/* Bookeeper homepage. An architect's drawing set for a family house, inked in Bookeeper sage.
   Light: pale sage drafting paper, deep sage ink. Dark: deep sage sheet, pale sage linework.
   Amber, a shelf wood, is the only "found" mark. */

@font-face { font-family: 'Lora Variable'; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url('/fonts/lora-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Lora Variable'; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url('/fonts/lora-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Lora Variable'; font-style: italic; font-display: swap; font-weight: 400 700;
  src: url('/fonts/lora-latin-wght-italic.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Lora Variable'; font-style: italic; font-display: swap; font-weight: 400 700;
  src: url('/fonts/lora-latin-ext-wght-italic.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  color-scheme: light;
  --sheet: #eef5f0;
  --sheet-2: #e1ede6;
  --grid: rgb(48 85 69 / 0.07);
  --rule: #b4cfc1;
  --ink: #3b6953;
  --ink-strong: #223830;
  --text: #10201a;
  --muted: #305545;
  --wall: #284439;
  --hatch-bg: #d3e5da;
  --found: #c9954a;
  --found-ink: #6f4f22;
  --found-wash: rgb(201 149 74 / 0.16);
  --on-found: #10201a;
  --btn: #305545;
  --btn-hover: #223830;
  --btn-text: #f1f7f4;
  --code: #dcebe2;
  --shadow: 0 1px 2px rgb(16 32 26 / 0.08), 0 14px 32px -12px rgb(16 32 26 / 0.22);

  --serif: 'Lora Variable', 'Lora', Georgia, serif;
  --sans: 'Inter Variable', 'Inter', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --section: clamp(72px, 10vw, 136px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --sheet: #1e332a;
    --sheet-2: #182a22;
    --grid: rgb(146 186 166 / 0.06);
    --rule: #3f5d4f;
    --ink: #92baa6;
    --ink-strong: #dcebe2;
    --text: #f1f7f4;
    --muted: #bcd6c8;
    --wall: #bcd6c8;
    --hatch-bg: #2b4438;
    --found: #e0b062;
    --found-ink: #f0cd8f;
    --found-wash: rgb(224 176 98 / 0.14);
    --btn: #f1f7f4;
    --btn-hover: #dcebe2;
    --btn-text: #1a2c24;
    --code: #162720;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 18px 40px -14px rgb(0 0 0 / 0.55);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --sheet: #1e332a;
  --sheet-2: #182a22;
  --grid: rgb(146 186 166 / 0.06);
  --rule: #3f5d4f;
  --ink: #92baa6;
  --ink-strong: #dcebe2;
  --text: #f1f7f4;
  --muted: #bcd6c8;
  --wall: #bcd6c8;
  --hatch-bg: #2b4438;
  --found: #e0b062;
  --found-ink: #f0cd8f;
  --found-wash: rgb(224 176 98 / 0.14);
  --btn: #f1f7f4;
  --btn-hover: #dcebe2;
  --btn-text: #1a2c24;
  --code: #162720;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 18px 40px -14px rgb(0 0 0 / 0.55);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--ink) var(--sheet-2); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--sheet);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  font-feature-settings: 'cv11', 'ss01';
  caret-color: var(--found);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--found); color: var(--on-found); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--ink-strong); }
:focus-visible { outline: 2px solid var(--found); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; color: var(--ink-strong); text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 14px; background: var(--btn); color: var(--btn-text); border-radius: 6px; }
.skip:focus { top: 12px; }

/* The sheet: one long drawing set inside a ruled frame. Only the plan sits on drafting grid. */
.sheet {
  margin: clamp(0px, 1vw, 14px);
  border: 1px solid var(--rule);
}

.top {
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.25rem/1 var(--serif); color: var(--ink-strong); }
.brand img { border-radius: 6px; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a, .lang { font: 500 0.9375rem/1 var(--sans); text-decoration: none; color: var(--muted); padding: 8px 0; }
.nav a:hover, .lang:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--ink-strong); }
.tools { display: flex; align-items: center; gap: 16px; padding-left: 24px; border-left: 1px solid var(--rule); }
.theme {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--rule); border-radius: 6px; background: transparent; color: var(--ink-strong); cursor: pointer;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.theme:hover { border-color: var(--ink); background: var(--sheet-2); }
.theme .i-sun { display: none; }
.theme[data-mode='dark'] .i-sun { display: block; }
.theme[data-mode='dark'] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { .theme:not([data-mode]) .i-sun { display: block; } .theme:not([data-mode]) .i-moon { display: none; } }

/* First viewport: the title block (cartiglio) beside the plan. */
.hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) 1.22fr;
  min-height: calc(100svh - 72px - 2 * clamp(0px, 1vw, 14px));
}
.block {
  display: flex; flex-direction: column;
  padding: clamp(40px, 6vh, 72px) var(--gutter) 0;
  border-right: 1px solid var(--rule);
}
h1 { font-size: clamp(2.375rem, 3.9vw, 3.875rem); line-height: 1.04; letter-spacing: -0.018em; max-width: 14ch; }
.h1-q { display: block; }
h1 cite { font-style: italic; }
.h1-a { display: block; margin-top: 0.3em; font-size: 0.64em; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); }
.lede { margin-top: 24px; max-width: 34ch; font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); color: var(--muted); }
.get { margin-top: clamp(28px, 4.5vh, 44px); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.get-meta, .get-alt { flex-basis: 100%; font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.get-alt a { font-family: var(--mono); font-size: 0.8125rem; overflow-wrap: anywhere; }
.get-phone { flex-basis: 100%; display: grid; gap: 10px; padding: 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet-2); font-size: 0.9375rem; }
.get.is-phone .btn.primary { display: none; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 1.0625rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.btn.primary { padding: 16px 24px; border-radius: 6px; background: var(--btn); color: var(--btn-text); box-shadow: var(--shadow); }
.btn.primary:hover { background: var(--btn-hover); }
.btn.primary:active { transform: translateY(1px); }
.get[data-state='loading'] .btn.primary .btn-label { opacity: 0.9; }
.btn.quiet { padding: 8px 0; color: var(--ink-strong); font-weight: 500; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.3em; }
.btn.quiet:hover { text-decoration-color: var(--ink-strong); }

.cells {
  margin: auto calc(-1 * var(--gutter)) 0; padding: 0;
  display: flex; border-top: 1px solid var(--rule);
  font: 500 0.75rem/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.cells span { padding: 14px clamp(12px, 1.6vw, 24px); white-space: nowrap; border-right: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.cells span:first-child { padding-left: var(--gutter); }
.cells span:last-child { border-right: 0; margin-left: auto; padding-right: var(--gutter); }

.drawing {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
  margin: 0; padding: clamp(24px, 3.5vh, 40px) var(--gutter) 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ask { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-width: 0; }
.ask-label { font: italic 500 1.125rem/1.2 var(--serif); color: var(--ink-strong); }
.chips { display: contents; }
.chip { flex: none; }
html:not(.js) .chips { display: none; }
.chip {
  font: 500 0.875rem/1 var(--sans); color: var(--muted);
  padding: 9px 12px; min-height: 40px; border-radius: 4px; cursor: pointer;
  background: transparent; border: 1px solid var(--rule);
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease), color 150ms var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--text); }
.chip[aria-pressed='true'] { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--sheet); }

.plan-wrap {
  position: relative; aspect-ratio: 1000 / 790;
  width: min(100%, calc((100svh - 470px) * 1000 / 790));
  min-width: min(100%, 420px);
  margin-inline: auto;
  container-type: inline-size;
}
.plan { width: 100%; height: 100%; overflow: visible; }
.plan .room { fill: transparent; }
.plan .room.is-found { fill: var(--found-wash); }
.plan .fittings * { fill: none; stroke: var(--ink); stroke-width: 1.5; opacity: 0.55; }
.plan .wall-edge { fill: none; stroke: var(--wall); }
.plan .wall-fill { fill: none; stroke: url(#hatch); }
.plan .outer.wall-edge { stroke-width: 16; }
.plan .outer.wall-fill { stroke-width: 12; }
.plan .inner.wall-edge { stroke-width: 10; }
.plan .inner.wall-fill { stroke-width: 6; }
.hatch-bg { fill: var(--hatch-bg); }
.hatch-line { stroke: var(--wall); stroke-width: 1.6; }
.plan .gap { stroke: var(--sheet); stroke-width: 20; }
.plan .window { stroke: var(--wall); stroke-width: 4; stroke-dasharray: none; }
.plan .leaf { stroke: var(--wall); stroke-width: 2.5; }
.plan .swing { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 4; }
.plan .case rect { fill: var(--hatch-bg); stroke: var(--wall); stroke-width: 1.5; }
.plan .case.is-found rect { fill: var(--found); stroke: var(--found-ink); stroke-width: 3; }
.plan .room-label { font: 600 17px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; fill: var(--muted); text-anchor: middle; }
.plan .dim line { stroke: var(--ink); stroke-width: 1; }
.plan .dim text { font: 500 14px var(--sans); fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; }
.plan .route { fill: none; stroke: var(--found); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.plan .spot { fill: var(--found); stroke: var(--sheet); stroke-width: 3; }
.plan .leader { stroke: var(--ink-strong); stroke-width: 1.5; }
.plan .mark circle { fill: var(--sheet); stroke: var(--ink-strong); stroke-width: 2; }
.plan .mark text { font: 600 19px var(--serif); fill: var(--ink-strong); text-anchor: middle; }
.plan .entry path { fill: var(--ink); }
.plan .entry text { font: 600 15px var(--sans); letter-spacing: 0.1em; text-transform: uppercase; fill: var(--ink); }

.tag {
  position: absolute; left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  display: grid; gap: 2px; min-width: max-content;
  padding: 1.3cqw 1.9cqw 1.4cqw; border: 1.5px solid var(--ink-strong); border-radius: 4px;
  background: var(--sheet); box-shadow: var(--shadow); pointer-events: none;
}
.tag-room { font: 600 2cqw/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tag-case { font: 500 3cqw/1.25 var(--serif); color: var(--text); }
.tag-shelf { font: 600 2.5cqw/1.3 var(--sans); color: var(--found-ink); }
/* Below this plan width the tag's lettering would fall under ~10px: the h1 carries the answer there. */
@container (max-width: 519px) { .tag, .plan .leader { display: none; } }

.detail { display: flex; align-items: center; gap: 28px; padding-top: 14px; border-top: 1px solid var(--rule); }
.detail-name { flex: 1 1 auto; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; font-size: 0.875rem; line-height: 1.4; color: var(--muted); }
.detail-name > :not(.mark-chip) { grid-column: 2; }
.mark-chip { grid-row: span 3; display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--ink-strong); border-radius: 50%; font: 600 1rem/1 var(--serif); color: var(--ink-strong); }
.detail-shelf { font-weight: 600; color: var(--found-ink); }
.detail-name b { font: 500 1.125rem/1.25 var(--serif); color: var(--text); }
.detail-art { flex: none; min-width: 0; display: flex; }
.elevation { max-width: 100%; height: auto; }
.elevation .shelf-no { font: 600 17px var(--sans); fill: var(--muted); text-anchor: middle; }
.elevation .shelf-no.is-target { fill: var(--found-ink); font-size: 20px; }
.elevation .carcass { fill: var(--sheet-2); stroke: var(--wall); stroke-width: 3; }
.elevation .board { stroke: var(--wall); stroke-width: 3; }
.elevation .spine { fill: var(--cloth); stroke: rgb(0 0 0 / 0.18); stroke-width: 0.8; }
.elevation .spine.is-target { fill: var(--found); stroke: var(--found-ink); stroke-width: 2.5; }
.elevation .pointer { stroke: var(--found-ink); stroke-width: 3; stroke-linecap: round; }

/* The one authored moment: the walk from the door to the shelf, drawn once per answer. */
@media (prefers-reduced-motion: no-preference) {
  .is-drawing .route { stroke-dasharray: var(--len); animation: walk 1.3s var(--ease) both; }
  .is-drawing .spot { animation: arrive 0.5s 1.05s var(--ease) both; transform-box: fill-box; transform-origin: center; }
  .is-drawing .case.is-found rect { animation: light 0.5s 1.05s var(--ease) both; }
  .is-drawing .tag { animation: tag 0.45s 1.15s var(--ease) both; }
  .detail-art .is-target { animation: lift 0.5s 1.3s var(--ease) both; transform-box: fill-box; transform-origin: bottom; }
}
@keyframes walk { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes arrive { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes light { from { fill: var(--hatch-bg); } to { fill: var(--found); } }
@keyframes tag { from { opacity: 0; filter: blur(4px); translate: 0 6px; } to { opacity: 1; filter: blur(0); translate: 0 0; } }
@keyframes lift { from { transform: translateY(0); } 60% { transform: translateY(-8px); } to { transform: translateY(-4px); } }

/* Sections: further sheets of the same set. */
.app, .net, .dl { padding: var(--section) var(--gutter); border-top: 1px solid var(--rule); }
.sec-head { max-width: 62ch; display: grid; gap: 18px; margin-bottom: clamp(40px, 5vw, 64px); }
.sec-head h2 { font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1.08; letter-spacing: -0.014em; }
.sec-head p { font-size: 1.125rem; color: var(--muted); max-width: 56ch; }

.elevation-shot { position: relative; margin: 0 auto; max-width: 1000px; }
.shot img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--rule); box-shadow: var(--shadow); background: var(--sheet-2); }
.shot.is-phone img { border-radius: 22px; }
.notes { list-style: none; margin: 0; padding: 0; }
.note { position: absolute; left: -14px; top: var(--ty); width: calc(var(--tx) + 14px); border-top: 1px solid var(--ink-strong); }
.note::after { content: ''; position: absolute; right: -4px; top: -4.5px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-strong); box-shadow: 0 0 0 2px var(--sheet); }
.note span {
  position: absolute; right: calc(100% + 0px); top: 0; transform: translateY(-50%); width: 180px; text-align: right;
  font: 600 0.75rem/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-strong);
  padding: 6px 10px; background: var(--sheet); border: 1px solid var(--ink-strong); border-radius: 3px;
}
@media (max-width: 1439px) { .notes { display: none; } }

.figs { display: grid; grid-template-columns: 1fr 1fr 0.42fr; gap: clamp(20px, 3vw, 40px); align-items: end; max-width: 1120px; margin: clamp(40px, 5vw, 64px) auto 0; }
.figs figure { margin: 0; display: grid; gap: 12px; }
.figs figcaption { font-size: 0.9375rem; color: var(--muted); }
.demo-note { max-width: 1120px; margin: 28px auto 0; font-size: 0.875rem; color: var(--muted); }

.schedule { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; margin-top: var(--section); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { text-align: left; font: 500 clamp(1.625rem, 2.6vw, 2.25rem)/1.15 var(--serif); color: var(--ink-strong); text-wrap: balance; padding-bottom: 24px; }
thead th { font: 600 0.75rem/1.3 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 16px 10px 0; border-bottom: 1.5px solid var(--ink-strong); }
tbody th, tbody td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
tbody th { font: 600 1rem/1.4 var(--sans); color: var(--text); white-space: nowrap; }
tbody td { color: var(--muted); }
.where { white-space: nowrap; font-size: 0.875rem; }
.where[data-where='phone'], .where[data-where='both'] { color: var(--ink-strong); }

.quote { margin: 0; display: grid; gap: 14px; max-width: 38ch; }
.quote::before { content: ''; width: 48px; height: 1.5px; background: var(--ink); }
.quote blockquote { margin: 0; }
.quote p { font: italic 400 clamp(1.25rem, 1.8vw, 1.5rem)/1.4 var(--serif); color: var(--ink-strong); }
.quote figcaption { font-size: 0.875rem; color: var(--muted); }
.q-catalog { position: sticky; top: 32px; margin-top: 72px; }
.q-lend, .q-grow { margin: var(--section) 0 0 auto; max-width: 46ch; }

.modes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.mode { padding: clamp(24px, 3vw, 40px); display: grid; gap: 12px; align-content: start; }
.mode + .mode { border-left: 1px solid var(--rule); background: var(--sheet-2); }
.mode h3 { font-size: 1.5rem; }
.mode p { color: var(--muted); max-width: 48ch; }
.schema { margin-top: 16px; width: 100%; max-width: 640px; height: auto; }
.schema .s-node rect, .schema .s-node path, .schema .s-node circle { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.schema .s-node.is-core rect, .schema .s-node.is-core path { fill: var(--sheet); stroke: var(--ink-strong); stroke-width: 2; }
.schema-alone { max-width: 240px; }
.schema .s-node circle { fill: var(--ink); stroke: none; }
.schema text { font: 500 15px var(--sans); fill: var(--text); text-anchor: middle; }
.schema .s-wire path { fill: none; stroke: var(--ink-strong); stroke-width: 2; }
.schema .s-tag { font: 600 12px var(--sans); letter-spacing: 0.1em; fill: var(--muted); }
.schema .s-file path { stroke: var(--ink); stroke-width: 1; }

.steps-h { margin-top: var(--section); font-size: clamp(1.625rem, 2.6vw, 2.25rem); }
.steps { list-style: none; margin: 28px 0 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(16px, 3vw, 48px); row-gap: 8px;
  padding: 28px 0; border-top: 1px solid var(--rule); align-items: start;
}
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(step); grid-row: span 4; font: 500 2.75rem/1 var(--serif); color: var(--ink); }
.steps h4 { font-size: 1.375rem; grid-column: 2; }
.steps li > p:not(.or) { grid-column: 2; color: var(--muted); max-width: 46ch; }
.steps pre, .steps .or { grid-column: 3; margin: 0; }
.steps li > pre:first-of-type { grid-row: 1 / span 2; }
.steps .or { font-size: 0.8125rem; color: var(--muted); }
pre { padding: 12px 16px; border-radius: 6px; background: var(--code); border: 1px solid var(--rule); overflow-x: auto; }
code { font: 500 0.9375rem/1.5 var(--mono); color: var(--text); }
.guide { margin-top: 28px; }

.dl-tables { display: grid; gap: clamp(48px, 6vw, 80px); max-width: 980px; }
.files caption { font-size: 1.5rem; padding-bottom: 16px; }
.files .file { font: 500 0.8125rem/1.4 var(--mono); overflow-wrap: anywhere; }
.files th[scope='row'] { width: 34%; }
.files .num { text-align: right; white-space: nowrap; padding-right: 0; }
.files tbody th { white-space: normal; }
.files tr.is-yours { background: var(--found-wash); }
.files tr.is-yours th, .files tr.is-yours td { border-bottom-color: var(--found); }
.yours { display: block; margin-top: 4px; font: 600 0.6875rem/1.3 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--found-ink); }
.files .skeleton td { color: var(--muted); font-style: italic; }
.dl-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.6fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.dl-body > .dl-error, .dl-body > .dl-links { grid-column: 1 / -1; }
.notes-box { position: sticky; top: 32px; padding: clamp(20px, 2.4vw, 32px); border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet-2); }
.notes-box h3 { font-size: 1.5rem; }
.notes-lang { margin-top: 6px; font-size: 0.875rem; color: var(--muted); }
.changes h4 { margin: 22px 0 8px; font: 600 0.75rem/1.3 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-strong); }
.changes ul { margin: 0; padding-left: 1.1em; display: grid; gap: 10px; }
.changes li { font-size: 0.9375rem; line-height: 1.55; color: var(--muted); }
.changes li::marker { color: var(--ink); }
.changes strong { color: var(--text); font-weight: 600; }
.changes code { font-size: 0.8125rem; }
.dl-error { padding: 16px 20px; border: 1px solid var(--ink); border-radius: 6px; background: var(--sheet-2); max-width: 62ch; }
.dl-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 32px; font-size: 0.9375rem; }

.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px;
  padding: 28px var(--gutter); border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--muted);
}
.foot .brand { font-size: 1rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-left: auto; }
.foot-rev { font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .block { border-right: 0; padding-bottom: 32px; }
  h1 { max-width: 14ch; }
  .lede { max-width: 46ch; }
  .cells { margin-top: 36px; }
  .drawing { border-top: 1px solid var(--rule); }
  .plan-wrap { width: 100%; min-width: 0; }
  .schedule { grid-template-columns: 1fr; }
  .q-catalog { position: static; margin-top: 0; }
  .modes { grid-template-columns: 1fr; }
  .mode + .mode { border-left: 0; border-top: 1px solid var(--rule); }
  .dl-body { grid-template-columns: minmax(0, 1fr); }
  .notes-box { position: static; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .tools { margin-left: auto; padding-left: 0; border-left: 0; }
  .top { padding-block: 10px; }
  .figs { grid-template-columns: 1fr 1fr; }
  .figs .phone { grid-column: span 2; max-width: 260px; justify-self: center; }
  .steps li { grid-template-columns: 44px minmax(0, 1fr); }
  .steps li::before { font-size: 2rem; }
  .steps pre, .steps .or { grid-column: 2; }
  .steps li > pre:first-of-type { grid-row: auto; }
  .plan .room-label { font-size: 22px; letter-spacing: 0.04em; }
  .plan .dim text, .plan .entry text { font-size: 20px; }
  .tag, .plan .leader { display: none; }
  .chip { min-height: 44px; }
  .detail { flex-direction: column; align-items: flex-start; }
  .detail-name { flex: none; }
  .cells { flex-wrap: wrap; }
  .cells span { white-space: normal; }
  .cells span:first-child { flex: 1 1 100%; border-right: 0; border-bottom: 1px solid var(--rule); padding-right: var(--gutter); }
  .cells span:nth-child(2) { padding-left: var(--gutter); }
  tbody th { white-space: normal; }
  thead th:nth-child(3), tbody td.where { display: none; }
}
@media (max-width: 480px) {
  .figs { grid-template-columns: 1fr; }
  .figs .phone { grid-column: auto; }
  .files thead th.num, .files td.num { display: none; }
}
