:root {
  --bg: #131722;
  --panel: #1a1e2a;
  --panel-2: #232837;
  --border: #2a2e39;
  --text: #d1d4dc;
  --text-strong: #f0f3fa;
  --muted: #9298a6;  /* ≥ 5:1 on all surfaces */
  --blue: #c9a45c;
  --blue-hover: #d6b46f;
  --green: #22ab94;  /* text ≥ 5:1 */
  --red: #ff5c66;    /* text ≥ 4.8:1 */
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.num, td, .big, .value { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 24px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(19, 23, 34, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text-strong); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.updated { color: var(--muted); font-size: 12px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--blue); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; font-weight: 600;
}
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:disabled { opacity: .7; cursor: default; }
.btn-primary.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { max-width: 1280px; margin: 0 auto; padding: 24px; }
.loading { color: var(--muted); padding: 80px 0; text-align: center; }

/* hero */
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumb:hover { color: var(--text); }
.title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.title-row h1 { margin: 0; font-size: 20px; color: var(--text-strong); font-weight: 600; }
.tag { font-size: 12px; color: var(--muted); background: var(--panel-2); border-radius: 5px; padding: 2px 7px; }
.label { color: var(--muted); font-size: 13px; }
.big { font-size: 44px; font-weight: 700; color: var(--text-strong); letter-spacing: -.5px; line-height: 1.1; margin: 4px 0 6px; }
.change { font-size: 17px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.change .muted { font-weight: 400; font-size: 14px; }
.muted { color: var(--muted); }
.up { color: var(--green); }
.down { color: var(--red); }

.earn {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; min-width: 250px; text-align: right;
}
.earn .value { font-size: 26px; font-weight: 700; margin: 2px 0; }
.earn .pct { font-size: 15px; font-weight: 600; }
.earn .sub { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.6; }

/* chart card */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.chart-card { padding: 12px 14px 8px; margin-bottom: 22px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px; position: relative; flex-wrap: wrap; }
.seg button {
  background: none; border: 0; border-radius: 6px; padding: 5px 11px; color: var(--muted); font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 5px;
}
.seg button:hover { color: var(--text); background: var(--panel-2); }
.seg button.active { background: var(--panel-2); color: var(--text-strong); }
.seg button:disabled { opacity: .35; cursor: default; background: none; }
.tools-right { display: flex; gap: 8px; flex-wrap: wrap; }

.custom-wrap { position: relative; }
.popover {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.45); width: 270px;
}
.popover label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.popover input[type=date] {
  display: block; width: 100%; margin-top: 4px; padding: 7px 9px; font: inherit; color: var(--text-strong);
  background: var(--bg); border: 1px solid var(--border); border-radius: 7px;
}
.popover input[type=date]:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.popover .hint { font-size: 11px; color: var(--muted); margin: -2px 0 12px; }
.popover .btn-primary { width: 100%; justify-content: center; }

.legend { min-height: 20px; font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; padding: 2px 2px 4px; }
.legend b { color: var(--text-strong); font-weight: 600; }
.legend b.up { color: var(--green); }
.legend b.down { color: var(--red); }
#chart { height: 440px; position: relative; }
.empty-chart { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.note { font-size: 12px; color: var(--muted); padding: 6px 2px 2px; }

/* tables */
.table-card { margin-bottom: 22px; overflow: hidden; }
.table-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px 6px; }
.table-head h2 { margin: 0; font-size: 16px; color: var(--text-strong); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 11px 16px; text-align: right; }
th { font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); }
th:first-child, td:first-child { text-align: left; }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: 0; }
tr.link { cursor: pointer; }
tr.link:hover { background: var(--panel-2); }
tr.link:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.sym { display: flex; align-items: center; gap: 11px; }
.logo {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 700; color: #fff;
}
.sym .n { color: var(--text-strong); font-weight: 600; }
.sym .t { color: var(--muted); font-size: 12px; }
td .sub { display: block; color: var(--muted); font-size: 12px; }
tfoot td { font-weight: 700; color: var(--text-strong); border-top: 1px solid var(--border); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: calc(100% - 32px);
}

html { -webkit-text-size-adjust: 100%; }
#chart { touch-action: pan-y; -webkit-user-select: none; user-select: none; }

.mlist { display: none; }
.mrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); }
.mrow:active { background: var(--panel-2); }
.mright { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; flex: none; }
.mv { color: var(--text-strong); font-weight: 600; font-size: 15px; }
.mtotal { font-weight: 700; color: var(--text-strong); }
.mrow .sym { min-width: 0; }
.mrow .sym > div { min-width: 0; }
.mrow .sym .n { max-width: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 760px) {
  .mlist { display: block; }
  .wide-only { display: none; }
  .caret { display: none; }
  .toolbar > .seg button { white-space: nowrap; }
  main { padding: 16px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .hide-sm { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar > .seg { display: flex; }
  .toolbar > .seg > button, .toolbar > .seg > .custom-wrap { flex: 1; }
  .toolbar > .seg button { justify-content: center; padding: 7px 4px; width: 100%; }
  .tools-right { justify-content: space-between; }
  .popover { left: auto; right: 0; width: min(280px, calc(100vw - 48px)); }
  .chart-card { padding: 10px 8px 6px; }
  .legend { font-size: 12px; gap: 8px; }
  .earn .value { font-size: 22px; }
  .table-head { flex-direction: column; gap: 2px; }
  td:first-child, th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; }
  .sym .n { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
  .logo { width: 28px; height: 28px; font-size: 10px; }
  .updated { display: none; }
  .hero { flex-direction: column; }
  .earn { width: 100%; text-align: left; }
  .earn .nw-line { justify-content: flex-start; }
  .big { font-size: 34px; }
  #chart { height: 320px; }
  th, td { padding: 10px 12px; }
}

/* ---------- multi-asset + AI ---------- */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); color: var(--text-strong);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; font-weight: 600; font-size: 13px;
}
.btn-ghost:hover { border-color: #3a3f4d; background: #2a3040; }
.btn-ghost.danger { color: var(--red); }
.btn-ghost:disabled, .btn-primary:disabled { opacity: .5; cursor: default; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 8px; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--text-strong); background: var(--panel-2); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn-row.tight { margin-top: 0; }
.small { font-size: 12.5px; }
.error { color: var(--red); }

.badge { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; padding: 1px 6px; border-radius: 4px; background: var(--panel-2); color: var(--muted); vertical-align: 1px; }
.badge.ai { background: rgba(201, 164, 92, .18); color: var(--link); }

.alloc-card { margin-bottom: 22px; padding-bottom: 14px; }
.alloc-bar { display: flex; gap: 2px; height: 12px; margin: 6px 16px 12px; border-radius: 6px; overflow: hidden; }
.alloc-bar span { min-width: 3px; }
.alloc-legend { list-style: none; margin: 0; padding: 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 20px; }
.alloc-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.alloc-legend i, tr.group i, .mgroup i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.alloc-legend b { margin-left: auto; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.alloc-legend .muted { min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
tr.group td { text-align: left; padding: 14px 16px 6px; font-size: 12px; font-weight: 600; color: var(--text); background: var(--bg); }
tr.group i { margin-right: 8px; vertical-align: -1px; }
.mgroup { display: flex; justify-content: space-between; padding: 12px 16px 4px; font-size: 12px; font-weight: 600; border-top: 1px solid var(--border); background: var(--bg); }
.mgroup span { display: flex; align-items: center; gap: 8px; }

.val-card { margin-bottom: 22px; }
.val-body { padding: 4px 16px 16px; }
.val-body h3 { font-size: 13px; color: var(--text-strong); margin: 16px 0 6px; }
.val-body ul { margin: 0; padding-left: 18px; }
.val-body li { margin: 3px 0; }
.val-body a { color: var(--link); }
.val-stats { display: flex; gap: 32px; flex-wrap: wrap; margin: 4px 0 10px; }
.val-stats .value { font-size: 22px; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.val-stats .value.sm { font-size: 16px; padding-top: 5px; }
.conf-high { color: var(--green) !important; } .conf-medium { color: var(--accent) !important; } .conf-low { color: var(--red) !important; }
ul.comps { list-style: none; padding: 0; }
ul.comps li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
ul.comps b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.disclaimer { font-size: 11.5px; color: var(--muted); margin: 14px 0 0; }

.empty { max-width: 560px; margin: 60px auto; text-align: center; }
.empty h1 { color: var(--text-strong); font-size: 26px; margin: 18px 0 10px; }
.empty p { color: var(--text); margin: 0 0 22px; }
.empty a { color: var(--link); }

/* modal */
dialog#modal { border: 0; padding: 0; background: transparent; max-width: min(640px, calc(100vw - 24px)); width: 100%; color: var(--text); }
dialog#modal::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.5); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal header h2 { margin: 0; font-size: 17px; color: var(--text-strong); }
.modal-body { padding: 16px 18px 18px; overflow-y: auto; }
.modal-body h3 { font-size: 13px; color: var(--text-strong); margin: 4px 0 8px; }
.modal-body h3 + p { margin-top: 0; }
.modal-body a { color: var(--link); }
.tabs { display: flex; margin-bottom: 14px; }
.tabs button { flex: 1; justify-content: center; }
.modal textarea, .modal input:not([type=checkbox]):not([type=file]), .modal select {
  width: 100%; font: inherit; color: var(--text-strong); background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 10px; margin-top: 4px;
}
.modal textarea { resize: vertical; min-height: 70px; }
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid label, label.block { display: block; font-size: 12px; color: var(--muted); }
label.block { margin-bottom: 12px; }
.form-grid .span2 { grid-column: 1 / -1; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); grid-column: 1 / -1; margin: 10px 0 0; }
label.check input { width: 16px; height: 16px; accent-color: var(--blue); }
[hidden] { display: none !important; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.file-btn { display: inline-flex; margin-top: 8px; cursor: pointer; }
.file-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-btn span { font-size: 13px; color: var(--link); }
.file-btn:focus-within span { outline: 2px solid var(--blue); border-radius: 4px; }
#aiResult { margin-top: 12px; }
.questions { background: rgba(201, 133, 0, .12); border: 1px solid rgba(201, 133, 0, .35); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
.questions ul { margin: 4px 0 0; padding-left: 18px; }
.parsed { display: grid; gap: 8px; }
.pcard { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.pcard label.check { margin: 0 0 4px; }
.pcard .txs { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.pcard input.tk { width: 110px !important; display: inline-block; padding: 2px 6px !important; margin: 0 !important; font-size: 12px; }

@media (max-width: 760px) {
  .add-top { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .val-stats { gap: 18px; }
  dialog#modal { max-width: 100vw; margin: auto 0 0; }
  .modal { border-radius: 14px 14px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
}

/* ---------- landing & account ---------- */
body.signed-out .topbar-right > :not(.brand) { display: none; }
.landing { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; padding: 48px 0; }
.landing h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.8px; color: var(--text-strong); margin: 0 0 16px; }
.landing .lead { font-size: 17px; color: var(--text); margin: 0 0 26px; max-width: 560px; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; max-width: 560px; }
.features li { padding-left: 16px; border-left: 2px solid var(--blue); color: var(--text); }
.features b { color: var(--text-strong); display: block; margin-bottom: 2px; }
.auth-card { padding: 20px; }
.auth-card input { width: 100%; font: inherit; color: var(--text-strong); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-top: 4px; }
.auth-card input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.auth-card .btn-primary { width: 100%; justify-content: center; }
.danger-zone { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 12px; }
.danger-zone summary { cursor: pointer; color: var(--red); font-size: 13px; }
a.btn-ghost { text-decoration: none; }
@media (max-width: 760px) {
  .landing { grid-template-columns: 1fr; gap: 28px; padding: 16px 0; }
  .landing h1 { font-size: 32px; }
}

/* ---------- navigation ---------- */
.nav { display: flex; gap: 4px; margin: 0 auto 0 28px; }
.nav a { color: var(--muted); font-weight: 600; font-size: 14px; padding: 7px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { color: var(--text-strong); background: var(--panel-2); }
.nav a.active { color: var(--text-strong); background: var(--panel-2); }
body.signed-out .nav, body.signed-out .tabbar { display: none; }
.tabbar { display: none; }
.spark { color: var(--accent); }
.beta {
  display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; vertical-align: 2px;
  padding: 2px 6px; border-radius: 999px; color: #fff; background: var(--accent);
}

/* ---------- shared page pieces ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 4px 0 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; color: var(--text-strong); display: flex; align-items: center; gap: 10px; }
.page-head p { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.tile .value { font-size: 22px; font-weight: 700; color: var(--text-strong); margin: 2px 0; font-variant-numeric: tabular-nums; }
.card.pad { padding: 16px 18px; }
.card.pad h2 { margin: 0 0 12px; font-size: 16px; color: var(--text-strong); }
.empty-inline { padding: 28px; text-align: center; margin-bottom: 18px; }
.empty-inline h3 { margin: 0 0 6px; color: var(--text-strong); }
.icon-btn.sm { padding: 2px 6px; font-size: 12px; }
.quota { color: var(--link); }
.nw-line { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; margin-top: 8px; font-size: 13px; }
.nw-line b { color: var(--text-strong); font-size: 15px; }
.nw-line a { font-size: 12px; }
.teaser { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 22px; color: var(--text); }
.teaser:hover { border-color: #3a3f4d; }
.teaser .spark { font-size: 22px; }
.teaser > div { flex: 1; }

/* ---------- loans ---------- */
.loan-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; }
.loan { padding: 16px 18px; }
.loan-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.loan h3 { margin: 0 0 2px; color: var(--text-strong); font-size: 16px; }
.loan-bal { text-align: right; }
.loan-bal .value { font-size: 20px; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; margin-bottom: 4px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.loan-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin: 14px 0; }
.loan-facts dt { font-size: 12px; color: var(--muted); }
.loan-facts dd { margin: 0; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.loan-facts a { color: var(--link); }

/* ---------- allocation page ---------- */
.alloc-page { padding: 16px 18px; margin-bottom: 22px; }
.alloc-grid { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: center; margin-top: 18px; }
.donut-wrap { position: relative; }
.donut { width: 100%; max-width: 300px; display: block; margin: 0 auto; }
.seg-arc { stroke: var(--panel); stroke-width: 2px; transition: opacity .15s; cursor: pointer; }
.donut-label { fill: var(--muted); font-size: 11px; }
.donut-value { fill: var(--text-strong); font-size: 17px; font-weight: 700; }
.dim { opacity: .3; }
.tip { position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12px; white-space: nowrap; box-shadow: 0 8px 20px rgba(0,0,0,.4); z-index: 5; }
.slice-list { list-style: none; margin: 0; padding: 0; }
.slice-list li { transition: opacity .15s; }
.slice-list li > a, .slice-list li > div { display: grid; grid-template-columns: 12px minmax(120px, 1.4fr) 1fr 60px 110px; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--border); color: inherit; }
.slice-list li > a:hover { background: var(--panel-2); }
.slice-list i { width: 12px; height: 12px; border-radius: 3px; }
.sl-name { display: flex; flex-direction: column; min-width: 0; }
.sl-name b { color: var(--text-strong); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.sl-bar span { display: block; height: 100%; border-radius: 3px; opacity: .85; }
.sl-pct { text-align: right; color: var(--text-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.sl-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.nw-card { margin-bottom: 22px; padding-bottom: 16px; }
.nw-bars { display: grid; gap: 10px; padding: 6px 16px; }
.nw-bars > div { display: grid; grid-template-columns: 60px 1fr 130px; align-items: center; gap: 12px; }
.nw-bars b { text-align: right; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.nw-track { height: 14px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.nw-track span { display: block; height: 100%; border-radius: 4px; }
.nw-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px 0; margin-top: 8px; border-top: 1px solid var(--border); }
.nw-total .value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nw-empty { padding: 4px 16px; }
.nw-empty a, .page-head a { color: var(--link); }

/* ---------- insights ---------- */
.ins-card, .ask-card { margin-bottom: 18px; padding-bottom: 16px; }
.ins-headline { padding: 0 16px; font-size: 16px; color: var(--text-strong); margin: 4px 0 14px; }
.ins-empty { padding: 0 16px; }
.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; padding: 0 16px; }
.ins { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; border-left: 3px solid var(--muted); }
.ins h3 { margin: 6px 0 6px; font-size: 14.5px; color: var(--text-strong); }
.ins p { margin: 0 0 6px; font-size: 13.5px; }
.ins-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ins-icon { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; color: #fff; }
.ins-strength { border-left-color: var(--green); } .ins-strength .ins-kind { color: var(--green); } .ins-strength .ins-icon { background: var(--green); }
.ins-risk { border-left-color: var(--red); } .ins-risk .ins-kind { color: #ff6b76; } .ins-risk .ins-icon { background: var(--red); }
.ins-opportunity { border-left-color: var(--accent); } .ins-opportunity .ins-kind { color: var(--link); } .ins-opportunity .ins-icon { background: var(--accent); }
.ins-idea { border-left-color: var(--accent); } .ins-idea .ins-kind { color: var(--link); } .ins-idea .ins-icon { background: transparent; }
.ins-actions { padding: 0 16px; align-items: center; }
.chat { max-height: 460px; overflow-y: auto; padding: 4px 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.msg.q { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.a { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.typing { color: var(--muted); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 0; }
.chip { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--text); }
.chip:hover { border-color: var(--accent); color: var(--text-strong); }
.ask-form { display: flex; gap: 8px; padding: 12px 16px 0; }
.ask-form input { flex: 1; font: inherit; color: var(--text-strong); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.ask-form input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

/* ---------- paywall ---------- */
.paywall { padding: 18px; }
.pw-head { display: flex; gap: 12px; align-items: center; }
.pw-head .spark { font-size: 30px; }
.pw-head h3 { margin: 0; font-size: 20px; color: var(--text-strong); }
.pw-head p { margin: 2px 0 0; }
.pw-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.pw-list li { display: flex; gap: 12px; }
.pw-i { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2); color: var(--link); font-weight: 700; }
.pw-list b { display: block; color: var(--text-strong); }
.pw-list span { font-size: 13px; }
.pw-cta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; }
.pw-price { font-size: 20px; font-weight: 700; color: var(--text-strong); }

/* ---------- notes ---------- */
.notes-card { margin-bottom: 22px; padding-bottom: 12px; }
.note-form { display: flex; gap: 8px; padding: 0 16px; align-items: flex-end; }
.note-form textarea { flex: 1; font: inherit; color: var(--text-strong); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; resize: vertical; }
.note-form textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.notes { list-style: none; margin: 12px 0 0; padding: 0 16px; }
.notes li { border-top: 1px solid var(--border); padding: 10px 0; }
.notes p { margin: 4px 0 0; white-space: normal; }
.note-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-bottom: 18px; }
.admin-grid input:not([type=checkbox]), .admin-grid select { width: 100%; font: inherit; color: var(--text-strong); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 4px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist .ok span { color: var(--green); } .checklist .missing span { color: var(--red); }
table.admin-users td, table.admin-users th { text-align: left; }

@media (max-width: 900px) {
  .nav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: rgba(19, 23, 34, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
  .tabbar a.active { color: var(--text-strong); }
  .tabbar a.active svg { color: var(--link); }
  .tabbar svg { width: 22px; height: 22px; }
  body:not(.signed-out) main { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .alloc-grid { grid-template-columns: 1fr; gap: 16px; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .slice-list li > a, .slice-list li > div { grid-template-columns: 12px 1fr 52px 96px; }
  .sl-bar { display: none; }
  .loan-list { grid-template-columns: 1fr; }
  .tile .value { font-size: 18px; }
  .nw-bars > div { grid-template-columns: 50px 1fr 110px; }
  .page-head h1 { font-size: 22px; }
  .msg { max-width: 92%; }
}

/* ---------- symbol picker ---------- */
.sym-field { position: relative; }
.sym-list {
  position: absolute; left: 0; right: 0; top: calc(100% - 18px); z-index: 40; list-style: none; margin: 0; padding: 4px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 36px rgba(0,0,0,.5);
  max-height: 280px; overflow-y: auto;
}
.sym-list li { display: grid; grid-template-columns: 100px 1fr; gap: 0 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.sym-list li:hover, .sym-list li.active { background: #2f3547; }
.sym-list b { color: var(--text-strong); font-size: 13px; }
.sym-list span { color: var(--text); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sym-list em { grid-column: 2; font-style: normal; font-size: 11.5px; color: var(--muted); }
.sym-status { display: block; min-height: 18px; margin-top: 5px; font-size: 12px; }
.sym-status.ok { color: var(--green); } .sym-status.bad { color: #ff6b76; } .sym-status.wait { color: var(--muted); }
.tk-mark { font-size: 11.5px; margin-left: 6px; color: var(--muted); }
.tk-mark.ok { color: var(--green); } .tk-mark.bad { color: #ff6b76; font-weight: 600; }

/* ---------- plans (layout after a classic 3-column pricing table) ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.plan {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 30px 28px 26px;
  display: flex; flex-direction: column;
}
.plan.is-current { border-color: rgba(201, 164, 92, .45); box-shadow: 0 0 0 1px rgba(201, 164, 92, .25) inset; }
.plan h2 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -.5px; color: var(--text-strong); }
.plan-tag { margin: 8px 0 0; font-size: 16px; color: var(--text); min-height: 48px; }
.plan-price { display: flex; align-items: baseline; gap: 8px; margin: 26px 0 22px; }
.plan-price .amt { font-size: 52px; font-weight: 600; letter-spacing: -1.5px; color: var(--text-strong); line-height: 1; font-variant-numeric: tabular-nums; }
.plan-price .per { font-size: 15px; color: var(--muted); }
.plan-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border-radius: 999px;
  border: 1px solid #3a3f4d; background: var(--panel-2); color: var(--text-strong); font-weight: 600; font-size: 15px; text-decoration: none;
}
.plan-btn:hover:not(:disabled) { background: #2f3547; }
.plan-btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.plan-btn.primary:hover { background: var(--blue-hover); }
.plan-btn:disabled { opacity: .6; cursor: default; }
.plan-btn.current { background: transparent; }
.plan-renew { margin: 10px 2px 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); text-align: center; }
.plan-head { display: flex; align-items: center; gap: 12px; margin: 26px 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text-strong); }
.plan-head.empty { margin: 8px 0 0; padding-bottom: 0; border-bottom: 0; }
.plan-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.plan-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; color: var(--text); line-height: 1.4; }
.plan-list svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--text-strong); }
.pw-price { display: flex; align-items: baseline; gap: 2px; }

@media (max-width: 900px) {
  .tabbar { grid-template-columns: repeat(5, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .plan-tag { min-height: 0; }
}
.cost { font-size: 11px; font-weight: 600; opacity: .75; margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.16); }
.credit-note { margin: 4px 0 6px; }

/* ---------- shared portfolios ---------- */
.space-switch { position: relative; }
.space-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px 5px 8px; font-weight: 600; font-size: 13px; color: var(--text-strong); max-width: 220px; }
.space-btn:hover { border-color: #3a3f4d; }
.space-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.space-ico { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--bg); font-size: 12px; flex: none; }
.space-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 40; min-width: 280px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.space-menu button, .space-menu a { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 13px; }
.space-menu button:hover, .space-menu a:hover, .space-menu .active { background: #2f3547; }
.space-menu b { display: block; color: var(--text-strong); font-weight: 600; }
.space-menu em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
.space-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.space-menu a { color: var(--link); font-weight: 600; }
.banners { display: grid; gap: 8px; margin-bottom: 16px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }
.banner.invite { border-color: rgba(201, 164, 92, .45); background: rgba(201, 164, 92, .08); }
body.readonly [data-action="add"], body.readonly [data-action="tx"], body.readonly [data-action="delete"], body.readonly [data-action="setvalue"],
body.readonly [data-action="details"], body.readonly [data-action="revalue"], body.readonly [data-action="addloan"], body.readonly [data-action="editloan"],
body.readonly [data-action="delloan"], body.readonly [data-action="delnote"], body.readonly .note-form, body.readonly .add-top { display: none !important; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.inline-form input, .inline-form select, .copy-row input, .pct-input input, table.admin-users select { font: inherit; color: var(--text-strong); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.inline-form input { flex: 1; min-width: 200px; }
.copy-row { display: flex; gap: 8px; margin-top: 6px; }
.copy-row input { flex: 1; min-width: 0; }
.pct-input { display: inline-flex; align-items: center; gap: 4px; }
.pct-input input { width: 72px; text-align: right; }
.invite-list { list-style: none; padding: 0; margin: 6px 0 0; }
.invite-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ok-note { color: var(--green); }
@media (max-width: 760px) {
  .brand span { display: none; }
  .space-btn { max-width: 160px; }
  .space-menu { position: fixed; left: 12px; right: 12px; top: 58px; min-width: 0; }
}
.upsell { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(201, 164, 92, .45); background: rgba(201, 164, 92, .07); font-size: 13.5px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.badge.warn { background: rgba(242, 54, 69, .15); color: #ff8a93; }
.badge.shared { background: rgba(25, 158, 112, .15); color: #4fd1a5; white-space: nowrap; }

/* ---------- accessibility & compliance ---------- */
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--blue); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 10px; }
main:focus { outline: none; }
.site-footer { max-width: 1280px; margin: 8px auto 0; padding: 18px 24px 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.site-footer a { color: var(--text); }
.site-footer p { margin: 4px 0; }
.cookie-notice { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 640px; margin: 0 auto; display: flex; gap: 14px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(0,0,0,.45); font-size: 13px; }
.cookie-notice p { margin: 0; flex: 1; }
.cookie-notice a { color: var(--link); }
label.consent { align-items: flex-start; margin: 8px 0 0; }
label.consent a { color: var(--link); }
@media (max-width: 900px) {
  .site-footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .cookie-notice { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   Ledger: the house style. A private-bank statement crossed with a trading
   terminal. Graphite surfaces, hairline rules, one brass accent, IBM Plex
   (Sans for words, Mono for every figure). Fonts are OFL-licensed (fonts/OFL.txt).
   ============================================================ */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-greek-400-normal.woff2) format('woff2'); unicode-range: U+0370-03FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-greek-500-normal.woff2) format('woff2'); unicode-range: U+0370-03FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-greek-600-normal.woff2) format('woff2'); unicode-range: U+0370-03FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #12110f; --panel: #1a1916; --panel-2: #22201c; --hover: #2a2823;
  --border: #33302a; --rule: #26241f;
  --text: #e3dfd5; --text-strong: #f6f2e8; --muted: #a39e92;
  --accent: #c9a45c; --accent-hover: #d6b46f; --link: #dcbd7e; --on-accent: #141414;
  --green: #5dbb8a; --red: #e56b5d;
  --blue: var(--accent); --blue-hover: var(--accent-hover);
  --radius: 6px;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
body { font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
::selection { background: rgba(201, 164, 92, .35); }

/* figures, tickers and data labels are set in mono so columns line up like a statement */
.big, .value, td, th, .mv, .mright, .sl-pct, .sl-val, .legend, .tile .value, .loan-bal .value, .loan-facts dd, .val-stats .value,
.nw-total .value, .nw-bars b, .plan-price .amt, .alloc-legend b, .alloc-legend .muted, .sym .t, .quota, .updated, .change,
.earn .pct, .earn .sub, .nw-line b, ul.comps b, .cost, .pct-input input, .donut-value, .seg button, .label, .eyebrow, dt {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
td .sym .n, .sym .n, td .sub { font-family: var(--sans); }
.big { font-weight: 500; font-size: 46px; letter-spacing: -0.03em; }
.label, .eyebrow, th, dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.change { font-size: 15px; font-weight: 500; }
.change .muted { font-family: var(--sans); font-size: 13px; }
h1, h2, h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; }
.page-head h1 { font-size: 24px; font-weight: 600; }
.table-head h2, .card.pad h2 { font-size: 13px; font-weight: 600; letter-spacing: .02em; }

/* top bar: flat, ruled, wordmark not app-icon */
.topbar { background: var(--bg); backdrop-filter: none; border-bottom: 1px solid var(--rule); padding-top: max(0px, env(safe-area-inset-top)); padding-bottom: 0; min-height: 52px; }
.brand { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; gap: 8px; }
.nav { align-self: stretch; margin-left: 24px; gap: 0; }
.nav a { border-radius: 0; padding: 0 12px; display: flex; align-items: center; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: none; color: var(--text-strong); }
.nav a.active { background: none; color: var(--text-strong); border-bottom-color: var(--accent); }
.updated { font-size: 11.5px; }

/* buttons: square-ish, brass primary with dark ink */
.btn-primary { background: var(--accent); color: var(--on-accent); border-radius: 4px; font-weight: 600; padding: 8px 14px; box-shadow: none; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border: 1px solid var(--border); border-radius: 4px; color: var(--text-strong); font-weight: 500; }
.btn-ghost:hover { background: var(--hover); border-color: #454139; }
.btn-ghost.danger { color: var(--red); }
.icon-btn { border-radius: 4px; }
.btn-lg { padding: 11px 18px; }

/* segmented controls become ruled tabs */
.seg { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 0; gap: 0; }
.seg button { border-radius: 0; padding: 7px 10px 8px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .02em; }
.seg button:hover { background: none; color: var(--text-strong); }
.seg button.active { background: none; color: var(--text-strong); border-bottom-color: var(--accent); }
.tools-right { gap: 18px; }

/* surfaces: hairlines, no glow */
.card, .tile, .earn, .plan, .loan, .banner, .pcard, .ins, .val-card, .teaser { border-radius: var(--radius); box-shadow: none; }
.card, .tile, .earn { background: var(--panel); border-color: var(--border); }
.earn { padding: 16px 18px; min-width: 280px; }
/* the earnings box reads like a bank statement summary: text face, sentence-case label, one figure per row */
.earn .earn-label { font-size: 13px; color: var(--muted); }
.earn .value { font-family: var(--sans); font-weight: 600; font-size: 28px; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; margin: 2px 0 0; }
.earn .pct, .earn .nw-line b { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.earn .pct { font-size: 14px; font-weight: 500; }
.earn-rows { display: grid; grid-template-columns: 1fr auto; column-gap: 24px; row-gap: 5px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--rule); font-size: 13px; line-height: 1.4; }
.earn-rows span { color: var(--muted); text-align: start; }
.earn-rows b { font-weight: 500; color: var(--text); text-align: end; font-variant-numeric: tabular-nums; }
.earn-rows b.up { color: var(--green); }
.earn-rows b.down { color: var(--red); }
.earn-rows b.muted { color: var(--text); }
.chart-card { padding: 12px 16px 10px; }
.legend { font-size: 12px; }
.legend b { font-weight: 500; }
.note, .disclaimer { color: var(--muted); }

/* tables read like a statement */
table { font-size: 13.5px; }
th { border-bottom: 1px solid var(--border); padding-top: 10px; padding-bottom: 10px; }
tbody tr { border-bottom: 1px solid var(--rule); }
tr.link:hover { background: var(--panel-2); }
tr.group td { background: transparent; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 18px; border-bottom: 1px solid var(--border); }
tr.group td .muted { text-transform: none; letter-spacing: 0; }
tfoot td { font-weight: 500; border-top: 1px solid var(--border); }
.mgroup { background: transparent; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.alloc-legend i, tr.group i, .mgroup i, .slice-list i { border-radius: 1px; }
.alloc-bar { gap: 1px; height: 8px; border-radius: 1px; }

/* ticker tiles */
.logo { width: 36px; height: 30px; border-radius: 3px; background: var(--panel-2); color: var(--text-strong); font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .02em;
  box-shadow: inset 2px 0 0 var(--tile, var(--muted)); border: 1px solid var(--border); border-left: 0; }

/* tags replace pills and sparkles */
.badge, .beta, .tag-ai, .cost { display: inline-block; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 2px; border: 1px solid var(--border); background: transparent; color: var(--muted); vertical-align: 1px; line-height: 1.5; }
.badge.ai, .tag-ai { color: var(--link); border-color: rgba(201, 164, 92, .45); }
.beta { color: var(--link); border-color: rgba(201, 164, 92, .45); font-size: 9px; }
.badge.shared { color: #7fc4a6; border-color: rgba(76, 183, 130, .35); background: transparent; text-transform: none; letter-spacing: 0; }
.badge.warn { color: var(--red); border-color: rgba(232, 102, 94, .4); background: transparent; }
.btn-primary .cost { color: var(--on-accent); border-color: rgba(20, 20, 20, .35); background: transparent; opacity: 1; }
.ic { vertical-align: -3px; flex: none; }
.banner .ic, .upsell .ic { color: var(--muted); }

/* page furniture */
.banner { background: var(--panel); border-color: var(--border); }
.banner.invite { background: rgba(201, 164, 92, .06); border-color: rgba(201, 164, 92, .35); }
.upsell { background: rgba(201, 164, 92, .06); border-color: rgba(201, 164, 92, .35); border-radius: var(--radius); }
.teaser { gap: 12px; }
.space-btn { border-radius: 4px; background: transparent; padding: 5px 9px; font-size: 12.5px; font-weight: 500; }
.space-ico { background: transparent; width: auto; height: auto; color: var(--muted); }
.space-menu { border-radius: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
.space-menu button, .space-menu a { border-radius: 3px; }
.toast { border-radius: 4px; font-size: 13px; }
.modal { border-radius: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.modal header h2 { font-size: 15px; }
.modal textarea, .modal input:not([type=checkbox]):not([type=file]), .modal select, .auth-card input, .inline-form input, .inline-form select,
.copy-row input, .ask-form input, .note-form textarea, .admin-grid input:not([type=checkbox]), .admin-grid select, table.admin-users select { border-radius: 4px; }
.progress { height: 4px; border-radius: 1px; }
.progress span { background: var(--accent); border-radius: 1px; }
.cookie-notice { border-radius: 6px; }
.chip { border-radius: 4px; font-size: 12.5px; }
.msg { border-radius: 6px; }
.msg.q { background: var(--panel-2); color: var(--text-strong); border: 1px solid var(--border); border-bottom-right-radius: 6px; }
.msg.a { background: transparent; border: 0; border-left: 2px solid var(--accent); border-radius: 0; padding-left: 12px; }

/* insights: labelled rules, not coloured bubbles */
.ins { background: transparent; border: 1px solid var(--border); border-left-width: 2px; }
.ins-icon { width: auto; height: auto; background: transparent !important; color: inherit; border-radius: 0; }
.ins-kind { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; gap: 5px; }
.ins-opportunity { border-left-color: #5fa8a0; } .ins-opportunity .ins-kind { color: #7cc0b8; }

/* paywall + plans */
.pw-i { background: transparent; border: 1px solid var(--border); color: var(--link); border-radius: 4px; }
.pw-head .tag-ai { font-size: 12px; padding: 3px 8px; }
.plan { border-radius: 8px; padding: 28px 26px 24px; }
.plan h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.plan-tag { font-size: 15px; color: var(--muted); }
.plan-price .amt { font-size: 46px; font-weight: 500; letter-spacing: -0.04em; }
.plan-btn { border-radius: 4px; font-weight: 600; }
.plan-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.plan-btn.primary:hover { background: var(--accent-hover); }
.plan-head .ic { color: var(--accent); }
.plan.is-current { border-color: rgba(201, 164, 92, .5); box-shadow: none; }

/* loans + allocation */
.tile .value { font-weight: 500; font-size: 21px; letter-spacing: -0.02em; }
.nw-track { border-radius: 1px; height: 10px; }
.nw-track span { border-radius: 1px; }
.seg-arc { stroke: var(--panel); stroke-width: 1.5px; }
.donut-value { font-weight: 500; }

/* landing: an editorial page, not a slogan */
.landing { gap: 64px; padding: 56px 0 40px; }
.eyebrow { margin: 0 0 14px; color: var(--accent); }
.landing h1 { font-size: 38px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 500; max-width: 15em; }
.landing .lead { font-size: 16px; color: var(--muted); max-width: 34em; }
.features { display: grid; gap: 0; margin: 28px 0 0; max-width: 36em; border-top: 1px solid var(--border); }
.features > div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.features dt { padding-top: 2px; color: var(--text-strong); }
.features dd { margin: 0; color: var(--text); font-size: 14px; }
.auth-card { padding: 22px; border-radius: 8px; }
.auth-card .seg { margin-bottom: 16px; }

/* mobile tab bar */
.tabbar { background: var(--bg); backdrop-filter: none; }
.tabbar a { font-size: 10.5px; font-weight: 500; }
.tabbar a.active svg { color: var(--accent); }
.site-footer { border-top-color: var(--rule); }
@media (max-width: 760px) {
  .big { font-size: 36px; }
  .landing h1 { font-size: 28px; }
  .features > div { grid-template-columns: 1fr; gap: 2px; }
  .logo { width: 32px; height: 28px; font-size: 9.5px; }
}

body.signed-out .space-switch { display: none; }

/* ---------- welcome tour ---------- */
.modal.tour { max-width: 460px; margin: 0 auto; padding: 18px 22px 20px; }
.tour-top { display: flex; justify-content: space-between; align-items: center; }
.tour-step { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.tour-skip { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 4px 2px; }
.tour-skip:hover { color: var(--text-strong); }
.tour-body { padding: 28px 0 8px; min-height: 230px; }
.tour-icon { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; color: var(--accent); margin-bottom: 20px; }
.tour-body h2 { margin: 0 0 10px; font-size: 22px; font-weight: 600; color: var(--text-strong); letter-spacing: -0.015em; }
.tour-body p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); }
.tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--rule); }
.tour-dots { display: flex; gap: 6px; }
.tour-dots button { width: 18px; height: 3px; padding: 0; border: 0; border-radius: 1px; background: var(--border); }
.tour-dots button.on { background: var(--accent); }
.landing .lead { margin-bottom: 0; }
@media (max-width: 760px) {
  .modal.tour { border-radius: 10px 10px 0 0; }
  .tour-body { min-height: 0; padding-top: 22px; }
}

/* ---------- landing on any screen size: fill the viewport, scale the type ---------- */
body.signed-out { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.signed-out main { flex: 1; display: flex; align-items: center; width: 100%; max-width: 1440px; padding: 0 clamp(16px, 4vw, 64px); }
body.signed-out .site-footer { width: 100%; max-width: 1440px; padding-left: clamp(16px, 4vw, 64px); padding-right: clamp(16px, 4vw, 64px); margin-top: 0; }
.landing { width: 100%; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); align-items: center; gap: clamp(40px, 7vw, 140px); padding: clamp(32px, 7vh, 120px) 0; }
.landing h1 { font-size: clamp(34px, 3.9vw, 72px); line-height: 1.06; letter-spacing: -0.03em; max-width: 12em; margin-bottom: clamp(14px, 1.6vw, 24px); }
.landing .lead { font-size: clamp(16px, 1.2vw, 21px); max-width: 30em; }
.landing .eyebrow { font-size: clamp(11px, .75vw, 13px); margin-bottom: clamp(14px, 1.4vw, 22px); }
.auth-card { padding: clamp(20px, 1.8vw, 28px); }
@media (max-width: 760px) {
  body.signed-out main { align-items: flex-start; }
  .landing { grid-template-columns: 1fr; padding: 28px 0 36px; gap: 28px; }
}
/* logged out: the logo lines up with the content column on wide screens */
body.signed-out .topbar { padding-left: max(clamp(16px, 4vw, 64px), calc((100vw - 1440px) / 2 + 64px)); padding-right: max(clamp(16px, 4vw, 64px), calc((100vw - 1440px) / 2 + 64px)); }
/* cookie notice: the button can never be pushed off a narrow or clipped screen */
.cookie-notice { position: fixed; padding-right: 40px; }
.cookie-notice .btn-primary { flex: none; }
.cookie-x { position: absolute; top: 6px; right: 6px; background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 4px; line-height: 0; }
.cookie-x:hover { color: var(--text-strong); }
@media (max-width: 600px) {
  .cookie-notice { flex-direction: column; align-items: stretch; gap: 10px; left: 12px; right: 12px; }
  .cookie-notice .btn-primary { width: 100%; justify-content: center; padding: 10px; }
}

/* ---------- AI credit balance in the top bar ---------- */
.credit-pill { position: relative; display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px 7px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-strong); text-decoration: none; line-height: 1.2; }
.credit-pill:hover { background: var(--hover); border-color: #454139; }
.cp-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; color: var(--link); border: 1px solid rgba(201, 164, 92, .45); border-radius: 2px; padding: 0 4px; align-self: center; }
.cp-num { font-family: var(--mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cp-of, .cp-word { color: var(--muted); font-weight: 400; }
.cp-word { font-size: 12px; }
.cp-bar { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; background: var(--border); border-radius: 1px; overflow: hidden; }
.cp-bar span { display: block; height: 100%; background: var(--accent); }
.credit-pill.low .cp-num { color: var(--red); }
.credit-pill.low .cp-bar span { background: var(--red); }
body.signed-out .credit-pill { display: none; }
@media (max-width: 760px) {
  .cp-word { display: none; }
  .credit-pill { padding: 4px 8px 6px; gap: 5px; }
  .topbar-right { gap: 8px; }
}
@media (max-width: 380px) { .credit-pill .cp-label { display: none; } }
.credit-pill, .cp-num { white-space: nowrap; flex: none; }
@media (max-width: 760px) {
  #refresh span { display: none; }          /* icon-only Update on phones; it keeps its aria label below */
  #refresh { padding: 8px 10px; }
  .space-btn { max-width: 130px; }
}

/* ---------- usernames, social sign-in, password ---------- */
.at-field { display: flex; align-items: center; margin-top: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; }
.at-field > span { padding: 0 2px 0 10px; color: var(--muted); font-family: var(--mono); }
.at-field input { border: 0 !important; margin: 0 !important; background: transparent !important; padding-left: 2px !important; font-family: var(--mono); width: 100%; outline: none; }
.at-field:focus-within { outline: 2px solid var(--link); outline-offset: -1px; }
.auth-card .at-field input { padding: 10px 10px 10px 2px; color: var(--text-strong); font-size: 14px; }
.uname-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; min-height: 16px; }
.uname-hint.ok { color: var(--green); }
.uname-hint.bad { color: var(--red); }
.social { display: grid; gap: 8px; margin-bottom: 4px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; border-radius: 4px; border: 1px solid var(--border);
  color: var(--text-strong); text-decoration: none; font-weight: 500; background: var(--panel-2); }
.social-btn:hover { background: var(--hover); border-color: #454139; }
.social-btn.apple { background: #f6f2e8; color: #111; border-color: #f6f2e8; }
.social-btn.apple:hover { background: #fff; }
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.acct-rows { display: grid; gap: 12px; margin: 6px 0 12px; }
.acct-rows > div { display: grid; gap: 4px; }
.inline-form.tight { margin-top: 0; flex-wrap: nowrap; }
.inline-form.tight .at-field { flex: 1; margin-top: 0; min-width: 0; }
.inline-form.tight .at-field input { padding: 8px 10px 8px 2px; color: var(--text-strong); }
.pw-zone { margin: 4px 0 6px; }
.pw-zone summary, .danger-zone summary { cursor: pointer; font-size: 13px; color: var(--link); }
.pw-form { margin-top: 10px; }

/* ---------- settings: profile card + grouped rows ---------- */
.avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(201, 164, 92, .5);
  color: var(--link); font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .02em; background: rgba(201, 164, 92, .06); }
.avatar.lg { width: 56px; height: 56px; font-size: 17px; }
.profile-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px; margin-bottom: 14px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.profile-card:hover { border-color: #454139; background: var(--hover); }
.pc-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pc-text b, .profile-head b { color: var(--text-strong); font-family: var(--mono); font-weight: 500; font-size: 15px; }
.pc-text .muted, .profile-head .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-go { color: var(--muted); transform: rotate(-90deg); display: inline-flex; }
.profile-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.profile-head > div { display: flex; flex-direction: column; min-width: 0; }
.back-link { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--muted); font-size: 13px; padding: 0 0 10px; }
.back-link .ic { transform: rotate(90deg); }
.back-link:hover { color: var(--text-strong); }
.set-group { border: 1px solid var(--border); border-radius: 6px; padding: 4px 14px; margin-bottom: 12px; }
.set-group > .btn-row { padding: 2px 0 12px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 14px; color: var(--text); }
.set-row:last-child { border-bottom: 0; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 6px; }
.set-row .label { flex: none; }
.set-val { text-align: right; color: var(--text-strong); min-width: 0; overflow-wrap: anywhere; }
.set-select { width: auto !important; margin: 0 !important; padding: 6px 8px !important; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.set-group.fold { padding: 0 14px; }
.set-group.fold > summary { padding: 12px 0; font-size: 14px; color: var(--text-strong); cursor: pointer; list-style-position: inside; }
.set-group.fold[open] > summary { border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
.set-group.fold > :not(summary) { padding-bottom: 12px; }
.set-group.danger-zone { margin-top: 0; border-top: 1px solid var(--border); }
.set-group.danger-zone > summary { color: var(--red); }
.set-group.links { padding: 0; }
.set-link { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; font-size: 14px; color: var(--text); border-bottom: 1px solid var(--rule); text-decoration: none; }
.set-link:last-child { border-bottom: 0; }
.set-link:hover { background: var(--hover); color: var(--text-strong); }
.modal-actions.spread { justify-content: flex-start; margin-top: 4px; }
/* top bar never wraps; drop the "Updated …" note when space is short (the data refreshes itself anyway) */
.brand span, .updated, .topbar .btn-ghost, .topbar .btn-primary { white-space: nowrap; }
@media (max-width: 1100px) { .updated { display: none; } }
@media (min-width: 761px) and (max-width: 900px) { .add-top { display: none; } }
.pc-name { font-family: var(--sans) !important; font-weight: 600 !important; font-size: 15.5px !important; letter-spacing: -0.01em; }
.inline-form.tight > input { flex: 1; min-width: 0; margin: 0 !important; }

/* iOS-style switch, used where AI spends credits: one clear control, cost stated beside it */
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 38px !important; height: 22px !important; margin: 0 !important; padding: 0 !important;
  border-radius: 999px !important; border: 0 !important; background: var(--border) !important; position: relative; cursor: pointer; transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .2s cubic-bezier(.3,.7,.4,1); }
.switch:checked { background: var(--accent) !important; }
.switch:checked::after { transform: translateX(16px); background: #fff; }
.switch:disabled { opacity: .4; cursor: default; }
.switch:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.switch-row { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px !important; color: var(--text) !important;
  padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--border); cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { color: var(--muted); font-size: 12px; }
.form-grid .switch-row { margin-top: 2px; }
.cost-note { color: var(--muted); margin: 12px 0 0; line-height: 1.5; }
.modal-actions #pHint { margin-right: auto; align-self: center; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }
.back-link { background: none; border: 0; padding: 0; margin: 0 0 12px; color: var(--link); font: inherit; font-size: 13px; cursor: pointer; }
.back-link:hover { text-decoration: underline; }

/* Segmented controls (Gain/Value, chart type): iOS-style track with a raised thumb, set in the text face, not mono */
.seg.pill { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; flex-wrap: nowrap; }
.seg.pill button { font-family: var(--sans); font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--muted);
  border: 0; border-radius: 7px; margin: 0; padding: 4px 12px; min-height: 26px; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.seg.pill button:hover { color: var(--text); background: none; }
.seg.pill button.active { background: var(--panel-2); color: var(--text-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .06); }
.seg.pill.icons button { padding: 4px 8px; display: inline-flex; align-items: center; justify-content: center; }
.seg.pill.icons svg { width: 15px; height: 15px; }
.tools-right { display: flex; align-items: center; gap: 8px; }
/* Chart readout: words in the text face, figures in mono */
.legend .lg-when { font-family: var(--sans); color: var(--muted); }
.legend .lg-k { font-family: var(--sans); font-style: normal; color: var(--muted); margin-right: 6px; }
@media (prefers-reduced-motion: reduce) { .seg.pill button { transition: none; } }
@media (max-width: 640px) { .tools-right { justify-content: space-between; } .tools-right > .seg.pill { flex: none; } }

/* Legal footer: only on the signed-out welcome page, pinned to the bottom of the screen however tall it is.
   Signed in, the same links live in Settings → Legal & info. */
body.signed-out { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.signed-out > main { flex: 1 0 auto; width: 100%; }
body.signed-out .site-footer { margin-top: auto; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
body:not(.signed-out) .site-footer { display: none; }
.site-footer nav, .legal-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.legal-fold > :not(summary) { font-size: 12px; color: var(--muted); }
.legal-fold .legal-links { padding: 4px 0 8px; font-size: 13px; }
.legal-fold .legal-links a { color: var(--text); }
.legal-fold p { margin: 4px 0; padding-bottom: 0 !important; }
.legal-fold p:last-child { padding-bottom: 12px !important; }

/* Each plan's own monthly AI allowance, under the price (not part of the "Everything in …" list) */
.plan-credits { margin: 2px 0 18px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
  font-size: 13.5px; color: var(--text); display: grid; gap: 2px; }
.plan-credits b { font-family: var(--mono); font-weight: 500; font-size: 15px; color: var(--accent); margin-right: 2px; }
.plan-credits span { font-size: 12px; color: var(--muted); }
.plan-credits p { margin: 0; }

/* Currency effect: a quiet line under the result, with an ⓘ that explains it */
.fx-note { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.fx-note b { font-family: var(--mono); font-weight: 500; color: var(--text); }
.fx-note b.up { color: var(--green); } .fx-note b.down { color: var(--red); }
.fx-why { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 2px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.fx-why:hover, .fx-why:focus-visible { color: var(--text); background: var(--panel-2); }
.fx-sum { border: 1px solid var(--border); border-radius: 6px; margin: 14px 0; }
.fx-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 14px; }
.fx-sum > div:first-child { border-top: 0; }
.fx-sum b { font-family: var(--mono); font-weight: 500; }
.fx-sum .fx-total { background: var(--panel-2); }
.fx-sum b.up { color: var(--green); } .fx-sum b.down { color: var(--red); }
.set-note { margin: -4px 0 10px; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* Top bar fit steps (set by fitTopbar when a language's words don't fit) */
.topbar[data-fit~="updated"] .updated { display: none; }
.topbar[data-fit~="labels"] #refresh span, .topbar[data-fit~="labels"] .cp-word { display: none; }
.topbar[data-fit~="brand"] .brand span { display: none; }
.topbar[data-fit~="tight"] .nav a { padding-left: 8px; padding-right: 8px; }
.topbar[data-fit~="tight"] .topbar-right { gap: 8px; }

/* ---------- languages: fonts per script ----------
   Plex covers Latin and Greek; other scripts use the system's best face for that language (Han characters
   need the right font per language: PingFang for Chinese, Hiragino for Japanese, Apple SD Gothic for Korean). */
html:lang(zh) { --sans: 'IBM Plex Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif; --mono: 'IBM Plex Mono', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', monospace; }
html:lang(ja) { --sans: 'IBM Plex Sans', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, 'Noto Sans JP', sans-serif; --mono: 'IBM Plex Mono', 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', monospace; }
html:lang(ko) { --sans: 'IBM Plex Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif; --mono: 'IBM Plex Mono', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', monospace; }
html:lang(hi) { --sans: 'IBM Plex Sans', 'Kohinoor Devanagari', 'Devanagari Sangam MN', 'Nirmala UI', 'Noto Sans Devanagari', sans-serif; --mono: 'IBM Plex Mono', 'Kohinoor Devanagari', 'Nirmala UI', 'Noto Sans Devanagari', monospace; }
html:lang(ar) { --sans: 'IBM Plex Sans', 'SF Arabic', 'Geeza Pro', 'Segoe UI', 'Noto Sans Arabic', sans-serif; --mono: 'IBM Plex Mono', 'SF Arabic', 'Geeza Pro', 'Noto Sans Arabic', monospace; }
html:lang(he) { --sans: 'IBM Plex Sans', 'SF Hebrew', 'Arial Hebrew', 'Segoe UI', 'Noto Sans Hebrew', sans-serif; --mono: 'IBM Plex Mono', 'SF Hebrew', 'Arial Hebrew', 'Noto Sans Hebrew', monospace; }
/* Letter-spacing breaks Arabic joining and crowds CJK and Devanagari: small-caps style labels go plain there */
html:lang(ar) *, html:lang(hi) *, html:lang(zh) *, html:lang(ja) *, html:lang(ko) * { letter-spacing: 0 !important; }
html:lang(ar) body, html:lang(he) body, html:lang(hi) body { line-height: 1.6; }

/* ---------- right-to-left (Arabic, Hebrew) ----------
   Flex and grid mirror on their own; these are the places that set a side explicitly. Charts, prices and
   tables of numbers keep their natural direction. */
[dir="rtl"] th, [dir="rtl"] td { text-align: left; }
[dir="rtl"] th:first-child, [dir="rtl"] td:first-child, [dir="rtl"] tr.group td { text-align: right; }
[dir="rtl"] table.admin-users td, [dir="rtl"] table.admin-users th { text-align: right; }
[dir="rtl"] .earn, [dir="rtl"] .mright, [dir="rtl"] .loan-bal, [dir="rtl"] .sl-pct, [dir="rtl"] .sl-val,
[dir="rtl"] .nw-bars b, [dir="rtl"] .alloc-legend .muted, [dir="rtl"] .set-val { text-align: left; }
[dir="rtl"] .space-menu button, [dir="rtl"] .space-menu a, [dir="rtl"] .profile-card, [dir="rtl"] .set-link { text-align: right; }
[dir="rtl"] .pc-go { transform: rotate(90deg); }
[dir="rtl"] .back-link .ic { transform: rotate(-90deg); }
[dir="rtl"] td:first-child, [dir="rtl"] th:first-child { left: auto; right: 0; }
[dir="rtl"] .modal-actions #pHint { margin-right: 0; margin-left: auto; }
[dir="rtl"] .cookie-x { right: auto; left: 10px; }
[dir="rtl"] .tip { direction: rtl; }
/* figures, symbols and charts read left to right inside right-to-left text */
[dir="rtl"] .big, [dir="rtl"] .value, [dir="rtl"] .amt, [dir="rtl"] #chart, [dir="rtl"] .tk, [dir="rtl"] .cp-num,
[dir="rtl"] input[type="number"], [dir="rtl"] input[type="email"], [dir="rtl"] .at-field input { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .big, [dir="rtl"] .earn .value { text-align: right; }
[dir="rtl"] .earn .value { text-align: left; }
[dir="rtl"] .earn-rows b { direction: ltr; unicode-bidi: isolate; text-align: left; }
[dir="rtl"] .at-field { direction: ltr; }
[dir="rtl"] input[type="number"] { text-align: right; }

/* =====================================================================================
   Light theme: "paper ledger". Warm off-white paper, ink text, a deeper gold that keeps
   AA contrast on white, and green/red darkened so figures read at a glance.
   ===================================================================================== */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3ec; --panel: #fffdf8; --panel-2: #f1ede4; --hover: #ebe6da;
  --border: #ddd5c6; --rule: #e9e3d7;
  --text: #2c2924; --text-strong: #15130f; --muted: #6c665a;
  --accent: #8a6620; --accent-hover: #7a5a1c; --link: #81601e; --on-accent: #fffdf8;
  --green: #1a744c; --red: #b23f34;
  --blue: var(--accent); --blue-hover: var(--accent-hover);
}
:root[data-theme="light"] ::selection { background: rgba(154, 116, 40, .22); }
:root[data-theme="light"] .topbar { background: rgba(246, 243, 236, .94); backdrop-filter: blur(10px); }
:root[data-theme="light"] .tabbar { background: rgba(255, 253, 248, .96) !important; }
:root[data-theme="light"] dialog#modal::backdrop { background: rgba(32, 28, 20, .32); }
/* surfaces lift with soft shadows instead of borders alone */
:root[data-theme="light"] .card, :root[data-theme="light"] .earn, :root[data-theme="light"] .plan, :root[data-theme="light"] .tile,
:root[data-theme="light"] .loan { box-shadow: 0 1px 2px rgba(40, 32, 18, .05), 0 1px 0 rgba(40, 32, 18, .03); }
:root[data-theme="light"] .modal { box-shadow: 0 24px 60px rgba(40, 32, 18, .22); }
:root[data-theme="light"] .space-menu, :root[data-theme="light"] .sym-list, :root[data-theme="light"] .popover,
:root[data-theme="light"] .cookie-notice, :root[data-theme="light"] .toast { box-shadow: 0 14px 36px rgba(40, 32, 18, .18); }
/* hover states that were tuned for dark */
:root[data-theme="light"] .btn-ghost:hover, :root[data-theme="light"] .credit-pill:hover, :root[data-theme="light"] .social-btn:hover,
:root[data-theme="light"] .profile-card:hover, :root[data-theme="light"] .space-btn:hover, :root[data-theme="light"] .teaser:hover { border-color: #c9bfab; background: var(--hover); }
:root[data-theme="light"] .sym-list li:hover, :root[data-theme="light"] .sym-list li.active,
:root[data-theme="light"] .space-menu button:hover, :root[data-theme="light"] .space-menu a:hover, :root[data-theme="light"] .space-menu .active,
:root[data-theme="light"] .plan-btn:hover:not(:disabled) { background: var(--hover); }
:root[data-theme="light"] .plan-btn { border-color: var(--border); }
:root[data-theme="light"] .plan-btn.primary, :root[data-theme="light"] .btn-primary, :root[data-theme="light"] .msg.q, :root[data-theme="light"] .skip { color: var(--on-accent); }
:root[data-theme="light"] .btn-primary .cost { color: var(--on-accent); border-color: rgba(255, 253, 248, .45); }
:root[data-theme="light"] .cost { background: rgba(20, 18, 14, .07); }
/* tags and badges */
:root[data-theme="light"] .badge.ai, :root[data-theme="light"] .tag-ai, :root[data-theme="light"] .beta, :root[data-theme="light"] .cp-label { border-color: rgba(154, 116, 40, .45); color: var(--link); }
:root[data-theme="light"] .badge.shared { color: #1d7a52; border-color: rgba(31, 138, 90, .35); }
:root[data-theme="light"] .badge.warn { color: var(--red); border-color: rgba(200, 71, 58, .4); }
:root[data-theme="light"] .banner.invite, :root[data-theme="light"] .upsell { background: rgba(154, 116, 40, .07); border-color: rgba(154, 116, 40, .3); }
:root[data-theme="light"] .questions { background: rgba(176, 116, 0, .08); border-color: rgba(176, 116, 0, .3); }
:root[data-theme="light"] .plan.is-current { border-color: rgba(154, 116, 40, .55); }
:root[data-theme="light"] .avatar { border-color: rgba(154, 116, 40, .5); background: rgba(154, 116, 40, .08); color: var(--link); }
:root[data-theme="light"] .ins-risk .ins-kind, :root[data-theme="light"] .sym-status.bad, :root[data-theme="light"] .tk-mark.bad { color: var(--red); }
:root[data-theme="light"] .ins-opportunity .ins-kind { color: #2f7d74; }
/* sign in with Apple is black on light backgrounds, per Apple's guidelines */
:root[data-theme="light"] .social-btn.apple { background: #111; color: #fff; border-color: #111; }
:root[data-theme="light"] .social-btn.apple:hover { background: #000; }
/* switches and segmented controls */
:root[data-theme="light"] .switch { background: #d9d1c1 !important; }
:root[data-theme="light"] .switch:checked { background: var(--accent) !important; }
:root[data-theme="light"] .switch::after { background: #fff; box-shadow: 0 1px 3px rgba(40, 32, 18, .3); }
:root[data-theme="light"] .seg.pill { background: var(--panel-2); }
:root[data-theme="light"] .seg.pill button.active { background: var(--panel); box-shadow: 0 1px 2px rgba(40, 32, 18, .14), inset 0 0 0 1px rgba(40, 32, 18, .06); }
:root[data-theme="light"] .fx-why:hover { background: var(--hover); }

/* =====================================================================================
   Welcome page: the product shown as it is (a ledger), then one way in.
   ===================================================================================== */
.lp-login { display: none; }
body.signed-out .lp-login { display: inline-flex; margin-left: auto; color: var(--text-strong); font-size: 14px; font-weight: 500; padding: 7px 12px; border-radius: 8px; text-decoration: none; }
body.signed-out .lp-login:hover { background: var(--panel-2); }
.lp-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; padding: 64px 0 56px; }
.lp-copy h1 { font-size: 46px; line-height: 1.08; letter-spacing: -0.03em; font-weight: 500; color: var(--text-strong); margin: 0 0 18px; max-width: 13em; text-wrap: balance; }
.lp-copy .lead { font-size: 17px; color: var(--muted); max-width: 30em; margin: 0 0 28px; }
.lp-copy .btn-primary, .lp-end .btn-primary { text-decoration: none; display: inline-flex; }
.lp-fine { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.lp-preview { margin: 0; padding: 22px 22px 8px; }
.lp-cap { display: flex; align-items: center; justify-content: space-between; }
.lp-big { font-family: var(--mono); font-size: 34px; font-weight: 500; letter-spacing: -0.02em; color: var(--text-strong); margin: 8px 0 4px; }
.lp-chg { font-family: var(--mono); font-size: 13px; }
.lp-chg .pos { color: var(--green); }
.lp-chg .muted { font-family: inherit; }
.lp-spark { display: block; width: 100%; height: 84px; margin: 16px 0 8px; }
.lp-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.lp-rows li { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.lp-rows li:last-child { border-bottom: 0; }
.lp-rows .n { color: var(--text-strong); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.lp-rows .k { grid-column: 1; font-size: 12px; color: var(--muted); }
.lp-rows .v { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-family: var(--mono); font-size: 14px; color: var(--text-strong); }
.lp-rows .neg .v { color: var(--red); }
.lp-tag { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 4px; padding: 1px 6px; font-weight: 500; white-space: nowrap; }
.lp-section { padding: 44px 0 36px; border-top: 1px solid var(--rule); }
.lp-section > .label { margin: 0 0 8px; }
.lp-features { max-width: none; margin: 0; border-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; }
.lp-features > div { grid-template-columns: 210px 1fr; padding: 18px 0; }
.lp-features dt { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.lp-features dt svg { color: var(--accent); flex: none; margin-top: 2px; }
.lp-features dd { color: var(--muted); line-height: 1.5; }
.lp-end { text-align: center; padding: 64px 0 32px; border-top: 1px solid var(--rule); }
.lp-end h2 { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; color: var(--text-strong); margin: 0 auto 24px; max-width: 18em; text-wrap: balance; }
.lp-end .lang-pick { display: flex; justify-content: center; margin-top: 40px; }
.lp-auth { max-width: 440px; margin: 0 auto; padding: 24px 0 40px; }
.lp-auth .back-link { text-decoration: none; }
.lp-auth h1 { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; color: var(--text-strong); margin: 18px 0 6px; }
.lp-auth > p { margin: 0 0 20px; }
.lp-auth > p[hidden] + .auth-card { margin-top: 20px; }
@media (max-width: 860px) {
  .lp-hero { grid-template-columns: 1fr; gap: 36px; padding: 28px 0 36px; }
  .lp-copy h1 { font-size: 34px; }
  .lp-copy .btn-primary, .lp-end .btn-primary { width: 100%; justify-content: center; }
  .lp-features { grid-template-columns: 1fr; }
  .lp-features > div { grid-template-columns: 1fr; gap: 6px; }
  .lp-end { padding-top: 44px; }
  .lp-end h2 { font-size: 22px; }
  .lp-auth { padding-top: 12px; }
}
.lp { display: block; width: 100%; min-width: 0; }
.lp-features dt { text-transform: none; letter-spacing: 0; font-family: inherit; font-size: 15px; color: var(--text-strong); }
.lp-features > div:nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 860px) { .lp-features > div:nth-last-child(2) { border-bottom: 1px solid var(--rule); } }
/* hero: centred statement, the product underneath */
.lp-hero { grid-template-columns: 1fr; justify-items: center; gap: 48px; padding: 72px 0 56px; text-align: center; }
.lp-copy { display: flex; flex-direction: column; align-items: center; }
.lp-copy h1 { font-size: 52px; max-width: 12em; margin-bottom: 20px; }
.lp-copy .lead { max-width: 34em; margin-bottom: 30px; }
.lp-preview { width: 100%; max-width: 560px; text-align: start; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .55); }
:root[data-theme="light"] .lp-preview { box-shadow: 0 30px 70px -40px rgba(40, 32, 18, .35); }
@media (max-width: 860px) {
  .lp-hero { gap: 36px; padding: 32px 0 36px; }
  .lp-copy h1 { font-size: 34px; }
  .lp-copy .btn-primary { width: 100%; }
}
/* a file input that looks and behaves like a button: the real input covers it, so click, tap and keyboard all work */
.file-pick { position: relative; overflow: hidden; cursor: pointer; }
.file-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.forgot-link { display: inline-block; margin: -2px 0 10px; color: var(--link); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

/* Settings → Appearance: the row of style swatches */
.style-row { flex-direction: column; align-items: stretch; gap: 10px; }
.style-head { display: flex; justify-content: space-between; align-items: baseline; }
.style-name { font-size: 13px; color: var(--text-strong); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 1px solid var(--border); cursor: pointer; flex: none;
  outline-offset: 2px; transition: transform .12s ease; }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-checked="true"] { outline: 2px solid var(--text-strong); }
.swatch:focus-visible { outline: 2px solid var(--accent); }
@media (pointer: coarse) { .swatches { gap: 12px; } .swatch { width: 34px; height: 34px; } }
/* a link styled as a button keeps the button's text colour, also inside windows where links are tinted */
a.btn-primary, .modal-body a.btn-primary, a.btn-primary:hover, .modal-body a.btn-primary:hover { color: var(--on-accent); text-decoration: none; }

/* Allocation: one accent, ranked, bars = true share of the total; the tail folds into "N more" */
.astrip { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; margin: 18px 0 8px; }
.astrip span { min-width: 3px; background: var(--accent); transition: opacity .15s; }
.astrip span.rest { background: var(--border); }
.arank { list-style: none; margin: 0; padding: 0; }
.arank li { transition: opacity .15s; border-bottom: 1px solid var(--rule); }
.arank li:last-child { border-bottom: 0; }
.arank li > a, .arank li > div, .ar-more button { display: grid; grid-template-columns: minmax(0, 1fr) 64px 120px; column-gap: 12px; row-gap: 7px;
  align-items: baseline; padding: 11px 4px; color: inherit; text-decoration: none; }
.arank li > a:hover { background: var(--panel-2); }
.ar-name { display: flex; flex-direction: column; min-width: 0; }
.ar-name b { color: var(--text-strong); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-pct { text-align: right; color: var(--text-strong); font-weight: 600; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ar-val { text-align: right; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.ar-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.ar-bar span { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.ar-bar span.rest { background: var(--muted); }
.arank .ar-tail { display: none; }
.arank.open .ar-tail { display: block; }
.ar-more button { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.ar-more button b { color: var(--link); font-weight: 500; }
.ar-more button:hover b { text-decoration: underline; }
.astrip .dim, .arank .dim { opacity: .3; }
.alloc-card .astrip { margin: 6px 16px 6px; }
.alloc-card .arank { padding: 0 12px 6px; }
.alloc-card .arank li > a, .alloc-card .arank li > div, .alloc-card .ar-more button { padding: 9px 4px; }
@media (max-width: 640px) {
  .arank li > a, .arank li > div, .ar-more button { grid-template-columns: minmax(0, 1fr) 56px 96px; column-gap: 8px; }
  .ar-val { font-size: 12px; }
}
/* category colour dot in the allocation lists; the circle sits beside the list (above it on phones) */
.arank li > a, .arank li > div, .ar-more button { grid-template-columns: 10px minmax(0, 1fr) 64px 120px; }
.ar-dot { width: 10px; height: 10px; border-radius: 3px; align-self: center; }
.ar-bar { grid-column: 2 / -1; }
.alloc-page .alloc-grid { margin-top: 18px; align-items: center; }
.seg-arc { transition: opacity .15s; }
.seg-arc.dim { opacity: .3; }
@media (max-width: 640px) {
  .arank li > a, .arank li > div, .ar-more button { grid-template-columns: 10px minmax(0, 1fr) 56px 96px; }
  .alloc-page .donut { max-width: 240px; }
}
/* the softer category tones (items 8-14) lean towards white: pastel on dark, lighter tints on light */
:root { --cat-soft: #f4f4f4; }
:root[data-theme="light"] { --cat-soft: #ffffff; }
/* shades beyond the 7 palette colours lean lighter (towards --cat-soft) or deeper (towards --cat-deep) */
:root { --cat-deep: #3a3a3a; }
:root[data-theme="light"] { --cat-deep: #1f1f1f; }
/* by holding: a small header per type, in the circle's order */
.arank li.ar-group { display: grid; grid-template-columns: 10px minmax(0, 1fr) 64px 120px; column-gap: 12px; align-items: baseline;
  padding: 18px 4px 6px; border-bottom: 0; }
.arank li.ar-group:first-child { padding-top: 4px; }
.arank li.ar-group b { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.arank li.ar-group .ar-pct { font-size: 12px; color: var(--muted); font-weight: 500; }
.arank li.ar-group .ar-val { font-size: 12px; }
.arank li.ar-group .ar-dot { width: 8px; height: 8px; border-radius: 50%; }
@media (max-width: 640px) { .arank li.ar-group { grid-template-columns: 10px minmax(0, 1fr) 56px 96px; column-gap: 8px; } }
/* Admin → Email */
.nl-card { grid-column: 1 / -1; }
.nl-card textarea { width: 100%; font: inherit; line-height: 1.5; }
.nl-h { font-size: 13px; margin: 20px 0 8px; color: var(--text-strong); }
.check-row small { display: block; font-size: 12px; margin-top: 2px; }
.check-row input[type="checkbox"] { flex: none; }
.nl-sched { margin: 0 0 8px; padding-left: 18px; font-size: 14px; }

/* sign-up: first and last name side by side */
.name-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* pick a username: a tall pill, the @ already in place */
.modal.uname-pill { max-width: 380px; margin: auto; padding: 34px 28px 26px; border-radius: 36px; align-items: stretch; text-align: center; gap: 0; }
.uname-pill h2 { margin: 0 0 22px; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; color: var(--text-strong); }
.uname-at { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 0 18px; }
.uname-at:focus-within { outline: 2px solid var(--link); outline-offset: -1px; }
.uname-at > span { font-family: var(--mono); font-size: 18px; color: var(--muted); }
.uname-at input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; outline: none; font-family: var(--mono); font-size: 18px; padding: 14px 2px !important; margin: 0 !important; color: var(--text-strong); }
.uname-pill .uname-hint { margin: 10px 4px 20px; min-height: 32px; }
.uname-pill .btn-primary { border-radius: 999px; }
@media (max-width: 640px) { .modal.uname-pill { margin: auto 12px; border-radius: 32px; } dialog#modal:has(.uname-pill) { margin: auto; } }
.uname-at input:focus, .uname-at input:focus-visible { outline: none !important; box-shadow: none !important; }
.uname-at > span { color: var(--text); }
.uname-pill .btn-primary { justify-content: center; text-align: center; width: 100%; }
