/* Ferro: dark by default, light on request. Orange + blue brand, big radii, rings. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0e;
  --glow-a: rgba(255, 106, 26, 0.16);
  --glow-b: rgba(47, 123, 255, 0.14);
  --surface: #17171b;
  --surface-2: #222228;
  --surface-3: #2c2c33;
  --ink: #f5f5f7;
  --ink-2: #b6b6c0;
  --muted: #7d7d88;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --grid: #26262c;
  --axis: #3a3a42;
  --ref: #55555f;
  --tick: #7d7d88;
  --ring-track: rgba(255, 255, 255, 0.08);
  --nav: #1c1c21;
  --nav-ink: #8a8a95;
  --statbar: #222228;
  --tip: #24242a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --good: #3ddc84; --good-bg: rgba(61, 220, 132, 0.14);
  --warn: #ffc24a; --warn-bg: rgba(255, 194, 74, 0.14);
  --bad: #ff6b6b; --bad-bg: rgba(255, 107, 107, 0.14);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f1f4;
  --glow-a: rgba(255, 106, 26, 0.10);
  --glow-b: rgba(47, 123, 255, 0.08);
  --surface: #ffffff;
  --surface-2: #f1f1f4;
  --surface-3: #e6e6ec;
  --ink: #111114;
  --ink-2: #4c4c56;
  --muted: #8a8a94;
  --line: rgba(17, 17, 20, 0.07);
  --line-2: rgba(17, 17, 20, 0.12);
  --grid: #ececf0;
  --axis: #cfcfd6;
  --ref: #a9a9b3;
  --tick: #8a8a94;
  --ring-track: rgba(17, 17, 20, 0.07);
  --nav: #111114;
  --nav-ink: #8a8a95;
  --statbar: #111114;
  --tip: #ffffff;
  --shadow: 0 10px 30px rgba(17, 17, 20, 0.10);
  --good: #0f8a3c; --good-bg: #e3f6ea;
  --warn: #9a6400; --warn-bg: #fdf1d8;
  --bad: #c62f2f; --bad-bg: #fde7e7;
}
:root {
  --orange: #ff6a1a;
  --orange-2: #ff8f3f;
  --blue: #2f7bff;
  --blue-2: #5aa0ff;
  --grad-orange: linear-gradient(140deg, #ff9a4a 0%, #ff6a1a 55%, #f2520f 100%);
  --grad-blue: linear-gradient(140deg, #5aa8ff 0%, #2f7bff 55%, #1d5ee6 100%);
  --grad-green: linear-gradient(140deg, #a5e85c 0%, #6fcf3a 100%);
  --grad-yellow: linear-gradient(140deg, #ffd04d 0%, #ffad1f 100%);
  --accent: var(--orange);
  --radius: 24px;
  --nav-h: 66px;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink); font-size: 14.5px; line-height: 1.45; min-height: 100vh;
  background:
    radial-gradient(520px 320px at -10% -6%, var(--glow-a), transparent 70%),
    radial-gradient(480px 320px at 110% 2%, var(--glow-b), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
body.locked { overflow: hidden; }
a { color: var(--blue-2); text-decoration: none; }
:where(:root[data-theme="light"]) a { color: var(--blue); }
button, input, select { font: inherit; color: inherit; }
h1 { font-size: 27px; line-height: 1.12; margin: 2px 0 14px; letter-spacing: -0.02em; font-weight: 800; font-style: italic; }
h2 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 17px; margin: 0; font-weight: 800; font-style: italic; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ic { display: block; flex: none; }
.num { font-variant-numeric: tabular-nums; }

/* chrome */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink) !important; font-weight: 800; font-style: italic; font-size: 18px; letter-spacing: -0.02em; }
.logo { width: 34px; height: 34px; display: block; filter: drop-shadow(0 3px 10px rgba(255, 106, 26, 0.35)); }
.round { position: relative; width: 42px; height: 42px; border-radius: 50%; background: var(--surface); color: var(--ink-2) !important; display: grid; place-items: center; border: 1px solid var(--line); }
.sync-dot { position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg); background: var(--good); }
.sync-dot.bad { background: var(--bad); }
.sync-dot.busy { background: var(--warn); }
.view { max-width: 600px; margin: 0 auto; padding: 6px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 40px); }

.tabs {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 12px);
  width: min(568px, calc(100% - 32px)); height: var(--nav-h); border-radius: 33px; background: var(--nav);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.tabs a { position: relative; display: grid; place-items: center; height: 100%; color: var(--nav-ink); }
.tabs a.on { color: #fff; }
.tabs a.on::after { content: ""; position: absolute; bottom: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--orange); }
.tabs a.fab { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; background: var(--grad-orange); color: #fff; box-shadow: 0 6px 18px rgba(255, 106, 26, 0.45); }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card.flush { padding: 4px 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { flex: 1; min-width: 0; }
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.sec a { font-size: 13px; font-weight: 600; color: var(--ink-2) !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sub { font-size: 13px; color: var(--ink-2); }
.grad { color: #fff; border: 0; position: relative; overflow: hidden; }
.grad .sub, .grad .muted { color: rgba(255, 255, 255, 0.82); }
.grad::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, 0.10); pointer-events: none; }
.grad.g-orange { background: var(--grad-orange); }
.grad.g-blue { background: var(--grad-blue); }
.grad.g-green { background: var(--grad-green); color: #10210a; }
.grad.g-yellow { background: var(--grad-yellow); color: #2b1a00; }
.g-green .sub, .g-yellow .sub { color: rgba(0, 0, 0, 0.62); }

/* buttons + inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--surface-2); font-weight: 600; cursor: pointer; color: var(--ink) !important; }
.btn.primary { background: var(--grad-orange); color: #fff !important; box-shadow: 0 6px 16px rgba(255, 106, 26, 0.3); }
.btn.blue { background: var(--grad-blue); color: #fff !important; }
.btn.white { background: #fff; color: #111 !important; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink-2) !important; padding: 0 6px; }
.btn.danger { color: var(--bad) !important; }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: 0.45; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.icon-btn.go { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.92); color: #111; }
.icon-btn:active, .btn:active, .lift-card:active { transform: scale(0.97); }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=search], select {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid transparent; background: var(--surface-2); font-size: 16px;
}
input::placeholder { color: var(--muted); }
input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; line-height: 46px; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }
input:focus, select:focus { outline: none; border-color: var(--orange); }
input[type=file] { color: var(--ink-2); font-size: 13px; }
label.field { display: block; }
label.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }

.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; min-height: 34px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; padding: 0 6px; }
.seg button.on { background: var(--grad-blue); color: #fff; box-shadow: 0 4px 12px rgba(47, 123, 255, 0.35); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid transparent; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip.on { border-color: var(--orange); background: rgba(255, 106, 26, 0.14); }
.chip.off { color: var(--muted); }
.chip.off .key { opacity: 0.25; }
.key { width: 14px; height: 4px; border-radius: 2px; display: inline-block; flex: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* level chip: ordinal pips + name */
.lvl { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.lvl .pips { display: inline-flex; gap: 2px; }
.lvl .pips i { width: 6px; height: 11px; border-radius: 3px; background: var(--surface-3); }
.lvl .pips i.on { background: var(--orange); }
.grad .lvl { color: #fff; }
.grad .lvl .pips i { background: rgba(255, 255, 255, 0.3); }
.grad .lvl .pips i.on { background: #fff; }
.lvl-none { color: var(--muted); font-weight: 500; }

/* lists */
.list { margin: 0; padding: 0; list-style: none; }
.list > li + li { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: var(--ink) !important; min-height: 58px; }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .end { text-align: right; flex: none; }
.chev { color: var(--muted); }
.ico-tile { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--orange); }

/* figures */
.hero { font-size: 46px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.hero small { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-left: 4px; letter-spacing: 0; }
.grad .hero small { color: rgba(255, 255, 255, 0.8); }
.ring { position: relative; flex: none; }
.ring svg { display: block; }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-c b { font-size: 1em; font-weight: 800; letter-spacing: -0.03em; }
.ring-c span { font-size: 11px; color: var(--ink-2); font-weight: 500; }
.grad .ring-c span { color: rgba(255, 255, 255, 0.85); }
.statbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--statbar); border-radius: 22px; padding: 12px 6px; color: #fff; }
.statbar > div { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 0 4px; }
.statbar > div + div { border-left: 1px solid rgba(255, 255, 255, 0.12); }
.statbar b { font-size: 17px; font-weight: 700; }
.statbar span { font-size: 10.5px; color: #a9a9b3; line-height: 1.15; white-space: nowrap; }
.statbar .ic { color: var(--orange); }
.tile { border-radius: 22px; padding: 14px 15px; background: var(--surface); border: 1px solid var(--line); min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; }
.tile.grad { border: 0; }
.tile .label { font-size: 13px; font-weight: 600; }
.tile .value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.tile .value small { font-size: 13px; font-weight: 600; opacity: 0.8; margin-left: 3px; }
.tile .delta { font-size: 12px; font-weight: 600; opacity: 0.85; }
.up { color: var(--good); }
.down { color: var(--bad); }
.grad .up, .grad .down { color: inherit; }
.status { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px 4px 6px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status.up, .status.green { background: var(--good-bg); color: var(--good); }
.status.purple { background: rgba(155, 120, 255, 0.2); color: #b9a3ff; }
.status.blue { background: rgba(47, 123, 255, 0.18); color: #6aa8ff; }
:root[data-theme="light"] .status.purple { background: #efe8ff; color: #6a3fd6; }
:root[data-theme="light"] .status.blue { background: #e4eeff; color: #1d5ee6; }
.status.flat { background: var(--surface-2); color: var(--ink-2); }
.status.down { background: var(--bad-bg); color: var(--bad); }
.status.idle, .status.new { background: var(--surface-2); color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--grad-orange); color: #fff; letter-spacing: 0.03em; }

/* lift cards (horizontal carousel) */
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.lift-card { scroll-snap-align: start; flex: none; width: 162px; border-radius: 22px; padding: 14px; color: #fff !important; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.lift-card .t { font-weight: 700; font-size: 14px; line-height: 1.2; min-height: 34px; }
.lift-card .v { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.lift-card .v small { font-size: 12px; font-weight: 600; opacity: 0.85; margin-left: 2px; }
.lift-card .s { font-size: 11.5px; opacity: 0.9; }

/* charts */
.chart { position: relative; width: 100%; user-select: none; -webkit-user-select: none; }
.svg { display: block; overflow: visible; }
.svg .tick { font-size: 10.5px; fill: var(--tick); font-variant-numeric: tabular-nums; font-family: inherit; }
.svg .ref { font-size: 10.5px; fill: var(--ink-2); font-weight: 600; font-family: inherit; }
.tip { position: absolute; display: none; pointer-events: none; z-index: 5; min-width: 130px; max-width: 240px; padding: 9px 11px; background: var(--tip); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); font-size: 12px; }
.tip-h { font-weight: 700; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.65; }
.tip-row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tip-row span { flex: 1; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.tip-row.old { opacity: 0.55; }
.tip-note { margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.tip { max-width: 260px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13.5px; }
.hbar { display: grid; grid-template-columns: 96px 1fr 42px; align-items: center; gap: 10px; padding: 7px 0; }
.hbar .track { position: relative; height: 12px; background: var(--surface-2); border-radius: 999px; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--grad-orange); border-radius: 999px; }
.hbar .refl { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ref); }
.hbar .lab { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .val { text-align: right; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hbar-scale { display: grid; grid-template-columns: 96px 1fr 42px; gap: 10px; font-size: 10.5px; color: var(--muted); }
.hbar-scale .s { position: relative; height: 14px; }
.hbar-scale .s span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.prog { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 999px; background: #fff; }

/* tables */
table.std { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.std th { text-align: left; font-size: 11.5px; color: var(--ink-2); font-weight: 600; padding: 6px 6px; border-bottom: 1px solid var(--line-2); }
table.std td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.std tr.mine td { background: rgba(255, 106, 26, 0.14); font-weight: 700; }
table.std tr.mine td:first-child { border-radius: 10px 0 0 10px; }
table.std tr.mine td:last-child { border-radius: 0 10px 10px 0; }
table.std td.r, table.std th.r { text-align: right; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal .dow { font-size: 11.5px; color: var(--muted); font-weight: 600; padding-bottom: 2px; }
.cal button { aspect-ratio: 1 / 0.9; border: 0; border-radius: 12px; background: transparent; font-size: 14.5px; font-weight: 600; cursor: pointer; color: var(--ink); }
.cal button.other { color: var(--muted); opacity: 0.5; }
.cal button.has { background: var(--grad-orange); color: #fff; }
.cal button.today { box-shadow: inset 0 0 0 2px var(--blue); }

/* workout editor */
.ex-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.ex-card .ex-head { display: flex; align-items: flex-start; gap: 8px; padding: 14px 12px 6px 18px; }
.ex-card .ex-head a { color: var(--ink) !important; font-weight: 700; font-size: 16px; }
.setrow { display: grid; grid-template-columns: 22px minmax(0, 1fr) 12px minmax(0, 0.8fr) minmax(84px, auto) 34px; align-items: center; gap: 6px; padding: 5px 8px 5px 14px; }
.setrow .n { color: var(--orange); font-size: 13px; font-weight: 800; text-align: center; }
.setrow.todo .n { color: var(--muted); }
.setrow.todo input[data-f="r"] { border-color: var(--line-2); }
.setrow input { min-height: 44px; text-align: center; padding: 0 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.setrow .x { color: var(--muted); text-align: center; font-size: 13px; }
.setrow .res { font-size: 11.5px; line-height: 1.3; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.setrow .res b { color: var(--ink); font-size: 14px; }
.setrow-head { padding-top: 0; padding-bottom: 0; }
.setrow-head > span { font-size: 10.5px; color: var(--muted); font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: 0.06em; }
.ex-foot { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 12px 12px; }

/* sheet + toast */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 600px; max-height: 88vh; min-height: 60vh; background: var(--bg); border-radius: 28px 28px 0 0; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); animation: rise 0.18s ease-out; border-top: 1px solid var(--line-2); }
@keyframes rise { from { transform: translateY(30px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 10px 8px 18px; }
.sheet-wrap.top { inset: auto; left: 0; right: 0; top: 0; height: 100dvh; align-items: flex-start; }
.sheet.full { height: 100%; max-height: none; min-height: 0; border-radius: 0 0 24px 24px; border-top: 0; border-bottom: 1px solid var(--line-2); padding-top: env(safe-area-inset-top); padding-bottom: 0; animation: drop 0.16s ease-out; }
@keyframes drop { from { transform: translateY(-16px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet.full .sheet-body { flex: 1; min-height: 0; padding-bottom: 12px; }
.sheet-sticky { position: sticky; top: 0; z-index: 2; background: var(--bg); padding-bottom: 6px; }
.sheet-head h2 { font-style: italic; font-weight: 800; font-size: 19px; }
.sheet-body { overflow-y: auto; padding: 0 16px 20px; -webkit-overflow-scrolling: touch; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 26px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; z-index: 60; transition: opacity 0.3s; white-space: nowrap; }
.toast.out { opacity: 0; }
.searchbox { position: relative; }
.searchbox .ic { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.searchbox input { padding-left: 42px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
a.searchbox { display: block; }
a.searchbox span { display: flex; align-items: center; min-height: 48px; padding-left: 42px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14.5px; }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.thumbs img { width: 100%; border-radius: 14px; background: var(--surface-2); aspect-ratio: 4 / 3; object-fit: cover; }
details > summary { cursor: pointer; font-weight: 700; color: var(--orange); list-style: none; padding: 4px 0; }
details > summary::-webkit-details-marker { display: none; }
.note { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 16px; padding: 12px 14px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--grad-blue); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--orange); }
@media (min-width: 520px) { .grid4 { grid-template-columns: repeat(4, 1fr); } }

/* percentile card: small multiples + change rows */
.minis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini { position: relative; display: block; min-width: 0; background: var(--surface-2); border-radius: 16px; padding: 10px 11px 9px; color: var(--ink) !important; }
.mini-plot { position: relative; height: 64px; margin: 6px 0 4px; }
.mini-plot svg { display: block; width: 100%; height: 100%; }
.mini-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mini-foot { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; white-space: nowrap; }
.mini-foot > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.mini-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface-2); pointer-events: none; }
.dumbs { display: grid; gap: 14px; }
.dumb { display: block; color: var(--ink) !important; }
.dtrack { position: relative; height: 16px; margin-top: 6px; background: var(--surface-2); border-radius: 999px; }
.dtrack .refl { position: absolute; top: 2px; bottom: 2px; width: 1px; background: var(--ref); }
.dseg { position: absolute; top: 6px; height: 4px; border-radius: 2px; }
.dseg.up { background: var(--good); } .dseg.down { background: var(--bad); } .dseg.flat { background: var(--muted); }
.dtrack i { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); }
.dtrack .d0 { border: 2.5px solid; background: var(--surface); }
.dtrack .d1 { box-shadow: 0 0 0 2px var(--surface); }
.dscale { position: relative; height: 14px; font-size: 10.5px; color: var(--muted); margin-top: -4px; }
.dscale span { position: absolute; transform: translateX(-50%); }
