/* ATARium Phase 2B (staged) - student dashboard and analytics.
   Loaded only by student-dashboard-staging.html and subjects-staging.html.
   Subject accents come from the --sa variables set in atarium-ui.css for
   body[data-ui="v2"][data-subject-theme]; navy stays the identity colour. */

body[data-ui-stage="2b"] { --sa: var(--blue); --sa-strong: var(--navy); --sa-tint: #eaf3fb; }
body[data-ui="v2"][data-ui-stage="2b"][data-subject-theme="HUMBIO"] { --sa:#0a7857; --sa-strong:#0a6a4d; --sa-tint:#e5f3ee; }
body[data-ui="v2"][data-ui-stage="2b"][data-subject-theme="CHEM"] { --sa:#bf8613; --sa-strong:#8a5f0a; --sa-tint:#fbf1dc; }
body[data-ui="v2"][data-ui-stage="2b"][data-subject-theme="PHYS"] { --sa:#126bbd; --sa-strong:#0f5ea6; --sa-tint:#e3effa; }
body[data-ui="v2"][data-ui-stage="2b"][data-subject-theme="PSYCH"] { --sa:#7554aa; --sa-strong:#664897; --sa-tint:#efe9f7; }

/* ---------------- dashboard shell ---------------- */
.db-topbar-left { display:flex; align-items:center; gap:12px; min-width:0; }
.db-root { display:flex; flex-direction:column; gap:16px; padding-top:22px; }
.db-greeting { margin:0; color:var(--muted); font-size:12px; font-weight:750; }
.db-warning { padding:10px 14px; border:1px solid #f0d9a8; border-radius:12px; background:var(--warning-bg); color:var(--warning); font-size:12px; font-weight:700; }
.db-warning[hidden] { display:none; }
.db-loading { margin:0; color:var(--muted); font-size:13px; }
.sr-only { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.db-banner { position:relative; display:flex; align-items:center; min-height:132px; overflow:hidden; border-radius:20px; background:linear-gradient(120deg,#062447,#0b3a6b); color:#fff; box-shadow:var(--shadow-md); }
.db-skeleton { min-height:132px; background:linear-gradient(90deg,#e8eff6,#f3f7fb,#e8eff6); box-shadow:none; }
.db-banner-art { position:absolute; inset:0; background-color:#051a33; background-size:cover; background-position:right center; }
.db-banner-art::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,rgba(4,22,44,.94) 0%,rgba(4,22,44,.72) 42%,rgba(4,22,44,.1) 100%); }
.db-banner-copy { position:relative; z-index:1; display:flex; flex-direction:column; gap:4px; padding:22px 28px; max-width:720px; }
.db-banner h1 { margin:0; color:#fff; font-size:clamp(24px,3vw,34px); line-height:1.1; letter-spacing:-.02em; }
.db-banner p { margin:0; color:rgba(255,255,255,.86); font-size:14px; font-weight:600; }
.db-kicker { color:rgba(255,255,255,.75); font-size:10px; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.db-switch { align-self:flex-start; margin-top:8px; padding:6px 11px; border:1px solid rgba(255,255,255,.4); border-radius:999px; color:#fff; font-size:11.5px; font-weight:800; text-decoration:none; }
.db-switch:hover, .db-switch:focus-visible { background:rgba(255,255,255,.14); outline:none; }
.db-banner-none { background:linear-gradient(120deg,#082b55,#1267b1); }
.db-banner-none h1 { font-size:26px; }
.db-tabs { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.db-tabs a { padding:8px 14px; border-radius:999px; color:var(--navy); font-size:12.5px; font-weight:800; text-decoration:none; }
.db-tabs a:hover { background:var(--ice); }
.db-tabs a[aria-current="page"] { background:var(--sa-tint); color:var(--sa-strong); }
.db-tabs a:focus-visible { outline:3px solid rgba(49,150,230,.35); outline-offset:2px; }

/* next actions */
.db-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.db-action { display:flex; align-items:center; gap:12px; min-height:76px; padding:14px; border:1px solid var(--line); border-radius:16px; background:#fff; color:var(--ink); text-decoration:none; box-shadow:var(--shadow-sm); transition:border-color .15s, box-shadow .15s, transform .15s; }
.db-action:hover { border-color:var(--sa); box-shadow:var(--shadow-md); transform:translateY(-1px); }
.db-action:focus-visible { outline:3px solid var(--sa); outline-offset:2px; }
.db-action-icon, .db-icon { display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; width:38px; height:38px; border-radius:11px; background:var(--sa-tint); color:var(--sa-strong); }
.db-action-icon svg, .db-icon svg { width:20px; height:20px; }
.db-action-copy { display:flex; flex:1; flex-direction:column; min-width:0; }
.db-action-copy b { color:var(--navy); font-size:13.5px; }
.db-action-copy span { overflow:hidden; color:var(--muted); font-size:11.5px; font-weight:600; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.db-action-go { display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; width:30px; height:30px; border-radius:9px; background:var(--sa-strong); color:#fff; }
.db-action-go svg { width:16px; height:16px; }

/* grid + panels */
.db-grid { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:14px; }
.db-grid[hidden] { display:none; }
.db-span-3 { grid-column:span 3; } .db-span-4 { grid-column:span 4; } .db-span-6 { grid-column:span 6; } .db-span-8 { grid-column:span 8; } .db-span-12 { grid-column:span 12; }
.db-panel { display:flex; flex-direction:column; min-width:0; padding:18px; border:1px solid var(--line); border-radius:18px; background:#fff; box-shadow:var(--shadow-sm); }
.db-head { display:flex; align-items:flex-start; gap:10px; margin-bottom:12px; }
.db-head h2 { margin:0; color:var(--navy); font-size:15px; letter-spacing:-.01em; }
.db-head p { margin:2px 0 0; color:var(--muted); font-size:11.5px; font-weight:600; line-height:1.4; }
.db-icon { width:32px; height:32px; border-radius:9px; }
.db-icon svg { width:17px; height:17px; }
.db-note { margin:10px 0 0; color:var(--muted); font-size:11px; font-weight:600; line-height:1.45; }
.db-more { margin-top:auto; padding-top:10px; color:var(--sa-strong); font-size:12px; font-weight:800; text-decoration:none; }
.db-more:hover { text-decoration:underline; }
.db-sub { margin:16px 0 8px; color:var(--navy); font-size:12px; letter-spacing:.06em; text-transform:uppercase; }
.db-empty { padding:14px; border:1px dashed var(--line-strong); border-radius:14px; background:var(--ice); }
.db-empty b { display:block; color:var(--navy); font-size:13px; }
.db-empty p { margin:4px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.db-empty a { display:inline-block; margin-top:8px; color:var(--sa-strong); font-size:12px; font-weight:800; }
.db-insufficient b { display:block; color:var(--sa-strong); font-size:30px; letter-spacing:-.02em; }
.db-insufficient p { margin:4px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }

/* charts */
.db-line { display:block; width:100%; height:auto; }
.db-line .db-gridline { stroke:#e3ebf3; stroke-width:1; }
.db-axis { fill:var(--muted); font-size:11px; font-weight:600; font-family:var(--font); }
.db-path { fill:none; stroke:var(--sa); stroke-width:2.5; stroke-linejoin:round; stroke-linecap:round; }
.db-area { fill:var(--sa); opacity:.1; }
.db-dot { fill:#fff; stroke:var(--sa); stroke-width:2.5; }
.db-tag rect { fill:var(--sa-strong); }
.db-tag text { fill:#fff; font-size:11.5px; font-weight:800; font-family:var(--font); }

.db-bar { position:relative; display:block; height:10px; overflow:hidden; border-radius:999px; background:#e9eff5; }
.db-bar > span { display:block; height:100%; border-radius:inherit; background:var(--sa); }
.db-bar.good > span { background:var(--sa); }
.db-bar.mid > span { background:color-mix(in srgb, var(--sa) 62%, #fff); }
.db-bar.low > span { background:#d9822b; }
.db-bar.mc > span { background:var(--sa-strong); }
.db-bar.written > span { background:var(--sa); }
.db-bar.thin > span { background:repeating-linear-gradient(45deg,#b8c6d4 0 4px,#d3dde7 4px 8px); }
.db-bar.none > span { width:0 !important; }

.db-topics, .db-types, .db-recs, .db-work, .db-activity, .db-points, .db-legend { margin:0; padding:0; list-style:none; }
.db-topic { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"name value" "bar bar" "meta meta"; align-items:center; gap:4px 10px; padding:7px 0; }
.db-topic + .db-topic { border-top:1px solid #eef3f8; }
.db-topic-name { grid-area:name; color:var(--navy); font-size:12.5px; font-weight:750; line-height:1.3; text-decoration:none; }
a.db-topic-name:hover { color:var(--sa-strong); text-decoration:underline; }
a.db-topic-name:focus-visible { outline:2px solid var(--sa); outline-offset:2px; border-radius:4px; }
.db-topic .db-bar { grid-area:bar; }
.db-topic-value { grid-area:value; min-width:42px; color:var(--navy); font-size:12px; text-align:right; }
.db-topic-value em, .db-type-value em { color:var(--muted); font-size:11px; font-style:normal; font-weight:650; }
.db-topic-meta { grid-area:meta; color:var(--muted); font-size:10.5px; font-weight:600; }
.db-topic.none .db-topic-name { color:#7b8a98; }

.db-type { display:grid; grid-template-columns:110px minmax(40px,1fr); grid-template-areas:"name bar" "value value"; align-items:center; gap:3px 10px; padding:7px 0; }
.db-type + .db-type { border-top:1px solid #eef3f8; }
.db-type-name { grid-area:name; color:var(--navy); font-size:12.5px; font-weight:750; }
.db-type .db-bar { grid-area:bar; }
.db-type-value { grid-area:value; color:var(--muted); font-size:11px; font-weight:600; }
.db-type-value b { color:var(--navy); font-size:12px; }

.db-cover { display:flex; align-items:center; gap:14px; }
.db-donut { flex:0 0 108px; width:108px; height:108px; }
.db-donut-bg { fill:none; stroke:#e9eff5; stroke-width:12; }
.db-donut-fg { fill:none; stroke:var(--sa); stroke-width:12; stroke-linecap:round; }
.db-donut-value { fill:var(--navy); font-size:17px; font-weight:800; font-family:var(--font); }
.db-donut-label { fill:var(--muted); font-size:8.5px; font-weight:700; font-family:var(--font); }
.db-legend { display:flex; flex:1; flex-direction:column; gap:6px; min-width:0; }
.db-legend li { display:flex; align-items:center; gap:7px; color:var(--ink); font-size:11.5px; font-weight:650; }
.db-legend b { margin-left:auto; color:var(--navy); }
.db-legend .k { flex:0 0 9px; width:9px; height:9px; border-radius:3px; }
.k.good { background:var(--sa); } .k.low { background:#d9822b; } .k.none { background:#c9d5e1; } .k.gap { background:repeating-linear-gradient(45deg,#b8c6d4 0 2px,#e4ebf2 2px 4px); }
.db-points li { display:grid; grid-template-columns:auto 1fr auto; gap:8px; align-items:baseline; padding:6px 0; border-top:1px solid #eef3f8; font-size:11.5px; line-height:1.45; }
.db-code { color:var(--muted); font-size:10px; font-weight:800; white-space:nowrap; }
.db-points b { color:#b5651d; }

/* recommendations */
.db-rec { display:flex; align-items:center; gap:12px; padding:11px 12px; border:1px solid #e6edf4; border-radius:14px; background:#fbfdff; }
.db-rec + .db-rec { margin-top:8px; }
.db-rec-copy { flex:1; min-width:0; }
.db-rec-copy b { color:var(--navy); font-size:13px; }
.db-rec-copy p { margin:3px 0 0; color:var(--ink); font-size:11.5px; line-height:1.45; }
.db-refs { color:var(--muted) !important; font-weight:600; }
.db-pill { display:inline-block; margin-left:8px; padding:2px 8px; border-radius:999px; font-size:9px; font-weight:850; letter-spacing:.05em; text-transform:uppercase; vertical-align:2px; }
.db-pill.high { background:#fde9d7; color:#9a4f12; }
.db-pill.medium { background:var(--sa-tint); color:var(--sa-strong); }
.db-pill.next { background:#e9eef4; color:#4b5d70; }
.db-rec-go { flex:0 0 auto; padding:8px 11px; border-radius:10px; background:var(--sa-tint); color:var(--sa-strong); font-size:11.5px; font-weight:800; text-decoration:none; white-space:nowrap; }
.db-rec-go:hover { background:var(--sa-strong); color:#fff; }
.db-rec-go:focus-visible { outline:3px solid var(--sa); outline-offset:2px; }

/* assigned work */
.db-work-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto auto; align-items:center; gap:10px; padding:10px 0; border-top:1px solid #eef3f8; }
.db-work-row:first-child { border-top:0; }
.db-work-copy { min-width:0; }
.db-work-copy b { display:block; overflow:hidden; color:var(--navy); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.db-work-copy span { color:var(--muted); font-size:11px; font-weight:600; }
.db-due { color:var(--ink); font-size:11.5px; font-weight:700; white-space:nowrap; }
.db-work-row.overdue .db-due { color:var(--danger); }
.db-status { padding:4px 9px; border-radius:999px; font-size:10.5px; font-weight:800; white-space:nowrap; }
.db-status.todo { background:#eef2f6; color:#475a6d; }
.db-status.progress { background:#e4effa; color:#0f5ea6; }
.db-status.done { background:#eaf4ec; color:#1f6b3e; }
.db-status.released { background:var(--success-bg); color:var(--success); box-shadow:inset 0 0 0 1px rgba(31,122,68,.25); }
.db-work-go { padding:7px 10px; border:1px solid var(--line); border-radius:9px; color:var(--navy); font-size:11.5px; font-weight:800; text-decoration:none; white-space:nowrap; }
.db-work-go:hover { border-color:var(--sa); color:var(--sa-strong); }
.db-work-go:focus-visible { outline:3px solid var(--sa); outline-offset:2px; }

/* figures */
.db-figures { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.db-figures > div { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; padding:12px 16px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.db-figures span { flex-basis:100%; color:var(--muted); font-size:10px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.db-figures b { color:var(--navy); font-size:22px; letter-spacing:-.02em; }
.db-figures em { color:var(--muted); font-size:11.5px; font-style:normal; font-weight:600; }
.db-sample { margin:8px 2px 0; color:var(--muted); font-size:11px; font-weight:650; }

/* analytics */
.db-analytics-head { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:14px; }
.db-analytics-head h2 { margin:0; color:var(--navy); font-size:24px; letter-spacing:-.02em; }
.db-analytics-head p { margin:2px 0 0; color:var(--muted); font-size:13px; font-weight:600; }
.db-filters { display:flex; flex-wrap:wrap; gap:10px; }
.db-filter { display:flex; flex-direction:column; gap:3px; }
.db-filter span { color:var(--muted); font-size:9.5px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.db-filter select { min-width:150px; max-width:260px; height:38px; padding:0 30px 0 11px; border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--navy); font:700 12.5px var(--font); }
.db-filter select:focus-visible { outline:3px solid rgba(49,150,230,.3); border-color:var(--bright); }
.db-table { width:100%; margin-top:12px; border-collapse:collapse; font-size:12px; }
.db-table th { padding:6px 8px; border-bottom:1px solid var(--line); color:var(--muted); font-size:10px; font-weight:850; letter-spacing:.06em; text-align:left; text-transform:uppercase; }
.db-table td { padding:7px 8px; border-bottom:1px solid #eef3f8; color:var(--ink); font-weight:600; }
.db-table em { color:var(--muted); font-style:normal; }
.db-strengths { display:flex; flex-direction:column; gap:10px; }
.db-strength { padding:12px 14px; border-radius:14px; background:var(--sa-tint); }
.db-strength.low { background:#fdf0e3; }
.db-strength span { color:var(--muted); font-size:10px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.db-strength b { display:block; margin-top:3px; color:var(--navy); font-size:15px; }
.db-strength p { margin:3px 0 0; color:var(--muted); font-size:11.5px; font-weight:600; }
.db-activity li { display:flex; gap:12px; padding:8px 0; border-top:1px solid #eef3f8; }
.db-activity li:first-child { border-top:0; }
.db-activity time { flex:0 0 52px; color:var(--muted); font-size:11px; font-weight:800; }
.db-activity b { display:block; color:var(--navy); font-size:12.5px; }
.db-activity span { color:var(--muted); font-size:11px; font-weight:600; }

/* compact My Classes (markup shared with student-class.js) */
.db-classes { margin:0; padding:14px 18px; border:1px solid var(--line); border-radius:18px; background:#fff; box-shadow:var(--shadow-sm); }
.db-classes .join-class-row { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.db-classes .join-class-copy h2 { margin:0 0 3px; color:var(--navy); font-size:15px; }
.db-classes .join-class-copy p { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.db-classes .join-class-kicker { display:block; margin-bottom:3px; color:var(--sa-strong); font-size:9px; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.db-classes .join-class-form { display:flex; align-items:center; gap:9px; min-width:min(100%,360px); }
.db-classes .join-class-form[hidden] { display:none; }
.db-classes .join-class-form input { flex:1; min-width:0; height:40px; padding:0 12px; border:1px solid var(--line); border-radius:10px; color:var(--navy); background:#fff; font:700 13px var(--font); letter-spacing:.06em; text-transform:uppercase; }
.db-classes .join-class-form input:focus { outline:3px solid rgba(49,150,230,.18); border-color:var(--bright); }
.db-classes .join-class-form button[aria-busy="true"] { opacity:.75; cursor:progress; }
.db-classes .student-class-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:8px; margin-top:10px; }
.db-classes .student-class-list[hidden] { display:none; }
.db-classes .your-class-item { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#fbfdff; }
.db-classes .your-class-copy { min-width:0; }
.db-classes .your-class-copy h3 { margin:0; color:var(--navy); font-size:13.5px; overflow-wrap:anywhere; }
.db-classes .your-class-copy p { margin:1px 0 0; color:var(--ink); font-size:11.5px; font-weight:600; }
.db-classes .your-class-meta { display:block; color:var(--muted); font-size:10.5px; font-weight:700; }
.db-classes .your-class-view { flex:0 0 auto; min-height:34px; padding:6px 11px; font-size:12px; }
.db-classes .join-another { margin-top:8px; padding:4px 0; border:0; background:none; color:var(--sa-strong); font:800 11.5px var(--font); cursor:pointer; }
.db-classes .join-another:hover { text-decoration:underline; }
.db-classes .join-another:focus-visible { outline:3px solid rgba(49,150,230,.35); outline-offset:2px; border-radius:6px; }
.db-classes .join-class-message { margin:6px 0 0; font-size:11px; font-weight:700; }
.db-classes .join-class-message:empty { display:none; }
.db-classes .join-class-message.error { color:#a33; } .db-classes .join-class-message.success { color:#28734d; }
.db-classes.has-class .join-class-copy h2 { font-size:12px; letter-spacing:.08em; text-transform:uppercase; }
.db-classes.has-class .join-class-kicker { display:none; }

/* ---------------- responsive ---------------- */
@media (max-width:1240px) {
  .db-span-3 { grid-column:span 6; }
  .db-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:980px) {
  .db-span-4, .db-span-6, .db-span-8 { grid-column:span 12; }
}
@media (max-width:760px) {
  .app-topbar .breadcrumb { display:none; }
  .db-root { padding-top:14px; gap:12px; }
  .db-grid { grid-template-columns:1fr; gap:12px; }
  .db-span-3, .db-span-4, .db-span-6, .db-span-8, .db-span-12 { grid-column:1 / -1; }
  .db-banner { min-height:112px; border-radius:18px; }
  .db-banner-copy { padding:18px; }
  .db-banner h1 { font-size:23px; }
  .db-tabs { flex-wrap:nowrap; overflow-x:auto; padding-bottom:2px; -webkit-overflow-scrolling:touch; }
  .db-tabs a { flex:0 0 auto; }
  .db-actions { grid-template-columns:1fr; gap:10px; }
  /* Mobile order: the first action is the hero; the rest follow as compact rows. */
  .db-action:first-child { padding:16px; background:var(--sa-tint); border-color:color-mix(in srgb, var(--sa) 30%, #fff); }
  .db-figures { grid-template-columns:1fr; }
  .db-work-row { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"copy go" "due status"; }
  .db-work-copy { grid-area:copy; } .db-work-go { grid-area:go; } .db-due { grid-area:due; } .db-status { grid-area:status; justify-self:end; }
  .db-rec { flex-direction:column; align-items:stretch; }
  .db-rec-go { text-align:center; }
  .db-classes .join-class-row { flex-direction:column; align-items:stretch; }
  .db-classes .join-class-form { min-width:0; width:100%; }
  .db-filter select { min-width:0; width:100%; max-width:none; }
  .db-filters, .db-filter { width:100%; }
  .top-actions .db-start { display:none; }
}
/* Mobile hierarchy: next actions, then recommendations and assigned work, then charts. */
@media (max-width:760px) {
  [data-db-overview] #dashboard-recommendations { order:-2; }
  [data-db-overview] #dashboard-assignments { order:-1; }
}


/* Wide analytics topic list: name, bar and value on one line. */
@media (min-width:981px) { [data-db-analytics] .db-topic { grid-template-columns:minmax(0,1.4fr) minmax(80px,1fr) auto; grid-template-areas:"name bar value" "meta meta meta"; } }
.db-points-na b { color:var(--muted); font-weight:700; white-space:nowrap; }

/* ---------------- subjects overview + archive ---------------- */
.db-back { align-self:flex-start; margin-bottom:6px; color:rgba(255,255,255,.85); font-size:11.5px; font-weight:800; text-decoration:none; }
.db-back:hover, .db-back:focus-visible { color:#fff; text-decoration:underline; outline:none; }
.db-archived { display:inline-block; margin-right:4px; padding:2px 7px; border-radius:999px; background:#fff; color:#5b6b7a; font-size:9px; letter-spacing:.06em; vertical-align:1px; }
.db-archived-note { margin-top:6px !important; padding:6px 10px; border-radius:10px; background:rgba(255,255,255,.12); font-size:12px !important; }
.db-banner-archived .db-banner-art { filter:grayscale(.65); }
.db-nav-icon { display:inline-flex; width:18px; height:18px; vertical-align:-3px; }
.db-nav-icon svg { width:18px; height:18px; }
.db-action[data-subject] .db-action-copy span { -webkit-line-clamp:3; }
.db-subj { gap:12px; }
.db-subj-top { position:relative; display:flex; align-items:flex-end; min-height:92px; margin:-18px -18px 0; padding:16px 18px; overflow:hidden; border-radius:18px 18px 0 0; background:#062447; }
.db-subj-art { position:absolute; inset:0; background-size:cover; background-position:right center; }
.db-subj-art::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,rgba(4,22,44,.92) 0%,rgba(4,22,44,.55) 55%,rgba(4,22,44,.1) 100%); }
.db-subj[data-year] .db-subj-name { position:relative; z-index:1; color:#fff; }
.db-subj-name span { color:rgba(255,255,255,.78); font-size:10px; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.db-subj-name h2 { margin:2px 0 0; color:#fff; font-size:22px; letter-spacing:-.02em; }
.db-subj-figs { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:10px; }
.db-subj-figs > div { display:flex; flex-direction:column; gap:2px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#fbfdff; }
.db-subj-figs span { color:var(--muted); font-size:9.5px; font-weight:850; letter-spacing:.07em; text-transform:uppercase; }
.db-subj-figs b { color:var(--navy); font-size:20px; letter-spacing:-.02em; }
.db-subj-figs em { color:var(--muted); font-size:11px; font-style:normal; font-weight:600; }
.db-subj-focus { margin:0; color:var(--ink); font-size:12.5px; font-weight:650; }
.db-subj-focus a { color:var(--sa-strong); font-weight:800; }
.db-muted { color:var(--muted) !important; font-weight:600 !important; }
.db-subj-open { align-self:flex-start; margin-top:auto; padding:9px 13px; border-radius:11px; background:var(--sa-strong); color:#fff; font-size:12.5px; font-weight:800; text-decoration:none; }
.db-subj-open:hover { background:var(--sa); }
.db-subj-open:focus-visible { outline:3px solid var(--sa); outline-offset:2px; }
.db-subj[data-year] { border-top:0; }
.db-actions[hidden] { display:none; }
@media (max-width:980px) { .db-subj { grid-column:1 / -1; } }
body[data-db-view="hub"] [data-db-overview] #dashboard-assignments { order:0; }

[data-db-overview-wrap] { display:flex; flex-direction:column; gap:14px; }
[data-db-overview-wrap][hidden] { display:none; }

/* Neutral subject imagery for combined-unit contexts (U12, U34) and whole-subject cards.
   Same treatment as the merged practice banner (.pb-neutral): navy with the subject accent. */
.db-art-neutral {
  background:
    radial-gradient(circle at 82% 30%, var(--sa) 0, transparent 42%),
    radial-gradient(circle at 96% 92%, var(--sa-strong) 0, transparent 38%),
    linear-gradient(120deg, #062447 30%, var(--sa-strong) 140%);
}

/* Assigned work beyond the first five on a unit dashboard. */
.db-work-more { margin-top:8px; }
.db-work-more > summary { cursor:pointer; width:max-content; padding:6px 2px; color:var(--navy,#082b55); font-size:13px; font-weight:800; }
.db-work-more > summary:focus-visible { outline:3px solid var(--sa); outline-offset:2px; border-radius:6px; }
.db-work-more[open] > summary { margin-bottom:6px; }
/* Assignment titles wrap to two lines in the half-width panel instead of being cut to a
   few characters; the class line stays below. */
.db-work-copy b { white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; line-height:1.3; }

/* ======================================================================
   Visual-pack layout (17 Nov): white top bar instead of the left menu,
   compact banner, pack-style panels. Staged student dashboard only.
   Brand mark, colours and type stay ATARium's own.
   ====================================================================== */
body[data-ui-stage="2b"][data-page="student"] { background:#f4f7fb; }
@media (min-width:841px) {
  body[data-ui-stage="2b"][data-page="student"] .app-layout { display:block; }
  body[data-ui-stage="2b"][data-page="student"] .sidebar { display:none; }
}
body[data-ui-stage="2b"] .db-appbar { position:sticky; top:0; z-index:40; min-height:68px; padding:0 clamp(16px,3vw,40px); background:#fff; backdrop-filter:none; box-shadow:0 1px 0 var(--line), 0 6px 18px rgba(8,43,85,.04); }
body[data-ui-stage="2b"] .db-appbar-left { display:flex; align-items:center; gap:clamp(12px,2.2vw,34px); min-width:0; }
body[data-ui-stage="2b"] .db-brand { display:inline-flex; align-items:center; gap:10px; color:var(--navy); font-size:22px; font-weight:800; letter-spacing:-.04em; text-decoration:none; white-space:nowrap; }
body[data-ui-stage="2b"] .db-brand .brand-copy small { display:none; }
body[data-ui-stage="2b"] .db-topnav { display:flex; align-items:center; gap:4px; }
body[data-ui-stage="2b"] .db-topnav a { display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border-radius:10px; color:#22324a; font-size:14.5px; font-weight:600; text-decoration:none; white-space:nowrap; }
body[data-ui-stage="2b"] .db-topnav a svg { width:19px; height:19px; }
body[data-ui-stage="2b"] .db-topnav a:hover { background:#eef4fb; }
body[data-ui-stage="2b"] .db-topnav a[aria-current="page"] { background:var(--blue); color:#fff; box-shadow:0 6px 14px rgba(18,103,177,.25); }
body[data-ui-stage="2b"] .db-topnav a:focus-visible, body[data-ui-stage="2b"] .db-year:focus-visible, body[data-ui-stage="2b"] .db-avatar:focus-visible { outline:3px solid var(--blue); outline-offset:2px; }
body[data-ui-stage="2b"] .db-appbar .top-actions { display:flex; align-items:center; gap:14px; }
body[data-ui-stage="2b"] .db-appbar .top-actions > [data-signout] { display:none; }
body[data-ui-stage="2b"] .db-year { display:inline-flex; align-items:center; gap:8px; padding:9px 12px 9px 14px; border:1px solid var(--line); border-radius:11px; background:#fff; color:var(--navy); font-size:14.5px; font-weight:700; text-decoration:none; white-space:nowrap; }
body[data-ui-stage="2b"] .db-year svg { width:16px; height:16px; }
body[data-ui-stage="2b"] .db-bell { position:relative; border:0; background:transparent; box-shadow:none; }
body[data-ui-stage="2b"] .db-account { position:relative; }
body[data-ui-stage="2b"] .db-avatar { display:grid; width:40px; height:40px; place-items:center; border:0; border-radius:50%; background:var(--navy); color:#fff; font:800 14px/1 inherit; cursor:pointer; }
body[data-ui-stage="2b"] .db-menu { position:absolute; right:0; top:calc(100% + 8px); z-index:50; display:flex; min-width:200px; flex-direction:column; padding:6px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 16px 40px rgba(8,43,85,.16); }
body[data-ui-stage="2b"] .db-menu[hidden] { display:none; }
body[data-ui-stage="2b"] .db-menu a, body[data-ui-stage="2b"] .db-menu button { display:flex; justify-content:space-between; padding:10px 12px; border:0; border-radius:8px; background:none; color:var(--navy); font:600 14px/1.2 inherit; text-align:left; text-decoration:none; cursor:pointer; }
body[data-ui-stage="2b"] .db-menu a:hover, body[data-ui-stage="2b"] .db-menu button:hover, body[data-ui-stage="2b"] .db-menu a:focus-visible, body[data-ui-stage="2b"] .db-menu button:focus-visible { background:#eef4fb; outline:none; }
body[data-ui-stage="2b"][data-page="student"] .app-content { width:min(1600px,100%); margin:0 auto; padding:22px clamp(16px,2.4vw,36px) 56px; }

/* Banner: compact, subject icon tile, artwork right. */
body[data-ui-stage="2b"] .db-banner { min-height:96px; border-radius:16px; align-items:center; }
body[data-ui-stage="2b"] .db-banner-icon { position:relative; z-index:1; display:grid; flex:none; width:58px; height:58px; margin-left:22px; place-items:center; border:1px solid rgba(255,255,255,.35); border-radius:14px; background:var(--sa-strong); color:#fff; box-shadow:0 8px 18px rgba(0,0,0,.18); }
body[data-ui-stage="2b"] .db-banner-icon svg { width:32px; height:32px; }
body[data-ui-stage="2b"] .db-banner-copy { padding:16px 22px; gap:2px; }
body[data-ui-stage="2b"] .db-banner h1 { font-size:clamp(23px,2.4vw,30px); }
body[data-ui-stage="2b"] .db-banner p { font-size:15px; font-weight:600; color:rgba(255,255,255,.9); }
body[data-ui-stage="2b"] .db-banner .db-back { position:absolute; top:12px; right:16px; z-index:2; padding:5px 10px; border-radius:999px; background:rgba(4,22,44,.55); color:#fff; font-size:12px; font-weight:700; text-decoration:none; }
body[data-ui-stage="2b"] .db-banner-art::after { background:linear-gradient(90deg,rgba(4,22,44,.92) 0%,rgba(4,22,44,.7) 36%,rgba(4,22,44,.05) 78%); }
body[data-ui-stage="2b"] .db-mtabs { display:none; }

/* Next actions */
body[data-ui-stage="2b"] .db-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin:14px 0; }
body[data-ui-stage="2b"] .db-action { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:14px; min-height:86px; padding:14px 16px; border:1px solid var(--line); border-radius:14px; background:#fff; color:var(--navy); text-decoration:none; box-shadow:0 2px 8px rgba(8,43,85,.04); }
body[data-ui-stage="2b"] .db-action:hover { border-color:var(--sa); box-shadow:0 10px 24px rgba(8,43,85,.09); }
body[data-ui-stage="2b"] .db-action-icon { display:grid; width:46px; height:46px; place-items:center; border-radius:12px; background:var(--sa-tint); color:var(--sa-strong); }
body[data-ui-stage="2b"] .db-action-icon svg { width:24px; height:24px; }
body[data-ui-stage="2b"] .db-action-copy { display:flex; min-width:0; flex-direction:column; gap:3px; }
body[data-ui-stage="2b"] .db-action-copy b { font-size:15.5px; font-weight:800; line-height:1.2; }
body[data-ui-stage="2b"] .db-action-copy > span { overflow:hidden; color:var(--muted); font-size:13px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
body[data-ui-stage="2b"] .db-action-go { display:grid; width:auto; height:auto; place-items:center; border:0; background:none; color:#5d6f86; box-shadow:none; }
body[data-ui-stage="2b"] .db-action-go svg { width:20px; height:20px; }
body[data-ui-stage="2b"] .db-action-progress { display:flex; align-items:center; gap:8px; margin-top:6px; }
body[data-ui-stage="2b"] .db-action-progress .db-bar { flex:1; height:6px; }
body[data-ui-stage="2b"] .db-action-progress em { color:var(--navy); font-size:11.5px; font-style:normal; font-weight:700; white-space:nowrap; }

/* Panels */
body[data-ui-stage="2b"] .db-panel { padding:18px 18px 16px; border-radius:16px; box-shadow:0 2px 10px rgba(8,43,85,.04); }
body[data-ui-stage="2b"] .db-head { align-items:center; gap:12px; margin-bottom:12px; }
body[data-ui-stage="2b"] .db-head .db-icon { display:grid; width:40px; height:40px; flex:none; place-items:center; border-radius:11px; background:var(--sa-tint); color:var(--sa-strong); }
body[data-ui-stage="2b"] .db-head h2 { font-size:17px; font-weight:800; letter-spacing:-.01em; }
body[data-ui-stage="2b"] .db-head p { font-size:12.5px; }
body[data-ui-stage="2b"] .db-chip-link { display:inline-flex; align-items:center; gap:6px; margin-left:auto; padding:7px 12px; border:1px solid var(--line); border-radius:999px; color:var(--navy); font-size:12.5px; font-weight:700; text-decoration:none; white-space:nowrap; }
body[data-ui-stage="2b"] .db-chip-link svg { width:14px; height:14px; }
body[data-ui-stage="2b"] .db-foot { margin:8px 0 0; color:var(--muted); font-size:11.5px; line-height:1.4; }
body[data-ui-stage="2b"] .db-line .db-path { stroke:var(--sa); stroke-width:2.6; }
body[data-ui-stage="2b"] .db-line .db-area { fill:var(--sa); opacity:.13; }
body[data-ui-stage="2b"] .db-line .db-dot { fill:#fff; stroke:var(--sa); stroke-width:2.4; }
body[data-ui-stage="2b"] .db-line .db-tag rect { fill:var(--sa-strong); }

/* Topic bars */
body[data-ui-stage="2b"] .db-tbars { display:flex; flex-direction:column; gap:12px; }
body[data-ui-stage="2b"] .db-tbars .db-topic { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,1.3fr) 42px; align-items:center; gap:10px; padding:0; border:0; }
body[data-ui-stage="2b"] .db-tbars .db-topic-name { overflow:hidden; color:#22324a; font-size:13px; font-weight:600; text-decoration:none; text-overflow:ellipsis; white-space:nowrap; }
body[data-ui-stage="2b"] .db-tbars .db-topic-name:hover { color:var(--sa-strong); text-decoration:underline; }
body[data-ui-stage="2b"] .db-tbars .db-bar { height:12px; border-radius:4px; background:#edf2f7; }
body[data-ui-stage="2b"] .db-tbars .db-bar > span { border-radius:4px; background:var(--sa); }
body[data-ui-stage="2b"] .db-tbars .db-topic.thin .db-bar > span { opacity:.45; }
body[data-ui-stage="2b"] .db-tbars .db-topic-value { font-size:13px; text-align:right; }
body[data-ui-stage="2b"] .db-tbars .db-topic-value em { color:var(--muted); font-style:normal; }
body[data-ui-stage="2b"] .db-tbars .db-topic-flag { grid-column:1 / -1; margin-top:-8px; color:var(--muted); font-size:11px; font-weight:600; }

/* Question-type columns (axis from 0) */
body[data-ui-stage="2b"] .db-cols { display:flex; align-items:stretch; justify-content:space-around; gap:10px; height:200px; margin:0; padding:6px 0 0; background:repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#edf2f7 calc(25% - 1px),#edf2f7 25%) 0 0 / 100% calc(100% - 46px) no-repeat; list-style:none; }
body[data-ui-stage="2b"] .db-cols .db-type { display:flex; flex:1; flex-direction:column; align-items:center; gap:4px; padding:0; border:0; }
body[data-ui-stage="2b"] .db-col { position:relative; display:flex; width:min(52px,70%); flex:1; flex-direction:column; justify-content:flex-end; }
body[data-ui-stage="2b"] .db-col-bar { display:block; width:100%; border-radius:6px 6px 2px 2px; background:var(--sa); }
body[data-ui-stage="2b"] .db-type.mc .db-col-bar { background:var(--sa-strong); }
body[data-ui-stage="2b"] .db-type.thin .db-col-bar { opacity:.45; }
body[data-ui-stage="2b"] .db-col-val { margin-bottom:4px; color:var(--navy); font-size:13px; font-weight:800; text-align:center; }
body[data-ui-stage="2b"] .db-cols .db-type-name { color:#22324a; font-size:12px; font-weight:700; text-align:center; line-height:1.15; }
body[data-ui-stage="2b"] .db-cols .db-type-value { color:var(--muted); font-size:11px; font-weight:600; text-align:center; }

/* Coverage */
body[data-ui-stage="2b"] .db-cover-compact { display:grid; grid-template-columns:118px 1fr; align-items:center; gap:14px; }
body[data-ui-stage="2b"] .db-cover-compact .db-donut { width:118px; height:118px; }
body[data-ui-stage="2b"] .db-donut-fg { stroke:var(--sa); }
body[data-ui-stage="2b"] .db-cover-topics { display:flex; flex-direction:column; gap:9px; margin:0; padding:0; list-style:none; }
body[data-ui-stage="2b"] .db-cover-topics li { display:grid; grid-template-columns:18px 1fr auto; align-items:center; gap:7px; color:#22324a; font-size:12.5px; font-weight:600; }
body[data-ui-stage="2b"] .db-cover-topics li span:nth-child(2) { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body[data-ui-stage="2b"] .db-cover-ico { display:grid; color:#9fb0c3; }
body[data-ui-stage="2b"] .db-cover-ico svg { width:17px; height:17px; }
body[data-ui-stage="2b"] .db-cover-topics li.done .db-cover-ico { color:var(--sa); }
body[data-ui-stage="2b"] .db-cover-topics li.done .db-cover-ico svg circle { fill:var(--sa); stroke:var(--sa); }
body[data-ui-stage="2b"] .db-cover-topics li.done .db-cover-ico svg path { stroke:#fff; }
body[data-ui-stage="2b"] .db-cta { display:flex; align-items:center; justify-content:center; gap:8px; margin-top:14px; padding:11px 14px; border-radius:10px; background:var(--navy); color:#fff; font-size:13.5px; font-weight:800; text-decoration:none; }
body[data-ui-stage="2b"] .db-cta svg { width:16px; height:16px; }
body[data-ui-stage="2b"] .db-cta:hover { background:var(--blue); }

/* Recommendations */
body[data-ui-stage="2b"] .db-rec-rows { display:flex; flex-direction:column; gap:10px; }
body[data-ui-stage="2b"] .db-rec-rows .db-rec { display:grid; grid-template-columns:40px 1fr 28px; align-items:center; gap:12px; padding:12px 14px; border:1px solid color-mix(in srgb, var(--sa) 22%, transparent); border-radius:12px; background:color-mix(in srgb, var(--sa-tint) 70%, #fff); }
body[data-ui-stage="2b"] .db-rec-icon { display:grid; width:40px; height:40px; place-items:center; border-radius:10px; background:#fff; color:var(--sa-strong); }
body[data-ui-stage="2b"] .db-rec-icon svg { width:22px; height:22px; }
body[data-ui-stage="2b"] .db-rec-rows .db-rec-copy b { color:var(--navy); font-size:14.5px; font-weight:800; }
body[data-ui-stage="2b"] .db-rec-rows .db-rec-copy p { margin:3px 0 0; color:#3b4d64; font-size:12.5px; line-height:1.4; }
body[data-ui-stage="2b"] .db-rec-rows .db-rec-go { display:grid; width:28px; height:28px; place-items:center; padding:0; border:0; background:none; color:#3b4d64; }
body[data-ui-stage="2b"] .db-rec-rows .db-rec-go svg { width:20px; height:20px; }

/* Assigned work table */
body[data-ui-stage="2b"] .db-work-head, body[data-ui-stage="2b"] .db-work-row { display:grid; grid-template-columns:30px minmax(0,1fr) 128px 150px 24px; align-items:center; gap:10px; }
body[data-ui-stage="2b"] .db-work-head { padding:0 0 8px; border-bottom:1px solid var(--line); color:var(--navy); font-size:12px; font-weight:800; }
body[data-ui-stage="2b"] .db-work-head span:first-child { grid-column:1 / span 2; }
body[data-ui-stage="2b"] .db-work-row { padding:11px 0; border-top:1px solid #eef3f8; }
body[data-ui-stage="2b"] .db-work-icon { display:grid; width:30px; height:30px; place-items:center; border-radius:8px; background:#f1f5fa; color:#3b4d64; }
body[data-ui-stage="2b"] .db-work-icon svg { width:17px; height:17px; }
body[data-ui-stage="2b"] .db-due { font-size:13px; font-weight:600; }
body[data-ui-stage="2b"] .db-status { display:inline-flex; width:max-content; align-items:center; gap:6px; padding:5px 10px; border-radius:999px; font-size:12px; font-weight:700; }
body[data-ui-stage="2b"] .db-status svg { width:14px; height:14px; }
body[data-ui-stage="2b"] .db-work-go { display:grid; width:24px; height:24px; place-items:center; padding:0; border:0; background:none; color:#3b4d64; }
body[data-ui-stage="2b"] .db-work-go svg { width:18px; height:18px; }

/* Tablet and phone */
@media (max-width:1180px) {
  body[data-ui-stage="2b"] .db-topnav a span { display:none; }
  body[data-ui-stage="2b"] .db-topnav a { padding:9px 10px; }
  body[data-ui-stage="2b"] .db-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:840px) {
  body[data-ui-stage="2b"] .db-topnav { display:none; }
  body[data-ui-stage="2b"] .db-appbar { min-height:62px; }
  body[data-ui-stage="2b"] .db-appbar .top-actions { gap:8px; }
}
@media (max-width:760px) {
  body[data-ui-stage="2b"] .db-brand { font-size:19px; }
  body[data-ui-stage="2b"] .db-year { padding:7px 10px; font-size:13px; }
  body[data-ui-stage="2b"] .db-avatar { width:36px; height:36px; }
  body[data-ui-stage="2b"] .db-banner { min-height:88px; }
  body[data-ui-stage="2b"] .db-banner-icon { width:48px; height:48px; margin-left:14px; }
  body[data-ui-stage="2b"] .db-banner-icon svg { width:26px; height:26px; }
  body[data-ui-stage="2b"] .db-mtabs { display:flex; gap:6px; margin:12px -4px 0; padding:2px 4px 4px; overflow-x:auto; scrollbar-width:none; }
  body[data-ui-stage="2b"] .db-mtabs::-webkit-scrollbar { display:none; }
  body[data-ui-stage="2b"] .db-mtabs a { display:inline-flex; flex:none; align-items:center; gap:6px; min-height:40px; padding:8px 14px; border-radius:12px; color:#22324a; font-size:14px; font-weight:600; text-decoration:none; }
  body[data-ui-stage="2b"] .db-mtabs a svg { width:18px; height:18px; }
  body[data-ui-stage="2b"] .db-mtabs a[aria-current="page"] { background:var(--sa-tint); color:var(--sa-strong); font-weight:800; }
  body[data-ui-stage="2b"] .db-actions { grid-template-columns:1fr; }
  body[data-ui-stage="2b"] .db-work-head { display:none; }
  body[data-ui-stage="2b"] .db-work-row { grid-template-columns:30px minmax(0,1fr) 24px; grid-template-areas:"icon copy go" "icon due status"; }
  body[data-ui-stage="2b"] .db-work-icon { grid-area:icon; align-self:start; } body[data-ui-stage="2b"] .db-work-copy { grid-area:copy; }
  body[data-ui-stage="2b"] .db-work-go { grid-area:go; } body[data-ui-stage="2b"] .db-due { grid-area:due; } body[data-ui-stage="2b"] .db-status { grid-area:status; justify-self:end; }
}
/* Pack topic bars: one row per topic (name | bar | %), names wrap rather than truncate. */
body[data-ui-stage="2b"] .db-tbars .db-topic { grid-template-areas:"name bar value" "flag flag flag"; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr) 40px; row-gap:2px; }
body[data-ui-stage="2b"] .db-tbars .db-topic + .db-topic { border-top:0; }
body[data-ui-stage="2b"] .db-tbars .db-topic-name { grid-area:name; overflow:visible; white-space:normal; line-height:1.25; }
body[data-ui-stage="2b"] .db-tbars .db-bar { grid-area:bar; }
body[data-ui-stage="2b"] .db-tbars .db-topic-value { grid-area:value; min-width:0; }
body[data-ui-stage="2b"] .db-tbars .db-topic-flag { grid-area:flag; margin-top:0; }
body[data-ui-stage="2b"] .db-cover-compact { grid-template-columns:104px 1fr; gap:12px; }
body[data-ui-stage="2b"] .db-cover-compact .db-donut { width:104px; height:104px; }
body[data-ui-stage="2b"] .db-cover-topics li { align-items:start; line-height:1.25; }
body[data-ui-stage="2b"] .db-cover-topics li span:nth-child(2) { overflow:visible; white-space:normal; }
/* Columns drawn to scale: bar height = value % of the plot area; gridlines at 0/25/50/75/100. */
body[data-ui-stage="2b"] .db-cols { height:210px; padding-top:22px; background:none; }
body[data-ui-stage="2b"] .db-col { width:100%; align-items:center; background:repeating-linear-gradient(to top,#dfe7f0 0,#dfe7f0 1px,transparent 1px,transparent 25%); }
body[data-ui-stage="2b"] .db-col-bar { position:relative; width:min(52px,72%); }
body[data-ui-stage="2b"] .db-col-val { position:absolute; bottom:calc(100% + 4px); left:50%; margin:0; transform:translateX(-50%); white-space:nowrap; }
body[data-ui-stage="2b"] .db-cols .db-type-name { min-height:30px; display:flex; align-items:flex-start; }
@media (max-width:760px) {
  body[data-ui-stage="2b"] .db-appbar { gap:8px; padding:0 12px; }
  body[data-ui-stage="2b"] .db-appbar-left { gap:8px; min-width:0; flex:1; }
  body[data-ui-stage="2b"] .db-appbar .mobile-toggle { width:38px; height:38px; flex:none; border:0; background:transparent; box-shadow:none; }
  body[data-ui-stage="2b"] .db-brand { gap:7px; font-size:18px; min-width:0; }
  body[data-ui-stage="2b"] .db-brand .brand-mark { width:32px; height:32px; flex:none; border-radius:10px; font-size:16px; }
  body[data-ui-stage="2b"] .db-appbar .top-actions { flex:none; gap:6px; }
  body[data-ui-stage="2b"] .db-bell { width:36px; height:36px; }
  body[data-ui-stage="2b"] .db-banner { flex-wrap:wrap; }
  body[data-ui-stage="2b"] .db-banner .db-back { position:relative; top:auto; right:auto; order:-1; margin:12px 0 -6px 14px; }
}
@media (max-width:380px) { body[data-ui-stage="2b"] .db-brand .brand-copy { display:none; } }
/* "← All subjects" sits in the banner's text column as a small link at every width. */
body[data-ui-stage="2b"] .db-banner .db-back { position:static; order:0; align-self:flex-start; margin:0 0 4px; padding:0; background:none; color:rgba(255,255,255,.85); font-size:12px; }
body[data-ui-stage="2b"] .db-banner .db-back:hover { color:#fff; text-decoration:underline; }
@media (max-width:760px) { body[data-ui-stage="2b"] .db-banner { flex-wrap:nowrap; } body[data-ui-stage="2b"] .db-banner-copy { padding:14px 14px 14px 12px; } body[data-ui-stage="2b"] .db-banner p { font-size:13.5px; } }

/* ---- Analytics, visual-pack layout ---- */
body[data-ui-stage="2b"] .db-analytics { margin-top:6px; }
body[data-ui-stage="2b"] .db-analytics-head { display:flex; flex-wrap:wrap; align-items:center; gap:16px 18px; margin:4px 0 6px; }
body[data-ui-stage="2b"] .db-ana-icon { display:grid; width:64px; height:64px; place-items:center; border-radius:16px; background:#e6f0fb; color:var(--blue); }
body[data-ui-stage="2b"] .db-ana-icon svg { width:34px; height:34px; }
body[data-ui-stage="2b"] .db-analytics-head h2 { margin:0; color:var(--navy); font-size:clamp(26px,2.6vw,34px); font-weight:800; letter-spacing:-.025em; }
body[data-ui-stage="2b"] .db-analytics-head p { margin:4px 0 0; color:#3b4d64; font-size:15px; }
body[data-ui-stage="2b"] .db-analytics-head .db-filters { display:flex; flex-wrap:wrap; gap:12px; margin-left:auto; }
body[data-ui-stage="2b"] .db-analytics-head .db-filter { display:flex; min-width:190px; flex-direction:column; gap:2px; padding:9px 14px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 2px 8px rgba(8,43,85,.05); }
body[data-ui-stage="2b"] .db-analytics-head .db-filter span { color:#3b4d64; font-size:12px; font-weight:700; }
body[data-ui-stage="2b"] .db-analytics-head .db-filter select { padding:0; border:0; background-color:transparent; color:var(--navy); font:800 14.5px/1.3 inherit; cursor:pointer; }
body[data-ui-stage="2b"] .db-ot { display:grid; grid-template-columns:minmax(0,1fr) 230px; gap:16px; align-items:start; }
body[data-ui-stage="2b"] .db-stats { display:flex; flex-direction:column; gap:10px; padding:12px; border-radius:14px; background:#f6f9fd; }
body[data-ui-stage="2b"] .db-stat { display:grid; grid-template-columns:34px 1fr; gap:10px; padding:8px 4px; }
body[data-ui-stage="2b"] .db-stat + .db-stat { border-top:1px solid var(--line); }
body[data-ui-stage="2b"] .db-stat-icon { display:grid; width:34px; height:34px; place-items:center; color:var(--blue); }
body[data-ui-stage="2b"] .db-stat-icon svg { width:26px; height:26px; }
body[data-ui-stage="2b"] .db-stat span { display:block; color:#3b4d64; font-size:12.5px; font-weight:700; }
body[data-ui-stage="2b"] .db-stat b { display:flex; align-items:center; gap:8px; color:var(--navy); font-size:26px; font-weight:800; letter-spacing:-.02em; }
body[data-ui-stage="2b"] .db-stat em { display:block; color:var(--muted); font-size:11.5px; font-style:normal; font-weight:600; }
body[data-ui-stage="2b"] .db-delta { padding:3px 8px; border-radius:999px; font-size:12px; font-weight:800; letter-spacing:0; }
body[data-ui-stage="2b"] .db-delta.up { background:#e3f5ec; color:#0a6a4d; } body[data-ui-stage="2b"] .db-delta.down { background:#fde8e8; color:#a12a2a; }
body[data-ui-stage="2b"] .db-hbars { display:flex; flex-direction:column; gap:12px; }
body[data-ui-stage="2b"] .db-hbars .db-topic { grid-template-areas:"name bar value" "meta meta meta"; grid-template-columns:minmax(0,.95fr) minmax(0,1.4fr) auto; row-gap:1px; padding:0; border:0; }
body[data-ui-stage="2b"] .db-hbars .db-topic + .db-topic { border-top:0; }
body[data-ui-stage="2b"] .db-hbars .db-topic-name { color:#22324a; font-size:13px; font-weight:600; text-align:right; }
body[data-ui-stage="2b"] .db-hbars .db-bar { height:20px; border-radius:3px; background:#edf2f7; }
body[data-ui-stage="2b"] .db-hbars .db-bar > span { border-radius:3px; background:var(--sa); }
body[data-ui-stage="2b"] .db-hbars .db-topic.thin .db-bar > span { opacity:.45; }
body[data-ui-stage="2b"] .db-hbars .db-topic-value { font-size:13px; }
body[data-ui-stage="2b"] .db-hbars .db-topic-meta { grid-column:2 / -1; color:var(--muted); font-size:10.5px; }
body[data-ui-stage="2b"] .db-type-donut { display:grid; grid-template-columns:132px 1fr; align-items:center; gap:14px; }
body[data-ui-stage="2b"] .db-type-donut .db-donut { width:132px; height:132px; }
body[data-ui-stage="2b"] .db-tlist { display:flex; flex-direction:column; gap:4px; margin:0; padding:0; list-style:none; }
body[data-ui-stage="2b"] .db-tlist li { display:grid; grid-template-columns:12px 1fr auto; grid-template-areas:"k name val" ". em em"; align-items:center; gap:0 9px; padding:7px 10px; border-radius:9px; background:#f6f9fd; color:#22324a; font-size:13px; font-weight:600; }
body[data-ui-stage="2b"] .db-tlist .k { grid-area:k; width:11px; height:11px; border-radius:3px; background:var(--sa); }
body[data-ui-stage="2b"] .db-tlist .k.mc { background:var(--sa-strong); } body[data-ui-stage="2b"] .db-tlist .k.rest { background:#dbe5ef; }
body[data-ui-stage="2b"] .db-tlist b { grid-area:val; color:var(--navy); font-weight:800; }
body[data-ui-stage="2b"] .db-tlist em { grid-area:em; color:var(--muted); font-size:11px; font-style:normal; }
body[data-ui-stage="2b"] .db-tlist li.mc { margin-top:6px; border:1px dashed var(--line); background:#fff; }
body[data-ui-stage="2b"] .db-info { display:flex; gap:10px; margin:12px 0 0; padding:10px 12px; border-radius:10px; background:#f6f9fd; color:#22324a; font-size:12.5px; font-weight:600; }
body[data-ui-stage="2b"] .db-info svg { flex:none; width:18px; height:18px; color:var(--blue); }
body[data-ui-stage="2b"] .db-more-detail { margin-top:12px; }
body[data-ui-stage="2b"] .db-more-detail > summary { cursor:pointer; color:var(--navy); font-size:12.5px; font-weight:800; }
body[data-ui-stage="2b"] .db-more-detail[open] > summary { margin-bottom:10px; }
body[data-ui-stage="2b"] .db-hm-wrap { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:16px; align-items:start; }
body[data-ui-stage="2b"] .db-hm { display:grid; grid-template-columns:34px repeat(4,1fr); grid-template-rows:auto repeat(7,16px); gap:4px 6px; }
body[data-ui-stage="2b"] .db-hm-day { grid-column:1; color:#3b4d64; font-size:10.5px; font-weight:600; line-height:16px; }
body[data-ui-stage="2b"] .db-hm-week { grid-row:1; color:#22324a; font-size:10.5px; font-weight:700; text-align:center; }
body[data-ui-stage="2b"] .db-hm-cell { border-radius:3px; background:#e8eef6; }
body[data-ui-stage="2b"] .db-hm-cell.l1 { background:color-mix(in srgb, var(--blue) 35%, #fff); }
body[data-ui-stage="2b"] .db-hm-cell.l2 { background:color-mix(in srgb, var(--blue) 65%, #fff); }
body[data-ui-stage="2b"] .db-hm-cell.l3 { background:var(--navy); }
body[data-ui-stage="2b"] .db-hm-cell.future { background:transparent; border:1px dashed #e1e8f0; }
body[data-ui-stage="2b"] .db-hm-stats { display:flex; flex-direction:column; gap:12px; padding-left:14px; border-left:1px solid var(--line); }
body[data-ui-stage="2b"] .db-hm-stat { display:grid; grid-template-columns:24px auto; grid-template-areas:"i v" ". l"; gap:0 8px; }
body[data-ui-stage="2b"] .db-hm-stat span { grid-area:i; color:var(--blue); } body[data-ui-stage="2b"] .db-hm-stat svg { width:22px; height:22px; }
body[data-ui-stage="2b"] .db-hm-stat b { grid-area:v; color:var(--navy); font-size:19px; font-weight:800; }
body[data-ui-stage="2b"] .db-hm-stat em { grid-area:l; color:#3b4d64; font-size:11.5px; font-style:normal; font-weight:600; }
body[data-ui-stage="2b"] .db-insights-panel { background:linear-gradient(120deg,#eef5fd,#f8fbff); }
body[data-ui-stage="2b"] .db-insights { display:grid; grid-template-columns:minmax(220px,1fr) minmax(0,2fr) minmax(240px,1.4fr); align-items:center; gap:18px; }
body[data-ui-stage="2b"] .db-ins-intro { display:flex; gap:14px; align-items:center; }
body[data-ui-stage="2b"] .db-ins-icon { display:grid; flex:none; width:56px; height:56px; place-items:center; border-radius:14px; background:#dbe9f8; color:var(--blue); }
body[data-ui-stage="2b"] .db-ins-icon svg { width:30px; height:30px; }
body[data-ui-stage="2b"] .db-ins-intro h2 { margin:0; color:var(--navy); font-size:24px; font-weight:800; }
body[data-ui-stage="2b"] .db-ins-intro p { margin:4px 0 0; color:#3b4d64; font-size:13.5px; }
body[data-ui-stage="2b"] .db-insights .db-strengths { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
body[data-ui-stage="2b"] .db-insights .db-strength { padding:12px 14px; border-radius:12px; background:#fff; }
body[data-ui-stage="2b"] .db-ins-steps h3 { margin:0 0 8px; color:var(--navy); font-size:16px; font-weight:800; }
body[data-ui-stage="2b"] .db-ins-steps ul { display:flex; flex-direction:column; gap:6px; margin:0; padding:0; list-style:none; }
body[data-ui-stage="2b"] .db-ins-steps li { display:flex; gap:8px; color:#22324a; font-size:13px; font-weight:600; }
body[data-ui-stage="2b"] .db-ins-steps li svg { flex:none; width:17px; height:17px; color:var(--blue); }
@media (max-width:1180px) {
  body[data-ui-stage="2b"] .db-analytics .db-span-4 { grid-column:span 6; }
  body[data-ui-stage="2b"] .db-analytics .db-span-8 { grid-column:span 12; }
  body[data-ui-stage="2b"] .db-insights { grid-template-columns:1fr; }
}
@media (max-width:760px) {
  body[data-ui-stage="2b"] .db-analytics .db-span-4 { grid-column:1 / -1; }
  body[data-ui-stage="2b"] .db-ot { grid-template-columns:1fr; }
  body[data-ui-stage="2b"] .db-analytics-head .db-filters { margin-left:0; width:100%; }
  body[data-ui-stage="2b"] .db-analytics-head .db-filter { flex:1 1 100%; }
  body[data-ui-stage="2b"] .db-insights .db-strengths { grid-template-columns:1fr; }
  body[data-ui-stage="2b"] .db-hm-wrap { grid-template-columns:1fr; } body[data-ui-stage="2b"] .db-hm-stats { flex-direction:row; padding:10px 0 0; border:0; border-top:1px solid var(--line); }
}
body[data-ui-stage="2b"][data-db-view="analytics"] [data-db-banner] > .db-banner { display:none; }
body[data-ui-stage="2b"] .db-analytics-head { justify-content:flex-start; text-align:left; }
body[data-ui-stage="2b"] .db-analytics-head > div:not(.db-filters) { flex:1 1 360px; min-width:0; }
body[data-ui-stage="2b"] .db-analytics-head .db-filter span { text-transform:none; letter-spacing:0; }
body[data-ui-stage="2b"] .db-ot { grid-template-columns:minmax(0,1fr) 250px; }
body[data-ui-stage="2b"] .db-stat b { flex-wrap:wrap; font-size:24px; white-space:nowrap; }
/* Subject-tinted banner (pack): the shade takes the subject colour instead of plain navy. */
body[data-ui-stage="2b"] .db-banner { background:color-mix(in srgb, var(--sa-strong) 55%, #04162c); }
body[data-ui-stage="2b"] .db-banner-art::after { background:linear-gradient(90deg, color-mix(in srgb, var(--sa-strong) 62%, #04162c) 0%, color-mix(in srgb, var(--sa-strong) 52%, rgba(4,22,44,.75)) 34%, rgba(4,22,44,.04) 78%); }
body[data-ui-stage="2b"] .db-banner-archived .db-banner-art::after { background:linear-gradient(90deg,rgba(4,22,44,.92) 0%,rgba(4,22,44,.7) 36%,rgba(4,22,44,.05) 78%); }
/* Phones: the title runs almost the full width, so keep the overlay solid under it
   and let the photo show only faintly at the right edge (23 Nov legibility fix). */
@media (max-width:560px) {
  body[data-ui-stage="2b"] .db-banner-art::after { background:linear-gradient(90deg, color-mix(in srgb, var(--sa-strong) 62%, #04162c) 0%, color-mix(in srgb, var(--sa-strong) 58%, #04162c) 58%, color-mix(in srgb, var(--sa-strong) 40%, rgba(4,22,44,.55)) 100%); }
  body[data-ui-stage="2b"] .db-banner-archived .db-banner-art::after { background:linear-gradient(90deg,rgba(4,22,44,.94) 0%,rgba(4,22,44,.9) 58%,rgba(4,22,44,.55) 100%); }
}
body[data-ui-stage="2b"] .db-banner-icon { background:color-mix(in srgb, var(--sa) 85%, #fff); border-color:rgba(255,255,255,.55); }
/* Value strip */
body[data-ui-stage="2b"] .db-values { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin-top:6px; padding:16px 8px; border:1px solid var(--line); border-radius:16px; background:linear-gradient(120deg,#f1f6fc,#fbfdff); }
body[data-ui-stage="2b"] .db-value { display:flex; gap:12px; padding:2px 16px; }
body[data-ui-stage="2b"] .db-value + .db-value { border-left:1px solid var(--line); }
body[data-ui-stage="2b"] .db-value > span { flex:none; color:var(--blue); } body[data-ui-stage="2b"] .db-value svg { width:28px; height:28px; }
body[data-ui-stage="2b"] .db-value b { color:var(--navy); font-size:14.5px; font-weight:800; }
body[data-ui-stage="2b"] .db-value p { margin:3px 0 0; color:#3b4d64; font-size:12px; line-height:1.4; }
@media (max-width:980px) { body[data-ui-stage="2b"] .db-values { grid-template-columns:1fr 1fr; row-gap:14px; } body[data-ui-stage="2b"] .db-value:nth-child(3) { border-left:0; } }
@media (max-width:560px) { body[data-ui-stage="2b"] .db-values { grid-template-columns:1fr; } body[data-ui-stage="2b"] .db-value + .db-value { border-left:0; } }

/* Consolidated overview (24 Nov 2026): visible action on each recommendation, the
   newcomer panel, and the collapsible "Topic progress" section. */
body[data-ui-stage="2b"] .db-rec-btn { display:inline-flex; align-items:center; gap:4px; min-height:40px; padding:0 12px; border-radius:10px; background:var(--sa-strong); color:#fff; font-size:12.5px; font-weight:800; }
body[data-ui-stage="2b"] .db-rec-btn:hover { background:var(--navy); color:#fff; }
body[data-ui-stage="2b"] .db-rec-btn svg { width:14px; height:14px; }
body[data-ui-stage="2b"] .db-start-copy { margin:0; color:#3b4d64; font-size:14px; line-height:1.55; max-width:56ch; }
body[data-ui-stage="2b"] .db-start .db-cta { align-self:flex-start; min-height:44px; padding:0 18px; background:var(--sa-strong); }
body[data-ui-stage="2b"] .db-start .db-cta:hover { background:var(--navy); }
body[data-ui-stage="2b"] .db-tmore { display:block; padding:0; }
body[data-ui-stage="2b"] .db-tmore > summary { display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; min-height:56px; padding:12px 18px; list-style:none; cursor:pointer; border-radius:16px; }
body[data-ui-stage="2b"] .db-tmore > summary::-webkit-details-marker { display:none; }
body[data-ui-stage="2b"] .db-tmore > summary:focus-visible { outline:3px solid var(--sa); outline-offset:2px; }
body[data-ui-stage="2b"] .db-tmore-title { display:inline-flex; align-items:center; gap:10px; color:var(--navy); font-size:16px; font-weight:800; }
body[data-ui-stage="2b"] .db-tmore-title svg { width:18px; height:18px; color:var(--sa-strong); }
body[data-ui-stage="2b"] .db-tmore-sub { color:var(--muted); font-size:12.5px; font-weight:600; }
body[data-ui-stage="2b"] .db-tmore-chev { margin-left:auto; display:grid; place-items:center; color:var(--muted); transform:rotate(90deg); transition:transform .15s; }
body[data-ui-stage="2b"] .db-tmore-chev svg { width:16px; height:16px; }
body[data-ui-stage="2b"] .db-tmore[open] .db-tmore-chev { transform:rotate(-90deg); }
body[data-ui-stage="2b"] .db-tmore-body { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:20px 28px; padding:4px 18px 8px; }
body[data-ui-stage="2b"] .db-tmore-body h3 { margin:0 0 8px; color:var(--muted); font-size:11.5px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
body[data-ui-stage="2b"] .db-tmore > .db-chip-link { margin:4px 18px 16px; align-self:flex-start; display:inline-flex; }
@media (max-width:760px) {
  body[data-ui-stage="2b"] .db-tmore-body { grid-template-columns:1fr; }
  body[data-ui-stage="2b"] .db-tmore-sub { flex-basis:100%; order:3; }
}
@media (prefers-reduced-motion:reduce) { body[data-ui-stage="2b"] .db-tmore-chev { transition:none; } }
body[data-ui-stage="2b"] .db-rec-rows .db-rec { grid-template-columns:40px minmax(0,1fr) auto; }
body[data-ui-stage="2b"] .db-rec-rows .db-rec-go.db-rec-btn { display:inline-flex; width:auto; height:auto; min-height:40px; padding:0 12px; border-radius:10px; background:var(--sa-strong); color:#fff; }
body[data-ui-stage="2b"] .db-rec-rows .db-rec-go.db-rec-btn:hover { background:var(--navy); }
body[data-ui-stage="2b"] .db-rec-rows .db-rec-go.db-rec-btn svg { width:14px; height:14px; }
@media (max-width:520px) {
  body[data-ui-stage="2b"] .db-rec-rows .db-rec { grid-template-columns:40px minmax(0,1fr); }
  body[data-ui-stage="2b"] .db-rec-rows .db-rec-go.db-rec-btn { grid-column:2; justify-self:start; }
}
/* The compact chart is drawn at 330×190; in the wider overview panel keep it at a
   readable size instead of scaling its labels up with the panel width. */
body[data-ui-stage="2b"] #dashboard-progress .db-line { max-height:250px; margin:0 auto; }

/* 25 Nov: progress overview row 2 (recent results + question types), unit-tier accents. */
body[data-ui-stage="2b"] { --tier:var(--sa-strong); }
body[data-ui-stage="2b"][data-unit-tier="u34"] { --tier:var(--sa-deep,var(--sa-strong)); }
body[data-ui-stage="2b"] .db-banner-icon,
body[data-ui-stage="2b"] .db-rec-rows .db-rec-go.db-rec-btn,
body[data-ui-stage="2b"] .db-start .db-cta { background:var(--tier); }
body[data-ui-stage="2b"] .db-tmore-title svg { color:var(--tier); }
body[data-ui-stage="2b"] .db-recent { display:grid; gap:0; margin:0; padding:0; list-style:none; }
body[data-ui-stage="2b"] .db-recent li { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 0; border-bottom:1px solid #edf2f7; }
body[data-ui-stage="2b"] .db-recent li:last-child { border-bottom:0; }
body[data-ui-stage="2b"] .db-recent li > div { display:grid; gap:2px; min-width:0; }
body[data-ui-stage="2b"] .db-recent-name { overflow:hidden; color:var(--navy); font-size:13.5px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
body[data-ui-stage="2b"] .db-recent-meta { color:var(--muted); font-size:12px; }
body[data-ui-stage="2b"] .db-recent li > b { flex:none; color:var(--navy); font-size:16px; font-weight:800; font-variant-numeric:tabular-nums; }
body[data-ui-stage="2b"] .db-recent li > b.db-recent-few { color:var(--muted); font-size:13px; font-weight:700; }
body[data-ui-stage="2b"] .db-tmore-one { grid-template-columns:1fr; }
