/* ── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  --font: system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", monospace;
  --font-size-body: 16px;
  --font-size-note: 14px;

  /* Page tokens — overridden by dark themes */
  --color-primary:          #1a365d;
  --color-primary-dark:     #2a4a7f;
  --color-heading:          #1a365d;
  --color-qr-bg:            #2b6cb0;
  --color-accent:           #2b6cb0;
  --color-success:          #276749;
  --color-bg:               #f0f4f8;
  --color-surface:          #ffffff;
  --color-surface-subtle:   #f7fafc;
  --color-border:           #e2e8f0;
  --color-text:             #1a202c;
  --color-text-secondary:   #2d3748;
  --color-text-muted:       #718096;
  --color-label:            #4a5568;
  --color-placeholder-bg:   #ebf4ff;
  --color-placeholder-text: #2b6cb0;

  /* Header tokens — overridden per theme */
  --header-bg:              #ffffff;
  --header-border:          1px solid #e2e8f0;
  --logo-name-color:        #1a365d;
  --logo-op-color:          #1a365d;
  --logo-tld-color:         #3182ce;
  --logo-tagline-color:     #718096;
  --nav-color:              #4a5568;
  --nav-hover-color:        #1a365d;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;

  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04);

  --max-width: 860px;
  --label-col: 190px;
}

/* ── Themes ─────────────────────────────────────────────────────────────── */

/* Navy — dark navy header, white wordmark */
[data-theme="navy"] {
  --header-bg:          #1a365d;
  --header-border:      none;
  --logo-name-color:    #ffffff;
  --logo-op-color:      #ffffff;
  --logo-tld-color:     #90cdf4;
  --logo-tagline-color: rgba(255, 255, 255, 0.45);
  --nav-color:          rgba(255, 255, 255, 0.75);
  --nav-hover-color:    #ffffff;
}

/* Accent — navy header, "Op" in blue */
[data-theme="accent"] {
  --header-bg:          #1a365d;
  --header-border:      none;
  --logo-name-color:    #ffffff;
  --logo-op-color:      #4299e1;
  --logo-tld-color:     #90cdf4;
  --logo-tagline-color: rgba(255, 255, 255, 0.45);
  --nav-color:          rgba(255, 255, 255, 0.75);
  --nav-hover-color:    #ffffff;
}

/* Midnight — near-black header + page */
[data-theme="midnight"] {
  --header-bg:              #0f172a;
  --header-border:          none;
  --logo-name-color:        #ffffff;
  --logo-op-color:          #ffffff;
  --logo-tld-color:         #90cdf4;
  --logo-tagline-color:     rgba(255, 255, 255, 0.35);
  --nav-color:              rgba(255, 255, 255, 0.55);
  --nav-hover-color:        #ffffff;
  --color-bg:               #080d18;
  --color-surface:          #0f172a;
  --color-surface-subtle:   #141e2b;
  --color-input:            #1e2d42;
  --color-surface-hover:    #1a2840;
  --color-border:           rgba(255, 255, 255, 0.07);
  --color-text:             #c0ccd8;
  --color-text-secondary:   #95a2b8;
  --color-text-muted:       #7a8a9e;
  --color-label:            #b8c6d6;
  --color-primary:          #2b6cb0;
  --color-primary-dark:     #3182ce;
  --color-heading:          #4299e1;
  --color-qr-bg:            #1a2f4a;
  --color-placeholder-bg:   rgba(43, 108, 176, 0.2);
  --color-placeholder-text: #90cdf4;
}

/* Night Op — near-black header + page, "Op" in blue */
[data-theme="night-op"] {
  --header-bg:              #0f172a;
  --header-border:          none;
  --logo-name-color:        #ffffff;
  --logo-op-color:          #4299e1;
  --logo-tld-color:         #90cdf4;
  --logo-tagline-color:     rgba(255, 255, 255, 0.35);
  --nav-color:              rgba(255, 255, 255, 0.55);
  --nav-hover-color:        #ffffff;
  --color-bg:               #080d18;
  --color-surface:          #0f172a;
  --color-surface-subtle:   #141e2b;
  --color-input:            #1e2d42;
  --color-surface-hover:    #1a2840;
  --color-border:           rgba(255, 255, 255, 0.07);
  --color-text:             #c0ccd8;
  --color-text-secondary:   #95a2b8;
  --color-text-muted:       #7a8a9e;
  --color-label:            #b8c6d6;
  --color-primary:          #2b6cb0;
  --color-primary-dark:     #3182ce;
  --color-heading:          #4299e1;
  --color-qr-bg:            #1a2f4a;
  --color-placeholder-bg:   rgba(43, 108, 176, 0.2);
  --color-placeholder-text: #90cdf4;
}

/* Dusk — soft dark navy header + page */
[data-theme="dusk"] {
  --header-bg:              #1e2a3a;
  --header-border:          1px solid rgba(255, 255, 255, 0.06);
  --logo-name-color:        #ffffff;
  --logo-op-color:          #ffffff;
  --logo-tld-color:         #90cdf4;
  --logo-tagline-color:     rgba(255, 255, 255, 0.35);
  --nav-color:              rgba(255, 255, 255, 0.55);
  --nav-hover-color:        #ffffff;
  --color-bg:               #111827;
  --color-surface:          #1a2336;
  --color-surface-subtle:   #1e2a3a;
  --color-input:            #253347;
  --color-border:           rgba(255, 255, 255, 0.08);
  --color-text:             #c0ccd8;
  --color-text-secondary:   #95a2b8;
  --color-text-muted:       #7a8a9e;
  --color-label:            #b8c6d6;
  --color-primary:          #2b6cb0;
  --color-primary-dark:     #3182ce;
  --color-heading:          #4299e1;
  --color-qr-bg:            #1a2f4a;
  --color-placeholder-bg:   rgba(43, 108, 176, 0.2);
  --color-placeholder-text: #90cdf4;
}

/* Auto dark mode: system preference uses Night Op unless overridden */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --header-bg:              #0f172a;
    --header-border:          none;
    --logo-name-color:        #ffffff;
    --logo-op-color:          #4299e1;
    --logo-tld-color:         #90cdf4;
    --logo-tagline-color:     rgba(255, 255, 255, 0.35);
    --nav-color:              rgba(255, 255, 255, 0.55);
    --nav-hover-color:        #ffffff;
    --color-bg:               #080d18;
    --color-surface:          #0f172a;
    --color-surface-subtle:   #141e2b;
    --color-border:           rgba(255, 255, 255, 0.07);
    --color-text:             #c0ccd8;
    --color-text-secondary:   #95a2b8;
    --color-text-muted:       #7a8a9e;
    --color-label:            #b8c6d6;
    --color-primary:          #2b6cb0;
    --color-primary-dark:     #3182ce;
    --color-placeholder-bg:   rgba(43, 108, 176, 0.2);
    --color-placeholder-text: #90cdf4;
  }
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: var(--font-size-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  border-bottom: var(--header-border, none);
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon { flex-shrink: 0; }
.logo-wordmark {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.logo-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}
.logo-op      { color: var(--logo-op-color); }
.logo-note    { color: var(--logo-name-color); }
.logo-tld     { color: var(--logo-tld-color); font-weight: 300; }
.logo-tagline {
  font-size: 10px;
  letter-spacing: 0.4px;
  color: var(--logo-tagline-color);
}
.site-nav-group {
  display: flex;
  align-items: center;
}
.site-nav a {
  color: var(--nav-color);
  text-decoration: none;
  margin-left: 24px;
  font-size: 14px;
}
.site-nav a:hover { color: var(--nav-hover-color); }

/* ── Theme Toggle (crescent ↔ sun, View Transition page wipe) ────────────── */

/* Toggle colors per theme */
:root {
  --toggle-color:    hsla(230, 25%, 30%, 1);
  --toggle-bg-color: #ffffff;
}
[data-theme="navy"],
[data-theme="accent"] {
  --toggle-color:    rgba(255, 255, 255, 0.8);
  --toggle-bg-color: #1a365d;
}
[data-theme="night-op"],
[data-theme="midnight"] {
  --toggle-color:    hsla(230, 25%, 75%, 1);
  --toggle-bg-color: #0f172a;
}
[data-theme="dusk"] {
  --toggle-color:    hsla(230, 25%, 75%, 1);
  --toggle-bg-color: #1e2a3a;
}

/* Toggle label — 44px touch target, inner div is the visual */
.toggle {
  position: relative;
  cursor: pointer;
  margin-left: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}
.toggle input { display: none; }

.toggle input + div {
  border-radius: 50%;
  width: 20px;
  height: 20px;
  position: relative;
  box-shadow: inset 9px -9px 0 0 var(--toggle-color);
  transform: scale(1) rotate(-2deg);
  transition: box-shadow .5s ease 0s, transform .4s ease .1s;
}
.toggle input + div::before {
  content: '';
  width: inherit;
  height: inherit;
  border-radius: inherit;
  position: absolute;
  left: 0;
  top: 0;
  background: transparent;
  transition: background .3s ease;
}
.toggle input + div::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin: -2px 0 0 -2px;
  position: absolute;
  top: 50%;
  left: 50%;
  box-shadow:
     0 -13px 0 var(--toggle-color),
     0  13px 0 var(--toggle-color),
    13px  0  0 var(--toggle-color),
   -13px  0  0 var(--toggle-color),
     9px  9px 0 var(--toggle-color),
    -9px  9px 0 var(--toggle-color),
     9px -9px 0 var(--toggle-color),
    -9px -9px 0 var(--toggle-color);
  transform: scale(0);
  transition: all .3s ease;
}

/* Checked = dark mode = sun */
.toggle input:checked + div {
  box-shadow: inset 18px -18px 0 0 var(--toggle-bg-color);
  transform: scale(.5) rotate(0deg);
  transition: transform .3s ease .1s, box-shadow .2s ease 0s;
}
.toggle input:checked + div::before {
  background: var(--toggle-color);
  transition: background .3s ease .1s;
}
.toggle input:checked + div::after {
  transform: scale(1.5);
  transition: transform .5s ease .15s;
}

/* ── View Transition page wipe ───────────────────────────────────────────── */
@keyframes reveal-in {
  from { clip-path: circle(0% at var(--x) var(--y)); }
  to   { clip-path: circle(150% at var(--x) var(--y)); }
}
@keyframes reveal-out {
  from { clip-path: circle(150% at var(--x) var(--y)); }
  to   { clip-path: circle(0% at var(--x) var(--y)); }
}

::view-transition-new(root) {
  animation: reveal-in .5s ease-in-out forwards;
  z-index: 1;
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  animation: reveal-out .5s ease-in-out forwards;
  animation-delay: .5s;
  z-index: 0;
  mix-blend-mode: normal;
}
::view-transition-image-pair(root) { isolation: isolate; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-new(root),
  ::view-transition-old(root) { animation: none; }
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 24px 64px;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}
.breadcrumb a {
  color: var(--color-accent);
  text-decoration: none;
}

/* ── Page Title ──────────────────────────────────────────────────────────── */
.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 16px;
  line-height: 1.2;
}

/* ── Quick Reference Box ─────────────────────────────────────────────────── */
.quick-ref-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  background: var(--color-qr-bg);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 80px;
  text-align: center;
}
.qr-item.qr-addons {
  flex: 0 0 100%;
  align-items: flex-start;
  text-align: left;
}
.qr-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
}
.qr-value {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.qr-item code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
}
.qr-label[data-tooltip] {
  cursor: help;
  position: relative;
}
.qr-label[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: #1a1a2e;
  color: rgba(255,255,255,0.9);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
  white-space: normal;
}
.qr-label[data-tooltip]:hover::after { opacity: 1; }
.addon-list {
  margin: 4px 0 0 0;
  padding-left: 0;
  list-style: none;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}
.addon-list li { margin-top: 3px; }
.addon-rvu {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 4px;
}

/* ── Copy Bar ────────────────────────────────────────────────────────────── */
.copy-bar { margin-bottom: 16px; }

.copy-full-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 22px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-qr-bg);
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.1s;
}
.copy-full-btn:hover { background: var(--color-primary-dark); }
.copy-full-btn:active { transform: scale(0.98); }
.copy-full-btn.copied { background: var(--color-success); }

/* ── Note Card ───────────────────────────────────────────────────────────── */
.note-body {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* ── Note Sections — shared ──────────────────────────────────────────────── */
.note-section { border-bottom: 1px solid var(--color-border); }
.note-section:last-child { border-bottom: none; }

.section-label span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-label);
}
.section-content {
  font-size: var(--font-size-note);
  color: var(--color-text-secondary);
  line-height: 1.75;
}
.section-content p { margin-bottom: 8px; }
.section-content p:last-child { margin-bottom: 0; }

/* Placeholder tokens [like this] */
.placeholder {
  background: var(--color-placeholder-bg);
  color: var(--color-placeholder-text);
  border-radius: 3px;
  padding: 0 3px;
  font-style: italic;
}

/* ── Compact sections: LABEL: | content on one row ──────────────────────── */
.note-section--compact {
  display: grid;
  grid-template-columns: var(--label-col) 1fr;
  align-items: baseline;
  padding: 11px 20px;
  gap: 12px;
}
.note-section--compact .section-label { padding-top: 1px; }

/* ── Full sections: label above, content below ───────────────────────────── */
.note-section--full { padding: 16px 20px; }
.note-section--full .section-label { margin-bottom: 8px; }

/* ── Supplemental sections (collapsed details) ───────────────────────────── */
.supplemental-body {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.supplemental-section {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}
.supplemental-summary {
  list-style: none;
  padding: 13px 18px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-label);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.supplemental-summary:hover {
  background: var(--color-surface-hover, var(--color-surface-subtle));
  color: var(--color-accent);
}
.supplemental-summary::-webkit-details-marker { display: none; }
.supplemental-summary::before {
  content: "▶";
  font-size: 9px;
  color: #a0aec0;
  transition: transform 0.15s;
}
.supplemental-section[open] > .supplemental-summary::before {
  transform: rotate(90deg);
}
.supplemental-content {
  padding: 0 18px 18px;
  border-top: 1px solid var(--color-border);
}

/* ── SmartPhrase block ───────────────────────────────────────────────────── */
.smartphrase-wrapper {
  margin-top: 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #2d3748;
}
.smartphrase-toolbar {
  background: #2d3748;
  padding: 8px 12px;
  display: flex;
  justify-content: flex-end;
}
.copy-sp-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  cursor: pointer;
}
.copy-sp-btn:hover { background: rgba(255, 255, 255, 0.2); }
.copy-sp-btn.copied { background: var(--color-success); border-color: var(--color-success); }
.smartphrase-block {
  background: #1a202c;
  color: #e2e8f0;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ── Variants ────────────────────────────────────────────────────────────── */
.variant { margin-bottom: 20px; }
.variant:last-child { margin-bottom: 0; }
.variant h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
  margin-top: 16px;
  border-left: 3px solid var(--color-accent);
  padding-left: 10px;
}

/* ── Documentation Tips ──────────────────────────────────────────────────── */
.tips-list { padding-left: 20px; margin-top: 12px; }
.tips-list li {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--color-label);
  line-height: 1.6;
}

/* ── Procedure Card (category pages) ────────────────────────────────────── */
.procedure-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.1s, box-shadow 0.1s, transform 0.1s;
}
.procedure-card--has-icon {
  display: flex;
  align-items: center;
  gap: 14px;
}
.specialty-card-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--color-text-muted);
  transition: color 0.15s;
}
.specialty-card-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}
.procedure-card--has-icon:hover .specialty-card-icon {
  color: var(--color-accent);
}
.procedure-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(43, 108, 176, 0.12);
  transform: scale(1.04);
}
.procedure-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 4px;
}
.procedure-card-meta {
  font-size: 12px;
  color: var(--color-text-muted);
}
.procedure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

/* ── Ad Slots ────────────────────────────────────────────────────────────── */
/* Three placements per page:
   1. .ad-slot--leaderboard  — below quick-ref box, above Copy button (728x90 desktop / 320x50 mobile)
   2. .ad-slot--in-article   — after Description of Procedure section (highest CTR)
   3. .ad-slot--footer       — above site footer
*/
.ad-slot {
  background: var(--color-surface-subtle);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  overflow: hidden;
}
.ad-slot--leaderboard {
  width: 100%;
  height: 90px;
  margin-bottom: 16px;
}
.ad-slot--in-article {
  width: 100%;
  height: 250px;
  margin: 24px 0;
}
.ad-slot--footer {
  width: 100%;
  height: 90px;
  margin: 32px 0 0 0;
}
/* On mobile collapse leaderboard/footer to banner height */
@media (max-width: 600px) {
  .ad-slot--leaderboard,
  .ad-slot--footer { height: 50px; }
  .ad-slot--in-article { height: 250px; } /* stays full — 300x250 works on mobile */
}

/* ── Affiliate CTA ───────────────────────────────────────────────────────── */
.affiliate-cta {
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 32px;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.affiliate-cta a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}
.affiliate-cta a:hover { text-decoration: underline; }

/* ── Last Reviewed ───────────────────────────────────────────────────────── */
.last-reviewed {
  font-size: 12px;
  color: #a0aec0;
  margin-top: 40px;
  text-align: center;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 12px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-surface);
}
.site-footer a { color: var(--color-accent); text-decoration: none; }

/* ── Hamburger button (hidden on desktop) ────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  margin-left: 4px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--nav-color);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Procedure search filter ─────────────────────────────────────────────── */
.procedure-search {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-input, var(--color-surface-subtle));
  color: var(--color-text);
  margin-bottom: 4px;
  outline: none;
  transition: border-color 0.15s;
}
.procedure-search:focus { border-color: var(--color-accent); }
.procedure-search::placeholder { color: var(--color-text-muted); }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .page-content { padding: 16px 16px 48px; }
  .page-title { font-size: 20px; }
  .logo-tagline { display: none; }
  .quick-ref-box { padding: 14px; gap: 12px; }

  /* Nav: hidden by default, shown as dropdown when open */
  .site-nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 8px 0;
    flex-direction: column;
    z-index: 199;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    margin-left: 0;
    padding: 14px 24px;
    font-size: 15px;
    border-bottom: 1px solid var(--color-border);
  }
  .site-nav a:last-child { border-bottom: none; }

  .site-header { position: sticky; overflow: visible; }
  .nav-hamburger { display: flex; }

  .note-section--compact {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 16px;
  }
  .note-section--full { padding: 14px 16px; }
  .copy-full-btn { width: 100%; justify-content: center; }
  .procedure-grid { grid-template-columns: 1fr; }
  .procedure-search { max-width: 100%; }
}
