 :root {
    --primary: #00A845;
    --primary-dark: #007A32;
    --primary-glow: rgba(0, 168, 69, 0.18);
    --bg: #F5F7F5;
    --bg2: #EDF2ED;
    --bg3: #E2EBE2;
    --card: #FFFFFF;
    --border: #D6E4D6;
    --border-strong: #B8D4B8;
    --text: #1A2E1A;
    --text-muted: #5A7A5A;
    --accent: #F59E0B;
    --danger: #EF4444;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
      radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0,168,69,0.07) 0%, transparent 60%),
      repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0,168,69,0.025) 40px, rgba(0,168,69,0.025) 41px),
      repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(0,168,69,0.025) 40px, rgba(0,168,69,0.025) 41px);
  }

  /* ===== HEADER ===== */
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 12px rgba(0,0,0,0.06);
  }

  .logo {
    font-family: 'Rajdhani', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text);
  }
  .logo span { color: var(--primary); }

  .logo-bolt {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: var(--primary);
    clip-path: polygon(60% 0%, 100% 0%, 40% 50%, 80% 50%, 0% 100%, 20% 50%, 0% 50%);
    margin-right: 8px;
    vertical-align: middle;
  }

  .header-tag {
    font-size: 12px;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
  }

  /* ===== HERO ===== */
  .hero {
    text-align: center;
    padding: 60px 20px 40px;
  }

  .hero-label {
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 16px;
  }

  .hero h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #1A2E1A 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .hero p {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
  }

  /* ===== SHARED FORM STYLES (used by download dialog) ===== */
  .form-group {
    margin-bottom: 20px;
  }

  .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
  }

  .form-group input {
    width: 100%;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
  }

  .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: #fff;
  }

  .form-group input::placeholder { color: #A8C4A8; }

  .gate-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 6px;
    display: none;
  }

  /* ===== MAIN LAYOUT ===== */
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
  }

  .calc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }

  @media (max-width: 900px) {
    .calc-layout { grid-template-columns: 1fr; }
    header { padding: 16px 20px; }
  }

  /* ===== ANIMATIONS ===== */

  /* Page load states */
  header { animation: slideDown 0.6s cubic-bezier(0.34,1.56,0.64,1) both; }
  @keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  .hero-label { animation: fadeUp 0.6s 0.2s ease both; }
  .hero h1    { animation: fadeUp 0.7s 0.35s ease both; }
  .hero p     { animation: fadeUp 0.7s 0.5s ease both; }
  @keyframes fadeUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
  }

  /* Cards stagger in */
  .card:nth-child(1) { animation: cardIn 0.65s 0.55s cubic-bezier(0.34,1.4,0.64,1) both; }
  .card:nth-child(2) { animation: cardIn 0.65s 0.7s  cubic-bezier(0.34,1.4,0.64,1) both; }
  .results-card      { animation: cardIn 0.65s 0.65s cubic-bezier(0.34,1.4,0.64,1) both; }
  @keyframes cardIn {
    from { transform: translateY(32px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
  }

  /* Logo bolt pulse */
  .logo-bolt { animation: boltPulse 2.4s ease-in-out infinite; }
  @keyframes boltPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.75; transform: scale(1.12); }
  }

  /* Metric boxes pop on load */
  .metric-box {
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .metric-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,168,69,0.15);
  }

  /* Metric value flash on update */
  @keyframes valuePop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.12); color: var(--primary); }
    100% { transform: scale(1); }
  }
  .metric-value.pop { animation: valuePop 0.4s cubic-bezier(0.34,1.56,0.64,1); }

  /* Slider thumb glow on drag */
  input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.4);
    box-shadow: 0 0 0 6px rgba(0,168,69,0.18);
  }

  /* Slider track fill animated gradient */
  input[type="range"] {
    background: linear-gradient(to right, var(--primary) var(--fill, 0%), var(--bg3) var(--fill, 0%));
    transition: background 0.15s;
  }

  /* Charger tab hover lift */
  .charger-tab {
    transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  }
  .charger-tab:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,168,69,0.15);
  }
  .charger-tab.active {
    animation: tabPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
  }
  @keyframes tabPop {
    0%   { transform: scale(0.92); }
    60%  { transform: scale(1.06); }
    100% { transform: scale(1); }
  }

  /* ROI bar shimmer */
  .roi-bar-fill {
    position: relative;
    overflow: hidden;
  }
  .roi-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: shimmer 2.2s 1s ease-in-out infinite;
  }
  @keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
  }

  /* Breakdown rows slide in */
  .breakdown-row {
    transition: background 0.2s;
    animation: rowIn 0.4s ease both;
  }
  .breakdown-row:hover { background: rgba(0,168,69,0.03); border-radius: 6px; }

  /* Download button pulse ring */
  .download-roi-btn {
    position: relative;
    overflow: visible;
  }
  .download-roi-btn::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 12px;
    border: 2px solid var(--primary);
    opacity: 0;
    transform: scale(1);
  }
  .download-roi-btn:hover::before {
    animation: ringPulse 0.6s ease forwards;
  }
  @keyframes ringPulse {
    0%   { opacity: 0.6; transform: scale(1); }
    100% { opacity: 0;   transform: scale(1.05); }
  }

  /* CTA button hover */
  .cta-btn {
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1) !important;
  }
  .cta-btn:hover {
    transform: translateY(-2px) scale(1.03) !important;
  }

  /* Floating particles in hero */
  .hero { position: relative; overflow: hidden; }
  .particle {
    position: absolute;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0;
    pointer-events: none;
    animation: floatUp var(--dur, 4s) var(--delay, 0s) ease-in infinite;
  }
  @keyframes floatUp {
    0%   { transform: translateY(0) scale(1); opacity: 0; }
    10%  { opacity: 0.25; }
    90%  { opacity: 0.08; }
    100% { transform: translateY(-120px) scale(0.5); opacity: 0; }
  }

  /* Results card live pulse border */
  .results-card {
    animation: cardIn 0.65s 0.65s cubic-bezier(0.34,1.4,0.64,1) both, borderGlow 3s 1.5s ease-in-out infinite alternate;
  }
  @keyframes borderGlow {
    from { box-shadow: 0 4px 24px rgba(0,168,69,0.10), 0 2px 8px rgba(0,0,0,0.06); }
    to   { box-shadow: 0 4px 32px rgba(0,168,69,0.22), 0 2px 8px rgba(0,0,0,0.06); }
  }

  /* Select focus ring animation */
  .select-group select {
    transition: border-color 0.25s, box-shadow 0.25s;
  }
  .select-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
  }

  /* Input row label flash when slider moves */
  .input-value {
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
  }
  .input-value.flash {
    animation: valueFlash 0.35s ease;
  }
  @keyframes valueFlash {
    0%   { color: var(--primary); transform: scale(1.18); }
    100% { color: var(--primary); transform: scale(1); }
  }
  .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  }

  .card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
  }

  .card-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .card-title-dot {
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
  }

  /* ===== SLIDER INPUTS ===== */
  .input-row {
    margin-bottom: 24px;
  }

  .input-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
  }

  .input-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
  }

  .input-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
  }

  input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--bg3);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    position: relative;
  }

  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: transform 0.2s;
  }

  input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.3); }
  input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
  }

  .range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #9AB89A;
    margin-top: 4px;
  }

  /* ===== SELECT ===== */
  .select-group {
    margin-bottom: 24px;
  }

  .select-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
  }

  .select-group select {
    width: 100%;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300A845' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
  }

  .select-group select:focus { border-color: var(--primary); }

  /* ===== RESULTS CARD ===== */
  .results-card {
    background: linear-gradient(135deg, #F0FAF4 0%, #FFFFFF 100%);
    border: 1.5px solid var(--border-strong);
    border-radius: 20px;
    padding: 32px;
    position: sticky;
    top: 90px;
    box-shadow: 0 4px 24px rgba(0,168,69,0.1), 0 2px 8px rgba(0,0,0,0.06);
  }

  .results-header {
    margin-bottom: 28px;
  }

  .results-header h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 22px;
    font-weight: 700;
  }

  .results-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
  }

  /* Key Metrics */
  .metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
  }

  .metric-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
  }

  .metric-box.highlight {
    background: rgba(0, 168, 69, 0.06);
    border-color: var(--border-strong);
    grid-column: 1 / -1;
  }

  .metric-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 6px;
  }

  .metric-box.highlight .metric-value { font-size: 40px; }

  .metric-label {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
  }

  /* Breakdown Table */
  .breakdown {
    margin-bottom: 24px;
  }

  .breakdown-title {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
  }

  .breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
  }

  .breakdown-row:last-child { border-bottom: none; }
  .breakdown-row span:first-child { color: var(--text-muted); }
  .breakdown-row span:last-child { font-weight: 600; font-family: 'Rajdhani', sans-serif; font-size: 15px; color: var(--text); }

  .breakdown-row.total span:first-child { color: var(--text); font-weight: 600; }
  .breakdown-row.total span:last-child { color: var(--primary); font-size: 17px; }

  /* ROI Bar */
  .roi-bar-wrapper {
    margin-bottom: 24px;
  }

  .roi-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
  }

  .roi-bar-track {
    height: 8px;
    background: var(--bg3);
    border-radius: 8px;
    overflow: hidden;
  }

  .roi-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #00FF85);
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
  }

  /* Payback timeline */
  .timeline {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
  }

  .timeline-item {
    flex: 1;
    height: 6px;
    background: var(--bg3);
    border-radius: 3px;
    transition: background 0.5s;
  }

  .timeline-item.active { background: var(--primary); }
  .timeline-item.partial { background: rgba(0,168,69,0.35); }

  .timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #9AB89A;
    margin-top: 4px;
  }

  /* CTA */
  .cta-section {
    background: rgba(0, 168, 69, 0.05);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
  }

  .cta-section p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
  }

  .cta-btn {
    display: inline-block;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
  }

  .cta-btn:hover { background: #00E65C; box-shadow: 0 4px 15px var(--primary-glow); }

  /* Assumption badge */
  .assumptions-note {
    font-size: 11px;
    color: #9AB89A;
    text-align: center;
    margin-top: 24px;
    line-height: 1.7;
  }

  /* Number tabs */
  .charger-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }

  .charger-tab {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
  }

  .charger-tab.active {
    background: rgba(0,168,69,0.08);
    border-color: var(--primary);
    color: var(--primary);
  }

  /* Divider */
  .divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
  }

  /* Toast */
  .toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 14px;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    color: var(--text);
  }
  .toast.show { transform: translateY(0); opacity: 1; }
  .toast strong { color: var(--primary); display: block; margin-bottom: 4px; }
  /* ===== DOWNLOAD DIALOG ===== */
  #dl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 30, 10, 0.55);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
  }
  #dl-overlay.active { display: flex; }

  .dl-card {
    background: #FFFFFF;
    border: 1.5px solid var(--border-strong);
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 50px rgba(0,0,0,0.18), 0 0 40px rgba(0,168,69,0.08);
    animation: dlSlideIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
  }

  @keyframes dlSlideIn {
    from { transform: scale(0.88) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
  }

  .dl-card::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 20px 20px 0 0;
  }

  .dl-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 32px; height: 32px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    transition: all 0.2s;
  }
  .dl-close:hover { background: var(--bg3); color: var(--text); }

  .dl-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, rgba(0,168,69,0.12), rgba(0,168,69,0.06));
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
  }
  .dl-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  .dl-card h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    margin-bottom: 6px;
  }
  .dl-card .dl-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 28px;
    line-height: 1.6;
  }

  .dl-btn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 15px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .dl-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
  .dl-btn:active { transform: translateY(0); }
  .dl-btn.loading { opacity: 0.7; pointer-events: none; }
  .dl-btn svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

  /* Download button in results */
  .download-roi-btn {
    width: 100%;
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 13px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .download-roi-btn:hover { background: var(--primary); color: #fff; box-shadow: 0 4px 16px var(--primary-glow); }
  .download-roi-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

  .dn{
    display: none !important;
  }