/* physicaleurope: one stylesheet for the static pages, the app views and the queue pages.
   Light and lean: white ground, hairlines instead of boxes, one accent, one radius scale. */

:root {
  --bg: #FFFFFF;
  --subtle: #F7F7F5;
  --surface: #FFFFFF;
  --ink: #16191E;
  --ink-2: #3D424A;
  --muted: #676D76;
  --line: #EAEAE6;
  --line-strong: #D5D6D1;
  --accent: #1F44B0;
  --accent-dark: #16348C;
  --accent-soft: #F0F3FC;
  --accent-line: #C9D4F2;
  --green: #1B6B3A;
  --green-dot: #1B8A4B;
  --green-soft: #EDF7F1;
  --red: #B3261E;
  --red-soft: #FDF2F1;
  --amber: #8A5A00;
  --amber-soft: #FFF7E3;
  --r: 8px;
  --r-sm: 6px;
  --shadow: 0 8px 24px rgba(22, 25, 30, .08), 0 0 0 1px rgba(22, 25, 30, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Kept for the queue pages and older markup. */
  --ground: var(--subtle);
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.1; letter-spacing: -.025em; font-weight: 600; }
h2 { font-size: 20px; line-height: 1.3; letter-spacing: -.01em; font-weight: 600; }
h3 { font-size: 16px; line-height: 1.35; font-weight: 600; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--bg); padding: 8px 12px; border-radius: var(--r-sm); box-shadow: var(--shadow); z-index: 1000; }

/* Layout */
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
@media (max-width: 640px) { .wrap { padding-left: 16px; padding-right: 16px; } }
.main { padding-top: 40px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 28px; min-height: 60vh; }
.main:focus { outline: none; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 48px; }
.stack-xl { display: flex; flex-direction: column; gap: clamp(64px, 9vw, 96px); }
.subnav + .lp-hero { margin-top: clamp(-56px, -5vw, -32px); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cols { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.col-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.col-side { flex: 1 1 280px; display: flex; flex-direction: column; gap: 20px; }
.narrow { max-width: 680px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.grid-fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }

/* Text */
.lead { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 680px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.note { font-size: 14px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* One label style everywhere: small, quiet, uppercase. The accent variant opens sections. */
.label, .fact dt, .flow-who, .mock-cap, .plan-head, .request-draft h3 { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow, .section-label, .type { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.type { letter-spacing: 0; text-transform: none; font-size: 13px; }
.tag { align-self: flex-start; display: inline-block; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
code { font-family: var(--mono); font-size: .92em; }
pre { margin: 0; padding: 16px; background: var(--subtle); color: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); font-family: var(--mono); font-size: 13px; line-height: 1.55; overflow-x: auto; max-height: 640px; }
ul.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* Header and footer */
.site-header { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-size: 18px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand span { color: var(--accent); }
.header-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.main-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 14px; }
.main-nav a:hover { color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--ink); font-weight: 500; box-shadow: inset 0 -1.5px 0 var(--ink); }
.login-link { display: inline-flex; align-items: center; min-height: 44px; margin-right: -12px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.login-link:hover { color: var(--accent); }
.login-link[aria-current="page"] { box-shadow: inset 0 -1.5px 0 var(--ink); }
@media (max-width: 640px) {
  .header-nav { display: contents; }
  .header-nav .btn-sm, .login-link { order: 1; }
  .login-link { margin-left: auto; margin-right: 16px; }
  .main-nav { order: 2; flex-basis: 100%; gap: 0 18px; }
  .header-row { row-gap: 0; }
}
.site-footer { border-top: 1px solid var(--line); background: var(--bg); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 28px; padding-bottom: 28px; font-size: 13px; color: var(--muted); }
.footer-row a:not(.btn) { color: var(--muted); }
.footer-row a:not(.btn):hover { color: var(--ink); }
.footer-row nav { gap: 4px 18px; }
nav[aria-label="Breadcrumb"] { gap: 6px; font-size: 13px; }
nav[aria-label="Breadcrumb"] a { color: var(--muted); text-decoration: none; }
nav[aria-label="Breadcrumb"] a:hover { color: var(--ink); }

/* Navigation inside a page */
.subnav { display: flex; flex-wrap: wrap; gap: 0 24px; border-bottom: 1px solid var(--line); }
.subnav a { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: -1px; border-bottom: 1.5px solid transparent; color: var(--muted); text-decoration: none; font-size: 14px; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 500; }
.jump { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; }
.jump a { color: var(--muted); text-decoration: none; }
.jump a:hover { color: var(--accent); }

/* Buttons and chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s, background-color .15s; }
.btn:hover { color: var(--ink); border-color: var(--ink-2); }
.btn-primary, .btn-light { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.btn-primary:hover, .btn-light:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #FFFFFF; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 13px; cursor: pointer; text-align: left; transition: border-color .15s; }
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip-dark { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

/* Containers: an outline, never a fill. Soft accent panels carry calls to action. */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.card p { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.card h2 { font-size: 17px; }
/* Inside a two-column page, cards open with a rule instead of a box. */
.cols .card { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 20px 0 0; }
.cols .card.dark, .cols .banner { border-top: 0; }
.dark { background: var(--accent-soft); color: var(--ink); border: 0; }
.dark .label, .dark .note { color: var(--muted); }
.banner { border-radius: var(--r); padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.banner span { flex: 1 1 320px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.empty { padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--r); display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 15px; color: var(--ink-2); }
.empty span { flex: 1 1 320px; }
.quote { padding: 16px; background: var(--subtle); border-color: transparent; gap: 4px; }
.gap { min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); color: var(--ink-2); font-size: 14px; }
.total { flex: 1 1 280px; border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.total-value { font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; }
.request { font-size: 19px; line-height: 1.5; color: var(--ink); }
blockquote.request { margin: 0; padding-left: 18px; border-left: 2px solid var(--accent); }

/* Search prompt */
.prompt { background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, box-shadow .15s; }
.prompt:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prompt textarea { border: 0; outline: 0; resize: vertical; width: 100%; min-height: 84px; font-size: 17px; line-height: 1.5; background: transparent; }
.prompt-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.prompt-lg { padding: 20px; }
.prompt-lg textarea { font-size: 19px; min-height: 120px; }

/* Supplier list and supplier page */
.result { display: flex; flex-wrap: wrap; gap: 16px 32px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; transition: border-color .15s, background-color .15s; }
.result:hover { border-color: var(--line-strong); background: var(--subtle); color: var(--ink); }
.result-main { flex: 3 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.result-main p { font-size: 15px; color: var(--ink-2); }
.result-side { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.result-name { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.result-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.kv { display: flex; flex-direction: column; gap: 1px; font-size: 14px; overflow-wrap: anywhere; }
.offer { display: flex; flex-wrap: wrap; gap: 4px 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.offer:last-child { border-bottom: 0; padding-bottom: 0; }
.offer-name { flex: 2 1 200px; font-weight: 600; font-size: 15px; color: var(--ink); }
.offer span { flex: 1 1 150px; }
.offer .offer-notes { flex: 1 1 100%; color: var(--muted); }
.sources { display: flex; flex-direction: column; gap: 6px; font-size: 14px; overflow-wrap: anywhere; }
.tile { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; min-height: 88px; transition: border-color .15s, background-color .15s; }
a.tile:hover { border-color: var(--line-strong); background: var(--subtle); color: var(--ink); }
.tile strong { font-size: 15px; font-weight: 600; line-height: 1.35; }
.tile p { font-size: 14px; color: var(--ink-2); }
.step-n { font-size: 24px; font-weight: 600; color: var(--accent); }
.hero-img, .ref-img, .tile-img { display: block; width: 100%; height: auto; border-radius: var(--r-sm); border: 1px solid var(--line); }
.tile-img { margin-bottom: 8px; }

/* Status badges: soft tints, never solid blocks. */
.status { align-self: flex-start; display: inline-block; padding: 2px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; transition: background-color .6s ease, color .6s ease, border-color .6s ease; }
.status-yes { background: var(--accent-soft); color: var(--accent); }
.status-no { background: var(--subtle); color: var(--ink-2); border-color: var(--line); }
.status-unknown { background: var(--subtle); color: var(--muted); }
.st-wait { color: var(--red); border-color: #EFC6C2; background: var(--red-soft); }
.st-quote { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.st-order { color: var(--ink); border-color: var(--line-strong); background: var(--bg); }
.st-work { color: var(--amber); border-color: #EEDBA8; background: var(--amber-soft); }
.st-move { color: #FFFFFF; border-color: var(--accent); background: var(--accent); }
.st-done { color: var(--green); border-color: #B9DDC5; background: var(--green-soft); }
.st-drop { color: var(--muted); }
.st-queue { color: var(--muted); border-color: var(--line); background: var(--subtle); }
.pill { display: inline-block; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); background: var(--bg); margin-right: 4px; }
.pill-quote { border-color: var(--accent-line); color: var(--accent); }
.pill-catalogue { border-color: #B9DDC5; color: var(--green); }
.pill-waiting { border-color: #EFC6C2; color: var(--red); background: var(--red-soft); }
.pill-best { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }

/* Forms */
form.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field input, .field select { height: 44px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; min-height: 44px; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline-form .field { flex: 1 1 260px; }
.form-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* Start a project and the login page: the first pages of the account area */
.start-head { max-width: 760px; margin-top: 24px; }
.start-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 48px; margin-top: 40px; align-items: start; }
.start-form textarea { font-size: 17px; min-height: 140px; }
@media (max-width: 860px) { .start-grid { grid-template-columns: 1fr; gap: 40px; } }
div.s-done { padding: 14px 16px; }
.s-btns-start { justify-content: flex-start; }
.s-you { margin: 0; font-size: 15px; color: var(--ink-2); }
.s-you .label { margin-right: 6px; }
.s-now-body .start-form .s-ask ul { margin-top: 8px; }

/* Supplier map */
#map { width: 100%; height: min(70vh, 640px); border: 1px solid var(--line); border-radius: var(--r); z-index: 0; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.legend .hq { background: var(--ink); }
.legend .prod { background: #5B7FE0; }
.place-list { display: flex; flex-direction: column; gap: 8px; }

/* Landing: overview */
.lp-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: clamp(0px, 2vw, 16px); }
.lp-hero-text { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.lp-hero-text h1 { font-size: clamp(38px, 6.4vw, 64px); line-height: 1.04; letter-spacing: -.035em; }
.lp-lead { font-size: clamp(17px, 2vw, 19px); line-height: 1.6; color: var(--muted); max-width: 560px; }
.lp-prompt { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; max-width: 560px; transition: border-color .15s, box-shadow .15s; }
.lp-prompt:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lp-prompt input { flex: 1 1 220px; min-width: 0; min-height: 44px; padding: 0 10px; border: 0; outline: 0; font-size: 16px; color: var(--ink); background: transparent; }
.lp-note { font-size: 13px; color: var(--muted); }
.lp-hero-media { flex: 2 1 300px; min-width: 0; }
.lp-hero-img { display: block; width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); }
.lp-head { display: flex; flex-direction: column; gap: 6px; }
.lp-head h2 { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; letter-spacing: -.02em; }
.lp-gallery { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.lp-shot { flex: 0 0 220px; scroll-snap-align: start; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); text-decoration: none; transition: border-color .15s; }
.lp-shot:hover { border-color: var(--line-strong); color: var(--ink); }
.lp-shot-img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.lp-shot-text { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.lp-shot-text strong { font-size: 14px; font-weight: 600; line-height: 1.35; }
.lp-cta { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: clamp(40px, 6vw, 72px) 24px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); }
.lp-cta h2 { font-size: clamp(26px, 3.6vw, 36px); letter-spacing: -.025em; }
.lp-cta p { font-size: 17px; color: var(--muted); max-width: 520px; }

/* Landing: process steps with blueprint mock-ups */
.proc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 72px; }
.proc { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 56px; }
.proc-flip { flex-direction: row-reverse; }
.proc-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.proc-text h3 { margin: 0; font-size: clamp(21px, 2.6vw, 26px); line-height: 1.25; letter-spacing: -.015em; }
.proc-text p { font-size: 16px; line-height: 1.65; color: var(--ink-2); max-width: 520px; }
.proc-text .flow-n { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.flow-who-we { color: var(--accent); }
.proc-points { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: var(--ink-2); }
.proc-usp { margin: 4px 0 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent); font-size: 15px; line-height: 1.55; color: var(--ink); }
.proc-mock { flex: 1 1 380px; min-width: 0; }

.mock { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--r); background-color: #FAFBFD; background-image: linear-gradient(#EEF1F7 1px, transparent 1px), linear-gradient(90deg, #EEF1F7 1px, transparent 1px); background-size: 20px 20px; font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--ink-2); pointer-events: none; user-select: none; cursor: default; }
.mock-cap { margin-bottom: 14px; font-size: 10px; }
.mock-body { display: flex; flex-direction: column; gap: 10px; }
.mock-prompt { padding: 14px; border: 1px solid var(--ink-2); border-radius: var(--r-sm); background: rgba(255, 255, 255, .8); font-size: 13px; line-height: 1.55; color: var(--ink); }
.mock-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mock-ghost { padding: 5px 10px; border: 1px dashed #A7AEBD; border-radius: var(--r-sm); color: var(--muted); }
.mock-note { font-size: 11px; color: var(--muted); white-space: nowrap; }
.mock-split { display: flex; gap: 14px; align-items: center; }
.mock-img { flex: 0 0 42%; width: 42%; height: auto; border: 1px solid var(--accent-line); border-radius: var(--r-sm); }
.mock-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk { display: block; height: 6px; border-radius: 3px; background: #D5DBE8; }
.mock-qa { display: flex; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid #E2E7F2; }
.mock-qa b { color: var(--accent); font-weight: 600; }
.mock-arrow { color: var(--muted); }
.mock-line, .mock-track { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.mock-glyph { width: 14px; text-align: center; color: var(--accent); font-size: 14px; }
.mock-fill { flex: 1; min-width: 12px; border-bottom: 1px dotted var(--line-strong); transform: translateY(3px); }
.mock-legend { padding-top: 8px; border-top: 1px solid #E2E7F2; font-size: 11px; color: var(--muted); white-space: pre-wrap; }
.mock-fan { display: grid; grid-template-columns: minmax(0, 1.4fr) 28px auto auto; align-items: center; gap: 8px; padding: 3px 0; }
.mock-fan-item { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-fan-line { height: 0; border-bottom: 1px solid #A7AEBD; }
.mock-boxes { display: flex; gap: 4px; }
.mock-box { width: 14px; height: 14px; border: 1px solid #A7AEBD; border-radius: 3px; }
.mock-box-ok { border-color: var(--accent); background: repeating-linear-gradient(45deg, var(--accent-line) 0 3px, transparent 3px 6px); }
.mock-gantt { display: flex; flex-direction: column; gap: 6px; }
.mock-g-row { display: grid; grid-template-columns: 40% 1fr; align-items: center; gap: 8px; }
.mock-g-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-g-track { position: relative; height: 12px; border-left: 1px solid #A7AEBD; }
.mock-g-bar { position: absolute; top: 1px; bottom: 1px; border: 1px solid #A7AEBD; border-radius: 2px; }
.mock-g-crit { border-color: var(--accent); background: repeating-linear-gradient(45deg, var(--accent-line) 0 3px, transparent 3px 6px); }
.mock-sum { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; padding-top: 10px; border-top: 1px solid var(--ink-2); font-size: 14px; font-weight: 600; color: var(--ink); }
.mock-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1px solid #A7AEBD; }
.mock-dot-done { background: var(--accent); border-color: var(--accent); }
.mock-dot-run { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }

/* Start a project: what happens next */
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.flow-step { position: relative; display: flex; gap: 16px; padding-bottom: 24px; }
.flow-step:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 1px; background: var(--line-strong); }
.flow-n { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; background: var(--bg); border: 1px solid var(--line-strong); color: var(--ink-2); }
.flow-we .flow-n { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.flow-body { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; max-width: 640px; }
.flow-we .flow-who { color: var(--accent); }

/* Drawings and route tables */
.drawing { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r); background: #FFFFFF; }
.route-map { height: 420px; border: 1px solid var(--line); border-radius: var(--r); background: var(--subtle); position: relative; }
.route-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.route-table th, .route-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.route-table th { font-weight: 500; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .route-map { height: 320px; } .route-table { display: block; overflow-x: auto; } }
.shipments summary, .notes summary { cursor: pointer; font-size: 14px; color: var(--ink-2); }
.shipments .route-table { margin-top: 8px; }

/* Bill of materials: a ruled sheet, figures in monospace. */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.bom { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.45; min-width: 700px; }
.bom thead th { text-align: left; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; padding: 12px 14px; border-bottom: 1px solid var(--line-strong); }
.bom td, .bom tbody th { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; transition: background-color .8s ease; }
.bom tbody.line { border-bottom: 1px solid var(--line-strong); }
.bom tbody.line:last-of-type { border-bottom: 0; }
.bom .c-pos { font-family: var(--mono); font-weight: 600; width: 40px; border-right: 1px solid var(--line); }
.bom .c-part { min-width: 170px; }
.bom .c-part strong { display: block; font-size: 14px; font-weight: 600; }
.bom .c-part .muted { font-size: 12px; }
.bom .c-part > span, .bom .c-part > a, .bom .c-part > .alt-toggle { display: block; }
.bom .c-part > .alt-note { display: inline-block; }
.bom .c-part > a { font-size: 12px; }
.bom .c-est { color: var(--muted); border-right: 1px solid var(--line); }
.bom .c-sup { min-width: 180px; }
.bom .c-sup .small { display: block; }
.bom .c-eur, .bom .c-days { text-align: right; }
.bom thead th:nth-child(6), .bom thead th:nth-child(7) { text-align: right; }
.bom .c-gap { color: var(--muted); }
.bom .c-opt { width: 28px; font-family: var(--mono); font-weight: 600; color: var(--muted); text-align: center; }
.bom .r-best td:not(.c-est):not(.c-part) { background: var(--accent-soft); }
.bom .r-best .c-eur, .bom .r-best .c-sup a { font-weight: 600; }
.bom .r-waiting td, .bom .r-waiting a { color: var(--red); }
.bom tbody.line-waiting .c-pos { box-shadow: inset 3px 0 0 var(--red); color: var(--red); }
.bom tbody.line-moving .c-pos { box-shadow: inset 3px 0 0 var(--accent); color: var(--accent); }
.bom tbody.line-done td:not(.c-est), .bom tbody.line-done th { background: #F4FAF6; }
.bom tbody.line-done .c-pos { box-shadow: inset 3px 0 0 var(--green-dot); color: var(--green); }
.bom tbody.line-alt .c-opt { background: var(--subtle); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.bom tbody.line-alt tr:not(:last-child) td:not(.c-est):not(.c-part) { border-bottom-style: dashed; }
.bom tbody.line-group { border-top: 1px solid var(--ink-2); border-bottom: 1px solid var(--ink-2); }
.bom tbody.line-group .c-part strong { font-size: 15px; }
.bom tbody.line-member .c-pos, .bom tbody.line-member .c-part { padding-left: 24px; }
.bom tbody.line-member { font-size: 12px; }
.bom tbody[hidden] { display: none; }
.bom tr.r-chosen td:not(.c-est):not(.c-part) { background: #F7F9FE; }
.bom tr.r-chosen .c-sup a, .bom tr.r-chosen .c-eur { font-weight: 600; }
.bom tr.r-moving td:not(.c-est):not(.c-part) { background: #EAF0FD; }
.bom tr.r-dropped td:not(.c-est):not(.c-part) { color: var(--muted); text-decoration: line-through; animation: rowdrop 1.8s ease forwards; }
.bom tr.r-dropped .status { text-decoration: none; }
.bom tr.flash td:not(.c-est):not(.c-part) { animation: rowflash 2.2s ease-out; }
.bom .alt-note { display: inline-block; margin-top: 6px; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bom .t-good { color: var(--green); font-weight: 600; background: var(--green-soft); }
.bom .t-bad { color: var(--red); background: var(--red-soft); }
.bom .t-mid { color: var(--amber); background: var(--amber-soft); }
.bom tfoot td { background: var(--subtle); border-top: 1px solid var(--line-strong); font-weight: 600; padding: 12px 14px; }
.bom tfoot .num { text-align: right; }
.legend-line { margin-top: 16px; }
.legend-line .t-good { color: var(--green); font-weight: 600; }
.legend-line .t-bad { color: var(--red); font-weight: 600; }
.r-best-key { background: var(--accent-soft); padding: 0 4px; border-radius: 3px; }
.alt-toggle { margin-top: 6px; padding: 2px 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
@keyframes rowflash { 0% { background: #FFF1BF; } 100% { background: transparent; } }
@keyframes rowdrop { 0% { background: var(--red-soft); opacity: 1; } 100% { background: var(--red-soft); opacity: .35; } }
@media (max-width: 900px) {
  .bom:not(.live) { min-width: 560px; }
  .bom:not(.live) .c-est, .bom:not(.live) thead th:nth-child(3) { display: none; }
  .bom .c-part > a, .bom .c-part > span.muted { display: none; }
  .bom .c-part { min-width: 130px; }
}

/* Process view: the map fills one viewport, the live list floats on the left, one play button. */
.process-view { position: relative; height: clamp(520px, calc(100vh - 40px), 820px); border: 1px solid var(--line); border-radius: var(--r); background: #F4F4F1; overflow: hidden; }
.process-view[hidden] { display: none; }
.process .route-map { border: 0; border-radius: 0; height: 360px; }
@media (min-height: 620px) and (min-width: 560px) { .process .route-map { height: 300px; } }
@media (min-height: 620px) and (max-height: 820px) and (min-width: 560px) { .process .route-map { height: 220px; } }
.process .process-view .route-map { position: absolute; top: 0; left: 0; right: 0; bottom: 0; height: auto; border: 0; border-radius: 0; }
.process-view .process-track input[type=range] { flex: 0 0 auto; height: 22px; width: 100%; margin: 0; accent-color: #8FB0FF; min-height: 22px; }
/* Filter each tile, not the pane: a filtered pane is re-rendered on every frame of a zoom. */
.process-view .leaflet-tile-pane { opacity: .55; }
.process-view .leaflet-tile { filter: grayscale(1) brightness(1.06) contrast(.82); }
.process-view .leaflet-control-attribution { background: rgba(255, 255, 255, .6); font-size: 10px; }
.process-view .leaflet-control-zoom a { width: 26px; height: 26px; line-height: 26px; font-size: 15px; color: var(--ink-2); }
.process-view .leaflet-marker-icon.dot-wrap { display: grid; place-items: center; }
.process-view.is-clickable .leaflet-container, .process-view.is-clickable .live-panel { cursor: pointer; }
.process-view.is-clickable .leaflet-dragging .leaflet-container { cursor: grabbing; }

.live-panel { position: absolute; z-index: 800; top: 12px; left: 12px; width: min(500px, 50%); max-height: calc(100% - 24px); display: flex; flex-direction: column; overflow-y: auto; background: rgba(255, 255, 255, .98); border-radius: var(--r); box-shadow: var(--shadow); transition: max-height .6s ease; }
.live-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; background: #FFFFFF; color: var(--ink); border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; font-size: 13px; }
.live-title { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.live-title strong { font-size: 15px; font-weight: 600; }
.live-clock { font-size: 12px; color: var(--muted); }
.live-head .num { font-size: 12px; color: var(--green); white-space: nowrap; }
.live-panel table.live { min-width: 0; width: 100%; font-size: 12px; }
.bom.live thead th { position: sticky; top: 0; z-index: 1; padding: 6px 12px; font-size: 10px; background: #FFFFFF; border-bottom: 1px solid var(--line); }
.bom.live td, .bom.live tbody th { padding: 8px 12px; border-bottom-color: #F1F1EE; }
.bom.live tbody.line { border-bottom: 1px solid var(--line); }
.bom.live .c-pos { width: 30px; }
.bom.live .c-part, .bom.live .c-sup { min-width: 0; }
.bom.live .c-part strong { font-size: 13px; font-weight: 600; }
.bom.live .c-opt { width: 22px; }
.bom.live .status { font-size: 11px; padding: 1px 7px; }
.bom.live tbody.line-member .c-pos, .bom.live tbody.line-member .c-part { padding-left: 16px; }
.bom.live .alt-toggle { display: block; margin-top: 2px; font-size: 11px; }
.bom.live tbody.line-waiting .c-pos, .bom.live tbody.line-moving .c-pos, .bom.live tbody.line-done .c-pos { box-shadow: inset 3px 0 0 currentColor; }
.bom.live tr.r-chosen td:not(.c-est):not(.c-part), .bom.live tr.r-moving td:not(.c-est):not(.c-part) { background: transparent; }
.bom.live tbody.line-moving td, .bom.live tbody.line-moving th { background: #F3F6FE; }
.bom.live tbody.line-done td:not(.c-est), .bom.live tbody.line-done th { background: #F4FAF6; }

.play-btn { position: absolute; z-index: 800; left: 50%; bottom: 24px; width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transform: translateX(-50%); box-shadow: 0 6px 18px rgba(22, 25, 30, .22); transition: transform .2s ease, background-color .2s ease; }
.play-btn:hover { transform: translateX(-50%) scale(1.05); background: #000; }
.play-btn:focus-visible { outline: 3px solid #8FB0FF; outline-offset: 2px; }
.process-view.has-panel .play-btn { left: calc((12px + min(500px, 50%) + 100%) / 2); }
.play-icon { display: block; width: 0; height: 0; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #FFFFFF; margin-left: 4px; }
.play-btn[data-state="pause"] .play-icon { width: 16px; height: 18px; border: 0; margin: 0; background: linear-gradient(90deg, #FFFFFF 0 5px, transparent 5px 11px, #FFFFFF 11px 16px); }
.play-btn[data-state="replay"] .play-icon { width: 18px; height: 18px; margin: 0; border: 2.5px solid #FFFFFF; border-right-color: transparent; border-radius: 50%; box-sizing: border-box; }

.tracker { position: absolute; z-index: 700; top: 12px; right: 12px; min-width: 190px; padding: 10px 12px; background: rgba(255, 255, 255, .97); color: var(--ink); font-size: 13px; line-height: 1.45; border-radius: var(--r); box-shadow: var(--shadow); }
.tracker[hidden] { display: none; }
.tracker .label { color: var(--green); font-size: 10px; }
.tracker strong { display: block; font-size: 15px; font-weight: 600; }
.tracker-bar { margin-top: 6px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.tracker-bar span { display: block; height: 100%; background: var(--green-dot); transition: width .3s linear; }

/* Map markers: small, centred in their icon box, so they sit exactly on the lines. */
.route-dot, .opt-dot { box-sizing: border-box; border-radius: 50%; border: 2px solid #FFFFFF; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }
.route-dot { width: 12px; height: 12px; }
.route-dot.part { background: #5B7FE0; }
.route-dot.product { background: var(--ink); width: 16px; height: 16px; }
.route-dot.delivery { background: var(--green-dot); width: 18px; height: 18px; }
.route-dot.work { background: #E0A100; }
.opt-dot { width: 12px; height: 12px; }
.opt-dot.os-wait { background: #D93025; animation: optfade .7s ease-out; }
.opt-dot.os-quote { background: var(--accent); animation: optfade .7s ease-out; }
.opt-dot.os-chosen { background: var(--accent); box-shadow: 0 0 0 3px rgba(31, 68, 176, .3); }
.opt-dot.os-drop { background: #D93025; animation: optdrop 1.6s ease forwards; }
.track-dot { position: relative; width: 26px; height: 26px; }
.track-dot span { position: absolute; inset: 6px; border-radius: 50%; background: var(--green-dot); border: 2px solid #FFFFFF; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.track-dot::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(27, 138, 75, .22); animation: trackpulse 2.6s ease-out infinite; }
@keyframes optfade { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes optdrop { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(.2); opacity: 0; } }
@keyframes trackpulse { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }

/* Delivered: success box above the destination. */
.done-box { position: relative; display: flex; align-items: center; gap: 10px; width: 250px; height: 72px; box-sizing: border-box; padding: 10px 14px; background: #FFFFFF; border: 1.5px solid var(--green-dot); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .16); animation: donepop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.done-box::after { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -9px; border: 9px solid transparent; border-bottom: 0; border-top-color: var(--green-dot); }
.done-text { display: flex; flex-direction: column; line-height: 1.3; }
.done-text strong { font-size: 15px; color: var(--green); }
.done-text span { font-size: 13px; color: var(--ink-2); font-family: var(--mono); }
.done-check { flex: 0 0 40px; width: 40px; height: 40px; }
.done-check circle { fill: var(--green-dot); stroke: var(--green-dot); stroke-width: 2; stroke-dasharray: 145; stroke-dashoffset: 145; animation: donecircle .5s .15s ease-out forwards; fill-opacity: 0; }
.done-check path { fill: none; stroke: #FFFFFF; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: donetick .35s .6s ease-out forwards; }
.done-ring { position: absolute; left: 34px; top: 36px; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 3px solid #3DDC84; opacity: 0; animation: donering 1s .7s ease-out; }
.done-spark { position: absolute; left: 34px; top: 36px; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #3DDC84; opacity: 0; animation: donespark .8s .75s ease-out; }
.done-spark.s2 { background: #FFC94A; } .done-spark.s4 { background: #5B7FE0; } .done-spark.s6 { background: #FFC94A; }
.done-spark.s1 { --x: 0px; --y: -38px; } .done-spark.s2 { --x: 33px; --y: -19px; } .done-spark.s3 { --x: 33px; --y: 19px; }
.done-spark.s4 { --x: 0px; --y: 38px; } .done-spark.s5 { --x: -33px; --y: 19px; } .done-spark.s6 { --x: -33px; --y: -19px; }
@keyframes donepop { 0% { transform: translateY(16px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes donecircle { 0% { stroke-dashoffset: 145; fill-opacity: 0; } 70% { fill-opacity: 0; } 100% { stroke-dashoffset: 0; fill-opacity: 1; } }
@keyframes donetick { to { stroke-dashoffset: 0; } }
@keyframes donering { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes donespark { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) scale(.3); opacity: 0; } }

@media (max-width: 760px) {
  .process-view { height: auto; display: flex; flex-direction: column; overflow: visible; }
  .process .process-view .route-map { position: relative; order: 1; height: 300px; bottom: auto; }
  .bom.live.live-cmp .c-opt, .bom.live.live-cmp .c-days, .bom.live.live-cmp thead th:nth-child(3), .bom.live.live-cmp thead th:nth-child(6) { display: none; }
  .bom.live .c-eur { white-space: nowrap; }
  .live-panel { position: relative; order: 3; top: auto; left: auto; bottom: auto; width: auto; max-height: 420px; overflow-x: auto; box-shadow: none; border-top: 1px solid var(--line); border-radius: 0; }
  .play-btn, .process-view.has-panel .play-btn { left: 50%; top: 222px; bottom: auto; width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .opt-dot, .track-dot::before, .bom tr.flash td, .bom tr.r-dropped td { animation: none !important; }
  .done-box, .done-ring, .done-spark { animation: none; }
  .done-check circle { animation: none; stroke-dashoffset: 0; fill-opacity: 1; }
  .done-check path { animation: none; stroke-dashoffset: 0; }
}

/* Iteration story */
.it-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.it-kpi { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.it-kpi .total-value { font-size: 28px; color: var(--ink); }
.it-timeline { display: grid; grid-template-columns: max-content 1fr; gap: 10px 12px; align-items: center; padding: 8px 0; }
.it-row-label { color: var(--muted); font-size: 14px; }
.it-track { position: relative; height: 28px; background: repeating-linear-gradient(90deg, var(--subtle) 0 calc(100% / 17 - 1px), var(--line) 0 calc(100% / 17)); border-radius: 4px; }
.it-bar { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; }
.it-bar-old { background: var(--line-strong); color: var(--ink); }
.it-dot { position: absolute; top: 3px; width: calc(100% / 17 * 1.4); min-width: 26px; height: 22px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: #FFFFFF; border-radius: 4px; font-size: 12px; font-weight: 600; }
.it-axis { position: relative; height: 18px; }
.it-tick { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.it-tick:first-child { transform: none; }
.it-unit { position: absolute; right: 0; top: 16px; font-size: 11px; }
.it-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.it-card { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.it-card p { font-size: 14px; color: var(--ink-2); }
.it-head { display: flex; flex-direction: column; gap: 2px; }
.it-name { align-self: flex-start; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent); }
.it-learn { border-top: 1px dashed var(--line-strong); padding-top: 8px; }
.ab { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.ab li { display: flex; gap: 8px; align-items: baseline; padding: 4px 8px; border-radius: 4px; background: var(--subtle); }
.ab li strong { margin-left: auto; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--green); }
.ab-win { box-shadow: inset 2px 0 0 var(--green); }
.ab-lose { color: var(--muted); }
.ab-key { font-family: var(--mono); font-weight: 600; }
@media (max-width: 640px) { .it-timeline { grid-template-columns: 1fr; gap: 4px; } .it-timeline > span:empty { display: none; } }

/* Build page: hero with key facts, the process as the centrepiece, then request, drawing, plan.
   Every section opens with a rule, a label and its heading. */
.build-page { display: block; }
.build-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-bottom: 8px; }
.build-hero { display: flex; flex-direction: column; gap: 18px; margin-top: 40px; }
.build-hero h1 { max-width: 900px; }
.build-hero .lead { font-size: 18px; max-width: 640px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 28px 0 0; border-top: 1px solid var(--line); }
.fact { padding: 20px 24px 0 0; display: flex; flex-direction: column; gap: 6px; }
.fact + .fact { padding-left: 24px; border-left: 1px solid var(--line); }
.fact dd { margin: 0; font-size: clamp(19px, 2.2vw, 26px); font-weight: 600; letter-spacing: -.015em; line-height: 1.15; }
.build-section { margin-top: 128px; padding-top: 40px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.build-section[hidden] { display: none; }
.build-section.build-process { margin-top: 56px; padding-top: 0; border-top: 0; }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; max-width: 680px; }
.section-head p { font-size: 16px; line-height: 1.6; color: var(--muted); }
.build-section h2, .build-cta h2, .ex h2 { font-size: clamp(22px, 2.8vw, 28px); line-height: 1.2; letter-spacing: -.02em; }
.build-process .process-view { width: min(1360px, calc(100vw - 48px)); margin-left: calc((100% - min(1360px, calc(100vw - 48px))) / 2); height: clamp(560px, calc(100vh - 72px), 860px); border: 1px solid var(--line); border-radius: 12px; }
.build-process .live-panel { top: 16px; left: 16px; max-height: calc(100% - 32px); }
.process-caption { margin-top: 20px; max-width: 760px; }
.request-draft { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 80px; align-items: start; }
.request-draft .section-head { margin-bottom: 28px; }
.request-draft blockquote.request { margin: 0 0 48px; padding-left: 22px; font-size: clamp(19px, 2.2vw, 23px); line-height: 1.45; }
.request-draft h3 { margin-bottom: 10px; }
.request-draft p { font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.rd-figure { padding-top: 8px; }
.rd-figure img, .ex-figure img { display: block; width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); }
.build-section .drawing { max-width: 920px; }
.drawing-note { margin-top: 14px; max-width: 760px; }
.build-section .shipments { margin-top: 10px; }
.notes { margin-top: 28px; }
.notes p { margin-top: 8px; font-size: 14px; line-height: 1.65; color: var(--muted); max-width: 760px; }
.iterations .it-kpis { margin-bottom: 40px; }
.build-cta { margin-top: 128px; padding: 48px; border-radius: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.build-cta > div { flex: 1 1 420px; display: flex; flex-direction: column; gap: 8px; }
.build-cta p { color: var(--muted); font-size: 15px; line-height: 1.6; }
@media (max-width: 760px) {
  .build-top .jump { display: none; }
  .build-hero { margin-top: 24px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact { padding: 16px 12px 0 0; }
  .fact + .fact { padding-left: 12px; }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n+3) { margin-top: 16px; border-top: 1px solid var(--line); }
  .build-section { margin-top: 80px; padding-top: 28px; }
  .build-section.build-process { margin-top: 36px; }
  .build-process .process-view { width: auto; margin-left: 0; height: auto; border-radius: var(--r); }
  .request-draft { grid-template-columns: 1fr; gap: 36px; }
  .build-cta { margin-top: 80px; padding: 32px 22px; }
}

/* Examples: one block per build, the same parts as the top of a build page. */
.ex-list { display: flex; flex-direction: column; }
.ex { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 72px; align-items: center; padding: 72px 0; border-top: 1px solid var(--line); }
.ex-text { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ex h2 a { color: var(--ink); text-decoration: none; }
.ex h2 a:hover { color: var(--accent); }
.ex .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 8px; }
.ex .fact:nth-child(3) { padding-left: 0; border-left: 0; }
.ex .fact:nth-child(n+3) { margin-top: 16px; }
@media (max-width: 760px) { .ex { grid-template-columns: 1fr; gap: 28px; padding: 48px 0; } .ex-figure { order: -1; } }

/* Queue: internal pages served by scripts/serve.py, in the layout of a build page */
.q-board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 40px; align-items: start; }
.q-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-top: 12px; border-top: 1.5px solid var(--ink); }
.q-col h2 { display: flex; align-items: baseline; gap: 8px; font-size: 15px; line-height: 1.3; letter-spacing: 0; }
.q-col > p { min-height: 4.2em; }
.q-step-no { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--muted); }
.q-count { margin-left: auto; font-family: var(--mono); font-size: 13px; }
.q-card { min-height: 0; overflow-wrap: anywhere; }
.q-card strong { font-size: 14px; }
.q-card .pill { align-self: flex-start; }
.q-empty { padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.q-declined { margin-top: 12px; }
.q-minis { display: flex; flex-direction: column; gap: 4px; }
.q-minis .label { margin-top: 4px; }
.q-mini { display: block; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--ink-2); text-decoration: none; font-size: 12px; line-height: 1.3; }
.q-mini:hover { border-color: var(--line-strong); color: var(--ink); }
.q-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; list-style: none; margin: 4px 0 0; padding: 0; }
.q-step { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px 0 0; border-top: 2px solid var(--line); font-size: 13px; color: var(--muted); }
.q-done { border-color: var(--ink); color: var(--ink); }
.q-now { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.q-now .q-step-no { color: var(--accent); }
.q-closed { margin-top: 4px; }
.q-account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink-2); }
.q-avatar { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #FFFFFF; font-size: 12px; font-weight: 600; }
.q-account .pill { margin-left: auto; margin-right: 0; }
.request-draft:has(.q-account-card) { align-items: start; }
.q-account-card h3 { margin-bottom: 0; }
.q-kvs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.q-internal .section-label::after { content: " · internal"; }
.q-review { max-width: 680px; }
.q-review select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); font-size: 15px; }
.q-log { list-style: none; margin: 0; padding: 0; max-width: 760px; border-top: 1px solid var(--line); }
.q-log li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.q-log p { flex-basis: 100%; color: var(--ink-2); line-height: 1.55; white-space: pre-line; }
.p-history { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.p-history-head { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.p-history-head .muted { font-weight: 400; margin-left: 6px; }
.p-log { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; line-height: 1.4; color: var(--muted); }
.p-log td { padding: 5px 12px 5px 0; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: baseline; }
.p-log tr:last-child td { border-bottom: 0; }
.p-log-when { width: 96px; font-family: var(--mono); font-size: 11px; }
.p-log-what { width: 140px; color: var(--ink-2); font-weight: 500; }
.p-log-who { width: 90px; padding-right: 0; text-align: right; }
.p-log-who .pill { margin: 0; }
@media (max-width: 640px) { .p-log-when { width: 52px; } .p-log-time { display: none; } .p-log td.p-log-what, .p-log td.p-log-text { white-space: normal; } .p-log-what { width: 100px; } }
.q-log-when { font-family: var(--mono); font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) { .q-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } .q-col > p { min-height: 0; } }
@media (max-width: 640px) { .q-board, .q-kvs { grid-template-columns: 1fr; } .q-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .q-account .pill { margin-left: 0; } }

/* Project pages for the requester: overview with map and price, served by scripts/serve.py */
.p-map-wrap[hidden] { display: none; }
.p-map { height: 460px; }
@media (max-width: 640px) { .p-map { height: 340px; } }
.p-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.p-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
/* Requester dashboard: one collapsible card per project, closed by default. */
.p-projs { display: flex; flex-direction: column; gap: 16px; }
a.p-card { display: flex; flex-direction: column; padding: 20px 24px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.p-card:hover { border-color: var(--line-strong); box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
a.p-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.p-card-turn { box-shadow: inset 3px 0 0 var(--accent); }
a.p-card-turn:hover { box-shadow: inset 3px 0 0 var(--accent), 0 2px 10px rgba(0, 0, 0, .05); }
.p-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.p-card-id, .p-card-label { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.p-card-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.p-card-pills .pill { margin: 0; }
.p-card-name { margin-top: 6px; font-size: 19px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.p-card-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: center; gap: 16px; margin: 18px -24px 0; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--subtle); border-radius: 0 0 9px 9px; }
.p-card-fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.p-card-val { font-size: 14px; color: var(--ink); }
.p-card-open { font-size: 14px; font-weight: 500; color: var(--accent); white-space: nowrap; }
a.p-card:hover .p-card-open { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  a.p-card { padding: 16px 16px 0; }
  .p-card-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 14px -16px 0; padding: 14px 16px; }
  .p-card-open { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); }
}
.bom.p-plan .p-r, .bom.p-plan thead th:nth-child(n+5) { text-align: right; }
.bom.p-plan .c-src .small, .bom.p-plan .c-part > span { display: block; }
.bom.p-plan .c-src .small { margin-top: 3px; }
.p-next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, .8fr); gap: 16px 24px; margin-top: 8px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; }
.p-next p { margin-top: 4px; font-size: 15px; line-height: 1.45; }
.p-next p.small { font-size: 13px; }
.p-budget { display: flex; flex-direction: column; gap: 6px; max-width: 760px; margin-bottom: 18px; }
.p-budget-row { display: flex; justify-content: space-between; gap: 12px; }
.p-bar { height: 8px; border-radius: 4px; background: #E6E7E2; overflow: hidden; }
.p-bar span { display: block; height: 100%; background: var(--accent); }
.p-over .p-bar span { background: #B3261E; }
.p-over .p-budget-row strong:first-child { color: #B3261E; }
@media (max-width: 640px) {
  .p-next { grid-template-columns: 1fr; }
}

/* Project page: every stage is a tab. Tabs are links (?stage=); projects-map.js switches them in place. */
.btn-dark { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.btn-dark:hover { background: #000000; border-color: #000000; color: #FFFFFF; }
.p-r { text-align: right; }
.p-hero { gap: 16px; }
.p-hero .facts { margin-top: 12px; }
.p-turn { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 8px; padding: 18px 20px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r); }
.p-turn > div { flex: 1 1 320px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.p-turn-now { font-size: 16px; line-height: 1.5; }
.p-turn-sent { background: var(--green-soft); border-color: #B9DDC5; }
.p-turn .pill { margin: 0; }
.p-stages { margin-top: 72px; scroll-margin-top: 12px; display: flex; flex-direction: column; }
.p-stages > .p-notice { margin: 0 0 16px; }
.p-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-bottom: 1px solid var(--line-strong); }
.p-tab { position: relative; display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 12px 14px 14px; border-top: 3px solid var(--line); color: var(--muted); text-decoration: none; transition: background-color .15s, color .15s; }
.p-tab:hover { background: var(--subtle); color: var(--ink); }
.p-tab-done { border-top-color: var(--ink); color: var(--ink-2); }
.p-tab-now { border-top-color: var(--accent); color: var(--accent); }
.p-tab[aria-current] { background: var(--subtle); color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); }
.p-tab-now[aria-current] { box-shadow: inset 0 -3px 0 var(--accent); }
.p-tab-no { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--muted); }
.p-tab-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-tab-meta { font-size: 12px; white-space: nowrap; }
.p-tab-done .p-tab-meta::before { content: "\2713\00a0"; color: var(--green-dot); font-weight: 700; }
.p-tab-todo .p-tab-name { font-weight: 500; }
.p-tab-turn .p-tab-meta { align-self: flex-start; margin-top: 2px; padding: 0 6px; border-radius: 4px; background: var(--accent); color: #FFFFFF; font-weight: 600; }
.p-tab-badge { position: absolute; top: 10px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--bg); color: var(--ink-2); font-size: 11px; font-weight: 600; line-height: 16px; text-align: center; }
.p-tab-wait .p-tab-badge { border-color: #EFC6C2; background: var(--red-soft); color: var(--red); }
.p-panel { padding-top: 32px; }
.p-panel[hidden] { display: none; }
.p-panel-head { display: flex; flex-direction: column; gap: 6px; max-width: 720px; margin-bottom: 28px; }
.p-panel-head h2 { font-size: clamp(22px, 2.8vw, 28px); line-height: 1.2; letter-spacing: -.02em; }
.p-panel-state { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.p-state-now { color: var(--accent); }
.p-state-done { color: var(--green); }
.p-panel-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.p-panel-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.p-panel-main > .table-wrap .bom { min-width: 540px; }
.p-rfqs td .pill + .small { display: block; margin-top: 4px; }
.p-answer { white-space: nowrap; }
.p-answer .small { display: block; }
.p-empty { padding: 28px 24px; border: 1px dashed var(--line-strong); border-radius: var(--r); color: var(--muted); font-size: 15px; line-height: 1.6; }
.p-request { font-size: 18px; line-height: 1.55; color: var(--ink); }
.p-kvs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.p-sub { margin-top: 12px; }
.p-brief { display: grid; gap: 10px; margin: 20px 0; max-width: 860px; }
.p-brief .p-sub { margin: 0; }
.p-brief h4 { margin: 8px 0 0; }
.p-brief-text { display: grid; gap: 8px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.p-brief-text p { margin: 0; }
.p-brief-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.p-brief-cols h4 { margin: 8px 0 6px; }
.p-brief ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.s-lead { margin: 10px 0 0; max-width: 640px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
@media (max-width: 720px) { .p-brief-cols { grid-template-columns: 1fr; } }
.p-ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.p-ov-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.p-ov-side { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--subtle); }
.p-ov-side .p-sub { margin: 0; }
.p-kvs-1 { grid-template-columns: minmax(0, 1fr); gap: 10px; padding-top: 8px; }
.p-overview .p-map-wrap { margin-top: 24px; }
.p-supply .c-part .small { display: block; }
.p-supply .c-sup a + a::before { content: ", "; color: var(--muted); }
.p-supply tfoot td, .p-supply tfoot th { border-top: 2px solid var(--line-strong); }
.p-supply tfoot .small { display: block; }
.p-opt-about { display: block; margin-top: 4px; color: var(--ink-2); line-height: 1.45; }
@media (max-width: 960px) { .p-ov-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .p-overview .table-wrap { overflow: visible; }
  .p-supply, .p-supply tbody, .p-supply tfoot, .table-wrap .bom.p-supply { display: block; min-width: 0; width: 100%; }
  .p-supply thead { display: none; }
  .p-supply tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  .p-supply tr > * { display: block; width: auto; padding: 0; border: 0; min-width: 0; }
  .p-supply tbody .c-pos { grid-row: 1 / span 3; }
  .p-supply tbody .c-part { grid-column: 2; }
  .p-supply tbody .p-answer { grid-column: 3; grid-row: 1; text-align: right; }
  .p-supply tbody .c-sup, .p-supply tbody td:nth-child(4) { grid-column: 2 / -1; }
  .p-supply tfoot tr { border-bottom: 0; border-top: 2px solid var(--line-strong); }
  .p-supply tfoot td, .p-supply tfoot th { border-top: 0; }
}
}
}
.p-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.p-chip { padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-2); font-size: 13px; }
.p-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.p-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px 0 0; }
.p-stat + .p-stat { padding-left: 16px; border-left: 1px solid var(--line); }
.p-stat-n { font-size: 26px; font-weight: 600; line-height: 1.15; }
.p-stat-wait .p-stat-n { color: var(--red); }
.p-pos { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.p-pos-open { box-shadow: inset 3px 0 0 var(--red); }
.p-pos-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--subtle); }
.p-pos-no { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); }
.p-pos-title { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.p-pos-title strong { font-size: 15px; }
.p-pos-head .pill { margin: 0; }
.p-pos-foot { padding: 8px 16px; border-top: 1px solid var(--line); }
.p-gap { padding: 12px 16px; color: var(--red); }
.p-opts { list-style: none; margin: 0; padding: 0; }
.p-opts li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.p-opts li:last-child { border-bottom: 0; }
.p-opts .pill { margin: 0; }
.p-opt-main { display: flex; flex-direction: column; flex: 1 1 220px; min-width: 0; }
.p-opt-main a { font-weight: 600; }
.p-opt-total { font-weight: 600; }
.p-pick { background: var(--accent-soft); }
.p-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; margin-left: auto; }
.p-quick { display: inline-flex; margin: 0; }
.p-quick .btn-sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.p-offer { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); }
.p-offer-cell { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.p-offer-cell + .p-offer-cell { border-left: 1px solid var(--line); }
.p-big { font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.p-ok { color: var(--green); }
.p-late { color: var(--red); }
.p-banner { padding: 12px 16px; border-radius: var(--r-sm); font-size: 14px; }
.p-banner-ok { border: 1px solid #B9DDC5; background: var(--green-soft); color: var(--green); }
.p-bar-green span { background: var(--green-dot); }
.p-track-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 16px; }
.p-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; flex: 2 1 320px; list-style: none; margin: 0; padding: 0; }
.p-track li { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 3px solid var(--line); font-size: 14px; }
.p-track li.is-done { border-top-color: var(--green-dot); }
/* The answer box beside each stage */
.p-say { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--subtle); }
.p-say > h3 { font-size: 15px; }
.p-say-decide { border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.p-say-form { display: flex; flex-direction: column; gap: 14px; }
.p-say fieldset { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.p-say legend { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; padding: 0; }
.p-say-q { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.p-choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); font-size: 14px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.p-choice:hover { border-color: var(--ink-2); }
.p-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.p-choice input { margin: 0; accent-color: var(--accent); }
.p-choice-main { font-weight: 600; }
.p-say .field textarea { font-size: 14px; }
.p-say-send { width: 100%; }
.p-error { padding: 10px 12px; border: 1px solid #EFC6C2; border-radius: var(--r-sm); background: var(--red-soft); color: var(--red); font-size: 14px; }
.p-say-sent { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.p-msgs { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.p-msgs li { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); font-size: 14px; }
.p-msgs p { color: var(--ink-2); white-space: pre-line; }
.p-msg-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; }
.p-msg-head .pill { margin: 0; }
/* Dashboard cards */
.p-dash .build-section { margin-top: 32px; }
.p-row-now { font-size: 14px; line-height: 1.6; }
.p-row-now .pill { vertical-align: 1px; }
@media (max-width: 960px) {
  .p-panel-body { grid-template-columns: 1fr; gap: 28px; }
  .p-say { position: static; }
}
@media (max-width: 760px) {
  .p-stages { margin-top: 48px; }
  .p-tabs { display: flex; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .p-tab { flex: 0 0 128px; scroll-snap-align: start; }
  .p-kvs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .p-stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .p-offer-cell + .p-offer-cell { border-left: 0; border-top: 1px solid var(--line); }
  .p-acts { margin-left: 0; justify-content: flex-start; }
}
.q-fb-done { margin-left: auto; }
.q-fb-head { margin: 0 0 8px; font-size: 15px; }
.q-fb-list + .q-review { margin-top: 20px; }
.p-notice { margin: 8px 0; padding: 12px 16px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 4px; font-size: 14px; }

/* Project pages: uploaded files, part specs with previews */
.p-files { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.p-specs { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.p-spec { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; padding: 2px; border-radius: var(--r-sm); }
.p-spec > div { display: grid; gap: 1px; min-width: 0; font-size: 12px; }
.p-spec strong { font-size: 13px; font-weight: 600; }
.p-spec-img { display: block; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.p-spec-img img { display: block; width: 100%; height: 48px; object-fit: contain; }
.p-spec-warn { margin: 4px 0 0; padding-left: 18px; color: var(--amber); }
/* Parts list: one tbody per position, name, facts and drawings on rows of their own */
.table-wrap .bom.p-parts { min-width: 0; }   /* beats the wide .bom minimums: this table stacks instead of scrolling */
.bom.p-parts thead th:nth-child(3) { display: table-cell; }
.bom.p-parts .c-part > span.muted { display: block; }
.p-parts tbody.p-line { border-bottom: 1px solid var(--line); }
.p-parts tbody.p-line:last-of-type { border-bottom: 0; }
.p-parts tbody.p-line td, .p-parts tbody.p-line th { border-bottom: 0; }
.p-parts tbody.p-line tr + tr > td { padding-top: 0; }
.p-parts .c-part { min-width: 0; }
.p-parts .p-qty, .p-parts thead th:last-child, .p-parts .c-pos, .p-parts thead th:first-child { width: 1%; white-space: nowrap; }
.p-parts .p-qty { font-weight: 600; }
.p-facts { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; }
.p-facts > div { min-width: 0; }
.p-facts-wide { flex: 1 1 100%; }
.p-facts dt { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.p-facts dd { margin: 0; }

/* 3D view of the whole build (site/viewer.js). The still works without JavaScript. */
.v3d { margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--subtle); overflow: hidden; }
.v3d-stage { display: flex; justify-content: center; padding: 12px; }
.v3d-stage img { display: block; width: auto; max-width: 100%; height: auto; max-height: 420px; }
.v3d.is-3d .v3d-stage { padding: 0; height: clamp(320px, 60vh, 560px); }
.v3d.is-3d .v3d-stage img { display: none; }
.v3d-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.v3d-stage canvas:active { cursor: grabbing; }
.v3d figcaption { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--ink-2); }
.v3d-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.v3d-facts { flex-basis: 100%; margin: 0; color: var(--ink); }
.v3d-live [data-part], .v3d-live tr[data-line] { cursor: pointer; }
.p-spec.is-picked, .p-spec:target { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.p-parts tr.is-picked > *, .p-parts tbody:has(tr:target) > tr > * { background: var(--accent-soft); }

/* Quote request mail preview on the prices step. Opens on #mail-NN, no JavaScript. Simulation only. */
.p-mail-btn { margin-top: 6px; }
.p-modal { display: none; position: fixed; inset: 0; z-index: 100; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; }
.p-modal:target { display: flex; }
.p-modal-bg { position: fixed; inset: 0; background: rgba(22, 25, 30, .45); }
.p-modal-box { position: relative; width: 100%; max-width: 760px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; display: grid; gap: 20px; }
.p-modal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.p-modal-top h2 { margin: 4px 0; font-size: 20px; }
.p-mail { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; }
.p-mail h3 { margin: 0; font-size: 16px; display: flex; flex-direction: column; gap: 2px; }
.p-mail-head { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.p-mail-head dt { color: var(--muted); }
.p-mail-head dd { margin: 0; overflow-wrap: anywhere; }
.p-mail-head ul { margin: 0; padding-left: 18px; }
.p-mail-body { margin: 0; padding: 14px; background: var(--subtle); border: 1px solid var(--line); border-radius: var(--r-sm); font-family: var(--font); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Versions and ideas: box on the project page, loop-back modal (#loop) */
.i-box { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 24px; background: var(--subtle); display: grid; gap: 12px; }
.i-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.i-head h2 { margin: 2px 0; font-size: 18px; }
.i-head p { margin: 0; }
.i-revs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.i-rev { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.i-rev p { margin: 0; }
.i-rev-no { font-weight: 600; font-size: 13px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 8px; }
.i-rev-sum { color: var(--ink); font-size: 15px; }
.i-chip { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; margin: 4px 6px 0 0; }
.i-good { background: var(--green-soft); color: var(--green); }
.i-bad { background: var(--red-soft); color: var(--red); }
.i-box > p { margin: 0; }
.i-form { display: grid; gap: 8px; }
.i-form p { margin: 0; }
.i-label { font-weight: 600; }
.i-form textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; line-height: 1.5; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface); color: var(--ink); resize: vertical; }
.i-actions { display: flex; justify-content: flex-end; }
@media (max-width: 600px) { .p-modal { padding: 16px; } .p-mail-head { grid-template-columns: 1fr; } .p-mail-head dt { margin-top: 6px; } }

/* Requester's project page: one story in seven chapters (scripts/queue_pages.py story_page) */
.s-page { padding: 24px 0 80px; }
.s-back { font-size: 14px; color: var(--muted); text-decoration: none; }
.s-back:hover { color: var(--accent); }
.s-top { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: end; margin: 12px 0 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.s-top h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -.02em; margin: 4px 0 0; }
.s-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--subtle); }
.s-card dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.s-card dt { color: var(--muted); }
.s-card dd { margin: 0; text-align: right; font-weight: 600; }
.s-card small { color: var(--muted); font-size: 12px; }
.s-card .s-card-turn { display: flex; justify-content: center; margin-top: 12px; }
.s-bar { height: 6px; border-radius: 3px; background: var(--line); margin: 12px 0 4px; overflow: hidden; }
.s-bar span { display: block; height: 100%; background: var(--accent); }
.s-bar.s-over span { background: var(--red); }
.s-over-text { color: var(--red); font-weight: 600; }
.s-story { display: flex; flex-direction: column; gap: 12px; }
.s-ch { scroll-margin-top: 16px; }
.s-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.s-head h2 { font-size: 18px; margin: 0; }
.s-no { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.s-when { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.s-mark { flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 700; box-sizing: border-box; }
.s-line { margin: 2px 0 0 44px; color: var(--ink-2); font-size: 15px; }
.s-more { font-size: 13px; color: var(--accent); white-space: nowrap; }
.s-done { border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px; }
.s-done > summary { list-style: none; cursor: pointer; padding: 14px 0; }
.s-done > summary::-webkit-details-marker { display: none; }
.s-done > summary:hover h2 { color: var(--accent); }
.s-done .s-mark { background: var(--green-dot); color: #fff; }
.s-done[open] > summary { border-bottom: 1px solid var(--line); }
.s-done[open] .s-more { display: none; }
.s-body { padding: 16px 0 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.s-now { border: 2px solid var(--accent); border-radius: var(--r); overflow: hidden; margin: 12px 0; }
.s-now-head { background: var(--accent); color: #fff; padding: 18px 20px; }
.s-now-head h2 { color: #fff; font-size: 24px; margin: 2px 0; letter-spacing: -.01em; }
.s-now-head p { margin: 0; opacity: .9; }
.s-now-head .pill { margin-top: 8px; }
.s-now-label { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.s-now-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.s-closed { border-color: var(--line-strong); }
.s-closed .s-now-head { background: var(--ink-2); }
.s-closed .p-say { position: static; }
.s-later { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 14px 16px; color: var(--muted); }
.s-later h2 { color: var(--muted); font-weight: 600; }
.s-later .s-mark { border: 2px dashed var(--line-strong); }
.s-later .s-line { color: var(--muted); }
.s-decide { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.s-decide p { margin: 0; font-size: 14px; color: var(--ink-2); }
.s-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.s-btns .p-quick .btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 0 6px; }
.s-ask { font-size: 14px; }
.s-ask summary { cursor: pointer; color: var(--accent); }
.s-ask form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
.s-ask textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.s-sent { border-top: 1px solid var(--line); padding-top: 12px; }
.s-foot { margin-top: 32px; display: flex; flex-direction: column; gap: 8px; }
.s-extra { border-top: 1px solid var(--line); padding: 12px 0 0; }
.s-extra > summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.s-extra[open] > summary { margin-bottom: 12px; }
/* Tables and position lists inside the chapters: numbers right, one column grid for every option row */
.s-page .bom { min-width: 640px; }
.s-page .bom th.p-r, .s-page .bom td.p-r { text-align: right; }
.s-page .bom td.p-answer { width: 150px; }
.s-page .bom .c-sup { width: 26%; }
.s-page .bom td.c-part { width: 30%; }
.s-page .p-pos-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) 140px 280px; gap: 16px; }
.s-page .p-pos-head > :nth-child(3) { text-align: right; }
.s-page .p-opts li { display: grid; grid-template-columns: minmax(0, 1fr) 140px 280px; gap: 16px; padding-left: 60px; }
.s-page .p-opts li > :nth-child(2) { justify-self: end; text-align: right; }
.s-page .p-opts li > .p-acts { grid-column: 3; justify-content: flex-end; margin-left: 0; }
.s-page .p-pos-foot, .s-page .p-pos .p-gap { padding-left: 60px; }
.s-page .p-track-row { padding-left: 60px; }
@media (max-width: 760px) {
  .s-page .p-pos-head { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .s-page .p-pos-head > :nth-child(4) { display: none; }
  .s-page .p-opts li { grid-template-columns: minmax(0, 1fr) auto; padding-left: 16px; }
  .s-page .p-opts li > .p-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .s-page .p-pos-foot, .s-page .p-pos .p-gap, .s-page .p-track-row { padding-left: 16px; }
  .s-top { grid-template-columns: 1fr; gap: 16px; }
  .s-line { margin-left: 0; }
  .s-head h2 { flex: 1 1 150px; min-width: 0; font-size: 16px; }
  .s-when { display: none; }
  .s-now-body { padding: 16px; }
  .s-decide { grid-template-columns: 1fr; }
  .s-btns { justify-content: flex-start; }
}

@media (max-width: 640px) {  /* prices on a project page: one block per position, price top right */
  .s-page .table-wrap { overflow: visible; }
  .s-page .bom.p-prices, .s-page .bom.p-prices tbody, .s-page .bom.p-prices tfoot { display: block; min-width: 0; width: 100%; }
  .s-page .bom.p-prices thead { display: none; }
  .s-page .bom.p-prices tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  .s-page .bom.p-prices tr > * { display: block; width: auto; padding: 0; border: 0; min-width: 0; text-align: left; }
  .s-page .bom.p-prices tr > *:empty { display: none; }
  .s-page .bom.p-prices tbody .c-pos { grid-row: 1 / span 4; }
  .s-page .bom.p-prices tbody td.c-part { grid-column: 2; width: auto; }
  .s-page .bom.p-prices tbody td.p-answer { grid-column: 3; grid-row: 1; width: auto; max-width: 130px; white-space: normal; text-align: right; }
  .s-page .bom.p-prices tbody td.c-sup, .s-page .bom.p-prices tbody td:nth-child(4), .s-page .bom.p-prices tbody td:nth-child(5) { grid-column: 2 / -1; width: auto; }
  .s-page .bom.p-prices tfoot td.p-r { grid-column: 3; grid-row: 1; text-align: right; }
  .s-page .bom.p-prices tfoot td:not(.p-r) { grid-column: 1 / 3; grid-row: 1; }
  .s-page .bom.p-prices tfoot .small { display: block; }
  .s-page .bom.p-prices tfoot tr { border-bottom: 0; border-top: 2px solid var(--line-strong); }
}
.p-quick .btn { white-space: nowrap; }

/* Position list: every position once. Closed: position, supplier, price. Open: asked for, found, alternatives. */
.pl { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.pl-row + .pl-row { border-top: 1px solid var(--line); }
.pl-sum { display: grid; grid-template-columns: 32px minmax(0, 1fr) 220px 130px 10px; gap: 4px 14px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.pl-sum::-webkit-details-marker { display: none; }
.pl-sum::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); }
.pl-row[open] > .pl-sum::after { transform: translateY(2px) rotate(-135deg); }
.pl-sum:hover, .pl-row[open] > .pl-sum { background: var(--subtle); }
.pl-sum:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pl-no { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.pl-item strong { display: block; font-size: 14px; font-weight: 600; }
.pl-item .small, .pl-price .small { display: block; }
.pl-who { color: var(--ink-2); text-align: left; }
.pl-price { text-align: right; white-space: nowrap; }
.pl-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 28px; padding: 14px 14px 18px 60px; border-top: 1px solid var(--line); }
.pl-col { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pl-col h4 { margin: 0 0 2px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.pl-col .p-facts { flex-direction: column; flex-wrap: nowrap; gap: 8px; width: 100%; }
.pl-col .p-facts > div { flex: none; }
.pl-alts { list-style: none; margin: 0; padding: 0; width: 100%; }
.pl-alts li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pl-alts li:first-child { border-top: 0; padding-top: 0; }
.pl-alts li > div:first-child { min-width: 0; display: flex; flex-direction: column; }
.pl-alt-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; }
.pl-alt-right .pill { margin: 0; }
.pl-total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px; border-top: 2px solid var(--line-strong); }
.pl-total .small { display: block; }
.pl-row.is-picked > .pl-sum, .pl-row:target > .pl-sum { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 640px) {
  .pl-sum { grid-template-columns: 26px minmax(0, 1fr) 110px 10px; padding: 12px; }
  .pl-who { grid-column: 2 / 4; grid-row: 2; }
  .pl-price { font-size: 13px; }
  .pl-sum::after { grid-column: 4; grid-row: 1; }
  .pl-body { grid-template-columns: 1fr; padding: 12px; }
}
/* Estimates: never look like a price. Light grey and italic wherever an amount carries ≈. */
.est { color: #9AA0A8; font-style: italic; font-weight: 400; }

/* Design guidelines */
.guide-page { max-width: 860px; min-width: 0; }
.guide { min-width: 0; scroll-margin-top: 80px; }
.guide > h2 { font-size: 20px; }
.guide h3 { margin-top: 12px; }
.guide ul, .guide ol { margin: 0; }
.guide li { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.guide code { overflow-wrap: anywhere; }
.guide td code { overflow-wrap: normal; }
.guide .table-wrap { max-width: 100%; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin-top: 8px; }
.guide-chapter { margin-top: 24px; scroll-margin-top: 80px; }
.guide-prompt { white-space: pre-wrap; overflow-wrap: anywhere; }
.guide-keys { list-style: none; padding: 0; }
.guide-keys li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 12px; padding: 6px 0; }
.guide-rules { list-style: none; padding: 0; }
.guide-rules li { display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.guide-rules li:last-child { border-bottom: 0; }
.guide-from { font-size: 12px; color: var(--muted); text-align: right; }
.guide-cats { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 16px; }
.guide-cats li { font-size: 14px; line-height: 1.4; }
.guide-cats code { display: block; font-size: 12px; color: var(--muted); }
.guide-figure { margin: 0; max-width: 420px; }
.guide-figure svg { display: block; width: 100%; height: auto; }
@media (max-width: 640px) {
  .guide { padding: 16px; }
  .guide-rules li { grid-template-columns: minmax(0, 1fr) auto; }
  .guide-rules li > span:not(.guide-from) { grid-column: 1 / -1; grid-row: 2; }
  .guide-keys li { grid-template-columns: minmax(0, 1fr); }
}
.guide-logic { list-style: none; padding: 0; counter-reset: step; }
.guide-logic li { display: grid; grid-template-columns: 110px 130px minmax(0, 1fr) 150px; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.guide-logic li:last-child { border-bottom: 0; }
.guide-logic strong::before { counter-increment: step; content: counter(step) ". "; }
.guide-who { color: var(--muted); }
.guide-result { text-align: right; color: var(--accent); }
.guide-family { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.guide-family h3 { margin: 0; }
.guide-family-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.guide-stage { font-size: 12px; color: var(--accent); white-space: nowrap; }
.guide-stage.is-planned { color: var(--muted); }
.guide-family summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.guide-family .guide-cats { margin-top: 8px; }
@media (max-width: 640px) {
  .guide-logic li { grid-template-columns: minmax(0, 1fr) auto; }
  .guide-logic li > span:nth-child(3), .guide-result { grid-column: 1 / -1; text-align: left; }
}
