:root {
  --bg: #d8e9f6;
  --surface: #fbfcfd;
  --panel: #f0f5f6;
  --ink: #111315;
  --muted: #68747b;
  --line: #dbe3e5;
  --blue: #2f5ee8;
  --blue-soft: #dfe8ff;
  --coral: #ff563d;
  --lime: #c8f62e;
  --green: #1f7a4d;
  --dark: #121214;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(37, 74, 98, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(47, 94, 232, 0.28);
  outline-offset: 3px;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 64px);
  margin: 32px auto;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 28px 12px;
  background: #eef4f5;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--coral);
  color: var(--white);
  font-weight: 800;
}

.nav-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.nav-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 42px;
  margin: 0 auto;
  border-radius: var(--radius);
  color: #1c252b;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item svg,
.mobile-nav svg,
.search-box svg {
  width: 20px;
  height: 20px;
}

.nav-item span {
  position: absolute;
  left: 54px;
  z-index: 4;
  padding: 6px 9px;
  border-radius: var(--radius);
  background: var(--dark);
  color: var(--white);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.nav-item:hover span {
  opacity: 1;
  transform: translateX(0);
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--coral);
  color: var(--white);
  transform: translateY(-1px);
}

.main-shell {
  min-width: 0;
  padding: 34px 28px 36px;
  background: var(--surface);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar h1,
.page-heading h2,
.now-card h2,
.mission-card h2,
.subject-hero h2,
.micro-main h2 {
  margin: 0;
  line-height: 1.05;
}

.topbar h1 {
  font-size: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 45%);
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #e9eeee;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-clear {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #dbe3e3;
  color: var(--ink);
  cursor: pointer;
}

.search-clear[hidden] {
  display: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) repeat(2, minmax(160px, 0.75fr));
  gap: 12px;
  align-items: stretch;
}

.now-card,
.metric-card,
.soft-panel,
.subject-card,
.subject-tile,
.subject-hero,
.micro-main,
.mission-card,
.metric-grid article {
  border-radius: var(--radius);
  border: 1px solid rgba(17, 19, 21, 0.06);
  box-shadow: 0 14px 36px rgba(15, 25, 32, 0.08);
}

.now-card {
  grid-row: span 2;
  min-height: 310px;
  padding: 22px;
  background: var(--blue);
  color: var(--white);
}

.card-topline,
.section-heading,
.task-meta,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-topline {
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-weight: 750;
  font-size: 12px;
}

.pill.dark {
  background: var(--dark);
  color: var(--white);
}

.now-card h2,
.mission-card h2 {
  max-width: 460px;
  margin-top: 32px;
  font-size: 34px;
}

.recommendation {
  margin-top: 28px;
}

.recommendation h3,
.mission-card h3 {
  max-width: 560px;
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.18;
}

.recommendation p,
.mission-card p,
.foundation-page p {
  color: inherit;
}

.task-meta {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin: 18px 0;
}

.task-meta span {
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.task-meta.large span {
  background: #eff3f3;
  color: var(--ink);
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 19, 21, 0.14);
}

.button:disabled,
.button.is-loading {
  cursor: wait;
  opacity: 0.72;
}

.button.is-loading::after {
  width: 12px;
  height: 12px;
  margin-left: 10px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}

.button.primary {
  background: var(--lime);
  color: var(--ink);
}

.button.ghost {
  background: #eef2f2;
  color: var(--ink);
}

.button.danger {
  background: #a92518;
  color: var(--white);
}

.button.wide {
  width: 100%;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--dark);
  color: var(--white);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.flash {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-weight: 750;
}

.flash.error {
  background: #ffe4df;
  color: #8f210f;
}

.flash.success {
  background: #dff8ee;
  color: #145336;
}

.metric-card {
  display: flex;
  min-height: 148px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
}

.metric-card span,
.metric-card p,
.soft-panel span,
.subject-card small,
.subject-tile small,
.chapter-row small,
.result-list span,
.stacked-metrics span,
.metric-grid span {
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  font-size: 36px;
  line-height: 1;
}

.metric-card.blue {
  background: var(--blue-soft);
}

.metric-card.lime {
  background: var(--lime);
}

.metric-card.coral {
  background: var(--coral);
  color: var(--white);
}

.metric-card.coral span,
.metric-card.coral p {
  color: rgba(255, 255, 255, 0.84);
}

.metric-card.ink {
  background: var(--dark);
  color: var(--white);
}

.metric-card.ink span,
.metric-card.ink p {
  color: rgba(255, 255, 255, 0.76);
}

.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(17, 19, 21, 0.12);
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: var(--radius);
  background: currentColor;
  transition: width 460ms ease;
}

.now-card .progress i,
.metric-card.coral .progress i,
.metric-card.ink .progress i {
  background: var(--white);
}

.panel-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.span-2 {
  grid-column: span 1;
}

.soft-panel {
  padding: 18px;
  background: var(--panel);
}

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

.section-heading h2,
.soft-panel h2 {
  margin: 0;
  font-size: 19px;
}

.section-heading a {
  color: var(--coral);
  font-size: 13px;
  font-weight: 800;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat-row div,
.focus-strip div,
.subject-metrics div,
.stacked-metrics div,
.metric-grid article {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.stat-row strong,
.focus-strip strong,
.subject-metrics strong,
.stacked-metrics strong,
.metric-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.focus-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.mini-subject {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.mini-subject strong {
  float: right;
}

.mini-subject .progress {
  margin-top: 10px;
}

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

.subject-card-grid.compact {
  grid-template-columns: repeat(7, minmax(130px, 1fr));
}

.subject-card,
.subject-tile {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background: var(--white);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.subject-card:hover,
.subject-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(17, 19, 21, 0.13);
}

.subject-card.priority,
.subject-tile.priority {
  background: var(--lime);
}

.subject-card:nth-child(3n+1):not(.priority) {
  background: var(--blue);
  color: var(--white);
}

.subject-card:nth-child(3n+1):not(.priority) small,
.subject-card:nth-child(3n+1):not(.priority) span {
  color: rgba(255, 255, 255, 0.75);
}

.subject-card:nth-child(3n+2):not(.priority) {
  background: var(--dark);
  color: var(--white);
}

.subject-card:nth-child(3n+2):not(.priority) small,
.subject-card:nth-child(3n+2):not(.priority) span {
  color: rgba(255, 255, 255, 0.76);
}

.subject-card h3,
.subject-tile h3 {
  margin: 18px 0;
  font-size: 23px;
  line-height: 1.1;
}

.subject-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.page-heading,
.subject-hero,
.micro-layout,
.today-layout {
  display: grid;
  gap: 12px;
}

.subject-hero {
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: end;
  padding: 24px;
  background: var(--dark);
  color: var(--white);
}

.subject-hero p {
  color: rgba(255, 255, 255, 0.76);
}

.hero-score {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--lime);
  color: var(--ink);
}

.hero-score span {
  color: rgba(17, 19, 21, 0.62);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-score strong {
  display: block;
  font-size: 40px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.metric-grid.six {
  grid-template-columns: repeat(6, 1fr);
}

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

.tax-part-grid article {
  display: grid;
  gap: 8px;
}

.tax-part-grid small {
  color: var(--muted);
}

.chapter-list,
.result-list,
.stacked-metrics {
  display: grid;
  gap: 8px;
}

.chapter-row,
.result-list a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 90px 110px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

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

.result-list small {
  color: var(--muted);
}

.result-list.compact a {
  padding: 11px 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.today-layout,
.micro-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.7fr);
}

.mission-card,
.micro-main {
  padding: 24px;
  background: var(--white);
}

.mission-card {
  background: var(--blue);
  color: var(--white);
}

.mission-chapter {
  color: rgba(255, 255, 255, 0.76);
}

.reason-box {
  margin: 20px 0;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.16);
}

.reason-box span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.reason-box p {
  margin: 8px 0 0;
}

.recall-panel {
  display: grid;
  gap: 14px;
}

.toggle-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.toggle-list button {
  min-height: 38px;
  border: 0;
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
}

.toggle-list button.is-selected {
  background: var(--dark);
  color: var(--white);
}

.field-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.field-label input,
.field-label textarea,
.field-label select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  outline: 0;
  background: var(--white);
}

.stack-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.settings-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.settings-list div {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.settings-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-list dd {
  margin: 0;
  font-weight: 850;
}

.setup-callout {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--lime-soft);
}

.setup-callout h3,
.setup-callout p {
  margin: 0;
}

.setup-callout p {
  margin-top: 6px;
  color: var(--muted);
}

.confirm-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 26px 80px rgba(17, 19, 21, 0.28);
}

.confirm-dialog::backdrop {
  background: rgba(17, 19, 21, 0.42);
}

.confirm-dialog h3,
.confirm-dialog p {
  margin: 0;
}

.confirm-dialog p {
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.compact-form {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.score-row,
.split-actions,
.inline-budget,
.mini-form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.score-row {
  align-items: stretch;
}

.score-row .field-label {
  flex: 1;
  min-width: 0;
}

.split-actions {
  align-items: center;
  flex-wrap: wrap;
}

.inline-budget {
  margin-top: 10px;
}

.inline-budget .field-label {
  flex: 1;
}

.mini-form {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-form input {
  width: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--white);
}

.mini-form input[type="text"] {
  width: min(220px, 100%);
}

.muted {
  color: var(--muted);
}

.soft-panel > .muted,
.task-list > .muted {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(17, 19, 21, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

.mission-list {
  margin-top: 12px;
}

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

.task-list.compact {
  gap: 4px;
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.task-row div {
  min-width: 0;
}

.task-row span,
.task-row small,
.selected-session span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.task-row strong,
.selected-session strong {
  display: block;
  margin: 4px 0;
  line-height: 1.2;
}

.selected-session {
  margin: 12px 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--lime);
}

.state-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(35, 91, 214, 0.12);
  border-radius: var(--radius);
  background: #edf4ff;
}

.state-banner span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.state-banner strong {
  font-size: 20px;
}

.state-banner small {
  color: var(--muted);
}

.focus-mode .sidebar,
.focus-mode .topbar,
.focus-mode .mobile-nav {
  display: none;
}

.focus-mode .app-shell {
  display: block;
  width: min(1440px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
}

.focus-mode .main-shell {
  min-height: 100vh;
  padding: 28px;
}

.focus-board {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(300px, 380px);
  gap: 16px;
  align-items: start;
  width: 100%;
}

.focus-task-card {
  grid-column: 1;
  min-width: 0;
  padding: 26px;
  border: 1px solid rgba(17, 19, 21, 0.06);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 14px 36px rgba(15, 25, 32, 0.08);
}

.focus-task-card:only-child {
  grid-column: 1 / -1;
}

.focus-task-card h2 {
  max-width: 900px;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
  font-size: 44px;
  line-height: 1.02;
}

.focus-task-card > p:not(.eyebrow),
.focus-side-panel p {
  color: var(--muted);
}

.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--lime-soft);
}

.resume-banner span {
  color: var(--muted);
}

.focus-checklist {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 14px;
  border-radius: var(--radius);
  background: #f4f7f7;
}

.focus-checklist label,
.confusion-flag label {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-weight: 760;
}

.focus-complete-form {
  max-width: 780px;
}

.confusion-flag {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(150px, 0.45fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(169, 37, 24, 0.18);
  border-radius: var(--radius);
  background: #fff3ef;
}

.confusion-flag select,
.confusion-flag input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--white);
}

.focus-side-panel {
  grid-column: 2;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.briefing-journey.compact {
  gap: 6px;
}

.weekly-checkin {
  background: var(--lime-soft);
}

.smart-break {
  background: #fff7e9;
}

.you-are-here {
  display: inline-grid;
  gap: 3px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #edf4ff;
}

.you-are-here span,
.topic-heading span,
.practice-target-card span,
.wizard-step > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.breadcrumb-line {
  color: var(--muted);
}

.recall-instruction {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

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

.optional-reflection {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafa;
}

.optional-reflection summary,
.activity-history summary {
  cursor: pointer;
  font-weight: 850;
}

.optional-reflection .field-label,
.optional-reflection .confusion-flag {
  margin-top: 12px;
}

.not-done-form {
  margin-top: 10px;
}

.topic-path-list,
.micro-sequence,
.onboarding-steps {
  display: grid;
  gap: 12px;
}

.topic-path-group,
.wizard-step,
.practice-target-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.topic-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.32fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.topic-heading h3,
.wizard-step h3,
.practice-target-card strong {
  margin: 4px 0 0;
}

.micro-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: #f4f7f7;
}

.micro-step > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #e2eaea;
  font-weight: 900;
}

.micro-step small {
  grid-column: 2;
  color: var(--muted);
}

.micro-step.is-current {
  background: #edf4ff;
  box-shadow: inset 0 0 0 1px rgba(35, 91, 214, 0.2);
}

.micro-step.is-current > span,
.micro-step.is-completed > span {
  background: var(--blue);
  color: var(--white);
}

.micro-step.is-upcoming {
  opacity: 0.76;
}

.onboarding-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.onboarding-hero {
  position: sticky;
  top: 24px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--dark);
  color: var(--white);
}

.onboarding-hero h2 {
  margin: 0;
  line-height: 1.04;
}

.onboarding-hero p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.72);
}

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

.choice-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafa;
  font-weight: 800;
}

.choice-grid label small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

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

.tax-part-picker {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.field-caption {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.compact-settings {
  margin-bottom: 0;
}

.practice-target-card {
  display: grid;
  gap: 14px;
}

.practice-target-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.practice-target-grid div {
  min-height: 96px;
  padding: 12px;
  border-radius: var(--radius);
  background: #f4f7f7;
}

.practice-target-grid strong {
  display: block;
  font-size: 22px;
}

.practice-target-grid small {
  color: var(--muted);
}

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

.journey-stage {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafa;
}

.journey-stage h3 {
  margin: 0;
}

.guided-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.flow-step,
.briefing-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.flow-step > span,
.briefing-step > span {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  background: #eef2f2;
  font-weight: 900;
}

.flow-step strong,
.briefing-step strong {
  display: block;
}

.flow-step small,
.briefing-step small,
.home-hero small,
.modal-subhead {
  color: var(--muted);
}

.flow-step.is-current {
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(35, 91, 214, 0.14);
}

.flow-step.is-current > span,
.briefing-step.is-current > span {
  background: var(--blue);
  color: var(--white);
}

.flow-step.is-complete > span,
.briefing-step.is-complete > span {
  background: var(--lime);
  color: var(--ink);
}

.flow-step.is-locked,
.briefing-step.is-locked {
  opacity: 0.64;
}

.next-stage-note,
.main-focus-box {
  padding: 14px;
  border-radius: var(--radius);
  background: #eef7f5;
}

.next-stage-note span,
.main-focus-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.next-stage-note p,
.main-focus-box strong {
  display: block;
  margin: 6px 0 0;
}

.daily-start-modal,
.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.daily-start-modal {
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 19, 21, 0.48);
}

.daily-start-modal[hidden],
.tour-layer[hidden] {
  display: none;
}

.daily-start-card {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 26px 80px rgba(17, 19, 21, 0.28);
}

.modal-heading,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-heading h2 {
  margin: 0;
}

.modal-actions {
  flex-wrap: wrap;
  margin-top: 16px;
}

.briefing-count-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.briefing-count-grid div {
  min-height: 78px;
  padding: 12px;
  border-radius: var(--radius);
  background: #f2f5f5;
}

.briefing-count-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.briefing-count-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.briefing-journey {
  display: grid;
  gap: 8px;
}

.briefing-journey h3 {
  margin: 0;
}

.briefing-step {
  min-height: 0;
  padding: 10px;
}

.main-focus-box {
  margin-top: 16px;
}

.tour-scrim {
  position: absolute;
  inset: 0;
  background: rgba(11, 16, 18, 0.72);
}

.tour-highlight {
  position: fixed;
  z-index: 1001;
  border: 2px solid var(--lime);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 0 0 9999px rgba(11, 16, 18, 0.58), 0 0 0 8px rgba(198, 246, 43, 0.18);
  pointer-events: none;
  transition: all 180ms ease;
}

.tour-tooltip {
  position: fixed;
  z-index: 1002;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 24px 70px rgba(17, 19, 21, 0.28);
}

.tour-tooltip h2 {
  margin: 0;
}

.tour-tooltip p:not(.eyebrow) {
  color: var(--muted);
}

.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.notification-anchor {
  width: 100%;
  height: 1px;
}

.replay-tour-button {
  margin-top: 12px;
}

.settings-panel {
  max-width: 560px;
}

.danger-panel {
  border-color: rgba(169, 37, 24, 0.22);
}

.danger-panel .eyebrow {
  color: #a92518;
}

.home-hero,
.air-hero,
.app-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.home-hero,
.air-hero {
  padding: 24px;
  border: 1px solid rgba(17, 19, 21, 0.06);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 14px 36px rgba(15, 25, 32, 0.08);
}

.home-hero h2,
.air-hero h2 {
  margin: 0;
  font-size: 42px;
  line-height: 1.02;
}

.home-hero p,
.air-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.summary-card {
  display: flex;
  min-height: 154px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid rgba(17, 19, 21, 0.06);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 14px 36px rgba(15, 25, 32, 0.08);
}

.summary-card span,
.summary-card small,
.spotlight-card span,
.spotlight-card p,
.lesson-row span,
.lesson-row small,
.revision-card span,
.revision-card small {
  color: rgba(17, 19, 21, 0.62);
  font-size: 12px;
}

.summary-card strong {
  display: block;
  font-size: 38px;
  line-height: 1;
}

.summary-card.accent-air,
.subject-card.accent-tax,
.subject-tile.accent-tax,
.task-row.accent-tax,
.revision-card.accent-tax {
  background: #c8f62e;
}

.summary-card.accent-progress,
.subject-card.accent-cafm,
.subject-tile.accent-cafm,
.task-row.accent-cafm,
.revision-card.accent-cafm {
  background: #dfe8ff;
}

.summary-card.accent-revision,
.subject-card.accent-jigl,
.subject-tile.accent-jigl,
.task-row.accent-jigl,
.revision-card.accent-jigl {
  background: #fff0c7;
}

.summary-card.accent-streak,
.subject-card.accent-company,
.subject-tile.accent-company,
.task-row.accent-company,
.revision-card.accent-company {
  background: #ffe2db;
}

.summary-card.accent-warning,
.subject-card.accent-sbill,
.subject-tile.accent-sbill,
.task-row.accent-sbill,
.revision-card.accent-sbill {
  background: #ffd8a8;
}

.subject-card.accent-cmsl,
.subject-tile.accent-cmsl,
.task-row.accent-cmsl,
.revision-card.accent-cmsl {
  background: #dff8ee;
}

.subject-card.accent-ecipl,
.subject-tile.accent-ecipl,
.task-row.accent-ecipl,
.revision-card.accent-ecipl {
  background: #eadfff;
}

.subject-card.accent-default,
.subject-tile.accent-default {
  background: var(--white);
}

.home-main {
  align-items: stretch;
}

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

.lesson-row,
.revision-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(17, 19, 21, 0.05);
  border-radius: var(--radius);
}

.lesson-row div,
.revision-card div {
  min-width: 0;
}

.lesson-row strong,
.revision-card strong {
  display: block;
  margin: 4px 0;
  line-height: 1.18;
}

.lesson-row b {
  white-space: nowrap;
}

.spotlight-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid rgba(17, 19, 21, 0.06);
  border-radius: var(--radius);
  background: #c8f62e;
  color: var(--ink);
  box-shadow: 0 14px 36px rgba(15, 25, 32, 0.08);
}

.spotlight-card span,
.spotlight-card p {
  color: rgba(17, 19, 21, 0.68);
}

.spotlight-card strong {
  margin: 18px 0;
  font-size: 30px;
  line-height: 1.05;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-heading {
  margin-top: 18px;
}

.notice-panel {
  margin: 12px 0;
  padding: 16px 18px;
  border: 1px solid rgba(17, 19, 21, 0.06);
  border-radius: var(--radius);
  background: #fff0c7;
}

.notice-panel.strong {
  background: #ffe2db;
}

.notice-panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.output-box {
  margin: 16px 0;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.2);
}

.output-box span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.output-box p {
  margin: 6px 0 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--lime);
  font-size: 13px;
  font-weight: 800;
}

.revision-form {
  display: grid;
  gap: 10px;
  min-width: min(420px, 100%);
}

.recall-bands {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.recall-bands label {
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.recall-bands input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.recall-bands label:has(input:checked) {
  background: var(--dark);
  color: var(--white);
}

.link-row {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.link-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 19, 21, 0.12);
}

.subject-hero {
  background: var(--white);
  color: var(--ink);
}

.subject-hero p {
  color: var(--muted);
}

.hero-score.light,
.subject-hero .hero-score {
  background: #dfe8ff;
  color: var(--ink);
}

.compact-week .summary-card {
  min-height: 120px;
}

.micro-main {
  min-height: 250px;
}

.micro-main h2 {
  max-width: 720px;
  margin-top: 18px;
  font-size: 34px;
}

.action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 24px;
}

.stacked-metrics strong {
  font-size: 18px;
}

.foundation-page {
  display: grid;
  min-height: 360px;
  place-items: center;
}

.foundation-page .soft-panel {
  width: min(560px, 100%);
}

.error-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.error-shell {
  width: min(520px, calc(100% - 32px));
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mobile-nav {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1040px) {
  .dashboard-grid,
  .panel-grid,
  .summary-card-grid,
  .guided-stepper,
  .today-layout,
  .settings-grid,
  .focus-board,
  .onboarding-shell,
  .practice-target-grid,
  .micro-layout {
    grid-template-columns: 1fr;
  }

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

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

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

  .onboarding-hero {
    position: static;
  }

  .focus-task-card,
  .focus-side-panel {
    grid-column: 1;
  }
}

@media (max-width: 560px) {
  .settings-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .guided-stepper,
  .briefing-count-grid,
  .choice-grid,
  .compact-choice,
  .compact-rating,
  .topic-heading {
    grid-template-columns: 1fr;
  }

  .daily-start-modal {
    align-items: end;
    padding: 10px;
  }

  .daily-start-card {
    max-height: calc(100vh - 20px);
  }

  .modal-heading,
  .modal-actions,
  .tour-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  body {
    background: var(--surface);
  }

  .app-shell {
    display: block;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .focus-mode .app-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
  }

  .sidebar {
    display: none;
  }

  .main-shell {
    padding: 22px 14px 86px;
  }

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

  .search-box {
    width: 100%;
  }

  .dashboard-grid,
  .summary-card-grid,
  .subject-card-grid,
  .subject-card-grid.compact,
  .stat-row,
  .focus-strip,
  .focus-board,
  .metric-grid,
  .metric-grid.six,
  .subject-hero {
    grid-template-columns: 1fr;
  }

  .home-hero,
  .air-hero,
  .app-heading,
  .lesson-row,
  .revision-card {
    align-items: stretch;
    flex-direction: column;
  }

  .home-hero h2,
  .air-hero h2 {
    font-size: 34px;
  }

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

  .now-card h2,
  .mission-card h2,
  .micro-main h2 {
    font-size: 28px;
  }

  .chapter-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .chapter-row small,
  .chapter-row .progress {
    grid-column: 2;
  }

  .score-row,
  .split-actions,
  .inline-budget,
  .confusion-flag,
  .task-row,
  .mini-form {
    align-items: stretch;
    flex-direction: column;
  }

  .confusion-flag {
    grid-template-columns: 1fr;
  }

  .mini-form input,
  .mini-form input[type="text"] {
    width: 100%;
  }

  .mobile-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 32px rgba(17, 19, 21, 0.18);
  }

  .mobile-nav a {
    display: grid;
    min-height: 42px;
    place-items: center;
    border-radius: var(--radius);
    color: var(--ink);
  }

  .mobile-nav a.is-active {
    background: var(--coral);
    color: var(--white);
  }
}
