/* Xyrek site styles: landing page + tool, manual, privacy, terms.

   The site has one fixed look: a deep blueprint-night header and hero, light
   content below, IBM Plex Sans and Mono (self-hosted). The eleven "sheet
   styles" (cyanotype, white print, ...) restyle only the drawings: see
   "Sheet styles" below. Their --svg-* values must stay in sync with MEDIA in
   app/svg_export.py, which bakes the same palettes into downloads. */

/* IBM Plex Sans is one variable file per script (weights 100 to 700); the
   unicode-range lets the browser fetch Cyrillic or extended Latin only when
   a page actually shows such text (a part named in Russian, for instance). */
@font-face { font-family: "IBM Plex Sans"; font-weight: 100 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/plex-sans-latin.woff2") format("woff2");
  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: "IBM Plex Sans"; font-weight: 100 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 100 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/plex-sans-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("/static/fonts/plex-mono-500.woff2") format("woff2"); }

:root {
  --bg: #ffffff;
  --surface: #f5f7fa;        /* alternate light surface */
  --ink: #0d1b2e;            /* text and primary buttons on light */
  --ink-2: #4a5a70;          /* secondary text */
  --ink-3: #66758a;          /* tertiary text, still AA on white */
  --line: #e2e7ee;
  --line-strong: #c9d1dc;
  --night: #0a1626;          /* header, hero, footer */
  --night-2: #101f35;
  --on-night: #e9eff7;
  --on-night-2: #a3b3c7;     /* secondary text on night */
  --blueprint: #17304e;      /* the cyanotype sheet */
  --accent: #ffd166;         /* dimension yellow: the action colour on night */
  --accent-hi: #ffdd8a;
  --blue: #1652c8;           /* dimension blue of the white print: links on light */
  --blue-wash: #eef3fd;
  --focus: #5b9dff;
  --alert: #b3261e;

  --font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1160px;
  --gutter: clamp(20px, 4vw, 40px);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(13,27,46,.05), 0 10px 30px -14px rgba(13,27,46,.22);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.03rem/1.62 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure, table { margin: 0; }
ul, ol { padding: 0; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
b, strong { font-weight: 600; }

h1, h2, h3 { font-weight: 600; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 1.3rem + 3.4vw, 3.45rem); line-height: 1.06; letter-spacing: -0.032em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.5rem); line-height: 1.12; letter-spacing: -0.024em; }
h3 { font-size: 1.14rem; line-height: 1.35; letter-spacing: -0.008em; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 30;
  background: var(--accent); color: var(--ink); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600;
}
.skip:focus { top: 12px; }
:target, .section, .doc h2 { scroll-margin-top: 84px; }

/* ---------------------------------------------------------------- header */
/* solid, so it reads as one surface with the hero below it and stays the same
   bar over the light sections */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--night); border-bottom: 1px solid rgba(255,255,255,.09);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.3rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em;
  color: #fff; text-decoration: none;
}
.brand-mark { width: 28px; height: 28px; flex: none; display: block; border-radius: 7px; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.site-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.site-nav a {
  color: var(--on-night-2); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: 7px 12px; border-radius: var(--r-sm); transition: color .12s, background-color .12s;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.site-nav a[aria-current="page"] { color: #fff; }
.plan-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .82rem; font-weight: 500; color: var(--on-night);
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 4px 12px 4px 10px; white-space: nowrap;
}
.plan-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
@media (max-width: 760px) {
  .site-header .wrap { gap: 10px; }
  .site-nav a.nav-secondary { display: none; }
}
@media (max-width: 400px) { .plan-badge { display: none; } }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  font: 600 .96rem/1 var(--font); letter-spacing: -0.005em; color: var(--ink); text-decoration: none;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:hover { border-color: #9aa7b8; background: var(--surface); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(13,27,46,.2); }
.btn-primary:hover { background: var(--blueprint); border-color: var(--blueprint); }
/* on the night surfaces: the dimension yellow is the action colour */
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-accent:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.24); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }
.btn-small { min-height: 30px; padding: 0 11px; font-size: .8rem; border-radius: 8px; }
.btn.locked { color: var(--ink-3); border-style: dashed; }
.btn.locked::after { content: "Pro"; font-size: .7rem; font-weight: 600; border: 1px solid currentColor; border-radius: 4px; padding: 1px 4px; }
.linkbtn {
  font: inherit; color: var(--blue); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.linkbtn:hover { text-decoration-thickness: 2px; }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(900px 520px at 80% 34%, rgba(48,110,190,.34), transparent 62%),
    radial-gradient(700px 400px at 8% 100%, rgba(30,70,130,.28), transparent 60%),
    var(--night);
  color: var(--on-night);
}
/* a drafting grid, fading out away from the sheet */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 72% 40%, #000 12%, transparent 72%);
          mask-image: radial-gradient(ellipse 70% 80% at 72% 40%, #000 12%, transparent 72%);
}
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 13fr); gap: clamp(32px, 5vw, 68px);
  align-items: center; padding-top: clamp(44px, 6vw, 88px); padding-bottom: clamp(52px, 7vw, 104px);
}
.hero h1 { color: #fff; }
.hero-lead { font-size: 1.16rem; line-height: 1.58; color: var(--on-night-2); margin-top: 22px; max-width: 33em; }
.hero-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px; font-size: .92rem; color: var(--on-night-2); }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts li::before {
  content: ""; width: 11px; height: 6px; margin-top: -3px; flex: none;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}

/* drop zone: the tool's entry point, a glass panel on the hero */
.drop {
  margin-top: 30px; padding: 24px;
  background: rgba(255,255,255,.055); border: 1.5px dashed rgba(255,255,255,.3); border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(255,209,102,.08); }
.drop.busy { cursor: default; border-style: solid; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.055); }
.drop-idle { display: flex; flex-direction: column; gap: 3px; }
.drop-title { font-size: 1.22rem; font-weight: 600; letter-spacing: -0.015em; color: #fff; }
.drop-sub { color: var(--on-night-2); font-size: .95rem; }
.drop-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.drop.busy .drop-idle { display: none; }

.status { display: flex; flex-direction: column; gap: 18px; }
.prog-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-bottom: 8px; font-size: .93rem; }
.prog-k { font-weight: 600; color: #fff; }
.prog-rate { flex: 1; text-align: right; color: var(--on-night-2); font-size: .84rem; font-variant-numeric: tabular-nums; }
.prog-v { color: #fff; font: 500 .9rem/1.62 var(--mono); }
.prog-track { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
.prog-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); border-radius: 3px; transition: width .35s ease-out; }
.prog.done .prog-fill { width: 100%; }
.prog.wait { opacity: .5; }
.prog.busy .prog-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: sheen 1.3s linear infinite;
}
@keyframes sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.error {
  margin-top: 14px; padding: 11px 15px; border-radius: var(--r-sm);
  background: rgba(255,120,95,.13); border: 1px solid rgba(255,140,115,.4); color: #ffdcd4; font-size: .96rem;
}

/* the sample sheet: a real PDF page, on a stack of the other pages */
.hero-sheet { position: relative; }
.sheet-stack { position: relative; margin: 0 16px 16px 0; }
.sheet-stack::before, .sheet-stack::after {
  content: ""; position: absolute; inset: 0; border-radius: 4px;
  background: #1d3d63; box-shadow: 0 0 0 1px rgba(255,255,255,.07);
}
.sheet-stack::before { transform: translate(16px, 16px); background: #224872; }
.sheet-stack::after { transform: translate(8px, 8px); }
.sheet-stack img {
  position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 297 / 210; border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 40px 80px -30px rgba(0,0,0,.75);
}
.hero-sheet figcaption { margin-top: 14px; font-size: .88rem; color: var(--on-night-2); }
/* the one piece of motion on the page: the sheet settles onto its stack */
@media (prefers-reduced-motion: no-preference) {
  .sheet-stack img { animation: sheet-in .7s cubic-bezier(.2,.7,.2,1) both; }
  .sheet-stack::before { animation: stack-in-2 .7s cubic-bezier(.2,.7,.2,1) .08s both; }
  .sheet-stack::after { animation: stack-in-1 .7s cubic-bezier(.2,.7,.2,1) .04s both; }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes stack-in-1 { from { opacity: 0; transform: translate(0, 18px); } to { opacity: 1; transform: translate(8px, 8px); } }
@keyframes stack-in-2 { from { opacity: 0; transform: translate(0, 18px); } to { opacity: 1; transform: translate(16px, 16px); } }
@media (prefers-reduced-motion: reduce) {
  .prog-fill { transition: none; }
  .prog.busy .prog-fill::after { animation: none; }
}
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }

/* -------------------------------------------------------------- sections */
.section { padding: clamp(60px, 8vw, 112px) 0; }
.section-tint { background: var(--surface); }
.section-head { max-width: 42em; margin-bottom: clamp(30px, 4vw, 52px); }
.section-head p { margin-top: 14px; font-size: 1.12rem; color: var(--ink-2); }

/* how it works: a real sequence, so it is numbered */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 58px; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font: 500 .95rem/1 var(--mono); color: var(--ink); background: #fff; border: 1px solid var(--line-strong);
}
/* the line that leads from one step to the next */
.steps li::after { content: ""; position: absolute; top: 19px; left: 50px; right: calc(-1 * clamp(28px, 4vw, 56px) + 12px); height: 1px; background: var(--line-strong); }
.steps li:last-child::after { display: none; }
.steps p { color: var(--ink-2); margin-top: 8px; }
@media (max-width: 760px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .steps li { padding: 0 0 0 56px; }
  .steps li::after { display: none; }
}

kbd, .path {
  font: 500 .84em/1.4 var(--mono); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px;
  white-space: nowrap;
}
.section-tint kbd { background: #fff; }
@media (max-width: 640px) { kbd, .path { white-space: normal; -webkit-box-decoration-break: clone; box-decoration-break: clone; } }

/* what gets dimensioned: the sample drawing with a keyed legend */
.dimfig { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.dimfig-sheet {
  background: var(--svg-bg); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(12px, 2.4vw, 28px); box-shadow: var(--shadow);
}
.dimfig-sheet svg { display: block; width: 100%; height: auto; }
.dimfig-caption { margin-top: 14px; font-size: .88rem; color: var(--ink-3); }
.legend { list-style: none; display: grid; gap: 4px; }
.legend button {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 16px; width: 100%;
  text-align: left; font: inherit; color: inherit; background: none; border: 1px solid transparent;
  padding: 14px 16px 14px 14px; cursor: pointer; border-radius: var(--r); transition: background-color .12s, border-color .12s;
}
.legend button:hover, .legend button:focus-visible, .legend button.on { background: #fff; border-color: var(--line); box-shadow: var(--shadow); }
.legend .key {
  grid-row: span 2; width: 44px; height: 44px; padding: 10px 7px; color: var(--blue);
  background: var(--blue-wash); border-radius: 10px;
}
.legend .t { font-weight: 600; font-size: 1.06rem; letter-spacing: -0.008em; align-self: end; }
.legend .d { color: var(--ink-2); font-size: .95rem; grid-column: 2; }
/* highlighting: the legend row fades every dimension it does not describe */
.dimfig-sheet g.dim { transition: opacity .15s; }
.dimfig-sheet.focus g.dim:not(.hl) { opacity: .14; }
.dimfig-sheet.focus-hidden g.dim { opacity: .14; }
.dimfig-sheet.focus-hidden svg > path[stroke="#7e9cc0"] { stroke: var(--blue); stroke-opacity: 1; stroke-width: .34; }
@media (max-width: 900px) { .dimfig { grid-template-columns: minmax(0, 1fr); } }

/* formats */
.formats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vw, 28px); }
.formats > div { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 26px 12px; background: #fff; }
.formats h3 { padding: 16px 0 14px; color: var(--ink-3); font-size: .95rem; font-weight: 500; letter-spacing: 0; }
.formats dl > div { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 18px; padding: 15px 0; border-top: 1px solid var(--line); align-items: baseline; }
.formats dt { font: 500 .92rem/1.5 var(--mono); color: var(--ink); }
.formats dd { color: var(--ink-2); font-size: .97rem; }
@media (max-width: 760px) { .formats { grid-template-columns: minmax(0, 1fr); } }

/* pricing */
.pricing {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 64px); align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 48px);
}
.price-figure { font-size: clamp(3.2rem, 2rem + 4.5vw, 5rem); font-weight: 600; line-height: 1; letter-spacing: -0.045em; }
.price-note { margin-top: 12px; color: var(--ink-2); font-size: 1.05rem; max-width: 24em; }
.ticks { list-style: none; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--blue-wash);
}
.ticks li::after {
  content: ""; position: absolute; left: 6px; top: 9px; width: 10px; height: 5px;
  border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg);
}
.pricing-later { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .95rem; }
/* the admin panel can switch the payment mode; show the matching copy */
.mode-paid { display: none !important; }
:root[data-mode="free"] .mode-beta, :root[data-mode="live"] .mode-beta { display: none !important; }
:root[data-mode="free"] .pricing.mode-paid, :root[data-mode="live"] .pricing.mode-paid { display: grid !important; }
:root[data-mode="free"] li.mode-paid, :root[data-mode="live"] li.mode-paid { display: inline-flex !important; }
@media (max-width: 760px) { .pricing { grid-template-columns: minmax(0, 1fr); } }

/* questions */
.faq { max-width: 48em; display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r); background: #fff; transition: border-color .12s, box-shadow .12s; }
.faq details[open] { border-color: var(--line-strong); box-shadow: var(--shadow); }
.faq summary {
  list-style: none; cursor: pointer; padding: 17px 52px 17px 20px; position: relative; border-radius: var(--r);
  font-weight: 600; font-size: 1.05rem; letter-spacing: -0.008em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .15s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details > div { padding: 0 52px 19px 20px; color: var(--ink-2); }
.faq details > div p + p { margin-top: 10px; }

/* ------------------------------------------------------------- workspace */
.workspace { padding: clamp(26px, 3.4vw, 44px) 0 clamp(44px, 6vw, 80px); border-bottom: 1px solid var(--line); background: var(--surface); }
.ws-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 40px; }
.ws-title { flex: 1 1 320px; min-width: 0; }
.ws-title label { display: block; font-size: .84rem; font-weight: 500; color: var(--ink-3); margin-bottom: 2px; }
.ws-title input {
  width: 100%; font: 600 clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem)/1.2 var(--font); letter-spacing: -0.025em; color: var(--ink);
  background: none; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; padding: 2px 0 7px;
}
.ws-title input:hover { border-bottom-color: var(--ink-3); }
.ws-title input:focus-visible { outline: none; border-bottom: 2px solid var(--blue); padding-bottom: 6px; }
.ws-facts { display: flex; gap: 34px; }
.ws-facts dt { font-size: .84rem; font-weight: 500; color: var(--ink-3); }
.ws-facts dd { font: 500 1.05rem/1.5 var(--mono); white-space: nowrap; }
.toolbar {
  margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; box-shadow: var(--shadow);
}
.toolbar .spacer { flex: 1 1 12px; }
/* option switches */
.check {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px;
  font-weight: 500; font-size: .94rem; cursor: pointer; border-radius: var(--r-sm); white-space: nowrap;
}
.check:hover { background: var(--surface); }
.check input {
  -webkit-appearance: none; appearance: none; margin: 0; flex: none; cursor: pointer;
  width: 34px; height: 20px; border-radius: 999px; background: #c5cedb; position: relative; transition: background-color .15s;
}
.check input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(13,27,46,.35); transition: transform .15s;
}
.check input:checked { background: var(--ink); }
.check input:checked::after { transform: translateX(14px); }
@media (prefers-reduced-motion: reduce) { .check input, .check input::after { transition: none; } }
.field { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; font-size: .94rem; white-space: nowrap; padding-left: 6px; }
.field select {
  min-height: 44px; font: 500 .94rem/1 var(--font); color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 10px; cursor: pointer;
}
.field select:hover { border-color: #9aa7b8; }
.ws-hint { margin-top: 16px; color: var(--ink-2); font-size: .95rem; max-width: 62em; }
.notice {
  margin-top: 14px; padding: 11px 15px; border-radius: var(--r-sm); max-width: 62em; font-size: .95rem;
  background: var(--blue-wash); border: 1px solid #cfdcf6;
}
.notice.warn { background: #fff6e2; border-color: #f1dca8; }
.ws-foot { margin-top: 24px; color: var(--ink-3); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px 22px; }

/* views: third-angle arrangement, all six sides + the 3D view */
.views {
  margin-top: 24px; display: grid; gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    ".    top    .     iso"
    "left front  right back"
    ".    bottom .     .";
}
.view {
  border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden;
  display: flex; flex-direction: column; min-width: 0; box-shadow: 0 1px 2px rgba(13,27,46,.04);
}
.view[data-view="Top"]       { grid-area: top; }
.view[data-view="Bottom"]    { grid-area: bottom; }
.view[data-view="Front"]     { grid-area: front; }
.view[data-view="Back"]      { grid-area: back; }
.view[data-view="Right"]     { grid-area: right; }
.view[data-view="Left"]      { grid-area: left; }
.view[data-view="Isometric"] { grid-area: iso; }
.view-bar { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--line); min-height: 56px; }
.view-id { min-width: 0; display: flex; flex-direction: column; }
.view-name { font-weight: 600; font-size: .96rem; line-height: 1.3; letter-spacing: -0.008em; }
.view-size { font: 400 .78rem/1.4 var(--mono); color: var(--ink-3); }
.view-dl { margin-left: auto; display: flex; gap: 6px; flex: none; }
.view-canvas { background: var(--svg-bg); padding: 8px; flex: 1; display: flex; align-items: center; }
.view-canvas svg { display: block; width: 100%; height: auto; max-height: 38vh; }
@media (max-width: 1100px) {
  .views { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "front right" "top bottom" "left back" "iso iso"; }
}
@media (max-width: 640px) {
  .views { grid-template-columns: minmax(0, 1fr); grid-template-areas: "front" "back" "top" "bottom" "left" "right" "iso"; }
  .ws-facts { gap: 22px; }
}

/* ----------------------------------------------------------- sheet styles
   Server-rendered previews are always drawn in the cyanotype palette; these
   attribute selectors recolor them (CSS overrides SVG presentation
   attributes). Downloads get the same palette via ?medium=, see MEDIA in
   app/svg_export.py. Keep the two in sync. */
[data-sheet] svg [stroke="#eef3f8"] { stroke: var(--svg-visible); }
[data-sheet] svg [stroke="#7e9cc0"] { stroke: var(--svg-hidden); }
[data-sheet] svg [stroke="#ffd166"] { stroke: var(--svg-dim); }
[data-sheet] svg [stroke="#e8a13d"] { stroke: var(--svg-dim-hid); }
[data-sheet] svg [fill="#ffd166"]   { fill: var(--svg-dim); }
[data-sheet] svg [fill="#e8a13d"]   { fill: var(--svg-dim-hid); }

[data-sheet="cyanotype"]    { --svg-bg: #17304e; --svg-visible: #eef3f8; --svg-hidden: #7e9cc0; --svg-dim: #ffd166; --svg-dim-hid: #e8a13d; }
[data-sheet="whiteprint"]   { --svg-bg: #ffffff; --svg-visible: #111418; --svg-hidden: #7d8794; --svg-dim: #1652c8; --svg-dim-hid: #5b86d6; }
[data-sheet="black"]        { --svg-bg: #000000; --svg-visible: #eef3f8; --svg-hidden: #7e9cc0; --svg-dim: #ffd166; --svg-dim-hid: #e8a13d; }
[data-sheet="whiteonblack"] { --svg-bg: #000000; --svg-visible: #ffffff; --svg-hidden: #8c8c8c; --svg-dim: #ffffff; --svg-dim-hid: #b3b3b3; }
[data-sheet="graphite"]     { --svg-bg: #1f2227; --svg-visible: #e8eaed; --svg-hidden: #848d97; --svg-dim: #f0b429; --svg-dim-hid: #c98f1e; }
[data-sheet="vellum"]       { --svg-bg: #f6f2e7; --svg-visible: #262f38; --svg-hidden: #8a91a0; --svg-dim: #b23a26; --svg-dim-hid: #c56a3c; }
[data-sheet="sepia"]        { --svg-bg: #f1e7d3; --svg-visible: #43301f; --svg-hidden: #997f5f; --svg-dim: #8a5a14; --svg-dim-hid: #b07f3a; }
[data-sheet="chalkboard"]   { --svg-bg: #26372d; --svg-visible: #f2f0e6; --svg-hidden: #9fb3a3; --svg-dim: #f6e27a; --svg-dim-hid: #d8c35d; }
[data-sheet="wireframe"]    { --svg-bg: #000000; --svg-visible: #39ff6e; --svg-hidden: #1f8f45; --svg-dim: #b8ffc9; --svg-dim-hid: #7fd69a; }
[data-sheet="amber"]        { --svg-bg: #0d0800; --svg-visible: #ffb000; --svg-hidden: #9c6a12; --svg-dim: #fff1c7; --svg-dim-hid: #d9b56a; }
[data-sheet="neon"]         { --svg-bg: #0a0612; --svg-visible: #3df5ff; --svg-hidden: #8a5cff; --svg-dim: #ff3df2; --svg-dim-hid: #c03bd0; }
[data-sheet="neon"] .view-canvas svg { filter: drop-shadow(0 0 1.5px rgba(61,245,255,.55)) drop-shadow(0 0 5px rgba(255,61,242,.25)); }

/* dimensions are clickable in the workspace: click to remove, again to restore */
.views g.dim { cursor: pointer; }
.views g.dim:hover text { text-decoration: underline; }
.views g.dim.off { opacity: .16; }
.views:not(.hdims) g.hiddendim { display: none; }
.views.nomeas g.dim:not(.dia), .views.nolabels g.dim.dia { display: none; }
.dimfig-sheet g.hiddendim { display: none; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--night); color: var(--on-night-2); font-size: .95rem; }
.site-footer a { color: var(--on-night); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-main { display: grid; grid-template-columns: minmax(0, 6fr) repeat(2, minmax(0, 2fr)); gap: 32px 40px; padding-top: 56px; padding-bottom: 44px; }
.footer-brand p { margin-top: 14px; max-width: 24em; }
.footer-col h2 { font-size: .86rem; font-weight: 500; color: var(--on-night-2); letter-spacing: 0; margin-bottom: 12px; }
.footer-col ul { list-style: none; display: grid; gap: 8px; }
.footer-legal { padding-bottom: 30px; font-size: .84rem; display: grid; gap: 8px; }
/* the rule lines up with the text, not with the padded wrapper */
.footer-legal::before { content: ""; border-top: 1px solid rgba(255,255,255,.1); margin-bottom: 14px; }
.footer-legal p { max-width: 80em; }
@media (max-width: 860px) { .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }

/* The web server still injects a "Contact" snippet into HTML that ends with a
   literal body end tag. The pages avoid that (they omit the optional end
   tags) and the content policy would block the script anyway; this is the
   last line of defence so nothing of it can ever show. */
#cf-pill, #cf-foot { display: none !important; }

/* ------------------------------------------------------- documents: manual,
   privacy, terms */
.doc-head {
  background: radial-gradient(800px 300px at 85% 0%, rgba(48,110,190,.3), transparent 65%), var(--night);
  color: var(--on-night); padding: clamp(36px, 5vw, 68px) 0 clamp(40px, 5.5vw, 76px);
}
.doc-head h1 { color: #fff; font-size: clamp(2.2rem, 1.4rem + 3vw, 3.3rem); }
.doc-head p { margin-top: 16px; font-size: 1.14rem; color: var(--on-night-2); max-width: 38em; }
.doc-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(32px, 6vw, 84px); padding-top: clamp(36px, 5vw, 60px); padding-bottom: clamp(60px, 8vw, 104px); align-items: start; }
.doc-layout.single { grid-template-columns: minmax(0, 1fr); }
.toc { position: sticky; top: 88px; font-size: .94rem; }
.toc h2 { font-size: .84rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-bottom: 10px; }
.toc ol { list-style: none; display: grid; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; transition: color .12s, border-color .12s; }
.toc a:hover { color: var(--ink); border-left-color: var(--ink); }
.doc { max-width: 44em; }
.doc section + section { margin-top: 56px; }
.doc h2 { font-size: 1.7rem; margin-bottom: 16px; }
.doc h3 { margin: 28px 0 8px; }
.doc p + p, .doc p + ul, .doc p + ol, .doc ul + p, .doc ol + p, .doc .table-scroll + p, .doc p + .table-scroll { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 1.35em; }
.doc li { margin: 7px 0; }
.doc li::marker { color: var(--ink-3); font-weight: 500; }
.doc .muted { color: var(--ink-2); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); margin-top: 16px; }
.doc table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 11px 16px; border-top: 1px solid var(--line); }
.doc tr:first-child th { border-top: 0; }
.doc th { font-size: .84rem; font-weight: 500; color: var(--ink-3); background: var(--surface); white-space: nowrap; }
.doc td:first-child { font-weight: 600; white-space: nowrap; }
.doc td.wrap-ok { white-space: normal; }
.doc-updated { color: var(--ink-3); font-size: .92rem; }
@media (max-width: 860px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; column-gap: 16px; }
  .toc a { padding-left: 0; border-left: 0; }
}
@media (max-width: 520px) { .toc ol { grid-template-columns: minmax(0, 1fr); } }
