/* Tokens: .claude/skills/fecha-design/references/platform-mapping.md */
:root {
  --background: #F4F2ED; --bg: var(--background);
  --surface1: #FBFAF7; --surface2: #EDEAE3; --surface3: #E6E2DA;
  --border: #DDD9CF; --border-visible: #BFBAAE;
  --text1: #1E1D19; --text2: #5C5850; --text3: #726E64; --text4: #A29D91;
  --accent: #2F6B3E; --accent-subtle: #EBF3ED; --on-accent: #FBFAF7;
  --ink: #1E1D19; --on-ink: #F4F2ED; --backdrop: rgba(30, 29, 25, 0.32);
  --success: #4A7552; --success-bg: #EEF3EE; --warning: #94600F; --warning-bg: #FBF3E4; --error: #9E3B2C; --error-bg: #FBEEEA;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --text-display: 28px; --text-heading: 22px; --text-subheading: 16px; --text-body: 15px;
  --text-body-sm: 14px; --text-caption: 13px; --text-label: 12px; --text-lp-heading: 36px; --text-lp-lead: 18px;
  --space-2xs: 2px; --space-xs: 4px; --space-sm: 8px; --space-12: 12px; --space-md: 16px; --space-lg: 24px;
  --space-xl: 32px; --space-2xl: 48px; --space-3xl: 64px; --space-4xl: 96px;
  --radius-element: 4px; --radius-control: 6px; --radius-component: 8px; --radius-container: 12px;
  --ease: ease-in-out; --duration-fast: 120ms; --duration-medium: 200ms; --duration-slow: 280ms;
  --rail: 232px; --rail-collapsed: 64px; --pane: 420px; --tabbar: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #1C1B17; --surface1: #24231F; --surface2: #2C2A25; --surface3: #36342E;
    --border: #36342E; --border-visible: #4A473F;
    --text1: #EDEAE3; --text2: #BFBAAE; --text3: #8A857A; --text4: #5C5850;
    --accent: #7FB08A; --accent-subtle: #16291B; --on-accent: #1C1B17;
    --ink: #EDEAE3; --on-ink: #1C1B17; --backdrop: rgba(10, 10, 8, 0.60);
    --success: #93AE96; --success-bg: #1F2A20; --warning: #E0A955; --warning-bg: #2E2412; --error: #E08A7A; --error-bg: #321D18;
    color-scheme: dark;
  }
}

/* Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--background); color: var(--text1); font: 400 var(--text-body)/1.55 var(--font-body);
  font-variant-numeric: tabular-nums lining-nums; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: transparent; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-element); }
::selection { background: var(--surface3); }
h1 { font-family: var(--font-display); font-size: var(--text-display); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-family: var(--font-display); font-size: var(--text-heading); font-weight: 500; line-height: 1.25; letter-spacing: -0.005em; }
h3 { font-size: var(--text-subheading); font-weight: 500; line-height: 1.4; }
strong { font-weight: 500; }
/* An emblem: one per region, ink in --text2, never inside a table or a cell */
.emblem { display: block; flex-shrink: 0; color: var(--text2); }
.settings-label .emblem { margin-bottom: var(--space-md); }
.quiet-empty { display: flex; align-items: center; gap: var(--space-md); min-height: 56px; padding: var(--space-sm) 0; font-size: var(--text-body-sm); color: var(--text3); }
.quiet-empty p { max-width: 52ch; }
/* A glyph is its SVG as a mask: 1em square, in the colour of its text (glyphs.css holds the shapes) */
.ph { display: inline-block; flex-shrink: 0; width: 1em; height: 1em; vertical-align: -0.125em; background: currentColor; -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat; }
/* 2.8: a noun's glyph sits before its word, 16px in --text2; 20px on a folder tab */
.ph.noun { font-size: 16px; color: var(--text2); margin-right: var(--space-sm); }
.th-noun, .board-name { display: inline-flex; align-items: center; }
.need-glyph { font-size: 18px; color: var(--text3); }
.need-glyph.is-waiting { color: var(--warning); }
.lia-mark { display: block; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wordmark { font-family: var(--font-display); font-size: var(--text-heading); font-weight: 500; letter-spacing: -0.005em; line-height: 1; }
.subline { margin-top: var(--space-xs); font-size: var(--text-caption); color: var(--text3); }
.dim { color: var(--text3); }
.quiet-line { font-size: var(--text-body-sm); color: var(--text3); padding: var(--space-sm) 0; }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 120ms !important; animation: none !important; } }

/* App frame: rail, main, and on O mês the detail pane */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.app.with-pane { grid-template-columns: var(--rail-collapsed) minmax(0, 1fr) var(--pane); }
.rail { border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-lg) var(--space-md); position: sticky; top: 0; height: 100vh; }
.rail-mark { height: 40px; display: flex; align-items: center; padding: 0 var(--space-sm); margin-bottom: var(--space-lg); }
.rail-item { height: 36px; border-radius: var(--radius-control); display: flex; align-items: center; gap: var(--space-12); padding: 0 var(--space-sm); color: var(--text2); font-size: var(--text-body-sm); transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease); }
.rail-item:hover { background: var(--surface2); color: var(--text1); }
.rail-item.is-active { background: var(--surface2); color: var(--text1); font-weight: 500; }
.rail-item { position: relative; }
.nav-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; }
.nav-icon i { font-size: 18px; }
.nav-count { position: absolute; top: -7px; right: -10px; height: 16px; min-width: 16px; padding: 0 4px; border-radius: var(--radius-element); background: var(--warning); color: var(--on-accent); font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
/* In the full rail the count sits at the end of the row, as a quiet badge */
.app:not(.with-pane) .rail-item .nav-icon { position: static; }
.app:not(.with-pane) .rail-item .nav-count { top: 50%; right: var(--space-sm); transform: translateY(-50%); height: 20px; min-width: 20px; padding: 0 6px; background: var(--warning-bg); color: var(--warning); font-size: var(--text-label); font-weight: 500; }
.rail-foot { margin-top: auto; display: flex; align-items: center; gap: var(--space-12); padding: var(--space-sm); }
.avatar { width: 32px; height: 32px; border-radius: var(--radius-control); background: var(--surface3); color: var(--text1); display: inline-flex; align-items: center; justify-content: center; font-size: var(--text-label); font-weight: 500; flex-shrink: 0; }
.rail-who { display: flex; flex-direction: column; min-width: 0; font-size: var(--text-caption); line-height: 1.35; }
.rail-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-who span + span { color: var(--text3); }
.with-pane .rail { align-items: center; padding: var(--space-lg) 0; }
.with-pane .rail-mark { padding: 0; justify-content: center; }
.with-pane .rail-mark span, .with-pane .nav-label, .with-pane .rail-who { display: none; }
.with-pane .rail-item { width: 40px; height: 40px; justify-content: center; padding: 0; }
.with-pane .rail-foot { padding: 0; }
.main { padding: var(--space-xl) var(--space-xl) var(--space-2xl); min-width: 0; }
.tabbar { display: none; }

/* Page head */
.page-head { margin-bottom: var(--space-2xl); }
.title-row { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; min-height: 40px; }
.title-tools { margin-left: auto; display: flex; gap: var(--space-sm); align-items: center; }
.crumb { font-size: var(--text-body-sm); color: var(--text2); margin-bottom: var(--space-sm); display: flex; gap: var(--space-sm); }
.crumb a:hover { color: var(--text1); text-decoration: underline; text-underline-offset: 3px; }
.crumb .sep { color: var(--text3); }
.page-head .tags { margin-top: var(--space-md); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm); height: 36px; padding: 0 var(--space-md); border-radius: var(--radius-control); font-size: var(--text-body-sm); font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease); }
.btn i { font-size: 16px; }
.btn .lia-mark { width: 16px; height: 16px; }
.btn-sm { height: 32px; padding: 0 var(--space-12); }
.btn-icon { width: 32px; padding: 0; }
.btn-block { width: 100%; height: 40px; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { opacity: 0.8; }
.btn-secondary { border: 1px solid var(--border-visible); color: var(--text1); }
.btn-secondary:hover { background: var(--surface2); }
.btn-ghost { color: var(--text2); }
.btn-ghost:hover { color: var(--text1); background: var(--surface2); }
.btn-secondary:active, .btn-ghost:active { background: var(--surface3); }
/* Resolving an exception is amber's partner: ink on amber, never green */
.btn-resolve { background: var(--warning-bg); color: var(--ink); outline: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); outline-offset: -1px; }
.btn-resolve:hover { outline-color: var(--warning); }
/* Brand green: the thresholds and Lia's chat, nowhere else */
.btn-brand { background: var(--accent); color: var(--on-accent); }
.btn-brand:hover { opacity: 0.88; }
.btn[disabled], .btn.is-busy { opacity: 0.4; pointer-events: none; }

/* Sections */
.section + .section { margin-top: var(--space-2xl); }
.section-head { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); flex-wrap: wrap; min-height: 32px; }
.section-meta { margin-left: auto; font-size: var(--text-caption); color: var(--text3); }
.badge { display: inline-flex; align-items: center; justify-content: center; height: 20px; min-width: 20px; padding: 0 6px; border-radius: var(--radius-element); font-size: var(--text-label); font-weight: 500; line-height: 1; background: var(--surface2); color: var(--text2); }
.badge-attention { background: var(--warning-bg); color: var(--warning); }
.card { background: var(--surface1); border: 1px solid var(--border); border-radius: var(--radius-component); padding: var(--space-lg); }

/* Precisa de você */
.need { background: var(--surface1); border: 1px solid var(--border); border-radius: var(--radius-component); }
.exc { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); min-height: 64px; }
.exc + .exc { border-top: 1px solid var(--border); }
.exc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex-shrink: 0; }
.exc-body { flex: 1; min-width: 0; }
.exc-title { font-weight: 500; }
.exc-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.exc-title span { color: var(--text3); font-weight: 400; }
.exc-noun { white-space: nowrap; }
.exc-note { font-size: var(--text-body-sm); color: var(--text2); max-width: 72ch; }
.exc-quote { font-size: var(--text-body-sm); color: var(--text3); margin-top: var(--space-2xs); }
.exc-actions { display: flex; gap: var(--space-xs); flex-shrink: 0; align-items: center; }
.need-empty { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); min-height: 64px; font-size: var(--text-body-sm); color: var(--text3); }
.need-empty .emblem { color: var(--text2); }
.need-empty strong { color: var(--text2); font-weight: 500; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.pop { position: relative; }
.pop[open] > summary.btn-ghost { background: var(--surface2); color: var(--text1); }
.pop-body { position: absolute; right: 0; top: calc(100% + var(--space-sm)); z-index: 10; width: min(400px, 86vw); background: var(--surface1); border: 1px solid var(--border-visible); border-radius: var(--radius-component); padding: var(--space-md); }

/* Segmented filter */
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface2); border-radius: var(--radius-control); }
.seg-item { height: 28px; padding: 0 var(--space-12); border-radius: var(--radius-element); font-size: var(--text-body-sm); color: var(--text2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg-item span { color: var(--text3); }
.seg-item:hover { color: var(--text1); }
.seg-item.is-selected { background: var(--surface1); color: var(--text1); outline: 1px solid var(--border-visible); outline-offset: -1px; }

/* Month grid */
.mgrid { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.mgrid col.c-client { width: 260px; }
.mgrid thead th { font-size: var(--text-label); font-weight: 500; color: var(--text3); text-align: left; height: 40px; padding: 0 var(--space-12); position: sticky; top: 0; z-index: 2; background: var(--background); border-bottom: 1px solid var(--border-visible); }
.mgrid tbody th, .mgrid td { height: 56px; padding: 0 var(--space-12); border-bottom: 1px solid var(--border); text-align: left; font-weight: 400; }
.mgrid td { white-space: nowrap; }
.mgrid tbody tr { cursor: pointer; transition: background var(--duration-fast) var(--ease); }
.mgrid tbody tr:hover { background: var(--surface2); }
.mgrid tr.is-selected { background: var(--surface2); }
.mgrid tr.is-selected th { position: relative; }
.mgrid tr.is-selected th::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.client-name { font-weight: 500; line-height: 1.3; display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.client-name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-sub { font-size: var(--text-caption); color: var(--text3); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex-shrink: 0; }
.grid-none { padding: var(--space-sm) var(--space-12); border-bottom: 1px solid var(--border); }
.grid-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); margin-top: var(--space-md); font-size: var(--text-caption); color: var(--text3); }
.grid-foot .progress { margin-top: 0; }
.bar { display: block; width: 160px; height: 4px; border-radius: 2px; background: var(--surface3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--text3); border-radius: 2px; }
/* A client's month: settled segments grey, the rest in their status colour */
.mbar { display: flex; align-items: center; gap: var(--space-12); margin: var(--space-xs) 0 var(--space-sm); font-size: var(--text-caption); color: var(--text3); }
.mbar-track { display: flex; gap: 3px; flex: 1; max-width: 240px; }
.mbar-seg { flex: 1; height: 4px; border-radius: 2px; background: var(--surface3); }
.mbar-seg.is-received, .mbar-seg.is-paid { background: var(--text3); }
.mbar-seg.is-review { background: var(--warning); }
.mbar-seg.is-late { background: var(--error); }
.via { position: relative; display: inline-flex; align-items: center; margin-right: var(--space-sm); vertical-align: -2px; color: var(--text3); }
.via i { font-size: 13px; }
.via .lia-mark { width: 13px; height: 13px; }
.via:hover .tip { opacity: 1; transition-delay: 400ms; }
.via:focus-visible .tip { opacity: 1; }

/* State cell */
.cell { display: inline-flex; align-items: center; gap: var(--space-sm); height: 28px; padding: 0 var(--space-sm); margin-left: calc(-1 * var(--space-sm)); border-radius: var(--radius-element); font-size: var(--text-caption); line-height: 1; white-space: nowrap; position: relative; transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease); }
.cell i { font-size: 14px; }
.cell sub { display: inline-flex; color: var(--text3); position: relative; top: 3px; margin-left: calc(-1 * var(--space-xs)); }
.cell sub i { font-size: 12px; }
.cell sub .lia-mark { width: 12px; height: 12px; stroke-width: 1.75; }
.cell-ring { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; flex-shrink: 0; }
.cell-ring.double { outline: 1px solid currentColor; outline-offset: 1.5px; }
.cell-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.cell-line { width: 12px; height: 1px; background: currentColor; }
.cell.is-na { color: var(--border-visible); }
.cell.is-waiting { color: var(--text2); }
.cell.is-nudged { color: var(--text1); }
.cell.is-received, .cell.is-paid { color: var(--text3); }
.cell.is-received > i, .cell.is-paid > i { color: var(--success); opacity: 0.75; }
.cell.is-review { color: var(--warning); background: var(--warning-bg); font-weight: 500; }
.cell.is-late { color: var(--error); font-weight: 500; }
.cell[tabindex]:hover { background: var(--surface2); }
.cell.is-review[tabindex]:hover { background: var(--warning-bg); outline: 1px solid var(--warning); outline-offset: -1px; }
.tip { position: absolute; bottom: calc(100% + var(--space-sm)); left: 0; z-index: 20; width: max-content; max-width: 280px; white-space: normal; background: var(--ink); color: var(--on-ink); font-size: var(--text-caption); font-weight: 400; line-height: 1.4; padding: var(--space-sm) var(--space-12); border-radius: var(--radius-element); opacity: 0; pointer-events: none; transition: opacity var(--duration-medium) var(--ease) 0ms; }
.cell:hover .tip { opacity: 1; transition-delay: 400ms; }
.mgrid td:nth-last-child(-n+2) .tip { left: auto; right: 0; }
.cell:focus-visible .tip { opacity: 1; }

/* Detail pane */
.detail { background: var(--surface1); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; animation: pane-in var(--duration-slow) var(--ease); }
@keyframes pane-in { from { opacity: 0; transform: translateX(8px); } }
.d-head { padding: var(--space-lg) var(--space-xl) var(--space-md); position: relative; }
.d-close { position: absolute; top: var(--space-md); right: var(--space-md); }
.d-crumb { font-size: var(--text-caption); color: var(--text3); margin-bottom: var(--space-xs); }
.d-head h2 { padding-right: var(--space-xl); }
.d-open { margin-top: var(--space-md); }
.d-block { padding: var(--space-sm) var(--space-xl) var(--space-md); }
.d-label { font-size: var(--text-label); font-weight: 500; color: var(--text3); margin-bottom: var(--space-xs); }
.d-talk { flex: 1; background: var(--background); border-top: 1px solid var(--border); padding: var(--space-lg) var(--space-xl); }
.d-talk .timeline { padding-top: var(--space-sm); }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-sm); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-sm); border-radius: var(--radius-element); background: var(--surface2); color: var(--text2); font-size: var(--text-label); font-weight: 500; line-height: 1; }
.contacts { display: flex; flex-wrap: wrap; column-gap: var(--space-lg); row-gap: var(--space-xs); margin-top: var(--space-12); }
.detail .contacts { flex-direction: column; }
.contact { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-body-sm); color: var(--text2); }
.contact i { color: var(--text3); font-size: 16px; }
.contact-num { color: var(--text3); }
.warn { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-sm); font-size: var(--text-caption); color: var(--warning); }
.board { list-style: none; }
.board li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); min-height: 36px; border-bottom: 1px solid var(--border); font-size: var(--text-body-sm); color: var(--text2); }
.board li:last-child { border-bottom: none; }
.board .cell { margin-left: 0; margin-right: calc(-1 * var(--space-sm)); }
.board .cell.is-review { margin-right: 0; }
.board .tip { left: auto; right: 0; }
.board.deliv li { padding: var(--space-sm) 0; align-items: flex-start; }
.deliv-main { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.deliv-name { color: var(--text1); font-weight: 500; }
.deliv-sub { display: block; font-size: var(--text-caption); color: var(--text3); font-weight: 400; }
.attach { display: inline-flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-sm); height: 32px; padding: 0 var(--space-12); background: var(--surface1); border: 1px solid var(--border); border-radius: var(--radius-control); max-width: 100%; color: var(--text1); }
.attach i { color: var(--text3); font-size: 14px; }
.attach-name { font-family: var(--font-mono); font-size: var(--text-label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.attach:hover { background: var(--surface2); }

/* Empty states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-3xl) var(--space-lg); }
.empty .emblem { color: var(--text2); margin-bottom: var(--space-md); }
.empty-title { font-size: var(--text-subheading); font-weight: 500; color: var(--text1); }
.empty-line { margin-top: var(--space-xs); color: var(--text2); max-width: 46ch; }
.empty-actions { margin-top: var(--space-lg); display: flex; gap: var(--space-sm); flex-wrap: wrap; justify-content: center; }


/* Timeline: a transcript, not bubbles */
.timeline { display: flex; flex-direction: column; gap: var(--space-lg); }
.day { display: flex; align-items: center; gap: var(--space-md); font-size: var(--text-caption); color: var(--text3); }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.entry { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-md); }
.lia-face { display: block; flex-shrink: 0; object-fit: cover; border-radius: var(--radius-control); background: var(--surface2); }
.av { width: 24px; height: 24px; border-radius: var(--radius-control); background: var(--surface2); color: var(--text2); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 500; line-height: 1; }
.who { font-size: var(--text-body-sm); font-weight: 500; line-height: 24px; }
.who time { font-weight: 400; font-size: var(--text-caption); color: var(--text3); margin-left: var(--space-sm); }
.who .channel { margin: 0 0 0 var(--space-sm); vertical-align: -1px; }
.who .channel + time { margin-left: var(--space-xs); }
.msg { max-width: 68ch; overflow-wrap: anywhere; }
/* Lia speaks in the serif; everyone else in the sans */
.msg-lia { font-family: var(--font-display); font-size: 17px; line-height: 1.5; }
.msg p + p, .msg ul + p { margin-top: var(--space-sm); }
.msg p + ul { margin-top: var(--space-xs); }
.msg ul { list-style: none; display: grid; gap: var(--space-xs); }
.msg li { position: relative; padding-left: var(--space-md); }
.msg li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 6px; height: 1px; background: var(--text3); }
.event { display: flex; align-items: flex-start; gap: var(--space-sm); padding-left: 40px; font-size: var(--text-caption); color: var(--text3); }
.event i { font-size: 14px; margin-top: 1px; }
.event.is-attention { color: var(--warning); font-weight: 500; }

/* Client page */
.client-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--space-2xl); align-items: start; }
[data-live="client-need"]:not(:empty) + .client-page { margin-top: var(--space-2xl); }
.client-side h2 { margin-bottom: var(--space-sm); }
.block { margin-top: var(--space-2xl); }
.block-title { font-size: var(--text-subheading); font-weight: 500; margin-bottom: var(--space-xs); }
.talk { background: var(--surface1); border: 1px solid var(--border); border-radius: var(--radius-component); position: sticky; top: var(--space-xl); display: flex; flex-direction: column; max-height: calc(100vh - 2 * var(--space-xl)); overflow: hidden; }
.talk-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md); padding: var(--space-lg) var(--space-lg) var(--space-md); border-bottom: 1px solid var(--border); }
.talk-meta { font-size: var(--text-caption); color: var(--text3); }
.talk-body { flex: 1; overflow-y: auto; background: var(--background); padding: var(--space-lg); }
.talk-body .empty, .d-talk .empty { padding: var(--space-2xl) var(--space-md); }
.reply { padding: var(--space-md) var(--space-lg) var(--space-lg); border-top: 1px solid var(--border); background: var(--surface1); }
.reply-box { border: 1px solid var(--border-visible); border-radius: var(--radius-control); background: var(--surface1); padding: var(--space-12); transition: border-color var(--duration-fast) var(--ease); }
.reply-box:focus-within { border-color: var(--text1); }
.reply-box:has(:focus-visible:not(textarea)) { outline: 2px solid var(--accent); outline-offset: 2px; }
.reply-box textarea { width: 100%; border: none; background: transparent; resize: none; min-height: 48px; field-sizing: content; max-height: 240px; font-size: var(--text-body); line-height: 1.55; outline: none; }
.reply-box textarea::placeholder { color: var(--text3); }
.reply-tools { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-sm); }
.reply-tools .btn-primary, .reply-tools .btn-brand { margin-left: auto; }
.reply-note { font-size: var(--text-caption); color: var(--text3); }
.disclose { margin-top: var(--space-md); }
.disclose[open] > summary { background: var(--surface2); }
.disclose > .card, .disclose > .form { margin-top: var(--space-12); }
.form-note { font-size: var(--text-caption); color: var(--text3); }
.copy { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-md); height: 40px; padding: 0 var(--space-xs) 0 var(--space-12); background: var(--surface3); border-radius: var(--radius-control); }
.copy-url { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: var(--text-label); color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy + .form-note, .consent-gen .btn { margin-top: var(--space-sm); }
.consent-gen { margin-top: var(--space-md); }

/* Lia, full height: transcript above, composer pinned below */
.main:has(> .chat) { padding: 0; }
.chat { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.chat-head { padding: var(--space-xl) var(--space-xl) var(--space-md); border-bottom: 1px solid var(--border); }
.msg a { text-decoration: underline; text-decoration-color: var(--border-visible); text-underline-offset: 3px; overflow-wrap: anywhere; }
.msg a:hover { text-decoration-color: currentColor; }
.chat-scroll { overflow-y: auto; padding: var(--space-xl); }
.chat-col { max-width: 720px; margin: 0 auto; }
.chat-head .chat-col { display: flex; align-items: center; gap: var(--space-md); }
.chat-head h1 { font-size: var(--text-heading); line-height: 1.1; }
.chat-head .subline { margin-top: 2px; }
.chat-foot { padding: var(--space-md) var(--space-xl) var(--space-lg); border-top: 1px solid var(--border); background: var(--background); }
.chat-scroll .alert { margin-bottom: var(--space-lg); }
.composer .reply-box { background: var(--surface1); }
.composer-note { font-size: var(--text-caption); color: var(--text3); margin-top: var(--space-sm); }
.files { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.files:empty { display: none; }
.files .attach { margin-top: var(--space-xs); }
.attach-btn { position: relative; overflow: hidden; }
.thinking { display: none; align-items: center; gap: var(--space-sm); font-size: var(--text-caption); color: var(--text3); }
.is-sending .thinking { display: inline-flex; }
.spinner { width: 14px; height: 14px; border: 1.5px solid var(--border); border-top-color: var(--text2); border-radius: 50%; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.starters { margin-top: var(--space-xl); display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); width: 100%; max-width: 520px; }
.starter { display: flex; align-items: center; gap: var(--space-12); height: 48px; padding: 0 var(--space-md); border: 1px solid var(--border); border-radius: var(--radius-component); background: var(--surface1); font-size: var(--text-body-sm); color: var(--text1); text-align: left; transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease); }
.starter i { font-size: 18px; color: var(--text3); }
.starter:hover { background: var(--surface2); border-color: var(--border-visible); }
.chat-scroll:has(.lia-hello) .chat-col { height: 100%; }

/* Forms */
.form { display: grid; gap: var(--space-md); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-md); align-items: start; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: var(--space-sm); min-width: 0; }
.field-label { font-size: var(--text-label); font-weight: 500; color: var(--text2); }
.field-hint { font-size: var(--text-caption); color: var(--text3); }
.date { display: flex; flex-direction: column; gap: var(--space-xs); flex: 1; min-width: 0; }
.date .input, .ag-dated-row .date .input { flex: none; font-variant-numeric: tabular-nums lining-nums; }
.date-day { min-height: 16px; font-size: var(--text-caption); color: var(--text3); font-variant-numeric: tabular-nums; }
.date-day.is-wrong { color: var(--error); }
.plan-status { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-md); font-size: var(--text-body-sm); color: var(--text2); }
.plan-status .ph { color: var(--text2); }
.plan-status.is-none { color: var(--text1); }
.plan-status a { color: var(--text1); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-visible); }
.undo-line { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-md); font-size: var(--text-body-sm); color: var(--text2); }
.undo-line .ph { color: var(--success); }
.sort { display: inline-flex; align-items: center; gap: var(--space-xs); color: inherit; text-decoration: none; }
.sort .sort-dir { opacity: 0; font-size: 12px; transition: opacity var(--duration-fast) var(--ease); }
.sort:hover .sort-dir, .sort.is-on .sort-dir { opacity: 1; }
.sort.is-on { color: var(--text1); }
.sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-element); }
mark { background: var(--surface3); color: var(--text1); border-radius: 2px; text-decoration: underline; text-decoration-color: var(--text3); text-underline-offset: 3px; }
.field-error { font-size: var(--text-caption); color: var(--error); }
.draft-note { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs); margin-bottom: var(--space-md); font-size: var(--text-caption); color: var(--text2); }
.input[aria-invalid] { border-color: var(--error); }
.input[data-money] { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.input, .textarea, .select select { height: 40px; width: 100%; padding: 0 var(--space-12); border-radius: var(--radius-control); border: 1px solid var(--border-visible); background: var(--surface1); color: var(--text1); font-size: var(--text-body); font-weight: 400; transition: border-color var(--duration-fast) var(--ease); }
.textarea { height: auto; min-height: 96px; max-height: 60vh; padding: var(--space-12); line-height: 1.55; resize: vertical; field-sizing: content; }
.input:hover, .textarea:hover, .select select:hover { border-color: var(--text3); }
.input:focus, .textarea:focus, .select select:focus { border-color: var(--text1); outline: 2px solid var(--accent); outline-offset: 2px; }
.input[readonly] { background: var(--surface3); color: var(--text2); border-color: var(--border); }
.input::placeholder, .textarea::placeholder { color: var(--text3); }
input[type=number].input { appearance: textfield; -moz-appearance: textfield; }
input[type=number].input::-webkit-inner-spin-button, input[type=number].input::-webkit-outer-spin-button { appearance: none; margin: 0; }
input[type=date].input::-webkit-calendar-picker-indicator { opacity: 0.55; cursor: pointer; }
@media (prefers-color-scheme: dark) { input[type=date].input::-webkit-calendar-picker-indicator { filter: invert(1); } }
.select { position: relative; display: block; }
.select select { appearance: none; padding-right: 36px; cursor: pointer; }
.select i { position: absolute; right: var(--space-12); top: 50%; transform: translateY(-50%); font-size: 16px; color: var(--text3); pointer-events: none; }
.month .select select { height: 32px; border-color: transparent; background: transparent; color: var(--text2); padding-left: var(--space-sm); font-size: var(--text-body); }
.month .select select:hover { border-color: var(--border-visible); color: var(--text1); }
.check { display: flex; align-items: flex-start; gap: var(--space-sm); font-size: var(--text-body); cursor: pointer; position: relative; }
.check input { position: absolute; opacity: 0; width: 16px; height: 16px; margin-top: 4px; }
.check-box { width: 16px; height: 16px; margin-top: 4px; border: 1px solid var(--border-visible); border-radius: var(--radius-element); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: transparent; transition: background var(--duration-fast) var(--ease); }
.check-box i { font-size: 12px; }
.check:hover .check-box { border-color: var(--text3); }
.check input:checked + .check-box { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.check input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check small { display: block; font-size: var(--text-caption); color: var(--text3); }
.checks { display: grid; gap: var(--space-12); margin-top: var(--space-xs); }
.file { position: relative; display: flex; align-items: center; gap: var(--space-12); height: 48px; padding: 0 var(--space-xs) 0 var(--space-12); border: 1px dashed var(--border-visible); border-radius: var(--radius-control); background: var(--surface3); color: var(--text2); font-size: var(--text-body-sm); cursor: pointer; transition: border-color var(--duration-fast) var(--ease); }
.file:hover { border-color: var(--text3); }
.file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.file i { font-size: 16px; color: var(--text3); }
.file-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file.has-file { border-style: solid; background: var(--surface1); }
.file-thumb { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--radius-element); overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file.has-file .file-thumb { background: var(--surface3); }
.chip-size { flex-shrink: 0; font-size: var(--text-caption); color: var(--text3); font-variant-numeric: tabular-nums; }
.file-size { flex-shrink: 0; font-size: var(--text-caption); color: var(--text3); font-variant-numeric: tabular-nums; }
[data-file-zone] { transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease); }
[data-file-zone].is-file-over { border-color: var(--text1); background: var(--surface2); }
[data-file-zone].is-file-over .file { border-color: var(--text1); border-style: solid; }
.file.has-file .file-text { color: var(--text1); font-family: var(--font-mono); font-size: var(--text-label); }
.file-pick { height: 32px; padding: 0 var(--space-12); display: inline-flex; align-items: center; border: 1px solid var(--border-visible); border-radius: var(--radius-control); background: var(--surface1); color: var(--text1); font-weight: 500; }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.form-actions { display: flex; gap: var(--space-sm); justify-content: flex-end; align-items: center; }
.form-actions .thinking { margin-right: auto; }
.save-state { display: inline-flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; font-size: var(--text-caption); color: var(--text3); }
.save-state:empty { display: none; }
.save-state.is-ok { color: var(--text2); }
.save-state.is-ok .ph { color: var(--success); }
.save-state.is-error { color: var(--error); }
.save-state .link-btn { margin-left: var(--space-xs); }
.switch-undo { display: flex; align-items: center; gap: var(--space-xs); margin-top: var(--space-2xs); color: var(--text2); }
.switch-undo .ph { color: var(--success); }
fieldset { border: none; min-width: 0; }
legend { font-size: var(--text-label); font-weight: 500; color: var(--text3); margin-bottom: var(--space-xs); }
.switches + .switches { margin-top: var(--space-lg); }
.switches.two { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-xl); }
.switches.two legend { grid-column: 1 / -1; }
.switches.two .switch-row:nth-last-child(2):nth-child(odd), .switches.two .switch-row:last-child { border-bottom: none; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); min-height: 52px; padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switches .switch-row:last-child { border-bottom: none; }
.switch-row > .noun { align-self: flex-start; margin: 3px 0 0; }
.switch-row:not(:has(small)) > .noun { align-self: center; margin-top: 0; }
.switch-text { flex: 1; min-width: 0; }
.switch-text small { display: block; color: var(--text3); font-size: var(--text-caption); }
.switch-text .switch-note { color: var(--text2); margin-top: var(--space-2xs); }
.holds { padding-block: var(--space-xs); }
.hold { display: flex; align-items: center; gap: var(--space-md); min-height: 64px; padding: var(--space-sm) 0; }
.hold + .hold { border-top: 1px solid var(--border); }
.hold > i { font-size: 16px; color: var(--text2); flex-shrink: 0; }
.hold-body { flex: 1; min-width: 0; }
.hold-title { font-weight: 500; }
.hold-title span { color: var(--text2); font-weight: 400; }
.hold-sub { font-size: var(--text-caption); color: var(--text3); font-variant-numeric: tabular-nums lining-nums; }
@media (max-width: 640px) {
  .hold { flex-wrap: wrap; align-items: flex-start; column-gap: var(--space-12); row-gap: 0; }
  .hold > i { margin-top: 3px; }
  .hold-body { flex-basis: calc(100% - 28px); }
  .hold form { margin-left: 16px; }
}
.switch { appearance: none; width: 36px; height: 20px; border-radius: var(--radius-control); background: var(--surface3); border: 1px solid var(--border-visible); position: relative; cursor: pointer; flex-shrink: 0; transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: var(--radius-element); background: var(--surface1); transition: transform var(--duration-fast) var(--ease); }
.switch:checked { background: var(--ink); border-color: var(--ink); }
.switch:checked::after { transform: translateX(16px); background: var(--on-ink); }
.switch:hover { border-color: var(--text3); }
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr 0.8fr; gap: var(--space-sm); }
.contact-row { display: contents; }
.team + .team { margin-top: var(--space-lg); }
.team-person { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(180px, 220px); align-items: center; gap: var(--space-12); min-height: 56px; border-bottom: 1px solid var(--border); }
.team-person:last-child { border-bottom: none; }
.team-who { display: grid; min-width: 0; font-size: var(--text-body-sm); }
.team-who > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-who small { color: var(--text3); font-size: var(--text-caption); }
.team-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 220px); gap: var(--space-sm); margin-top: var(--space-xs); }

/* Settings and long forms: the label speaks on the left, the controls work on the right */
.settings { display: grid; }
.settings > .alert { margin-bottom: var(--space-lg); }
.settings-row { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: var(--space-2xl); padding: var(--space-xl) 0; border-top: 1px solid var(--border); }
.settings-row:first-of-type { border-top: none; padding-top: 0; }
.settings-label p { margin-top: var(--space-sm); font-size: var(--text-body-sm); color: var(--text2); max-width: 36ch; }
.settings-body { max-width: 760px; }
.settings-actions { display: flex; justify-content: flex-end; gap: var(--space-sm); padding-top: var(--space-lg); border-top: 1px solid var(--border); max-width: calc(300px + var(--space-2xl) + 760px); }
.scope { display: flex; align-items: center; gap: var(--space-sm); margin-left: auto; }
.scope-label { font-size: var(--text-body-sm); color: var(--text3); }
.scope .select { min-width: 240px; }
.scope .select select { height: 36px; font-size: var(--text-body-sm); }
.account { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.account p { margin-top: var(--space-2xs); }
.base-rules { font-size: var(--text-body-sm); color: var(--text2); display: grid; gap: var(--space-sm); }
.base-rules .msg, .base-rules p { max-width: 72ch; }
.base-rules strong { color: var(--text1); display: block; margin-top: var(--space-sm); }

/* Alerts */
.alert { display: flex; gap: var(--space-12); align-items: flex-start; padding: var(--space-md); border-radius: var(--radius-component); font-size: var(--text-body-sm); }
.page-head + .alert, .crumb + .alert { margin-bottom: var(--space-lg); }
.alert i { font-size: 16px; margin-top: 2px; }
.alert-info { background: var(--surface1); border: 1px solid var(--border); }
.alert-info i { color: var(--text2); }
.alert-success { background: var(--success-bg); }
.alert-success i { color: var(--success); }
.alert-warning { background: var(--warning-bg); }
.alert-warning i { color: var(--warning); }
.alert-error { background: var(--error-bg); }
.alert-error i { color: var(--error); }

/* Lists of clients */
.table { width: 100%; border-collapse: collapse; }
.table thead th { font-size: var(--text-label); font-weight: 500; color: var(--text3); text-align: left; height: 40px; padding: 0 var(--space-12); border-bottom: 1px solid var(--border-visible); }
.table tbody th, .table td { height: 56px; padding: var(--space-sm) var(--space-12); border-bottom: 1px solid var(--border); text-align: left; font-weight: 400; color: var(--text2); }
.table tbody th a { color: var(--text1); font-weight: 500; }
.table tbody tr { cursor: pointer; transition: background var(--duration-fast) var(--ease); }
.table tbody tr:hover { background: var(--surface2); }
.table .num { text-align: right; }
.row-sub { display: block; font-size: var(--text-caption); color: var(--text3); font-weight: 400; }
.table.clients .mbar { margin: 0; }
.table.clients .mbar-track { flex: none; width: 120px; }

/* Pages outside the app frame */
.solo { min-height: 100vh; min-height: 100dvh; }
.solo-foot { font-size: var(--text-caption); color: var(--text3); }
.solo-center { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; padding: var(--space-xl); text-align: center; }
.solo-center .wordmark { justify-self: start; }
.error-body { align-self: center; display: flex; flex-direction: column; align-items: center; max-width: 440px; }
.error-body .lia-mark { color: var(--text3); margin-bottom: var(--space-lg); }
.error-body p { margin: var(--space-sm) 0 var(--space-xl); color: var(--text2); }

.step { display: grid; gap: var(--space-md); }
.step-head { display: flex; align-items: center; gap: var(--space-12); }
.step-head h2 { flex: 1; }
.step-head .cell { margin-left: 0; margin-right: calc(-1 * var(--space-sm)); }
.step-n { width: 28px; height: 28px; border-radius: var(--radius-control); background: var(--surface2); color: var(--text1); display: inline-flex; align-items: center; justify-content: center; font-size: var(--text-body-sm); font-weight: 500; flex-shrink: 0; }
.step-n.is-done { background: transparent; border: 1px solid var(--border); color: var(--text3); }
.step-why { color: var(--text2); max-width: 60ch; }
.step-done { font-size: var(--text-body-sm); color: var(--text3); }
.steps { margin-left: var(--space-lg); display: grid; gap: var(--space-sm); color: var(--text2); font-size: var(--text-body-sm); }
.steps li::marker { color: var(--text3); }
.steps strong { color: var(--text1); }
.step-confirm { border-top: 1px solid var(--border); padding-top: var(--space-md); grid-template-columns: 1fr auto; align-items: center; }
.step-note { display: flex; gap: var(--space-12); font-size: var(--text-body-sm); color: var(--text2); border-top: 1px solid var(--border); padding-top: var(--space-md); }
.step-note i { font-size: 18px; color: var(--text3); flex-shrink: 0; }

/* The bank step: one question, two answers, one action under the chosen one */
.choice { border: 0; display: grid; gap: var(--space-sm); border-top: 1px solid var(--border); padding-top: var(--space-md); }
.choice legend { float: left; width: 100%; font-family: var(--font-display); font-size: 19px; color: var(--text1); margin-bottom: var(--space-12); }
.choice-opt { border: 1px solid var(--border); border-radius: var(--radius-component); transition: border-color var(--duration-fast) var(--ease); }
.choice-opt:has(input:checked) { border-color: var(--border-visible); background: var(--background); }
.choice-row { display: flex; align-items: flex-start; gap: var(--space-12); min-height: 64px; padding: var(--space-12) var(--space-md); cursor: pointer; position: relative; }
.choice-row input { position: absolute; opacity: 0; width: 16px; height: 16px; margin-top: 3px; }
.radio { margin-top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border-visible); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; transition: border-color var(--duration-fast) var(--ease); }
.choice-row:hover .radio { border-color: var(--text3); }
.choice-row input:checked + .radio { border-color: var(--ink); }
.choice-row input:checked + .radio::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.choice-row input:focus-visible + .radio { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-text { display: grid; gap: var(--space-2xs); }
.choice-title { font-size: var(--text-body); font-weight: 500; color: var(--text1); }
.choice-line { font-size: var(--text-body-sm); color: var(--text3); }
.choice-panel { display: none; gap: var(--space-md); padding: 0 var(--space-md) var(--space-md) calc(var(--space-md) + 16px + var(--space-12)); color: var(--text2); max-width: 64ch; }
.choice-opt:has(input:checked) .choice-panel { display: grid; }
.bank-status { font-size: var(--text-body-sm); color: var(--text2); min-height: 1lh; }
.bank-status:empty { display: none; }
.bank-list li { padding: var(--space-12) 0; }
.bank-name { display: grid; gap: var(--space-2xs); }
.bank-ok { color: var(--success); opacity: 0.7; font-size: 16px; }
.step .disclose > .choice { margin-top: var(--space-12); }
.block-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-sm); }

/* Thresholds: login, consent page, first run. Lia's face, one photograph, the serif speaking, brand green */
.photo { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .photo { filter: brightness(0.86); } }
.threshold-title { font-family: var(--font-display); font-size: var(--text-lp-heading); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
.threshold-title em { color: var(--text2); }
.threshold-voice { font-family: var(--font-display); font-size: 19px; line-height: 1.5; color: var(--text2); max-width: 46ch; text-wrap: pretty; }
.btn-threshold { font-family: var(--font-display); font-size: 18px; font-weight: 500; height: 44px; padding: 0 var(--space-lg); letter-spacing: -0.005em; }
.threshold-actions { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; }
.lia-sign { display: flex; align-items: center; gap: var(--space-md); }
.lia-sign span { display: flex; flex-direction: column; font-size: var(--text-caption); color: var(--text3); line-height: 1.35; }
.lia-sign strong { font-size: var(--text-body); color: var(--text1); }
.lia-says { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--space-md); align-items: start; }

.door { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 7fr) minmax(440px, 5fr); }
.door-photo { position: sticky; top: 0; height: 100vh; height: 100dvh; object-position: 50% 80%; }
.door-first-run .door-photo { object-position: 38% 70%; }
.door-consent .door-photo { object-position: 30% 75%; }
.door-panel { display: grid; grid-template-rows: auto 1fr auto; padding: var(--space-xl) var(--space-3xl); border-left: 1px solid var(--border); }
.door-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md); }
.door-aside { font-size: var(--text-body-sm); color: var(--text3); }
.door-aside a, .door-link, .door-body .alert a { color: var(--text1); text-decoration: underline; text-decoration-color: var(--border-visible); text-underline-offset: 3px; }
.door-aside a:hover, .door-link:hover, .door-body .alert a:hover { text-decoration-color: currentColor; }
.door-body { align-self: center; display: grid; gap: var(--space-xl); max-width: 400px; padding: var(--space-2xl) 0; }
.door-body .threshold-voice strong { font-weight: 500; color: var(--text1); overflow-wrap: anywhere; }
.door-form { gap: var(--space-md); }
.door-hello { color: var(--text2); font-size: var(--text-body-sm); }
.door-hello strong { font-weight: 500; color: var(--text1); overflow-wrap: anywhere; }
.door-form .btn-block { height: 44px; margin-top: var(--space-sm); }
.door-form .form-note, .door-link { justify-self: center; text-align: center; }
.door-link { font-size: var(--text-body-sm); color: var(--text2); }
.door-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.door-actions .btn-ghost { margin-left: calc(-1 * var(--space-md)); }

.consent { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: 100vh; min-height: 100dvh; }
.consent-intro { position: sticky; top: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: minmax(160px, 1fr) auto; border-right: 1px solid var(--border); }
.consent-photo { object-position: 50% 70%; }
.consent-hero { display: grid; gap: var(--space-lg); padding: var(--space-xl) var(--space-3xl) var(--space-2xl); }
.letterhead { font-family: var(--font-display); font-size: var(--text-heading); font-weight: 500; }
.consent-for { border-top: 1px solid var(--border); padding-top: var(--space-lg); }
.consent-for h1 { margin-top: var(--space-2xs); }
.progress { display: flex; align-items: center; gap: var(--space-12); margin-top: var(--space-md); font-size: var(--text-caption); color: var(--text3); }
.progress-marks { display: inline-flex; gap: var(--space-xs); }
.progress-marks span { width: 32px; height: 4px; border-radius: 2px; background: var(--surface3); }
.progress-marks span.is-done { background: var(--text3); }
.consent-steps { padding: var(--space-3xl); display: grid; gap: var(--space-lg); align-content: center; max-width: 760px; min-height: 100vh; min-height: 100dvh; }
.consent-steps > .solo-foot { margin-top: var(--space-sm); }
.assure { list-style: none; display: grid; gap: var(--space-12); padding: var(--space-md) 0 0; }
.assure li { display: flex; gap: var(--space-12); font-size: var(--text-body-sm); color: var(--text2); max-width: 60ch; }
.assure i { font-size: 18px; color: var(--text3); flex-shrink: 0; }

/* First run inside the app: the photograph beside Lia asking for the clients */
.first-run { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--space-3xl); align-items: center; min-height: calc(100vh - 220px); }
.first-run-photo { height: auto; aspect-ratio: 4 / 3; border-radius: var(--radius-component); }
.first-run-copy { display: grid; gap: var(--space-lg); max-width: 480px; }
.first-run-copy .threshold-actions { margin-top: var(--space-sm); }

.lia-hello { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-2xl) 0 var(--space-xl); min-height: 100%; justify-content: center; gap: var(--space-md); }
.lia-portrait { width: 168px; height: 168px; object-fit: cover; border-radius: var(--radius-component); margin-bottom: var(--space-sm); }
.lia-hello .threshold-title { font-size: var(--text-display); font-weight: 500; }

/* Mid widths: the rail keeps only its icons */
/* Search on O mês: "/" focuses it, the grid filters as you type */
.search { display: inline-flex; align-items: center; gap: var(--space-sm); height: 36px; width: 240px; padding: 0 var(--space-sm) 0 var(--space-12); border: 1px solid var(--border-visible); border-radius: var(--radius-control); background: var(--surface1); color: var(--text3); transition: border-color var(--duration-fast) var(--ease); }
.search:focus-within { border-color: var(--text1); }
.search input { flex: 1; min-width: 0; height: 100%; border: none; background: transparent; font-size: var(--text-body-sm); color: var(--text1); outline: none; }
.search input::placeholder { color: var(--text3); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font-family: var(--font-mono); font-size: 11px; line-height: 18px; padding: 0 6px; color: var(--text3); border: 1px solid var(--border); border-radius: var(--radius-element); }
.search:focus-within kbd { visibility: hidden; }
.mgrid tbody th:focus-visible, .mgrid td:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 0; }

/* The chat: what you are about to send, what is still on its way */
.chip { position: relative; display: inline-flex; align-items: center; gap: var(--space-sm); height: 40px; max-width: 260px; padding: 0 var(--space-2xs) 0 var(--space-xs); background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-control); }
.chip-thumb { width: 30px; height: 30px; border-radius: var(--radius-element); object-fit: cover; flex: none; }
.chip-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--text3); flex: none; }
.chip .attach-name { color: var(--text1); }
.chip-x { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-element); color: var(--text3); flex: none; }
.chip-x:hover { background: var(--surface3); color: var(--text1); }
.files:not(:empty) { margin-bottom: var(--space-sm); gap: var(--space-sm); }
.files .chip { margin: 0; }
.entry.is-pending .msg, .entry.is-pending .attach { opacity: 0.62; }
.attachments { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.attachments .attach { margin-top: var(--space-xs); }
.attachments + .msg { margin-top: var(--space-xs); }
.pending { margin-left: var(--space-sm); display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-caption); color: var(--text3); }
.pending i { font-size: 12px; }
.entry.is-failed .pending { color: var(--error); }
.pending button { color: var(--text1); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.drop-veil { position: fixed; inset: 12px; z-index: 60; display: none; place-items: center; background: color-mix(in srgb, var(--background) 90%, transparent); border: 1.5px dashed var(--text3); border-radius: var(--radius-container); pointer-events: none; }
.is-dragging .drop-veil { display: grid; }
.drop-veil div { display: grid; justify-items: center; gap: var(--space-sm); text-align: center; }
.drop-veil i { font-size: 28px; color: var(--text2); }
.drop-veil strong { font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--text1); }
.drop-veil span { font-size: var(--text-body-sm); color: var(--text3); }
.only-phone { display: none !important; }


/* Arquivo: a drawer per client, a month per competência, the checklist's folders inside */
.cab { display: grid; grid-template-columns: 280px 196px minmax(0, 1fr); align-items: start; border-top: 1px solid var(--border-visible); }
.cab.is-empty-drawer { grid-template-columns: 280px minmax(0, 1fr); }
.cab-col { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: var(--space-md) 0 var(--space-xl); border-right: 1px solid var(--border); }
.cab-col-head { display: flex; justify-content: space-between; gap: var(--space-sm); min-height: 24px; font-size: var(--text-label); font-weight: 500; color: var(--text3); padding: 0 var(--space-md) var(--space-sm); }
.only-phone-name { display: none; }
.cab-list { list-style: none; }
.drawer, .mrow { position: relative; display: flex; flex-direction: column; transition: background var(--duration-fast) var(--ease); }
.drawer { gap: 2px; padding: var(--space-12) var(--space-md); border-bottom: 1px solid var(--border); }
.drawer:hover, .mrow:hover, .drawer.is-open, .mrow.is-open { background: var(--surface2); }
.drawer.is-open::before, .mrow.is-open::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.drawer-name { font-weight: 500; color: var(--text1); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-sub { font-size: var(--text-caption); color: var(--text3); line-height: 1.35; }
.drawer .mbar, .mrow .mbar { margin: var(--space-xs) 0 0; gap: var(--space-sm); font-size: var(--text-label); }
.drawer .mbar-track { max-width: 132px; }
.mbar-none { color: var(--text4); }
.year { font-size: var(--text-label); font-weight: 500; color: var(--text3); padding: var(--space-md) var(--space-md) var(--space-xs); }
.year:first-of-type { padding-top: var(--space-xs); }
.mrow { justify-content: center; min-height: 52px; padding: var(--space-sm) var(--space-md); font-size: var(--text-body-sm); color: var(--text2); }
.mrow.is-open { color: var(--text1); font-weight: 500; }
.mrow.is-open .mbar { font-weight: 400; }
.mrow .mbar-track { max-width: 88px; }
.mrow.is-full .mrow-name { color: var(--text3); }
.cab-month { padding: var(--space-lg) 0 var(--space-2xl) var(--space-xl); min-width: 0; }
.month-crumb { font-size: var(--text-caption); color: var(--text3); margin-bottom: var(--space-xs); }
.month-crumb a:hover { color: var(--text1); text-decoration: underline; text-underline-offset: 3px; }
.month-head .mbar { margin-top: var(--space-md); }
.month-head .mbar-track { max-width: 280px; }
.drop-hint { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-xs); font-size: var(--text-caption); color: var(--text3); }
.drop-hint i { font-size: 14px; }
.folders { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); margin-top: var(--space-xl); max-width: 760px; }
.folder:focus-visible { outline: none; }
.folder:focus-visible .folder-body, .folder:focus-visible .folder-tab { border-color: var(--text1); }
.folder-tab { display: inline-flex; align-items: center; height: 40px; padding: 0 var(--space-lg) 0 var(--space-md); background: var(--surface1); border: 1px solid var(--border-visible); border-bottom: none; border-radius: var(--radius-component) var(--radius-component) 0 0; position: relative; z-index: 1; margin-bottom: -1px; transition: border-color var(--duration-fast) var(--ease); }
.folder-tab .noun { font-size: 20px; }
.folder-name { font-family: var(--font-display); font-size: var(--text-heading); font-weight: 500; line-height: 1; letter-spacing: -0.005em; padding-top: 2px; }
.folder-body { background: var(--surface1); border: 1px solid var(--border-visible); border-radius: 0 var(--radius-component) var(--radius-component) var(--radius-component); padding: 0 var(--space-lg) var(--space-sm); transition: border-color var(--duration-fast) var(--ease); }
.folder.is-settled .folder-name { color: var(--text2); }
.folder.is-settled .folder-tab, .folder.is-settled .folder-body { border-color: var(--border); }
.folder-head { display: flex; align-items: center; gap: var(--space-md); min-height: 48px; border-bottom: 1px solid var(--border); }
.folder-head > .cell { margin-left: calc(-1 * var(--space-sm)); }
.folder-quiet { font-size: var(--text-caption); color: var(--text3); }
.folder-due { margin-left: auto; font-size: var(--text-caption); color: var(--text3); white-space: nowrap; }
.folder-head .add { margin-right: calc(-1 * var(--space-12)); }
.add .file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.papers, .missing { list-style: none; }
.paper { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; align-items: center; column-gap: var(--space-12); min-height: 56px; padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); }
.paper:last-child { border-bottom: none; }
.paper > i { font-size: 18px; color: var(--text3); }
.paper-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.paper-name { font-family: var(--font-mono); font-size: var(--text-label); line-height: 1.5; color: var(--text1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.paper-name:hover { text-decoration: underline; text-decoration-color: var(--border-visible); text-underline-offset: 3px; }
.paper-name.is-record { font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--text2); }
.paper-sub { font-size: var(--text-caption); color: var(--text3); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-sub .via { margin-right: var(--space-xs); }
.paper-flag { display: inline-flex; align-items: center; gap: var(--space-sm); font-size: var(--text-caption); font-weight: 500; color: var(--warning); white-space: nowrap; }
.folder-head:last-child { border-bottom: none; }
.paper.is-pending { opacity: 0.62; }
.paper.is-failed .paper-sub { color: var(--error); white-space: normal; }
.paper .pending-mark { display: inline-flex; align-items: center; gap: var(--space-xs); }
.paper.is-failed button { text-decoration: underline; text-underline-offset: 3px; color: var(--text1); margin-left: var(--space-xs); }
.papers + .missing { border-top: 1px solid var(--border); }
.miss { display: flex; align-items: center; gap: var(--space-12); min-height: 44px; font-size: var(--text-body-sm); color: var(--text2); }
.miss + .miss { border-top: 1px solid var(--border); }
.miss .cell-ring, .miss .cell-dot { margin: 0 6px 0 5px; }
.miss .late-mark { font-size: 16px; margin: 0 1px; }
.miss-label { display: inline-flex; align-items: center; }
.miss.is-late .noun { color: currentColor; }
.miss.is-nudged { color: var(--text1); }
.miss.is-late { color: var(--error); }
.miss.is-late .miss-label { font-weight: 500; }
.miss-by { margin-left: auto; font-size: var(--text-caption); color: var(--text3); white-space: nowrap; }
.miss.is-late .miss-by { color: var(--error); }
.folder-empty { padding: var(--space-md) 0 var(--space-sm); font-size: var(--text-body-sm); color: var(--text3); }
.cab-empty { align-self: stretch; display: grid; place-items: center; min-height: 480px; }
.cab-empty .empty { max-width: 560px; }
.ghost-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-sm); margin-bottom: var(--space-xl); padding-bottom: 0; border-bottom: 1px dashed var(--border-visible); }
.ghost-tabs .folder-tab { height: 36px; margin-bottom: 0; background: transparent; border-style: dashed; border-color: var(--border-visible); color: var(--text3); font-family: var(--font-display); font-size: var(--text-heading); font-weight: 500; line-height: 1; padding: 2px var(--space-md) 0; border-bottom: none; }
.found { border-top: 1px solid var(--border-visible); padding-top: var(--space-md); max-width: 880px; }
.found .cab-col-head { padding: 0 0 var(--space-sm); }
.found .papers { border-top: 1px solid var(--border); }
.cab-back { display: none; }
/* A paper read into rows opens to them: the rows read-only, each marked literal or a conferir */
.paper.has-rows { display: block; padding: 0; }
.rows-fold > summary { list-style: none; cursor: pointer; }
.rows-fold > summary::-webkit-details-marker { display: none; }
.paper-line { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto auto; align-items: center; column-gap: var(--space-12); min-height: 56px; padding: var(--space-sm) 0; }
.paper-line > i:first-child { font-size: 18px; color: var(--text3); }
.paper-line:hover .rows-caret, .paper-line:focus-visible .rows-caret { color: var(--text1); }
.paper-line:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-element); }
.rows-caret { font-size: 14px; color: var(--text3); transition: transform var(--duration-fast) var(--ease); }
.rows-fold[open] .rows-caret { transform: rotate(180deg); }
.rows-sum { display: inline-flex; align-items: center; gap: var(--space-md); font-size: var(--text-caption); color: var(--text3); white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.rows-open { display: inline-flex; align-items: center; gap: var(--space-sm); color: var(--warning); font-weight: 500; }
.rows { padding: 0 0 var(--space-md) 32px; }
.rtable-wrap { overflow-x: auto; }
.rtable { width: 100%; border-collapse: collapse; font-size: var(--text-body-sm); font-variant-numeric: tabular-nums lining-nums; }
.rtable th { height: 32px; padding: 0 var(--space-12); font-size: var(--text-label); font-weight: 500; color: var(--text3); text-align: left; border-bottom: 1px solid var(--border-visible); white-space: nowrap; }
.rtable td { height: 40px; padding: var(--space-xs) var(--space-12); color: var(--text1); border-bottom: 1px solid var(--border); vertical-align: middle; }
.rtable th:first-child, .rtable td:first-child { padding-left: 0; }
.rtable .num { text-align: right; white-space: nowrap; }
.rtable td.is-out { color: var(--text2); }
.rtable td.mono, .inv-key .mono { font-family: var(--font-mono); font-size: var(--text-label); }
.inv-key .mono { word-break: break-all; }
.rtable .cell-sub.mono { font-family: var(--font-mono); max-width: 230px; line-height: 1.5; margin-top: 2px; }
.rtable tr:last-child td { border-bottom: none; }
.rtable td { white-space: nowrap; }
.rtable td.is-desc, .rtable td.is-wrap { white-space: normal; min-width: 160px; }
.rtable tr[id], .inv-head[id], .rows-fold[id] { scroll-margin-top: 120px; }
.rtable .cell-sub { display: block; font-size: var(--text-label); color: var(--text3); }
.rtable .proof { margin-left: var(--space-xs); font-size: 13px; color: var(--text3); vertical-align: -1px; }
.basis-cell { white-space: nowrap; text-align: right; width: 1%; }
.basis { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: var(--text-label); color: var(--text3); }
.basis.is-literal i { font-size: 14px; color: var(--success); opacity: 0.75; }
.basis.is-proposed .cell-dot { margin: 0 3px; }
.basis.is-proposed { color: var(--warning); font-weight: 500; gap: var(--space-sm); }
.row-acts { display: inline-flex; align-items: center; gap: 2px; margin-left: var(--space-sm); }
.row-acts form { display: inline; }
.row-acts .btn { height: 28px; padding: 0 var(--space-sm); color: var(--text1); }
.row-acts .btn-icon { width: 28px; padding: 0; justify-content: center; }
.row-fix td { background: var(--surface2); padding: var(--space-md) var(--space-12) var(--space-md) var(--space-md) !important; }
.fix-line { font-size: var(--text-caption); color: var(--text2); margin-bottom: var(--space-12); }
.fix-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-12) var(--space-md); }
.fix-field { display: flex; flex-direction: column; gap: var(--space-xs); font-size: var(--text-label); color: var(--text3); }
.fix-field.is-wide { grid-column: span 2; }
.fix-field .input { height: 36px; font-size: var(--text-body-sm); }
.fix-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-md); }
.inv + .inv { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--border-visible); }
.inv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; column-gap: var(--space-md); padding: var(--space-xs) 0 var(--space-12); }
.inv-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inv-title { font-size: var(--text-body-sm); font-weight: 500; color: var(--text1); }
.inv-parties, .inv-taxes { font-size: var(--text-caption); color: var(--text2); line-height: 1.45; }
.inv-parties i { font-size: 11px; color: var(--text3); margin: 0 2px; }
.inv-taxes { color: var(--text3); font-variant-numeric: tabular-nums lining-nums; }
.inv-total { font-size: var(--text-body-sm); font-weight: 500; font-variant-numeric: tabular-nums lining-nums; padding-top: 1px; }
.inv-key { margin-top: var(--space-sm); font-size: var(--text-label); color: var(--text3); }
.map-strip { display: flex; align-items: center; gap: var(--space-lg); padding: var(--space-12) var(--space-md); margin-bottom: var(--space-md); background: var(--warning-bg); border-radius: var(--radius-control); }
.map-strip p { flex: 1; font-size: var(--text-caption); color: var(--text1); line-height: 1.5; }
.map-strip .mono { font-family: var(--font-mono); font-size: var(--text-label); }
.map-strip .btn { white-space: nowrap; background: var(--surface1); }
.export-line { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs); padding: var(--space-12) 0 var(--space-xs); border-top: 1px solid var(--border); font-size: var(--text-caption); color: var(--text3); }
.export-line i { font-size: 14px; margin-right: 2px; }
.export-line a { color: var(--text2); text-decoration: underline; text-decoration-color: var(--border-visible); text-underline-offset: 3px; }
.export-line a:hover { color: var(--text1); }
.month-head .export-line { border-top: none; padding: var(--space-md) 0 0; }
/* Dragging a file over the cabinet: the place it would land, outlined, and named below */
[data-drop].is-drop-over { outline: 1.5px dashed var(--text2); outline-offset: -2px; }
.folder.is-drop-over { outline: none; }
.folder.is-drop-over .folder-tab, .folder.is-drop-over .folder-body { border-color: var(--text1); border-style: dashed; }
.folder.is-drop-over .folder-tab { border-bottom: none; }
.drop-label { position: fixed; left: 50%; bottom: var(--space-xl); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--on-ink); font-size: var(--text-body-sm); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-control); pointer-events: none; white-space: nowrap; }
.lia-notes { position: fixed; right: var(--space-xl); bottom: var(--space-xl); z-index: 50; display: grid; gap: var(--space-sm); width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.lia-note { pointer-events: auto; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--space-12); align-items: start; padding: var(--space-12) var(--space-md); background: var(--surface1); border: 1px solid var(--border-visible); border-radius: var(--radius-component); animation: pane-in var(--duration-slow) var(--ease); }
.lia-note .msg-lia { font-size: 17px; line-height: 1.45; }
.lia-note .who { line-height: 24px; }
.lia-note.is-error .msg { color: var(--error); font-size: var(--text-body-sm); }
.lia-note.is-error .btn { margin: var(--space-xs) 0 0 calc(-1 * var(--space-12)); color: var(--text1); }
.thinking-line { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-caption); color: var(--text3); line-height: 1.4; }
.lia-note a { display: inline-block; margin-top: var(--space-xs); font-size: var(--text-caption); color: var(--text2); text-decoration: underline; text-decoration-color: var(--border-visible); text-underline-offset: 3px; }
.lia-note a:hover { color: var(--text1); }

@media (max-width: 1180px) {
  .app { grid-template-columns: var(--rail-collapsed) minmax(0, 1fr); }
  .app.with-pane { grid-template-columns: var(--rail-collapsed) minmax(0, 1fr) 380px; }
  .rail { align-items: center; padding: var(--space-lg) 0; }
  .rail-mark { padding: 0; justify-content: center; }
  .rail-mark span, .rail .nav-label, .rail-who { display: none; }
  .rail-item { width: 40px; height: 40px; justify-content: center; padding: 0; }
  .rail-foot { padding: 0; }
  .settings-row { grid-template-columns: 1fr; gap: var(--space-lg); }
  .door-panel, .consent-hero { padding-left: var(--space-xl); padding-right: var(--space-xl); }
  .consent-steps { padding: var(--space-2xl) var(--space-xl); }
  .first-run { gap: var(--space-2xl); }
  .cab { grid-template-columns: 240px 172px minmax(0, 1fr); }
  .cab.is-empty-drawer { grid-template-columns: 240px minmax(0, 1fr); }
  .cab-month { padding-left: var(--space-lg); }
}

/* Phone: a tab bar at the bottom, one column, the grid becomes a stack of boards */
@media (max-width: 760px) {
  .team-person { grid-template-columns: 24px minmax(0, 1fr); padding: var(--space-sm) 0; }
  .team-person .input { grid-column: 2; }
  .team-grid { grid-template-columns: 1fr 1fr; }
  .hide-phone { display: none !important; }
  .app, .app.with-pane { grid-template-columns: minmax(0, 1fr); min-height: calc(100dvh - var(--tabbar)); }
  .rail { display: none; }
  .main { padding: var(--space-lg) var(--space-md) var(--space-2xl); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: sticky; bottom: 0; z-index: 30; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface1); border-top: 1px solid var(--border); }
  .tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text3); font-size: var(--text-label); }
  .tab-item .nav-icon { width: 20px; height: 20px; }
  .tab-item .nav-icon i { font-size: 20px; }
  .tab-item.is-active { color: var(--text1); font-weight: 500; }
  .page-head { margin-bottom: var(--space-xl); }
  .page-head { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-sm); }
  .page-head .title-row { display: contents; }
  .page-head .subline { flex-basis: 100%; order: 2; }
  .page-head .title-tools { order: 3; margin: var(--space-md) 0 0; }
  .page-head .tags, .page-head .contacts, .page-head .warn { order: 4; flex-basis: 100%; }
  .page-head .scope { order: 3; margin-top: var(--space-md); }
  .section + .section { margin-top: var(--space-xl); }
  .exc { flex-wrap: wrap; align-items: flex-start; padding: var(--space-md); gap: var(--space-12); }
  .exc-dot { margin-top: 8px; }
  .exc-body { flex-basis: calc(100% - 24px); }
  .exc-actions { margin-left: 20px; flex-wrap: wrap; flex-shrink: 1; flex-basis: calc(100% - 20px); }
  .exc-actions { gap: 0; margin-left: 12px; }
  .exc-actions > :has(.btn-resolve) { order: -1; margin-right: var(--space-xs); }
  .exc-actions .btn-ghost { padding: 0 var(--space-sm); }
  .pop-body { right: auto; left: 0; }
  .exc-actions .pop:last-of-type .pop-body { left: auto; right: 0; }
  .section-meta { margin-left: 0; }
  .seg { width: 100%; }
  .seg-item { flex: 1; justify-content: center; padding: 0 var(--space-sm); }
  .mgrid, .mgrid tbody { display: block; }
  .mgrid colgroup, .mgrid thead { display: none; }
  .mgrid tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: var(--space-md) 0 var(--space-sm); border-bottom: 1px solid var(--border); }
  .mgrid tbody tr:hover { background: transparent; }
  .mgrid tbody th, .mgrid td { height: auto; border: none; padding: 0; }
  .mgrid tbody th { margin-bottom: var(--space-sm); }
  .mgrid td { display: flex; align-items: center; justify-content: space-between; min-height: 32px; font-size: var(--text-body-sm); color: var(--text2); }
  .mgrid td::before { content: ""; order: -2; width: 16px; height: 16px; margin-right: var(--space-sm); background: var(--text2); -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat; }
  .mgrid td::after { content: attr(data-label); order: -1; margin-right: auto; }
  .mgrid td .cell { margin-left: 0; margin-right: calc(-1 * var(--space-sm)); }
  .mgrid td .cell.is-review { margin-right: 0; }
  .mgrid td .tip { left: auto; right: 0; }
  .mgrid td.is-na-cell { display: none; }
  .mgrid tr.is-selected th::before { display: none; }
  .grid-foot { flex-direction: column; }
  .detail { display: none; }
  .first-run { grid-template-columns: 1fr; gap: var(--space-xl); min-height: 0; }
  .first-run-photo { aspect-ratio: 16 / 10; }
  .threshold-title { font-size: var(--text-display); }
  .threshold-voice { font-size: 17px; }
  .threshold-actions .btn-brand { flex: 1; }
  .client-page { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xl); }
  .talk { position: static; max-height: none; }
  .talk-head, .talk-body { padding: var(--space-md); }
  .reply { padding: var(--space-md); }
  .reply-tools { flex-wrap: wrap; }
  .chat { height: calc(100dvh - var(--tabbar) - env(safe-area-inset-bottom)); }
  .chat-head { padding: var(--space-lg) var(--space-md) var(--space-md); }
  .chat-scroll { padding: var(--space-lg) var(--space-md); }
  .chat-foot { padding: var(--space-sm) var(--space-md) var(--space-md); }
  .composer-note { display: none; }
  .only-phone { display: inline-flex !important; }
  .cab, .cab.is-empty-drawer { display: block; border-top: none; }
  .cab-col { position: static; max-height: none; overflow: visible; padding: 0; border-right: none; }
  .cab.level-drawers .cab-months, .cab.level-drawers .cab-month,
  .cab.level-months .cab-drawers, .cab.level-months .cab-month:not(.cab-empty),
  .cab.level-folders .cab-drawers, .cab.level-folders .cab-months { display: none; }
  .cab-drawers .cab-col-head { padding: 0 0 var(--space-sm); border-bottom: 1px solid var(--border-visible); }
  .drawer { min-height: 72px; padding: var(--space-12) 0; justify-content: center; }
  .drawer.is-open { background: transparent; }
  .drawer.is-open::before { display: none; }
  .drawer .mbar-track { max-width: 160px; }
  .cab-back { display: inline-flex; align-items: center; gap: var(--space-xs); height: 44px; margin-left: -4px; font-size: var(--text-body-sm); color: var(--text2); }
  .cab-back i { font-size: 16px; }
  .cab-months .cab-col-head { padding: 0 0 var(--space-md); }
  .only-phone-name { display: block; font-family: var(--font-display); font-size: var(--text-heading); font-weight: 500; color: var(--text1); line-height: 1.25; }
  .year { padding: var(--space-lg) 0 var(--space-xs); border-bottom: 1px solid var(--border-visible); }
  .mrow { min-height: 56px; padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); }
  .mrow.is-open { background: transparent; font-weight: 400; color: var(--text2); }
  .mrow.is-open::before { display: none; }
  .mrow .mbar-track { max-width: 160px; }
  .cab-month { padding: 0; }
  .month-head h2 { font-size: var(--text-display); }
  .folders { margin-top: var(--space-xl); gap: var(--space-md); }
  .folder-tab { height: 36px; padding: 0 var(--space-md) 0 var(--space-12); }
  .folder-body { padding: 0 var(--space-md) var(--space-xs); }
  .folder-head .add .btn { width: 44px; height: 44px; padding: 0; }
  .paper-line { grid-template-columns: 20px minmax(0, 1fr) auto; row-gap: var(--space-xs); }
  .paper-line .rows-sum { grid-column: 2; grid-row: 2; }
  .paper-line .rows-caret { grid-column: 3; grid-row: 1 / span 2; }
  .paper-line .paper-flag { grid-column: 2; }
  .rows { padding-left: 0; }
  .rtable thead { display: none; }
  .rtable tr { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); padding: var(--space-12) 0; border-bottom: 1px solid var(--border); }
  .rtable tr:last-child { border-bottom: none; }
  .rtable td, .rtable td:first-child { height: auto; padding: 0; border: none; }
  .rtable td:not(:first-child):not(.is-desc):not(.is-wrap):not(.basis-cell)::before { content: attr(data-label) " "; color: var(--text3); font-size: var(--text-label); }
  .rtable td.is-desc, .rtable td.is-wrap { flex-basis: 100%; order: 2; min-width: 0; }
  .rtable td.is-desc:first-child { order: 0; }
  .rtable td.basis-cell { margin-left: auto; width: auto; }
  .rtable tr.is-proposed td.basis-cell { order: 3; flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; }
  .rtable tr.is-proposed .basis.is-proposed::after { content: "a conferir"; font-size: var(--text-label); }
  .rtable tr.row-fix { display: block; }
  .rtable tr.row-fix td { display: block; }
  .row-acts .btn { height: 44px; }
  .row-acts .btn-icon { width: 44px; }
  .inv-head { grid-template-columns: minmax(0, 1fr) auto; }
  .inv-head .basis-cell { grid-column: 2; grid-row: 2; }
  .inv-head .basis-cell:has(.row-acts) { grid-column: 1 / -1; grid-row: auto; display: flex; justify-content: space-between; margin-top: var(--space-sm); }
  .map-strip { flex-direction: column; align-items: stretch; gap: var(--space-12); }
  .fix-field.is-wide { grid-column: 1 / -1; }
  .paper { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .paper-flag { grid-column: 2; justify-self: start; margin-top: var(--space-xs); }
  .cab-empty { min-height: 0; display: block; }
  .cab-empty .empty { padding: var(--space-xl) 0; }
  .ghost-tabs .folder-tab { padding: 2px var(--space-12) 0; }
  .lia-notes { right: var(--space-md); left: var(--space-md); width: auto; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + var(--space-sm)); }
  .drop-label { display: none; }
  .search { width: 100%; height: 44px; }
  .page-head .title-tools:has(.search) { width: 100%; }
  .page-head .title-tools .search { flex: 1; }
  .attach-btn { min-height: 44px; }
  .reply-tools .btn-brand, .reply-tools .btn-primary { min-height: 44px; padding: 0 var(--space-lg); }
  /* The keyboard is up: the composer sits on it and the tab bar steps aside */
  .kb-open .tabbar { display: none; }
  .kb-open .chat { height: var(--vvh, 100dvh); }
  .starters { grid-template-columns: 1fr; }
  .lia-hello { padding: var(--space-lg) 0; }
  .lia-portrait { width: 120px; height: 120px; }
  .switches.two { grid-template-columns: 1fr; }
  .switches.two .switch-row:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--border); }
  .form-row.three { grid-template-columns: 1fr; }
  .settings-row { padding: var(--space-lg) 0; }
  .card { padding: var(--space-md); }
  .scope { margin-left: 0; width: 100%; }
  .scope .select { flex: 1; min-width: 0; }
  .settings-actions .btn { flex: 1; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .contact-row input:nth-child(n+3) { display: none; }
  .table thead th.num:last-child { display: none; }
  .table td.num { display: none; }
  .table tbody th { padding: var(--space-12) var(--space-sm); }
  .door { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .door-photo { position: static; height: 200px; object-position: 50% 85%; }
  .door-first-run .door-photo { object-position: 40% 80%; }
  .door-consent .door-photo { object-position: 30% 82%; }
  .door-panel { border-left: none; padding: var(--space-lg) var(--space-md) var(--space-xl); gap: var(--space-lg); }
  .door-body { align-self: start; padding: var(--space-md) 0 var(--space-xl); gap: var(--space-lg); }
  .door-actions .btn-brand { flex: 1; }
  .consent { grid-template-columns: 1fr; }
  .consent-intro { position: static; height: auto; border-right: none; grid-template-rows: 180px auto; }
  .consent-photo { object-position: 30% 88%; }
  .consent-hero { padding: var(--space-lg) var(--space-md) 0; }
  .consent-steps { padding: var(--space-lg) var(--space-md) var(--space-2xl); min-height: 0; }
  .step-confirm { grid-template-columns: 1fr; }
  .step-head .cell { display: none; }
  .choice-panel { padding-left: var(--space-md); }
  .choice-panel .threshold-actions .btn-brand { flex: 1; }
  .solo-center { padding: var(--space-lg) var(--space-md); }
}

/* Foto da Lia: her face first, what it is beside it, the actions under that */
.lia-photo { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--space-lg); align-items: start; margin-bottom: var(--space-md); }
.lia-photo-face { width: 112px; height: 112px; border-radius: var(--radius-component); }
.lia-photo-body { display: grid; gap: var(--space-sm); min-width: 0; }
.lia-photo-head { display: flex; align-items: center; gap: var(--space-sm); }
.lia-photo-head h3 { font-size: var(--text-body); font-weight: 500; }
.lia-photo-body > p { font-size: var(--text-body-sm); color: var(--text2); max-width: 56ch; }
.lia-photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-top: var(--space-xs); }
.lia-photo-actions form { display: contents; }
.attach-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-note { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-caption); color: var(--text2); min-height: 32px; }
.photo-note i { font-size: 14px; color: var(--success); }
.photo-note.is-error, .photo-note.is-error i { color: var(--error); }
.photo-note form { margin-left: auto; }
@media (max-width: 640px) {
  .lia-photo { grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-md); }
  .lia-photo-face { width: 72px; height: 72px; }
  .lia-photo-actions .btn { min-height: 44px; }
}
.lia-photo-wa { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-12); padding-top: var(--space-md); margin-top: var(--space-xs); border-top: 1px solid var(--border); }
.lia-photo-wa i { font-size: 18px; color: var(--text3); flex-shrink: 0; }
.lia-photo-wa > .photo-note { flex-basis: 100%; padding-left: 30px; }
.lia-photo-wa p { flex: 1; font-size: var(--text-caption); color: var(--text2); }
@media (max-width: 640px) {
  .lia-photo-wa { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; }
  .lia-photo-wa i { margin-top: 1px; }
  .lia-photo-wa .btn, .lia-photo-wa > .photo-note { grid-column: 1 / -1; padding-left: 0; }
  .lia-photo-wa .btn { width: 100%; min-height: 44px; }
}

/* A guia Lia sent: its first page beside its name and WhatsApp state */
.guia-card { display: flex; align-items: flex-start; gap: var(--space-md); margin-top: var(--space-sm); padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-sm); max-width: 360px; background: var(--surface1); border: 1px solid var(--border); border-radius: var(--radius-control); color: var(--text1); }
a.guia-card:hover { background: var(--surface2); }
.guia-page { width: 60px; height: 85px; object-fit: cover; object-position: top; flex-shrink: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-element); }
.guia-body { display: grid; gap: var(--space-xs); min-width: 0; }
.wa-state { display: inline-flex; align-items: flex-start; gap: var(--space-xs); font-size: var(--text-caption); line-height: 1.4; color: var(--text3); }
.wa-state > i { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.wa-state > .cell-dot, .wa-state > .cell-ring { margin-top: 0.42em; }
.wa-why { display: block; font-weight: 400; color: var(--text2); }
.wa-state .ph-whatsapp-logo { color: var(--text3); margin-right: var(--space-xs); }
.wa-state.is-done > .ph-check { color: var(--success); opacity: 0.75; }
.wa-state.is-waiting { color: var(--text2); }
.wa-state.is-attention { color: var(--warning); font-weight: 500; }
.wa-state.is-late { color: var(--error); font-weight: 500; }
.deliv .wa-state { display: flex; margin-top: var(--space-xs); }

/* The asking plan: each item as a switch and a day */
.plan-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-right: var(--space-sm); vertical-align: 1px; border-radius: var(--radius-element); background: var(--warning-bg); color: var(--warning); font-size: var(--text-label); font-weight: 500; line-height: 1; white-space: nowrap; flex-shrink: 0; }
.plan-lines { display: grid; }
.plan-line { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); min-height: 56px; padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); }
.plan-ask { display: flex; align-items: center; gap: var(--space-12); cursor: pointer; min-width: 0; }
.plan-ask .noun { margin-right: 0; }
.plan-name small { display: block; color: var(--text3); font-size: var(--text-caption); }
.plan-day { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-body-sm); color: var(--text3); }
.plan-day .input { width: 64px; text-align: center; font-variant-numeric: tabular-nums lining-nums; }
.plan-line:has(.switch:not(:checked)) .plan-name { color: var(--text3); }
.plan-line:has(.switch:not(:checked)) .plan-day { opacity: 0.45; }
.plan-when { margin-right: auto; align-self: center; font-size: var(--text-caption); color: var(--text3); }
.plan-summary { font-size: var(--text-body-sm); color: var(--text2); margin-top: var(--space-xs); }
.plan-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-12); }
.plan-actions > .btn-ghost:first-child { margin-left: calc(-1 * var(--space-12)); }

/* Agenda da Lia: what she will send, then what she sent */
.ag-list { list-style: none; }
.ag-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) 32px; align-items: center; column-gap: var(--space-md); min-height: 56px; padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); font-size: var(--text-body-sm); }
.ag-line:last-child { border-bottom: none; }
.ag-line.is-done { grid-template-columns: 64px minmax(0, 1fr) 112px; }
.ag-day { font-size: var(--text-caption); color: var(--text2); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.ag-main { display: flex; flex-direction: column; min-width: 0; }
.ag-what { color: var(--text1); font-weight: 500; }
.ag-what .noun { vertical-align: -3px; }
.ag-sub { font-size: var(--text-caption); color: var(--text3); font-variant-numeric: tabular-nums lining-nums; }
.ag-client { font-weight: 500; color: var(--text1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-client:hover { text-decoration: underline; text-underline-offset: 3px; }
.ag-contact { font-size: var(--text-caption); color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-line.is-skipped .ag-what { color: var(--text3); font-weight: 400; text-decoration: line-through; text-decoration-color: var(--border-visible); }
.ag-line.is-skipped .ag-sub { display: none; }
.ag-line.is-stuck .ag-sub { color: var(--warning); }
.ag-held { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 var(--space-sm); font-size: var(--text-caption); color: var(--text3); }
.ag-held form { display: inline; }
.link-btn { color: var(--text2); font-size: var(--text-caption); text-decoration: underline; text-decoration-color: var(--border-visible); text-underline-offset: 3px; min-height: 24px; }
.link-btn:hover { color: var(--text1); text-decoration-color: currentColor; }
.ag-menu-gap { width: 32px; }
.ag-menu .pop-body { width: min(340px, calc(100vw - 32px)); padding: var(--space-xs) 0; }
.ag-menu > summary { color: var(--text3); }
.ag-pop form + form { border-top: 1px solid var(--border); }
.ag-choice, .ag-dated { display: flex; align-items: flex-start; gap: var(--space-12); width: 100%; padding: var(--space-12) var(--space-md); text-align: left; }
.ag-choice:hover { background: var(--surface2); }
.ag-choice i, .ag-dated-text i { font-size: 16px; color: var(--text2); margin-top: 2px; flex-shrink: 0; }
.ag-choice strong, .ag-dated-text strong { display: block; font-size: var(--text-body-sm); font-weight: 500; color: var(--text1); }
.ag-choice small, .ag-dated-text small { display: block; font-size: var(--text-caption); color: var(--text3); line-height: 1.4; }
.ag-dated { flex-direction: column; gap: var(--space-sm); }
.ag-dated-text { display: flex; gap: var(--space-12); }
.ag-dated-row { display: flex; align-items: flex-start; gap: var(--space-sm); padding-left: 28px; width: 100%; }
.ag-dated-row .btn { min-width: 88px; }
.ag-dated-row .input { flex: 1; height: 32px; min-width: 0; font-variant-numeric: tabular-nums lining-nums; }
.ag-result { display: inline-flex; align-items: center; gap: var(--space-sm); justify-self: start; font-size: var(--text-caption); color: var(--text3); white-space: nowrap; }
.ag-result > i { font-size: 14px; }
.ag-why.is-late { color: var(--error); }
.ag-why.is-review { color: var(--warning); }
.ag-more > summary { display: inline-flex; align-items: center; margin-top: var(--space-sm); cursor: pointer; }
.ag-more[open] > summary { margin-bottom: var(--space-sm); }
.ag-more .ag-list { margin-top: 0; }
.ag-result.is-settled > i { color: var(--success); opacity: 0.75; }
.ag-result.is-read { color: var(--text2); }
.ag-result.is-read > i { color: var(--success); }
.ag-result.is-review { color: var(--warning); font-weight: 500; }
.ag-result.is-late { color: var(--error); font-weight: 500; }
.ag-result.is-settled .cell-line { background: var(--border-visible); }
.ag-title { font-size: var(--text-subheading); font-weight: 500; margin-bottom: var(--space-xs); }
.ag-title span { font-size: var(--text-caption); font-weight: 400; color: var(--text3); margin-left: var(--space-xs); }
.ag-past { margin-top: var(--space-lg); }
.ag-empty { display: flex; align-items: center; gap: var(--space-md); min-height: 56px; font-size: var(--text-body-sm); color: var(--text2); flex-wrap: wrap; }
.ag-empty > .emblem, .quiet-empty .emblem { color: var(--text3); }
.ag-empty > span { flex: 1; min-width: 200px; }
.ag-off { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); font-size: var(--text-caption); color: var(--text2); }

/* On O mês: folded under Precisa de você, a day per group */
.fold-head { display: flex; align-items: center; gap: var(--space-md); min-height: 48px; cursor: pointer; flex-wrap: wrap; border-radius: var(--radius-control); }
.fold-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.fold-line { font-size: var(--text-caption); color: var(--text3); font-variant-numeric: tabular-nums lining-nums; }
.fold-cta { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-sm); height: 32px; padding: 0 var(--space-12); border-radius: var(--radius-control); font-size: var(--text-body-sm); font-weight: 500; color: var(--text2); }
.fold-head:hover .fold-cta { background: var(--surface2); color: var(--text1); }
.fold-cta i { transition: transform var(--duration-medium) var(--ease); }
.fold[open] > summary .fold-cta i { transform: rotate(180deg); }
.fold-opened, .fold[open] > summary .fold-closed { display: none; }
.fold[open] > summary .fold-opened { display: inline; }
.fold-body { margin-top: var(--space-md); }
.ag .ag-list { background: var(--surface1); border: 1px solid var(--border); border-radius: var(--radius-component); }
.ag .ag-line { grid-template-columns: minmax(160px, 240px) minmax(0, 1fr) minmax(0, 160px) 32px; padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-lg); }
.ag .ag-line.is-done { grid-template-columns: minmax(160px, 240px) minmax(0, 1fr) minmax(0, 160px) 112px; padding-right: var(--space-lg); }
.ag-daygroup + .ag-daygroup { margin-top: var(--space-lg); }
.ag .ag-past { margin-top: var(--space-2xl); }
.ag .ag-empty { background: var(--surface1); border: 1px solid var(--border); border-radius: var(--radius-component); padding: var(--space-sm) var(--space-lg); }
@media (max-width: 640px) {
  .ag-line, .ag .ag-line { grid-template-columns: minmax(0, 1fr) 44px; grid-template-areas: "lead menu" "main menu" "contact menu"; row-gap: 2px; padding: var(--space-12) 0; }
  .ag .ag-line { padding: var(--space-12) var(--space-xs) var(--space-12) var(--space-md); }
  .ag-line.is-done, .ag .ag-line.is-done { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "lead result" "main result" "contact result"; }
  .ag .ag-line.is-done { padding-right: var(--space-md); }
  .ag-line > .ag-day, .ag-line > .ag-client { grid-area: lead; }
  .ag-line > .ag-main { grid-area: main; }
  .ag-line > .ag-contact { grid-area: contact; }
  .ag-line > .ag-menu, .ag-line > .ag-menu-gap { grid-area: menu; justify-self: end; }
  .ag-line > .ag-result { grid-area: result; }
  .ag-menu > summary.btn-icon { width: 44px; height: 44px; }
  .ag-menu .pop-body { position: fixed; left: var(--space-md); right: var(--space-md); top: auto; bottom: calc(var(--tabbar) + var(--space-md)); width: auto; }
  .ag-dated-row .input, .ag-dated-row .btn { height: 44px; }
  .ag-choice { min-height: 56px; }
  .fold-line { flex-basis: 100%; order: 3; }
  }

/* Phone: every control a thumb can hit, at least 44px tall (SKILL 2.7) */
@media (max-width: 760px) {
  .btn, summary.btn { min-height: 44px; }
  .btn-icon { min-width: 44px; }
  .input, .select select { height: 44px; }
  .check, .switch-row { min-height: 44px; }
  .crumb a, .sort { display: inline-flex; align-items: center; min-height: 44px; }
  .paper-name { display: inline-block; padding-block: 13px; margin-block: -13px; }
  .link-btn { min-height: 44px; }
  .month .select select, .scope .select select { height: 44px; }
  .seg-item { height: 40px; }
  a.attach { min-height: 44px; }
}
