/* =========================================================
   Mercado · Estúdio Santello
   Paleta: Branco / Preto / Destaque #ff4800
   Fonte Parkinsans. Textos pequenos em UPPERCASE.
   Tema claro (padrão) e escuro.
   ========================================================= */

:root, :root[data-theme="light"] {
  --bg: #ffffff;
  --card: #ffffff;
  --card-2: #f5f5f4;
  --sunken: #ececeb;
  --ink: #0a0a0a;
  --ink-soft: #262626;
  --muted: #737373;
  --muted-2: #a3a3a3;
  --border: #e7e5e4;
  --border-2: #d6d3d1;

  --accent: #ff4800;
  --accent-ink: #ffffff;
  --accent-soft: #ffe9df;

  --hero: #0a0a0a;
  --hero-ink: #ffffff;
  --hero-2: #1c1c1c;
  --hero-mute: #9a9a9a;

  --up: #ff4800;
  --down: #737373;
  --danger: #e5352b;
  --danger-soft: #fde5e3;

  --shadow: 0 8px 30px rgba(10,10,10,0.10);

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px; --r-2xl: 24px; --r-3xl: 28px; --r-pill: 999px;
  --s1:4px;--s2:8px;--s3:12px;--s4:16px;--s5:20px;--s6:24px;--s7:32px;--s8:40px;

  --sans: 'Parkinsans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'Parkinsans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --maxw: 640px;
  --navh: 96px;
  --topb: 62px;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --card: #121212;
  --card-2: #1c1c1c;
  --sunken: #0a0a0a;
  --ink: #ffffff;
  --ink-soft: #e5e5e5;
  --muted: #a3a3a3;
  --muted-2: #6b6b6b;
  --border: #262626;
  --border-2: #363636;

  --accent: #ff4800;
  --accent-ink: #ffffff;
  --accent-soft: #35190f;

  --hero: #141414;
  --hero-ink: #ffffff;
  --hero-2: #1f1f1f;
  --hero-mute: #9a9a9a;

  --up: #ff5a1a;
  --down: #a3a3a3;
  --danger: #ff5a4d;
  --danger-soft: #351512;

  --shadow: 0 8px 30px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
html, body {
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body { min-height: 100dvh; overflow-x: clip; }
@media (max-width: 767px) { input, textarea, select { font-size: 16px !important; } }

#app { max-width: var(--maxw); margin: 0 auto; min-height: 100dvh; position: relative; background: var(--bg); }
main { padding-bottom: calc(var(--navh) + env(safe-area-inset-bottom)); }

/* Tipografia — pequenos SEMPRE uppercase */
.t-eyebrow, .chart-lbl, .lc-meta, .cat-label, .set-val, .pay-tag, .hero-stat .l, .cat-tag, .meta-up {
  text-transform: uppercase; letter-spacing: 0.08em;
}
.t-eyebrow { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.12em; }
.t-metric { font-family: var(--mono); letter-spacing: -0.02em; font-weight: 600; }
/* Dígitos tabulares: mantêm os valores alinhados mesmo em Parkinsans */
.hero-value, .calc-total .v, .item-total, .lc-value, .cat-nums, .chart-val,
.set-val, .hero-stat .n, .pay-tag, .pay-sum, .t-metric, .iwrap input { font-variant-numeric: tabular-nums; }
.t-h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.t-h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }

/* ============ TOPBAR (favicon centralizado) ============ */
.topbar {
  position: sticky; top: 0; z-index: 55;
  height: var(--topb);
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar .brand { width: 40px; height: 40px; display: block; }
.topbar .brand img { width: 100%; height: 100%; }
.topbar .tb-left, .topbar .tb-right { position: absolute; top: 50%; transform: translateY(-50%); }
.topbar .tb-left { left: 12px; } .topbar .tb-right { right: 12px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-pill); flex: none;
  background: var(--card); border: 1px solid var(--border); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.icon-btn:hover { background: var(--card-2); }
.icon-btn:active { transform: scale(0.94); }

.view { padding: 14px 20px 20px; animation: fade 0.24s ease-out; }
.view-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2px; }

.user-chip { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  width: 46px; height: 46px; border-radius: var(--r-pill); flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px;
  overflow: hidden; border: 1px solid var(--border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .greet { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.user-chip .name { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 12px; }
.section-head .link { font-size: 11px; color: var(--muted); font-weight: 600; background: none; border: none; cursor: pointer; font-family: inherit; text-transform: uppercase; letter-spacing: 0.08em; }
.section-head .link:hover { color: var(--accent); }

/* ============ HERO ============ */
.hero { background: var(--hero); color: var(--hero-ink); border-radius: var(--r-3xl); padding: 24px 22px; border: 1px solid var(--border); position: relative; overflow: hidden; }
.hero .t-eyebrow { color: var(--hero-mute); }
.hero-value { font-size: 46px; line-height: 1; margin: 10px 0 4px; letter-spacing: -0.03em; font-weight: 700; font-family: var(--mono); }
.hero-stats { display: flex; gap: 8px; margin-top: 20px; }
.hero-stat { flex: 1; background: var(--hero-2); border-radius: var(--r-lg); padding: 12px; }
.hero-stat .n { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.hero-stat .l { font-size: 10px; color: var(--hero-mute); margin-top: 3px; font-weight: 600; }

/* ============ CARDS ============ */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: 18px; }
.card.pad-lg { padding: 22px; }

/* ============ CHART (estilo DS) ============ */
.chart-wrap { position: relative; }
.chart-grid { position: absolute; inset: 0 0 26px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid span { border-top: 1px dashed var(--border); height: 0; }
.chart { position: relative; display: flex; align-items: flex-end; gap: 7px; height: 178px; padding-top: 34px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; position: relative; }
.chart-bar { width: 100%; max-width: 34px; background: var(--card-2); border: 1px solid var(--border); border-radius: 7px 7px 3px 3px; transform-origin: bottom; animation: grow 0.6s cubic-bezier(0.16,1,0.3,1) both; min-height: 4px; }
.chart-col.max .chart-bar { background: var(--accent); border-color: var(--accent); }
.chart-lbl { font-size: 9px; font-family: var(--sans); font-weight: 600; color: var(--muted-2); margin-top: 8px; }
.chart-val { position: absolute; top: 0; left: 50%; transform: translate(-50%, -118%); background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; box-shadow: var(--shadow); }
.chart-val::after { content: ''; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: var(--accent); transform: translateX(-50%) rotate(45deg); border-radius: 1px; }

/* ============ KPI CATEGORIAS ============ */
.cat-list { display: flex; flex-direction: column; gap: 14px; }
.cat-row { }
.cat-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; gap: 10px; }
.cat-label { font-size: 11px; font-weight: 700; color: var(--ink); }
.cat-nums { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.cat-nums b { color: var(--ink); font-weight: 600; }
.cat-track { height: 8px; background: var(--card-2); border-radius: var(--r-pill); overflow: hidden; }
.cat-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transform-origin: left; animation: growx 0.6s cubic-bezier(0.16,1,0.3,1) both; }
.cat-fill.n1 { opacity: 1; } .cat-fill.n2 { opacity: .82; } .cat-fill.n3 { opacity: .66; }
.cat-fill.n4 { opacity: .5; } .cat-fill.n5 { background: var(--muted); } .cat-fill.n6 { background: var(--muted-2); }

/* ============ LIST-CARD ============ */
.list-card { width: 100%; text-align: left; font-family: inherit; color: inherit; cursor: pointer; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 14px 16px; display: flex; align-items: center; gap: 13px; margin-bottom: 10px; transition: border-color 0.16s; }
.list-card:hover { border-color: var(--accent); }
.lc-icon { width: 42px; height: 42px; border-radius: var(--r-lg); flex: none; background: var(--card-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.lc-icon.accent { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.lc-body { flex: 1; min-width: 0; }
.lc-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 3px; letter-spacing: -0.01em; }
.lc-meta { font-size: 10px; color: var(--muted); font-family: var(--sans); font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lc-value { font-family: var(--mono); font-size: 16px; font-weight: 600; color: var(--ink); }
.lc-right { text-align: right; }

.delta { font-family: var(--mono); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; letter-spacing: 0; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); } .delta.flat { color: var(--muted-2); }

.pay-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.pay-tag { font-size: 9px; font-family: var(--mono); padding: 3px 8px; border-radius: var(--r-pill); background: var(--card-2); color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }

/* ============ FORM / CALCULADORA ============ */
.field { width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 13px 14px; color: var(--ink); font-size: 15px; font-family: inherit; }
.field:focus { outline: none; border-color: var(--accent); }
.field::placeholder { color: var(--muted-2); }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; cursor: pointer; }
.field-lbl { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin: 0 2px 6px; display: block; }

.when-row { display: flex; gap: 10px; }
.when-row .field { flex: 1; }

.calc-total { text-align: center; padding: 6px 0 14px; }
.calc-total .v { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; font-family: var(--mono); }
.calc-total .m { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

.name-input { width: 100%; background: transparent; border: none; border-bottom: 1.5px solid var(--border-2); padding: 10px 2px; color: var(--ink); font-size: 17px; font-family: inherit; font-weight: 600; }
.name-input:focus { outline: none; border-bottom-color: var(--accent); }
.name-input::placeholder { color: var(--muted-2); font-weight: 400; }

.add-row { display: flex; gap: 9px; margin-top: 12px; }
.iwrap { position: relative; flex: 2; }
.iwrap.qty { flex: 1; }
.iwrap label { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 14px; font-family: var(--mono); pointer-events: none; }
.iwrap input { width: 100%; background: var(--card-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 12px 12px 30px; color: var(--ink); font-size: 16px; font-family: var(--mono); }
.iwrap.qty input { padding-left: 26px; }
.iwrap input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.btn-add { flex: none; background: var(--accent); color: var(--accent-ink); border: none; border-radius: var(--r); padding: 0 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.14s; }
.btn-add:active { transform: scale(0.94); }

.item-row { padding: 13px 2px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); animation: fade 0.2s ease-out; }
.item-row:last-child { border-bottom: none; }
.item-info { flex: 1; min-width: 0; }
.item-name { font-size: 15px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.cat-tag { font-size: 9px; font-family: var(--sans); font-weight: 700; padding: 2px 7px; border-radius: var(--r-pill); background: var(--card-2); color: var(--muted); letter-spacing: 0.05em; }
.item-total { font-family: var(--mono); font-size: 15px; font-weight: 500; min-width: 78px; text-align: right; }
.x-btn { background: transparent; border: none; color: var(--muted-2); cursor: pointer; padding: 7px; border-radius: var(--r-pill); display: flex; transition: color 0.16s, background 0.16s; }
.x-btn:hover { color: var(--danger); background: var(--danger-soft); }

.empty-mini { text-align: center; padding: 26px 10px; color: var(--muted-2); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.pay-row { display: flex; gap: 9px; margin-bottom: 9px; align-items: center; }
.pay-row select { flex: 1.4; }
.pay-row .pv { flex: 1; }
.pay-sum { font-size: 11px; font-family: var(--mono); color: var(--muted); text-align: right; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }
.pay-sum.ok { color: var(--down); }
.pay-sum.off { color: var(--accent); }

/* ============ CTA ============ */
.cta-dark { width: 100%; background: var(--accent); color: var(--accent-ink); border: none; border-radius: var(--r-lg); padding: 16px; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.14s; text-transform: uppercase; letter-spacing: 0.06em; }
.cta-dark:active { transform: scale(0.99); }
.cta-dark:disabled { opacity: 0.5; }

.attach-btn { width: 100%; background: var(--card-2); border: 1.5px dashed var(--border-2); border-radius: var(--r-lg); padding: 16px; color: var(--muted); font-size: 12px; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.attach-btn.filled { border-style: solid; border-color: var(--accent); color: var(--ink); padding: 8px; text-transform: none; }
.attach-btn img { max-height: 150px; border-radius: var(--r); }

.ghost-btn { background: var(--card); border: 1px solid var(--border); color: var(--ink-soft); border-radius: var(--r-pill); padding: 9px 15px; font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background 0.16s, border-color 0.16s; text-transform: uppercase; letter-spacing: 0.06em; }
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============ DETALHE ============ */
.detail-actions { display: flex; gap: 9px; flex-wrap: wrap; margin: 6px 0 16px; }
.nota-view { border-radius: var(--r-2xl); overflow: hidden; border: 1px solid var(--border); margin-bottom: 16px; }
.nota-view img { width: 100%; display: block; }
.nota-loading { padding: 26px; text-align: center; color: var(--muted-2); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.cat-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin: 18px 2px 8px; display: flex; justify-content: space-between; }
.cat-head .cv { font-family: var(--mono); color: var(--ink); }

/* ============ SETTINGS ============ */
.profile-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: 16px; }
.profile-card .avatar { width: 56px; height: 56px; font-size: 20px; }
.profile-card .pc-body { flex: 1; min-width: 0; }
.profile-card .pc-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.profile-card .pc-email { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.set-group { margin-top: 22px; }
.set-group > .t-eyebrow { margin: 0 4px 8px; display: block; }
.set-list { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-2xl); overflow: hidden; }
.set-item { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border); font-family: inherit; color: inherit; cursor: pointer; padding: 15px 16px; display: flex; align-items: center; gap: 12px; text-align: left; transition: background 0.14s; }
.set-item:last-child { border-bottom: none; }
.set-item:hover { background: var(--card-2); }
.set-ic { color: var(--ink-soft); display: flex; flex: none; }
.set-lbl { flex: 1; font-size: 15px; font-weight: 600; }
.set-val { font-size: 11px; color: var(--muted); font-family: var(--mono); font-weight: 600; }
.set-chev { color: var(--muted-2); display: flex; }
.seg { display: inline-flex; gap: 4px; background: var(--card-2); border-radius: var(--r-pill); padding: 3px; }
.seg button { border: none; background: transparent; color: var(--muted); font-family: inherit; font-size: 11px; font-weight: 700; padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

/* ============ FLOATING NAV (só ícones, círculo no hover) ============ */
.floating-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; justify-content: center; padding: 0 16px calc(14px + env(safe-area-inset-bottom)); pointer-events: none; }
.nav-pill { pointer-events: auto; display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 8px; box-shadow: var(--shadow); }
.nav-item { width: 50px; height: 50px; border-radius: var(--r-pill); background: transparent; border: none; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; transition: background 0.18s, color 0.18s, transform 0.14s; }
.nav-item:hover { background: var(--accent); color: var(--accent-ink); }
.nav-item.active { background: var(--accent); color: var(--accent-ink); }
.nav-item.add { background: var(--accent); color: var(--accent-ink); }
.nav-item.add:active { transform: scale(0.92); }
.nav-item.nav-avatar:hover { background: var(--accent); }
.nav-item .nav-av { width: 34px; height: 34px; border-radius: var(--r-pill); overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--card-2); color: var(--ink-soft); font-weight: 700; font-size: 13px; border: 1px solid var(--border); }
.nav-item .nav-av img { width: 100%; height: 100%; object-fit: cover; }
.nav-item.active .nav-av, .nav-item.nav-avatar:hover .nav-av { border-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); }

/* ============ AUTH (ilustração no topo + card branco) ============ */
.auth-screen { min-height: 100dvh; display: flex; flex-direction: column; background: var(--card-2); }
.auth-illus { position: relative; flex: 1 1 auto; min-height: 320px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 120px 20px 0; }
.auth-illus .a-logo { position: absolute; top: max(20px, env(safe-area-inset-top)); left: 22px; width: 46px; height: 46px; z-index: 2; }
.auth-illus .a-logo img { width: 100%; height: 100%; }
.auth-headline { flex: none; font-weight: 700; font-size: clamp(34px, 10.5vw, 52px); line-height: 1.04; letter-spacing: -0.03em; color: var(--ink); text-align: center; }
.auth-illus .a-art { width: 116%; max-width: 620px; margin-bottom: -6%; margin-top: 8px; display: block; transform: translateX(2%); }
.auth-sheet { flex: 0 0 auto; background: var(--card); border-radius: 30px 30px 0 0; margin-top: -34px; position: relative; z-index: 3; padding: 30px 24px calc(28px + env(safe-area-inset-bottom)); }

.g-btn { width: 100%; background: var(--card); border: 1.5px solid var(--border-2); border-radius: var(--r-pill); padding: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; font-family: inherit; transition: background 0.16s; }
.g-btn:hover { background: var(--card-2); }
.a-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.a-or::before, .a-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.a-row { display: flex; gap: 10px; margin-bottom: 10px; }
.a-row > * { flex: 1; min-width: 0; }
.a-input { width: 100%; background: var(--card-2); border: 1.5px solid transparent; border-radius: var(--r-pill); padding: 14px 18px; color: var(--ink); font-size: 15px; font-family: inherit; }
.a-input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.a-input::placeholder { color: var(--muted-2); }
.a-pass { display: flex; gap: 8px; margin-top: 10px; }
.a-pass .a-input { flex: 1; }
.a-eye { width: 52px; flex: none; background: var(--card-2); border: 1.5px solid transparent; border-radius: var(--r-pill); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.a-eye:hover { color: var(--ink); }
.a-err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 8px 0 0; text-align: center; }
.a-primary { width: 100%; background: var(--ink); color: var(--bg); border: none; border-radius: var(--r-pill); padding: 16px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; margin-top: 16px; text-transform: uppercase; letter-spacing: 0.06em; transition: transform 0.14s; }
.a-primary:active { transform: scale(0.99); }
.a-primary:disabled { opacity: 0.5; }
.a-terms { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.5; }
.a-terms b { color: var(--ink-soft); font-weight: 600; }
.a-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--ink); font-weight: 600; }
.a-switch button { background: none; border: none; color: var(--accent); font-weight: 700; cursor: pointer; font-family: inherit; font-size: 14px; }

/* Campos reaproveitados no modal de edição */
.auth-field { margin-bottom: 4px; }
.auth-field input { width: 100%; background: var(--card-2); border: 1px solid var(--border); border-radius: var(--r); padding: 13px 14px; color: var(--ink); font-size: 15px; font-family: inherit; }
.auth-field input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.auth-error { font-size: 13px; margin-top: 6px; min-height: 18px; color: var(--danger); }

/* ============ MODAL ============ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 1000; display: none; align-items: flex-end; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-content { background: var(--card); border-radius: var(--r-3xl) var(--r-3xl) 0 0; padding: 26px 22px; padding-bottom: max(26px, calc(env(safe-area-inset-bottom) + 16px)); width: 100%; max-width: var(--maxw); border: 1px solid var(--border); border-bottom: none; animation: slideUp 0.28s cubic-bezier(0.16,1,0.3,1); }
.modal-title { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.modal-sub { font-size: 14px; color: var(--muted); margin-bottom: 20px; line-height: 1.45; }
.modal-buttons { display: flex; gap: 10px; }
.btn-2, .btn-1 { flex: 1; border-radius: var(--r-lg); padding: 14px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; border: none; transition: transform 0.14s; text-transform: uppercase; letter-spacing: 0.05em; }
.btn-2:active, .btn-1:active { transform: scale(0.99); }
.btn-2 { background: transparent; color: var(--muted); border: 1px solid var(--border-2); }
.btn-1 { background: var(--accent); color: var(--accent-ink); }
.btn-1.danger { background: var(--danger); color: #fff; }
.btn-1:disabled { opacity: 0.5; }

/* ============ TOAST ============ */
.toast { position: fixed; left: 50%; bottom: calc(var(--navh) + 16px); transform: translateX(-50%) translateY(16px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; z-index: 1200; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; max-width: calc(100% - 40px); text-align: center; text-transform: uppercase; letter-spacing: 0.04em; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spin { animation: spin 0.8s linear infinite; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%,100% { transform: translateX(0);} 25% { transform: translateX(-6px);} 75% { transform: translateX(6px);} }
.shake { animation: shake 0.4s ease-in-out; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 30%, transparent); border-radius: 9999px; border: 2.5px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (min-width: 768px) {
  .home-bento { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .home-bento .section-head { margin-top: 6px; }
  .home-bento .span-2 { grid-column: 1 / -1; }
}
