/* Overview dimensions follow content. Expanded charts retain their own space. */
#view-analytics { width:100%; max-width:none; margin-inline:auto; height:auto; min-height:0; gap:18px; padding:8px 0 20px; font-variant-numeric:tabular-nums; }
#view-analytics > * { flex-shrink:0; min-width:0; }
#view-analytics button,#view-analytics select,.an-focus-dialog button,.an-detail-dialog button { font-family:inherit; }
#view-analytics button,.an-focus-dialog button { cursor:pointer; }
.an-control { display:inline-flex; align-items:center; justify-content:center; gap:4px; padding:7px 9px; border:1px solid transparent; border-radius:6px; background:transparent; color:#5a6e89; font:inherit; font-size:13px; line-height:1.4; white-space:nowrap; cursor:pointer; transition:background 150ms,color 150ms; }
.an-control:hover { background:#eaf1fc; color:#285da9; }
.an-control.is-active { background:#fff; color:#2563eb; box-shadow:0 1px 3px #24364e14; }
.an-control .ui-icon { width:18px; height:18px; }
.an-segment { display:inline-flex; align-items:center; gap:2px; padding:3px; border-radius:8px; background:#eaf0f8; }
.an-select { height:36px; max-width:100%; padding:0 22px 0 8px; border:1px solid #dce4ef; border-radius:6px; background:#fff; color:#4d6381; font:inherit; font-size:13px; cursor:pointer; }
.an-overview-bar { display:flex; align-items:center; gap:14px; min-height:52px; padding:0 0 10px; border-bottom:1px solid #e1e7f0; white-space:nowrap; }
.an-overview-bar h2 { margin:0; color:#293e5b; font-size:20px; font-weight:650; flex-shrink:0; }
.an-header-range { color:#52667f; font-size:12px; }
.an-header-values { display:flex; align-items:center; gap:20px; margin-right:auto; }
.an-header-values > span { display:flex; align-items:baseline; gap:5px; color:#52667f; font-size:12px; }
.an-header-values strong { color:#354c6b; font-size:24px; font-weight:600; letter-spacing:-.02em; }
.an-header-values small { font-size:13px; font-weight:400; color:#52667f; }
.an-header-controls,.an-header-actions { display:flex; align-items:center; gap:5px; }
.an-header-actions { gap:2px; }
.an-header-actions .an-control { padding:6px; }
.an-tier-key { display:flex; align-items:center; gap:10px; }
.an-tier-key > span { display:flex; align-items:center; gap:4px; color:var(--score-ink); font-size:12px; }
.an-tier-key i { display:block; width:6px; height:6px; border-radius:2px; background:var(--score-mark); }
.an-dates { display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:13px; color:#526a87; }
.an-dates label { display:flex; align-items:center; gap:6px; }
.an-dates input { padding:5px; border:1px solid #dce4ef; border-radius:6px; background:#fff; font:inherit; color:#485e7d; }
#view-analytics .an-workspace { display:grid; grid-template-columns:minmax(0,2fr) minmax(340px,1fr); align-items:start; gap:18px; flex:none; min-height:0; }
.an-module { padding:20px; border:1px solid #e0e7f0; border-radius:12px; background:#fff; min-width:0; }
.an-module-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.an-module-head h3 { margin:0; color:#253c59; font-size:17px; font-weight:600; line-height:1.4; }
.an-module-head p { margin:3px 0 0; color:#586d87; font-size:13px; line-height:1.5; }
.an-student-module { display:flex; flex-direction:column; min-height:0; }
.an-student-module .an-module-head > div:first-child { display:block; }
.an-student-module .an-module-head p { margin-top:5px; }
.an-map-controls { display:flex; align-items:center; gap:5px; }
.an-map-controls .an-select { height:34px; font-size:12px; }
.an-map-controls .an-control { padding:4px 6px; }
.an-student-grid { display:grid; grid-template-columns:repeat(var(--an-cols,3),minmax(0,1fr)); grid-template-rows:repeat(var(--an-rows,4),80px); align-content:start; gap:7px; min-width:0; flex:none; }
.an-student { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:6px; min-width:0; padding:12px; border:1px solid #e6ebf3; border-radius:7px; background:#f9fbfe; text-align:left; color:#405a7b; font:inherit; cursor:pointer; transition:background 150ms,opacity 150ms; }
.an-student-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:16px; font-weight:550; }
.an-student strong { font-size:22px; font-weight:600; line-height:1; }
.an-student strong small { margin-left:3px; color:#6c7e95; font-size:12px; font-weight:400; }
.an-student-rank { color:#5c718a; font-size:12px; text-align:right; }
.an-student.is-compact strong small { display:none; }
.an-student.is-compact .an-mini-track { grid-column:1/-1; }
.an-student.is-compact .an-student-rank { display:none; }
.an-student[data-score-tier] { color:var(--score-ink); background:color-mix(in srgb,var(--score-paper) 40%,white); border-color:color-mix(in srgb,var(--score-mark) 14%,#e6ecf4); }
.an-student[data-score-tier] > strong { color:var(--score-ink); }
.an-student[data-score-tier] .an-mini-fill { background:var(--score-mark); }
.an-student[data-score-tier]:hover { background:var(--score-paper); }
.an-student.is-dimmed { opacity:.32; }
.an-student-grid.is-rank { grid-auto-flow:column; grid-template-rows:repeat(var(--an-rows,4),44px); gap:8px 24px; }
.an-student-grid.is-rank .an-student { grid-template-columns:86px minmax(30px,1fr) 54px 38px; gap:8px; padding:7px 8px; border-color:transparent; border-radius:4px; background:transparent; }
.an-student-grid.is-rank .an-student:hover { background:var(--score-paper); }
.an-student-grid.is-rank .an-mini-track { grid-column:2; grid-row:1; }
.an-student-grid.is-rank strong { grid-column:3; grid-row:1; text-align:right; font-size:22px; }
.an-student-grid.is-rank .an-student .an-student-rank { display:inline-flex; align-items:center; justify-content:flex-end; grid-column:4; grid-row:1; }
.an-tier-label { display:inline-flex; align-items:center; justify-content:center; padding:4px 5px; border-radius:4px; background:var(--score-paper); color:var(--score-ink); font-size:11px; font-weight:600; }
.an-mini-track { position:relative; display:block; height:8px; width:100%; border-radius:3px; background:#e9eef6; }
.an-zero-axis { position:absolute; top:-2px; width:1px; height:12px; background:#aebdd0; }
.an-mini-fill { position:absolute; height:8px; border-radius:4px; background:#5485e4; }
.an-mini-fill.negative { background:#bf7769; }
.an-map-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:16px; padding-top:12px; border-top:1px solid #f0f3f8; min-height:24px; }
.an-map-legend { display:flex; flex-wrap:wrap; gap:10px; color:#586f8b; font-size:12px; }
.an-pager { display:flex; align-items:center; gap:5px; }
.an-pager > span { margin-right:3px; color:#586f8b; font-size:12px; white-space:nowrap; }
.an-pager button { display:grid; place-items:center; width:32px; height:32px; padding:0; border:1px solid #dce4f0; border-radius:5px; background:#fff; color:#55749a; }
.an-pager button:disabled { opacity:.3; cursor:default!important; }
.an-pager svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.8; }
.an-selection { display:flex; align-items:center; justify-content:space-between; gap:6px; padding:3px 8px; margin-bottom:8px; color:#345e9c; background:#f1f6ff; font-size:13px; border-radius:6px; }
.an-selection[hidden] { display:none; }
.an-selection .an-control { padding:5px 7px; font-size:12px; }
.an-hybrid-aside { display:grid; grid-template-rows:auto auto; align-content:start; gap:18px; min-width:0; }
.an-hybrid-aside .an-module-head { margin-bottom:16px; }
.an-hybrid-aside .an-module-head p { display:none; }
.an-hybrid-aside .an-sources { gap:14px; padding:0 0 3px; }
.an-hybrid-aside .an-source-row { grid-template-columns:78px minmax(0,1fr) 60px; gap:10px; font-size:14px; }
.an-hybrid-aside .an-source-bars { height:28px; }
.an-hybrid-aside .an-source-half i { height:25px; }
.an-hybrid-aside .an-source-half b { font-size:12px; padding-inline:5px; }
.an-hybrid-aside .an-source-legend { margin:0 0 14px; font-size:12px; }
.an-student-grid.is-empty { grid-template-columns:1fr; grid-template-rows:100px; }
.an-primary-column { display:flex; flex-direction:column; gap:18px; min-width:0; }
.an-pending-roster { margin-top:22px; padding-top:18px; border-top:1px solid #e6ecf4; }
.an-pending-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:13px; }
.an-pending-heading h4 { margin:0; color:#3b506a; font-size:15px; font-weight:600; }
.an-pending-heading h4 span { margin-left:6px; color:#60748e; font-size:13px; font-weight:400; }
.an-pending-heading > span { color:#60748e; font-size:12px; }
.an-pending-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:8px; }
.an-pending-student { display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; padding:10px 12px; border:1px solid #e8edf4; border-radius:7px; background:#f7f9fc; color:#3b526f; text-align:left; font:inherit; font-size:14px; cursor:pointer; }
.an-pending-student > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.an-pending-student > small { color:#60748e; font-size:12px; white-space:nowrap; }
.an-pending-student:hover { border-color:#b1c4df; background:#eef3fa; }
.an-pending-student.is-dimmed { opacity:.5; }
.an-day-chart { display:grid; grid-template-columns:repeat(var(--an-days),minmax(0,1fr)); gap:8px; height:100%; }
.an-day-column { display:flex; flex-direction:column; align-items:center; gap:9px; min-width:0; }
.an-day-column > strong { color:#345579; font-size:13px; font-weight:600; }
.an-day-column > small { color:#526a87; font-size:12px; white-space:nowrap; }
.an-day-track { position:relative; display:block; width:100%; flex:1; min-height:70px; }
.an-day-zero { position:absolute; left:0; right:0; height:1px; background:#d5dfed; }
.an-day-bar { position:absolute; left:22%; width:56%; border-radius:4px; background:#6c93cb; }
.an-day-bar.negative { background:#bd7061; }
.an-day-bar.zero { background:#9aaabd; }
.an-pager button[hidden] { display:none; }
.an-preview { display:flex; flex-direction:column; align-items:stretch; min-width:0; padding:20px; border:1px solid #e0e7f0; border-radius:12px; background:#fff; text-align:left; color:#304763; }
.an-preview:hover { border-color:#9db7dc; }
.an-preview-heading { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.an-preview-heading strong { font-size:17px; font-weight:600; }
.an-preview-heading > .ui-icon { width:17px; height:17px; color:#7c8da5; }
.an-preview-subtitle { margin-top:6px; color:#586e89; font-size:13px; }
.an-preview-visual { display:block; min-width:0; height:150px; margin:16px 0 12px; }
.an-thumbnail { display:block; width:100%; height:100%; }
.an-thumbnail text { fill:#586e89; font:12px -apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif; }
.an-preview-foot { color:#586e89; font-size:12px; }
.an-secondary-previews { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.an-secondary-preview { display:flex; align-items:center; gap:14px; min-width:0; padding:17px; border:1px solid #e0e7f0; border-radius:10px; background:#fff; text-align:left; color:#405879; }
.an-secondary-preview:hover { border-color:#a4bad9; }
.an-secondary-preview > span:first-child { flex-shrink:0; }
.an-secondary-preview strong { display:block; font-size:15px; font-weight:550; }
.an-secondary-preview small { display:block; margin-top:5px; color:#596f89; font-size:12px; }
.an-secondary-chart { display:block; width:100px; min-width:40px; height:54px; margin-left:auto; }
.an-secondary-preview > .ui-icon { width:17px; height:17px; color:#7487a1; flex-shrink:0; }
.an-preview-empty { display:flex; flex-direction:column; justify-content:center; align-items:center; height:100%; gap:7px; color:#5a708b; font-size:14px; }
.an-preview-empty > span { font-size:12px; }
.an-secondary-chart .an-preview-empty > span { display:none; }
.an-bottom-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:28px; }
.an-bottom-bar > div { display:flex; align-items:center; flex-wrap:wrap; gap:16px; color:#586e89; font-size:13px; }
.an-bottom-bar b { color:#415b7b; font-weight:550; margin-left:3px; }
.an-bottom-bar .an-method-note { color:#60758e; font-size:12px; }
.an-bottom-bar > .an-control { border-color:#dce4ef; background:#fff; font-size:13px; }
.an-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; min-height:100px; padding:15px; grid-column:1/-1; grid-row:1/-1; text-align:center; color:#586e89; font-size:14px; line-height:1.6; }
.an-empty > .ui-icon { width:28px; height:28px; color:#95a8c4; }
.an-no-scope { display:grid; place-items:center; }
.an-positive-dot,.an-negative-dot { display:inline-block; width:6px; height:6px; flex-shrink:0; border-radius:2px; background:#5485e4; }
.an-negative-dot { background:#bf7769; }
.an-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.an-source-legend { display:flex; align-items:center; gap:7px; color:#6b7789; font-size:12px; margin:4px 0 16px; }
.an-source-legend .an-positive-dot { margin-left:12px; }
.an-legend-end { margin-left:auto; }
.an-sources { display:flex; flex-direction:column; gap:22px; padding:7px 0 12px; }
.an-source-row { display:grid; grid-template-columns:65px minmax(0,1fr) 54px; gap:10px; align-items:center; font-size:13px; color:#59677d; }
.an-source-row > strong { text-align:right; font-weight:600; }
.an-source-bars { display:flex; height:22px; }
.an-source-half { position:relative; display:flex; align-items:center; flex:1; min-width:0; }
.an-source-half i { position:absolute; height:20px; background:#dce8ff; border-radius:3px; }
.an-source-half b { position:relative; z-index:1; font-size:12px; font-weight:500; padding:0 5px; color:#355c99; }
.an-source-half.is-left { justify-content:flex-end; border-right:1px solid #bcc8d9; }
.an-source-half.is-left i { right:0; background:#f3d9d3; }
.an-source-half.is-left b { color:#9a453c; }
.an-source-half.is-right i { left:0; }
.an-positive { color:#2563eb; }
.an-negative { color:#b63d3d; }
.an-zero { color:#64748b; }
.an-unit { font-size:12px; color:#6b7789; white-space:nowrap; padding-top:3px; }
.an-chart-scroll { min-width:0; overflow-x:auto; scrollbar-color:#ccd8e8 transparent; scrollbar-width:thin; }
.an-trend { width:100%; height:auto; display:block; overflow:visible; }
.an-trend text { fill:#69788f; font-size:12px; font-family:inherit; }
.an-trend g[role=button] { cursor:pointer; outline:none; }
.an-trend g[role=button]:hover .an-chart-bar,.an-trend g[role=button]:focus-visible .an-chart-bar { stroke:#263b5a; stroke-width:2px; }
.an-gridline { stroke:#edf1f7; stroke-dasharray:3 4; }
.an-axis { stroke:#bbc9db; }
.an-chart-bar.an-positive { fill:#6694ed; }
.an-chart-bar.an-negative { fill:#ca786e; }
.an-chart-bar.an-zero { fill:#8e9db2; }
.an-chart-bar.an-missing { fill:#dbe2ec; }
:is(#view-analytics,.an-focus-dialog) .an-heat-scroll { overflow-x:auto; max-width:100%; scrollbar-color:#ccd8e8 transparent; scrollbar-width:thin; }
:is(#view-analytics,.an-focus-dialog) .an-heat-table { border-collapse:separate; border-spacing:4px; width:100%; font-size:12px; }
:is(#view-analytics,.an-focus-dialog) .an-heat-table th { font-weight:450; color:#68778d; white-space:nowrap; padding:5px 1px; text-align:center; }
:is(#view-analytics,.an-focus-dialog) .an-heat-table th:first-child { position:sticky; left:0; z-index:1; background:#fff; min-width:62px; text-align:left; padding-right:8px; font-size:13px; }
:is(#view-analytics,.an-focus-dialog) .an-heat-cell { width:100%; min-width:36px; height:32px; border:1px solid transparent; border-radius:4px; font-size:12px; font-variant-numeric:tabular-nums; padding:0 4px; transition:box-shadow 150ms; }
:is(#view-analytics,.an-focus-dialog) .an-heat-cell:hover { border-color:#788ba7; }
:is(#view-analytics,.an-focus-dialog) .an-heat-legend { display:flex; align-items:center; flex-wrap:wrap; gap:11px; font-size:12px; color:#67768d; margin-top:16px; }
:is(#view-analytics,.an-focus-dialog) .an-heat-legend span { display:flex; align-items:center; gap:4px; }
:is(#view-analytics,.an-focus-dialog) .an-heat-legend i { display:inline-block; width:10px; height:10px; border-radius:2px; }
:is(#view-analytics,.an-focus-dialog) .an-distribution { display:flex; gap:7px; align-items:stretch; padding-top:7px; }
:is(#view-analytics,.an-focus-dialog) .an-distribution-bin { flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:10px; border:1px solid transparent; border-radius:7px; background:transparent; padding:8px 3px; color:#69788e; font-size:12px; }
:is(#view-analytics,.an-focus-dialog) .an-distribution-bin:hover,:is(#view-analytics,.an-focus-dialog) .an-distribution-bin.is-active { border-color:#bdd0ef; background:#f3f7ff; }
:is(#view-analytics,.an-focus-dialog) .an-distribution-bin strong { color:#314763; font-weight:600; font-size:16px; }
:is(#view-analytics,.an-focus-dialog) .an-distribution-bin small { font-size:12px; font-weight:400; }
:is(#view-analytics,.an-focus-dialog) .an-distribution-track { display:flex; align-items:flex-end; justify-content:center; height:124px; width:100%; border-bottom:1px solid #e0e7f0; }
:is(#view-analytics,.an-focus-dialog) .an-distribution-track i { width:72%; max-width:45px; background:#8aadee; border-radius:4px 4px 0 0; min-height:0; }
:is(#view-analytics,.an-focus-dialog) .an-distribution-bin.is-active i { background:#2563eb; }
:is(#view-analytics,.an-focus-dialog) .an-chart-note { font-size:12px; color:#6c7a8e; line-height:1.7; margin-top:14px; }
dialog.an-detail-dialog { position:fixed; inset:12px 12px 12px auto; margin:0; width:min(600px,calc(100vw - 24px)); max-width:none; height:calc(100dvh - 24px); max-height:none; border:0; border-radius:16px; box-shadow:-12px 0 50px #172b4929; font-variant-numeric:tabular-nums; }
dialog.an-detail-dialog::backdrop { background:#182a4540; }
dialog.an-detail-dialog .dialog-panel { padding:20px 24px; }
dialog.an-detail-dialog .dialog-panel > section { margin-top:28px; }
dialog.an-detail-dialog .dialog-panel > section .an-module-head { margin-bottom:15px; }
.an-detail-scope { font-size:12px; color:#62748d; line-height:1.7; }
.an-detail-total { padding:22px 0; border-bottom:1px solid #e6ecf4; }
.an-detail-total > span { font-size:12px; color:#64748b; }
.an-detail-total > strong { display:block; margin:8px 0 12px; font-size:42px; font-weight:600; line-height:1; }
.an-detail-total small { font-size:13px; font-weight:400; color:#64748b; }
.an-detail-total p { font-size:12px; color:#64748b; }
.an-detail-total p span { margin-left:20px; }

/* Large charts live only inside focus mode, leaving the overview height bounded. */
dialog.an-focus-dialog { width:min(1180px,calc(100vw - 48px)); height:calc(100dvh - 48px); max-height:calc(100dvh - 48px); border-radius:14px; font-variant-numeric:tabular-nums; }
dialog.an-focus-dialog .paper-dialog-header { padding:16px 24px; }
dialog.an-focus-dialog .dialog-panel { padding:0 24px 24px; }
dialog.an-focus-dialog .dialog-footer { padding:10px 24px; }
.an-focus-tabs { display:flex; flex-wrap:wrap; gap:5px; position:sticky; top:0; z-index:4; background:#fff; padding:14px 0; border-bottom:1px solid #e6ebf3; }
.an-focus-tabs .an-control { color:#596c88; }
.an-focus-tabs .an-control.is-active { background:#edf4ff; color:#2563eb; box-shadow:none; }
.an-focus-scope { font-size:13px; color:#63768e; padding:15px 0 20px; line-height:1.6; }
.an-focus-content { min-width:0; }
.an-focus-content > .an-module-head { margin-bottom:24px; }
.an-focus-content > .an-chart-scroll { width:100%; }
.an-focus-content .an-trend { max-height:450px; min-height:240px; }
.an-focus-content .an-sources { max-width:850px; gap:35px; padding-block:20px; }
.an-focus-content .an-source-row { font-size:13px; grid-template-columns:80px minmax(0,1fr) 80px; }
.an-focus-content .an-source-bars,.an-focus-content .an-source-half i { height:30px; }
.an-focus-content .an-source-half b { font-size:12px; }
.an-focus-students { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.an-focus-content .an-distribution { max-width:850px; margin-inline:auto; }
.an-focus-content .an-distribution-track { height:250px; }
.an-focus-content .an-distribution-bin { font-size:12px; }
.an-focus-content .an-distribution-bin strong { font-size:23px; }
.an-focus-content .an-distribution-track i { max-width:90px; }
.an-focus-matches { margin-top:25px; }
.an-focus-matches h4 { font-size:13px; font-weight:550; margin-bottom:12px; color:#405778; }
.an-focus-dialog .an-heat-cell { min-width:32px; height:28px; }
.an-focus-dialog .an-heat-table { width:100%; }
.an-detail-total[data-score-tier] strong { color:var(--score-ink); }

/* Two rows of usable data, with full-size lower panels instead of tiny entry tiles. */
#view-analytics .an-workspace.an-dashboard-grid { grid-template-columns:minmax(0,2fr) minmax(340px,1fr); grid-template-rows:auto minmax(280px,1fr); align-items:stretch; min-height:calc(100dvh - 220px); gap:18px; }
.an-dashboard-grid > .an-module { min-width:0; padding:18px; }
.an-dashboard-grid .an-module-head { margin-bottom:14px; }
.an-dashboard-grid .an-student-grid.is-rank { grid-template-rows:repeat(var(--an-rows,4),40px); row-gap:6px; }
.an-dashboard-grid .an-map-footer { margin-top:12px; padding-top:9px; }
.an-insight-card,.an-level-card,.an-trace-card { display:flex; flex-direction:column; min-width:0; }
.an-panel-controls { display:flex; align-items:center; gap:5px; flex-shrink:0; }
.an-panel-controls .an-control { font-size:12px; padding:6px 8px; }
.an-insight-card .an-module-head,.an-level-card .an-module-head { flex-wrap:wrap; gap:10px; }
.an-panel-controls { margin-left:auto; }
.an-insight-body { display:flex; flex-direction:column; justify-content:center; flex:1; min-height:210px; }
.an-insight-body > .an-day-chart { flex:1; min-height:210px; padding:14px 0 6px; }
.an-insight-body > .an-day-chart .an-day-track { min-height:140px; }
.an-insight-body > .an-day-chart .an-day-column > strong { font-size:15px; }
.an-insight-body > .an-thumbnail { height:240px; }
.an-insight-body .an-sources { gap:20px; padding:8px 0; }
.an-insight-body .an-source-row { grid-template-columns:72px minmax(0,1fr) 58px; gap:10px; font-size:14px; }
.an-insight-body .an-source-bars { height:32px; }
.an-insight-body .an-source-half i { height:28px; }
.an-insight-body .an-source-half b { font-size:13px; }
.an-insight-body .an-source-legend { font-size:12px; }
#view-analytics .an-trace-card .an-heat-table { width:100%; border-spacing:4px; font-size:13px; }
#view-analytics .an-trace-card .an-heat-table th:first-child { min-width:78px; font-size:14px; }
#view-analytics .an-trace-card .an-heat-cell { min-width:32px; height:30px; font-size:14px; }
#view-analytics .an-trace-card .an-heat-legend { display:none; }
.an-trace-window { display:flex; justify-content:flex-end; margin:-5px 0 8px; }
.an-trace-window .an-select { height:30px; font-size:12px; }
.an-trace-footer { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:auto; padding-top:12px; }
.an-trace-footer > span { color:#526c89; font-size:12px; }
.an-trace-footer > div { display:flex; gap:4px; }
.an-trace-footer .an-control { font-size:12px; padding:5px 7px; }
.an-control:disabled { opacity:.4; cursor:default!important; }
.an-analysis-note { margin:12px 0 0; color:#5d738d; font-size:12px; line-height:1.6; }
.an-grade-bars { display:flex; flex-direction:column; justify-content:center; gap:13px; flex:1; }
.an-grade-row { display:grid; grid-template-columns:82px minmax(30px,1fr) 45px 35px; align-items:center; gap:9px; padding:6px 0; border:0; background:transparent; text-align:left; color:#304b6d; font:inherit; border-radius:6px; cursor:pointer; }
.an-grade-row:hover,.an-grade-row.is-selected { background:var(--score-paper); }
.an-grade-row:disabled { cursor:default!important; }
.an-grade-name { color:var(--score-ink); font-size:16px; font-weight:600; }
.an-grade-name small { display:block; margin-top:3px; color:#5d738d; font-size:11px; font-weight:400; }
.an-grade-track { display:block; height:10px; border-radius:5px; background:#edf1f7; }
.an-grade-track i { display:block; height:100%; border-radius:5px; background:var(--score-mark); }
.an-grade-row > strong { font-size:20px; font-weight:600; color:#304b6d; white-space:nowrap; text-align:right; }
.an-grade-row > strong small { font-size:12px; font-weight:400; }
.an-grade-percent { text-align:right; color:#526c89; font-size:12px; }
.an-upgrade-list { display:flex; flex-direction:column; gap:0; flex:1; }
.an-upgrade-row { display:grid; grid-template-columns:minmax(0,1fr) 38px auto; align-items:center; gap:12px; padding:10px 0; border:0; border-bottom:1px solid #edf1f7; background:transparent; text-align:left; color:#304b6d; font:inherit; cursor:pointer; }
.an-upgrade-row:last-child { border-bottom:0; }
.an-upgrade-row:hover { background:#f4f7fc; }
.an-upgrade-row > span:first-child { font-size:15px; }
.an-upgrade-row > span:first-child small { display:block; margin-top:3px; color:#5d738d; font-size:12px; }
.an-upgrade-row > strong { color:#3d5e85; font-size:14px; font-weight:550; white-space:nowrap; }
.an-focus-content .an-grade-bars,.an-focus-content .an-upgrade-list { max-width:800px; }
.an-focus-content .an-grade-row { padding-block:13px; }
.an-focus-content .an-grade-name { font-size:18px; }

@media(max-width:1250px) {
 .an-overview-bar { gap:10px; } .an-header-range { display:none; } .an-header-values { gap:14px; } .an-header-values strong { font-size:22px; } .an-tier-key { gap:8px; } .an-tier-key > span { font-size:11px; } .an-header-controls .an-select { max-width:100px; }
 .an-map-controls .an-select { max-width:100px; } .an-module-head { align-items:flex-start; } .an-student-module .an-module-head p { max-width:190px; }
 .an-secondary-preview { flex-wrap:wrap; } .an-secondary-chart { order:1; flex-basis:100%; height:46px; } .an-secondary-preview>.ui-icon { margin-left:auto; }
}
@media(max-width:1050px) {
 .an-overview-bar { flex-wrap:wrap; gap:9px 14px; } .an-header-values { margin-right:auto; } .an-header-controls { margin-left:auto; }
 #view-analytics .an-workspace { grid-template-columns:minmax(0,1.7fr) minmax(320px,1fr); gap:16px; }
 .an-module,.an-preview { padding:17px; } .an-module-head h3,.an-preview-heading strong { font-size:16px; }
 .an-student-module .an-module-head { flex-wrap:wrap; gap:12px; } .an-map-controls { margin-left:auto; }
 .an-hybrid-aside .an-source-row { grid-template-columns:65px minmax(0,1fr) 45px; gap:8px; font-size:13px; }
 .an-bottom-bar .an-method-note { display:none; }
 #view-analytics .an-workspace.an-dashboard-grid { grid-template-columns:minmax(0,1.7fr) minmax(320px,1fr); gap:16px; }
 .an-panel-controls .an-control { padding:6px; }
 .an-grade-row { grid-template-columns:76px minmax(20px,1fr) 40px 32px; gap:7px; }
}
@media(max-width:760px) {
 #view-analytics { gap:14px; padding-top:4px; }
 .an-overview-bar { gap:10px; } .an-overview-bar h2 { font-size:18px; } .an-header-values { gap:12px; } .an-header-values strong { font-size:21px; } .an-header-values>span { font-size:12px; }
 .an-header-controls { margin-left:0; } .an-tier-key { margin-left:auto; } .an-header-actions .an-control { padding:7px; }
 #view-analytics .an-workspace { grid-template-columns:minmax(0,1fr); gap:16px; } .an-primary-column { gap:16px; }
 .an-hybrid-aside { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
 .an-hybrid-aside .an-source-row { grid-template-columns:58px minmax(0,1fr) 40px; gap:6px; font-size:12px; } .an-hybrid-aside .an-source-half b { font-size:11px; padding-inline:3px; }
 .an-preview-visual { height:150px; } .an-preview-subtitle { font-size:12px; }
 .an-secondary-preview { padding:15px; } .an-secondary-preview strong { font-size:14px; }
 .an-pending-grid { grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); }
 .an-bottom-bar { flex-wrap:wrap; gap:12px; } .an-bottom-bar>div { gap:12px; font-size:12px; }
 dialog.an-focus-dialog { width:calc(100vw - 16px); height:calc(100dvh - 16px); max-height:calc(100dvh - 16px); } dialog.an-focus-dialog .dialog-panel { padding:0 16px 20px; }
 .an-focus-tabs { gap:3px; padding-block:12px; } .an-focus-tabs .an-control { font-size:12px; padding:7px; }
 .an-focus-content .an-source-row { grid-template-columns:64px minmax(0,1fr) 48px; gap:7px; font-size:13px; } .an-focus-content .an-distribution-track { height:180px; }
 dialog.an-detail-dialog { inset:auto 0 0; margin:0; width:100%; max-width:100%; height:90dvh; border-radius:16px 16px 0 0; }
 #view-analytics .an-workspace.an-dashboard-grid { grid-template-columns:minmax(0,1fr); grid-template-rows:auto; min-height:0; gap:16px; }
 .an-dashboard-grid > .an-module { padding:17px; }
 .an-insight-body > .an-day-chart { height:240px; flex:none; }
 .an-grade-row { grid-template-columns:90px minmax(30px,1fr) 45px 35px; }
 .an-trace-footer { flex-wrap:wrap; }
}
@media(max-width:520px) {
 .an-header-values { order:1; width:100%; justify-content:space-between; } .an-header-controls { margin-left:auto; } .an-tier-key { order:2; margin-left:0; } .an-header-actions { order:2; margin-left:auto; }
 .an-hybrid-aside { grid-template-columns:minmax(0,1fr); } .an-secondary-previews { gap:12px; } .an-secondary-preview { padding:13px; }
 .an-map-legend { gap:6px; font-size:12px; } .an-pager>span { font-size:12px; } .an-map-footer { flex-wrap:wrap; gap:12px; }
 .an-student-grid.is-rank .an-student { grid-template-columns:76px minmax(20px,1fr) 49px 34px; gap:6px; padding-inline:4px; }
 .an-student-name { font-size:15px; } .an-pending-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .an-pending-student { padding:9px; font-size:14px; gap:6px; }
}
@media(prefers-reduced-motion:reduce) { #view-analytics *,dialog.an-detail-dialog *,dialog.an-focus-dialog * { transition:none!important; animation:none!important; } }
#view-analytics .an-quiet-period { padding:24px; min-height:0; }
.an-quiet-period h3 { margin:0; font-size:19px; }
.an-quiet-period p { margin:6px 0 16px; color:#566479; }
.an-period-actions,.an-period-roster { display:flex; flex-wrap:wrap; gap:8px; }
.an-quiet-period details { margin-top:20px; padding-top:12px; border-top:1px solid #dde4ec; }
.an-quiet-period summary { cursor:pointer; color:#405570; }
.an-period-roster { margin-top:12px; }

/* Landscape overview keeps all four panels within the available content height. */
@media (min-width:900px) and (orientation:landscape) {
  #view-analytics { height:100%; padding:0; gap:10px; }
  #view-analytics > .an-overview-bar { min-height:44px; padding-bottom:6px; gap:10px; flex-wrap:wrap; }
  #view-analytics > .an-bottom-bar { min-height:26px; gap:8px; }
  #view-analytics .an-workspace.an-dashboard-grid {
    flex:1 1 0; min-height:0;
    grid-template-columns:minmax(0,1.8fr) minmax(300px,1fr);
    grid-template-rows:minmax(0,1fr) minmax(0,1fr); gap:10px;
  }
  #view-analytics .an-dashboard-grid > .an-module { min-height:0; padding:12px 14px; }
  #view-analytics .an-module-head { margin-bottom:8px; gap:6px; flex-wrap:nowrap; }
  #view-analytics .an-module-head h3 { font-size:16px; }
  #view-analytics .an-module-head p { font-size:12px; margin-top:2px; }
  #view-analytics .an-map-controls { gap:3px; }
  #view-analytics .an-student-grid { flex:1 1 0; min-height:0; grid-template-rows:repeat(var(--an-rows,1),minmax(0,1fr)); align-content:stretch; gap:4px 12px; }
  #view-analytics .an-student-grid.is-rank { grid-template-rows:repeat(var(--an-rows,1),minmax(0,1fr)); }
  #view-analytics .an-student-grid .an-student { padding:4px 6px; }
  #view-analytics .an-student-grid.is-rank .an-student { grid-template-columns:minmax(50px,1fr) minmax(20px,.9fr) 48px 30px; gap:5px; }
  #view-analytics .an-student-name { font-size:14px; }
  #view-analytics .an-student strong { font-size:19px; }
  #view-analytics .an-map-footer { margin-top:6px; padding-top:5px; gap:5px; }
  #view-analytics .an-map-legend { display:none; }
  #view-analytics .an-pager { margin-left:auto; font-size:11px; }
  #view-analytics .an-pending-roster { margin-top:5px; padding-top:4px; display:flex; align-items:center; justify-content:space-between; gap:6px; }
  #view-analytics .an-pending-heading { margin:0; }
  #view-analytics .an-pending-heading h4 { font-size:12px; }
  #view-analytics .an-pending-heading > span,#view-analytics .an-pending-grid { display:none; }
  #view-analytics .an-insight-body { min-height:0; }
  #view-analytics .an-insight-body > .an-day-chart { min-height:0; height:auto; padding:4px 0; }
  #view-analytics .an-insight-body .an-day-track { min-height:0; }
  #view-analytics .an-insight-body .an-sources { gap:8px; padding:0; }
  #view-analytics .an-insight-body .an-source-bars { height:24px; }
  #view-analytics .an-insight-body .an-source-half i { height:20px; }
  #view-analytics .an-source-legend { margin-bottom:5px; }
  #view-analytics .an-trace-card .an-heat-cell { height:26px; font-size:13px; }
  #view-analytics .an-trace-card .an-heat-table { border-spacing:3px; font-size:12px; }
  #view-analytics .an-trace-window { margin:0 0 3px; }
  #view-analytics .an-trace-window .an-select { height:25px; }
  #view-analytics .an-trace-footer { padding-top:4px; }
  #view-analytics .an-analysis-note { margin-top:5px; font-size:11px; line-height:1.35; }
  #view-analytics .an-grade-bars { gap:3px; min-height:0; }
  #view-analytics .an-grade-row { padding:2px 0; gap:6px; grid-template-columns:74px minmax(20px,1fr) 36px 30px; }
  #view-analytics .an-grade-name { font-size:14px; }
  #view-analytics .an-grade-name small { margin-top:0; font-size:10px; }
  #view-analytics .an-grade-row > strong { font-size:17px; }
  #view-analytics .an-upgrade-row { padding:3px 0; gap:5px; }
  #view-analytics .an-upgrade-row > span:first-child { font-size:13px; }
  #view-analytics .an-upgrade-row > span:first-child small { display:inline; margin-left:5px; font-size:11px; }
  #view-analytics .an-upgrade-row > strong { font-size:12px; }
}

/* Statistics context and summary share the main navigation line. */
body[data-page="analytics"] .topbar-left { display:none; }
body[data-page="analytics"] .navigation-center-track { flex:1 1 0; width:auto; }
body[data-page="analytics"] .navigation-center-track > .topbar-center { width:100%; gap:14px; }
#topbarCtrl-analytics.active { display:flex; flex:1; min-width:0; align-items:center; gap:14px; }
.an-top-range { display:flex; align-items:center; gap:0; flex-shrink:0; padding:2px; border:1px solid #d7e2f0; background:#f6f9ff; border-radius:99px; }
.an-top-range .an-control { font-size:13px; padding:6px; border-radius:99px; }
.an-top-range .an-control > span { margin-left:5px; }
.an-top-values { display:flex; align-items:center; justify-content:center; gap:12px; flex:1; }
.an-top-values .an-control { display:flex; align-items:baseline; justify-content:center; gap:6px; min-height:36px; padding:5px 12px; border:1px solid #d7e2f0; border-radius:999px; background:#f6f9ff; color:#526b8b; font-size:12px; white-space:nowrap; }
.an-top-values .an-control:hover { background:#eaf2ff; border-color:#bed1ec; }
.an-top-values .an-control:focus-visible { outline:2px solid #5689cc; outline-offset:2px; }
.an-top-values strong { font-size:22px; color:#314e70; font-weight:650; font-variant-numeric:tabular-nums; }
.an-top-field { flex-shrink:0; width:110px; border-radius:999px; background-color:#f6f9ff; border-color:#d7e2f0; }
.an-top-search { font-size:11px; color:#566d87; background:#f6f9ff; border:1px solid #d7e2f0; border-radius:999px; padding:5px 8px; white-space:nowrap; }
.an-range-choices { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:16px; padding:4px; background:#eef3fa; border-radius:9px; }
.an-level-key { display:flex; align-items:center; gap:10px; font-size:11px; color:#526c85; }
.an-level-key > span { color:var(--score-ink); white-space:nowrap; }
.an-level-key .an-control { margin-left:auto; padding:3px; }
@media (min-width:900px) and (max-width:1200px) {
 body[data-page="analytics"] .topbar { gap:6px; }
 body[data-page="analytics"] #gk-class-picker { max-width:164px; padding:8px; overflow:hidden; text-overflow:ellipsis; font-size:12px; }
 body[data-page="analytics"] .navigation-center-track > .topbar-center,#topbarCtrl-analytics.active { gap:7px; }
 .an-top-range .an-control { font-size:12px; padding:5px 3px; }
 .an-top-values { gap:4px; }
 .an-top-values .an-control { gap:4px; padding-inline:7px; font-size:11px; }
 .an-top-values strong { font-size:18px; }
 .an-top-field { width:97px; font-size:12px; }
}
@media (max-width:899px) {
 #topbarCtrl-analytics.active { flex:none; }
 .an-top-values { gap:6px; }
 .an-top-values strong { font-size:18px; }
}

body[data-page="analytics"] .topbar .an-top-field {
  margin-left:auto;
  appearance:none;
  -webkit-appearance:none;
  border-radius:999px;
  padding-left:13px;
  padding-right:27px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%234d6381' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 10px center;
  background-size:12px;
}
