/* ==========================================================================
   QAYKA — Design system: tokens, base, typography, primitives
   8px spacing scale · Inter (body) · Manrope (headings) · JetBrains Mono (codes)
   ========================================================================== */

:root {
  /* Graphite / steel neutrals */
  --graphite-950: #0e1114;
  --graphite-900: #14181c;
  --graphite-850: #181d22;
  --graphite-800: #1d2329;
  --graphite-700: #272e36;
  --graphite-600: #353d46;
  --steel-500: #5b6671;
  --steel-400: #86919c;
  --steel-300: #b4bdc6;
  --steel-200: #d7dde3;
  --steel-150: #e3e7ec;
  --steel-100: #edf0f3;
  --steel-50: #f5f7f9;
  --white: #ffffff;

  /* Accent — safety orange (AA with white text on --accent) */
  --brand: #e0560b;
  --accent: #cc4a0a;
  --accent-hover: #ad3e07;
  --accent-bright: #ff7a2e;
  --accent-soft: #fdf0e8;
  --accent-ring: rgba(224, 86, 11, .35);

  /* Semantic */
  --success: #13743c; --success-bg: #e6f4ec;
  --warn: #8a5a00; --warn-bg: #fff3d6; --warn-dot: #e3a008;
  --danger: #b42318; --danger-bg: #fdecea;
  --info: #1a5aa0; --info-bg: #e7f0fa;

  /* Text / surfaces */
  --text: #14181c;
  --text-2: #444e59;
  --text-3: #66717d;
  --text-inv: #ffffff;
  --text-inv-2: rgba(255, 255, 255, .72);
  --bg: #ffffff;
  --bg-alt: #f3f5f7;
  --bg-dark: var(--graphite-900);
  --art-bg: #eef1f4;
  --border: #dde2e7;
  --border-strong: #c3cad2;
  --border-dark: rgba(255, 255, 255, .12);

  /* Spacing (8px system) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* Radius / shadow */
  --r-sm: 4px; --r: 6px; --r-lg: 10px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .06);
  --sh-2: 0 6px 16px -4px rgba(16, 24, 40, .10), 0 2px 4px rgba(16, 24, 40, .05);
  --sh-3: 0 20px 40px -12px rgba(16, 24, 40, .22);

  /* Type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 13.5px; --fs: 15px; --fs-md: 17px; --fs-lg: 20px;
  --fs-h3: 19px; --fs-h2: clamp(26px, 2.4vw, 34px); --fs-h1: clamp(30px, 3.4vw, 46px);
  --lh: 1.6;

  --container: 1320px;
  --gutter: 24px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (max-width: 640px) { :root { --gutter: 16px; } }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; font-family: var(--font); font-size: var(--fs); line-height: var(--lh); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
html.no-scroll, html.no-scroll body { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 var(--s4); }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; line-height: 1.18; margin: 0 0 var(--s3); letter-spacing: -.015em; color: inherit; }
h3, h4 { letter-spacing: -.005em; word-spacing: .06em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
table { border-collapse: collapse; width: 100%; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--steel-100); padding: 1px 5px; border-radius: 3px; }
mark { background: var(--accent-soft); color: var(--accent-hover); padding: 0 1px; border-radius: 2px; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }
[hidden] { display: none !important; }

/* ---------- Focus & a11y ---------- */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.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; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--graphite-900); color: #fff; padding: 10px 16px; border-radius: var(--r); font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 880px; }
.section { padding-block: clamp(48px, 6vw, 88px); }
.section--tight { padding-block: var(--s7) 0; }
.section--alt { background: var(--bg-alt); }
.section--dark { position: relative; background: var(--graphite-900); color: var(--text-inv); overflow: hidden; }
.section--dark .section-lead, .section--dark .muted { color: var(--text-inv-2); }
.section__grid-bg, .page-head__grid, .hero__grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 30%, transparent 80%);
}
.section > .container { position: relative; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); align-items: center; }
.split--top { align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); gap: var(--s6); } }

/* ---------- Typography helpers ---------- */
.eyebrow { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--s3); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--brand); }
.eyebrow--accent { color: var(--accent-bright); }
.eyebrow--dark { color: var(--graphite-900); }
.eyebrow--dark::before { background: var(--graphite-900); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s6); }
@media (max-width: 640px) { .section-head { flex-direction: column; align-items: flex-start; gap: var(--s3); } .section-head > div { width: 100%; } }
.section-head--center { justify-content: center; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-title { font-size: var(--fs-h2); margin-bottom: var(--s3); max-width: 22ch; }
.section-head--center .section-title { margin-inline: auto; }
.section-title--sm { font-size: 24px; max-width: none; margin-bottom: var(--s5); }
.section-lead { color: var(--text-2); font-size: var(--fs-md); max-width: 62ch; margin: 0; }
.lead-p { font-size: var(--fs-md); color: var(--text-2); }
.muted { color: var(--text-3); }
.fine { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; display: flex; gap: 6px; align-items: flex-start; }
.fine .icon { flex: none; margin-top: 2px; }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.t-right { text-align: right; }
.nowrap { white-space: nowrap; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.link-arrow .icon { transition: transform .2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }
.link-arrow--back:hover .icon { transform: translateX(-3px); }
.section--dark .link-arrow { color: var(--accent-bright); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: var(--fs-sm); }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn--muted { color: var(--text-3); }
.prose a, .notice a, .field a, .check__label a, .auth__switch a, .dev-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Placeholder marker (devMode) */
.ph { text-decoration: underline dotted var(--brand); text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: help; }
.dev-note { font-size: var(--fs-xs); color: var(--text-3); display: flex; gap: 6px; align-items: center; margin-top: var(--s4); }

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: var(--r);
  font-weight: 600; font-size: 14.5px; line-height: 1; letter-spacing: .005em; white-space: nowrap;
  border: 1px solid transparent; transition: background .18s, color .18s, border-color .18s, box-shadow .18s, transform .12s;
  position: relative; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn--sm { --h: 36px; padding: 0 14px; font-size: 13.5px; }
.btn--lg { --h: 52px; padding: 0 26px; font-size: 15.5px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { border-color: var(--graphite-900); }
.btn--dark { background: var(--graphite-900); color: #fff; }
.btn--dark:hover { background: var(--graphite-700); }
.btn--light { background: #fff; color: var(--graphite-900); }
.btn--light:hover { background: var(--steel-100); }
.btn--ghost-light { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn--ghost-light:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.btn--outline-dark { background: transparent; color: var(--graphite-900); border-color: var(--graphite-900); }
.btn--outline-dark:hover { background: var(--graphite-900); color: #fff; }
.btn--text { background: transparent; color: var(--text-2); padding: 0 10px; }
.btn--text:hover { color: var(--accent); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #8f1c13; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn--secondary.is-loading::after { border-color: var(--steel-300); border-top-color: var(--text); }
.btn.is-bump { animation: bump .4s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bump { 40% { transform: scale(1.06); } }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }
.btn-row--sm { gap: var(--s2); margin-top: var(--s2); }

.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r); color: var(--text); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--steel-100); }
.icon-btn--sm { width: 34px; height: 34px; }
.icon-btn__badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.icon-btn__dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px #fff; }
.tool-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--text-2); box-shadow: var(--sh-1); transition: color .15s, background .15s, transform .15s; }
.tool-btn:hover { color: var(--accent); transform: scale(1.06); }
.tool-btn.is-on { color: #fff; background: var(--accent); }

/* ---------- Chips / tags / badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips--lg .chip { height: 42px; padding: 0 16px; font-size: 14.5px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--r-pill); border: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.chip:hover { border-color: var(--graphite-900); color: var(--text); }
.chip.is-active { background: var(--graphite-900); border-color: var(--graphite-900); color: #fff; }
.chip__n { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.chip.is-active .chip__n { color: rgba(255, 255, 255, .7); }
.chip__k { color: var(--text-3); }
.chip--removable { background: var(--accent-soft); border-color: #f5cfb7; color: var(--accent-hover); }
.chip--removable:hover { border-color: var(--accent); color: var(--accent-hover); }
.chip--dark { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); color: #fff; }
.chip--dark:hover, .chip--dark.is-active { background: #fff; color: var(--graphite-900); border-color: #fff; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-sm); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; background: var(--steel-100); color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.tag--accent { background: var(--accent); color: #fff; }
.tag--dark { background: var(--graphite-900); color: #fff; }
.tag--info { background: var(--info-bg); color: var(--info); }
.tag--warn { background: var(--warn-bg); color: var(--warn); }
.tag--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text-2); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; }
.grade-chip { display: inline-block; min-width: 54px; padding: 2px 8px; border-radius: var(--r-sm); background: var(--graphite-900); color: #fff; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; text-align: center; }
.file-badge { display: inline-block; padding: 2px 7px; border-radius: 3px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; background: var(--steel-100); color: var(--text-2); }
.file-badge--pdf { background: #fde8e6; color: #a8231a; }
.file-badge--csv { background: #e6f4ec; color: #13743c; }
.file-badge--dxf { background: #e7f0fa; color: #1a5aa0; }

/* Availability */
.avail { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--success); }
.avail__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(19, 116, 60, .15); flex: none; }
.avail--low-stock { color: var(--warn); }
.avail--low-stock .avail__dot { background: var(--warn-dot); box-shadow: 0 0 0 3px rgba(227, 160, 8, .2); }
.avail--on-order { color: var(--info); }
.avail--on-order .avail__dot { box-shadow: 0 0 0 3px rgba(26, 90, 160, .15); }
.avail--out-of-stock { color: var(--danger); }
.avail--out-of-stock .avail__dot { box-shadow: 0 0 0 3px rgba(180, 35, 24, .15); }

/* Status */
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--steel-100); color: var(--text-2); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--new { background: var(--info-bg); color: var(--info); }
.status--processing, .status--in-review { background: var(--warn-bg); color: var(--warn); }
.status--shipped, .status--quoted { background: #efe9fb; color: #5b3aa8; }
.status--completed, .status--accepted { background: var(--success-bg); color: var(--success); }
.status--cancelled, .status--rejected { background: var(--danger-bg); color: var(--danger); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s5); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid--doc { grid-template-columns: 1.4fr 1fr; align-items: end; padding-block: var(--s2); border-bottom: 1px solid var(--border); }
.field--full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid, .form-grid--3, .form-grid--4, .form-grid--doc { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.field__req { color: var(--accent); }
.field__opt { font-weight: 400; color: var(--text-3); font-size: 12.5px; }
.field__hint { font-size: 12.5px; color: var(--text-3); margin: 0; }
.field__error { font-size: 12.5px; color: var(--danger); margin: 0; min-height: 0; }
.field__error:empty { display: none; }
.input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r); background: #fff; color: var(--text); font-size: 15px; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: #98a2ad; }
.input:hover { border-color: var(--steel-400); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-ring); }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }
.input--sm { height: 36px; font-size: 14px; padding: 0 10px; }
.input--num { width: 100px; }
.select { position: relative; }
.select select { padding-right: 36px; cursor: pointer; }
.select > .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-3); }
.select--inline { display: inline-block; }
.select--inline select { width: auto; }
input[type=number]::-webkit-inner-spin-button { opacity: .4; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; line-height: 1.45; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box { flex: none; width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: #fff; display: grid; place-items: center; color: transparent; transition: all .15s; margin-top: 1px; }
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); color: #fff; }
.check input:focus-visible + .check__box { outline: 2px solid var(--brand); outline-offset: 2px; }
.check input:disabled ~ * { opacity: .45; cursor: not-allowed; }
.check input.is-invalid + .check__box { border-color: var(--danger); }
.field--check { gap: 4px; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3) var(--s4); margin-bottom: var(--s5); }
@media (max-width: 720px) { .check-grid { grid-template-columns: minmax(0, 1fr); } }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14.5px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch__ui { width: 42px; height: 24px; border-radius: 12px; background: var(--steel-300); position: relative; transition: background .2s; flex: none; }
.switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .2s var(--ease); }
.switch input:checked + .switch__ui { background: var(--accent); }
.switch input:checked + .switch__ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch-list { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s5); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r); background: #fff; height: 44px; overflow: hidden; }
.qty__btn { width: 38px; height: 100%; display: grid; place-items: center; color: var(--text-2); transition: background .15s; }
.qty__btn:hover { background: var(--steel-100); color: var(--text); }
.qty__input { width: 56px; height: 100%; border: 0; border-inline: 1px solid var(--border); text-align: center; font-weight: 600; font-family: var(--font-mono); -moz-appearance: textfield; }
.qty__input::-webkit-inner-spin-button, .qty__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty__input:focus { outline: none; background: var(--accent-soft); }
.file-drop { position: relative; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--steel-50); transition: border-color .15s, background .15s; }
.file-drop:hover, .file-drop:focus-within { border-color: var(--brand); background: var(--accent-soft); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-drop__ui { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--s5); text-align: center; color: var(--text-2); font-weight: 600; font-size: 14px; pointer-events: none; }
.file-drop__ui small { font-weight: 400; color: var(--text-3); font-size: 12.5px; }
.file-drop__list { padding: 0 var(--s4) var(--s3); display: flex; flex-direction: column; gap: 4px; }
.file-drop__list li { display: flex; align-items: center; gap: 8px; font-size: 13px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 10px; }
.file-drop__list li small { color: var(--text-3); margin-left: auto; }
.file-drop__list li.is-error { border-color: var(--danger); color: var(--danger); }
.form-error { color: var(--danger); font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; margin-top: var(--s3); }
.form-foot { margin-top: var(--s5); }

/* Segmented */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; background: #fff; }
.seg__btn { width: 38px; height: 36px; display: grid; place-items: center; color: var(--text-3); }
.seg__btn + .seg__btn { border-left: 1px solid var(--border); }
.seg__btn.is-active { background: var(--graphite-900); color: #fff; }
.seg--full { display: flex; margin-bottom: var(--s5); }
.seg__opt { flex: 1; position: relative; cursor: pointer; }
.seg__opt input { position: absolute; opacity: 0; }
.seg__opt span { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.seg__opt + .seg__opt { border-left: 1px solid var(--border); }
.seg__opt input:checked + span { background: var(--graphite-900); color: #fff; }
.seg__opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -3px; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r-lg); background: #fff; }
.table-wrap:focus-visible { outline: 2px solid var(--brand); }
.table { font-size: 14px; }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table thead th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); background: var(--steel-50); white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody th { font-weight: 600; }
.table--zebra tbody tr:nth-child(even) { background: var(--steel-50); }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbfc; }

/* Spec table */
.spec-table { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: #fff; }
.spec-table__row { display: grid; grid-template-columns: minmax(140px, 40%) 1fr; border-bottom: 1px solid var(--border); }
.spec-table__row:last-child { border-bottom: 0; }
.spec-table__row:nth-child(odd) { background: var(--steel-50); }
.spec-table dt { padding: 11px 16px; font-size: 13.5px; color: var(--text-3); font-weight: 500; }
.spec-table dd { padding: 11px 16px; font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.spec-table dd .muted { font-weight: 400; }
@media (max-width: 520px) { .spec-table__row { grid-template-columns: minmax(0, 1fr); } .spec-table dt { padding-bottom: 0; } .spec-table dd { padding-top: 2px; } }

/* ---------- Notices ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--info-bg); color: var(--info); font-size: 14px; margin-bottom: var(--s4); }
.notice .icon { flex: none; margin-top: 2px; }
.notice p { margin: 0; color: inherit; }
.notice strong { display: block; margin-bottom: 2px; }
.notice--soft { background: var(--steel-50); color: var(--text-2); border: 1px solid var(--border); }
.notice--warn { background: var(--warn-bg); color: var(--warn); }
.notice--error { background: var(--danger-bg); color: var(--danger); }

/* ---------- Checklist ---------- */
.checklist { display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--text-2); }
.checklist .icon { flex: none; color: var(--accent); margin-top: 3px; }
.checklist--light li { color: var(--text-inv-2); }
.checklist--light .icon { color: var(--accent-bright); }

/* ---------- Empty state ---------- */
.empty { max-width: 560px; margin: 0 auto; text-align: center; padding: var(--s7) var(--s4); }
.empty__icon { width: 72px; height: 72px; margin: 0 auto var(--s5); border-radius: 50%; background: var(--steel-100); color: var(--text-3); display: grid; place-items: center; position: relative; }
.empty__icon::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px dashed var(--border-strong); }
.empty__title { font-size: 24px; margin-bottom: var(--s2); }
.empty__text { color: var(--text-2); }
.empty__list { display: inline-flex; flex-direction: column; gap: 8px; text-align: left; margin: var(--s4) 0 0; }
.empty__list li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; color: var(--text-2); }
.empty__list .icon { color: var(--accent); flex: none; }
.empty__list a, .empty__list button { color: var(--accent); font-weight: 600; }
.empty__actions { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; margin-top: var(--s5); }

/* ---------- Skeleton / spinner ---------- */
.card-skel { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0 0 var(--s4); background: #fff; overflow: hidden; }
.skel { background: linear-gradient(90deg, var(--steel-100) 25%, var(--steel-50) 50%, var(--steel-100) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 4px; }
.skel--img { aspect-ratio: 4 / 3; border-radius: 0; margin-bottom: var(--s4); }
.skel--line { height: 12px; margin: 10px var(--s4) 0; }
.skel--short { width: 50%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { display: inline-block; width: 22px; height: 22px; border: 2px solid var(--steel-200); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------- Reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Progress ---------- */
.progress { height: 6px; border-radius: 3px; background: var(--steel-150); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s var(--ease); }

/* ---------- Avatar ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--graphite-900); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-family: var(--font-head); flex: none; }

/* ---------- Art (SVG renders) ---------- */
.art { width: 100%; height: auto; }

/* ---------- Utility visibility ---------- */
@media (max-width: 1100px) { .hide-md { display: none !important; } }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
/* Engineering symbols are case-sensitive (d ≠ D, mm ≠ MM): keep header casing as written */
.table-wrap--tech .table thead th { text-transform: none; letter-spacing: .01em; font-size: 12.5px; }

