:root {
  color-scheme: light;
  --paper: #f3f6fa;
  --white: #fff;
  --ink: #0f2340;
  --muted: #4f637c;
  --accent: #1d559d;
  --accent-strong: #133f79;
  --marker: #ef5a24;
  --marker-soft: #fff0e9;
  --line: #dbe4ef;
  --focus: #245fb3;
  --radius: 20px;
  --shadow-sm: 0 1px 2px #0f234010, 0 2px 6px #0f23400c;
  --shadow-md: 0 10px 28px #0f234018, 0 2px 6px #0f23400f;
  --gutter: clamp(.75rem, 3vw, 1.75rem);
  --left-gutter: max(var(--gutter), env(safe-area-inset-left, 0px));
  --right-gutter: max(var(--gutter), env(safe-area-inset-right, 0px));
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  min-width: 0;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p, figure { margin: 0; }
button { font: inherit; }

.container {
  width: 100%;
  max-width: calc(72rem + var(--left-gutter) + var(--right-gutter));
  margin-inline: auto;
  padding-inline: var(--left-gutter) var(--right-gutter);
}

.skip-link {
  position: absolute;
  top: max(.75rem, env(safe-area-inset-top, 0px));
  left: var(--left-gutter);
  z-index: 3;
  padding: .65rem 1rem;
  border-radius: .5rem;
  background: var(--white);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ── Header and footer ─────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid #dbe4ef99;
  background: #ffffffe6;
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  backdrop-filter: saturate(1.6) blur(12px);
}
.header-inner { display: flex; align-items: center; min-height: 68px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  text-decoration: none;
}
.brand img { flex: none; border-radius: 11px; box-shadow: 0 3px 10px #1d559d40; }
.brand-text { display: grid; gap: 1px; }
.brand-name { font-size: 1.12rem; font-weight: 780; letter-spacing: -.025em; line-height: 1.2; }
.brand-tagline { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .1em; line-height: 1.3; text-transform: uppercase; }

.site-footer {
  margin-top: 1rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--line);
  background: var(--white);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 1.5rem;
  align-items: center;
  min-height: 64px;
  padding-block: .9rem;
  color: var(--muted);
  font-size: .88rem;
}
.footer-brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); font-weight: 750; }
.footer-brand img { border-radius: 7px; }

.section-title {
  margin-bottom: .85rem;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  letter-spacing: -.02em;
  line-height: 1.25;
}

/* ── Homepage ──────────────────────────────────────────────────────── */

.home-shell { padding-block: clamp(1rem, 3vw, 2rem) clamp(1.5rem, 4vw, 2.5rem); }

.home-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  min-height: 300px;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at 85% 20%, #3f86d666, transparent 45%),
    radial-gradient(circle at 10% 110%, #ef5a2433, transparent 40%),
    linear-gradient(120deg, #0c2448 0%, #143b6f 55%, #1f5a9e 100%);
  color: var(--white);
  box-shadow: var(--shadow-md);
}
.home-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 40%;
  background-image: radial-gradient(circle, #a9cfff3d 1.15px, transparent 1.3px);
  background-size: 18px 18px;
  mask-image: linear-gradient(90deg, transparent, #000 50%);
  content: "";
}

.hero-copy { padding: clamp(1.35rem, 4.5vw, 3rem); }
.hero-eyebrow {
  display: inline-block;
  margin-bottom: .9rem;
  padding: .3rem .7rem;
  border: 1px solid #ffffff38;
  border-radius: 999px;
  background: #ffffff14;
  color: #d7e8ff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hero-copy h1 {
  max-width: 13ch;
  font-size: clamp(2rem, 5.6vw, 3.9rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.045em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.hero-copy p:not(.hero-eyebrow) {
  max-width: 27rem;
  margin-top: 1rem;
  color: #dbe9fb;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.6;
}

.hero-art {
  position: relative;
  width: min(100%, 380px);
  height: 250px;
  margin-inline: auto;
  display: grid;
  place-items: center;
}
.scan-frame { position: absolute; width: 292px; height: 196px; }
.scan-frame span {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 3px solid #ffb08f;
}
.scan-frame span:nth-child(1) { top: 0; left: 0; border-width: 3px 0 0 3px; border-top-left-radius: 14px; }
.scan-frame span:nth-child(2) { top: 0; right: 0; border-width: 3px 3px 0 0; border-top-right-radius: 14px; }
.scan-frame span:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: 14px; }
.scan-frame span:nth-child(4) { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: 14px; }
.scan-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 270px;
  height: 2px;
  margin-left: -135px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #ff8a5c, transparent);
  box-shadow: 0 0 12px #ff8a5c;
  animation: scan 3.2s ease-in-out infinite;
}
@keyframes scan {
  0%, 100% { transform: translateY(-80px); opacity: 0; }
  15%, 85% { opacity: 1; }
  50% { transform: translateY(80px); }
}
.hero-label {
  position: relative;
  width: 244px;
  padding: 15px 17px;
  border: 1px solid #fff;
  border-radius: 13px;
  background: linear-gradient(153deg, #fff, #e7f0fe);
  color: #193659;
  box-shadow: 0 18px 34px #06183a66, 0 1px 1px #fff inset;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  transform: rotate(-4deg);
}
.hero-label-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 750 .64rem/1.3 system-ui, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero-label-mark {
  width: 14px;
  height: 14px;
  border: 1px solid #7294bf;
  border-radius: 4px;
  background: #c4daf4;
}
.hero-label-lines { margin-block: 10px 9px; border-block: 1px solid #becfe3; }
.hero-label-lines div {
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: center;
  min-height: 26px;
  padding: 0 5px;
}
.hero-label-lines div + div { border-top: 1px solid #becfe3; }
.hero-label-lines span { font-size: .64rem; font-weight: 700; letter-spacing: .03em; }
.hero-label-lines b { color: #1d4e89; font-size: .86rem; letter-spacing: .055em; }
.barcode-art, .sample-barcode {
  width: 122px;
  max-width: 100%;
  height: 17px;
  background: repeating-linear-gradient(90deg, #1d3753 0 2px, transparent 2px 4px, #1d3753 4px 5px, transparent 5px 8px, #1d3753 8px 11px, transparent 11px 13px, #1d3753 13px 14px, transparent 14px 16px, #1d3753 16px 17px, transparent 17px 20px);
}

.appliance-section { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.appliance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.65rem, 2vw, 1.1rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.appliance-grid li { min-width: 0; }

.appliance-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .25rem .5rem;
  height: 100%;
  padding: .6rem .6rem 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.appliance-card img {
  grid-column: 1 / -1;
  height: auto;
  margin-left: -.5rem;
  width: calc(100% + .5rem);
  aspect-ratio: 48 / 34;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 45%, #ffffff 0, #eef3f9 70%);
}
.card-text { display: grid; min-width: 0; }
.card-name { font-weight: 760; font-size: clamp(1rem, 1.8vw, 1.15rem); line-height: 1.25; letter-spacing: -.01em; overflow-wrap: break-word; hyphens: auto; }
.card-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 50%;
  background: #eaf2fc;
  color: var(--accent);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.appliance-card:active { border-color: #85aedb; background: #f4f9ff; }
@media (hover: hover) {
  .appliance-card:hover { transform: translateY(-3px); border-color: #b5cde9; box-shadow: var(--shadow-md); }
  .appliance-card:hover .card-arrow { background: var(--accent); color: var(--white); transform: translateX(2px); }
}

.steps { margin-top: clamp(1.75rem, 4vw, 2.75rem); }
.steps-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.65rem, 2vw, 1.1rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps-list li {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.steps-list strong { display: block; line-height: 1.35; }
.steps-list p { margin-top: .2rem; color: var(--muted); font-size: .94rem; }
.step-number {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--marker);
  color: var(--white);
  font-weight: 800;
  box-shadow: 0 0 0 4px var(--marker-soft);
}

.home-tip {
  display: flex;
  gap: .65rem;
  align-items: baseline;
  margin-top: 1.25rem;
  padding: .9rem 1.05rem;
  border: 1px solid #cfe0f3;
  border-radius: 14px;
  color: var(--muted);
  background: #eaf3fd;
  font-size: .94rem;
}
.tip-icon {
  flex: 0 0 20px;
  align-self: baseline;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
}
.home-tip strong { color: var(--ink); }

/* ── Guide pages ───────────────────────────────────────────────────── */

.guide-shell { padding-block: clamp(.65rem, 2vw, 1.1rem) 2.5rem; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 44px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.back-link::before { content: "←"; transition: transform .2s ease; }
.back-link:hover::before { transform: translateX(-3px); }
.back-link:hover { text-decoration: underline; text-underline-offset: .23em; }

.guide-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: .45rem 0 1.6rem;
}
.guide-hero h1 {
  font-size: clamp(1.85rem, 5.2vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: -.045em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.guide-intro { margin-top: .65rem; max-width: 42rem; color: var(--muted); font-size: 1.08rem; }

.share-button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: .55rem 1rem;
  border: 1px solid #c4d6eb;
  border-radius: 999px;
  background: var(--white);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.share-button:hover { border-color: var(--accent); background: #f1f7ff; }
.share-button[hidden] { display: none; }
.hero-copy .share-button { margin-top: 1.35rem; border-color: transparent; }

.guide-types-nav {
  margin-bottom: 1.6rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.guide-types-nav h2 { font-size: 1.05rem; line-height: 1.3; }
.guide-types-nav ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr));
  gap: .5rem;
  margin: .7rem 0 0;
  padding: 0;
  list-style: none;
}
.guide-types-nav a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .1rem;
  height: 100%;
  min-height: 44px;
  padding: .55rem .9rem;
  border: 1px solid #c8d8ea;
  border-radius: 12px;
  background: #f5f9fe;
  line-height: 1.3;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.guide-types-nav .type-name { font-weight: 700; }
.guide-types-nav .type-hint { color: var(--muted); font-size: .9rem; }
.guide-types-nav a:hover { border-color: var(--accent); background: var(--accent); color: var(--white); }
.guide-types-nav a:hover .type-hint { color: inherit; }
.guide-types-tip { margin-top: .75rem; color: var(--muted); font-size: .95rem; }

.guide-type { margin-top: 2rem; scroll-margin-top: calc(84px + env(safe-area-inset-top, 0px)); }
.guide-type-hint { margin: -.45rem 0 .75rem; color: var(--muted); }
.guide-type > h2 { margin-bottom: .75rem; font-size: clamp(1.3rem, 3.2vw, 1.7rem); line-height: 1.2; letter-spacing: -.025em; }

.guide-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.guide-card:has(> .guide-figure) {
  background: linear-gradient(90deg, #eff4f9 calc(60% - 1px), var(--line) calc(60% - 1px) 60%, var(--white) 60%);
}
.guide-card--text { display: block; }
.guide-card--text .guide-content { max-width: 50rem; }

.guide-figure {
  position: sticky;
  top: 76px;
  align-self: start;
  display: grid;
  justify-items: center;
  gap: .6rem;
  padding: 1rem 1rem .9rem;
  background: transparent;
}
.guide-figure .illustration { width: 100%; max-width: 40rem; height: auto; max-height: 72vh; max-height: 72svh; }
.guide-figure figcaption { display: grid; gap: .1rem; color: var(--muted); text-align: center; font-size: .875rem; }
.figure-hint { display: none; color: #b8471c; font-weight: 650; }
.is-interactive .figure-hint { display: block; }

.marker { cursor: pointer; transition: opacity .25s ease; }
.marker-pin { transform-box: fill-box; transform-origin: center; transition: transform .25s ease; }
.marker-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-out infinite; }
.has-active .marker:not(.is-active) { opacity: .22; }
.marker.is-active .marker-pin { transform: scale(1.18); }
@keyframes pulse {
  0% { transform: scale(.55); opacity: .5; }
  80%, 100% { transform: scale(1.7); opacity: 0; }
}

.guide-content { padding: 1.6rem clamp(1rem, 3vw, 2rem); }
.guide-content h2, .sample-copy h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); letter-spacing: -.025em; line-height: 1.2; }
.locations { display: grid; gap: .35rem; margin: 1.1rem 0 0; padding: 0; list-style: none; }
.locations li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: start;
  gap: .75rem;
  margin-inline: -.6rem;
  padding: .6rem;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background .2s ease, border-color .2s ease;
}
.is-interactive .locations li { cursor: pointer; }
@media (hover: hover) {
  .is-interactive .locations li:hover { background: #f6f9fd; }
}
.locations li.is-active { border-color: #ffc9b3; background: var(--marker-soft); }
.location-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--marker);
  color: var(--white);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 0 4px var(--marker-soft);
  transition: transform .2s ease;
}
.locations li.is-active .location-number { transform: scale(1.1); box-shadow: 0 0 0 4px #ffd8c8; }
.locations strong, .other-locations strong { display: block; font-size: 1rem; line-height: 1.4; }
.locations p, .other-locations p { margin-top: .2rem; color: var(--muted); }
.locations:first-child, .other-locations:first-child { margin-top: 0; }
.other-locations-title {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.other-locations { display: grid; gap: .8rem; margin: .7rem 0 0; padding-inline-start: 1.25rem; }
.other-locations li::marker { color: var(--muted); }
.guide-note {
  margin: 1.15rem 0 0;
  padding: .75rem .95rem;
  border: 1px solid #f0d7c8;
  border-radius: 12px;
  background: #fff6ed;
  color: #614438;
  font-size: .95rem;
}

.sample-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  align-items: center;
  gap: 1.4rem;
  margin-top: 2rem;
  padding: 1.5rem clamp(1rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.sample-copy p { max-width: 35rem; margin-top: .5rem; color: var(--muted); }
.photo-tips { display: grid; gap: .35rem; margin: .9rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .95rem; }
.photo-tips li { display: flex; gap: .55rem; align-items: baseline; }
.photo-tips li::before { flex: none; color: #2f8a57; font-weight: 800; content: "✓"; }
.sample-label {
  width: min(100%, 360px);
  margin-inline: auto;
  padding: 1rem;
  border: 1px solid #b9cbe0;
  border-radius: 12px;
  background: linear-gradient(160deg, #f8fbff, #e8f1fb);
  color: var(--ink);
  box-shadow: 0 12px 24px #0f23401a;
  transform: rotate(-1.5deg);
}
.sample-eyebrow { display: block; font-size: .79rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sample-fields { margin: .55rem 0; border-block: 1px solid #bdcce0; }
.sample-fields div { display: grid; grid-template-columns: minmax(min-content, .62fr) minmax(0, 1fr); align-items: baseline; gap: .5rem; padding: .28rem .15rem; }
.sample-fields div + div { border-top: 1px solid #bdcce0; }
.sample-fields dt { font-size: .82rem; font-weight: 700; }
.sample-fields dd { margin: 0; color: #214e83; font: 750 1rem/1.4 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.sample-barcode { display: block; margin-top: .65rem; }

.guide-help { max-width: 42rem; margin-top: 1.25rem; color: var(--muted); }
.guide-end-link { margin-top: .9rem; }

/* ── Smaller screens ───────────────────────────────────────────────── */

@media (max-width: 52rem) {
  .steps-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 60rem) {
  .guide-card { grid-template-columns: minmax(0, 1fr); }
  .guide-card:has(> .guide-figure) { background: var(--white); }
  .guide-figure { position: static; padding: .65rem .5rem .75rem; border-right: 0; border-bottom: 1px solid var(--line); background: #eff4f9; }
  .guide-content { max-width: 46rem; }
}

@media (max-width: 46rem) {
  .sample-section { grid-template-columns: minmax(0, 1fr); }
  .guide-content { padding: clamp(.9rem, 4vw, 1.2rem); }
  .guide-hero { margin-bottom: 1.1rem; }
  .guide-intro { font-size: 1rem; }
  .sample-section { gap: .9rem; }
  .sample-label { margin-inline: 0; }
}

@media (max-width: 42rem) {
  .header-inner { min-height: 60px; }
  .home-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: 22px; }
  .home-hero::after { inset: 0 0 0 18%; }
  .hero-copy h1 { max-width: 24rem; font-size: clamp(2rem, 9vw, 3.2rem); }
  .hero-art { display: none; }
  .hero-copy p:not(.hero-eyebrow) { margin-top: .65rem; max-width: 23rem; line-height: 1.45; }
  .appliance-card { border-radius: 16px; padding: .45rem .45rem .8rem .8rem; }
  .appliance-card img { margin-left: -.35rem; width: calc(100% + .35rem); border-radius: 11px; }
  .card-arrow { width: 28px; height: 28px; padding: 5px; }
}

@media (max-width: 34rem) {
  .appliance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .marker-pin { scale: 1.5; }
}

@media (max-width: 22.5rem) {
  .appliance-grid { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .appliance-card { grid-template-columns: 5.75rem minmax(0, 1fr) auto; gap: .8rem; padding: .4rem .7rem .4rem .4rem; }
  .appliance-card img { grid-column: auto; width: 100%; margin-left: 0; }
}

@media (max-width: 17rem) {
  .sample-fields div { grid-template-columns: minmax(0, 1fr); gap: .05rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .marker-pulse, .scan-line { animation: none; }
  .marker-pulse { opacity: .18; }
  .scan-line { display: none; }
}

/* Keep text, images, and tap targets on either side of a reported hinge. */
/* Side-by-side screens: book-style foldables and dual-screen phones.
   The second query covers older browsers that report a fold with env(fold-*). */
@media (horizontal-viewport-segments: 2), (spanning: single-fold-vertical) {
  :root {
    --hinge-start: env(viewport-segment-right 0 0, env(fold-left, 50vw));
    --hinge-end: env(viewport-segment-left 1 0, calc(env(fold-left, 50vw) + env(fold-width, 0px)));
    --left-panel-width: max(0px, calc(var(--hinge-start) - var(--left-gutter) - var(--gutter)));
    --hinge-gap: calc(var(--hinge-end) - var(--hinge-start) + var(--gutter) * 2);
  }

  .container { max-width: none; }
  .home-hero, .appliance-grid, .guide-card, .sample-section, .footer-inner, .steps-list {
    grid-template-columns: minmax(0, var(--left-panel-width)) minmax(0, 1fr);
    column-gap: var(--hinge-gap);
  }
  .hero-copy h1, .guide-hero h1 { font-size: clamp(1.65rem, 4vw, 3.25rem); }
  .hero-art { display: grid; scale: .65; }
  .home-tip, .guide-hero, .guide-help, .guide-types-nav,
  .guide-type > h2, .guide-card--text { max-width: var(--left-panel-width); }
  .guide-figure { position: static; border: 0; }
  .guide-card:has(> .guide-figure) { background: var(--white); }
  .sample-section { padding-inline: 0; }
  .sample-copy { padding-inline: .85rem; }
  .sample-label { width: min(100% - 1.7rem, 22.5rem); margin-inline: auto; }
  .footer-inner { display: grid; }
}

/* Stacked screens: a foldable half-open like a laptop, or a dual-screen phone
   turned sideways. Keep nothing pinned across the fold, and keep each
   illustration within the top screen. */
@media (vertical-viewport-segments: 2), (spanning: single-fold-horizontal) {
  :root { --fold-top: env(viewport-segment-bottom 0 0, env(fold-top, 50vh)); }
  .site-header, .guide-figure { position: static; }
  .guide-figure .illustration { max-height: calc(var(--fold-top) - 7rem); }
  .home-hero { min-height: 0; }
}

/* Short screens, such as phones held sideways. */
@media (max-height: 34rem) and (orientation: landscape) {
  .site-header { position: static; }
  .guide-type { scroll-margin-top: 1rem; }
  .guide-figure { top: .5rem; }
  .guide-figure .illustration { max-height: 82svh; }
  .home-hero { min-height: 0; }
}

/* Touch screens: no grey flash on tap. */
.locations li, .marker, .appliance-card, .guide-types-nav a, .share-button, .back-link {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (forced-colors: active) {
  .home-hero, .location-number, .appliance-card, .step-number { border: 1px solid CanvasText; }
  .hero-art { display: none; }
  .locations li.is-active { outline: 2px solid Highlight; }
}

@media print {
  .site-header { position: static; }
  .share-button, .skip-link, .guide-end-link { display: none; }
  .guide-figure { position: static; }
  .guide-card { break-inside: avoid; }
}
