:root {
  --blue: #3b6ef6;
  --blue-dark: #2f5fe0;
  --ink: #1d2440;
  --muted: #7b849c;
  --line: #e4e8f2;
  --soft: #f5f7fb;
  --select: #eceefe;
  --select-ink: #3a4ec4;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --display: Poppins, "Source Sans 3", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink);
  background: var(--soft);
  font-family: var(--sans);
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--blue);
  color: white;
}
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 650; font-size: 20px; }
.logo img { height: 22px; width: auto; filter: brightness(10); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions button {
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  color: white;
  padding: 0 12px;
  font-weight: 600;
}
.avatar { width: 34px; border-radius: 999px; padding: 0; }
kbd { font-family: var(--sans); font-size: 12px; opacity: .8; margin-left: 6px; }
.shell-body { flex: 1; display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 0; }
.side { background: #f7f8fc; border-right: 1px solid var(--line); padding: 18px 12px; }
.side-label { margin: 0 8px 8px; color: var(--muted); font-size: 13px; }
.side a {
  display: block;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 4px;
  color: #4d5672;
  font-weight: 600;
}
.side a.on { background: var(--select); color: var(--select-ink); }
.side a.need { background: #fff4df; color: #8a5a00; }
.main { padding: 28px 32px 64px; min-width: 0; }
h1 { font-family: var(--display); font-size: 28px; margin: 0 0 16px; letter-spacing: -0.03em; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.tabs button, .btn, .btn-ghost {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
  height: 36px;
  padding: 0 14px;
  font-weight: 650;
  color: #3a4670;
}
.tabs button.on { background: var(--select); color: var(--select-ink); border-color: #d5dbff; }
.unit { margin: 22px 0 10px; font-size: 20px; font-weight: 700; }
.lesson {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: white;
  border: 1px solid #d9dfef;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-align: left;
}
.lesson:hover { border-color: #9aa8ee; }
.lesson strong { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.globe { width: 18px; height: 18px; color: #8b93ab; flex: none; }
.when { color: var(--muted); font-size: 14px; white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 8px 10px;
  font-weight: 400;
}
.btn { background: var(--blue); color: white; border-color: transparent; }
.btn:hover { background: var(--blue-dark); }
.panel { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.error { color: #c4375a; min-height: 1.2em; }
.login-stage { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: radial-gradient(900px 420px at 12% -10%, rgba(255,255,255,.16), transparent 50%), radial-gradient(700px 480px at 100% 110%, rgba(255,186,236,.22), transparent 46%), linear-gradient(155deg, #3d0d58 0%, #7a1fa3 46%, #c45ad4 100%); }
.login-panel { width: min(920px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; min-height: 520px; background: white; border-radius: 28px; overflow: hidden; box-shadow: 0 36px 90px rgba(28, 6, 48, .38); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 36px; color: white; background: radial-gradient(280px 180px at 18% 12%, rgba(255,255,255,.16), transparent 60%), linear-gradient(165deg, #4c1468, #7a1fa3 78%); overflow: hidden; }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border-radius: 999px; border: 28px solid rgba(255,255,255,.12); }
.login-brand::before { width: 220px; height: 220px; right: -70px; top: -50px; }
.login-brand::after { width: 320px; height: 320px; left: -90px; bottom: -120px; border-width: 46px; }
.login-badge { position: relative; z-index: 1; display: inline-flex; width: fit-content; background: white; border-radius: 16px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(40, 8, 60, .18); }
.login-badge img, .login-mark { height: 34px; width: auto; display: block; }
.login-brand strong { position: relative; z-index: 1; font-family: var(--display); font-size: 68px; letter-spacing: -0.045em; line-height: .9; }
.login-card { width: min(420px, calc(100% - 32px)); background: white; border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 12px; --blue: #9a2ec4; --blue-dark: #7a1fa3; }
.login-panel .login-card { width: auto; border: 0; border-radius: 0; padding: 40px 36px; justify-content: center; }
.login-card[hidden], .preview-gate[hidden] { display: none !important; }
.login-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #7a1fa3; }
.login-card h1 { margin: 0; color: #1d2440; font-size: 34px; }
.login-card .muted { margin: 0; line-height: 1.45; }
.login-card input { height: 46px; border-radius: 12px; border: 1px solid #eadff3; background: #fbf8fd; padding: 0 12px; }
.login-card input:focus { outline: 3px solid #edd7f8; border-color: #a030c8; background: white; }
.login-card .btn, .login-card .btn-ghost { width: 100%; height: 46px; border-radius: 12px; }
.login-card .btn { box-shadow: 0 8px 18px rgba(122, 31, 163, .22); }
.login-or { display: flex; align-items: center; gap: 10px; margin: 0; color: #9a90a8; font-size: 13px; font-weight: 650; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: #eadff3; }

.menu, .modal {
  position: fixed;
  z-index: 20;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(29, 36, 64, .16);
}
.menu { top: 62px; right: 12px; width: 240px; padding: 8px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink); border-radius: 8px; padding: 8px 10px; height: auto; }
.modal { top: 72px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.modal h2 { margin: 0; }
.modal input, .modal select { width: 100%; }
.github-callout { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #fff4df; border: 1px solid #f0d7a2; border-radius: 16px; padding: 16px 18px; }
.github-callout h2 { margin: 0 0 4px; font-size: 18px; }
.github-callout p { margin: 0; }
#save-state a { color: #9cdcfe; margin-left: 8px; text-decoration: underline; }
.hit { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 8px; }
.hit:hover, .hit.on { background: var(--select); }
.backdrop { position: fixed; inset: 0; z-index: 19; }

.ide { height: 100vh; display: flex; flex-direction: column; background: #1e1e1e; color: #d4d4d4; }
.ide-titlebar { height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: #3c3c3c; color: #fff; }
.ide-titlebar .logo { color: white; font-size: 14px; }
.ide-titlebar .title { font-size: 13px; opacity: .9; }
.ide-titlebar button { height: 26px; border-radius: 4px; border: 1px solid transparent; background: #0e639c; color: white; padding: 0 10px; font-weight: 650; }
.ide-titlebar #run { background: #007acc; }
.spacer { flex: 1; }
.ide-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 48px 280px minmax(0, 1fr) minmax(260px, 36%); }
.activity { background: #333333; display: flex; flex-direction: column; align-items: center; padding-top: 8px; }
.activity button { width: 48px; height: 48px; border: 0; border-left: 2px solid transparent; background: transparent; color: #858585; display: grid; place-items: center; }
.activity button svg { width: 24px; height: 24px; }
.activity button.on { color: white; border-left-color: #007acc; }
.explorer { background: #252526; color: #cccccc; min-width: 0; overflow: auto; border-right: 1px solid #1e1e1e; }
.explorer-head, .explorer-project { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #bbbbbb; }
.explorer-actions { display: flex; gap: 4px; text-transform: none; letter-spacing: 0; }
.explorer-actions button, .file-row button { border: 0; background: transparent; color: #cccccc; padding: 2px 4px; height: auto; font-size: 12px; }
.tree-row { display: flex; align-items: center; gap: 4px; height: 22px; padding-right: 8px; padding-left: calc(8px + var(--depth, 0) * 12px); cursor: pointer; color: #cccccc; }
.tree-row:hover { background: #2a2d2e; }
.tree-row.active { background: #37373d; color: white; }
.tree-row.drop { outline: 1px dashed #007acc; }
.tree-row .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row .ficon, .tab .ficon { width: 16px; height: 16px; flex: none; }
.twist, .tree-row .add { width: 16px; height: 16px; border: 0; background: transparent; color: #cccccc; padding: 0; display: grid; place-items: center; }
.tree-row .add { display: none; margin-left: auto; }
.tree-row:hover .add { display: grid; }
.twist-icon { width: 16px; height: 16px; }
.tree-row.open .twist-icon { transform: rotate(90deg); }
.tree-row .badge { margin-left: auto; font-size: 10px; color: #c5a35a; }
.tree-menu { position: fixed; z-index: 40; min-width: 168px; background: #252526; border: 1px solid #454545; box-shadow: 0 8px 24px rgba(0,0,0,.45); padding: 4px; }
.tree-menu button { display: block; width: 100%; text-align: left; height: 26px; border: 0; background: transparent; color: #cccccc; padding: 0 10px; }
.tree-menu button:hover { background: #094771; color: white; }
.folder.drop { outline: 1px dashed #007acc; }
.folder button, .inline-create button { border: 0; background: transparent; color: #cccccc; height: auto; }
.inline-create, .inline-name { display: flex; gap: 4px; margin: 4px 8px; }
.inline-create input, .inline-name, .side-panel input, .side-panel select { background: #3c3c3c; color: #fff; border: 1px solid #3c3c3c; border-radius: 3px; padding: 3px 6px; }
#view-files[hidden], #view-teach[hidden], #view-lead[hidden], .side-panel[hidden] { display: none !important; }
.side-panel { padding: 8px 10px; display: grid; gap: 8px; align-content: start; }
.control-card { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px; border: 1px solid #3c3c3c; border-radius: 6px; background: #1e1e1e; }
.control-card strong { display: block; color: white; font-size: 12px; }
.control-card p { margin: 3px 0 0; color: #9a9a9a; font-size: 11px; line-height: 1.35; }
.control-card input { margin-top: 2px; }
.teach-pick { display: grid; gap: 4px; }
.side-panel label { display: grid; gap: 4px; font-size: 12px; color: #cccccc; }
.side-panel button { height: 26px; border: 0; border-radius: 4px; background: #0e639c; color: white; }
.file-row i { font-style: normal; color: #858585; margin-left: 6px; font-size: 11px; }
.file-row { display: flex; align-items: center; gap: 2px; }
.file-row button[data-open] { flex: 1; text-align: left; padding: 3px 6px; }
.file-row.active, .file-row.active button { background: #37373d; color: white; }
.tree-empty { padding: 8px 12px; }
.preview-pane, .editor-pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: #1e1e1e; }
.editor-pane { border-right: 1px solid #252526; }
.tabs-files { display: flex; background: #2d2d2d; overflow: auto; min-height: 35px; }
.tabs-files .tab { display: flex; align-items: center; gap: 8px; border: 0; border-right: 1px solid #252526; background: #2d2d2d; color: #969696; padding: 8px 10px; height: 35px; }
.tabs-files .tab.active { background: #1e1e1e; color: white; }
.tabs-files i { font-style: normal; opacity: .7; }
.code-host { flex: 1; min-height: 0; position: relative; }
.welcome { position: absolute; inset: 0; display: grid; place-items: center; color: #858585; z-index: 2; pointer-events: none; }
.welcome[hidden] { display: none; }
.code-host .CodeMirror { height: 100%; font-family: var(--mono); font-size: 14px; line-height: 1.45; background: #1e1e1e; color: #d4d4d4; }
.ide .CodeMirror-gutters, .ide .CodeMirror-linenumber { background: #1e1e1e; color: #858585; border-color: #333; }
.ide .CodeMirror-cursor { border-left-color: #aeafad; }
.ide .CodeMirror-selected { background: #264f78; }
.ide .cm-s-default .cm-keyword, .ide .cm-s-default .cm-tag, .ide .cm-s-default .cm-builtin { color: #569cd6; }
.ide .cm-s-default .cm-string, .ide .cm-s-default .cm-string-2 { color: #ce9178; }
.ide .cm-s-default .cm-number, .ide .cm-s-default .cm-atom { color: #b5cea8; }
.ide .cm-s-default .cm-comment { color: #6a9955; }
.ide .cm-s-default .cm-def, .ide .cm-s-default .cm-variable-2, .ide .cm-s-default .cm-attribute { color: #9cdcfe; }
.fallback-editor { width: 100%; height: 100%; border: 0; resize: none; outline: none; padding: 12px; font-family: var(--mono); font-size: 14px; background: #1e1e1e; color: #d4d4d4; }
.pane-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: #252526; color: #cccccc; font-size: 12px; }
.terminal-pane .pane-bar button { height: 22px; border: 0; border-radius: 4px; background: #0e639c; color: white; padding: 0 8px; font-size: 12px; font-weight: 650; }
.terminal-pane #play, .ide-titlebar #run { background: #388a34; }
.term { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 12px; background: #1e1e1e; color: #cccccc; font-family: var(--mono); font-size: 13px; line-height: 1.45; }
#term-log { flex: 1; min-height: 0; overflow: auto; white-space: pre-wrap; }
.term-form { display: flex; align-items: center; gap: 0; margin-top: 4px; white-space: pre; }
.term-form .prompt, .term-line.cmd .prompt { color: #4ec9b0; }
.term-form .live { color: #d4d4d4; }
.term-form input { flex: 1; min-width: 2ch; border: 0; outline: none; background: transparent; color: inherit; font: inherit; padding: 0; }
.term-line.err { color: #f48771; }
.term-line.muted { color: #858585; }
#runner { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; }
.preview-page { min-height: 100vh; display: flex; flex-direction: column; background: #1e1e1e; color: #d4d4d4; }
.preview-bar { height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: #252526; }
.preview-page iframe { flex: 1; width: 100%; border: 0; background: white; }
.preview-gate { margin: 72px auto; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.statusbar { height: 22px; display: flex; align-items: center; gap: 12px; padding: 0 10px; background: #007acc; color: white; font-size: 12px; }
.banner { background: #063b5e; color: #d7ecff; padding: 6px 12px; font-size: 13px; }
.CodeMirror-hints { z-index: 40; background: #252526; border: 1px solid #454545; color: #d4d4d4; font-family: var(--mono); }
.CodeMirror-hint { color: #d4d4d4; }
.CodeMirror-hint-active { background: #094771; color: white; }
.drawer { position: fixed; top: 0; right: 0; width: min(420px, 100%); height: 100vh; background: white; border-left: 1px solid var(--line); z-index: 6; display: flex; flex-direction: column; padding: 16px; gap: 12px; }
.board-wrap { flex: 1; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
#board { width: 100%; height: 100%; touch-action: none; cursor: crosshair; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }

@media (max-width: 900px) {
  .shell-body, .ide-body { grid-template-columns: 1fr; }
  .side { display: flex; gap: 6px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-label { display: none; }
  .when { display: none; }
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: white; }
.card h3 { margin: 0 0 6px; }
.live-dot { color: #1aa37a; font-weight: 700; }
.diff { white-space: pre-wrap; background: #f7f8fc; border-radius: 10px; padding: 10px; overflow: auto; max-height: 280px; font-family: var(--mono); font-size: 12px; }
.menu-link { display: block; padding: 8px 10px; border-radius: 8px; font-weight: 650; }
.remote-caret { border-left: 2px solid var(--c, #3b6ef6); margin-left: -1px; position: relative; }
.remote-caret::after { content: attr(data-name); position: absolute; top: -16px; left: -1px; background: var(--c, #3b6ef6); color: white; font-size: 10px; padding: 1px 4px; border-radius: 4px; white-space: nowrap; }
.remote-sel { border-radius: 2px; }
.board-app { position: fixed; inset: 0; z-index: 30; background: #f5f7fb; display: flex; flex-direction: column; }
.board-app header, .board-app .tools button, .film button { font-weight: 700; }
.board-app header { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #3b6ef6; color: white; }
.board-app header button, .tools button, .film button { border: 1px solid #d9dfef; background: white; color: #1d2440; border-radius: 8px; padding: 6px 10px; }
.board-app header button { background: rgba(255,255,255,.16); color: white; border-color: rgba(255,255,255,.35); }
.board-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 148px 1fr; }
.tools { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.tools button.on, .film button.on { background: #eceefe; color: #3a4ec4; }
.swatches, .sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button { width: 22px; height: 22px; border-radius: 999px; padding: 0; border: 2px solid white; box-shadow: 0 0 0 1px #d9dfef; }
.stage { position: relative; min-width: 0; min-height: 0; }
.board-surface { position: absolute; inset: 12px; }
.stage canvas { width: 100%; height: 100%; background: white; border-radius: 12px; border: 1px solid #d9dfef; touch-action: none; cursor: crosshair; }
.stage canvas.selecting { cursor: default; }
#objects { position: absolute; inset: 0; pointer-events: none; }
.board-text, .board-image { position: absolute; display: flex; align-items: flex-start; gap: 4px; min-width: 80px; pointer-events: auto; }
.board-copy { flex: 1; min-height: 28px; padding: 4px 6px; white-space: pre-wrap; user-select: text; -webkit-user-select: text; cursor: text; outline: 1px dashed transparent; }
.board-copy:focus { outline-color: #3b6ef6; background: rgba(255,255,255,.72); }
.board-image { height: 24%; }
.board-image img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.mover, .obj-x { user-select: none; cursor: grab; opacity: 0; border: 0; background: white; color: #1d2440; border-radius: 4px; height: 18px; }
.board-text:hover .mover, .board-text:hover .obj-x, .board-image:hover .mover, .board-image:hover .obj-x, .board-text:focus-within .mover { opacity: 1; }
.board-text.locked .mover, .board-text.locked .obj-x, .board-image.locked .mover, .board-image.locked .obj-x { display: none; }
.film { display: flex; gap: 8px; overflow: auto; padding: 8px 12px 12px; }
.spacer { flex: 1; }
.portal { display: flex; flex-direction: column; gap: 16px; }
.page-head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat, .panel { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 28px; margin-top: 4px; }
.split { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.search { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: white; }
.card.link { text-align: left; cursor: pointer; }
.avatar { width: 36px; height: 36px; border-radius: 999px; display: inline-grid; place-items: center; background: #eceefe; color: #3a4ec4; font-weight: 700; }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #f3f5fb; border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.chip.live, .chip.mastered { background: #e5f7ef; color: #137a52; }
.chip.practiced { background: #fff4df; color: #8a5a00; }
.chip.linked { background: #e8f1fb; color: #0e639c; }
.chip.none { background: #f3f5fb; color: #5c678a; }
.pathway-search { width: min(320px, 100%); margin: 8px 0; }
.mod-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.unit-block { margin: 6px 0; }
.check { display: inline-flex; align-items: center; gap: 6px; }
.teach-guide { position: fixed; top: 48px; right: 16px; z-index: 50; width: 380px; height: 540px; min-width: 280px; min-height: 220px; resize: both; overflow: auto; background: #252526; color: #d4d4d4; border: 1px solid #454545; border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.45); display: flex; flex-direction: column; }
.teach-guide header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #3c3c3c; cursor: move; position: sticky; top: 0; }
.teach-guide header button, .teach-guide .guide-tools button { height: 26px; border: 0; border-radius: 4px; background: #0e639c; color: white; padding: 0 8px; }
.teach-guide .guide-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.teach-guide select, .teach-guide input { background: #1e1e1e; color: #d4d4d4; border: 1px solid #454545; border-radius: 4px; padding: 4px 6px; }
.teach-guide pre { margin: 0; white-space: pre-wrap; background: #1e1e1e; border: 1px solid #454545; padding: 8px; font-family: var(--mono); font-size: 12px; }
.teach-guide .guide-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.teach-guide p { margin: 0; }
.profile { background: white; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.cover { height: 88px; background: linear-gradient(120deg, #3b6ef6, #7a4de0); }
.profile-row { display: flex; gap: 16px; align-items: flex-start; padding: 0 18px 18px; }
.profile-row .avatar.lg { margin-top: -32px; border: 3px solid white; box-shadow: 0 0 0 1px var(--line); background: white; flex: none; }
.profile-row > div { padding-top: 14px; min-width: 0; }
.profile-tabs { position: sticky; top: 0; z-index: 4; display: flex; gap: 8px; padding: 10px 0; background: var(--soft); }
.profile-tabs button { border: 1px solid var(--line); background: white; border-radius: 999px; height: 34px; padding: 0 14px; font-weight: 700; color: #3a4670; }
.profile-tabs button.on { background: var(--select); color: var(--select-ink); border-color: #d5dbff; }
.profile-tabs span { opacity: .7; margin-left: 4px; }
.lib-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.lib-row h3 { margin: 0; font-size: 16px; }
.lib-row p { margin: 2px 0 0; }
.report-row summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.report-row summary span:last-child { color: var(--muted); }
.course-tabs { margin-top: 8px; }
.profile-row h1 { margin: 0; color: var(--ink, #1d2440); }
.profile-row .muted { color: var(--muted); }
.btn-ghost.danger { color: #b42318; border-color: #f3c1bc; }
.chip-x { border: 0; background: transparent; color: #5c678a; margin-left: 6px; padding: 0; cursor: pointer; font-size: 14px; line-height: 1; }
.member-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.member-card > .card { width: 100%; }
.typeahead { position: relative; display: block; width: 100%; }
.suggest { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(29,36,64,.08); padding: 6px; }
.suggest button { display: flex; width: 100%; justify-content: space-between; border: 0; background: transparent; padding: 8px; border-radius: 8px; text-align: left; }
.suggest button span { color: var(--muted); }
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.setup { margin: 0 0 12px; padding-left: 18px; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 900px) { .split, .pair-grid, .admin-layout, .form-row { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .login-panel { grid-template-columns: 1fr; min-height: 0; }
  .login-brand { min-height: 168px; padding: 24px; }
  .login-brand strong { font-size: 42px; }
  .login-panel .login-card { padding: 28px 22px 24px; }
}

.shell { --blue: #9a2ec4; --blue-dark: #7a1fa3; --select: #f4e8fb; --select-ink: #6d1b96; --soft: #f6f3fa; --line: #eadff2; background: var(--soft); }
.shell .topbar { background: linear-gradient(90deg, #5b157c 0%, #8d28b4 58%, #a030c8 100%); }
.shell .top-actions button { border-radius: 999px; border-color: transparent; background: rgba(255,255,255,.14); }
.shell .top-actions button:hover { background: rgba(255,255,255,.24); }
.shell .top-actions .avatar { width: 34px; height: 34px; background: rgba(255,255,255,.2); color: white; }
.shell .shell-body { grid-template-columns: 228px minmax(0, 1fr); }
.shell .side { background: #fbf8fd; padding: 18px 12px 32px; }
.shell .side-group + .side-group { margin-top: 18px; }
.shell .side-label { margin: 0 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.shell .side a:hover { background: #f3eaf8; color: var(--select-ink); }
.shell .side a.on, .shell .side a.on:hover { background: var(--select); color: var(--select-ink); }
.shell .page-head a { color: var(--select-ink); font-weight: 700; }
.shell .main { padding: 32px 36px 80px; }
.shell .portal { max-width: 1040px; gap: 20px; }
.shell .btn, .shell .btn-ghost, .shell .tabs button, .shell .profile-tabs button { border-radius: 12px; }
.shell .btn { box-shadow: 0 1px 0 rgba(255,255,255,.25) inset; }
.shell .btn:hover { background: var(--blue-dark); }
.shell .btn-ghost:hover { background: var(--select); border-color: #e7d4f3; color: var(--select-ink); }
.shell .btn-ghost.danger:hover { background: #fdecec; color: #b42318; border-color: #f3c1bc; }
.shell .panel, .shell .stat, .shell .card, .shell .lib-row { box-shadow: 0 1px 2px rgba(76, 20, 104, .04); }
.shell .panel h2 { margin: 0 0 12px; font-size: 18px; }
.shell .stat { position: relative; overflow: hidden; }
.shell .stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.shell .stat strong { color: #4c1468; }
.shell .cover { background: linear-gradient(120deg, #6b1d96, #c45ad4); }
.goto { display: flex; flex-direction: column; gap: 10px; }
.shortcut-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; }
.jump { display: flex; flex-direction: column; gap: 3px; min-height: 76px; padding: 12px 14px; border-radius: 14px; background: white; border: 1px solid var(--line); }
.jump:hover { border-color: #d7b3ea; background: #fbf7fd; }
.jump strong { font-size: 15px; }
.jump span { color: var(--muted); font-size: 13px; line-height: 1.35; font-weight: 500; }
.admin-layout { display: grid; grid-template-columns: 1.35fr .8fr; gap: 16px; align-items: start; }
.form-card { display: flex; flex-direction: column; gap: 10px; }
.form-card .btn, .form-card input, .form-card select { width: 100%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.form-row .btn { width: auto; }
.table-card { padding: 6px 12px; }
.table-card table { margin: 0; }
.spread { justify-content: space-between; align-items: center; }
.spread .unit { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-open { display: block; width: 100%; border: 0; background: transparent; text-align: left; padding: 0; }
.chapter-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.chip.linked { background: #f4e8fb; color: #6d1b96; }
@media (max-width: 900px) {
  .shell .shell-body { grid-template-columns: 1fr; }
  .shell .side { display: flex; gap: 14px; overflow: auto; padding: 10px; }
  .shell .side-group { display: flex; gap: 6px; margin: 0; }
  .shell .side-group + .side-group { margin: 0; }
  .shell .side-label { display: none; }
  .shell .side a { white-space: nowrap; }
}
