:root {
  --navy: #0a0a23;
  --navy-2: #1a1b26;
  --navy-3: #26283a;
  --cyan: #00d8ff;
  --cyan-dark: #00677a;
  --cyan-soft: #e5f9fe;
  --yellow: #fbbb35;
  --ink: #0a0a23;
  --muted: #55586a;
  --line: #e5e7eb;
  --soft: #f5f7fa;
  --graphite: #1a1b26;
  --white: #ffffff;
  --red: #f34842;
  --green: #18c07a;
  --card-shadow: 0 1px 2px #00000014, 0 2px 4px #0000000a;
  --sidebar: 260px;
  --topbar: 76px;
  --content: 1120px;
  --font-sans:
    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:
    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--topbar);
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
}
body.nav-open {
  overflow: hidden;
}
a {
  color: inherit;
}
button,
input {
  font: inherit;
}
button {
  letter-spacing: 0;
}
code,
pre {
  font-family: var(--font-mono);
}
code {
  padding: 0.12em 0.36em;
  color: var(--navy);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.88em;
}
img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 8px 16px;
  color: var(--navy);
  background: var(--yellow);
  transform: translateY(-150%);
}
.skip-link:focus {
  transform: translateY(0);
}
.reading-progress {
  position: fixed;
  z-index: 101;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}
.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan);
}

.topbar {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  color: var(--white);
  background: var(--navy);
  border-bottom: 1px solid var(--graphite);
}
.brand {
  flex: 0 0 auto;
  width: 240px;
  overflow: hidden;
  text-decoration: none;
}
.brand img {
  width: 240px;
  height: 60px;
  object-fit: contain;
  object-position: left center;
}
.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 24px;
  border-left: 1px solid #353748;
  line-height: 1.25;
}
.topbar-title span {
  color: #c7c9d4;
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
}
.topbar-title strong {
  font-size: 0.86rem;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e4e5eb;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}
.text-link:hover {
  color: var(--cyan);
}
.text-link svg {
  width: 15px;
}
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}
.button:hover {
  transform: translateY(-1px);
}
.button svg {
  width: 17px;
}
.button-yellow {
  color: var(--navy);
  background: var(--yellow);
}
.button-yellow:hover {
  background: #fccc60;
}
.button-cyan {
  color: var(--navy);
  background: var(--cyan);
}
.button-cyan:hover {
  background: #4ce4ff;
}
.button-ghost {
  color: var(--white);
  border-color: #6f7184;
  background: transparent;
}
.button-ghost:hover {
  border-color: var(--cyan);
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
}
.icon-button svg {
  width: 19px;
}
.menu-button {
  display: none;
}

.app-shell {
  padding-top: var(--topbar);
}
.sidebar {
  position: fixed;
  z-index: 50;
  top: var(--topbar);
  left: 0;
  bottom: 0;
  width: var(--sidebar);
  background: var(--soft);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 32px 16px 24px;
}
.sidebar-label {
  padding: 0 8px 16px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}
.section-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.section-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--muted);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 140ms ease,
    color 140ms ease;
}
.section-nav a span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}
.section-nav a:hover {
  color: var(--ink);
  background: var(--line);
}
.section-nav a.active {
  color: var(--navy);
  background: var(--cyan-soft);
}
.section-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 20px;
  background: var(--cyan-dark);
}
.section-nav a.active span {
  color: var(--cyan-dark);
}
.sidebar-status {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid var(--line);
}
.status-mark {
  width: 8px;
  height: 8px;
  background: var(--cyan-dark);
  box-shadow: 0 0 0 4px var(--cyan-soft);
  border-radius: 50%;
}
.sidebar-status div:last-child {
  display: flex;
  flex-direction: column;
}
.sidebar-status strong {
  font-size: 0.72rem;
}
.sidebar-status span {
  color: var(--muted);
  font-size: 0.68rem;
}
.scrim {
  display: none;
}

main {
  margin-left: var(--sidebar);
  min-width: 0;
}
.guide-section {
  position: relative;
}
.section-pad {
  padding: 90px max(40px, calc((100% - var(--content)) / 2));
}
.section-heading {
  max-width: 780px;
  margin-bottom: 44px;
}
.section-heading h2 {
  margin: 8px 0 16px;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: 0;
}
.section-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}
.section-heading.light h2 {
  color: var(--white);
}
.section-heading.light > p:last-child {
  color: #aec1c7;
}
.eyebrow {
  margin: 0;
  color: var(--cyan-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.eyebrow.yellow,
.yellow {
  color: var(--yellow);
}
.eyebrow.cyan,
.cyan {
  color: var(--cyan);
}

.hero {
  min-height: calc(100vh - var(--topbar) - 64px);
  padding: 72px max(40px, calc((100% - var(--content)) / 2)) 0;
  color: var(--white);
  background: var(--navy);
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--yellow);
}
.hero-grid {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 72px;
  align-items: center;
}
.hero h1 {
  max-width: 720px;
  margin: 16px 0 24px;
  font-size: 48px;
  line-height: 56px;
  font-weight: 900;
  letter-spacing: 0;
}
.hero-lede {
  max-width: 670px;
  margin: 0;
  color: #d9dae2;
  font-size: 20px;
  line-height: 28px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 34px;
}
.workflow-visual {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 12px 0;
}
.workflow-line {
  position: absolute;
  top: 50px;
  bottom: 50px;
  left: 23px;
  width: 1px;
  background: #353748;
}
.workflow-node {
  position: relative;
  min-height: 88px;
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  padding: 16px 24px 16px 0;
  color: #b5b7c4;
  border-bottom: 1px solid #353748;
}
.workflow-node > span {
  position: relative;
  z-index: 1;
  grid-row: 1 / 3;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #c7c9d4;
  background: var(--navy);
  border: 1px solid #595b6c;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}
.workflow-node strong {
  padding-left: 20px;
  color: var(--white);
  font-size: 1.15rem;
  text-transform: uppercase;
}
.workflow-node small {
  padding-left: 20px;
  font-size: 0.78rem;
}
.workflow-node.active > span {
  color: var(--navy);
  background: var(--cyan);
  border-color: var(--cyan);
}
.workflow-node.active strong {
  color: var(--cyan);
}
.hero-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 24px 0 32px;
  border-top: 1px solid #353748;
}
.hero-footer div {
  display: flex;
  flex-direction: column;
}
.hero-footer span {
  color: var(--yellow);
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
}
.hero-footer strong {
  color: #d9dae2;
  font-size: 0.78rem;
  font-weight: 500;
}

.route-control {
  max-width: 820px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px;
  background: #eaf0f2;
  border-radius: 6px;
}
.route-tab {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.route-tab > svg {
  width: 22px;
}
.route-tab span {
  display: flex;
  flex-direction: column;
}
.route-tab strong {
  color: inherit;
  font-size: 0.88rem;
}
.route-tab small {
  font-size: 0.72rem;
}
.route-tab.active {
  color: var(--navy);
  background: var(--white);
  border-color: var(--line);
  box-shadow: 0 1px 3px rgba(8, 31, 40, 0.08);
}
.route-tab.active > svg {
  color: var(--cyan-dark);
}
.route-panel {
  max-width: 980px;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: 48px;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--cyan);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.route-panel[hidden] {
  display: none;
}
.route-summary {
  display: flex;
  gap: 20px;
}
.route-number {
  flex: 0 0 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--yellow);
  font-family: var(--font-mono);
  font-weight: 600;
}
.route-summary h3 {
  margin: 5px 0 8px;
  font-size: 1.28rem;
  line-height: 1.3;
}
.route-summary div > p:last-of-type {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.inline-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--cyan-dark);
  font-size: 0.76rem;
  font-weight: 800;
}
.inline-action:hover {
  color: var(--navy);
}
.inline-action svg {
  width: 15px;
}
.step-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.step-list li:last-child {
  border-bottom: 0;
}
.step-list li > span {
  color: var(--cyan-dark);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding-top: 3px;
}
.step-list strong {
  font-size: 0.86rem;
}
.step-list p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.code-block {
  overflow: hidden;
  color: var(--soft);
  background: var(--graphite);
  border: 1px solid var(--soft);
  border-radius: 8px;
}
.code-header {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  color: #c7c9d4;
  background: var(--navy);
  border-bottom: 1px solid #353748;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.copy-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  color: #d9dae2;
  background: transparent;
  border: 1px solid #6f7184;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}
.copy-button:hover {
  color: var(--navy);
  background: var(--cyan);
  border-color: var(--cyan);
}
.copy-button svg {
  width: 14px;
}
.code-block pre {
  margin: 0;
  padding: 24px;
  overflow: auto;
  white-space: pre;
}
.code-block code {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font-size: 13px;
  line-height: 20px;
}

.dark-band {
  color: var(--white);
  background: var(--navy);
}
.loop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #353748;
  border-left: 1px solid #353748;
}
.loop-grid article {
  position: relative;
  min-height: 192px;
  padding: 24px;
  border-right: 1px solid #353748;
  border-bottom: 1px solid #353748;
}
.loop-grid article > span {
  position: absolute;
  top: 22px;
  right: 22px;
  color: #8f93a6;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}
.loop-grid svg {
  width: 24px;
  color: var(--cyan);
}
.loop-grid h3 {
  margin: 32px 0 8px;
  font-size: 1.02rem;
  text-transform: uppercase;
}
.loop-grid p {
  margin: 0;
  color: #c7c9d4;
  font-size: 0.82rem;
}
.principle-callout {
  max-width: 850px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 40px;
  padding: 24px;
  color: var(--navy);
  background: var(--yellow);
}
.principle-callout svg {
  width: 28px;
}
.principle-callout p {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.checklist-panel,
.rhythm-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel-heading h3 {
  margin: 4px 0 0;
  font-size: 1.3rem;
}
.reset-checklist {
  color: var(--muted);
  border-color: var(--line);
}
.reset-checklist:hover {
  color: var(--navy);
  background: var(--soft);
}
.check-row {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e2e8ea;
  cursor: pointer;
  font-size: 0.86rem;
}
.check-row input {
  appearance: none;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px solid #91a2a9;
  border-radius: 2px;
  cursor: pointer;
}
.check-row input::before {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  transform: rotate(-45deg) scale(0);
  transition: transform 120ms ease;
}
.check-row input:checked {
  background: var(--cyan);
  border-color: var(--cyan-dark);
}
.check-row input:checked::before {
  transform: rotate(-45deg) scale(1);
}
.check-row:has(input:checked) span {
  color: #7a888e;
  text-decoration: line-through;
}
.check-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}
.check-progress::before {
  content: '';
  grid-column: 1;
  grid-row: 1;
  height: 5px;
  background: #e1e7e9;
}
.check-progress span {
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  display: block;
  width: 0;
  height: 5px;
  background: var(--cyan-dark);
  transition: width 180ms ease;
}
.check-progress strong {
  color: var(--muted);
  font-size: 0.7rem;
}
.rhythm-panel {
  background: var(--soft);
}
.rhythm-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.rhythm-row:last-child {
  border-bottom: 0;
}
.rhythm-row > span {
  color: var(--cyan-dark);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.rhythm-row strong {
  font-size: 0.88rem;
}
.rhythm-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.soft-band {
  background: var(--soft);
  border-top: 1px solid #e1e7e9;
  border-bottom: 1px solid #e1e7e9;
}
.diagram-panel {
  margin-bottom: 24px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--cyan);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.diagram-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.diagram-heading h3 {
  margin: 5px 0 0;
  font-size: 1.3rem;
}
.diagram-heading > span {
  max-width: 330px;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: right;
}
.diagram-panel .mermaid {
  display: grid;
  place-items: center;
  min-height: 230px;
  margin: 0;
  overflow: hidden;
  background: var(--white);
  font-family: var(--font-sans);
}
.diagram-panel .diagram-desktop svg {
  width: 100% !important;
  max-width: 1000px !important;
  height: auto;
}
.diagram-panel .diagram-mobile {
  display: none !important;
}
.diagram-panel .diagram-mobile svg {
  width: 100% !important;
  max-width: 420px !important;
  height: auto;
}
html.mermaid-rendering .diagram-desktop,
html.mermaid-rendering .diagram-mobile {
  position: absolute !important;
  left: -10000px !important;
  display: grid !important;
}
html.mermaid-rendering .diagram-desktop {
  width: 1000px;
}
html.mermaid-rendering .diagram-mobile {
  width: 420px;
}
.diagram-panel .mermaid svg {
  border: 1px solid var(--cyan);
}
.diagram-panel .nodeLabel {
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
}
.diagram-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  color: var(--muted);
  background: var(--soft);
  border-left: 3px solid var(--cyan-dark);
  font-size: 0.76rem;
}
.diagram-note strong {
  color: var(--navy);
}
.command-paths {
  margin-bottom: 48px;
  color: var(--white);
  background: var(--navy);
  border-top: 4px solid var(--yellow);
}
.command-paths-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 24px;
  border-bottom: 1px solid #34354b;
}
.command-paths-heading .eyebrow {
  color: var(--cyan);
}
.command-paths-heading h3 {
  margin: 5px 0 0;
  font-size: 1.3rem;
}
.command-paths-heading > span {
  color: #b9c0cc;
  font-size: 0.74rem;
  text-align: right;
}
.command-path-list {
  padding: 0 24px;
}
.command-path-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  min-height: 74px;
  border-bottom: 1px solid #34354b;
}
.command-path-label {
  color: var(--cyan);
  font-size: 0.75rem;
  text-transform: uppercase;
}
.command-path-steps {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 0.73rem;
}
.command-path-steps > svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #6f7189;
}
.command-path-steps > code,
.command-path-steps .path-choice code,
.command-path-steps .path-optional code {
  color: var(--navy);
  background: var(--cyan);
  border-color: var(--cyan);
  font-weight: 700;
  white-space: nowrap;
}
.command-path-steps > span:not(.path-choice):not(.path-optional) {
  color: #e2e6ec;
  white-space: nowrap;
}
.path-choice,
.path-optional {
  color: #b9c0cc;
  white-space: nowrap;
}
.command-path-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 16px 24px;
  color: #d8dce4;
  background: #15162f;
  font-size: 0.73rem;
}
.command-path-rule > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--yellow);
}
.command-path-rule code {
  color: var(--white);
  border-color: #4d4e67;
  background: #242540;
}
.content-grid {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 56px;
}
.subhead {
  margin: 0 0 16px;
  font-size: 1.4rem;
}
.numbered-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.numbered-list li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.numbered-list span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--yellow);
  font-family: var(--font-mono);
  font-size: 0.67rem;
}
.numbered-list p {
  margin: 2px 0 0;
  font-size: 0.84rem;
}
.table-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: baseline;
  margin-bottom: 12px;
}
.table-heading span {
  color: var(--muted);
  font-size: 0.7rem;
}
.reference-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.79rem;
}
.reference-table th:first-child {
  width: 24%;
}
.reference-table th:nth-child(2) {
  width: 34%;
}
.reference-table th {
  padding: 10px 12px;
  color: var(--white);
  background: var(--navy);
  text-align: left;
}
.reference-table td {
  padding: 9px 12px;
  border: 1px solid var(--line);
}
.reference-table tr:nth-child(even) td {
  background: #f7f9fa;
}
.details-block {
  margin-top: 32px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.details-block summary,
.troubleshoot-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.details-block summary::-webkit-details-marker,
.troubleshoot-list summary::-webkit-details-marker {
  display: none;
}
.details-block summary svg,
.troubleshoot-list summary svg {
  width: 18px;
  transition: transform 160ms ease;
}
details[open] > summary svg {
  transform: rotate(180deg);
}
.details-content {
  border-top: 1px solid var(--line);
}
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.control-grid div {
  display: grid;
  grid-template-columns: minmax(128px, auto) 1fr;
  gap: 16px;
  align-items: center;
  min-height: 64px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.control-grid span {
  color: var(--muted);
  font-size: 0.74rem;
}

.command-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 32px;
}
.command-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.command-tab {
  padding: 8px 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.command-tab.active {
  color: var(--navy);
  border-bottom-color: var(--cyan-dark);
}
.command-code[hidden] {
  display: none;
}
.note-panel {
  padding: 24px;
  background: #fff8de;
  border: 1px solid var(--yellow);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.note-panel > svg {
  width: 25px;
  color: #9e7600;
}
.note-panel h3 {
  margin: 24px 0 8px;
  font-size: 1rem;
}
.note-panel p {
  margin: 0;
  color: #655b3f;
  font-size: 0.78rem;
}
.note-panel a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 22px;
  color: #725900;
  font-size: 0.74rem;
  font-weight: 700;
}
.note-panel a svg {
  width: 14px;
}

.issue-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 32px;
}
.issue-template pre {
  max-height: 650px;
}
.quality-panel {
  padding: 24px;
  background: var(--graphite);
  border: 1px solid #353748;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.quality-panel h3 {
  margin: 8px 0 24px;
  color: var(--white);
  font-size: 1.3rem;
}
.tick-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tick-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  color: #c3d2d7;
  font-size: 0.78rem;
}
.tick-list svg {
  width: 17px;
  color: var(--cyan);
}
.example-pair {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}
.example-pair div {
  padding: 16px;
  background: var(--navy);
  border-left: 3px solid #6f7184;
}
.example-pair div:last-child {
  border-left-color: var(--cyan);
}
.example-pair span {
  color: var(--yellow);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
}
.example-pair p {
  margin: 4px 0 0;
  color: #c5d4d9;
  font-size: 0.75rem;
}

.verification-ladder {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 50px;
}
.ladder-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: center;
  width: calc(52% + var(--n, 0) * 7%);
  min-width: 416px;
  padding: 16px;
  color: var(--white);
  background: var(--navy);
  border-bottom: 1px solid #353748;
}
.ladder-step:nth-child(1) {
  width: 52%;
  background: var(--cyan-dark);
}
.ladder-step:nth-child(2) {
  width: 58%;
}
.ladder-step:nth-child(3) {
  width: 64%;
}
.ladder-step:nth-child(4) {
  width: 70%;
}
.ladder-step:nth-child(5) {
  width: 76%;
}
.ladder-step:nth-child(6) {
  width: 82%;
}
.ladder-step:nth-child(7) {
  width: 88%;
}
.ladder-step > span {
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.ladder-step strong {
  font-size: 0.8rem;
  text-transform: uppercase;
}
.ladder-step p {
  margin: 1px 0 0;
  color: var(--white);
  font-size: 0.71rem;
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 24px;
}
.review-panel,
.warning-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.review-panel h3 {
  margin: 0 0 20px;
  font-size: 1.3rem;
}
.dark-ticks li {
  color: var(--ink);
}
.dark-ticks svg {
  color: var(--cyan-dark);
}
.warning-panel {
  background: #fff4f4;
  border-color: #e2b9bc;
}
.warning-panel ul {
  display: grid;
  gap: 9px;
  margin: 17px 0 0;
  padding-left: 18px;
  color: #633b3f;
  font-size: 0.8rem;
}

.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.rule-grid article {
  min-height: 208px;
  padding: 24px;
  background: var(--white);
}
.rule-grid svg {
  width: 25px;
  color: var(--cyan-dark);
}
.rule-grid h3 {
  margin: 24px 0 9px;
  font-size: 1.05rem;
}
.rule-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.troubleshoot-list {
  max-width: 900px;
  border-top: 1px solid var(--line);
}
.troubleshoot-list details {
  border-bottom: 1px solid var(--line);
}
.troubleshoot-list summary {
  min-height: 56px;
  padding: 16px 0;
  font-size: 0.84rem;
}
.troubleshoot-list details > p {
  margin: 0;
  padding: 0 40px 24px 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.cheat-sheet {
  color: var(--white);
  background: var(--navy);
}
.cheat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: #353748;
  border: 1px solid #353748;
}
.cheat-command {
  min-height: 152px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--graphite);
}
.cheat-command code {
  display: block;
  width: fit-content;
  color: var(--soft);
  background: var(--navy);
  border-color: #595b6c;
}
.cheat-command code {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.done-panel {
  display: grid;
  grid-template-columns: 0.65fr 1.35fr;
  gap: 48px;
  margin-top: 40px;
  padding: 32px;
  color: var(--ink);
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.done-panel h3 {
  margin: 6px 0 0;
  font-size: 1.45rem;
}
.done-panel ol {
  columns: 2;
  gap: 40px;
  margin: 0;
  padding-left: 22px;
}
.done-panel li {
  break-inside: avoid;
  margin-bottom: 10px;
  font-size: 0.8rem;
}
.final-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 20px 24px;
  color: var(--navy);
  background: var(--yellow);
}
.final-note svg {
  flex: 0 0 auto;
  width: 22px;
}
.final-note p {
  margin: 0;
  font-weight: 700;
}

footer {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 32px max(40px, calc((100% - var(--content)) / 2));
  background: var(--navy);
  color: #c7c9d4;
  border-top: 1px solid #353748;
  font-size: 0.73rem;
}
.footer-brand {
  width: 224px;
  height: 48px;
  padding: 0 16px;
  overflow: hidden;
}
.footer-brand img {
  width: 192px;
  height: 48px;
  object-fit: contain;
}
footer nav {
  display: flex;
  gap: 20px;
}
footer a:hover {
  color: var(--cyan);
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 24px;
  padding: 12px 16px;
  color: var(--white);
  background: var(--navy);
  border: 1px solid #595b6c;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.back-to-top {
  position: fixed;
  z-index: 40;
  right: 24px;
  bottom: 24px;
  color: var(--white);
  background: var(--navy);
  border-color: #46636c;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  color: var(--navy);
  background: var(--cyan);
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  :root {
    --sidebar: 224px;
  }
  .topbar-title {
    display: none;
  }
  .hero-grid {
    grid-template-columns: 1fr 340px;
    gap: 40px;
  }
  .hero h1 {
    font-size: 48px;
    line-height: 56px;
  }
  .section-pad {
    padding-left: 44px;
    padding-right: 44px;
  }
  .content-grid,
  .issue-layout {
    grid-template-columns: 1fr;
  }
  .quality-panel {
    max-width: none;
  }
}

@media (max-width: 860px) {
  :root {
    --topbar: 68px;
  }
  .topbar {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 0 16px;
  }
  .menu-button {
    display: inline-grid;
  }
  .brand {
    width: 220px;
    justify-self: start;
  }
  .brand img {
    width: 220px;
    height: 48px;
  }
  .text-link {
    display: none;
  }
  .top-actions .button {
    min-height: 38px;
    padding: 0 12px;
  }
  .sidebar {
    top: var(--topbar);
    width: min(300px, 85vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.18);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  .scrim {
    position: fixed;
    z-index: 45;
    inset: var(--topbar) 0 0;
    display: block;
    background: rgba(1, 16, 22, 0.56);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }
  body.nav-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  main {
    margin-left: 0;
  }
  .hero {
    min-height: auto;
    padding: 56px 32px 0;
  }
  .hero-grid {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 54px;
    padding-bottom: 52px;
  }
  .workflow-visual {
    max-width: 580px;
    width: 100%;
  }
  .hero-footer {
    grid-template-columns: 1fr 1fr;
  }
  .hero-footer div:last-child {
    display: none;
  }
  .section-pad {
    padding: 72px 32px;
  }
  .route-panel {
    grid-template-columns: 1fr;
  }
  .loop-grid {
    grid-template-columns: 1fr 1fr;
  }
  .two-column,
  .review-grid,
  .command-layout {
    grid-template-columns: 1fr;
  }
  .content-grid {
    gap: 40px;
  }
  .diagram-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }
  .diagram-heading > span {
    max-width: none;
    text-align: left;
  }
  .diagram-panel .diagram-desktop {
    display: none !important;
  }
  .diagram-panel .diagram-mobile {
    display: grid !important;
    min-height: 600px;
  }
  .command-path-row {
    grid-template-columns: 128px minmax(0, 1fr);
  }
  .command-path-steps {
    flex-wrap: wrap;
    padding: 14px 0;
  }
  .note-panel {
    max-width: none;
  }
  .cheat-grid {
    grid-template-columns: 1fr;
  }
  .cheat-command {
    min-height: 0;
  }
  .done-panel {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  footer {
    grid-template-columns: 1fr auto;
  }
  footer > p {
    display: none;
  }
}

@media (max-width: 580px) {
  .topbar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    padding: 0 10px;
  }
  .brand {
    width: 190px;
    justify-self: center;
  }
  .brand img {
    width: 190px;
  }
  .top-actions {
    margin-left: auto;
  }
  .top-actions .button span {
    display: none;
  }
  .top-actions .button {
    width: 40px;
    padding: 0;
  }
  .hero {
    padding: 48px 20px 0;
  }
  .hero h1 {
    font-size: 40px;
    line-height: 48px;
  }
  .hero-lede {
    font-size: 1rem;
  }
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .hero-actions .button {
    width: 100%;
  }
  .workflow-node {
    padding-right: 0;
  }
  .hero-footer {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .hero-footer div:nth-child(2) {
    display: none;
  }
  .section-pad {
    padding: 62px 20px;
  }
  .section-heading {
    margin-bottom: 34px;
  }
  .section-heading h2 {
    font-size: 32px;
    line-height: 40px;
  }
  .section-heading > p:last-child {
    font-size: 0.95rem;
  }
  .route-control {
    grid-template-columns: 1fr;
  }
  .route-panel {
    gap: 32px;
    padding: 24px 16px;
  }
  .route-summary {
    gap: 12px;
  }
  .loop-grid {
    grid-template-columns: 1fr;
  }
  .loop-grid article {
    min-height: 160px;
  }
  .two-column {
    gap: 16px;
  }
  .checklist-panel,
  .rhythm-panel {
    padding: 24px 16px;
  }
  .rhythm-row {
    grid-template-columns: 72px 1fr;
    gap: 12px;
  }
  .control-grid {
    grid-template-columns: 1fr;
  }
  .diagram-panel {
    padding: 24px 16px;
  }
  .diagram-panel .diagram-mobile {
    min-height: 560px;
  }
  .command-paths-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 22px 16px;
  }
  .command-paths-heading > span {
    text-align: left;
  }
  .command-path-list {
    padding: 0 16px;
  }
  .command-path-row {
    display: block;
    padding: 18px 0;
  }
  .command-path-label {
    display: block;
    margin-bottom: 12px;
  }
  .command-path-steps {
    gap: 7px;
    padding: 0;
  }
  .command-path-steps > svg {
    width: 13px;
    height: 13px;
  }
  .command-path-rule {
    align-items: flex-start;
    padding: 16px;
  }
  .reference-table-wrap {
    overflow-x: auto;
  }
  .reference-table {
    min-width: 620px;
  }
  .control-grid div {
    grid-template-columns: 1fr;
    gap: 7px;
    border-right: 0;
  }
  .command-tabs {
    overflow-x: auto;
  }
  .code-block pre {
    padding: 16px;
  }
  .code-block code {
    font-size: 0.72rem;
  }
  .quality-panel {
    padding: 24px 16px;
  }
  .ladder-step,
  .ladder-step:nth-child(n) {
    width: 100%;
    min-width: 0;
  }
  .rule-grid {
    grid-template-columns: 1fr;
  }
  .rule-grid article {
    min-height: 0;
  }
  .done-panel {
    padding: 24px 20px;
  }
  .done-panel ol {
    columns: 1;
  }
  .final-note {
    align-items: flex-start;
  }
  footer {
    grid-template-columns: 1fr;
    padding: 32px 24px;
  }
  footer nav {
    flex-wrap: wrap;
  }
}

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

@media print {
  .topbar,
  .sidebar,
  .reading-progress,
  .back-to-top,
  .toast {
    display: none !important;
  }
  main {
    margin: 0;
  }
  .guide-section {
    break-inside: avoid;
  }
}
