/* LucroVista -- the Vista. Mobile first: phone = banner, close note, tiles,
   cash; tablet adds one statement; laptop everything (north-star brief). */
:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #1c1c1a; --muted: #6b6a64; --line: #e3e1da;
  --accent: #1f5f4a; --accent-soft: #e4efe9; --warn: #9a5b00; --warn-soft: #fbf1e0;
  --bad: #a3322b; --bad-soft: #f8e6e4; --pos: #1f6f4a; --neg: #a3322b; --bar-a: #1f5f4a; --bar-b: #c4b79a; --bar-c: #6c8fb3;
  --radius: 10px; --gap: 12px;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141412; --panel: #1d1d1a; --ink: #ecebe6; --muted: #a09e95; --line: #33322d;
    --accent: #7cc4a4; --accent-soft: #1f302a; --warn: #e0a54a; --warn-soft: #34291a; --bad: #e8857c; --bad-soft: #3a2220;
    --pos: #7cc4a4; --neg: #e8857c; --bar-a: #7cc4a4; --bar-b: #8a7f68; --bar-c: #88a9cc;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
.muted { color: var(--muted); }
.pad { padding: 16px; }
.top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); letter-spacing: .2px; }
.entity-name { color: var(--muted); font-size: 14px; }
.spacer { flex: 1; }
.who { font-size: 12px; color: var(--muted); max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice { margin: 10px 16px 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
main { padding: 12px 16px 40px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 20px; margin: 8px 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: var(--gap); }
.picker { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.picker a.card { display: block; text-decoration: none; color: var(--ink); }
.picker .role { font-size: 12px; color: var(--muted); }
.banner { display: flex; align-items: center; gap: 10px; border-radius: var(--radius); padding: 12px 14px; margin-bottom: var(--gap); font-weight: 600; }
.banner.calm { background: var(--accent-soft); color: var(--accent); }
.banner.attention { background: var(--warn-soft); color: var(--warn); }
.banner a { margin-left: auto; font-weight: 600; color: inherit; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: var(--gap); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; padding: 7px 11px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
select { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.note p { margin: 0 0 6px; }
.tiles { display: grid; gap: var(--gap); grid-template-columns: repeat(2, 1fr); margin-bottom: var(--gap); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.tile .label { font-size: 12px; color: var(--muted); }
.tile .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .cmp { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tile.needs .value { font-size: 15px; color: var(--warn); font-weight: 600; }
.tile .why { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.up { color: var(--pos); } .down { color: var(--neg); }
table.stmt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13.5px; }
table.stmt th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.stmt th:first-child { text-align: left; }
table.stmt td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.stmt td:first-child { text-align: left; white-space: normal; }
table.stmt tr.total td { font-weight: 700; }
table.stmt tr.section td { font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding-top: 12px; }
table.stmt tr.drill { cursor: pointer; }
table.stmt tr.drill:hover td { background: var(--accent-soft); }
.checks { font-size: 12px; margin-top: 8px; }
.checks .ok { color: var(--pos); } .checks .no { color: var(--bad); }
.statements, .charts { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.chart .cnote { font-size: 12px; color: var(--muted); margin-top: 6px; }
.attention-list .item { display: flex; gap: 10px; align-items: flex-start; }
.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; flex: none; }
.sev.high { background: var(--bad-soft); color: var(--bad); } .sev.medium { background: var(--warn-soft); color: var(--warn); } .sev.low { background: var(--accent-soft); color: var(--accent); }
.item .t { font-weight: 600; } .item .d { font-size: 13px; color: var(--muted); }
.item .amt { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; margin: 4px 0 12px; }
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer-panel { background: var(--panel); width: min(640px, 100%); height: 100%; overflow: auto; padding: 16px; }
.drawer-head { display: flex; align-items: center; gap: 10px; }
.drawer-head h2 { flex: 1; margin: 0; }
.icon-btn { border: 1px solid var(--line); background: none; color: var(--ink); border-radius: 8px; width: 34px; height: 34px; font-size: 20px; cursor: pointer; }
.drawer-body { margin-top: 12px; }
.signin { max-width: 420px; margin: 40px auto; text-align: center; }
.only-wide { display: none; }
.statements .stmt-extra { display: none; }
.charts .chart-extra { display: none; }
@media (min-width: 700px) {
  .tiles { grid-template-columns: repeat(5, 1fr); }
  .picker { grid-template-columns: repeat(2, 1fr); }
  .statements .stmt-first { display: block; }
  .only-wide { display: block; }
}
@media (min-width: 1100px) {
  .statements { grid-template-columns: 1.1fr 1fr 1fr; }
  .statements .stmt-extra { display: block; }
  .charts { grid-template-columns: repeat(2, 1fr); }
  .charts .chart-extra { display: block; }
  .tabs.stmt-tabs { display: none; }
}
@media (max-width: 699px) {
  .statements { display: none; }
  .phone-hint { display: block; }
}
@media (min-width: 700px) { .phone-hint { display: none; } }

/* M4: answers, inbox, machine room */
.links strong { font-weight: 700; }
.answer-card .item { display: flex; gap: 10px; align-items: flex-start; }
.answers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.answers select { max-width: 100%; }
.btn { font: inherit; font-size: 14px; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.btn.ghost { background: var(--panel); color: var(--accent); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.upload { display: inline-block; font-size: 16px; padding: 12px 16px; }
.linkbtn { border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
label.inline { font-size: 13px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.result { margin-top: 8px; }
.queued { color: var(--accent); font-weight: 600; }
.status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.status.s-needs-one-answer, .status.s-unreadable { background: var(--warn-soft); color: var(--warn); }
.status.s-duplicate, .status.s-not-ours, .status.s-not-expected { background: var(--line); color: var(--muted); }
.pre { white-space: pre-wrap; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; background: var(--bg); border-radius: 8px; padding: 10px; max-height: 420px; overflow: auto; }
.held { margin: 0; padding-left: 18px; font-size: 13px; }
