/* Tonometer Guide — Swiss Ophthalmic Instrument Manual Theme */
:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-alt: #eaf1ee;
  --ink: #132521;
  --muted: #4b615b;
  --primary: #0f6b5c;
  --primary-dark: #0a4f44;
  --accent: #8a4d08;
  --accent-soft: #fdf5e8;
  --danger: #a62c2b;
  --danger-soft: #fceeee;
  --line: #d4e0db;
  --radius: 10px;
  --shadow-1: 0 1px 2px rgba(19, 37, 33, .06);
  --shadow-2: 0 8px 24px rgba(19, 37, 33, .08);
  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: 16px; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { flex: 0 0 auto; }
.brand-text {
  font-family: var(--font-head);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 4px;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--primary); }
.nav-toggle {
  display: none;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.site-main { padding: 24px 0 64px; }

/* Editorial provenance bar */
.editorial-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-1);
}
.editorial-bar__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}
.editorial-badge {
  display: inline-block;
  background: var(--surface-alt);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
}
.editorial-bar__note {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 92ch;
}

/* Typography & Kickers */
.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}
h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 16px;
}
h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
p { margin: 0 0 16px; }

/* Hero + Interactive 3-path Finder */
.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.08fr);
  gap: 32px;
  align-items: start;
  padding: 12px 0 32px;
}
.hero-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 24px;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.metric-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  box-shadow: var(--shadow-1);
}
.metric-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.metric-lbl {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.finder-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-2);
}
.finder-step {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.finder-head h2 { font-size: 24px; margin-bottom: 6px; }
.finder-head p { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.finder-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.finder-tab {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.finder-tab:hover { border-color: var(--primary); color: var(--primary); }
.finder-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.finder-pane { display: none; }
.finder-pane.is-active { display: block; }
.finder-summary {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 14px;
}
.finder-recs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.finder-rec {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.finder-rec__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.finder-rec__top strong { font-size: 15px; color: var(--ink); }
.mono-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--primary-dark);
  white-space: nowrap;
}
.finder-rec p { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.finder-rec__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.finder-rec__meta span { color: var(--accent); font-weight: 600; }
.finder-rec__meta a { font-weight: 600; text-decoration: none; }

/* Sections */
.section { margin-top: 56px; }
.section-head { margin-bottom: 24px; }
.section-intro { color: var(--muted); max-width: 68ch; font-size: 16px; }

/* Comparison Table */
.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  font-size: 14px;
}
.spec-table th, .spec-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.spec-table thead th {
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.spec-table tbody tr:last-child th, .spec-table tbody tr:last-child td { border-bottom: none; }
.spec-table tbody th { font-weight: 700; color: var(--ink); }
.table-sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.mono-cell { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; color: var(--primary-dark); }
.status-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--primary-dark);
  white-space: nowrap;
}
.table-footnote { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* Figures */
.clinical-figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
}
.clinical-figure--tight { padding: 8px; margin-bottom: 16px; }
.clinical-figure img { width: 100%; border-radius: 6px; }
.clinical-figure figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

/* IOP Reference Band */
.iop-band {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-1);
}
.iop-band__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 32px;
  align-items: center;
}
.iop-mini-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.iop-mini-list div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.iop-mini-list dt {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.iop-mini-list dd { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); color: #ffffff; }
.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-secondary:hover { background: var(--surface-alt); color: var(--primary-dark); }

/* Prose & Sidebar Layout */
.prose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 40px;
  align-items: start;
  margin-top: 32px;
}
.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-1);
}
.prose--standalone { max-width: 780px; }
.prose p, .prose li { max-width: 70ch; }
.prose h2 { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose h3 { margin-top: 24px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 20px; }
.prose li { margin-bottom: 8px; }
.prose blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--surface-alt);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}
.prose thead th { background: var(--surface-alt); font-weight: 700; }

.sidebar-rail { display: grid; gap: 20px; }
.rail-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-1);
}
.rail-box--accent { background: var(--surface-alt); }
.rail-box h3 { font-size: 20px; margin-bottom: 14px; }
.rail-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.rail-links a {
  display: block;
  text-decoration: none;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.rail-links a:hover { border-color: var(--primary); }
.rail-links strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 2px; }
.rail-links span { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }
.citation-list { padding-left: 18px; margin: 0; font-size: 13px; color: var(--muted); }
.citation-list li { margin-bottom: 10px; }
.citation-list cite { font-style: normal; font-weight: 700; color: var(--ink); }

.spec-dl { margin: 0; display: grid; gap: 10px; }
.spec-dl div { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.spec-dl div:last-child { border-bottom: none; padding-bottom: 0; }
.spec-dl dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.spec-dl dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--ink); }

/* Breadcrumb & Guide Header */
.breadcrumb { margin-bottom: 16px; }
.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--line); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

.guide-header { margin-bottom: 28px; }
.guide-lead { font-size: 18px; color: var(--muted); max-width: 66ch; margin-bottom: 20px; }
.takeaway-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-1);
}
.takeaway-box h2 { font-size: 20px; margin-bottom: 10px; }
.takeaway-box ul { margin: 0; padding-left: 20px; }
.takeaway-box li { margin-bottom: 6px; font-size: 15px; }

/* Tool Stage */
.tool-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-2);
  margin-bottom: 32px;
}
.tool-privacy-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

/* FAQ */
.faq-list { display: grid; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 20px;
  box-shadow: var(--shadow-1);
}
.faq-q {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--primary);
  flex: 0 0 auto;
}
.faq-item[open] .faq-q::after { content: "−"; }
.faq-a { padding: 0 0 18px; color: var(--muted); font-size: 15px; }
.faq-a p { margin: 0; max-width: 70ch; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.85fr) minmax(0, 0.85fr);
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.footer-tagline { font-size: 14px; font-weight: 600; color: var(--primary-dark); margin: 10px 0 12px; }
.footer-disclaimer { font-size: 13px; color: var(--muted); line-height: 1.55; max-width: 58ch; }
.footer-heading { font-family: var(--font-body); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-links a { font-size: 14px; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--primary); }
.footer-contact { margin-top: 14px; font-size: 13px; color: var(--muted); }
.footer-bottom { padding-top: 20px; font-size: 13px; color: var(--muted); }
.footer-bottom p { margin: 0; }

.legal-meta { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.not-found {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px 32px;
  max-width: 680px;
  margin: 32px auto;
}

@media (max-width: 960px) {
  .hero-panel, .iop-band__grid, .prose-layout, .footer-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    box-shadow: var(--shadow-2);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { width: 100%; padding: 10px 4px; font-size: 15px; }
  .hero-metrics, .finder-tabs, .iop-mini-list { grid-template-columns: 1fr; }
  .finder-card, .iop-band, .prose, .tool-stage { padding: 20px 16px; }
  .btn-row .btn-primary, .btn-row .btn-secondary { width: 100%; }
}
