/* Page CSS: tokens only (palette lives in theme.css). */
:root { --header-height: 68px; }

/* Header */
.site-header { background: color-mix(in srgb, var(--bg) 94%, transparent); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; margin-right: auto; }
.logo { width: auto; height: 36px; }
.logo-dark-ground { display: none; }
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-dark-ground { display: block; } :root:not([data-theme="light"]) .logo-light-ground { display: none; } }
@media screen { :root[data-theme="dark"] .logo-dark-ground { display: block; } :root[data-theme="dark"] .logo-light-ground { display: none; } }
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-links { gap: 22px; }
@media (min-width: 900px) and (max-width: 1180px) { .nav-links { gap: 14px; } .nav-links a:nth-child(n+6) { display: none; } }
.button-sm { min-height: 44px; padding: 10px 16px; font-size: var(--fs-small); }
.theme-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted-strong); border-radius: var(--radius-sm); cursor: pointer; }
.theme-toggle:hover { color: var(--ink); }
.mobile-nav { position: relative; }
.mobile-nav summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; border-radius: var(--radius-sm); }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav nav { position: absolute; right: 0; top: calc(100% + 8px); display: grid; min-width: 220px; padding: 8px; background: var(--surface); box-shadow: 0 12px 32px color-mix(in srgb, var(--ink) 18%, transparent); border-radius: var(--radius); }
.mobile-nav nav a { padding: 12px 14px; text-decoration: none; font-weight: 600; }
@media (min-width: 900px) { .mobile-nav { display: none; } }
@media (max-width: 479px) { .header-actions .button-sm { display: none; } .logo { height: 30px; } }

/* Hero */
.hero { min-height: min(84svh, 820px); padding-block: clamp(40px, 7vw, 104px); }
.hero .display { font-size: clamp(2.5rem, 1.3rem + 4.4vw, 5.4rem); max-width: 13ch; }
.accent-figure { color: var(--accent-text); font-family: var(--font-mono); font-weight: 500; letter-spacing: -0.04em; white-space: nowrap; }
.hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero .lead { max-width: 48ch; }

.facts .label { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: var(--fs-small); font-weight: 500; }
.facts strong { font-weight: 500; font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3.4rem); }

/* Media helpers */
.ratio-3-2 { aspect-ratio: 3 / 2; }
.media img { display: block; }
.media-figure figcaption strong { color: var(--ink); }
.mono { font-family: var(--font-mono); }

/* Range */
.delivery { display: grid; gap: 28px; }
@media (min-width: 640px) { .delivery { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .delivery { grid-template-columns: 1.15fr 0.85fr; align-items: end; } .delivery figure:last-child { margin-bottom: 64px; } }

/* Tolerances */
.tol-head { display: grid; gap: clamp(28px, 4vw, 64px); margin-bottom: clamp(48px, 6vw, 88px); }
@media (min-width: 900px) { .tol-head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; } }
.band-ink figcaption { color: var(--on-ink-muted); }
.band-ink .h3, .band-ink .h4 { color: var(--on-ink); }
.gauge .intro-row { margin-bottom: 24px; }
.gauge-board { min-width: 620px; color: var(--ink); }
.gauge-board td, .gauge-board th { padding: 10px 16px; font-family: var(--font-mono); font-size: var(--fs-small); }
.gauge-board tbody th { font-weight: 500; color: var(--accent-text); }
.gauge-board tr.is-match { background: var(--accent-soft); }
.source-note { margin-top: 12px; }
.board-wrap:focus-visible { outline-offset: 4px; }

/* Configurator */
.configurator { display: grid; gap: clamp(28px, 4vw, 56px); }
@media (min-width: 1000px) { .configurator { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } .cfg-preview { position: sticky; top: calc(var(--header-height) + 20px); } }
.cfg-controls { display: grid; gap: 22px; }
.cfg-controls fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cfg-controls legend { padding: 0; margin-bottom: 10px; }
.ctl { display: grid; gap: 8px; }
.ctl-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ctl-val { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: var(--fs-small); color: var(--muted-strong); }
.ctl-val input { width: 6.5em; font-family: var(--font-mono); text-align: right; }
.ctl-scale { display: flex; justify-content: space-between; font-size: var(--fs-micro); color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
select, input:not([type="range"]):not([type="radio"]):not([type="checkbox"]), textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-size: 1rem;
}
.ctl-val input { width: 6.5em; min-height: 40px; padding: 6px 8px; }
textarea { resize: vertical; line-height: 1.5; }
textarea#f-config { font-family: var(--font-mono); font-size: var(--fs-small); }
select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.seg legend { grid-column: 1 / -1; }
.seg label, .chips label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; cursor: pointer; font-size: var(--fs-small); font-weight: 600; border: 1px solid var(--line-strong); background: var(--surface); }
.seg label { justify-content: center; }
.seg label:first-of-type { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.seg label:last-of-type { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { width: 100%; }
.chips label { border-radius: var(--radius-sm); }
.seg input, .chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked), .chips label:has(input:checked) { background: var(--accent-fill); color: var(--accent-on-fill); border-color: var(--accent-fill); }
.seg label:has(input:focus-visible), .chips label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.chips label:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.qty-row { display: grid; grid-template-columns: 1fr 9rem; gap: 8px; }

.cfg-preview { display: grid; gap: 18px; padding: clamp(20px, 3vw, 36px); background: var(--field-2); color: var(--field-2-ink); border-radius: var(--radius); }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.illustrative-tag, .status { font-family: var(--font-mono); font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.08em; padding: 6px 10px; border-radius: var(--radius-sm); }
.illustrative-tag { background: var(--surface); color: var(--muted-strong); }
.status { background: var(--ink); color: var(--bg); }
.status.is-request { background: var(--accent-fill); color: var(--accent-on-fill); }
.drawings { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 12px; align-items: center; }
.drawings svg { width: 100%; height: auto; overflow: visible; }
@media (max-width: 559px) { .drawings { grid-template-columns: 1fr; } .xsec { max-width: 240px; margin-inline: auto; } }
.xsec .metal { fill: var(--muted-strong); }
.xsec .bore { fill: var(--field-2); }
.xsec .tol { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; }
.dim { stroke: var(--ink); stroke-width: 1; fill: none; }
.dim-text { fill: var(--ink); font-family: var(--font-mono); font-size: 11px; }
.dim-text.small-t { font-size: 10px; fill: var(--muted-strong); }
.elev .tube { fill: none; stroke: var(--muted-strong); stroke-linecap: round; }
.elev .tube-in { fill: none; stroke: var(--field-2); stroke-linecap: round; }
.elev .hole { fill: var(--field-2); }
.elev .cap { fill: var(--muted-strong); }
.readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-strong); }
.readout > div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line-strong); }
.readout dt { font-family: var(--font-mono); font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.readout dd { margin: 4px 0 0; font-family: var(--font-mono); font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3rem); font-weight: 500; }
@media (max-width: 479px) { .readout { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.note { font-size: var(--fs-small); color: var(--muted-strong); }
.note strong { color: var(--ink); }
.disclaimer { border-top: 1px solid var(--line-strong); padding-top: 14px; }

/* Inquiry */
.inquiry { align-items: start; }
@media (min-width: 900px) { .inquiry { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.inq-form { display: grid; gap: 16px; }
.grid2 { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.spec > div { padding-block: 10px; }
.spec dd { font-family: var(--font-mono); font-size: var(--fs-small); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { font-size: var(--fs-small); font-weight: 600; }
.form-msg.is-error { color: var(--accent-text); }
[aria-invalid="true"] { border-color: var(--accent) !important; box-shadow: 0 0 0 2px var(--accent-soft); }

/* Process */
.index-list > li p { color: var(--muted-strong); }
@media (min-width: 760px) { .index-list > li { grid-template-columns: 4.5rem minmax(0, 0.9fr) minmax(0, 1.4fr); } }

/* Types */
.types-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-bottom: clamp(48px, 6vw, 88px); }
.types-grid .media { aspect-ratio: 3 / 2; }
.types-grid figcaption { margin-top: 8px; }
.types-grid figcaption strong { color: var(--ink); }
.t-a { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .types-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .t-a { grid-column: 1 / span 6; grid-row: span 2; }
  .t-a .media { aspect-ratio: auto; height: calc(100% - 34px); }
  .t-b { grid-column: 7 / span 3; } .t-c { grid-column: 10 / span 3; }
  .t-d { grid-column: 7 / span 3; } .t-e { grid-column: 10 / span 3; }
}
.robot { align-items: center; }

/* Materials */
.grade-list { columns: 2; column-gap: 20px; font-size: var(--fs-small); }
.grade-list li { padding: 5px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.grade-list li span { color: var(--muted); }
.rule-list p + p { margin-top: 0.6em; }

/* Industries */
.ind-list { display: grid; gap: 0; }
.ind-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; padding-block: 18px; border-top: 1px solid var(--line-strong); align-items: start; }
.ind-list li:last-child { border-bottom: 1px solid var(--line-strong); }
.ind-list img { width: 96px; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.ind-list p { color: var(--muted-strong); max-width: 70ch; margin-top: 4px; }
@media (min-width: 900px) { .ind-list li { grid-template-columns: 160px minmax(0, 0.6fr) minmax(0, 1fr); } .ind-list li > div { display: contents; } .ind-list img { width: 160px; aspect-ratio: 3 / 2; } .ind-list p { margin-top: 0; } }

/* Quality */
.q-photos { display: grid; gap: 24px; }
@media (min-width: 900px) { .q-photos figure:last-child { width: 78%; margin-left: auto; } }
.certs dt { color: var(--ink); font-family: var(--font-mono); }

/* History */
.timeline > li { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 20px; padding-block: 22px; border-top: 1px solid color-mix(in srgb, var(--on-ink) 25%, transparent); }
.timeline .year { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); color: var(--on-ink); line-height: 1.2; }
.timeline p { color: var(--on-ink-muted); margin-top: 6px; }

/* Contact */
.addr { font-style: normal; }
.rule-list a, .addr a, .brief a { text-underline-offset: 0.2em; }
.footer-note { margin-top: 40px; }

/* Phone and tablet: preview first, live summary bar pinned while the controls scroll */
.cfg-mini { display: none; }
@media (max-width: 999px) {
  .cfg-preview { order: -1; }
  .cfg-mini { display: flex; position: sticky; bottom: 0; z-index: 5; justify-content: space-between; align-items: center; gap: 12px; margin-inline: calc((var(--shell) - 100vw) / 2); padding: 10px 16px; background: var(--ink-field); color: var(--on-ink); box-shadow: 0 -8px 24px color-mix(in srgb, var(--ink) 20%, transparent); }
  .mini-spec { font-size: var(--fs-small); }
  .cfg-mini .mini-status { color: var(--on-ink-muted); }
  .spec { display: none; }
}

[hidden] { display: none !important; }
