:root {
  --dash-bg: #f4f7fb;
  --dash-card: #ffffff;
  --dash-card-soft: #f8fafc;
  --dash-ink: #14213d;
  --dash-muted: #64748b;
  --dash-border: #dfe7f1;
  --dash-primary: #1457e6;
  --dash-primary-dark: #0c42bb;
  --dash-primary-soft: #eaf1ff;
  --dash-green: #0b8f69;
  --dash-green-soft: #e8f8f2;
  --dash-amber: #b96b08;
  --dash-amber-soft: #fff5df;
  --dash-rose: #cc365c;
  --dash-rose-soft: #fff0f4;
  --dash-violet: #7048d8;
  --dash-violet-soft: #f1edff;
  --dash-radius: 20px;
  --dash-radius-sm: 12px;
  --dash-shadow: 0 12px 34px rgba(37, 57, 91, 0.08);
  --dash-header-height: 72px;
  --dash-section-nav-height: 54px;
}

[data-theme="dark"] {
  --dash-bg: #0b1220;
  --dash-card: #111c2f;
  --dash-card-soft: #16243a;
  --dash-ink: #edf4ff;
  --dash-muted: #9aabc2;
  --dash-border: #263750;
  --dash-primary: #6d9bff;
  --dash-primary-dark: #8cb0ff;
  --dash-primary-soft: #1b3159;
  --dash-green: #48cda4;
  --dash-green-soft: #11372f;
  --dash-amber: #f0b659;
  --dash-amber-soft: #3b2b13;
  --dash-rose: #ff7597;
  --dash-rose-soft: #441d2b;
  --dash-violet: #aa8cff;
  --dash-violet-soft: #2d2450;
  --dash-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--dash-header-height) + var(--dash-section-nav-height) + 16px);
}

body.dashboard-page {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 7% 4%, rgba(20, 87, 230, 0.07), transparent 23rem),
    var(--dash-bg);
  color: var(--dash-ink);
  font-family: var(--font-body, "Inter", sans-serif);
  line-height: 1.55;
}

.dashboard-page [hidden] {
  display: none !important;
}

.dashboard-page button,
.dashboard-page input,
.dashboard-page select,
.dashboard-page textarea {
  font: inherit;
}

.dashboard-page button,
.dashboard-page a {
  -webkit-tap-highlight-color: transparent;
}

.dashboard-page a {
  color: inherit;
  text-decoration: none;
}

.dashboard-page h1,
.dashboard-page h2,
.dashboard-page h3,
.dashboard-page h4,
.dashboard-page p {
  margin-top: 0;
}

.dashboard-page h1,
.dashboard-page h2,
.dashboard-page h3,
.dashboard-page h4,
.dash-brand {
  font-family: var(--font-heading, "Plus Jakarta Sans", sans-serif);
}

.dashboard-page h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.dashboard-page h2 {
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.dashboard-page h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
  line-height: 1.3;
}

.dashboard-page h4 {
  margin-bottom: 7px;
  font-size: 1rem;
  line-height: 1.35;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--dash-ink);
  color: var(--dash-card) !important;
  transform: translateY(-160%);
  transition: transform 0.18s ease;
}

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

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.dash-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--dash-header-height);
  border-bottom: 1px solid color-mix(in srgb, var(--dash-border) 82%, transparent);
  background: color-mix(in srgb, var(--dash-card) 90%, transparent);
  backdrop-filter: blur(18px);
}

.dash-header__inner {
  display: flex;
  align-items: center;
  max-width: 1480px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  gap: 32px;
}

.dash-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--dash-ink);
  font-size: 1.23rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-brand__mark {
  display: inline-grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(140deg, #2c6cf0, #663cc9);
  color: #fff;
  box-shadow: 0 7px 17px rgba(20, 87, 230, 0.25);
}

.dash-top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
}

.dash-top-nav a {
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--dash-muted);
  font-size: 0.86rem;
  font-weight: 650;
  transition: color 0.18s ease, background 0.18s ease;
}

.dash-top-nav a:hover,
.dash-top-nav a[aria-current="page"] {
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
}



.dash-more-menu {
  position: relative;
}

.dash-more-menu summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--dash-muted);
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
  transition: color 0.18s ease, background 0.18s ease;
}

.dash-more-menu summary::-webkit-details-marker {
  display: none;
}

.dash-more-menu summary:hover,
.dash-more-menu[open] summary {
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
}

.dash-more-menu summary i {
  font-size: 0.68rem;
  transition: transform 0.18s ease;
}

.dash-more-menu[open] summary i {
  transform: rotate(180deg);
}

.dash-more-menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 80;
  display: grid;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  background: var(--dash-card);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
}

.dash-more-menu__panel a {
  display: block;
  padding: 10px 12px;
  white-space: nowrap;
}

.dash-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-button,
.dialog-close,
.mini-add,
.calendar-controls button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--dash-border);
  border-radius: 12px;
  background: var(--dash-card);
  color: var(--dash-muted);
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icon-button:hover,
.dialog-close:hover,
.mini-add:hover,
.calendar-controls button:hover {
  border-color: color-mix(in srgb, var(--dash-primary) 55%, var(--dash-border));
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
  transform: translateY(-1px);
}

.profile-link {
  display: flex;
  align-items: center;
  min-width: 130px;
  padding: 5px 9px;
  gap: 9px;
  border-radius: 12px;
  transition: background 0.18s ease;
}

.profile-link:hover {
  background: var(--dash-card-soft);
}

.profile-link__avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
}

.profile-link__copy {
  display: grid;
  line-height: 1.2;
}

.profile-link__copy small {
  color: var(--dash-muted);
  font-size: 0.68rem;
}

.profile-link__copy strong {
  max-width: 110px;
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  gap: 8px;
  border: 1px solid var(--dash-border);
  border-radius: 12px;
  background: var(--dash-card);
  color: var(--dash-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.logout-button:hover {
  border-color: color-mix(in srgb, var(--dash-rose) 45%, var(--dash-border));
  color: var(--dash-rose);
}

.section-nav {
  position: sticky;
  top: var(--dash-header-height);
  z-index: 40;
  height: var(--dash-section-nav-height);
  border-bottom: 1px solid var(--dash-border);
  background: color-mix(in srgb, var(--dash-card) 94%, transparent);
  backdrop-filter: blur(14px);
}

.section-nav__inner {
  display: flex;
  align-items: center;
  max-width: 1480px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.section-nav__inner::-webkit-scrollbar {
  display: none;
}

.section-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  gap: 8px;
  color: var(--dash-muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.section-nav a::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--dash-primary);
  content: "";
  opacity: 0;
  transform: scaleX(0.3);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.section-nav a:hover,
.section-nav a[aria-current="location"] {
  color: var(--dash-primary);
}

.section-nav a[aria-current="location"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.dashboard-main {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 24px 28px 72px;
}

.dashboard-section {
  padding: 42px 0 24px;
  scroll-margin-top: calc(var(--dash-header-height) + var(--dash-section-nav-height) + 12px);
}

.dashboard-section + .dashboard-section {
  margin-top: 22px;
  border-top: 1px solid var(--dash-border);
}

.dashboard-status,
.dialog-status {
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--dash-primary) 35%, var(--dash-border));
  border-radius: 12px;
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
  font-size: 0.88rem;
  font-weight: 650;
}

.dashboard-status {
  position: sticky;
  top: calc(var(--dash-header-height) + var(--dash-section-nav-height) + 10px);
  z-index: 35;
  margin-bottom: 14px;
  box-shadow: var(--dash-shadow);
}

.dashboard-status.is-error,
.dialog-status.is-error {
  border-color: color-mix(in srgb, var(--dash-rose) 42%, var(--dash-border));
  background: var(--dash-rose-soft);
  color: var(--dash-rose);
}

.dashboard-status.is-success,
.dialog-status.is-success {
  border-color: color-mix(in srgb, var(--dash-green) 42%, var(--dash-border));
  background: var(--dash-green-soft);
  color: var(--dash-green);
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--dash-primary);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.welcome-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 270px;
  padding: clamp(28px, 5vw, 58px);
  gap: 36px;
  overflow: hidden;
  border: 1px solid #244eb0;
  border-radius: 28px;
  background:
    radial-gradient(circle at 87% 25%, rgba(112, 72, 216, 0.55), transparent 15rem),
    radial-gradient(circle at 70% 100%, rgba(41, 153, 218, 0.35), transparent 19rem),
    linear-gradient(135deg, #102b60 0%, #123f92 58%, #31226f 100%);
  color: #fff;
  box-shadow: 0 22px 54px rgba(22, 54, 120, 0.2);
}

.welcome-panel::after {
  position: absolute;
  top: -95px;
  right: -45px;
  width: 270px;
  height: 270px;
  border: 46px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  content: "";
}

.welcome-panel__copy,
.welcome-panel__actions {
  position: relative;
  z-index: 1;
}

.welcome-panel__copy {
  max-width: 750px;
}

.welcome-panel .eyebrow {
  color: #9ed1ff;
}

.welcome-panel h1 {
  color: #fff;
}

.welcome-panel__copy > p:not(.eyebrow) {
  max-width: 690px;
  margin-bottom: 22px;
  color: #d6e4ff;
  font-size: 1rem;
}

.student-context {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.student-context span {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #e7efff;
  font-size: 0.78rem;
}

.student-context strong {
  color: #fff;
}

.welcome-panel__actions {
  display: grid;
  min-width: 220px;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 9px 16px;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.button--primary {
  background: var(--dash-primary);
  color: #fff !important;
  box-shadow: 0 7px 16px color-mix(in srgb, var(--dash-primary) 22%, transparent);
}

.button--primary:hover {
  background: var(--dash-primary-dark);
  box-shadow: 0 9px 21px color-mix(in srgb, var(--dash-primary) 29%, transparent);
}

.button--secondary {
  border-color: var(--dash-border);
  background: var(--dash-card);
  color: var(--dash-ink) !important;
}

.button--secondary:hover,
.button--ghost:hover {
  border-color: color-mix(in srgb, var(--dash-primary) 42%, var(--dash-border));
  background: var(--dash-primary-soft);
  color: var(--dash-primary) !important;
}

.button--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--dash-muted);
}

.welcome-panel .button--primary {
  background: #fff;
  color: #123b86 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.welcome-panel .button--secondary {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff !important;
}

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

.summary-card {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 19px;
  gap: 14px;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  background: var(--dash-card);
  box-shadow: 0 7px 24px rgba(37, 57, 91, 0.045);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.summary-card:hover {
  border-color: color-mix(in srgb, var(--dash-primary) 28%, var(--dash-border));
  box-shadow: var(--dash-shadow);
  transform: translateY(-2px);
}

.summary-card__icon,
.section-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
}

.summary-card__icon {
  width: 48px;
  height: 48px;
  font-size: 1.05rem;
}

.section-icon {
  width: 42px;
  height: 42px;
}

.tone-blue {
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
}

.tone-green {
  background: var(--dash-green-soft);
  color: var(--dash-green);
}

.tone-amber {
  background: var(--dash-amber-soft);
  color: var(--dash-amber);
}

.tone-rose {
  background: var(--dash-rose-soft);
  color: var(--dash-rose);
}

.tone-violet {
  background: var(--dash-violet-soft);
  color: var(--dash-violet);
}

.summary-card p,
.summary-card small {
  display: block;
  margin: 0;
  color: var(--dash-muted);
}

.summary-card p {
  margin-bottom: 1px;
  font-size: 0.72rem;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin-bottom: 1px;
  color: var(--dash-ink);
  font-size: 1.35rem;
  line-height: 1.25;
}

.summary-card small {
  overflow: hidden;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 18px 21px;
  gap: 18px;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  background: var(--dash-card);
}

.quick-actions h2 {
  margin: 0;
  font-size: 1.1rem;
}

.quick-actions .eyebrow {
  margin-bottom: 3px;
}

.quick-actions__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.quick-actions__links button,
.quick-actions__links a,
.filter-chips button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  gap: 7px;
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  background: var(--dash-card-soft);
  color: var(--dash-muted);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.quick-actions__links button:hover,
.quick-actions__links a:hover,
.filter-chips button:hover,
.filter-chips button.is-active {
  border-color: color-mix(in srgb, var(--dash-primary) 40%, var(--dash-border));
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
}

.section-heading,
.card-heading-row,
.resource-column__heading,
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading > div:first-child {
  max-width: 850px;
}

.section-heading p:not(.eyebrow),
.card-heading-row p:not(.eyebrow),
.muted-note,
.legend-note {
  margin-bottom: 0;
  color: var(--dash-muted);
  font-size: 0.82rem;
}

.section-heading h2,
.card-heading-row h3,
.resource-column__heading h3 {
  margin-bottom: 0;
}

.dashboard-card,
.test-group {
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  background: var(--dash-card);
  box-shadow: 0 8px 28px rgba(37, 57, 91, 0.045);
}

.test-groups {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 16px;
}

.test-group {
  padding: 20px;
}

.test-group--wide {
  grid-column: 1 / -1;
}

.test-group__heading {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 11px;
}

.test-group__heading .eyebrow {
  margin-bottom: 2px;
}

.test-group__heading h3 {
  margin: 0;
}

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

.test-option {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--dash-border);
  border-radius: 15px;
  background: var(--dash-card-soft);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.test-option:hover {
  border-color: color-mix(in srgb, var(--dash-primary) 35%, var(--dash-border));
  box-shadow: 0 10px 24px rgba(37, 57, 91, 0.08);
  transform: translateY(-2px);
}

.test-option--featured {
  background: linear-gradient(145deg, var(--dash-primary-soft), var(--dash-card-soft) 60%);
}

.test-option__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 10px;
}

.pill,
.target-chip,
.subtle-label,
.stage-grade {
  font-size: 0.66rem;
  font-weight: 800;
}

.pill,
.target-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  gap: 5px;
  border-radius: 999px;
}

.pill {
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pill--green {
  background: var(--dash-green-soft);
  color: var(--dash-green);
}

.pill--violet {
  background: var(--dash-violet-soft);
  color: var(--dash-violet);
}

.pill--amber {
  background: var(--dash-amber-soft);
  color: var(--dash-amber);
}

.pill--rose {
  background: var(--dash-rose-soft);
  color: var(--dash-rose);
}

.target-chip {
  border: 1px solid var(--dash-border);
  background: var(--dash-card);
  color: var(--dash-muted);
}

.subtle-label {
  color: var(--dash-muted);
}

.test-option > p {
  flex: 1;
  margin-bottom: 16px;
  color: var(--dash-muted);
  font-size: 0.79rem;
}

.feature-list,
.insight-list,
.stage-card ul {
  padding: 0;
  list-style: none;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 18px;
  gap: 8px;
}

.feature-list li,
.choice-preview span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--dash-muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.feature-list i,
.choice-preview i {
  color: var(--dash-primary);
}

.choice-preview {
  display: flex;
  margin-bottom: 18px;
  gap: 8px;
}

.choice-preview span {
  padding: 7px 9px;
  border: 1px solid var(--dash-border);
  border-radius: 9px;
  background: var(--dash-card);
}

.test-option > .button {
  align-self: flex-start;
}

.planned-tests,
.record-browser {
  margin-top: 16px;
  padding: 21px;
}

.card-heading-row {
  margin-bottom: 15px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.dashboard-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.dashboard-page caption {
  padding: 9px;
  color: var(--dash-muted);
  font-size: 0.7rem;
  text-align: left;
}

.dashboard-page th,
.dashboard-page td {
  padding: 12px 11px;
  border-bottom: 1px solid var(--dash-border);
  text-align: left;
  vertical-align: middle;
}

.dashboard-page th {
  color: var(--dash-muted);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dashboard-page tbody tr:last-child td {
  border-bottom: 0;
}

.dashboard-page tbody tr:not(.empty-table-row):hover {
  background: var(--dash-card-soft);
}

.empty-table-row td {
  padding: 26px 12px;
  color: var(--dash-muted);
  text-align: center;
}

.empty-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.compact-field {
  display: grid;
  min-width: 220px;
  gap: 4px;
}

.compact-field span {
  color: var(--dash-muted);
  font-size: 0.65rem;
  font-weight: 750;
}

.compact-field select {
  min-height: 38px;
  padding: 7px 34px 7px 10px;
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  background: var(--dash-card);
  color: var(--dash-ink);
  font-size: 0.74rem;
}

.empty-state {
  display: grid;
  min-height: 250px;
  padding: 40px 24px;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--dash-primary) 32%, var(--dash-border));
  border-radius: var(--dash-radius);
  background: linear-gradient(145deg, var(--dash-card), var(--dash-primary-soft));
  text-align: center;
}

.analysis-empty {
  margin-top: 16px;
}

.empty-state__icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 13px;
  place-items: center;
  border-radius: 18px;
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
  font-size: 1.45rem;
}

.empty-state h3 {
  margin-bottom: 6px;
  font-size: 1.15rem;
}

.empty-state p {
  max-width: 600px;
  margin-bottom: 16px;
  color: var(--dash-muted);
  font-size: 0.82rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 16px;
  gap: 10px;
}

.metric {
  padding: 15px;
  border: 1px solid var(--dash-border);
  border-radius: 15px;
  background: var(--dash-card);
}

.metric span,
.metric small {
  display: block;
  color: var(--dash-muted);
  font-size: 0.66rem;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 1.22rem;
}

.metric--good strong {
  color: var(--dash-green);
}

.metric--danger strong {
  color: var(--dash-rose);
}

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

.chart-card {
  min-width: 0;
  padding: 21px;
}

.chart-frame {
  position: relative;
  height: 260px;
  margin: 8px 0 13px;
}

.chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-fallback {
  padding-top: 8px;
  border-top: 1px solid var(--dash-border);
}

.chart-fallback table {
  font-size: 0.7rem;
}

#analysis-content > .dashboard-card {
  margin-top: 16px;
  padding: 21px;
}

.classification-key {
  display: flex;
  flex-wrap: wrap;
  padding-top: 15px;
  gap: 15px;
  color: var(--dash-muted);
  font-size: 0.68rem;
}

.classification-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot--strong {
  background: var(--dash-green);
}

.status-dot--average {
  background: var(--dash-amber);
}

.status-dot--focus {
  background: var(--dash-rose);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  gap: 16px;
}

.insight-card {
  display: flex;
  align-items: flex-start;
  min-height: 210px;
  padding: 20px;
  gap: 13px;
}

.insight-card > div {
  min-width: 0;
  flex: 1;
}

.insight-list {
  display: grid;
  margin: 14px 0 0;
  gap: 8px;
}

.insight-list li:not(.empty-list) {
  position: relative;
  padding: 9px 10px 9px 27px;
  border-radius: 9px;
  background: var(--dash-card-soft);
  color: var(--dash-muted);
  font-size: 0.73rem;
}

.insight-list li:not(.empty-list)::before {
  position: absolute;
  top: 14px;
  left: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dash-primary);
  content: "";
}

.empty-list {
  color: var(--dash-muted);
  font-size: 0.74rem;
  font-style: italic;
}

.progress-list {
  display: grid;
  margin-top: 14px;
  gap: 10px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  margin: -5px 0 15px;
  gap: 7px;
}

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

.resource-column {
  min-height: 350px;
  padding: 20px;
}

.resource-column__heading {
  justify-content: flex-start;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--dash-border);
}

.resource-column__heading > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.resource-column__heading p {
  margin: 0;
  color: var(--dash-muted);
  font-size: 0.7rem;
}

.mini-add {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.resource-list {
  display: grid;
  gap: 9px;
  padding-top: 15px;
}

.mini-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  color: var(--dash-muted);
  text-align: center;
}

.mini-empty > i {
  margin-bottom: 8px;
  color: color-mix(in srgb, var(--dash-muted) 60%, transparent);
  font-size: 1.6rem;
}

.mini-empty p {
  margin: 0 0 3px;
  font-size: 0.78rem;
  font-weight: 700;
}

.mini-empty span {
  font-size: 0.68rem;
}

.mini-empty button {
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--dash-primary);
  font-size: 0.7rem;
  font-weight: 750;
  cursor: pointer;
}

.routine-score {
  display: grid;
  min-width: 220px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3px 12px;
}

.routine-score span {
  color: var(--dash-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.routine-score strong {
  color: var(--dash-primary);
  font-size: 0.88rem;
}

.routine-score progress {
  width: 100%;
  height: 7px;
  grid-column: 1 / -1;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--dash-border);
}

.routine-score progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--dash-border);
}

.routine-score progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--dash-primary), var(--dash-violet));
}

.routine-score progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--dash-primary), var(--dash-violet));
}

.routine-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.7fr);
  gap: 16px;
}

.today-card,
.routine-road,
.calendar-grid > .dashboard-card {
  padding: 21px;
}

.inline-task-form {
  display: grid;
  grid-template-columns: minmax(190px, 1.5fr) repeat(4, minmax(105px, 0.65fr)) auto;
  align-items: end;
  margin: 16px 0 10px;
  padding: 14px;
  gap: 9px;
  border-radius: 14px;
  background: var(--dash-card-soft);
}

.form-field {
  display: grid;
  align-content: start;
  gap: 5px;
}

.form-field label,
.chapter-picker legend {
  color: var(--dash-ink);
  font-size: 0.7rem;
  font-weight: 750;
}

.form-field label span,
.optional-label {
  color: var(--dash-muted);
  font-size: 0.63rem;
  font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea,
.chapter-picker input {
  accent-color: var(--dash-primary);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  outline: 0;
  background: var(--dash-card);
  color: var(--dash-ink);
  font-size: 0.77rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.form-field textarea {
  min-height: 110px;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: color-mix(in srgb, var(--dash-muted) 74%, transparent);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.compact-field select:focus {
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dash-primary) 16%, transparent);
}

.routine-items {
  display: grid;
  gap: 8px;
}

.routine-road {
  background: linear-gradient(165deg, var(--dash-card), var(--dash-primary-soft));
}

.road-line {
  position: relative;
  display: grid;
  margin: 21px 0 0;
  padding: 0;
  gap: 19px;
  list-style: none;
}

.road-line::before {
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 18px;
  width: 2px;
  background: var(--dash-border);
  content: "";
}

.road-line li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
}

.road-line li > span {
  display: grid;
  width: 38px;
  height: 38px;
  z-index: 1;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--dash-border);
  border-radius: 50%;
  background: var(--dash-card);
  color: var(--dash-muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.road-line li.is-current > span,
.road-line li.is-complete > span {
  border-color: var(--dash-primary);
  background: var(--dash-primary);
  color: #fff;
}

.road-line strong,
.road-line small {
  display: block;
}

.road-line strong {
  font-size: 0.78rem;
}

.road-line small {
  color: var(--dash-muted);
  font-size: 0.67rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.7fr);
  margin-top: 16px;
  gap: 16px;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-controls button {
  width: 31px;
  height: 31px;
  border-radius: 9px;
}

.calendar-controls strong {
  min-width: 100px;
  font-size: 0.73rem;
  text-align: center;
}

.routine-calendar {
  table-layout: fixed;
}

.routine-calendar th,
.routine-calendar td {
  text-align: center;
}

.routine-calendar td {
  min-width: 72px;
  height: 67px;
  vertical-align: top;
}

.roadmap-heading {
  padding: 22px;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  background: linear-gradient(115deg, var(--dash-primary-soft), var(--dash-card));
}

.roadmap-track {
  display: grid;
  gap: 18px;
}

.roadmap-path {
  padding: 24px;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  background: var(--dash-card);
}

.roadmap-path__heading {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: start;
  margin-bottom: 19px;
  gap: 17px;
}

.roadmap-path__heading > span {
  display: inline-grid;
  min-height: 77px;
  padding: 12px;
  place-items: center;
  border-radius: 16px;
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
  font-size: 0.77rem;
  font-weight: 800;
  text-align: center;
}

.roadmap-path__heading p:not(.eyebrow) {
  margin: 0;
  color: var(--dash-muted);
  font-size: 0.78rem;
}

.stage-grid {
  display: grid;
  gap: 12px;
}

.stage-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stage-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stage-card {
  position: relative;
  min-height: 100%;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--dash-border);
  border-radius: 15px;
  background: var(--dash-card-soft);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.stage-card:hover,
.stage-card.is-current {
  border-color: color-mix(in srgb, var(--dash-primary) 52%, var(--dash-border));
  box-shadow: 0 9px 24px rgba(37, 57, 91, 0.09);
  transform: translateY(-2px);
}

.stage-card.is-current::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--dash-primary), var(--dash-violet));
  content: "";
}

.stage-number {
  position: absolute;
  top: 10px;
  right: 13px;
  color: color-mix(in srgb, var(--dash-primary) 16%, transparent);
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1;
}

.stage-grade {
  position: relative;
  z-index: 1;
  margin-bottom: 11px;
  color: var(--dash-primary);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stage-card h4,
.stage-card > p:not(.stage-grade),
.stage-card li {
  position: relative;
  z-index: 1;
}

.stage-card > p:not(.stage-grade),
.stage-card li {
  color: var(--dash-muted);
  font-size: 0.71rem;
}

.stage-card > p:not(.stage-grade) {
  margin-bottom: 12px;
}

.stage-card ul {
  display: grid;
  margin: 12px 0 0;
  gap: 7px;
}

.stage-card li {
  position: relative;
  padding-left: 15px;
}

.stage-card li::before {
  position: absolute;
  top: 0.57em;
  left: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dash-primary);
  content: "";
}

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

.dash-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 28px;
  gap: 30px;
  border-top: 1px solid var(--dash-border);
  color: var(--dash-muted);
  font-size: 0.74rem;
}

.dash-brand--footer {
  font-size: 1rem;
}

.dash-brand--footer .dash-brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.dash-footer > div p {
  margin: 7px 0 0;
}

.dash-footer nav {
  display: flex;
  gap: 15px;
}

.dash-footer a:hover {
  color: var(--dash-primary);
}

.dashboard-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(88vh, 920px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--dash-border);
  border-radius: 22px;
  outline: 0;
  background: var(--dash-card);
  color: var(--dash-ink);
  box-shadow: 0 30px 100px rgba(4, 14, 35, 0.38);
}

.dashboard-dialog--wide {
  width: min(920px, calc(100% - 28px));
}

.dashboard-dialog::backdrop {
  background: rgba(4, 14, 35, 0.66);
  backdrop-filter: blur(4px);
}

.dialog-form {
  padding: clamp(20px, 4vw, 30px);
}

.dialog-heading {
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--dash-border);
}

.dialog-heading > div {
  max-width: 740px;
}

.dialog-heading h2 {
  margin-bottom: 7px;
  font-size: 1.5rem;
}

.dialog-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--dash-muted);
  font-size: 0.78rem;
}

.dialog-close {
  flex: 0 0 auto;
}

.dialog-status {
  margin-top: 15px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  gap: 14px;
}

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

.form-section {
  margin-top: 20px;
  padding-top: 1px;
}

.form-section + .form-section {
  padding-top: 18px;
  border-top: 1px solid var(--dash-border);
}

.form-section h3 {
  margin: 0;
  font-size: 0.88rem;
}

.dialog-form > .form-field {
  margin-top: 16px;
}

.chapter-picker {
  margin: 19px 0 0;
  padding: 15px;
  border: 1px solid var(--dash-border);
  border-radius: 13px;
  background: var(--dash-card-soft);
}

.chapter-picker p {
  margin: 2px 0 11px;
  color: var(--dash-muted);
  font-size: 0.68rem;
}

.chapter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chapter-options label {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  gap: 6px;
  border: 1px solid var(--dash-border);
  border-radius: 9px;
  background: var(--dash-card);
  color: var(--dash-muted);
  font-size: 0.7rem;
  cursor: pointer;
}

.chapter-options label:has(input:checked) {
  border-color: var(--dash-primary);
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  gap: 8px;
  border-top: 1px solid var(--dash-border);
}

.dashboard-page :focus-visible {
  outline: 3px solid color-mix(in srgb, var(--dash-primary) 45%, transparent);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .dash-top-nav {
    display: none;
  }

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

  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .inline-task-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inline-task-form .form-field--wide {
    grid-column: span 2;
  }

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

@media (max-width: 860px) {
  :root {
    --dash-header-height: 64px;
  }

  .dash-header__inner,
  .section-nav__inner,
  .dashboard-main,
  .dash-footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .dash-header__inner {
    gap: 10px;
  }

  .profile-link__copy,
  .logout-button span {
    display: none;
  }

  .profile-link {
    min-width: auto;
    padding: 0;
  }

  .logout-button {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .welcome-panel {
    display: grid;
    min-height: 0;
  }

  .welcome-panel__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .test-groups,
  .chart-grid,
  .routine-layout,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stage-grid--three {
    grid-template-columns: 1fr;
  }

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

  .dash-footer {
    grid-template-columns: 1fr auto;
  }

  .dash-footer > p:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  :root {
    --dash-section-nav-height: 50px;
  }

  .dash-header__inner,
  .section-nav__inner,
  .dashboard-main,
  .dash-footer {
    padding-right: 13px;
    padding-left: 13px;
  }

  .dash-header__actions {
    gap: 4px;
  }

  .dash-header__actions #refresh-dashboard {
    display: none;
  }

  .dash-brand > span:last-child {
    font-size: 1.05rem;
  }

  .dash-brand__mark {
    width: 35px;
    height: 35px;
    border-radius: 11px;
  }

  .section-nav a {
    padding: 0 10px;
    font-size: 0.71rem;
  }

  .dashboard-main {
    padding-bottom: 50px;
  }

  .dashboard-section {
    padding-top: 32px;
  }

  .welcome-panel {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .welcome-panel__actions,
  .summary-grid,
  .test-option-grid,
  .resource-grid,
  .insight-grid,
  .stage-grid--four,
  .bookmark-list {
    grid-template-columns: 1fr;
  }

  .summary-card small {
    white-space: normal;
  }

  .quick-actions,
  .section-heading,
  .card-heading-row,
  .roadmap-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-actions__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .test-group,
  .planned-tests,
  .record-browser,
  .chart-card,
  #analysis-content > .dashboard-card,
  .resource-column,
  .today-card,
  .routine-road,
  .calendar-grid > .dashboard-card,
  .roadmap-path {
    padding: 17px;
    border-radius: 16px;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .compact-field,
  .routine-score {
    min-width: 0;
    width: 100%;
  }

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

  .chart-frame {
    height: 225px;
  }

  .inline-task-form,
  .form-grid,
  .form-grid--three {
    grid-template-columns: 1fr;
  }

  .inline-task-form .form-field--wide {
    grid-column: auto;
  }

  .roadmap-path__heading {
    grid-template-columns: 1fr;
  }

  .roadmap-path__heading > span {
    min-height: 45px;
  }

  .dash-footer {
    grid-template-columns: 1fr;
  }

  .dialog-form {
    padding: 20px 16px;
  }

  .dialog-heading h2 {
    font-size: 1.25rem;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
  }
}

@media (max-width: 430px) {
  .dash-header__actions .profile-link {
    display: none;
  }

  .quick-actions__links {
    grid-template-columns: 1fr;
  }

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

  .student-context {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ========================================================================
   Focused routine cards + concise analytical visualizations
   ======================================================================== */

.card-supporting-text,
.chart-description {
  max-width: 620px;
  margin: 4px 0 0;
  color: var(--dash-muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.metric-grid--primary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric--featured {
  position: relative;
  min-height: 128px;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--dash-primary) 12%, transparent), transparent 48%),
    var(--dash-card);
}

.metric--featured::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dash-primary), var(--dash-violet));
  content: "";
}

.metric--featured span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dash-muted);
  font-size: 0.69rem;
  font-weight: 750;
}

.metric--featured span i {
  color: var(--dash-primary);
  font-size: 0.77rem;
}

.metric--featured strong {
  margin-top: 12px;
  color: var(--dash-ink);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1;
}

.metric--featured small {
  margin-top: 9px;
  line-height: 1.45;
}

.metric--featured.metric--good::after {
  background: linear-gradient(90deg, var(--dash-green), #41c98e);
}

.metric--featured.metric--good span i,
.metric--featured.metric--good strong {
  color: var(--dash-green);
}

.analysis-detail-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  background: var(--dash-card);
}

.analysis-detail-strip > div {
  min-width: 0;
  padding: 13px 15px;
  border-right: 1px solid var(--dash-border);
}

.analysis-detail-strip > div:last-child {
  border-right: 0;
}

.analysis-detail-strip span,
.analysis-detail-strip strong {
  display: block;
}

.analysis-detail-strip span {
  color: var(--dash-muted);
  font-size: 0.63rem;
  font-weight: 700;
}

.analysis-detail-strip strong {
  margin-top: 4px;
  color: var(--dash-ink);
  font-size: 0.92rem;
}

.analysis-detail-strip .is-positive strong {
  color: var(--dash-green);
}

.analysis-detail-strip .is-negative strong {
  color: var(--dash-rose);
}

.chart-grid--analytics {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
}

.chart-card--outcome {
  grid-column: span 4;
}

.chart-card--trend {
  grid-column: span 8;
}

.chart-card--chapters {
  grid-column: 1 / -1;
}

.chart-card .card-heading-row {
  align-items: flex-start;
}

.chart-card .legend-note {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--dash-border);
  border-radius: 999px;
  background: var(--dash-card-soft);
  color: var(--dash-muted);
  font-size: 0.62rem;
  font-weight: 750;
  white-space: nowrap;
}

.chart-frame--doughnut {
  height: 215px;
  max-width: 270px;
  margin: 10px auto 8px;
}

.chart-frame--trend {
  height: 250px;
  margin-top: 13px;
}

.chart-frame--chapters {
  height: clamp(230px, 30vw, 330px);
  margin-top: 14px;
}

.outcome-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.outcome-stat {
  position: relative;
  padding: 9px 9px 9px 14px;
  border-radius: 10px;
  background: var(--dash-card-soft);
}

.outcome-stat::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 6px;
  width: 3px;
  border-radius: 999px;
  background: var(--dash-muted);
  content: "";
}

.outcome-stat--correct::before {
  background: var(--dash-green);
}

.outcome-stat--incorrect::before {
  background: var(--dash-rose);
}

.outcome-stat--skipped::before {
  background: #94a3b8;
}

.outcome-stat span,
.outcome-stat strong {
  display: block;
}

.outcome-stat span {
  color: var(--dash-muted);
  font-size: 0.58rem;
  font-weight: 700;
}

.outcome-stat strong {
  margin-top: 2px;
  color: var(--dash-ink);
  font-size: 0.74rem;
}

.chart-series-key {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px;
  gap: 13px;
  color: var(--dash-muted);
  font-size: 0.63rem;
  font-weight: 700;
}

.chart-series-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-series-key span::before {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--dash-primary);
  content: "";
}

.chart-series-key .series-accuracy::before {
  background: var(--dash-green);
}

.chart-series-key .series-average::before {
  height: 1px;
  background: repeating-linear-gradient(90deg, #94a3b8 0 5px, transparent 5px 8px);
}

.trend-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid var(--dash-border);
  border-radius: 11px;
}

.trend-summary-grid > div {
  padding: 9px 11px;
  border-right: 1px solid var(--dash-border);
  background: var(--dash-card-soft);
}

.trend-summary-grid > div:last-child {
  border-right: 0;
}

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

.trend-summary-grid span {
  color: var(--dash-muted);
  font-size: 0.59rem;
  font-weight: 700;
}

.trend-summary-grid strong {
  margin-top: 2px;
  font-size: 0.78rem;
}

.trend-summary-grid strong.is-up {
  color: var(--dash-green);
}

.trend-summary-grid strong.is-down {
  color: var(--dash-rose);
}

.trend-summary-grid strong.is-flat {
  color: var(--dash-muted);
}

.chart-data-details {
  margin-top: 10px;
  border-top: 1px solid var(--dash-border);
}

.chart-data-details summary {
  padding: 10px 0 2px;
  color: var(--dash-primary);
  font-size: 0.64rem;
  font-weight: 750;
  cursor: pointer;
  list-style-position: inside;
}

.chart-data-details[open] summary {
  margin-bottom: 7px;
}

.chart-data-details .chart-fallback {
  padding-top: 0;
  border-top: 0;
}

.chapter-chart-empty {
  min-height: 225px;
  margin-top: 12px;
  border: 1px dashed var(--dash-border);
  border-radius: 13px;
  background: var(--dash-card-soft);
}

/* Daily routine */
.routine-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid var(--dash-border);
  border-radius: 13px;
  background: var(--dash-card-soft);
}

.routine-overview > div {
  padding: 11px 13px;
  border-right: 1px solid var(--dash-border);
}

.routine-overview > div:last-child {
  border-right: 0;
}

.routine-overview span,
.routine-overview strong {
  display: block;
}

.routine-overview span {
  color: var(--dash-muted);
  font-size: 0.61rem;
  font-weight: 700;
}

.routine-overview strong {
  margin-top: 2px;
  color: var(--dash-ink);
  font-size: 0.9rem;
}

.routine-composer {
  margin: 14px 0;
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  background: var(--dash-card-soft);
}

.routine-composer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  gap: 15px;
  color: var(--dash-ink);
  cursor: pointer;
  list-style: none;
}

.routine-composer > summary::-webkit-details-marker {
  display: none;
}

.routine-composer > summary > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.73rem;
  font-weight: 800;
}

.routine-composer > summary > span i {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
}

.routine-composer > summary small {
  color: var(--dash-muted);
  font-size: 0.62rem;
}

.routine-composer[open] > summary {
  border-bottom: 1px solid var(--dash-border);
}

.routine-composer .inline-task-form {
  margin: 0;
  border-radius: 0 0 14px 14px;
  background: transparent;
}

.inline-task-form .form-field > small {
  margin-top: -2px;
  color: var(--dash-muted);
  font-size: 0.57rem;
}

.routine-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 9px;
  gap: 12px;
}

.routine-list-heading span {
  color: var(--dash-ink);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.routine-list-heading small {
  color: var(--dash-muted);
  font-size: 0.61rem;
}

.routine-items {
  gap: 9px;
}

.routine-task-card {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 104px;
  padding: 13px 14px;
  gap: 14px;
  overflow: hidden;
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  background: var(--dash-card);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.035);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.routine-task-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--dash-primary);
  content: "";
}

.routine-task-card:hover {
  border-color: color-mix(in srgb, var(--dash-primary) 34%, var(--dash-border));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.075);
  transform: translateY(-1px);
}

.routine-task-card--active::before {
  background: var(--dash-amber);
}

.routine-task-card--due::before {
  background: var(--dash-rose);
}

.routine-task-card--complete::before,
.routine-task-card.is-complete::before {
  background: var(--dash-green);
}

.routine-task-card.is-complete {
  opacity: 0.72;
  background: color-mix(in srgb, var(--dash-green) 4%, var(--dash-card));
}

.routine-task-time {
  display: grid;
  align-content: center;
  min-height: 65px;
  padding-right: 14px;
  border-right: 1px solid var(--dash-border);
}

.routine-task-time strong,
.routine-task-time span {
  display: block;
}

.routine-task-time strong {
  color: var(--dash-ink);
  font-size: 0.87rem;
  line-height: 1.2;
}

.routine-task-time span {
  margin-top: 4px;
  color: var(--dash-muted);
  font-size: 0.6rem;
}

.routine-task-content {
  min-width: 0;
}

.routine-task-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 5px;
  gap: 6px;
}

.routine-task-subject,
.routine-task-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 750;
}

.routine-task-subject {
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
}

.routine-task-status {
  background: var(--dash-card-soft);
  color: var(--dash-muted);
}

.routine-task-status--active {
  background: color-mix(in srgb, var(--dash-amber) 15%, transparent);
  color: color-mix(in srgb, var(--dash-amber) 78%, var(--dash-ink));
}

.routine-task-status--due {
  background: color-mix(in srgb, var(--dash-rose) 12%, transparent);
  color: var(--dash-rose);
}

.routine-task-status--complete {
  background: color-mix(in srgb, var(--dash-green) 13%, transparent);
  color: var(--dash-green);
}

.routine-task-content h4 {
  margin: 0;
  color: var(--dash-ink);
  font-size: 0.83rem;
  line-height: 1.4;
}

.routine-task-card.is-complete .routine-task-content h4 {
  color: var(--dash-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.routine-task-meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 7px;
  gap: 11px;
  color: var(--dash-muted);
  font-size: 0.62rem;
  text-transform: capitalize;
}

.routine-task-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.routine-task-meta i {
  color: color-mix(in srgb, var(--dash-muted) 78%, transparent);
}

.routine-task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.routine-task-check {
  position: relative;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  background: var(--dash-card-soft);
  color: var(--dash-ink);
  cursor: pointer;
}

.routine-task-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.routine-task-check__box {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid var(--dash-border);
  border-radius: 6px;
  background: var(--dash-card);
  color: transparent;
  font-size: 0.58rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.routine-task-check__label {
  font-size: 0.63rem;
  font-weight: 750;
}

.routine-task-check input:checked + .routine-task-check__box {
  border-color: var(--dash-green);
  background: var(--dash-green);
  color: #fff;
}

.routine-task-check:has(input:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--dash-primary) 22%, transparent);
  outline-offset: 2px;
}

.routine-task-remove {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--dash-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.routine-task-remove:hover,
.routine-task-remove:focus-visible {
  border-color: color-mix(in srgb, var(--dash-rose) 24%, var(--dash-border));
  background: color-mix(in srgb, var(--dash-rose) 8%, transparent);
  color: var(--dash-rose);
}

.routine-empty {
  min-height: 150px;
  border: 1px dashed var(--dash-border);
  border-radius: 13px;
  background: var(--dash-card-soft);
}

@media (max-width: 1120px) {
  .analysis-detail-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analysis-detail-strip > div:nth-child(3) {
    border-right: 0;
  }

  .analysis-detail-strip > div:nth-child(-n + 3) {
    border-bottom: 1px solid var(--dash-border);
  }

  .chart-card--outcome {
    grid-column: span 5;
  }

  .chart-card--trend {
    grid-column: span 7;
  }

  .routine-task-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .routine-task-actions {
    grid-column: 2;
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .metric-grid--primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-grid--analytics {
    grid-template-columns: 1fr;
  }

  .chart-card--outcome,
  .chart-card--trend,
  .chart-card--chapters {
    grid-column: 1;
  }

  .chart-frame--doughnut {
    max-width: 320px;
  }

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

  .routine-overview > div:nth-child(2) {
    border-right: 0;
  }

  .routine-overview > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--dash-border);
  }
}

@media (max-width: 640px) {
  .metric-grid--primary {
    grid-template-columns: 1fr;
  }

  .metric--featured {
    min-height: 112px;
  }

  .analysis-detail-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-detail-strip > div,
  .analysis-detail-strip > div:nth-child(3) {
    border-right: 1px solid var(--dash-border);
    border-bottom: 1px solid var(--dash-border);
  }

  .analysis-detail-strip > div:nth-child(even) {
    border-right: 0;
  }

  .analysis-detail-strip > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .outcome-stat-grid,
  .trend-summary-grid {
    grid-template-columns: 1fr;
  }

  .trend-summary-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--dash-border);
  }

  .trend-summary-grid > div:last-child {
    border-bottom: 0;
  }

  .chart-frame--trend {
    height: 225px;
  }

  .chart-frame--chapters {
    height: 300px;
  }

  .routine-composer > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .routine-task-card {
    grid-template-columns: 70px minmax(0, 1fr);
    padding: 12px;
    gap: 11px;
  }

  .routine-task-time {
    min-height: 58px;
    padding-right: 10px;
  }

  .routine-task-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 9px;
    border-top: 1px solid var(--dash-border);
  }

  .routine-task-check {
    flex: 1;
    justify-content: center;
  }

  .routine-task-remove {
    flex: 0 0 auto;
  }
}
