/* ONEp1 bèta — Zon, SolarONE en batteryONE */

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.sub-title { margin: 0; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.count { font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--muted-fill); border-radius: 999px; padding: 1px 9px; }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }
.card-title .beta-tag, .sub-title .beta-tag { vertical-align: 2px; margin-left: 6px; }

.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn-danger { border: 1px solid var(--danger-line); background: var(--surface); color: var(--red-ink); }
.btn-danger:hover { background: var(--danger-wash); color: var(--red-ink); }
.link-inline { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 700; color: var(--blue); cursor: pointer; text-decoration: underline; }
.link-inline.back { text-decoration: none; margin-bottom: 8px; }
.link-inline.danger { color: var(--red-ink); font-weight: 600; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row .chip { min-height: 40px; padding: 8px 12px; }
.row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; }
.facts dt { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.facts dd { margin: 2px 0 0; font-weight: 700; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.facts dd.small { font-weight: 600; color: var(--ink-2); }
.dot.bad { background: var(--red-ink); }

.notice.ok { background: var(--green-soft); color: var(--ok-ink); }
.pill.warn { background: var(--amber-soft); color: var(--tag-ink); }
.ok-text { color: var(--green-ink); font-weight: 700; font-size: 13px; margin-top: 4px; }
.bad-text { color: var(--red-ink); font-weight: 600; }
.empty.dashed { border: 1px dashed var(--dash); border-radius: 12px; padding: 14px 16px; }

/* Rijen (koppelingen, scanresultaten) */
.item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.item-row.found { border-color: var(--blue-line); background: var(--blue-wash); }
.item-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.item-icon.sun { background: var(--green-soft); color: var(--green-ink); }
.item-text { flex: 1 1 200px; min-width: 0; }
.item-text strong { font-weight: 800; }
.item-text > span:last-child { display: block; font-size: 13px; color: var(--ink-3); }

/* Merkkeuze */
.wizard { border-top: 1px solid var(--line-soft); margin-top: 16px; padding-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.wizard #genStep1, .wizard #genStep2 { display: flex; flex-direction: column; gap: 12px; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.brand-opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
    min-height: 64px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--field-line); background: var(--surface); cursor: pointer;
}
.brand-opt:hover { border-color: var(--border-strong); }
.brand-opt[aria-checked="true"] { border: 2px solid var(--blue); padding: 11px 13px; background: var(--blue-wash); }
.bo-name { font-weight: 800; font-size: 14px; }
.bo-sub { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.bo-tag { margin-top: 4px; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--muted-fill); color: var(--ink-2); }
.bo-tag.broken { background: var(--bad-soft); color: var(--bad-ink); }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.copy-row code { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; overflow-wrap: anywhere; }

/* Koppelbox */
.pairbox { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; background: var(--blue-wash); border: 1px solid var(--blue-line); border-radius: 14px; padding: 16px; }
.pairbox-qr { width: 132px; height: 132px; flex: none; background: #FFFFFF; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-3); }
.pairbox-qr svg { width: 100%; height: 100%; }
.pairbox-text { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; }
.pairbox-code { margin: 0; font-weight: 700; }
.pairbox-code .mono { font-size: 18px; letter-spacing: 0.12em; margin-left: 6px; }
.steps { margin: 0; padding-left: 20px; font-size: 14px; }
.steps li { margin-bottom: 2px; }

/* Omvormer-/accukaarten */
.inv-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.inv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 16px 4px; }
.inv-title { flex: 1 1 200px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.inv-title strong { font-weight: 800; }
.inv-title > span:nth-child(2) { font-size: 13px; color: var(--ink-3); }
.inv-actions { display: flex; gap: 8px; }
.inv-live { padding: 4px 16px 14px 36px; font-size: 14px; color: var(--ink-3); display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.inv-live strong { color: var(--ink); font-size: 16px; }
.inv-live .sep { color: var(--sep); }
.inv-live > div { flex-basis: 100%; }
.inv-edit { border-top: 1px solid var(--line-soft); background: var(--surface-2); padding: 16px; }
.soc-bar { height: 8px; border-radius: 4px; background: var(--muted-fill); overflow: hidden; width: 120px; display: inline-block; vertical-align: middle; }
.soc-bar > span { display: block; height: 8px; border-radius: 4px; background: var(--green); }
/* Nu-kaart: per accu (alleen bij meer dan één accu) */
.bat-split { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.bat-split li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.bat-split .bs-name { font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bat-split .bs-soc { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.bat-split .soc-bar { width: 64px; }
/* Hoofdzekering: afname per fase nu (batteryone.js renderPhases) */
.phase-rows { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.phase-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.phase-row > strong { width: 24px; }
.phase-row .soc-bar { width: 96px; }
.bat-split .bs-pw { font-weight: 800; text-align: right; min-width: 7.5em; }
@media (max-width: 420px) { .bat-split li { grid-template-columns: minmax(0, 1fr) auto; } .bat-split .bs-pw { grid-column: 1 / -1; text-align: left; min-width: 0; color: var(--ink-3); font-weight: 600; } }

.subcard { border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.mode-panel { display: flex; flex-direction: column; gap: 12px; }
.range { width: 100%; max-width: 420px; accent-color: var(--blue); min-height: 32px; }
.live-line { margin: 0; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; font-size: 14px; color: var(--ink-3); }
.live-line strong { color: var(--ink); }
.live-line .ok { color: var(--green-ink); font-weight: 700; }
.live-line .warn { color: var(--amber-ink); font-weight: 700; }

.guide .disclosure-body, .guide-body { font-size: 14px; }
.guide-body .setup-guide, #soGuidePicker .setup-guide, #b1GuidePicker .setup-guide { font-family: var(--font); }
.guide select, .guide-body select { font: inherit; min-height: 40px; }

table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th { text-align: left; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 0 6px; }
table.simple td { border-top: 1px solid var(--line-soft); padding: 8px 0; }
table.simple td:last-child, table.simple th:last-child { text-align: right; }

.sticky-actions { position: sticky; bottom: 0; background: var(--surface); margin: 0 -20px -20px; padding: 14px 20px; border-radius: 0 0 var(--radius) var(--radius); z-index: 5; }

@media (max-width: 860px) {
    .sticky-actions { bottom: calc(66px + env(safe-area-inset-bottom)); }
    .inv-live { padding-left: 16px; }
}
.chips.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 320px; }

/* ---------- Bèta 2: startstappen en Nu-kaart ---------- */
.start-steps { list-style: none; counter-reset: st; margin: 12px 0 18px; padding: 0; display: grid; gap: 12px; }
.start-steps li { counter-increment: st; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; }
.start-steps li::before { content: counter(st); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 800; display: grid; place-items: center; }
.start-steps strong { font-weight: 800; }
.start-steps span { font-size: 14px; color: var(--ink-3); }
.now-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.now-grid .stat-list dd { text-align: right; white-space: normal; }
@media (max-width: 480px) { .now-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; } .now-grid .stat-list { width: 100%; } }

/* ---------- Bèta 2: koppelen ---------- */
.pairbox2 { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pairbox2 .choice-grid { width: 100%; }
.pairbox2 a.choice { text-decoration: none; color: inherit; }
.choice.disabled { opacity: 0.55; cursor: not-allowed; }
.pairbox2 .disclosure { width: 100%; }
.sum-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.sum-text { font-weight: 700; color: var(--ink-2); font-size: 14px; }
.ctrl-body { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.dongle-details > summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dongle-details > summary .card-title { font-size: 16px; }
.dongle-details > summary .sum-text { font-weight: 600; font-size: 13px; color: var(--ink-3); }
#b1List, #soInvList { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
#b1List > .inv-card:has(.inv-edit:not([hidden])), #soInvList > .inv-card:has(.inv-edit:not([hidden])) { grid-column: 1 / -1; }
#b1List > .empty, #soInvList > .empty { grid-column: 1 / -1; }
.inv-head { cursor: pointer; }
#genList .item-row { cursor: pointer; }
#genList .item-row .btn-danger { display: none; }
#genList .item-row.open .btn-danger { display: inline-flex; }
#genList .item-row::after { content: '›'; font-size: 20px; color: var(--ink-3); margin-left: 4px; transition: transform 0.2s; }
#genList .item-row.open::after { transform: rotate(90deg); }

/* Stappenplan per merk (gedeelde setup-guides.js met inline stijlen): merkkeuze past altijd
   binnen de kaart, ook met lange merknamen, en volgt het thema (ook donker). */
#b1GuidePicker, #soGuidePicker { min-width: 0; max-width: 100%; }
#b1GuidePicker .setup-guide-select, #soGuidePicker .setup-guide-select {
    display: block; width: 100%; max-width: 100%; min-width: 0 !important; min-height: 46px;
    padding: 10px 12px !important; border: 1px solid var(--field-line) !important; border-radius: 12px !important;
    background: var(--surface); color: var(--ink); font-size: 15px !important; font-weight: 600;
    text-overflow: ellipsis;
}
#b1GuidePicker .setup-guide, #soGuidePicker .setup-guide { overflow-wrap: anywhere; }
#b1GuidePicker table, #soGuidePicker table { max-width: 100%; }
#b1GuidePicker [style*="white-space:nowrap"], #soGuidePicker [style*="white-space:nowrap"] { white-space: normal !important; }
#b1GuidePicker [style*="color:#1e293b"], #soGuidePicker [style*="color:#1e293b"] { color: var(--ink) !important; }
#b1GuidePicker [style*="color:#64748b"], #soGuidePicker [style*="color:#64748b"] { color: var(--ink-3) !important; }
#b1GuidePicker [style*="color:#2563eb"], #soGuidePicker [style*="color:#2563eb"] { color: var(--blue) !important; }
#b1GuidePicker [style*="background:#f8fafc"], #soGuidePicker [style*="background:#f8fafc"] { background: var(--surface-2) !important; border-left-color: var(--border-strong) !important; }

/* Opslaan-balk los onder de kaarten (Thuisaccu, Zon): eigen afgeronde balk binnen de
   paginamarge in plaats van negatieve marges die op de telefoon buiten beeld vielen. */
.container > .sticky-actions, .stack-lg > .sticky-actions {
    margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 -6px 18px rgba(14, 23, 38, 0.06);
}

/* Accukaart: wat de batteryONE gemeten heeft (batteryone.js renderLearned) */
.bat-learn { display: flex; flex-direction: column; gap: 8px; }
.bat-learn:empty { display: none; }
.bat-learn .field-hint strong { color: var(--ink-2); }
