/* ========================================================
   EV SCULPTED BLUE GLASS SPEEDOMETER — JGVRP HUD
   Pixel-accurate implementation of Figma Node 2:2 (1560 × 720)
   ======================================================== */

:root {
    --hud-scale: 0.34;
    --cyan-glow: #3beaff;
    --cyan-bright: #51e6f5;
    --electric-blue: #079eff;
    --frost-text: #edf4f8;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100vw;
    height: 100vh;
    background: transparent;
    overflow: hidden;
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

.asset-img {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

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

/* ========================================================
   HUD CONTAINER — Bottom Right Corner (1920x1080)
   ======================================================== */
.hud-container {
    position: fixed;
    right: 22px;
    bottom: 20px;
    width: 1560px;
    height: 720px;
    transform-origin: bottom right;
    transform: scale(var(--hud-scale));
    z-index: 9000;
    pointer-events: none;
}

.speedometer-board {
    position: relative;
    width: 1560px;
    height: 720px;
    pointer-events: none;
}

.bg-silhouette-layer,
.glass-finish-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 1560px;
    height: 720px;
    pointer-events: none;
}

.bg-silhouette-layer { z-index: 1; }
.glass-finish-layer  { z-index: 2; }

/* ========================================================
   1. RIGHT ANALOG SPEEDOMETER (Figma 2:3)
   ======================================================== */
.speedometer-dial {
    position: absolute;
    left: 940px;
    top: 76px;
    width: 556px;
    height: 566px;
    z-index: 10;
}

.bezel-outer-ring,
.scale-ticks-layer,
.scale-labels-layer,
.accent-inner-arc,
.dial-warnings-layer,
.hub-fixed-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 556px;
    height: 566px;
}

.bezel-outer-inner {
    position: absolute;
    inset: -1.41% -2.16% -1.06% -2.16%;
}

.scale-labels-layer {
    color: #e6ecf0;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    z-index: 12;
}

.dial-label {
    position: absolute;
    font-size: 38px;
    font-weight: 400;
    color: #e6ecf0;
}

.dl-20  { left: 56.5px;  top: 269.5px; }
.dl-40  { left: 74.5px;  top: 173.5px; }
.dl-60  { left: 118.5px; top: 99.5px;  }
.dl-80  { left: 208.5px; top: 59.5px;  }
.dl-100 { left: 290.5px; top: 59.5px;  }
.dl-120 { left: 360.5px; top: 101.5px; }
.dl-140 { left: 419.5px; top: 173.5px; }
.dl-160 { left: 437.5px; top: 267.5px; }
.dl-180 { left: 411.5px; top: 362.5px; }

.dial-unit {
    position: absolute;
    left: 278px;
    top: 95px;
    transform: translateX(-50%);
    font-size: 19px;
    font-weight: 400;
    color: #e6ecf0;
    text-align: center;
}

.accent-inner-arc { z-index: 11; }
.dial-warnings-layer { z-index: 15; }

/* Engine Ready Plug (Green, Figma 2:291) */
.warn-engine-ready {
    position: absolute;
    left: 179px;
    top: 255px;
    width: 44px;
    height: 35px;
    opacity: 0.16;
    filter: grayscale(0.8);
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.warn-engine-ready.active {
    opacity: 1;
    filter: none;
}

.warn-engine-inner {
    position: absolute;
    inset: -9.82% 0 0 -7.53%;
}

/* Health Warning / Power Steering Amber (Figma 2:293) */
.warn-steering {
    position: absolute;
    left: 309px;
    top: 194px;
    width: 49px;
    height: 48px;
    opacity: 0.14;
    filter: grayscale(0.9);
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.warn-steering.active {
    opacity: 1;
    filter: none;
    animation: ev-amber-pulse 1.1s ease-in-out infinite;
}

@keyframes ev-amber-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.warn-steering-inner {
    position: absolute;
    inset: -6.56% -10% 0 -11.53%;
}

/* Headlights / Lighting State Indicator (Figma 2:298 & 2:302) */
.warn-lighting {
    position: absolute;
    left: 245px;
    top: 447px;
    width: 58px;
    height: 66px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.42;
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.warn-lighting-icon-wrap {
    position: relative;
    width: 58px;
    height: 45px;
    filter: drop-shadow(0px 0px 3.5px rgba(255, 153, 0, 0.5));
}

.warn-lighting-inner {
    position: absolute;
    inset: 9.5% 13.5%;
}

.warn-lighting-text {
    position: absolute;
    top: 40.5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: 500;
    color: #ffa400;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}

/* Headlights ON (Low Beam) */
.warn-lighting.mode-on {
    opacity: 1;
}

.warn-lighting.mode-on .warn-lighting-icon-wrap {
    filter: hue-rotate(85deg) saturate(1.4) brightness(1.15) drop-shadow(0 0 8px rgba(74, 222, 128, 0.85));
}

.warn-lighting.mode-on .warn-lighting-text {
    color: #5ef29a;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.65);
}

/* Headlights HIGH BEAM */
.warn-lighting.mode-high {
    opacity: 1;
}

.warn-lighting.mode-high .warn-lighting-icon-wrap {
    filter: hue-rotate(175deg) saturate(1.7) brightness(1.25) drop-shadow(0 0 11px rgba(59, 234, 255, 0.95));
}

.warn-lighting.mode-high .warn-lighting-text {
    color: #51e6f5;
    text-shadow: 0 0 10px rgba(59, 234, 255, 0.85);
}

/* Needle & Fixed Center Hub */
.needle-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 556px;
    height: 566px;
    transform-origin: 278px 282px;
    will-change: transform;
    transition: none !important;
    z-index: 18;
    pointer-events: none;
}

.hub-fixed-layer {
    z-index: 20;
    pointer-events: none;
}

/* ========================================================
   2. LEFT FUEL GAUGE & CHARGE ESTIMATES (Figma 2:4)
   ======================================================== */
.fuel-section {
    position: absolute;
    left: 150px;
    top: 150px;
    width: 480px;
    height: 355px;
    z-index: 10;
}

.fine-charging-grid {
    position: absolute;
    left: 170px;
    top: 210px;
    width: 600px;
    height: 190px;
    pointer-events: none;
}

.fine-charging-grid-inner {
    position: absolute;
    inset: -0.32% 0 0 0;
}

.charge-estimate-header {
    position: absolute;
    left: 50px;
    top: 0;
    width: 430px;
    height: 78px;
}

.charge-heading {
    position: absolute;
    left: 10px;
    top: 4px;
    font-size: 32px;
    font-weight: 400;
    color: #f1f5f9;
    white-space: nowrap;
}

.etched-underline {
    position: absolute;
    left: 0;
    top: 38px;
    width: 281px;
    height: 18px;
}

.etched-underline-inner {
    position: absolute;
    inset: -24.07% -1.76% -27.78% -1.77%;
}

.underline-highlight {
    position: absolute;
    left: 20px;
    top: 61px;
    width: 240px;
    height: 1px;
}

.underline-highlight-inner {
    position: absolute;
    inset: -0.5px 0;
}

/* Vertical Battery Fuel Gauge (Figma 2:108) */
.battery-fuel-gauge {
    position: absolute;
    left: 0;
    top: 94px;
    width: 184px;
    height: 230px;
}

.battery-shell-box {
    position: absolute;
    left: 78px;
    top: 7px;
    width: 85px;
    height: 211px;
}

.battery-shell-inner {
    position: absolute;
    inset: -3.08% -7.65%;
}

.battery-inset {
    position: absolute;
    left: 85px;
    top: 23px;
    width: 71px;
    height: 187px;
    border-radius: 1px;
    border: 1.5px solid rgba(167, 205, 227, 0.4);
    background: linear-gradient(180deg, rgba(27, 53, 76, 0.65) 0%, rgba(62, 101, 125, 0.5) 100%);
}

.fuel-segments-wrap {
    position: absolute;
    left: 88px;
    top: 26px;
    width: 65px;
    height: 184px;
}

.fuel-seg {
    position: absolute;
    left: 0;
    width: 65px;
    height: 6.2px;
    background: linear-gradient(180deg, rgba(130, 156, 169, 0.5) 0%, rgba(105, 138, 157, 0.32) 100%);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.fuel-seg.active {
    background: linear-gradient(180deg, #a2f7ff 0%, #51e6f5 42%, #00bbdd 100%);
}

.fuel-seg.active.top-cap {
    box-shadow: 0 0 8px rgba(59, 234, 255, 0.78);
}

.fuel-section.low-fuel .fuel-seg.active {
    background: linear-gradient(180deg, #ff9c8a 0%, #ff5e57 45%, #d92638 100%);
}

.fuel-section.low-fuel .fuel-seg.active.top-cap {
    box-shadow: 0 0 9px rgba(255, 82, 82, 0.85);
}

.fuel-scale-txt {
    position: absolute;
    font-size: 26px;
    font-weight: 400;
    color: #e0ebf3;
    line-height: 1;
}

.fst-100 { left: 7px;  top: 8px;   }
.fst-75  { left: 21px; top: 55px;  }
.fst-50  { left: 21px; top: 102px; }
.fst-25  { left: 21px; top: 149px; }

.fuel-unit-pct {
    position: absolute;
    left: 35px;
    top: 202px;
    font-size: 25px;
    color: #f1f5f9;
    line-height: 1;
}

.fuel-tick {
    position: absolute;
    left: 58px;
    width: 15px;
    height: 1.5px;
}

.ft-100 { top: 23.25px; }
.ft-75  { top: 70.25px; }
.ft-50  { top: 117.25px; }
.ft-25  { top: 164.25px; }

/* 4 Side Fuel Marker Dots */
.fuel-marker-dot {
    position: absolute;
    left: -29px;
    width: 11px;
    height: 11px;
}

.fmd-1 { top: 89px;  }
.fmd-2 { top: 108px; }
.fmd-3 { top: 127px; }
.fmd-4 { top: 146px; }

.fuel-marker-dot .marker-idle {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.fuel-marker-dot .marker-active {
    position: absolute;
    inset: -72.73%;
    width: 245.46%;
    height: 245.46%;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.fuel-marker-dot.is-active .marker-idle { opacity: 0; }
.fuel-marker-dot.is-active .marker-active { opacity: 1; }

/* Charging Estimates & Glass kW Box (Figma 2:146) */
.charging-estimates {
    position: absolute;
    left: 188px;
    top: 81px;
    width: 292px;
    height: 244px;
}

.est-text {
    position: absolute;
    left: 7px;
    font-size: 29px;
    font-weight: 400;
    color: #f1f5f9;
    line-height: 1.1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.est-0   { top: 0px;   }
.est-47  { top: 47px;  }
.est-94  { top: 94px;  }
.est-141 { top: 141px; }
.est-188 { top: 188px; }

.est-rule {
    position: absolute;
    left: 0;
    width: 110px;
    height: 1.5px;
}

.er-0   { top: 34.25px; }
.er-47  { top: 81.25px; }
.er-94  { top: 128.25px; }
.er-141 { top: 175.25px; }
.er-188 { top: 222.25px; }

.power-readout-glass {
    position: absolute;
    left: 124px;
    top: 59px;
    width: 164px;
    height: 46px;
    border-radius: 5px;
    border: 1.5px solid rgba(208, 223, 233, 0.75);
    background: linear-gradient(180deg, rgba(178, 209, 226, 0.15) 0%, rgba(84, 122, 148, 0.12) 100%);
}

.power-readout-text {
    position: absolute;
    left: 206px;
    top: 64px;
    transform: translateX(-50%);
    font-size: 30px;
    font-weight: 400;
    color: #f1f5f9;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.power-connector {
    position: absolute;
    left: 111px;
    top: 81.5px;
    width: 13px;
    height: 1px;
}

/* ========================================================
   3. CENTER RPM GAUGE & GEAR INDICATOR (Figma 2:5)
   ======================================================== */
.rpm-gear-section {
    position: absolute;
    left: 643px;
    top: 325px;
    width: 220px;
    height: 190px;
    z-index: 12;
}

.rpm-arc-outer-rim {
    position: absolute;
    left: 11px;
    top: 5px;
    width: 188px;
    height: 147.916px;
}

.rpm-arc-outer-rim-inner {
    position: absolute;
    inset: -3.72% -2.93% -3.29% -2.93%;
}

.rpm-arc-track {
    position: absolute;
    left: 22px;
    top: 16px;
    width: 166px;
    height: 130.607px;
}

.rpm-arc-track-inner {
    position: absolute;
    inset: -5.74% -4.52% -3.29% -4.52%;
}

.rpm-dynamic-svg {
    position: absolute;
    left: 14.5px;
    top: 8.5px;
    width: 181px;
    height: 142.409px;
    display: block;
    overflow: visible;
    z-index: 2;
}

/* Exact 22 Figma RPM Ticks */
.rpm-tick {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

.rt-0  { left: 29.64px; top: 142.59px; width: 13.106px; height: 9.177px;  }
.rt-1  { left: 21.46px; top: 130.83px; width: 14.529px; height: 6.702px;  }
.rt-2  { left: 15.94px; top: 118.06px; width: 15.489px; height: 4.013px;  }
.rt-3  { left: 13.26px; top: 104.68px; width: 15.955px; height: 1.196px;  }
.rt-4  { left: 13.50px; top: 89.46px;  width: 15.914px; height: 1.659px;  }
.rt-5  { left: 16.65px; top: 73.35px;  width: 15.365px; height: 4.461px;  }
.rt-6  { left: 22.61px; top: 58.05px;  width: 14.328px; height: 7.121px;  }
.rt-7  { left: 31.20px; top: 44.06px;  width: 12.834px; height: 9.555px;  }
.rt-8  { left: 42.14px; top: 31.82px;  width: 10.931px; height: 11.684px; }
.rt-9  { left: 55.09px; top: 21.72px;  width: 8.681px;  height: 13.44px;  }
.rt-10 { left: 69.62px; top: 14.08px;  width: 6.154px;  height: 14.769px; }
.rt-11 { left: 85.27px; top: 9.14px;   width: 3.431px;  height: 15.628px; }
.rt-12 { left: 101.56px; top: 7.06px;  width: 0.598px;  height: 15.989px; }
.rt-13 { left: 115.70px; top: 7.92px;  width: 2.253px;  height: 15.841px; }
.rt-14 { left: 128.91px; top: 11.67px; width: 5.033px;  height: 15.188px; }
.rt-15 { left: 141.35px; top: 18.20px; width: 7.652px;  height: 14.052px; }
.rt-16 { left: 152.63px; top: 27.31px; width: 10.028px; height: 12.468px; }
.rt-17 { left: 162.40px; top: 38.70px; width: 12.084px; height: 10.487px; }
.rt-18 { left: 170.34px; top: 52.01px; width: 13.756px; height: 8.172px;  }
.rt-19 { left: 176.20px; top: 66.82px; width: 14.989px; height: 5.597px;  }
.rt-20 { left: 179.79px; top: 82.65px; width: 15.745px; height: 2.844px;  }
.rt-21 { left: 181px;    top: 99px;    width: 16px;     height: 1px;      }

.rti-0  { position: absolute; inset: -4.46% -2.19%; }
.rti-1  { position: absolute; inset: -6.77% -1.44%; }
.rti-2  { position: absolute; inset: -12.06% -0.81%; }
.rti-3  { position: absolute; inset: -41.7% -0.23%; }
.rti-4  { position: absolute; inset: -29.97% -0.33%; }
.rti-5  { position: absolute; inset: -10.76% -0.91%; }
.rti-6  { position: absolute; inset: -6.29% -1.55%; }
.rti-7  { position: absolute; inset: -4.2% -2.33%; }
.rti-8  { position: absolute; inset: -2.92% -3.34%; }
.rti-9  { position: absolute; inset: -2.02% -4.84%; }
.rti-10 { position: absolute; inset: -1.3% -7.5%; }
.rti-11 { position: absolute; inset: -0.69% -14.24%; }
.rti-12 { position: absolute; inset: -0.12% -83.52%; }
.rti-13 { position: absolute; inset: -0.44% -21.97%; }
.rti-14 { position: absolute; inset: -1.04% -9.43%; }
.rti-15 { position: absolute; inset: -1.7% -5.74%; }
.rti-16 { position: absolute; inset: -2.51% -3.89%; }
.rti-17 { position: absolute; inset: -3.6% -2.71%; }
.rti-18 { position: absolute; inset: -5.26% -1.86%; }
.rti-19 { position: absolute; inset: -8.37% -1.17%; }
.rti-20 { position: absolute; inset: -17.3% -0.56%; }
.rti-21 { position: absolute; inset: -0.5px 0; }

/* Gear Box (Figma 2:188 & 2:189) */
.gear-box-outline {
    position: absolute;
    left: 80px;
    top: 64px;
    width: 50px;
    height: 57px;
    border: 2px solid #edf4f8;
    border-radius: 5px;
    background: linear-gradient(180deg, rgba(217, 236, 245, 0.13) 0%, rgba(81, 115, 137, 0.04) 100%);
    box-shadow: 0 0 4px rgba(168, 216, 247, 0.25);
    z-index: 4;
}

.gear-letter {
    position: absolute;
    left: 105px;
    top: 92.5px;
    transform: translate(-50%, -50%);
    font-size: 46px;
    font-weight: 400;
    color: #edf4f8;
    line-height: 1;
    text-align: center;
    z-index: 5;
}

/* e-Pedal / Engine Status Pill (Figma 2:394, 2:190, 2:391) */
.epedal-pill {
    position: absolute;
    left: 82px;
    top: 152px;
    width: 115px;
    height: 26px;
    border-radius: 3px;
    background: rgba(112, 143, 171, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.epedal-pill.is-on {
    background: rgba(18, 168, 238, 0.34);
    box-shadow: 0 0 10px rgba(59, 234, 255, 0.35);
}

.epedal-text {
    font-size: 17px;
    font-weight: 400;
    color: #edf4f8;
    line-height: 1;
    white-space: nowrap;
}

.epedal-arrows-box {
    position: absolute;
    left: 33px;
    top: 153px;
    width: 31px;
    height: 31px;
    opacity: 0.38;
    filter: drop-shadow(0 0 2.5px rgba(36, 158, 255, 0.3));
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.epedal-arrows-box.active {
    opacity: 1;
    filter: drop-shadow(0 0 7px rgba(59, 234, 255, 0.85));
}

.epedal-arrows-inner {
    position: absolute;
    inset: 2% 5%;
}

/* ========================================================
   4. TOP STATUS BAR: CLOCK, TEMP & TURN ARROWS (Figma 2:6)
   ======================================================== */
.top-status-bar {
    position: absolute;
    left: 580px;
    top: 139px;
    width: 280px;
    height: 55px;
    color: var(--frost-text);
    z-index: 15;
}

.status-time {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.status-meridiem {
    position: absolute;
    left: 80px;
    top: 10px;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.1;
}

.status-temp {
    position: absolute;
    left: 191px;
    top: 0;
    font-size: 35px;
    font-weight: 400;
    line-height: 1.1;
}

.turn-signals-inline {
    position: absolute;
    left: 122px;
    top: 12px;
    width: 58px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ev-turn-arrow {
    color: #3beaff;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ev-turn-arrow.active {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(59, 234, 255, 0.95));
    animation: ev-turn-blink 0.72s ease-in-out infinite;
}

@keyframes ev-turn-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* ========================================================
   5. SEATBELT & MUSIC ICONS (Figma 2:404 & 2:496)
   ======================================================== */
.seatbelt-icon-btn,
.music-icon-btn {
    position: absolute;
    top: 241px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer !important;
    pointer-events: auto !important;
    outline: none;
    z-index: 25;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease, filter 0.25s ease;
}

.seatbelt-icon-btn { left: 702px; }
.music-icon-btn    { left: 784px; }

.seatbelt-icon-frame,
.music-icon-frame {
    position: relative;
    width: 44px;
    height: 44px;
}

.seatbelt-icon-inner {
    position: absolute;
    inset: 4.55% 23.5% 5.5% 23.5%;
}

.music-icon-inner {
    position: absolute;
    inset: 11.36% 11.36% 11.22% 11.36%;
}

/* Seatbelt Buckled (ON = Safe, subtle dim) vs Unbuckled (OFF = Red Warning Glow & Pulse!) */
.seatbelt-icon-btn {
    opacity: 0.24;
    filter: saturate(0.4);
}

.seatbelt-icon-btn:hover {
    transform: scale(1.12);
    opacity: 0.8;
}

.seatbelt-icon-btn.unbuckled {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(255, 119, 112, 0.9));
    animation: seatbelt-warn-pulse 0.9s ease-in-out infinite;
}

@keyframes seatbelt-warn-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(1.07); }
}

/* Music Button (YouTube Music Integration) */
.music-icon-btn {
    opacity: 0.88;
}

.music-icon-btn:hover {
    opacity: 1;
    transform: scale(1.14);
    filter: drop-shadow(0 0 10px rgba(185, 233, 255, 0.9));
}

.music-icon-btn:active {
    transform: scale(0.92);
}

.music-icon-btn.active {
    opacity: 1;
    filter: brightness(1.25) drop-shadow(0 0 12px rgba(59, 234, 255, 0.95));
    animation: music-active-float 1.8s ease-in-out infinite alternate;
}

@keyframes music-active-float {
    0% { transform: translateY(0) scale(1.04); }
    100% { transform: translateY(-2.5px) scale(1.1); }
}

/* ========================================================
   6. BOTTOM VEHICLE METRICS BAR (Figma 2:7)
   ======================================================== */
.vehicle-metrics-bar {
    position: absolute;
    left: 170px;
    top: 528px;
    width: 690px;
    height: 53px;
    z-index: 15;
}

.metric-health {
    position: absolute;
    left: 0;
    top: 0;
    width: 268px;
    height: 53px;
}

.metric-range {
    position: absolute;
    left: 326px;
    top: 0;
    width: 205px;
    height: 53px;
}

.metric-trip {
    position: absolute;
    left: 562px;
    top: 0;
    width: 150px;
    height: 53px;
}

.metric-icon-box {
    position: absolute;
    left: 0;
    top: 10px;
    width: 27px;
    height: 27px;
}

.metric-icon-inner {
    position: absolute;
    inset: 12% 8% 8% 12%;
}

.metric-value {
    position: absolute;
    top: 7px;
    font-size: 27px;
    font-weight: 400;
    color: var(--frost-text);
    line-height: 1.15;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.health-pct { left: 38px; }
.range-val  { left: 40px; }
.trip-val   { left: 34px; }

.health-bar-track {
    position: absolute;
    left: 114px;
    top: 9px;
    width: 148px;
    height: 28px;
    border: 2px solid rgba(220, 234, 245, 0.7);
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(188, 203, 221, 0.22) 0%, rgba(112, 139, 158, 0.06) 45%, rgba(205, 232, 250, 0.2) 100%);
}

.health-bar-fill {
    position: absolute;
    left: 118px;
    top: 13px;
    width: 140px;
    height: 20px;
    background: linear-gradient(180deg, #79eaff 0%, #1cd2f8 40%, #0080d6 100%);
    box-shadow: 0 0 6px rgba(17, 187, 255, 0.65);
    transition: width 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.metric-health.low-health .health-bar-fill {
    background: linear-gradient(180deg, #ff9a8a 0%, #ff5252 45%, #c61a2b 100%);
    box-shadow: 0 0 8px rgba(255, 82, 82, 0.85);
}

.metric-health.low-health .health-pct {
    color: #ff7770;
}

.health-bar-cap {
    position: absolute;
    left: 262px;
    top: 15px;
    width: 5px;
    height: 16px;
    background: rgba(169, 195, 213, 0.85);
}

.trip-badge-box {
    position: absolute;
    left: 0;
    top: 8px;
    width: 23px;
    height: 26px;
    border: 2px solid #edf4f8;
    border-radius: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trip-badge-letter {
    font-size: 19px;
    font-weight: 500;
    color: #edf4f8;
    line-height: 1;
}

/* ========================================================
   COMPACT GEAR SETTINGS BUTTON (26x26px) & POPUP SLIDER
   EV Blue Glass Theme
   ======================================================== */
.speedo-settings-btn {
    position: fixed;
    right: 22px;
    bottom: calc(20px + (720px * var(--hud-scale)) + 6px);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(14, 34, 54, 0.88);
    border: 1.5px solid rgba(59, 234, 255, 0.5);
    color: #b9e9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    pointer-events: auto !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 8px rgba(59, 234, 255, 0.25);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    z-index: 99999;
    outline: none;
}

.speedo-settings-btn svg {
    width: 13px;
    height: 13px;
}

.speedo-settings-btn:hover {
    transform: scale(1.12) rotate(45deg);
    background: #173859;
    border-color: #3beaff;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), 0 0 14px rgba(59, 234, 255, 0.65);
}

.speedo-settings-btn.active {
    background: #079eff;
    border-color: #a2f7ff;
    color: #ffffff;
    transform: scale(1.06) rotate(90deg);
    box-shadow: 0 0 14px rgba(59, 234, 255, 0.85);
}

.speedo-settings-btn:active {
    transform: scale(0.92);
}

.speedo-settings-popup {
    position: fixed;
    right: 22px;
    bottom: min(calc(20px + (720px * var(--hud-scale)) + 40px), calc(100vh - 340px));
    width: 310px;
    max-width: calc(100vw - 40px);
    background: #102437;
    border: 1.5px solid #2c577c;
    border-radius: 16px;
    padding: 16px 18px;
    color: #edf4f8;
    font-family: 'Roboto', system-ui, sans-serif;
    box-shadow: 0 12px 36px rgba(4, 12, 22, 0.65), 0 0 20px rgba(59, 234, 255, 0.28);
    z-index: 100000;
    pointer-events: auto !important;
    transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.22s;
    user-select: none;
}

.speedo-settings-popup.closed {
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    pointer-events: none !important;
}

.speedo-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(59, 234, 255, 0.22);
    margin-bottom: 14px;
    cursor: grab;
}

.speedo-settings-header:active { cursor: grabbing; }

.speedo-settings-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
}

.speedo-drag-grip {
    color: #6a94b4;
    font-size: 16px;
    line-height: 1;
}

.speedo-settings-close-btn {
    background: #173149;
    border: 1px solid #2c577c;
    color: #b9e9ff;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    outline: none;
}

.speedo-settings-close-btn:hover {
    background: #e11d48;
    border-color: #e11d48;
    color: #ffffff;
}

.speedo-setting-row { margin-bottom: 14px; }
.speedo-setting-row:last-child { margin-bottom: 0; }

.setting-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.setting-title-text {
    font-size: 13px;
    font-weight: 600;
    color: #dcebf5;
}

.setting-val-badge {
    background: #0d2b45;
    border: 1px solid #1cb7f6;
    color: #a2f7ff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
}

.speedo-scale-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #0a1b2b;
    border-radius: 6px;
    outline: none;
    border: 1px solid #2c577c;
    cursor: pointer;
}

.speedo-scale-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #3beaff;
    border: 2.5px solid #ffffff;
    box-shadow: 0 0 10px rgba(59, 234, 255, 0.85);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.speedo-scale-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.scale-tick-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: #8cb2cc;
    margin-top: 5px;
    font-weight: 600;
}

.setting-sub-heading {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #8cb2cc;
    margin-bottom: 6px;
}

.speedo-scale-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.scale-preset-btn {
    background: #173149;
    border: 1px solid #2c577c;
    border-radius: 8px;
    padding: 6px 0;
    font-size: 11px;
    font-weight: 700;
    color: #c8e3f5;
    cursor: pointer;
    text-align: center;
    transition: all 0.16s ease;
    outline: none;
}

.scale-preset-btn:hover {
    background: #214261;
    border-color: #3beaff;
    color: #ffffff;
}

.scale-preset-btn.active {
    background: #079eff;
    border-color: #a2f7ff;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(59, 234, 255, 0.55);
}

.speedo-reset-btn {
    width: 100%;
    background: #173149;
    border: 1px solid #2c577c;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #edf4f8;
    cursor: pointer;
    transition: all 0.18s ease;
    outline: none;
}

.speedo-reset-btn:hover {
    background: #079eff;
    border-color: #a2f7ff;
    color: #ffffff;
}
