/* FDG Solar Rev 3.7.3 — Reference Alignment
   PRESENTATION LAYER ONLY
   Scoped to calculator shell + remaster classes.
   Protected calculation/document/business logic is untouched. */

:root{
  --r37-bg:#06101d;
  --r37-bg2:#081827;
  --r37-panel:#0b2032;
  --r37-panel2:#0f2940;
  --r37-line:rgba(121,157,191,.20);
  --r37-line2:rgba(121,157,191,.32);
  --r37-gold:#f6b53f;
  --r37-gold2:#ffd064;
  --r37-blue:#3b82f6;
  --r37-cyan:#21c7e8;
  --r37-green:#31d38a;
  --r37-violet:#a96df3;
  --r37-slate:#8ba0b7;
  --r37-text:#f7fafc;
  --r37-muted:#9bb0c4;
  --r37-dim:#627990;
  --r37-shadow:0 20px 60px rgba(0,0,0,.28);
}

html,body{background:var(--r37-bg)}
.app{position:relative}
.main{
  flex:1;
  width:100%;
  min-width:0;
  background:
    radial-gradient(circle at 70% -5%,rgba(246,181,63,.065),transparent 30%),
    radial-gradient(circle at 0 50%,rgba(33,199,232,.025),transparent 24%),
    linear-gradient(180deg,#06101d 0%,#071522 48%,#06101d 100%) !important;
}

/* ── AUTO-HIDE NAVIGATION ─────────────────────────────────── */
.sidebar{
  position:fixed !important;
  inset:0 auto 0 0;
  width:252px !important;
  min-width:252px !important;
  height:100vh !important;
  z-index:950 !important;
  transform:translateX(calc(-100% + 10px));
  transition:transform .28s cubic-bezier(.2,.75,.2,1),box-shadow .28s ease !important;
  background:
    linear-gradient(180deg,rgba(3,10,19,.992),rgba(5,14,26,.985)) !important;
  border-right:1px solid rgba(121,157,191,.15) !important;
  box-shadow:none;
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
}
.sidebar:hover,
.sidebar.fdg-r37-open,
body.fdg-r37-nav-open .sidebar{
  transform:translateX(0);
  box-shadow:24px 0 70px rgba(0,0,0,.44);
}
.sidebar::before{
  opacity:.42 !important;
  background:linear-gradient(to bottom,transparent,var(--r37-gold),rgba(33,199,232,.4),transparent) !important;
}
.sidebar::after{
  content:"";
  position:absolute;
  top:0;right:0;bottom:0;
  width:10px;
  background:linear-gradient(180deg,rgba(246,181,63,.20),rgba(33,199,232,.08),rgba(246,181,63,.12));
  opacity:.52;
  pointer-events:none;
}
.sidebar-logo{padding:27px 20px 19px !important}
.sidebar .logo-sun{
  width:43px !important;height:43px !important;
  border-radius:12px !important;
  box-shadow:0 13px 32px rgba(245,158,11,.24) !important;
}
.sidebar .logo-name{font-size:17px !important;letter-spacing:.1px !important}
.sidebar .logo-sub{max-width:195px;line-height:1.28;color:#678198 !important}
.sidebar .nav{padding:14px 10px !important}
.sidebar .nav-item{
  margin:4px 0;
  padding:11px 12px !important;
  border-radius:10px;
  border-left:0 !important;
}
.sidebar .nav-item.active{
  background:linear-gradient(90deg,rgba(246,181,63,.16),rgba(246,181,63,.045)) !important;
  box-shadow:inset 0 0 0 1px rgba(246,181,63,.18);
}
.fdg-r37-sidebar-handle{
  position:fixed;
  z-index:975;
  left:0;
  top:50%;
  transform:translateY(-50%);
  width:38px;height:92px;
  border:1px solid rgba(246,181,63,.32);
  border-left:0;
  border-radius:0 14px 14px 0;
  background:rgba(5,16,29,.92);
  color:var(--r37-gold2);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  box-shadow:10px 12px 34px rgba(0,0,0,.25);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  transition:left .28s cubic-bezier(.2,.75,.2,1),background .18s ease;
}
.fdg-r37-sidebar-handle:hover{background:rgba(246,181,63,.12)}
.fdg-r37-sidebar-handle span{
  writing-mode:vertical-rl;
  transform:rotate(180deg);
  font-size:8px;
  font-weight:900;
  letter-spacing:1.7px;
  text-transform:uppercase;
}
body.fdg-r37-nav-open .fdg-r37-sidebar-handle{left:252px}
.fdg-r37-nav-backdrop{
  position:fixed;inset:0;z-index:940;
  opacity:0;pointer-events:none;
  background:rgba(1,6,13,.58);
  backdrop-filter:blur(2px);
  transition:opacity .18s ease;
}
body.fdg-r37-nav-open .fdg-r37-nav-backdrop{opacity:1;pointer-events:auto}

/* ── CALCULATOR CANVAS ───────────────────────────────────── */
#view-calc{
  max-width:1700px;
  margin:0 auto;
  padding:16px 22px 44px !important;
}
#view-calc > .page-header{display:none !important}

/* ── HERO ────────────────────────────────────────────────── */
#view-calc .fdg-r37-hero{
  position:relative;
  overflow:hidden;
  min-height:430px;
  margin:0 0 14px;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.105);
  background:
    linear-gradient(90deg,rgba(2,8,16,.985) 0%,rgba(2,8,16,.925) 28%,rgba(2,8,16,.56) 53%,rgba(2,8,16,.18) 77%,rgba(2,8,16,.30) 100%),
    linear-gradient(180deg,rgba(2,8,16,.04),rgba(2,8,16,.60)),
    url("https://images.unsplash.com/photo-1775686332316-8e1ce04d10d7?auto=format&fit=crop&fm=jpg&q=88&w=2600") center 47%/cover no-repeat;
  box-shadow:var(--r37-shadow);
  isolation:isolate;
}
#view-calc .fdg-r37-hero::before{
  content:"";
  position:absolute;inset:0;z-index:-1;
  background:
    radial-gradient(circle at 51% 30%,rgba(255,193,79,.16),transparent 14%),
    linear-gradient(110deg,transparent 0 61%,rgba(255,255,255,.035) 61.2%,transparent 61.6%);
  pointer-events:none;
}
#view-calc .fdg-r37-hero::after{
  content:"";
  position:absolute;inset:auto 0 0;height:48%;
  background:linear-gradient(to top,rgba(3,10,18,.74),transparent);
  z-index:-1;pointer-events:none;
}
#view-calc .fdg-r37-hero-inner{
  min-height:430px;
  display:grid;
  grid-template-columns:minmax(0,1.22fr) minmax(345px,.78fr);
  gap:28px;
  align-items:end;
  padding:38px 38px 30px;
}
#view-calc .fdg-r37-hero-copy{align-self:center;max-width:800px}
#view-calc .fdg-r37-eyebrow{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(246,181,63,.22);
  background:rgba(246,181,63,.075);
  color:#efc673;
  font-size:8px;font-weight:900;letter-spacing:1.9px;text-transform:uppercase;
  margin-bottom:16px;
  backdrop-filter:blur(8px);
}
#view-calc .fdg-r37-eyebrow::before{
  content:"";width:6px;height:6px;border-radius:50%;
  background:var(--r37-green);
  box-shadow:0 0 0 5px rgba(49,211,138,.075),0 0 16px rgba(49,211,138,.55);
}
#view-calc .fdg-r37-hero h1{
  margin:0;
  max-width:820px;
  color:#f8fafc;
  font-family:Georgia,'Times New Roman',serif;
  font-size:clamp(42px,4.45vw,68px);
  font-weight:700;
  line-height:.94;
  letter-spacing:-2.25px;
  text-wrap:balance;
  text-shadow:0 9px 28px rgba(0,0,0,.38);
}
#view-calc .fdg-r37-hero h1 em{
  display:block;
  font-style:normal;
  color:var(--r37-gold2);
}
#view-calc .fdg-r37-hero p{
  max-width:650px;
  margin:17px 0 0;
  color:#c4d2df;
  font-size:13px;
  line-height:1.65;
}
#view-calc .fdg-r37-actions{
  display:flex;flex-wrap:wrap;gap:10px;
  margin-top:22px;
}
#view-calc .fdg-r37-action{
  min-height:43px;
  padding:0 17px;
  border-radius:9px;
  border:1px solid rgba(255,255,255,.12);
  cursor:pointer;
  font-family:var(--body);
  font-size:11px;font-weight:800;letter-spacing:.15px;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
#view-calc .fdg-r37-action:hover{transform:translateY(-2px)}
#view-calc .fdg-r37-action.primary{
  color:#07101d;
  background:linear-gradient(135deg,#ffd26d,#f5a90c);
  border-color:rgba(255,210,109,.68);
  box-shadow:0 12px 30px rgba(245,169,12,.23);
}
#view-calc .fdg-r37-action.secondary{
  color:#eef6ff;
  background:linear-gradient(180deg,rgba(19,65,104,.82),rgba(8,37,65,.82));
  border-color:rgba(72,142,205,.46);
  box-shadow:0 10px 24px rgba(0,0,0,.18);
}
#view-calc .fdg-r37-trust-row{
  display:flex;flex-wrap:wrap;gap:15px 22px;
  margin-top:21px;
  color:#c0d0de;
  font-size:9px;
}
#view-calc .fdg-r37-trust-row span{display:inline-flex;align-items:center;gap:7px}
#view-calc .fdg-r37-trust-row i{
  width:22px;height:22px;border-radius:7px;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(15,77,115,.52);
  border:1px solid rgba(33,199,232,.22);
  color:#58d8f0;
  font-style:normal;font-size:12px;
}

/* Hero recommendation card */
#view-calc .fdg-r37-live-card{
  align-self:end;
  padding:14px;
  border-radius:15px;
  border:1px solid rgba(103,144,182,.24);
  background:linear-gradient(180deg,rgba(10,31,49,.91),rgba(6,20,34,.88));
  box-shadow:0 22px 52px rgba(0,0,0,.28);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
#view-calc .fdg-r37-live-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:2px 2px 11px;
  border-bottom:1px solid rgba(121,157,191,.15);
}
#view-calc .fdg-r37-live-head strong{
  font-size:12px;letter-spacing:.15px;color:#f8fafc;
}
#view-calc .fdg-r37-live-state{
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 9px;
  border:1px solid rgba(49,211,138,.22);
  border-radius:999px;
  color:#63e7a6;
  background:rgba(49,211,138,.07);
  font-size:8px;font-weight:900;text-transform:uppercase;letter-spacing:.75px;
}
#view-calc .fdg-r37-live-state::before{
  content:"";width:6px;height:6px;border-radius:50%;background:#32da8e;
  box-shadow:0 0 12px rgba(50,218,142,.72);
}
#view-calc .fdg-r37-live-grid{
  display:grid;grid-template-columns:1fr;
  gap:8px;margin-top:10px;
}
#view-calc .fdg-r37-live-metric{
  min-height:58px;
  display:grid;
  grid-template-columns:38px 1fr;
  align-items:center;
  gap:9px;
  padding:8px 10px;
  border:1px solid rgba(121,157,191,.17);
  border-radius:10px;
  background:linear-gradient(180deg,rgba(24,55,80,.66),rgba(12,37,58,.58));
}
#view-calc .fdg-r37-live-metric::before{
  content:attr(data-icon);
  width:34px;height:34px;border-radius:9px;
  display:flex;align-items:center;justify-content:center;
  font-size:17px;
  background:rgba(59,130,246,.12);
  color:#64a6ff;
}
#view-calc .fdg-r37-live-metric.battery::before{background:rgba(49,211,138,.11);color:#45e29c}
#view-calc .fdg-r37-live-metric.investment::before{background:rgba(246,181,63,.12);color:#ffd25f}
#view-calc .fdg-r37-live-metric label{
  display:block;
  color:#8ea6bb;
  font-size:8px;font-weight:700;text-transform:uppercase;letter-spacing:.75px;
}
#view-calc .fdg-r37-live-metric strong{
  display:block;margin-top:2px;
  color:#f6f9fc;
  font-family:var(--mono);
  font-size:12px;line-height:1.35;
}
#view-calc .fdg-r37-live-metric.investment strong{color:#ffd76e}

/* ── PREMIUM ENGINEERING ROW ──────────────────────────────── */
#view-calc .fdg-r37-dashboard{
  display:grid;
  grid-template-columns:minmax(260px,.78fr) minmax(480px,1.7fr) minmax(250px,.72fr);
  gap:12px;
  margin-bottom:12px;
}
#view-calc .fdg-r37-panel{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(103,144,182,.22);
  border-radius:14px;
  background:
    radial-gradient(circle at 95% 0%,rgba(33,199,232,.04),transparent 25%),
    linear-gradient(180deg,rgba(11,34,53,.97),rgba(7,25,41,.96));
  box-shadow:0 14px 34px rgba(0,0,0,.14);
}
#view-calc .fdg-r37-panel-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  padding:13px 14px 10px;
  border-bottom:1px solid rgba(121,157,191,.12);
}
#view-calc .fdg-r37-panel-title{
  display:flex;align-items:center;gap:8px;
  color:#f7fafc;
  font-size:12px;font-weight:800;
}
#view-calc .fdg-r37-panel-title i{
  width:25px;height:25px;border-radius:7px;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(59,130,246,.12);
  color:#59a3ff;
  font-style:normal;
}
#view-calc .fdg-r37-panel-sub{
  margin-top:3px;color:#718ba1;font-size:8px;
}
#view-calc .fdg-r37-source{
  padding:5px 8px;border-radius:999px;
  border:1px solid rgba(49,211,138,.18);
  background:rgba(49,211,138,.06);
  color:#53d99a;
  font-size:7px;font-weight:900;letter-spacing:.65px;text-transform:uppercase;
  white-space:nowrap;
}

/* Input summary */
#view-calc .fdg-r37-inputs{padding:12px}
#view-calc .fdg-r37-input-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#view-calc .fdg-r37-input-item{
  min-height:67px;
  padding:9px 10px;
  border:1px solid rgba(121,157,191,.16);
  border-radius:9px;
  background:rgba(6,22,36,.72);
}
#view-calc .fdg-r37-input-item.wide{grid-column:1/-1}
#view-calc .fdg-r37-input-item label{
  display:block;color:#6f899f;font-size:7px;font-weight:800;letter-spacing:.8px;text-transform:uppercase;
}
#view-calc .fdg-r37-input-item strong{
  display:block;margin-top:5px;color:#edf5fb;font-family:var(--mono);font-size:10px;line-height:1.35;
}
#view-calc .fdg-r37-open-inputs{
  width:100%;min-height:40px;margin-top:10px;
  border-radius:9px;border:1px solid rgba(246,181,63,.42);
  background:linear-gradient(135deg,#ffd36f,#f4ac16);
  color:#06101d;font-weight:900;font-size:10px;cursor:pointer;
  box-shadow:0 8px 22px rgba(245,169,12,.15);
}

/* Flow schematic */
#view-calc .fdg-r37-flow-wrap{padding:7px 10px 0}
#view-calc .fdg-r37-flow-svg{
  width:100%;
  aspect-ratio:760/215;
  display:block;
  overflow:visible;
}
#view-calc .fdg-r37-flow-svg .r37-grid-line{stroke:rgba(104,141,176,.10);stroke-width:1}
#view-calc .fdg-r37-flow-svg .r37-path{
  fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;
  filter:url(#r37Glow);
}
#view-calc .fdg-r37-flow-svg .r37-solar-path{stroke:#f4c34f}
#view-calc .fdg-r37-flow-svg .r37-direct-path{stroke:#23d7df}
#view-calc .fdg-r37-flow-svg .r37-batt-path{stroke:#c76bf0}
#view-calc .fdg-r37-flow-svg .r37-grid-path{stroke:#7fa4c7}
#view-calc .fdg-r37-flow-svg .r37-value{
  fill:#f8fafc;font-family:var(--mono);font-size:16px;font-weight:800;
}
#view-calc .fdg-r37-flow-svg .r37-label{
  fill:#8da6bb;font-family:var(--body);font-size:9px;font-weight:600;
}
#view-calc .fdg-r37-flow-svg .r37-small{
  fill:#678198;font-family:var(--body);font-size:8px;
}
#view-calc .fdg-r37-flow-legend{
  display:flex;flex-wrap:wrap;gap:7px 12px;
  padding:0 12px 10px;
  color:#8da6bb;font-size:7px;
}
#view-calc .fdg-r37-flow-legend span{display:inline-flex;align-items:center;gap:5px}
#view-calc .fdg-r37-dot{width:6px;height:6px;border-radius:50%;display:inline-block}

/* Typical-day normalized chart */
#view-calc .fdg-r37-chart-box{
  margin:0 10px 10px;
  padding:9px 10px 7px;
  border-top:1px solid rgba(121,157,191,.12);
}
#view-calc .fdg-r37-chart-head{
  display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:7px;
}
#view-calc .fdg-r37-chart-head strong{font-size:9px;color:#e9f2fa}
#view-calc .fdg-r37-chart-head span{font-size:7px;color:#60798f}
#view-calc .fdg-r37-bars{
  height:88px;
  display:flex;
  align-items:flex-end;
  gap:2px;
  border-bottom:1px solid rgba(121,157,191,.17);
  background:
    linear-gradient(to top,rgba(121,157,191,.07) 1px,transparent 1px) 0 0/100% 22px;
}
#view-calc .fdg-r37-bar{
  flex:1;min-width:2px;
  display:flex;flex-direction:column-reverse;
  justify-content:flex-start;
  border-radius:2px 2px 0 0;
  overflow:hidden;
  opacity:.94;
}
#view-calc .fdg-r37-seg{width:100%;min-height:0}
#view-calc .fdg-r37-seg.solar{background:#f4c54d}
#view-calc .fdg-r37-seg.direct{background:#28b6f4}
#view-calc .fdg-r37-seg.batt{background:#41d79b}
#view-calc .fdg-r37-seg.night{background:#a36be8}
#view-calc .fdg-r37-seg.grid{background:#7891aa}
#view-calc .fdg-r37-time-axis{
  display:flex;justify-content:space-between;
  margin-top:4px;color:#60798f;font-size:7px;
}

/* Outputs */
#view-calc .fdg-r37-outputs{padding:8px 10px 10px}
#view-calc .fdg-r37-output-row{
  display:grid;grid-template-columns:30px 1fr auto;
  align-items:center;gap:8px;
  min-height:54px;
  padding:7px 8px;
  border-bottom:1px solid rgba(121,157,191,.10);
}
#view-calc .fdg-r37-output-row:last-child{border-bottom:0}
#view-calc .fdg-r37-output-row i{
  width:28px;height:28px;border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(59,130,246,.11);color:#69a8ff;font-style:normal;font-size:14px;
}
#view-calc .fdg-r37-output-row.green i{background:rgba(49,211,138,.10);color:#4be29f}
#view-calc .fdg-r37-output-row.gold i{background:rgba(246,181,63,.10);color:#ffd266}
#view-calc .fdg-r37-output-row small{display:block;color:#6e899f;font-size:7px;text-transform:uppercase;letter-spacing:.65px}
#view-calc .fdg-r37-output-row strong{color:#f5f8fb;font-family:var(--mono);font-size:10px;text-align:right}

/* Bottom live cards */
#view-calc .fdg-r37-bottom{
  display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;margin-bottom:14px;
}
#view-calc .fdg-r37-bottom-card{
  min-height:140px;
  padding:13px 14px;
  border:1px solid rgba(103,144,182,.20);
  border-radius:14px;
  background:linear-gradient(180deg,rgba(11,34,53,.96),rgba(7,25,41,.95));
}
#view-calc .fdg-r37-bottom-card h4{
  margin:0;color:#edf5fb;font-size:10px;font-weight:800;display:flex;align-items:center;gap:7px;
}
#view-calc .fdg-r37-bottom-value{
  margin-top:14px;color:#f8fafc;font-family:var(--mono);font-size:19px;font-weight:900;
}
#view-calc .fdg-r37-bottom-sub{margin-top:3px;color:#7890a6;font-size:8px}
#view-calc .fdg-r37-mini-row{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
#view-calc .fdg-r37-mini{
  flex:1;min-width:82px;padding:7px 8px;border-radius:8px;
  background:rgba(5,19,32,.72);border:1px solid rgba(121,157,191,.12);
}
#view-calc .fdg-r37-mini small{display:block;color:#667f95;font-size:7px}
#view-calc .fdg-r37-mini strong{display:block;margin-top:3px;color:#e8f1f9;font-family:var(--mono);font-size:9px}
#view-calc .fdg-r37-balance{
  display:grid;grid-template-columns:86px 1fr;gap:12px;align-items:center;margin-top:9px;
}
#view-calc .fdg-r37-donut{
  width:78px;height:78px;border-radius:50%;
  display:grid;place-items:center;
  background:conic-gradient(var(--r37-gold) 0 var(--r37-day-deg,90deg),#593b83 var(--r37-day-deg,90deg) 360deg);
  position:relative;
}
#view-calc .fdg-r37-donut::after{
  content:"";position:absolute;inset:12px;border-radius:50%;
  background:#092035;border:1px solid rgba(121,157,191,.14);
}
#view-calc .fdg-r37-donut span{position:relative;z-index:1;text-align:center;color:#fff;font-family:var(--mono);font-size:9px}
#view-calc .fdg-r37-checks{display:grid;gap:7px;margin-top:12px}
#view-calc .fdg-r37-check{display:flex;align-items:center;gap:7px;color:#9cb1c4;font-size:8px}
#view-calc .fdg-r37-check i{
  width:16px;height:16px;border-radius:50%;display:grid;place-items:center;
  background:rgba(49,211,138,.10);color:#45df9b;font-style:normal;font-size:9px;
}
#view-calc .fdg-r37-check.pending i{background:rgba(246,181,63,.10);color:#ffc95d}

/* Original core controls remain intact below */
#view-calc .fdg-r37-core-label{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin:18px 2px 9px;
  color:#d9e7f2;
  font-size:10px;font-weight:800;letter-spacing:.2px;
}
#view-calc .fdg-r37-core-label span{color:#607a91;font-size:8px;font-weight:500}
#view-calc > .card{
  border-radius:14px !important;
  border:1px solid rgba(103,144,182,.18) !important;
  background:linear-gradient(180deg,rgba(11,31,49,.96),rgba(7,22,37,.95)) !important;
  box-shadow:0 12px 30px rgba(0,0,0,.10) !important;
}
#view-calc .card-header{border-bottom-color:rgba(121,157,191,.10) !important}
#view-calc input,#view-calc select,#view-calc textarea{
  border-radius:8px !important;
  background:rgba(4,15,27,.80) !important;
  border-color:rgba(103,144,182,.24) !important;
}
#view-calc input:focus,#view-calc select:focus,#view-calc textarea:focus{
  border-color:rgba(246,181,63,.62) !important;
  box-shadow:0 0 0 3px rgba(246,181,63,.08) !important;
}
#view-calc .fdg-r37-focus-flash{
  animation:r37CoreFlash 1.3s ease 1;
}
@keyframes r37CoreFlash{
  0%,100%{box-shadow:0 12px 30px rgba(0,0,0,.10)}
  45%{box-shadow:0 0 0 2px rgba(246,181,63,.46),0 0 44px rgba(246,181,63,.18)}
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media(max-width:1240px){
  #view-calc{padding:14px 14px 38px !important}
  #view-calc .fdg-r37-hero-inner{
    grid-template-columns:1fr;
    align-content:space-between;
    padding:32px 28px 24px;
  }
  #view-calc .fdg-r37-hero{min-height:590px}
  #view-calc .fdg-r37-live-card{max-width:720px}
  #view-calc .fdg-r37-dashboard{
    grid-template-columns:minmax(250px,.85fr) minmax(440px,1.55fr);
  }
  #view-calc .fdg-r37-dashboard .fdg-r37-panel.outputs-panel{grid-column:1/-1}
  #view-calc .fdg-r37-outputs{display:grid;grid-template-columns:repeat(4,1fr)}
  #view-calc .fdg-r37-output-row{
    grid-template-columns:30px 1fr;
    border-right:1px solid rgba(121,157,191,.10);
  }
  #view-calc .fdg-r37-output-row strong{grid-column:1/-1;text-align:left;padding-left:38px}
}
@media(max-width:850px){
  .sidebar{
    width:min(86vw,320px) !important;
    min-width:min(86vw,320px) !important;
    transform:translateX(-100%) !important;
  }
  .sidebar.fdg-r37-open,body.fdg-r37-nav-open .sidebar{transform:translateX(0) !important}
  .sidebar::after{display:none}
  body.fdg-r37-nav-open .fdg-r37-sidebar-handle{left:min(86vw,320px)}
  .fdg-r37-sidebar-handle{
    top:90px;transform:none;width:38px;height:55px;border-radius:0 12px 12px 0;
  }
  .fdg-r37-sidebar-handle span{writing-mode:horizontal-tb;transform:none;font-size:0}
  .fdg-r37-sidebar-handle span::after{content:"☰";font-size:18px}
  #view-calc{padding:9px 8px 30px !important}
  #view-calc .fdg-r37-hero{min-height:610px;border-radius:16px;background-position:62% center}
  #view-calc .fdg-r37-hero-inner{min-height:610px;padding:23px 18px 17px}
  #view-calc .fdg-r37-hero h1{font-size:40px;letter-spacing:-1.55px}
  #view-calc .fdg-r37-actions{display:grid;grid-template-columns:1fr}
  #view-calc .fdg-r37-action{width:100%}
  #view-calc .fdg-r37-trust-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  #view-calc .fdg-r37-dashboard{grid-template-columns:1fr}
  #view-calc .fdg-r37-dashboard .fdg-r37-panel.outputs-panel{grid-column:auto}
  #view-calc .fdg-r37-outputs{display:block}
  #view-calc .fdg-r37-output-row{grid-template-columns:30px 1fr auto;border-right:0}
  #view-calc .fdg-r37-output-row strong{grid-column:auto;text-align:right;padding-left:0}
  #view-calc .fdg-r37-bottom{grid-template-columns:1fr}
}
@media(max-width:480px){
  #view-calc .fdg-r37-hero h1{font-size:35px}
  #view-calc .fdg-r37-live-metric{grid-template-columns:34px 1fr}
  #view-calc .fdg-r37-input-grid{grid-template-columns:1fr}
  #view-calc .fdg-r37-input-item.wide{grid-column:auto}
  #view-calc .fdg-r37-flow-wrap{padding:4px 4px 0}
  #view-calc .fdg-r37-flow-svg{aspect-ratio:760/250}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important}
  .sidebar,.fdg-r37-sidebar-handle,.fdg-r37-nav-backdrop{transition:none!important}
  #view-calc .fdg-r37-focus-flash{animation:none!important}
}


/* ── REV 3.7.4 SOLAR WINDOW ALLOCATION ─────────────────────
   Mirrors the current autosizer design basis:
   PV target = (day load + gross battery basis) / 4.5h × 1.20
   No export/surplus path is presented. */
#view-calc .fdg-r37-allocation{
  margin:0 10px 10px;
  padding:10px 11px 11px;
  border-top:1px solid rgba(121,157,191,.12);
  border-bottom:1px solid rgba(121,157,191,.12);
  background:linear-gradient(180deg,rgba(5,20,34,.48),rgba(5,18,31,.28));
}
#view-calc .fdg-r37-allocation-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  margin-bottom:8px;
}
#view-calc .fdg-r37-allocation-head strong{
  display:block;color:#ecf5fc;font-size:9px;font-weight:800;
}
#view-calc .fdg-r37-allocation-head small{
  display:block;margin-top:2px;color:#607b91;font-size:7px;line-height:1.4;
}
#view-calc .fdg-r37-coverage{
  flex:0 0 auto;
  min-width:70px;
  padding:5px 8px;
  border:1px solid rgba(49,211,138,.20);
  border-radius:999px;
  background:rgba(49,211,138,.07);
  color:#58e2a0;
  font-family:var(--mono);
  font-size:8px;font-weight:900;text-align:center;
}
#view-calc .fdg-r37-coverage.warn{
  border-color:rgba(246,181,63,.28);
  background:rgba(246,181,63,.08);
  color:#ffd068;
}
#view-calc .fdg-r37-allocation-bar{
  position:relative;
  display:flex;
  width:100%;height:18px;
  overflow:hidden;
  border:1px solid rgba(121,157,191,.18);
  border-radius:999px;
  background:#061522;
}
#view-calc .fdg-r37-alloc-load{
  height:100%;
  background:linear-gradient(90deg,#22c7df,#41b9ef);
  transition:width .45s ease;
}
#view-calc .fdg-r37-alloc-charge{
  height:100%;
  background:linear-gradient(90deg,#8b5cf6,#c66cf0);
  transition:width .45s ease;
}
#view-calc .fdg-r37-alloc-shortfall{
  height:100%;
  background:repeating-linear-gradient(135deg,rgba(246,181,63,.28) 0 5px,rgba(246,181,63,.10) 5px 10px);
  transition:width .45s ease;
}
#view-calc .fdg-r37-allocation-stats{
  display:grid;grid-template-columns:1fr 1fr 1fr;
  gap:6px;margin-top:8px;
}
#view-calc .fdg-r37-allocation-stat{
  min-height:44px;
  padding:6px 7px;
  border-radius:8px;
  border:1px solid rgba(121,157,191,.10);
  background:rgba(6,23,38,.58);
}
#view-calc .fdg-r37-allocation-stat small{
  display:block;color:#667f95;font-size:6px;text-transform:uppercase;letter-spacing:.65px;
}
#view-calc .fdg-r37-allocation-stat strong{
  display:block;margin-top:3px;color:#edf5fb;font-family:var(--mono);font-size:8px;line-height:1.35;
}
#view-calc .fdg-r37-allocation-stat.load strong{color:#54d7ef}
#view-calc .fdg-r37-allocation-stat.charge strong{color:#d38af5}
#view-calc .fdg-r37-allocation-stat.solar strong{color:#ffd06a}
#view-calc .fdg-r37-allocation-note{
  margin-top:7px;color:#557087;font-size:6.5px;line-height:1.45;
}
@media(max-width:520px){
  #view-calc .fdg-r37-allocation-stats{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  #view-calc .fdg-r37-alloc-load,
  #view-calc .fdg-r37-alloc-charge,
  #view-calc .fdg-r37-alloc-shortfall{transition:none!important}
}
