/* OptiFab Technologies — "Layout fluid on steel plate" */
:root {
  --bg: #F4F2EC;
  --surface: #EAE7DE;
  --text: #14181F;
  --primary: #2438B8;
  --accent: #E8A317;
  --muted: #4A505C;
  --line: #CFCBC0;
  --outline: #6B7180;
  --graphite: #1B1F27;
  --on-dark: #F4F2EC;
  --on-dark-muted: #B9BDC7;
  --on-dark-link: #9DB0FF;
  --primary-dark: #1C2D96;
  --primary-soft: #DDE2FA;
  --success: #1E6B3A;
  --error: #B3261E;
  --field: #FFFFFF;
  --f-head: "Archivo", "Arial Black", Arial, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --chamfer: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--f-body);
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
svg { max-width: 100%; }
h1, h2, h3 {
  font-family: var(--f-head);
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
  font-weight: 700;
}
h1 { font-size: clamp(2.05rem, 1.3rem + 3.2vw, 3.5rem); font-weight: 800; font-stretch: 125%; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); font-stretch: 115%; }
h3 { font-size: clamp(1.2rem, 1.1rem + .45vw, 1.45rem); font-stretch: 100%; }
p { margin: 0 0 1em; max-width: 68ch; }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: .35em; }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
strong { font-weight: 600; }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--primary); color: #fff; padding: 12px 16px; font-weight: 600;
}
.skip:focus { top: 12px; color: #fff; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: min(100%, 1240px); margin-inline: auto; padding-inline: clamp(16px, 5vw, 32px); }
.mono {
  font-family: var(--f-mono); font-size: .8125rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 10px;
}
.lead { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.55; }
.small { font-size: .9375rem; color: var(--muted); }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.plate {
  background-image: radial-gradient(circle, rgba(107, 113, 128, .32) 1px, transparent 1.5px);
  background-size: 16px 16px;
}
.band { padding-block: clamp(48px, 7vw, 88px); }
.band-alt { background-color: var(--surface); border-block: 1px solid var(--line); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg); border-bottom: 1px solid var(--text);
}
.top-in { display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; min-height: 48px; padding: 4px 0; }
.brand img { height: 34px; width: auto; }
.menu-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; min-width: 48px; padding: 0 14px; border: 1.5px solid var(--text); border-radius: 2px;
  background: var(--bg); color: var(--text); font: 600 1rem var(--f-body); cursor: pointer;
}
.menu-btn svg { flex: 0 0 auto; }
.menu-btn[aria-expanded="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
/* Phone and tablet: collapsed list behind the Menu button */
.nav { display: none; flex: 1 1 100%; min-width: 0; padding: 4px 0 12px; }
.top.open .nav { display: block; }
.nav-in { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.nav li { margin: 0; }
.nav a {
  display: flex; align-items: center; min-height: 52px; padding: 0 12px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.05rem;
  border-top: 1px solid var(--line); border-left: 4px solid transparent;
}
.nav a:hover { color: var(--primary); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--primary); border-left-color: var(--primary); background: var(--surface); }
.nav .tabs a::before {
  content: attr(data-n); font-family: var(--f-mono); font-size: .75rem; color: var(--muted);
  margin-right: 8px; font-weight: 500;
}
.nav .sub { border-top: 2px solid var(--text); }
@media (min-width: 640px) and (max-width: 1079px) {
  .nav-in { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .nav .sub { border-top: 0; }
}
@media (min-width: 1080px) {
  .top-in { flex-wrap: nowrap; min-height: 68px; column-gap: 24px; }
  .brand img { height: 40px; }
  .menu-btn { display: none; }
  .nav, .top.open .nav { display: block; flex: 1 1 auto; padding: 0; }
  .nav-in { display: flex; align-items: stretch; justify-content: space-between; }
  .nav ul { display: flex; }
  .nav a {
    min-height: 68px; font-size: .95rem; white-space: nowrap;
    border-top: 0; border-left: 0; border-bottom: 3px solid transparent;
  }
  .nav a:hover { background: none; border-bottom-color: var(--line); }
  .nav a[aria-current="page"] { background: none; border-bottom-color: var(--primary); }
  .nav .sub { margin-left: 8px; padding-left: 8px; border-top: 0; border-left: 1px solid var(--line); }
}
@media print { .menu-btn { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 11px 22px; border: 2px solid var(--primary);
  background: var(--primary); color: #fff; font: 600 1.0625rem/1.2 var(--f-body);
  text-decoration: none; border-radius: 2px; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-line { background: transparent; color: var(--text); border-color: var(--text); }
.btn-line:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-sm { min-height: 48px; padding: 10px 16px; font-size: 1rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.ticket .btn-line { color: var(--on-dark); border-color: var(--on-dark); }
.ticket .btn-line:hover { background: var(--on-dark); color: var(--graphite); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }
.tlink { font-weight: 600; display: inline-flex; align-items: center; min-height: 48px; }
.linkbtn {
  background: none; border: 0; padding: 0 4px; min-height: 48px; font: 600 1rem var(--f-body);
  color: var(--primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* ---------- Dimension-line divider ---------- */
.dim {
  display: flex; align-items: center; gap: 12px; margin: 0 0 24px;
  color: var(--primary); font-family: var(--f-mono); font-size: .875rem;
  letter-spacing: .1em; text-transform: uppercase;
}
.dim::before, .dim::after {
  content: ""; flex: 1 1 0; min-width: 16px; height: 11px;
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}
.dim::before { border-left: 1.5px solid currentColor; }
.dim::after { border-right: 1.5px solid currentColor; }
.dim span { white-space: nowrap; }

/* ---------- Traveler cards ---------- */
.traveler {
  position: relative; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--primary);
  clip-path: var(--chamfer); padding: 24px;
}
.traveler > :last-child { margin-bottom: 0; }
.traveler.on-surface { background: var(--bg); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Home ---------- */
.hero { padding-block: 32px 40px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 8px 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; }
  .hero-grid h1 { margin-bottom: 0; }
}
.hero-pic {
  margin: 28px 0 0; border: 1px solid var(--text); background: var(--surface);
  aspect-ratio: 3 / 2; overflow: hidden;
}
.hero-pic img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 760px) { .hero-pic { aspect-ratio: 2.3 / 1; } }

.board-head { display: grid; gap: 8px 40px; grid-template-columns: minmax(0, 1fr); margin-bottom: 24px; }
@media (min-width: 960px) { .board-head { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); align-items: end; } }
.tile { display: flex; flex-direction: column; }
.tile .preview {
  background: var(--graphite); color: var(--on-dark); padding: 14px; margin: 4px 0 14px;
  min-height: 170px; display: flex; flex-direction: column; justify-content: center; gap: 8px;
}
.tile .preview svg { width: 100%; height: auto; display: block; }
.tile .preview .pv-cap { font-family: var(--f-mono); font-size: .8125rem; color: var(--on-dark-muted); margin: 0; }
.tile .btn { margin-top: auto; align-self: flex-start; }
.demo-tag {
  display: inline-block; background: var(--accent); color: var(--text); border: 1px solid var(--text);
  font-family: var(--f-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 6px; margin-right: 6px;
}
.tile .tagline { font-size: .9375rem; color: var(--muted); }
.leak h3 { margin-bottom: 12px; }
.leak .prob { font-weight: 600; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: op; }
.steps li { margin: 0; }
.op { font-family: var(--f-mono); font-size: .8125rem; color: var(--primary); letter-spacing: .08em; margin: 0 0 6px; font-weight: 600; }
.who-list { list-style: none; padding: 0; margin: 0; }
.who-list li { padding: 14px 0; border-top: 1px solid var(--line); margin: 0; }
.who-list li:last-child { border-bottom: 1px solid var(--line); }
.role { font-family: var(--f-mono); font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); display: block; margin-bottom: 2px; }

/* ---------- Plans ---------- */
.plan .chip {
  display: inline-block; font-family: var(--f-mono); font-size: .8125rem; letter-spacing: .04em;
  padding: 4px 8px; border: 1.5px solid currentColor; margin-bottom: 14px; font-weight: 600;
}
.plan .chip.ok { color: var(--success); }
.plan .chip.soon { color: var(--muted); }
.plan.coming { background: var(--bg); border: 1.5px dashed var(--outline); border-top: 4px dashed var(--outline); }
.plan ul { list-style: none; padding: 0; margin: 0 0 20px; }
.plan li { padding-left: 26px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 2px; top: 0; color: var(--success); font-weight: 700; }

/* ---------- Roadmap rail ---------- */
.rail { list-style: none; margin: 0 0 24px; padding: 0 0 0 30px; position: relative; display: grid; gap: 20px; }
.rail::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--primary); }
.rail li { position: relative; margin: 0; }
.rail li::before {
  content: ""; position: absolute; left: -29px; top: 4px; width: 16px; height: 16px;
  border: 2px solid var(--primary); background: var(--bg);
}
.rail li.now::before { background: var(--accent); border-color: var(--text); }
.rail .stop { font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .08em; font-size: .875rem; color: var(--primary); font-weight: 600; display: block; }
@media (min-width: 860px) {
  .rail { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 34px 0 0; gap: 32px; }
  .rail::before { left: 0; right: 0; top: 8px; bottom: auto; width: auto; height: 2px; }
  .rail li::before { left: 0; top: -34px; }
}

/* ---------- Early access ---------- */
.ea { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 860px) { .ea.with-pic { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.ea-pic { margin: 0; border: 1px solid var(--line); background: var(--surface); aspect-ratio: 1 / 1; overflow: hidden; max-width: 520px; }
.ea-pic img { width: 100%; height: 100%; object-fit: cover; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row .input { flex: 1 1 240px; }
.row .btn { flex: 0 0 auto; }
@media (max-width: 559px) { .row .btn { flex: 1 1 100%; } }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-ok { border: 2px solid var(--success); background: var(--field); padding: 18px 20px; }
.form-ok p { margin: 0; }
.form-ok:focus { outline: 3px solid var(--primary); outline-offset: 2px; }
.form-fail { border: 2px solid var(--error); color: var(--error); background: var(--field); padding: 12px 14px; font-weight: 600; }

/* ---------- Forms ---------- */
fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
legend, .flabel { font-weight: 600; font-size: .975rem; padding: 0; margin-bottom: 6px; }
.field { display: grid; gap: 4px; margin-bottom: 18px; min-width: 0; }
.field > label { font-weight: 600; font-size: .975rem; }
.help { font-size: .9rem; color: var(--muted); margin: 0 0 4px; }
.err { color: var(--error); font-size: .925rem; font-weight: 600; margin: 2px 0 0; }
.err:empty { display: none; }
.err:not(:empty)::before { content: "! "; }
.input {
  width: 100%; max-width: 100%; font: inherit; font-size: 1.0625rem; padding: 10px 12px; min-height: 48px;
  border: 1px solid var(--outline); border-radius: 2px; background: var(--field); color: var(--text);
}
textarea.input { min-height: 150px; resize: vertical; line-height: 1.5; }
select.input { appearance: auto; }
.input:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; }
.ctl {
  display: flex; align-items: stretch; min-width: 0; border: 1px solid var(--outline);
  background: var(--field); border-radius: 2px;
}
.ctl input, .ctl select {
  flex: 1 1 auto; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 1.0625rem; padding: 10px 12px; min-height: 46px;
}
.ctl input:focus { outline: none; }
.ctl:focus-within { outline: 3px solid var(--primary); outline-offset: 1px; }
.ctl input[readonly] { color: var(--muted); background: var(--surface); }
.unit {
  display: flex; align-items: center; padding: 0 12px; font-family: var(--f-mono); font-size: .875rem;
  color: var(--muted); border-left: 1px solid var(--line); white-space: nowrap; background: var(--bg);
}
.invalid .ctl, .invalid .input, .invalid.input { border: 2px solid var(--error); }
.stepper { display: flex; min-width: 0; }
.stepper .ctl { flex: 1 0 3.5rem; min-width: 3.5rem; border-radius: 0; }
.stepper .ctl input {
  min-width: 3ch; padding: 10px 4px; text-align: center; font-family: var(--f-mono);
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.stepper .ctl input::-webkit-outer-spin-button,
.stepper .ctl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cols-steppers { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.step {
  flex: 0 0 48px; min-height: 48px; border: 1px solid var(--outline); background: var(--surface);
  font: 600 1.25rem/1 var(--f-body); color: var(--text); cursor: pointer;
}
.step:hover { background: var(--primary-soft); }
.step:first-child { border-right: 0; }
.step:last-child { border-left: 0; }
.cols-2 { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 480px) { .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cols-3 { display: grid; gap: 0 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.check { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); flex: 0 0 auto; }

/* Segmented toggle */
.seg { position: relative; display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--outline); background: var(--field); border-radius: 2px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg label { display: flex; align-items: center; min-height: 46px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: .95rem; }
.seg input:checked + label { background: var(--primary); color: #fff; }
.seg input:focus-visible + label { outline: 3px solid var(--primary); outline-offset: 2px; position: relative; z-index: 1; }
.unitbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 18px; }
.unitbar fieldset { margin: 0; }
.unitbar .field { margin: 0; min-width: 150px; }

/* Collapsible groups */
.group {
  border: 1px solid var(--line); border-top: 4px solid var(--primary); background: var(--bg);
  margin-bottom: 16px; clip-path: var(--chamfer);
}
.group > summary {
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 16px 10px 20px; cursor: pointer; background: var(--surface);
  font-family: var(--f-mono); font-size: .875rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
}
.group > summary::-webkit-details-marker { display: none; }
.group > summary::after { content: "+"; font-size: 1.35rem; line-height: 1; color: var(--primary); }
.group[open] > summary::after { content: "−"; }
.group > summary:focus-visible { outline-offset: -4px; }
.gbody { padding: 18px 16px 4px; }
.gnote { font-size: .925rem; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 10px; }

/* ---------- Tool console ---------- */
.tool-head { padding-block: 28px 24px; border-bottom: 1px solid var(--line); }
.tool-head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
.crumb a { color: var(--muted); }
.console { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 28px 48px; }
@media (min-width: 960px) {
  .console { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .console.wide-result { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}
@media (min-width: 960px) and (min-height: 940px) {
  .sticky-col { position: sticky; top: 84px; }
}
.inputs { min-width: 0; }
.actionbar {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  background: var(--bg); border-top: 1px solid var(--text); padding: 12px 0; margin-top: 8px;
}
.actionbar .btn { flex: 1 1 200px; }
@media (min-width: 960px) { .actionbar { position: static; border-top: 0; } .actionbar .btn { flex: 0 0 auto; } }
.errsum { border: 2px solid var(--error); background: var(--field); padding: 12px 16px; margin-bottom: 16px; }
.errsum p { margin: 0 0 6px; font-weight: 600; color: var(--error); }
.errsum ul { margin: 0; }

/* Result ticket */
.ticket {
  position: relative; min-width: 0; background-color: var(--graphite); color: var(--on-dark);
  padding: 24px clamp(16px, 3vw, 28px); clip-path: var(--chamfer);
  background-image: radial-gradient(circle, rgba(244, 242, 236, .09) 1px, transparent 1.5px);
  background-size: 16px 16px;
}
.ticket:focus { outline: none; }
.ticket:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.ticket a { color: var(--on-dark-link); }
.ticket :focus-visible { outline-color: var(--on-dark-link); }
.ticket .mono { color: var(--on-dark-muted); }
.ticket h2 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.8rem); }
.ticket h3 { font-size: 1.1rem; }
.ticket .small { color: var(--on-dark-muted); }
.ticket.stale .tbody-wrap { opacity: .55; }
.stale-note { display: none; color: var(--accent); font-weight: 600; }
.ticket.stale .stale-note { display: block; }
.badge {
  display: inline-block; background: var(--accent); color: var(--text); border: 1px solid var(--text);
  font: 600 .9375rem/1.3 var(--f-body); padding: 6px 10px; margin: 0 0 16px;
}
.ticket-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0 12px; }
.perf { border: 0; border-top: 2px dashed var(--on-dark-muted); margin: 14px 0; height: 0; }
.cost { width: 100%; border-collapse: collapse; }
.cost th, .cost td { padding: 9px 0; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(244, 242, 236, .14); }
.cost thead th { font-family: var(--f-mono); font-size: .8125rem; color: var(--on-dark-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.cost .amt { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.cost .lname { font-weight: 600; }
.share { display: block; height: 6px; background: rgba(244, 242, 236, .16); margin-top: 7px; max-width: 260px; }
.share > span { display: block; height: 100%; background: var(--on-dark-link); width: 0; }
.share-pct { font-family: var(--f-mono); font-size: .8125rem; color: var(--on-dark-muted); }
.totals { display: grid; gap: 6px; }
.totals .trow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.totals .tlabel { font-family: var(--f-head); font-weight: 700; font-size: 1.15rem; }
.total { color: var(--accent); font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.3rem); }
.unitp { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 1.3rem; font-weight: 600; }
.facts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 4px; font-size: .95rem; color: var(--on-dark-muted); }
.facts li { margin: 0; }
.facts .num { color: var(--on-dark); }
.assume { border: 1.5px dashed var(--primary); padding: 16px 18px; margin-top: 20px; }
.ticket .assume { border-color: var(--on-dark-link); }
.assume h3 { font-size: 1.05rem; margin-bottom: 8px; }
.assume ul { margin: 0; padding-left: 1.1em; font-size: .95rem; }
.ticket-anim { animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Nesting */
.part-row {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
@media (min-width: 420px) { .part-row { grid-template-columns: minmax(0, 1fr) 170px; } }
.part-row .check { font-weight: 600; }
.psize { display: block; font-family: var(--f-mono); font-size: .8125rem; color: var(--muted); font-weight: 400; }
.swatch { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--text); flex: 0 0 auto; }
.sw-bracket { background: #2438B8; } .sw-gusset { background: #5B6FE0; } .sw-plate { background: #14206E; }
.sw-tab { background: #8C9BF0; } .sw-cover { background: #3A4FCF; }
.picked { font-family: var(--f-mono); font-size: .875rem; color: var(--muted); margin: 8px 0 0; }
.radios { display: grid; gap: 0; }
.blocker { border: 2px solid var(--error); background: var(--field); color: var(--text); padding: 16px; margin-bottom: 16px; }
.blocker strong { color: var(--error); }
.cmp { width: 100%; border-collapse: collapse; font-size: .975rem; }
.cmp th, .cmp td { padding: 9px 8px 9px 0; text-align: left; border-bottom: 1px solid rgba(244, 242, 236, .16); vertical-align: top; }
.cmp thead th { font-family: var(--f-mono); font-size: .8125rem; color: var(--on-dark-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.cmp td { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.cmp .best { color: var(--accent); font-weight: 700; }
.gain { font-family: var(--f-head); font-size: 1.2rem; margin: 16px 0 0; color: var(--on-dark); }
.gain .num { color: var(--accent); }
.layouts { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); margin-top: 20px; }
@media (min-width: 720px) { .layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.layout h3 { margin-bottom: 4px; }
.layout .small { margin-bottom: 10px; }
.sheets { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.sheet-fig { margin: 0; }
.sheet-fig figcaption { font-family: var(--f-mono); font-size: .8125rem; color: var(--on-dark-muted); margin-top: 4px; }
.sheet-svg { width: 100%; height: auto; display: block; }
.sh-plate { fill: #F4F2EC; stroke: #14181F; }
.sh-hatch { stroke: #B9B4A6; }
.sh-part { stroke: #14181F; }
.pt-bracket { fill: #2438B8; } .pt-gusset { fill: #5B6FE0; } .pt-plate { fill: #14206E; }
.pt-tab { fill: #8C9BF0; } .pt-cover { fill: #3A4FCF; }
.pt-letter { fill: #FFFFFF; font-family: var(--f-mono); font-weight: 700; }
.pt-letter.dark { fill: #14181F; }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.legend li { display: flex; align-items: center; gap: 6px; margin: 0; }

/* Schedule */
.days { display: flex; flex-wrap: wrap; gap: 8px; }
.days label { position: relative; }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days span {
  display: flex; align-items: center; justify-content: center; min-width: 52px; min-height: 48px; padding: 0 10px;
  border: 1px solid var(--outline); background: var(--field); font-weight: 600; cursor: pointer; border-radius: 2px;
}
.days input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.days input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.verdict {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; min-height: 64px; margin-bottom: 16px;
  border: 1px solid var(--on-dark);
}
.verdict p { margin: 0; }
.verdict .vicon { font-family: var(--f-mono); font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.verdict .vword { display: block; font-family: var(--f-head); font-size: 1.45rem; font-weight: 800; font-stretch: 115%; }
.verdict.fits { background: var(--success); color: #fff; }
.verdict.tight { background: var(--accent); color: var(--text); border-color: var(--text); }
.verdict.no { background: var(--error); color: #fff; }
.chart-scroll { overflow-x: auto; margin: 8px 0 12px; border: 1px solid rgba(244, 242, 236, .2); padding: 10px; }
.chart-scroll svg { max-width: none; display: block; }
.ch-text { fill: #F4F2EC; font-family: var(--f-mono); font-size: 12px; }
.ch-muted { fill: #B9BDC7; font-family: var(--f-mono); font-size: 11px; }
.ch-new { fill: #9DB0FF; }
.ch-exbg { fill: #3A404C; }
.ch-hatch { stroke: #8A909C; stroke-width: 2; }
.ch-cap { stroke: #F4F2EC; stroke-width: 1.5; stroke-dasharray: 4 3; }
.ch-short { fill: none; stroke: #FFB4AB; stroke-width: 2; }
.ch-short-t { fill: #FFB4AB; font-family: var(--f-mono); font-size: 11px; font-weight: 700; }
.ch-grid { stroke: rgba(244, 242, 236, .12); }
.chart-key { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; color: var(--on-dark-muted); }
.chart-key li { display: flex; align-items: center; gap: 6px; margin: 0; }
.key { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--on-dark); }
.key-ex { background: repeating-linear-gradient(45deg, #3A404C 0 3px, #8A909C 3px 5px); }
.key-new { background: #9DB0FF; }
.key-cap { border: 0; border-top: 2px dashed var(--on-dark); height: 0; margin-top: 4px; }
.key-short { border: 2px solid #FFB4AB; }
.tscroll { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dtable th, .dtable td { padding: 7px 10px 7px 0; text-align: left; border-bottom: 1px solid rgba(244, 242, 236, .16); white-space: nowrap; }
.dtable td { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.dtable thead th { font-family: var(--f-mono); font-size: .8125rem; color: var(--on-dark-muted); font-weight: 500; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.result-actions .btn { flex: 1 1 160px; }

/* Next links & guides */
.nextlinks { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .nextlinks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nextlinks a { font-weight: 600; font-size: 1.1rem; display: inline-block; padding: 6px 0; }
.guide-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .guide-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.guide-pic { margin: 0; border: 1px solid var(--line); background: var(--surface); }
.guide-pic img { width: 100%; height: auto; }
.guide h3 { margin-top: 1.4em; }
.limits { border-left: 4px solid var(--accent); padding: 4px 0 4px 16px; }

/* About / content pages */
.page-head { padding-block: 36px 28px; border-bottom: 1px solid var(--line); }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.6em; font-size: clamp(1.35rem, 1.15rem + .8vw, 1.75rem); }
.prose h3 { margin-top: 1.3em; }
.flow-pic { margin: 0 0 28px; border: 1px solid var(--line); background: var(--surface); aspect-ratio: 3 / 2; overflow: hidden; }
.flow-pic img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .flow-pic { aspect-ratio: 2.2 / 1; } }
.flow { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.flow li { margin: 0; }
.contact-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.maillist { list-style: none; padding: 0; margin: 0; }
.maillist li { margin: 0 0 14px; }
.maillist a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; font-size: 1.1rem; overflow-wrap: anywhere; }
.notfound { padding-block: clamp(56px, 10vw, 120px); }
.code404 { font-family: var(--f-mono); color: var(--primary); font-size: 1rem; letter-spacing: .1em; }

/* ---------- Footer ---------- */
.foot { background: var(--graphite); color: var(--on-dark); margin-top: 0; padding-top: 48px; }
.foot a { color: var(--on-dark-link); }
.foot a:focus-visible { outline-color: var(--on-dark-link); }
.foot-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); padding-bottom: 32px; }
@media (min-width: 640px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .foot-grid { grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); } }
.foot-logo { display: inline-block; background: #FFFFFF; padding: 8px 12px; margin-bottom: 14px; }
.foot-logo img { height: 40px; width: auto; }
.foot p { color: var(--on-dark-muted); font-size: .95rem; }
.foot .fh { font-family: var(--f-mono); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark); margin: 0 0 8px; font-weight: 600; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: 0; }
.foot li a { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.foot-base { border-top: 1px dashed rgba(244, 242, 236, .3); padding-block: 18px 24px; }
.foot-base p { margin: 0; color: var(--on-dark-muted); font-size: .9rem; }

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .top, .foot, .skip, .inputs, .ea-band, .next-band, .guide-band, .tool-head .lead, .result-actions, .noprint { display: none !important; }
  body { background: #fff; }
  .plate { background: none; }
  .console { display: block; padding: 0; }
  .ticket { background: #fff !important; color: #000; clip-path: none; border: 1px solid #000; }
  .ticket .mono, .ticket .small, .chart-key { color: #000; }
  .verdict { border: 2px solid #000; }
  .ch-text, .ch-muted { fill: #000; }
  .ch-new { fill: #2438B8; }
  .ch-exbg { fill: #fff; }
  .ch-hatch { stroke: #555; }
  .ch-cap { stroke: #000; }
  .chart-scroll { overflow: visible; border: 0; }
  .dtable th, .dtable td, .cmp th, .cmp td { border-color: #999; }
  .print-url { display: block !important; }
}
.print-url { display: none; }
