/* ============================================================
   Car Tuning Calculator — Flask edition
   Modern redesign: Deep Purple + Mint/Neon Green + White/Gray.
   Single-page feel: centered Form (State 1) ⇄ Results (State 2).
   ============================================================ */

/* ── Self-hosted fonts (Inter + JetBrains Mono) ──────────────────────────
   No third-party CDN requests (GDPR: avoids leaking visitor IPs to Google).
   Mirrors the @font-face set Google Fonts CSS2 would normally serve, just
   pointing at local files in ../fonts/. ── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrainsmono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrainsmono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jetbrainsmono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jetbrainsmono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* ── Brand palette ── */
  --purple-900: #2E1065;   /* deepest — header / footer */
  --purple-800: #4C1D95;
  --purple-700: #5B21B6;
  --purple-600: #6D28D9;   /* primary brand accent */
  --purple-500: #7C3AED;
  --purple-200: #DDD6FE;
  --purple-100: #EDE9FE;   /* light tint */
  --purple-50:  #F5F3FF;

  --mint:       #14E5A0;   /* primary CTA (Calculate) */
  --mint-dark:  #0FCB8D;   /* CTA hover */
  --mint-text:  #07301F;   /* readable text on mint */
  --mint-glow:  rgba(20, 229, 160, 0.45);

  /* ── Neutrals ── */
  --bg:         #E9E0FA;   /* purple-tinted page background */
  --card:       #FFFFFF;
  --border:     #E9E5F5;
  --text:       #1E152F;   /* dark purple-tinted ink */
  --text-light: #6E6786;

  /* ── Status ── */
  --success:    #0E9F6E;
  --warning:    #B45309;
  --danger:     #DC2626;

  /* ── Type ── */
  --font-title: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:  'JetBrains Mono', Consolas, "Courier New", monospace;

  /* ── Shape & depth ── */
  --radius:     20px;
  --radius-md:  14px;
  --radius-sm:  10px;
  --shadow-card: 0 18px 50px rgba(46, 16, 101, 0.10);
  --shadow-soft: 0 6px 20px rgba(46, 16, 101, 0.07);
  --shadow-cta:  0 10px 26px var(--mint-glow);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1100px 540px at 50% -200px, var(--purple-200), transparent 70%),
    linear-gradient(180deg, var(--purple-100) 0%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--purple-600); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--purple-200); }

/* ──────────────── HEADER ──────────────── */
.app-header {
  background: linear-gradient(120deg, var(--purple-900), var(--purple-700));
  color: #fff;
  padding: 14px 0;
  box-shadow: 0 8px 30px rgba(46, 16, 101, 0.28);
  position: sticky;
  top: 0;
  z-index: 900;
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand:hover { text-decoration: none; opacity: 0.92; }
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.nav a { color: rgba(255,255,255,0.85); font-size: 0.92rem; font-weight: 500; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav-version {
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ──────────────── LANGUAGE SWITCHER ──────────────── */
.lang-switcher { position: relative; display: inline-block; }
.lang-btn {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.lang-btn:hover { background: rgba(255,255,255,0.2); }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 184px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  margin: 0;
  list-style: none;
  box-shadow: var(--shadow-card);
  display: none;
  z-index: 1000;
}
.lang-switcher:hover .lang-menu,
.lang-switcher:focus-within .lang-menu { display: block; }
.lang-menu .lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.93rem;
  text-decoration: none;
}
.lang-menu .lang-item:hover { background: var(--purple-50); color: var(--purple-700); text-decoration: none; }
.lang-menu .lang-item.is-active { background: var(--purple-100); color: var(--purple-700); font-weight: 600; }
.lang-flag { font-size: 1.15rem; }

/* ──────────────── FLASH MESSAGES ──────────────── */
.flash-stack {
  max-width: 860px;
  margin: 16px auto 0;
  padding: 0 24px;
}
.flash {
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  font-weight: 500;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.flash-success { border-color: var(--success); color: #08603f; }
.flash-warning { border-color: var(--warning); color: #8a4a07; }
.flash-danger  { border-color: var(--danger);  color: #991b1b; }
.flash-info    { border-color: var(--purple-600); color: var(--purple-800); }

/* ──────────────── MAIN LAYOUT ──────────────── */
.app-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}
.app-footer {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 28px 16px 36px;
}
.app-footer a { color: var(--purple-600); }

.container { max-width: 760px; margin: 0 auto; }

/* ════════════════════════════════════════════════════════════
   SPA STAGE — State 1 (form)  ⇄  State 2 (results), centered
   ════════════════════════════════════════════════════════════ */
.ctc-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}
.state-panel { width: 100%; }
.state-panel.hidden { display: none !important; }

/* Smooth entrance animation toggled by JS */
.fade-in { animation: stageIn .45s cubic-bezier(.22,.61,.36,1) both; }
@keyframes stageIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.form-card,
.results-card {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 38px 40px 34px;
}

/* ── Stage heading ── */
.stage-head { text-align: center; margin-bottom: 28px; }
.stage-title {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 8px;
  background: linear-gradient(120deg, var(--purple-700), var(--purple-500));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stage-sub {
  color: var(--text-light);
  font-size: 1rem;
  margin: 0;
}

/* ── Form sections ── */
.form-section {
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.form-section:first-of-type { border-top: none; padding-top: 4px; }

.section-title {
  font-family: var(--font-title);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--purple-700);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lbl {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 14px 0 6px;
  color: var(--text);
}
.muted    { color: var(--text-light); font-size: 0.9rem; }
.muted-lg { color: var(--text-light); font-size: 1.05rem; }

/* ──────────────── FORM CONTROLS ──────────────── */
.input, .select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #aba6bd; }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--purple-500);
  box-shadow: 0 0 0 4px var(--purple-100);
}
.select:disabled {
  background: #f6f5fb;
  color: var(--text-light);
  cursor: not-allowed;
}

/* Car specs panel (εμφανίζεται μόλις επιλεγεί κινητήρας) */
.car-specs {
  margin-top: 14px;
  border: 1.5px solid var(--purple-100);
  border-radius: var(--radius-sm);
  background: var(--purple-50);
  padding: 14px 16px;
}
.car-specs.hidden { display: none; }
.spec-head {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--purple-700);
  margin-bottom: 10px;
}
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
}
.spec-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 0.88rem;
  padding: 3px 0;
  border-bottom: 1px dashed var(--border);
}
.spec-ico { flex: 0 0 auto; }
.spec-lbl { flex: 0 0 auto; font-weight: 600; color: var(--text-light); }
.spec-val { flex: 1 1 auto; text-align: right; color: var(--text); font-weight: 600; }
@media (max-width: 540px) { .spec-grid { grid-template-columns: 1fr; } }

/* Category buttons */
.cat-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.cat-btn {
  flex: 1;
  min-width: 110px;
  background: var(--purple-50);
  color: var(--purple-700);
  border: 1.5px solid var(--purple-100);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all .15s;
}
.cat-btn:hover { border-color: var(--purple-500); background: var(--purple-100); }
.cat-btn.is-active {
  background: linear-gradient(120deg, var(--purple-700), var(--purple-500));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-soft);
}

/* Checks & radios */
.check, .radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.check:hover, .radio:hover { background: var(--purple-50); }
.check.is-disabled { opacity: .45; cursor: not-allowed; }
.check.is-disabled:hover { background: transparent; }
.check.is-disabled input { cursor: not-allowed; }
.check.block, .radio.block { display: flex; }
.check input, .radio input { accent-color: var(--purple-600); width: 17px; height: 17px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }

.upgrades-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--purple-50);
}
@media (max-width: 540px) { .upgrades-grid { grid-template-columns: 1fr; } }

/* ──────────────── BUTTONS ──────────────── */
.btn-primary, .btn-secondary {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.96rem;
  cursor: pointer;
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn-primary {
  background: linear-gradient(120deg, var(--purple-700), var(--purple-500));
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(91,33,182,.32); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: #fff;
  color: var(--purple-700);
  border: 1.5px solid var(--purple-200) !important;
}
.btn-secondary:hover { background: var(--purple-50); }
.btn-primary:disabled,
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-block { display: block; width: 100%; }

/* ── Primary CTA — the big green "Calculate" ── */
.btn-cta {
  display: block;
  width: 100%;
  margin-top: 30px;
  padding: 18px 24px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, var(--mint), var(--mint-dark));
  color: var(--mint-text);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: var(--shadow-cta);
  transition: transform .1s, box-shadow .2s, filter .15s;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 36px var(--mint-glow); filter: brightness(1.03); }
.btn-cta:active { transform: translateY(0); }
.btn-cta:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Back / Recalculate button (results header) ── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--purple-700);
  border: 1.5px solid var(--purple-200);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background .15s, transform .08s, box-shadow .15s;
}
.btn-back:hover { background: var(--purple-50); box-shadow: var(--shadow-soft); }
.btn-back:active { transform: translateY(1px); }

.hidden, .mode-opts.hidden { display: none !important; }

/* ──────────────── RESULTS PANEL ──────────────── */
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.status-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--purple-50);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-badge.out-success { color: var(--success); background: #e7f8f1; border-color: #bff0dd; }
.status-badge.out-danger  { color: var(--danger);  background: #fdeaea; border-color: #f7c9c9; }
.results-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--purple-800);
  margin: 0 0 18px;
}
.output {
  font-size: 0.97rem;
  line-height: 1.65;
}

/* Loading spinner */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 48px 0;
}
.spinner {
  width: 46px;
  height: 46px;
  border: 4px solid var(--purple-100);
  border-top-color: var(--purple-600);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Output formatter classes (light theme) ── */
.out-line   { padding: 2px 0; }
.out-spacer { height: 10px; }

/* ── Info tooltips (ⓘ) — hover σε desktop, tap σε mobile ── */
.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  outline: none;
  vertical-align: middle;
}
.tip-ico {
  font-size: 0.72em;
  color: var(--purple-600);
  border: 1px solid var(--purple-100);
  background: #fff;
  border-radius: 50%;
  width: 1.35em; height: 1.35em;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
  margin-left: 3px;
  transition: background .12s, color .12s;
}
.tip:hover .tip-ico, .tip:focus .tip-ico { background: var(--purple-600); color: #fff; }
.tip-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 60;
  width: max-content;
  max-width: min(290px, 78vw);
  background: #2a2540;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .14s, transform .14s, visibility .14s;
  pointer-events: none;
}
.tip-pop::after {
  content: '';
  position: absolute;
  top: 100%; left: 14px;
  border: 6px solid transparent;
  border-top-color: #2a2540;
}
.tip:hover .tip-pop,
.tip:focus .tip-pop,
.tip:focus-within .tip-pop {
  opacity: 1; visibility: visible; transform: translateY(0);
}
@media (max-width: 540px) {
  .tip-pop { left: auto; right: 0; max-width: 74vw; }
  .tip-pop::after { left: auto; right: 14px; }
}
.out-header {
  color: var(--purple-800);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--purple-100);
  padding-bottom: 8px;
  margin: 22px 0 12px;
}
.out-section {
  color: var(--purple-700);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.02rem;
  border-left: 4px solid var(--mint);
  padding-left: 12px;
  margin: 18px 0 8px;
}
.out-success { color: var(--success); font-weight: 600; }
.out-warning { color: var(--warning); }
.out-danger  { color: var(--danger); font-weight: 600; }
.out-accent  { color: var(--purple-600); }
.out-muted   { color: var(--text-light); }
.out-mono {
  font-family: var(--font-mono);
  white-space: pre-wrap;
  font-size: 0.86rem;
  color: #3a3550;
}
.out-link {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--purple-50);
  color: var(--purple-700);
  text-decoration: none;
  font-size: 0.82em;
  font-weight: 600;
  border: 1px solid var(--purple-100);
}
.out-link:hover { background: var(--purple-100); text-decoration: none; }

/* Collapsible details panel */
.out-details {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--purple-50);
}
.out-details > summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 16px;
  font-weight: 600;
  color: var(--purple-700);
  user-select: none;
  border-radius: var(--radius-md);
  display: flex; align-items: center; gap: 8px;
}
.out-details > summary::before {
  content: '▶';
  display: inline-block;
  font-size: .7em;
  transition: transform .15s ease;
  color: var(--purple-500);
}
.out-details[open] > summary::before { transform: rotate(90deg); }
.out-details > summary::-webkit-details-marker { display: none; }
.out-details > summary:hover { background: var(--purple-100); }
.out-details > *:not(summary) { padding: 4px 16px 14px; }

/* ── PDF button ── */
.pdf-row { margin-top: 24px; display: flex; justify-content: center; }
.btn-pdf {
  background: linear-gradient(120deg, var(--purple-700), var(--purple-500));
  color: #fff;
  border: none;
  padding: 14px 30px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform .1s, box-shadow .2s;
  box-shadow: var(--shadow-soft);
}
.btn-pdf:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(91,33,182,.35); text-decoration: none; }
.btn-pdf:active { transform: translateY(0); }

/* ──────────────── DISCLAIMER ──────────────── */
.disclaimer-card {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 40px 44px;
}
.disclaimer-card h1 {
  font-family: var(--font-title);
  font-weight: 800;
  color: var(--purple-800);
  margin-top: 0;
}
.disclaimer-card .lead {
  font-size: 1.02rem;
  color: var(--text);
  background: var(--purple-50);
  border-left: 4px solid var(--mint);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}
.disclaimer-card h3 {
  font-family: var(--font-title);
  color: var(--purple-700);
  margin-top: 26px;
}
.disclaimer-card ul { line-height: 1.75; }
.accept-form {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.accept-form .check { font-size: 1rem; margin-bottom: 18px; }
.accept-row {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.accept-row .btn-primary { display: inline-block; text-decoration: none; }

/* ──────────────── TABLES ──────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin: 14px 0;
}
.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--purple-700);
  color: #fff;
  font-weight: 600;
  font-family: var(--font-title);
  font-size: 0.92rem;
}
.data-table tbody tr:hover { background: var(--purple-50); }

.error-box {
  background: #fdeaea;
  color: var(--danger);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #f7c9c9;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 16px 0;
}
.inline-form .input { flex: 1; }

/* ──────────────── DONATE (button + modal) ──────────────── */
.donate-btn {
  background: linear-gradient(135deg, #7C3AED, #C026D3);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px rgba(124, 58, 237, .4);
}
.donate-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(192, 38, 211, .5); }
.donate-btn:active { transform: translateY(0); }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 21, 47, .55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1100;
  padding: 20px;
  animation: fadeIn .15s ease-out;
}
.modal-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  padding: 34px 30px 26px;
  max-width: 480px; width: 100%;
  box-shadow: 0 30px 70px rgba(30, 21, 47, .4);
  border: 1px solid var(--border);
}
.modal-card h2 { margin: 0 0 12px; font-size: 1.4rem; font-family: var(--font-title); color: var(--purple-800); }
.modal-card p { margin: 0 0 22px; line-height: 1.6; color: var(--text-light); }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: transparent; border: none; color: var(--text-light);
  font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 8px;
  border-radius: 8px;
}
.modal-close:hover { background: var(--purple-50); color: var(--purple-700); }
.modal-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  justify-content: flex-end; align-items: center;
}
.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ════════════════ BUILDS BROWSER ════════════════ */
.builds-page { position: relative; max-width: 980px; margin: 0 auto; }
.builds-page h1 { font-family: var(--font-title); font-weight: 800; color: var(--purple-800); }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--purple-700);
  border: 1.5px solid var(--purple-200);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 18px;
  transition: background .15s, transform .08s, box-shadow .15s;
}
.back-btn:hover  { background: var(--purple-50); box-shadow: var(--shadow-soft); }
.back-btn:active { transform: translateY(1px); }

.builds-showall { margin: 0 0 14px; }

.brand-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.brand-chip {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .08s;
}
.brand-chip:hover { border-color: var(--purple-500); background: var(--purple-50); }
.brand-chip:active { transform: translateY(1px); }
.chip-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 1px 7px;
  background: var(--purple-600);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.brand-group { margin-bottom: 26px; }
.brand-group-title {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--purple-700);
  border-bottom: 2px solid var(--purple-100);
  padding-bottom: 8px;
  margin: 0 0 14px;
  font-size: 1.2rem;
}
.build-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.build-card {
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--mint);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.build-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-left-color: var(--purple-500);
}
.bc-model { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.bc-hp { margin: 8px 0; font-size: 1.05rem; color: var(--text); font-family: var(--font-mono); }
.bc-hp .bc-gain {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  background: var(--success);
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.bc-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 0.82rem; margin-bottom: 8px; }
.bc-view { color: var(--purple-600); font-weight: 600; font-size: 0.86rem; }

.detail-vehicle { color: var(--purple-600); margin: 4px 0 18px; }
.detail-stats { display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 0; }
.detail-stats .stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  min-width: 130px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.detail-stats .stat-lbl {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-light);
}
.detail-stats .stat-val { font-size: 1.5rem; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.detail-stats .stat-val.accent { color: var(--purple-600); }
.detail-table th { width: 32%; background: #fff; color: var(--text-light); }
.detail-list { margin: 0; padding-left: 18px; }
.detail-list li { padding: 2px 0; }

.builds-pdf-row { margin-top: 26px; display: flex; justify-content: flex-start; }
.builds-pdf-row .btn-pdf { text-decoration: none; display: inline-block; }

/* ──────────────── RESPONSIVE ──────────────── */
@media (max-width: 680px) {
  .app-main { padding: 24px 16px 48px; }
  .form-card, .results-card { padding: 26px 22px; border-radius: var(--radius-md); }
  .stage-title { font-size: 1.6rem; }
  .header-inner { padding: 0 16px; }
  .brand span { display: none; }
}

/* ──────────────── ANALYTICS FLOATING CAPSULE ──────────────── */
.analytics-capsule {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.50);
  color: #fff;
  font-family: var(--font-body), sans-serif;
  font-size: 11px;
  line-height: 1.3;
  pointer-events: none;   /* purely informational — never blocks clicks */
  user-select: none;
}

.analytics-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.analytics-ico  { font-size: 13px; }

.analytics-label {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
}

.analytics-value {
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
}

.analytics-sep {
  color: rgba(255, 255, 255, 0.25);
  font-size: 13px;
  line-height: 1;
}

/* On very small screens collapse to icons + numbers only */
@media (max-width: 480px) {
  .analytics-capsule { padding: 6px 14px; gap: 8px; font-size: 10px; }
  .analytics-label   { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   REPORT CARDS — professional card layout for the results panel
   All classes are prefixed rpt- to avoid collisions.
   ══════════════════════════════════════════════════════════════ */

.rpt-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 20px 24px;
  margin-bottom: 14px;
}
.rpt-card:last-child { margin-bottom: 0; }

/* Card header row (title + optional pill) */
.rpt-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border);
}
.rpt-card-title {
  flex: 1;
  font-family: var(--font-title);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--purple-800);
  margin: 0;
}

/* ── Stats strip (Stock HP → Final HP → Gain) ── */
.rpt-stats-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.rpt-stat {
  flex: 1;
  min-width: 76px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--purple-50);
}
.rpt-stat-lbl {
  display: block;
  font-size: 0.70rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 3px;
}
.rpt-stat-val {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  font-family: var(--font-mono);
}
.rpt-stat-val.green  { color: var(--success); }
.rpt-stat-val.accent { color: var(--purple-600); }
.rpt-stat-arrow {
  font-size: 1.3rem;
  color: var(--purple-200);
  flex: 0 0 auto;
  line-height: 1;
}

/* ── Sub-section label (mint left-border rule) ── */
.rpt-section-label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--purple-700);
  border-left: 3px solid var(--mint);
  padding-left: 10px;
  margin: 16px 0 10px;
}
.rpt-section-label.dim { color: var(--text-light); border-left-color: var(--border); }

/* ── 2-column upgrade grid ── */
.rpt-upg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
@media (max-width: 560px) { .rpt-upg-grid { grid-template-columns: 1fr; } }

.rpt-upg-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--purple-50);
  transition: background .1s;
}
.rpt-upg-row:hover { background: var(--purple-100); }
.rpt-upg-row.existing { opacity: .72; }

.rpt-upg-name {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpt-upg-note {
  flex-basis: 100%;
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.4;
  padding-top: 2px;
}

/* HP / Nm pill badges */
.rpt-badges { display: flex; gap: 5px; flex-shrink: 0; }
.rpt-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.5;
  font-family: var(--font-mono);
}
.rpt-badge-hp {
  background: rgba(14,159,110,0.12);
  color: #0a7a54;
  border: 1px solid rgba(14,159,110,0.28);
}
.rpt-badge-nm {
  background: rgba(109,40,217,0.10);
  color: var(--purple-700);
  border: 1px solid rgba(109,40,217,0.22);
}

/* ── Status pills ── */
.rpt-status-pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.rpt-status-safe       { background: rgba(14,159,110,.12); color: #0a7a54; border: 1px solid rgba(14,159,110,.28); }
.rpt-status-warn       { background: rgba(180,83,9,.12);   color: #8a4a07; border: 1px solid rgba(180,83,9,.28); }
.rpt-status-danger     { background: rgba(220,38,38,.12);  color: #991b1b; border: 1px solid rgba(220,38,38,.28); }
.rpt-status-peripheral { background: rgba(234,88,12,.12);  color: #7c2d12; border: 1px solid rgba(234,88,12,.32); }
.rpt-status-info       { background: rgba(109,40,217,.10); color: var(--purple-700); border: 1px solid rgba(109,40,217,.22); }

/* ── Stress bars ── */
.rpt-stress-list { display: flex; flex-direction: column; gap: 12px; }

.rpt-stress-item {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafafa;
}
.rpt-stress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.rpt-stress-name {
  font-weight: 700;
  font-size: 0.90rem;
  color: var(--text);
}
.rpt-sf-chip {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.rpt-sf-safe   { background: rgba(14,159,110,.12); color: #0a7a54; border: 1px solid rgba(14,159,110,.28); }
.rpt-sf-warn   { background: rgba(180,83,9,.12);   color: #8a4a07; border: 1px solid rgba(180,83,9,.28); }
.rpt-sf-danger { background: rgba(220,38,38,.12);  color: #991b1b; border: 1px solid rgba(220,38,38,.28); }

.rpt-bar-bg {
  height: 7px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.rpt-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .45s ease;
}
.rpt-bar-safe   { background: linear-gradient(90deg, #0E9F6E, #14E5A0); }
.rpt-bar-warn   { background: linear-gradient(90deg, #D97706, #FBBF24); }
.rpt-bar-danger { background: linear-gradient(90deg, #DC2626, #F87171); }

.rpt-stress-meta {
  font-size: 0.76rem;
  color: var(--text-light);
  font-family: var(--font-mono);
  line-height: 1.5;
}

/* ── Required parts list ── */
.rpt-parts-list { display: flex; flex-direction: column; gap: 7px; }
.rpt-part-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
}
.rpt-part-warn   { background: rgba(180,83,9,.05);  border-left-color: #D97706; }
.rpt-part-danger { background: rgba(220,38,38,.05); border-left-color: #DC2626; }

.rpt-part-prio {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.rpt-prio-critical { background: #DC2626; color: #fff; }
.rpt-prio-high     { background: rgba(220,38,38,.15); color: #991b1b; border: 1px solid rgba(220,38,38,.3); }
.rpt-prio-med      { background: rgba(180,83,9,.14);  color: #8a4a07; border: 1px solid rgba(180,83,9,.28); }
.rpt-prio-low      { background: rgba(14,159,110,.12); color: #0a7a54; border: 1px solid rgba(14,159,110,.28); }

.rpt-part-info { flex: 1; min-width: 0; }
.rpt-part-name   { font-weight: 600; font-size: 0.88rem; display: block; color: var(--text); }
.rpt-part-reason { font-size: 0.80rem; color: var(--text-light); display: block; margin-top: 2px; }

/* ── Warnings strip ── */
.rpt-warn-list { display: flex; flex-direction: column; gap: 6px; }
.rpt-warn-item {
  padding: 8px 12px;
  background: rgba(180,83,9,.05);
  border: 1px solid rgba(180,83,9,.2);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--warning);
  line-height: 1.5;
}

/* ── Cost / invoice table ── */
.rpt-cost-table { display: flex; flex-direction: column; gap: 5px; }
.rpt-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--purple-50);
  border: 1px solid var(--border);
}
.rpt-cost-row.part-row { background: rgba(180,83,9,.04); border-color: rgba(180,83,9,.18); }
.rpt-cost-name  { font-weight: 600; font-size: 0.86rem; color: var(--text); flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rpt-cost-range { font-size: 0.86rem; font-weight: 700; color: var(--purple-700); white-space: nowrap; font-family: var(--font-mono); }
.rpt-cost-row.part-row .rpt-cost-range { color: var(--warning); }

/* ── Unified part accordion card ── */
.rpt-part-accordion {
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.rpt-part-accordion > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  border-left: 3px solid rgba(180,83,9,.45);
  transition: background 0.15s;
}
.rpt-part-accordion > summary::-webkit-details-marker { display: none; }
.rpt-part-accordion > summary::marker { display: none; }
.rpt-part-accordion > summary:hover { filter: brightness(0.97); }
.rpt-part-accordion.part-row-danger > summary { border-left-color: rgba(220,38,38,.6); }
.rpt-part-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.rpt-part-chevron {
  opacity: 0.5;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}
.rpt-part-accordion[open] > summary .rpt-part-chevron { transform: rotate(180deg); }
.rpt-part-accordion[open] > summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 1px solid rgba(180,83,9,.12);
}
.rpt-part-accordion.part-row-danger[open] > summary {
  border-bottom-color: rgba(220,38,38,.12);
}
.rpt-part-accordion > .rpt-brands-block {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  border: 1px solid rgba(180,83,9,.14);
  border-top: none;
}
.rpt-part-accordion.part-row-danger > .rpt-brands-block {
  border-color: rgba(220,38,38,.14);
}

/* ── Collapsible brands accordion ── */
.rpt-brands-details {
  margin: 6px 0 6px 16px;
}
.rpt-brands-toggle {
  list-style: none;
  width: 100%;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 0.80rem;
  font-weight: 500;
  color: var(--text);
  transition: background 0.2s;
  user-select: none;
}
.rpt-brands-toggle::-webkit-details-marker { display: none; }
.rpt-brands-toggle::marker { display: none; }
.rpt-brands-toggle:hover { background: rgba(51, 65, 85, 0.8); }
.rpt-brands-chevron {
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.22s ease;
}
details.rpt-brands-details[open] > .rpt-brands-toggle {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom-color: transparent;
}
details.rpt-brands-details[open] .rpt-brands-chevron { transform: rotate(180deg); }

/* ── Brand suggestion block ── */
.rpt-brands-block {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-top: none;
  background: #fafafa;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* ── Responsive flex brand rows ── */
.rpt-brand-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--border);
}
.rpt-brand-row:last-child { border-bottom: none; }
.rpt-brand-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.rpt-brand-name    { font-weight: 600; font-size: 0.83rem; color: var(--text); }
.rpt-brand-quality { font-size: 0.78rem; color: var(--text-light); }
.rpt-brand-price   { font-size: 0.78rem; color: var(--text-light); }
.rpt-shop-links    { display: flex; flex-wrap: wrap; gap: 6px; }
.rpt-shop-btn {
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(20,184,166,0.10);
  color: #0d9488;
  border: 1px solid rgba(20,184,166,0.35);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.rpt-shop-btn:hover {
  background: rgba(20,184,166,0.22);
  border-color: rgba(20,184,166,0.55);
  text-decoration: none;
}
html.dark .rpt-shop-btn {
  background: rgba(20,184,166,0.12);
  color: #5eead4;
  border-color: rgba(20,184,166,0.35);
}
html.dark .rpt-shop-btn:hover {
  background: rgba(20,184,166,0.25);
  border-color: rgba(20,184,166,0.55);
}

@media (min-width: 600px) {
  .rpt-brand-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 4px;
  }
  .rpt-shop-links { flex-shrink: 0; justify-content: flex-end; }
}

/* ── Budget / Premium badges on brand rows ── */
.rpt-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.rpt-badge-budget  { background: #e7f8f1; color: #08603f; border-color: #bff0dd; }
.rpt-badge-premium { background: var(--purple-50); color: var(--purple-700); border-color: var(--purple-200); }

/* ── Total cost strip ── */
.rpt-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(120deg, var(--purple-50), #f0fdf8);
  border: 1.5px solid var(--mint-dark);
}
.rpt-total-lbl  { font-weight: 600; font-size: 0.90rem; color: var(--text); }
.rpt-total-val  { font-weight: 800; font-size: 1.02rem; color: var(--success); white-space: nowrap; font-family: var(--font-mono); }
.rpt-total-mult { font-size: 0.74rem; color: var(--text-light); margin-top: 2px; }

/* ── LPG already installed note (Mode E) ── */
.rpt-lpg-installed-note {
  margin: 8px 0 14px;
  padding: 10px 14px;
  background: rgba(22,163,74,0.08);
  border: 1px solid rgba(22,163,74,0.30);
  border-left: 4px solid #16a34a;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #166534;
  line-height: 1.5;
}
html.dark .rpt-lpg-installed-note {
  background: rgba(22,163,74,0.12);
  border-color: rgba(22,163,74,0.35);
  color: #86efac;
}

/* ── Economy (Mode E) ── */
.rpt-eco-ranked { display: flex; flex-direction: column; gap: 7px; }
.rpt-eco-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--purple-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.rpt-eco-name  { flex: 1; font-weight: 600; font-size: 0.86rem; color: var(--text); min-width: 120px; }
.rpt-eco-pct   { font-size: 0.86rem; color: var(--success); font-weight: 700; white-space: nowrap; font-family: var(--font-mono); }
.rpt-eco-stars { font-size: 0.85rem; color: #D97706; white-space: nowrap; }
.rpt-eco-cost  { font-size: 0.80rem; color: var(--text-light); white-space: nowrap; }

.rpt-eco-summary {
  margin-top: 12px;
  padding: 13px 16px;
  background: rgba(14,159,110,.05);
  border: 1px solid rgba(14,159,110,.2);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rpt-eco-srow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.86rem;
}
.rpt-eco-srow-lbl { color: var(--text-light); }
.rpt-eco-srow-val { font-weight: 700; color: var(--success); text-align: right; font-family: var(--font-mono); }
.rpt-eco-srow-val.accent { color: var(--purple-700); }
.rpt-eco-srow-val.muted  { color: var(--text-light); font-weight: 500; }

/* ──────────────── TUNING STAGE BADGE ──────────────── */
@keyframes stage-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px currentColor; }
  50%       { opacity: 0.7; box-shadow: 0 0 18px currentColor; }
}

.stage-badge-wrap {
  display: flex;
  justify-content: center;
  margin: 14px 0 6px;
}

.stage-badge {
  display: inline-block;
  padding: 7px 22px;
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-title);
}

/* ══════════════════════════════════════════════════════════════
   ENGINE SWAP INPUT SECTION (form)
   ══════════════════════════════════════════════════════════════ */
.engine-swap-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.engine-swap-toggle {
  font-weight: 600;
  font-size: 0.9rem;
}
.engine-swap-panel {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(109,40,217,0.05);
  border: 1px solid rgba(109,40,217,0.20);
  border-radius: 8px;
}
.swap-row-2col {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.swap-row-2col > div {
  flex: 1;
  min-width: 0;
}
html.dark .engine-swap-section { border-top-color: var(--border); }
html.dark .engine-swap-panel { background: rgba(109,40,217,0.10); border-color: rgba(109,40,217,0.30); }

/* ══════════════════════════════════════════════════════════════
   ENGINE SWAP INDICATOR (results)
   ══════════════════════════════════════════════════════════════ */
.rpt-swap-indicator {
  margin: 10px 0 6px;
  padding: 9px 16px;
  background: rgba(109,40,217,0.10);
  border: 1px solid rgba(109,40,217,0.35);
  border-left: 4px solid var(--purple-600, #7c3aed);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--purple-600, #7c3aed);
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════════════════════════
   TURBO TECHNOLOGY RECOMMENDATION CARD
   ══════════════════════════════════════════════════════════════ */
.rpt-turbo-rec-card {
  margin: 6px 0 10px;
  padding: 10px 16px;
  background: rgba(20,184,166,0.08);
  border: 1px solid rgba(20,184,166,0.30);
  border-left: 4px solid #14b8a6;
  border-radius: 8px;
}
.rpt-turbo-rec-head {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.rpt-turbo-rec-label {
  color: var(--text-light);
  font-weight: 500;
}
.rpt-turbo-rec-type {
  color: #14b8a6;
  font-weight: 700;
}
.rpt-turbo-rec-spool {
  font-size: 0.82rem;
  color: var(--text-light);
}

/* ══════════════════════════════════════════════════════════════
   TUNING ADVISOR CARD
   ══════════════════════════════════════════════════════════════ */
.rpt-advisor-card {
  border-left: 4px solid var(--mint);
}

.rpt-advisor-type-badge {
  display: inline-block;
  background: rgba(20,229,160,0.12);
  color: #0a7a54;
  border: 1px solid rgba(20,229,160,0.35);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-left: 4px;
}

.rpt-advisor-boost-badge {
  display: inline-block;
  background: rgba(109,40,217,0.12);
  color: var(--purple-700);
  border: 1px solid rgba(109,40,217,0.28);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-left: 4px;
}

.rpt-advisor-note {
  font-size: 0.83rem;
  color: var(--text-light);
  padding: 3px 0 6px 2px;
  line-height: 1.5;
}

.rpt-advisor-boost-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--purple-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.rpt-advisor-boost-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 90px;
}

.rpt-advisor-boost-lbl {
  font-size: 0.70rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.rpt-advisor-boost-val {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}

.rpt-advisor-boost-target {
  color: var(--purple-600);
}

.rpt-advisor-boost-arrow {
  font-size: 1.4rem;
  color: var(--purple-200);
  flex: 0 0 auto;
  line-height: 1;
  align-self: center;
}

/* ══════════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ══════════════════════════════════════════════════════════════ */
.theme-toggle-btn {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 1.05rem;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,0.22); }

/* ══════════════════════════════════════════════════════════════
   DARK MODE — Base transitions
   ══════════════════════════════════════════════════════════════ */
html, body,
.form-card, .results-card, .rpt-card,
.app-header, .lang-menu, .modal-card,
.input, .select, .btn-back, .btn-secondary,
.disclaimer-card, .car-specs, .upgrades-grid,
.cat-btn, .rpt-upg-row, .rpt-stress-item,
.rpt-brands-block, .rpt-brands-toggle, .rpt-cost-row, .rpt-total-row,
.rpt-eco-row, .detail-stats .stat, .build-card,
.brand-chip, .status-badge, .flash {
  transition: background-color 0.3s ease, border-color 0.3s ease,
              color 0.3s ease, box-shadow 0.3s ease;
}

/* ══════════════════════════════════════════════════════════════
   DARK MODE — CSS variable overrides (html.dark)
   ══════════════════════════════════════════════════════════════ */
html.dark {
  --bg:          #121212;
  --card:        #1E1E28;
  --border:      #2D2B40;
  --text:        #E2D9FA;
  --text-light:  #9B8ECA;
  --purple-50:   #1A1828;
  --purple-100:  #231F38;
  /* purple-200 is the "readable purple on dark" used throughout dark mode text */
  --purple-200:  #C4B5FD;  /* violet-300 — bright, readable on dark backgrounds */
  --shadow-card: 0 18px 50px rgba(0,0,0,0.45);
  --shadow-soft: 0 6px 20px rgba(0,0,0,0.32);
}

html.dark body {
  background:
    radial-gradient(1100px 540px at 50% -200px, #2d255a, transparent 70%),
    linear-gradient(180deg, #1a1828 0%, #121212 100%);
  background-attachment: fixed;
  color: var(--text);
}

/* ── Cards & layout surfaces ── */
html.dark .form-card,
html.dark .results-card { background: var(--card); border-color: var(--border); }

html.dark .rpt-card { background: #1e1e2b; border-color: var(--border); }
html.dark .rpt-advisor-card { border-left-color: var(--mint); }

html.dark .rpt-stress-item { background: #17151f; border-color: var(--border); }
html.dark .rpt-brands-block { background: #17151f; border-color: var(--border); }
html.dark .rpt-brands-toggle { background: rgba(15,23,42,0.8); border-color: var(--border); color: var(--text); }
html.dark .rpt-brands-toggle:hover { background: rgba(30,41,59,0.9); }
html.dark details.rpt-brands-details[open] > .rpt-brands-toggle { border-bottom-color: transparent; }

html.dark .disclaimer-card { background: var(--card); border-color: var(--border); }
html.dark .disclaimer-card h1 { color: var(--purple-200); }
html.dark .disclaimer-card .lead { background: var(--purple-50); }
html.dark .disclaimer-card h3 { color: var(--purple-200); }

/* ── Navigation & header ── */
html.dark .lang-menu { background: #1e1e2b; border-color: var(--border); }
html.dark .lang-menu .lang-item { color: var(--text); }
html.dark .lang-menu .lang-item:hover { background: var(--purple-50); color: var(--purple-200); }
html.dark .lang-menu .lang-item.is-active { background: var(--purple-100); color: var(--purple-200); }

/* ── Forms & inputs ── */
html.dark .input,
html.dark .select { background: #17151f; color: var(--text); border-color: var(--border); }
html.dark .input::placeholder { color: #5a5275; }
html.dark .input:focus,
html.dark .select:focus { border-color: var(--purple-500); box-shadow: 0 0 0 4px rgba(109,40,217,0.18); }
html.dark .select:disabled { background: #1a1828; color: var(--text-light); }

html.dark .car-specs { background: var(--purple-50); border-color: var(--border); }
html.dark .upgrades-grid { background: var(--purple-50); border-color: var(--border); }

html.dark .cat-btn { background: var(--purple-50); color: var(--purple-200); border-color: var(--border); }
html.dark .cat-btn:hover { background: var(--purple-100); border-color: var(--purple-500); }
html.dark .cat-btn.is-active { background: linear-gradient(120deg, var(--purple-700), var(--purple-500)); color: #fff; }

html.dark .check:hover,
html.dark .radio:hover { background: var(--purple-50); }

/* ── Buttons ── */
html.dark .btn-back,
html.dark .btn-secondary,
html.dark .back-btn { background: #1e1e2b; color: var(--purple-200); border-color: var(--border); }
html.dark .btn-back:hover,
html.dark .btn-secondary:hover,
html.dark .back-btn:hover { background: var(--purple-50); }

/* ── Modal ── */
html.dark .modal-card { background: #1e1e2b; color: var(--text); border-color: var(--border); }
html.dark .modal-card h2 { color: var(--purple-200); }
html.dark .modal-card p { color: var(--text-light); }
html.dark .modal-close { color: var(--text-light); }
html.dark .modal-close:hover { background: var(--purple-50); color: var(--purple-200); }

/* ── Flash messages ── */
html.dark .flash { background: #1e1e2b; }

/* ── Output formatter classes ── */
html.dark .out-header { color: var(--purple-200); border-bottom-color: var(--border); }
html.dark .out-section { color: var(--purple-200); }
html.dark .out-mono { color: #c4b8f0; }
html.dark .out-link { background: var(--purple-50); color: var(--purple-200); border-color: var(--border); }
html.dark .out-link:hover { background: var(--purple-100); }
html.dark .out-details { background: var(--purple-50); border-color: var(--border); }
html.dark .out-details > summary { color: var(--purple-200); }
html.dark .out-details > summary:hover { background: var(--purple-100); }

/* ── Report card internals ── */
html.dark .rpt-card-title { color: var(--purple-200); }
html.dark .rpt-card-head { border-bottom-color: var(--border); }
html.dark .rpt-stat { background: var(--purple-50); border-color: var(--border); }
html.dark .rpt-stat-val { color: var(--text); }
html.dark .rpt-stat-arrow { color: var(--border); }
html.dark .rpt-section-label { color: var(--purple-200); }
html.dark .rpt-section-label.dim { color: var(--text-light); border-left-color: var(--border); }

html.dark .rpt-upg-row { background: var(--purple-50); border-color: var(--border); }
html.dark .rpt-upg-row:hover { background: var(--purple-100); }
html.dark .rpt-upg-name { color: var(--text); }
html.dark .rpt-upg-note { color: var(--text-light); }

html.dark .rpt-stress-name { color: var(--text); }
html.dark .rpt-stress-meta { color: var(--text-light); }
html.dark .rpt-bar-bg { background: #2d2b40; }

html.dark .rpt-part-name { color: var(--text); }
html.dark .rpt-part-reason { color: var(--text-light); }
html.dark .rpt-part-warn { background: rgba(180,83,9,0.10); }
html.dark .rpt-part-danger { background: rgba(220,38,38,0.10); }

html.dark .rpt-warn-item { background: rgba(180,83,9,0.10); border-color: rgba(180,83,9,0.30); }

html.dark .rpt-cost-row { background: var(--purple-50); border-color: var(--border); }
html.dark .rpt-cost-row.part-row { background: rgba(180,83,9,0.07); border-color: rgba(180,83,9,0.22); }
html.dark .rpt-part-accordion > .rpt-brands-block { background: #17151f; border-color: rgba(180,83,9,0.2); }
html.dark .rpt-part-accordion.part-row-danger > .rpt-brands-block { border-color: rgba(220,38,38,0.2); }
html.dark .rpt-cost-name { color: var(--text); }
html.dark .rpt-cost-range { color: var(--purple-200); }
html.dark .rpt-brand-name { color: var(--text); }
html.dark .rpt-brand-quality { color: var(--text-light); }
html.dark .rpt-brand-price { color: var(--text-light); }
html.dark .rpt-brand-row { border-bottom-color: var(--border); }
html.dark .rpt-shop-btn { background: rgba(15,23,42,0.8); color: var(--text); border-color: var(--border); }
html.dark .rpt-shop-btn:hover { background: rgba(30,41,59,0.9); }
html.dark .rpt-badge-budget  { background: rgba(6, 78, 45, 0.45); color: #34d399; border-color: #065f46; }
html.dark .rpt-badge-premium { background: rgba(79, 70, 229, 0.20); color: #a78bfa; border-color: #4338ca; }
html.dark .rpt-total-row { background: linear-gradient(120deg, var(--purple-50), #0c1a12); border-color: var(--mint-dark); }
html.dark .rpt-total-lbl { color: var(--text); }

html.dark .rpt-eco-row { background: var(--purple-50); border-color: var(--border); }
html.dark .rpt-eco-name { color: var(--text); }
html.dark .rpt-eco-srow-lbl { color: var(--text-light); }

html.dark .rpt-advisor-boost-row { background: var(--purple-50); border-color: var(--border); }
html.dark .rpt-advisor-boost-val { color: var(--text); }
html.dark .rpt-advisor-boost-arrow { color: var(--border); }
html.dark .rpt-advisor-type-badge { color: #14E5A0; background: rgba(20,229,160,0.10); border-color: rgba(20,229,160,0.30); }
html.dark .rpt-advisor-boost-badge { color: var(--purple-200); background: rgba(109,40,217,0.15); border-color: rgba(109,40,217,0.35); }
html.dark .rpt-advisor-note { color: var(--text-light); }

html.dark .rpt-swap-indicator { background: rgba(109,40,217,0.15); border-color: rgba(109,40,217,0.40); color: #a78bfa; }
html.dark .rpt-turbo-rec-card { background: rgba(20,184,166,0.10); border-color: rgba(20,184,166,0.30); }
html.dark .rpt-turbo-rec-type { color: #5eead4; }
html.dark .rpt-turbo-rec-spool { color: var(--text-light); }

/* ── Status pills & badges in dark ── */
html.dark .status-badge { background: var(--purple-50); border-color: var(--border); color: var(--text-light); }

/* ── Data tables ── */
html.dark .data-table { background: var(--card); }
html.dark .data-table td { border-bottom-color: var(--border); color: var(--text); }
html.dark .data-table tbody tr:hover { background: var(--purple-50); }
html.dark .detail-table th { background: var(--card); color: var(--text-light); border-bottom-color: var(--border); }

/* ── Builds browser ── */
html.dark .builds-page h1 { color: var(--purple-200); }
html.dark .build-card { background: #1e1e2b; border-color: var(--border); }
html.dark .build-card:hover { box-shadow: var(--shadow-card); }
html.dark .bc-model { color: var(--text); }
html.dark .bc-hp { color: var(--text); }
html.dark .brand-chip { background: #1e1e2b; border-color: var(--border); color: var(--text); }
html.dark .brand-chip:hover { background: var(--purple-50); border-color: var(--purple-500); }
html.dark .brand-group-title { color: var(--purple-200); border-bottom-color: var(--border); }
html.dark .detail-vehicle { color: var(--purple-200); }
html.dark .detail-stats .stat { background: #1e1e2b; border-color: var(--border); }
html.dark .detail-stats .stat-val { color: var(--text); }

/* ── Tooltips stay dark regardless of mode ── */
html.dark .tip-ico { background: #1e1e2b; border-color: var(--border); color: var(--purple-200); }
html.dark .tip:hover .tip-ico,
html.dark .tip:focus .tip-ico { background: var(--purple-600); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   DARK MODE — Purple contrast fixes
   Covers elements that use --purple-600/700/800 for text and
   were not yet overridden. Uses violet-400 (#A78BFA) for
   interactive purple and violet-300 (#C4B5FD) for headings.
   ══════════════════════════════════════════════════════════════ */

/* Global link colour */
html.dark a { color: #A78BFA; }
html.dark a:hover { color: #C4B5FD; }

/* Form section headings */
html.dark .section-title { color: #C4B5FD; }

/* Car spec panel heading */
html.dark .spec-head { color: #C4B5FD; }

/* Results panel heading */
html.dark .results-title { color: #C4B5FD; }

/* Footer link */
html.dark .app-footer a { color: #A78BFA; }

/* Generic accent text (.out-accent) */
html.dark .out-accent { color: #A78BFA; }

/* HP/stat accent value (Final HP) */
html.dark .rpt-stat-val.accent { color: #A78BFA; }

/* Advisor boost target value */
html.dark .rpt-advisor-boost-target { color: #A78BFA; }

/* Loading spinner */
html.dark .spinner {
  border-color: #2D2B40;
  border-top-color: #A78BFA;
}

/* Info status pill (rpt-status-info) */
html.dark .rpt-status-info {
  background: rgba(167,139,250,0.15);
  color: #C4B5FD;
  border-color: rgba(167,139,250,0.40);
}
/* Peripheral/orange status pill (Tier 2 — engine safe but mandatory peripheral) */
html.dark .rpt-status-peripheral {
  background: rgba(234,88,12,0.20);
  color: #fb923c;
  border-color: rgba(234,88,12,0.45);
}

/* Status badge (top-right of results) — info variant */
html.dark .status-badge { color: #A78BFA; }

/* Flash info */
html.dark .flash-info { color: #C4B5FD; border-color: #7C6FC4; }

/* Builds browser detail accent */
html.dark .bc-view { color: #A78BFA; }
html.dark .detail-vehicle { color: #A78BFA; }
html.dark .detail-stats .stat-val.accent { color: #A78BFA; }

/* Checkbox / radio accent-color — OS-rendered, best effort */
html.dark .check input,
html.dark .radio input { accent-color: #A78BFA; }

/* rpt-cost-range accent (upgrade price) */
html.dark .rpt-cost-range { color: #C4B5FD; }

/* out-details expand arrow */
html.dark .out-details > summary::before { color: #A78BFA; }
