/* VUE visual finish: existing forms, operator panel and photo review.
   Visibility continues to belong to the original .show classes / inline styles. */

.gate,
.xform,
.painel,
#rem_foto {
  color: var(--vue-ink);
  font-family: inherit;
  color-scheme: light;
}

.gate *,
.xform *,
.painel *,
#foto_zoom *,
#rem_foto * {
  box-sizing: border-box;
}

.gate button,
.xform button,
.painel button,
#foto_zoom button,
#rem_foto button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.xform.show, .painel.show { box-shadow: 0 0 0 100vmax rgb(16 29 49 / 40%); }

.gate button:focus-visible,
.xform button:focus-visible,
.painel button:focus-visible,
#foto_zoom button:focus-visible,
#rem_foto button:focus-visible {
  outline: 3px solid var(--vue-blue);
  outline-offset: 3px;
}

/* One alignment axis, restrained typography and a compact product wordmark. */
.gate {
  justify-content: flex-start;
  padding: calc(env(safe-area-inset-top) + 38px + var(--vue-notice-space)) 28px
    calc(env(safe-area-inset-bottom) + 28px);
  background: var(--vue-surface);
  text-align: left;
  overscroll-behavior: contain;
  scroll-padding-block: 24px;
  -webkit-overflow-scrolling: touch;
}

.gate > * {
  min-width: 0;
  flex-shrink: 0;
}

.gate .gate-brand,
.gate h2,
.gate p.sub,
.gate .field,
.gate .ok,
.gate .btn-primary,
.gate > .small {
  width: 100%;
  max-width: 400px;
}

.gate .gate-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  margin: 0 0 44px;
  color: var(--vue-ink);
}

.gate .gate-brand img {
  display: block;
  flex: 0 0 auto;
  width: 140px;
  height: auto;
  padding: 0;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  background: transparent;
}

.gate h2 {
  margin: 0 0 8px;
  color: var(--vue-ink);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.8px;
}

.gate p.sub {
  margin: 0 0 30px;
  color: var(--vue-muted);
  font-size: 14px;
  line-height: 1.55;
  opacity: 1;
}

.gate .field {
  margin-bottom: 22px;
}

.gate label,
.xform label {
  margin-bottom: 8px;
  color: var(--vue-ink);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
}

.gate input,
.xform input,
.xform select,
.xform textarea,
#rem_foto #rf_obs {
  min-height: 50px;
  min-width: 0;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--vue-line);
  border-radius: 12px;
  background: var(--vue-surface);
  color: var(--vue-ink);
  font-size: 16px;
  line-height: 1.45;
  font-family: inherit;
  box-shadow: none;
  scroll-margin-block: 24px;
}

.gate input::placeholder,
.xform input::placeholder,
.xform textarea::placeholder,
#rem_foto #rf_obs::placeholder {
  color: var(--vue-muted);
  opacity: .85;
}

.gate input:focus,
.xform input:focus,
.xform select:focus,
.xform textarea:focus,
#rem_foto #rf_obs:focus {
  border-color: var(--vue-blue);
  background: var(--vue-surface);
  outline: 2px solid var(--vue-blue);
  outline-offset: 2px;
  box-shadow: none;
}

.gate label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
}

.gate input {
  min-height: 54px;
  padding: 15px 16px;
  border-color: #dee3eb;
  border-radius: 12px;
  background: #fafbfc;
  font-size: 16px;
  line-height: 1.4;
}

.gate input::placeholder {
  color: var(--vue-muted);
  opacity: 1;
}

.gate input:focus {
  border-color: var(--vue-blue);
  background: var(--vue-surface);
  outline: 2px solid #245fe51a;
  outline-offset: 0;
}

.gate .ok {
  margin-top: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 8px;
  color: #244d94;
  background: var(--vue-soft);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.gate .btn-primary {
  min-height: 54px;
  margin-top: 8px;
  padding: 15px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--vue-blue);
  color: var(--vue-surface);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  box-shadow: none;
}

.gate .small {
  max-width: 400px;
  margin-top: 24px;
  color: var(--vue-muted);
  font-size: 12px;
  line-height: 1.5;
  opacity: 1;
}

/* Existing inline opacity and link color were intended for a dark surface. */
.gate .field .small {
  margin-top: 9px !important;
  font-size: 12px;
  line-height: 1.5;
  opacity: 1 !important;
}

.gate #g_skip {
  min-height: 44px;
  padding: 12px 16px;
  color: var(--vue-muted) !important;
  font-size: 13px !important;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none !important;
}

.gate > .small:last-child {
  margin-top: auto;
  padding-top: 28px;
  color: var(--vue-muted);
  font-size: 11px;
  text-align: center;
}

/* The body scrolls; the header and footer remain inside the form width.
   No viewport-fixed footer, including the pre-existing tablet breakpoints. */
.xform {
  width: 100%;
  max-width: 680px;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: var(--vue-notice-space) 0 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--vue-surface);
  box-shadow: none;
}

.xform .x-head {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  gap: 14px;
  padding: calc(env(safe-area-inset-top) + 18px) 20px 18px;
  border-bottom: 1px solid var(--vue-line);
  background: var(--vue-surface);
}

.xform .x-head img {
  width: 40px;
  height: 40px;
  padding: 0;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  filter: none;
}

.xform h3 {
  color: var(--vue-ink);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.3px;
  overflow-wrap: anywhere;
}

.xform .hint {
  margin-top: 5px;
  color: var(--vue-muted);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  text-shadow: none;
  opacity: 1;
}

.xform .x-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-padding-block: 20px;
  -webkit-overflow-scrolling: touch;
}

.xform .x-section {
  margin: 8px 0 16px;
  padding-top: 8px;
  color: var(--vue-ink);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
}

.xform .x-body > .x-section:first-child {
  margin-top: 0;
  padding-top: 0;
}

.xform .field {
  min-width: 0;
  margin-bottom: 20px;
}

.xform textarea {
  min-height: 96px;
  resize: vertical;
}

.xform select option {
  color: var(--vue-ink);
  background: var(--vue-surface);
}

.xform .tipos {
  gap: 10px;
}

.xform .tipos button {
  flex: 1 1 88px;
  min-width: 0;
  min-height: 50px;
  padding: 12px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--vue-muted);
  background: var(--vue-bg);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

.xform .tipos button.on {
  color: var(--vue-blue);
  border-color: transparent;
  background: var(--vue-soft);
  box-shadow: none;
}

.xform .row2 {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
  width: 100%;
  gap: 12px;
  padding: 16px 20px calc(env(safe-area-inset-bottom) + 16px);
  border-top: 1px solid var(--vue-line);
  background: var(--vue-surface);
}

.xform .row2 button {
  min-width: 0;
  min-height: 50px;
  padding: 13px 12px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0;
  white-space: normal;
}

.xform .row2 .btn-back {
  flex: 1 1 32%;
  color: var(--vue-ink);
  background: var(--vue-bg);
  border: 1px solid var(--vue-line);
}

.xform .row2 .btn-go {
  flex: 2 1 62%;
  color: var(--vue-surface);
  background: var(--vue-blue);
  box-shadow: none;
}

.xform button:disabled,
.gate .btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
}

/* These controls carry original inline colors; change contrast, not visibility. */
.xform #xf_photo_btn {
  min-height: 50px;
  justify-content: center;
  width: 100%;
  padding: 14px 16px !important;
  background: var(--vue-soft) !important;
  color: var(--vue-blue) !important;
  border-color: #aac2f3 !important;
  font-size: 15px !important;
  letter-spacing: 0 !important;
}

.xform #xf_photo_status {
  color: var(--vue-muted);
  font-size: 14px !important;
  line-height: 1.5;
  letter-spacing: 0 !important;
  opacity: 1 !important;
}

.xform #xf_photo_preview {
  max-width: min(100%, 280px) !important;
  max-height: 210px !important;
  border-color: var(--vue-line) !important;
  object-fit: contain;
  background: var(--vue-surface);
}

.xform #xf_cam_fim {
  width: 100%;
  min-height: 50px;
  color: #1f6d49 !important;
  font-size: 14px !important;
  line-height: 1.4;
}

/* Product selection and media retain their existing layout and actions. */
.xform .pf-lista {
  margin-top: 16px;
  max-height: 38vh;
  max-height: 38dvh;
  overscroll-behavior: contain;
  padding: 2px;
}

.xform .pf-item {
  min-height: 58px;
  padding: 16px 2px;
  margin-bottom: 0;
  border: 0;
  border-bottom: 1px solid var(--vue-line);
  border-radius: 0;
  background: var(--vue-surface);
  color: var(--vue-ink);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.xform .pf-item b {
  font-size: 14px;
  color: var(--vue-blue);
  opacity: 1;
}

.xform .pf-item small {
  font-size: 13px;
  color: var(--vue-muted);
  opacity: 1;
}

.xform .pf-sel {
  padding: 16px 90px 16px 16px;
  background: var(--vue-soft);
  border: 0;
  color: var(--vue-ink);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.xform .pf-sel b {
  color: var(--vue-blue);
  font-size: 15px;
}

.xform .pf-trocar {
  min-height: 44px;
  padding: 10px 12px;
  border-color: var(--vue-line);
  background: var(--vue-surface);
  color: var(--vue-blue);
  font-size: 14px;
}

.xform .pf-midias {
  gap: 10px;
  margin: 16px 0 20px;
}

.xform .pf-midias .pm {
  border-color: var(--vue-line);
  background: var(--vue-navy);
}

.xform .pf-midias .pm button {
  width: 32px;
  height: 32px;
  line-height: 32px;
  font-size: 20px;
  color: var(--vue-surface);
  background: rgb(16 29 49 / 90%);
}

.xform .pf-midias .pm .st {
  color: var(--vue-surface);
  background: rgb(16 29 49 / 92%);
  font-size: 12px;
  line-height: 1.4;
  padding: 3px 0;
}

.xform .pf-midias .pm .vd {
  color: var(--vue-surface);
}

.xform .pf-status,
.xform .small {
  color: var(--vue-muted);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Keep the meaning of the existing dynamically generated status colors. */
.xform [style*="color:#ffb4b4"] {
  color: #a92b31 !important;
}

.xform [style*="color:#fcd34d"] {
  color: #825a11 !important;
}

.xform [style*="color:#8ff0c4"] {
  color: #1f6d49 !important;
}

/* Operator panel: readable records with a scrolling list and in-panel close. */
.painel {
  width: 100%;
  max-width: 720px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px + var(--vue-notice-space)) 20px
    calc(env(safe-area-inset-bottom) + 16px);
  overflow: hidden;
  background: var(--vue-surface);
  box-shadow: none;
}

.painel h2 {
  flex: 0 0 auto;
  margin: 0 0 18px;
  color: var(--vue-ink);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -.35px;
}

.painel .abas {
  flex: 0 0 auto;
  gap: 8px;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--vue-bg);
}

.painel .abas button {
  min-width: 0;
  min-height: 48px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  color: var(--vue-muted);
  background: transparent;
  font-size: 14px;
  line-height: 1.35;
}

.painel .abas button.on {
  color: var(--vue-blue);
  background: var(--vue-soft);
  border-color: transparent;
}

.painel #pn_lista {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.painel .linha {
  padding: 18px 0;
  margin-bottom: 0;
  border: 0;
  border-bottom: 1px solid var(--vue-line);
  border-radius: 0;
  color: var(--vue-ink);
  background: var(--vue-surface);
}

.painel .linha .t {
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.painel .d,
.painel .linha .d {
  margin-top: 6px;
  color: var(--vue-muted);
  font-size: 14px;
  line-height: 1.55;
  opacity: 1;
  overflow-wrap: anywhere;
}

.painel .tag {
  padding: 0;
  margin-left: 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
  vertical-align: middle;
}

.painel .tag.ok {
  color: #226646;
  background: transparent;
}

.painel .tag.pend {
  color: #825a11;
  background: transparent;
}

.painel .tag.erp {
  color: #254d98;
  background: transparent;
}

.painel .vazio {
  padding: 40px 16px;
  color: var(--vue-muted);
  font-size: 15px;
  line-height: 1.6;
  opacity: 1;
}

.painel .fotos {
  gap: 10px;
  margin-top: 14px;
  padding: 2px 2px 6px;
}

.painel .fotos img {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  border-color: var(--vue-line);
  background: var(--vue-bg);
}

.painel .fotos .mais {
  color: var(--vue-muted);
  font-size: 13px;
  opacity: 1;
}

.painel .chipfotos {
  min-height: 44px;
  padding: 11px 14px;
  color: var(--vue-blue);
  border-color: var(--vue-line);
  background: var(--vue-soft);
  font-size: 14px;
}

.painel .fechar {
  flex: 0 0 auto;
  min-height: 50px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--vue-line);
  border-radius: 12px;
  color: var(--vue-ink);
  background: var(--vue-surface);
  font-size: 15px;
  font-weight: 600;
}

/* Neutral, dark photo canvas; no change to the original 250% zoom behavior. */
#foto_zoom {
  padding-top: var(--vue-notice-space);
  height: 100%;
  height: 100dvh;
  background: var(--vue-navy);
}

#foto_zoom.show {
  display: flex;
  flex-direction: column;
}

#foto_zoom .fz_pane {
  position: relative;
  inset: auto;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overscroll-behavior: contain;
}

#foto_zoom .fz_cont {
  top: calc(env(safe-area-inset-top) + 12px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 7px 12px;
  border-radius: 8px;
  background: rgb(16 29 49 / 88%);
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  text-shadow: none;
}

#foto_zoom .fz_cont:empty {
  padding: 0;
}

#foto_zoom .fz_bar {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  background: var(--vue-surface);
  border-top: 1px solid var(--vue-line);
}

#foto_zoom .fz_bar button {
  min-width: 0;
  min-height: 48px;
  padding: 10px 4px;
  border: 1px solid var(--vue-line);
  border-radius: 10px;
  color: var(--vue-ink);
  background: var(--vue-bg);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

#foto_zoom #fz_lupa,
#foto_zoom #fz_rem {
  grid-column: span 2;
}

#foto_zoom #fz_rem {
  color: #a92b31;
  background: #fff1f1;
  border-color: #f0caca;
}

#foto_zoom .fz_bar button.fz_fechar {
  grid-column: 1 / -1;
  color: var(--vue-surface);
  background: var(--vue-blue);
  border-color: var(--vue-blue);
}

/* Destructive action stays explicit and distinct from ordinary blue selection. */
#rem_foto {
  padding: max(16px, env(safe-area-inset-top)) 16px
    max(16px, env(safe-area-inset-bottom));
  background: rgb(16 29 49 / 75%);
}

#rem_foto .rf_box {
  max-width: 440px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  padding: 20px;
  border-radius: 18px;
  background: var(--vue-surface);
  color: var(--vue-ink);
  box-shadow: 0 20px 60px rgb(0 0 0 / 25%);
  overscroll-behavior: contain;
}

#rem_foto .rf_tit {
  margin-bottom: 10px;
  color: var(--vue-ink);
  font-size: 21px;
  line-height: 1.3;
}

#rem_foto .rf_sub {
  margin-bottom: 20px;
  color: var(--vue-muted);
  font-size: 14px;
  line-height: 1.55;
}

#rem_foto .rf_ops {
  gap: 10px;
}

#rem_foto .rf_ops button {
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid var(--vue-line);
  border-radius: 12px;
  color: var(--vue-ink);
  background: var(--vue-surface);
  font-size: 15px;
  line-height: 1.4;
}

#rem_foto .rf_ops button.on {
  border-color: transparent;
  color: var(--vue-blue);
  background: var(--vue-soft);
  box-shadow: none;
}

#rem_foto #rf_obs {
  margin-top: 16px;
}

#rem_foto .rf_bar {
  gap: 12px;
  margin-top: 20px;
}

#rem_foto .rf_bar button {
  min-width: 0;
  min-height: 50px;
  padding: 13px 10px;
  border: 1px solid var(--vue-line);
  border-radius: 12px;
  color: var(--vue-ink);
  background: var(--vue-bg);
  font-size: 15px;
  font-weight: 600;
}

#rem_foto .rf_bar .rf_ok {
  background: #b53138;
  border-color: #b53138;
  color: #fff;
}

#rem_foto .rf_bar .rf_ok:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (min-width: 768px) {
  .gate {
    padding-top: calc(env(safe-area-inset-top) + 60px + var(--vue-notice-space));
  }

  .xform,
  .painel {
    border-inline: 1px solid var(--vue-line);
  }

  .xform .x-head,
  .xform .x-body,
  .xform .row2 {
    padding-left: 28px;
    padding-right: 28px;
  }

  #foto_zoom .fz_bar {
    grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr) 48px minmax(0, 1fr);
    padding-left: max(20px, calc((100vw - 720px) / 2));
    padding-right: max(20px, calc((100vw - 720px) / 2));
  }

  #foto_zoom #fz_lupa,
  #foto_zoom #fz_rem,
  #foto_zoom .fz_bar button.fz_fechar {
    grid-column: auto;
  }
}

@media (max-width: 359px) {
  .gate {
    padding-left: 20px;
    padding-right: 20px;
  }

  .xform .x-head,
  .xform .x-body,
  .xform .row2,
  .painel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .xform .tipos {
    gap: 8px;
  }

  .xform .tipos button {
    flex-basis: 80px;
  }

  .xform .row2 {
    gap: 8px;
  }

  .painel .linha {
    padding: 16px 0;
  }
}

@media (max-height: 620px) {
  .gate .gate-brand {
    margin-top: 0;
    margin-bottom: 24px;
  }

  .gate {
    padding-top: calc(env(safe-area-inset-top) + 24px + var(--vue-notice-space));
  }

  .gate p.sub {
    margin-bottom: 24px;
  }

  .gate .field {
    margin-bottom: 18px;
  }

  .xform .x-head {
    padding-top: calc(env(safe-area-inset-top) + 12px);
    padding-bottom: 12px;
  }

  .xform .row2 {
    padding-top: 12px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .xform input,
  .xform select,
  .xform textarea,
  .xform .tipos button {
    transition: none;
  }
}
