/* ============================================================
   The Stacks — shared stylesheet
   A card-catalog inspired study library.
   ============================================================ */

:root {
  --paper: #F6F3EC;
  --paper-card: #FCFAF5;
  --ink: #22271F;
  --ink-soft: #565B4E;
  --forest: #33503F;
  --forest-dark: #23362A;
  --amber: #B8792E;
  --amber-soft: #E8D9BE;
  --line: #DAD4C3;
  --line-strong: #C4BCA4;

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --max-width: 1040px;
}


/* ---------- Theme: dark ---------- */

html[data-theme="dark"] {
  --paper: #1A1C19;
  --paper-card: #22251F;
  --ink: #E9E5DA;
  --ink-soft: #ABA79A;
  --forest: #8BB89A;
  --forest-dark: #6E9C7E;
  --amber: #D9A85C;
  --amber-soft: #3E3421;
  --line: #34382F;
  --line-strong: #4B5044;
}

html[data-theme="dark"] .nav-row-current { color: #14171A !important; }
html[data-theme="dark"] .nav-row-current .nav-row-label,
html[data-theme="dark"] .nav-row-current .nav-caret { color: #14171A; }

/* ---------- Theme: color-blind friendly ----------
   Swaps the green/amber pair (hard for deuteranopia and
   protanopia) for blue/orange, the safest high-contrast
   pairing across the common types. Also adds an underline
   to text links so color is never the only cue. */

html[data-cb="1"] {
  --forest: #2E5FB3;
  --forest-dark: #1F4A94;
  --amber: #C4611D;
  --amber-soft: #F3DCC8;
}

html[data-cb="1"][data-theme="dark"] {
  --forest: #7FA9E9;
  --forest-dark: #5F8FD6;
  --amber: #F0A462;
  --amber-soft: #3E2A18;
}

html[data-cb="1"] .points a,
html[data-cb="1"] .block p a,
html[data-cb="1"] .article-eyebrow a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

html[data-cb="1"] .nav-row-current .nav-row-label::before {
  content: "\25B6\00A0";
  font-size: 9px;
}

/* ---------- Sidebar controls (switches) ---------- */

.sidebar-controls {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink);
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: var(--line-strong);
  border-radius: 11px;
  transition: background 0.15s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper-card);
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.switch input:checked + .switch-track {
  background: var(--forest);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .switch-track, .switch-track::after, #sidebar { transition: none; }
}

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}

::selection {
  background: var(--amber-soft);
}

a {
  color: var(--forest);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--amber);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* ---------- Page shell (sidebar + content) ---------- */

.shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

#sidebar {
  width: 272px;
  flex: 0 0 272px;
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--paper-card);
  position: sticky;
  top: 0;
  align-self: flex-start;
  overflow-y: auto;
}

.sidebar-inner {
  padding: 24px 20px 40px;
}

.sidebar-search {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  padding: 9px 12px;
  margin: 18px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

.sidebar-search::placeholder { color: var(--ink-soft); }

.sidebar-search:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

.mobile-topbar {
  display: none;
}

#sidebar-tree {
  display: flex;
  flex-direction: column;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.35;
}

a.nav-row:hover {
  background: var(--amber-soft);
  color: var(--ink);
}

.nav-row-child {
  padding-left: 22px;
  font-size: 13.5px;
  color: var(--ink);
}

.nav-row-grandchild {
  padding-left: 40px;
  font-size: 13px;
  color: var(--ink-soft);
}

.nav-row-grandchild .nav-row-label { line-height: 1.3; }

.nav-group.is-collapsed > .nav-row-grandchild { display: none; }

.nav-caret {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 3px;
  font-size: 11px;
  padding: 0;
}

.nav-caret:hover { background: var(--amber-soft); color: var(--ink); }

.nav-group.is-collapsed .nav-caret::before { content: "\25B8"; }
.nav-group:not(.is-collapsed) .nav-caret::before { content: "\25BE"; }

.nav-row-current .nav-caret { color: #fff; }

a.nav-row-child:hover { color: var(--ink); }

.nav-row-current {
  background: var(--forest);
  color: #fff !important;
}

.nav-row-current .nav-row-label { color: #fff; }

.nav-row-locked {
  color: var(--ink-soft);
  cursor: default;
}

.nav-row-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 1px 5px;
  flex: 0 0 auto;
}

.nav-empty {
  padding: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.sidebar-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.content-col {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------- Header (kept for the wordmark inside the sidebar) ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 0 0 18px;
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.2px;
}

.wordmark:hover { color: var(--forest); }

.wordmark small {
  display: block;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-top: 2px;
}

.crumb {
  font-size: 14.5px;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.crumb::before {
  content: "\2190";
  margin-right: 6px;
}

.crumb:hover { color: var(--forest); }

/* ---------- Layout shells ---------- */

main {
  max-width: var(--max-width);
  margin: 0;
  padding: 44px 56px 96px;
}

.wide main { max-width: 880px; }

/* ---------- Hero (homepage) ---------- */

.hero h1 {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 14px;
  max-width: 14ch;
}

.hero p {
  color: var(--ink-soft);
  max-width: 70ch;
  font-size: 17.5px;
}

/* ---------- Catalog (subject drawers) ---------- */

.drawer {
  margin-top: 44px;
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}

.drawer + .drawer { margin-top: 28px; }

.drawer h2 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.catalog-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px dotted var(--line-strong);
  text-decoration: none;
  color: var(--ink);
}

.catalog-row.is-open:hover .catalog-title { color: var(--amber); }

.catalog-title {
  font-family: var(--serif);
  font-size: 19px;
}

.catalog-status {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.catalog-row.is-open .catalog-status {
  color: var(--forest);
}

.catalog-row.is-locked {
  cursor: default;
}

.catalog-row.is-locked .catalog-title {
  color: var(--ink-soft);
}

/* ---------- Table of contents (course page) ---------- */

.toc-entry {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.toc-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
  min-width: 2.4em;
}

.toc-label {
  font-family: var(--serif);
  font-size: 19px;
  flex: 0 0 auto;
}

.toc-leader {
  flex: 1;
  border-bottom: 1px dotted var(--line-strong);
  margin-bottom: 6px;
}

.toc-page {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.course-intro p {
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 80ch;
}

.course-eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--forest);
  letter-spacing: 0.04em;
}

.course-title {
  font-family: var(--serif);
  font-size: 32px;
  margin: 6px 0 18px;
}

/* ---------- Big Idea / article pages ---------- */

.article-eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--forest);
  letter-spacing: 0.04em;
}

.article-title {
  font-family: var(--serif);
  font-size: 34px;
  margin: 6px 0 22px;
  line-height: 1.2;
}

.article-lede {
  font-size: 18.5px;
  color: var(--ink-soft);
  max-width: 80ch;
  margin-bottom: 40px;
}

.topic {
  margin-bottom: 38px;
  padding-bottom: 6px;
}

.topic h3 {
  font-family: var(--serif);
  font-size: 21px;
  margin: 0 0 4px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.topic h3 .tnum {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
  font-weight: 500;
}

.topic ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.topic li {
  margin-bottom: 8px;
  max-width: 85ch;
}

.topic li::marker {
  color: var(--amber);
}

.callout {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--forest);
  padding: 14px 18px;
  margin: 14px 0 0;
  font-size: 16px;
  max-width: 85ch;
}

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

code, .kbd {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--paper-card);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---------- Vocab block ---------- */

.vocab {
  margin-top: 48px;
  border-top: 1px solid var(--line-strong);
  padding-top: 22px;
}

.vocab h2 {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.vocab dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.vocab dt {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  display: inline;
}

.vocab dd {
  display: inline;
  margin: 0;
  color: var(--ink-soft);
}

.vocab dd::before {
  content: " \2014 ";
}

.vocab > div { break-inside: avoid; }

/* ---------- Prev / next nav ---------- */

.pager {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line-strong);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.pager a {
  text-decoration: none;
  font-size: 15px;
  max-width: 45%;
}

.pager .dir {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.pager .to-right { text-align: right; margin-left: auto; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px 40px;
  margin-top: 40px;
}

.site-footer .wrap {
  max-width: var(--max-width);
  margin: 0;
  padding: 0 32px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.site-footer.wide .wrap { max-width: 880px; }

/* ---------- Responsive ---------- */

@media (max-width: 520px) {
  .hero h1 { font-size: 32px; }
  .article-title { font-size: 28px; }
  .course-title { font-size: 26px; }
  main { padding: 36px 18px 72px; }
  .toc-label { font-size: 17px; }
}

/* ---------- Responsive sidebar / mobile drawer ---------- */

@media (max-width: 860px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .mobile-topbar .wordmark { font-size: 19px; }
  .mobile-topbar .wordmark small { display: none; }

  #sidebar-toggle {
    font-family: var(--mono);
    font-size: 12.5px;
    background: var(--paper-card);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 7px 12px;
    color: var(--ink);
    cursor: pointer;
  }

  #sidebar {
    position: fixed;
    inset: 0 30% 0 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 2px 0 18px rgba(0,0,0,0.12);
  }

  #sidebar.is-open {
    transform: translateX(0);
  }

  .site-header { display: none; }
}


/* ---------- Topic page blocks ---------- */

.title-num {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--amber);
  font-weight: 500;
  margin-right: 8px;
  vertical-align: 6px;
}

.article-eyebrow a {
  color: inherit;
  text-decoration: none;
}

.article-eyebrow a:hover { color: var(--amber); }

.block {
  margin: 36px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.block h2 {
  font-family: var(--serif);
  font-size: 23px;
  margin: 0 0 14px;
}

.block-note {
  font-size: 15px;
  color: var(--ink-soft);
  margin: -6px 0 16px;
}

.points {
  margin: 0;
  padding-left: 22px;
}

.points li {
  margin-bottom: 10px;
  max-width: 88ch;
  line-height: 1.6;
}

.points li::marker { color: var(--amber); }

.points ul, .points ol {
  margin-top: 8px;
  padding-left: 20px;
}

.block p {
  max-width: 88ch;
  line-height: 1.65;
}

pre.code {
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.55;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  padding: 14px 18px;
  margin: 12px 0;
  overflow-x: auto;
  max-width: 88ch;
  white-space: pre;
}

table.trace {
  border-collapse: collapse;
  font-size: 14.5px;
  margin: 12px 0;
}

table.trace th, table.trace td {
  border: 1px solid var(--line-strong);
  padding: 6px 14px;
  text-align: left;
}

table.trace th {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12.5px;
  background: var(--paper-card);
}

.question {
  border: 1px solid var(--line);
  background: var(--paper-card);
  padding: 18px 22px;
  margin: 14px 0;
  max-width: 88ch;
}

.q-stem {
  line-height: 1.6;
}

.q-num {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--amber);
  margin-right: 8px;
}

.q-options {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.q-options li {
  padding: 6px 0;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.opt-letter {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 1px 6px;
  flex: 0 0 auto;
}

.q-answer {
  margin-top: 12px;
  border-top: 1px dotted var(--line-strong);
  padding-top: 10px;
}

.q-answer summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--forest);
  letter-spacing: 0.03em;
}

.q-answer summary:hover { color: var(--amber); }

.q-answer p {
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 1.6;
}

.q-answer strong { color: var(--forest); }

@media (max-width: 860px) {
  main { padding: 36px 20px 72px; }
  .site-footer .wrap { padding: 0; }
}

/* ---------- Code tracer widget ---------- */

.tracer {
  border: 1px solid var(--line-strong);
  background: var(--paper-card);
  margin: 16px 0;
  max-width: 100%;
  outline: none;
}

.tracer:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.tracer-head {
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.tracer-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.tracer-intro {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.tracer-body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(220px, 2fr);
  gap: 0;
}

.tracer-code {
  margin: 0;
  padding: 14px 0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  overflow-x: auto;
  border-right: 1px solid var(--line);
  white-space: pre;
}

.tracer-line {
  display: block;
  padding: 0 16px 0 0;
}

.tracer-ln {
  display: inline-block;
  width: 36px;
  text-align: right;
  padding-right: 12px;
  color: var(--ink-soft);
  font-size: 11.5px;
  user-select: none;
}

.tracer-line.is-active {
  background: var(--amber-soft);
  box-shadow: inset 3px 0 0 var(--amber);
}

.tracer-side {
  padding: 12px 16px;
  font-size: 13.5px;
}

.tracer-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 6px 0 6px;
}

.tracer-vars {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--mono);
  font-size: 13px;
  margin-bottom: 10px;
}

.tracer-vars td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.tracer-vname { color: var(--ink-soft); width: 34%; }

.tracer-vars tr.is-changed td { background: var(--amber-soft); }

.tracer-empty { color: var(--ink-soft); font-style: italic; }

.tracer-out {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  min-height: 1.6em;
  white-space: pre-wrap;
  color: var(--forest);
}

.tracer-note {
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  min-height: 2.6em;
}

.tracer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 14px;
  border-top: 1px solid var(--line);
}

.tracer-btn {
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.tracer-btn:hover:not(:disabled) { background: var(--amber-soft); }
.tracer-btn:disabled { opacity: 0.4; cursor: default; }

.tracer-btn-primary {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

.tracer-btn-primary:hover:not(:disabled) { background: var(--forest-dark); color: #fff; }

html[data-theme="dark"] .tracer-btn-primary { color: #14171A; }

.tracer-count {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0 auto;
}

.tracer-hint {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 6px 0 0;
}

@media (max-width: 720px) {
  .tracer-body { grid-template-columns: 1fr; }
  .tracer-code { border-right: none; border-bottom: 1px solid var(--line); }
}

/* ---------- Depth sections ---------- */

.mistakes {
  margin: 0;
  padding-left: 22px;
}

.mistakes li {
  margin-bottom: 10px;
  max-width: 88ch;
  line-height: 1.6;
}

.mistakes li::marker { color: var(--amber); }

.mistakes li strong { color: var(--forest); }

/* ---------- Cheat sheets ---------- */

.cheat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 40px;
}

.cheat-topic { break-inside: avoid; }

.cheat-topic h3 {
  font-family: var(--serif);
  font-size: 16px;
  margin: 0 0 6px;
}

.cheat-topic h3 .tnum {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  margin-right: 6px;
}

.cheat-topic dl { margin: 0 0 8px; }
.cheat-topic dt { font-weight: 600; display: inline; font-size: 13.5px; }
.cheat-topic dd { display: inline; margin: 0; color: var(--ink-soft); font-size: 13.5px; }
.cheat-topic dd::before { content: " \2014 "; }
.cheat-topic > div { margin-bottom: 4px; }

.cheat-tip {
  font-size: 13.5px;
  border-left: 3px solid var(--forest);
  padding: 4px 10px;
  margin-top: 6px;
  background: var(--paper-card);
}

.cheat-tip strong { color: var(--forest); }

.print-btn {
  font-family: var(--sans);
  font-size: 14px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper-card);
  color: var(--ink);
  cursor: pointer;
  margin-top: 12px;
}

.print-btn:hover { background: var(--amber-soft); }

@media print {
  #sidebar, .mobile-topbar, .pager, .site-footer, .print-btn, .article-eyebrow a { display: none !important; }
  .shell { display: block; }
  main { max-width: none; padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .cheat-grid { grid-template-columns: 1fr 1fr; gap: 12px 28px; }
  .cheat-tip { border-left-color: #000; background: none; }
  a { color: inherit; text-decoration: none; }
  h1.article-title { font-size: 20pt; }
}

@media (max-width: 720px) {
  .cheat-grid { grid-template-columns: 1fr; }
}

/* ---------- Search: content-match snippets ---------- */

.nav-row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.nav-row-snippet {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 2px;
  white-space: normal;
  line-height: 1.4;
}

.nav-row-snippet mark {
  background: var(--amber-soft);
  color: var(--ink);
  font-style: normal;
  padding: 0 1px;
  border-radius: 2px;
}

.nav-row-current .nav-row-snippet { color: rgba(255,255,255,0.75); }
.nav-row-current .nav-row-snippet mark { background: rgba(255,255,255,0.25); color: #fff; }
