/* LetzAssess design system - blue & white */

/* Poppins, self-hosted so the UI looks identical offline. */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/poppins-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/poppins-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/poppins-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/poppins-700.woff2') format('woff2');
}

:root {
  /* Neutrals carry a slight blue cast so white surfaces read as part of the
     same family rather than sitting cold against the brand colour. */
  --ink: #0d1b2e;
  --ink-2: #33455c;
  --ink-3: #64748b;
  --ink-4: #94a3b8;
  --line: #dbe4f0;
  --line-2: #eaf0f8;
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-2: #f9fbfe;

  --brand: #1d5fd0;
  --brand-dark: #17469c;
  --brand-soft: #e9f1fe;
  --brand-line: #c3d9f8;

  --ok: #0f7a53;
  --ok-soft: #e5f5ee;
  --ok-line: #b4e0cd;
  --warn: #9a5b00;
  --warn-soft: #fdf2e0;
  --warn-line: #f2d8a6;
  --danger: #c0342c;
  --danger-soft: #fdecea;
  --danger-line: #f5c6c2;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(13, 27, 46, .06), 0 1px 3px rgba(13, 27, 46, .04);
  --shadow-md: 0 4px 12px rgba(13, 27, 46, .09), 0 2px 4px rgba(13, 27, 46, .04);
  --shadow-lg: 0 18px 44px rgba(13, 27, 46, .2);

  --font: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Icons inherit their colour and sit on the text baseline. */
.icon { flex-shrink: 0; display: block; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.011em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.02rem; }
h4 { font-size: .92rem; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: .88em; }

/* ---------------------------------------------------------------- layout */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: 820px; }

.page { padding: 28px 0 80px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.muted { color: var(--ink-3); }
.small { font-size: .86rem; }
.tiny { font-size: .78rem; }
.strong { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 27px; height: 27px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-dark), #3b82f6);
  color: #fff;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 700;
}
.role-chip {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid var(--brand-line);
}
/* Admin carries the content-authoring keys, so it gets a visually distinct
   (warm, not blue) chip - a glance at the header is enough to tell which
   kind of account is signed in. */
.role-chip.role-admin {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: var(--warn-line);
}
.user-block { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid; place-items: center;
  font-size: .78rem; font-weight: 700;
}

/* ------------------------------------------------------------ breadcrumb */

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: .84rem; color: var(--ink-3);
  margin-bottom: 14px;
}
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { color: var(--ink-4); }

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-2);
}
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 12px 20px; }

a.card-link { display: block; color: inherit; }
a.card-link:hover { text-decoration: none; border-color: var(--brand-line); box-shadow: var(--shadow-md); transform: translateY(-1px); }
a.card-link { transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li {
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: flex-start; gap: 12px;
}
.list > li:last-child { border-bottom: 0; }
.list > li .item-main { flex: 1; min-width: 0; }
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.page-title-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 22px; flex-wrap: wrap;
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: .88rem; font-weight: 500;
  padding: 8px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-4); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px;
}
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.btn-danger:hover { background: #fbdedb; border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: .8rem; border-radius: 8px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center;
  font-size: .84rem; line-height: 1;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-3);
  white-space: nowrap;
}
.badge-brand { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-dark); }
.badge-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.badge-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.badge-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }

.difficulty-Easy { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.difficulty-Medium { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.difficulty-Hard { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }

/* ------------------------------------------------------------------ tabs */

.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  font: inherit; font-size: .88rem; font-weight: 500;
  padding: 10px 14px;
  border: 0; background: none;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab .tab-num {
  width: 18px; height: 18px; border-radius: 5px;
  background: var(--line-2); color: var(--ink-3);
  font-size: .68rem; font-weight: 700;
  display: grid; place-items: center;
}
.tab.active .tab-num { background: var(--brand-soft); color: var(--brand-dark); }

.section-intro {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: .85rem;
  color: var(--ink-3);
  margin-bottom: 18px;
}

/* ----------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--ink-4); }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="date"],
.field textarea,
.field select {
  font: inherit; font-size: .9rem;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.field textarea.code { font-family: var(--mono); font-size: .85rem; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.field-check { flex-direction: row; align-items: center; gap: 8px; }
.field-check label { font-weight: 500; }
.field-check input { width: auto; }

.form-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: 14px;
}

/* ---------------------------------------------------------------- modals */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(22, 22, 29, .42);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  z-index: 100;
  animation: fade .13s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  animation: rise .16s ease;
}
.modal.wide { max-width: 720px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-body { padding: 18px 20px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* --------------------------------------------------------------- toasts */

.toast-stack {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 10px 15px;
  border-radius: var(--radius);
  font-size: .86rem;
  box-shadow: var(--shadow-md);
  max-width: 340px;
  animation: rise .16s ease;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }

/* --------------------------------------------------------- empty states */

.empty {
  text-align: center;
  padding: 38px 24px;
  color: var(--ink-3);
  font-size: .9rem;
}
.empty .empty-title { font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }

.loading { padding: 34px; text-align: center; color: var(--ink-4); font-size: .88rem; }

/* --------------------------------------------------------------- stats */

.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 15px 17px;
}
.stat .stat-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .stat-label { font-size: .78rem; color: var(--ink-3); margin-top: 3px; }

.meter { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.meter.ok > span { background: var(--ok); }
.meter.warn > span { background: var(--warn); }
.meter.danger > span { background: var(--danger); }

/* ---------------------------------------------------------------- table */

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ================================================================ GUIDE */
/* Colour-coded content blocks for the Faculty Delivery Guide             */

.guide-page { font-size: 1rem; }
.guide-page > * { margin-bottom: 16px; }
.guide-page > *:last-child { margin-bottom: 0; }
.guide-h2 { font-size: 1.3rem; margin-top: 30px; padding-bottom: 7px; border-bottom: 2px solid var(--brand-soft); }
.guide-h3 { font-size: 1.06rem; margin-top: 22px; color: var(--ink-2); }
.guide-page > .guide-h2:first-child, .guide-page > .guide-h3:first-child { margin-top: 0; }
.guide-p { color: var(--ink-2); line-height: 1.7; white-space: pre-wrap; }
.guide-list { margin: 0; padding-left: 22px; color: var(--ink-2); }
.guide-list li { margin-bottom: 5px; line-height: 1.65; }
.guide-code {
  background: #0d1b2e; color: #e2ecf8;
  padding: 14px 16px; border-radius: var(--radius);
  overflow-x: auto; margin: 0;
  font-size: .85rem; line-height: 1.6;
  white-space: pre;
}
.guide-code-lang {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-4); margin-bottom: 5px; font-weight: 600;
}

/* A written note's body - reference cards and cheat sheets read far better
   in a monospace box than as a plain paragraph, and short prose notes still
   read fine this way too. */
.note-body {
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.guide-figure { margin: 0; }
.guide-figure img { display: block; max-width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.guide-figure figcaption { font-size: .82rem; color: var(--ink-3); margin-top: 6px; text-align: center; }

/* Baseline styling for an admin-uploaded HTML guide, so even markup that
   does not use the guide-* / callout classes above degrades sensibly. */
.guide-html { color: var(--ink-2); line-height: 1.7; overflow-x: auto; }
.guide-html h1, .guide-html h2, .guide-html h3, .guide-html h4 { color: var(--ink); margin-top: 24px; }
.guide-html h1:first-child, .guide-html h2:first-child, .guide-html h3:first-child { margin-top: 0; }
.guide-html p { margin: 0 0 14px; }
.guide-html img { max-width: 100%; height: auto; border-radius: var(--radius); }
.guide-html a { color: var(--brand); }
.guide-html table { width: 100%; border-collapse: collapse; margin: 4px 0 16px; }
.guide-html th, .guide-html td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; font-size: .92rem; }
.guide-html th { background: var(--surface-2); font-weight: 600; }
.guide-html pre { overflow-x: auto; }
.guide-html blockquote { margin: 0 0 14px; padding: 4px 16px; border-left: 3px solid var(--line); color: var(--ink-3); }

/* -------------------------------------------------------- file uploads */

.upload-box {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.upload-box input[type=file] { font: inherit; font-size: .84rem; color: var(--ink-2); max-width: 100%; }
.upload-box .spacer { flex: 1; }
.upload-mode-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; color: var(--brand-dark);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  padding: 4px 10px; border-radius: 999px;
}

.callout {
  border-left: 4px solid var(--c-accent, var(--brand));
  background: var(--c-bg, var(--brand-soft));
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 13px 16px;
}
.callout .callout-label {
  display: flex; align-items: center; gap: 7px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .075em;
  color: var(--c-accent, var(--brand));
  margin-bottom: 6px;
}
.callout .callout-title { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.callout .callout-text { color: var(--ink-2); white-space: pre-wrap; line-height: 1.65; }

/* The SRS requires content blocks to be distinguishable at a glance, so these
   stay individually coloured - but tuned cool and muted to sit inside a blue
   and white page rather than fight it. */
.callout.c-definition     { --c-accent: #1d5fd0; --c-bg: #e9f1fe; }  /* royal blue */
.callout.c-example        { --c-accent: #4338ca; --c-bg: #ecebfb; }  /* indigo     */
.callout.c-analogy        { --c-accent: #0e7490; --c-bg: #ddf1f6; }  /* teal       */
.callout.c-didyouknow     { --c-accent: #475569; --c-bg: #eef2f7; }  /* steel      */
.callout.c-tip            { --c-accent: #0f7a53; --c-bg: #e6f5ee; }  /* green      */
.callout.c-warning        { --c-accent: #9a5b00; --c-bg: #fdf4e5; }  /* amber      */
.callout.c-misconception  { --c-accent: #c0342c; --c-bg: #fdeceb; }  /* red        */
.callout.c-funfact        { --c-accent: #be185d; --c-bg: #fce9f1; }  /* rose       */

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

.editor-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.editor-block.dragging { opacity: .45; }
.editor-block-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
}
.editor-block-kind {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--c-accent, var(--ink-3));
  padding: 3px 9px; border-radius: 999px;
  background: var(--c-bg, var(--line-2));
  display: inline-flex; align-items: center; gap: 5px;
}
.editor-block-body { padding: 11px 12px; }
.editor-block-body textarea, .editor-block-body input[type="text"] {
  font: inherit; font-size: .9rem;
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface);
}
.editor-block-body textarea { resize: vertical; min-height: 68px; line-height: 1.6; }
.editor-block-body textarea:focus, .editor-block-body input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.editor-block-body .sub-label { font-size: .76rem; color: var(--ink-4); margin-bottom: 4px; font-weight: 600; }
.drag-handle { cursor: grab; color: var(--ink-4); padding: 0 2px; user-select: none; display: flex; align-items: center; }
.drag-handle:active { cursor: grabbing; }

.block-palette {
  display: grid; gap: 7px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.block-palette button {
  font: inherit; font-size: .82rem; font-weight: 500;
  text-align: left;
  padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); cursor: pointer;
  border-left: 3px solid var(--c-accent, var(--ink-4));
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.block-palette button .icon { color: var(--c-accent, var(--ink-3)); }
.block-palette button:hover { background: var(--surface-2); border-color: var(--ink-4); border-left-color: var(--c-accent, var(--ink-4)); }

/* Stays readable when it sticks over the guide content behind it. */
.editor-savebar {
  position: sticky;
  bottom: 16px;
  margin-top: 18px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.checklist { display: flex; flex-wrap: wrap; gap: 7px; }
.check-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 500;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3);
}
.check-item.done { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }

/* ----------------------------------------------------------- embed media */

.embed-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0d1b2e;
  border: 1px solid var(--line);
}
.embed-frame iframe, .embed-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-fallback {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 15px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: .87rem;
}

/* -------------------------------------------------------------- practice */

.question-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 17px 19px;
  margin-bottom: 14px;
}
.question-card.correct { border-color: var(--ok-line); background: var(--ok-soft); }
.question-card.wrong { border-color: var(--danger-line); background: var(--danger-soft); }
.question-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.question-num {
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 7px; background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-size: .78rem; font-weight: 700;
}
.question-prompt { font-weight: 500; line-height: 1.55; white-space: pre-wrap; flex: 1; }
.options { display: flex; flex-direction: column; gap: 7px; }
.option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  line-height: 1.5;
  transition: border-color .13s ease, background .13s ease;
}
.option:hover { border-color: var(--ink-4); }
.option input { margin: 3px 0 0; flex-shrink: 0; }
.option.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.option.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.option.locked { cursor: default; }
.option.locked:hover { border-color: var(--line); }
.option.locked.is-correct:hover { border-color: var(--ok); }
.option.locked.is-wrong:hover { border-color: var(--danger); }
.option-mark {
  margin-left: auto; font-size: .76rem; font-weight: 600; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
}

.answer-key {
  margin-top: 11px; padding-top: 11px;
  border-top: 1px dashed var(--line);
  font-size: .86rem; color: var(--ink-2);
}
.explanation {
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: .87rem;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.score-banner {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  margin-bottom: 20px;
}
.score-ring {
  width: 62px; height: 62px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 700;
  background: var(--surface);
  border: 3px solid var(--brand);
  color: var(--brand-dark);
}
.score-banner.good { background: var(--ok-soft); border-color: var(--ok-line); }
.score-banner.good .score-ring { border-color: var(--ok); color: var(--ok); }
.score-banner.poor { background: var(--danger-soft); border-color: var(--danger-line); }
.score-banner.poor .score-ring { border-color: var(--danger); color: var(--danger); }

/* -------------------------------------------------------------- tailored */

.tailor-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  padding: 14px 17px;
}
.tailor-card .depth-badge {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--brand-dark);
}

.status-strong { color: var(--ok); }
.status-weak { color: var(--danger); }
.status-in_progress { color: var(--warn); }
.status-untested, .status-no_questions { color: var(--ink-4); }

/* ----------------------------------------------------------------- login */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-aside {
  background: linear-gradient(150deg, #10305f, #17469c 50%, #2f76e0);
  color: #fff;
  padding: 54px 48px;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-aside h1 { font-size: 2rem; margin-bottom: 14px; }
.auth-aside p { color: rgba(255, 255, 255, .86); max-width: 40ch; line-height: 1.7; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 13px; }
.auth-points li { display: flex; gap: 11px; align-items: flex-start; color: rgba(255, 255, 255, .92); font-size: .92rem; }
.auth-points .dot {
  width: 21px; height: 21px; flex-shrink: 0; border-radius: 7px;
  background: rgba(255, 255, 255, .18);
  display: grid; place-items: center; font-size: .68rem; font-weight: 700;
}
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-tabs { display: flex; gap: 4px; background: var(--line-2); padding: 4px; border-radius: var(--radius); margin-bottom: 22px; }
.auth-tabs button {
  flex: 1; font: inherit; font-size: .86rem; font-weight: 600;
  padding: 7px; border: 0; border-radius: 7px; background: none; color: var(--ink-3); cursor: pointer;
}
.auth-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.role-option {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 13px; cursor: pointer; background: var(--surface);
  transition: border-color .14s ease, background .14s ease;
}
.role-option:hover { border-color: var(--ink-4); }
.role-option.selected { border-color: var(--brand); background: var(--brand-soft); }
.role-option .role-name { font-weight: 600; font-size: .89rem; }
.role-option .role-desc { font-size: .76rem; color: var(--ink-3); margin-top: 2px; }
.role-option input { position: absolute; opacity: 0; pointer-events: none; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .site-header .container { gap: 10px; }
  .user-block .user-name { display: none; }
  .page-title-row { flex-direction: column; align-items: stretch; }
  .grid { grid-template-columns: 1fr; }
}
