:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --sep: rgba(60, 60, 67, 0.18);
  --accent: #0066cc;
  --code: rgba(0, 0, 0, 0.05);
  --green: #248a3d;  --green-bg: rgba(52, 199, 89, 0.14);
  --orange: #b25000; --orange-bg: rgba(255, 149, 0, 0.16);
  --grey: #6e6e73;   --grey-bg: rgba(120, 120, 128, 0.12);
  --blue: #0066cc;   --blue-bg: rgba(0, 122, 255, 0.10);
  --radius: 12px;
  --radius-lg: 22px;
  --tile: #ffffff;
  --glow: transparent;
  --banner-from: #3a3a3d; --banner-to: #1d1d1f; --banner-ink: #f5f5f7; --banner-ink-2: #c7c7cc;
  --banner-btn: #f5f5f7; --banner-btn-ink: #1d1d1f;
  --lift: rgba(0, 0, 0, 0.16);
  --pill: rgba(255, 255, 255, 0.72); --pill-edge: rgba(0, 0, 0, 0.08); --pill-hover: rgba(0, 0, 0, 0.05); --pill-active: rgba(0, 0, 0, 0.09);
  --pill-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); --sheet: rgba(255, 255, 255, 0.88);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --sep: rgba(84, 84, 88, 0.6);
    --accent: #2997ff;
    --code: rgba(255, 255, 255, 0.08);
    --green: #30d158;  --green-bg: rgba(48, 209, 88, 0.16);
    --orange: #ff9f0a; --orange-bg: rgba(255, 159, 10, 0.16);
    --grey: #a1a1a6;   --grey-bg: rgba(120, 120, 128, 0.24);
    --blue: #64b5ff;   --blue-bg: rgba(10, 132, 255, 0.18);
    --tile: rgba(118, 118, 128, 0.2);
    --glow: rgba(255, 255, 255, 0.07);
    --banner-from: #bbbbbd; --banner-to: #949597; --banner-ink: #1d1d1f; --banner-ink-2: #3a3a3c;
    --banner-btn: rgba(29, 29, 31, 0.88); --banner-btn-ink: #ffffff;
    --lift: rgba(0, 0, 0, 0.5);
    --pill: rgba(40, 40, 46, 0.74); --pill-edge: rgba(255, 255, 255, 0.1); --pill-hover: rgba(255, 255, 255, 0.08); --pill-active: rgba(255, 255, 255, 0.16);
    --pill-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); --sheet: rgba(34, 34, 38, 0.9);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg) radial-gradient(ellipse 70rem 28rem at 50% -6rem, var(--glow), transparent) no-repeat;
  color: var(--text);
  font: 106.25%/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-weight: 600; }
h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; margin: 2.5rem 0 0.75rem; }
h2 { font-size: 1.6rem; line-height: 1.15; letter-spacing: -0.02em; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.05rem; line-height: 1.25; margin: 0 0 0.5rem; }
p, li { max-width: 46rem; }
.lede { color: var(--text-2); font-size: 1.1rem; margin-top: 0; }
code { font: 0.88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code); padding: 0.1em 0.35em; border-radius: 5px; letter-spacing: 0; }
pre { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; overflow-x: auto; }
pre code { background: none; padding: 0; }

/* The bar is a floating pill; the menu and search open as glass sheets under it. Content scrolls beneath all three.
   Native popovers close on an outside click or Esc, no script. */
.bar { position: sticky; top: 0; z-index: 10; padding: 0.75rem 0.75rem 0; pointer-events: none; }
.bar nav {
  pointer-events: auto; display: flex; align-items: center; gap: 0.125rem; width: fit-content; margin: 0 auto; padding: 6px;
  border-radius: 999px; border: 1px solid var(--pill-edge); background: var(--pill); box-shadow: var(--pill-shadow);
  -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6);
}
.brand, .icon {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 0; border-radius: 999px;
  background: none; color: var(--text); cursor: pointer; transition: background 0.2s, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.icon { opacity: 0.85; }
.brand:hover, .icon:hover { background: var(--pill-hover); opacity: 1; }
.brand:active, .icon:active, #menu a:active, .tabbar a:active { transform: scale(0.94); transition-duration: 0.1s; }
.brand img, .icon svg { display: block; }
#menu { display: flex; gap: 0.125rem; list-style: none; margin: 0 0.125rem; padding: 0; position: static; inset: auto; border: 0; background: none; color: inherit; overflow: visible; }
#menu a {
  display: block; padding: 0.55rem 1rem; border-radius: 999px; color: var(--text); opacity: 0.85; font-size: 0.88rem; white-space: nowrap;
  transition: background 0.2s, opacity 0.2s, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#menu a:hover { background: var(--pill-hover); opacity: 1; text-decoration: none; }
#menu a[aria-current] { background: var(--pill-active); opacity: 1; font-weight: 500; }
.actions { display: flex; align-items: center; gap: 0.125rem; margin-left: 0.125rem; }
.page-label, .tabbar { display: none; }

#search, #more:popover-open {
  border: 1px solid var(--pill-edge); background: var(--sheet); color: var(--text); box-shadow: var(--pill-shadow);
  -webkit-backdrop-filter: blur(40px) saturate(1.6); backdrop-filter: blur(40px) saturate(1.6);
}
#search {
  position: fixed; inset: 4.6rem auto auto 50%; translate: -50% 0; width: min(42rem, calc(100vw - 1.5rem)); height: auto;
  max-height: calc(100vh - 6rem); overflow-y: auto; margin: 0; padding: 1.5rem 1.75rem 1.75rem; border-radius: 26px;
}
#search .panel { display: contents; }
#search .wrap { max-width: none; padding: 0; }
#q {
  width: 100%; border: 0; outline: 0; background: none; color: var(--text);
  font-family: inherit; font-size: 1.5rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; padding: 0;
}
#q::placeholder { color: var(--text-2); }
#q::-webkit-search-cancel-button { display: none; }
#search ul { list-style: none; margin: 0; padding: 0; }
#results { margin-top: 1.25rem; }
#results:empty { display: none; }
#results a, .quick a { display: block; padding: 0.35rem 0; color: var(--text); font-weight: 500; }
#results .none { color: var(--text-2); padding: 0.35rem 0; }
#results li { padding-bottom: 0.4rem; }
#results .snippet { display: block; color: var(--text-2); font-size: 0.85rem; font-weight: 400; line-height: 1.35; }
.quick { margin-top: 1.75rem; }
.quick p { margin: 0 0 0.5rem; color: var(--text-2); font-size: 0.75rem; }
#search:has(#results:not(:empty)) .quick { display: none; }
#search:popover-open { animation: sheet-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* Under 834px the pill goes: the section's name is a large title at the top left that scrolls away with the page, search and
   GitHub are two round glass buttons at the top right, and an icon-only tab bar sits at the bottom. More opens a sheet. */
@media (max-width: 833px) {
  .bar { position: fixed; inset: 0 0 auto 0; padding: 0; }
  .bar nav { display: contents; }
  .brand, #menu { display: none; }
  .actions { position: absolute; top: 0.65rem; right: 0.9rem; display: flex; gap: 0.6rem; margin: 0; padding: 0; }
  .icon {
    pointer-events: auto; width: 2.75rem; height: 2.75rem; flex: none; opacity: 1;
    border: 1px solid var(--pill-edge); background: var(--pill); box-shadow: var(--pill-shadow);
    -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6);
  }
  .icon svg { width: 1.1rem; height: 1.1rem; }
  .page-label {
    display: flex; align-items: center; position: absolute; top: 0.65rem; left: 1.25rem; right: 7.5rem; height: 2.75rem;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -0.035em;
  }
  main.wrap { padding-top: 3.9rem; }
  body { padding-bottom: 5.75rem; }

  .tabbar {
    display: flex; position: fixed; z-index: 10; left: 50%; translate: -50% 0; bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: min(24rem, calc(100% - 1.5rem)); gap: 0.125rem; padding: 6px;
    border-radius: 999px; border: 1px solid var(--pill-edge); background: var(--pill); box-shadow: var(--pill-shadow);
    -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6);
  }
  .tabbar a, .tabbar button {
    flex: 1; display: grid; place-items: center; height: 3rem; padding: 0; border: 0; border-radius: 999px;
    background: none; color: var(--text); opacity: 0.65; cursor: pointer;
    transition: background 0.2s, opacity 0.2s, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .tabbar [aria-current] { background: var(--pill-active); opacity: 1; }
  .tabbar svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar svg circle { fill: currentColor; stroke: none; }
  .tabbar img { display: block; }

  #more {
    position: fixed; inset: auto 0.75rem calc(max(0.75rem, env(safe-area-inset-bottom)) + 4.4rem) auto; width: min(17rem, calc(100% - 1.5rem)); height: auto;
    margin: 0; padding: 0.5rem; border-radius: 26px; transform-origin: bottom right;
  }
  #more ul { display: block; margin: 0; padding: 0; list-style: none; }
  #more a { display: block; padding: 0.7rem 1rem; border-radius: 16px; color: var(--text); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
  #more a:hover { background: var(--pill-hover); text-decoration: none; }
  #more a[aria-current] { background: var(--pill-active); }
  #more:popover-open { animation: sheet-in-up 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  #search { inset: 4.1rem 0.75rem auto; translate: none; width: auto; padding: 1.25rem 1.25rem 1.5rem; }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(-0.5rem) scale(0.98); } }
@keyframes sheet-in-up { from { opacity: 0; transform: translateY(0.5rem) scale(0.98); } }
@media (prefers-reduced-transparency: reduce) {
  .bar nav, .actions, .tabbar, #search, #more:popover-open { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .brand, .icon, #menu a, .tabbar a, .tabbar button { transition: none; }
  #search:popover-open, #more:popover-open { animation: none; }
}

/* Home: an inverted banner, a shelf of captures, tiles for status, cards that lift. */
.banner {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2rem; align-items: center;
  margin-top: 1.25rem; padding: 2.75rem 2.75rem 2.75rem 3rem; border-radius: var(--radius-lg);
  background: linear-gradient(var(--banner-from), var(--banner-to)); color: var(--banner-ink);
  box-shadow: 0 30px 70px var(--lift);
}
.banner h1 { margin: 0 0 0.75rem; font-size: clamp(2.6rem, 7vw, 3.6rem); font-weight: 700; line-height: 1; letter-spacing: -0.035em; }
.banner p { margin: 0 0 0.9rem; color: var(--banner-ink-2); font-size: 1.1rem; max-width: 30rem; }
.banner strong { color: var(--banner-ink); }
.banner a:not(.btn) { color: var(--banner-ink); text-decoration: underline; }
.banner .buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; height: 2.75rem; padding: 0 1.15rem; border-radius: 14px;
  background: var(--banner-btn); color: var(--banner-btn-ink); font-weight: 600; font-size: 0.95rem; letter-spacing: -0.005em;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s;
}
.btn.alt { background: color-mix(in srgb, var(--banner-ink) 14%, transparent); color: var(--banner-ink); }
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 24px var(--lift); }
.btn:active { transform: scale(0.97); transition-duration: 0.1s; }
.phone-ph {
  justify-self: center; display: grid; place-items: center; width: min(100%, 11rem); aspect-ratio: 9 / 19; padding: 1rem;
  border: 1.5px dashed color-mix(in srgb, var(--banner-ink) 40%, transparent); border-radius: 28px;
  color: var(--banner-ink-2); font-size: 0.8rem; text-align: center;
}

.home h2 { margin: 3rem 0 0.9rem; font-size: 1.3rem; letter-spacing: -0.015em; }
.home .lede { margin: -0.4rem 0 1rem; font-size: 1rem; }
.shelf { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -1.25rem; padding: 0 1.25rem 0.5rem; scroll-padding: 0 1.25rem; scrollbar-width: none; }
.shelf figure { flex: 0 0 10.5rem; margin: 0; scroll-snap-align: start; }
.shot {
  display: grid; place-items: center; aspect-ratio: 9 / 19.5; border-radius: var(--radius-lg);
  background: var(--tile); border: 1px dashed var(--sep); color: var(--text-2); font-size: 0.8rem;
}
.shelf figcaption { margin-top: 0.6rem; color: var(--text-2); font-size: 0.85rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.75rem; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; min-height: 6rem;
  padding: 1.1rem 1.2rem; border-radius: var(--radius-lg); background: var(--tile);
}
.tile strong { font-weight: 600; line-height: 1.25; }
.tile .pill { align-self: flex-start; }
.tiles.muted .tile { min-height: 0; padding: 0.9rem 1.2rem; color: var(--text-2); }
.tiles.muted strong { font-weight: 500; }
.not-yet { margin: 1.5rem 0 0.6rem; font-size: 1rem; color: var(--text-2); }
.tiles.detail { grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); }
.tile .note { margin-top: 0.3rem; line-height: 1.4; }
.tiles.three { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-top: 0.75rem; }
.app-card { display: flex; align-items: center; gap: 1.4rem; padding: 1.4rem 1.6rem; border-radius: var(--radius-lg); background: var(--tile); }
.app-card p { margin: 0 0 0.5rem; max-width: 36rem; }
.app-icon { flex: none; width: 6rem; height: 6rem; border-radius: 22.37%; box-shadow: 0 8px 24px var(--lift); }
@media (max-width: 560px) { .app-card { flex-direction: column; align-items: flex-start; } }
.count { margin-left: 0.35rem; color: var(--text-2); font-weight: 400; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.75rem; }
.spec { min-height: 0; gap: 0.25rem; justify-content: flex-start; }
.spec small { color: var(--text-2); font-size: 0.75rem; }
.banner.plain { grid-template-columns: 1fr; }
.phone-photo { justify-self: center; width: min(100%, 11rem); aspect-ratio: 9 / 19; overflow: hidden; border-radius: 28px; box-shadow: 0 18px 40px var(--lift); }
.phone-photo img, .shot.has-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot.has-photo { overflow: hidden; border: 0; }
.banner code { background: color-mix(in srgb, var(--banner-ink) 12%, transparent); color: var(--banner-ink); }
.device-notes h2 { font-size: 1.3rem; }
.device-notes { margin-top: 0.5rem; }



table { width: 100%; border-collapse: collapse; }
.doc > table { background: var(--tile); border-radius: var(--radius-lg); overflow: hidden; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--sep); }
tr:last-child > th, tr:last-child > td { border-bottom: 0; }
thead th { font-size: 0.8rem; color: var(--text-2); font-weight: 500; }
.note { display: block; color: var(--text-2); font-size: 0.85rem; margin-top: 0.15rem; }

.pill { display: inline-block; font-size: 0.78rem; font-weight: 500; padding: 0.15rem 0.6rem; border-radius: 999px; letter-spacing: 0; }
.pill.works { color: var(--green); background: var(--green-bg); }
.pill.partial { color: var(--orange); background: var(--orange-bg); }
.pill.planned { color: var(--grey); background: var(--grey-bg); }
.pill.later { color: var(--blue); background: var(--blue-bg); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.card {
  display: flex; flex-direction: column; gap: 0.3rem;
  background: var(--tile); border-radius: var(--radius-lg); padding: 1.15rem 1.3rem; color: var(--text);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s;
}
.card span { color: var(--text-2); font-size: 0.9rem; }
.card:hover, .card:focus-visible { text-decoration: none; transform: translateY(-3px) scale(1.015); box-shadow: 0 14px 34px var(--lift); }
.card:active { transform: scale(0.98); transition-duration: 0.1s; }

.doc { padding-bottom: 1rem; }
.doc h2 { font-size: 1.35rem; }

/* Footer, laid out like Apple's: breadcrumb, notes, link directory, copyright row. */
.foot { color: var(--text-2); font-size: 0.75rem; line-height: 1.33; letter-spacing: -0.005em; border-top: 1px solid var(--sep); margin-top: 4rem; padding: 0 0 1.5rem; }
.foot p { margin: 0 0 0.6rem; max-width: none; }
.foot a { color: var(--text-2); }
.foot a:hover { color: var(--text); }
.crumbs { display: flex; align-items: center; gap: 0.6rem; padding: 1rem 0; border-bottom: 1px solid var(--sep); }
.crumbs img { display: block; opacity: 0.85; }
.crumbs span:last-child { color: var(--text); }
.notes { padding: 1rem 0 0.4rem; border-bottom: 1px solid var(--sep); }
.directory { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.25rem; padding: 1.25rem 0 1.5rem; }
.directory summary { list-style: none; color: var(--text); font-weight: 600; margin-bottom: 0.6rem; }
.directory summary::-webkit-details-marker { display: none; }
.directory ul { list-style: none; margin: 0; padding: 0; }
.directory li { margin-bottom: 0.6rem; }
.legal { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; padding-top: 1rem; border-top: 1px solid var(--sep); }
.legal p { margin: 0; }
.legal ul { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.legal li + li { border-left: 1px solid var(--sep); margin-left: 0.6rem; padding-left: 0.6rem; }
@media (min-width: 834px) {
  .directory details::details-content { content-visibility: visible; display: block; }
  .directory summary { pointer-events: none; }
}
/* On narrow screens the directory folds into lists that open one at a time. */
@media (max-width: 833px) {
  .directory { grid-template-columns: 1fr; gap: 0; padding: 0.5rem 0 0; }
  .directory details { border-bottom: 1px solid var(--sep); }
  .directory summary { display: flex; justify-content: space-between; margin: 0; padding: 0.8rem 0; cursor: pointer; font-weight: 400; }
  .directory summary::after { content: ""; width: 0.4rem; height: 0.4rem; margin-right: 0.2rem; border: solid var(--text-2); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-0.15rem); transition: transform 200ms ease; }
  .directory details[open] summary::after { transform: rotate(-135deg) translateY(-0.1rem); }
  .directory ul { padding: 0 0 0.6rem 0.8rem; }
  .legal { flex-direction: column; border-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .directory summary::after { transition: none; }
}

@media (max-width: 640px) {
  .cols { grid-template-columns: 1fr; }
  th, td { padding: 0.65rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}

/* Docs: sidebar from the section tree, the page, "On this page". Wide screens show the sidebar and the page's
   contents beside the text; narrower ones fold both into lists that open on tap. */
body:has(.docs) .wrap { max-width: 1240px; }
.docs { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "toc" "main"; column-gap: 3rem; padding-top: 1rem; }
.docs-side { grid-area: side; font-size: 0.85rem; }
.docs-toc { grid-area: toc; font-size: 0.8rem; }
.docs-main { grid-area: main; min-width: 0; }
.docs-side > summary, .docs-toc > summary {
  display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none;
  padding: 0.8rem 0; border-bottom: 1px solid var(--sep); color: var(--text);
}
.docs-side > summary::-webkit-details-marker, .docs-toc > summary::-webkit-details-marker { display: none; }
.docs-side > summary::after, .docs-toc > summary::after {
  content: ""; width: 0.4rem; height: 0.4rem; margin-right: 0.2rem; border: solid var(--text-2); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-0.15rem); transition: transform 200ms ease;
}
.docs-side[open] > summary::after, .docs-toc[open] > summary::after { transform: rotate(-135deg) translateY(-0.1rem); }
.docs nav ul { list-style: none; margin: 0; padding: 0; }
.docs nav a { color: var(--text-2); }
.docs nav a:hover { color: var(--text); text-decoration: none; }
.docs nav a[aria-current] { color: var(--text); font-weight: 600; }
.docs-side nav { padding: 0.5rem 0 1rem; }
.docs-side .home { display: block; padding: 0.3rem 0; }
.docs-side h2 { margin: 1.1rem 0 0.2rem; font-size: 0.78rem; letter-spacing: 0; }
.docs-side h2 a { color: var(--text); }
.docs-side li a { display: block; padding: 0.28rem 0; line-height: 1.3; }
.docs-toc nav { padding: 0.5rem 0 1rem; }
.docs-toc nav ul ul { padding-left: 0.9rem; }
.docs-toc li a { display: block; padding: 0.22rem 0; line-height: 1.3; }
.docs-toc > summary { font-weight: 600; }

.eyebrow { margin: 1.75rem 0 -1.5rem; font-size: 0.8rem; font-weight: 600; }
.eyebrow a { color: var(--text-2); }
.docs-main > h1:first-child { margin-top: 2.5rem; }
.docs-main :is(h2, h3, h4) { scroll-margin-top: 5.5rem; }
.docs-main h3 { margin-top: 1.75rem; }
.docs-main p, .docs-main li { max-width: none; }
.docs-main img { max-width: 100%; height: auto; }

/* Tables scroll inside their own box instead of widening the page. */
.scroll { overflow-x: auto; background: var(--tile); border-radius: var(--radius-lg); margin: 1.25rem 0; }
.scroll table { font-size: 0.88rem; }
.scroll th, .scroll td { padding: 0.65rem 1rem; }
.scroll table:has(th:nth-child(4)) { min-width: 46rem; }
.scroll table:has(th:nth-child(6)) { min-width: 62rem; }
.scroll th, .scroll td { min-width: 9rem; }
.scroll th:first-child, .scroll td:first-child { min-width: 0; }

/* Code: Zola's highlighting; the colours follow light-dark(), the box follows the page. */
pre.giallo { background-color: var(--tile) !important; border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin: 1.25rem 0; overflow-x: auto; font-size: 0.85rem; line-height: 1.5; }
pre.giallo code { display: block; width: max-content; min-width: 100%; }

/* Diagrams: an inline <svg class="diagram"> in a page (no blank lines inside it). Its shapes take these classes and the
   page's colours, so it follows light and dark: .box, .accent (shapes), .line, .head (connectors, arrowheads), .muted (text). */
svg.diagram { display: block; max-width: 100%; height: auto; margin: 1.5rem 0; }
.diagram text { fill: var(--text); font: 13px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0; }
.diagram .muted { fill: var(--text-2); }
.diagram .box { fill: var(--tile); stroke: var(--sep); stroke-width: 1; }
.diagram .accent { fill: var(--blue-bg); stroke: var(--accent); stroke-width: 1; }
.diagram .line { fill: none; stroke: var(--text-2); stroke-width: 1.5; }
.diagram .head { fill: var(--text-2); stroke: none; }

.docs-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--sep); font-size: 0.8rem; color: var(--text-2); }
.docs-foot p { margin: 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.pager a { display: block; padding: 0.9rem 1.1rem; background: var(--tile); border-radius: var(--radius-lg); color: var(--text); font-weight: 500; transition: transform 100ms ease-out; }
.pager a:hover { text-decoration: none; }
.pager a:active { transform: scale(0.98); }
.pager span { display: block; color: var(--text-2); font-size: 0.75rem; font-weight: 400; }
.pager .next { grid-column: 2; text-align: right; }

@media (min-width: 834px) {
  .docs { grid-template-columns: 14rem minmax(0, 1fr); grid-template-areas: "side toc" "side main"; }
  .docs-side { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow-y: auto; }
  .docs-side::details-content { content-visibility: visible; display: block; }
  .docs-side > summary { display: none; }
  .docs-side nav { padding-top: 0; }
  .docs-toc { margin-bottom: 0.5rem; }
}
@media (min-width: 1100px) {
  .docs { grid-template-columns: 14rem minmax(0, 1fr) 12.5rem; grid-template-areas: "side main toc"; }
  .docs-toc { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow-y: auto; margin: 2.5rem 0 0; }
  .docs-toc::details-content { content-visibility: visible; display: block; }
  .docs-toc > summary { display: block; padding: 0 0 0.4rem; border: 0; font-size: 0.78rem; }
  .docs-toc > summary::after { display: none; }
  .docs-toc nav { padding-top: 0; }
}
@media (max-width: 640px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }
@media (prefers-reduced-motion: reduce) {
  .docs-side > summary::after, .docs-toc > summary::after, .pager a { transition: none; }
}

@media (max-width: 760px) {
  .banner { grid-template-columns: 1fr; padding: 2rem 1.5rem; }
  .phone-ph { width: 8rem; }
}
/* Pages rise in, a little, one after the other. */
@media (prefers-reduced-motion: no-preference) {
  main > :not(.docs), .docs-main { animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  main > :nth-child(2) { animation-delay: 60ms; }
  main > :nth-child(3) { animation-delay: 120ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(0.6rem); } }
@media (prefers-reduced-motion: reduce) {
  .card, .btn { transition: none; }
  .card:hover, .card:focus-visible, .btn:hover { transform: none; }
}

/* Pages: callouts, note cards, FAQ tiles, the 404. */
.callout, .note-card { border-radius: var(--radius-lg); margin: 1.25rem 0; }
.callout { background: var(--orange-bg); padding: 1rem 1.3rem; }
.callout > :first-child, .note-card > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.note-card { background: var(--tile); padding: 0.25rem 1.5rem 1.25rem; }
.note-card.warn { background: var(--orange-bg); }
.note-card h2 { margin: 1rem 0 0.6rem; font-size: 1.2rem; }
.doc details { background: var(--tile); border-radius: var(--radius-lg); margin: 0.75rem 0; padding: 0 1.3rem; }
.doc summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.05rem 0; cursor: pointer; list-style: none; font-weight: 600; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after {
  content: ""; flex: none; width: 0.4rem; height: 0.4rem; border: solid var(--text-2); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-0.15rem); transition: transform 200ms ease;
}
.doc details[open] summary::after { transform: rotate(-135deg) translateY(-0.1rem); }
.doc details > :last-child { margin-bottom: 1.1rem; }
.card .pill { font-size: 0.78rem; }
.card .counts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.35rem 0; }
.device-cards { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.notfound { padding: 4rem 0 2rem; text-align: center; --banner-btn: var(--text); --banner-btn-ink: var(--bg); --banner-ink: var(--text); }
.notfound .code { margin: 0; font-size: 5rem; font-weight: 700; line-height: 1; letter-spacing: -0.04em; color: var(--text-2); }
.notfound h1 { margin-top: 0.5rem; }
.notfound p { margin-inline: auto; }
.notfound .buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { .doc summary::after { transition: none; } }
