/* KNOX BANK — UI Components & Interactive Elements */

.wrap { max-width: 1360px; margin: 0 auto; padding: 24px 20px 64px; }
#product-shell > h1,
#product-shell > .sub,
#product-shell > .controls,
#product-shell > .steps { display: none; }
#acc-menu-settings-btn { display: none; }

h1 {
  font-size: 1.65rem; font-weight: 650; letter-spacing: -0.02em;
  line-height: 1.25; margin: 0 0 6px; color: var(--text);
}
.sub { color: var(--text-muted); margin: 0 0 20px; max-width: 72ch; font-size: 0.9375rem; }

/* Top Header Segmented Controls */
.controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 18px; }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface-solid); }
.seg button {
  font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border: 0; background: transparent; color: var(--text-muted);
  transition: background 160ms ease, color 160ms ease;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--panel); color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.exam-settings-seg button {
  flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; text-align: center;
}

.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.steps button {
  font: inherit; font-size: 0.8125rem; cursor: pointer; padding: 8px 14px;
  border: 0; border-bottom: 2.5px solid transparent; background: none; color: var(--text-muted);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.steps button:hover { color: var(--text); background: var(--panel); }
.steps button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; background: var(--accent-soft); }

/* Main App Shell Layout */
.app {
  border: 1px solid var(--border-strong); border-radius: var(--r-xl); overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 68px; position: relative;
  min-height: min(720px, calc(100svh - 180px));
  background: var(--canvas);
}
.app.is-bank-hub { grid-template-columns: 1fr; }
.app.is-bank-hub .side { display: none; }
.app.is-bank-hub .mobile-nav-toggle { display: none !important; }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; overflow: visible; }
  .side {
    display: flex; position: fixed; inset: 0 0 0 auto; width: min(280px, 86vw); z-index: 1001;
    transform: translate3d(105%, 0, 0);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--shadow-overlay);
  }
  .app.mobile-nav-open .side { transform: translate3d(0, 0, 0); }
  button.mobile-nav-toggle { display: inline-flex !important; }
  .mobile-nav-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(20, 18, 24, 0.35); }
  .bar { z-index: 1102; }
}
button.mobile-nav-toggle { display: none; }

.side {
  grid-column: 2; grid-row: 1;
  position: relative; width: auto; z-index: 600;
  background: var(--panel); border-left: 1px solid var(--border); border-right: 0;
  display: flex; flex-direction: column;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  min-width: 0; overflow: hidden;
}
.side > nav { flex: 1; }
.side .nav-support-btn { margin-top: auto; border-top: 1px solid var(--border); border-radius: 0; padding-top: 12px; }

@media (min-width: 821px) {
  .side .brand-header { justify-content: center; gap: 0; padding-inline: 8px; }
  .side .brand-header > div { max-width: 0; opacity: 0; }
  .side nav { padding-inline: 6px; }
  .side .n-item { justify-content: center; gap: 0; padding-inline: 0; }
  .side .n-item > span:not(.c) { max-width: 0; opacity: 0; }
  .side .n-item .c { max-width: 0; margin-left: 0; opacity: 0; }
  .side .n-head { max-height: 0; padding-block: 0; opacity: 0; visibility: hidden; }
  .side .adminband { font-size: 0; padding: 9px 0; }
  .side .adminband::after { content: "A"; font-size: 0.65rem; letter-spacing: 0; }
}

@media (max-width: 820px) {
  .side {
    position: fixed; inset: 0 0 0 auto; width: min(280px, 86vw); z-index: 1001;
    transform: translate3d(105%, 0, 0);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-overlay);
  }
  .app.mobile-nav-open .side { transform: translate3d(0, 0, 0); }
}

@media (max-width: 360px) {
  .side { width: 100vw; }
}

.brand-header {
  height: 56px; padding: 6px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: transparent;
  cursor: pointer; position: relative; overflow: hidden;
}
.brand-header > div {
  max-width: 180px; overflow: hidden; white-space: nowrap;
  opacity: 1; transition: max-width 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 140ms ease;
}
.logo-img {
  width: 44px; height: 44px; border-radius: 10px;
  object-fit: cover; border: 1.5px solid var(--accent-border); background: var(--accent-soft);
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand-title { font-weight: 800; letter-spacing: 0.08em; font-size: 0.95rem; line-height: 1.2; color: var(--text); }
.brand-sub { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

@media (max-width: 768px) {
  .brand-header { height: 61px; padding-block: 8px; }
}

.adminband {
  background: var(--accent); color: var(--on-accent);
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em;
  text-align: center; padding: 5px;
}

/* The sidebar list. Scoped: a bare `nav` rule also caught the main page's
   Telegram links and stacked them into a column. */
.side nav { padding: 10px; display: flex; flex-direction: column; gap: 3px; }

.n-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--r-md); color: var(--text-muted); font-size: 0.8125rem; cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  border: 1px solid transparent; position: relative; overflow: hidden;
}
.n-item:hover {
  background: var(--surface-solid); color: var(--text); border-color: var(--border);
  transform: none;
}
.n-item:active { transform: none; }
.n-item[aria-current="page"] {
  background: var(--accent-soft); color: var(--accent); font-weight: 650;
  border-color: var(--accent-border);
}
.n-item svg { flex: none; transition: transform 200ms ease; }
.n-item > span:not(.c) {
  min-width: 0; max-width: 180px; overflow: hidden; white-space: nowrap;
  opacity: 1; transition: max-width 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 140ms ease;
}
.n-item .c {
  max-width: 40px; margin-left: auto; overflow: hidden;
  font-family: var(--f-data); font-size: 0.72rem; color: var(--text-faint); font-variant-numeric: tabular-nums;
  opacity: 1; transition: max-width 180ms cubic-bezier(0.16, 1, 0.3, 1), opacity 140ms ease, margin-left 180ms ease;
}
.n-head {
  max-height: 40px; overflow: hidden;
  font-size: 0.6875rem; letter-spacing: 0.09em; font-weight: 700; color: var(--text-faint); padding: 16px 12px 6px;
  opacity: 1; transition: max-height 180ms cubic-bezier(0.16, 1, 0.3, 1), opacity 140ms ease, padding 180ms ease;
}

.main { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; min-width: 0; }
.bar {
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; flex: none;
  position: relative; z-index: 500;
}
.bar h2 { font-size: 1.05rem; font-weight: 650; margin: 0; }
.grow { flex: 1; }
.bar-actions {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--border);
}
.ghost {
  width: 34px; height: 34px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface-solid); color: var(--text-muted); display: grid; place-items: center;
  position: relative; cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.ghost:hover { background: var(--panel); color: var(--text); border-color: var(--border-strong); }
.badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-family: var(--f-data); font-size: 0.625rem; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.me {
  width: 34px; height: 34px; padding: 0; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--border-strong); color: var(--text-muted); font: inherit;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700;
  cursor: pointer; transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.me:hover { background: var(--surface-solid); color: var(--accent); border-color: var(--accent-border); }

.view {
  padding: 24px; overflow: auto; flex: 1; background: var(--canvas);
}

/* Route changes only. Initial render should land immediately. */
.page-intro-anim {
  animation: windowPageIntro 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes windowPageIntro {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .page-intro-anim { animation: none !important; }
}

html[data-motion="on"] .page-intro-anim {
  animation: windowPageIntro 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* Container Panels (Structural Wrappers) */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 20px;
  position: relative;
}
.panel.flush { padding: 0; overflow: hidden; }
.panel.wide { padding: 26px; }
.dropzone-active { background: var(--accent-soft) !important; border-color: var(--accent) !important; }

/* Interactive Cards - Universal Premium Hover Lift (-8px Lift) */
.panel.interactive,
.stat-card,
.quiz-card,
.sys-card-item,
.hero-card {
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease !important;
}

.panel.interactive:hover,
.stat-card:hover,
.quiz-card:hover,
.sys-card-item:hover:not(.expanded),
.hero-card:hover {
  background: var(--panel) !important;
  border-color: var(--accent-border) !important;
}

.panel.interactive:active,
.stat-card:active,
.quiz-card:active,
.sys-card-item:active {
  transform: none !important;
}

/* Dashboard Stat Cards & 3-Column Layout Grid (R4) */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 960px) {
  .stat-cards-grid {
    grid-template-columns: 1fr;
  }
}

.sect { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sect h3 { font-size: 1.05rem; font-weight: 650; margin: 0; }
.sect .aside { margin-left: auto; font-size: 0.78rem; color: var(--text-faint); }

.lede { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; color: var(--text); }
.lbl { font-size: 0.72rem; letter-spacing: 0.09em; font-weight: 700; color: var(--text-faint); text-transform: uppercase; }
.d { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.mut { color: var(--text-muted); }
.fnt { color: var(--text-faint); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.cols { display: grid; gap: 16px; }
.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.performance-kpi-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 88px; }
.performance-kpi-copy { min-width: 0; flex: 1; }
.performance-ring { position: relative; flex: 0 0 68px; width: 68px; height: 68px; }
.performance-ring .ring-pct-val {
  position: absolute;
  font-family: var(--f-data);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.previous-kpi-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 88px; }
.previous-kpi-copy { min-width: 0; flex: 1; }
.previous-ring { position: relative; flex: 0 0 68px; width: 68px; height: 68px; }
.previous-ring .ring-pct-val {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--f-data);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text);
}
.prev-history-filters { padding: 12px 16px; }
.prev-filter-control { min-width: 150px; flex: 1 1 0; }
.ask-finish-top-btn { min-width: 68px; border-color: var(--accent); color: var(--accent); }
.ask-pause-top-btn { min-width: 62px; }
.admin-activation-list { display: grid; gap: 8px; }
.admin-activation-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.admin-activation-copy { display: grid; gap: 3px; min-width: 0; }
.admin-activation-copy strong { overflow-wrap: anywhere; }
.admin-activation-copy > span:last-child { color: var(--text-muted); font-size: 0.75rem; overflow-wrap: anywhere; }
.admin-activation-row .b { flex: 0 0 auto; }
.admin-activation-empty { padding: 18px 0; color: var(--text-muted); font-size: 0.82rem; }
.admin-home-review-accounts { width: 100%; margin-top: 12px; }
.lean { grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); }
.active-session-hero > * { min-width: 0; display: flex; flex-direction: column; }
.active-session-hero > :last-child {
  display: flex; align-items: stretch; justify-content: initial;
  padding-left: 18px; border-left: 1px solid var(--border);
}
.active-session-hero > :last-child .b { width: 100%; margin-top: auto; }
.home-session-card { gap: 12px !important; padding: 16px; }
.home-session-card h3 { margin: 3px 0 6px; font-size: 1.15rem; letter-spacing: -0.01em; }
.home-session-card p { margin-bottom: 10px !important; }
.home-session-card-resume > div:first-child > .row:first-child,
.home-session-card-resume > div:first-child > p,
.home-session-card-resume .metric-row > span:last-child { display: none; }
.home-session-card .b { min-height: 40px; padding: 8px 14px !important; }
.home-session-card-create .b { padding-block: 10px; }
@media (max-width: 960px) { .c2, .c3, .c4, .lean { grid-template-columns: 1fr; } }

.row { display: flex; align-items: center; gap: 10px; }
.flow { display: flex; flex-wrap: wrap; gap: 8px; }
.rule { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* Buttons */
/*
 * `.b` is the button. It is element-qualified so the bare class cannot pick
 * up an unrelated `b`, and `a.b` is listed everywhere `button.b` is because
 * a control that leaves the site has to be an anchor and must still look
 * like the buttons beside it — the trial's Contact us rendered as underlined
 * text for exactly as long as this rule said `button` alone.
 */
button.b, a.b {
  font: inherit; font-size: 0.8125rem; font-weight: 620; padding: 9px 16px;
  border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--surface-solid); color: var(--text); cursor: pointer;
  position: relative; overflow: hidden;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
/* An anchor is inline and underlined by default; a button is neither. */
a.b {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
button.b:hover, a.b:hover {
  background: var(--panel); border-color: var(--accent-border);
}
button.b.pri, a.b.pri {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
button.b.pri:hover, a.b.pri:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
}
button.b.on, a.b.on { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); font-weight: 650; }
button.b.sm, a.b.sm { padding: 6px 12px; font-size: 0.75rem; }
button.b.full, a.b.full { width: 100%; text-align: center; justify-content: center; }
button.b[disabled] { opacity: 0.45; cursor: not-allowed; transform: none !important; }

@keyframes checkPop {
  0% { transform: scale(0.4); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* HIGHLY POLISHED INTERACTIVE CHECKBOX ROWS (IMPECCABLE / COURSEOLOGY) */
.chk-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: -2px -4px;
  border-radius: var(--r-md); cursor: pointer; user-select: none;
  transition: background-color 160ms ease, border-color 160ms ease;
  border: 1px solid transparent;
}
.chk-row:hover {
  background: var(--panel);
  background-color: var(--panel);
}
.chk-row .cbx {
  width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; background: var(--surface-solid); flex: none;
  transition: background 180ms ease, border-color 180ms ease, transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 180ms ease;
}
.chk-row .cbx svg {
  width: 12px; height: 12px; stroke: #ffffff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
  fill: none; opacity: 0; transform: scale(0.4); transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 150ms ease;
}
.chk-row.on .cbx,
.chk-row:has(input:checked) .cbx {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 2px 6px color-mix(in oklab, var(--accent) 35%, transparent);
}
.chk-row.on .cbx svg,
.chk-row:has(input:checked) .cbx svg {
  opacity: 1; transform: scale(1); animation: checkPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
/* Some but not all of what this row governs is selected.
 *
 * A tree row stands for every topic beneath it, so it has three states and not
 * two. Without this the partial state fell through to the unchecked styling and
 * a module with one topic deselected looked exactly like a module with nothing
 * selected — the count said 356 while the box said none. The dash is drawn in
 * the accent colour on a tinted square so it reads as "partly on" rather than
 * as a disabled control. */
.chk-row.partial .cbx {
  background: var(--accent-soft); border-color: var(--accent);
}
.chk-row.partial .cbx svg {
  opacity: 1; transform: scale(1); stroke: var(--accent);
}
.chk-row.partial .lbl-txt { color: var(--text); font-weight: 600; }

.chk-row .lbl-txt {
  font-size: 0.875rem; font-weight: 500; color: var(--text-muted); transition: color 150ms ease, font-weight 150ms ease;
}
.chk-row.on .lbl-txt,
.chk-row:has(input:checked) .lbl-txt {
  color: var(--text); font-weight: 650;
}
.chk-row .pill {
  min-width: 26px; height: 22px; padding: 0 8px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--canvas);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-data); font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  transition: all 180ms ease;
}
.chk-row.on .pill,
.chk-row:has(input:checked) .pill {
  border-color: var(--accent-border); color: var(--accent); background: var(--accent-soft); font-weight: 700;
}
.chk-row .plus {
  color: var(--text-faint); font-weight: 400; font-size: 1.1rem; line-height: 1; margin-left: 2px;
  transition: color 150ms ease, transform 150ms ease;
}
.chk-row:hover .plus { color: var(--accent); }

/* Segmented Pill Switcher */
.seg-pill {
  display: inline-flex; background: var(--canvas); border-radius: 999px; padding: 3px; gap: 2px;
  border: 1px solid var(--border);
}
.seg-pill button {
  background: transparent; border: none; border-radius: 999px; padding: 6px 18px;
  font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); cursor: pointer;
  transition: all 180ms ease;
}
.seg-pill button:hover { color: var(--text); }
.seg-pill button[aria-pressed="true"] {
  background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Accordion Header */
.acc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-top: 1px solid var(--border); cursor: pointer; user-select: none;
}
.acc-head h3 { margin: 0; font-size: 0.95rem; font-weight: 650; }
.acc-head svg { color: var(--text-faint); transition: transform 200ms ease; }
.acc-head:hover h3 { color: var(--accent); }

/* Meter Bar & Badges with Dynamic Width Fill Animation */
.meter { height: 8px; border-radius: 999px; background: var(--panel); overflow: hidden; border: 1px solid var(--border); }
.meter i {
  display: block; height: 100%; border-radius: 999px;
}

.chart-fallback svg {
  transform-origin: center bottom;
  animation: chartRise 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Responsive shell: keep dense desktop layouts fluid without changing route/state behavior. */
@media (max-width: 1200px) {
  .wrap { padding-inline: 16px; }
  .view { padding: 20px; }
}

@media (max-width: 960px) {
  .wrap { padding-top: 16px; }
  .app { min-height: min(720px, calc(100svh - 150px)); }
  .view { padding: 18px; }
  .panel.wide { padding: 22px; }
  .cols.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .wrap { padding: 12px 12px 40px; }
  h1 { font-size: 1.4rem; }
  .sub { margin-bottom: 14px; }
  .controls { gap: 8px; }
  .controls .grow { display: none; }
  .steps { gap: 4px; overflow-x: auto; flex-wrap: nowrap; }
  .steps button { min-height: 44px; white-space: nowrap; }
  .bar { min-height: 56px; height: auto; padding: 8px 14px; }
  .bar h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .view { padding: 14px; overflow-x: hidden; }
  .panel, .panel.wide { padding: 16px; }
  .cols.c2, .cols.c3, .cols.c4, .cols.lean,
  .stat-cards-grid { grid-template-columns: 1fr; }
  .row { min-width: 0; }
  .row > * { min-width: 0; }
  button.b, a.b, .ghost, .me, .mobile-nav-toggle { min-height: 44px; }
  .n-item { min-height: 44px; }
  button.b, a.b { padding-block: 10px; }
  .ghost { width: 44px; height: 44px; }
  .me { width: 44px; height: 44px; }
  .opt { padding: 12px; }
  .qg { min-height: 44px; height: auto; }
  .scroll { max-width: 100%; -webkit-overflow-scrolling: touch; }
  table { min-width: 560px; }
  .chart-fallback { min-height: 180px; }
}

@media (max-width: 600px) {
  .wrap { padding-inline: 8px; }
  .app { border-radius: var(--r-lg); }
  .view { padding: 10px; }
  .bar { gap: 8px; padding-inline: 10px; }
  .bar .grow { min-width: 8px; }
  .bar-actions { gap: 6px; margin-left: 0; padding-left: 8px; }
  .controls, .seg { width: 100%; }
  .controls .seg { flex: 1; }
  .seg button { flex: 1; min-height: 44px; padding-inline: 10px; }
  .panel, .panel.wide { padding: 12px; }
  .sect { align-items: flex-start; flex-wrap: wrap; }
  .sect .aside { margin-left: 0; width: 100%; }
  .popover-menu { position: fixed; top: 64px; left: 8px; right: 8px; width: auto; }
  .modal-card { max-height: calc(100svh - 24px); overflow: auto; padding: 18px; }
}

@media (max-height: 640px) {
  .app { min-height: 480px; }
  .view { padding-block: 14px; }
}
@keyframes chartRise {
  from { transform: scaleY(0); opacity: 0.2; }
  to { transform: scaleY(1); opacity: 1; }
}

/* CIRCULAR PROGRESS INDICATOR RINGS */
.circle-progress-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.circle-progress-val {
  position: absolute;
  font-family: var(--f-data);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text);
}

.hot {
  display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 8px; white-space: nowrap; border: 1px solid transparent;
  transition: transform 200ms ease;
}
.hot.high {
  background: var(--hot-high); color: var(--on-accent); border-color: var(--hot-high);
}
.hot:hover { border-color: var(--accent-border); }
.hot.mid { background: var(--surface-solid); color: var(--hot-mid); border-color: var(--hot-mid); }
.hot.low { background: var(--surface-solid); color: var(--hot-low); border-color: var(--border-strong); }
/* Outlined like mid and low rather than filled like high: PURPLE is a category
   the source material carried over, not a level of emphasis above RED HOT. */
.hot.purple { background: var(--surface-solid); color: var(--hot-purple); border-color: var(--hot-purple); }

.st {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: var(--r-sm);
  font-size: 0.75rem; font-weight: 600; padding: 3px 9px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-muted); white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.st:hover { border-color: var(--border-strong); }
.st.live { color: var(--success); border-color: color-mix(in oklab, var(--success) 40%, transparent); background: color-mix(in oklab, var(--success) var(--tint), var(--surface-solid)); }
.st.wait { color: var(--warning); border-color: color-mix(in oklab, var(--warning) 40%, transparent); background: color-mix(in oklab, var(--warning) var(--tint), var(--surface-solid)); }
.st.gone { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 40%, transparent); background: color-mix(in oklab, var(--accent) var(--tint), var(--surface-solid)); }

/* Form Elements */
label.f { display: block; margin-bottom: 14px; }
label.f > .lbl { display: block; margin-bottom: 6px; }
.in {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 9px 12px; font: inherit; font-size: 0.84rem;
  background: var(--surface-solid); color: var(--text);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.in:hover { border-color: var(--text-faint); }
.in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
textarea.in { resize: vertical; line-height: 1.6; }

/* Modals: one body-level layer keeps overlays above the full application shell. */
#modal-container { position: relative; z-index: 10000; }
.modal-backdrop {
  position: fixed; inset: 0; background: color-mix(in srgb, var(--text) 55%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center; z-index: 10001; isolation: isolate;
  overflow-y: auto; padding: 12px;
  animation: fadeIn 200ms ease-out;
}
.modal-card {
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: var(--r-xl); width: 92%; max-width: 540px; padding: 26px;
  position: relative; z-index: 1;
  box-shadow: var(--shadow-overlay); animation: slideUp 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-card-wide { max-width: min(900px, 96vw); max-height: min(88svh, 900px); overflow-y: auto; }

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-card { animation: none !important; }
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
thead th {
  text-align: left; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700; color: var(--text-faint); padding: 11px 14px;
  border-bottom: 1px solid var(--border); background: var(--panel); white-space: nowrap;
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); transition: background 150ms ease; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel); }
.scroll { overflow-x: auto; }

/* Tutor Answering Engine Options & Verdicts */
.opt {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; margin-bottom: 12px;
  border-radius: var(--r-lg); border: 1.5px solid var(--border);
  background: var(--surface-solid); color: var(--text);
  cursor: pointer; position: relative; user-select: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.opt:hover {
  border-color: var(--accent-border); background: var(--panel);
}
.opt .k {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; font-weight: 700; font-size: 0.84rem;
  background: var(--canvas); color: var(--text-muted); flex: none;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.opt:hover .k { border-color: var(--accent); color: var(--accent); }

/* Option Verdict States (Multi-signal OKLCH Colors) */
.opt.yes {
  border-color: oklch(0.52 0.115 155) !important;
  background: color-mix(in oklab, oklch(0.52 0.115 155) 6%, var(--surface-solid)) !important;
  box-shadow: 0 2px 10px rgba(40, 167, 69, 0.12);
}
.opt.yes .k {
  background: oklch(0.52 0.115 155) !important; color: #ffffff !important; border-color: oklch(0.52 0.115 155) !important;
}
.opt.no {
  border-color: var(--danger) !important;
  background: color-mix(in oklab, var(--danger) 6%, var(--surface-solid)) !important;
  box-shadow: 0 2px 10px rgba(220, 53, 69, 0.12);
}
.opt.no .k {
  background: var(--danger) !important; color: var(--on-accent) !important; border-color: var(--danger) !important;
}
.opt.selected {
  border-color: var(--accent) !important;
  background: color-mix(in oklab, var(--accent) 11%, var(--surface-solid)) !important;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.opt.selected .k {
  background: var(--accent) !important; color: var(--on-accent) !important; border-color: var(--accent) !important;
}
.opt.tutor-locked { cursor: default; }
.opt.tutor-locked:hover { border-color: var(--border); background: var(--surface-solid); }
.opt.tutor-locked:hover .k { border-color: var(--border-strong); color: var(--text-muted); }

/* The answer control.
 *
 * A circle when the question has exactly one correct option and a square when
 * it has several, so the shape on screen matches what the control actually
 * does — picking B after A replaces it in the first case and adds to it in the
 * second. `singleAnswer` on the delivered question is what decides, and it is
 * one bit rather than a count — neither how many options are correct nor which
 * ones is the client's to know until the server reveals them.
 *
 * Drawn only before reveal. Afterwards the letter badge carries ✓ or ✕ and a
 * second indicator beside it would be noise on the one screen that is finally
 * allowed to just answer the question. */
.opt-control {
  width: 20px; height: 20px; flex: none; margin-top: 4px;
  border: 1.5px solid var(--border-strong); background: var(--canvas);
  display: grid; place-items: center;
  transition: background 180ms ease, border-color 180ms ease;
}
.opt-control-radio { border-radius: 50%; }
.opt-control-check { border-radius: 6px; }
.opt:hover .opt-control { border-color: var(--accent); }
.opt.selected .opt-control { background: var(--accent); border-color: var(--accent); }
.opt.selected .opt-control-radio::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent);
}
/* Two borders of a rotated box is the whole tick — no glyph, so it cannot go
 * missing with a font. */
.opt.selected .opt-control-check::after {
  content: ''; width: 5px; height: 10px; margin-top: -2px;
  border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.question-stem { border-radius: var(--r-md); user-select: text; }
.question-highlight { border-radius: 3px; padding: 0 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.question-highlight-yellow { background: color-mix(in oklab, oklch(0.9 0.14 95) 70%, white); }
.question-highlight-green { background: color-mix(in oklab, oklch(0.78 0.12 145) 62%, white); }
.question-highlight-blue { background: color-mix(in oklab, oklch(0.78 0.1 245) 62%, white); }

/* Question Grid in Sidebar */
.qgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.qg {
  height: 34px; border-radius: var(--r-md); border: 1px solid var(--border-strong);
  display: grid; place-items: center; font-family: var(--f-data); font-size: 0.78rem; font-weight: 600;
  background: var(--surface-solid); color: var(--text-muted); cursor: pointer; user-select: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.qg:hover { border-color: var(--accent); color: var(--accent); }
.qg.here { border: 2px solid var(--accent); font-weight: 800; color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.qg.answered { border-color: var(--accent-border); color: var(--text); background: var(--accent-soft); }
.qg.yes { background: oklch(0.52 0.115 155); color: #ffffff; border-color: oklch(0.52 0.115 155); }
.qg.no { background: var(--danger); color: var(--on-accent); border-color: var(--danger); }
.qg.marked::after { content: "★"; font-size: 0.6rem; margin-left: 2px; color: var(--warning); }

/* Key Value Row */
.kv { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.84rem; }
.kv:last-child { border-bottom: 0; }

/* Popover & Header Dropdown Menus */
.popover-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 330px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-overlay);
  padding: 12px;
  z-index: 9999;
  animation: slideUp 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 0.84rem;
  color: var(--text);
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.popover-item:hover {
  background: var(--panel);
  transform: translateX(3px);
}
.support-popover { position: fixed; width: min(310px, calc(100vw - 16px)); }
.support-popover .popover-item { text-decoration: none; }

/* MODULE HIERARCHY & PACKAGES EXPANDABLE WINDOWS — DISAPPEARING SIBLINGS */
#systems-hierarchy-container {
  position: relative;
  min-height: 240px;
}

.sys-card-item {
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 300ms ease, border-color 250ms ease, opacity 280ms ease, visibility 280ms ease;
}

.sys-card-item.expanded {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  border-color: var(--accent-border) !important;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--accent-border);
  background: var(--surface-solid) !important;
  animation: windowExpandIn 360ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Other windows DISAPPEAR smoothly when one window expands */
#systems-hierarchy-container.has-expanded .sys-card-item:not(.expanded) {
  opacity: 0 !important;
  transform: scale(0.93) translateY(10px) !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 280ms ease, transform 280ms ease, visibility 280ms ease;
}

@keyframes windowExpandIn {
  0% {
    transform: scale(0.92) translateY(-8px);
    opacity: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  }
  70% {
    transform: scale(1.01) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Admin account directory */
.admin-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-account-card { display: block; width: 100%; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-solid); color: var(--text); text-align: left; cursor: pointer; transition: border-color 150ms ease, background 150ms ease; }
.admin-account-card:hover, .admin-account-card.is-selected { border-color: var(--accent-border); background: var(--accent-soft); }
.admin-account-card-rule { display: block; height: 1px; margin: 13px 0; background: var(--border); }
.admin-account-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--accent-border); border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--f-data); font-weight: 700; }
.admin-account-open-label { color: var(--accent); font-size: 0.75rem; font-weight: 700; }
.admin-status-pending { color: var(--warning); border-color: color-mix(in oklch, var(--warning) 35%, var(--border)); background: color-mix(in oklch, var(--warning) 8%, var(--surface-solid)); }
.admin-status-expired { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 35%, var(--border)); background: color-mix(in oklch, var(--danger) 8%, var(--surface-solid)); }
.admin-account-detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr); gap: 20px; }
.admin-account-detail, .admin-account-editor { grid-column: 1 / -1; }
.admin-account-detail-dialog { width: min(900px, 96vw); }
.admin-receipt-panel { min-height: 260px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); }
.admin-account-receipt { display: block; width: 100%; max-height: 340px; margin-top: 12px; object-fit: contain; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-solid); }
.admin-receipt-empty { display: grid; min-height: 220px; margin-top: 12px; place-items: center; border: 1px dashed var(--border-strong); border-radius: var(--r-md); color: var(--text-muted); text-align: center; }
.admin-account-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* Bank Hub active package cards */
.app.is-bank-hub .view > .stack > .panel.wide:first-child > .cols.c2 { gap: 12px; align-items: stretch; }
.app.is-bank-hub .view > .stack > .panel.wide:first-child > .cols.c2 > .panel.interactive {
  min-height: 0; padding: 14px; gap: 10px;
}
/* Package Store */
.buy-store-jump {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 16px; border-color: var(--accent-border); background: var(--accent-soft);
}
.buy-store-jump .b { flex: 0 0 auto; min-width: 132px; }
.buy-store-panel { scroll-margin-top: 18px; }
.buy-store-heading { margin-bottom: 14px; align-items: flex-end; }
.buy-store-filter-panel { padding: 12px 16px; background: var(--surface); }
.buy-store-filter-row { flex-wrap: wrap; }
.buy-store-filter-row .in { width: auto; min-width: 150px; flex: 1 1 0; }

/*
 * The guest's call to action on the Bank Hub.
 *
 * Deliberately the loudest thing on the screen: it is the only action a
 * visitor can actually complete, and the two panels under it are about a
 * purchase they cannot make yet. Accent-tinted rather than solid so it reads
 * as an invitation rather than a warning, and centred because it has no
 * neighbours to align with.
 */
.buy-guest-hero {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: clamp(24px, 4vw, 40px) 20px;
  text-align: center;
  border-color: var(--accent-border);
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent-soft) 85%, transparent),
    var(--surface-solid)
  );
}
.buy-guest-hero-title {
  margin: 2px 0 0;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.buy-guest-hero-lede {
  max-width: 54ch;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
/* Big enough to be the obvious next move, not so big it looks like a banner. */
.buy-guest-hero-btn {
  min-height: 52px;
  margin-top: 14px;
  padding-inline: clamp(28px, 6vw, 52px);
  font-size: 1rem;
  font-weight: 700;
}
/*
 * The Bank tab, for somebody with no account.
 *
 * Sits where Recent tests and Weakest topics would be, and is the same width
 * as the pair it replaces. Quieter than the Bank Hub hero — this one explains
 * an absence rather than offering the main action of the screen — so the
 * three controls are equal weight and only Contact us is filled in.
 */
.home-guest-doors {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: clamp(22px, 3.5vw, 34px) 20px;
  text-align: center;
}
.home-guest-doors-title {
  margin: 2px 0 0;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 700;
}
.home-guest-doors-lede {
  max-width: 56ch;
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.6;
}
.home-guest-doors-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
/* One size for all three, so none of them reads as the afterthought. */
.home-guest-door {
  min-height: 46px;
  min-width: 168px;
  padding-inline: 22px;
  font-size: 0.9rem;
}
@media (max-width: 560px) {
  .home-guest-doors-row { flex-direction: column; align-items: stretch; width: 100%; }
  .home-guest-door { width: 100%; min-width: 0; }
}

.buy-guest-hero-note {
  margin: 10px 0 0;
  color: var(--text-faint);
  font-size: 0.76rem;
}
@media (max-width: 640px) {
  .buy-guest-hero-btn { width: 100%; }
}

/*
 * `.in` is width:100%, which inside a wrapping flex row makes every control
 * claim a line of its own — a filter bar that reads as a stack of full-width
 * boxes rather than a row of filters. The store worked around it locally;
 * this is the same fix, named so any other filter bar can use it.
 */
.admin-filter-row .in { width: auto; min-width: 150px; flex: 1 1 0; }
.admin-filter-row .admin-filter-search { flex: 1.6 1 0; min-width: 240px; }
@media (max-width: 700px) {
  .admin-filter-row .in { flex-basis: 100%; }
}
.buy-store-search { flex: 1.45 1 0 !important; min-width: 240px; }
.buy-store-card, .buy-package-card { min-width: 0; min-height: 0; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.buy-package-card-content { min-width: 0; }
.buy-package-card-name { margin: 0; font-size: 1rem; line-height: 1.35; font-weight: 700; }
.buy-package-card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--text-muted); font-family: var(--f-data); font-size: 0.78rem; }
.buy-package-card-meta strong { color: var(--accent); font-size: 1.15rem; }
.buy-store-actions, .buy-package-card-actions { display: flex; gap: 8px; margin-top: auto; }
.buy-store-actions .b, .buy-package-card-actions .b { flex: 1; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.buy-suggested-grid .buy-package-card { min-height: 142px; }
.buy-store-empty { padding: 28px; color: var(--text-muted); text-align: center; }
.buy-store-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.buy-store-load-more { min-width: 176px; }
.buy-store-load-more[aria-busy="true"] { cursor: wait; }
.buy-package-dialog { gap: 18px; }
.buy-package-dialog-header { justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.buy-package-modal-details { display: grid; gap: 8px; }
.buy-modal-package-name { font-size: 1.2rem; font-weight: 700; line-height: 1.35; }
.buy-modal-package-context, .buy-package-modal-note { color: var(--text-muted); }
.buy-modal-package-stats { display: flex; gap: 16px; align-items: baseline; margin-top: 6px; font-family: var(--f-data); }
.buy-modal-package-stats strong:last-child { color: var(--accent); font-size: 1.2rem; }
.buy-package-modal-details p { max-width: 70ch; margin: 6px 0 0; color: var(--text-muted); line-height: 1.55; }
.buy-modal-package-items { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.buy-modal-package-items > span:not(.lbl) { padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-muted); font-size: 0.78rem; }
.buy-purchase-switch { display: flex; gap: 8px; }
.buy-purchase-switch .b { flex: 1; }
.buy-purchase-switch .b.is-selected { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.buy-friends-fields { display: grid; gap: 14px; padding: 14px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); }
.buy-friends-copy { display: grid; gap: 2px; }
.buy-friends-copy span { color: var(--text-muted); font-size: 0.82rem; }
.buy-friends-controls { align-items: flex-end; }
.buy-purchase-total { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; padding-top: 14px; border-top: 1px solid var(--border); }
.buy-purchase-total span { color: var(--text-muted); }
.buy-purchase-total strong { color: var(--accent); font-family: var(--f-data); font-size: 1.15rem; }
.buy-purchase-total small { grid-column: 1 / -1; color: var(--text-faint); }
.buy-checkout-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.buy-package-modal-note { margin: 0; font-size: 0.78rem; }
.buy-demo-dialog { gap: 18px; }
.buy-demo-modal-details { display: grid; gap: 14px; }
.buy-demo-intro { display: grid; gap: 4px; }
.buy-demo-intro span, .buy-demo-item span { color: var(--text-muted); font-size: 0.82rem; }
.buy-demo-list { display: grid; gap: 8px; }
.buy-demo-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); }
.buy-demo-item > div { display: grid; gap: 3px; min-width: 0; }
.buy-demo-item strong { overflow-wrap: anywhere; }
.exam-settings-trigger { width: 36px; height: 36px; padding: 0 !important; display: grid; place-items: center; }
.ask-question-header .ask-toolbar { margin-left: auto; justify-content: flex-end; }
.ask-toolbar { display: inline-flex; flex-direction: row-reverse; align-items: center; gap: 6px; }
.ask-toolbar .exam-settings-trigger { flex: 0 0 36px; }
.ask-toolbar .exam-timer {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px;
  border: 1px solid var(--accent-border); border-radius: var(--r-md); color: var(--accent); font-family: var(--f-data); font-size: 0.78rem; font-weight: 700;
}
.ask-highlight-wrap { position: relative; display: inline-flex; }
.ask-highlight-palette {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 20;
  display: flex; gap: 6px; padding: 8px; border: 1px solid var(--border-strong);
  border-radius: var(--r-md); background: var(--surface-solid); box-shadow: var(--shadow-overlay);
}
.ask-highlight-palette[hidden] { display: none; }
.ask-highlight-swatch { width: 28px; height: 28px; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; cursor: pointer; }
.ask-highlight-swatch[data-highlight-color="yellow"] { background: oklch(0.9 0.14 95); }
.ask-highlight-swatch[data-highlight-color="green"] { background: oklch(0.78 0.12 145); }
.ask-highlight-swatch[data-highlight-color="blue"] { background: oklch(0.78 0.1 245); }
.ask-toolbar #ask-highlight-btn.highlight-tool-yellow.on { background: color-mix(in oklab, oklch(0.9 0.14 95) 70%, white); border-color: oklch(0.72 0.12 85); color: var(--text); }
.ask-toolbar #ask-highlight-btn.highlight-tool-green.on { background: color-mix(in oklab, oklch(0.78 0.12 145) 62%, white); border-color: oklch(0.62 0.12 145); color: var(--text); }
.ask-toolbar #ask-highlight-btn.highlight-tool-blue.on { background: color-mix(in oklab, oklch(0.78 0.1 245) 62%, white); border-color: oklch(0.62 0.1 245); color: var(--text); }
.ask-highlight-swatch:hover, .ask-highlight-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ask-question-nav { justify-content: flex-end; gap: 8px; }
.ask-question-nav .icon-btn { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; }
.ask-question-nav .ask-finish-btn { min-width: 124px; min-height: 44px; padding: 0 16px; }

@media (max-width: 768px) {
  .active-session-hero > :last-child { padding-top: 16px; padding-left: 0; border-top: 1px solid var(--border); border-left: 0; }
  .admin-activation-row { align-items: stretch; flex-direction: column; }
  .admin-activation-row .b { width: 100%; }
  .app.is-bank-hub .view > .stack > .panel.wide:first-child > .cols.c2 > .panel.interactive { padding: 12px; }
  .modal-card-wide { width: min(96vw, 900px); }
  .buy-store-heading { align-items: flex-start; }
  .buy-store-jump { align-items: stretch; flex-direction: column; }
  .buy-store-jump .b { width: 100%; }
  .buy-store-filter-row { align-items: stretch; }
  .buy-store-filter-row .in { width: 100%; flex: 1 1 100%; }
  .buy-store-search { flex-basis: 100% !important; min-width: 0; }
  .buy-store-footer { align-items: stretch; flex-direction: column; }
  .buy-store-load-more { width: 100%; }
  .buy-friends-controls { align-items: stretch; flex-direction: column; }
  .buy-friends-controls .f { width: auto !important; }
  .prev-filter-control { width: 100%; flex: 1 1 100%; }
}

/* Explanation text arrives with real newlines and must keep them.
 *
 * Every one of the 329 imported explanations is written as several lines — one
 * per option, typically — and they were all rendering as a single run-on
 * paragraph, because the text is escaped into a <p> and HTML collapses
 * newlines. `pre-line` keeps the line breaks while still collapsing runs of
 * spaces and wrapping normally, which is what this text wants; `pre-wrap` would
 * also preserve the source indentation.
 */
.explain-body { white-space: pre-line; }

/* ── Import: the two upload boxes ─────────────────────────────────────────
 *
 * Two boxes rather than one input, because the workbook and its image
 * archive are different things with different rules and one of them is
 * optional. A single row of two bare file inputs made the admin guess which
 * was which; a labelled box states its own job and shows what is in it.
 */
.import-drops {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.import-drop {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-2, transparent);
  cursor: pointer;
}

.import-drop:hover,
.import-drop:focus-within {
  border-color: var(--accent);
}

.import-drop-role {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.import-drop-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

/* The chosen filename, so the box shows its own state without a re-render. */
.import-drop-file {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  overflow-wrap: anywhere;
}
