:root {
  --calc-bg: #f5f6f8;
  --calc-surface: #ffffff;
  --calc-surface-soft: #f3f4f6;
  --calc-text: #111318;
  --calc-muted: #69707d;
  --calc-red: #ef1c25;
  --calc-red-dark: #b8141b;
  --calc-black: #111318;
  --calc-border: rgba(17, 19, 24, 0.1);
  --calc-border-strong: rgba(17, 19, 24, 0.16);
  --calc-shadow: 0 16px 45px rgba(17, 19, 24, 0.07);
}

* {
  box-sizing: border-box;
}

body.triumph-page {
  margin: 0;
  min-height: 100vh;
  background: var(--calc-bg);
  color: var(--calc-text);
  font-family: Inter, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.triumph-page .site-header {
  display: block;
}

button,
input,
select {
  font: inherit;
}

.import-calc-shell {
  width: min(1280px, calc(100% - 4rem));
  margin: 1rem auto 2.2rem;
  display: grid;
  gap: 18px;
}

.import-calc-hero,
.calc-flow-card,
.result-card,
.empty-result-card,
.breakdown-card {
  border: 1px solid var(--calc-border);
  border-radius: 24px;
  background: var(--calc-surface);
  box-shadow: var(--calc-shadow);
}

.import-calc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  padding: 30px 34px;
}

.brand-pill {
  width: fit-content;
  margin: 0 0 14px;
  border: 1px solid rgba(239, 28, 37, 0.2);
  border-radius: 999px;
  background: #fff;
  color: var(--calc-red);
  padding: 6px 16px;
  font-size: 14px;
  line-height: 18px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.import-calc-hero h1 {
  max-width: 1040px;
  margin: 0;
  font-family: Manrope, Inter, sans-serif;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: 0;
}

.import-calc-hero p:not(.brand-pill) {
  max-width: 850px;
  margin: 14px 0 0;
  color: #475163;
  font-size: 17px;
  line-height: 1.55;
  font-weight: 500;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mode-tabs button,
.button-grid button,
.reset-button {
  min-width: 0;
  min-height: 56px;
  border: 1px solid var(--calc-border-strong);
  border-radius: 16px;
  background: #fff;
  color: var(--calc-text);
  padding: 0 18px;
  cursor: pointer;
  font-size: 15px;
  line-height: 20px;
  font-weight: 800;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.mode-tabs button:hover,
.button-grid button:hover,
.reset-button:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 28, 37, 0.32);
  box-shadow: 0 12px 28px rgba(17, 19, 24, 0.06);
}

.mode-tabs button.is-active,
.mode-tabs button.is-selected,
.button-grid button.is-active {
  border-color: var(--calc-red);
  background: var(--calc-red);
  color: #fff;
  box-shadow: 0 14px 32px rgba(239, 28, 37, 0.22);
}

.mode-tabs [data-mode="duty"].is-active {
  border-color: var(--calc-black);
  background: var(--calc-black);
}

.advanced-calculator-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.advanced-calculator-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(239, 28, 37, 0.22);
  border-radius: 999px;
  background: rgba(239, 28, 37, 0.06);
  color: var(--calc-red-dark);
  padding: 0 18px;
  text-decoration: none;
  font-size: 14px;
  line-height: 18px;
  font-weight: 800;
}

.advanced-calculator-links a:hover {
  background: rgba(239, 28, 37, 0.1);
  border-color: rgba(239, 28, 37, 0.34);
}

.import-calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.calc-flow-card {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.calc-step {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--calc-border);
  border-radius: 20px;
  background: #fff;
  padding: 20px;
}

fieldset.calc-step {
  display: grid;
  gap: 16px;
}

.calc-step.is-disabled,
.calc-step:disabled {
  background: #f7f8fa;
  color: #9aa1ad;
  box-shadow: none;
}

.calc-step.is-disabled .step-number,
.calc-step:disabled .step-number {
  background: #d1d5db;
}

.calc-step.is-disabled button,
.calc-step:disabled button {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.step-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

fieldset .step-head {
  margin-bottom: 0;
}

.step-number {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--calc-red);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
}

.step-head h2 {
  margin: 0;
  font-family: Manrope, Inter, sans-serif;
  font-size: 22px;
  line-height: 28px;
  font-weight: 800;
}

.step-head p {
  margin: 4px 0 0;
  color: var(--calc-muted);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

.price-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px minmax(220px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.calc-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #222733;
  font-size: 13px;
  line-height: 18px;
  font-weight: 800;
}

.calc-field input,
.calc-field select {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--calc-border-strong);
  border-radius: 16px;
  background: #fff;
  color: var(--calc-text);
  padding: 0 16px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.calc-field input:focus,
.calc-field select:focus {
  border-color: var(--calc-red);
  box-shadow: 0 0 0 4px rgba(239, 28, 37, 0.1);
}

.field-error {
  min-height: 16px;
  color: var(--calc-red-dark);
  font-size: 12px;
  line-height: 16px;
  font-style: normal;
  font-weight: 700;
}

.field-error:empty {
  display: none;
}

/* inline info tooltip (e.g. the 30-min electric power hint) */
.calc-field__label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.calc-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: help;
  outline: none;
}
.calc-info__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--calc-red, #ef1c25);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}
.calc-info__bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  z-index: 70;
  width: max-content;
  max-width: 270px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 22, 28, 0.94);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.calc-info__bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(20, 22, 28, 0.94);
}
.calc-info:hover .calc-info__bubble,
.calc-info:focus .calc-info__bubble,
.calc-info:focus-visible .calc-info__bubble {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.rub-preview {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--calc-border);
  border-radius: 18px;
  background: var(--calc-surface-soft);
  padding: 14px 16px;
}

.rub-preview span,
.rates-card span,
.result-label {
  color: var(--calc-muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 800;
  text-transform: uppercase;
}

.rub-preview strong {
  color: var(--calc-text);
  font-size: 24px;
  line-height: 30px;
  font-weight: 800;
}

.rub-preview small {
  color: var(--calc-muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.button-grid {
  display: grid;
  gap: 12px;
}

.button-grid--age {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.button-grid--engine {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.engine-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.engine-fields--single {
  grid-template-columns: minmax(0, 1fr);
}

.engine-fields--power {
  grid-template-columns: minmax(180px, 1fr) 150px;
  align-items: end;
}

/* Engine-params step is a <section>, not a fieldset, so it had no inner gap —
   for hybrids (type + ICE + electric blocks + hints stacked) everything sat
   too close together. Lay it out as a grid with consistent breathing room. */
#engineParamsStep {
  display: grid;
  gap: 18px;
}
#engineParamsStep .step-head { margin-bottom: 0; }
#engineParamsStep .soft-warning { margin-top: 0; }
/* the hybrid-type select is a lone control — let it span the full width */
#hybridTypeFields {
  grid-template-columns: minmax(0, 1fr);
}

.check-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--calc-border);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  color: var(--calc-text);
  font-size: 15px;
  line-height: 20px;
  font-weight: 800;
}

.check-card input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--calc-red);
}

.check-card small {
  display: block;
  margin-top: 4px;
  color: var(--calc-muted);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}

.import-purpose-step {
  padding: 0;
  border: 0;
  background: transparent;
}

.soft-warning {
  margin: 14px 0 0;
  border: 1px solid rgba(239, 28, 37, 0.18);
  border-radius: 14px;
  background: rgba(239, 28, 37, 0.08);
  color: var(--calc-red-dark);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

.soft-warning--neutral {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: #1f3b72;
}

.warning-stack {
  display: grid;
  gap: 10px;
}

.notice-card {
  margin: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 19px;
  font-weight: 800;
}

.notice-card--japan {
  border: 1px solid rgba(30, 64, 175, 0.22);
  background: #16243f;
  color: #eef5ff;
  box-shadow: 0 14px 30px rgba(22, 36, 63, 0.12);
}

.notice-card--limit {
  border: 1px solid rgba(217, 119, 6, 0.22);
  background: rgba(251, 191, 36, 0.15);
  color: #8a4b00;
}

.notice-card--danger {
  border: 1px solid rgba(239, 28, 37, 0.18);
  background: rgba(239, 28, 37, 0.09);
  color: var(--calc-red-dark);
}

.reset-button {
  justify-self: start;
  min-width: 220px;
  background: #fff;
}

.result-stack {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.empty-result-card,
.result-card,
.breakdown-card {
  padding: 24px;
}

.empty-result-card {
  background: linear-gradient(135deg, #fff, #f8fafc);
}

.empty-result-card h2 {
  margin: 0;
  font-family: Manrope, Inter, sans-serif;
  font-size: 24px;
  line-height: 30px;
  font-weight: 800;
}

.empty-result-card p {
  margin: 10px 0 0;
  color: var(--calc-muted);
  font-size: 15px;
  line-height: 22px;
}

.result-card {
  background: #fff;
}

.result-card > strong {
  display: block;
  margin-top: 8px;
  color: #05070b;
  font-family: Manrope, Inter, sans-serif;
  font-size: clamp(40px, 4vw, 58px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.result-card > p {
  margin: 10px 0 0;
  color: #404958;
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}

.rates-card {
  margin-top: 18px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--calc-border);
  border-radius: 18px;
  background: var(--calc-surface-soft);
  padding: 14px 16px;
}

.japan-total-card {
  margin-top: 16px;
  border: 1px solid rgba(239, 28, 37, 0.14);
  border-radius: 18px;
  background: rgba(239, 28, 37, 0.07);
  padding: 14px 16px;
}

.japan-total-card span {
  display: block;
  color: var(--calc-red-dark);
  font-size: 12px;
  line-height: 16px;
  font-weight: 800;
  text-transform: uppercase;
}

.japan-total-card strong {
  display: block;
  margin-top: 4px;
  color: var(--calc-red-dark);
  font-family: Manrope, Inter, sans-serif;
  font-size: 28px;
  line-height: 34px;
  font-weight: 800;
}

.rates-card strong {
  color: var(--calc-text);
  font-size: 16px;
  line-height: 22px;
  font-weight: 800;
}

.rates-card small {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: 3px;
  color: var(--calc-muted);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}
.rates-card__pair {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.rates-card__pair b {
  font-weight: 700;
  color: var(--calc-text);
}

.breakdown-card {
  background: #f1f3f6;
  box-shadow: none;
}

.breakdown-card h2 {
  margin: 0 0 16px;
  font-family: Manrope, Inter, sans-serif;
  font-size: 22px;
  line-height: 28px;
  font-weight: 800;
}

.breakdown-card dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.breakdown-card dl > div {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  gap: 10px;
  align-items: end;
  min-height: 24px;
  color: #242a35;
  font-size: 14px;
  line-height: 18px;
  font-weight: 650;
}

.breakdown-card dl > div::after {
  content: "";
  grid-column: 2;
  grid-row: 1;
  border-bottom: 1px dashed rgba(105, 112, 125, 0.34);
  transform: translateY(-5px);
}

.breakdown-card dt,
.breakdown-card dd {
  margin: 0;
}

.breakdown-card dd {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.breakdown-card .breakdown-total {
  margin-top: 8px;
  border-radius: 14px;
  background: rgba(239, 28, 37, 0.09);
  color: var(--calc-red-dark);
  padding: 10px 12px;
  font-size: 17px;
}

.breakdown-card .breakdown-total::after {
  display: none;
}

.breakdown-card .breakdown-subtitle {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(105, 112, 125, 0.2);
  color: var(--calc-text);
  font-size: 15px;
  font-weight: 800;
}

.breakdown-card .breakdown-subtitle::after {
  display: none;
}

.breakdown-card .breakdown-subtitle dd {
  display: none;
}

.calculation-note {
  margin-top: 16px;
  display: grid;
  gap: 7px;
  color: #5c6675;
  font-size: 13px;
  line-height: 19px;
  font-weight: 600;
}
.calculation-note__line {
  position: relative;
  display: block;
  padding-left: 16px;
}
.calculation-note__line::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--calc-red, #ef1c25);
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .import-calc-layout {
    grid-template-columns: 1fr;
  }

  .result-stack {
    position: static;
  }
}

@media (max-width: 820px) {
  .import-calc-shell {
    width: min(1280px, calc(100% - 1.5rem));
    margin: 10px auto 24px;
  }

  .import-calc-hero,
  .calc-flow-card,
  .empty-result-card,
  .result-card,
  .breakdown-card {
    border-radius: 20px;
  }

  .import-calc-hero,
  .calc-flow-card,
  .empty-result-card,
  .result-card,
  .breakdown-card {
    padding: 20px;
  }

  .mode-tabs,
  .price-grid,
  .button-grid--age,
  .button-grid--engine,
  .engine-fields,
  .engine-fields--power {
    grid-template-columns: 1fr;
  }

  .import-calc-hero h1 {
    font-size: 32px;
    overflow-wrap: anywhere;
  }

  .import-calc-hero p:not(.brand-pill) {
    font-size: 15px;
  }

  .reset-button {
    width: 100%;
    min-width: 0;
  }

  .breakdown-card dl > div {
    grid-template-columns: minmax(0, max-content) 1fr max-content;
    font-size: 13px;
  }
}

@media (max-width: 440px) {
  .import-calc-shell {
    width: min(1280px, calc(100% - 1.5rem));
  }

  .import-calc-hero,
  .calc-flow-card,
  .empty-result-card,
  .result-card,
  .breakdown-card {
    padding: 18px;
  }

  .calc-step {
    padding: 16px;
  }

  .step-head {
    gap: 10px;
  }

  .step-head h2 {
    font-size: 20px;
  }

  .import-calc-hero h1 {
    font-size: 28px;
    line-height: 1.12;
  }

  .import-calc-hero p:not(.brand-pill) {
    font-size: 14px;
    line-height: 1.5;
  }

  .result-card > strong {
    font-size: 38px;
    word-break: break-word;
  }

  .breakdown-card dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .breakdown-card dl > div::after {
    display: none;
  }

  .breakdown-card dd {
    text-align: left;
  }
}

/* ==========================================================================
   Unified hub — three calculators on /calculator with instant tab switching.
   .calc-view sections are toggled via .is-active by main.js (no page reload).
   ========================================================================== */

.calc-views {
  position: relative;
  width: 100%;
}

.calc-view { display: none; }
.calc-view.is-active {
  display: block;
  animation: calcViewIn 0.36s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes calcViewIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card surface harmonisation with the home/auction-stats palette ---------- */
body.calc-hub-page .import-calc-hero,
body.calc-hub-page .calc-flow-card,
body.calc-hub-page .result-card,
body.calc-hub-page .empty-result-card,
body.calc-hub-page .breakdown-card {
  background: color-mix(in srgb, var(--card, #ffffff) 92%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, var(--line, #e7eaf0) 80%, transparent);
  box-shadow: 0 18px 50px rgba(17, 19, 24, 0.07);
}

body.calc-hub-page .import-calc-hero { border-radius: 28px; }
body.calc-hub-page .calc-flow-card { border-radius: 28px; }
body.calc-hub-page .result-card,
body.calc-hub-page .empty-result-card,
body.calc-hub-page .breakdown-card { border-radius: 26px; }

/* Switch the eyebrow "ТРИУМФ АВТО" to the same kicker style as advanced ---- */
body.calc-hub-page .brand-pill {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--red, #d81f26);
  text-transform: uppercase;
}

body.calc-hub-page .import-calc-hero h1 {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text, #1f2937);
}
body.calc-hub-page .import-calc-hero p:not(.brand-pill) {
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
  line-height: 1.6;
  color: var(--muted, #6b7280);
  font-weight: 500;
}

/* Step heads with the kicker look ----------------------------------------- */
body.calc-hub-page .calc-step {
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--line, #e7eaf0) 80%, transparent);
  background: color-mix(in srgb, var(--card, #ffffff) 70%, transparent);
}
body.calc-hub-page .step-number {
  background: linear-gradient(140deg, var(--red, #d81f26), var(--red-dark, #b3171d));
  box-shadow: 0 8px 16px -10px rgba(216, 31, 38, 0.7);
  font-size: 13px;
}
body.calc-hub-page .step-head h2 {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.18rem;
  letter-spacing: -0.015em;
  color: var(--text, #1f2937);
}
body.calc-hub-page .step-head p {
  font-size: 0.88rem;
  color: var(--muted, #6b7280);
}

/* Field controls — match the stats-page look (52px, 14px radius, soft glow) */
body.calc-hub-page .calc-field {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
}
body.calc-hub-page .calc-field input,
body.calc-hub-page .calc-field select {
  min-height: 52px;
  border-radius: 14px;
  border: 1.5px solid color-mix(in srgb, var(--line, #e7eaf0) 92%, transparent);
  background: var(--card, #ffffff);
  color: var(--text, #1f2937);
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
body.calc-hub-page .calc-field input:hover,
body.calc-hub-page .calc-field select:hover {
  border-color: color-mix(in srgb, var(--red, #d81f26) 35%, var(--line, #e7eaf0));
}
body.calc-hub-page .calc-field input:focus,
body.calc-hub-page .calc-field select:focus {
  border-color: var(--red, #d81f26);
  box-shadow: 0 0 0 4px rgba(216, 31, 38, 0.12);
}
body.calc-hub-page .calc-field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

body.calc-hub-page .rub-preview {
  min-height: 72px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--line, #e7eaf0) 80%, transparent);
  background: color-mix(in srgb, var(--bg, #f5f6f8) 70%, transparent);
}
body.calc-hub-page .rub-preview span,
body.calc-hub-page .rates-card span,
body.calc-hub-page .result-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--muted, #6b7280);
}
body.calc-hub-page .rub-preview strong {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text, #1f2937);
}

/* Country / age / engine button grids — gradient-active state ------------ */
body.calc-hub-page .mode-tabs button,
body.calc-hub-page .button-grid button,
body.calc-hub-page .reset-button {
  min-height: 52px;
  border-radius: 14px;
  border: 1.5px solid color-mix(in srgb, var(--line, #e7eaf0) 92%, transparent);
  background: color-mix(in srgb, var(--card, #ffffff) 80%, transparent);
  color: var(--text, #1f2937);
  font-size: 0.95rem;
  font-weight: 700;
}
body.calc-hub-page .mode-tabs button:hover,
body.calc-hub-page .button-grid button:hover,
body.calc-hub-page .reset-button:hover {
  border-color: var(--red, #d81f26);
  color: var(--red, #d81f26);
}
body.calc-hub-page .mode-tabs button.is-active,
body.calc-hub-page .mode-tabs button.is-selected,
body.calc-hub-page .button-grid button.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--red, #d81f26), var(--red-dark, #b3171d));
  color: #fff;
  box-shadow: 0 14px 28px -14px rgba(216, 31, 38, 0.62);
}

body.calc-hub-page .reset-button {
  border-color: color-mix(in srgb, var(--line, #e7eaf0) 92%, transparent);
  background: color-mix(in srgb, var(--card, #ffffff) 70%, transparent);
}

/* Checkbox "Для личного пользования" — pill card ------------------------- */
body.calc-hub-page .check-card {
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--line, #e7eaf0) 80%, transparent);
  background: color-mix(in srgb, var(--card, #ffffff) 80%, transparent);
  color: var(--text, #1f2937);
}
body.calc-hub-page .check-card small {
  color: var(--muted, #6b7280);
}

/* Result side panel ------------------------------------------------------- */
body.calc-hub-page .empty-result-card {
  background:
    radial-gradient(circle at 92% 6%, rgba(216, 31, 38, 0.12), transparent 55%),
    var(--card, #ffffff);
}
body.calc-hub-page .empty-result-card h2,
body.calc-hub-page .result-card > strong {
  font-family: "Manrope", "Inter", sans-serif;
  letter-spacing: -0.02em;
  color: var(--text, #1f2937);
}
body.calc-hub-page .result-card > strong {
  background: linear-gradient(116deg, var(--red, #d81f26), #ff5a4e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.calc-hub-page .result-card > p,
body.calc-hub-page .empty-result-card p {
  color: var(--muted, #6b7280);
}
body.calc-hub-page .rates-card {
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--line, #e7eaf0) 80%, transparent);
  background: color-mix(in srgb, var(--bg, #f5f6f8) 70%, transparent);
}
body.calc-hub-page .japan-total-card {
  border-radius: 18px;
  border-color: rgba(216, 31, 38, 0.28);
  background:
    linear-gradient(135deg, rgba(216, 31, 38, 0.16), transparent 42%),
    linear-gradient(135deg, #242a36, #111827);
  color: #fff;
  box-shadow: 0 20px 36px -20px rgba(17, 24, 39, 0.55);
}
body.calc-hub-page .japan-total-card span {
  color: rgba(255, 255, 255, 0.72);
}
body.calc-hub-page .japan-total-card strong {
  color: #fff;
}
body.calc-hub-page .breakdown-card h2 {
  font-family: "Manrope", "Inter", sans-serif;
  letter-spacing: -0.015em;
  color: var(--text, #1f2937);
}

/* Notice/soft-warning chips — same family as the advanced calc warnings -- */
body.calc-hub-page .soft-warning {
  border-radius: 14px;
  background: color-mix(in srgb, var(--red, #d81f26) 8%, transparent);
  border-color: color-mix(in srgb, var(--red, #d81f26) 25%, transparent);
  color: var(--red-dark, #b3171d);
}
body.calc-hub-page .soft-warning--neutral {
  background: color-mix(in srgb, #3b82f6 10%, transparent);
  border-color: color-mix(in srgb, #3b82f6 30%, transparent);
  color: #1e3a8a;
}
body.calc-hub-page .notice-card {
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.88rem;
}

/* Dark theme — re-tint the gradients so the cards stay legible. */
html[data-theme="dark"] body.calc-hub-page .check-card small,
html[data-theme="dark"] body.calc-hub-page .empty-result-card p,
html[data-theme="dark"] body.calc-hub-page .result-card > p,
html[data-theme="dark"] body.calc-hub-page .step-head p,
html[data-theme="dark"] body.calc-hub-page .import-calc-hero p:not(.brand-pill) {
  color: var(--muted, #9aa3b2);
}
html[data-theme="dark"] body.calc-hub-page .calc-field input,
html[data-theme="dark"] body.calc-hub-page .calc-field select {
  /* background-color only — using the `background` shorthand here reset the
     select's chevron repeat/position and tiled the arrow across the field. */
  background-color: color-mix(in srgb, var(--card, #181b22) 92%, transparent);
}
html[data-theme="dark"] body.calc-hub-page .calc-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
html[data-theme="dark"] body.calc-hub-page .soft-warning--neutral {
  color: #bfd5ff;
}

/* Rates card — date and currency abbreviations use --calc-text (≈ #111318 in
   light theme) which becomes invisible on the dark background. Re-tint them. */
html[data-theme="dark"] body.calc-hub-page .rates-card strong,
html[data-theme="dark"] body.calc-hub-page .rates-card__pair b {
  color: var(--text, #e6e9ef);
}
html[data-theme="dark"] body.calc-hub-page .rates-card small,
html[data-theme="dark"] body.calc-hub-page .rates-card__pair {
  color: var(--muted, #9aa3b2);
}

/* The "Детали расчёта" rows inherit the light-theme ink (--calc-text ≈ #111318)
   and become near-invisible on the dark background. Re-tint the regular rows
   with the dark palette (muted labels, bright values); the total rows keep
   their red accent, the subtitle stays light. */
html[data-theme="dark"] body.calc-hub-page .breakdown-card dl > div:not(.breakdown-total):not(.breakdown-subtitle) dt {
  color: var(--muted, #9aa3b2);
}
html[data-theme="dark"] body.calc-hub-page .breakdown-card dl > div:not(.breakdown-total):not(.breakdown-subtitle) dd {
  color: var(--text, #e6e9ef);
}
html[data-theme="dark"] body.calc-hub-page .breakdown-card .breakdown-subtitle dt {
  color: var(--text, #e6e9ef);
}

/* ============================================ custom dropdown (.cs) ========
   Shared translucent dropdown used by every calculator select (import calc +
   the React util/customs calcs). Replaces the native <select> popup with a
   blurred glassy panel that matches the auction-stats filters. */
.cs {
  position: relative;
  width: 100%;
  min-width: 0;
}
.cs__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.cs__control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 12px 0 16px;
  border: 1.5px solid color-mix(in srgb, var(--line, #e7eaf0) 92%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card, #ffffff) 92%, transparent);
  color: var(--text, #1f2937);
  font: 600 0.97rem/20px Inter, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.cs__control:hover {
  border-color: color-mix(in srgb, var(--red, #d81f26) 35%, var(--line, #e7eaf0));
}
.cs.is-open .cs__control,
.cs__control:focus-visible {
  border-color: var(--red, #d81f26);
  box-shadow: 0 0 0 4px rgba(239, 28, 37, 0.12);
}
.cs.is-disabled .cs__control {
  opacity: 0.55;
  cursor: not-allowed;
}
.cs__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs__chevron {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--muted, #6b7280);
  transition: transform 0.2s ease, color 0.2s ease;
}
.cs__chevron svg { width: 18px; height: 18px; }
.cs.is-open .cs__chevron {
  transform: rotate(180deg);
  color: var(--red, #d81f26);
}
.cs__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  /* hidden by default; the vanilla enhancer keeps the panel in the DOM at all
     times, so visibility must be driven by the .is-open class (the React
     version only mounts it while open, so this is harmless there). */
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(1.85);
  backdrop-filter: blur(22px) saturate(1.85);
  box-shadow: 0 28px 54px -22px rgba(20, 22, 28, 0.42);
  animation: cs-pop 0.16s ease;
}
.cs.is-open .cs__panel { display: flex; }
html[data-theme="dark"] .cs__panel {
  background: rgba(28, 30, 37, 0.86);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.7);
}
.cs__option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text, #1f2937);
  font: 500 0.95rem/20px Inter, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.cs__option:hover {
  background: rgba(239, 28, 37, 0.09);
  color: var(--red-dark, #b3171d);
}
html[data-theme="dark"] .cs__option:hover { color: #ff6a63; }
.cs__option.is-selected {
  background: rgba(239, 28, 37, 0.12);
  color: var(--red-dark, #b3171d);
  font-weight: 700;
}
html[data-theme="dark"] .cs__option.is-selected { color: #ff6a63; }
.cs--mini { max-width: 120px; }

@keyframes cs-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .cs__panel { animation: none; }
}

/* "Просмотреть PDF" action in the import-calculator result card */
.calc-pdf-button {
  margin-top: 16px;
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--calc-red);
  border-radius: 16px;
  background: var(--calc-red);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  line-height: 20px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}
.calc-pdf-button svg { width: 19px; height: 19px; }
.calc-pdf-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(239, 28, 37, 0.24);
}
.calc-pdf-button[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}
