/* Teaching Mate - app chrome, quizzes and editor. Page content styles are in content.css. */

/* Nunito (SIL Open Font License), bundled so the Android app looks the same offline. */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/nunito-latin.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: 'Nunito';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Windows has no flag emoji: this font draws only the flags (unicode-range), everything else falls through. */
@font-face {
  font-family: 'Twemoji Country Flags';
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  src: url('https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1.8/dist/TwemojiCountryFlags.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f0f1f9;
  --text: #1f2135;
  --muted: #6b6f88;
  --line: #e1e3ef;
  --primary: #6c5ce7;
  --primary-2: #5847d8;
  --primary-soft: #ecebff;
  --on-primary: #ffffff;
  --accent: #ff8a3d;
  --target: #c2410c;
  --good: #16935f;
  --good-soft: #e2f6ec;
  --bad: #d93d42;
  --bad-soft: #fde9e9;
  --warn: #b7791f;
  --warn-soft: #fff5d9;
  --info: #2f6fd1;
  --info-soft: #e7f0ff;
  --star: #f5b301;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(25, 25, 60, .06), 0 6px 20px rgba(25, 25, 60, .06);
  --shadow-lift: 0 2px 4px rgba(25, 25, 60, .08), 0 12px 28px rgba(25, 25, 60, .12);
  --font: 'Twemoji Country Flags', 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
  --top: 60px;
  --side: 292px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151f;
    --surface: #1d1f2d;
    --surface-2: #262838;
    --text: #e9eaf4;
    --muted: #9a9db5;
    --line: #33364a;
    --primary: #8b7ff0;
    --primary-2: #a197f5;
    --primary-soft: #2c2a4d;
    --target: #ffa36b;
    --good: #3ccf8e;
    --good-soft: #193a2c;
    --bad: #ff6b70;
    --bad-soft: #43202399;
    --warn: #f0c050;
    --warn-soft: #3a3118;
    --info: #78a8ff;
    --info-soft: #1d2b46;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 12px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
}
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, kbd { font-family: var(--mono); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* --- buttons ------------------------------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none;
  cursor: pointer; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { color: var(--bad); }
.btn.primary.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.tiny { padding: 3px 9px; font-size: .82rem; font-weight: 600; }
.btn.on { background: var(--primary-soft); border-color: var(--primary); }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 1.15rem;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.on { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

/* --- top bar & layout ---------------------------------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.brand .logo { font-size: 1.5rem; }
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
}
.search input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 6px;
}
.sr { display: grid; grid-template-columns: 28px auto 1fr; gap: 8px; align-items: baseline; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.sr:hover, .sr:focus { background: var(--surface-2); }
.sr small { color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-empty { padding: 10px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 4px; }
.edit-btn.on { background: var(--warn-soft); border-color: var(--warn); }

.layout { display: grid; grid-template-columns: var(--side) 1fr; min-height: calc(100vh - var(--top)); }
.sidebar {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow: auto;
  border-right: 1px solid var(--line); background: var(--surface); padding: 12px 8px 40px;
}
.scrim { display: none; }
main { min-width: 0; padding: 26px 28px 80px; }
.page-wrap { max-width: 900px; margin: 0 auto; }
.page-wrap.narrow { max-width: 780px; }
.loading { color: var(--muted); padding: 30px; text-align: center; }

@media (max-width: 880px) {
  .menu-btn { display: inline-grid; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: var(--top); width: min(86vw, 320px);
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lift);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; z-index: 35; background: rgba(0, 0, 0, .3); }
  main { padding: 18px 14px 70px; }
  .brand #brandTitle { display: none; }
}

/* --- tree ---------------------------------------------------------------------------------------------------- */

.tree { list-style: none; margin: 0; padding: 0; }
.tree .tree { padding-left: 16px; }
.node .row { display: flex; align-items: center; }
.twisty {
  width: 22px; height: 22px; flex: none; border: 0; background: none; cursor: pointer; color: var(--muted);
  border-radius: 6px; font-size: 1rem; line-height: 1; transition: transform .15s;
}
.twisty:hover { background: var(--surface-2); }
.node.open > .row > .twisty { transform: rotate(90deg); }
.twisty.none { cursor: default; }
.node .row a {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px;
  color: var(--text); text-decoration: none; font-weight: 600;
}
.node .row a:hover { background: var(--surface-2); }
.node.active > .row a { background: var(--primary-soft); color: var(--primary-2); }
.node .ico { width: 22px; text-align: center; flex: none; }
.node .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .status { font-size: .8rem; flex: none; }
.node .status.done { color: var(--star); }
.node .status.started { color: var(--primary); }
.tree-edit { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 8px; border-top: 1px dashed var(--line); margin-top: 12px; }

/* --- home & topic views -------------------------------------------------------------------------------------- */

.hero {
  display: flex; align-items: center; gap: 20px; padding: 28px 32px; border-radius: 22px; margin-bottom: 26px;
  background: linear-gradient(135deg, var(--primary) 0%, #8e7cf3 55%, #ff9a5a 130%); color: #fff;
  box-shadow: var(--shadow-lift);
}
.hero h1 { margin: 0 0 6px; font-size: 2.2rem; }
.hero p { margin: 0 0 16px; max-width: 560px; opacity: .95; }
.hero .btn.primary { background: #fff; color: var(--primary-2); border-color: #fff; }
.hero-art { font-size: 5.5rem; margin-left: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .2)); }
@media (max-width: 600px) { .hero-art { display: none; } .hero { padding: 22px; } }

.section-title { font-size: 1.25rem; margin: 30px 0 12px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.topic-card {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  border: 1px solid transparent; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--primary-soft); }
.tc-icon { font-size: 2rem; line-height: 1; }
.tc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tc-body small { color: var(--muted); }
.tc-progress { display: block; height: 6px; border-radius: 6px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.tc-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--good), #6ad6a5); border-radius: inherit; }
.tc-done { position: absolute; top: 10px; right: 12px; color: var(--star); }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; margin-bottom: 10px; }
.crumbs a { text-decoration: none; }
.crumbs .sep { color: var(--muted); }
.topic-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.th-icon { font-size: 3rem; line-height: 1; }
.topic-head h1 { margin: 0; font-size: 2rem; line-height: 1.15; }
.topic-head p { margin: 4px 0 0; }

.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-bottom: 10px; }
.quiz-card {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  border: 1px solid var(--line); transition: transform .12s, box-shadow .12s, border-color .12s;
}
.quiz-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--primary); }
.quiz-card.broken { border-color: var(--bad); }
.qc-icon { font-size: 1.9rem; }
.qc-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.qc-body small { color: var(--muted); }
.qc-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .82rem; margin-top: 3px; }
.qc-go { font-weight: 800; color: var(--primary); white-space: nowrap; }
.qc-edit { position: absolute; top: -8px; right: -8px; }
.badge { padding: 1px 8px; border-radius: 999px; font-weight: 700; background: var(--primary-soft); color: var(--primary-2); }
.badge.test { background: var(--warn-soft); color: var(--warn); }
.badge.flashcards { background: var(--good-soft); color: var(--good); }
.best { color: var(--muted); }
.best.passed { color: var(--good); font-weight: 700; }
.review-btn { margin-top: 14px; }
.prevnext { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); }
.pn { display: flex; flex-direction: column; padding: 10px 16px; border-radius: 12px; text-decoration: none; color: var(--text); background: var(--surface); box-shadow: var(--shadow); max-width: 48%; }
.pn small { color: var(--muted); }
.pn.next { text-align: right; margin-left: auto; }
.pn:hover { box-shadow: var(--shadow-lift); }

/* --- modal, toast, confetti ---------------------------------------------------------------------------------- */

.overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(15, 16, 30, .45); animation: fade .15s ease;
}
.modal {
  width: min(480px, 100%); max-height: 90vh; overflow: auto; padding: 22px 24px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow-lift); animation: pop .18s ease;
}
.modal.wide { width: min(760px, 100%); }
.modal h2 { margin: 0 0 12px; font-size: 1.3rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.form-grid { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field > span { font-weight: 700; font-size: .9rem; }
.field input, .field select, .field textarea, .deck-meta input {
  width: 100%; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.check { display: flex; align-items: center; gap: 6px; cursor: pointer; flex-wrap: wrap; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

#toastRoot { position: fixed; z-index: 200; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 700;
  box-shadow: var(--shadow-lift); animation: pop .2s ease; transition: opacity .4s, transform .4s; max-width: 90vw;
}
.toast.good { background: var(--good); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(10px); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes enter { from { transform: translateY(10px); opacity: 0; } }

/* --- quiz ---------------------------------------------------------------------------------------------------- */

.quiz-shell { display: grid; gap: 16px; }
.qhead { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; }
.qtitle { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.qtitle span { color: var(--muted); font-weight: 700; font-size: .9rem; }
.qclock.low { color: var(--bad); }
.qbar { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.qbar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #a08ff7); transition: width .35s ease; }
.qcard {
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 26px 28px; border: 2px solid transparent;
  transition: border-color .2s;
}
.qcard.enter { animation: enter .25s ease; }
.qcard.right { border-color: var(--good); }
.qcard.wrong { border-color: var(--bad); }
.qcard.partly { border-color: var(--warn); }
.qask { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; margin-bottom: 8px; }
.qprompt { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 1.45rem; font-weight: 700; margin-bottom: 20px; line-height: 1.35; }
.qprompt:empty { display: none; }
.qprompt .t { color: var(--target); }
.qprompt .eq { color: var(--muted); margin: 0 4px; }
.q-emoji { font-size: 2.6rem; line-height: 1; }
.qimg { max-height: 160px; max-width: 100%; border-radius: 12px; }
.qsay {
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.3rem;
  background: var(--primary-soft); transition: transform .1s, background .15s; flex: none;
}
.qsay:hover { transform: scale(1.06); }
.qsay.big { width: 84px; height: 84px; font-size: 2.2rem; }
.qsay.playing { background: var(--primary); animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--primary) 20%, transparent); } }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts.long { grid-template-columns: 1fr; }
@media (max-width: 560px) { .opts { grid-template-columns: 1fr; } }
.opt {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 13px 16px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.08rem; font-weight: 700;
  transition: border-color .12s, background .12s, transform .08s;
}
.opt:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt kbd { font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.opt.selected { border-color: var(--primary); background: var(--primary-soft); }
.opt.correct { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt:disabled { cursor: default; }
.opt.tf { justify-content: center; font-size: 1.2rem; padding: 18px; }
.opt.shake, .shake { animation: shake .4s ease; border-color: var(--bad); }

.input-wrap { display: grid; gap: 8px; }
.answer {
  width: 100%; padding: 14px 18px; font-size: 1.3rem; font-weight: 700; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface-2);
}
.answer:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.answer.correct { border-color: var(--good); background: var(--good-soft); }
.answer.wrong { border-color: var(--bad); background: var(--bad-soft); }
.accent-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.key { min-width: 36px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; }
.key:hover { border-color: var(--primary); }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mcol { display: grid; gap: 8px; align-content: start; }
.match .opt { justify-content: center; text-align: center; }
.match .opt.picked { border-color: var(--primary); background: var(--primary-soft); }
.match .opt.matched { border-color: var(--good); background: var(--good-soft); opacity: .65; }

.order-answer {
  min-height: 62px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-radius: 14px;
  border: 2px dashed var(--line); margin-bottom: 14px;
}
.order-answer.correct { border: 2px solid var(--good); background: var(--good-soft); }
.order-answer.wrong { border: 2px solid var(--bad); background: var(--bad-soft); }
.order-answer .ph { padding: 0 6px; }
.order-bank { display: flex; flex-wrap: wrap; gap: 8px; }
.tok {
  padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer;
  font-size: 1.1rem; font-weight: 700; box-shadow: 0 2px 0 var(--line); transition: transform .08s;
}
.tok:hover { border-color: var(--primary); }
.tok:active { transform: translateY(2px); box-shadow: none; }
.tok.ghost { visibility: hidden; }

.fill-text { font-size: 1.35rem; font-weight: 700; line-height: 2.3; margin-bottom: 12px; }
.blank {
  font: inherit; color: var(--target); padding: 0 6px; margin: 0 3px; border: 0; border-bottom: 3px solid var(--primary);
  background: var(--primary-soft); border-radius: 6px 6px 0 0; text-align: center; max-width: 100%;
}
.blank:focus { outline: none; background: var(--surface-2); }
.blank.correct { border-color: var(--good); background: var(--good-soft); }
.blank.wrong { border-color: var(--bad); background: var(--bad-soft); text-decoration: line-through; }
.fix { color: var(--good); font-size: 1rem; margin-right: 6px; }

.qfeedback:empty { display: none; }
.qfeedback { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); display: grid; gap: 4px; }
.right .qfeedback { background: var(--good-soft); }
.wrong .qfeedback { background: var(--bad-soft); }
.partly .qfeedback { background: var(--warn-soft); }
.fb-head { font-weight: 800; font-size: 1.1rem; }
.fb-answer b, .fb-note b { color: var(--target); }
.fb-explain { color: var(--muted); }
.qfoot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 18px; }
.qfoot .hint { margin-right: auto; font-size: .85rem; }

.results { text-align: center; }
.res-stars { font-size: 3rem; letter-spacing: 6px; color: var(--line); }
.res-stars .on { color: var(--star); text-shadow: 0 2px 8px rgba(245, 179, 1, .4); }
.res-score { font-size: 3.4rem; font-weight: 800; line-height: 1.1; }
.passed .res-score { color: var(--good); }
.res-msg { font-size: 1.2rem; font-weight: 700; margin-top: 6px; }
.res-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 22px 0 6px; }
.review { text-align: left; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 10px; }
.review h3 { margin: 6px 0 10px; }
.review-row { display: flex; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.rr-mark { font-weight: 800; width: 20px; flex: none; }
.review-row.ok .rr-mark { color: var(--good); }
.review-row.bad .rr-mark { color: var(--bad); }
.review-row.part .rr-mark { color: var(--warn); }
.rr-a { font-size: .92rem; color: var(--muted); }
.rr-a .given { text-decoration: line-through; }
.rr-a b { color: var(--target); }

/* --- flashcards ---------------------------------------------------------------------------------------------- */

.fc-wrap { display: grid; gap: 16px; justify-items: center; }
.fc-card {
  position: relative; width: min(520px, 100%); height: 300px; cursor: pointer; perspective: 1200px; outline: none;
}
.fc-face {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; border-radius: 22px; text-align: center;
  background: var(--surface); box-shadow: var(--shadow-lift); backface-visibility: hidden; transition: transform .45s ease;
}
.fc-face.back { transform: rotateY(180deg); background: linear-gradient(160deg, var(--surface), var(--primary-soft)); }
.fc-card.flipped .front { transform: rotateY(-180deg); }
.fc-card.flipped .back { transform: rotateY(0); }
.fc-card:focus-visible .fc-face { box-shadow: 0 0 0 3px var(--primary), var(--shadow-lift); }
.fc-side { display: grid; gap: 10px; justify-items: center; }
.fc-media { font-size: 4rem; line-height: 1; }
.fc-media.img { max-height: 120px; }
.fc-word { font-size: 2.2rem; font-weight: 800; }
.fc-word.t { color: var(--target); }
.fc-example { display: grid; gap: 2px; font-size: 1.05rem; }
.fc-example small { color: var(--muted); }
.fc-hint { position: absolute; bottom: 12px; font-size: .8rem; color: var(--muted); }
.fc-actions { display: flex; gap: 10px; }
.fc-actions .btn { padding: 12px 22px; font-size: 1.05rem; }
.hint { font-size: .85rem; }

/* --- editor -------------------------------------------------------------------------------------------------- */

main.focus .page-wrap:not(.narrow) { max-width: none; }
.editing .page-wrap { position: relative; }
.edit-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; margin-bottom: 18px;
  border-radius: 12px; background: var(--warn-soft); border: 1px dashed var(--warn);
}
.edit-toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.edit-bar { margin: 16px 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.edit-link { display: inline-block; margin-bottom: 6px; font-size: .85rem; font-weight: 700; text-decoration: none; padding: 2px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }

.editor { display: grid; gap: 12px; height: calc(100vh - var(--top) - 52px); grid-template-rows: auto 1fr; }
.ed-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ed-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 1.15rem; }
.ed-title code { font-size: .8rem; color: var(--muted); }
.ed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ed-status { font-size: .85rem; color: var(--good); margin-right: 6px; }
.ed-status.dirty { color: var(--warn); font-weight: 700; }
.ed-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; min-height: 0; }
.ed-pane { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.ed-pane.side { overflow: auto; }
.preview-pane { overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 4px 22px 22px; }
.pane-label { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 8px 0; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
textarea.code {
  flex: 1; min-height: 300px; width: 100%; resize: none; padding: 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font: 13.5px/1.55 var(--mono); tab-size: 2; white-space: pre; overflow: auto;
}
textarea.code:focus { outline: none; border-color: var(--primary); }
.snippets { display: flex; flex-wrap: wrap; gap: 5px; }
.tabbed { display: flex; flex-direction: column; height: 100%; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tab { border: 0; background: none; padding: 8px 14px; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; color: var(--muted); }
.tab.on { color: var(--primary); border-color: var(--primary); }
.tab-body { overflow: auto; }
.check-list { display: grid; gap: 6px; }
.chk { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: .92rem; }
.chk.ok { background: var(--good-soft); }
.chk.bad { background: var(--bad-soft); }
.chk.warn { background: var(--warn-soft); }
.insert-pane h4 { margin: 14px 0 6px; }
.insert-pane pre { background: var(--surface-2); padding: 10px; border-radius: 10px; white-space: pre-wrap; }
.try-box .quiz-shell { gap: 10px; }
.try-box .qcard { padding: 18px; }
@media (max-width: 980px) {
  .editor { height: auto; }
  .ed-split { grid-template-columns: 1fr; }
  textarea.code { min-height: 50vh; }
}

.deck-editor { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.deck-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.inline input { width: auto; }
.deck-edit { overflow: auto; flex: 1; }
.deck-edit table.vocab td { padding: 3px 4px; }
.deck-edit input { width: 100%; min-width: 60px; padding: 5px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; }
.deck-edit input:hover { border-color: var(--line); }
.deck-edit input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.row-actions { white-space: nowrap; }
.row-actions .btn { padding: 2px 7px; }
.deck-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.deck-tools select { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }

.files-section .file-list { display: grid; gap: 4px; }
.file-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.file-row:hover { outline: 2px solid var(--primary-soft); }
.file-row .unused { color: var(--warn); }
.files-section .btn { margin-bottom: 10px; }

/* --- account ------------------------------------------------------------------------------------------------- */

.user-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 6px; margin-left: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 700;
}
.user-btn:hover { border-color: var(--primary); }
.ub-avatar { font-size: 1.35rem; line-height: 1; }
.ub-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .ub-name, .admin-btn { display: none; } .user-btn { padding: 0 6px; } }

body.signed-out .topbar, body.signed-out .sidebar { display: none; }
body.signed-out .layout { grid-template-columns: 1fr; }
body.signed-out main { padding: 0; }
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 26px; padding: 24px 16px;
  background: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 55%),
    radial-gradient(circle at 90% 90%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 50%), var(--bg);
}
.login-card { width: min(420px, 100%); background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lift); padding: 28px 26px; display: grid; gap: 14px; }
.login-logo { font-size: 3.4rem; text-align: center; line-height: 1; }
.login-card h1 { margin: 0; text-align: center; font-size: 1.6rem; }
.login-form { display: grid; gap: 12px; }
.login-form input { font-size: 1.1rem; }
.btn.big { padding: 12px 18px; font-size: 1.08rem; }
.login-error { color: var(--bad); font-weight: 700; min-height: 1.2em; font-size: .95rem; }
.login-error:empty { display: none; }
.login-links { display: grid; gap: 6px; justify-items: center; }
.link-btn { border: 0; background: none; color: var(--primary); font-weight: 700; cursor: pointer; padding: 4px; }
.who p { margin: 0 0 8px; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.who-item { position: relative; }
.who-btn {
  width: 100%; display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 700;
}
.who-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.who-avatar { font-size: 2.2rem; line-height: 1; }
.who-forget { position: absolute; top: 4px; right: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .8rem; }
.avatar-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-opt { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.4rem; }
.avatar-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.user-menu { display: grid; gap: 10px; }
.um-head { display: flex; align-items: center; gap: 12px; }
.um-avatar { font-size: 2.6rem; }
.modal-actions { flex-wrap: wrap; }
.row-input { display: flex; gap: 6px; }
.row-input input { flex: 1; }
.credentials { display: grid; gap: 6px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); font-size: 1.1rem; }

/* --- admin console ------------------------------------------------------------------------------------------- */

.admin-nav { display: grid; gap: 2px; padding: 4px; }
.an-title { font-weight: 800; padding: 8px 10px 12px; }
.an-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.an-link:hover { background: var(--surface-2); }
.an-link.active { background: var(--primary-soft); color: var(--primary-2); }
.an-link .ico { width: 22px; text-align: center; }
.an-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.an-hint { padding: 0 10px; }

.page-wrap.admin { max-width: 1100px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 6px 0 8px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 700; }
.stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.25; }
.stat-sub { color: var(--muted); font-size: .8rem; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.admin-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); padding: 10px 12px; white-space: nowrap; }
.admin-table td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table tr.click { cursor: pointer; }
.admin-table tr.click:hover td { background: color-mix(in srgb, var(--primary-soft) 45%, transparent); }
.admin-table tr.disabled td { opacity: .55; }
.nowrap { white-space: nowrap; }
.who-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
a.who-link:hover { color: var(--primary); }
.av { font-size: 1.4rem; line-height: 1; }
.qicon { font-size: 1rem; }
.score { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.meter { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: var(--primary-soft); overflow: hidden; vertical-align: middle; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.meter.wide { width: 100%; height: 10px; }
.usage { margin: 4px 0 14px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.bad-text { color: var(--bad); }
.quiz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qchip { font-size: .85rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); }
.qchip.passed { background: var(--good-soft); border-color: transparent; }
.qchip.tried { background: var(--surface-2); }
.admin-table.topics td:first-child { white-space: nowrap; }
.attempts { display: grid; gap: 6px; }
.att { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.att > .att-head, .att > summary { padding: 10px 14px; }
.att summary { cursor: pointer; list-style: none; }
.att summary::-webkit-details-marker { display: none; }
.att summary .att-head::before { content: '▸'; color: var(--muted); margin-right: 2px; }
.att[open] summary .att-head::before { content: '▾'; }
.att-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.att-when { min-width: 90px; color: var(--muted); }
.att-quiz { font-weight: 700; flex: 1; min-width: 180px; }
.att .chips { padding: 0 14px 12px; }
.admin-table.mistakes { border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; overflow: hidden; }
.admin-table.mistakes .given { text-decoration: line-through; color: var(--muted); }
.admin-table.mistakes b { color: var(--target); }
.app-card-body { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.app-card-body p { margin: 0 0 8px; }
.qr { background: #fff; padding: 8px; border-radius: 10px; line-height: 0; }
.page-wrap.admin .card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin: 12px 0; }
.page-wrap.admin .card h3 { margin: 0 0 8px; }

/* search results across the whole width on phones */
@media (max-width: 700px) {
  .search-results { position: fixed; top: calc(var(--top) + 4px); left: 8px; right: 8px; }
}

/* --- Google sign-in ------------------------------------------------------------------------------------------ */

.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.google-box { display: flex; justify-content: center; min-height: 44px; }
/* Google's button is an iframe with a light colour scheme; matching it keeps Chrome from painting it an opaque white box in dark mode */
.google-box, .google-box iframe { color-scheme: light; }
.google-box > div { max-width: 100%; }
.btn.google-native { width: 100%; background: #fff; color: #1f1f1f; border-color: #dadce0; gap: 10px; }
.btn.google-native:hover { border-color: #4285f4; }
.g-logo { display: inline-flex; }
.g-badge {
  display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 6px; border-radius: 50%;
  background: var(--surface-2); color: var(--info); font: 800 .7rem/1 var(--font); vertical-align: middle;
}
.login-new { display: grid; gap: 6px; justify-items: center; padding-top: 4px; border-top: 1px dashed var(--line); }
.login-new .btn { width: 100%; }

/* --- courses & libraries ------------------------------------------------------------------------------------- */

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.course-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); border: 1px solid transparent; transition: transform .12s, box-shadow .12s, border-color .12s;
  text-decoration: none; color: var(--text);
}
.course-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--primary-soft); }
.cc-main { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--text); min-width: 0; }
.cc-icon { font-size: 2.2rem; line-height: 1; }
.cc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.cc-body b { font-size: 1.05rem; }
.cc-progress { color: var(--good); font-weight: 700; }
.cc-desc { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cc-remove { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; font-size: .85rem; color: var(--muted); }
.cc-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: auto; }
.hit { color: var(--muted); }
.hit mark { background: color-mix(in srgb, var(--star) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-row .section-title { margin-bottom: 12px; }
.empty { padding: 18px; color: var(--muted); }
.empty.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); }
.lib-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.lib-search { flex: 1; padding: 12px 18px; font-size: 1.1rem; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); }
.lib-search:focus { outline: none; border-color: var(--primary); }
.lang-chips { margin: 0 0 14px; }
.chip-btn { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: .88rem; }
.chip-btn.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tag { padding: 3px 11px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-2); text-decoration: none; font-weight: 700; font-size: .88rem; }
.card.outline { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 20px; margin: 12px 0; }
.card.outline h3 { margin: 4px 0; }
.link-open { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 18px 0 4px; }
.link-open input { flex: 1; min-width: 200px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.download { text-align: center; padding: 40px 16px; display: grid; gap: 10px; justify-items: center; }
.download .qbar { width: min(360px, 100%); }
.dl-icon { font-size: 3.5rem; }
.side-title { font-weight: 800; padding: 8px 10px 6px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.side-note { padding: 0 10px; }
.tree-back { display: block; padding: 6px 10px; font-weight: 700; text-decoration: none; font-size: .9rem; }
.tree-course { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 2px 0 6px; border-radius: 10px; text-decoration: none; color: var(--text); background: var(--surface-2); }
.tree-course.active { background: var(--primary-soft); color: var(--primary-2); }
.tree-course .ico { font-size: 1.2rem; }
.add-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--info-soft); margin: 10px 0 4px; }

/* --- Studio -------------------------------------------------------------------------------------------------- */

.studio-badge { margin-left: 6px; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 800; letter-spacing: .03em; }
.studio .page-wrap .card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin: 12px 0; }
.studio .page-wrap .card h3 { margin: 0 0 10px; }
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.cols-2 > .card { margin: 0; }
.vis-picker { display: grid; gap: 8px; }
.vis-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; }
.vis-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.vis-opt input { margin-top: 4px; accent-color: var(--primary); }
.vis-opt span { display: grid; gap: 2px; }
.icon-input { text-align: center; font-size: 1.4rem; }
.share-link { flex: 1; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--mono); font-size: .85rem; }
.row-input[hidden] { display: none !important; }
.copy-results { display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.copy-opt { text-align: left; padding: 9px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; }
.copy-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.dropzone {
  display: grid; gap: 8px; justify-items: center; text-align: center; padding: 22px; margin: 6px 0 20px; border-radius: 18px;
  border: 2px dashed var(--line); background: var(--surface);
}
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone select { padding: 3px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.dz-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.upload-log { display: grid; gap: 4px; width: 100%; max-height: 240px; overflow: auto; text-align: left; }
.upload-log:empty { display: none; }
.file-row a { text-decoration: none; color: var(--text); }
.file-row .btn { margin-left: auto; }
.course-progress { margin-bottom: 8px; }
.table-wrap.flat { box-shadow: none; border-radius: 0 0 12px 12px; margin: 0; }
.studio-card .cc-body small { display: block; }

/* phones: the Studio button shrinks to its icon so the search field keeps its room */
@media (max-width: 700px) { .sb-label { display: none; } }

/* --- teachers, students and groups --------------------------------------------------------------------------- */

.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-opt { display: flex; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; }
.role-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.role-opt > span:last-child { display: grid; gap: 1px; line-height: 1.2; }
.ro-icon { font-size: 1.6rem; }
@media (max-width: 380px) { .role-picker { grid-template-columns: 1fr; } }
.join-banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--info-soft); }
.jb-icon { font-size: 1.5rem; }
.join-card { text-align: center; display: grid; gap: 6px; justify-items: center; padding: 28px 20px !important; }
.join-card h1 { margin: 0; }
.jc-icon { font-size: 3rem; }
.edit-bar.center { justify-content: center; }
.groups-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.chip-group { padding: 3px 11px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: .9rem; }
.cc-group { color: var(--info); font-weight: 700; }
.invite { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.invite-text { flex: 1; min-width: 220px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; justify-items: start; }
.invite-text p { margin: 0; }
.invite-text .row-input { width: 100%; }
.join-code { font: 800 1.9rem/1.1 var(--mono); letter-spacing: .08em; color: var(--primary-2); }
.group-courses { display: grid; gap: 6px; margin-bottom: 10px; }
.gc-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.gc-icon { font-size: 1.3rem; }
.gc-title { flex: 1; min-width: 0; }
.gc-row .icon-btn { width: 30px; height: 30px; font-size: .85rem; color: var(--muted); }
.group-table th { white-space: nowrap; }
.gp-cell { min-width: 150px; }
.pick-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.check.pick { padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.mono { font-family: var(--mono); letter-spacing: .04em; }
.invite-text .share-link { min-width: 0; }
.side-title a { color: inherit; text-decoration: none; }
.side-title a:hover { color: var(--primary); }
.groups-cell { min-width: 170px; }
.login-about { width: min(560px, 100%); color: var(--muted); line-height: 1.5; }
.login-about h2 { color: var(--text); font-size: 1.15rem; margin: 0 0 6px; }
.login-about p { margin: 0 0 8px; }
.login-about ul { margin: 0 0 8px; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.login-about b { color: var(--text); }
