/* AgentDeduct v2 — design system. Mobile-first, thumb-friendly, dark-mode ready. */
:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --bg-grad: linear-gradient(180deg, #fbfdfb 0%, #f4f6f3 60%, #eef1ec 100%);
  --surface: #ffffff;
  --surface-2: #f7f9f6;
  --ink: #10160f;
  --ink-2: #33402f;
  --muted: #68766a;
  --line: rgba(20, 35, 22, 0.1);
  --green: #157347;
  --green-deep: #0d4d2f;
  --green-soft: #e3f3e9;
  --gold: #b07d1e;
  --gold-soft: #fdf3dd;
  --red: #b3372f;
  --red-soft: #fbe9e7;
  --blue: #2563a8;
  --blue-soft: #e8f0fa;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 14px 40px rgba(18, 40, 24, 0.1);
  --shadow-sm: 0 4px 14px rgba(18, 40, 24, 0.07);
  --tabbar-h: 76px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d120e;
  --bg-grad: linear-gradient(180deg, #101711 0%, #0d120e 60%, #0a0e0b 100%);
  --surface: #151c16;
  --surface-2: #1a221b;
  --ink: #f0f4ee;
  --ink-2: #cfd8cc;
  --muted: #93a093;
  --line: rgba(255, 255, 255, 0.09);
  --green: #4cc38a;
  --green-deep: #2f9e68;
  --green-soft: rgba(76, 195, 138, 0.14);
  --gold: #e0a83e;
  --gold-soft: rgba(224, 168, 62, 0.14);
  --red: #e0705f;
  --red-soft: rgba(224, 112, 95, 0.13);
  --blue: #6aa5e8;
  --blue-soft: rgba(106, 165, 232, 0.13);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg-grad); background-attachment: fixed;
  color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; font-weight: 700; }
img { max-width: 100%; }

.app { max-width: 560px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .app { max-width: 640px; } }

/* ---------- header ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(18px + env(safe-area-inset-top)) 0 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.brand-logo { height: 28px !important; width: auto !important; border-radius: 8px !important; object-fit: contain !important; background: #fff; padding: 3px 10px; }
.year-pill {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 8px 14px; font-weight: 700; font-size: 14px; display: flex; gap: 6px; align-items: center;
}
.year-pill select { border: 0; background: none; font-weight: 800; font-size: 14px; }

/* ---------- views ---------- */
.view { display: none; animation: rise 240ms ease; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--green-deep), var(--green));
  color: #fff; border-radius: 22px; padding: 22px 20px; margin: 10px 0 14px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px;
  border-radius: 50%; background: rgba(255,255,255,0.09);
}
.hero .eyebrow { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.hero .big { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.hero .sub { font-size: 14px; opacity: 0.9; }
.hero .bracket { margin-top: 10px; font-size: 12.5px; opacity: 0.85; }
.hero .bracket button { color: #fff; text-decoration: underline; font-size: 12.5px; padding: 0; }

/* ---------- cards & stats ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: -0.01em; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 10px; text-align: center; }
.stat .v { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 600; }

/* ---------- nudges ---------- */
.nudge { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius-sm); padding: 13px 14px; margin-bottom: 10px; font-size: 14px; line-height: 1.45; border: 1px solid var(--line); background: var(--surface); }
.nudge .ico { font-size: 20px; flex: 0 0 auto; }
.nudge.gold { background: var(--gold-soft); border-color: rgba(176, 125, 30, 0.25); }
.nudge.blue { background: var(--blue-soft); border-color: rgba(37, 99, 168, 0.2); }
.nudge b { font-weight: 800; }
.nudge .act { margin-left: auto; flex: 0 0 auto; align-self: center; }
.btn-inline { background: var(--green); color: #fff; border-radius: 999px; padding: 9px 16px; font-size: 13.5px; }
.btn-inline.ghost { background: none; color: var(--green); border: 1.5px solid var(--green); }

/* ---------- lists ---------- */
.row-item { display: flex; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: 0; }
.row-ico { width: 42px; height: 42px; border-radius: 13px; background: var(--green-soft); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row-amt { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }
.row-amt small { display: block; font-size: 11px; color: var(--green); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 14px; }
.empty .big-ico { font-size: 34px; display: block; margin-bottom: 8px; }
.link-more { display: block; text-align: center; font-size: 13.5px; color: var(--green); font-weight: 700; padding: 10px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 30px rgba(18, 40, 24, 0.08);
}
.tabbar-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1.3fr 1fr 1fr; height: var(--tabbar-h); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 700; }
.tab .ti { font-size: 21px; }
.tab.active { color: var(--green); }
.fab {
  width: 62px; height: 62px; border-radius: 50%; margin: -24px auto 0;
  background: linear-gradient(135deg, var(--green-deep), var(--green)); color: #fff;
  font-size: 30px; line-height: 1; box-shadow: 0 10px 24px rgba(21, 115, 71, 0.4);
  display: flex; align-items: center; justify-content: center;
}
.fab:active { transform: scale(0.94); }
.fab-label { font-size: 10.5px; font-weight: 700; color: var(--muted); }

/* ---------- bottom sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 14, 9, 0.55); z-index: 60; opacity: 0; pointer-events: none; transition: opacity 200ms; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 560px; margin: 0 auto;
  background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform 260ms cubic-bezier(0.32, 0.72, 0.24, 1);
  max-height: 92vh; overflow-y: auto;
}
.sheet.open { transform: none; }
.grabber { width: 42px; height: 5px; border-radius: 99px; background: var(--line); margin: 6px auto 12px; }
.sheet h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -0.02em; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; margin: 10px 0 14px; }
.seg button { border-radius: 999px; padding: 10px; font-size: 14px; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- forms ---------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 13px 14px; font-size: 16px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.amount-input { font-size: 34px !important; font-weight: 800; letter-spacing: -0.02em; text-align: center; font-variant-numeric: tabular-nums; }
.amount-wrap { position: relative; }
.amount-wrap .cur { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 800; color: var(--muted); }
.amount-wrap input { padding-left: 40px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat-cell { border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.2; min-height: 74px; justify-content: center; }
.cat-cell .ci { font-size: 21px; }
.cat-cell.active { border-color: var(--green); background: var(--green-soft); color: var(--ink); }
.choice-row { display: flex; gap: 8px; }
.choice { flex: 1; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font-size: 14px; text-align: center; background: var(--surface); }
.choice.active { border-color: var(--green); background: var(--green-soft); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.warn { background: var(--gold-soft); border: 1px solid rgba(176, 125, 30, 0.3); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13.5px; margin: 10px 0; line-height: 1.45; }
.warn b { font-weight: 800; }
.ocr-status { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.45; min-height: 20px; }
.ocr-status.working { color: var(--blue); }
.ocr-status.success { color: var(--green); }
.ocr-status.warning { color: var(--gold); }
.btn-primary {
  width: 100%; background: linear-gradient(135deg, var(--green-deep), var(--green)); color: #fff;
  border-radius: 16px; padding: 16px; font-size: 17px; font-weight: 800; letter-spacing: -0.01em;
  box-shadow: 0 10px 24px rgba(21, 115, 71, 0.35); margin-top: 6px;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; }
.btn-ghost { width: 100%; border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; font-size: 15px; margin-top: 10px; background: var(--surface); }
.btn-danger { color: var(--red); }
.receipt-btn { display: flex; align-items: center; gap: 10px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 13px 14px; width: 100%; font-size: 14.5px; background: var(--surface); text-align: left; }
.receipt-btn .ri { font-size: 20px; }
.hidden-file { display: none; }

/* ---------- drive tracking ---------- */
.drive-live { text-align: center; padding: 18px 10px; }
.drive-miles { font-size: 52px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.drive-meta { color: var(--muted); font-size: 14px; margin: 4px 0 16px; }
.btn-drive { width: 100%; border-radius: 18px; padding: 18px; font-size: 18px; font-weight: 800; background: linear-gradient(135deg, var(--green-deep), var(--green)); color: #fff; box-shadow: 0 10px 24px rgba(21, 115, 71, 0.35); }
.btn-drive.stop { background: linear-gradient(135deg, #8c2b25, var(--red)); box-shadow: 0 10px 24px rgba(179, 55, 47, 0.35); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---------- deals ---------- */
.deal-card { display: block; width: 100%; text-align: left; }
.deal-addr { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.deal-client { font-size: 13px; color: var(--muted); margin-top: 2px; }
.deal-nums { display: flex; gap: 14px; margin-top: 10px; }
.deal-nums .dn .v { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.deal-nums .dn .l { font-size: 11px; color: var(--muted); font-weight: 600; }
.pill { display: inline-block; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green-deep); }
[data-theme="dark"] .pill { color: var(--green); }
.pill.closed { background: var(--surface-2); color: var(--muted); }

/* ---------- reports ---------- */
.cpa-line { display: flex; justify-content: space-between; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cpa-line:last-child { border-bottom: 0; }
.cpa-line .t { font-weight: 600; }
.cpa-line .t small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.cpa-line .a { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.total-line { display: flex; justify-content: space-between; padding: 14px 2px 2px; font-size: 16px; font-weight: 800; }

/* ---------- settings ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.set-row:last-child { border-bottom: 0; }
.set-row .t { font-weight: 700; }
.set-row .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.set-row select { border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--surface); font-weight: 700; max-width: 170px; }
.privacy-note { font-size: 13px; color: var(--muted); line-height: 1.55; }
.privacy-note b { color: var(--ink-2); }

/* ---------- misc ---------- */
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 14px 0 4px; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.mt { margin-top: 14px; }
.center { text-align: center; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 13px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: all 240ms ease; z-index: 80; max-width: 90vw; text-align: center;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
@keyframes tickpop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.tickpop { animation: tickpop 420ms ease; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* print: CPA export */
@media print {
  body { padding-bottom: 0; background: #fff; }
  .tabbar, .topbar .year-pill, .no-print { display: none !important; }
  .app { max-width: 100%; }
  .view { display: none; }
  .view.active { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---- Google sign-in gate ---- */
.gate-veil {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg-grad, #f4f6f3);
  display: flex; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
}
.gate-card {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 40px 28px 32px; box-shadow: var(--shadow);
}
.gate-logo { height: 162px; width: auto; border-radius: 12px; margin-bottom: 12px; background: #fff; padding: 6px 16px; }
.gate-card h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 6px; }
.gate-sub { color: var(--muted); font-size: 15px; margin: 0 0 26px; line-height: 1.45; }
.gbtn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: 999px;
  padding: 13px 20px; font-size: 16px; font-weight: 600; text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12); transition: transform 120ms ease;
}
.gbtn:active { transform: scale(0.98); }
.gate-note { color: var(--muted); font-size: 13px; margin: 22px 0 0; line-height: 1.5; }
body.is-gated { overflow: hidden; }
/* ---- Public landing gate (logged-out visitors) ---- */
.gate-veil.gate-landing { align-items: flex-start; overflow-y: auto; }
.gate-card.gate-wide { max-width: 600px; text-align: left; padding: 36px 30px; margin: auto 0; }
.gate-top { text-align: center; }
.gate-info h2 { font-size: 17px; margin: 28px 0 8px; letter-spacing: -0.01em; }
.gate-info p { font-size: 14.5px; line-height: 1.6; margin: 0 0 10px; }
.gate-feats { list-style: none; margin: 14px 0 4px; padding: 0; display: grid; gap: 10px; }
.gate-feats li { display: flex; gap: 10px; font-size: 14.5px; line-height: 1.55; }
.gate-feats li > span:first-child { font-size: 19px; line-height: 1.4; }
.gate-links { margin: 22px 0 0; font-size: 13.5px; }

/* ---- Drive link modal ---- */
.modal-veil {
  position: fixed; inset: 0; z-index: 190; background: rgba(15, 25, 18, 0.55);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.modal-card {
  width: 100%; max-width: 480px; background: var(--surface); color: var(--ink);
  border-radius: 24px 24px 0 0; padding: 26px 24px calc(20px + env(safe-area-inset-bottom));
  text-align: center; box-shadow: var(--shadow);
}
.modal-ico { font-size: 44px; margin-bottom: 6px; }
.modal-card h2 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 8px; }
.modal-sub { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 0 14px; }
.modal-sub b { color: var(--ink); }

/* ---- Standalone pages (privacy, terms, feedback) ---- */
.legal-topbar { max-width: 720px; margin: 0 auto; }
.legal-shell { max-width: 720px; margin: 0 auto; padding: 0 20px calc(40px + env(safe-area-inset-bottom)); }
.legal-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 26px; box-shadow: var(--shadow); }
.legal-panel h2 { font-size: 20px; margin: 26px 0 8px; letter-spacing: -0.01em; }
.legal-panel h2:first-child { margin-top: 0; }
.legal-panel p, .legal-panel li { font-size: 15px; line-height: 1.65; }
.legal-panel p { margin: 0 0 12px; }
.legal-panel ul { margin: 0 0 12px; padding-left: 20px; }
.legal-panel label { display: block; font-weight: 700; font-size: 14px; margin: 0 0 14px; }
.legal-panel input[type="text"], .legal-panel input[type="email"], .legal-panel select, .legal-panel textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink);
}
.legal-panel textarea { resize: vertical; min-height: 120px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; font-weight: 800; color: var(--green); margin: 0 0 8px; }
.brand-title { display: flex; align-items: center; gap: 12px; }
.brand-title img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.brand-title h1 { font-size: 28px; margin: 0; letter-spacing: -0.02em; }
.tagline { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.site-footer { max-width: 720px; margin: 0 auto; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: 13px; }
.site-footer a { color: var(--green); font-weight: 700; }
.primary { display: inline-block; background: var(--green); color: #fff; border-radius: 999px; padding: 13px 26px; font-size: 16px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; }
.primary:disabled { opacity: 0.6; cursor: default; }
.legal-panel .primary { width: 100%; margin-top: 4px; }
.site-footer nav { display: flex; gap: 18px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---- Talk (conversational logging) ---- */
.talk-fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); z-index: 60;
  width: 58px; height: 58px; border-radius: 50%; background: var(--green); color: #fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 10px 26px rgba(18, 60, 30, 0.35); border: 0;
}
.talk-fab:active { transform: scale(0.94); }
.talk-sheet { max-height: 88vh; display: flex; flex-direction: column; }
.talk-msgs { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px 12px; min-height: 220px; max-height: 52vh; }
.tmsg { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5; }
.tmsg.user { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 6px; }
.tmsg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.tmsg.ttyping { color: var(--muted); letter-spacing: 2px; }
.talk-input-row { display: flex; gap: 8px; align-items: center; padding-top: 6px; }
.talk-input-row input[type="text"] {
  flex: 1; padding: 12px 14px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface-2); color: var(--ink); min-width: 0;
}
.talk-icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-size: 19px; cursor: pointer; flex-shrink: 0; }
.talk-send { width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: #fff; font-size: 18px; cursor: pointer; border: 0; flex-shrink: 0; }
.tconfirm { display: flex; flex-direction: column; gap: 8px; }
.tconfirm-title { font-weight: 800; font-size: 14px; }
.tconfirm-body { font-size: 15px; line-height: 1.7; }
.tconfirm-actions { display: flex; gap: 8px; margin-top: 2px; }
.tconfirm-actions .btn-primary { flex: 1; padding: 10px; font-size: 15px; border-radius: 14px; }
/* Tap-to-edit number on the Talk confirm card */
.tedit-num { background: none; border: none; padding: 0 2px; font: inherit; font-weight: 800; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.tedit-input { width: 120px; font: inherit; font-weight: 700; padding: 6px 10px; border: 2px solid #12503F; border-radius: 10px; background: #fff; }
.tconfirm-actions .btn-ghost { flex: 1; padding: 10px; font-size: 15px; border-radius: 14px; }

/* ---- Period toggle (Year | Month) + month navigator ---- */
.period-toggle {
  display: inline-flex; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; margin: 2px 0 10px;
}
.period-toggle button {
  border: 0; background: none; padding: 8px 18px; font-size: 14px; font-weight: 700;
  color: var(--muted); border-radius: 999px; cursor: pointer;
}
.period-toggle button.active { background: var(--green); color: #fff; }
.month-nav {
  display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0 0 12px;
}
.month-nav button {
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--line); font-size: 15px; cursor: pointer; color: var(--ink);
}
.month-nav button:active { transform: scale(0.93); }
.month-nav #monthLabel { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; min-width: 150px; text-align: center; }
