/* Cotação Inteligente — estilos. Mobile first (390 px), uma mão, botões grandes. */

:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-2: #f7f8f6;
  --text: #15202b;
  --muted: #55606b;
  --border: #dde1e4;
  --border-strong: #c9cfd4;
  --primary: #0a4d7a;
  --primary-dark: #073656;
  --primary-soft: #e3eef6;
  --primary-ring: #dce8f1;
  --success: #1b6e3f;
  --success-soft: #e4f2e9;
  --success-text: #14532d;
  --warn: #e2a54d;
  --warn-soft: #fdf1de;
  --warn-text: #8a4b00;
  --danger: #c2410c;
  --danger-soft: #fdebe3;
  --dark-bg: #0a2a40;
  --dark-text: #ffffff;
  --dark-muted: #9fc3dd;
  --radius: 16px;
  --radius-sm: 12px;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1419;
    --surface: #1a2129;
    --surface-2: #202934;
    --text: #eef2f5;
    --muted: #9aa7b3;
    --border: #2b3640;
    --border-strong: #3a4753;
    --primary: #4ea3dc;
    --primary-dark: #7dbde8;
    --primary-soft: #16344a;
    --primary-ring: #16344a;
    --success: #4fbf7f;
    --success-soft: #16351f;
    --success-text: #b6f0c9;
    --warn: #e2a54d;
    --warn-soft: #3a2a10;
    --warn-text: #ffd9a3;
    --danger: #ff8a5b;
    --danger-soft: #3d1f12;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f1419;
  --surface: #1a2129;
  --surface-2: #202934;
  --text: #eef2f5;
  --muted: #9aa7b3;
  --border: #2b3640;
  --border-strong: #3a4753;
  --primary: #4ea3dc;
  --primary-dark: #7dbde8;
  --primary-soft: #16344a;
  --primary-ring: #16344a;
  --success: #4fbf7f;
  --success-soft: #16351f;
  --success-text: #b6f0c9;
  --warn: #e2a54d;
  --warn-soft: #3a2a10;
  --warn-text: #ffd9a3;
  --danger: #ff8a5b;
  --danger-soft: #3d1f12;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body.has-sheet {
  overflow: hidden;
}
a {
  color: var(--primary);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
}
details summary {
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Estrutura ---------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}
@media (min-width: 560px) {
  body {
    background: #e6e9eb;
  }
  @media (prefers-color-scheme: dark) {
    body:not([data-theme='light']) {
      background: #070a0d;
    }
  }
  #app {
    box-shadow: 0 0 0 1px var(--border), 0 20px 60px rgba(0, 0, 0, 0.12);
    background: var(--bg);
  }
}
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
}
.screen--flow {
  padding-bottom: 0;
}
.screen--dark {
  background: var(--dark-bg);
  color: var(--dark-text);
  padding-bottom: 0;
}
.screen--dark a {
  color: var(--dark-text);
}

/* Cabeçalhos */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar--dark {
  background: transparent;
  border: 0;
  position: static;
}
.topbar__titles {
  flex: 1;
  min-width: 0;
}
.topbar__title {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__subtitle {
  font-size: 12px;
  color: var(--muted);
}
.topbar--dark .topbar__subtitle {
  color: var(--dark-muted);
}
.topbar__spacer {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}
.page-head {
  padding: 20px 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.page-body,
.flow__body {
  flex: 1;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.flow__footer {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(16px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 4;
}
.flow__footer--row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

/* ---------- Utilidades ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.row.between {
  justify-content: space-between;
}
.row.center {
  align-items: center;
}
.row.start {
  align-items: flex-start;
}
.row.end {
  justify-content: flex-end;
}
.row.baseline {
  align-items: baseline;
}
.row.wrap {
  flex-wrap: wrap;
}
.col {
  display: flex;
  flex-direction: column;
}
.gap-2 {
  gap: 2px;
}
.gap-4 {
  gap: 4px;
}
.gap-6 {
  gap: 6px;
}
.gap-8 {
  gap: 8px;
}
.gap-10 {
  gap: 10px;
}
.gap-12 {
  gap: 12px;
}
.flex-1 {
  flex: 1;
  min-width: 0;
}
.w-full {
  width: 100%;
}
.pad {
  padding: 16px;
}
.pad-x-4 {
  padding: 0 4px;
}
.pad-x-16 {
  padding: 0 16px;
}
.muted {
  color: var(--muted);
}
.muted-light {
  color: var(--dark-muted);
}
.small {
  font-size: 13px;
}
.big {
  font-size: 30px;
  font-weight: 800;
}
.huge {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.semibold {
  font-weight: 600;
}
.block {
  display: block;
}
.right {
  text-align: right;
}
.center-text {
  text-align: center;
}
.text-success {
  color: var(--success);
}
.text-warn {
  color: var(--warn-text);
}
.text-danger {
  color: var(--danger);
}
.text-strong {
  color: var(--text);
}
.label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
}
.link {
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}
.scroll-y {
  overflow-y: auto;
}
.dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 5px;
  background: var(--danger);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.05s ease, background 0.15s ease;
  text-align: center;
}
.btn:active {
  transform: scale(0.98);
}
.btn[disabled],
.btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.btn--lg {
  min-height: 56px;
  font-size: 17px;
  border-radius: 16px;
}
.btn--sm {
  min-height: 40px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 12px;
}
.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--primary-dark);
}
.btn--success {
  background: var(--success);
  color: #fff;
}
.btn--success.is-armed {
  background: #c2410c;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 6px rgba(194, 65, 12, 0.25);
  }
}
.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--outline {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--primary);
}
.btn--ghost {
  background: transparent;
  color: var(--primary);
}
.btn--ghost-light {
  background: transparent;
  color: var(--dark-text);
  border-color: #3d6584;
}
.btn--dashed {
  border: 1px dashed var(--border-strong);
  color: var(--primary);
  background: transparent;
  font-weight: 600;
}
.btn--pill {
  border-radius: 24px;
  min-height: 48px;
}
.iconbtn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  color: inherit;
  text-decoration: none;
  position: relative;
  flex: 0 0 auto;
}
.iconbtn--round {
  background: var(--surface);
  border: 1px solid var(--border);
}
.iconbtn--primary {
  background: var(--primary);
  color: #fff;
}
.iconbtn.is-listening {
  background: var(--danger);
  color: #fff;
}

/* Microfone */
.micbtn {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 14px var(--primary-ring), 0 0 0 28px color-mix(in srgb, var(--primary-ring) 55%, transparent);
  text-decoration: none;
  transition: transform 0.1s ease;
}
.micbtn:active {
  transform: scale(0.96);
}
.micbtn--light {
  width: 96px;
  height: 96px;
  background: #fff;
  color: var(--dark-bg);
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.14);
}
.micbtn--light.is-listening {
  background: #fff;
  color: var(--danger);
  animation: ring 1.4s ease-out infinite;
}
@keyframes ring {
  0% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.18);
  }
  100% {
    box-shadow: 0 0 0 26px rgba(255, 255, 255, 0);
  }
}
.micbtn--sm {
  width: 56px;
  height: 56px;
  box-shadow: none;
  flex: 0 0 auto;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
}
.chips--scroll::-webkit-scrollbar {
  display: none;
}
.chip {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.chip.is-selected {
  border: 2px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}
.chip--outline {
  border-style: dashed;
  color: var(--primary);
}
.chip--muted {
  color: var(--muted);
  border-color: var(--border);
  background: var(--surface-2);
}
.chip--block {
  justify-content: center;
  padding: 0 4px;
  border-radius: 12px;
  font-size: 15px;
}
.chip--block.is-selected {
  background: var(--primary);
  color: #fff;
}
.chip--check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  margin: 0;
}

/* Segmentado */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  background: var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.seg--tabs {
  margin: 12px 16px 0;
}
.seg__btn {
  min-height: 40px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg__btn.is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* ---------- Cartões ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card--link {
  text-decoration: none;
  color: inherit;
}
.card--link:active {
  background: var(--surface-2);
}
.card--compact {
  padding: 12px 16px;
  gap: 4px;
}
.card--muted {
  background: var(--surface-2);
  border-style: dashed;
}
.card--list {
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.card--rec {
  border: 2px solid var(--success);
}
.card--table {
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.card__title {
  font-size: 15px;
  font-weight: 700;
}
.line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  min-height: 52px;
}
.line:first-child {
  border-top: 0;
}
.line--col {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.line--total {
  font-weight: 700;
  background: var(--surface-2);
}
.line--link {
  text-decoration: none;
  color: inherit;
}
.line--link:active {
  background: var(--surface-2);
}
.trow {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.7fr;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  align-items: center;
}
.trow:first-child {
  border-top: 0;
}
.trow--head {
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat--success {
  background: var(--success-soft);
  border-color: transparent;
}
.stat--success .stat__n,
.stat--success .stat__l {
  color: var(--success-text);
}
.stat__n {
  font-size: 26px;
  font-weight: 800;
}
.stat__n--sm {
  font-size: 18px;
}
.stat__l {
  font-size: 13px;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.badge--success {
  background: var(--success-soft);
  color: var(--success-text);
}
.badge--warn {
  background: var(--warn-soft);
  color: var(--warn-text);
}
.badge--neutral {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.4s ease;
}
.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.45;
}
.note svg {
  flex: 0 0 auto;
  margin-top: 1px;
}
.note--info {
  background: var(--primary-soft);
  color: var(--text);
}
.note--warn {
  background: var(--warn-soft);
  color: var(--warn-text);
}
.note--warn a {
  color: inherit;
}
.note--danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.note--ai {
  flex-direction: column;
  background: var(--surface);
  border: 1px dashed var(--primary);
  color: var(--text);
  gap: 10px;
}
.empty {
  text-align: center;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.empty__title {
  font-weight: 700;
  color: var(--text);
  font-size: 16px;
}
.transcript {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--muted);
}
.transcript summary {
  font-weight: 600;
  color: var(--primary);
}
.transcript p {
  margin: 8px 0 0;
}
.transcript pre {
  margin-top: 8px;
  color: var(--text);
}

/* ---------- Início ---------- */
.home__top {
  padding: 20px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.home__brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.home__mic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 20px 26px;
  text-align: center;
}
.home__mic-title {
  margin-top: 22px;
  font-size: 20px;
  font-weight: 700;
}
.home__mic-hint {
  font-size: 14px;
  color: var(--muted);
  max-width: 300px;
  line-height: 1.45;
}
.home__list {
  flex: 1;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Menu inferior ---------- */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  z-index: 6;
}
.bottomnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.bottomnav__item.is-active {
  color: var(--primary);
  font-weight: 700;
}

/* ---------- Tela de voz ---------- */
.listen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 0;
  gap: 22px;
}
.listen__status {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.bars {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 64px;
}
.bars span {
  width: 6px;
  height: 14px;
  border-radius: 3px;
  background: #6fa8d0;
  transition: height 0.2s ease;
}
.bars.is-active span {
  animation: bar 1s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.09s);
  background: #fff;
}
@keyframes bar {
  0%,
  100% {
    height: 14px;
  }
  50% {
    height: 60px;
  }
}
.listen__live {
  font-size: 22px;
  line-height: 1.45;
  font-weight: 500;
  text-align: center;
  min-height: 64px;
  width: 100%;
}
.listen__live.is-placeholder {
  color: var(--dark-muted);
  font-size: 15px;
  font-weight: 400;
}
.listen__edit {
  width: 100%;
}
.listen__edit textarea,
.screen--dark textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #3d6584;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 12px 14px;
  font-size: 17px;
  line-height: 1.45;
  resize: vertical;
}
.screen--dark textarea::placeholder {
  color: #7fa6c2;
}
.listen__examples {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.example {
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid #3d6584;
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
}
.listen__footer {
  padding: 16px 20px calc(28px + var(--safe-b));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.listen__hint {
  font-size: 14px;
  font-weight: 600;
}
.listen__error {
  width: 100%;
}
.listen__error[hidden] {
  display: none;
}

/* ---------- Itens ---------- */
.item {
  gap: 12px;
}
.item--pending {
  border: 1.5px solid var(--warn);
}
.item__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.item__status {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 15px;
  background: var(--success-soft);
  color: var(--success);
}
.item--pending .item__status {
  background: var(--warn-soft);
  color: var(--warn-text);
}
.item__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.item__name {
  font-size: 16px;
  font-weight: 700;
}
.item__spec {
  font-size: 14px;
  color: var(--text);
}
.item__qty {
  font-size: 14px;
  color: var(--muted);
}
.item__tools {
  display: flex;
  margin: -8px -10px 0 0;
  color: var(--muted);
}
.question {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.question__text {
  font-size: 14px;
  color: var(--warn-text);
  font-weight: 600;
}

/* ---------- Fornecedores (seleção) ---------- */
.srow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  min-height: 60px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.srow:first-child {
  border-top: 0;
}
.srow input {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}
.srow--disabled {
  opacity: 0.6;
}
.srow__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.srow__name {
  font-size: 15px;
  font-weight: 600;
}
.srow__ch {
  flex: 0 0 auto;
  font-weight: 600;
}

/* ---------- Confirmação ---------- */
.message {
  font-size: 14px;
  line-height: 1.5;
}
.message__text {
  white-space: pre-wrap;
  word-break: break-word;
}
.message-edit {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  padding: 12px;
  font-size: 14px;
  line-height: 1.5;
  background: var(--surface);
  color: var(--text);
}

/* ---------- Acompanhamento ---------- */
.prow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-height: 58px;
  border-top: 1px solid var(--border);
  width: 100%;
  text-align: left;
  color: inherit;
}
.prow:first-child {
  border-top: 0;
}
.prow:active {
  background: var(--surface-2);
}
.prow__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.prow__name {
  font-size: 15px;
  font-weight: 600;
}
.prow__total {
  font-size: 15px;
  font-weight: 700;
  flex: 0 0 auto;
}
.answer {
  background: var(--primary-soft);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.answer__text {
  font-size: 16px;
  line-height: 1.45;
}

/* ---------- Histórico ---------- */
.chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  height: 150px;
}
.chart__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}
.chart__val {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.chart__val.is-last {
  color: var(--primary);
  font-weight: 700;
}
.chart__val.is-min {
  color: var(--success);
  font-weight: 700;
}
.chart__bar {
  width: 100%;
  max-width: 44px;
  border-radius: 6px 6px 0 0;
  background: #b9d3e6;
  min-height: 6px;
}
.chart__bar.is-last {
  background: var(--primary);
}
.chart__lbl {
  font-size: 11px;
  color: var(--muted);
}
.searchbar {
  height: 48px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: var(--muted);
}
.searchbar input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  outline: none;
  min-width: 0;
}

/* ---------- Formulários ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field input,
.field select,
.field textarea,
.sheet input[type='text'],
.sheet input[type='number'],
.sheet input[type='search'],
.sheet input:not([type]) {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  font-size: 16px;
}
.field textarea,
.sheet textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  font-size: 16px;
  resize: vertical;
}
fieldset.field {
  border: 0;
  padding: 0;
  margin: 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
}
.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}
.check--important {
  font-weight: 600;
}
.file-btn {
  cursor: pointer;
}

/* ---------- Folha inferior ---------- */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}
#overlay.is-open {
  display: block;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 30, 0.45);
}
.sheet {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(20px + var(--safe-b));
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
  animation: slideup 0.2s ease-out;
}
@keyframes slideup {
  from {
    transform: translate(-50%, 30px);
    opacity: 0;
  }
}
.sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  margin: 4px auto 10px;
}
.sheet__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}
.sheet__text {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
}
.sheet__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Avisos ---------- */
#toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 16px + var(--safe-b));
  width: calc(100% - 32px);
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s ease;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}
.toast.is-visible {
  opacity: 1;
  transform: none;
}
.toast--success {
  background: var(--success);
  color: #fff;
}
.toast--warn {
  background: var(--warn-text);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Login ---------- */
.login {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px 48px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}
.login__logo {
  width: 88px;
  height: 88px;
  border-radius: 44px;
  background: #fff;
  color: var(--dark-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.12);
  margin-bottom: 8px;
}
.login__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}
.login__sub {
  margin: 0 0 8px;
  color: var(--dark-muted);
  text-align: center;
}
.login .field input {
  background: rgba(255, 255, 255, 0.08);
  border-color: #3d6584;
  color: #fff;
}
.login .field__label {
  color: var(--dark-muted);
}
