/* Atlas Group dashboard.
   Identity comes from the owner's logo: deep navy, one signal red, the arc.  Type: Outfit (OFL), the same face as the public site.
   Structure: hairlines and whitespace; raised surfaces only where something is edited (composer, sheets, grouped settings). */

@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/static/fonts/outfit-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/static/fonts/outfit-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font: "Outfit", ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
  --bg: #080d1d; --surface: #0e1531; --raise: #131c3e; --hover: #0f1736;
  --line: #19234a; --line-strong: #2a3664;
  --ink: #e9edf9; --ink-2: #a2acca; --ink-3: #707c9f;
  --brand: #e0344c; --brand-hover: #ee4a60; --on-brand: #fff; --brand-ink: #ff7488; --brand-soft: rgba(224, 52, 76, .14);
  --ok: #3fcf94; --ok-soft: rgba(63, 207, 148, .13); --warn: #f3b542; --warn-soft: rgba(243, 181, 66, .14);
  --info: #88a9ff; --info-soft: rgba(136, 169, 255, .13);
  --side: #060a17; --side-ink: #e9edf9; --side-ink-2: #8f9abb; --side-line: #121a37; --side-hover: rgba(255, 255, 255, .045); --side-active: rgba(255, 255, 255, .08);
  --mark: #1c2f6b; --scrim: rgba(3, 6, 16, .62); --av-l: 74%; --av-s: 70%; --av-a: .17;
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
  --bar-rev: #34437a;
  --top-h: 64px; --tab-h: 62px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f4f9; --surface: #ffffff; --raise: #ffffff; --hover: #eaeef7;
  --line: #e0e5ef; --line-strong: #c9d1e3;
  --ink: #0b1236; --ink-2: #48527a; --ink-3: #79829f;
  --brand: #c8102e; --brand-hover: #a90d26; --on-brand: #fff; --brand-ink: #c8102e; --brand-soft: rgba(200, 16, 46, .08);
  --ok: #107a52; --ok-soft: rgba(16, 122, 82, .1); --warn: #8f5b00; --warn-soft: rgba(184, 118, 0, .12);
  --info: #2a52cf; --info-soft: rgba(42, 82, 207, .08);
  --side: #0b1236; --side-ink: #f1f4fc; --side-ink-2: #9ca8ce; --side-line: #18224f; --side-hover: rgba(255, 255, 255, .06); --side-active: rgba(255, 255, 255, .11);
  --scrim: rgba(11, 18, 54, .45); --av-l: 30%; --av-s: 55%; --av-a: .13;
  --shadow: 0 24px 60px rgba(11, 18, 54, .22);
  --bar-rev: #b9c3de;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; border-radius: 6px; }
.num, .tnum { font-variant-numeric: tabular-nums; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 22px 14px 14px; background: var(--side); color: var(--side-ink);
  border-right: 1px solid var(--side-line); }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 10px 26px; }
.brand svg, .top-mark svg { width: 34px; height: 34px; border-radius: 9px; flex: none; display: block; }
.brand b { display: block; font-weight: 600; font-size: 18px; letter-spacing: -.015em; line-height: 1.05; }
.brand small { display: block; color: var(--side-ink-2); font-size: 12.5px; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .gap { height: 16px; }
.nav a { position: relative; display: flex; align-items: center; gap: 13px; height: 41px; padding: 0 12px; border-radius: 10px; font-weight: 500; font-size: 15px;
  color: var(--side-ink-2); transition: background .12s, color .12s; }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { background: var(--side-hover); color: var(--side-ink); }
.nav a.on { background: var(--side-active); color: var(--side-ink); }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px; border-top: 1px solid var(--side-line); }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--side-ink-2); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.live.off i { background: var(--ink-3); box-shadow: none; }
.live em { font-style: normal; }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--side-ink-2); }
.theme-btn:hover { background: var(--side-hover); color: var(--side-ink); }
.theme-btn svg { width: 18px; height: 18px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 14px; height: var(--top-h); padding: 0 40px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-mark { display: none; }
.top h1 { flex: 1; margin: 0; min-width: 0; font-weight: 600; font-size: 21px; letter-spacing: -.015em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.view { width: 100%; max-width: 1240px; padding: 36px 40px 72px; }
.view.flush { max-width: none; padding: 0; }
.tabbar { display: none; }
body.busy::before { content: ""; position: fixed; z-index: 30; left: 0; top: 0; height: 2px; width: 40%; background: var(--brand); animation: busy 1s ease-in-out infinite; }
@keyframes busy { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- type and small parts ---------- */
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 13px; } .bad { color: var(--brand-ink); } .good { color: var(--ok); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; } .row.wrap { flex-wrap: wrap; } .spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sec { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sec h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.sec .n { color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.sec .more { margin-left: auto; color: var(--ink-2); font-size: 13.5px; }
.sec a.more:hover { color: var(--ink); text-decoration: underline; }
.block { margin-bottom: 40px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tag.k-info { color: var(--info); } .tag.k-ok { color: var(--ok); } .tag.k-warn { color: var(--warn); } .tag.k-bad { color: var(--brand-ink); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center;
  font-variant-numeric: tabular-nums; }
.av { --h: 220; display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; font-weight: 600; font-size: 14px; letter-spacing: .01em;
  color: hsl(var(--h) var(--av-s) var(--av-l)); background: hsl(var(--h) 60% 55% / var(--av-a)); }
.dotline { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- buttons, fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: transparent; font-weight: 500; font-size: 14.5px; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s; }
.btn:hover { background: var(--hover); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.quiet { border-color: transparent; color: var(--ink-2); }
.btn.quiet:hover { color: var(--ink); background: var(--hover); border-color: transparent; }
.btn.danger { color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn.icon { width: 40px; padding: 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
input, select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; height: 42px; outline: none; min-width: 0;
  transition: border-color .12s, box-shadow .12s; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23808aab' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
textarea { height: auto; min-height: 96px; padding: 11px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[type=checkbox] { width: auto; height: auto; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); min-width: 0; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.inline-sel { width: auto; height: 34px; border-radius: 8px; font-size: 13.5px; background-color: transparent; padding-right: 30px; background-position: right 10px center; }
.tool { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.tool input[type=search] { flex: 1 1 240px; max-width: 420px; }
.tool select { width: auto; flex: 0 0 auto; }
.tabs2 { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs2::-webkit-scrollbar { display: none; }
.tabs2 button { position: relative; flex: none; background: none; border: 0; color: var(--ink-2); padding: 14px 10px 13px; font-weight: 500; font-size: 14.5px; }
.tabs2 button:hover { color: var(--ink); }
.tabs2 button.on { color: var(--ink); }
.tabs2 button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.tabs2 .n { margin-left: 6px; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--hover); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:disabled + span { opacity: .45; }
.notice { border-radius: 10px; padding: 11px 14px; font-size: 14px; background: var(--warn-soft); color: var(--warn); line-height: 1.45; }
.notice.info { background: var(--info-soft); color: var(--info); }
.notice.bad { background: var(--brand-soft); color: var(--brand-ink); }
.empty { padding: 44px 16px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.link { color: var(--info); } .link:hover { text-decoration: underline; }

/* ---------- lists ---------- */
.rows { display: flex; flex-direction: column; }
.rw { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 12px; margin: 0 -12px; border-radius: 12px; color: inherit;
  transition: background .1s; }
.rw::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 1px; background: var(--line); }
.rw:last-child::after { display: none; }
a.rw:hover, .rw[data-href]:hover, .rw[data-act]:hover { background: var(--hover); cursor: pointer; }
.rw.static { cursor: default; }
.rw .nm { font-weight: 600; font-size: 15.5px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.rw .meta { color: var(--ink-2); font-size: 14px; }
.rw .meta.sub { color: var(--ink-3); font-size: 13px; }
.rw .end { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: 13px; color: var(--ink-3); }
.rw .end b { color: var(--ink); font-weight: 600; font-size: 15.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger { display: flex; flex-direction: column; }
.ledger .r { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ledger .r > span { color: var(--ink-2); }
.ledger .r > b { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; font-size: 16px; white-space: nowrap; }
.ledger .r.big > b { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.ledger .r.big > span { color: var(--ink); font-weight: 500; }
.ledger .r small { color: var(--ink-3); }
.ledger a.r:hover { background: var(--hover); }
.spark { width: 72px; height: 22px; color: var(--ink-3); flex: none; }
.spark .endpt { fill: var(--brand); }
.log { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.log li { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom-color: transparent; }
.log .t { color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; min-width: 42px; }
.log li.new { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--brand-soft); } to { background: transparent; } }

/* ---------- pulpit ---------- */
.hero { padding: 4px 0 38px; max-width: 880px; }
.hero .when { margin: 0 0 14px; color: var(--ink-3); font-size: 15px; }
.headline { margin: 0; font-weight: 500; font-size: clamp(27px, 3.6vw, 42px); line-height: 1.16; letter-spacing: -.028em; text-wrap: balance; }
.headline a { text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: .2em; text-decoration-skip-ink: all; transition: background .12s; }
.headline a:hover { background: var(--brand-soft); }
.subline { margin: 16px 0 0; color: var(--ink-2); font-size: 17px; line-height: 1.5; max-width: 36em; }
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.route-wrap { margin-bottom: 44px; }
.route-wrap .sec { border-bottom: 0; padding-bottom: 4px; }
.route { --cnt: 38px; --gap: 12px; --node: 14px; list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); }
.route li { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--gap); text-align: center; min-width: 0; }
.route b { height: var(--cnt); font-size: 32px; font-weight: 500; line-height: var(--cnt); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.route .node { position: relative; z-index: 1; width: var(--node); height: var(--node); border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); }
.route span { color: var(--ink-3); font-size: 13px; line-height: 1.25; padding: 0 4px; overflow-wrap: normal; word-break: normal; }
.route li::after { content: ""; position: absolute; left: 50%; width: 100%; height: 2px; top: calc(var(--cnt) + var(--gap) + var(--node) / 2 - 1px); background: var(--line-strong); }
.route li:last-child::after { display: none; }
.route li.on b { color: var(--ink); }
.route li.on span { color: var(--ink-2); }
.route li.on .node { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.route li.go::after { background: var(--brand); }
.route.draw li::after { transform-origin: left; animation: draw .7s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- inbox ---------- */
.mail { display: grid; grid-template-columns: 400px minmax(0, 1fr); height: calc(100dvh - var(--top-h)); }
.mail-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.mail-search { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mail-rows { flex: 1; overflow-y: auto; }
.mail-row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 15px 18px 15px 20px; border-bottom: 1px solid var(--line); color: inherit; }
.mail-row:hover { background: var(--hover); }
.mail-row.on { background: var(--hover); }
.mail-row.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.mr-top { display: flex; align-items: baseline; gap: 10px; }
.mr-top .nm { font-weight: 500; font-size: 15.5px; flex: 1; min-width: 0; }
.mail-row.unread .nm { font-weight: 650; }
.mail-row.unread .nm::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: 8px; vertical-align: 1px; }
.mr-top time { color: var(--ink-3); font-size: 13px; flex: none; }
.mr-meta { display: flex; gap: 10px; align-items: center; color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.mr-prev { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.mail-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mail-thread > .empty { margin: auto; }
.th-head { display: flex; align-items: center; gap: 14px; padding: 16px 32px; border-bottom: 1px solid var(--line); }
.th-head h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.th-head p { margin: 1px 0 0; color: var(--ink-3); font-size: 13.5px; }
.th-head .back { display: none; }
.th-ctl { margin-left: auto; display: flex; gap: 8px; }
.thread-scroll { flex: 1; overflow-y: auto; padding: 26px 32px 18px; }
.note { border-left: 3px solid var(--info); background: var(--info-soft); padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 0 0 26px; max-width: 760px; }
.note p { margin: 0; font-size: 15.5px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 24px; margin: 14px 0 0; }
.facts div { display: flex; flex-direction: column; min-width: 0; }
.facts dt { font-size: 12.5px; color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 500; }
.bubbles { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.bub { align-self: flex-start; max-width: min(620px, 86%); padding: 12px 15px; border-radius: 18px 18px 18px 5px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; }
.bub.out { align-self: flex-end; border-radius: 18px 18px 5px 18px; background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 28%, transparent); }
.bub .when { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.composer { border-top: 1px solid var(--line); padding: 14px 32px 20px; background: var(--bg); }
.composer textarea { min-height: 104px; max-height: 40vh; background: var(--surface); }
.comp-note { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); }
.comp-note.bad { color: var(--brand-ink); }
.comp-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- money ---------- */
.bigfig { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 0 0 8px; }
.bigfig .v { white-space: nowrap; font-size: clamp(40px, 6vw, 64px); font-weight: 500; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.bigfig .d { font-size: 16px; color: var(--ink-2); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-3); font: 500 12px var(--font); }
.chart .base { stroke: var(--line-strong); }
.chart .rev { fill: var(--bar-rev); } .chart .pro { fill: var(--brand); } .chart .hit { fill: transparent; cursor: pointer; }
.chart .mo:hover .rev, .chart .mo.on .rev { fill: var(--ink-3); }
.chart .mo.on text { fill: var(--ink); }
.chart-read { margin: 0 0 4px; min-height: 24px; font-size: 14.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart-read b { color: var(--ink); font-weight: 600; }
.key { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 13px; color: var(--ink-2); }
.key::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--bar-rev); }
.key.p::before { background: var(--brand); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: start; }

/* ---------- settings and grouped surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px; }
.set-row { display: flex; gap: 16px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .txt { flex: 1; min-width: 0; }
.set-row .txt b { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.set-row .txt span { display: block; color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.set-row .ctl { flex: none; }
.group-title { margin: 30px 0 10px; font-size: 17px; font-weight: 600; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; }

/* ---------- sheet, toast, login ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: var(--scrim); backdrop-filter: blur(3px); }
.sheet { width: min(560px, 100%); height: 100%; overflow-y: auto; padding: 28px 28px 32px; background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow); animation: slide .2s cubic-bezier(.2, .8, .2, 1); }
.sheet h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.sheet .lead { margin: 0 0 20px; color: var(--ink-2); font-size: 14.5px; }
.sheet .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
@keyframes slide { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-weight: 500; box-shadow: var(--shadow); animation: pop .18s ease-out; }
.toast.bad { background: var(--brand); color: #fff; }
@keyframes pop { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.login { max-width: 400px; margin: 14vh auto 0; }
.login .mark-lg { width: 52px; height: 52px; border-radius: 13px; margin-bottom: 22px; display: block; }
.login h2 { margin: 0 0 6px; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.facts-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { padding: 5px 11px; border-radius: 8px; background: var(--hover); font-size: 13.5px; }

/* ---------- goal ---------- */
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px; margin-bottom: 44px; }
.block > .meters { margin-bottom: 0; margin-top: 16px; }
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--ink-2); }
.meter-head b { color: var(--ink); font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-head small { color: var(--ink-3); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.meter { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.meter > i { display: block; height: 100%; width: var(--w, 0%); background: var(--brand); border-radius: 8px; transition: width .6s cubic-bezier(.3, .7, .2, 1); }
.cmp { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; }
.cmp > div { padding: 12px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.cmp .h { color: var(--ink-3); font-size: 13px; border-bottom-color: var(--line-strong); }
.cmp .v { text-align: right; font-weight: 500; white-space: nowrap; }
.cmp .h.v { font-weight: 400; }
.ledger .r > span { min-width: 0; }
.ledger .r > b { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- late additions ---------- */
.rw > * { min-width: 0; }
.aside-col { display: flex; flex-direction: column; gap: 44px; }
.th-ctl-m { display: none; }
.comp-bar .go { margin-left: auto; display: flex; gap: 8px; }
.m-sq { fill: var(--mark); }
.post { padding: 18px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom-color: transparent; }
.post-text { margin: 10px 0 14px; white-space: pre-wrap; }
.sec .more a:hover { color: var(--ink); text-decoration: underline; }
body.login-mode .side, body.login-mode .top, body.login-mode .tabbar { display: none; }
body.login-mode .app { grid-template-columns: 1fr; }
.rw .end.btns { align-items: flex-end; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 920px) {
  :root { --top-h: 58px; }
  body { font-size: 16px; }
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 0 16px; padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top)); gap: 12px; }
  .top-mark { display: block; }
  .top-mark svg { width: 30px; height: 30px; border-radius: 8px; }
  .top h1 { font-size: 19px; }
  .view { padding: 22px 18px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); }
  .view.flush { padding: 0; }
  .hide-sm { display: none !important; }
  .btn { height: 44px; }
  .btn.sm { height: 36px; }
  .btn.icon { width: 44px; }
  input, select, textarea { font-size: 16px; height: 46px; }
  textarea { height: auto; }
  .inline-sel { height: 38px; font-size: 14.5px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.5) blur(16px); border-top: 1px solid var(--line); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on::before { content: ""; position: absolute; top: -1px; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
  .tabbar .badge { position: absolute; top: 5px; left: calc(50% + 6px); height: 17px; min-width: 17px; font-size: 11px; padding: 0 5px; }
  .hero { padding-bottom: 28px; }
  .meters { grid-template-columns: 1fr; gap: 26px; margin-bottom: 36px; }
  .cmp { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); column-gap: 10px; font-size: 14px; }
  .subline { font-size: 16px; }
  .split, .grid2, .cols2 { grid-template-columns: 1fr; gap: 36px; }
  .block { margin-bottom: 34px; }
  .route-wrap { margin-bottom: 36px; }
  .route { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 112px; overflow-x: auto; scroll-snap-type: x proximity; margin-right: -18px; padding-right: 18px; scrollbar-width: none; }
  .route::-webkit-scrollbar { display: none; }
  .route li { scroll-snap-align: start; }
  .mail { grid-template-columns: 1fr; height: calc(100dvh - var(--top-h) - env(safe-area-inset-top) - var(--tab-h) - env(safe-area-inset-bottom)); }
  .mail.has-thread { height: calc(100dvh - var(--top-h) - env(safe-area-inset-top)); }
  .mail.has-thread .mail-list, .mail:not(.has-thread) .mail-thread { display: none; }
  .mail-list { border-right: 0; }
  .mail-row { padding: 14px 18px; }
  .th-head { padding: 12px 14px; gap: 10px; }
  .th-head .back { display: inline-flex; }
  .th-head .th-ctl { display: none; }
  .th-head h2 { font-size: 17px; }
  .thread-scroll { padding: 18px 16px 12px; }
  .composer { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .composer textarea { min-height: 84px; }
  .bub { max-width: 92%; }
  .th-ctl-m { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .th-ctl-m select { flex: 1; width: auto; }
  .comp-bar .go { order: -1; flex: 1 1 100%; margin-left: 0; }
  .comp-bar .go .btn { flex: 1; }
  body.in-thread .tabbar { display: none; }
  .sheet-wrap { align-items: flex-end; justify-content: center; }
  .sheet { width: 100%; height: auto; max-height: 92dvh; border-radius: 22px 22px 0 0; border-left: 0; border-top: 1px solid var(--line-strong); padding: 26px 20px calc(24px + env(safe-area-inset-bottom)); animation: rise .24s cubic-bezier(.2, .8, .2, 1); }
  .sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: -12px auto 18px; }
  @keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .toast { bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
  .rw { gap: 12px; }
  .rw .end.btns { grid-column: 1 / -1; align-items: flex-start; padding-left: 54px; margin-top: -4px; }
  .tool input[type=search] { max-width: none; flex-basis: 100%; }
  .tool select { flex: 1 1 130px; }
  .panel { padding: 2px 16px; }
  .set-row { align-items: flex-start; }
  .bigfig .v { font-size: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* chat */
.chat { display: flex; flex-direction: column; height: calc(100dvh - 150px); min-height: 360px; max-width: 760px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 14px; }
.cm { max-width: 86%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; font-size: 15px; word-wrap: break-word; }
.cm.user { align-self: flex-end; background: var(--info); color: #fff; border-bottom-right-radius: 4px; }
.cm.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.cm.wait { color: var(--ink-3); }
.chat-in { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.chat-in textarea { min-height: 42px; max-height: 140px; resize: none; }
.chat-in .btn { height: 42px; width: 46px; padding: 0; justify-content: center; flex: none; }
@media (max-width: 920px) { .chat { height: calc(100dvh - 250px); } }
.chat-in { flex-wrap: wrap; }
.chat-prev { display: flex; gap: 8px; flex: 0 0 100%; }
.chat-prev:empty { display: none; }
.chat-prev .pv { position: relative; }
.chat-prev img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.chat-prev .pv button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; line-height: 1; }
.chat-in textarea { flex: 1; }
.chat-att { height: 42px; width: 46px; padding: 0; justify-content: center; flex: none; cursor: pointer; }
.chat-att svg { width: 20px; height: 20px; }
.prop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); }
.prop.skipped span:first-child { text-decoration: line-through; color: var(--ink-3); }
