/* Visionworks.info — site stylesheet
   Bright, trustworthy optical information aesthetic (teal / ink). */

:root {
  --vw-primary: #0B6E7A;
  --vw-accent: #1F8A9A;
  --vw-ink: #16323A;
  --vw-bg: #F4FBFB;
  --vw-surface: #fff;
  --vw-warn: #9A3412;
  --vw-ok: #0F766E;
  --vw-muted: #4A6670;
  --vw-line: #D3E6E8;
  --vw-line-strong: #A8CDD2;
  --vw-soft: #E7F5F6;
  --vw-soft-2: #D9EFF1;
  --vw-danger-bg: #FEF3EE;
  --vw-ok-bg: #ECFDF8;
  --vw-shadow: 0 10px 30px rgba(11, 110, 122, 0.08);
  --vw-shadow-sm: 0 2px 10px rgba(22, 50, 58, 0.06);
  --vw-radius: 14px;
  --vw-radius-sm: 10px;
  --vw-focus: 0 0 0 3px rgba(31, 138, 154, 0.35);
  --vw-font-ui: "Nunito Sans", "Segoe UI", Tahoma, sans-serif;
  --vw-font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --vw-shell: 1120px;
  --vw-header-h: 72px;
  --vw-touch: 44px;
  color-scheme: light;
}

html[data-contrast="high"] {
  --vw-primary: #054851;
  --vw-accent: #0A5C66;
  --vw-ink: #06161A;
  --vw-bg: #FFFFFF;
  --vw-surface: #FFFFFF;
  --vw-muted: #10262C;
  --vw-line: #16323A;
  --vw-line-strong: #0B6E7A;
  --vw-soft: #F0F7F8;
  --vw-soft-2: #E2F0F2;
  --vw-shadow: none;
  --vw-shadow-sm: none;
  --vw-focus: 0 0 0 3px #000000;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--vw-font-ui);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--vw-ink);
  background:
    radial-gradient(1200px 480px at 10% -10%, rgba(31, 138, 154, 0.14), transparent 55%),
    radial-gradient(900px 420px at 95% 0%, rgba(11, 110, 122, 0.10), transparent 50%),
    linear-gradient(180deg, #F7FCFC 0%, var(--vw-bg) 42%, #EEF8F8 100%);
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--vw-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--vw-accent);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--vw-accent);
  outline-offset: 2px;
  box-shadow: var(--vw-focus);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10000;
  background: var(--vw-ink);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.shell {
  width: min(100% - 2rem, var(--vw-shell));
  margin-inline: auto;
  min-width: 0;
}

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--vw-line);
}

html[data-contrast="high"] .site-header {
  background: #fff;
  backdrop-filter: none;
}

.site-header__inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem;
  min-height: var(--vw-header-h);
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--vw-ink);
  flex: 0 0 auto;
  min-width: 0;
  position: relative;
  z-index: 2;
  padding-right: 0.35rem;
}

.brand__mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.brand__wordmark {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  line-height: 1;
  padding: 0.1rem 0;
}

.brand__name {
  font-family: var(--vw-font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--vw-ink);
}

.brand__tld {
  font-family: var(--vw-font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--vw-accent);
}

.brand__logo,
.brand__logo--compact,
.brand__text,
.brand__tag {
  display: none;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.1rem;
  margin-left: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  overflow: hidden;
}

.nav-desktop a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--vw-ink);
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

.nav-desktop a:hover,
.nav-desktop a[aria-current="page"] {
  background: var(--vw-soft);
  color: var(--vw-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.icon-btn,
.contrast-toggle,
.nav-toggle {
  appearance: none;
  border: 1px solid var(--vw-line-strong);
  background: var(--vw-surface);
  color: var(--vw-ink);
  min-width: var(--vw-touch);
  min-height: var(--vw-touch);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 0.8rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.contrast-toggle__icon {
  display: block;
  flex: 0 0 auto;
}

.icon-btn:hover,
.contrast-toggle:hover,
.nav-toggle:hover {
  background: var(--vw-soft);
}

.nav-toggle {
  display: inline-flex;
}

.nav-toggle__bars {
  width: 18px;
  height: 12px;
  position: relative;
  display: block;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after,
.nav-toggle__bars span {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars span { top: 5px; }
.nav-toggle__bars::after { bottom: 0; content: ""; }

body.nav-open .nav-toggle__bars::before {
  top: 5px;
  transform: rotate(45deg);
}

body.nav-open .nav-toggle__bars span {
  opacity: 0;
}

body.nav-open .nav-toggle__bars::after {
  bottom: 5px;
  transform: rotate(-45deg);
}

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 950;
  pointer-events: none;
}

.nav-drawer[hidden] {
  display: none !important;
}

.nav-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 22, 26, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100vw - 2.5rem, 360px);
  max-width: 100%;
  height: 100%;
  background: var(--vw-surface);
  border-left: 1px solid var(--vw-line);
  box-shadow: var(--vw-shadow);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1rem;
  gap: 1rem;
  overflow: auto;
}

body.nav-open .nav-drawer {
  pointer-events: auto;
}

body.nav-open .nav-drawer__backdrop {
  opacity: 1;
}

body.nav-open .nav-drawer__panel {
  transform: translateX(0);
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

.nav-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.nav-drawer__title {
  font-family: var(--vw-font-display);
  font-size: 1.25rem;
  margin: 0;
}

.nav-drawer nav {
  display: grid;
  gap: 0.25rem;
}

.nav-drawer a {
  display: flex;
  align-items: center;
  min-height: var(--vw-touch);
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--vw-ink);
  font-weight: 700;
}

.nav-drawer a:hover,
.nav-drawer a[aria-current="page"] {
  background: var(--vw-soft);
  color: var(--vw-primary);
}

.header-search,
.drawer-search {
  position: relative;
  min-width: 0;
}

.header-search {
  display: none !important;
  width: min(220px, 22vw);
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
}

.search-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.search-form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--vw-touch);
  border: 1px solid var(--vw-line-strong);
  border-radius: 12px;
  padding: 0.55rem 0.85rem;
  font: inherit;
  background: var(--vw-surface);
  color: var(--vw-ink);
}

.search-form button {
  min-width: var(--vw-touch);
  min-height: var(--vw-touch);
  border: 0;
  border-radius: 12px;
  background: var(--vw-primary);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0 0.9rem;
}

.search-form button:hover {
  background: var(--vw-accent);
}

.search-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  background: var(--vw-surface);
  border: 1px solid var(--vw-line);
  border-radius: 12px;
  box-shadow: var(--vw-shadow);
  z-index: 40;
  max-height: 280px;
  overflow: auto;
  padding: 0.35rem;
}

.search-suggest[hidden] {
  display: none !important;
}

.search-suggest a,
.search-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--vw-ink);
  text-decoration: none;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  min-height: var(--vw-touch);
}

.search-suggest a:hover,
.search-suggest button:hover,
.search-suggest [aria-selected="true"] {
  background: var(--vw-soft);
}

.search-suggest__meta {
  display: block;
  color: var(--vw-muted);
  font-size: 0.82rem;
}

/* Main */
main#main {
  min-width: 0;
  padding: 1.5rem 0 3.5rem;
}

.page-hero,
.hero {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--vw-line);
  border-radius: calc(var(--vw-radius) + 4px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(231, 245, 246, 0.92)),
    radial-gradient(600px 240px at 85% 20%, rgba(31, 138, 154, 0.18), transparent 60%);
  box-shadow: var(--vw-shadow-sm);
  padding: clamp(1.4rem, 3vw, 2.4rem);
  margin-bottom: 1.75rem;
  overflow: hidden;
  min-width: 0;
}

.page-hero::before,
.hero::before {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 18px solid rgba(11, 110, 122, 0.08);
  pointer-events: none;
  z-index: -1;
}

.hero__brand,
.eyebrow {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--vw-primary);
  margin: 0 0 0.55rem;
}

.hero h1,
.page-hero h1,
.section-title,
h1, h2, h3, h4 {
  font-family: var(--vw-font-display);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--vw-ink);
  margin: 0 0 0.65rem;
  overflow-wrap: anywhere;
}

.hero h1,
.page-hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  max-width: 18ch;
}

.hero__lead,
.lead {
  font-size: 1.1rem;
  color: var(--vw-muted);
  max-width: 62ch;
  margin: 0 0 1.1rem;
}

.hero__actions,
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

/* Buttons */
.btn,
button.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--vw-touch);
  padding: 0.65rem 1.1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--vw-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--vw-accent);
  color: #fff;
}

.btn--secondary,
.btn--ghost {
  background: var(--vw-surface);
  border-color: var(--vw-line-strong);
  color: var(--vw-ink);
}

.btn--secondary:hover,
.btn--ghost:hover {
  background: var(--vw-soft);
  color: var(--vw-primary);
}

.btn--warn {
  background: var(--vw-danger-bg);
  border-color: #F0C2AE;
  color: var(--vw-warn);
}

.btn[disabled],
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Cards / grids */
.card-grid,
.tools-grid,
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
  min-width: 0;
}

.tool-card,
.article-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--vw-surface);
  border: 1px solid var(--vw-line);
  border-radius: var(--vw-radius);
  box-shadow: var(--vw-shadow-sm);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.tool-card:hover,
a.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--vw-line-strong);
  box-shadow: var(--vw-shadow);
}

.tool-card__media,
.article-card__media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(145deg, var(--vw-soft), #fff 55%, var(--vw-soft-2));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-card__media img,
.article-card__media img {
  width: 100%;
  height: 100%;
  /* contain: keep diagram labels/titles fully visible (cover was clipping text) */
  object-fit: contain;
  object-position: center;
}

.tool-card__body,
.article-card__body {
  padding: 1rem 1.05rem 1.15rem;
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.tool-card__title,
.article-card__title {
  font-family: var(--vw-font-display);
  font-size: 1.2rem;
  margin: 0;
}

.tool-card__summary,
.article-card__summary {
  margin: 0;
  color: var(--vw-muted);
  font-size: 0.98rem;
}

.tool-card__meta,
.article-card__meta {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--vw-primary);
}

.article-hero {
  margin: 0 0 1.25rem;
  min-width: 0;
}

.article-hero picture,
.article-hero img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: calc(var(--vw-radius) + 4px);
  border: 1px solid var(--vw-line);
  background: var(--vw-soft);
}

.article-hero__caption {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  color: var(--vw-muted);
  line-height: 1.45;
}

/* Breadcrumbs */
.breadcrumbs {
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  min-width: 0;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--vw-muted);
}

.breadcrumbs a {
  text-decoration: none;
  font-weight: 700;
}

.breadcrumbs [aria-current="page"] {
  color: var(--vw-muted);
  overflow-wrap: anywhere;
}

/* Sections */
.section {
  margin: 2rem 0;
  min-width: 0;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section__head p {
  margin: 0;
  color: var(--vw-muted);
  max-width: 60ch;
}

.prose,
.article-body,
.tool-copy {
  max-width: 72ch;
  min-width: 0;
}

.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }

.prose h2 { font-size: 1.55rem; margin-top: 1.8rem; }
.prose h3 { font-size: 1.25rem; margin-top: 1.4rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin: 0.25rem 0; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--vw-soft);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

/* FAQ */
.faq {
  display: grid;
  gap: 0.65rem;
}

.faq__item {
  background: var(--vw-surface);
  border: 1px solid var(--vw-line);
  border-radius: var(--vw-radius-sm);
  overflow: hidden;
}

.faq__question {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  min-height: var(--vw-touch);
  padding: 0.9rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.faq__question::after {
  content: "+";
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--vw-soft);
  color: var(--vw-primary);
  font-weight: 900;
}

.faq__item.is-open .faq__question::after {
  content: "–";
}

.faq__answer {
  padding: 0 1rem 1rem;
  color: var(--vw-muted);
}

.faq__answer[hidden] {
  display: none !important;
}

/* Disclaimer / banners */
.disclaimer,
.medical-disclaimer,
.disclaimer-band {
  background: var(--vw-soft);
  border: 1px solid var(--vw-line);
  border-left: 4px solid var(--vw-primary);
  border-radius: var(--vw-radius-sm);
  padding: 0.95rem 1.05rem;
  margin: 1.25rem 0;
  color: var(--vw-ink);
}

.disclaimer h2,
.medical-disclaimer h2,
.disclaimer-band h2,
.disclaimer h3,
.medical-disclaimer h3 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.disclaimer p,
.medical-disclaimer p,
.disclaimer-band p {
  margin: 0;
  color: var(--vw-muted);
}

.emergency-banner {
  background: var(--vw-danger-bg);
  border: 1px solid #F0C2AE;
  border-left: 4px solid var(--vw-warn);
  border-radius: var(--vw-radius-sm);
  padding: 0.95rem 1.05rem;
  margin: 1rem 0 1.5rem;
  color: var(--vw-warn);
}

.emergency-banner strong {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--vw-font-display);
}

.sources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.sources-list li {
  background: var(--vw-surface);
  border: 1px solid var(--vw-line);
  border-radius: var(--vw-radius-sm);
  padding: 0.85rem 1rem;
  min-width: 0;
}

.sources-list a {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.sources-list__org,
.sources-list__meta {
  display: block;
  color: var(--vw-muted);
  font-size: 0.9rem;
}

.related-list {
  display: grid;
  gap: 0.75rem;
}

.related-list a {
  display: block;
  text-decoration: none;
  background: var(--vw-surface);
  border: 1px solid var(--vw-line);
  border-radius: var(--vw-radius-sm);
  padding: 0.9rem 1rem;
  color: inherit;
  min-width: 0;
}

.related-list a:hover {
  border-color: var(--vw-line-strong);
  background: var(--vw-soft);
}

.related-list__title {
  font-weight: 800;
  color: var(--vw-primary);
}

.related-list__summary {
  color: var(--vw-muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  min-width: 0;
}

.form-grid .full,
.field--full {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.field label,
.field .label {
  font-weight: 800;
  font-size: 0.95rem;
}

.field .hint {
  color: var(--vw-muted);
  font-size: 0.88rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: var(--vw-touch);
  border: 1px solid var(--vw-line-strong);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font: inherit;
  background: var(--vw-surface);
  color: var(--vw-ink);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.search-form input:focus-visible {
  border-color: var(--vw-accent);
}

.field-error,
.form-error {
  color: var(--vw-warn);
  font-weight: 700;
  font-size: 0.92rem;
}

.form-success {
  color: var(--vw-ok);
  font-weight: 700;
}

/* Tool UI */
.tool-panel,
.tool-ui {
  background: var(--vw-surface);
  border: 1px solid var(--vw-line);
  border-radius: var(--vw-radius);
  box-shadow: var(--vw-shadow-sm);
  padding: clamp(1rem, 2vw, 1.4rem);
  min-width: 0;
}

.tool-panel + .tool-panel,
.tool-ui + .tool-ui {
  margin-top: 1rem;
}

.tool-toolbar,
.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 1rem;
  min-width: 0;
}

.tool-toolbar .field,
.tool-controls .field {
  flex: 1 1 160px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem;
  background: var(--vw-soft);
  border-radius: 12px;
  border: 1px solid var(--vw-line);
}

.segmented button {
  min-height: var(--vw-touch);
  min-width: var(--vw-touch);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--vw-ink);
  font: inherit;
  font-weight: 800;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}

.segmented button[aria-pressed="true"],
.segmented button.is-active {
  background: var(--vw-primary);
  color: #fff;
}

.chart-stage,
.optotype-stage,
.tool-stage {
  background:
    linear-gradient(180deg, #FBFEFE, #F2F9FA);
  border: 1px dashed var(--vw-line-strong);
  border-radius: var(--vw-radius-sm);
  padding: 1rem;
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  min-width: 0;
  overflow: auto;
}

.optotype-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 0.85rem;
  margin: 0.55rem 0;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #111;
  line-height: 1;
}

.optotype-line button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  color: inherit;
  min-width: var(--vw-touch);
  min-height: var(--vw-touch);
  cursor: pointer;
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
}

.optotype-line button:hover,
.optotype-line button:focus-visible {
  border-color: var(--vw-accent);
  background: rgba(31, 138, 154, 0.08);
}

.result-box {
  margin-top: 1rem;
  background: var(--vw-ok-bg);
  border: 1px solid #99D5CB;
  border-radius: var(--vw-radius-sm);
  padding: 1rem;
  min-width: 0;
}

.result-box--warn {
  background: var(--vw-danger-bg);
  border-color: #F0C2AE;
  color: var(--vw-warn);
}

.result-box h3,
.result-box h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.result-box p,
.result-box ul {
  margin: 0 0 0.55rem;
}

.result-box ul:last-child,
.result-box p:last-child {
  margin-bottom: 0;
}

.calibration-helper {
  display: grid;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--vw-line);
  border-radius: var(--vw-radius-sm);
  padding: 0.9rem;
}

.calibration-card {
  width: min(100%, 85.6mm);
  max-width: 100%;
  aspect-ratio: 85.6 / 53.98;
  border: 2px dashed var(--vw-primary);
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.75rem;
  background: repeating-linear-gradient(
    -45deg,
    rgba(11, 110, 122, 0.04),
    rgba(11, 110, 122, 0.04) 8px,
    transparent 8px,
    transparent 16px
  );
  color: var(--vw-muted);
  font-size: 0.92rem;
}

.mm-ruler {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--vw-line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 0.5rem;
}

.mm-ruler__track {
  height: 42px;
  background:
    repeating-linear-gradient(
      to right,
      var(--vw-ink) 0,
      var(--vw-ink) 1px,
      transparent 1px,
      transparent 1mm
    );
  border-bottom: 2px solid var(--vw-ink);
  min-width: 100mm;
}

.color-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 0.65rem;
  width: min(100%, 420px);
}

.color-swatch {
  aspect-ratio: 1;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  cursor: pointer;
  min-height: var(--vw-touch);
}

.color-swatch:focus-visible {
  outline-offset: 3px;
}

.astigmatism-chart {
  width: min(100%, 360px);
  height: auto;
}

.sim-canvas-wrap {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
}

.sim-canvas-wrap canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--vw-line);
  background: #ddd;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--vw-soft);
  color: var(--vw-primary);
  font-weight: 800;
  font-size: 0.82rem;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--vw-line);
  border-radius: var(--vw-radius-sm);
  background: var(--vw-surface);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

table.data-table th,
table.data-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--vw-line);
  text-align: left;
  vertical-align: top;
}

table.data-table th {
  background: var(--vw-soft);
  font-weight: 800;
}

/* Ads */
.ad-slot {
  margin: 1.25rem 0;
  min-width: 0;
  max-width: 100%;
}

.ad-slot__inner {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* Modal */
.modal-root[hidden] {
  display: none !important;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-root__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 22, 26, 0.5);
}

.modal {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-width: 100%;
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--vw-surface);
  border-radius: var(--vw-radius);
  border: 1px solid var(--vw-line);
  box-shadow: var(--vw-shadow);
  padding: 1.15rem 1.2rem 1.25rem;
  min-width: 0;
}

.modal__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.modal__title {
  margin: 0;
  font-size: 1.3rem;
}

.modal__close {
  flex: 0 0 auto;
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

/* Footer */
.site-footer {
  background: #0D3C44;
  color: #E7F5F6;
  padding: 2.5rem 0 2rem;
  margin-top: 2rem;
}

.site-footer a {
  color: #B9E4EA;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
  min-width: 0;
}

.site-footer h2,
.site-footer h3 {
  color: #fff;
  font-size: 1.05rem;
  margin: 0 0 0.7rem;
}

.site-footer p,
.site-footer li {
  color: #C9DEE2;
  font-size: 0.95rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.site-footer__legal {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(185, 228, 234, 0.25);
  font-size: 0.9rem;
  color: #B7CDD2;
}

.site-footer__legal p {
  margin: 0 0 0.65rem;
  max-width: 80ch;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 1.5rem 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--vw-touch);
  min-height: var(--vw-touch);
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--vw-line);
  background: var(--vw-surface);
  text-decoration: none;
  color: var(--vw-ink);
  font-weight: 800;
}

.pagination [aria-current="page"] {
  background: var(--vw-primary);
  border-color: var(--vw-primary);
  color: #fff;
}

/* Empty / status */
.empty-state,
.status-note {
  border: 1px dashed var(--vw-line-strong);
  border-radius: var(--vw-radius-sm);
  padding: 1.1rem;
  color: var(--vw-muted);
  background: rgba(255, 255, 255, 0.7);
}

/* Utility */
.stack { display: grid; gap: 1rem; }
.stack-sm { display: grid; gap: 0.55rem; }
.muted { color: var(--vw-muted); }
.ok { color: var(--vw-ok); }
.warn { color: var(--vw-warn); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.25rem; }

/* Responsive */
@media (max-width: 899px) {
  .brand__mark { width: 36px; height: 36px; }
  .brand__name { font-size: 1.05rem; }
  .brand__tld { display: none; } /* keep "Visionworks" visible; hide .info on small screens */
  .site-footer__grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .brand__wordmark { display: none; }
}

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .nav-toggle { display: none; }
  .header-actions { margin-left: 0; }
  .header-search { display: flex !important; }
  .brand__name,
  .brand__tld { font-size: 1.2rem; }
  .nav-desktop a { padding: 0.3rem 0.55rem; font-size: 0.88rem; }
}

@media (min-width: 1200px) {
  .brand__name,
  .brand__tld { font-size: 1.35rem; }
  .nav-desktop a { padding: 0.35rem 0.65rem; font-size: 0.92rem; }
  .header-search { width: min(250px, 24vw); }
  .brand__mark { width: 44px; height: 44px; }
}

@media (max-width: 1199px) {
  .contrast-toggle__label { display: none; }
  .contrast-toggle { padding: 0; width: var(--vw-touch); }
}

@media (max-width: 480px) {
  .shell { width: min(100% - 1.25rem, var(--vw-shell)); }
  .hero h1,
  .page-hero h1 { max-width: none; }
  .contrast-toggle__label { display: none; }
}

@media (min-width: 1280px) {
  body {
    background:
      radial-gradient(1400px 520px at 8% -12%, rgba(31, 138, 154, 0.15), transparent 55%),
      radial-gradient(1000px 460px at 96% 0%, rgba(11, 110, 122, 0.11), transparent 52%),
      linear-gradient(180deg, #F8FDFD 0%, var(--vw-bg) 40%, #EEF8F8 100%);
  }
}

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

@media print {
  .site-header,
  .site-footer,
  .ad-slot,
  .nav-drawer,
  .skip-link,
  .contrast-toggle,
  .nav-toggle {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  a { text-decoration: underline; }
}

/* Phase 5 hub navigation */
.hub-toc {
  background: var(--vw-surface, #fff);
  border: 1px solid rgba(11, 110, 122, 0.14);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
}
.hub-toc .h3,
.hub-toc h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}
.hub-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem 1rem;
}
.hub-toc__list a {
  display: inline-flex;
  gap: 0.35rem;
  align-items: baseline;
  min-height: 44px;
  align-items: center;
}
.hub-section .card-grid {
  align-items: stretch;
}
