/* ============================================================================
   DeliveryGoods — /calculator page body styles.
   Ported from the calculator redesign mockup (_mockup/calc/project/styles.css).

   Scoped entirely under `.calc-page` so the mockup's own design tokens and
   page-body rules never clobber the site-wide design system (tokens/base/ui).
   The shared header, footer and global CSS come from base.html — those rules
   (header, logo, nav, burger, footer and the global button styles) are
   intentionally NOT ported here.

   Class names (calc-card, body.sel, route, point, res-*, map-card, etc.) are a
   hard contract with calculator.html + its JS — do NOT rename them.
   ============================================================================ */

/* ===== Local design tokens (mockup :root → scoped to .calc-page) ===== */
.calc-page {
  /* Brand */
  --brand: #1f9d57;
  --brand-strong: color-mix(in srgb, var(--brand) 80%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 13%, #fff);
  --brand-softer: color-mix(in srgb, var(--brand) 6%, #fff);

  /* Surfaces */
  --bg: #f3f6f9;
  --card: #ffffff;
  --card-2: #f7f9fb;
  --line: #e6eaf0;
  --line-2: #eef1f5;

  /* Result (dark) panel */
  --dark: #161a22;
  --dark-2: #1f2530;
  --dark-line: #2c333f;

  /* Text */
  --ink: #1b1e26;
  --ink-2: #515967;
  --ink-3: #6b7280; /* было #8a909c (~3:1) → ~4.6:1 на карточке #f7f9fb (WCAG AA) */
  --on-dark: #f4f6f9;
  --on-dark-2: #9aa3b2;

  /* Geometry */
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --pad: 28px;
  --maxw: 1180px;

  --shadow-card: 0 1px 2px rgba(20, 28, 40, .04), 0 12px 28px -16px rgba(20, 28, 40, .18);
  --shadow-pop: 0 24px 60px -24px rgba(20, 28, 40, .35);

  /* Inherit the site font token (Manrope) instead of the mockup's hard-coded --font */
  font-family: var(--font-text, "Manrope", system-ui, sans-serif);
  color: var(--ink);
  line-height: 1.55;
}

.calc-page * { box-sizing: border-box; }
.calc-page a { color: inherit; text-decoration: none; }
.calc-page button { font-family: inherit; cursor: pointer; }
.calc-page input { font-family: inherit; }
.calc-page .wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ===================== Hero ===================== */
.calc-page .hero { padding: 40px 0 0; }
.calc-page .hero-head { max-width: 760px; display: flex; flex-direction: column; align-items: flex-start; }
.calc-page .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-strong); background: var(--brand-soft);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.calc-page .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.calc-page .hero h1 {
  font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.025em;
  font-weight: 800; margin: 0 0 14px; max-width: 100%;
}
.calc-page .hero h1 .accent { color: var(--brand); }
.calc-page .hero p.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); margin: 0; max-width: 560px; text-wrap: pretty; }
.calc-page .pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.calc-page .pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 15px; font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.calc-page .pill svg { width: 15px; height: 15px; color: var(--brand); }

/* ===================== Calculator ===================== */
.calc-page .calc { margin: 26px 0 0; }
.calc-page .calc-card {
  display: grid; grid-template-columns: 1.18fr .82fr; gap: 16px; align-items: start;
}
.calc-page .calc-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: var(--pad); }
.calc-page .calc-result { background: var(--dark); color: var(--on-dark); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: var(--pad); display: flex; flex-direction: column; position: sticky; top: 84px; }

/* section label */
.calc-page .fld-group + .fld-group { margin-top: 26px; }
.calc-page .sec-label { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.calc-page .sec-label .ix { width: 22px; height: 22px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-size: 12px; }

/* Route timeline */
.calc-page .route { position: relative; }
.calc-page #routePoints { position: relative; }
.calc-page .route-line { position: absolute; left: 11px; width: 2px; background: linear-gradient(var(--brand), var(--line)); border-radius: 2px; z-index: 0; }
.calc-page .point { position: static; display: block; }
.calc-page .point + .point { margin-top: 14px; }
.calc-page .point .lbl { margin: 0 0 6px 38px; }
.calc-page .point-row { display: flex; align-items: center; gap: 14px; }
.calc-page .point-row .rel { flex: 1; min-width: 0; }
.calc-page .point .node { flex: none; width: 24px; height: 24px; display: grid; place-items: center; z-index: 1; }
.calc-page .point .node .ring { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); }
.calc-page .point.is-dest .node .ring { border-color: var(--ink); background: var(--ink); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
.calc-page .point.is-mid .node .ring { width: 10px; height: 10px; border: 3px solid var(--ink-3); }
.calc-page .fieldwrap { flex: 1; min-width: 0; }
.calc-page .lbl { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 0 6px; }
.calc-page .lbl .req { color: var(--brand); }
.calc-page .inp {
  width: 100%; height: 50px; border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--card-2); padding: 0 14px; font-size: 16px; color: var(--ink);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.calc-page .inp::placeholder { color: var(--ink-3); }
.calc-page .inp:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.calc-page .inp.has-suffix { padding-right: 42px; }
.calc-page .inp-suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 14px; font-weight: 600; pointer-events: none; }
.calc-page .rel { position: relative; }
.calc-page .point .x { flex: none; width: 44px; height: 50px; margin-top: 0; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-3); display: none; place-items: center; }
.calc-page .point.is-mid .x { display: grid; }
.calc-page .point .x:hover { color: #e0524d; border-color: #f3c7c5; background: #fdf2f2; }
.calc-page .point .x svg { width: 15px; height: 15px; }
.calc-page .add-point { display: inline-flex; align-items: center; gap: 7px; margin: 12px 0 0 38px; font-size: 14px; font-weight: 700; color: var(--brand-strong); background: none; border: none; padding: 4px 0; white-space: nowrap; }
.calc-page .add-point svg { width: 16px; height: 16px; }
.calc-page .add-point:hover { color: var(--brand); }
.calc-page .add-point[disabled] { color: var(--ink-3); cursor: not-allowed; }

/* swap button */
.calc-page .swap { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; z-index: 3; box-shadow: var(--shadow-card); }
.calc-page .swap svg { width: 16px; height: 16px; color: var(--ink-2); transition: transform .25s; }
.calc-page .swap:hover svg { color: var(--brand); transform: rotate(180deg); }

/* Cargo */
.calc-page .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc-page .field .lbl { margin-bottom: 6px; }

/* weight slider */
.calc-page .cargo-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* ui.css adds margin to every adjacent .field; grid items must stay level. */
.calc-page .cargo-fields > .field { margin-top: 0; }
.calc-page .weight-slider { margin-top: 18px; }
.calc-page .weight-row { display: flex; align-items: center; gap: 10px; }
.calc-page .weight-row .rel { flex: none; width: 130px; }
.calc-page .range { width: 100%; -webkit-appearance: none; appearance: none; accent-color: var(--brand); height: 6px; border-radius: 999px; background: var(--line); outline: none; }
.calc-page .range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 5px solid var(--brand); box-shadow: var(--shadow-card); cursor: pointer; margin-top: 0; }
.calc-page .range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 5px solid var(--brand); cursor: pointer; }
.calc-page .weight-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin: 8px 2px 0; font-weight: 600; }
.calc-page .vol-block { margin-top: 18px; }
.calc-page .vol-field { max-width: 220px; }

/* Body type chips */
.calc-page .bodies { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calc-page .body {
  position: relative; text-align: left; border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--card-2); padding: 12px 13px; transition: border-color .15s, background .15s, transform .1s;
}
.calc-page .body:hover { border-color: #cfd6e0; }
.calc-page .body .bname { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.calc-page .body .bname svg { width: 17px; height: 17px; color: var(--ink-3); }
.calc-page .body .bnote { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.calc-page .body .bcheck { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.calc-page .body .bcheck svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.calc-page .body.sel { border-color: var(--brand); background: var(--brand-softer); }
.calc-page .body.sel .bname svg { color: var(--brand-strong); }
.calc-page .body.sel .bcheck { background: var(--brand); border-color: var(--brand); }
.calc-page .body.sel .bcheck svg { opacity: 1; }

/* Advanced collapsible */
.calc-page .adv-toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; font-size: 14px; font-weight: 700; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; }
.calc-page .adv-toggle svg { width: 16px; height: 16px; transition: transform .2s; }
.calc-page .adv-toggle.open svg.chev { transform: rotate(180deg); }
.calc-page .adv-toggle:hover { color: var(--ink); border-color: #cfd6e0; }
.calc-page .adv { display: none; margin-top: 16px; padding: 18px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--card-2); }
.calc-page .adv.open { display: block; }
.calc-page .adv .sub { font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.calc-page .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calc-page .markup-row { margin-top: 16px; }
.calc-page .markup-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.calc-page .markup-head .val { font-weight: 800; color: var(--brand-strong); }
.calc-page .range.markup::-webkit-slider-thumb { border-color: var(--ink); }
.calc-page .range.markup::-moz-range-thumb { border-color: var(--ink); }
.calc-page .hint { font-size: 12px; color: var(--ink-3); margin-top: 7px; }

/* ===================== Result panel ===================== */
.calc-page .res-top { display: flex; align-items: center; justify-content: space-between; }
.calc-page .res-kicker { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--on-dark-2); white-space: nowrap; }
.calc-page .res-badge { font-size: 11px; font-weight: 700; color: var(--brand); background: rgba(47, 191, 115, .13); border: 1px solid rgba(47, 191, 115, .25); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.calc-page .res-route { margin: 18px 0 0; }
.calc-page .res-route .r-from, .calc-page .res-route .r-to { font-size: 18px; font-weight: 700; }
.calc-page .res-route .r-arrow { color: var(--on-dark-2); margin: 0 4px; }
.calc-page .res-route .r-empty { color: var(--on-dark-2); font-weight: 600; font-size: 16px; }
.calc-page .res-price-wrap { margin-top: 16px; }
.calc-page .res-price { font-size: clamp(34px, 4.5vw, 46px); font-weight: 800; letter-spacing: -.02em; line-height: 1; display: flex; align-items: baseline; gap: 4px; }
.calc-page .res-price .cur { font-size: .6em; color: var(--on-dark-2); font-weight: 700; }
.calc-page .res-price.placeholder { color: var(--on-dark-2); }
.calc-page .res-meta { font-size: 13px; color: var(--on-dark-2); margin-top: 10px; }
.calc-page .res-market { margin-top: 16px; padding: 13px 14px; border: 1px solid var(--dark-line); border-radius: var(--r-md); background: rgba(255,255,255,.035); }
.calc-page .res-market[hidden] { display: none; }
.calc-page .res-market-range { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.calc-page .res-market-range span { color: var(--on-dark-2); font-size: 12px; font-weight: 600; }
.calc-page .res-market-range strong { color: var(--on-dark); font-size: 16px; white-space: nowrap; }
.calc-page .res-market-source { color: var(--on-dark-2); font-size: 11.5px; line-height: 1.45; margin-top: 5px; }
.calc-page .res-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 18px; background: var(--dark-line); border: 1px solid var(--dark-line); border-radius: var(--r-md); overflow: hidden; }
.calc-page .res-stat { background: var(--dark-2); padding: 13px 15px; }
.calc-page .res-stat .k { font-size: 12px; color: var(--on-dark-2); font-weight: 600; }
.calc-page .res-stat .v { font-size: 20px; font-weight: 800; margin-top: 2px; }
.calc-page .res-cta { margin-top: 24px; padding-top: 0; display: flex; flex-direction: column; gap: 10px; }
.calc-page .btn-order { width: 100%; height: 52px; border-radius: var(--r-md); background: var(--brand); color: #fff; font-size: 16px; font-weight: 800; border: none; display: inline-flex; align-items: center; justify-content: center; gap: 9px; box-shadow: 0 10px 24px -10px rgba(31, 157, 87, .8); transition: background .15s, transform .12s; }
.calc-page .btn-order:hover { background: var(--brand-strong); transform: translateY(-1px); }
.calc-page .btn-order:disabled { background: var(--dark-2); color: var(--on-dark-2); box-shadow: none; cursor: not-allowed; transform: none; }
.calc-page .btn-order svg { width: 19px; height: 19px; }
.calc-page .res-actions { display: flex; gap: 10px; }
.calc-page .res-act { flex: 1; height: 44px; border-radius: var(--r-md); background: transparent; border: 1px solid var(--dark-line); color: var(--on-dark); font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, border-color .15s; position: relative; }
.calc-page .res-act:hover { background: var(--dark-2); border-color: #3a4350; }
.calc-page .res-act svg { width: 16px; height: 16px; color: var(--on-dark-2); }
.calc-page .res-act.done svg { color: var(--brand); }
.calc-page .res-act.done { border-color: var(--brand); }
/* hover tooltip explaining the action */
.calc-page .res-act[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(5px);
  width: 230px; max-width: 78vw; background: #fff; color: var(--ink);
  font-size: 12px; font-weight: 600; line-height: 1.45; text-align: left;
  padding: 11px 13px; border-radius: 11px; box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s; z-index: 70;
}
.calc-page .res-act[data-tip]::before {
  content: ""; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #fff;
  opacity: 0; transition: opacity .16s; z-index: 71; pointer-events: none;
}
.calc-page .res-act[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.calc-page .res-act[data-tip]:hover::before { opacity: 1; }
.calc-page .res-actions-hint { font-size: 12px; color: var(--on-dark-2); line-height: 1.5; margin: 12px 0 0; }
.calc-page .res-disc { font-size: 11.5px; color: var(--on-dark-2); margin-top: 16px; line-height: 1.5; display: flex; gap: 8px; }
.calc-page .res-disc svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--on-dark-2); }

/* ===================== Route map ===================== */
.calc-page .map-card { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.calc-page .map-card[hidden] { display: none; }
.calc-page .map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 14px; }
.calc-page .map-head h3 { margin: 0; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 9px; letter-spacing: -.01em; white-space: nowrap; }
.calc-page .map-head h3 svg { width: 18px; height: 18px; color: var(--brand); }
.calc-page .map-sub { color: var(--ink-3); font-size: 13px; font-weight: 700; white-space: nowrap; }
.calc-page #map { height: 400px; width: 100%; background: #eef1f5; z-index: 0; }
.calc-page .pin { border-radius: 50%; box-shadow: 0 2px 7px rgba(20, 28, 40, .4); }
.calc-page .pin-start { width: 18px; height: 18px; background: var(--brand); border: 4px solid #fff; }
.calc-page .pin-end { width: 18px; height: 18px; background: var(--ink); border: 4px solid #fff; }
.calc-page .pin-mid { width: 13px; height: 13px; background: var(--ink-3); border: 3px solid #fff; }
.calc-page .leaflet-container { font-family: inherit; }

/* ===================== Stats band ===================== */
.calc-page .stats { margin: 22px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.calc-page .stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 24px; }
.calc-page .stat .num { font-size: 30px; font-weight: 800; color: var(--brand); letter-spacing: -.02em; }
.calc-page .stat .cap { font-size: 14px; color: var(--ink-2); margin-top: 2px; font-weight: 600; }

/* ===================== Content sections ===================== */
.calc-page .content { padding: 56px 0 30px; }
.calc-page .sec { margin-bottom: 26px; }
.calc-page .sec-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 38px 40px; box-shadow: var(--shadow-card); }
.calc-page .sec-card.audience { border-left: 4px solid var(--brand); }
.calc-page .sec h2 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; }
.calc-page .sec .sub { color: var(--ink-2); font-size: 16px; margin: 0 0 26px; max-width: 760px; }
.calc-page .sec h3 { font-size: 19px; font-weight: 800; margin: 0 0 8px; letter-spacing: -.01em; }
.calc-page .sec p { color: var(--ink-2); margin: 0 0 14px; }
.calc-page .feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }
.calc-page .feat h3 { display: flex; align-items: center; gap: 10px; }
.calc-page .feat h3 .fi { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; flex: none; }
.calc-page .feat h3 .fi svg { width: 17px; height: 17px; }
.calc-page .clean-list { list-style: none; margin: 0; padding: 0; }
.calc-page .clean-list li { position: relative; padding-left: 26px; color: var(--ink-2); margin-bottom: 9px; }
.calc-page .clean-list li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 14px; height: 14px; background: var(--brand-soft); border-radius: 4px; }
.calc-page .clean-list li::after { content: ""; position: absolute; left: 6px; top: 11px; width: 5px; height: 8px; border-right: 2px solid var(--brand-strong); border-bottom: 2px solid var(--brand-strong); transform: rotate(40deg); }
.calc-page .tip { display: flex; gap: 12px; background: var(--brand-softer); border: 1px solid var(--brand-soft); border-radius: var(--r-md); padding: 16px 18px; margin-top: 20px; }
.calc-page .tip svg { width: 20px; height: 20px; color: var(--brand-strong); flex: none; margin-top: 1px; }
.calc-page .tip p { margin: 0; color: var(--ink); font-size: 14.5px; }
.calc-page .tip code { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 13px; }

/* factors */
.calc-page .factors { display: grid; gap: 0; }
.calc-page .factor { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 18px 0; border-top: 1px solid var(--line-2); }
.calc-page .factor:first-child { border-top: none; }
.calc-page .factor .ft { font-weight: 800; font-size: 16px; }
.calc-page .factor .fd { color: var(--ink-2); margin: 0; }

/* routes table */
.calc-page .routes-tbl { width: 100%; border-collapse: collapse; }
.calc-page .routes-tbl th { text-align: left; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 0 16px 14px; border-bottom: 1px solid var(--line); }
.calc-page .routes-tbl th.r, .calc-page .routes-tbl td.r { text-align: right; }
.calc-page .routes-tbl td { padding: 16px; border-bottom: 1px solid var(--line-2); }
.calc-page .routes-tbl tr:last-child td { border-bottom: none; }
.calc-page .routes-tbl tr.row:hover { background: var(--card-2); }
.calc-page .routes-tbl .rt-name { font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.calc-page .routes-tbl .rt-name svg { width: 15px; height: 15px; color: var(--ink-3); }
.calc-page .routes-tbl .rt-price { font-weight: 800; color: var(--brand-strong); white-space: nowrap; }
.calc-page .routes-tbl td.dim { color: var(--ink-2); }

/* bodies info */
.calc-page .body-info { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc-page .bcard { border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; background: var(--card-2); }
.calc-page .bcard .bh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.calc-page .bcard .bt { font-weight: 800; font-size: 16px; }
.calc-page .bcard .bp { font-size: 13px; font-weight: 700; color: var(--brand-strong); background: var(--brand-soft); padding: 3px 9px; border-radius: 999px; }
.calc-page .bcard p { margin: 0; font-size: 14px; }

/* FAQ */
.calc-page .faq-item { border-bottom: 1px solid var(--line-2); }
.calc-page .faq-q { width: 100%; text-align: left; background: none; border: none; padding: 20px 44px 20px 0; font-size: 17px; font-weight: 700; color: var(--ink); position: relative; }
.calc-page .faq-q::after { content: ""; position: absolute; right: 8px; top: 26px; width: 11px; height: 11px; border-right: 2.5px solid var(--ink-3); border-bottom: 2.5px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s; }
.calc-page .faq-item.open .faq-q::after { transform: rotate(-135deg); }
.calc-page .faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.calc-page .faq-a p { color: var(--ink-2); padding-bottom: 4px; }
.calc-page .faq-item.open .faq-a { max-height: 360px; padding-bottom: 18px; }

/* newsletter */
.calc-page .news { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; }
.calc-page .news-form { display: flex; gap: 10px; margin-top: 4px; }
.calc-page .news-form .inp { background: #fff; }
.calc-page .news .sub { margin-bottom: 16px; }
.calc-page .news small { color: var(--ink-3); display: block; margin-top: 10px; font-size: 12.5px; }

/* newsletter CTA — scoped so it never overrides the global/header .btn-primary */
.calc-page .btn-primary {
  border: none; border-radius: 11px; font-weight: 700; font-size: 15px;
  padding: 12px 20px; background: var(--brand); color: #fff;
  box-shadow: 0 8px 18px -8px rgba(31, 157, 87, .7);
  transition: transform .12s, box-shadow .15s, background .15s;
}
.calc-page .btn-primary:hover { background: var(--brand-strong); transform: translateY(-1px); }
.calc-page .btn-primary:active { transform: translateY(0); }

/* ===================== Toast ===================== */
.calc-page .toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 200; box-shadow: var(--shadow-pop); display: flex; align-items: center; gap: 9px; }
.calc-page .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.calc-page .toast svg { width: 17px; height: 17px; color: var(--brand); }

/* ===================== Modal ===================== */
.calc-page .modal-bg { position: fixed; inset: 0; background: rgba(20, 26, 34, .55); backdrop-filter: blur(4px); display: none; place-items: center; z-index: 150; padding: 20px; }
.calc-page .modal-bg.open { display: grid; }
/* transform:none и display:block — сбрасываем «протёкшие» глобальные правила
   лид-модалки (ui.css .modal{transform:translateY..} + .modal-head{display:flex}),
   из-за которых модалка заявки была смещена/сжата, а заголовок налезал на текст. */
.calc-page .modal { background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 460px; box-shadow: var(--shadow-pop); overflow: hidden; transform: none; border: 0; }
.calc-page .modal-head { padding: 26px 28px 0; display: block; }
.calc-page .modal-head h3 { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.calc-page .modal-head p { color: var(--ink-2); margin: 0; font-size: 15px; }
.calc-page .modal-body { padding: 22px 28px 28px; }
.calc-page .summary { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 18px; }
.calc-page .summary .row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.calc-page .summary .row .k { color: var(--ink-2); }
.calc-page .summary .row .v { font-weight: 700; }
.calc-page .summary .row .v.price { color: var(--brand-strong); }
.calc-page .modal label.lbl { margin-top: 12px; }
.calc-page .modal .inp { background: #fff; }
.calc-page .check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: 13px; color: var(--ink-2); }
.calc-page .check input { margin-top: 2px; }
.calc-page .modal .close { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border-radius: 9px; border: none; background: var(--card-2); display: grid; place-items: center; }
.calc-page .modal .close svg { width: 18px; height: 18px; color: var(--ink-2); }
.calc-page .modal-card-rel { position: relative; }

/* minimal ghost button — modal success "Закрыть" (scoped, not the header ghost) */
.calc-page .btn-ghost {
  border: 1px solid var(--line); border-radius: 11px; font-weight: 700; font-size: 15px;
  padding: 12px 20px; background: transparent; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.calc-page .btn-ghost:hover { background: #fff; color: var(--ink); }

/* ===================== Production niceties ===================== */
/* input validation states */
.calc-page .inp.has-error, .calc-page .has-error .inp { border-color: #e0524d; box-shadow: 0 0 0 4px rgba(224, 82, 77, .12); }
/* display:block перебивает глобальный ui.css `.field-error{display:none}`, иначе
   все inline-ошибки на /calculator невидимы. Скрытие — через атрибут [hidden]. */
.calc-page .field-error { color: #d23b36; font-size: 12.5px; font-weight: 600; margin-top: 6px; display: block; }
.calc-page .field-error[hidden] { display: none; }

/* city autocomplete dropdown (anchors to .point .rel / .rel which are position:relative) */
.calc-page .suggestions {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-pop); max-height: 260px; overflow-y: auto; display: none;
}
.calc-page .suggestions.active { display: block; }
.calc-page .suggestion-item { padding: 11px 14px; font-size: 14.5px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.calc-page .suggestion-item:last-child { border-bottom: 0; }
.calc-page .suggestion-item:hover, .calc-page .suggestion-item.highlighted { background: var(--brand-softer); color: var(--brand-strong); }
.calc-page .suggestion-empty { padding: 12px 14px; font-size: 13.5px; color: var(--ink-3); text-align: center; }

/* inline calculation alerts (errors / weight warnings, etc.) */
.calc-page .calc-alert { margin-top: 14px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; border: 1px solid #e0524d; background: rgba(224, 82, 77, .08); color: var(--ink); }
.calc-page .calc-alert--warn { border-color: #caa23a; background: rgba(202, 162, 58, .12); }
.calc-page .calc-alert[hidden] { display: none; }
.calc-page .calc-manual { width: 100%; min-height: 46px; margin-top: 10px; border: 1.5px solid var(--brand); border-radius: var(--r-md); background: var(--brand-softer); color: var(--brand-strong); font: inherit; font-size: 14px; font-weight: 800; }
.calc-page .calc-manual:hover { background: var(--brand-soft); }
.calc-page .calc-manual[hidden] { display: none; }

/* ===================== Responsive ===================== */
@media (max-width: 980px) {
  .calc-page .calc-card { grid-template-columns: 1fr; }
  .calc-page .calc-result { order: 0; position: static; }
  .calc-page .feat-grid,
  .calc-page .body-info,
  .calc-page .news { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .calc-page .wrap { padding: 0 16px; }
  .calc-page .hero { padding: 26px 0 0; }
  .calc-page { --pad: 20px; }
  .calc-page .stats { grid-template-columns: 1fr 1fr; }
  .calc-page #map { height: 300px; }
  .calc-page .bodies { grid-template-columns: 1fr 1fr; }
  .calc-page .grid-3 { grid-template-columns: 1fr 1fr; }
  .calc-page .factor { grid-template-columns: 1fr; gap: 4px; }
  .calc-page .sec-card { padding: 26px 22px; }
  .calc-page .routes-tbl th.hide-m, .calc-page .routes-tbl td.hide-m { display: none; }
  .calc-page .vol-field { max-width: 170px; }
  .calc-page .adv-toggle { width: 100%; justify-content: center; }
  .calc-page .res-market-range { align-items: flex-start; flex-direction: column; gap: 4px; }
  .calc-page .res-market-range strong { white-space: normal; }
  .calc-page .routes-tbl td { padding: 14px 4px; }
  .calc-page .routes-tbl .rt-name { display: inline; font-size: 14.5px; }
  .calc-page .routes-tbl .rt-name svg { display: none; }
  .calc-page .news-form { flex-direction: column; }
  /* tooltips would overflow narrow screens — the persistent hint line covers it */
  .calc-page .res-act[data-tip]::after, .calc-page .res-act[data-tip]::before { display: none; }
}

/* ===================== Saved calcs (favorites) ===================== */
.calc-page .saved-calcs { margin: 22px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 18px 22px; }
.calc-page .saved-calcs[hidden] { display: none; }
.calc-page .saved-head { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.calc-page .saved-head svg { width: 16px; height: 16px; color: var(--brand-strong); }
.calc-page .saved-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.calc-page .saved-item { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--card-2); transition: border-color .15s; }
.calc-page .saved-item:hover { border-color: #cfd6e0; }
.calc-page .saved-open { flex: 1; min-width: 0; text-align: left; background: none; border: none; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.calc-page .saved-route { font-weight: 700; font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-page .saved-meta { font-size: 12.5px; color: var(--ink-2); }
.calc-page .saved-meta b { color: var(--brand-strong); }
.calc-page .saved-del { flex: none; width: 42px; border: none; border-left: 1px solid var(--line); background: none; color: var(--ink-3); display: grid; place-items: center; }
.calc-page .saved-del:hover { color: #e0524d; background: #fdf2f2; }
.calc-page .saved-del svg { width: 15px; height: 15px; }
@media (max-width: 720px) { .calc-page .saved-list { grid-template-columns: 1fr; } }
.calc-page .order-steps { margin: 0 0 4px; padding-left: 22px; line-height: 1.9; color: var(--ink-2); }
.calc-page .order-steps li { margin-bottom: 4px; }
