/* Qareken SAT — admin (teacher) pages. Tokens and shared components live in app.css.
   Everything here is prefixed `adm-` and is designed mobile-first to work from 360px wide. */

/* ---------- Page layout ---------- */
.adm-page { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.adm-page .page-head { margin-bottom: 0; }
.adm-page .card-header { flex-wrap: wrap; min-height: 54px; }
.adm-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.adm-head-text { min-width: 0; }
.adm-head-text .page-title { overflow-wrap: anywhere; }
.adm-head-text .page-subtitle { overflow-wrap: anywhere; }
.adm-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 2px 0; }
.adm-back:hover { color: var(--brand-dark); }
.adm-title-badge { margin-left: 8px; vertical-align: middle; font-size: 12px; letter-spacing: 0; }
.adm-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.adm-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.adm-halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.adm-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1080px) { .adm-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .adm-halves { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .adm-page, .adm-col { gap: 16px; } .adm-two, .adm-halves { gap: 16px; } }

.adm-card-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.adm-flush { padding: 0; min-width: 0; }
.adm-flush > .empty, .adm-flush > div > .empty { padding: 28px 16px; }
.adm-inner-card { box-shadow: none; overflow: hidden; }
.adm-subhead { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.adm-tight { margin: 0; }
.adm-break { overflow-wrap: anywhere; word-break: break-word; }
.adm-center { justify-content: center; }
.adm-stack-xs { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.adm-row-tight { gap: 6px; }
.adm-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.adm-sub { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.adm-strong-link { font-weight: 700; color: var(--ink); text-decoration: none; }
.adm-strong-link:hover { color: var(--brand-dark); text-decoration: underline; }
.adm-linklike { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.adm-linklike:hover { color: var(--brand-dark); text-decoration: underline; }
.mono-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .01em; }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--bad); background: #fffafa; }
.adm-form-error[hidden] { display: none; }
.adm-danger-icon { color: var(--bad); }
.adm-danger-icon:hover:not(:disabled) { border-color: #f5c2c0; background: var(--bad-soft); }
.adm-pre { margin: 0; max-height: 220px; overflow: auto; background: var(--bg); border: 1px dashed #cfd5dd; border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-fieldset > legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 14px; }

/* ---------- KPI tiles ---------- */
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.adm-kpi { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.adm-kpi .kpi-value { font-size: 26px; overflow-wrap: anywhere; }
.adm-kpi .kpi-sub { overflow-wrap: anywhere; }
.adm-kpi-split { display: flex; flex-direction: column; font-size: 17px; line-height: 1.3; }
.adm-kpi-split small { font-size: 12px; color: var(--muted); font-weight: 600; }
.adm-kpi-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.adm-kpi-inline strong { color: var(--ink); }
@media (max-width: 640px) {
  .adm-kpi { padding: 12px 14px; }
  .adm-kpi .kpi-value { font-size: 22px; }
}
@media (max-width: 400px) { .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ---------- Toolbars & filters ---------- */
.adm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.adm-toolbar > .select, .adm-toolbar > .input { width: auto; flex: 1 1 170px; min-width: 0; max-width: 100%; }
.adm-toolbar > .check { flex: none; }
.adm-toolbar-end { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.adm-toolbar-pad { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.adm-summary-pad { padding-top: 10px; padding-bottom: 10px; background: #fafbfc; }
.adm-search { position: relative; flex: 2 1 220px; min-width: 0; }
.adm-search .input { width: 100%; padding-left: 38px; }
.adm-search > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.adm-summary-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.adm-summary-line strong { color: var(--ink); }
.adm-summary-line .icon { vertical-align: -2px; }
.adm-chip-x { display: inline-flex; align-items: center; gap: 4px; cursor: default; padding-right: 4px; }
.adm-chip-close { border: 0; background: rgba(255, 255, 255, .18); color: inherit; border-radius: 999px; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.adm-chip-close:hover { background: rgba(255, 255, 255, .32); }
@media (max-width: 640px) {
  .adm-toolbar-end { margin-left: 0; width: 100%; }
  .adm-toolbar > .select { flex-basis: calc(50% - 5px); }
}

/* ---------- Responsive data table ---------- */
.adm-table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
.adm-rtable td { vertical-align: middle; }
.adm-rtable .adm-cell { min-width: 0; }
.adm-rtable .mono { overflow-wrap: anywhere; }
.adm-rtable td.adm-primary { min-width: 160px; }
.adm-rtable td.adm-actions-cell { width: 1%; white-space: nowrap; }
.adm-rtable tr.adm-row-muted td { color: var(--muted); }
.adm-rtable tr.adm-row-muted .adm-strong-link { color: var(--muted); }
.adm-rtable tbody tr.clickable:focus-visible { outline: 3px solid rgba(252, 91, 32, .45); outline-offset: -3px; }
.adm-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.adm-sort:hover, .adm-sort.active { color: var(--ink); }
.adm-sort-idle { opacity: .3; }
.adm-actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 6px; }
.adm-name-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.adm-skill-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 150px; }
.adm-disc { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

@media (max-width: 720px) {
  .adm-table-wrap { overflow-x: visible; }
  .adm-rtable, .adm-rtable tbody, .adm-rtable tr, .adm-rtable td { display: block; width: 100%; }
  .adm-rtable thead { display: none; }
  .adm-rtable tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .adm-rtable tr:last-child { border-bottom: 0; }
  .table.adm-rtable td { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; min-width: 0; }
  .adm-rtable td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); }
  .adm-rtable td[data-label=""]::before { display: none; }
  .adm-rtable td .adm-cell { min-width: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; }
  .adm-rtable td .adm-stack-xs, .adm-rtable td .adm-skill-cell, .adm-rtable td .adm-disc { align-items: flex-end; text-align: right; min-width: 0; }
  .table.adm-rtable td.adm-primary { display: block; text-align: left; padding: 0 0 6px; font-size: 15px; min-width: 0; }
  .adm-rtable td.adm-primary .adm-cell { justify-content: flex-start; }
  .table.adm-rtable td.adm-actions-cell { display: block; width: 100%; padding: 8px 0 0; white-space: normal; }
  .adm-rtable td.adm-actions-cell .adm-cell { justify-content: flex-start; }
  .adm-rtable td.adm-actions-cell .adm-actions { flex-wrap: wrap; justify-content: flex-start; }
  .table.adm-rtable td.adm-hide-sm { display: none; }
  .table.adm-rtable tbody tr.clickable:hover td { background: none; }
  .adm-rtable tbody tr.clickable:active { background: #fafbfc; }
}

/* ---------- Lists (dashboard, detail pages) ---------- */
.adm-list { display: flex; flex-direction: column; }
.adm-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.adm-list-item:last-child { border-bottom: 0; }
a.adm-list-item:hover { background: #fafbfc; }
.adm-list-tight .adm-list-item { padding: 10px 0; }
.adm-list-main { flex: 1; min-width: 0; }
.adm-list-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-list-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.adm-list-end { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; text-align: right; }
.adm-score { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; min-width: 48px; }
.adm-score strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.adm-score span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
@media (max-width: 640px) { .adm-list-item { padding: 12px 16px; gap: 10px; } }

.adm-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 50px; padding: 3px 8px; border-radius: 8px; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); flex: none; }
.adm-delta { font-weight: 800; font-variant-numeric: tabular-nums; }
.adm-delta.up { color: var(--ok); }
.adm-delta.down { color: var(--bad); }

.adm-live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; animation: adm-pulse 1.6s ease-in-out infinite; }
.adm-live-dot.lg { width: 10px; height: 10px; background: var(--ok); }
.adm-live-title { display: inline-flex; align-items: center; gap: 8px; }
@keyframes adm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .adm-live-dot { animation: none; } }

/* ---------- Dashboard ---------- */
.adm-welcome { border-color: #ffd2bf; background: linear-gradient(180deg, var(--brand-soft), #fff 70%); }
.adm-welcome .card-header { border-bottom-color: #ffe1d3; }
.adm-welcome-title { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-dark); }
.adm-welcome-title h2 { color: var(--ink); }
.adm-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.adm-step { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.adm-step:first-child { padding-top: 0; }
.adm-step:last-child { border-bottom: 0; padding-bottom: 0; }
.adm-step-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.adm-step.done .adm-step-num { background: var(--ok); color: #fff; }
.adm-step-body { flex: 1; min-width: 0; }
.adm-step-title { font-weight: 700; margin-bottom: 2px; }
.adm-step.done .adm-step-title { color: var(--muted); text-decoration: line-through; }
.adm-step-text { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.adm-step-text .field { color: var(--ink); margin-top: 6px; }
.adm-step-actions { margin-top: 8px; }
.adm-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.adm-quick-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); font-weight: 700; font-size: 14px; min-width: 0; }
.adm-quick-item > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.adm-quick-icon { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 760px) { .adm-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .adm-quick-item { padding: 10px 12px; gap: 10px; } .adm-quick-icon { width: 34px; height: 34px; } }

/* ---------- Switch ---------- */
.adm-switch { position: relative; display: inline-flex; align-items: flex-start; gap: 12px; cursor: pointer; max-width: 100%; }
.adm-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.adm-switch-track { position: relative; flex: none; width: 42px; height: 24px; margin-top: 1px; border-radius: 999px; background: #cfd5dd; transition: background .15s; }
.adm-switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.adm-switch-input:checked + .adm-switch-track { background: var(--brand); }
.adm-switch-input:checked + .adm-switch-track .adm-switch-thumb { transform: translateX(18px); }
.adm-switch-input:focus-visible + .adm-switch-track { outline: 3px solid rgba(252, 91, 32, .45); outline-offset: 2px; }
.adm-switch-input:disabled + .adm-switch-track { opacity: .55; }
.adm-switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-switch-label { font-weight: 600; font-size: 14px; }

/* ---------- Radio cards ---------- */
.adm-radios { display: flex; flex-direction: column; gap: 8px; }
.adm-radio { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.adm-radio:hover { border-color: #c8ced6; }
.adm-radio input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.adm-radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.adm-radio > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.adm-radio-title { font-weight: 700; font-size: 14px; }
.adm-radio-text { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.adm-fixed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.adm-fixed > div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .adm-fixed { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Secrets & credentials ---------- */
.adm-secret { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.adm-secret-text { min-width: 76px; font-size: 13px; }
.adm-cred { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px dashed #cfd5dd; border-radius: 12px; background: var(--bg); }
.adm-cred-head { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--brand-dark); flex-wrap: wrap; }
.adm-cred-name { font-weight: 600; }
.adm-cred-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.adm-cred-row > span { min-width: 74px; font-size: 13px; color: var(--muted); }
.adm-cred-row > strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; overflow-wrap: anywhere; min-width: 0; }
.adm-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; align-items: center; margin: 0; }
.adm-dl dt { font-size: 13px; font-weight: 600; color: var(--muted); }
.adm-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Bulk add ---------- */
.adm-bulk-list { display: flex; flex-direction: column; gap: 8px; }
.adm-bulk-head, .adm-bulk-row {
  display: grid; gap: 8px; align-items: center;
  grid-template-columns: 28px minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 1.1fr) 34px;
  grid-template-areas: "idx name login pw del";
}
.adm-bulk-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.adm-bulk-head > span:nth-child(2) { grid-area: name; }
.adm-bulk-head > span:nth-child(3) { grid-area: login; }
.adm-bulk-head > span:nth-child(4) { grid-area: pw; }
.adm-bulk-idx { grid-area: idx; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); }
.adm-bulk-name { grid-area: name; min-width: 0; }
.adm-bulk-login { grid-area: login; min-width: 0; }
.adm-bulk-pw { grid-area: pw; display: flex; gap: 4px; min-width: 0; }
.adm-bulk-pw .input { flex: 1; min-width: 0; }
.adm-bulk-del { grid-area: del; }
.adm-bulk-err { grid-column: 2 / -1; font-size: 12px; color: var(--bad); margin-top: -2px; }
.adm-bulk-err[hidden] { display: none; }
@media (min-width: 641px) { .adm-bulk-row .input { min-height: 38px; padding: 7px 10px; font-size: 14px; } }
@media (max-width: 640px) {
  .adm-bulk-head { display: none; }
  .adm-bulk-row {
    grid-template-columns: 22px minmax(0, 1fr) 34px;
    grid-template-areas: "idx name del" ". login login" ". pw pw";
    padding: 10px; border: 1px solid var(--line); border-radius: 12px; row-gap: 6px;
  }
}

/* ---------- Issues (validation) ---------- */
.adm-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.adm-issue { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.adm-issue code { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.adm-issue.error { background: var(--bad-soft); color: #8c1d18; }
.adm-issue.warning { background: var(--warn-soft); color: #7a4f00; }

/* ---------- Groups ---------- */
.adm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
@media (max-width: 400px) { .adm-cards { grid-template-columns: minmax(0, 1fr); } }
.adm-gcard { display: flex; flex-direction: column; }
.adm-gcard.is-archived { background: #fbfbfc; }
.adm-gcard > .card-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.adm-gcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.adm-gcard-title { font-size: 17px; font-weight: 800; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; min-width: 0; }
.adm-gcard-title:hover { color: var(--brand-dark); }
.adm-gcard-desc { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.adm-gcard-stats { display: flex; flex-wrap: wrap; gap: 20px; margin-top: auto; }
.adm-stat { display: flex; flex-direction: column; line-height: 1.2; }
.adm-stat strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.adm-stat span { font-size: 12px; color: var(--muted); }
.adm-gcard-foot { justify-content: space-between; align-items: center; }

/* ---------- Heat map ---------- */
.adm-heat-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.adm-heat-wrap:focus-visible { outline: 3px solid rgba(252, 91, 32, .45); outline-offset: 2px; }
.adm-heat { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.adm-heat th, .adm-heat td { padding: 0; }
.adm-heat-sticky { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; min-width: 128px; max-width: 160px; padding: 0 10px 0 2px !important; box-shadow: 3px 0 0 #fff, 4px 0 0 var(--line); font-weight: 600; }
.adm-heat thead .adm-heat-sticky { z-index: 3; vertical-align: bottom; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-bottom: 6px !important; }
.adm-heat-sticky a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.adm-heat-sticky a:hover { color: var(--brand-dark); text-decoration: underline; }
.adm-heat-section { padding: 4px !important; border-radius: 6px; background: #f3f4f6; text-align: center; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.adm-heat-skill { width: 74px; min-width: 74px; max-width: 74px; padding: 4px 2px !important; vertical-align: bottom; text-align: center; font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--muted); overflow-wrap: anywhere; hyphens: auto; }
.adm-heat-cell { width: 74px; height: 34px; border-radius: 6px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); cursor: default; }
.adm-heat-cell.empty { color: #9aa3ad; font-weight: 500; }
.adm-heat-avg th, .adm-heat-avg td { border-top: 0; }
.adm-heat-avg .adm-heat-sticky { font-weight: 800; }
.adm-heat-avg .adm-heat-cell { box-shadow: inset 0 0 0 2px rgba(31, 35, 40, .18); }
.adm-heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.adm-heat-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.adm-heat-legend-item i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Tests: import ---------- */
.adm-json { min-height: 220px; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 2; }
.adm-json.is-drop { border-color: var(--brand); background: var(--brand-soft); }
.adm-import-result:empty { display: none; }
.adm-summary { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.adm-summary-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.adm-module-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.adm-module-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.adm-module-list li:last-child { border-bottom: 0; }

/* ---------- Test detail: questions ---------- */
.adm-qlist { display: flex; flex-direction: column; gap: 16px; }
.adm-q { padding: 18px; scroll-margin-top: 72px; }
.adm-q-inner { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.adm-q-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.adm-q-num { font-weight: 800; font-size: 16px; }
.adm-q-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-q-tags { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--muted); }
.adm-q-tags strong { color: var(--ink); font-weight: 600; }
.adm-q-passage { padding: 4px 0 4px 14px; border-left: 3px solid var(--line); font-size: 15px; line-height: 1.6; }
.adm-q-passage-rw { font-family: "Noto Serif", Georgia, "Times New Roman", serif; font-size: 16px; }
.adm-q-prompt { font-weight: 600; }
.adm-choices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.adm-choice.correct { border-color: var(--ok); background: var(--ok-soft); }
.adm-choice-letter { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #9aa3ad; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: #fff; }
.adm-choice.correct .adm-choice-letter { background: var(--ok); border-color: var(--ok); color: #fff; }
.adm-choice-body { flex: 1; min-width: 0; padding-top: 3px; }
.adm-choice-flag { flex: none; margin-top: 3px; }
.adm-spr { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--ok-soft); }
.adm-spr .field-hint { margin: 0; }
.adm-spr-answer { font-size: 14px; padding: 4px 12px; }
.adm-q-expl { border-top: 1px solid var(--line); padding-top: 12px; }
.adm-q-expl > summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); list-style-position: inside; }
.adm-q-expl[open] > summary { margin-bottom: 8px; }
.adm-q-id { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.adm-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-pills button { min-width: 34px; height: 34px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.adm-pills button:hover { border-color: var(--brand); color: var(--brand-dark); }
.adm-pills button.unscored { border-style: dashed; color: var(--muted); }
@media (max-width: 640px) { .adm-q { padding: 14px; } }

/* ---------- Test detail: item analysis ---------- */
.adm-dist { display: flex; flex-direction: column; gap: 2px; min-width: 112px; }
.adm-dist-row { display: grid; grid-template-columns: 12px minmax(56px, 1fr) 26px; align-items: center; gap: 6px; font-size: 11px; font-variant-numeric: tabular-nums; }
.adm-dist-letter { font-weight: 700; color: var(--muted); }
.adm-dist-track { height: 8px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.adm-dist-fill { display: block; height: 100%; border-radius: inherit; background: #9aa3ad; }
.adm-dist-count { text-align: right; color: var(--muted); }
.adm-dist-row.correct .adm-dist-letter, .adm-dist-row.correct .adm-dist-count { color: var(--ok); font-weight: 800; }
.adm-dist-row.correct .adm-dist-fill { background: var(--ok); }
.adm-route { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #eef0f3; }
.adm-route-hard { background: #324dc7; }
.adm-route-easy { background: #9db0f0; }
.adm-heat-legend-item i.adm-route-hard, .adm-heat-legend-item i.adm-route-easy { border-radius: 3px; }
@media (max-width: 720px) { .adm-dist { min-width: 132px; } }

/* iOS zooms into inputs under 16px — keep the JSON box at 16px on phones. */
@media (max-width: 760px) { .adm-json { font-size: 16px; } }
.adm-samples { gap: 6px; }

