/* ============================================================
   CADERNIM — UI v3 (handoff de design aplicado)
   Tokens, tipografia e componentes conforme design_handoff_cadernim.
   Temas: claro (padrão) e escuro ("a cave") via [data-theme="dark"].
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #F7F6F3;
  --surf: #FFFFFF;
  --surf2: #F1EFEA;
  --line: #E6E3DC;
  --ink: #1C1A15;
  --soft: #716E64;
  --amber: #C2801F;
  --amberD: #99650F;
  --btnInk: #FFFDF6;
  --cream: #F7F3EA;
  --green: #43604B;
  --brown: #4A3520;
  --clay: #B4691E;
  --ok: #2E8B57;
  --warn: #D9A514;
  --warnT: #8A6A08;
  --err: #D24D43;
  --info: #4A72B8;
  --cave: #3E3556;
  --gold: #E2A742;

  --shSm: 0 1px 2px rgba(28,26,21,.05);
  --shMd: 0 2px 6px rgba(28,26,21,.06), 0 10px 24px rgba(28,26,21,.05);
  --shLg: 0 24px 60px rgba(28,26,21,.22);

  /* aliases de compatibilidade com o app */
  --surface: var(--surf);
  --surface-alt: var(--surf2);
  --border: var(--line);
  --border-strong: #D8D4CA;
  --text: var(--ink);
  --text-soft: var(--soft);
  --text-faint: #9B978B;
  --primary: var(--amber);
  --primary-dark: var(--amberD);
  --primary-soft: rgba(194,128,31,.12);
  --primary-grad: linear-gradient(135deg, #E2A742, #C2801F);
  --success: var(--ok);
  --warning: var(--warn);
  --danger: var(--err);
  --error: var(--err);
  --shadow-sm: var(--shSm);
  --shadow-md: var(--shMd);
  --shadow-lg: var(--shLg);
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-w: 236px;

  /* planos */
  --tier-free: #6FA07C;
  --tier-starter: #D9A84E;
  --tier-pro: #B4691E;
  --tier-premium: #3E3556;
  --tier-premium-accent: #E2A742;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #131210;
  --surf: #1C1A17;
  --surf2: #262420;
  --line: #33302A;
  --ink: #EDEBE4;
  --soft: #A29E92;
  --amber: #E2A742;
  --amberD: #EDBB5E;
  --btnInk: #241804;
  --cream: #211E18;
  --brown: #E9DDC6;
  --ok: #4FB37A;
  --warn: #E0B234;
  --warnT: #E0B234;
  --err: #E2695F;
  --info: #7D9FD4;
  --cave: #4A4168;

  --shSm: 0 1px 2px rgba(0,0,0,.35);
  --shMd: 0 2px 6px rgba(0,0,0,.4), 0 10px 24px rgba(0,0,0,.3);
  --shLg: 0 24px 60px rgba(0,0,0,.6);

  --border-strong: #45413A;
  --text-faint: #7A766B;
  --primary-soft: rgba(226,167,66,.15);
  --primary-grad: linear-gradient(135deg, #E2A742, #C2801F);

  --tier-free: #7FB58C;
  --tier-starter: #E3B65E;
  --tier-pro: #D08A3E;
  --tier-premium: #4A4168;

  color-scheme: dark;
}

/* ---------- Reset / Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 13.7px;
  line-height: 1.55;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100dvh; }

::selection { background: rgba(194,128,31,.2); }

h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; margin-bottom: 1rem; }
h3 { font-size: 14px; font-weight: 700; margin-bottom: .75rem; }
h4 { font-weight: 650; letter-spacing: -.005em; }
small { color: var(--soft); }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amberD); }

/* números sempre tabulares */
table, .stat-value, .pc-preco, .chart, .kv, td, .sic-row3 { font-variant-numeric: tabular-nums; }

*:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes growup { from { transform: scaleY(0); } to { transform: scaleY(1); } }

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

/* ---------- App shell ---------- */
.app { display: flex; height: 100dvh; overflow: hidden; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surf);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  z-index: 60;
}

.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px 12px;
}
.brand-logo {
  width: 38px; height: 38px; flex-shrink: 0;
  background: linear-gradient(135deg, #E2A742, #C2801F);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shSm);
}
.brand-logo svg { width: 24px; height: 24px; }
.brand-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px; font-weight: 650;
  letter-spacing: -.01em;
  
  line-height: 1.1;
}
.brand-tag { font-size: 11px; color: var(--soft); }

.side-nav {
  flex: 1;
  padding: 4px 10px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.tab {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: none; border: none; cursor: pointer;
  padding: 9px 12px;
  font-size: 13.7px; font-weight: 500;
  font-family: inherit;
  color: var(--ink);
  border-radius: 10px;
  transition: background .12s ease, color .12s ease;
  text-align: left;
}
.tab svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.9; }
.tab:hover { background: var(--surf2); }
.tab.active { background: var(--cream); color: var(--amber); font-weight: 700; }
.tab.locked { opacity: .55; }
.tab .lock-ico { margin-left: auto; display: inline-flex; }
.tab .lock-ico svg { width: 13px; height: 13px; }
.nav-count {
  margin-left: auto;
  background: var(--err);
  color: #fff;
  font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.tab .lock-ico + .nav-count, .nav-count + .lock-ico { margin-left: 6px; }

/* Cartão do plano na sidebar */
.side-plan {
  margin: 0 10px 8px;
  padding: 11px 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .12s ease;
}
.side-plan:hover { border-color: var(--amber); }
.sp-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 6px; }
.sp-link { font-size: 11px; color: var(--amber); font-weight: 700; white-space: nowrap; }
.sp-label { font-size: 11px; color: var(--soft); margin-top: 6px; }

.usage-bar {
  width: 100%; height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 70%, transparent);
  overflow: hidden;
}
.usage-bar > i {
  display: block; height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #E2A742, #C2801F);
  transition: width .3s ease;
}
.usage-bar.warn > i { background: var(--warn); }
.usage-bar.full > i { background: var(--err); }

.side-foot {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--soft);
}
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #E2A742, #C2801F);
  color: #241804;
  font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}
.user-info { min-width: 0; flex: 1; }
.user-name { font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mail { font-size: 11px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .icon-btn { width: 28px; height: 28px; flex-shrink: 0; }

/* ---------- Topbar ---------- */
.topbar {
  height: 58px; flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  z-index: 50;
}
.tb-title { display: flex; flex-direction: column; line-height: 1.3; }
.tb-title h1 { font-size: 17px; }
.tb-title small { font-size: 11.5px; }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  color: var(--soft);
  transition: all .12s ease;
}
.icon-btn:hover { color: var(--ink); border-color: var(--border-strong); }
.icon-btn svg { width: 16px; height: 16px; stroke-width: 1.9; }

#menuBtn { display: none; }

/* Pill de sincronização */
#syncStatus {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .02em;
}
#syncStatus.success { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
#syncStatus.warning { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warnT); }
#syncStatus.info    { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
#syncStatus.muted   { background: var(--surf2); color: var(--soft); }

/* ---------- Views ---------- */
main#app {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}
.view { display: none; max-width: 1180px; margin: 0 auto; }
.view.active { display: block; animation: fadeUp .25s ease; }
#view-assistente.active { max-width: 860px; }
#view-config.active { max-width: 900px; }

.view-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 14px;
}
.view-desc { color: var(--soft); font-size: 13px; }

/* ---------- KPI cards ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpi-card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shSm);
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}
.kpi-card:hover { box-shadow: var(--shMd); transform: translateY(-1px); }
.kpi-label {
  display: flex; align-items: center; gap: 6px;
  color: var(--soft);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
.kpi-label svg { width: 13px; height: 13px; stroke-width: 1.9; flex-shrink: 0; }
.stat-label {
  color: var(--soft);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
.stat-value {
  font-size: 25px; font-weight: 800;
  letter-spacing: -.02em;
  margin-top: 4px;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#dashSales30 { color: var(--ok); }

/* Cards do fluxo */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.card.stat {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shSm);
}

/* ---------- Panels ---------- */
.panel {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shSm);
}
.grid-2 {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  margin-bottom: 14px;
}
.critical-panel {
  border-left: 3px solid var(--err);
  background: color-mix(in srgb, var(--err) 6%, var(--surf));
}
.critical-panel h3 { color: var(--err); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surf);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  transition: all .13s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--amber); color: var(--amber); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--amber);
  color: var(--btnInk);
  border-color: transparent;
  font-weight: 700;
}
.btn.primary:hover { background: var(--amberD); color: var(--btnInk); }
.btn.danger { background: var(--err); color: #fff; border-color: transparent; }
.btn.danger:hover { filter: brightness(1.08); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 11.5px; border-radius: 8px; }
.btn.link { background: none; border: none; box-shadow: none; color: var(--amber); padding: 0; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- Forms / Filters ---------- */
input, select, textarea {
  font-family: inherit; font-size: 13.7px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surf);
  color: var(--ink);
  outline: none;
  transition: border-color .13s ease, box-shadow .13s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(194,128,31,.15);
}
input::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 64px; }

.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px;
}
.filters label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--soft); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--soft); }

.form-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: 12px; color: var(--soft); font-weight: 600; }
.form-field.full, .form-grid .full { grid-column: 1 / -1; }

/* ---------- Tables ---------- */
.table-wrap {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  box-shadow: var(--shSm);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  background: var(--surf2);
  font-weight: 600; color: var(--soft);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  position: sticky; top: 0;
  white-space: nowrap;
}
tbody tr { transition: background .1s ease; }
tbody tr:hover { background: var(--surf2); }
tbody tr:last-child td { border-bottom: none; }
td.actions { white-space: nowrap; text-align: right; }

.empty { padding: 36px 16px; text-align: center; color: var(--soft); font-size: 13.5px; font-style: italic; }

/* Empty state ilustrado ("traço de caderno") */
.empty-ilu {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 30px 16px;
  text-align: center;
}
.empty-ilu svg { width: 150px; height: auto; opacity: .9; }
.empty-ilu span {
  color: var(--soft); font-size: 13.5px; font-style: italic;
  max-width: 380px; line-height: 1.6;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge.success { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge.warning { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warnT); }
.badge.danger  { background: color-mix(in srgb, var(--err) 15%, transparent); color: var(--err); }
.badge.info    { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
.badge.muted   { background: var(--surf2); color: var(--soft); }

/* Badges de maturação (campo) */
.badge.fresco    { background: rgba(111,160,124,.18); color: #3F7A52; }
.badge.meia-cura, .badge.meia { background: rgba(217,165,20,.18); color: #9A7407; }
.badge.maturado  { background: rgba(180,105,30,.18); color: var(--clay); }
.badge.curado    { background: rgba(180,105,30,.18); color: var(--clay); }
.badge.capa-preta { background: rgba(74,53,32,.25); color: #8B6A45; }
[data-theme="dark"] .badge.fresco { color: #7FB58C; }
[data-theme="dark"] .badge.meia-cura, [data-theme="dark"] .badge.meia { color: #E0B234; }
[data-theme="dark"] .badge.capa-preta { color: #C9A87C; }

/* Estágios por idade (README: <21 · 21–59 · 60–119 · ≥120) */
.badge.est-fresco { background: rgba(111,160,124,.18); color: #3F7A52; }
.badge.est-meia   { background: rgba(217,165,20,.18); color: #9A7407; }
.badge.est-curado { background: rgba(180,105,30,.18); color: var(--clay); }
.badge.est-capa   { background: rgba(74,53,32,.25); color: #8B6A45; }
[data-theme="dark"] .badge.est-fresco { color: #7FB58C; }
[data-theme="dark"] .badge.est-meia   { color: #E0B234; }
[data-theme="dark"] .badge.est-curado { color: #D08A3E; }
[data-theme="dark"] .badge.est-capa   { color: #C9A87C; }

/* aliases legados de idade */
.badge.idade-verde    { background: rgba(111,160,124,.18); color: #3F7A52; }
.badge.idade-amarela  { background: rgba(217,165,20,.18); color: #9A7407; }
.badge.idade-laranja  { background: rgba(180,105,30,.18); color: var(--clay); }
.badge.idade-marrom   { background: rgba(74,53,32,.25); color: #8B6A45; }
.badge.idade-vermelha { background: color-mix(in srgb, var(--err) 15%, transparent); color: var(--err); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surf2);
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 13px;
}
.list-item .li-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list-item .li-title { font-weight: 700; }
.list-item .li-sub { color: var(--soft); font-size: 12px; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  background: var(--primary-soft);
  color: var(--amber);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.chip button {
  background: none; border: none; cursor: pointer;
  color: var(--amber); font-weight: 700; font-size: 13px; line-height: 1;
  opacity: .65; transition: opacity .1s;
}
.chip button:hover { opacity: 1; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(28,26,21,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 60; padding: 14px;
}
.modal {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 18px;
  width: 100%; max-width: 720px;
  max-height: 90dvh;
  display: flex; flex-direction: column;
  box-shadow: var(--shLg);
  animation: pop .2s ease;
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h3, #modalTitle {
  font-family: "Fraunces", Georgia, serif;
  font-size: 20px; font-weight: 650;
  margin: 0;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text-faint);
  transition: color .1s;
}
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--surf2);
  border-radius: 0 0 18px 18px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: var(--shLg);
  z-index: 90;
  font-size: 12.5px;
  font-weight: 600;
  animation: pop .2s ease;
  max-width: min(420px, calc(100vw - 2rem));
  text-align: center;
}
.toast.success { background: var(--ok); color: #fff; }
.toast.error   { background: var(--err); color: #fff; }
.toast.warning { background: var(--warn); color: #3A2C00; }

/* ---------- Charts ---------- */
.chart {
  display: flex; align-items: flex-end; gap: 10px;
  height: 150px;
  padding-top: 8px;
}
.chart-col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 5px;
  height: 100%;
  cursor: default;
}
.chart-bar {
  width: 100%;
  max-width: 44px;
  background: linear-gradient(180deg, #E2A742, #C2801F);
  border-radius: 6px 6px 3px 3px;
  min-height: 3px;
  transform-origin: bottom;
  animation: growup .5s ease;
  transition: filter .12s ease;
}
.chart-col:hover .chart-bar { filter: brightness(1.12); }
.chart-duo {
  display: flex; align-items: flex-end; gap: 3px;
  width: 100%; max-width: 52px;
  height: calc(100% - 20px);
  justify-content: center;
}
.chart-duo .chart-bar { max-width: 20px; }
.chart-bar.in  { background: var(--ok); }
.chart-bar.out { background: var(--err); }
.chart-label { font-size: 10.5px; color: var(--soft); white-space: nowrap; }
.chart-legend { display: flex; gap: 14px; margin-top: 8px; font-size: 11.5px; color: var(--soft); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend .lg-in  { background: var(--ok); }
.chart-legend .lg-out { background: var(--err); }

/* ---------- Lote (ficha) ---------- */
.lote-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.lote-tipo { font-family: "Fraunces", Georgia, serif; font-size: 20px; font-weight: 650; color: var(--amber); }
.lote-sub { color: var(--soft); font-size: 12.5px; margin-top: 2px; }
.lote-age { flex-shrink: 0; }

ul.kv { list-style: none; }
ul.kv li {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
ul.kv li:last-child { border-bottom: none; }
ul.kv li span { color: var(--soft); }
ul.kv li strong { text-align: right; }

.lote-link {
  color: var(--amber); text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.lote-link:hover { color: var(--amberD); }

/* ---------- Linhas de formulário específicas ---------- */
.qty-row {
  display: grid;
  grid-template-columns: 1fr 100px auto;
  gap: 8px; margin-bottom: 8px; align-items: center;
}
.qty-row select, .qty-row input { width: 100%; }

.prod-cat-row {
  display: grid;
  grid-template-columns: 1fr 80px 100px 90px auto;
  gap: 8px; margin-bottom: 8px; align-items: center;
}
.prod-cat-row select, .prod-cat-row input { width: 100%; }
.prod-cat-header {
  font-size: 10.5px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .06em;
  padding-bottom: 5px; border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.prod-cat-header strong { font-weight: 600; }

.sale-item-card {
  background: var(--surf2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.sic-row1 { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.sic-row1 select { flex: 1; }
.sic-row2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px; margin-bottom: 8px;
}
.sic-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--soft); }
.sic-field span { font-weight: 600; }
.sic-field input, .sic-field select { width: 100%; }
.sic-row3 {
  text-align: right; padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
}

.hint { color: var(--soft); font-size: 12.5px; margin-bottom: 10px; }

/* ---------- Tela de login ---------- */
.auth-screen {
  position: fixed; inset: 0;
  z-index: 120;
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(194,128,31,.12), transparent 60%),
    var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
}
.auth-card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shLg);
  width: 100%; max-width: 400px;
  padding: 30px 28px;
  display: flex; flex-direction: column; gap: 12px;
  animation: pop .25s ease;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.auth-card h2 { font-family: "Fraunces", Georgia, serif; font-weight: 650; margin-bottom: 2px; }
.auth-submit { width: 100%; padding: 11px; font-size: 13.5px; margin-top: 4px; }
.auth-error {
  background: color-mix(in srgb, var(--err) 10%, transparent);
  color: var(--err);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
}
.auth-switch { text-align: center; font-size: 12.5px; color: var(--soft); margin-top: 4px; }
.auth-switch a { font-weight: 700; }

/* ---------- Planos ---------- */
.tier-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap;
}
.tier-badge::before {
  content: '';
  width: 8px; height: 8px; border-radius: 999px;
  background: currentColor;
}
.tier-badge.free    { background: color-mix(in srgb, var(--tier-free) 15%, transparent);    color: var(--tier-free); }
.tier-badge.starter { background: color-mix(in srgb, var(--tier-starter) 20%, transparent); color: color-mix(in srgb, var(--tier-starter) 70%, var(--ink)); }
.tier-badge.pro     { background: color-mix(in srgb, var(--tier-pro) 16%, transparent);     color: var(--tier-pro); }
.tier-badge.premium { background: var(--tier-premium); color: var(--tier-premium-accent); }

.plano-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 25px; font-weight: 650;
  letter-spacing: -.01em;
  margin-bottom: 4px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.plan-card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shSm);
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shMd); }
.plan-card.atual { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(194,128,31,.15); }
.plan-card.premium { border-color: var(--tier-premium); }
.pc-head { display: flex; justify-content: space-between; align-items: center; }
.pc-nome { font-family: "Fraunces", Georgia, serif; font-size: 19px; font-weight: 650; }
.pc-preco { font-size: 22px; font-weight: 800; color: var(--amber); }
.pc-preco small { font-size: 12px; font-weight: 500; color: var(--soft); }
.plan-card.premium .pc-preco { color: var(--tier-premium-accent); }
.pc-desc { font-size: 12.5px; color: var(--soft); line-height: 1.5; }
.pc-limite { font-size: 12px; color: var(--soft); font-weight: 600; }
.pc-feats { list-style: none; padding: 0; margin: 4px 0 10px; flex: 1; }
.pc-feats li {
  font-size: 12.5px; padding: 5px 0 5px 20px; position: relative;
  border-bottom: 1px dashed var(--line);
}
.pc-feats li:last-child { border-bottom: none; }
.pc-feats li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

/* ---------- IA da Cave ---------- */
.ai-card {
  background: var(--surf);
  border: 1px solid color-mix(in srgb, var(--cave) 45%, var(--line));
  border-left: 3px solid var(--gold);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shSm);
}
.ai-card h4 {
  display: flex; align-items: center; gap: 6px;
  color: var(--gold);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 5px;
}
.ai-card.warn { border-left-color: var(--err); }
.ai-card p { font-size: 13.3px; }
.ai-chat { border: 1px solid color-mix(in srgb, var(--cave) 45%, var(--line)); }
.ai-msg {
  background: color-mix(in srgb, var(--cave) 8%, var(--surf2));
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.3px;
}
.ai-lock {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shMd);
  text-align: center;
  max-width: 560px;
  margin: 24px auto 0;
}
.ai-lock-ico {
  width: 56px; height: 56px; margin: 0 auto;
  border-radius: 16px;
  background: color-mix(in srgb, var(--cave) 12%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.ai-lock-ico svg { width: 26px; height: 26px; stroke: var(--gold); stroke-width: 1.75; fill: color-mix(in srgb, var(--cave) 15%, transparent); }
.ai-lock h3 { font-family: "Fraunces", Georgia, serif; font-size: 22px; font-weight: 650; margin: 14px 0 0; }
.ai-lock p { font-size: 13.7px; color: var(--soft); margin-top: 8px; line-height: 1.6; }
.ai-lock .btn { margin-top: 16px; padding: 11px 20px; font-size: 13.5px; }
.ai-lock small { display: block; font-size: 11.5px; color: var(--soft); margin-top: 10px; }

/* Carrossel de insights do Pingo (compacto, rolagem horizontal) */
#aiCards {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}
#aiCards::-webkit-scrollbar { height: 6px; }
#aiCards .ai-card {
  min-width: 250px;
  max-width: 270px;
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 11px 13px;
}
#aiCards .ai-card p { font-size: 12.5px; }
#aiCards .ai-lock { min-width: 100%; max-width: 560px; margin: 24px auto 0; }

/* Chat do Pingo */
.pingo-msgs {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 380px; overflow-y: auto;
  padding: 2px;
}
.pmsg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.3px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: fadeUp .2s ease;
}
.pmsg.user {
  align-self: flex-end;
  background: var(--amber);
  color: var(--btnInk);
  border-bottom-right-radius: 4px;
}
.pmsg.ai {
  align-self: flex-start;
  background: color-mix(in srgb, var(--cave) 8%, var(--surf2));
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.pmsg.erro { background: color-mix(in srgb, var(--err) 10%, var(--surf2)); color: var(--err); }
.pmsg.acao {
  border: 1px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, var(--surf2));
}

.pmsg img {
  max-width: 180px;
  max-height: 180px;
  border-radius: 10px;
  display: block;
}
.pingo-acao { flex-shrink: 0; cursor: pointer; }
.icon-btn.rec {
  color: #fff;
  background: var(--err);
  border-color: var(--err);
  animation: recPulse 1.2s infinite;
}
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(210,77,67,.45); }
  50% { box-shadow: 0 0 0 6px rgba(210,77,67,0); }
}

@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.pmsg.typing { display: inline-flex; gap: 4px; align-items: center; }
.pmsg.typing i {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--soft);
  animation: blink 1.2s infinite;
}
.pmsg.typing i:nth-child(2) { animation-delay: .2s; }
.pmsg.typing i:nth-child(3) { animation-delay: .4s; }

/* ---------- Onboarding ---------- */
.ob-bg {
  position: fixed; inset: 0;
  background: rgba(28,26,21,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 80; padding: 14px;
}
.ob-card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 18px;
  width: 100%; max-width: 440px;
  max-height: 92dvh;
  display: flex; flex-direction: column;
  box-shadow: var(--shLg);
  animation: pop .25s ease;
  overflow: hidden;
}
.ob-head {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 24px 24px 18px;
  text-align: center;
}
.ob-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.ob-body p { font-size: 13.5px; color: var(--soft); line-height: 1.6; margin-bottom: 12px; }
.ob-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  background: var(--surf2);
}
.ob-dots { flex: 1; display: flex; justify-content: center; gap: 6px; }
.ob-dots i {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--line); display: inline-block;
  transition: background .15s ease;
}
.ob-dots i.on { background: var(--amber); }
.ob-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 12px; }
.ob-chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surf);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  transition: all .12s ease;
}
.ob-chip.on {
  background: var(--primary-soft);
  border-color: var(--amber);
  color: var(--amber);
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--surf);
  border-top: 1px solid var(--line);
  z-index: 55;
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
}
.bn-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
  font-size: 10.5px; font-weight: 600;
  color: var(--soft);
  padding: 6px 2px;
  min-height: 44px;
  border-radius: 10px;
}
.bn-item svg { width: 20px; height: 20px; stroke-width: 1.9; }
.bn-item.active { color: var(--amber); }

.sheet-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(28,26,21,.45);
  z-index: 58;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--surf);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--line);
  z-index: 59;
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .2s ease;
}
body.sheet-open .sheet { transform: none; }
body.sheet-open .sheet-bg { display: block; }
.sheet-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.sheet-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--surf2); border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 4px;
  cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 600;
  color: var(--ink);
}
.sheet-item svg { width: 19px; height: 19px; stroke-width: 1.9; }

/* ---------- Backdrop drawer (fallback) ---------- */
.nav-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(28,26,21,.45);
  z-index: 55;
}
body.nav-open .nav-backdrop { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  main#app { padding: 14px 14px 84px; }
  .topbar { padding: 0 14px; }
  .tb-mark { display: flex !important; }
}

@media (max-width: 700px) {
  .kpi-grid, .cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi-card, .card.stat { padding: 11px 12px; }
  .stat-value { font-size: 19px; }
  .view-head { flex-direction: column; align-items: stretch; }
  .view-head .btn { width: 100%; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input, .filters select { width: 100%; }
  table { font-size: 12px; }
  th, td { padding: 8px 10px; }
  .modal { max-height: 94dvh; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .qty-row { grid-template-columns: 1fr 1fr; }
  .prod-cat-row { grid-template-columns: 1fr 1fr; }
  .prod-cat-header { display: none; }
  .chart { height: 120px; gap: 6px; }
  .toast { bottom: 92px; }
}

@media (max-width: 420px) {
  .kpi-grid, .cards { grid-template-columns: 1fr; }
}

/* ---------- Polimento 28-07: painel vivo + Compadre em destaque + planos ---------- */
.list-item.clicavel { cursor: pointer; transition: background .12s; }
.list-item.clicavel:hover { background: var(--surf2); }
.li-seta { color: var(--text-faint); font-size: 1.1rem; margin-left: 4px; }

/* Compadre na bottom nav — destaque sutil de marca */
.bn-item.bn-compadre svg { color: var(--amber); }
.bn-item.bn-compadre.active svg { color: var(--amber); }

/* Tela de planos: aviso de degustação + preço anual */
.trial-aviso {
  background: var(--primary-soft); border: 1px solid var(--amber);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
  font-size: .92rem;
}
.trial-aviso[hidden] { display: none; }
.pc-anual { font-size: .8rem; color: var(--text-soft); margin: 2px 0 8px; }

/* ============================================================
   DIREÇÃO A — "Caderno de bancada" (manual: branding/MANUAL_DE_MARCA.md)
   Camada de aplicação sobre o design system v3. Vence por cascata.
   ============================================================ */

/* ---------- Tokens: papel quente + terracota (voz) + carimbo ---------- */
:root {
  --bg: #F5EFE2;
  --surf: #FDFAF3;
  --surf2: #F1E9D8;
  --line: #E3DAC6;
  --ink: #221E15;
  --soft: #6E6653;
  --terra: #C4622D;
  --contorno: #221E15;
  --shCarimbo: 3px 3px 0 rgba(34, 30, 21, .9);
  --shCarimboHover: 2px 2px 0 rgba(34, 30, 21, .9);
}
[data-theme="dark"] {
  /* restaura os tokens do tema escuro (esta camada fica depois dele no
     arquivo e venceria a cascata — os claros acima não podem vazar) */
  --bg: #131210;
  --surf: #1C1A17;
  --surf2: #262420;
  --line: #33302A;
  --ink: #EDEBE4;
  --soft: #A29E92;
  --terra: #D97D4A;
  --contorno: #4A463C;
  --shCarimbo: 3px 3px 0 rgba(0, 0, 0, .55);
  --shCarimboHover: 2px 2px 0 rgba(0, 0, 0, .55);
}

/* ---------- Cartões com contorno de tinta e sombra de carimbo ---------- */
.kpi-card, .panel, .plan-card {
  border: 1.5px solid var(--contorno);
  border-radius: 12px;
  box-shadow: var(--shCarimbo);
}
.kpi-card { transition: transform .13s ease, box-shadow .13s ease; }
.kpi-card:hover { transform: translate(1px, 1px); box-shadow: var(--shCarimboHover); }
.kpi-card:active { transform: translate(3px, 3px); box-shadow: none; }

/* números-protagonista na letra da marca */
.stat-value, .pc-preco {
  font-family: 'Fraunces', serif;
  font-weight: 650;
  letter-spacing: 0;
}

/* ---------- Botão principal: carimbo no papel ---------- */
.btn.primary {
  border: 1.5px solid var(--contorno);
  box-shadow: var(--shCarimbo);
  background: var(--amber);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn.primary:hover { background: var(--amber); transform: translate(1px, 1px); box-shadow: var(--shCarimboHover); }
.btn.primary:active { transform: translate(3px, 3px); box-shadow: none; }

/* ---------- Divisores de caderno pautado ---------- */
td { border-bottom-style: dashed; }
hr { border: none; border-top: 1px dashed var(--line); }

/* ---------- Voz da marca: itálico terracota ---------- */
.voz {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--terra);
}

/* ---------- Grão de papel só nas telas de respiro ---------- */
#authScreen, .ob-bg, #view-plano {
  background-image: radial-gradient(rgba(34, 30, 21, .028) 1px, transparent 1px);
  background-size: 5px 5px;
}
[data-theme="dark"] #authScreen,
[data-theme="dark"] .ob-bg,
[data-theme="dark"] #view-plano {
  background-image: radial-gradient(rgba(237, 235, 228, .022) 1px, transparent 1px);
}

/* ---------- Movimento entre telas (#35: "app mais vivo") ---------- */
::view-transition-old(root) { animation: vtSai 130ms ease both; }
::view-transition-new(root) { animation: vtEntra 210ms cubic-bezier(.2, .8, .25, 1) both; }
@keyframes vtSai { to { opacity: 0; } }
@keyframes vtEntra { from { opacity: 0; transform: translateY(7px); } }

/* entrada em cascata dos cartões quando a tela assume */
.view.active .kpi-card, .view.active > .panel {
  animation: fadeUp .3s cubic-bezier(.2, .8, .25, 1) backwards;
}
.view.active .kpi-card:nth-child(2) { animation-delay: .04s; }
.view.active .kpi-card:nth-child(3) { animation-delay: .08s; }
.view.active .kpi-card:nth-child(4) { animation-delay: .12s; }
.view.active .kpi-card:nth-child(5) { animation-delay: .16s; }
.view.active > .panel:nth-of-type(2) { animation-delay: .06s; }
.view.active > .panel:nth-of-type(3) { animation-delay: .12s; }

@media (prefers-reduced-motion: reduce) {
  .view.active .kpi-card, .view.active > .panel { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Motion da logo: splash e login (coreografia aprovada,
   fonte: branding/motion/logo-motion-2.html) ---------- */
.lm-splash {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--bg);
  background-image: radial-gradient(rgba(34, 30, 21, .028) 1px, transparent 1px);
  background-size: 5px 5px;
  color: var(--amber);
  transition: opacity .5s ease;
}
[data-theme="dark"] .lm-splash {
  background-image: radial-gradient(rgba(237, 235, 228, .022) 1px, transparent 1px);
}
.lm-splash.sai { opacity: 0; pointer-events: none; }
.lm-splash .lm-anima { width: min(44vw, 225px); }
.lm-splash svg { display: block; width: 100%; height: auto; }
.lm-anima svg, svg.lm-anima { overflow: visible; }

/* sem .anima (ou sem JS) a logo fica revelada — a animação é quem esconde */
.lm-tinta { stroke-dasharray: 1 2; stroke-dashoffset: 0; }
.lm-anima.anima .lm-tinta {
  stroke-dashoffset: 1.002;
  animation: lmDesenhar var(--lm-dur) cubic-bezier(.62, .05, .28, .96) var(--lm-espera) forwards;
}
.lm-linha    { --lm-espera: calc(var(--lm-atraso, 0s) + .15s); --lm-dur: 1.25s; }
.lm-segunda  { --lm-espera: calc(var(--lm-atraso, 0s) + .66s); --lm-dur: .55s; }
.lm-terceira { --lm-espera: calc(var(--lm-atraso, 0s) + .71s); --lm-dur: .55s; }
@keyframes lmDesenhar { to { stroke-dashoffset: 0; } }

.lm-anima.anima { animation: lmAssentar 1.9s cubic-bezier(.2, .8, .25, 1) var(--lm-atraso, 0s) both; }
@keyframes lmAssentar {
  0%   { transform: scale(.988); }
  78%  { transform: scale(1.005); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .lm-splash { display: none; }
  .lm-anima.anima .lm-tinta { animation: none; stroke-dashoffset: 0; }
  .lm-anima.anima { animation: none; }
}

/* ---------- Onboarding em conversa (Compadre) — letra grande, alvos grandes ---------- */
.ob-body { font-size: 16px; }
.ob-conversa { display: flex; flex-direction: column; gap: 10px; }
.ob-bolha {
  max-width: 92%; padding: 12px 15px; border-radius: 14px; line-height: 1.5;
  animation: fadeUp .28s cubic-bezier(.2,.8,.25,1) both;
}
.ob-bolha.compadre {
  align-self: flex-start; background: var(--surf2); color: var(--ink);
  border: 1px solid var(--line); border-bottom-left-radius: 4px;
}
.ob-bolha.compadre.eco { font-family: 'Fraunces', serif; font-style: italic; color: var(--terra); background: transparent; border: none; padding: 2px 6px 0; }
.ob-bolha.produtor {
  align-self: flex-end; background: var(--amber); color: var(--btnInk); font-weight: 600;
  border-bottom-right-radius: 4px;
}
.ob-bolha.produtor.pulou { background: transparent; color: var(--soft); font-weight: 500; font-style: italic; border: 1px dashed var(--line); }
.ob-dica { font-size: .88rem; color: var(--soft); padding: 0 6px; margin-top: -2px; }

.ob-entrada { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.ob-linha-input { display: flex; gap: 8px; align-items: center; }
.ob-input {
  flex: 1; min-height: 52px; font-size: 18px !important; padding: 12px 14px !important;
  border: 1.5px solid var(--contorno) !important; border-radius: 12px !important;
  background: var(--surf) !important; color: var(--ink);
}
.ob-input.ob-num { font-family: 'Fraunces', serif; font-weight: 650; font-size: 26px !important; text-align: right; max-width: 190px; }
.ob-linha-input.numero { justify-content: center; }
.ob-unidade { font-size: 15px; color: var(--soft); font-weight: 600; white-space: nowrap; }
.ob-mic {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--contorno); background: var(--surf); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shCarimbo);
}
.ob-mic svg { width: 24px; height: 24px; }
.ob-mic.rec { background: var(--err); color: #fff; border-color: var(--err); animation: pulsoMic 1s ease-in-out infinite; }
@keyframes pulsoMic { 50% { transform: scale(1.06); } }

.ob-acoes { display: flex; flex-direction: column; gap: 10px; }
.ob-btn-grande { min-height: 54px; font-size: 17px !important; border-radius: 12px !important; width: 100%; justify-content: center; }
.ob-chips.grande .ob-chip { font-size: 16px; padding: 12px 16px; min-height: 48px; border-radius: 12px; }

.ob-resultado {
  background: var(--surf); border: 1.5px solid var(--contorno); border-radius: 14px;
  box-shadow: var(--shCarimbo); padding: 14px 16px; margin-top: 12px;
}
.ob-res-linha { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ob-res-linha:last-child { border-bottom: none; }
.ob-res-linha strong { font-family: 'Fraunces', serif; font-weight: 650; font-size: 1.45rem; white-space: nowrap; }
.ob-res-linha.destaque strong { color: var(--amber); font-size: 1.7rem; }
.ob-res-sub { font-size: .85rem; color: var(--soft); margin: -4px 0 4px; }
.ob-bolha.compadre.aviso { border-color: var(--warn); background: rgba(217,165,20,.12); }
