:root {
  color-scheme: light dark;
  --bg: #f7faf9;
  --surface: #ffffff;
  --surface-alt: #eaf6f3;
  --text: #16201f;
  --muted: #5b6967;
  --line: #d5dfdd;
  --accent: #0f766e;
  --accent-strong: #095d57;
  --accent-soft: #d9efeb;
  --on-accent: #ffffff;
  --success: #146c43;
  --warning: #8a5200;
  --code: #e8efee;
  --radius: 12px;
  --page: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.075rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
code, kbd {
  border-radius: 5px;
  background: var(--code);
  padding: .12em .35em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 20;
  top: .75rem;
  left: .75rem;
  transform: translateY(-180%);
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  padding: .65rem .9rem;
}
.skip-link:focus { transform: none; }
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}
.header-inner, .footer-inner {
  width: min(calc(100% - 2rem), var(--page));
  margin-inline: auto;
}
.header-inner {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .62rem;
  color: var(--text);
  font-weight: 760;
  letter-spacing: -.025em;
  text-decoration: none;
}
.brand img { width: 38px; height: 24px; }
.site-nav { display: flex; gap: 1.1rem; font-size: .9rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 700; }

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(calc(100% - 2rem), var(--page));
  margin-inline: auto;
}
.article { min-width: 0; padding: 2.5rem 0 5.5rem; }
.article p, .article li { max-width: 68ch; }
.hero { max-width: 850px; margin-bottom: 1.7rem; }
.eyebrow {
  margin: 0 0 .65rem;
  color: var(--accent-strong);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.16; letter-spacing: -.027em; }
h1 { max-width: 850px; margin: 0; font-size: clamp(2.15rem, 5vw, 3.45rem); font-weight: 700; }
h2 { margin: 4rem 0 1.15rem; font-size: clamp(1.65rem, 4vw, 2.2rem); scroll-margin-top: 1.5rem; }
h3 { margin: 0 0 .65rem; font-size: 1.28rem; }
.dek { max-width: 68ch; margin: 1.2rem 0; color: var(--muted); font-size: 1.16rem; }
.meta { display: flex; flex-wrap: wrap; gap: .35rem 1rem; color: var(--muted); font-size: .86rem; }
.meta a { color: inherit; }
.author-note { margin: .55rem 0 0; color: var(--muted); font-size: .82rem; }

.proof { width: 100%; margin: 0 0 1.5rem; scroll-margin-top: 1.5rem; }
.proof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.proof-item { position: relative; margin: 0; }
.proof-item a { display: block; border-radius: var(--radius); }
.proof-item img, .shot img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.proof-item img {
  aspect-ratio: 740 / 482;
  height: auto;
  object-fit: cover;
  object-position: left center;
}
.proof-label {
  display: inline-block;
  border-radius: 999px;
  background: rgb(20 32 31 / 88%);
  color: #fff;
  margin-bottom: .5rem;
  padding: .3rem .7rem;
  font-size: .77rem;
  font-weight: 750;
  letter-spacing: .01em;
}
.proof-label-after { background: var(--accent); }
.proof-item figcaption { padding-inline: .15rem; }
.scope-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .65rem;
  margin: 1.25rem 0 0;
  scroll-margin-top: 1.5rem;
}
.scope-strip span {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 999px;
  background: var(--surface);
  padding: .35rem .72rem;
  color: var(--muted);
  font-size: .83rem;
}
.scope-strip strong { color: var(--text); }
.compat-note { margin: .65rem 0 0; color: var(--muted); font-size: .84rem; }
.browser-note {
  margin: .8rem 0 0;
  color: var(--muted);
  font-size: .88rem;
}
.browser-note p { margin: 0; }
.browser-note[hidden] { display: none; }

.copy-panel {
  max-width: 900px;
  margin: 2rem 0 4rem;
  border-radius: var(--radius);
  background: var(--surface-alt);
  padding: clamp(1rem, 4vw, 1.6rem);
}
.copy-panel h2 { margin: 0 0 1rem; font-size: 1.45rem; }
.field-row {
  display: grid;
  grid-template-columns: minmax(9rem, 12.5rem) minmax(0, 1fr);
  gap: .3rem 1rem;
  align-items: center;
  margin-top: .78rem;
}
.field-label { font-size: .84rem; font-weight: 750; }
.copy-control { display: flex; min-width: 0; gap: .55rem; }
.copy-value {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 3rem;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  overflow-wrap: normal;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: .72rem .8rem;
  font: 500 .88rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
button, .button-link {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  padding: .7rem .9rem;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}
.copy-control button { min-width: 7.5rem; flex: 0 0 7.5rem; }
button:hover, .button-link:hover { background: var(--accent-strong); color: var(--on-accent); }
.copy-status { grid-column: 2; min-height: 1.25em; margin: 0; color: var(--success); font-size: .78rem; }

.steps { max-width: 900px; margin-top: 1.8rem; }
.step { position: relative; margin: 0; padding: 0 0 4rem 4rem; }
.step p { overflow-wrap: anywhere; }
.step::before {
  content: "";
  position: absolute;
  top: 2.45rem;
  bottom: .55rem;
  left: 1.15rem;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-soft);
}
.step:last-child { padding-bottom: 0; }
.step:last-child::before { display: none; }
.step-number {
  position: absolute;
  top: -.25rem;
  left: 0;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}
.shot { max-width: 900px; margin: 1.25rem 0 .35rem; }
.shot a { display: block; border-radius: var(--radius); }
.shot a:hover img { border-color: var(--accent); }
.shot-secondary { margin-top: 1.6rem; }
figcaption { padding: .52rem .15rem 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.check-list { padding-left: 1.25rem; }
.check-list li { margin: .72rem 0; }
.proof-reference { color: var(--muted); font-size: .92rem; }

.iphone-guide { scroll-margin-top: 1.5rem; }
.device-panel {
  max-width: 900px;
  margin: 1.4rem 0 2rem;
  border-left: 3px solid var(--line);
  padding: .25rem 0 .25rem 1.25rem;
  scroll-margin-top: 1.5rem;
}
.device-panel.is-current-device {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--surface-alt), transparent 78%);
}
.device-panel h3 { margin-top: 0; }
.device-panel h4 { margin: 1.4rem 0 .35rem; font-size: 1.02rem; }
.phone-steps { margin: 1rem 0; padding-left: 1.45rem; }
.phone-steps li { margin: .8rem 0; padding-left: .25rem; }
.phone-shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  gap: 1.35rem 1rem;
  align-items: start;
  margin: 1.6rem 0 2rem;
}
.phone-shot {
  width: 100%;
  max-width: 360px;
  margin: 0;
}
.phone-shot img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

details {
  max-width: 900px;
  margin: .7rem 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
summary {
  position: relative;
  padding: .75rem 2.4rem .75rem 0;
  font-weight: 720;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  top: .62rem;
  right: .25rem;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
}
details[open] summary::after { content: "−"; }
details > :not(summary) { padding: 0 2.4rem .8rem .8rem; }
details > :last-child { margin-bottom: 0; }
.closing-notes { margin-top: 5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.closing-notes h2 { color: var(--text); font-size: 1.45rem; }
.closing-notes p { margin-block: .8rem; }
.test-record { font-size: .82rem; }
.toc { display: none; }

.simple-page { display: block; max-width: 760px; }
.simple-page h1 { font-size: clamp(2rem, 7vw, 3.35rem); }
.simple-page h2 { margin-top: 3.2rem; }
.not-found { min-height: 62vh; display: grid; align-content: center; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1rem; padding-block: 1.4rem; color: var(--muted); font-size: .84rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { color: inherit; }

@media (min-width: 1040px) {
  .page-shell { grid-template-columns: 185px minmax(0, 1fr); gap: 46px; }
  .toc { display: block; align-self: start; position: sticky; top: 1.25rem; padding: 2.75rem 0; }
  .toc p { margin: 0 0 .8rem; color: var(--muted); font-size: .71rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
  .toc ol { margin: 0; padding: 0; list-style: none; }
  .toc a { display: block; border-left: 2px solid var(--line); color: var(--muted); padding: .3rem 0 .3rem .72rem; font-size: .78rem; text-decoration: none; }
  .toc a:hover { border-color: var(--accent); color: var(--text); }
  .toc a[aria-current="true"] { border-color: var(--accent); color: var(--accent-strong); font-weight: 700; }
}
@media (max-width: 759px) {
  .proof-grid { grid-template-columns: 1fr; }
  .proof-item { max-width: 600px; }
  .phone-shot-grid { grid-template-columns: minmax(0, 360px); }
  .field-row { grid-template-columns: 1fr; gap: .3rem; }
  .copy-status { grid-column: 1; }
  .step { padding-left: 3.2rem; }
  .step::before { left: .98rem; }
  .step-number { width: 2rem; height: 2rem; }
}
@media (max-width: 560px) {
  body { font-size: 1.075rem; }
  .site-nav a:not(:first-child) { display: none; }
  .article { padding-top: 1.8rem; }
  h2 { margin-top: 3.4rem; }
  .copy-panel { margin-inline: -.35rem; }
  .copy-control { gap: .4rem; }
  .copy-control button { min-width: 6.7rem; flex-basis: 6.7rem; padding-inline: .65rem; }
  .step { padding-left: 2.9rem; }
  .step .shot { margin-left: -2.9rem; }
  .step h3, .step > p { margin-right: .1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1514;
    --surface: #151e1d;
    --surface-alt: #142522;
    --text: #eff6f4;
    --muted: #aab9b6;
    --line: #30413e;
    --accent: #58c9bd;
    --accent-strong: #83ded4;
    --accent-soft: #234b47;
    --on-accent: #082522;
    --success: #70d6a0;
    --warning: #efbd6d;
    --code: #22302e;
  }
  .proof-item img, .shot img { border-color: #45524f; }
  .proof-label-after { background: #0f766e; color: #fff; }
}
