:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f4;
  --ink: #162126;
  --muted: #637278;
  --line: #d9e1e4;
  --blue: #2d6fbd;
  --teal: #0f6f61;
  --green: #177245;
  --amber: #8f5b08;
  --coral: #b83f38;
  --slate: #42535a;
  --focus: #174ea6;
  --shadow: 0 18px 50px rgba(27, 45, 52, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body.drilldown-open {
  overflow: hidden;
}

button,
select {
  font: inherit;
}

button {
  font-family: inherit;
}

button:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(23, 78, 166, 0.42);
  outline-offset: 3px;
}

.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;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-150%);
  border-radius: 6px;
  background: var(--focus);
  color: #ffffff;
  padding: 9px 12px;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  background: #152229;
  color: #f7fbfc;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dff3ee;
  color: #0d554a;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #a8b8bd;
  font-size: 13px;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 11px 12px;
  background: transparent;
  color: #c7d4d8;
  text-align: left;
  cursor: pointer;
}

.nav-item span {
  display: inline-block;
  width: 24px;
  color: #7d979f;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.sidebar-note {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 18px;
}

.sidebar-note span,
.sidebar-note strong {
  display: block;
}

.sidebar-note span {
  color: #9fb1b7;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-note strong {
  font-size: 15px;
  margin-top: 5px;
}

.workspace {
  padding: 22px;
  min-width: 0;
}

.topbar,
.panel,
.summary-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  border-radius: 6px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(720px, 1.25fr);
  gap: 20px;
  align-items: end;
}

.topbar-title {
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.15;
}

.topbar p,
.panel-head p {
  color: var(--muted);
  margin-top: 5px;
  font-size: 14px;
}

.mode-switch,
.period-switch,
.quick-scope,
.priority-filter {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.mode-switch button,
.period-switch button,
.quick-scope button,
.priority-filter button {
  border: 0;
  background: transparent;
  color: var(--slate);
  padding: 8px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.scope-switch {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 540px;
}

.scope-switch button {
  font-size: 12px;
  padding: 7px 9px;
}

.mode-switch button.active,
.period-switch button.active,
.quick-scope button.active,
.priority-filter button.active {
  background: var(--surface);
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(22, 33, 38, 0.08);
}

.topbar-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 10px;
  align-items: end;
}

.hidden-control {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.period-switch {
  justify-self: end;
}

label {
  color: var(--muted);
  font-size: 12px;
  display: grid;
  gap: 6px;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #ffffff;
  padding: 9px 10px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #ffffff;
  padding: 9px 10px;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.4;
}

.page-view[hidden] {
  display: none;
}

.summary-grid {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.summary-grid article {
  border-radius: 6px;
  padding: 17px;
}

.summary-controls {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 10px 12px;
}

.summary-controls > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quick-scope {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary-grid span,
.summary-grid small {
  display: block;
  color: var(--muted);
}

.summary-grid span {
  font-size: 13px;
}

.summary-grid strong {
  display: block;
  font-size: 27px;
  line-height: 1;
  margin: 10px 0 8px;
}

.headline-metric,
.metric-link {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  padding: 0;
  cursor: pointer;
}

.headline-metric {
  font-size: inherit;
  line-height: inherit;
}

.metric-link:hover,
.headline-metric:hover {
  text-decoration: underline;
}

.metric-link:focus-visible,
.headline-metric:focus-visible {
  outline: 3px solid rgba(45, 111, 189, 0.22);
  outline-offset: 3px;
  border-radius: 4px;
}

.summary-grid small {
  font-size: 12px;
}

.main-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.84fr) minmax(310px, 0.88fr);
  grid-template-areas: "trend distribution insight";
  gap: 16px;
  align-items: start;
}

.trend-panel {
  grid-area: trend;
}

.main-grid > .panel {
  max-height: 640px;
  overflow: auto;
}

.distribution-chart {
  min-height: 170px;
}

.main-grid > .panel:nth-child(2) {
  grid-area: distribution;
}

.insight-panel {
  grid-area: insight;
}

.panel {
  border-radius: 6px;
  padding: 14px;
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 13px;
  color: var(--slate);
  margin-bottom: 8px;
}

.status-badge,
.priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--blue);
  background: #eaf1ff;
  font-size: 12px;
  font-weight: 700;
}

.chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.insight-strip {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.insight-strip.compact {
  grid-template-columns: 1fr;
}

.insight-strip span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  color: var(--muted);
  background: #fbfcfc;
  font-size: 11px;
  min-width: 0;
}

.insight-strip strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-strip .secure strong {
  color: var(--green);
}

.insight-strip .developing strong {
  color: var(--amber);
}

.insight-strip .support strong {
  color: var(--coral);
}

.evidence-grid {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.main-grid .evidence-grid {
  max-height: 210px;
  overflow: auto;
  padding-right: 3px;
}

.evidence-head,
.evidence-pill,
.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.evidence-head strong {
  color: var(--ink);
  font-size: 13px;
}

.evidence-head span,
.evidence-pill span,
.rank-row span,
.row-context {
  color: var(--muted);
  font-size: 12px;
}

.evidence-pill {
  border-radius: 6px;
  padding: 7px 8px;
  background: #fbfcfc;
}

.rank-list {
  display: grid;
  gap: 9px;
}

.rank-row {
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1.15fr) 54px;
  border-radius: 6px;
  padding: 8px;
  background: #fbfcfc;
}

.filter-action:hover {
  border-color: rgba(45, 111, 189, 0.45);
  background: #f3f8ff;
}

.filter-action.active {
  border-color: rgba(45, 111, 189, 0.55);
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(45, 111, 189, 0.16);
}

.filter-action:focus-visible {
  outline: 3px solid rgba(45, 111, 189, 0.22);
  outline-offset: 2px;
}

.rank-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 2px;
}

.stack-bar {
  display: flex;
  height: 10px;
  min-width: 120px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.stack-bar span {
  display: block;
  height: 100%;
}

.stack-bar .secure {
  background: var(--green);
}

.stack-bar .developing {
  background: var(--amber);
}

.stack-bar .support {
  background: var(--coral);
}

.row-context {
  margin-top: 3px;
}

.axis-label,
.chart-label {
  fill: var(--muted);
  font-size: 12px;
}

.chart-value {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.profile-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.intervention-counts {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.intervention-counts:empty {
  display: none;
}

.intervention-count-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.intervention-count-head strong {
  color: var(--ink);
  font-size: 13px;
}

.intervention-count-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.intervention-count-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.intervention-count-grid button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  padding: 9px;
  text-align: left;
  cursor: pointer;
}

.intervention-count-grid button:hover,
.intervention-count-grid button:focus-visible {
  border-color: rgba(45, 111, 189, 0.42);
  background: #f4f8ff;
}

.intervention-count-grid button:focus-visible {
  outline: 3px solid rgba(45, 111, 189, 0.22);
  outline-offset: 2px;
}

.intervention-count-grid strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.intervention-count-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(145deg, #0b7f78, #0e5968);
  font-weight: 800;
}

.profile-main h2 {
  font-size: 17px;
  margin-bottom: 4px;
}

.profile-main p {
  color: var(--muted);
  font-size: 13px;
}

.tag-row,
.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tag-row span,
.tag-row button,
.mini-tags span,
.mini-tags button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--slate);
  background: #f8fafb;
  font-size: 11px;
}

.tag-row button,
.mini-tags button,
.group-link {
  cursor: pointer;
}

.tag-row button:hover,
.mini-tags button:hover {
  border-color: rgba(45, 111, 189, 0.45);
  color: var(--blue);
  background: #f3f8ff;
}

.profile-tabs {
  display: flex;
  gap: 18px;
  padding: 10px 0 0;
  border-bottom: 1px solid var(--line);
}

.profile-tabs button {
  border: 0;
  background: transparent;
  color: var(--slate);
  font-size: 13px;
  padding: 0 0 10px;
  cursor: pointer;
}

.profile-tabs button.active {
  color: var(--blue);
  border-bottom: 3px solid var(--blue);
}

.profile-tabs button:focus-visible {
  outline-offset: 5px;
}

.insight-block {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.insight-block:first-of-type {
  border-top: 0;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li {
  margin: 5px 0;
  color: var(--slate);
  line-height: 1.35;
  font-size: 12px;
}

.gap-link,
.student-link,
.group-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: #075bd7;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.gap-link:hover,
.student-link:hover,
.group-link:hover {
  text-decoration: underline;
}

.gap-link:focus-visible,
.student-link:focus-visible,
.group-link:focus-visible,
.tag-row button:focus-visible,
.mini-tags button:focus-visible {
  outline-offset: 4px;
}

.age-scale {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral) 0 30%, var(--amber) 30% 50%, #9bcf55 50% 72%, var(--green) 72% 100%);
  margin: 12px 2px 9px;
}

.age-scale span {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid #ffffff;
  transform: translate(-50%, -50%);
}

.age-labels {
  display: flex;
  justify-content: space-between;
  color: var(--slate);
  font-size: 11px;
  gap: 8px;
}

.age-guide p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

.age-boxplot {
  position: relative;
  height: 34px;
  margin: 12px 4px 8px;
}

.age-boxplot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 16px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral) 0 30%, var(--amber) 30% 50%, #9bcf55 50% 72%, var(--green) 72% 100%);
  opacity: 0.34;
}

.box-line {
  position: absolute;
  top: 17px;
  height: 6px;
  border-radius: 999px;
  background: rgba(22, 33, 38, 0.34);
}

.box-mean,
.box-dot {
  position: absolute;
  top: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translateX(-50%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(22, 33, 38, 0.15);
}

.box-mean {
  background: var(--ink);
}

.box-dot {
  width: 12px;
  height: 12px;
  top: 14px;
  background: var(--slate);
}

.lower-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.8fr);
  gap: 16px;
}

.input-page {
  margin-top: 16px;
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.planning-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  gap: 16px;
}

.planning-hero {
  grid-column: 1 / -1;
}

.planning-year {
  grid-column: 1 / -1;
}

.planning-progression-panel {
  grid-column: 1 / -1;
}

.planning-readiness {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.planning-readiness article {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  padding: 12px;
}

.planning-readiness span,
.planning-readiness small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.planning-readiness strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  margin: 4px 0;
}

.plan-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding-right: 3px;
}

.plan-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 11px;
  text-align: left;
  cursor: pointer;
}

.plan-card strong {
  color: var(--ink);
}

.plan-card span,
.plan-meta {
  color: var(--muted);
  font-size: 12px;
}

.plan-status {
  justify-self: start;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 4px 8px;
}

.plan-status.secure {
  background: #eaf8f0;
  color: var(--green);
}

.plan-status.developing {
  background: #fff4e5;
  color: #8a5a00;
}

.plan-status.support {
  background: #fff0ef;
  color: var(--coral);
}

.plan-reality {
  display: grid;
  gap: 7px;
}

.guardrail-list {
  display: grid;
  gap: 8px;
}

.guardrail-item {
  display: grid;
  grid-template-columns: 44px minmax(90px, 0.45fr) minmax(90px, 0.45fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 9px;
}

.guardrail-item span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.guardrail-item strong {
  color: var(--ink);
}

.guardrail-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.guardrail-item small {
  color: var(--muted);
  font-size: 12px;
}

.progression-path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.85fr) minmax(0, 1fr);
  gap: 12px;
}

.progression-column {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
  padding: 10px;
}

.progression-column.current {
  background: #f4f8ff;
  border-color: rgba(45, 111, 189, 0.35);
}

.progression-column header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.progression-column header span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.progression-column header strong {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.progression-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 9px;
  text-align: left;
  cursor: pointer;
}

.progression-item:hover {
  border-color: rgba(45, 111, 189, 0.55);
}

.progression-item span,
.progression-item small,
.progression-current-card span,
.progression-current-card small,
.progression-current-card em {
  color: var(--muted);
  font-size: 12px;
}

.progression-item strong,
.progression-current-card strong {
  color: var(--ink);
}

.progression-current-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: #ffffff;
  padding: 12px;
}

.progression-current-card.developing {
  border-left-color: var(--amber);
}

.progression-current-card.support {
  border-left-color: var(--coral);
}

.progression-current-card em {
  font-style: normal;
}

.year-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.term-lane {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
  min-height: 280px;
  padding: 10px;
}

.term-lane.now {
  border-color: rgba(45, 111, 189, 0.45);
  background: #f4f8ff;
}

.term-lane header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 8px;
}

.term-lane header span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.term-now-marker {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #dfe9f3;
  margin: 2px 0 9px;
}

.term-now-marker span {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: var(--blue);
}

.term-blocks {
  display: grid;
  gap: 7px;
}

.timeline-group {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.timeline-group[open] {
  box-shadow: 0 8px 20px rgba(15, 35, 52, 0.05);
}

.timeline-group summary {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 9px 10px;
}

.timeline-group summary::-webkit-details-marker {
  display: none;
}

.timeline-group summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  grid-column: 1;
  align-self: center;
}

.timeline-group[open] summary::before {
  transform: rotate(45deg);
}

.timeline-group summary strong {
  color: var(--ink);
  font-size: 13px;
}

.timeline-group summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.timeline-group-items {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  background: #fbfcfc;
  padding: 8px;
}

.timeline-group.intervention-group {
  border-color: rgba(238, 154, 46, 0.45);
}

.timeline-group.intervention-group summary {
  background: #fffaf3;
}

.timeline-block {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  background: #ffffff;
  cursor: grab;
  padding: 8px;
  text-align: left;
}

.timeline-block:active {
  cursor: grabbing;
}

.timeline-block.selected {
  outline: 2px solid rgba(45, 111, 189, 0.45);
  outline-offset: 1px;
}

.timeline-block.secure {
  border-left-color: var(--green);
}

.timeline-block.developing {
  border-left-color: var(--amber);
}

.timeline-block.support {
  border-left-color: var(--coral);
}

.timeline-block.support-block {
  background: #fffaf3;
  cursor: pointer;
}

.timeline-block span,
.timeline-block small {
  color: var(--muted);
  font-size: 11px;
}

.timeline-block strong {
  color: var(--ink);
  font-size: 13px;
}

.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reality-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, auto) minmax(80px, auto);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 9px;
}

.reality-row strong,
.reality-row small {
  display: block;
}

.reality-row small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.input-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.teacher-flow {
  grid-template-columns: 1fr;
}

.input-form .wide-field,
.form-actions,
.provision-fieldset {
  grid-column: 1 / -1;
}

.flow-step {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #fbfcfc;
}

.flow-step legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  padding: 0 4px;
}

.flow-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.topic-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.topic-chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 9px;
  text-align: left;
  cursor: pointer;
}

.topic-chip:hover,
.topic-chip.active {
  border-color: rgba(45, 111, 189, 0.45);
  background: #f3f8ff;
}

.topic-chip strong,
.topic-chip span {
  display: block;
}

.topic-chip strong {
  color: var(--ink);
  font-size: 13px;
}

.topic-chip span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.selected-topic-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.selected-topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(45, 111, 189, 0.3);
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
}

.selected-topic-pill button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 900;
  padding: 0 2px;
}

.fallback-topic {
  margin-top: 10px;
}

.roster-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.roster-toolbar button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
  padding: 7px 9px;
}

.evidence-roster {
  display: grid;
  gap: 6px;
  max-height: 370px;
  overflow: auto;
  padding-right: 3px;
  margin-top: 10px;
}

.roster-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) repeat(5, minmax(48px, auto));
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 7px;
}

.roster-row.roster-all {
  border-color: rgba(45, 111, 189, 0.35);
  background: #f4f8ff;
}

.roster-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.roster-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.roster-row button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfc;
  color: var(--slate);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  min-height: 28px;
  padding: 4px 7px;
}

.roster-row button.active {
  border-color: rgba(45, 111, 189, 0.45);
  background: #eaf1ff;
  color: var(--blue);
}

.evidence-upload input {
  border-style: dashed;
}

.provision-fieldset {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
}

.provision-fieldset legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 4px;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--slate);
  background: #f8fafb;
  font-size: 12px;
}

.check-pill input {
  width: auto;
  margin: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-actions span {
  color: var(--muted);
  font-size: 13px;
}

.primary-action {
  border: 0;
  border-radius: 7px;
  background: var(--blue);
  color: #ffffff;
  padding: 10px 13px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action:hover {
  background: #245da0;
}

.work-list,
.entry-log {
  display: grid;
  gap: 9px;
}

.work-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  padding: 11px;
  text-align: left;
  cursor: pointer;
}

.work-item:hover {
  border-color: rgba(45, 111, 189, 0.42);
  background: #f4f8ff;
}

.work-item span,
.work-item small,
.log-row span,
.log-row small {
  color: var(--muted);
  font-size: 12px;
}

.work-item strong,
.log-row strong {
  color: var(--ink);
  font-size: 14px;
}

.log-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  padding: 11px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

th {
  color: var(--muted);
  font-weight: 700;
}

th button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

th button.active {
  color: var(--blue);
}

th button.desc::after {
  content: " ↓";
}

th button.asc::after {
  content: " ↑";
}

td {
  color: var(--slate);
}

.learner-name {
  color: var(--ink);
  font-weight: 700;
}

.positive,
.secure-text {
  color: #057246;
  font-weight: 700;
}

.negative,
.support-text {
  color: var(--coral);
  font-weight: 700;
}

.developing-text {
  color: var(--amber);
  font-weight: 700;
}

.priority {
  font-size: 11px;
}

.priority-filter {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.priority-filter button {
  padding: 6px 9px;
  font-size: 12px;
}

.priority.high {
  background: #fff0ee;
  color: var(--coral);
}

.priority.medium {
  background: #fff7e8;
  color: var(--amber);
}

.priority.low {
  background: #eaf8f3;
  color: var(--teal);
}

.intervention-list {
  display: grid;
}

.queue-table {
  display: grid;
  overflow-x: auto;
}

.queue-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 42px minmax(150px, 1.2fr) 76px 92px;
  gap: 8px;
  align-items: center;
  min-width: 520px;
  border-top: 1px solid var(--line);
  padding: 8px 0;
  color: var(--slate);
  font-size: 12px;
}

.queue-head {
  color: var(--muted);
  font-weight: 700;
  padding-top: 0;
}

.intervention-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.intervention-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.intervention-row strong,
.intervention-row p {
  grid-column: 1 / -1;
}

.intervention-row strong {
  font-size: 13px;
}

.intervention-row span,
.intervention-row small {
  color: var(--muted);
  font-size: 12px;
}

.intervention-row p {
  color: var(--slate);
  font-size: 12px;
  line-height: 1.3;
}

.drilldown-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 28, 34, 0.38);
}

.drilldown-overlay[hidden] {
  display: none;
}

.drilldown-panel {
  width: min(620px, 100%);
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(15, 28, 34, 0.2);
  padding: 20px;
}

.drilldown-panel:focus {
  outline: none;
}

.drilldown-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.drilldown-head span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drilldown-head h2 {
  margin-top: 5px;
  font-size: 22px;
}

.drilldown-head p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}

#drilldown-close {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--slate);
  padding: 8px 10px;
  cursor: pointer;
}

.drilldown-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.summary-chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.summary-chip:hover,
.summary-chip.active {
  border-color: rgba(45, 111, 189, 0.42);
  background: #f4f8ff;
}

.summary-chip.active {
  box-shadow: inset 0 0 0 1px rgba(45, 111, 189, 0.18);
}

.summary-chip strong,
.summary-chip span {
  display: block;
}

.summary-chip strong {
  color: var(--ink);
  font-size: 18px;
}

.summary-chip span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.drilldown-list {
  display: grid;
  gap: 10px;
}

.drilldown-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  padding: 12px;
}

.drilldown-item > div,
.drilldown-item footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.drilldown-item > div span,
.drilldown-item footer span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.drilldown-item strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 14px;
}

.drilldown-item p {
  color: var(--slate);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 5px;
}

.drilldown-item footer {
  margin-top: 10px;
}

.empty-state {
  color: var(--muted);
  font-size: 13px;
}

.bar-secure {
  fill: var(--green);
}

.bar-developing {
  fill: var(--amber);
}

.bar-gap {
  fill: var(--coral);
}

.line-secure,
.line-secure-green {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
}

.line-progress,
.line-developing {
  fill: none;
  stroke: var(--amber);
  stroke-width: 4;
}

.line-support {
  fill: none;
  stroke: var(--coral);
  stroke-width: 4;
}

.donut-secure {
  fill: transparent;
  stroke: var(--green);
  stroke-width: 28;
}

.donut-developing {
  fill: transparent;
  stroke: var(--amber);
  stroke-width: 28;
}

.donut-support {
  fill: transparent;
  stroke: var(--coral);
  stroke-width: 28;
}

.donut-secure-fill {
  fill: var(--green);
}

.donut-developing-fill {
  fill: var(--amber);
}

.donut-support-fill {
  fill: var(--coral);
}

.donut-total {
  fill: var(--ink);
  font-size: 22px;
  font-weight: 800;
}

@media (min-width: 1480px) {
  .main-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.75fr) minmax(330px, 0.75fr);
    grid-template-areas: "trend distribution insight";
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 14px;
    gap: 18px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .sidebar-note {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-filters {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .main-grid,
  .lower-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "trend"
      "distribution"
      "insight";
  }

  .input-grid {
    grid-template-columns: 1fr;
  }

  .planning-grid,
  .planning-readiness,
  .progression-path,
  .year-timeline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .workspace {
    padding: 14px;
  }

  .topbar,
  .main-grid,
  .lower-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .input-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .planning-grid,
  .planning-readiness,
  .progression-path,
  .year-timeline,
  .reality-row {
    grid-template-columns: 1fr;
  }

  .input-form {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .trend-panel,
  .main-grid > .panel:nth-child(2),
  .insight-panel {
    grid-area: auto;
  }

  .topbar-filters,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: flex-start;
    overflow-x: visible;
  }

  .brand {
    min-width: 0;
  }

  .nav-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
  }

  .nav-item {
    white-space: normal;
  }
}
