/* === assets/styles.css === */
:root {
  color-scheme: dark;
  --page: #1c1c1e;
  --panel: #252528;
  --panel-soft: #303034;
  --panel-deep: #0d0d10;
  --frame: #111115;
  --paper: #f5f0e8;
  --paper-muted: rgba(245, 240, 232, 0.72);
  --paper-soft: rgba(245, 240, 232, 0.56);
  --paper-faint: rgba(245, 240, 232, 0.14);
  --paper-line: rgba(245, 240, 232, 0.24);
  --paper-line-strong: rgba(245, 240, 232, 0.34);
  --accent: #e85d4e;
  --accent-strong: #ff755f;
  --accent-faint: rgba(232, 93, 78, 0.18);
  --ink: #151516;
  --header-surface: rgba(28, 28, 30, 0.88);
  --focus: #ffb84d;
  --shadow-high: 0 24px 80px rgba(0, 0, 0, 0.36);
  --shadow-low: 0 16px 48px rgba(0, 0, 0, 0.2);
  --content-max: 1200px;
  --page-max: 1440px;
  --status-pass: #4cd964;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}
body {
  background: var(--page);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  width: 100%;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
iframe:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  background: var(--paper);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  left: 16px;
  padding: 10px 14px;
  position: fixed;
  top: -80px;
  z-index: 30;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  backdrop-filter: blur(16px);
  background: var(--header-surface);
  border-bottom: 1px solid var(--paper-faint);
  max-width: 100%;
  overflow-x: clip;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner,
.footer-inner,
.section-shell {
  margin: 0 auto;
  max-width: var(--content-max);
  padding-inline: 24px;
  width: 100%;
}

.header-inner {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 800;
  gap: 10px;
  text-decoration: none;
}

.nav,
.language-switcher,
.footer-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.nav {
  justify-content: center;
}

.nav a,
.nav-menu summary,
.footer-links a {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--paper-muted);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
  padding: 9px 10px;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"],
.nav-menu[open] summary,
.nav-menu summary[aria-current="page"],
.nav-menu summary:hover,
.footer-links a:hover {
  border-color: var(--paper-line);
  color: var(--paper);
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  list-style: none;
}

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

.nav-menu-panel {
  background: var(--panel);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  box-shadow: var(--shadow-low);
  display: grid;
  gap: 4px;
  min-width: min(320px, 92vw);
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
}

.nav-menu-panel a {
  line-height: 1.2;
  white-space: normal;
}

.language-switcher {
  background: var(--panel-deep);
  border: 1px solid var(--paper-faint);
  border-radius: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: flex-end;
  padding: 4px;
}

.language-option {
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--paper-muted);
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1;
  min-width: 58px;
  padding: 9px 10px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.language-option:hover {
  border-color: var(--paper-line);
  color: var(--paper);
}

.language-option[aria-current="true"] {
  background: var(--paper);
  color: var(--ink);
}

.hero {
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  margin: 0 auto;
  max-width: var(--page-max);
  min-height: auto;
  padding: 56px 24px 48px;
  width: 100%;
}

.hero,
.content-section,
.information-main,
#game-frame {
  scroll-margin-top: 88px;
}

.hero-copy {
  align-self: center;
  max-width: 720px;
}

.hero-copy,
.game-shell,
.section-shell > *,
.point-list,
.preview-figure {
  min-width: 0;
}

.label {
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 5.25rem;
  line-height: 0.98;
  max-width: 10ch;
}

h2 {
  font-size: 3.25rem;
  line-height: 1.05;
}

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

.lead,
.section-copy p,
.information-content p,
.information-content li,
.footer-inner p {
  color: var(--paper-muted);
  line-height: 1.7;
}

.lead {
  font-size: 1.25rem;
  margin: 24px 0 0;
  max-width: 680px;
}

.hero-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

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

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

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  border: 1px solid var(--paper-line-strong);
  color: var(--paper);
}

.button.secondary:hover {
  border-color: var(--paper);
}

.hero-note {
  color: var(--paper-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 18px 0 0;
}

.hero-note a {
  color: var(--accent-strong);
  font-weight: 800;
  text-underline-offset: 3px;
}

.game-shell {
  align-self: center;
  background: var(--panel-deep);
  border: 1px solid var(--paper-faint);
  border-radius: 8px;
  box-shadow: var(--shadow-high);
  max-width: 100%;
  overflow: hidden;
  padding: 10px;
}

.game-frame-wrap {
  aspect-ratio: 414 / 896;
  background: var(--frame);
  border-radius: 6px;
  max-width: 340px;
  overflow: hidden;
  width: 100%;
}

.game-frame-wrap iframe {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.game-fallback {
  color: var(--paper-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 12px 4px 2px;
}

.game-fallback a,
.content-item-link,
.information-content a,
.byline a {
  color: var(--accent-strong);
  font-weight: 800;
  text-underline-offset: 3px;
}

.content-section {
  border-top: 1px solid var(--paper-faint);
  overflow-x: clip;
  padding-block: 88px;
}

.content-section:nth-of-type(odd) {
  background: var(--panel-deep);
}

.section-shell {
  align-items: start;
  display: grid;
  gap: 36px;
}

.section-copy {
  max-width: 720px;
}

.section-copy p {
  font-size: 1.125rem;
  margin: 18px 0 0;
  max-width: 66ch;
}

.content-section.split .section-shell,
.content-section.ledger .section-shell,
.content-section.media .section-shell {
  align-items: start;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 0.72fr);
}

.content-section.grid .section-shell,
.content-section.faq .section-shell {
  gap: 40px;
}

.content-section.grid .section-copy,
.content-section.faq .section-copy,
.content-section.cta .section-copy {
  max-width: 860px;
}

.content-section.ledger .point-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-section.media .preview-figure {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.content-section.media .point-list,
.content-section.media .section-actions {
  grid-column: 1;
}

.content-section.quote .section-copy {
  border-left: 4px solid var(--accent);
  padding-left: 28px;
}

.content-section.cta {
  background: var(--panel-soft);
}

.content-section.cta .section-shell {
  justify-items: start;
}

.point-list {
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.point-list li {
  background: var(--panel);
  border: 1px solid var(--paper-faint);
  border-left: 3px solid var(--paper-line);
  border-radius: 8px;
  color: var(--paper-muted);
  line-height: 1.6;
  padding: 18px 18px 18px 20px;
}

.content-item-title,
.point-list li > span,
.content-item-link {
  display: block;
}

.content-item-title {
  color: var(--paper);
  margin-bottom: 8px;
}

.content-item-link {
  margin-top: 12px;
}

.point-list li:nth-child(3n + 1) {
  border-left-color: var(--accent);
}

.content-section.grid .point-list,
.content-section.faq .point-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ledger-list {
  counter-reset: ledger;
}

.ledger-list li {
  counter-increment: ledger;
  padding-left: 52px;
  position: relative;
}

.ledger-list li::before {
  align-items: center;
  background: var(--accent-faint);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  color: var(--accent-strong);
  content: counter(ledger);
  display: inline-flex;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  left: 16px;
  position: absolute;
  top: 18px;
  width: 28px;
}

.preview-figure {
  margin: 0;
}

.preview-figure img {
  border: 1px solid var(--paper-faint);
  border-radius: 8px;
  box-shadow: var(--shadow-low);
  display: block;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  width: 100%;
}

.byline {
  color: var(--paper-soft);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 20px 0 0;
}

.guide-scope {
  background: var(--panel-soft);
}

.information-page {
  min-height: 100svh;
}

.information-main {
  border-top: 1px solid var(--paper-faint);
}

.information-hero,
.information-content {
  margin: 0 auto;
  max-width: 860px;
  padding-inline: 24px;
}

.information-hero {
  padding-block: 80px 48px;
}

.information-hero h1 {
  max-width: none;
}

.information-content {
  padding-bottom: 80px;
}

.information-content section {
  border-top: 1px solid var(--paper-faint);
  padding-block: 32px;
}

.information-content h2 {
  font-size: 2rem;
}

.information-links {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.site-footer {
  border-top: 1px solid var(--paper-faint);
  max-width: 100%;
  overflow-x: clip;
}

.footer-inner {
  align-items: center;
  color: var(--paper-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  padding-block: 32px;
}

.footer-inner p {
  margin: 6px 0 0;
}

@media (max-width: 1100px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 16px;
  }

  .nav,
  .language-switcher {
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .hero-copy {
    max-width: 100%;
  }

  .game-shell {
    justify-self: stretch;
    width: min(100%, 360px);
  }

  .content-section.split .section-shell,
  .content-section.ledger .section-shell,
  .content-section.media .section-shell {
    grid-template-columns: 1fr;
  }

  .content-section.ledger .point-list {
    grid-template-columns: 1fr;
  }

  .content-section.media .preview-figure,
  .content-section.media .point-list,
  .content-section.media .section-actions {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
  }

  .header-inner,
  .footer-inner,
  .section-shell,
  .information-hero,
  .information-content {
    padding-inline: 18px;
  }

  /* Keep the brand and language switcher on one row so the static header uses less of the
     first screen; the nav wraps below them. This keeps the primary CTA above the fold. */
  .header-inner {
    column-gap: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: normal;
    row-gap: 10px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .language-switcher {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hero {
    gap: 32px;
    padding: 24px 18px 48px;
  }

  .hero-actions {
    margin-top: 24px;
  }

  .hero-copy h1,
  .hero-copy .lead {
    overflow-wrap: anywhere;
  }

  h1 {
    font-size: 3.5rem;
    max-width: 11ch;
  }

  h2 {
    font-size: 2.25rem;
  }

  .lead {
    font-size: 1.125rem;
  }

  .hero-actions,
  .section-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .nav-menu {
    width: auto;
  }

  .nav-menu summary {
    width: auto;
  }

  .nav-menu-panel {
    margin-top: 8px;
    min-width: 0;
    position: static;
    width: 100%;
  }

  .game-shell {
    width: 100%;
  }

  .content-section {
    padding-block: 64px;
  }

  .content-section.grid .point-list,
  .content-section.faq .point-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .nav-editorial {
    display: none;
  }

  .nav a,
  .nav-menu summary,
  .footer-links a {
    font-size: 0.8125rem;
    padding-inline: 8px;
  }

  .language-switcher {
    width: auto;
  }

  .language-option {
    flex: 0 0 auto;
    min-width: 0;
    padding-inline: 6px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2rem;
  }

  .game-shell {
    padding: 8px;
  }
}

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

  .button {
    transition: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --paper-muted: var(--paper);
    --paper-soft: var(--paper-muted);
    --paper-line: var(--paper-line-strong);
  }
}

.breadcrumbs {
  margin-bottom: 24px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--paper-soft);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: var(--paper-line-strong);
}

.breadcrumbs a {
  color: var(--paper-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.tool-detail-main,
.tools-hub-main {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.tools-hub-shell,
.tool-detail-shell {
  box-sizing: border-box;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px 24px 80px;
  min-width: 0;
  width: 100%;
  contain: layout;
}
.tools-hub-header h1,
.tool-header-block h1 {
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  line-height: 1.2;
  max-width: none;
  width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.tool-interactive-area h2,
.tool-text-content h2,
.tool-table-section h2,
.tool-faq-section h2,
.tool-category-block h2 {
  max-width: none;
  width: 100%;
  font-size: clamp(1.4rem, 3.5vw, 2.25rem);
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: break-word;
}

.tool-header-block .lead,
.tools-hub-header .lead,
.tool-intro-text {
  max-width: 100%;
  width: 100%;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
}

.tool-header-block {
  margin-bottom: 32px;
  width: 100%;
  max-width: 100%;
}

.tools-hub-actions {
  margin-top: 24px;
}

.tool-header-links {
  color: var(--paper-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 16px 0 0;
}

.tool-header-links a {
  color: var(--accent-strong);
  font-weight: 800;
  text-underline-offset: 3px;
}

.tool-next-step {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--paper-line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  margin: 0 0 48px;
  padding: 24px;
}

.tool-next-step h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.2;
  margin: 0;
}

.tool-next-step p {
  color: var(--paper-muted);
  line-height: 1.65;
  margin: 8px 0 0;
  max-width: 60ch;
}

.tool-next-step .hero-actions {
  margin-top: 0;
}

.tools-categories-container {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.tool-category-block {
  background: var(--panel);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  padding: 32px;
}

.tool-category-block h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.75rem;
}

.category-desc {
  color: var(--paper-muted);
  margin-bottom: 24px;
}

.tools-grid,
.related-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card,
.related-card {
  background: var(--panel-soft);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card h3,
.related-card h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

.tool-card p,
.related-card p {
  margin: 0;
  color: var(--paper-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  flex-grow: 1;
}

.card-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-faint);
  padding: 4px 10px;
  border-radius: 6px;
}

.card-tag.status-fail {
  color: var(--accent-strong);
  border: 1px solid var(--accent);
}

.interactive-tool-box {
  background: var(--panel-deep);
  border: 2px solid var(--paper-line-strong);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow-high);
  margin-block: 28px 48px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tool-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  min-width: 0;
  width: 100%;
}

.tool-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-input-group label {

  font-size: 0.875rem;
  font-weight: 600;
  color: var(--paper-muted);
}

.tool-select {
  width: 100%;
  background: var(--panel);
  color: var(--paper);
  border: 1px solid var(--paper-line-strong);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 1rem;
  cursor: pointer;
}

.tool-select:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.tool-result-panel {
  background: var(--panel);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  padding: 24px;
  margin-top: 28px;
  border-left: 6px solid var(--accent);
}

.result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  flex: 1 1 200px;
  background: var(--panel-soft);
  border: 1px solid var(--paper-line);
  padding: 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--paper-soft);
}

.stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--paper);
}

.stat-val.status-pass {
  color: var(--status-pass);
}

.stat-val.status-fail {
  color: var(--accent);
}

.result-evaluation {
  line-height: 1.6;
  color: var(--paper);
  font-size: 0.95rem;
  padding-top: 12px;
  border-top: 1px solid var(--paper-line);
}

.tool-text-content {
  margin-block: 48px;
}

.tool-guide-block {
  background: var(--panel);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}

.tool-guide-block h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.25rem;
}
.table-responsive-wrapper {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-block: 20px 48px;
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  box-sizing: border-box;
  contain: paint;
}

.data-table {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: var(--panel);
}

.data-table th {
  background: var(--panel-soft);
  color: var(--paper);
  font-weight: 700;
  white-space: nowrap;
}
.data-table td {
  color: var(--paper-muted);
}

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

.tool-faq-section {
  margin-block: 48px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-entry {
  background: var(--panel);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  padding: 20px 24px;
}

.faq-entry h4 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--paper);
}

.faq-entry p {
  margin: 0;
  color: var(--paper-muted);
  line-height: 1.6;
}

.ending-cards-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.ending-entry-card {
  background: var(--panel);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  padding: 20px 24px;
}

.ending-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ending-card-header h4 {
  margin: 0;
  font-size: 1.2rem;
}

.card-tip {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--panel-soft);
  border-left: 4px solid var(--focus);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--paper-muted);
}

.related-tools-section {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--paper-line);
}

.related-tools-section h2 {
  margin-bottom: 24px;
}

@media (max-width: 760px) {
  .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .nav a {
    font-size: 0.8125rem;
    padding: 7px 9px;
  }

  .tools-hub-shell,
  .tool-detail-shell {
    box-sizing: border-box;
    padding-inline: 16px;
    padding-block: 24px 60px;
    overflow-x: hidden;
    width: 100%;
    contain: layout;
  }

  .tools-hub-header h1,
  .tool-header-block h1 {
    font-size: 1.85rem;
    line-height: 1.2;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .tool-header-block .lead,
  .tools-hub-header .lead,
  .tool-intro-text {
    font-size: 1rem;
    line-height: 1.6;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .interactive-tool-box {
    padding: 20px 14px;
    margin-block: 20px 32px;
    width: 100%;
    box-sizing: border-box;
  }

  .tool-controls-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tool-category-block {
    padding: 20px 14px;
  }

  .result-stats {
    flex-direction: column;
    gap: 12px;
  }

  .result-stats .stat-card {
    flex: 0 1 auto;
  }
}

.article-main {
  border-top: 1px solid var(--paper-faint);
  min-width: 0;
  overflow-x: clip;
}

.article-hero {
  align-items: center;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  margin: 0 auto;
  max-width: var(--content-max);
  padding: 56px 24px 32px;
  width: 100%;
}

.article-hero-copy {
  min-width: 0;
}

.article-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  line-height: 1.03;
  max-width: 18ch;
  overflow-wrap: anywhere;
}

.article-hero .lead {
  max-width: 68ch;
}

.guide-cover {
  align-self: center;
  margin: 0;
}

.guide-cover img {
  border: 1px solid var(--paper-faint);
  border-radius: 8px;
  box-shadow: var(--shadow-low);
  display: block;
  height: auto;
  width: 100%;
}

.guide-scope {
  background: var(--panel-soft);
  border-bottom: 1px solid var(--paper-faint);
  border-top: 1px solid var(--paper-faint);
  margin: 0 auto;
  max-width: var(--content-max);
  padding: 20px 24px;
  width: 100%;
}

.guide-scope strong {
  color: var(--paper);
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 8px;
}

.guide-scope p {
  color: var(--paper-muted);
  line-height: 1.65;
  margin: 4px 0 0;
  max-width: 80ch;
  overflow-wrap: anywhere;
}

.article-toc {
  margin: 36px auto 0;
  max-width: 860px;
  padding: 0 24px;
}

.article-toc strong {
  color: var(--paper);
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 12px;
}

.article-toc ol {
  display: grid;
  gap: 8px 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-toc a {
  color: var(--paper-muted);
  display: inline-block;
  font-size: 0.9375rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: var(--paper-line-strong);
  text-underline-offset: 3px;
}

.article-toc a:hover {
  color: var(--accent-strong);
  text-decoration-color: var(--accent-strong);
}

.article-section {
  border-top: 1px solid var(--paper-faint);
  margin: 0 auto;
  max-width: 860px;
  padding: 48px 24px;
}

.article-section:first-of-type {
  border-top: 0;
}

.article-section h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.12;
  max-width: 24ch;
  overflow-wrap: anywhere;
}

.article-section > p {
  color: var(--paper-muted);
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 70ch;
  overflow-wrap: anywhere;
}

.article-section .point-list {
  margin-top: 24px;
}

.article-highlights {
  padding-top: 40px;
}

.article-sources .information-links a,
.article-related a {
  color: var(--accent-strong);
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.related-guide-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.related-guide-list li {
  background: var(--panel);
  border: 1px solid var(--paper-faint);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
}

.related-guide-list a {
  display: block;
}

.related-guide-list span {
  color: var(--paper-muted);
  display: block;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-top: 6px;
}

.article-cta {
  background: var(--panel-soft);
  border-top: 1px solid var(--paper-faint);
  padding: 48px 24px;
}

.article-cta > div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--content-max);
}

.article-cta h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.article-cta p {
  color: var(--paper-muted);
  line-height: 1.7;
  margin: 10px 0 0;
  max-width: 60ch;
}

@media (max-width: 900px) {
  .article-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-cover {
    max-width: 320px;
  }
}

@media (max-width: 760px) {
  .article-hero {
    gap: 24px;
    padding: 24px 18px 24px;
  }

  .article-hero .hero-actions {
    margin-top: 20px;
  }

  .article-section {
    padding: 36px 18px;
  }

  .article-toc {
    padding: 0 18px;
  }

  .article-toc ol {
    grid-template-columns: 1fr;
  }

  .article-cta {
    padding: 36px 18px;
  }
}

.consent-banner {
  align-items: center;
  background: var(--panel);
  border-top: 1px solid var(--paper-line-strong);
  bottom: 0;
  box-shadow: var(--shadow-high);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  left: 0;
  padding: 16px 20px;
  position: fixed;
  right: 0;
  z-index: 30;
}

.consent-banner[hidden] {
  display: none;
}

.consent-body {
  color: var(--paper-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0;
  max-width: 62ch;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.consent-banner .button {
  cursor: pointer;
  font: inherit;
}

.consent-banner .button.secondary {
  background: none;
}

/* Mobile consent strip: compact two-row layout, shown after the first scroll (see
   consentScript), so it never covers the first-screen CTA at 375/390/430 widths. These
   rules come last so the base consent styles above cannot override them by source order. */
@media (max-width: 760px) {
  .consent-banner {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .consent-body {
    display: -webkit-box;
    flex: 1 1 100%;
    font-size: 0.8125rem;
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .consent-actions {
    flex: 1 1 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .consent-banner .button {
    flex: 1 1 0;
    font-size: 0.8125rem;
    min-height: 44px;
    padding-inline: 10px;
    white-space: nowrap;
    width: auto;
  }
}

/* Tool detail pages: keep the actual calculator input inside the 375x667 first screen
   instead of pushing it below a tall header. Scope these rules to tool pages only. */
@media (max-width: 760px) {
  .tool-detail-shell {
    padding-top: 12px;
  }

  .tool-detail-main .breadcrumbs {
    margin-bottom: 12px;
  }

  .tool-detail-main .tool-header-block {
    margin-bottom: 16px;
  }

  .tool-detail-main .tool-interactive-area h2 {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  .tool-detail-main .interactive-tool-box {
    margin-block: 12px 32px;
  }
}



/* === Interactive Companion Bar, 5-Tool Grid & Best Start Builder (v15) === */
.companion-section {
  border-top: 1px solid var(--paper-faint);
  background: var(--panel-deep);
  padding-block: 36px 44px;
  overflow-x: clip;
}

.companion-shell {
  margin: 0 auto;
  max-width: var(--content-max);
  padding-inline: 24px;
  width: 100%;
}

.companion-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 18px;
}

.companion-header h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  line-height: 1.2;
}

.companion-header p {
  color: var(--paper-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 4px 0 0;
  max-width: 64ch;
}

.companion-card {
  background: var(--panel);
  border: 1px solid var(--paper-line);
  border-radius: 10px;
  box-shadow: var(--shadow-low);
  overflow: hidden;
}

.companion-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--paper-faint);
}

.companion-tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--paper-muted);
  cursor: pointer;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 14px;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.companion-tab:hover {
  color: var(--paper);
  border-color: var(--paper-line);
}

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

.companion-panel {
  padding: 20px;
}

.companion-panel[hidden] {
  display: none;
}

.companion-dse-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.companion-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.companion-field label {
  color: var(--paper-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.companion-select {
  background: var(--panel-deep);
  border: 1px solid var(--paper-line-strong);
  border-radius: 6px;
  color: var(--paper);
  font-size: 0.875rem;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
}

.companion-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  background: var(--panel-deep);
  border: 1px solid var(--paper-faint);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
}

.companion-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}

.companion-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.companion-metric-label {
  color: var(--paper-soft);
  font-size: 0.75rem;
}

.companion-metric-val {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--paper);
}

.companion-metric-val.is-pass {
  color: var(--status-pass);
}

.companion-metric-val.is-warn {
  color: var(--focus);
}

.companion-metric-val.is-danger {
  color: var(--accent-strong);
}

.companion-note {
  color: var(--paper-muted);
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 12px 0 0;
}

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

.companion-slider-box {
  background: var(--panel-deep);
  border: 1px solid var(--paper-faint);
  border-radius: 8px;
  padding: 14px 16px;
}

.companion-slider-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.companion-slider-top label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--paper-muted);
}

.companion-slider-top strong {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.05rem;
  color: var(--paper);
}

.companion-range {
  accent-color: var(--accent);
  cursor: pointer;
  width: 100%;
}

.companion-inline-link {
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* Home 5-Tool Grid */
.home-tools-section {
  border-top: 1px solid var(--paper-faint);
  background: var(--page);
  padding-block: 56px;
  overflow-x: clip;
}

.home-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.home-tool-card {
  background: var(--panel);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.home-tool-card:hover {
  border-color: var(--accent-strong);
  transform: translateY(-2px);
}

.home-tool-card.is-featured {
  border-color: var(--accent);
  background: linear-gradient(160deg, var(--panel-soft) 0%, var(--panel) 100%);
}

.home-tool-card h3 {
  font-size: 1.0625rem;
  line-height: 1.3;
  color: var(--paper);
}

.home-tool-card p {
  color: var(--paper-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
  flex-grow: 1;
}

.home-tool-cta {
  color: var(--accent-strong);
  font-size: 0.875rem;
  font-weight: 800;
}

/* Best Start Builder & Shared Milestone Checklist */
.bsb-phase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.bsb-phase-card {
  background: var(--panel-soft);
  border: 1px solid var(--paper-line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
}

.bsb-phase-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-strong);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.bsb-phase-card h4 {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.05rem;
  margin: 0 0 6px;
  color: var(--paper);
}

.bsb-phase-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--paper-muted);
}

.bsb-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.bsb-actions-row .button {
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9375rem;
}

.bsb-actions-row .button.secondary {
  background: transparent;
  border-color: var(--paper-line-strong);
}

.bsb-checklist-wrap {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--paper-line);
}

.bsb-checklist-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.bsb-checklist-header h3 {
  font-size: 1.1rem;
  margin: 0;
}

.bsb-progress-badge {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--status-pass);
  background: rgba(76, 217, 100, 0.14);
  border: 1px solid rgba(76, 217, 100, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
}

.bsb-progress-track {
  background: var(--panel-deep);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}

.bsb-progress-fill {
  background: var(--status-pass);
  height: 100%;
  width: 0%;
  transition: width 200ms ease;
}

.bsb-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bsb-check-item {
  background: var(--panel-deep);
  border: 1px solid var(--paper-faint);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: border-color 140ms ease;
}

.bsb-check-item:hover {
  border-color: var(--paper-line-strong);
}

.bsb-check-item input[type="checkbox"] {
  accent-color: var(--status-pass);
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  cursor: pointer;
}

.bsb-check-text {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--paper-muted);
}

.bsb-check-item.is-done {
  border-color: rgba(76, 217, 100, 0.45);
}

.bsb-check-item.is-done .bsb-check-text {
  color: var(--paper);
  text-decoration: line-through;
  text-decoration-color: rgba(76, 217, 100, 0.7);
}

.bsb-reset-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  color: var(--paper-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
}

.bsb-reset-btn:hover {
  border-color: var(--paper);
  color: var(--paper);
}

.tool-featured-banner {
  border: 2px solid var(--accent);
  background: linear-gradient(155deg, var(--panel-soft) 0%, var(--panel) 100%);
}

@media (max-width: 900px) {
  .companion-dse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .companion-shell {
    padding-inline: 16px;
  }

  .companion-tabs {
    padding: 8px;
  }

  .companion-tab {
    flex: 1 1 auto;
    font-size: 0.8125rem;
    padding: 9px 10px;
    text-align: center;
  }

  .companion-panel {
    padding: 14px;
  }

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

  .companion-sliders,
  .bsb-phase-grid,
  .bsb-checklist {
    grid-template-columns: 1fr;
  }

  .home-tools-section {
    padding-block: 40px;
  }
}
