/* ==========================================================================
   Epicrack — design tokens
   Monochrome: ink on paper, one signal colour reserved for failures.
   ========================================================================== */
:root {
  color-scheme: light;
  --bg: #efeeea;
  --surface: #f7f6f3;
  --surface-2: #e8e7e2;
  --surface-3: #dcdbd5;
  --border: rgba(13, 13, 12, .12);
  --border-strong: rgba(13, 13, 12, .28);
  --text: #0d0d0c;
  --text-2: #4b4a46;
  --muted: #8a8983;
  --invert: #f7f6f3;
  --signal: #e2401c;
  --accent: var(--text);
  --accent-2: var(--text-2);
  --accent-soft: rgba(13, 13, 12, .07);
  --good: var(--text);
  --warn: var(--text-2);
  --serious: var(--text-2);
  --crit: var(--signal);
  --good-soft: rgba(13, 13, 12, .07);
  --warn-soft: rgba(13, 13, 12, .05);
  --serious-soft: rgba(13, 13, 12, .05);
  --crit-soft: rgba(226, 64, 28, .10);
  --grain-opacity: .07;
  --radius: 4px;
  --radius-sm: 3px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar: 232px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-2: #181818;
    --surface-3: #242424;
    --border: rgba(255, 255, 255, .09);
    --border-strong: rgba(255, 255, 255, .24);
    --text: #f2f1ed;
    --text-2: #a3a29d;
    --muted: #64635f;
    --invert: #0a0a0a;
    --signal: #ff5a36;
    --accent-soft: rgba(255, 255, 255, .07);
    --good-soft: rgba(255, 255, 255, .08);
    --warn-soft: rgba(255, 255, 255, .05);
    --serious-soft: rgba(255, 255, 255, .05);
    --crit-soft: rgba(255, 90, 54, .12);
    --grain-opacity: .05;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #181818;
  --surface-3: #242424;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .24);
  --text: #f2f1ed;
  --text-2: #a3a29d;
  --muted: #64635f;
  --invert: #0a0a0a;
  --signal: #ff5a36;
  --accent-soft: rgba(255, 255, 255, .07);
  --good-soft: rgba(255, 255, 255, .08);
  --warn-soft: rgba(255, 255, 255, .05);
  --serious-soft: rgba(255, 255, 255, .05);
  --crit-soft: rgba(255, 90, 54, .12);
  --grain-opacity: .05;
}

/* Extra themes picked during onboarding or in settings. */
:root[data-theme="kraft"] {
  color-scheme: light;
  --bg: #e8e0d0; --surface: #f1ebdf; --surface-2: #e0d7c4; --surface-3: #d2c7b1;
  --border: rgba(40, 28, 10, .14); --border-strong: rgba(40, 28, 10, .3);
  --text: #24190c; --text-2: #5a4a35; --muted: #8f7f68; --invert: #f1ebdf; --signal: #c2410c;
  --accent-soft: rgba(40, 28, 10, .07); --good-soft: rgba(40, 28, 10, .07); --warn-soft: rgba(40, 28, 10, .05);
  --serious-soft: rgba(40, 28, 10, .05); --crit-soft: rgba(194, 65, 12, .1); --grain-opacity: .09;
}
:root[data-theme="slate"] {
  color-scheme: dark;
  --bg: #0d1117; --surface: #131922; --surface-2: #1a212c; --surface-3: #26303d;
  --border: rgba(200, 220, 255, .09); --border-strong: rgba(200, 220, 255, .22);
  --text: #e6ebf2; --text-2: #9aa6b6; --muted: #5f6b7b; --invert: #0d1117; --signal: #f97362;
  --accent-soft: rgba(200, 220, 255, .07); --good-soft: rgba(200, 220, 255, .08); --warn-soft: rgba(200, 220, 255, .05);
  --serious-soft: rgba(200, 220, 255, .05); --crit-soft: rgba(249, 115, 98, .13); --grain-opacity: .04;
}
:root[data-theme="terminal"] {
  color-scheme: dark;
  --bg: #050805; --surface: #0a100a; --surface-2: #101a10; --surface-3: #1a2a1a;
  --border: rgba(120, 255, 140, .1); --border-strong: rgba(120, 255, 140, .26);
  --text: #c8f5cf; --text-2: #7fb488; --muted: #4c6e52; --invert: #050805; --signal: #ffb000;
  --accent-soft: rgba(120, 255, 140, .07); --good-soft: rgba(120, 255, 140, .08); --warn-soft: rgba(120, 255, 140, .05);
  --serious-soft: rgba(120, 255, 140, .05); --crit-soft: rgba(255, 176, 0, .12); --grain-opacity: .06;
  --font: 'JetBrains Mono', ui-monospace, monospace; --serif: 'JetBrains Mono', ui-monospace, monospace;
}
:root[data-theme="contrast"] {
  color-scheme: dark;
  --bg: #000; --surface: #000; --surface-2: #141414; --surface-3: #3a3a3a;
  --border: rgba(255, 255, 255, .38); --border-strong: #fff;
  --text: #fff; --text-2: #e6e6e6; --muted: #b5b5b5; --invert: #000; --signal: #ffd400;
  --accent-soft: rgba(255, 255, 255, .12); --good-soft: rgba(255, 255, 255, .14); --warn-soft: rgba(255, 255, 255, .1);
  --serious-soft: rgba(255, 255, 255, .1); --crit-soft: rgba(255, 212, 0, .18); --grain-opacity: 0;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 14px/1.5 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* Film grain over everything */
body::after {
  content: ''; position: fixed; inset: -50%; z-index: 999; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; line-height: 1.15; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.icon { flex: none; display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px solid var(--text); outline-offset: 3px; }
::selection { background: var(--text); color: var(--invert); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border: 3px solid var(--bg); border-radius: 99px; }

/* Display type: the editorial serif */
/* Kept for headlines only; numbers and list titles use the sans in a heavy weight. */
.serif, .hero h1, .dhead h1, .section-title h2, .connect__art h1,
.connect__box h2, .brand__name { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.kpi__value, .stat__value, .ring__label { font-family: var(--font); font-weight: 600; letter-spacing: -.04em; }
.empty h3 { font: 600 20px/1.2 var(--font); letter-spacing: -.02em; }
.grad, em.grad { font-style: italic; color: inherit; background: none; }
.label, .kpi__label, .stat__label, .hero__eyebrow, .row--head, .trow-head, .diff h5, .field > span {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}

/* ==========================================================================
   Shell
   ========================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.app.is-bare { grid-template-columns: 1fr; }
.app.is-bare .sidebar, .app.is-bare .topbar { display: none; }
.app.is-bare #view { padding: 0; max-width: none; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 36px;
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.brand__mark { width: 24px; height: 24px; flex: none; color: var(--text); }
.brand__mark svg { display: block; width: 100%; height: 100%; }
.brand__name { font-size: 26px; line-height: 1; font-style: italic; }

.nav { display: flex; flex-direction: column; gap: 0; counter-reset: nav; }
.nav a {
  counter-increment: nav;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 6px; border-bottom: 1px solid var(--border);
  color: var(--text-2); font-weight: 500;
  transition: color .2s var(--ease), padding .25s var(--ease);
}
.nav a:first-child { border-top: 1px solid var(--border); }
.nav a::before { content: counter(nav, decimal-leading-zero); font: 500 10px var(--mono); color: var(--muted); width: 16px; }
.nav a .icon { display: none; }
.nav a:hover { color: var(--text); padding-left: 10px; }
.nav a.is-active { color: var(--text); }
.nav a.is-active::after { content: ''; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--text); }
.nav a.is-active .nav__tag + * { display: none; }
.nav__tag { margin-left: auto; font: 500 11px var(--mono); padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 99px; color: var(--text-2); }
.nav a.is-active .nav__tag { margin-left: auto; margin-right: -4px; }
.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.sidebar__foot::before { content: 'non officiel — fait par des étudiants, pour des étudiants.'; font: italic 15px/1.3 var(--serif); color: var(--muted); }
.user { display: flex; align-items: center; gap: 10px; padding: 10px 0 0; border-top: 1px solid var(--border); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font: 500 11px var(--mono); color: var(--invert); background: var(--text);
}
.user__meta { min-width: 0; flex: 1; }
.user__name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user__mail { color: var(--muted); font: 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 40px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__title { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar__title .icon { display: none; }
.topbar__title b { color: var(--text); font-weight: 500; }
.topbar__title a:hover { color: var(--text); }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
#view { padding: 36px 40px 80px; max-width: 1320px; width: 100%; margin: 0 auto; outline: none; counter-reset: sec; }
#view > * { animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ==========================================================================
   Controls
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 18px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: transparent;
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease);
}
.btn:hover { background: var(--text); color: var(--invert); border-color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { border-color: var(--text); background: var(--text); color: var(--invert); }
.btn--primary:hover { background: transparent; color: var(--text); }
.btn--ghost { border-color: transparent; color: var(--text-2); }
.btn--danger:hover { color: var(--signal); border-color: var(--signal); background: transparent; }
.btn--sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn--lg { height: 48px; padding: 0 26px; font-size: 15px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border); background: transparent;
  cursor: pointer; color: var(--text-2); transition: color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--text); }

.input, select, textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: transparent; outline: none;
  transition: border-color .2s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }
.input:focus, select:focus, textarea:focus { border-color: var(--text); }
.input::placeholder, textarea::placeholder { color: var(--muted); }
select { cursor: pointer; padding-right: 30px; appearance: none; background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.year select { height: 36px; width: auto; border-radius: 99px; font: 500 12px var(--mono); padding: 0 32px 0 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field small { color: var(--muted); font-size: 12px; }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; border-radius: 99px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 34px; height: 18px; border-radius: 99px; border: 1px solid var(--border-strong); position: relative; cursor: pointer; margin: 0; flex: none; transition: background .2s; }
.switch input::after { content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); top: 2px; left: 2px; transition: transform .2s var(--ease), background .2s; }
.switch input:checked { background: var(--text); border-color: var(--text); }
.switch input:checked::after { transform: translateX(16px); background: var(--invert); }

.segmented { display: inline-flex; padding: 2px; border-radius: 99px; border: 1px solid var(--border-strong); }
.segmented button { border: 0; background: transparent; padding: 5px 14px; border-radius: 99px; font: 500 12px var(--font); color: var(--text-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.segmented button.is-on { background: var(--text); color: var(--invert); }

/* ==========================================================================
   Surfaces
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card--pad { padding: 22px; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card__head h2 { font: 600 16px/1.2 var(--font); letter-spacing: -.01em; }
.card__head h3 { font-size: 15px; }
.card__head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 48px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.section-title h2 { font-size: 34px; line-height: 1; display: flex; align-items: flex-start; gap: 10px; }
.section-title h2::before { counter-increment: sec; content: '(' counter(sec, decimal-leading-zero) ')'; font: 500 11px var(--mono); color: var(--muted); letter-spacing: .05em; margin-top: 4px; }
.section-title a { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; display: inline-flex; gap: 6px; align-items: center; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.section-title > .muted, .section-title > span { font: 11px var(--mono); color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.grid--kpi > .card { border: 0; border-left: 1px solid var(--border); border-radius: 0; background: transparent; }
.grid--kpi > .card:first-child { border-left: 0; }
.grid--2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding: 44px 40px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(105deg, transparent 35%, #000 100%);
  mask-image: linear-gradient(105deg, transparent 35%, #000 100%);
  opacity: .6;
}
.hero > * { position: relative; }
.hero__eyebrow { margin-bottom: 18px; display: flex; gap: 10px; align-items: center; }
.hero__eyebrow::before { content: ''; width: 24px; height: 1px; background: currentColor; }
.hero h1 { font-size: clamp(38px, 4.6vw, 64px); line-height: .98; max-width: 820px; }
.hero p { color: var(--text-2); margin-top: 18px; max-width: 560px; font-size: 15px; }
.hero p b { color: var(--text); font-weight: 600; }
.hero__side { display: flex; align-items: center; gap: 18px; }

/* KPI tile */
.kpi { padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.kpi__label { display: flex; align-items: center; gap: 6px; }
.kpi__label .icon { display: none; }
.kpi__value { font-size: 44px; line-height: 1; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi__value small { font: 500 14px var(--font); letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.kpi__sub { color: var(--text-2); font-size: 12.5px; margin-top: 6px; }

/* Ring */
.ring { position: relative; width: var(--size); height: var(--size); flex: none; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring__track { fill: none; stroke: var(--surface-3); }
.ring__value { fill: none; stroke: var(--text); stroke-linecap: butt; transition: stroke-dashoffset 1s var(--ease); animation: ring 1.2s var(--ease) both; }
@keyframes ring { from { stroke-dashoffset: var(--c); } }
.ring--warn .ring__value, .ring--serious .ring__value { stroke: var(--text-2); }
.ring--crit .ring__value { stroke: var(--signal); }
.ring__label { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--size) * .27); line-height: 1; font-variant-numeric: tabular-nums; }

/* Pills & chips */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 99px; font: 500 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--border-strong); color: var(--text-2); }
.pill--good { background: var(--text); color: var(--invert); border-color: var(--text); }
.pill--crit { color: var(--signal); border-color: currentColor; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 99px; font: 500 10.5px var(--mono); letter-spacing: .04em; color: var(--text-2); border: 1px solid var(--border); }
.cs-row { display: inline-flex; gap: 10px; font: 11px var(--mono); }
.cs { display: inline-flex; align-items: baseline; gap: 3px; color: var(--text-2); }
.cs b { font-weight: 600; color: var(--text); }
.cs--major:not(.cs--zero), .cs--major:not(.cs--zero) b { color: var(--signal); }
.cs--zero, .cs--zero b { color: var(--muted); font-weight: 400; }

/* Test bar: passed = ink, crashed = grey, failed = hatched */
.tbar { display: flex; gap: 2px; height: 6px; background: transparent; animation: reveal 1s var(--ease) both; }
.tbar--empty { background: var(--surface-3); }
.skill .tbar { animation: none; }
.tbar__seg { min-width: 3px; }
.tbar__seg--good { background: var(--text); }
.tbar__seg--serious { background: var(--muted); }
.tbar__seg--crit { background: repeating-linear-gradient(-45deg, var(--text-2) 0 1px, transparent 1px 4px); box-shadow: inset 0 0 0 1px var(--border-strong); }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Result card */
.rcard { padding: 20px; display: flex; flex-direction: column; gap: 16px; cursor: pointer; transition: border-color .25s, background .25s; }
.rcard:hover { border-color: var(--text); }
.rcard__top { display: flex; gap: 16px; align-items: center; }
.rcard__title { min-width: 0; flex: 1; }
.rcard__title h3 { font: 600 17px/1.2 var(--font); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard__title p { color: var(--muted); font: 11px var(--mono); margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font: 11px var(--mono); }

/* Table / list rows */
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: minmax(0, 2.2fr) 110px minmax(0, 1.4fr) 170px 120px 20px; align-items: center; gap: 18px; padding: 14px 22px; border-top: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row--head { cursor: default; padding-top: 12px; padding-bottom: 12px; }
.row--head:hover { background: none; }
.row__name { display: flex; align-items: center; gap: 14px; min-width: 0; }
.row__name b { font: 600 15px/1.25 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.row__name small { display: block; color: var(--muted); font: 11px var(--mono); margin-top: 3px; }
.row small.muted { font: 11px var(--mono); }
.row .chev { color: var(--muted); }
.num { font: 600 17px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* Chart */
.chart { position: relative; }
.chart svg { width: 100%; height: 220px; display: block; overflow: visible; cursor: crosshair; }
.chart__grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.chart__axis { position: absolute; color: var(--muted); font: 10px var(--mono); line-height: 1; pointer-events: none; font-variant-numeric: tabular-nums; }
.chart__axis--y { left: 0; width: 28px; text-align: right; transform: translateY(-50%); }
.chart__axis--x { bottom: 4px; transform: translateX(var(--tx)); white-space: nowrap; }
.chart__line { fill: none; stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart__dot { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: r .15s; }
.chart__dot.is-on { r: 6; fill: var(--text); }
.chart__cross { stroke: var(--text); stroke-width: 1; opacity: 0; vector-effect: non-scaling-stroke; }
.chart__cross.is-on { opacity: .4; }
.chart__tip {
  position: absolute; transform: translate(-50%, calc(-100% - 14px)); pointer-events: none;
  background: var(--text); color: var(--invert); border-radius: var(--radius-sm);
  padding: 8px 11px; font-size: 12px; white-space: nowrap;
  display: flex; flex-direction: column; gap: 2px;
}
.chart__tip b { font: 600 13px/1.2 var(--font); }
.chart__tip span { font: 10.5px var(--mono); opacity: .7; }
.empty-chart { height: 220px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; font-size: 14px; }
.spark { overflow: visible; }
.spark path { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--text); }

/* Skills / tests */
.skill { border-top: 1px solid var(--border); }
.skill:first-child { border-top: 0; }
.skill > summary { list-style: none; display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(120px, 240px) 80px; gap: 16px; align-items: center; padding: 16px 22px; cursor: pointer; }
.skill > summary::-webkit-details-marker { display: none; }
.skill > summary:hover { background: var(--surface-2); }
.skill > summary .chev { color: var(--muted); transition: transform .2s var(--ease); }
.skill[open] > summary .chev { transform: rotate(90deg); }
.skill__name { font: 600 15px/1.25 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill__score { text-align: right; font: 600 16px/1 var(--font); font-variant-numeric: tabular-nums; }
.skill__score small { color: var(--muted); font-size: 13px; font-weight: 500; }
.tests { padding: 0 22px 18px 58px; display: flex; flex-direction: column; }
.test { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px dashed var(--border); }
.test:first-child { border-top: 0; }
.test__icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; border: 1px solid var(--border-strong); }
.test--pass .test__icon { color: var(--invert); background: var(--text); border-color: var(--text); }
.test--fail .test__icon { color: var(--signal); border-color: var(--signal); }
.test--crash .test__icon { color: var(--text); border-style: dashed; }
.test--skip .test__icon { color: var(--muted); }
.test__body { min-width: 0; flex: 1; }
.test__name { font-weight: 500; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.test--pass .test__name { color: var(--text-2); font-weight: 400; }
.test__comment { color: var(--text-2); font: 11.5px var(--mono); margin-top: 3px; }
.test--fail .test__comment { color: var(--signal); }
.test__more { margin-top: 8px; }
.test__more summary { cursor: pointer; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text); }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.diff h5 { margin: 0 0 6px; }
pre.out { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); font: 12px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.badge-m { font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 1px 6px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--text-2); }
.breakdown-note { color: var(--muted); font-size: 13px; padding: 0 22px 18px 58px; }

/* Details header */
.dhead { display: flex; gap: 28px; align-items: center; padding: 30px; }
.dhead__main { flex: 1; min-width: 0; }
.dhead h1 { font-size: clamp(40px, 5vw, 68px); line-height: .95; }
.dhead__meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 14px; color: var(--text-2); font: 11.5px var(--mono); }
.dhead__meta span { display: inline-flex; gap: 6px; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.stat { padding: 18px 30px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat__value { font-size: 28px; line-height: 1; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat__value .muted { font-weight: 500; letter-spacing: 0; }
.meter { height: 2px; background: var(--surface-3); margin-top: 12px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--text) !important; transform-origin: left; animation: grow 1s var(--ease) both; }
.back { display: inline-flex; gap: 8px; align-items: center; color: var(--text-2); font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 20px; }
.back:hover { color: var(--text); }

/* Coding style issues */
.issues-file { border-top: 1px solid var(--border); }
.issues-file:first-child { border-top: 0; }
.issues-file > summary { list-style: none; padding: 13px 22px; display: flex; align-items: center; gap: 10px; cursor: pointer; font: 12.5px var(--mono); }
.issues-file > summary::-webkit-details-marker { display: none; }
.issues-file > summary:hover { background: var(--surface-2); }
.issues-file > summary .chev { color: var(--muted); transition: transform .2s; }
.issues-file[open] > summary .chev { transform: rotate(90deg); }
.issue { display: grid; grid-template-columns: 56px 64px 70px minmax(0, 1fr); gap: 10px; padding: 7px 22px 7px 46px; font-size: 13px; align-items: center; border-top: 1px dashed var(--border); }
.issue:hover { background: var(--surface-2); }
.issue .ln { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.sev { font: 500 9.5px var(--mono); letter-spacing: .08em; padding: 2px 6px; border-radius: 99px; text-align: center; border: 1px solid var(--border-strong); color: var(--text-2); }
.sev--MAJOR { color: var(--signal); border-color: var(--signal); }
.sev--INFO { color: var(--muted); }

/* Mooly */
.caps { display: flex; gap: 6px; flex-wrap: wrap; }
.cap { display: inline-flex; gap: 7px; align-items: center; padding: 4px 11px; border-radius: 99px; font: 500 11px var(--mono); border: 1px solid var(--border); color: var(--muted); }
.cap i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid currentColor; }
.cap.is-on { color: var(--text); border-color: var(--border-strong); }
.cap.is-on i { background: currentColor; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.opt-row { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; padding: 18px 0 0; }
.tests-editor { display: flex; flex-direction: column; gap: 8px; }
.trow { display: grid; grid-template-columns: 1fr 1.2fr 1.3fr 1.3fr 80px 34px 34px; gap: 8px; align-items: start; padding: 10px 0; border-top: 1px dashed var(--border); }
.trow .input, .trow textarea { height: 36px; font-size: 13px; }
.trow__flag { height: 36px; display: grid; place-items: center; }
.trow__flag input { width: 16px; height: 16px; accent-color: var(--text); }
.trow-head { display: grid; grid-template-columns: 1fr 1.2fr 1.3fr 1.3fr 80px 34px 34px; gap: 8px; }

.stepper { display: flex; gap: 0; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; width: fit-content; }
.stepper span { padding: 6px 14px; font: 500 11px var(--mono); color: var(--muted); display: inline-flex; gap: 6px; align-items: center; border-left: 1px solid var(--border); }
.stepper span:first-child { border-left: 0; }
.stepper span.is-done { color: var(--text-2); }
.stepper span.is-now { color: var(--invert); background: var(--text); }
.stepper span.is-now::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.console {
  height: 340px; overflow: auto; margin: 0; padding: 16px 18px; border-radius: var(--radius);
  background: #070707; color: #d8d7d2; border: 1px solid rgba(255, 255, 255, .08);
  font: 12px/1.75 var(--mono);
}
.console .l-warn { color: #ffffff; font-weight: 600; }
.console .l-error { color: #ff5a36; }
.console .l-t { color: #555; margin-right: 12px; }

.run-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto 34px; gap: 16px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--border); cursor: pointer; }
.run-item:first-child { border-top: 0; }
.run-item:hover { background: var(--surface-2); }
.run-item h4 { font: 600 15px/1.25 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-item p { color: var(--muted); font: 11px var(--mono); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-item .muted { font: 11px var(--mono); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--surface-3); border-top-color: var(--text); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Connect page */
.connect { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.connect__art {
  position: relative; overflow: hidden; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  background: #0a0a0a; color: #f2f1ed; border-right: 1px solid rgba(255, 255, 255, .08);
  --text: #f2f1ed; --muted: #64635f; --border: rgba(255, 255, 255, .09);
}
.connect__art::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 75% 45%, #000, transparent 65%); mask-image: radial-gradient(circle at 75% 45%, #000, transparent 65%);
}
.orbit-art { position: absolute; right: -160px; top: 46%; transform: translateY(-50%); width: 640px; height: 640px; }
.orbit-art circle { fill: none; stroke: rgba(255, 255, 255, .14); }
.orbit-art .crack { fill: none; stroke: #f2f1ed; stroke-width: 1.2; stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.4s .3s var(--ease) forwards; }
.orbit-art .planet { animation: orbit 26s linear infinite; transform-origin: 320px 320px; }
.orbit-art .planet circle { fill: #f2f1ed; stroke: none; }
.orbit-art .planet--2 { animation-duration: 40s; animation-direction: reverse; }
.orbit-art .planet--2 circle { fill: #ff5a36; }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.connect__art > :not(.orbit-art) { position: relative; z-index: 1; }
.connect__top { display: flex; justify-content: space-between; align-items: center; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #8a8983; }
.connect__art h1 { font-size: clamp(48px, 6vw, 96px); line-height: .9; letter-spacing: -.03em; max-width: 680px; }
.connect__art p { color: #a3a29d; max-width: 440px; margin-top: 22px; font-size: 15px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255, 255, 255, .12); max-width: 680px; background: #0a0a0a; }
.feature { padding: 16px 16px 0 0; }
.feature + .feature { padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .12); }
.feature b { display: block; font: 600 15px/1.2 var(--font); margin: 8px 0 4px; }
.feature span { font-size: 12.5px; color: #8a8983; }
.feature .icon { display: none; }
.feature::before { font: 500 10px var(--mono); color: #64635f; letter-spacing: .1em; }
.feature:nth-child(1)::before { content: '(01)'; }
.feature:nth-child(2)::before { content: '(02)'; }
.feature:nth-child(3)::before { content: '(03)'; }
.marquee { position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden; border-top: 1px solid rgba(255, 255, 255, .1); padding: 10px 0; white-space: nowrap; z-index: 1; }
.marquee__inner { display: inline-flex; gap: 32px; animation: marquee 30s linear infinite; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #64635f; }
.marquee__inner span::after { content: '✳'; margin-left: 32px; color: #a3a29d; }
@keyframes marquee { to { transform: translateX(-50%); } }
.connect__art { padding-bottom: 72px; }
.connect__panel { display: grid; place-items: center; padding: 48px 32px; }
.connect__box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.connect__box h2 { font-size: 48px; line-height: 1; }
.connect__box > p { color: var(--text-2); }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 0; padding: 0; margin: 0; list-style: none; border-top: 1px solid var(--border); }
.steps li { counter-increment: s; display: flex; gap: 14px; color: var(--text-2); font-size: 13.5px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.steps li::before { content: counter(s, decimal-leading-zero); flex: none; font: 500 10.5px var(--mono); color: var(--muted); }
.steps a { color: var(--text) !important; border-bottom: 1px solid currentColor; }
.bookmarklet { display: inline-flex; gap: 6px; align-items: center; padding: 3px 12px; border-radius: 99px; border: 1px dashed var(--text) !important; font: 500 12px var(--mono); cursor: grab; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.note { font-size: 12px; color: var(--muted); }
.callout { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border-strong); color: var(--text-2); font-size: 13.5px; display: flex; gap: 12px; }
.callout a { color: var(--text) !important; border-bottom: 1px solid currentColor; }
.callout .icon { color: var(--text); margin-top: 2px; }
.callout--warn { border-color: var(--signal); }
.callout--warn .icon { color: var(--signal); }

/* Empty / skeleton / toasts */
.empty { text-align: center; padding: 60px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty__glyph { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); color: var(--text) !important; background: transparent !important; margin-bottom: 8px; }
.empty h3 { font-size: 30px; }
.empty p { color: var(--text-2); max-width: 420px; }
.empty .btn { margin-top: 12px; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border: 1px solid var(--border); }
.sk-card { height: 150px; }
.sk-line { height: 54px; }
.sk-hero { height: 200px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 99px; background: var(--text); color: var(--invert); font-weight: 500; font-size: 13px; animation: rise .3s var(--ease); transition: opacity .4s, transform .4s; }
.toast--error .icon { color: var(--signal); }
.toast.is-out { opacity: 0; transform: translateY(8px); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .search { flex: 1; min-width: 220px; }
.toolbar select { width: auto; border-radius: 99px; }
.muted { color: var(--muted); }
.flex { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 32px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--kpi > .card:nth-child(3) { border-left: 0; }
  .grid--kpi > .card:nth-child(n+3) { border-top: 1px solid var(--border); }
  .grid--2 { grid-template-columns: 1fr; }
  .row { grid-template-columns: minmax(0, 2fr) 90px minmax(0, 1fr) 20px; }
  .row > :nth-child(4), .row > :nth-child(5) { display: none; }
  .trow, .trow-head { grid-template-columns: 1fr 1fr 34px 34px; }
  .trow-head { display: none; }
  .trow > :nth-child(3), .trow > :nth-child(4), .trow > :nth-child(5) { grid-column: span 2; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: auto 0 0 0; top: auto; height: auto; z-index: 20; flex-direction: row;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px);
  }
  .brand, .sidebar__foot { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav a, .nav a:first-child { border: 0; flex-direction: column; gap: 2px; font-size: 11px; padding: 8px 6px; }
  .nav a::before { width: auto; }
  .nav a:hover { padding-left: 6px; }
  .nav a.is-active::after { margin: 0; }
  .nav__tag { display: none; }
  .topbar { padding: 12px 16px; }
  #view { padding: 22px 16px 100px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 28px 22px; }
  .dhead { flex-direction: column; align-items: flex-start; padding: 22px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 16px 22px; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .section-title h2 { font-size: 28px; }
  .connect { grid-template-columns: 1fr; }
  .connect__art { padding: 28px 20px 64px; min-height: 0; border-right: 0; }
  .connect__panel { padding: 32px 20px 48px; }
  .orbit-art { width: 440px; height: 440px; right: -200px; }
  .features { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .diff { grid-template-columns: 1fr; }
  .skill > summary { grid-template-columns: 16px minmax(0, 1fr) 60px; padding: 14px 16px; }
  .skill > summary .tbar { display: none; }
  .tests { padding: 0 16px 14px; }
  .breakdown-note { padding: 0 16px 14px; }
  .issue { grid-template-columns: 44px 64px minmax(0, 1fr); padding-left: 22px; }
  .issue > :nth-child(3) { display: none; }
  .run-item { grid-template-columns: 44px minmax(0, 1fr) 34px; }
  .run-item > :nth-child(3), .run-item > :nth-child(4) { display: none; }
}
@media (max-width: 520px) {
  .kpi { padding: 16px; }
  .kpi__value { font-size: 34px; }
  .row { grid-template-columns: minmax(0, 1fr) 64px 20px; padding: 12px 14px; }
  .row > :nth-child(3) { display: none; }
  .row__name b { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .orbit-art .crack { stroke-dashoffset: 0; }
}
@media (forced-colors: active) {
  .tbar__seg--good { background: CanvasText; }
}

/* ==========================================================================
   Intranet views
   ========================================================================== */
.is-signal { color: var(--signal) !important; }
.link { border: 0; background: none; padding: 0; color: var(--text); border-bottom: 1px solid currentColor; cursor: pointer; font: inherit; }
.list-plain { display: flex; flex-direction: column; }
.list-plain > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid var(--border); }
.list-plain > div:first-child { border-top: 0; padding-top: 0; }
.list-plain b { font: 600 15px/1.25 var(--font); }
.list-plain span { color: var(--text-2); font-size: 13px; }

/* Modal */
.modal { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.modal::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.modal[open] { animation: rise .25s var(--ease); }
.modal__box { position: relative; padding: 28px; }
.modal__x { position: absolute; top: 14px; right: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--border); margin-top: 20px; }
.facts > div { display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 0 0; }
.facts > div + div { padding-left: 14px; border-left: 1px solid var(--border); }
.facts b { font: 600 16px/1.2 var(--font); }
.facts > div > span:not(.label) { color: var(--text-2); font: 11.5px var(--mono); }
.token-form { display: flex; flex-direction: column; gap: 14px; }
.token-input { width: 100%; border: 0; border-bottom: 1px solid var(--border-strong); background: transparent; outline: none; text-align: center; padding: 14px 0; margin: 10px 0; font: 500 44px/1 var(--mono); letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.token-input:focus { border-color: var(--text); }
.token-input::placeholder { color: var(--surface-3); }

/* Planning */
.plan-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.plan-title { font-size: clamp(34px, 4vw, 52px); line-height: 1; margin-top: 8px; }
.week { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr)); overflow-x: auto; }
.week__corner { border-bottom: 1px solid var(--border); }
.week__day { padding: 12px 10px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); display: flex; align-items: baseline; gap: 8px; }
.week__day b { font: 600 20px/1 var(--font); letter-spacing: -.03em; }
.week__day.is-today b { color: var(--signal); }
.week__day.is-today { box-shadow: inset 0 -2px 0 var(--text); }
.week__hours { display: flex; flex-direction: column; }
.week__hours span { height: var(--hour); font: 10px var(--mono); color: var(--muted); padding: 4px 8px 0 0; text-align: right; border-top: 1px solid var(--border); }
.week__hours span:first-child { border-top: 0; }
.week__col { position: relative; border-left: 1px solid var(--border); background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) - 1px), var(--border) calc(var(--hour) - 1px) var(--hour)); min-height: calc(var(--hour) * 13); }
.week__col.is-today { background-color: var(--accent-soft); }
.week__now { position: absolute; left: 0; right: 0; height: 1px; background: var(--signal); z-index: 3; }
.week__now::before { content: ''; position: absolute; left: -4px; top: -3.5px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.ev { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 1px; align-items: flex-start; text-align: left; overflow: hidden; padding: 5px 7px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: transform .15s var(--ease), border-color .15s; }
.ev:hover { border-color: var(--text); z-index: 4; }
.ev--in { background: var(--text); color: var(--invert); border-color: var(--text); }
.ev--out { border-style: dashed; color: var(--text-2); }
.ev--exam { background-image: repeating-linear-gradient(-45deg, transparent 0 5px, color-mix(in srgb, currentColor 18%, transparent) 5px 6px); }
.ev--exam.ev--in { box-shadow: inset 3px 0 0 var(--signal); }
.ev--past { opacity: .5; }
.ev--token { box-shadow: 0 0 0 1px var(--signal); opacity: 1; }
.ev__time { font: 9.5px var(--mono); opacity: .75; white-space: nowrap; }
.ev__title { font: 600 12.5px/1.2 var(--font); }
.ev__meta { font-size: 11px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ev__flag { margin-top: auto; display: inline-flex; gap: 4px; align-items: center; font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--signal); }
.agenda-day { display: grid; grid-template-columns: 90px minmax(0, 1fr); border-top: 1px solid var(--border); }
.agenda-day:first-child { border-top: 0; }
.agenda-day__date { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.agenda-day__date b { font: 600 26px/1 var(--font); letter-spacing: -.03em; }
.agenda-day.is-today .agenda-day__date b { color: var(--signal); }
.agenda-day__list { display: flex; flex-direction: column; }
.agenda-ev { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px 14px 0; border: 0; border-top: 1px dashed var(--border); background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.agenda-ev:first-child { border-top: 0; }
.agenda-ev .mono { font-size: 11px; color: var(--text-2); }
.agenda-ev.is-past { opacity: .55; }
.agenda-ev__main { min-width: 0; display: flex; flex-direction: column; }
.agenda-ev__main b { font: 600 15.5px/1.25 var(--font); }
.agenda-ev__main small { color: var(--muted); font-size: 12px; }
.agenda-ev__tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Scolarité */
.profile { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; padding: 28px; flex-wrap: wrap; }
.profile__id { display: flex; gap: 20px; align-items: center; min-width: 0; }
.profile__pic { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; filter: grayscale(1) contrast(1.05); border: 1px solid var(--border-strong); flex: none; }
.profile__pic--empty { display: grid; place-items: center; background: var(--text); color: var(--invert); font: 500 20px var(--mono); }
.profile h1 { font-size: clamp(38px, 4.4vw, 60px); line-height: .95; margin: 8px 0 6px; }
.profile p.mono { font-size: 11.5px; }
.profile__stats { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.profile__stats > div { display: flex; flex-direction: column; gap: 6px; padding: 14px 22px; border-left: 1px solid var(--border); }
.profile__stats > div:first-child { border-left: 0; }
.profile__stats b { font: 600 34px/1 var(--font); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.profile__stats small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ov { display: flex; flex-direction: column; gap: 12px; min-width: 0; transition: border-color .2s; }
a.ov:hover { border-color: var(--text); }
.ov--wide { grid-column: span 2; }
.ov__head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.ov__head .label { display: inline-flex; gap: 6px; align-items: center; }
.ov__big { font: 600 52px/.95 var(--font); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.ov__big small { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.ov-list { display: flex; flex-direction: column; }
.ov-ev { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border: 0; border-top: 1px dashed var(--border); background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.ov-ev:first-child { border-top: 0; }
.ov-ev .mono { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.ov-ev b { font: 600 14.5px/1.25 var(--font); display: block; }
.ov-ev small { color: var(--muted); font-size: 12px; }
.ov-proj { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-top: 1px dashed var(--border); }
.ov-proj b { font: 600 14px/1.25 var(--font); }
.ov-proj .mono { font-size: 11px; }
.ov-proj .meter { grid-column: 1 / -1; margin-top: 6px; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 96px; align-items: end; margin-top: auto; }
.bars > div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bars i { display: block; width: 100%; min-height: 2px; background: var(--text); transform-origin: bottom; animation: rise .6s var(--ease) both; }
.bars span { font: 10px var(--mono); color: var(--muted); text-transform: uppercase; }
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.note-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--border); }
.note-row__mark { font: 600 24px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.note-row b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row small { color: var(--muted); font-size: 12px; }
.mods { display: flex; flex-direction: column; }
.mod { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px dashed var(--border); }
.mod:first-child { border-top: 0; }
.mod b { font-weight: 500; display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod small { color: var(--muted); font-size: 10.5px; }
.mod__grade { font: 600 18px/1 var(--font); }
.abs-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--border); }
.abs-row:first-child { border-top: 0; }
.abs-row b { font: 600 15px/1.25 var(--font); display: block; }
.abs-row small { color: var(--muted); font-size: 12px; }
.abs-row[href]:hover b { text-decoration: underline; }

/* Projects */
.proj { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.proj__top { display: flex; justify-content: space-between; gap: 16px; }
.proj h3 { font: 600 20px/1.15 var(--font); letter-spacing: -.02em; margin: 12px 0 4px; }
.proj p { font-size: 12.5px; }
.proj__count { text-align: right; display: flex; flex-direction: column; gap: 4px; flex: none; }
.proj__count b { font: 600 22px/1 var(--font); letter-spacing: -.03em; }
.proj__bar { position: relative; height: 2px; background: var(--surface-3); margin-bottom: 8px; }
.proj__bar i { position: absolute; inset: 0 auto 0 0; background: var(--text); animation: grow 1s var(--ease) both; transform-origin: left; }
.proj__bar em { position: absolute; top: -4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--surface); border: 1px solid var(--text); }
.proj--done { opacity: .6; }

@media (max-width: 1100px) {
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .nav { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .nav a { flex: none; }
  .ov-grid { grid-template-columns: 1fr; }
  .ov--wide { grid-column: auto; }
  .notes { grid-template-columns: 1fr; }
  .profile { padding: 22px; }
  .profile__stats { width: 100%; }
  .profile__stats > div { flex: 1; padding: 12px; }
  .profile__stats b { font-size: 26px; }
  .agenda-day { grid-template-columns: 60px minmax(0, 1fr); }
  .agenda-day__date { padding: 14px 10px; }
  .agenda-ev { grid-template-columns: minmax(0, 1fr); gap: 4px; padding-right: 14px; }
  .agenda-ev__tags { justify-content: flex-start; }
  .abs-row { grid-template-columns: 56px minmax(0, 1fr); }
  .abs-row .pill { grid-column: 2; justify-self: start; }
}
.ev--short { flex-direction: row; align-items: center; gap: 6px; padding: 2px 7px; }
.ev--short .ev__title { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev--short .ev__flag { margin: 0 0 0 auto; }
.ov--full { grid-column: 1 / -1; }
.ov--full .mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 32px; }
.ov--full .mod:nth-child(-n+3) { border-top: 0; }

/* ==========================================================================
   Device showcase (connect page): a laptop and a spinning phone showing the app
   ========================================================================== */
.stage { position: relative; width: 100%; max-width: 760px; aspect-ratio: 16 / 10.5; margin: 8px 0 12px; }
.laptop { position: absolute; left: 0; top: 2%; width: 80%; animation: float 7s ease-in-out infinite; }
.laptop__lid { position: relative; aspect-ratio: 16 / 10.4; padding: 2.4% 2.4% 3.2%; border-radius: 14px 14px 5px 5px; background: linear-gradient(160deg, #262626, #121212 55%, #1c1c1c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 30px 60px -30px rgba(0, 0, 0, .9); }
.laptop__cam { position: absolute; top: 1%; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #333; box-shadow: inset 0 0 0 1px #000; }
.laptop__screen { height: 100%; overflow: hidden; border-radius: 3px; background: #0a0a0a; }
.laptop__screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.laptop__base { position: relative; width: 114%; margin-left: -7%; height: 14px; border-radius: 2px 2px 14px 14px; background: linear-gradient(#5b5b5b, #2c2c2c 40%, #1a1a1a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.laptop__base i { position: absolute; left: 50%; top: 0; width: 16%; height: 5px; margin-left: -8%; border-radius: 0 0 8px 8px; background: #1b1b1b; }
.laptop__shadow { width: 100%; height: 26px; margin-top: 4px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .7), transparent); }

.phone-wrap { position: absolute; right: 0; bottom: -3%; width: 28%; aspect-ratio: 9 / 19.5; perspective: 1400px; animation: float 6s 1s ease-in-out infinite; }
.phone { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: spin 14s cubic-bezier(.65, 0, .35, 1) infinite; }
.phone__face { position: absolute; inset: 0; border-radius: 17% / 7.8%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.phone__front { transform: translateZ(4px); padding: 3.6%; background: #050505; box-shadow: inset 0 0 0 1.5px #3b3b3b, inset 0 0 0 3px #111; }
.phone__back { transform: rotateY(180deg) translateZ(4px); background: linear-gradient(150deg, #2e2e2e, #161616 60%, #222); box-shadow: inset 0 0 0 1.5px #474747; display: grid; place-items: center; }
.phone__edge { position: absolute; top: 5%; bottom: 5%; width: 8px; background: linear-gradient(90deg, #1c1c1c, #5a5a5a, #1c1c1c); }
.phone__edge--l { left: -4px; transform: rotateY(-90deg); }
.phone__edge--r { right: -4px; transform: rotateY(90deg); }
.phone__screen { position: relative; height: 100%; overflow: hidden; border-radius: 13.5% / 6.2%; background: #0a0a0a; }
.phone__status { position: absolute; z-index: 2; inset: 0 0 auto; height: 6.5%; display: flex; align-items: center; justify-content: space-between; padding: 0 9% 0 11%; font: 600 clamp(6px, 1vw, 10px) var(--font); color: #f2f1ed; background: linear-gradient(#0a0a0a 70%, transparent); }
.phone__icons { display: inline-flex; align-items: flex-end; gap: 1.5px; }
.phone__icons i { width: 2px; background: #f2f1ed; border-radius: 1px; }
.phone__icons i:nth-child(1) { height: 3px; } .phone__icons i:nth-child(2) { height: 5px; } .phone__icons i:nth-child(3) { height: 7px; }
.phone__icons b { width: 13px; height: 6px; margin-left: 4px; border-radius: 2px; border: 1px solid #f2f1ed; box-shadow: inset -4px 0 0 0 #0a0a0a, inset 0 0 0 1px #0a0a0a; background: #f2f1ed; }
.phone__island { position: absolute; z-index: 3; top: 1.9%; left: 50%; width: 31%; height: 3.4%; transform: translateX(-50%); border-radius: 99px; background: #000; }
.phone__scroll { position: absolute; inset: 6.5% 0 0; overflow: hidden; }
.phone__scroll img { display: block; width: 100%; animation: phone-scroll 16s ease-in-out infinite; }
.phone__cams { position: absolute; top: 4%; left: 7%; width: 40%; aspect-ratio: 1; border-radius: 26%; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.phone__cams i { position: absolute; width: 38%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #3a3f55, #050505 55%); box-shadow: 0 0 0 2px #2a2a2a, 0 0 0 3px #0c0c0c; }
.phone__cams i:nth-child(1) { top: 8%; left: 8%; } .phone__cams i:nth-child(2) { bottom: 8%; left: 8%; } .phone__cams i:nth-child(3) { top: 31%; right: 8%; }
.phone__logo { width: 22%; color: rgba(242, 241, 237, .55); }
.phone__logo svg { display: block; width: 100%; }
.phone__shadow { position: absolute; left: 10%; right: 10%; bottom: -7%; height: 6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .75), transparent); animation: shadow 14s cubic-bezier(.65, 0, .35, 1) infinite; }

@keyframes spin {
  0%, 38% { transform: rotateY(-22deg) rotateX(4deg); }
  62%, 100% { transform: rotateY(338deg) rotateX(4deg); }
}
@keyframes shadow { 0%, 38%, 62%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.45); } }
@keyframes float { 50% { translate: 0 -8px; } }
@keyframes phone-scroll { 0%, 10% { transform: translateY(0); } 45%, 55% { transform: translateY(-58%); } 90%, 100% { transform: translateY(0); } }

@media (max-width: 860px) {
  .stage { margin: 4px 0 0; }
  .laptop__base { height: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .phone { transform: rotateY(-22deg) rotateX(4deg); }
}

/* ==========================================================================
   Themes, welcome flow, messages, staff
   ========================================================================== */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.theme-card { display: flex; flex-direction: column; gap: 0; padding: 0; text-align: left; cursor: pointer; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); overflow: hidden; transition: border-color .2s, transform .2s var(--ease); font: inherit; }
.theme-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.theme-card.is-on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.theme-card__art { display: grid; grid-template-columns: 22% 1fr; aspect-ratio: 16 / 9; background: var(--t-bg); color: var(--t-ink); border-bottom: 1px solid var(--border); }
.tc-side { display: flex; flex-direction: column; gap: 6px; padding: 12px 8px; border-right: 1px solid color-mix(in srgb, var(--t-ink) 12%, transparent); }
.tc-side i { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--t-ink) 30%, transparent); }
.tc-side i:first-child { background: var(--t-ink); width: 70%; }
.tc-main { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--t-bg); }
.tc-title { font: italic 400 20px/1 var(--serif); }
.tc-row { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 3px; background: var(--t-surface); border: 1px solid color-mix(in srgb, var(--t-ink) 12%, transparent); }
.tc-ring { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--t-ink); border-left-color: color-mix(in srgb, var(--t-ink) 20%, transparent); flex: none; }
.tc-bars { display: flex; gap: 2px; flex: 1; }
.tc-bars i { height: 5px; flex: 3; background: var(--t-ink); }
.tc-bars i.is-signal { flex: 1; background: var(--t-signal); }
.tc-chip { height: 6px; width: 34%; border-radius: 3px; background: color-mix(in srgb, var(--t-ink) 35%, transparent); }
.theme-card__meta { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; }
.theme-card__meta b { font-weight: 600; }
.theme-card__meta small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.theme-grid--wide { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

.welcome { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.welcome__top, .welcome__foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 40px; }
.welcome__top { border-bottom: 1px solid var(--border); }
.welcome__foot { border-top: 1px solid var(--border); }
.welcome__body { display: grid; align-items: center; padding: 40px; max-width: 1240px; width: 100%; margin: 0 auto; }
.welcome__body > * { animation: rise .5s var(--ease) both; }
.w-progress { display: flex; gap: 4px; flex: 1; max-width: 420px; }
.w-progress i { flex: 1; height: 2px; background: var(--surface-3); transition: background .3s; }
.w-progress i.is-done { background: var(--text-2); }
.w-progress i.is-now { background: var(--text); }
.w-hello { max-width: 760px; }
.w-mark { display: block; width: 56px; color: var(--text); margin-bottom: 28px; }
.w-mark svg { display: block; width: 100%; }
.w-title { font: 400 clamp(46px, 6vw, 92px)/.95 var(--serif); letter-spacing: -.02em; margin: 14px 0 0; text-wrap: balance; }
.w-text { color: var(--text-2); font-size: 16px; max-width: 520px; margin-top: 22px; line-height: 1.6; }
.w-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px; align-items: center; }
.w-split--theme { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.w-split .w-title { font-size: clamp(40px, 4.6vw, 72px); }
.w-stage { display: grid; place-items: center; min-height: 340px; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 18px 18px; }
.w-art { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 12px; }
.w-card { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); }
.w-card b { display: block; font-weight: 600; font-size: 16px; }
.w-card small { color: var(--muted); font-size: 11px; }
.w-card--col { flex-direction: column; align-items: stretch; gap: 12px; }
.w-skill { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; font-size: 13px; }
.w-art--week { flex-direction: row; gap: 6px; height: 260px; position: relative; padding-bottom: 46px; }
.w-day { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 8px 4px; border-left: 1px solid var(--border); }
.w-ev { display: block; border-radius: 3px; border: 1px dashed var(--border-strong); }
.w-ev.is-in { background: var(--text); border: 0; }
.w-ev.is-exam { background-image: repeating-linear-gradient(-45deg, transparent 0 4px, var(--muted) 4px 5px); box-shadow: inset 3px 0 0 var(--signal); }
.w-token { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: inline-flex; gap: 10px; align-items: center; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--signal); color: var(--signal); background: var(--bg); white-space: nowrap; }
.w-token .mono { font-size: 14px; color: var(--text); }
.w-proj { padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); display: flex; flex-direction: column; gap: 12px; }
.w-proj b { font-weight: 600; }
.w-proj .mono { font-size: 12px; }
.w-console { height: auto; width: 100%; max-width: 480px; }
.w-art--chat { gap: 10px; }
.bubble { align-self: flex-start; max-width: 80%; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.bubble b { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.bubble.is-me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--text); color: var(--invert); border-color: var(--text); }
.w-announce { display: flex; gap: 8px; align-items: center; margin-top: 8px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 13px; }
.w-art--staff { flex-direction: row; flex-wrap: wrap; }
.w-stat { flex: 1; min-width: 120px; padding: 18px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.w-stat b { font: 600 40px/1 var(--font); letter-spacing: -.04em; }
.w-checks { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.w-check { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--border); }
.w-check:first-child { border-top: 0; }
.w-check b { display: block; font-weight: 600; }
.w-check small { color: var(--muted); font-size: 12.5px; }
.w-check__dot { width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--border-strong); display: grid; place-items: center; }
.w-check.is-ok .w-check__dot { border: 0; background: var(--text); color: var(--invert); }

/* Messages */
.chat { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; height: calc(100vh - 150px); min-height: 520px; }
.chat__list { display: flex; flex-direction: column; min-height: 0; }
.chat__list-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; }
.chat__search { margin: 0 14px 10px; }
.chat__search .input { height: 36px; }
.chat__convs { flex: 1; overflow-y: auto; min-height: 0; }
.chat__note { padding: 12px 18px; border-top: 1px solid var(--border); }
.conv { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 11px 18px; border: 0; border-top: 1px solid var(--border); background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.conv:hover { background: var(--surface-2); }
.conv.is-on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--text); }
.conv__avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 500 12px var(--mono); border: 1px solid var(--border-strong); color: var(--text); }
.conv__avatar--ann { background: var(--text); color: var(--invert); border-color: var(--text); }
.conv__main { min-width: 0; display: flex; flex-direction: column; }
.conv__main b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv__main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv__side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.conv__side small { font-size: 10.5px; color: var(--muted); }
.conv__badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font: 600 11px var(--font); background: var(--signal); color: #fff; }
.chat__thread { display: flex; flex-direction: column; min-height: 0; }
.thread__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.thread__head b { display: block; font-weight: 600; font-size: 15px; }
.thread__head small { color: var(--muted); font-size: 12px; }
.thread__back { display: none; }
.thread__body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.day-sep { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; color: var(--muted); font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 72%; }
.msg.is-me { align-self: flex-end; align-items: flex-end; }
.msg__from { font-size: 11px; color: var(--muted); font-weight: 500; margin: 6px 0 2px 4px; }
.msg__bubble { padding: 9px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--border); line-height: 1.45; overflow-wrap: anywhere; }
.msg.is-me .msg__bubble { border-radius: 16px 16px 4px 16px; background: var(--text); color: var(--invert); border-color: var(--text); }
.msg__bubble a { text-decoration: underline; }
.msg__time { font-size: 10px; color: var(--muted); margin: 2px 6px 0; }
.composer { display: flex; gap: 10px; align-items: flex-end; padding: 14px 16px; border-top: 1px solid var(--border); }
.composer textarea { flex: 1; min-height: 42px; max-height: 160px; resize: none; font: 14px/1.45 var(--font); border-radius: 20px; padding: 10px 16px; }
.composer .btn { width: 42px; height: 42px; padding: 0; flex: none; }
.announce { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.announce.is-pinned { border-color: var(--text); }
.announce h3 { font: 600 17px/1.25 var(--font); }
.announce p { color: var(--text-2); line-height: 1.55; }
.nc-picked { display: flex; flex-wrap: wrap; gap: 6px; }
.nc-picked .tag { cursor: pointer; font-family: var(--font); font-size: 12px; padding: 3px 8px; }
.nc-results { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.nc-results .conv:first-child { border-top: 0; }
.nc-results > p { padding: 14px; }

/* Staff */
.staff-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 20px; border-top: 1px solid var(--border); }
.staff-row b { display: block; font-weight: 600; }
.staff-row small { color: var(--muted); font-size: 12px; }
.row.staff-members { grid-template-columns: minmax(0, 2fr) 90px 150px 140px; }
.row.staff-members select { height: 32px; font-size: 13px; }

@media (max-width: 1100px) {
  .w-split, .w-split--theme { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 860px) {
  .welcome__top, .welcome__foot { padding: 14px 16px; }
  .welcome__top .brand__name { display: none; }
  .welcome__body { padding: 24px 16px; align-items: start; }
  .welcome__foot .mono { display: none; }
  .w-stage { min-height: 0; padding: 18px; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .chat__thread { display: none; }
  .chat.has-thread .chat__list { display: none; }
  .chat.has-thread .chat__thread { display: flex; }
  .thread__back { display: grid; }
  .msg { max-width: 86%; }
  .row.staff-members { grid-template-columns: minmax(0, 1fr) 110px; }
  .row.staff-members > :nth-child(2), .row.staff-members > :nth-child(3) { display: none; }
}
@media (max-width: 1100px) {
  .row.staff-members > :nth-child(4) { display: block; }
}
.w-console { white-space: pre-wrap; }
@media (max-width: 860px) {
  .theme-grid, .theme-grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .theme-card__meta small { display: none; }
  .tc-title { font-size: 15px; }
  .tc-main { gap: 6px; padding: 8px; }
  .tc-row:last-child { display: none; }
}

/* School picker (connect page) */
.school-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.school-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: transparent; color: var(--text); cursor: pointer; }
.school-pick button small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.school-pick button[aria-checked="true"] { border-color: var(--text); background: var(--surface-2, rgba(127,127,127,.08)); }
.school-pick button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
[data-school] { display: flex; flex-direction: column; gap: 14px; }
