@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,600;8..60,700;8..60,800&family=IBM+Plex+Mono:wght@400;500;600&display=swap");
/* Delta – "ink on paper": tokens, app shell, shared components.
   Ink for text and primary actions, paper surfaces, thin rules, signal red only for the active/attention state,
   indigo for links, selection and focus. Every status also carries an icon and a label (never colour alone). */
:root {
  /* palette */
  --ink: #151211;
  --paper: #f1eee4;
  --graphite: #1b1e26;
  --signal: #b72a33;          /* active state, attention, the Delta mark – never "failure" */
  --focus: #4d5cb5;           /* links, selected source, keyboard focus */
  --resolved: #5d8965;        /* confirmed understanding, done (marks) */
  --caution: #b66b2d;         /* uncertain or partial (marks) */

  /* roles (the names the rest of the CSS uses) */
  --bg: var(--paper);
  --surface: #f8f6f0;
  --surface-2: #e9e3d5;
  --surface-3: #dfd8c8;
  --border: #dddace;          /* rules and dividers */
  --border-strong: #8f8a7c;   /* form controls: 3:1 against the surface */
  --text: var(--ink);
  --muted: #6b675d;
  --primary: var(--focus);
  --primary-strong: #3b4894;
  --primary-soft: #e7e8f3;
  --primary-text: #3e4ba0;
  --action: var(--ink);       /* the one primary button per view */
  --action-hover: #3a352f;
  --action-text: #f8f6f0;
  --accent: #46714f;          /* resolved, as text on paper (4.6:1) */
  --accent-soft: #e3ece0;
  --warn: #8f5320;            /* caution, as text on paper (5:1) */
  --warn-soft: #f6e8d8;
  --danger: #a8242e;          /* signal red as text (5.6:1 on its tint) */
  --danger-soft: #f5e1df;
  --sidebar-bg: #e9e3d5;
  --sidebar-text: var(--ink);
  --sidebar-muted: #625e55;
  --sidebar-active: rgba(21, 18, 17, .06);
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(24, 21, 19, .04);
  --shadow-lg: 0 18px 48px rgba(21, 18, 17, .14);
  --radius: 10px;
  --radius-sm: 7px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sidebar-w: 232px;
  --rail-w: 72px;
  --panel-w: 380px;
  --bottom-nav-h: 64px;
  color-scheme: light;
}

/* one light theme (beige paper, black ink), also when the system is in dark mode */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary-text); text-underline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); letter-spacing: -.015em; }
.display { font-family: var(--serif); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; }
.eyebrow { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.grid-6 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- App shell: dark navigation (232px) · icon rail (72px) · bottom navigation on phones ---------------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 18px 12px; z-index: 40; overflow-y: auto; border-right: 1px solid var(--border);
}
.sidebar .brand { color: var(--ink); padding: 0 10px 16px; }
.course-chip {
  display: block; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--paper); margin-bottom: 12px;
  color: var(--ink); text-decoration: none;
}
.course-chip strong { font-family: var(--mono); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; }
.course-chip small { display: block; color: var(--sidebar-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-chip:hover { border-color: var(--ink); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-muted); padding: 14px 12px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 7px; color: var(--sidebar-text);
  text-decoration: none; font-weight: 550; font-size: 14.5px; border: none; background: none; cursor: pointer; font-family: inherit; text-align: left;
}
.nav-item:hover { background: var(--sidebar-active); color: var(--ink); }
.nav-item.active { background: var(--ink); color: var(--paper); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--signal); }
.nav-item .count { margin-left: auto; background: var(--signal); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nav-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; background: none; border: none; color: inherit; width: 100%; font-family: inherit; text-align: left; }
.user-chip:hover { background: var(--sidebar-active); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px;
  background: var(--ink); color: var(--paper); flex: none; font-family: var(--mono);
}
.user-chip strong { color: var(--ink); display: block; font-size: 14px; }
.user-chip small { color: var(--sidebar-muted); font-size: 12px; }
.sidebar-tools { display: flex; gap: 6px; padding: 8px 4px 0; }
.sidebar-tools .btn { color: var(--sidebar-text); border-color: var(--border-strong); background: transparent; }
.sidebar-tools .btn:hover { background: var(--sidebar-active); color: var(--ink); }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 16px 28px 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; letter-spacing: -.02em; margin: 0; }
.topbar .subtitle { color: var(--muted); font-size: 13px; }
.btn.menu-btn { display: none; }
.content { padding: 24px 28px 60px; width: 100%; max-width: 1320px; }
.view { display: none; animation: fadein .18s ease; }
.view.active { display: block; }
.scrim { display: none; }
.bottom-nav { display: none; }

/* medium: an icon rail; labels as tooltips, the course and the account stay reachable */
@media (max-width: 1199px) and (min-width: 761px) {
  .sidebar { width: var(--rail-w); padding: 16px 10px; align-items: center; overflow-x: hidden; }
  .sidebar .brand { padding: 0 0 14px; }
  .sidebar .brand .brand-word, .nav-label, .nav-item > span:not(.count), .course-chip small, .user-chip > span:last-child, .sidebar-tools .spacer { display: none; }
  .course-chip { padding: 6px; width: 52px; text-align: center; }
  .course-chip strong { font-size: 10px; display: block; overflow: hidden; text-overflow: ellipsis; }
  .nav { width: 100%; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item.active::before { left: -10px; }
  .nav-item .count { position: absolute; top: 2px; right: 2px; margin: 0; padding: 0 5px; font-size: 10px; }
  .nav-item[data-tip]:hover::after, .nav-item[data-tip]:focus-visible::after {
    content: attr(data-tip); position: fixed; left: calc(var(--rail-w) + 6px); margin-top: 0; padding: 5px 9px; border-radius: 6px;
    background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 600; white-space: nowrap; z-index: 70; pointer-events: none;
  }
  .user-chip { justify-content: center; padding: 6px; }
  .sidebar-tools { flex-direction: column; align-items: center; padding: 8px 0 0; }
  .sidebar-foot .popover { left: calc(var(--rail-w) - 4px) !important; bottom: 12px !important; position: fixed; }
  .main { margin-left: var(--rail-w); }
}

/* phones: the task stays central, navigation at the bottom, everything else in the drawer ("More") */
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); width: min(300px, 86vw); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(21, 18, 17, .35); z-index: 35; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 1.25rem; }
  .content { padding: 16px 16px 32px; }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .bottom-nav a, .bottom-nav button {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; border: 0; background: none; padding: 6px 2px;
    color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; min-width: 0;
  }
  .bottom-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav .icon { width: 22px; height: 22px; }
  .bottom-nav .active { color: var(--text); }
  .bottom-nav .active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--signal); }
  .bottom-nav .count { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--signal); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 5px; }
  #toast-root { bottom: calc(var(--bottom-nav-h) + 12px); left: 12px; right: 12px; }
}

/* ---- Brand: the ink Δ on a red seal ------------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.45rem; font-weight: 800; letter-spacing: -.025em; margin: 0; text-decoration: none; color: inherit; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; background: var(--signal); color: var(--paper); flex: none; }
.brand-mark svg { width: 20px; height: 20px; }
.brand span.brand-word { color: inherit; }

/* ---- Cards: thin rules, calm surfaces, minimal elevation ---------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.section-title { display: flex; align-items: center; gap: 8px; }
.section-title .icon { color: var(--muted); }
.hint-text { color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
.rule-top { border-top: 2px solid var(--ink); padding-top: 12px; }

/* ---- Forms -------------------------------------------------------------------------------------------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; color: var(--muted); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 12px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--ink); }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text); margin: 0; }

/* ---- Buttons: ink for the primary action, quiet for the rest ------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; padding: 8px 15px; border-radius: 8px; border: 1px solid transparent; background: var(--action); color: var(--action-text);
  transition: background .15s, border-color .15s, color .15s, transform .05s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--action-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.soft { background: var(--primary-soft); color: var(--primary-text); }
.btn.soft:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 12%); }
.btn.success { background: var(--accent); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.warn { background: var(--warn); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn.icon-only { padding: 7px; }
.btn .icon { width: 16px; height: 16px; }

.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 9px; border: 1px solid var(--border); flex-wrap: wrap; }
.segmented button {
  font: inherit; font-size: 13.5px; font-weight: 600; border: none; background: none; color: var(--muted); padding: 6px 12px;
  border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.segmented button.active { background: var(--action); color: var(--action-text); }
.segmented button:disabled { opacity: .55; cursor: not-allowed; }

/* ---- Badges, chips, pills ----------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.badge.primary { background: var(--primary-soft); color: var(--primary-text); border-color: transparent; }
.badge.success { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
/* SourceChip: "view source" looks the same everywhere */
.source-chip {
  display: inline-flex; align-items: center; gap: 5px; margin: 2px 4px 2px 0; padding: 3px 9px; border-radius: 6px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; background: var(--surface); color: var(--primary-text);
  cursor: pointer; border: 1px solid var(--border); text-decoration: none;
}
.source-chip .icon { width: 13px; height: 13px; }
.source-chip:hover { border-color: var(--focus); text-decoration: underline; }

/* StatusPill: icon + label + tone. Tones: attention (signal), progress (focus), resolved, caution, neutral */
.status {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap; border: 1px solid transparent; background: var(--surface-2); color: var(--muted); line-height: 1.5;
}
.status .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.status.attention { background: var(--danger-soft); color: var(--danger); }
.status.progress { background: var(--primary-soft); color: var(--primary-text); }
.status.resolved { background: var(--accent-soft); color: var(--accent); }
.status.caution { background: var(--warn-soft); color: var(--warn); }
.status.neutral { background: var(--surface); color: var(--muted); border-color: var(--border); }
.status.ink { background: var(--action); color: var(--action-text); }

/* ---- Lists, stats, progress --------------------------------------------------------------------------- */
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: none; }
.stat { padding: 16px 18px; }
.stat .value { font-family: var(--serif); font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 13px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 3px; background: var(--ink); transition: width .4s; }
.meter.success > span { background: var(--resolved); }
.meter.warn > span { background: var(--caution); }
.meter.danger > span { background: var(--signal); }
.empty { text-align: center; color: var(--muted); padding: 26px 16px; }
.empty .icon { width: 28px; height: 28px; opacity: .6; display: block; margin: 0 auto 8px; }
.empty-state { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 16px; color: var(--muted); }
.empty-state .d-wrap { width: 96px; height: 78px; }
.empty-state .d-wrap svg { width: 100%; height: 100%; }
.empty-state h3 { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--text); margin: 4px 0 0; }
.empty-state p { margin: 0; max-width: 420px; }

/* ---- Components: AgentState, EvidenceRow, InsightCard, AttentionQueueItem, SupportingPanel, ActionFooter --- */
/* AgentState: Delia + one plain-language line of what she is really doing */
.agent-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.agent-state .d-wrap { width: 34px; height: 28px; flex: none; }
.agent-state .d-wrap svg { width: 100%; height: 100%; display: block; }
.agent-state strong { color: var(--text); font-weight: 600; }

/* EvidenceRow: where something comes from, what it says, and a way to open it */
.evidence { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.evidence-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.evidence-loc { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.evidence blockquote { margin: 2px 0; padding: 4px 10px; border-left: 2px solid var(--ink); font-size: 13.5px; }
.evidence .why { font-size: 13px; color: var(--muted); }

/* InsightCard / AttentionQueueItem: what changed · how many · likely issue · what you can do */
.insight { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; display: grid; gap: 8px; }
.insight h3 { font-family: var(--serif); font-weight: 700; font-size: 1.12rem; margin: 0; }
.insight .why { color: var(--muted); font-size: 14px; }
.attn-item { position: relative; border: 1px solid var(--border); border-left: 3px solid var(--signal); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); padding: 14px 18px; display: grid; gap: 6px; }
.attn-item.quiet { border-left-color: var(--border-strong); }
.attn-item h3 { font-family: var(--serif); font-weight: 700; font-size: 1.08rem; margin: 0; }
.attn-item .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.attn-item .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.attn-count { font-family: var(--serif); font-weight: 800; font-size: 1.6rem; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }

/* ActionFooter: the singular next step */
.action-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border); }
.action-footer .next { font-size: 13px; color: var(--muted); }

/* FormulaBlock */
.formula { overflow-x: auto; padding: 8px 12px; background: var(--surface-2); border-radius: 6px; }

/* Skeleton loading */
.skeleton { display: grid; gap: 8px; }
.skeleton i { display: block; height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
.skeleton i:nth-child(2) { width: 82%; } .skeleton i:nth-child(3) { width: 64%; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---- Toasts, spinner, popovers ------------------------------------------------------------------------ */
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--paper); padding: 11px 15px; border-radius: 8px; box-shadow: var(--shadow-lg); max-width: 380px; font-size: 14px; animation: fadein .2s; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.popover { position: absolute; z-index: 60; width: 340px; max-height: 440px; overflow: auto; padding: 8px 14px; box-shadow: var(--shadow-lg); }
.notif { position: relative; }
.notif .popover { right: 0; top: 42px; }
.dot-count { background: var(--signal); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; font-weight: 700; }

/* ---- Login -------------------------------------------------------------------------------------------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 460px; padding: 30px; }
.login-card .brand { font-size: 2.6rem; }
.login-card .brand-mark { width: 44px; height: 44px; }
.login-card .brand-mark svg { width: 28px; height: 28px; }
.login-hero { display: flex; align-items: center; gap: 14px; }
.login-hero .d-wrap { width: 86px; height: 70px; margin-left: auto; }
.login-hero .d-wrap svg { width: 100%; height: 100%; }
.demo-users { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.demo-user { text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.demo-user:hover { border-color: var(--ink); background: var(--surface-2); }
.demo-user small { display: block; color: var(--muted); font-size: 12px; }

/* ---- Generated material ------------------------------------------------------------------------------- */
.slide-preview { aspect-ratio: 16 / 9; background: #fff; color: #1a1a26; border-radius: 8px; border: 1px solid var(--border); display: flex; flex-direction: column; font-size: 14px; overflow: hidden; }
.slide-preview .slide-title { background: var(--accent-color, #1f3b8a); color: #fff; font-weight: 700; font-size: 1.25em; padding: .7em 1.2em; border-radius: 7px 7px 0 0; }
.slide-preview ul { margin: .8em 1.2em; padding-left: 1.2em; flex: 1; }
.slide-preview li { margin: .35em 0; }
.slide-preview li::marker { color: var(--accent-color, #1f3b8a); }
.slide-example { margin: 0 1.2em 1em; padding: .5em .8em; background: #f2f4fa; border-radius: 6px; font-size: .9em; }
.hint-list { padding-left: 20px; }
.task { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 8px 0; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ---- Accessibility: visible, unobscured focus; high contrast; reduced motion ----------------------------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:focus-visible { scroll-margin-top: 84px; scroll-margin-bottom: calc(var(--bottom-nav-h) + 16px); }
html.large-text { font-size: 118%; }
html.large-text body { font-size: 17px; }
html.high-contrast { --bg: #fff; --surface: #fff; --surface-2: #f0f0f0; --surface-3: #ddd; --border: #000; --border-strong: #000; --text: #000; --muted: #222; --primary: #0030c0; --primary-text: #0030c0; --primary-strong: #00208a; --action: #000; --action-text: #fff; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* a sequence of clarification slides (review and student view) */
.slide-seq { margin-bottom: 14px; }
.slide-seq .slide-preview { margin-top: 4px; }
.slide-edit { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 12px; margin: 10px 0; }
.slide-edit legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
