[hidden] { display: none !important; }
:root {
  --bg: #F6F4EE; --card: #FFFFFF; --ink: #1C2629; --muted: #5D676B; --line: #ECE8DF; --soft: #F3F1EB;
  --accent: #1B6E53; --accent-ink: #124D3A; --accent-soft: #E6F2EC; --accent-text: #145A43;
  --blue: #2459A8; --blue-soft: #E4ECF8; --blue-text: #1D4886;
  --warn: #B4530F; --warn-soft: #FBEBDD; --warn-text: #8F3F0A;
  --chip: #EEF0EC; --chip-text: #3E4A4E; --input: #FBFAF7; --input-line: #DCD7CC;
  --shadow: 0 1px 2px rgba(28,38,41,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121719; --card: #1B2225; --ink: #E9ECEA; --muted: #9AA5A8; --line: #2A3336; --soft: #222A2D;
    --accent: #3FA27D; --accent-ink: #5DBB95; --accent-soft: #1D3A30; --accent-text: #8FD5B6;
    --blue: #5B8FDB; --blue-soft: #1D2B40; --blue-text: #A9C4EE;
    --warn: #E08A4A; --warn-soft: #3A2718; --warn-text: #F0B184;
    --chip: #263033; --chip-text: #C9D0D2; --input: #172022; --input-line: #34404A;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: Rubik, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: 16px 16px 110px; display: flex; flex-direction: column; gap: 14px; }
h1 { margin: 0; font-size: 22px; font-weight: 700; }
h2 { margin: 0; font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card { background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.card.flush { padding: 4px 14px; }
.list > * + * { border-top: 1px solid var(--line); }
.li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; text-decoration: none; color: var(--ink); width: 100%; background: none; border: 0; text-align: start; }
.li .main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.li .t { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .s { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .amt { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amt.in { color: var(--accent-text); }
.hero { background: var(--accent); color: #fff; border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.hero.blue { background: var(--blue); }
.hero .big { font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hero .sub { font-size: 12.5px; opacity: .92; }
.bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.25); position: relative; overflow: hidden; }
.bar > i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; background: #fff; border-radius: 4px; }
.bar > b { position: absolute; top: 0; bottom: 0; width: 2px; background: #F2B46B; }
.kpi { background: var(--card); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.kpi .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi.good { background: var(--accent-soft); color: var(--accent-text); }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi.good .l { color: var(--accent-text); }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); color: var(--chip-text); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; white-space: nowrap; }
.chip.green { background: var(--accent-soft); color: var(--accent-text); }
.chip.blue { background: var(--blue-soft); color: var(--blue-text); }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); }
.icon { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--chip); color: var(--chip-text); }
.icon.warn { background: var(--warn-soft); color: var(--warn); }
.icon.blue { background: var(--blue-soft); color: var(--blue); }
.icon.green { background: var(--accent-soft); color: var(--accent); }
.btn { height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--input-line); background: var(--card); color: var(--ink); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.danger { color: var(--warn-text); }
.btn.small { height: 38px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { width: 44px; height: 44px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; cursor: pointer; color: var(--chip-text); }
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input { height: 44px; border: 1px solid var(--input-line); border-radius: 10px; padding: 0 12px; background: var(--input); color: var(--ink); font-size: 15px; width: 100%; }
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--soft); border-radius: 10px; padding: 0 12px; min-height: 44px; font-size: 14px; color: var(--ink); cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.toggle.on { background: var(--accent-soft); color: var(--accent-text); }
.tabs { position: fixed; bottom: 0; inset-inline: 0; height: 78px; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: center; padding: 0 8px env(safe-area-inset-bottom); z-index: 10; }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11.5px; min-width: 56px; padding: 6px 0; }
.tabs a.on { color: var(--accent); font-weight: 600; }
.tabs a.fab { width: 56px; height: 56px; min-width: 0; border-radius: 50%; background: var(--accent); color: #fff; justify-content: center; margin-top: -26px; box-shadow: 0 4px 12px rgba(27,110,83,.35); }
.toast { position: fixed; bottom: 92px; inset-inline: 16px; max-width: 528px; margin: 0 auto; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-size: 14px; z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.sync { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.dot.off { background: var(--muted); } .dot.err { background: var(--warn); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 6px; background: var(--accent); }
.mic { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; margin: 4px auto; cursor: pointer; box-shadow: 0 6px 16px rgba(27,110,83,.35); }
.mic.rec { background: var(--warn); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.draft { border: 1.5px solid transparent; }
.draft.sel { border-color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; font-size: 14px; }
.help h3 { margin: 6px 0 2px; font-size: 15px; }
.help p, .help li { font-size: 14px; color: var(--ink); margin: 4px 0; }
.help ul { padding-inline-start: 20px; margin: 4px 0; }
.bars { display: grid; gap: 10px; align-items: end; height: 140px; }
.bars > div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.bars i { display: block; width: 100%; background: var(--blue-soft); border-radius: 6px 6px 0 0; }
.bars .cur i { background: var(--blue); }
.table-wrap { overflow-x: auto; }
table.mini { border-collapse: collapse; width: 100%; font-size: 13px; }
table.mini td, table.mini th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.sec > summary { list-style: none; cursor: pointer; padding: 12px 0; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec .chev { display: inline-flex; color: var(--muted); transform: rotate(-90deg); transition: transform .15s; }
details.sec[open] .chev { transform: rotate(90deg); }
details.sec > .list > * { border-top: 1px solid var(--line); }
.badge-wrap { position: relative; }
.badge { position: absolute; top: 4px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.chat { gap: 12px; }
.msg { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; max-width: 85%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg .bubble { background: var(--card); border-radius: 14px; padding: 10px 12px; font-size: 14.5px; box-shadow: var(--shadow); }
.msg.mine .bubble { background: var(--accent-soft); color: var(--ink); }
