/* ===== Themes ===== */
:root {
  --fs: 1;
  /* Daylight */
  --bg: #f1f3fb;
  --card: #ffffff;
  --card-solid: #ffffff;
  --panel: #f1f3fb;
  --ink: #111827;
  --muted: #56607a;
  --line: #e2e5ef;
  --g1: #7c5cff; --g2: #22d3ee; --b-light: #4a43e0; --b-dark: #8c9bff;
  --brand: var(--b-light);
  --brand-soft: color-mix(in srgb, var(--brand) 14%, transparent);
  --brand-ink: #ffffff;
  --pos: #0b7f55;
  --pos-soft: #dcf5ea;
  --neg: #c92a3a;
  --neg-soft: #fde4e7;
  --warn: #a15c00;
  --warn-soft: #fff1d6;
  --side: #0d1328;
  --side-ink: #c5cde4;
  --side-active: #1d2750;
  --chip: #eceef6;
  --shadow: 0 1px 2px rgba(17, 24, 39, .06), 0 6px 20px rgba(17, 24, 39, .05);
  --thrust: linear-gradient(90deg, var(--g1), var(--g2));
  --tmix: 58%;
  --tmixc: #000;
  --pos-ink: color-mix(in srgb, var(--pos) 80%, var(--tmixc));
  --neg-ink: color-mix(in srgb, var(--neg) 80%, var(--tmixc));
  --warn-ink: color-mix(in srgb, var(--warn) 80%, var(--tmixc));
  --r: 16px;
  color-scheme: light;
}
[data-theme="space"] {
  --bg: #050816;
  --card: rgba(16, 22, 54, .74);
  --card-solid: #0f1536;
  --panel: #070b20;
  --ink: #eef2ff;
  --muted: #a3b2d8;
  --line: rgba(130, 150, 255, .2);
  --brand: var(--b-dark);
  --brand-soft: color-mix(in srgb, var(--brand) 18%, transparent);
  --brand-ink: #0a0f26;
  --pos: #3de0a8;
  --pos-soft: rgba(61, 224, 168, .14);
  --neg: #ff7385;
  --neg-soft: rgba(255, 115, 133, .16);
  --warn: #ffc26b;
  --warn-soft: rgba(255, 194, 107, .15);
  --side: rgba(5, 8, 26, .8);
  --side-ink: #a8b6dc;
  --side-active: rgba(124, 140, 255, .2);
  --chip: rgba(130, 150, 255, .13);
  --shadow: 0 0 0 1px rgba(130, 150, 255, .04), 0 12px 40px rgba(0, 0, 0, .38);
  --thrust: linear-gradient(90deg, var(--g1), var(--g2));
  --tmix: 72%;
  --tmixc: #fff;
  --on-primary: #06091c; --blur: 12px; --neb: 20%; --neb2: 15%;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: calc(17px * var(--fs)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
[data-theme="space"] body {
  background:
    radial-gradient(1100px 620px at 88% -8%, color-mix(in srgb, var(--g1) 30%, transparent), transparent 62%),
    radial-gradient(900px 520px at -4% 104%, color-mix(in srgb, var(--g2) 17%, transparent), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}
html[data-fx~="stars"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: var(--star-op, .85); filter: var(--star-filter, none);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='30' cy='60' r='1.1' opacity='.8'/%3E%3Ccircle cx='120' cy='210' r='.8' opacity='.5'/%3E%3Ccircle cx='210' cy='40' r='1.3' opacity='.7'/%3E%3Ccircle cx='300' cy='150' r='.9' opacity='.55'/%3E%3Ccircle cx='390' cy='80' r='1.1' opacity='.75'/%3E%3Ccircle cx='470' cy='230' r='.8' opacity='.5'/%3E%3Ccircle cx='60' cy='330' r='1' opacity='.65'/%3E%3Ccircle cx='170' cy='420' r='1.2' opacity='.7'/%3E%3Ccircle cx='260' cy='300' r='.7' opacity='.45'/%3E%3Ccircle cx='350' cy='400' r='1.1' opacity='.7'/%3E%3Ccircle cx='450' cy='470' r='.9' opacity='.55'/%3E%3Ccircle cx='500' cy='350' r='1.2' opacity='.7'/%3E%3Ccircle cx='90' cy='480' r='.8' opacity='.5'/%3E%3Ccircle cx='330' cy='500' r='.7' opacity='.45'/%3E%3Ccircle cx='430' cy='20' r='.8' opacity='.5'/%3E%3Ccircle cx='15' cy='180' r='.9' opacity='.6'/%3E%3C/g%3E%3C/svg%3E");
}
.app, #drawer, #toast { position: relative; z-index: 1; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.tc { color: color-mix(in srgb, var(--tcol) var(--tmix), var(--tmixc)); }

/* ===== Layout ===== */
.app { display: grid; grid-template-columns: 17rem minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--side);
  color: var(--side-ink);
  padding: 1.4rem 1rem;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1.6rem;
  border-right: 1px solid rgba(130, 150, 255, .12);
}
.sidebar { backdrop-filter: blur(var(--blur, 0px)); }
.brand { display: flex; align-items: center; gap: .75rem; padding: 0 .5rem; color: #fff; }
.brand .logo { width: 2.7rem; height: 2.7rem; flex: none; }
.brand b { font-size: 1.15rem; line-height: 1.1; display: block; letter-spacing: .01em; }
.brand small { color: var(--side-ink); font-size: .85rem; }
.nav { display: flex; flex-direction: column; gap: .25rem; }
.nav a {
  display: flex; align-items: center; gap: .8rem;
  padding: .8rem .9rem; border-radius: 12px;
  color: var(--side-ink); text-decoration: none; font-size: 1.05rem; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav svg { width: 1.35rem; height: 1.35rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: .8rem; padding: 0 .4rem; }
.side-foot .row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .95rem; }
.mini-btn {
  background: rgba(255, 255, 255, .09); color: #fff; border: 0; border-radius: 10px;
  padding: .45rem .8rem; cursor: pointer; font-weight: 600;
}
.mini-btn:hover { background: rgba(255, 255, 255, .17); }
.mini-btn.on { background: #f5b942; color: #1a1300; }

main { padding: 2rem 2.4rem 4rem; max-width: 1400px; width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 2rem; letter-spacing: -.02em; }
.page-head p { color: var(--muted); font-size: 1.05rem; margin-top: .2rem; }
.head-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.4rem 1.5rem; }
.card { backdrop-filter: blur(var(--blur, 0px)); }
.card h2 { font-size: 1.2rem; margin-bottom: .2rem; }
.card .sub { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head .sub { margin: 0; }

.grid { display: grid; gap: 1.2rem; margin-bottom: 1.2rem; }
.g-hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.g-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.g-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ===== Controls ===== */
.btn {
  border: 1px solid var(--line); background: var(--card-solid); border-radius: 12px;
  padding: .65rem 1.1rem; cursor: pointer; font-weight: 600; font-size: 1rem;
}
.btn:hover { background: var(--chip); }
.btn.primary { background: linear-gradient(90deg, var(--btn-g1, var(--g1)), var(--btn-g2, var(--g2))); color: var(--on-primary, #fff); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.sm { padding: .4rem .8rem; font-size: .92rem; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.secret-on { background: #f5b942; color: #1a1300; border-color: transparent; }
.seg { display: inline-flex; background: var(--chip); border-radius: 12px; padding: .2rem; gap: .15rem; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: .45rem .9rem; border-radius: 9px;
  cursor: pointer; font-weight: 600; color: var(--muted); font-size: .98rem;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--card-solid); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.chip {
  border: 1.5px solid var(--line); background: transparent; border-radius: 999px;
  padding: .4rem .9rem; cursor: pointer; font-weight: 600; font-size: .96rem;
  display: inline-flex; align-items: center; gap: .45rem; color: var(--muted);
}
.chip i { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.chip:hover { border-color: var(--brand); }
input[type=text], input[type=search], input[type=number], input[type=date], select {
  background: var(--card-solid); border: 1.5px solid var(--line); border-radius: 12px;
  padding: .6rem .85rem; font-size: 1rem; min-width: 0;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
label.field { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 600; color: var(--muted); }
label.field input, label.field select { color: var(--ink); font-weight: 500; }
.switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-weight: 600; user-select: none; }
.switch input { width: 1.2rem; height: 1.2rem; accent-color: var(--brand); }
.money { position: relative; display: inline-flex; align-items: center; }
.money > i { position: absolute; left: .85rem; font-style: normal; color: var(--muted); font-weight: 600; pointer-events: none; }
.money > input { padding-left: 1.7rem; width: 100%; text-align: right; }
body.secret input.sec { -webkit-text-security: disc; }
.dprev { display: block; font-size: .92rem; min-height: 1.2em; text-align: right; }

/* ===== Hero / trajectory ===== */
.hero-label { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .95rem; }
.hero-num { font-size: 3.6rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; margin: .25rem 0 .6rem; }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 999px; font-weight: 650; font-size: .98rem; }
.pill.pos { background: var(--pos-soft); color: var(--pos-ink); }
.pill.neg { background: var(--neg-soft); color: var(--neg-ink); }
.pill.flat { background: var(--chip); color: var(--muted); }
.pos { color: var(--pos-ink); } .neg { color: var(--neg-ink); } .muted { color: var(--muted); }
.bar { height: .95rem; background: var(--chip); border-radius: 999px; overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--thrust); box-shadow: 0 0 14px rgba(34, 211, 238, .45); }
.traj { margin-top: 1rem; }
.traj svg { width: 100%; height: auto; display: block; overflow: visible; }
.traj .lbl { fill: var(--muted); font-size: 15px; font-weight: 600; }
.traj .lbl-strong { fill: var(--ink); font-size: 16px; font-weight: 700; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.hero-stats small { display: block; color: var(--muted); font-weight: 600; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; }
.hero-stats b { font-size: 1.25rem; letter-spacing: -.01em; }
.tile .t-label { color: var(--muted); font-weight: 600; font-size: .95rem; }
.tile .t-num { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; margin-top: .15rem; }
.tile .t-note { color: var(--muted); font-size: .92rem; margin-top: .15rem; }

.donut-wrap { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.2rem; align-items: center; }
.donut { position: relative; width: 11rem; height: 11rem; }
.donut .mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut .mid b { font-size: 1.3rem; display: block; }
.donut .mid span { font-size: .9rem; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: .5rem; }
.legend .li { display: grid; grid-template-columns: .8rem minmax(0, 1fr) auto auto; gap: .6rem; align-items: center; font-size: 1rem; }
.legend .li i { width: .8rem; height: .8rem; border-radius: 4px; }
.legend .li .p { color: var(--muted); min-width: 3.2rem; text-align: right; }

.list { display: flex; flex-direction: column; }
.list .it { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line); font-size: 1rem; }
.list .it:first-child { border-top: 0; }
.list .it .nm { font-weight: 600; }
.list .it .sm { color: var(--muted); font-size: .95rem; display: block; font-weight: 400; }
.list h3 { font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .4rem 0 .2rem; }
.tag-warn { background: var(--warn-soft); color: var(--warn-ink); border-radius: 999px; padding: .15rem .65rem; font-weight: 650; font-size: .92rem; white-space: nowrap; }
.tag-bad { background: var(--neg-soft); color: var(--neg-ink); border-radius: 999px; padding: .15rem .65rem; font-weight: 700; font-size: .92rem; white-space: nowrap; }
.tag-soft { background: var(--chip); color: var(--muted); border-radius: 999px; padding: .15rem .65rem; font-weight: 600; font-size: .92rem; white-space: nowrap; }

.chart-box { position: relative; height: 22rem; }
.chart-box.tall { height: 26rem; }

/* ===== Insight ===== */
.insight { border-left: 4px solid var(--ic, var(--brand)); background-image: linear-gradient(120deg, color-mix(in srgb, var(--ic, var(--brand)) 10%, transparent), transparent 55%); margin-bottom: 1.2rem; }
.ins-head { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: .6rem; }
.ins-head .sub { margin-bottom: 0; }
.spark { font-size: 1.6rem; color: var(--ic, var(--brand)); line-height: 1.1; }
.ins-p { font-size: 1.08rem; line-height: 1.65; margin: .7rem 0; }
.ins-foot { color: var(--muted); font-size: .92rem; margin-top: .8rem; }
.ins-p a { color: var(--brand); font-weight: 600; }

/* ===== Tables ===== */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; max-height: 38rem; background: var(--card); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 1rem; }
th, td { padding: .8rem 1rem; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th.r, td.r { text-align: right; }
thead th {
  position: sticky; top: 0; background: var(--card-solid); z-index: 2;
  font-size: .92rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  cursor: pointer; user-select: none; border-bottom: 2px solid var(--line);
}
thead th:hover { color: var(--ink); }
thead th.sorted { color: var(--brand); }
thead th .arr { margin-left: .3rem; opacity: 1; }
thead th.sorted .arr { opacity: 1; }
tbody tr:hover td { background: var(--brand-soft); }
tbody tr.click { cursor: pointer; }
tbody tr.typed td { background: color-mix(in srgb, var(--rc) 9%, transparent); }
tbody tr.typed td:first-child { box-shadow: inset 4px 0 0 var(--rc); }
tbody tr.typed:hover td { background: color-mix(in srgb, var(--rc) 18%, transparent); }
tfoot td { position: sticky; bottom: 0; background: var(--card-solid); font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
td .nm { font-weight: 600; }
td .sm { display: block; color: var(--muted); font-size: .95rem; }
.badge { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .92rem; }
.badge i { width: .65rem; height: .65rem; border-radius: 50%; }
.share { display: inline-block; width: 4.5rem; height: .5rem; background: var(--chip); border-radius: 99px; margin-left: .5rem; vertical-align: middle; overflow: hidden; }
.share > span { display: block; height: 100%; background: var(--brand); }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); }

/* ===== Reports ===== */
.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .8rem; margin-bottom: .6rem; }
.tpl { position: relative; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: .9rem 1rem; cursor: pointer; }
.tpl:hover { border-color: var(--brand); }
.tpl.on { border-color: var(--brand); background: var(--brand-soft); }
.tpl b { display: block; font-size: 1.02rem; padding-right: 1.4rem; }
.tpl span.d { color: var(--muted); font-size: .95rem; }
.tpl .x { position: absolute; top: .45rem; right: .5rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: .2rem .35rem; border-radius: 6px; }
.tpl .x:hover { background: var(--chip); color: var(--ink); }
.tpl .star { color: #f5b942; margin-right: .25rem; }
.tpl-foot { margin-bottom: 1.2rem; font-size: .92rem; color: var(--muted); }
.tpl-foot button { border: 0; background: transparent; color: var(--brand); font-weight: 600; cursor: pointer; padding: 0; }
.filters { display: flex; flex-direction: column; gap: 1.1rem; }
.f-row { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: flex-end; }
.f-row .grow { flex: 1; min-width: 14rem; }
.f-label { font-size: .88rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.summary .s { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; }
.summary .s small { color: var(--muted); font-weight: 600; font-size: .95rem; }
.summary .s b { display: block; font-size: 1.6rem; letter-spacing: -.02em; }
.save-rep { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; padding: 1rem; border: 1.5px dashed var(--brand); border-radius: 12px; background: var(--brand-soft); }

/* ===== Escape velocity ===== */
.ms { display: flex; flex-direction: column; gap: 0; position: relative; }
.ms .m { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .85rem 0; border-top: 1px solid var(--line); }
.ms .m:first-child { border-top: 0; }
.ms .dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2.5px solid var(--line); display: grid; place-items: center; font-size: .85rem; font-weight: 800; }
.ms .m.done .dot { font-size: 1.2rem; line-height: 1; }   /* a bigger tick reads clearly on the green in every theme */
.ms .m.done .dot { background: var(--pos); border-color: var(--pos); color: var(--on-pos, #06150f); }
.ms .m.next .dot { border-color: var(--brand); background: var(--brand-soft); }
.ms .m b { font-size: 1.1rem; }
.scn { width: 100%; }
.lock { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; padding: .3rem .8rem; border-radius: 999px; font-size: .92rem; }
.lock.on { background: var(--pos-soft); color: var(--pos-ink); }
.lock.off { background: var(--warn-soft); color: var(--warn-ink); }

/* ===== Drawer / toast / misc ===== */
#drawer { position: fixed; inset: 0; display: none; z-index: 50; }
#drawer.open { display: block; }
#drawer .scrim { position: absolute; inset: 0; background: rgba(3, 5, 16, .62); }
#drawer .panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(46rem, 100%);
  background: var(--panel); overflow-y: auto; padding: 1.6rem 1.8rem 3rem;
  box-shadow: -10px 0 40px rgba(0, 0, 0, .4); border-left: 1px solid var(--line);
}
.panel .close { float: right; }
.panel h2 { font-size: 1.7rem; margin: .3rem 0 .2rem; }
#toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(2rem); opacity: 0;
  background: #111735; color: #fff; padding: .85rem 1.4rem; border-radius: 12px; font-weight: 600;
  transition: .25s; z-index: 80; pointer-events: none; border: 1px solid rgba(140, 155, 255, .35);
  width: max-content; max-width: min(34rem, calc(100vw - 2rem)); text-align: center; line-height: 1.4;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.has-action.show { pointer-events: auto; }
.toast-undo { margin-left: .5rem; padding: .2rem .7rem; border-radius: 8px; border: 1.5px solid currentColor; background: transparent; color: #8fe3ff; font: inherit; font-weight: 800; cursor: pointer; }
.toast-undo:hover { background: rgba(255,255,255,.12); }
.note-box { background: var(--brand-soft); border-radius: 12px; padding: .9rem 1.1rem; font-size: .98rem; margin-bottom: 1.2rem; }
.upd-in { width: 11rem; }
.welcome { max-width: 40rem; margin: 3rem auto; text-align: center; }
.welcome h1 { font-size: 2.4rem; letter-spacing: -.02em; margin-bottom: .6rem; }
.welcome p { color: var(--muted); font-size: 1.15rem; margin-bottom: 1.5rem; }
.welcome .row { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.set-grid { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.set-row:first-of-type { border-top: 0; }
.set-row small { display: block; color: var(--muted); font-size: .95rem; }

@media (max-width: 1100px) {
  .g-hero, .g-main, .g-2, .set-grid { grid-template-columns: minmax(0, 1fr); }
  .g-tiles, .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .8rem; gap: .6rem; }
  .nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; }
  .nav a { padding: .6rem .8rem; white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; }
  main { padding: 1.2rem 1rem 3rem; }
  .hero-num { font-size: 2.6rem; }
  .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .hero-stats { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .sidebar, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}
