/* ==========================================================================
   Stock Market Blueprint — Layout & Component Styles
   ========================================================================== */

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(10px);
}

@supports (background: color-mix(in srgb, #000 80%, transparent)) {
  .topbar {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
  }
}

.topbar-inner {
  max-width: var(--page-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent-tint);
  border: 1px solid var(--accent);
  color: var(--accent-text);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar {
  display: none;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.78rem;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}

.topnav a:hover {
  color: var(--ink);
  background: var(--subtle);
}

.topnav a[aria-current="page"] {
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--rule);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.theme-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.32rem 0.68rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}

.theme-switch button:hover {
  color: var(--ink);
}

.theme-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Page Container */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.75rem var(--page-pad) 4rem;
}

/* Masthead */
.masthead {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.masthead-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--ink);
}

@media (min-width: 980px) {
  .masthead-title {
    white-space: nowrap;
  }
}

.masthead-accent {
  color: var(--accent-text);
}

.masthead-sub {
  margin: 0.75rem 0 0;
  max-width: 72ch;
  font-size: 1.08rem;
  color: var(--ink-2);
}

.masthead-meta {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.disclaimer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.78rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.disclaimer-pill svg {
  color: var(--amber-text);
  flex-shrink: 0;
}

.masthead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.52rem 0.92rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease);
}

.btn:hover {
  background: var(--subtle);
  border-color: var(--muted);
  color: var(--ink);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  filter: brightness(1.06);
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* Controls: View Tabs + Search + Filter Pills */
.controls {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.35rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--rule);
}

.view-tab-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.48rem 0.9rem;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}

.view-tab-btn:hover {
  color: var(--ink);
  background: var(--subtle);
}

.view-tab-btn[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--card-shadow);
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.search-box-wrapper {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 2.5rem 0 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-kbd {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.1rem 0.42rem;
  border-radius: 5px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  pointer-events: none;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.result-count {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.link-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.25rem 0.4rem;
  color: var(--accent-text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.filter-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.filter-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.25rem;
  min-width: 72px;
}

.filter-pill {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--raised);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}

.filter-pill:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.filter-pill[aria-pressed="true"] {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Workspace Layout: Sticky TOC Rail + Main Column */
.blueprint-layout {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 1080px) {
  .blueprint-layout {
    grid-template-columns: 256px minmax(0, 1fr);
  }
  .blueprint-layout.is-single-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .topnav .nav-hide-sm {
    display: none;
  }
  .topnav a {
    padding: 0.36rem 0.56rem;
    font-size: 0.85rem;
  }
}

/* Sticky Table of Contents */
.toc-panel {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1rem;
}

@media (min-width: 1080px) {
  .toc-panel {
    position: sticky;
    top: calc(var(--topbar-h) + 1rem);
    max-height: calc(100vh - var(--topbar-h) - 2rem);
    overflow-y: auto;
  }
}

@media (max-width: 1079px) {
  .toc-panel {
    display: none;
  }
  .toc-panel.is-open {
    display: block;
  }
}

.toc-toggle {
  display: inline-flex;
}

@media (min-width: 1080px) {
  .toc-toggle {
    display: none;
  }
}

.toc-heading {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.6rem;
  border-radius: 7px;
  border: 1px solid transparent;
  color: var(--ink-2);
  font-size: 0.87rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}

.toc-link:hover {
  background: var(--subtle);
  color: var(--ink);
}

.toc-link.is-active {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-text);
}

.toc-divider {
  height: 1px;
  background: var(--rule);
  margin: 0.6rem 0;
}

.toc-sub-links {
  list-style: none;
  margin: 0.25rem 0 0.5rem;
  padding: 0 0 0 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.toc-sub-links a {
  display: block;
  padding: 0.22rem 0.45rem;
  border-radius: 5px;
  font-size: 0.81rem;
  color: var(--muted);
  text-decoration: none;
}

.toc-sub-links a:hover {
  color: var(--ink);
  background: var(--subtle);
}

/* Main Content Column */
.content-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

/* Section Blocks */
.module-section {
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.section-desc {
  margin: 0.4rem 0 0;
  max-width: 72ch;
  color: var(--ink-2);
  font-size: 0.98rem;
}

/* Level Badges */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.level-beginner {
  color: var(--lvl-beginner);
  background: var(--lvl-beginner-bg);
  border: 1px solid var(--lvl-beginner);
}

.level-intermediate {
  color: var(--lvl-intermediate);
  background: var(--lvl-intermediate-bg);
  border: 1px solid var(--lvl-intermediate);
}

.level-advanced {
  color: var(--lvl-advanced);
  background: var(--lvl-advanced-bg);
  border: 1px solid var(--lvl-advanced);
}

.level-all {
  color: var(--sky);
  background: var(--sky-tint);
  border: 1px solid var(--sky);
}

/* Topic Cards — Rich Editorial Layouts (Varied, Not Uniform Chrome) */
.topics-stack {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.topic-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--card-shadow);
  padding: 1.35rem 1.45rem;
  min-width: 0;
}

.topic-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.topic-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.24rem;
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.topic-summary {
  margin: 0 0 1.1rem;
  max-width: 72ch;
  color: var(--ink-2);
  font-size: 1rem;
}

/* Two-Column Internal Structure inside Cards */
.concept-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 760px) {
  .concept-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .concept-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.concept-block {
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--rule);
  min-width: 0;
}

.concept-block h4 {
  margin: 0 0 0.42rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.concept-block p,
.concept-block ul {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.93rem;
}

.concept-block ul {
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.formula-bar {
  margin-top: 0.95rem;
  padding: 0.72rem 1rem;
  border-radius: var(--radius);
  background: var(--stage-bg);
  border: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.formula-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.formula-code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent-text);
  word-break: break-word;
}

.callout-row {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
}

@media (min-width: 760px) {
  .callout-row.split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.callout {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--raised);
  font-size: 0.92rem;
  color: var(--ink-2);
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.callout svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.callout.callout-warn {
  background: var(--amber-tint);
  border-color: var(--amber);
}

.callout.callout-warn svg {
  color: var(--amber-text);
}

.callout.callout-tip {
  background: var(--accent-tint);
  border-color: var(--accent);
}

.callout.callout-tip svg {
  color: var(--accent-text);
}

.callout.callout-risk {
  background: var(--danger-tint);
  border-color: var(--danger);
}

.callout.callout-risk svg {
  color: var(--danger-text);
}

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

/* Inline Visual Diagrams */
.diagram-box {
  margin-top: 1.05rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--stage-bg);
  border: 1px solid var(--rule);
  overflow-x: auto;
}

.diagram-caption {
  margin: 0 0 0.65rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}

.diagram-svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 500px;
}

.diagram-svg text {
  font-family: var(--font-body);
  fill: var(--ink-2);
}

.diagram-svg text.mono-svg {
  font-family: var(--font-mono);
}

.diagram-svg text.title-svg {
  font-family: var(--font-display);
  font-weight: 700;
  fill: var(--ink);
}

/* Risk Badges for Option Strategies */
.risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.risk-defined {
  background: var(--accent-tint);
  color: var(--accent-text);
  border: 1px solid var(--accent);
}

.risk-capped {
  background: var(--indigo-tint);
  color: var(--indigo);
  border: 1px solid var(--indigo);
}

.risk-high {
  background: var(--amber-tint);
  color: var(--amber-text);
  border: 1px solid var(--amber);
}

.risk-unlimited {
  background: var(--danger-tint);
  color: var(--danger-text);
  border: 1px solid var(--danger);
}

/* Interactive Simulators */
.sim-grid {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sim-panel {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--card-shadow);
  padding: 1.4rem 1.5rem;
}

.sim-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.sim-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}

.sim-header p {
  margin: 0.35rem 0 0;
  color: var(--ink-2);
  font-size: 0.94rem;
  max-width: 70ch;
}

.strategy-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}

.strategy-pill {
  appearance: none;
  border: 1px solid var(--rule-strong);
  background: var(--raised);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.87rem;
  font-weight: 600;
  padding: 0.42rem 0.82rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}

.strategy-pill:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.strategy-pill[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.sim-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.35rem;
}

@media (min-width: 900px) {
  .sim-workspace {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}

.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--rule);
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
}

.control-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}

.control-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.control-field input[type="number"],
.control-field select {
  width: 100%;
  height: 36px;
  padding: 0 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--rule-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.sim-stage {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.chart-frame {
  border-radius: var(--radius);
  background: var(--stage-bg);
  border: 1px solid var(--rule);
  padding: 0.85rem;
}

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

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

@media (min-width: 680px) {
  .metrics-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.metric-box {
  padding: 0.72rem 0.85rem;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--rule);
  min-width: 0;
}

.metric-label {
  display: block;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.22rem;
}

.metric-value {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.metric-value.pos {
  color: var(--chart-profit);
}

.metric-value.neg {
  color: var(--chart-loss);
}

.sim-explain {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--rule);
  font-size: 0.92rem;
  color: var(--ink-2);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.55rem;
  font-size: 0.81rem;
  color: var(--ink-2);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

/* Comparison Matrices & Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.78rem 0.95rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.data-table thead th {
  background: var(--raised);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--raised);
}

.data-table td strong {
  color: var(--ink);
}

/* Do's vs Don'ts Grid */
.dos-donts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.15rem;
}

@media (min-width: 780px) {
  .dos-donts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dd-panel {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--card-shadow);
}

.dd-panel.is-do {
  border-color: var(--accent);
}

.dd-panel.is-dont {
  border-color: var(--danger);
}

.dd-panel h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dd-panel.is-do h3 {
  color: var(--accent-text);
}

.dd-panel.is-dont h3 {
  color: var(--danger-text);
}

.dd-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.dd-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.93rem;
  color: var(--ink-2);
}

.dd-list svg {
  flex-shrink: 0;
  margin-top: 0.22rem;
}

/* Red-Flag Interactive Readiness Checklist */
.checklist-panel {
  margin-top: 1.35rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.25rem 1.35rem;
}

.checklist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.checklist-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
}

.checklist-score {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-text);
}

.check-items {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.55rem;
}

@media (min-width: 780px) {
  .check-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--rule);
  cursor: pointer;
  font-size: 0.91rem;
  color: var(--ink-2);
}

.check-item input {
  margin-top: 0.22rem;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.check-item.is-checked {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--ink);
}

/* Quiz Page Styles */
.quiz-shell {
  max-width: 880px;
  margin: 1.75rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.quiz-controls {
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.quiz-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--card-shadow);
}

.quiz-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--subtle);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 240ms var(--ease);
}

.quiz-question {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-size: 1.24rem;
  line-height: 1.32;
  color: var(--ink);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.quiz-option {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background: var(--raised);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.96rem;
  line-height: 1.45;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--subtle);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option.is-correct {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.quiz-option.is-wrong {
  border-color: var(--danger);
  background: var(--danger-tint);
}

.option-key {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  flex-shrink: 0;
}

.quiz-feedback {
  margin-top: 1.1rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--raised);
  font-size: 0.95rem;
  color: var(--ink-2);
}

.quiz-feedback.ok {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.quiz-feedback.bad {
  border-color: var(--danger);
  background: var(--danger-tint);
}

.quiz-actions {
  margin-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

/* Empty State */
.empty-state {
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--rule-strong);
  background: var(--surface);
  text-align: center;
  color: var(--muted);
}

/* Footer */
.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.hide-xs {
  display: inline;
}

@media (max-width: 560px) {
  :root {
    --page-pad: 1rem;
  }
  .hide-xs {
    display: none;
  }
  .topic-card,
  .sim-panel {
    padding: 1.1rem;
  }
}

[hidden] {
  display: none !important;
}
