/* ═══════════════════════════════════════════════════════════════
   PROKONSTRUKT · DARK BLUEPRINT DESIGN SYSTEM
   src/css/blueprint.css — mobile first (390×844), CAD desktop ≥ 900px
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg: #0A0D10;
  --bg-2: #0F1418;
  --panel: rgba(14, 20, 25, .82);
  --line: rgba(120, 190, 230, .07);
  --line-major: rgba(120, 190, 230, .14);
  --cad: #6CC4EE;
  --cad-dim: rgba(108, 196, 238, .35);
  --gold: #C9A43A;
  --gold-dim: rgba(201, 164, 58, .35);
  --text: #E6ECF0;
  --text-2: rgba(230, 236, 240, .66);
  --muted: rgba(230, 236, 240, .38);
  --border: rgba(108, 196, 238, .18);
  --dc: #F0565B;
  --ac: #3DD68C;
  --hv: #F2B544;
  --data: #7AA7FF;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
  --sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.77, 0, .175, 1);
  --nav-h: 56px;
  --mq-h: 30px;

  /* ── Cod Cromatic Instalație Solară L0 ── */
  --dc-red: #DC2626;
  --ac-null: #0284C7;
  --bms-orange: #F97316;
  --solar-amber: #F59E0B;
  --pure-white: #FFFFFF;
}

/* ── TEMĂ LIGHT: Hârtie Milimetrică de Proiectare CAD ── */
[data-theme="lite"] {
  --bg: #F1F5F9;
  --bg-2: #E2E8F0;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(2, 132, 199, 0.09);
  --line-major: rgba(2, 132, 199, 0.22);
  --cad: #0284C7;
  --cad-dim: rgba(2, 132, 199, 0.35);
  --gold: #B45309;
  --gold-dim: rgba(180, 83, 9, 0.35);
  --text: #0F172A;
  --text-2: #334155;
  --muted: #64748B;
  --border: rgba(2, 132, 199, 0.22);
  --dc: #DC2626;
  --ac: #059669;
  --hv: #D97706;
  --data: #2563EB;
}

[data-theme="lite"] .mm-grid {
  background-color: var(--bg);
}
[data-theme="lite"] .mm-grid::after {
  background: radial-gradient(ellipse at 50% 40%, transparent 40%, rgba(226, 232, 240, 0.6) 100%);
}

/* Glassmorphism & Luciu de Sticlă pe Hârtie Milimetrică */
[data-theme="lite"] .frame {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.58) 100%);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 2px 0 rgba(2, 132, 199, 0.12),
    0 8px 24px -4px rgba(15, 23, 42, 0.08);
  border-radius: 3px;
}

[data-theme="lite"] .frame::before {
  border-color: #0284C7;
  border-top-left-radius: 3px;
  opacity: 0.85;
}

[data-theme="lite"] .frame::after {
  border-color: #0284C7;
  border-bottom-right-radius: 3px;
  opacity: 0.85;
}

[data-theme="lite"] .frame-t {
  color: #0284C7;
  font-weight: 700;
}

[data-theme="lite"] .field label {
  color: #0F172A;
  font-weight: 600;
}

[data-theme="lite"] select,
[data-theme="lite"] .field input {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(2, 132, 199, 0.25);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  color: #0F172A;
  border-radius: 3px;
}

[data-theme="lite"] select:focus,
[data-theme="lite"] .field input:focus {
  background: rgba(255, 255, 255, 0.94);
  border-color: #0284C7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.20), inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

[data-theme="lite"] .field input::placeholder {
  color: #64748B;
  opacity: 0.8;
}

[data-theme="lite"] select option {
  background: #FFFFFF;
  color: #0F172A;
}

[data-theme="lite"] .summary {
  color: #1E293B;
  font-weight: 500;
}

/* Butonul Sună acum în Glassmorphism de Sticlă Cristalină */
[data-theme="lite"] .btn.ghost {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.55) 100%);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 2px 0 rgba(2, 132, 199, 0.15),
    0 4px 16px -2px rgba(15, 23, 42, 0.08);
  color: #0284C7;
  font-weight: 700;
  border-radius: 3px;
  transition: all .2s var(--ease);
}

[data-theme="lite"] .btn.ghost:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.72) 100%);
  border-color: #0284C7;
  color: #0369A1;
  box-shadow: 
    inset 0 1.5px 1px 0 #FFFFFF,
    0 6px 20px rgba(2, 132, 199, 0.22);
  transform: translateY(-1px);
}

[data-theme="lite"] .btn.ghost:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 
    inset 0 1px 2px rgba(15, 23, 42, 0.08),
    0 2px 8px rgba(2, 132, 199, 0.15);
}

[data-theme="lite"] .kpi {
  background: rgba(2, 132, 199, 0.04);
}

[data-theme="lite"] .seg button {
  background: rgba(2, 132, 199, 0.04);
  color: var(--text);
}

[data-theme="lite"] .seg button.on {
  background: rgba(2, 132, 199, 0.14);
  color: var(--cad);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }

/* ── Hârtie milimetrică CAD ── */
.mm-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--line-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-major) 1px, transparent 1px),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
}
.mm-grid::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(5, 7, 9, .75) 100%); }

/* ── NAV (100% Transparent, plutitor peste cer) ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; height: auto; min-height: var(--nav-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(1rem, env(safe-area-inset-top)) 16px 8px;
  background: transparent !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
}
#nav.off { display: none !important; }
.nav-l { display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }
.btn-cta-solar {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
  padding: 0.6rem 1.2rem; background-color: var(--dc-red); color: var(--pure-white);
  border: none; border-radius: 4px; box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s;
}
.btn-cta-solar:hover { background-color: #B91C1C; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(220, 38, 38, 0.55); }
.btn-cta-solar:active { transform: translateY(0); }
#crumb { display: none !important; }

/* ── RAIL 2D ── */
#rail { position: fixed; inset: 0; z-index: 1; overflow: hidden; }
#vtrack { position: absolute; inset: 0; transition: transform .8s var(--ease); will-change: transform; }
.row { position: absolute; left: 0; width: 100%; height: 100dvh; overflow: hidden; }
.htrack { display: flex; height: 100%; transition: transform .7s var(--ease); will-change: transform; }
.card { flex: 0 0 100vw; width: 100vw; height: 100%; position: relative; }
.card-body {
  position: absolute; inset: calc(var(--nav-h) + 26px) 0 calc(var(--mq-h) + 12px) 0;
  overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 24px; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--cad-dim) transparent;
}
.row:not(#row0) .card-body {
  top: max(10px, env(safe-area-inset-top));
  bottom: max(32px, env(safe-area-inset-bottom));
  padding: 6px 12px 10px;
}
.sheet {
  max-width: 580px;
  margin: 0 auto;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Titluri CAD ── */
.tag { font-family: var(--mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--cad); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tag::before { content: ''; width: 18px; height: 1px; background: var(--cad); }
.h { font-weight: 300; font-size: clamp(1.35rem, 5.5vw, 1.95rem); line-height: 1.1; letter-spacing: -.01em; margin-bottom: 10px; }
.h em { font-style: normal; color: var(--gold); font-weight: 500; }
.p { color: var(--text-2); font-size: .9rem; line-height: 1.55; margin-bottom: 14px; }
.dir { position: absolute; bottom: max(10px, env(safe-area-inset-bottom)); font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); z-index: 3; pointer-events: none; }
.dir.l { left: 14px; } .dir.r { right: 14px; }

/* ── Panou tehnic (frame CAD cu colțuri) ── */
.frame { position: relative; border: 1px solid var(--border); background: var(--panel); padding: 14px; margin-bottom: 12px; border-radius: 2px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.frame::before, .frame::after { content: ''; position: absolute; width: 10px; height: 10px; border-color: var(--cad); border-style: solid; pointer-events: none; }
.frame::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.frame::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.frame-t { font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; margin-bottom: 10px; display: flex; justify-content: space-between; }

/* ── Controale ── */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg button { font-family: var(--mono); font-size: .74rem; padding: 10px 6px; border: 1px solid var(--border); background: rgba(108, 196, 238, .03); border-radius: 2px; transition: all .2s; min-height: 42px; }
.seg button:hover { border-color: var(--cad-dim); }
.seg button.on { border-color: var(--cad); background: rgba(108, 196, 238, .12); color: var(--cad); box-shadow: inset 0 0 0 1px rgba(108, 196, 238, .25); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }

.slider-wrap { padding: 4px 0 2px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.big { font-family: var(--mono); font-size: 1.9rem; color: var(--gold); font-weight: 300; }
.big small { font-size: .7rem; color: var(--muted); margin-left: 4px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; touch-action: none; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--cad) var(--pct, 50%), var(--border) var(--pct, 50%)); }
input[type=range]::-moz-range-track { height: 2px; background: var(--border); }
input[type=range]::-moz-range-progress { height: 2px; background: var(--cad); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -10px; border: 1px solid var(--cad); background: var(--bg); transform: rotate(45deg); box-shadow: 0 0 12px rgba(108, 196, 238, .45); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 1px solid var(--cad); background: var(--bg); transform: rotate(45deg); border-radius: 0; }
.scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .58rem; color: var(--muted); }

select, .field input {
  width: 100%; background: rgba(14, 20, 25, .85); border: 1px solid var(--border); padding: 12px 14px; border-radius: 3px;
  font-family: var(--mono); font-size: .84rem; color: var(--pure-white); outline: none; transition: border-color .2s, box-shadow .2s; min-height: 46px;
}
select:focus, .field input:focus { border-color: var(--cad); box-shadow: 0 0 0 1px var(--cad); }
select option { background: var(--bg-2); }
.field { margin-bottom: 12px; }
.field label { display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: #FFFFFF; margin-bottom: 6px; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { border: 1px solid var(--border); padding: 10px; background: rgba(108, 196, 238, .03); }
.kpi .v { font-family: var(--mono); font-size: 1.05rem; color: var(--text); }
.kpi .v.gold { color: var(--gold); }
.kpi .k { font-family: var(--mono); font-size: .56rem; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
.note { font-family: var(--mono); font-size: .62rem; color: var(--muted); line-height: 1.5; margin-top: 8px; }
.flag { font-family: var(--mono); font-size: .64rem; color: var(--hv); border-left: 2px solid var(--hv); padding: 4px 8px; margin-top: 6px; background: rgba(242, 181, 68, .06); }
.flag.danger { color: #f87171; border-left-color: #ef4444; background: rgba(239, 68, 68, .12); font-weight: 500; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; font-family: var(--mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; border: 1px solid var(--gold); color: var(--bg); background: var(--gold); border-radius: 2px; transition: transform .15s, box-shadow .25s; min-height: 48px; }
.btn:hover { box-shadow: 0 0 24px rgba(201, 164, 58, .35); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--cad); border-color: var(--cad-dim); }
.btn.wa { background: #1FAF5A; border-color: #1FAF5A; color: #fff; }
.btn:disabled, .btn[disabled], .btn.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; filter: grayscale(.85); }
.btn-row { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }

/* ── L1 Centru: sloturi componente ── */
.slot { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.slot:last-child { border-bottom: 0; }
.slot-n { width: 34px; height: 34px; border: 1px solid var(--cad-dim); display: grid; place-items: center; font-family: var(--mono); font-size: .8rem; color: var(--cad); }
.slot-t { font-size: .92rem; font-weight: 500; margin-bottom: 3px; }
.slot-d { font-family: var(--mono); font-size: .66rem; color: var(--text-2); line-height: 1.5; }
.slot-d b { color: var(--gold); font-weight: 400; }
.slot select { margin-top: 8px; padding: 8px 10px; font-size: .72rem; }
.slot .seg { margin-top: 8px; }
.slot .seg button { min-height: 36px; padding: 7px 4px; font-size: .66rem; }
.ticker { overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-top: 10px; padding: 7px 0; white-space: nowrap; }
.ticker span { display: inline-block; font-family: var(--mono); font-size: .62rem; letter-spacing: .18em; color: var(--cad); animation: tick 22s linear infinite; padding-left: 100%; }
@keyframes tick { to { transform: translateX(-100%); } }

/* ── L1 Dreapta: asistent ── */
.chat { display: flex; flex-direction: column; gap: 8px; min-height: 220px; }
.msg { max-width: 88%; padding: 10px 12px; font-size: .86rem; line-height: 1.45; border: 1px solid var(--border); animation: pop .35s var(--ease); }
.msg.bot { align-self: flex-start; background: rgba(108, 196, 238, .06); border-left: 2px solid var(--cad); }
.msg.me { align-self: flex-end; background: rgba(201, 164, 58, .1); border-color: var(--gold-dim); font-family: var(--mono); font-size: .78rem; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { font-family: var(--mono); font-size: .7rem; padding: 9px 12px; border: 1px solid var(--cad-dim); color: var(--cad); border-radius: 20px; transition: background .2s; }
.chip:hover { background: rgba(108, 196, 238, .12); }

/* ═══════════════════════════════════════════════════════════════
   FULL FRAME AUTORESPONSIVE: L1, L2, L3, L4
   ═══════════════════════════════════════════════════════════════ */

/* Cardurile cu frame principal se extind pe toată înălțimea ecranului */
#r2-l .frame,
#r2-c .frame,
#r2-r .frame,
#r3-l .frame,
#r3-c .frame,
#r3-r .frame,
#r1-r .frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

/* ── L3 Centru: deviz ── */
#r2-c .frame {
  justify-content: space-between;
  padding: clamp(10px, 1.8vh, 16px) clamp(10px, 3vw, 16px);
  margin-bottom: 0;
}
.deviz { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .67rem; }
.deviz td { padding: clamp(2.5px, 0.7vh, 4.8px) 0; border-bottom: 1px dashed var(--border); vertical-align: top; }
.deviz td:first-child { color: var(--muted); width: 18px; }
.deviz td.v { text-align: right; white-space: nowrap; padding-left: 6px; }
.deviz .sub { display: block; color: var(--muted); font-size: .55rem; margin-top: 1px; line-height: 1.25; }
.deviz tr.flash td.v { animation: flash .6s; }
@keyframes flash { 0% { color: var(--cad); } 100% { color: inherit; } }
.totals { margin-top: auto; padding-top: 6px; font-family: var(--mono); font-size: .73rem; }
.totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.totals .grand { border-top: 1px solid var(--gold-dim); margin-top: 3px; padding-top: 5px; font-size: .95rem; color: var(--gold); }

/* Notă avertisment estimare preliminară L2 */
.estimare-nota {
  margin-top: clamp(6px, 1vh, 10px);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: .64rem;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: .015em;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF !important;
  text-align: left;
}
[data-theme="lite"] .estimare-nota {
  color: #15803D !important; /* Verde intens pe Light Mode */
  border: 1.5px solid rgba(21, 128, 61, 0.45);
  background: rgba(21, 128, 61, 0.08);
}

/* ── L3 Stânga: stepper ── */
#r2-l #steps {
  justify-content: space-between;
  padding: clamp(10px, 1.8vh, 16px) clamp(10px, 3vw, 16px);
  margin-bottom: 0;
}
.step { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: clamp(4px, 1.1vh, 12px) 0; position: relative; opacity: .35; transition: opacity .5s; }
.step.on { opacity: 1; }
.step + .step::before { content: ''; position: absolute; left: 31px; top: -12px; height: 24px; border-left: 1px dashed var(--cad-dim); }
.step svg { width: 64px; height: 52px; }
.step svg * { fill: none; stroke: var(--cad); stroke-width: 1.2; stroke-dasharray: 220; stroke-dashoffset: 220; }
.step.on svg * { animation: draw 1.4s var(--ease) forwards; }
.step-n { font-family: var(--mono); font-size: .62rem; color: var(--gold); letter-spacing: .14em; }
.step-t { font-size: .92rem; margin: 2px 0; }
.step-d { font-family: var(--mono); font-size: .64rem; color: var(--text-2); line-height: 1.5; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── L2 Dreapta: garanții ── */
#r2-r .frame {
  justify-content: space-between;
  padding: clamp(12px, 2.2vh, 20px) clamp(12px, 3vw, 18px);
  margin-bottom: 0;
}
.war { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: clamp(10px, 2.2vh, 18px) 0; border-bottom: 1px dashed var(--border); }
.war span { font-size: .88rem; display: flex; align-items: center; gap: 10px; }
.war span i { width: 8px; height: 8px; border: 1px solid var(--cad); transform: rotate(45deg); display: inline-block; }
.war b { font-family: var(--mono); color: var(--gold); font-weight: 400; font-size: 1rem; }
.war b small { font-size: .62rem; color: var(--muted); }

/* ── L3: performanță, schemă, include ── */
#r3-c .frame {
  justify-content: space-between;
  margin-top: 8px;
  padding: clamp(10px, 1.8vh, 16px);
  min-height: 0;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: clamp(3px, 1vw, 6px);
  height: clamp(140px, 22vh, 220px);
  min-height: 130px;
  margin: 12px 0 6px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.bars i {
  flex: 1;
  background: linear-gradient(180deg, var(--cad) 0%, rgba(108, 196, 238, .15) 100%);
  border-top: 2px solid var(--cad);
  border-radius: 2px 2px 0 0;
  transform-origin: bottom;
  min-height: 8px;
  position: relative;
  transition: height .4s var(--ease);
}
[data-theme="lite"] .bars i {
  background: linear-gradient(180deg, #0284C7 0%, rgba(2, 132, 199, .18) 100%);
  border-top: 2px solid #0284C7;
}
.months {
  display: flex;
  gap: clamp(3px, 1vw, 6px);
  font-family: var(--mono);
  font-size: .54rem;
  color: var(--muted);
  margin-top: 4px;
}
.months span { flex: 1; text-align: center; }

#r3-l .frame {
  background: transparent !important;
  border: 1px dashed rgba(2, 132, 199, 0.22) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  justify-content: space-between;
  align-items: center;
  padding: clamp(6px, 1.2vh, 12px);
}
.sld {
  width: 100%;
  height: auto;
  flex: 1;
  max-height: calc(100% - 24px);
  object-fit: contain;
  display: block;
}

.sld text {
  font-family: var(--mono);
  user-select: none;
}

.sld .box-t {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  fill: #0F172A;
  letter-spacing: .04em;
}

.sld .lbl {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  fill: #0284C7;
  letter-spacing: .02em;
}

.sld .lbl-sub {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  fill: #64748B;
}

.sld .wire-tag {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  fill: #0284C7;
  letter-spacing: .06em;
}

/* Dark Mode Overrides pentru etichete schemă */
[data-theme="dark"] .sld .box-t,
body:not([data-theme="lite"]) .sld .box-t {
  fill: #F8FAFC;
}
[data-theme="dark"] .sld .lbl,
body:not([data-theme="lite"]) .sld .lbl {
  fill: #38BDF8;
}
[data-theme="dark"] .sld .lbl-sub,
body:not([data-theme="lite"]) .sld .lbl-sub {
  fill: #94A3B8;
}
[data-theme="dark"] .sld .wire-tag,
body:not([data-theme="lite"]) .sld .wire-tag {
  fill: #38BDF8;
}

@keyframes sldPulseGlow {
  0%, 100% { opacity: 0.95; filter: drop-shadow(0 0 3px #22c55e); }
  50% { opacity: 0.35; filter: drop-shadow(0 0 1px #22c55e); }
}
.sld-pulse-led {
  animation: sldPulseGlow 1.8s infinite ease-in-out;
}

@keyframes sldPulseRed {
  0%, 100% { opacity: 0.95; filter: drop-shadow(0 0 3px #ef4444); }
  50% { opacity: 0.3; filter: drop-shadow(0 0 1px #ef4444); }
}
.sld-pulse-red {
  animation: sldPulseRed 1.2s infinite ease-in-out;
}

.sld .flow {
  fill: none;
  stroke-width: 2;
  stroke-dasharray: 6 6;
  animation: flow 1s linear infinite;
}

.sld .dc { stroke: var(--dc); }
.sld .acl { stroke: var(--ac); }
.sld .hvl { stroke: var(--hv); }
.sld .dat { stroke: var(--data); stroke-width: 1.4; stroke-dasharray: 2 4; }

@keyframes flow { to { stroke-dashoffset: -12; } }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--text-2);
  margin-top: 8px;
}
.legend i { display: inline-block; width: 14px; height: 2px; margin-right: 5px; vertical-align: middle; }

/* ── Light Mode CAD Blueprint overrides for SLD ── */
[data-theme="lite"] .sld text {
  fill: #0F172A;
}

[data-theme="lite"] .sld .box-t {
  fill: #0F172A;
  font-weight: 700;
}

[data-theme="lite"] .sld .lbl {
  fill: #0369A1;
  font-weight: 600;
}

[data-theme="lite"] .sld .lbl-sub {
  fill: #475569;
  font-weight: 500;
}

[data-theme="lite"] .sld .wire-tag {
  fill: #0284C7;
  font-weight: 700;
}

[data-theme="lite"] .sld rect.box {
  fill: #FFFFFF;
  stroke: rgba(2, 132, 199, 0.45);
  stroke-width: 1.3px;
  filter: drop-shadow(0 2px 4px rgba(2, 132, 199, 0.08));
}

[data-theme="lite"] #sldBat rect.box {
  fill: #F8FAFC;
  stroke: rgba(2, 132, 199, 0.35);
}

[data-theme="lite"] .legend {
  color: #334155;
}

#r3-r #incList {
  justify-content: space-around;
  padding: clamp(10px, 1.8vh, 16px);
}
.check { display: flex; gap: 10px; padding: clamp(6px, 1.3vh, 11px) 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.check::before { content: '✓'; font-family: var(--mono); color: var(--ac); border: 1px solid rgba(61, 214, 140, .4); width: 20px; height: 20px; display: grid; place-items: center; font-size: .7rem; flex: 0 0 20px; }

/* ── L1: asistent & configurator ── */
#r1-r .frame {
  min-height: 0;
  padding: clamp(10px, 1.6vh, 14px);
}
#r1-r #chat {
  flex: 1;
  overflow-y: auto;
  min-height: 180px;
}
#r1-l .sheet,
#r1-c .sheet,
#r4 .sheet {
  justify-content: space-between;
}
#r1-l .frame,
#r1-c .frame,
#r1-l .slot,
#r1-c .slot,
#r4 .frame {
  margin-bottom: clamp(6px, 1vh, 10px);
}

/* ── L0 HERO · VIDEO FULL-BLEED ── */
.hero { position: absolute; inset: 0; overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: 0; background: var(--bg); }
.hero-media .hv,
.hero-media .hv-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.hero-media .hv { opacity: 0; transition: opacity .6s ease; }
.hero-media .hv.on { opacity: 1; }
.hero-media .hv-still { opacity: 0; transition: opacity .6s ease; }
.hero-media[data-state="still"] .hv-still { opacity: 1; }
.hero-media .hv-still:not([src]) { display: none; }
/* Scrim transparent – videoul rulează curat, fără filtre lăptoase */
.hv-scrim { display: none !important; }
[data-theme="lite"] .hero-media { background: transparent; }

/* ── Emblema Centrală Hero pe cer ── */
.hero-emblem-wrap {
  position: absolute; z-index: 3; left: 0; right: 0;
  top: clamp(58px, 10vh, 92px);
  display: flex; justify-content: center; pointer-events: none;
  opacity: 0; transform: translateY(-8px); animation: heroIn 1s var(--ease) .3s forwards;
}
.hero-emblem {
  width: clamp(110px, 30vw, 155px); height: auto;
  object-fit: contain;
  transition: transform .3s var(--ease);
}

.hero-txt {
  position: absolute; z-index: 2; left: 0; right: 0;
  bottom: calc(var(--mq-h) + clamp(18px, 3.5vh, 36px));
  padding: 0 clamp(16px, 5vw, 64px); text-align: center;
  opacity: 0; transform: translateY(12px); animation: heroIn 1s var(--ease) .4s forwards;
}
.hero-eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: clamp(0.7rem, 2.4vw, 1.02rem);
  font-weight: 500;
  letter-spacing: 0.36em;
  color: var(--pure-white);
  text-transform: uppercase;
  margin-bottom: 3px;
  padding-left: 0.36em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9);
}
.hero-brand-title {
  color: var(--pure-white); font-weight: 800; font-size: clamp(2.4rem, 8.5vw, 5.2rem);
  line-height: 1; letter-spacing: .08em; text-transform: uppercase; text-wrap: balance;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.9);
}
.hero-tagline {
  margin: 8px 0 0 0;
  font-family: var(--mono);
  font-size: clamp(0.56rem, 2.1vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--pure-white);
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9);
  opacity: 0.92;
}

@keyframes heroIn { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

/* landscape: text ancorat stânga-jos, lasă structura din video liberă */
@media (min-aspect-ratio: 1/1) and (min-width: 900px) {
  .hero-emblem-wrap {
    left: clamp(20px, 5vw, 96px); right: auto; justify-content: flex-start;
    top: auto; bottom: calc(var(--mq-h) + 180px);
  }
  .hero-emblem {
    width: clamp(80px, 7vw, 110px);
  }
  .hero-eyebrow { padding-left: 0; }
  .hero-txt { text-align: left; right: auto; max-width: min(62vw, 980px); bottom: calc(var(--mq-h) + 36px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-txt { animation: none; opacity: 1; transform: none; }
}

/* ── Buton temă (nav) ── */
.nav-r { display: flex; align-items: center; gap: 10px; }
.theme-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: none; background: transparent; padding: 0;
  transition: transform .3s var(--ease);
}
.theme-btn:hover { transform: scale(1.1); }
.theme-btn:focus-visible, .btn-cta-solar:focus-visible { outline: 2px solid var(--cad); outline-offset: 2px; }
.theme-btn svg { display: block; width: 22px; height: 22px; }
.theme-btn .icon-sun { color: var(--solar-amber); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
.theme-btn .icon-moon { color: var(--pure-white); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55)); }

/* ── L4 contact ── */
.contact-line { display: flex; gap: 10px; padding: 8px 0; font-family: var(--mono); font-size: .78rem; border-bottom: 1px dashed var(--border); }
.contact-line span { color: var(--muted); min-width: 70px; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; padding-top: 2px; }
.summary { font-family: var(--mono); font-size: .68rem; color: var(--text-2); line-height: 1.6; white-space: pre-line; }

/* ── HUD: săgeți, puncte, burtieră ── */
.arr { position: fixed; z-index: 45; width: 38px; height: 38px; border: 1px solid var(--border); background: rgba(10, 13, 16, .7); color: var(--cad); font-family: var(--mono); display: grid; place-items: center; transition: opacity .3s, border-color .2s; backdrop-filter: blur(6px); }
.arr:hover { border-color: var(--cad); }
.arr.off { display: none !important; opacity: 0 !important; pointer-events: none !important; }
#arrU { top: calc(var(--nav-h) + 30px); left: 50%; transform: translateX(-50%); }
#arrD { bottom: calc(var(--mq-h) + 10px); left: 50%; transform: translateX(-50%); }
#arrL { left: 6px; top: 50%; transform: translateY(-50%); }
#arrR { right: 6px; top: 50%; transform: translateY(-50%); }
#vdots { position: fixed; right: 8px; top: 50%; transform: translateY(-50%); z-index: 44; display: flex; flex-direction: column; gap: 10px; transition: opacity .3s; }
#vdots.off { opacity: 0; pointer-events: none; }
#hdots { position: fixed; bottom: max(10px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 44; display: flex; gap: 8px; transition: opacity .3s; }
#hdots.off { opacity: 0; }
.dot { width: 7px; height: 7px; border: 1px solid var(--cad-dim); transform: rotate(45deg); transition: all .3s; cursor: pointer; }
.dot.on { background: var(--cad); border-color: var(--cad); }
#mq {
  position: fixed; bottom: 0; left: 0; right: 0; height: auto; min-height: var(--mq-h); z-index: 46;
  background: transparent !important;
  border-top: 1px solid rgba(255, 255, 255, 0.22) !important;
  overflow: hidden; display: flex; align-items: center;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
#mq.off { display: none !important; }
#mq .t {
  white-space: nowrap; font-family: var(--mono); font-size: .62rem;
  font-weight: 600; letter-spacing: .14em; color: var(--pure-white);
  animation: tick 60s linear infinite; padding-left: 100%;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}
#mq .t b {
  color: var(--bms-orange); font-weight: 700; margin: 0 14px;
  text-shadow: 0 0 6px rgba(249, 115, 22, 0.4);
}

/* ── Desktop CAD ── */
@media (min-width: 900px) {
  :root { --nav-h: 64px; }
  .brand { font-size: .82rem; }
  .card-body { padding: 8px 80px 30px; }
  .sheet { max-width: 640px; }
  .btn-row.two { grid-template-columns: 1fr 1fr; }
  #arrL { left: 18px; } #arrR { right: 40px; }
  .kpis.four { grid-template-columns: repeat(4, 1fr); }
}
/* Pe mobil și dispozitive touch: săgeți HUD eliminate, carduri extinse pe tot ecranul */
@media (max-width: 899px), (hover: none) {
  .arr { display: none !important; }
}

@media (max-width: 899px) {
  .row:not(#row0) .card-body {
    padding: 6px 12px 10px;
  }
  .row:not(#row0) .sheet {
    max-width: 100%;
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
  }
  .row:not(#row0) .sheet .btn-row {
    margin-top: auto;
    padding-top: 10px;
  }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
