@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/geist-400.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/geist-400.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/geist-700.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/geist-700.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 900; font-display: swap; src: url(fonts/geist-900.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/geist-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/geist-mono-500.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --mono: var(--font-mono);
  --sans: var(--font-display);
  --mono-size: 13px;
  --surface-hover: #272928;
  --line-strong: rgba(232, 224, 210, 0.20);
  --editor-bg: #101111;
  --editor-hl: rgba(45, 212, 191, 0.07);
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-line: rgba(45, 212, 191, 0.34);
  --error-bg: rgba(229, 107, 111, 0.14);
  --success-bg: rgba(52, 211, 153, 0.14);
  --warning-bg: rgba(229, 181, 92, 0.14);
  --warning-line: rgba(229, 181, 92, 0.34);
  --card-shadow: 0 1px 0 rgba(232, 224, 210, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.34);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23E8E0D2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
}

body.light {
  color-scheme: light;
  --surface-hover: #DBD4C6;
  --line-strong: rgba(17, 17, 17, 0.22);
  --editor-bg: #FDFBF7;
  --editor-hl: rgba(15, 118, 110, 0.065);
  --accent-soft: rgba(15, 118, 110, 0.11);
  --accent-line: rgba(15, 118, 110, 0.30);
  --error-bg: rgba(194, 59, 50, 0.11);
  --success-bg: rgba(21, 128, 90, 0.11);
  --warning-bg: rgba(166, 110, 20, 0.11);
  --warning-line: rgba(166, 110, 20, 0.30);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset, 0 4px 16px rgba(17, 17, 17, 0.06);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23111111' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  transition: none !important;
  animation: none !important;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.side {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-role-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 10px 12px;
}
.side .eyebrow {
  font-size: 11px; letter-spacing: .09em; color: var(--muted);
  margin: 0; font-weight: 700; display: flex; align-items: center; gap: 7px;
}
.role-pip {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  display: inline-block;
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-control);
  color: var(--muted); font-size: 13.5px; text-align: left; width: 100%;
  transition: background .14s ease, color .14s ease;
}
.nav button svg { flex: 0 0 16px; opacity: .88; }
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button.on {
  background: var(--text); color: var(--bg); font-weight: 700;
}
.nav button.on svg { opacity: 1; }
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
.nav button.on .nav-badge {
  background: var(--bg); color: var(--text); border-color: transparent;
}
.side .spacer { flex: 1; }
.me {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 10px 11px;
  display: flex; align-items: center; gap: 10px;
}
body.light .side { background: var(--surface-2); }
body.light .side .nav button:hover { background: var(--surface); }
body.light .side .me { background: var(--surface); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  background: var(--bg); border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.me .who { min-width: 0; line-height: 1.25; }
.me .who b { display: block; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- main column & topbar ---------- */
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px 0 20px; border-bottom: 1px solid var(--line);
  background: var(--bg); position: sticky; top: 0; z-index: 15;
}
.brand { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.brand .mark { width: 24px; height: 24px; }
.brand .name { font-size: 15px; font-weight: 900; letter-spacing: -.02em; }
.crumb-sep { color: var(--faint); font-size: 13px; }
.topbar .title { color: var(--muted); font-size: 13px; }
.topbar .title strong { color: var(--text); font-weight: 700; }
.topbar .grow { flex: 1; }

.seg {
  display: inline-flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-control); padding: 2px; gap: 2px;
}
.seg button {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 3px;
  font-size: 12px; color: var(--muted);
  transition: background .14s ease, color .14s ease;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--text); color: var(--bg); font-weight: 700; }

.iconbtn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: var(--radius-control); color: var(--muted); position: relative;
  border: 1px solid transparent; transition: background .14s ease, color .14s ease;
}
.iconbtn:hover { background: var(--surface); color: var(--text); border-color: var(--line); }
.notif-dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--error); box-shadow: 0 0 0 2px var(--bg);
}

/* ---------- content & page header ---------- */
.content { flex: 1 1 auto; padding: 24px 28px 36px; min-width: 0; }
.content.content-ide { padding: 0; display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h)); overflow: hidden; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-title { font-size: 24px; font-weight: 900; letter-spacing: -.025em; margin: 0; line-height: 1.15; }
.page-sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- generic ui ---------- */
.grid { display: grid; gap: 16px; }
.cols-2-1 { grid-template-columns: 1.6fr 1fr; }
.cols-1-1 { grid-template-columns: 1fr 1fr; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 20px 22px;
  min-width: 0; box-shadow: var(--card-shadow);
}
.subcard {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 14px 16px; min-width: 0;
}
.card h3 { margin: 0; font-size: 15px; font-weight: 900; letter-spacing: -.01em; }
.card .sub { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }
.eyebrow-sm {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0; font-weight: 700;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid transparent; border-radius: var(--radius-control);
  padding: 8px 15px; font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: filter .14s ease, background .14s ease, border-color .14s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); font-weight: 400; }
.btn.ghost:hover { border-color: var(--line-strong); background: var(--surface-hover); filter: none; }
.btn.outline { background: transparent; color: var(--text); border: 1px solid var(--line-strong); font-weight: 400; }
.btn.outline:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: var(--error-bg); color: var(--error); border: 1px solid var(--error); font-weight: 700; }
.btn.danger:hover { filter: brightness(1.1); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn.xs { padding: 3px 8px; font-size: 11.5px; }

.input, .select {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-control);
  font-size: 13px; line-height: 1.25; height: 34px;
  transition: border-color .14s ease;
}
.input { padding: 0 12px; min-width: 210px; }
.input::placeholder { color: var(--faint); }
.input:hover, .select:hover { border-color: var(--line-strong); }
.select {
  appearance: none; -webkit-appearance: none;
  padding: 0 30px 0 11px; cursor: pointer;
  background-image: var(--select-arrow);
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: var(--bg); color: var(--text); }
.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-wrap svg { position: absolute; left: 10px; color: var(--faint); pointer-events: none; }
.search-wrap .input { padding-left: 31px; }

.switch {
  position: relative; width: 42px; height: 24px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line-strong);
  flex: 0 0 42px; transition: background .16s ease, border-color .16s ease;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted); transition: transform .16s ease, background .16s ease;
}
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { transform: translateX(18px); background: var(--accent-ink); }

.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface-2);
  white-space: nowrap;
}
.chip.ok { color: var(--success); border-color: rgba(77, 190, 147, 0.42); background: var(--success-bg); }
.chip.warn { color: var(--warning); border-color: rgba(229, 181, 92, 0.42); background: var(--warning-bg); }
.chip.err { color: var(--error); border-color: rgba(229, 107, 99, 0.42); background: var(--error-bg); }
body.light .chip.ok { border-color: rgba(31, 122, 84, 0.35); }
body.light .chip.warn { border-color: rgba(166, 110, 20, 0.35); }
body.light .chip.err { border-color: rgba(194, 59, 50, 0.35); }

.course-badge {
  width: 36px; height: 36px; border-radius: var(--radius-control); flex: 0 0 36px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--accent);
}
.course-badge.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }

.prog-track { height: 6px; border-radius: 3px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.prog-track.sm { height: 5px; }
.prog-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width .25s ease; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 400; color: var(--muted); font-size: 12px;
  padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; transition: background .12s ease; }
.tbl tr.click:hover { background: var(--surface-2); }

/* ---------- home & activity ---------- */
.lang-tracks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.lang-track {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-control);
  padding: 11px 12px; text-align: left; cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.lang-track:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.lang-track.on { border-color: var(--accent); }
.lang-track .lt-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12.5px; }
.lang-track .lt-top b { font-weight: 700; }

.activity { display: flex; flex-direction: column; padding: 0; margin: 12px 0 0; }
.activity li {
  list-style: none; display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.activity li:last-child { border-bottom: 0; padding-bottom: 0; }
.activity .dot, .status-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 8px; }
.activity b { font-weight: 700; font-size: 13px; display: block; }
.activity small { color: var(--muted); font-size: 12px; }
.activity time { margin-left: auto; color: var(--faint); font-size: 11.5px; white-space: nowrap; }

.join-card {
  border: 1px dashed var(--line-strong); background: transparent;
  border-radius: var(--radius-card); padding: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 220px; color: var(--muted); cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.join-card:hover { border-color: var(--accent); background: var(--surface); color: var(--text); }
.join-plus {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-size: 20px; line-height: 1;
}

/* ---------- KPI strip ---------- */
.kpi-card { padding: 0; overflow: hidden; }
.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-cell { padding: 15px 20px; position: relative; }
.kpi-cell + .kpi-cell { border-left: 1px solid var(--line); }
.kpi-val { font-size: 28px; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
.kpi-lbl { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.kpi-delta { font-size: 11.5px; margin-top: 4px; color: var(--success); }

/* ---------- charts ---------- */
.vchart { display: flex; align-items: flex-end; gap: 10px; height: 142px; padding-top: 22px; }
.vbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 6px; }
.vbar-val { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.vbar { width: 100%; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, transparent) 100%); opacity: .92; min-height: 4px; transition: opacity .14s ease; }
.vbar.dim { background: var(--muted); opacity: .34; }
.vbar.warn { background: linear-gradient(180deg, var(--warning) 0%, color-mix(in srgb, var(--warning) 70%, transparent) 100%); opacity: .92; }
.vbar-col:hover .vbar { opacity: 1; }
.vbar-lbl { font-size: 11.5px; color: var(--muted); }

/* ---------- IDE Workbench ---------- */
.ide-bar {
  height: 48px; flex: 0 0 48px;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.ide-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ide-title { font-size: 14px; font-weight: 900; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-main { flex: 1 1 auto; min-height: 0; display: flex; }
.ide-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ide-editors {
  flex: 1 1 auto; min-height: 0; display: grid;
  grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: 1px; background: var(--line);
}
.ide-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--editor-bg); }
.pane-head {
  height: 38px; flex: 0 0 38px;
  display: flex; align-items: center; gap: 9px; padding: 0 12px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.pane-head .lang-name { font-size: 13px; font-weight: 700; }
.pane-head .fname { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.pane-head .sp { flex: 1; }
.ready-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; }

.editor-wrap { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: var(--editor-bg); }
.editor-wrap .gutter {
  position: absolute; left: 0; top: 0; bottom: 0; width: 44px; padding: 12px 0;
  text-align: right; color: var(--faint); font-family: var(--mono); font-size: var(--mono-size); line-height: 20px;
  background: var(--surface-2); border-right: 1px solid var(--line); overflow: hidden; user-select: none; z-index: 2;
}
.editor-wrap .gutter span { display: block; padding-right: 10px; }
.editor-wrap .gutter span.active-ln { color: var(--text); font-weight: 500; }
.editor-wrap .code-hl,
.editor-wrap textarea {
  position: absolute; inset: 0; margin: 0; border: 0; outline: 0; resize: none;
  padding: 12px 14px 12px 56px;
  font-family: var(--mono); font-size: var(--mono-size); line-height: 20px; tab-size: 4;
  white-space: pre; overflow: auto;
}
.editor-wrap .code-hl {
  pointer-events: none; color: var(--text); z-index: 1;
}
.editor-wrap textarea {
  background: transparent; color: transparent; caret-color: var(--text); z-index: 3;
}
.editor-wrap textarea::selection { background: rgba(45, 212, 191, 0.20); }
body.light .editor-wrap textarea::selection { background: rgba(15, 118, 110, 0.16); }
.hl-line { display: block; min-height: 20px; }
.hl-line.active { background: var(--editor-hl); box-shadow: -12px 0 0 var(--editor-hl), 14px 0 0 var(--editor-hl); }

.tok-kw { color: var(--code-kw); }
.tok-str { color: var(--code-str); }
.tok-num { color: var(--code-num); }
.tok-com { color: var(--code-com); font-style: italic; }
.tok-fn { color: var(--code-fn); }
.tok-op { color: var(--code-op); }

.ide-bottom {
  flex: 0 0 212px; border-top: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; min-height: 0;
}
.ide-tabs {
  height: 38px; flex: 0 0 38px; display: flex; align-items: center; gap: 18px;
  padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.ide-tabs button {
  height: 38px; font-size: 12.5px; color: var(--muted);
  border-bottom: 2px solid transparent; padding: 0 2px;
}
.ide-tabs button:hover { color: var(--text); }
.ide-tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }
.ide-panel-body { flex: 1 1 auto; overflow: auto; padding: 10px 16px; font-size: 12.5px; }
.ide-panel-body .tbl th { padding: 6px 8px; font-size: 11px; }
.ide-panel-body .tbl td { padding: 7px 8px; font-size: 12px; }
.console-out { font-family: var(--mono); font-size: 12px; line-height: 1.55; }
.console-out .ln { white-space: pre-wrap; }
.console-out .ln.err { color: var(--error); }
.console-out .ln.ok { color: var(--success); }

.ide-instr {
  flex: 0 0 var(--instr-w); border-left: 1px solid var(--line); background: var(--surface);
  overflow-y: auto; padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 14px;
}
.ide-instr h2 { margin: 4px 0 0; font-size: 17px; font-weight: 900; letter-spacing: -.015em; }
.ide-instr p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.spec-box {
  background: var(--editor-bg); border: 1px solid var(--line); border-radius: var(--radius-control);
  padding: 9px 11px; font-family: var(--mono); font-size: 12.5px; line-height: 1.45;
}
.teacher-note {
  background: var(--warning-bg); border: 1px solid var(--warning-line);
  border-radius: var(--radius-control); padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
}
.ide-statusbar {
  height: 28px; flex: 0 0 28px; border-top: 1px solid var(--line); background: var(--surface-2);
  display: flex; align-items: center; gap: 16px; padding: 0 16px; font-size: 11.5px; color: var(--muted);
}

/* ---------- AI pattern stripe & management split ---------- */
.pattern-card { position: relative; overflow: hidden; padding-top: 22px; display: flex; flex-direction: column; }
.pattern-stripe { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.mgmt-split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.class-opt {
  width: 100%; text-align: left; padding: 13px 14px; border-radius: var(--radius-control);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: border-color .14s ease, background .14s ease;
}
.class-opt:hover { border-color: var(--line-strong); }
.class-opt.on { background: var(--bg); border-color: var(--accent); }

/* ---------- drawer & toast ---------- */
.drawer {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: 420px; max-width: 90vw;
  background: var(--surface); border-left: 1px solid var(--line-strong);
  transform: translateX(104%); transition: transform .18s ease;
  padding: 22px; overflow: auto; z-index: 30;
  box-shadow: -14px 0 36px rgba(0, 0, 0, .34);
}
.drawer.open { transform: none; }
.drawer h4 { margin: 0 0 6px; font-size: 17px; font-weight: 900; letter-spacing: -.015em; }
.drawer .close { position: absolute; top: 16px; right: 16px; }
.kv {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.kv:last-child { border-bottom: 0; }
.scrim {
  position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0, 0, 0, .42);
  opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 20;
}
.scrim.on { opacity: 1; pointer-events: auto; }

.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius-control); padding: 9px 14px;
  font-size: 12.5px; font-weight: 700; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  animation: toast-in .16s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- auth shell & IDE hint banner ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 52%), var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 26px 28px;
  box-shadow: var(--card-shadow);
}
.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.auth-field { margin-bottom: 13px; }
.auth-field label { display: block; margin-bottom: 6px; }
.auth-field .input { width: 100%; }
.auth-err {
  background: var(--error-bg);
  border: 1px solid rgba(229, 107, 111, 0.4);
  color: var(--error);
  border-radius: var(--radius-control);
  padding: 8px 11px;
  font-size: 12.5px;
  margin-bottom: 14px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--faint);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.ai-hint-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
}
.ai-hint-box b { color: var(--accent); }
.ready-dot.loading { background: var(--warning); }
.ready-dot.err { background: var(--error); }

/* ---------- responsive ---------- */
@media (max-width: 1279px) {
  .content { padding: 22px 18px 40px; }
  .cols-2-1, .cols-1-1, .mgmt-split { grid-template-columns: 1fr; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-cell:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .kpi-cell:nth-child(4) { border-top: 1px solid var(--line); }
}
@media (max-width: 1151px) {
  .hide-narrow { display: none !important; }
  .ide-instr { flex-basis: 260px; }
}
