/* Base, primitives, tables and drawer for the screens built before the new design (the .m-* components are in frs.css).
   Weights at the end are eased to the design's 500 and 600: Geist is the only face. */
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "lnum" 1; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
::selection { background: var(--tint-2); }
.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.ic svg { width: 100%; height: 100%; display: block; }
.num, .r { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.pos { color: var(--green); } .neg { color: var(--red); }
.nowrap { white-space: nowrap; }
details > summary { list-style: none; cursor: pointer; } details > summary::-webkit-details-marker { display: none; }


/* ---------------------------------------------------------- headers */
.ph1 { display: flex; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.ph1 h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; }
.ph1 .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; color: var(--ink-3); font-size: 13.5px; font-weight: 600; }
.ph1 .meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.ph1 p { margin: 6px 0 0; color: var(--ink-3); max-width: 72ch; }
.ph1 .act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tabs { min-width: 0; max-width: 100%; display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 22px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 10px 12px 11px; color: var(--ink-3); font-weight: 700; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs .n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--sunk); color: var(--ink-2); }
.tabs a.on .n { background: var(--brand); color: #fff; }
.sec-h { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 12px; }
.sec-h h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.sec-h span { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.sec-h .r { margin-left: auto; }

/* ------------------------------------------------------- primitives */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); min-width: 0; }
.card > .hd { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-height: 54px; }
.card > .hd h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.card > .hd .sub { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.card > .hd .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card > .bd { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.g-split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 16px; align-content: start; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font-weight: 750; font-size: 13.5px; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); border-color: #c5c3cf; }
.btn .ic { width: 16px; height: 16px; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--brand-2); padding: 0 8px; }
.btn.quiet:hover { background: var(--tint); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn.danger { color: var(--red); }
.btn[disabled], .btn.dis { opacity: .5; pointer-events: none; }
.link { border: 0; background: none; padding: 0; color: var(--brand-2); font-weight: 750; font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .ic { width: 15px; height: 15px; }

.st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12.5px; font-weight: 750; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.st.plain::before { display: none; }
.st.ok { background: var(--green-t); color: var(--green); }
.st.wait { background: var(--amber-t); color: var(--amber); }
.st.bad { background: var(--red-t); color: var(--red); }
.st.info { background: var(--tint); color: var(--brand-2); }
.st.teal { background: var(--teal-t); color: var(--teal); }
.chg { font-weight: 800; font-size: 13px; }
.badge-d { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12.5px; font-weight: 800; }
.badge-d.pos { background: var(--green-t); } .badge-d.neg { background: var(--red-t); }

.in { height: 38px; width: 100%; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--paper); transition: border-color .12s, box-shadow .12s; }
.in:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
textarea.in { height: auto; padding: 10px 12px; resize: vertical; }
select.in { appearance: none; padding-right: 32px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364626e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; cursor: pointer; }
.field { display: grid; gap: 6px; } .field label { font-size: 13px; font-weight: 750; color: var(--ink-2); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--sunk); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; font-weight: 750; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: var(--sh), 0 0 0 1px var(--line); }
.toggle { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 13.5px; cursor: pointer; user-select: none; }
.toggle i { width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; transition: background .15s; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s var(--ease); }
.toggle.on i { background: var(--brand); } .toggle.on i::after { transform: translateX(14px); }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; }
.av.n { background: #12707f; } .av.l { background: #6a3ba6; } .av.j { background: #23143a; } .av.x { background: #8d8a96; }
.who { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; border: 1px solid; }
.callout .ic { width: 18px; height: 18px; margin-top: 1px; }
.callout.warn { background: var(--amber-t); border-color: #f0d9ad; color: #5c3600; } .callout.warn .ic { color: var(--amber); }
.callout.ok { background: var(--green-t); border-color: #c4e5d4; color: #0a4f37; } .callout.ok .ic { color: var(--green); }
.callout.info { background: var(--tint); border-color: var(--tint-2); color: #3d1f68; } .callout.info .ic { color: var(--brand); }
.callout.bad { background: var(--red-t); border-color: #f2c9c2; color: #6f1f16; } .callout.bad .ic { color: var(--red); }
.empty { text-align: center; padding: 36px 20px; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* -------------------------------------------------------------- tables */
.tw { overflow: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.t th { position: sticky; top: 0; z-index: 2; background: var(--paper); text-align: left; padding: 0 14px; height: 40px; border-bottom: 1px solid var(--line-2); font-size: 13px; font-weight: 750; color: var(--ink-2); white-space: nowrap; }
.t td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr:hover > td { background: var(--hover); }
.t tr.click { cursor: pointer; }
.t td.r, .t th.r { text-align: right; white-space: nowrap; }
.t td:first-child, .t th:first-child { padding-left: 18px; } .t td:last-child, .t th:last-child { padding-right: 18px; }
.t .sub { display: block; color: var(--ink-3); font-size: 13px; font-weight: 500; margin-top: 1px; }
.t b { font-weight: 750; }
.paren { color: var(--red); }

/* P&L */
.pl td:first-child, .pl th:first-child { position: sticky; left: 0; z-index: 1; background: var(--paper); min-width: 260px; }
.pl th:first-child { z-index: 3; }
.pl tr.grp > td { cursor: pointer; font-weight: 700; }
.pl tr.grp > td:first-child .ic { width: 15px; height: 15px; color: var(--ink-3); margin-right: 6px; transition: transform .15s; }
.pl tr.grp.open > td:first-child .ic { transform: rotate(90deg); }
.pl tr.kid > td:first-child { padding-left: 46px; color: var(--ink-2); }
.pl tr.kid > td { font-size: 13.5px; }
.pl tr.key > td { font-weight: 800; background: #faf9fc; border-top: 1px solid var(--line-2); }
.pl tr.key > td:first-child { background: #faf9fc; }
.pl tr.key:hover > td { background: #f5f2fa; }
.pl tr.lead > td { font-weight: 800; }
.pl .mg { font-size: 12.5px; color: var(--ink-3); font-weight: 650; margin-left: 8px; }
.vb { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; }
.vb .b { position: relative; width: 64px; height: 6px; border-radius: 3px; background: var(--sunk); flex: none; }
.vb .b::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.vb .b i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.vb span { min-width: 54px; text-align: right; font-weight: 750; }


/* ---------------------------------------------------------- drawer */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 50; animation: fade .18s var(--ease); } @keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--paper); z-index: 51; box-shadow: var(--sh-pop); display: flex; flex-direction: column; animation: slide .25s var(--ease); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer .dh { padding: 18px 22px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer .dh h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.drawer .dh p { margin: 3px 0 0; color: var(--ink-3); font-size: 13.5px; }
.ctx { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 750; color: var(--ink-2); background: var(--sunk); padding: 3px 9px; border-radius: 6px; margin-top: 8px; }
.ctx .ic { width: 13px; height: 13px; }
.drawer .db { flex: 1; overflow-y: auto; padding: 18px 22px; }
.drawer .df { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.x-btn { margin-left: auto; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.x-btn:hover { background: var(--sunk); color: var(--ink); }
.drawer h4 { margin: 18px 0 8px; font-size: 14px; font-weight: 800; } .drawer h4:first-child { margin-top: 0; }

/* ---- weights and sizes of the older primitives, in the design's scale (500 body, 600 headings) */
.ph1 h1 { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -.025em; }
.ph1 .meta, .card > .hd .sub, .sec-h span { font-weight: 500; }
.tabs a, .btn, .link, .field label, .st, .seg button, .toggle, .t th, .t b, .vb span { font-weight: 500; }
.sec-h h2, .card > .hd h3, .drawer .dh h2, .drawer h4 { font-weight: 600; letter-spacing: -.01em; }
.chg, .badge-d, .tabs .n, .av { font-weight: 600; }
.btn.pri { box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 4px 14px -6px rgba(105,58,148,.7); }
.btn { border-radius: var(--r-md); }
.card { border-radius: var(--r-lg); }
.btn[disabled], .btn.dis { opacity: 1; background: var(--sunk); border-color: var(--line-2); color: var(--ink-3); cursor: not-allowed; pointer-events: auto; }
.btn.pri[disabled], .btn.pri.dis { background: var(--sunk); border-color: var(--line-2); color: var(--ink-3); box-shadow: none; }
.btn[disabled]:hover { background: var(--sunk); border-color: var(--line-2); }
.in, textarea, input[type="text"], input[type="search"], input[type="number"], select { border-color: var(--ctl); }
.av.n { background: var(--av-n); } .av.l { background: var(--av-l); } .av.j { background: var(--av-j); } .av.x { background: var(--av-x); }
.callout.warn { border-color: var(--warn-bd); color: var(--warn-ink); } .callout.ok { border-color: var(--ok-bd); color: var(--ok-ink); }
.callout.info { border-color: var(--info-bd); color: var(--info-ink); } .callout.bad { border-color: var(--bad-bd); color: var(--bad-ink); }
.pl tr.key > td, .pl tr.key > td:first-child { background: var(--subtle); }
.pl tr.key:hover > td { background: var(--subtle-2); }
