/* A&S Platform — clickable prototype styles */
/* Inter and JetBrains Mono, Latin + Cyrillic subsets (the UI is Bulgarian by default) */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('vendor/fonts/inter-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('vendor/fonts/inter-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('vendor/fonts/inter-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('vendor/fonts/inter-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('vendor/fonts/inter-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('vendor/fonts/inter-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('vendor/fonts/inter-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('vendor/fonts/inter-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url('vendor/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url('vendor/fonts/jetbrains-mono-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url('vendor/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url('vendor/fonts/jetbrains-mono-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }

/* ---------- design tokens (light); dark values below; never hard-code colors in components ---------- */
:root {
  color-scheme: light;
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f8f8f6; --sunken: #f1f1ee; --hover: #f3f3f1;
  --ink: #15171a; --ink-2: #3b4047; --muted: #6b7179; --faint: #a7acb3; --line: #e2e2dc; --line-2: #ecece7; --line-strong: #c9c9c2;
  --on-ink: #ffffff; --ink-hover: #2a2e33;
  --top: #111315; --top-ink: #e9eaec; --top-muted: #8b9098;
  --accent: #2547d0; --accent-hover: #1d3bb3; --accent-soft: #edf0fc; --accent-line: #c9d3f6;
  --ok: #1b7444; --ok-soft: #e7f3eb; --ok-line: #bfe0c8; --warn: #8f5d00; --warn-soft: #faf1dc; --warn-mid: #c98a12; --bad: #ad3420; --bad-soft: #fae8e3;
  --band-top: #1b7444; --band-hi: #5aa77a; --band-mid: #c98a12; --band-lo: #ad3420;
  --fresh: #f3f8f4; --sel: #dfe5fb; --console: #fcfcfa; --tb-bg: rgba(255, 255, 255, .92); --scrim: rgba(17, 19, 21, .45);
  --medal: #f3d36b; --medal-ink: #5c4400; --heat-1: #bfe0c8; --heat-2: #74bb8a;
  --c: #4757b5; --cpp: #1c7486; --python: #a87612; --java: #ab4b27; --csharp: #6a3db0;
  --tok-keyword: #7a3fb0; --tok-type: #1c7486; --tok-def: #2547d0; --tok-string: #2f7d32; --tok-number: #b0541e; --tok-comment: #8a9099; --tok-meta: #ab4b27; --tok-bracket: #1b7444;
  --shadow: 0 1px 2px rgba(17, 19, 21, .04); --shadow-md: 0 4px 16px rgba(17, 19, 21, .08); --shadow-pop: 0 12px 32px rgba(17, 19, 21, .14); --shadow-lg: 0 20px 60px rgba(17, 19, 21, .25);
  /* type scale: 9 sizes (was 17) */
  --fs-11: 11px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-16: 16px; --fs-18: 18px; --fs-22: 22px; --fs-28: 28px; --fs-34: 34px;
  /* radii: 4 sizes + full (was 10) */
  --radius-xs: 4px; --radius-sm: 6px; --radius: 10px; --radius-lg: 14px; --radius-full: 999px;
  /* spacing (4 px grid) for new components */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --ease: cubic-bezier(.2, .7, .2, 1); --dur: .18s;
  --sb-w: 248px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
}
/* dark theme: screen only, print always uses the light tokens */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1013; --surface: #15181c; --surface-2: #1a1e23; --sunken: #21262c; --hover: #1e2227;
    --ink: #e7e9ec; --ink-2: #c3c8cf; --muted: #8c939c; --faint: #5c636d; --line: #2b3037; --line-2: #22272d; --line-strong: #3d444d;
    --on-ink: #0e1013; --ink-hover: #ffffff;
    --accent: #7d97ff; --accent-hover: #a3b5ff; --accent-soft: rgba(125, 151, 255, .14); --accent-line: rgba(125, 151, 255, .38);
    --ok: #4fc58c; --ok-soft: rgba(79, 197, 140, .14); --ok-line: rgba(79, 197, 140, .38); --warn: #e3ae45; --warn-soft: rgba(227, 174, 69, .14); --warn-mid: #e3ae45; --bad: #f2836d; --bad-soft: rgba(242, 131, 109, .14);
    --band-top: #4fc58c; --band-hi: #8fd3a8; --band-mid: #e3ae45; --band-lo: #f2836d;
    --fresh: rgba(79, 197, 140, .08); --sel: rgba(125, 151, 255, .3); --console: #111418; --tb-bg: rgba(14, 16, 19, .86); --scrim: rgba(0, 0, 0, .6);
    --medal: #e6c050; --medal-ink: #3a2a00; --heat-1: #1f4d35; --heat-2: #2f8a5c;
    --c: #8e9cff; --cpp: #45b7c9; --python: #e2b34c; --java: #ec8f67; --csharp: #b591f2;
    --tok-keyword: #c89cf3; --tok-type: #5cc8d9; --tok-def: #93abff; --tok-string: #a3d68d; --tok-number: #f3a26d; --tok-comment: #6d747e; --tok-meta: #f0a37c; --tok-bracket: #4fc58c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5); --shadow-md: 0 6px 20px rgba(0, 0, 0, .45); --shadow-pop: 0 12px 32px rgba(0, 0, 0, .55); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .65);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
h1 { font-size: var(--fs-28); font-weight: 650; line-height: 1.2; }
h2 { font-size: var(--fs-16); font-weight: 600; }
h3 { font-size: var(--fs-14); font-weight: 600; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
code, .mono, pre, .CodeMirror, .console { font-variant-ligatures: none; font-feature-settings: 'liga' 0, 'calt' 0; }
code { background: var(--sunken); padding: 1px 5px; border-radius: var(--radius-xs); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-12); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }


/* ---------- Kaggle-style shell ---------- */
.app { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line-2); display: flex; flex-direction: column; padding: 8px 12px 16px; scrollbar-width: thin; z-index: 30; }
.sb-head { display: flex; align-items: center; gap: 6px; height: 56px; padding-left: 2px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.mark { display: inline-grid; place-items: center; height: 26px; padding: 0 6px; background: var(--ink); color: var(--on-ink); border-radius: var(--radius-sm); font-weight: 700; font-size: var(--fs-12); letter-spacing: .02em; }
.brand-name { font-weight: 650; font-size: var(--fs-18); letter-spacing: -0.02em; }
.sb-create { padding: 6px 2px 12px; }
.create-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px 0 16px; border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 4px 10px rgba(0, 0, 0, .05); font-weight: 600; cursor: pointer; color: var(--ink); }
.create-btn:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, .14), 0 6px 16px rgba(0, 0, 0, .07); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-item { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 14px; border-radius: var(--radius-full); color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.sb-item:hover { background: var(--hover); color: var(--ink); }
.sb-item.active { background: var(--sunken); color: var(--ink); font-weight: 600; }
.sb-item.active .ic { color: var(--ink); }
.sb-label { font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 14px 14px 6px; }
.sb-views { display: grid; grid-template-columns: repeat(3, auto); background: var(--sunken); border-radius: var(--radius); padding: 3px; margin: 0 6px 8px; }
.sb-views a { text-align: center; font-size: var(--fs-11); font-weight: 500; padding: 6px 5px; white-space: nowrap; border-radius: var(--radius-sm); color: var(--muted); }
.sb-views a:hover { color: var(--ink); }
.sb-views a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); font-weight: 600; }
.sb-group { display: flex; flex-direction: column; gap: 2px; }
.sb-sep { height: 1px; background: var(--line-2); margin: 12px 8px; }
.sb-ver { font-variant-numeric: tabular-nums; opacity: .8; }
.sb-foot { margin-top: auto; padding: 16px 14px 0; font-size: var(--fs-12); color: var(--muted); line-height: 1.5; }
.nav-collapsed { --sb-w: 76px; }
.nav-collapsed .sb-item span, .nav-collapsed .brand-name, .nav-collapsed .sb-label, .nav-collapsed .sb-views, .nav-collapsed .sb-foot, .nav-collapsed .create-btn span { display: none; }
.nav-collapsed .sb-item { justify-content: center; padding: 0; }
.nav-collapsed .create-btn { padding: 0; width: 44px; justify-content: center; }
.nav-collapsed .sb-head .brand { display: none; }
.scrim { display: none; }
.main-col { min-width: 0; }
.tb { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 28px; background: var(--tb-bg); backdrop-filter: blur(8px); }
.tb-menu { display: none; }
.tb-search { flex: 1; min-width: 0; max-width: 760px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-full); background: var(--surface); color: var(--muted); }
.tb-search:focus-within { border-color: var(--ink-2); box-shadow: 0 1px 6px rgba(0, 0, 0, .08); }
.tb-search input { flex: 1; border: 0; outline: none; height: 100%; background: none; min-width: 0; color: var(--ink); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang-switch { display: flex; background: var(--sunken); border-radius: var(--radius-lg); padding: 2px; }
.lang-switch button { border: 0; background: none; font-size: var(--fs-12); font-weight: 600; padding: 5px 10px; border-radius: var(--radius-lg); cursor: pointer; color: var(--muted); }
.lang-switch button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.preview-chip { font-size: var(--fs-12); font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius-lg); padding: 3px 10px; white-space: nowrap; cursor: help; }
.proto-chip { font-size: var(--fs-12); font-weight: 600; letter-spacing: .03em; color: var(--warn); background: var(--warn-soft); border-radius: var(--radius-lg); padding: 4px 10px; cursor: help; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; font-size: var(--fs-12); font-weight: 600; color: var(--on-ink); flex-shrink: 0; }
.avatar.sm { width: 32px; height: 32px; font-size: var(--fs-12); background: var(--ink-2); }
.create-menu { position: absolute; z-index: 60; width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 6px; }
.cm-head { font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 8px 10px 6px; }
.create-menu button { display: grid; gap: 1px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.create-menu button:hover { background: var(--hover); }
.create-menu button span { font-size: var(--fs-12); color: var(--muted); }

/* ---------- page scaffolding ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 12px 28px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: var(--fs-11); font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.lead-sm { color: var(--muted); margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { font-size: var(--fs-13); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.section { margin-top: 28px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel + .panel, .tiles + .panel, .tiles + .grid-main, .grid-main + .panel, .grid-main + .section { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head p { margin: 0; }
.panel-h { margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; }
.panel-inner h3 { margin-bottom: 6px; }
.stack { display: grid; gap: 14px; align-content: start; }
.stack .panel + .panel { margin-top: 0; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.grid-main > .panel, .grid-side > .panel { margin-top: 0; }
.grid-main > *, .grid-side > *, .stack > * { min-width: 0; }
.scroll-x { overflow-x: auto; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tile-label { font-size: var(--fs-12); color: var(--muted); font-weight: 500; }
.tile-value { font-size: var(--fs-28); font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile-hint { font-size: var(--fs-12); color: var(--muted); }

/* ---------- buttons, chips, pills ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); color: var(--on-ink); }
.btn-ghost { background: transparent; }
.btn-sm { height: 30px; padding: 0 12px; font-size: var(--fs-13); }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-full); font-size: var(--fs-12); font-weight: 600; white-space: nowrap; vertical-align: middle; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-info { background: var(--accent-soft); color: var(--accent); }
.chip-muted { background: var(--sunken); color: var(--muted); }
.lang { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); font-size: var(--fs-12); font-weight: 600; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.lang::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--dot, var(--muted)); }
.lang-c { --dot: var(--c); } .lang-cpp { --dot: var(--cpp); } .lang-python { --dot: var(--python); } .lang-java { --dot: var(--java); } .lang-csharp { --dot: var(--csharp); }
.pills { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 500; font-size: var(--fs-13); cursor: pointer; }
.pill:hover { color: var(--ink); border-color: var(--line-strong); }
.pill.active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

/* ---------- rows ---------- */
.rows { display: grid; }
.row-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 4px; border-top: 1px solid var(--line-2); color: var(--ink); }
.row-link:first-child { border-top: 0; }
a.row-link:hover { background: var(--surface-2); color: var(--ink); }
.row-title { font-weight: 600; }
.row-sub { font-size: var(--fs-13); color: var(--muted); margin-top: 1px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-meta { display: flex; align-items: center; gap: 14px; font-size: var(--fs-13); flex-shrink: 0; }
.row-due { color: var(--ink-2); min-width: 110px; }
.row-due.soon { color: var(--warn); font-weight: 600; }
.row-score { min-width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.rows.compact .row-link { padding: 10px 4px; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
a.card:hover { border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: var(--fs-12); }
.card-title { font-weight: 600; font-size: var(--fs-16); }
.card-sub { color: var(--muted); font-size: var(--fs-13); }
.card-foot { display: flex; gap: 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: var(--fs-13); color: var(--muted); }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.tbl th { text-align: left; font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.me td { background: var(--accent-soft); }
.tbl tr.fresh td { background: var(--fresh); }
.tbl tr.subrow td { padding-top: 0; border-bottom-color: var(--line-2); }
.tbl tr.sep td { padding-top: 14px; font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.tbl .rank { color: var(--muted); font-weight: 600; width: 40px; }
.tbl .up { color: var(--ok); font-weight: 600; } .tbl .down { color: var(--bad); font-weight: 600; }
.tbl select, .tbl .num-in { height: 30px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 0 8px; }
.tbl .num-in { width: 64px; text-align: right; }
.tbl-rates td:first-child { width: 48%; }
.err-inline { background: var(--bad-soft); color: var(--bad); display: inline-block; }
.bar-cell { display: flex; align-items: center; gap: 10px; }
.meter { flex: 1; min-width: 60px; max-width: 160px; height: 6px; background: var(--sunken); border-radius: 3px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ink-2); border-radius: 3px; }
.meter-warn span { background: var(--warn-mid); } .meter-bad span { background: var(--bad); }
.role { font-size: var(--fs-12); font-weight: 600; padding: 2px 8px; border-radius: var(--radius-xs); background: var(--sunken); }
.role-admin { color: var(--bad); } .role-instructor { color: var(--accent); } .role-ta { color: var(--cpp); }

/* ---------- assignment header + tabs ---------- */
.a-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.a-title p { color: var(--muted); margin: 6px 0 0; font-size: var(--fs-16); }
.a-actions { display: flex; gap: 8px; align-items: center; }
.a-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin: 16px 0 0; font-size: var(--fs-13); color: var(--ink-2); }
.a-meta b { font-weight: 600; color: var(--muted); font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 22px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab-count { font-size: var(--fs-11); background: var(--sunken); color: var(--ink-2); border-radius: var(--radius-full); padding: 0 6px; line-height: 18px; font-weight: 600; }

.prose h3 { margin: 18px 0 6px; font-size: var(--fs-16); }
.prose h3:first-child { margin-top: 0; }
.prose ul { margin: 0 0 10px; padding-left: 20px; }
.prose li { margin: 3px 0; }
.example { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.example span { font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.example pre, .codeblock { margin: 6px 0 0; background: var(--sunken); border-radius: var(--radius-sm); padding: 10px 12px; font: var(--fs-13)/1.5 var(--mono); overflow-x: auto; }
.codeblock { margin-top: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: var(--fs-13); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.kv-wide { grid-template-columns: 220px 1fr; }
.kv-wide dd { text-align: left; }
.filelist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: var(--fs-13); }

/* ---------- workspace ---------- */
.ws { display: grid; gap: 12px; }
.ws-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ws-env { display: flex; align-items: center; gap: 10px; font-size: var(--fs-13); flex-wrap: wrap; }
.ws-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ws-main { display: grid; grid-template-columns: 220px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.ws-tree { background: var(--surface-2); border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tree-h { font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--muted); padding: 10px 8px 4px; }
.tree-item { display: flex; justify-content: space-between; align-items: center; gap: 6px; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: var(--radius-sm); font-size: var(--fs-13); cursor: pointer; color: var(--ink-2); }
.tree-item:hover { background: var(--sunken); }
.tree-item.active { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-weight: 500; }
.tree-item.static { cursor: default; color: var(--muted); }
.tree-item.static:hover { background: none; }
.lock { font-size: var(--fs-11); color: var(--muted); font-family: var(--font); }
.ws-editor { min-width: 0; display: flex; flex-direction: column; }
.ed-tabs { display: flex; justify-content: space-between; align-items: center; padding: 0 14px; height: 38px; border-bottom: 1px solid var(--line); font-size: var(--fs-12); }
.ed-tab { font-weight: 500; color: var(--ink); }
.ed-host .CodeMirror { height: 440px; }
.ws-console { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.console-tabs { display: flex; align-items: center; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.console-tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.console-tabs button.active { color: var(--ink); border-bottom-color: var(--ink); }
.busy { margin-left: auto; font-size: var(--fs-12); color: var(--warn); font-weight: 500; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.console { margin: 0; padding: 14px 16px; font: var(--fs-13)/1.6 var(--mono); min-height: 120px; white-space: pre-wrap; background: var(--console); }
.console .warn { color: var(--warn); }
.console .err, .err-text { color: var(--bad); }
.ok-text { color: var(--ok); font-weight: 600; }
.console-empty { padding: 30px 16px; color: var(--muted); text-align: center; }
.tests-sum { padding: 12px 16px 4px; font-size: var(--fs-13); }
.tbl-tests { margin: 4px 0 6px; }
.tbl-tests td { padding: 8px 16px; }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 14px; font-size: var(--fs-13); font-weight: 500; }
.proto-note { font-size: var(--fs-13); color: var(--muted); margin: 0; }

/* notebook */
.kernel { font-size: var(--fs-12); font-weight: 500; color: var(--ok); display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; }
.kernel::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.kernel.busy { color: var(--warn); }
.nb { display: grid; gap: 10px; }
.cell { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.cell-gutter { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 10px; font-size: var(--fs-12); color: var(--muted); }
.cell-gutter .run { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); font-size: var(--fs-12); padding: 2px 8px; cursor: pointer; font-weight: 500; }
.cell-gutter .run:hover { border-color: var(--ink); }
.cell-body { min-width: 0; }
.cell-code .cell-body { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.cell-task .cell-body { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.cell-tag { font-size: var(--fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); padding: 6px 12px 0; }
.cell-md .cell-body { padding: 6px 2px; }
.cell-md h3 { font-size: var(--fs-18); margin-bottom: 6px; }
.cell-ed .CodeMirror { height: auto; }
.cell-out { border-top: 1px dashed var(--line); padding: 10px 14px; font-size: var(--fs-13); background: var(--console); }
.cell-out pre { margin: 0; font: var(--fs-13)/1.55 var(--mono); white-space: pre-wrap; }
.cell-out .err { color: var(--bad); }
.nb-add { padding-left: 72px; }
.plot { width: 100%; max-width: 680px; height: auto; display: block; }
.plot-raw { fill: none; stroke: var(--faint); stroke-width: 1.2; }
.plot-smooth { fill: none; stroke: var(--accent); stroke-width: 2; }
.plot-raw-k { fill: var(--faint); } .plot-smooth-k { fill: var(--accent); }
.plot-legend text { font: var(--fs-11) var(--font); fill: var(--muted); }

/* CodeMirror theme */
.CodeMirror { font: var(--fs-13)/1.6 var(--mono); color: var(--ink); background: var(--surface); }
.CodeMirror-gutters { background: var(--surface); border-right: 1px solid var(--line-2); }
.CodeMirror-linenumber { color: var(--faint); padding: 0 10px 0 6px; }
.CodeMirror-lines { padding: 10px 0; }
.CodeMirror-cursor { border-left: 2px solid var(--accent); }
.CodeMirror-selected, .CodeMirror-focused .CodeMirror-selected { background: var(--sel); }
.cm-s-default .cm-keyword { color: var(--tok-keyword); font-weight: 500; }
.cm-s-default .cm-type, .cm-s-default .cm-variable-3 { color: var(--tok-type); }
.cm-s-default .cm-def, .cm-s-default .cm-variable-2 { color: var(--tok-def); }
.cm-s-default .cm-string, .cm-s-default .cm-string-2 { color: var(--tok-string); }
.cm-s-default .cm-number, .cm-s-default .cm-atom { color: var(--tok-number); }
.cm-s-default .cm-comment { color: var(--tok-comment); font-style: italic; }
.cm-s-default .cm-meta { color: var(--tok-meta); }
.cm-s-default .cm-builtin { color: var(--tok-type); }
.cm-s-default .cm-qualifier { color: var(--muted); }
.cm-s-default .cm-property, .cm-s-default .cm-variable { color: var(--ink); }
.cm-s-default .cm-error { color: var(--bad); }
div.CodeMirror span.CodeMirror-matchingbracket { color: var(--tok-bracket); font-weight: 600; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background: var(--surface); }
.cm-s-default .cm-operator { color: var(--ink-2); }
.editor-fallback { width: 100%; height: 440px; border: 0; padding: 12px 14px; font: var(--fs-13)/1.6 var(--mono); resize: vertical; outline: none; }
.cell-ed .editor-fallback { height: 120px; }

/* ---------- leaderboard lock + results ---------- */
.locked { text-align: center; padding: 40px 20px; background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px); border: 1px dashed var(--line); border-radius: var(--radius); }
.locked-title { font-size: var(--fs-18); font-weight: 650; margin-bottom: 8px; }
.locked p { max-width: 520px; margin: 0 auto 6px; }
.result { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: var(--radius-sm); margin-top: 14px; }
.result.ok { background: var(--ok-soft); } .result.warn { background: var(--warn-soft); } .result.bad { background: var(--bad-soft); }
.result.bad .result-score { color: var(--bad); }
.result-score { font-size: var(--fs-28); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.result.ok .result-score { color: var(--ok); } .result.warn .result-score { color: var(--warn); }

/* ---------- modal + toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; width: min(520px, 100%); box-shadow: var(--shadow-lg); }
.modal h2 { font-size: var(--fs-18); margin-bottom: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--fs-14); }
.steps li::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; transition: all .2s; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px var(--surface); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--on-ink); padding: 11px 18px; border-radius: var(--radius-sm); font-size: var(--fs-14); opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- wizard ---------- */
.stepper { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 0; margin: 0 0 18px; }
.stepper a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: var(--fs-13); font-weight: 500; }
.stepper span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); font-size: var(--fs-12); font-weight: 600; flex-shrink: 0; }
.stepper li.active a { border-color: var(--ink); color: var(--ink); }
.stepper li.active span { background: var(--ink); color: var(--on-ink); }
.stepper li.done span { background: var(--ok-soft); color: var(--ok); }
.wizard { padding: 24px; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.form-stack { display: grid; gap: 22px; max-width: 760px; }
.field { display: grid; gap: 6px; align-content: start; }
.field-label { font-weight: 600; font-size: var(--fs-13); }
.field-hint { font-size: var(--fs-12); color: var(--muted); }
.field input, .field select, .field textarea, .search { height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px; background: var(--surface); width: 100%; }
.field textarea { height: auto; padding: 9px 12px; resize: vertical; }
.static-val { min-height: 38px; display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: var(--fs-13); }
.search { max-width: 320px; }
.radios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.radio.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.radio input { margin-top: 3px; accent-color: var(--ink); }
.radio span { display: grid; gap: 2px; font-size: var(--fs-13); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { accent-color: var(--ink); width: 16px; height: 16px; }
.upload-row { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; font-size: var(--fs-13); }
.split { display: flex; gap: 22px; margin: 6px 0 12px; font-size: var(--fs-13); color: var(--muted); }
.split b { color: var(--ink); font-size: var(--fs-16); margin-right: 3px; }
.checklist { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: var(--fs-14); }
.checklist li::before { content: ''; width: 16px; height: 16px; border-radius: var(--radius-xs); border: 2px solid var(--line); flex-shrink: 0; }
.checklist li.ok { color: var(--ink); }
.checklist li.ok::before { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px var(--surface); }

/* ---------- charts ---------- */
.hist { width: 100%; height: auto; display: block; }
.hist .bar { fill: var(--ink-2); }
.hist .bar-val { font: 600 var(--fs-11) var(--font); fill: var(--ink-2); text-anchor: middle; }
.hist .bar-lbl { font: var(--fs-11) var(--font); fill: var(--muted); text-anchor: middle; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-title { font-size: var(--fs-16); font-weight: 600; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 460px; margin: 0 auto 16px; }

/* ---------- section heads ---------- */
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sec-head .ic { color: var(--ink-2); }
.sec-head h2 { font-size: var(--fs-18); font-weight: 600; }
.sec-extra { margin-left: auto; font-size: var(--fs-13); font-weight: 500; }
.sec-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.h2-lg { font-size: var(--fs-18); font-weight: 600; margin-bottom: 2px; }
.section { margin-top: 40px; padding-top: 4px; }

/* ---------- home (Kaggle-style) ---------- */
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-top: 18px; flex-wrap: wrap; }
.home-head h1 { font-size: var(--fs-34); font-weight: 650; letter-spacing: -0.03em; margin-bottom: 6px; }
.home-widgets { display: flex; gap: 28px; }
.hw { display: grid; justify-items: center; gap: 2px; min-width: 96px; }
.hw-label { font-size: var(--fs-12); font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.hw-big { font-size: var(--fs-28); font-weight: 650; line-height: 1; }
.hw-sub { font-size: var(--fs-12); color: var(--muted); text-align: center; }
.ring-wrap { position: relative; width: 56px; height: 56px; }
.ring-wrap span { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-13); font-weight: 650; }
.ring { width: 56px; height: 56px; }
.ring-bg { fill: none; stroke: var(--sunken); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--ok); stroke-width: 6; stroke-linecap: round; }
.heat-days, .heat { display: grid; grid-template-columns: repeat(7, 9px); gap: 3px; }
.heat-days span { font-size: 8.5px; color: var(--muted); text-align: center; }
.heat i { width: 9px; height: 9px; border-radius: 2px; background: var(--sunken); }
.heat i.h1 { background: var(--heat-1); } .heat i.h2 { background: var(--heat-2); } .heat i.h3 { background: var(--ok); }
.statrow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 28px; padding: 18px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.stat { display: flex; gap: 12px; align-items: flex-start; }
.stat .ic { color: var(--muted); margin-top: 2px; }
.stat-l { font-size: var(--fs-13); font-weight: 600; }
.stat-v { font-size: var(--fs-22); font-weight: 650; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat-h { font-size: var(--fs-12); color: var(--muted); }
.focus-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.focus { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; color: var(--ink); background: var(--surface); transition: box-shadow .15s; }
.focus:hover { color: var(--ink); box-shadow: var(--shadow-md); }
.banner { display: block; width: 100%; height: auto; }
.focus .banner { height: 84px; }
.focus-ic { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 46px; height: 46px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.focus-body { display: grid; gap: 4px; padding: 14px 16px 14px; font-size: var(--fs-13); }
.focus-body strong { font-size: var(--fs-16); }
.focus-go { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-weight: 600; font-size: var(--fs-13); }
.focus-go .ic { width: 16px; height: 16px; }
.todo { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.todo li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line-2); }
.todo li:first-child { border-top: 0; }
.todo li a { display: flex; align-items: center; gap: 14px; padding: 12px 4px; color: var(--ink); flex: 1; min-width: 0; }
.todo li a:hover { color: var(--accent); }
.todo li .ic { color: var(--muted); }
.todo li.ok a { color: var(--muted); text-decoration: line-through; }
.todo li.ok .ic { color: var(--ok); }
.todo-box { width: 18px; height: 18px; border-radius: var(--radius-xs); border: 2px solid var(--line); flex-shrink: 0; margin-right: 6px; }
.todo li.ok .todo-box { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px var(--surface); }
.mini-stats { display: flex; gap: 34px; flex-wrap: wrap; margin: 16px 0 18px; }
.mini-stats > div { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; }
.mini-stats .ic { width: 18px; height: 18px; color: var(--muted); }
.ms-l { font-size: var(--fs-13); font-weight: 600; }
.mini-stats strong { grid-column: 2; font-size: var(--fs-22); font-weight: 650; line-height: 1.3; }
.ms-h { grid-column: 2; font-size: var(--fs-12); color: var(--muted); }
.assign-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.acards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.acard, .lcard { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; color: var(--ink); background: var(--surface); transition: box-shadow .15s; }
a.acard:hover, a.lcard:hover { color: var(--ink); box-shadow: var(--shadow-md); }
.acard .banner { height: 92px; }
.acard-body, .lcard-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.acard-body strong, .lcard-body strong { font-size: var(--fs-14); }
.acard-body p { font-size: var(--fs-13); color: var(--muted); margin: 0; flex: 1; }
.acard-type { display: flex; align-items: center; gap: 6px; font-size: var(--fs-12); color: var(--muted); font-weight: 600; }
.acard-type .ic { width: 14px; height: 14px; }
.acard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: var(--fs-13); }
.pulse { display: grid; gap: 4px; }
.pulse-h { font-size: var(--fs-13); font-weight: 600; margin-bottom: 4px; }
.pulse-item { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 2px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); color: var(--ink); font-size: var(--fs-13); }
.pulse-item:hover { color: var(--accent); }
.pulse-item .muted.small:first-of-type { justify-self: end; }
.pulse-item strong, .pulse-item > span:last-child { grid-column: 1 / -1; }
.ann { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 40px; margin-top: 10px; }
.ann-k { font-size: var(--fs-12); color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.ann strong { display: block; margin-bottom: 4px; }
.ann p { font-size: var(--fs-13); }
.feed { display: grid; gap: 14px; margin-top: 10px; max-width: 820px; }
.fcard { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; background: var(--surface); }
.fhead { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.fmain { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.fmain .banner { width: 64px; height: 64px; border-radius: var(--radius); flex-shrink: 0; }
.fmeta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: var(--fs-13); color: var(--muted); }
.ffiles { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); display: grid; gap: 8px; }
.ffile { display: flex; align-items: center; gap: 10px; font-size: var(--fs-13); }
.ffile .ic { width: 16px; height: 16px; color: var(--muted); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.lcard .banner { height: 96px; }
.medal { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--medal); color: var(--medal-ink); font-weight: 700; font-size: var(--fs-12); }

/* ---------- overview (first page) ---------- */
.ov-hero { padding: 26px 0 8px; max-width: 820px; }
.ov-hero h1 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.08; margin: 6px 0 14px; }
.ov-hero .lead { font-size: var(--fs-16); color: var(--ink-2); }
.hero-langs { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hero-langs .lang { height: 28px; padding: 0 11px; font-size: var(--fs-13); background: var(--surface); border: 1px solid var(--line); }
.ov-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 30px; }
.view-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; color: var(--ink); background: var(--surface); transition: box-shadow .15s, transform .15s; }
.view-card:hover { color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .09); transform: translateY(-2px); }
.vc-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; flex: 1; }
.vc-role { font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.vc-body h2 { font-size: var(--fs-22); }
.vc-body p { color: var(--ink-2); font-size: var(--fs-14); margin: 0; }
.vc-body ul { margin: 6px 0 14px; padding-left: 18px; font-size: var(--fs-13); color: var(--ink-2); flex: 1; }
.vc-body li { margin: 3px 0; }
.vc-body .btn { align-self: flex-start; }
.pv { display: grid; grid-template-columns: 22% 1fr; height: 150px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); padding: 12px; gap: 10px; }
.pv-side { display: grid; align-content: start; gap: 7px; padding-top: 4px; }
.pv-side i { height: 7px; border-radius: var(--radius-xs); background: var(--line-strong); }
.pv-side i:first-child { width: 70%; height: 14px; border-radius: 7px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); margin-bottom: 4px; }
.pv-main { display: grid; align-content: start; gap: 8px; background: var(--surface); border-radius: var(--radius-sm); padding: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.pv-top { height: 9px; width: 60%; border-radius: var(--radius-sm); background: var(--line); }
.pv-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pv-row i { height: 16px; border-radius: var(--radius-xs); background: var(--sunken); }
.pv-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pv-cards b { height: 38px; border-radius: var(--radius-sm); background: linear-gradient(180deg, rgba(71, 87, 181, .22) 45%, var(--sunken) 45%); }
.pv-cards b:nth-child(2) { background: linear-gradient(180deg, rgba(192, 138, 30, .25) 45%, var(--sunken) 45%); }
.pv-cards b:nth-child(3) { background: linear-gradient(180deg, rgba(171, 75, 39, .22) 45%, var(--sunken) 45%); }
.pv-lines { display: grid; gap: 5px; }
.pv-lines i, .pv-table i { height: 6px; border-radius: 3px; background: var(--line-2); }
.pv-lines i:last-child { width: 70%; }
.pv-chart { display: flex; align-items: flex-end; gap: 6px; height: 42px; }
.pv-chart s { flex: 1; background: var(--ink-2); border-radius: 2px; text-decoration: none; }
.pv-table { display: grid; gap: 8px; padding-top: 4px; }
.pv-table i { height: 9px; background: linear-gradient(90deg, var(--line) 70%, var(--ok-line) 70%, var(--ok-line) 85%, transparent 85%); }
.ov-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 12px; }
.ov-step { border-top: 2px solid var(--ink); padding-top: 14px; }
.ov-step-n { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--ink-2); }
.ov-step-n span { font-size: var(--fs-12); font-weight: 700; color: var(--muted); }
.ov-step h3 { font-size: var(--fs-16); margin-bottom: 4px; }
.ov-step p { font-size: var(--fs-13); color: var(--muted); }
.ov-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding-top: 28px; border-top: 1px solid var(--line-2); }
.ov-foot h3 { margin-bottom: 6px; }
.ov-foot p { color: var(--muted); font-size: var(--fs-14); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .assign-wrap { grid-template-columns: 1fr; }
  .statrow { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
  .grid-main, .grid-side { grid-template-columns: minmax(0, 1fr); }
  .stepper { grid-template-columns: repeat(3, 1fr); }
  .ov-views { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; visibility: hidden; }
  .nav-open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 25; }
  .nav-collapsed { --sb-w: 248px; }
  .tb-menu { display: grid; }
  .tb { padding: 0 12px; gap: 8px; }
  .acards, .focus-grid { grid-template-columns: 1fr 1fr; }
  .ov-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .page { padding: 8px 16px 64px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .statrow { grid-template-columns: 1fr 1fr; }
  .acards, .focus-grid, .ann, .ov-views, .ov-steps, .ov-foot, .form-grid, .radios, .example { grid-template-columns: 1fr; }
  .home-head h1 { font-size: var(--fs-28); }
  .home-widgets { gap: 18px; width: 100%; justify-content: space-between; }
  .proto-chip { display: none; }
  .row-link { flex-direction: column; align-items: flex-start; gap: 8px; }
  .row-meta { flex-wrap: wrap; gap: 10px; }
  .row-score { text-align: left; min-width: 0; }
  .ws-main { grid-template-columns: 1fr; }
  .ws-tree { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .tree-h { width: 100%; }
  .cell { grid-template-columns: 1fr; }
  .cell-gutter { flex-direction: row; justify-content: space-between; padding-top: 0; }
  .nb-add { padding-left: 0; }
  .kv-wide { grid-template-columns: 1fr; }
  .tbl { display: block; overflow-x: auto; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .fmain .banner { display: none; }
}

/* ---------- manual grading: rubric, review page, code with comments on lines (views-grading.js) ---------- */
.g-loading { padding: 32px; text-align: center; }
.g-gap { margin-top: 18px; }
.grid-side.g-grid { grid-template-columns: minmax(0, 1fr) 400px; }
.g-link { border: 0; background: none; padding: 0; color: var(--accent); font-size: var(--fs-13); font-weight: 500; cursor: pointer; }
.g-link:hover { color: var(--accent-hover); text-decoration: underline; }
.g-link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.g-note { border-left-color: var(--accent); }
.g-gap-b { margin-bottom: 18px; }
.g-pad { padding: 16px; }
.g-row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }
.g-row-start { justify-content: flex-start; }
.g-in { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 8px; background: var(--surface); }
.g-crit td:first-child { width: 34%; }
.g-crit .num-in { width: 80px; }
.g-weight { display: flex; align-items: center; gap: 12px; }
.field .g-weight input { flex: 1; height: auto; padding: 0; border: 0; accent-color: var(--ink); }
.g-weight output { font-weight: 650; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.g-subbar { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; padding: 14px 20px; }
.g-subpick { display: grid; gap: 4px; min-width: 0; flex: 1 1 220px; }
.g-subpick select { width: 100%; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; background: var(--surface); max-width: 100%; }
.g-code-panel { padding: 0; overflow: hidden; }
.g-pad-h { padding: 16px 20px 0; }
.g-files { display: flex; gap: 2px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.g-file { border: 0; background: transparent; padding: 5px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-13); display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
.g-file.active { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.g-hint { margin-left: auto; padding-right: 6px; }
.g-scroll { overflow-x: auto; max-height: 72vh; overflow-y: auto; }
.g-lines { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: var(--fs-13); line-height: 1.65; font-variant-ligatures: none; font-feature-settings: 'liga' 0, 'calt' 0; }
.g-lines td { padding: 0; vertical-align: top; }
.g-ln { width: 1%; text-align: right; color: var(--muted); background: var(--surface-2); border-right: 1px solid var(--line-2); user-select: none; white-space: nowrap; }
.g-ln button, .g-ln span { display: block; width: 100%; border: 0; background: transparent; color: inherit; font: inherit; padding: 0 10px 0 16px; text-align: right; }
.g-ln button { cursor: pointer; }
.g-ln button:hover { color: var(--accent); background: var(--accent-soft); }
.g-src pre { margin: 0; padding: 0 16px; white-space: pre; font-family: inherit; font-size: inherit; line-height: inherit; color: var(--ink); }
.g-lines tr.has-c .g-src { background: var(--warn-soft); }
.g-lines tr.has-c .g-ln { color: var(--warn); font-weight: 600; }
.g-crow > td:last-child { padding: 6px 16px 10px; }
.g-comment { font-family: var(--font); font-size: var(--fs-13); line-height: 1.5; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 8px 12px; max-width: 640px; }
.g-comment-h { display: flex; gap: 10px; align-items: center; margin-bottom: 2px; }
.g-comment-h .btn { margin-left: auto; }
.g-comment-b { white-space: pre-wrap; overflow-wrap: anywhere; }
.g-compose textarea, .g-resolve textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; font: inherit; resize: vertical; background: var(--surface); }
.g-final { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 6px; flex-wrap: wrap; }
.g-final-v { font-size: var(--fs-28); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.g-final .small { max-width: 220px; text-align: right; }
.g-crit-row { display: grid; gap: 5px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.g-crit-row:first-of-type { border-top: 0; }
.g-crit-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.g-pts { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.g-pts strong { color: var(--ink); }
.g-pts input { width: 70px; height: 30px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 6px; text-align: right; color: var(--ink); background: var(--surface); }
.g-score .field { margin-top: 12px; }
.g-saved { margin: 10px 0 0; text-align: right; }
.g-req { padding: 10px 0; border-top: 1px solid var(--line-2); display: grid; gap: 6px; }
.g-req:first-of-type { border-top: 0; padding-top: 0; }
.g-req-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.g-quote { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-13); padding: 6px 10px; border-left: 3px solid var(--line); background: var(--surface-2); border-radius: var(--radius-xs); }
.g-np { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--muted); }
.g-answer { font-size: var(--fs-13); overflow-wrap: anywhere; }
.g-result { margin-top: 0; }
.g-overall { margin-top: 14px; }
.g-overall p { white-space: pre-wrap; margin: 4px 0 0; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .grid-side.g-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .g-subbar { padding: 12px 14px; gap: 12px; }
  .g-final .small { text-align: left; max-width: none; }
  .g-hint { display: none; }
  .g-scroll { max-height: none; }
}

/* ---------- visual system v0.6: theme switch, chips with icons, scores, highlighted code, density, motion, print ---------- */
html { scrollbar-color: var(--line-strong) transparent; }
::selection { background: var(--sel); }
body, .sidebar, .tb, .panel, .tile, .card, .acard, .lcard, .focus, .fcard, .view-card, .btn, .chip, .tab { transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
a.acard:hover, a.lcard:hover, .focus:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.acard, .lcard, .focus { transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.tab { border-radius: 2px 2px 0 0; }
.tab.active { font-weight: 600; }

/* theme switch: next to the language switch */
.tb-switches { display: flex; align-items: center; gap: 8px; }
.theme-switch { display: flex; background: var(--sunken); border-radius: var(--radius-full); padding: 2px; }
.theme-switch button { border: 0; background: none; width: 32px; height: 26px; display: grid; place-items: center; border-radius: var(--radius-full); color: var(--muted); cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button.active, .lang-switch button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.theme-switch .ic { width: 15px; height: 15px; }

/* status chips carry an icon: the meaning never depends on color alone */
.chip .ic { width: 12px; height: 12px; margin: 0 4px 0 -2px; stroke-width: 2.6; }
.chip .ic-dot { stroke-width: 0; }

/* scores: number + band dot (grade bands from DB.gradeScale) */
.score { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--band, var(--faint)); flex-shrink: 0; }
.score-top { --band: var(--band-top); } .score-hi { --band: var(--band-hi); } .score-mid { --band: var(--band-mid); } .score-lo { --band: var(--band-lo); }
.score-none::before { display: none; }
.grade6 { font-size: var(--fs-12); font-weight: 600; color: var(--muted); }
.result .grade6 { font-size: var(--fs-14); color: inherit; opacity: .85; }

/* tabs that fit long Bulgarian labels: horizontal scroll with faded edges */
.tabs.scrolls { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.tabs.scrolls.mid { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 36px), transparent); }
.tabs.scrolls.end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
html[lang="bg"] p, html[lang="bg"] .prose, html[lang="bg"] .empty p, html[lang="bg"] .field-hint { hyphens: auto; -webkit-hyphens: auto; }
.a-actions, .modal-actions, .ws-btns { flex-wrap: wrap; }
.btn { max-width: 100%; }

/* highlighted read-only code (App.highlightLines, same token colors as the editor) */
.g-lines.cm-s-default { color: var(--ink); }

/* density: staff tables are tighter; the gradebook keeps its header and first column in view */
.app[data-role="instructor"] .tbl td { padding: 8px 10px; }
.app[data-role="instructor"] .tbl { font-size: var(--fs-13); }
.gb-scroll { max-height: 70vh; overflow: auto; margin: 0 -20px -20px; border-top: 1px solid var(--line-2); }
.gb-scroll .tbl th { position: sticky; top: 0; background: var(--surface); z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }
.gb-scroll .tbl td:first-child, .gb-scroll .tbl th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: inset -1px 0 0 var(--line-2); }
.gb-scroll .tbl th:first-child { z-index: 3; }
.gb-scroll .tbl td, .gb-scroll .tbl th { padding-left: 16px; padding-right: 16px; }
.gb-scroll .tbl tbody tr:hover td { background: var(--surface-2); }

/* motion: purposeful and short */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes shimmer { to { background-position: -200% 0; } }
.page.enter { animation: rise .24s var(--ease) both; }
.modal { animation: pop .2s var(--ease) both; }
.tbl-tests.reveal tbody tr { animation: rise .32s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.g-loading { color: transparent !important; min-height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--sunken) 25%, var(--surface-2) 50%, var(--sunken) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.tbl-board td { transition: background-color 1.2s var(--ease); }
.tbl-board tr.moved td { background: var(--accent-soft); transition: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* print: feedback with comments, gradebook, assignment text, protocols */
.print-btn .ic { width: 16px; height: 16px; }
.g-head-r { display: flex; align-items: center; gap: 12px; }
@media print {
  @page { margin: 14mm 12mm; }
  body { background: #fff; font-size: 10.5pt; }
  .sidebar, .tb, .scrim, .toast, .modal-backdrop, .create-menu, .tabs, .a-actions, .modal-actions, .pills, .btn, .g-link, .g-hint, .no-print { display: none !important; }
  .app { display: block; }
  .page { max-width: none; padding: 0; }
  .page.enter, .tbl-tests.reveal tbody tr { animation: none; }
  .panel, .tile, .card, .acard, .lcard, .g-comment { box-shadow: none; break-inside: avoid; }
  .grid-main, .grid-side, .grid-side.g-grid { grid-template-columns: 1fr !important; }
  .g-scroll, .gb-scroll { max-height: none; overflow: visible; margin: 0; }
  .g-src pre { white-space: pre-wrap; }
  .g-lines tr { break-inside: avoid; }
  .gb-scroll .tbl th, .gb-scroll .tbl td:first-child { position: static; box-shadow: none; }
  a { color: inherit; }
}

/* responsive additions for the new parts */
@media (max-width: 720px) {
  .tb-switches { gap: 6px; }
  .theme-switch button { width: 28px; }
  .preview-chip { padding: 3px 8px; }
}
@media (max-width: 520px) {
  .tb { gap: 8px; padding: 0 10px; }
  .tb-search { padding: 0 12px; height: 40px; flex: 1 1 40px; }
  .tb-right { gap: 8px; }
  .lang-switch button { padding: 5px 8px; }
  .tb-search input::placeholder { color: transparent; }
  .preview-chip { display: none; }
}
