/* ONEp1 bèta — Overzicht */

.spark { width: 100%; height: 32px; margin-top: 6px; overflow: visible; }
.spark path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-blue { stroke: var(--blue); }


.phase-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.phase-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 96px 56px; align-items: center; gap: 12px; }
.phase-badge { font-size: 12px; font-weight: 800; color: var(--blue); background: var(--blue-soft); border-radius: 6px; padding: 3px 0; text-align: center; }
.phase-bar { height: 8px; border-radius: 4px; background: var(--muted-fill); overflow: hidden; }
.phase-bar > span { display: block; height: 8px; border-radius: 4px; background: var(--blue); transition: width 0.4s ease; }
.phase-bar.export > span { background: var(--amber); }
.phase-val { text-align: right; font-weight: 700; }
.phase-dir { display: block; font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--blue-ink); }
.phase-dir.export { color: var(--amber-ink); }
.phase-volt { text-align: right; font-size: 13px; color: var(--ink-3); }

.totals { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.totals thead th { color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; text-align: right; padding: 0 0 8px; }
.totals tbody tr { border-top: 1px solid var(--line-soft); }
.totals tbody th { text-align: left; font-weight: 600; padding: 10px 0; display: flex; align-items: center; gap: 8px; }
.totals td { text-align: right; font-weight: 700; white-space: nowrap; }

.ports-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.port { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.port:hover { border-color: var(--border-strong); color: inherit; }
.port.off { background: var(--surface-2); }
.port-num { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.port-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port .pill { align-self: flex-start; margin-top: 2px; }
.port .spark { height: 28px; margin-top: 8px; }

/* ---------- Kop: energiestroom + vandaag ---------- */

.today-card { display: flex; flex-direction: column; }
.today-list { margin: 0; display: flex; flex-direction: column; }
.today-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.today-list > div:first-child { border-top: 0; }
.today-list dt { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.today-list dd { margin: 0; font-weight: 800; white-space: nowrap; }
#selfHint { margin: 12px 0 0; }

/* ---------- Grafiek: weergave en bladeren ---------- */
.small-seg button { padding: 4px 10px; min-height: 30px; font-size: 13px; }
@media (max-width: 980px) {
    .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .chart-box { height: 230px; }
    .ports-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 480px) {
    .flow { --node: 82px; }
    .node strong { font-size: 15px; }
    .node span { font-size: 10px; }
    .chart-bar { align-items: stretch; }
}

/* ---------- Bèta 2: huisje met stroompijltjes ---------- */
.house-wrap { max-width: 620px; margin: 0 auto; }
@media (max-width: 560px) { .house-wrap { margin: 0 -10px; } }
.house { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font); --lit: 0.4; }
.house .ground { stroke: var(--h-ground); stroke-width: 2; stroke-linecap: round; }
.house .shadow { fill: #0E1726; opacity: var(--h-shadow-op); }
.house .roof { stroke: none; }
.house .body, .house .side { stroke: var(--h-stroke); stroke-width: 1.5; stroke-linejoin: round; }
.house .trim { fill: none; stroke: var(--h-trim); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.house .panel-base { fill: #0B1E38; }
.house .win { opacity: var(--lit); transition: opacity 1.2s ease; stroke: var(--h-stroke); stroke-width: 1; }
.house .win-bar { stroke: var(--h-wall-top); stroke-width: 1.5; }
.house .door { fill: var(--h-door); stroke: var(--h-stroke); stroke-width: 1; }
.house .panel { stroke: #7FA2CF; stroke-width: 0.6; }
.house .panel-grid { stroke: #7FA2CF; stroke-width: 0.8; opacity: 0.7; }
.house .shine { opacity: 0; }
.house.sun-on .shine { animation: shine 4.5s ease-in-out infinite; }
/* Glans schuift helemaal van de panelen af en vervaagt aan beide kanten, dus nooit stilstaan of verspringen */
@keyframes shine {
    0% { transform: translateX(0) skewX(-20deg); opacity: 0; }
    12% { opacity: 1; }
    52% { opacity: 1; }
    70%, 100% { transform: translateX(340px) skewX(-20deg); opacity: 0; }
}

.house .sun { opacity: 0.35; transition: opacity 1s; }
.house.sun-on .sun { opacity: 1; }
.house .sun-rays path { stroke: #F59E0B; stroke-width: 2.5; stroke-linecap: round; fill: none; }
.house.sun-on .sun-rays { animation: spin 18s linear infinite; }
.house.sun-on .sun-glow { animation: glow 3.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 50% { transform: scale(1.18); opacity: 0.7; } }

.house .box { stroke-width: 2; }
.house .box.grid { stroke: var(--blue); }
.house .box.grid.export { stroke: var(--amber); }
.house .meter-screen { fill: #0F2A4A; }
.house .meter-digits { stroke: #5EEAD4; stroke-width: 2; stroke-linecap: round; }
.house .box-icon { fill: var(--blue); }
.house .grid-icon { fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.house .box.grid.export ~ .grid-icon { stroke: var(--amber); }
.house .box.grid.export ~ .box-icon { fill: var(--amber); }
.house .box.bat { stroke: var(--teal); }
.house .bat-slot { fill: var(--h-slot); }
.house .bat-fill { transition: y 0.8s ease, height 0.8s ease; }
.house .bat-cells { fill: none; stroke: var(--h-unit-a); stroke-width: 2; pointer-events: none; }
.house .bat-led { fill: var(--h-led); }
.house #batGroup.charging .bat-led { fill: var(--teal); animation: blink 1.6s ease-in-out infinite; }
.house #batGroup.discharging .bat-led { fill: var(--amber); animation: blink 1.6s ease-in-out infinite; }
.house #batGroup.charging .bat-fill { animation: pulse 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes pulse { 50% { opacity: 0.7; } }

.house .hl { fill: none; stroke: var(--h-line); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
.house .hl.on { stroke-dasharray: none; stroke-width: 4; opacity: 0.28; }
.house .hl.c-solar { stroke: var(--green); } .house .hl.c-grid { stroke: var(--blue); }
.house .hl.c-export { stroke: var(--amber); } .house .hl.c-bat { stroke: var(--teal); }
.house .arw { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.house .arw.c-solar { stroke: var(--green-ink); } .house .arw.c-grid { stroke: var(--blue); }
.house .arw.c-export { stroke: var(--amber-ink); } .house .arw.c-bat { stroke: var(--teal-ink); }
.house .nv { font-size: 17px; font-weight: 800; fill: var(--ink); }
.house .ns { font-size: 12px; font-weight: 700; fill: var(--ink-3); }
.house .hv { font-size: 22px; font-weight: 800; fill: var(--ink); }
.house .hs { font-size: 12px; font-weight: 700; fill: var(--ink-3); }
.house .stale { fill: var(--ink-3); }
@media (prefers-reduced-motion: reduce) {
    .house *, .house.sun-on .shine, .house.sun-on .sun-rays, .house.sun-on .sun-glow { animation: none !important; }
}
.flow-note { text-align: center; margin: 6px 0 0; }

.self-row { border-top: 1px solid var(--line-soft); margin-top: 14px; padding-top: 12px; }
.self-line {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 10px;
    background: var(--green-soft); color: var(--green-ink); font-weight: 800; font-size: 15px; cursor: pointer; text-align: center;
}
.self-line svg { transition: transform 0.2s; flex: none; }
.self-line[aria-expanded="true"] svg { transform: rotate(180deg); }
.self-plain { margin: 0; text-align: center; font-size: 14px; color: var(--ink-2); }
.self-calc { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px 28px; align-items: start; }
.self-calc p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.self-calc b { color: var(--ink); }

.seg-row { display: flex; justify-content: center; margin: -4px 0 12px; }
@media (max-width: 700px) { .self-calc { grid-template-columns: minmax(0, 1fr); } }
/* Waarden blijven leesbaar als een pijl er vlak langs loopt */
.house .hv, .house .hs, .house .nv, .house .ns { paint-order: stroke; stroke: var(--halo); stroke-width: 4px; stroke-linejoin: round; }

/* ---------- Gas / water ---------- */
.gas-title { display: flex; align-items: center; gap: 8px; }
.gas-ico { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none;
    color: var(--violet); background: color-mix(in srgb, var(--violet) 14%, transparent); }
.gas-top .price-big strong { color: var(--ink); }
.gas-card .legend { display: none; } /* één reeks: de kaarttitel zegt al wat het is */
.water-card .gas-ico { color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); }
.pill.less { background: var(--green-soft); color: var(--green-ink); }
.pill.more { background: var(--amber-soft); color: var(--amber-ink); }
@media (max-width: 560px) {
    .gas-top .price-facts { width: 100%; justify-content: space-between; gap: 12px; }
}

/* Kwartierpiek (Vlaanderen) */
.peak-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; }
.peak-big { display: inline-flex; align-items: baseline; gap: 6px; }
.peak-big strong { font-size: 34px; font-weight: 800; line-height: 1.1; }
.peak-big span { font-size: 15px; font-weight: 700; color: var(--ink-3); }
.peak-when { display: block; font-size: 13px; color: var(--ink-3); }
.peak-facts { display: flex; gap: 28px; margin: 0; }
.peak-facts dt { font-size: 12px; color: var(--ink-3); }
.peak-facts dd { margin: 2px 0 0; font-weight: 800; font-size: 16px; }
.peak-card .field-hint { margin-top: 8px; }
.peak-chart { position: relative; height: 170px; margin-top: 14px; }
.peak-guard { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 12px; }
.peak-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.peak-opts .segmented button[aria-checked="true"] { background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 800; color: var(--blue); }
.peak-target { display: inline-flex; align-items: center; gap: 8px; }
.peak-target .input { width: 90px; }
