:root {
  --bg: #1C1C1C; --panel: #242321; --panel-2: #2C2B28; --line: #3A3835; --line-soft: #2F2E2B;
  --text: #F5F5F0; --muted: #B5B0A4; --faint: #7F7A70;
  --gold: #D4AF37; --gold-dim: #A98E2C; --gold-soft: rgba(212,175,55,.14);
  --crimson: #7A1E1E; --crimson-bright: #A3302E; --crimson-soft: rgba(163,48,46,.16);
  --bronze: #A97142; --good: #6BAE74; --warn: #D9A441; --bad: #D0564B;
  --rail: 236px; --radius: 10px; --radius-sm: 6px;
  --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; margin: 0; color: var(--text); }
h1 { font-size: 1.7rem; line-height: 1.2; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
img { max-width: 100%; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .86rem; } .tiny { font-size: .78rem; }
.gold { color: var(--gold); } .good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; } .center { text-align: center; }
.mt { margin-top: 1rem; } .mt-s { margin-top: .5rem; } .mb { margin-bottom: 1rem; } .mb-s { margin-bottom: .5rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row > select, .row > input:not([type=checkbox]) { width: auto; max-width: 100%; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hidden { display: none !important; }

/* Layout */
#app { min-height: 100vh; }
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.shell > * { min-width: 0; }
.rail { background: #171716; border-right: 1px solid var(--line-soft); padding: 1.1rem .9rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; padding: .25rem .4rem; }
.brand img { width: 44px; height: 44px; }
.brand .word { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 1.05rem; letter-spacing: .08em; line-height: 1.1; }
.brand .sub { font-size: .7rem; color: var(--muted); letter-spacing: .14em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--gold-soft); color: var(--gold); }
.nav .ico { width: 20px; text-align: center; font-size: 1rem; opacity: .9; }
.rail .who { margin-top: auto; padding: .6rem .7rem; border-top: 1px solid var(--line-soft); font-size: .86rem; }
.rail .who b { display: block; color: var(--text); }
.main { padding: 1.4rem 1.6rem 5rem; max-width: 1240px; width: 100%; }
.topbar { display: none; }
.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: .6rem .9rem; background: #171716; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 5; }
  .topbar .brand img { width: 34px; height: 34px; }
  .topbar .brand .word { font-size: .95rem; }
  .main { padding: 1rem .9rem 6rem; overflow-x: hidden; }
  html, body { overflow-x: hidden; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #171716; border-top: 1px solid var(--line-soft); z-index: 5; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; text-align: center; padding: .55rem 0 .5rem; color: var(--muted); font-size: .7rem; display: flex; flex-direction: column; gap: 2px; }
  .tabbar a .ico { font-size: 1.15rem; }
  .tabbar a.active { color: var(--gold); }
  h1 { font-size: 1.4rem; }
}

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head .eyebrow { color: var(--muted); font-size: .86rem; margin-bottom: .2rem; }
.rule { height: 1px; background: linear-gradient(90deg, var(--gold), transparent); margin: .4rem 0 1rem; opacity: .6; }

/* Cards and panels */
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card.tight { padding: .7rem .85rem; }
.card h3 { margin-bottom: .5rem; }
.card .head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.kpi { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: .8rem 1rem; }
.kpi .n { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: .84rem; }
.kpi.alert .n { color: var(--bad); }
.hero { background: linear-gradient(135deg, #262320 0%, #1F1D1B 60%); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.3rem 1.4rem; display: flex; gap: 1.2rem; align-items: center; }
.hero img { width: 84px; height: 84px; }
.hero h1 { color: var(--gold); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font-weight: 500; font-size: .92rem; line-height: 1.2; }
.btn:hover { border-color: var(--gold-dim); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.btn.primary:hover { background: var(--crimson-bright); border-color: var(--crimson-bright); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1C1C1C; }
.btn.ghost { background: transparent; }
.btn.sm { padding: .3rem .6rem; font-size: .82rem; }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Forms */
label.f { display: flex; flex-direction: column; gap: .3rem; font-size: .86rem; color: var(--muted); }
label.f > span { font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  width: 100%; background: #171716; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .6rem; color: var(--text); font-size: .95rem;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
select option { background: #222; }
textarea { min-height: 80px; resize: vertical; }
input[type=file] { color: var(--muted); font-size: .85rem; }
.form-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { margin-top: .25rem; accent-color: var(--gold); }
.segment { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.segment button { background: transparent; border: 0; padding: .4rem .7rem; color: var(--muted); cursor: pointer; font-size: .86rem; }
.segment button.on { background: var(--gold-soft); color: var(--gold); }
.scale { display: flex; gap: .35rem; }
.scale button { flex: 1; padding: .55rem 0; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #171716; color: var(--muted); cursor: pointer; font-weight: 600; }
.scale button.on { background: var(--gold); color: #1C1C1C; border-color: var(--gold); }
.error { color: var(--bad); font-size: .88rem; }
.note { background: var(--gold-soft); border-left: 3px solid var(--gold); padding: .6rem .8rem; border-radius: 4px; font-size: .9rem; }
.note.red { background: var(--crimson-soft); border-left-color: var(--crimson-bright); }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; white-space: nowrap; }
tr:hover td { background: rgba(255,255,255,.015); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table input[type=number], table input[type=text] { padding: .3rem .4rem; min-width: 64px; font-size: .9rem; }
.grid-entry input { width: 70px; }

/* Badges, pills, bars */
.pill { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; border: 1px solid transparent; }
.pill.tier-Novae { background: #2d2b26; color: var(--muted); border-color: var(--line); }
.pill.tier-Ferrata { background: rgba(169,113,66,.18); color: #D9A777; border-color: rgba(169,113,66,.4); }
.pill.tier-Invicta { background: var(--gold-soft); color: var(--gold); border-color: rgba(212,175,55,.45); }
.pill.verified { background: rgba(107,174,116,.15); color: var(--good); }
.pill.recorded, .pill.reviewed { background: rgba(217,164,65,.14); color: var(--warn); }
.pill.high { background: var(--crimson-soft); color: #E07A74; }
.pill.watch { background: rgba(217,164,65,.14); color: var(--warn); }
.pill.info { background: rgba(255,255,255,.06); color: var(--muted); }
.pill.band-target { background: var(--gold-soft); color: var(--gold); }
.pill.band-on_track { background: rgba(107,174,116,.15); color: var(--good); }
.pill.band-developing { background: rgba(217,164,65,.14); color: var(--warn); }
.pill.band-below { background: var(--crimson-soft); color: #E07A74; }
.pill.status-draft { color: var(--muted); background: rgba(255,255,255,.06); }
.pill.status-approved { color: var(--good); background: rgba(107,174,116,.15); }
.pill.status-open { color: var(--warn); background: rgba(217,164,65,.14); }
.pill.status-done, .pill.status-closed { color: var(--good); background: rgba(107,174,116,.15); }
.bar { height: 8px; background: #171716; border-radius: 999px; overflow: hidden; border: 1px solid var(--line-soft); }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--bronze), var(--gold)); border-radius: 999px; }
.pct-row { display: grid; grid-template-columns: 1fr 70px 110px 46px; gap: .7rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line-soft); font-size: .92rem; }
.pct-row:last-child { border-bottom: 0; }
@media (max-width: 600px) { .pct-row { grid-template-columns: 1fr 60px 90px 40px; gap: .4rem; font-size: .85rem; } }

/* Tabs */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { background: transparent; border: 0; padding: .6rem .8rem; color: var(--muted); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; font-weight: 500; }
.tabs button.on { color: var(--gold); border-bottom-color: var(--gold); }

/* Lists */
.list { display: flex; flex-direction: column; }
.list > .item { padding: .65rem 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: .8rem; justify-content: space-between; align-items: flex-start; }
.list > .item:last-child { border-bottom: 0; }
.item .t { font-weight: 500; } .item .d { color: var(--muted); font-size: .86rem; }
.flag { border-left: 3px solid var(--warn); padding: .5rem .8rem; background: var(--panel-2); border-radius: 4px; margin-bottom: .5rem; }
.flag.high { border-left-color: var(--bad); } .flag.info { border-left-color: var(--faint); }
.athlete-card { display: flex; gap: .9rem; align-items: center; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--font-display); color: var(--gold); font-weight: 700; flex-shrink: 0; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }

/* Session items / plan */
.session-item { display: grid; grid-template-columns: 1fr auto; gap: .5rem; padding: .6rem 0; border-bottom: 1px solid var(--line-soft); }
.section-label { font-family: var(--font-display); font-size: .78rem; letter-spacing: .08em; color: var(--gold-dim); margin: .9rem 0 .3rem; }
.rx { color: var(--muted); font-size: .86rem; }
.cue { color: var(--faint); font-size: .82rem; font-style: italic; }
.chat { display: flex; flex-direction: column; gap: .6rem; max-height: 55vh; overflow-y: auto; padding-right: .3rem; }
.msg { padding: .6rem .8rem; border-radius: 10px; max-width: 85%; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--crimson); color: #fff; border-bottom-right-radius: 3px; }
.msg.assistant { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 3px; }
.photo { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
video { width: 100%; max-height: 420px; border-radius: 8px; background: #000; }
.frames { display: flex; gap: .4rem; overflow-x: auto; }
.frames img { height: 90px; border-radius: 4px; border: 1px solid var(--line); }
canvas { max-width: 100%; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 320px; }
.chart-box.short { height: 170px; }

/* Public pages */
.public { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(1200px 600px at 50% -10%, rgba(122,30,30,.25), transparent 60%), var(--bg); }
.public .box { width: 100%; max-width: 440px; }
.public .box.wide { max-width: 760px; }
.public .crest { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-bottom: 1.4rem; }
.public .crest img { width: 110px; height: 110px; }
.public .crest .word { font-family: var(--font-display); color: var(--gold); font-size: 1.5rem; letter-spacing: .14em; font-weight: 700; }
.public .crest .motto { color: var(--muted); font-size: .8rem; letter-spacing: .2em; }

/* Toasts and modal */
#toasts { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .4rem; z-index: 50; width: min(92vw, 420px); }
.toast { background: #2B2A27; border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: .6rem .9rem; border-radius: 6px; font-size: .9rem; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.toast.bad { border-left-color: var(--bad); } .toast.good { border-left-color: var(--good); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 40; padding: 1rem; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; width: min(96vw, 560px); max-height: 92vh; overflow-y: auto; }
.modal.wide { width: min(96vw, 860px); }
.modal h2 { margin-bottom: .8rem; }
.empty { padding: 1.4rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.laurel { font-family: var(--font-display); color: var(--gold); letter-spacing: .12em; font-size: .78rem; }
kbd.code { background: #111; border: 1px solid var(--line); padding: .1rem .35rem; border-radius: 4px; font-family: ui-monospace, monospace; font-size: .82rem; }
.copybox { display: flex; gap: .4rem; align-items: center; background: #171716; border: 1px solid var(--line); border-radius: 6px; padding: .4rem .6rem; font-family: ui-monospace, monospace; font-size: .82rem; word-break: break-all; }

/* ===== v1.1 ===== */
/* Tab groups on the athlete profile */
.tabgroups { display: flex; gap: 1.2rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 1rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabgroup { display: flex; flex-direction: column; }
.tabgroup .tg-label { font-family: var(--font-display); font-size: .66rem; letter-spacing: .12em; color: var(--faint); padding: .2rem .5rem 0; }
.tabgroups .tabs { border-bottom: 0; margin-bottom: 0; overflow: visible; }
.tabgroups .tabs button { padding: .4rem .6rem .55rem; }
/* Readiness */
.ready-banner { display: flex; gap: 1.2rem; align-items: center; border-radius: var(--radius); padding: .9rem 1.1rem; border: 1px solid var(--line-soft); background: var(--panel); border-left-width: 5px; }
.ready-banner .score { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.ready-banner.green { border-left-color: var(--good); } .ready-banner.green .score { color: var(--good); }
.ready-banner.amber { border-left-color: var(--warn); } .ready-banner.amber .score { color: var(--warn); }
.ready-banner.red { border-left-color: var(--bad); } .ready-banner.red .score { color: var(--bad); }
.pill.ready-green { background: rgba(107,174,116,.15); color: var(--good); }
.pill.ready-amber { background: rgba(217,164,65,.14); color: var(--warn); }
.pill.ready-red { background: var(--crimson-soft); color: #E07A74; }
.pill .x { background: none; border: 0; color: inherit; cursor: pointer; margin-left: .2rem; padding: 0; font-size: .9rem; line-height: 1; }
.badge-chip { display: inline-flex; align-items: center; gap: .25rem; background: var(--gold-soft); border: 1px solid rgba(212,175,55,.35); color: var(--gold); border-radius: 999px; padding: .15rem .6rem; font-size: .78rem; font-weight: 600; }
.chip { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: .15rem .6rem; font-size: .78rem; cursor: pointer; }
.chip.on { background: var(--gold-soft); color: var(--gold); border-color: rgba(212,175,55,.45); }
/* Timeline (unified log) */
.timeline { margin-top: .6rem; }
.tl-date { font-family: var(--font-display); font-size: .74rem; letter-spacing: .08em; color: var(--gold-dim); margin: .8rem 0 .25rem; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.tl-ico { color: var(--muted); text-align: center; } .k-test .tl-ico { color: var(--gold); } .k-lax .tl-ico { color: var(--good); } .k-whoop .tl-ico { color: #E07A74; } .k-badge .tl-ico, .k-tier .tl-ico { color: var(--gold); }
/* Path levers */
.lever input[type=range] { width: 100%; accent-color: var(--gold); }
.lever { padding: .4rem 0; }
/* Correlation matrix */
table.matrix th, table.matrix td { padding: .25rem .3rem; font-size: .76rem; text-align: center; }
table.matrix th:first-child { text-align: right; white-space: nowrap; }
table.matrix th.rot span { display: inline-block; max-width: 60px; white-space: normal; line-height: 1.1; }
td.mx { border-radius: 4px; color: var(--text); font-variant-numeric: tabular-nums; min-width: 40px; }
td.mx.diag { background: var(--panel-2); } td.mx.none { color: var(--faint); }
td.mx.low { opacity: .55; }
/* RTP and routines */
.rtp-step.done span b { color: var(--good); } .rtp-step.done { opacity: .8; }
.routine-step.done span { text-decoration: line-through; color: var(--muted); }
/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: .6rem; }
.cal-head { font-size: .72rem; color: var(--muted); text-align: center; padding: .2rem 0; }
.cal-cell { min-height: 78px; background: #1F1E1C; border: 1px solid var(--line-soft); border-radius: 4px; padding: .25rem .3rem; cursor: pointer; overflow: hidden; }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.today { border-color: var(--gold); }
.cal-cell:hover:not(.empty) { background: var(--panel-2); }
.cal-day { font-size: .78rem; color: var(--muted); }
.cal-ev { font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: .05rem .25rem; border-radius: 3px; margin-top: 2px; background: rgba(255,255,255,.05); }
.cal-ev.k-game { background: var(--crimson-soft); color: #E9A19C; } .cal-ev.k-tournament { background: var(--gold-soft); color: var(--gold); } .cal-ev.k-practice { background: rgba(110,155,197,.18); color: #A9C6E3; } .cal-ev.k-call { background: rgba(107,174,116,.18); color: #9BD1A2; } .cal-ev.k-rest { color: var(--muted); }
@media (max-width: 700px) { .cal-cell { min-height: 54px; } .cal-ev { display: none; } .cal-cell::after { content: ''; } .cal-day { font-size: .72rem; } }
.forecast { display: flex; gap: 4px; align-items: flex-end; }
.fc-day { flex: 1; text-align: center; min-width: 0; }
.fc-bar { height: 50px; background: #171716; border: 1px solid var(--line-soft); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; margin: .2rem 0; }
.fc-bar i { display: block; width: 100%; background: linear-gradient(180deg, var(--gold), var(--bronze)); }
.fc-day.heavy .fc-bar i { background: linear-gradient(180deg, var(--crimson-bright), var(--crimson)); }
/* Forum */
.forum { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; min-height: 60vh; }
.forum-side { border-right: 1px solid var(--line-soft); padding-right: .8rem; }
.chan { display: block; padding: .5rem .6rem; border-radius: var(--radius-sm); color: var(--text); margin-bottom: 2px; }
.chan:hover { background: var(--panel); text-decoration: none; } .chan.on { background: var(--gold-soft); }
.chan .badge, .bell .badge { background: var(--crimson-bright); color: #fff; border-radius: 999px; font-size: .68rem; padding: .05rem .4rem; font-weight: 600; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan-pane { display: flex; flex-direction: column; min-width: 0; }
.msgs { flex: 1; overflow-y: auto; max-height: 60vh; padding: .5rem .2rem; display: flex; flex-direction: column; gap: .5rem; }
.msg-row { display: grid; grid-template-columns: 32px 1fr; gap: .6rem; align-items: start; }
.msg-row.announce .msg-body { background: var(--gold-soft); border-left: 3px solid var(--gold); padding: .5rem .7rem; border-radius: 6px; }
.msg-row.hiddenmsg { opacity: .45; }
.msg-row.system { grid-template-columns: 1fr; } .sys { text-align: center; color: var(--gold-dim); font-size: .82rem; }
.msg-body .text { white-space: pre-wrap; word-break: break-word; margin: .15rem 0 .25rem; }
.reactions { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .2rem; }
.rx { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .5rem; font-size: .78rem; cursor: pointer; color: var(--text); }
.rx.mine { border-color: var(--gold); } .rx.add { color: var(--muted); }
.composer { border-top: 1px solid var(--line-soft); padding-top: .6rem; margin-top: .4rem; }
.composer textarea { min-height: 56px; }
.hide-desktop { display: none; }
@media (max-width: 900px) { .forum { grid-template-columns: 1fr; } .forum-side { display: none; } .hide-desktop { display: inline-flex; } .msgs { max-height: 50vh; } }
/* Boards */
ol.board { list-style: none; margin: 0; padding: 0; }
ol.board li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: .6rem; align-items: center; padding: .45rem .3rem; border-bottom: 1px solid var(--line-soft); }
ol.board li:last-child { border-bottom: 0; }
ol.board li.mine { background: var(--gold-soft); border-radius: 4px; }
ol.board .rank { font-family: var(--font-display); color: var(--gold); font-weight: 700; text-align: center; }
ol.board li:nth-child(1) .rank { font-size: 1.15rem; }
ol.board.compact li { padding: .25rem .3rem; font-size: .88rem; }
.challenge { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: .7rem .8rem; background: var(--panel-2); }
/* Notifications */
.bell { position: relative; text-decoration: none; font-size: 1rem; display: inline-flex; align-items: center; gap: .2rem; }
.bell .badge { position: absolute; top: -6px; right: -10px; }
.item.unread .t { font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--crimson-bright); margin-right: .4rem; }
/* Compare */
.compare video { max-height: 320px; }
.hide-sm { }
@media (max-width: 600px) { .hide-sm { display: none !important; } }
