/* ==========================================================================
   UAboxes — калькуляторы (прототип).
   Палитра и типографика — с uaboxes.com.ua: #042C59 (темно-синий),
   #D2B48C (песочный), жёлтый из логотипа, Nunito Sans.
   ========================================================================== */

:root {
  --navy: #042c59;
  --navy-700: #06376a;
  --navy-900: #021d3b;
  --navy-soft: #eaf0f8;
  --navy-line: #d8e2ef;

  --tan: #d2b48c;
  --tan-dark: #a9824b;
  --tan-soft: #f8f1e5;
  --tan-line: #e7d7bc;

  --yellow: #ffe55c;
  --yellow-soft: #fff8d6;

  --ink: #10203a;
  --ink-2: #33465c;
  --muted: #6c7c90;
  --faint: #9aa8b8;

  --paper: #f4f6fa;
  --paper-2: #fbfcfe;
  --card: #ffffff;
  --line: #e3e9f1;
  --line-2: #cfd9e6;

  --warn: #8a5a16;
  --warn-soft: #fdf3e3;
  --warn-line: #f0dbb8;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(4, 44, 89, .05), 0 16px 36px -26px rgba(4, 44, 89, .38);
  --shadow-lift: 0 2px 4px rgba(4, 44, 89, .05), 0 26px 50px -30px rgba(4, 44, 89, .45);

  --font: "Nunito Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -12%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(900px 460px at 100% -6%, #f3ede1 0%, rgba(243, 237, 225, 0) 58%),
    var(--paper);
  font-size: 15.5px;
  line-height: 1.55;
  letter-spacing: -0.004em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.022em; line-height: 1.12; color: var(--navy); }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: var(--navy-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.shell { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

/* ------------------------------------------------------------------ topbar */

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--navy);
  border-bottom: 1px solid var(--line);
}

.appbar-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 70px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(4, 44, 89, .18);
  flex: none;
}
.brand-mark svg { display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; color: var(--navy); }
.brand-sub { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  background: #eff3f9;
  border: 1px solid var(--line);
  margin-left: auto;
  overflow: auto;
  scrollbar-width: none;
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
}
.segmented::-webkit-scrollbar { display: none; }

.segmented button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 9px 17px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.segmented button:hover { color: var(--navy); background: rgba(4, 44, 89, .05); }
.segmented button[aria-selected="true"] {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 6px rgba(4, 44, 89, .28);
}

/* ------------------------------------------------------------------ intro */

main { padding: 34px 0 72px; }

.intro { max-width: 780px; margin-bottom: 26px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tan-dark);
  margin-bottom: 12px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--tan); border-radius: 2px; }

h1 { font-size: clamp(30px, 4.2vw, 45px); }
h1 em {
  font-style: normal;
  color: var(--navy);
  background-image: linear-gradient(180deg, transparent 56%, var(--yellow) 56%, var(--yellow) 92%, transparent 92%);
  padding: 0 .07em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.lede {
  margin-top: 14px;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 660px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}
.facts b { color: var(--navy); font-weight: 800; font-size: 14px; }

/* ------------------------------------------------------------------ layout */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 22px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.controls { padding: 8px 22px 18px; }

.result {
  padding: 22px;
  position: sticky;
  top: 90px;
  box-shadow: var(--shadow-lift);
}

/* ------------------------------------------------------------------ steps */

.step { padding: 16px 0 18px; border-bottom: 1px dashed var(--line); }
.step:last-of-type { border-bottom: 0; }

.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.step-num {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--navy);
  background: var(--navy-soft);
  border-radius: 6px;
  padding: 3px 6px;
  letter-spacing: .04em;
}

.step-head h2 { font-size: 15px; font-weight: 800; color: var(--navy); }

.step-head output {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  background: var(--navy-soft);
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  padding: 3px 9px;
}

.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 9px; }
.hint b { color: var(--ink-2); font-weight: 800; }

/* ------------------------------------------------------------------ combo */

.combo { position: relative; }

.combo > input {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.combo > input:focus {
  outline: none;
  border-color: var(--navy);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(4, 44, 89, .12);
}

.combo-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  opacity: .55;
  color: var(--navy);
  pointer-events: none;
}

.combo-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0; right: 0;
  max-height: 316px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 24px 48px -22px rgba(4, 44, 89, .4);
  overscroll-behavior: contain;
}

.combo-group {
  padding: 8px 10px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

.combo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
}
.combo-item:hover, .combo-item[data-active="true"] { background: var(--navy-soft); }
.combo-item[aria-selected="true"] { background: var(--navy); color: #fff; }
.combo-item[aria-selected="true"] .combo-price { color: #cfe0f2; }
.combo-item[aria-selected="true"] .combo-type { color: #a9c2dd; }

.combo-dims { font-variant-numeric: tabular-nums; font-weight: 800; min-width: 108px; }
.combo-type { font-size: 11.5px; color: var(--muted); }
.combo-price { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--navy); }
.combo-empty { padding: 14px 12px; color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------ mini switch */

.mini-switch {
  margin-left: auto;
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 9px;
  background: #eff3f9;
  border: 1px solid var(--line);
}
.mini-switch button {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  transition: .15s ease;
}
.mini-switch button:hover { color: var(--navy); }
.mini-switch button.is-on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(4, 44, 89, .16); }

/* ------------------------------------------------------------------ dims */

.dims-row { display: flex; align-items: flex-end; gap: 8px; }
.dims-row label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.dims-row input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--paper-2);
  padding: 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.dims-row input:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 3px rgba(4, 44, 89, .12); }
.dims-row .unit { font-size: 12px; color: var(--faint); padding-bottom: 13px; }

/* ------------------------------------------------------------------ swatches */

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }

.swatch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  min-width: 78px;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.swatch:hover:not(:disabled) { border-color: var(--line-2); transform: translateY(-1px); }
.swatch[aria-pressed="true"] {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px var(--navy) inset;
}
.swatch-color {
  width: 100%;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(4, 44, 89, .12);
  background-image: linear-gradient(120deg, rgba(255, 255, 255, .22), rgba(0, 0, 0, .05));
}
.swatch-name { font-size: 11.5px; font-weight: 800; line-height: 1.2; color: var(--navy); }
.swatch-delta { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.swatch:disabled { opacity: .38; cursor: not-allowed; }

/* ------------------------------------------------------------------ range */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  margin: 2px 0 6px;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--navy) 0 var(--fill, 40%), #e5ebf3 var(--fill, 40%) 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--navy);
  box-shadow: 0 2px 6px rgba(4, 44, 89, .28);
  transition: transform .12s ease;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.08); }
input[type="range"]::-moz-range-track { height: 7px; border-radius: 999px; background: #e5ebf3; }
input[type="range"]::-moz-range-progress { height: 7px; border-radius: 999px; background: var(--navy); }
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--navy);
}

.qty-row { display: flex; align-items: center; gap: 10px; }

.qty-input {
  width: 96px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--paper-2);
  padding: 0 10px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.qty-input:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 3px rgba(4, 44, 89, .12); }

.presets { display: flex; gap: 5px; flex-wrap: wrap; }
.presets button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  transition: .15s ease;
}
.presets button:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-soft); }
.presets button.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ------------------------------------------------------------------ toggle */

.switch { margin-left: auto; position: relative; display: inline-flex; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  width: 48px; height: 28px;
  border-radius: 999px;
  background: #d9e1ec;
  box-shadow: inset 0 1px 2px rgba(4, 44, 89, .16);
  position: relative;
  transition: background .18s ease;
  display: block;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(4, 44, 89, .3);
  transition: transform .18s cubic-bezier(.3, .8, .3, 1);
}
.switch input:checked + span { background: var(--navy); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(4, 44, 89, .3); }
.switch input:disabled + span { opacity: .45; }

/* ------------------------------------------------------------------ demo */

.demo-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding-top: 14px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.demo-row button {
  border: 1px dashed var(--line-2);
  background: transparent;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  transition: .15s ease;
}
.demo-row button:hover { border-style: solid; border-color: var(--navy); color: var(--navy); background: var(--navy-soft); }

/* ------------------------------------------------------------------ result */

.result-head { display: flex; flex-direction: column; gap: 2px; }

.result-label {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 800;
}

.result-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.result-unit {
  font-size: clamp(38px, 5vw, 50px);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--navy);
}
.result-unit small { font-size: .42em; font-weight: 700; letter-spacing: -0.01em; color: var(--muted); margin-left: 2px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  background: var(--navy-soft);
  border: 1px solid var(--navy-line);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip--kraft { background: var(--tan-soft); border-color: var(--tan-line); color: #8a6a3b; }
.chip--ok { background: var(--navy-soft); border-color: var(--navy-line); color: var(--navy); }
.chip--warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }

.result-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

.rows { margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1px; }
.rows li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.rows li:last-child { border-bottom: 0; }
.row-name { color: var(--ink-2); }
.row-name span { color: var(--muted); font-size: 12px; display: block; }
.row-val { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--navy); }

.total-block {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--navy) 0%, #0a4177 100%);
  box-shadow: 0 10px 24px -16px rgba(4, 44, 89, .75);
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: #fff;
}
.total-block .total-label { font-size: 11.5px; color: rgba(255, 255, 255, .78); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.total-block .total-val { margin-left: auto; font-size: 25px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.total-block small { display: block; font-size: 11px; color: rgba(255, 255, 255, .62); font-weight: 600; letter-spacing: 0; text-transform: none; margin-top: 2px; }

.nudge {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 12px;
  background: var(--navy-soft);
  border: 1px solid var(--navy-line);
  border-left: 3px solid var(--tan);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--navy);
}
.nudge svg { flex: none; margin-top: 2px; }
.nudge b { font-weight: 800; }
.nudge button {
  margin-left: auto;
  align-self: center;
  flex: none;
  border: 1px solid var(--navy-line);
  background: #fff;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--navy);
  white-space: nowrap;
}
.nudge button:hover { border-color: var(--navy); }

.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.actions .btn-primary { flex: 1 1 180px; }

.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.btn-primary { background: var(--navy); color: #fff; border: 1px solid var(--navy); box-shadow: 0 2px 8px -2px rgba(4, 44, 89, .45); }
.btn-primary:hover { background: var(--navy-700); transform: translateY(-1px); }
.btn-ghost { background: #fff; border: 1px solid var(--line-2); color: var(--navy); }
.btn-ghost:hover { border-color: var(--navy); transform: translateY(-1px); }

.meta-strip {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 11.5px;
  color: var(--muted);
}
.meta-strip span { display: inline-flex; align-items: center; gap: 5px; }
.meta-strip b { color: var(--navy); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ ladder */

.ladder { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.ladder-title { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); font-weight: 800; margin-bottom: 10px; }

.ladder-row {
  display: grid;
  grid-template-columns: 46px 1fr 86px;
  align-items: center;
  gap: 9px;
  padding: 3px 0;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s ease;
}
.ladder-row:hover { background: var(--navy-soft); }
.ladder-qty { color: var(--muted); font-weight: 600; }
.ladder-bar { display: block; height: 7px; border-radius: 999px; background: #e9eef5; overflow: hidden; }
.ladder-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7f9cbd, var(--navy)); transition: width .35s ease; }
.ladder-price { text-align: right; font-weight: 800; color: var(--navy); white-space: nowrap; }
.ladder-price i { font-style: normal; font-size: 10px; color: var(--tan-dark); margin-left: 4px; font-weight: 800; }
.ladder-row.is-on .ladder-qty { color: var(--navy); font-weight: 800; }
.ladder-row.is-on .ladder-fill { background: linear-gradient(90deg, var(--tan), #b98f57); }
.ladder-row.is-on .ladder-price { color: var(--navy); }

/* ------------------------------------------------------------------ fit result */

.viz-wrap {
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 40%, #ffffff 0%, #f6f2ea 60%, #efe7d9 100%);
  border: 1px solid var(--line);
  padding: 8px;
  margin-bottom: 16px;
}
.viz-wrap svg { display: block; width: 100%; height: auto; }

.fit-best { display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.fit-best h2 { font-size: 27px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--navy); }
.fit-best p { font-size: 13px; color: var(--muted); }
.fit-best p b { color: var(--navy); }

.fit-list { margin: 4px 0 0; padding: 0; list-style: none; }

.fit-list-head {
  margin-top: 20px;
  padding-bottom: 8px;
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 800;
  border-bottom: 1px solid var(--line);
}

.fit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}
.fit-row:last-child { border-bottom: 0; }
.fit-name { font-size: 14.5px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.fit-sub { font-size: 11.5px; color: var(--muted); }
.fit-price { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; color: var(--navy); }
.fit-price small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.fit-meter { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.fit-meter-bar { display: block; flex: 1; height: 6px; border-radius: 999px; background: #e9eef5; overflow: hidden; }
.fit-meter-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7f9cbd, var(--navy)); transition: width .35s ease; }
.fit-meter-val { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 54px; text-align: right; font-weight: 600; }
.fit-row.is-best { background: linear-gradient(90deg, rgba(234, 240, 248, .7), rgba(234, 240, 248, 0)); margin: 0 -10px; padding: 13px 10px; border-radius: 12px; }
.fit-row .to-tirage {
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--navy);
}
.fit-row .to-tirage:hover { border-color: var(--navy); }

.fit-custom {
  margin-top: 16px;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px dashed var(--tan-line);
  background: var(--tan-soft);
  font-size: 12.5px;
  color: #6b4f2b;
  line-height: 1.5;
}
.fit-custom b { font-weight: 800; color: #523a1c; }
.fit-custom .fit-custom-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.fit-custom .btn-ghost { height: 36px; font-size: 12.5px; padding: 0 12px; border-color: var(--tan-line); color: #6b4f2b; }

.alt-hint {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 1px dashed var(--line-2);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
}
.alt-hint b { font-weight: 800; color: var(--navy); }
.alt-hint .to-tirage {
  margin-left: auto;
  flex: none;
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--navy);
}
.alt-hint .to-tirage:hover { border-color: var(--navy); }

.empty-state {
  padding: 26px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  background: var(--paper-2);
}
.empty-state b { color: var(--navy); display: block; font-size: 15px; margin-bottom: 6px; font-weight: 800; }

/* ------------------------------------------------------------------ footer */

.footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: baseline;
}
.footer b { color: var(--navy); font-weight: 800; }

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 18px);
  background: var(--navy);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 18px 40px -18px rgba(4, 44, 89, .7);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 90;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr; }
  .result { position: static; }
}

@media (max-width: 660px) {
  .shell { padding: 0 16px; }
  .appbar-inner { height: auto; padding: 9px 0; gap: 10px; flex-wrap: wrap; }
  .brand-sub { display: none; }
  .segmented { width: 100%; margin-left: 0; }
  .segmented button { flex: 1; padding: 8px 10px; font-size: 12.5px; }
  main { padding: 20px 0 48px; }
  h1 { font-size: 30px; }
  .lede { font-size: 15px; }
  .controls { padding: 4px 16px 14px; }
  .result { padding: 18px; }
  .dims-row { flex-wrap: wrap; }
  .dims-row label { flex: 1 1 28%; }
  .swatch { min-width: 72px; flex: 1; }
  .result-unit { font-size: 40px; }
  .actions .btn-primary, .actions .btn-ghost { flex: 1 1 100%; }
  .total-block { flex-wrap: wrap; }
  .total-block .total-val { margin-left: 0; width: 100%; }
  .nudge { flex-wrap: wrap; }
  .nudge button { margin-left: 0; }
  .alt-hint { flex-wrap: wrap; }
  .alt-hint .to-tirage { margin-left: 0; }
}

@media print {
  .appbar, .controls, .demo-row, .footer, .toast, .actions, .nudge button { display: none !important; }
  body { background: #fff; }
  .grid { display: block; }
  .result { border: 0; box-shadow: none; position: static; padding: 0; }
  .card { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
