@import url("design-system/brand-fonts.css?v=e464d8f1d62b");
@import url("design-system/tokens.css?v=10f4ce486543");

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(63, 102, 243, 0.35);
  outline-offset: 3px;
}

textarea {
  font: inherit;
}

.feedback-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.feedback-panel h2 {
  margin: 4px 0 8px;
}

.feedback-panel p {
  margin-bottom: 0;
}

.feedback-form {
  display: grid;
  gap: 8px;
}

.feedback-form label {
  font-weight: 750;
}

.feedback-form textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  resize: vertical;
}

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

.feedback-actions p {
  margin: 0;
}

.feedback-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (max-width: 700px) {
  .feedback-panel {
    grid-template-columns: 1fr;
  }
}

a {
  color: var(--accent-dark);
  text-underline-offset: 3px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  line-height: 1.08;
}

h3 {
  font-size: 1.16rem;
  line-height: 1.16;
}

.app-shell {
  width: min(1240px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 4px 26px;
}

.brand-lockup {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--mint);
  color: var(--teal);
  font-size: 1.4rem;
  font-weight: 950;
}

.brand-mark::before {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background:
    linear-gradient(var(--teal), var(--teal)) center / 100% 5px no-repeat,
    linear-gradient(var(--teal), var(--teal)) center / 5px 100% no-repeat;
  content: "";
}

.topbar h1 {
  max-width: 600px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(2.25rem, 5vw, 4.55rem);
  line-height: 0.91;
}

.topline {
  max-width: 680px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.component-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 13px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.component-link:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

select,
input[type="date"],
input[type="number"],
input[type="search"] {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  padding: 9px 12px;
}

select:focus,
input:focus {
  border-color: var(--cobalt);
}

.tabs {
  position: sticky;
  top: 10px;
  z-index: 10;
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  padding: 7px;
}

.tab {
  flex: 1 0 auto;
  border-radius: 12px;
  background: transparent;
  color: var(--muted-strong);
  padding: 9px 16px;
  font-weight: 850;
  white-space: nowrap;
}

.tab.active {
  background: var(--teal);
  color: white;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  padding: 24px;
}

.panel + .panel,
.focus-grid,
.skills-layout {
  margin-top: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.panel-heading h2,
.panel h2 {
  margin: 0;
}

.eyebrow {
  display: block;
  margin: 0 0 7px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

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

.primary,
.ghost {
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font-weight: 900;
}

.primary span[aria-hidden="true"],
.ghost span[aria-hidden="true"] {
  display: inline-block;
  margin-left: 4px;
  transition: transform 160ms ease;
}

.primary:hover:not(:disabled) span[aria-hidden="true"],
.ghost:hover:not(:disabled) span[aria-hidden="true"] {
  transform: translate(2px, -2px);
}

.primary {
  background: var(--teal);
  color: white;
}

.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.ghost {
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--ink);
}

.ghost:hover:not(:disabled) {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

.dashboard-grid,
.skills-layout,
.dashboard-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.study-summary {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 0.8fr);
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: none;
}

.study-summary h2,
.study-summary .eyebrow {
  color: var(--ink);
}

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

.hud-grid,
.mission-stats,
.badge-list {
  display: grid;
  gap: 11px;
}

.hud-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hud-grid div,
.mission-card,
.badge,
.scenario-card,
.skill-score {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.hud-grid div {
  min-width: 0;
  border-color: var(--line);
  background: #f7fafb;
  padding: 13px;
}

.hud-grid strong {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
}

.hud-grid span,
.mission-card span,
.badge span,
.skill-score span {
  color: var(--muted);
  font-size: 0.84rem;
}

.hud-grid span {
  color: var(--muted);
}

.dashboard-primary-grid {
  margin-bottom: 18px;
}

.unit-panel,
.missions-panel {
  min-height: 100%;
}

.mission-list,
.mission-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.mission-deck-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--line-strong);
  padding: 0 2px 13px;
}

.mission-deck-heading p {
  margin: 4px 0 0;
}

.mission-card {
  position: relative;
  display: grid;
  min-height: 208px;
  gap: 10px;
  align-content: space-between;
  padding: 17px;
}

.mission-card strong,
.badge strong {
  display: block;
  color: var(--ink);
}

.mission-card p {
  margin: 4px 0 4px;
}

.mission-card.complete {
  border-color: rgba(26, 168, 154, 0.48);
  background: #eafaf3;
}

.mission-card.complete > div > span {
  color: var(--accent-dark);
  font-weight: 900;
}

.mission-card button {
  width: 100%;
  white-space: nowrap;
}

.mission-card-index,
.deck-label,
.badge-state {
  color: var(--accent-dark);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mission-card-index {
  display: block;
  padding-right: 42px;
}

.mission-card-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--mint);
  color: var(--teal);
  font-size: 1.2rem;
  font-weight: 950;
}

.mission-card-support {
  color: var(--accent-dark) !important;
  font-weight: 900;
}

.mission-card-large {
  min-height: 260px;
}

.mission-card.complete::before {
  border-color: rgba(26, 168, 154, 0.34);
}

.badge-panel {
  margin-top: 18px;
}

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

.badge-card-grid {
  gap: 15px;
}

.badge {
  position: relative;
  min-height: 76px;
  padding: 13px;
}

.badge-card {
  display: grid;
  min-height: 190px;
  align-content: space-between;
  gap: 14px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--white);
  padding: 17px;
}

.badge-medallion {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--mint);
  color: var(--teal);
  font-size: 1.35rem;
}

.badge-card-body {
  display: grid;
  gap: 5px;
}

.badge-card-body strong {
  font-size: 1.06rem;
}

.badge-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.badge-card.locked {
  opacity: 0.72;
}

.badge-card.locked .badge-medallion {
  border-color: var(--line-strong);
  background: var(--line);
  box-shadow: none;
  color: var(--muted-strong);
}

.badge-card.locked .badge-state {
  color: var(--muted-strong);
}

.badge-card strong::before {
  display: none;
}

.badge.badge-card.locked {
  opacity: 1;
}

.badge-list:not(.badge-card-grid) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.badge {
  min-width: 0;
}

.badge.locked {
  opacity: 0.53;
}

.badge strong::before {
  display: none;
}

.badge.locked strong::before {
  background: var(--line-strong);
}

.score-ring {
  --score: 0%;
  display: grid;
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) var(--score), var(--line) 0);
  position: relative;
}

.score-ring::after {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--white);
  content: "";
}

.score-ring span {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-weight: 950;
}

.stat-grid,
.exam-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 18px;
}

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

.stat-grid div,
.exam-facts div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.64);
  padding: 13px;
}

.stat-grid strong,
.exam-facts strong {
  display: block;
  color: var(--navy);
  font-size: 1.35rem;
}

.stat-grid span,
.exam-facts span {
  color: var(--muted);
  font-size: 0.86rem;
}

.state-panel {
  background: var(--white);
}

.blueprint-list,
.skill-draw-list,
.skill-card-grid,
.source-list,
.plan-breakdown {
  display: grid;
  gap: 12px;
}

/* The outline is a reading surface first: hierarchy, weight, and action. */
.blueprint-intro {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  padding: 20px;
}

.blueprint-intro-copy h2 {
  margin: 0;
}

.blueprint-intro-copy .muted {
  max-width: 620px;
  margin: 9px 0 14px;
}

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

.blueprint-route::before {
  display: none;
}

.blueprint-stop {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 190px;
  align-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  padding: 16px;
}

.blueprint-stop-top,
.blueprint-stop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.blueprint-stop-number {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.blueprint-stop-top strong {
  color: var(--stop-ink, var(--stop-color));
  font-size: 1.55rem;
}

.blueprint-stop h3 {
  margin: 0;
}

.blueprint-stop p,
.blueprint-stop-footer {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.blueprint-stop-footer {
  border-top: 1px dashed var(--line-strong);
  padding-top: 11px;
}

.bar,
.progress-track,
.safety-meter {
  height: 12px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: #e7efeb;
}

.bar span,
.progress-track span,
.safety-meter span {
  display: block;
  height: 100%;
  width: var(--width, 0%);
  border-radius: inherit;
  background: var(--teal);
  transition: width 180ms ease;
}

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

.focus-card {
  min-height: 210px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 18px;
}

.focus-card h3 {
  margin: 0 0 8px;
}

.focus-card p {
  min-height: 56px;
}

.practice-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.65fr);
  grid-template-areas: "intro filter" "modes modes" "note note";
  gap: 20px;
  align-items: end;
  background: var(--white);
}

.practice-builder > * { min-width: 0; }
.practice-intro { grid-area: intro; }
.practice-builder .field { grid-area: filter; }
.practice-builder .field select { width: 100%; }
.practice-builder .mode-grid { grid-area: modes; }
.practice-note { grid-area: note; margin: 0; }

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

.mode-card {
  position: relative;
  min-height: 118px;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 15px;
}

.mode-card strong,
.mode-card span {
  display: block;
  position: relative;
  z-index: 1;
}

.mode-card strong {
  color: var(--navy);
}

.mode-card-kicker {
  display: block;
  color: var(--accent-dark) !important;
  font-size: 0.68rem !important;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-card span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.89rem;
}

.mode-card strong span { display: inline; }

.mode-card:hover {
  border-color: var(--line-strong);
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.toggle-row {
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.quiz-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.timer {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--mint);
  padding: 9px 14px;
  color: var(--ink);
  font-weight: 950;
}

.progress-track {
  height: 13px;
  margin: 18px 0;
}

.progress-track span {
  background: var(--teal);
}

.question-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #fffefd;
  padding: 22px;
}

.domain-chip {
  display: inline-flex;
  margin: 0 0 13px;
  border-radius: var(--radius-pill);
  background: var(--mint);
  color: var(--accent-dark);
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 950;
}

.question-card h3 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  line-height: 1.12;
}

.answers,
.scenario-options {
  display: grid;
  gap: 11px;
  margin-top: 20px;
}

.answer-button {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
  padding: 14px;
  color: var(--ink);
}

.answer-button:hover:not(:disabled),
.scenario-option:hover:not(:disabled) {
  border-color: var(--line-strong);
}

.answer-button:disabled,
.scenario-option:disabled {
  cursor: default;
  opacity: 1;
}

.answer-button strong {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 10px;
  background: var(--sky);
  color: var(--cobalt);
}

.answer-button.correct {
  border-color: var(--teal);
  background: #eafaf3;
}

.answer-button.correct strong {
  background: var(--action-background);
  color: var(--action-foreground);
}

.answer-button.incorrect {
  border-color: var(--coral);
  background: #fff0ed;
}

.answer-button.incorrect strong {
  background: var(--coral);
  color: white;
}

.explanation {
  margin-top: 18px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 15px;
}

.explanation strong {
  color: var(--accent-dark);
}

.quiz-actions,
.scenario-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.results-panel h2 {
  margin-top: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin: 15px 0;
}

.result-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  padding: 13px;
}

.result-grid strong {
  display: block;
  color: var(--navy);
  font-size: 1.35rem;
}

.result-grid span {
  color: var(--muted);
  font-size: 0.86rem;
}

.scenario-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: start;
}

.safety-meter {
  height: 17px;
  margin-top: 18px;
  background: #f2e9d4;
}

.safety-meter span {
  background: var(--teal);
}

.scenario-card {
  margin-top: 20px;
  border-color: var(--line);
  background: var(--white);
  padding: 22px;
}

.scenario-card h3 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
}

.scenario-option {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 70px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
  padding: 14px;
}

.scenario-option strong {
  color: var(--ink);
}

.scenario-option span {
  color: var(--muted);
  font-size: 0.9rem;
}

.scenario-option.correct {
  border-color: var(--teal);
  background: #eafaf3;
}

.scenario-option.incorrect {
  border-color: var(--coral);
  background: #fff0ed;
}

.skill-draw-list {
  margin: 18px 0;
}

.draw-item,
.source-item,
.plan-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  padding: 14px;
}

.draw-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.draw-item strong,
.source-item strong {
  display: block;
  color: var(--navy);
}

.skill-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 17px;
}

.skill-timer strong {
  color: var(--navy);
  font-size: 2rem;
  line-height: 1;
}

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

.sequence-visual span {
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font-weight: 750;
  text-align: center;
  padding: 9px 6px;
}

.sequence-visual span:nth-child(even) {
  background: var(--white);
}

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

.skill-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.skill-card.mastered {
  border-color: rgba(26, 168, 154, 0.48);
  background: #eafaf3;
}

.skill-card h3 {
  margin: 0 0 8px;
}

.skill-card ul {
  margin: 11px 0 0;
  padding-left: 20px;
}

.skill-card li + li {
  margin-top: 5px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 11px;
}

.tag {
  border-radius: var(--radius-pill);
  background: var(--sky);
  color: #3f5d9f;
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 900;
}

.critical {
  color: #b8473e;
  font-weight: 900;
}

.skill-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 10px;
}

.planner {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 20px;
  background: var(--white);
}

.planner-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  align-items: end;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

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

.plan-summary div {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  padding: 13px;
}

.plan-summary strong {
  display: block;
  color: var(--navy);
  font-size: 1.3rem;
}

.source-item p,
.plan-row p {
  margin: 7px 0 0;
}

.source-item {
  background: rgba(255, 255, 255, 0.76);
}

@media (max-width: 1040px) {
  .dashboard-grid,
  .skills-layout,
  .planner,
    .study-summary,
  .dashboard-primary-grid,
  .scenario-shell {
    grid-template-columns: 1fr;
  }

  .practice-builder {
    align-items: stretch;
  }

  .focus-grid,
  .skill-card-grid,
  .badge-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 680px) {
  .practice-builder {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "filter" "modes" "note";
  }
  .app-shell {
    width: min(100vw - 20px, 1240px);
    padding-top: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 12px;
    box-shadow: none;
  }

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

  .topbar-actions > * {
    width: 100%;
    justify-content: center;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .tab {
    width: 100%;
  }

  .panel {
    border-radius: 20px;
    padding: 17px;
  }

  .panel-heading,
  .quiz-topline,
  .skill-timer {
    align-items: stretch;
    flex-direction: column;
  }

  .stat-grid,
  .exam-facts,
  .focus-grid,
  .skill-card-grid,
  .result-grid,
  .sequence-visual,
  .badge-list,
  .mode-grid,
  .plan-summary,
  .planner-controls,
    .hud-grid {
    grid-template-columns: 1fr;
  }

  .mission-list,
  .mission-card-grid,
  .blueprint-route {
    grid-template-columns: 1fr;
  }

  .score-ring {
    align-self: flex-start;
  }

  .mission-card,
  .draw-item,
  .scenario-actions,
  .quiz-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .mission-card button,
  .draw-item > *,
  .scenario-actions > *,
  .quiz-actions > * {
    width: 100%;
  }

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

/* Candidate exam journey */
.exam-intro { margin-bottom: 16px; }
.exam-intro h2 { margin: 0 0 10px; }
.source-date { margin: 14px 0 0; color: var(--muted-strong); font-size: .85rem; }
.exam-checklist-panel { margin-bottom: 16px; }
.exam-step-list { display: grid; gap: 0; }
.exam-step { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: start; border-top: 1px solid var(--line); padding: 18px 0; }
.exam-step:last-child { padding-bottom: 0; }
.exam-step-number { color: var(--teal); font-size: .86rem; font-weight: 800; }
.exam-step h3 { margin: 0 0 5px; }
.exam-step p { margin: 0 0 8px; }
.exam-step-check { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.exam-step-check input { width: 20px; height: 20px; accent-color: var(--teal); }
.exam-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.exam-detail-grid h2 { margin: 0 0 12px; }
.exam-detail-grid p { margin: 0 0 12px; }
.exam-action { display: inline-flex; min-height: 44px; align-items: center; border-radius: 10px; background: var(--action-background); color: var(--action-foreground); padding: 8px 14px; font-weight: 700; text-decoration: none; }
.exam-action:hover { color: #fff; background: var(--navy); }
@media (max-width: 680px) {
  .exam-step { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .exam-step-check { grid-column: 2; justify-self: start; }
  .exam-detail-grid { grid-template-columns: 1fr; }
}

/* Final light-system pass: grouped surfaces, system typography, and one calm action color. */
body {
  background: #f2f2f7;
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(1040px, calc(100vw - 32px));
}

.topbar h1 {
  font-weight: 750;
  letter-spacing: -0.035em;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: 11px;
}

.tabs {
  border-color: rgba(60, 60, 67, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 1px 2px rgba(24, 33, 43, 0.04);
  padding: 4px;
}

.tab {
  border-radius: 8px;
  color: #6e6e73;
  font-weight: 650;
}

.tab.active {
  background: rgba(0, 122, 116, 0.12);
  color: var(--accent-dark);
}

.panel,
.focus-card,
.question-card,
.scenario-card,
.mode-card,
.state-panel,
.blueprint-intro,
.practice-builder,
.planner,
.preferences-panel {
  border-color: rgba(60, 60, 67, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
}

.eyebrow,
.deck-label,
.mission-card-index,
.badge-state {
  letter-spacing: 0.02em;
  text-transform: none;
}

.primary,
.ghost {
  font-weight: 700;
}

.focus-card {
  border-left: 0;
  border-top: 3px solid var(--teal);
}

.focus-card:nth-child(2) {
  border-top-color: #5c9d97;
}

.focus-card:nth-child(3) {
  border-top-color: #7aa6a1;
}

.hud-grid div,
.stat-grid div,
.exam-facts div {
  border-color: rgba(60, 60, 67, 0.12);
  background: rgba(248, 248, 250, 0.82);
}

@media (max-width: 680px) {
  .app-shell {
    width: min(calc(100vw - 20px), 1040px);
  }

  .tabs {
    top: 6px;
  }
}

/* Practical review language: progress is a study aid, not a reward system. */
.topbar h1 {
  font-size: clamp(2rem, 3.5vw, 3.2rem);
}

.missions-panel .mission-card {
  grid-template-columns: 112px minmax(0, 1fr) auto;
}

.missions-panel .mission-card-index {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: none;
}

.missions-panel .mission-card-support {
  color: var(--muted-strong) !important;
  font-weight: 650;
}

.badge-panel .badge-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  gap: 0 32px;
  border-top: 1px solid var(--line);
}

.badge-panel .badge-card {
  display: block;
  min-height: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 14px 0;
  opacity: 1;
}

.badge-panel .badge-medallion {
  display: none;
}

.badge-panel .badge-card-body {
  gap: 4px;
}

.badge-panel .badge-state {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: none;
}

.badge-panel .badge-card.locked .badge-state,
.badge-panel .badge-card.locked .badge-card-body p {
  color: var(--muted-strong);
}

@media (max-width: 680px) {
  .missions-panel .mission-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .missions-panel .mission-card-index {
    grid-column: 1;
    grid-row: 1;
  }

  .missions-panel .mission-card > div {
    grid-column: 1;
    grid-row: 2;
  }

  .missions-panel .mission-card button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Calm utility pass: quiet, system-like surfaces instead of decorative lore. */
body {
  background: var(--canvas);
}

body::before {
  display: none;
}

button:hover:not(:disabled) {
  transform: none;
}

h1,
h2,
h3 {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

.app-shell {
  width: min(1080px, calc(100vw - 32px));
  padding-top: 24px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--mint);
  box-shadow: none;
  color: var(--teal);
  transform: none;
}

.topbar h1 {
  max-width: 520px;
  color: var(--ink);
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  line-height: 1;
}

.tabs {
  border-color: var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.tab.active {
  background: var(--teal);
  box-shadow: none;
}

.view {
  animation: none;
}

.panel,
.state-panel,
.practice-builder,
.planner,
.scenario-card,
.mode-card,
.focus-card,
.skill-card,
.draw-item,
.source-item,
.plan-row,
.stat-grid div,
.exam-facts div,
.result-grid div,
.question-card {
  border-radius: 14px;
  background: var(--white);
  box-shadow: none;
}

.mission-card,
.badge-card {
  box-shadow: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.mission-card::before,
.mode-card::after,
.badge-card::before {
  display: none;
}

.mission-card:hover,
.badge-card:hover {
  box-shadow: none;
  transform: none;
}

.badge-card {
  border-radius: 14px;
  background: var(--white);
}

.badge-medallion {
  border-width: 1px;
  border-color: var(--line-strong);
  background: var(--mint);
  box-shadow: none;
  color: var(--teal);
}

.score-ring {
  background: conic-gradient(var(--teal) var(--score), var(--line) 0);
  transform: none;
}

.score-ring span {
  transform: none;
}

.blueprint-route::before,
.blueprint-stop::before {
  display: none;
}

.blueprint-stop {
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  animation: none;
  transition: none;
}

.blueprint-stop:hover {
  box-shadow: none;
  transform: none;
}

.progress-track span,
.safety-meter span {
  background: var(--teal);
}

.timer {
  background: var(--mint);
}

.scenario-card {
  border-color: var(--line);
  background: var(--white);
}

.practice-builder,
.planner {
  background: var(--white);
}

/* Midnight is a real study mode, not a color inversion. Keep controls and
   sample cards on dark surfaces so their text never lands on a near-white
   overlay with a pale token color. */
[data-theme="midnight"] .tabs {
  border-color: #5d8490;
  background: rgba(12, 31, 46, 0.94);
}

[data-theme="midnight"] .tab {
  color: #e1f1eb;
}

[data-theme="midnight"] .tab.active {
  background: var(--cobalt);
  color: white;
}

[data-theme="midnight"] .mission-card,
[data-theme="midnight"] .badge,
[data-theme="midnight"] .blueprint-stop {
  border-color: #6b9da0;
  background: #204457;
}

[data-theme="midnight"] .mission-card.complete {
  background: #16463f;
}

[data-theme="midnight"] .blueprint-stop-top strong {
  color: var(--ink);
}

[data-theme="midnight"] .mission-card .muted,
[data-theme="midnight"] .badge-card-body p,
[data-theme="midnight"] .blueprint-stop p,
[data-theme="midnight"] .blueprint-stop-footer {
  color: #d0e5dd;
}

[data-theme="midnight"] .topbar h1 {
  color: #f5fffb;
  text-shadow: 0 2px 0 rgba(2, 11, 19, 0.2);
}

[data-theme="midnight"] .component-link,
[data-theme="midnight"] .ghost,
[data-theme="midnight"] select,
[data-theme="midnight"] input[type="date"],
[data-theme="midnight"] input[type="number"],
[data-theme="midnight"] input[type="search"] {
  border-color: #5d8490;
  background: #17324d;
  color: #f5fffb;
}

[data-theme="midnight"] .component-link:hover,
[data-theme="midnight"] .ghost:hover:not(:disabled) {
  border-color: var(--sun);
  color: var(--sun);
}

[data-theme="midnight"] .state-panel {
  background: linear-gradient(145deg, #1f4262, #174b4c);
}

[data-theme="midnight"] .exam-facts div,
[data-theme="midnight"] .stat-grid div,
[data-theme="midnight"] .result-grid div,
[data-theme="midnight"] .plan-summary div {
  border-color: #6b9da0;
  background: #204457;
}

[data-theme="midnight"] .exam-facts strong,
[data-theme="midnight"] .stat-grid strong,
[data-theme="midnight"] .result-grid strong,
[data-theme="midnight"] .plan-summary strong,
[data-theme="midnight"] .mode-card strong,
[data-theme="midnight"] .draw-item strong,
[data-theme="midnight"] .source-item strong,
[data-theme="midnight"] .skill-timer strong {
  color: #f5fffb;
}

[data-theme="midnight"] .question-card,
[data-theme="midnight"] .answer-button,
[data-theme="midnight"] .scenario-card,
[data-theme="midnight"] .scenario-option,
[data-theme="midnight"] .skill-card,
[data-theme="midnight"] .draw-item,
[data-theme="midnight"] .source-item,
[data-theme="midnight"] .plan-row,
[data-theme="midnight"] .focus-card,
[data-theme="midnight"] .mode-card,
[data-theme="midnight"] .sequence-visual span {
  border-color: #5d8490;
  background: #1d3d51;
  color: #f5fffb;
}

[data-theme="midnight"] .question-card h3,
[data-theme="midnight"] .scenario-option strong,
[data-theme="midnight"] .skill-card h3,
[data-theme="midnight"] .focus-card h3 {
  color: #f5fffb;
}

[data-theme="midnight"] .scenario-card {
  border-color: #806f4c;
  background: linear-gradient(135deg, #4c4328, #1d3d51 72%);
}

[data-theme="midnight"] .answer-button.correct,
[data-theme="midnight"] .scenario-option.correct,
[data-theme="midnight"] .skill-card.mastered {
  border-color: #55c7a8;
  background: #154b43;
}

[data-theme="midnight"] .answer-button.incorrect,
[data-theme="midnight"] .scenario-option.incorrect {
  border-color: #ff927f;
  background: #562f35;
}

[data-theme="midnight"] .tag {
  background: #2d4778;
  color: #e8f0ff;
}

[data-theme="midnight"] .critical {
  color: #ffad9f;
}

/* Light study-desk direction: quiet surfaces, direct hierarchy, and one clear action color. */
body {
  background: var(--canvas);
  color: var(--ink);
}

body::before {
  display: none;
}

button:hover:not(:disabled) {
  transform: none;
}

h1,
h2,
h3 {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.025em;
}

.app-shell {
  width: min(1180px, calc(100vw - 40px));
  padding-top: 24px;
}

.topbar {
  align-items: center;
  padding-bottom: 20px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  border: 1px solid var(--teal);
  border-radius: 12px;
  background: var(--mint);
  box-shadow: none;
  transform: none;
}

.brand-mark::before {
  background:
    linear-gradient(var(--teal), var(--teal)) center / 100% 5px no-repeat,
    linear-gradient(var(--teal), var(--teal)) center / 5px 100% no-repeat;
}

.topbar h1 {
  color: var(--ink);
  font-size: clamp(1.65rem, 3vw, 2rem);
  line-height: 1.15;
}

.topline {
  max-width: 600px;
  margin-top: 9px;
}

.component-link,
.ghost,
select,
input[type="date"],
input[type="number"],
input[type="search"] {
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: none;
}

.component-link:hover,
.ghost:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--accent-dark);
}

.tabs {
  border-color: var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 1px 2px rgba(24, 33, 43, 0.04);
}

.tab {
  border-radius: 9px;
  color: var(--muted-strong);
  font-weight: 700;
  transition: none;
}

.tab.active {
  background: var(--action-background);
  box-shadow: none;
  color: var(--action-foreground);
}

.panel {
  overflow: visible;
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: none;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: none;
}

.eyebrow::before {
  display: none;
}

.primary {
  background: var(--action-background);
  box-shadow: none;
  color: var(--action-foreground);
}

.primary:hover:not(:disabled) {
  background: var(--action-hover);
  box-shadow: none;
}

.study-summary {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: none;
}

.study-summary h2,
.study-summary .eyebrow {
  color: var(--ink);
}

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

.hud-grid div {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.hud-grid strong,
.hud-grid span {
  color: var(--ink);
}

.hud-grid span {
  color: var(--muted);
}

.study-path-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.study-path-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}

.study-path-row > span {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 750;
}

.study-path-row strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.study-path-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.mission-card,
.badge,
.scenario-card,
.skill-score,
.mode-card,
.question-card,
.answer-button,
.scenario-option,
.skill-card,
.draw-item,
.source-item,
.plan-row,
.focus-card,
.sequence-visual span {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: none;
}

.mission-card:hover,
.mode-card:hover,
.answer-button:hover:not(:disabled),
.scenario-option:hover:not(:disabled),
.skill-card:hover {
  border-color: var(--line-strong);
  box-shadow: none;
  transform: none;
}

.mission-card-symbol {
  color: var(--teal);
}

.mode-card::after {
  content: none;
}

.state-panel,
.blueprint-intro {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: none;
}

.blueprint-intro {
  display: block;
}

.blueprint-intro-copy {
  max-width: 680px;
}

.blueprint-route {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.blueprint-stop {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 0;
  border-color: var(--line);
  border-width: 0 0 1px;
  border-radius: 0;
  background: var(--white);
  padding: 16px 0;
  box-shadow: none;
  animation: none;
}

.blueprint-stop:last-child {
  border-bottom: 0;
}

.blueprint-stop:hover {
  box-shadow: none;
  transform: none;
}

.blueprint-route::before {
  display: none;
}

.blueprint-stop-top {
  display: contents;
}

.blueprint-stop-number {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.blueprint-stop-top strong {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.blueprint-stop h3 {
  grid-column: 2;
  grid-row: 1;
}

.blueprint-stop p {
  grid-column: 2;
  grid-row: 2;
  margin: 3px 0 0;
}

.blueprint-stop-footer {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}

.badge-medallion {
  display: none;
}

.badge-card {
  grid-template-columns: 1fr;
}

.score-ring {
  box-shadow: none;
}

.question-card,
.scenario-card {
  padding: 20px;
}

.answer-button,
.scenario-option {
  color: var(--ink);
}

.focus-card {
  border-left-width: 3px;
}

/* Light study desk: next actions are grouped rows, not game cards. */
.missions-panel .mission-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
  gap: 0;
  border-top: 1px solid var(--line);
}

.missions-panel .mission-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 0;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 14px 0;
}

.missions-panel .mission-card::before,
.missions-panel .mission-card-symbol {
  display: none;
}

.missions-panel .mission-card-index {
  grid-column: 1;
  grid-row: 1;
  padding: 0;
  color: var(--muted-strong);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.missions-panel .mission-card > div {
  grid-column: 2;
  grid-row: 1;
}

.missions-panel .mission-card button {
  grid-column: 3;
  grid-row: 1;
  width: auto;
  min-height: 44px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent-dark);
  padding: 10px 0 10px 10px;
}

.missions-panel .mission-card button:hover {
  border-color: transparent;
  background: var(--mint);
  color: var(--ink);
  transform: none;
}

.missions-panel .mission-card.complete {
  background: transparent;
}

.missions-panel .mission-card-support {
  font-size: 0.78rem;
}

.dashboard-primary-grid {
  grid-template-columns: 1fr;
  align-items: start;
}

.dashboard-primary-grid > .panel,
.unit-panel,
.missions-panel {
  align-self: start;
  min-height: 0;
}

.preferences-panel {
  margin-top: 18px;
}

.preferences-panel .panel-heading {
  align-items: center;
  margin-bottom: 0;
}

.preferences-panel .muted {
  margin: 5px 0 0;
}

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

@media (max-width: 680px) {
  .app-shell {
    width: min(calc(100vw - 20px), 1180px);
    padding-top: 16px;
  }

  .panel {
    padding: 17px;
  }

  .topbar h1 {
    font-size: 1.65rem;
  }

  .study-path-row { grid-template-columns: 24px minmax(0, 1fr); }
  .study-path-row button { grid-column: 2; justify-self: start; }

  .missions-panel .mission-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .missions-panel .mission-list {
    grid-template-columns: 1fr;
  }

  .missions-panel .mission-card button {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    padding-left: 0;
  }

  .preferences-panel .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .preference-actions {
    justify-content: flex-start;
  }
}

/* Enlarged text must wrap inside mobile tabs instead of crossing adjacent tabs. */
@media (max-width: 680px) {
  .tabs .tab { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
}

/* Hosted desk only: a link to the study chat sits in the top bar. */
.topbar:has(.study-chat-link) {
  flex-wrap: wrap;
}
.study-chat-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--mint);
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.study-chat-link:hover {
  text-decoration: underline;
}
@media (max-width: 640px) {
  .study-chat-link {
    margin-left: 0;
  }
}

/* Approved family mark, also works when index.html is opened directly. */
.brand-mark { border:0;background:transparent url("design-system/brand-mark-animated.svg") center/contain no-repeat }
.brand-mark::before { display:none }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:3px solid var(--focus);outline-offset:3px }
