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

body {
  background: var(--canvas);
}

.sb-app {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 30px 0 72px;
}

.sb-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 28px 30px;
  color: var(--ink);
}

.sb-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.98;
}

.sb-header p:last-child {
  max-width: 670px;
  margin: 12px 0 0;
  color: var(--muted);
}

.sb-kicker,
.sb-sidebar-heading,
.sb-count,
.sb-story-id {
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sb-kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
}

.sb-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.sb-header .ghost,
.sb-header .component-link {
  border-color: var(--line-strong);
  background: var(--white);
  color: var(--ink);
}

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

.sb-badge,
.sb-story-id,
.sb-count {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 7px 10px;
}

.sb-badge {
  background: var(--mint);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 950;
}

.sb-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.sb-sidebar {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 16px;
}

.sb-sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 4px 10px;
  color: var(--muted-strong);
}

.sb-count {
  background: var(--mint);
  color: var(--accent-dark);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
}

.sb-sidebar nav {
  display: grid;
  gap: 4px;
}

.sb-sidebar button {
  position: relative;
  min-height: 38px;
  border-left: 4px solid transparent;
  border-radius: 6px 12px 12px 6px;
  background: transparent;
  color: var(--muted-strong);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 800;
}

.sb-sidebar button:hover:not(:disabled) {
  background: var(--sky);
  color: var(--cobalt);
  transform: none;
}

.sb-sidebar button.active {
  border-left-color: var(--teal);
  background: var(--mint);
  color: var(--ink);
}

.sb-sidebar-note {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  border-top: 1px dashed var(--line-strong);
  padding: 14px 4px 2px;
}

.sb-sidebar-note strong {
  color: var(--ink);
}

.sb-sidebar-note span {
  color: var(--muted);
  font-size: 0.8rem;
}

.sb-main {
  min-width: 0;
}

.sb-story-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 5px 4px 5px;
}

.sb-story-id {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 7px 12px 12px 7px;
  background: var(--mint);
  color: var(--accent-dark);
  padding-left: 10px;
}

.sb-story-description {
  max-width: 850px;
  margin: 0 4px 18px;
  color: var(--muted);
}

.sb-stage {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  padding: 22px;
}

.sb-stage > .panel + .panel {
  margin-top: 16px;
}

.sb-docs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: 15px 4px 0;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

.sb-docs p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sb-docs .tag-row {
  justify-content: flex-end;
  margin: 0;
}

.sb-docs .tag {
  background: var(--mint);
  color: var(--accent-dark);
}

.sb-foundations,
.sb-token-grid,
.sb-spacing-grid,
.sb-overview-grid,
.sb-component-row {
  display: grid;
  gap: 12px;
}

.sb-foundations {
  gap: 20px;
}

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

.sb-token {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.sb-swatch {
  height: 64px;
}

.sb-token p {
  margin: 0;
  padding: 9px 10px 0;
  font-weight: 900;
}

.sb-token span {
  display: block;
  padding: 2px 10px 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.sb-section-label {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sb-spacing-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: end;
}

.sb-spacing-item {
  display: grid;
  gap: 5px;
  justify-items: center;
  color: var(--muted);
  font-size: 0.7rem;
}

.sb-spacing-item i {
  display: block;
  width: 100%;
  border-radius: 5px;
  background: var(--cobalt);
}

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

.sb-overview-card {
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 16px;
}

.sb-overview-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
}

.sb-overview-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sb-component-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.sb-mini-shell {
  display: grid;
  gap: 13px;
}

.sb-mini-shell .topbar {
  align-items: center;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  padding: 18px;
}

.sb-mini-shell .topbar h1 {
  font-size: 2.1rem;
}

.sb-mini-shell .topbar .topline {
  font-size: 0.9rem;
}

.sb-mini-shell .brand-mark {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  font-size: 1.2rem;
}

.sb-mini-shell .tabs {
  position: static;
  margin: 0;
}

.sb-compact-map {
  max-width: 680px;
  margin: 0 auto;
}

.sb-stacked {
  display: grid;
  gap: 12px;
}

.mission-deck {
  display: grid;
  gap: 16px;
}

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

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

.mission-deck-cards {
  gap: 18px;
}

.sb-label {
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 900;
}

.sb-stage [data-sb-muted] {
  color: var(--muted);
}

[data-theme="midnight"] .sb-stage,
[data-theme="midnight"] .sb-sidebar,
[data-theme="midnight"] .sb-token,
[data-theme="midnight"] .sb-overview-card,
[data-theme="midnight"] .sb-mini-shell .topbar {
  background: var(--panel);
}

[data-theme="midnight"] .sb-sidebar button:hover:not(:disabled) {
  background: #21455a;
  color: #f5fffb;
}

[data-theme="midnight"] .sb-story-id {
  border-color: #f5cf60;
}

@media (max-width: 980px) {
  .sb-layout {
    grid-template-columns: 1fr;
  }

  .sb-sidebar {
    position: static;
    max-height: none;
  }

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

  .sb-sidebar-note {
    display: none;
  }
}

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

  .sb-header {
    align-items: stretch;
    flex-direction: column;
    padding: 22px 18px;
  }

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

  .sb-header-actions > * {
    justify-content: center;
  }

  .sb-sidebar nav,
  .sb-token-grid,
  .sb-overview-grid,
  .sb-component-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sb-stage {
    padding: 12px;
  }

  .sb-story-header,
  .sb-docs {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .sb-docs .tag-row {
    justify-content: flex-start;
  }

  .mission-deck-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Keep the reference stories quiet and platform-neutral too. */
body {
  background: var(--canvas);
}

.sb-header {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: none;
  color: var(--ink);
}

.sb-header h1,
.sb-header p:last-child {
  color: var(--ink);
}

.sb-header p:last-child {
  color: var(--muted);
}

.sb-kicker {
  color: var(--accent-dark);
}

.sb-header .ghost,
.sb-header .component-link {
  border-color: var(--line-strong);
  background: var(--white);
  color: var(--ink);
}

.sb-badge,
.sb-count {
  background: var(--mint);
  color: var(--accent-dark);
}

.sb-sidebar {
  border-radius: 14px;
  background: var(--white);
  box-shadow: none;
}

.sb-sidebar::before,
.sb-story-id::before,
.mission-deck-cards .mission-card:nth-child(1),
.mission-deck-cards .mission-card:nth-child(2),
.mission-deck-cards .mission-card.is-dealing {
  transform: none;
  animation: none;
}

.sb-sidebar button.active {
  border-left-color: var(--teal);
  background: var(--mint);
  color: var(--ink);
  box-shadow: none;
}

.sb-story-id {
  border-radius: var(--radius-pill);
  background: var(--mint);
  color: var(--accent-dark);
  box-shadow: none;
}

.sb-stage {
  border-style: solid;
  border-radius: 16px;
  background: var(--white);
}

.sb-stage > .panel,
.sb-token,
.sb-overview-card,
.sb-mini-shell .topbar,
.mission-deck-cards .mission-card {
  box-shadow: none;
}

.sb-mini-shell .brand-mark {
  transform: none;
  box-shadow: none;
}

/* Light study-desk reference direction. Keep stories aligned with the product. */
body {
  background: var(--canvas);
  color: var(--ink);
}

.sb-header {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: none;
  color: var(--ink);
}

.sb-header h1,
.sb-header p:last-child {
  color: var(--ink);
}

.sb-header p:last-child {
  color: var(--muted);
}

.sb-kicker,
.sb-sidebar-heading,
.sb-count,
.sb-story-id {
  letter-spacing: 0.04em;
  text-transform: none;
}

.sb-kicker {
  color: var(--accent-dark);
}

.sb-header .ghost,
.sb-header .component-link {
  border-color: var(--line-strong);
  background: var(--white);
  color: var(--ink);
}

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

.sb-badge {
  background: var(--mint);
  color: var(--accent-dark);
}

.sb-sidebar,
.sb-stage,
.sb-docs,
.sb-token,
.sb-overview-card,
.sb-mini-shell .topbar,
.sb-compact-map,
.sb-contract-panel {
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: none;
}

.sb-sidebar::before {
  display: none;
}

.sb-sidebar button {
  border-radius: var(--radius-sm);
}

.sb-sidebar button.active,
.sb-sidebar button:hover:not(:disabled) {
  border-left-color: var(--teal);
  background: var(--mint);
  color: var(--ink);
}

.sb-stage,
.sb-docs {
  border: 1px solid var(--line);
}

.sb-story-id {
  border-color: var(--line);
  background: var(--paper);
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding-left: 10px;
  box-shadow: none;
}

.sb-story-id::before {
  display: none;
}

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

.mission-deck-cards .mission-card,
.mission-deck-cards .mission-card:nth-child(2),
.mission-deck-cards .mission-card:hover,
.mission-deck-cards .mission-card:focus-within {
  transform: none;
}

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

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

.mission-deck-cards {
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}

.mission-deck-cards .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;
}

.mission-deck-cards .mission-card::before,
.mission-deck-cards .mission-card-symbol {
  display: none;
}

.mission-deck-cards .mission-card-index {
  grid-column: 1;
  grid-row: 1;
  padding: 0;
  color: var(--muted-strong);
}

.mission-deck-cards .mission-card > div {
  grid-column: 2;
  grid-row: 1;
}

.mission-deck-cards .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;
}

.mission-deck-cards .mission-card button:hover {
  border-color: transparent;
  background: var(--mint);
  color: var(--ink);
}

/* Keep the component reference aligned with the practical, non-gamified app language. */
.mission-deck-cards .mission-card {
  grid-template-columns: 112px minmax(0, 1fr) auto;
}

.mission-deck-cards .mission-card-index,
.mission-deck-cards .mission-card-support,
.review-plan-story .badge-state {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: none;
}

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

.review-plan-story .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;
}

.review-plan-story .badge-medallion {
  display: none;
}

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

  .review-plan-story .badge-list {
    grid-template-columns: 1fr;
  }
}

/* Match the app's light system-surface treatment in the component reference. */
body {
  background: var(--canvas);
  font-family: var(--brand-font);
}

.sb-header,
.sb-sidebar,
.sb-stage {
  border-color: rgba(60, 60, 67, 0.16);
  border-radius: 14px;
  background: var(--panel);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  box-shadow: 0 1px 2px rgba(24, 33, 43, 0.04);
}

.sb-sidebar button.active {
  border-left-color: transparent;
  border-radius: 8px;
  background: rgba(0, 122, 116, 0.12);
  color: var(--accent-dark);
}

.sb-sidebar button:hover:not(:disabled) {
  border-radius: 8px;
  background: rgba(0, 122, 116, 0.08);
  color: var(--accent-dark);
}

/* English system reference: the shell is quiet; the examples use production CSS. */
.sb-app { max-width: 1600px; padding-top: 24px; }
.sb-header { background: var(--brand-field); color: var(--brand-paper); align-items: flex-start; }
.sb-header h1 { color: var(--brand-paper); font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.14; letter-spacing: -.028em; }
.sb-header p:last-child, .sb-header .sb-kicker { color: var(--brand-paper); }
.sb-kicker, .sb-sidebar-heading, .sb-count, .sb-story-id { text-transform: none; letter-spacing: .025em; font-weight: 600; font-size: .8125rem; }
.sb-stop { color: #FF8A65; }
.sb-header .sb-badge { background: #143640; color: #9CE7DD; white-space: nowrap; }
.sb-header :focus-visible { outline-color: #7FD3E3; }
.sb-sidebar { align-self: start; }
.sb-search-label { display: block; margin: 16px 0 8px; color: var(--ink); font-size: .875rem; font-weight: 600; }
#storySearch { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px; background: var(--panel); color: var(--ink); }
#storyNav { display: grid; gap: 5px; margin-top: 16px; }
#storyNav a { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .875rem; font-weight: 600; line-height: 1.4; }
#storyNav a span { color: var(--muted); font-size: .75rem; font-weight: 400; }
#storyNav a:hover { border-color: var(--line-strong); }
#storyNav a.active { border-color: var(--brand-primary); background: var(--mint); }
.sb-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 24px 0 16px; font-size: .875rem; }
.sb-toolbar label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sb-toolbar select { max-width: 100%; min-height: 44px; padding: 8px; color: var(--ink); }
.sb-toolbar input { accent-color: var(--teal); }
.sb-toolbar a { color: var(--accent-dark); padding-block: 10px; }
.sb-main { min-width: 0; }
.sb-stage { margin-inline: auto; width: 100%; min-width: 0; transition: none; }
.sb-stage:has(.sb-preview) { padding: 0; }
.sb-preview { display: block; width: 100%; height: 660px; border: 0; border-radius: var(--radius-md); background: var(--canvas); }
.sb-page-list { display: grid; gap: 8px; }
.sb-page-list a { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.sb-page-list a:hover { border-color: var(--teal); }
.sb-page-list span { color: var(--muted); font-size: .8125rem; }
.sb-token span { overflow-wrap: anywhere; }
.sb-token-grid { grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); }
.sb-token { min-width: 0; }
.sb-skip { position: absolute; left: -9999px; top: 8px; padding: 12px; background: var(--panel); color: var(--ink); z-index: 100; }
.sb-skip:focus { left: 8px; }
@media (max-width: 760px) {
  .sb-app { width: calc(100% - 24px); padding-top: 12px; }
  .sb-header { padding: 24px 20px; }
  .sb-layout { grid-template-columns: minmax(0, 1fr); }
  .sb-sidebar { position: static; }
  #storyNav { max-height: 220px; overflow-y: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-sidebar-note { display: none; }
  .sb-stage { padding: 16px; }
  .sb-story-header { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .sb-header-actions { justify-content: flex-start; }
  .sb-toolbar label { width: 100%; }
  .sb-toolbar select { width: 100%; }
}

.sb-header > *, .sb-story-header > *, .sb-toolbar > *, .sb-foundations { min-width: 0; max-width: 100%; }
.sb-story-header h2, .sb-header h1 { overflow-wrap: anywhere; }
.sb-toolbar select { min-width: 0; }
.sb-stage > * { min-width: 0; max-width: 100%; }
.sb-docs { padding: 16px 20px; border: 1px solid var(--line); }
