:root {
  --bg: #0e1218;
  --bg-elev: #161c24;
  --bg-card: #1a222c;
  --bg-soft: #243040;
  --border: #2d3a48;
  --text: #f2efe6;
  --muted: #9aa6b5;
  --accent: #f5c518;
  --accent-dim: #c9a010;
  --leaf: #5fb878;
  --leaf-dim: #3d8b5a;
  --petal: #f7f2e8;
  --cream: #e8dfc8;
  --warn: #f5c518;
  --danger: #f07178;
  --info: #5cc8ff;
  --pv: #f5c518;
  --batt: #5fb878;
  --load: #c792ea;
  --grid: #5cc8ff;
  --bellis: #f7f2e8;
  --vulgare: #e8dfc8;
  --maximum: #f5c518;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--info);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover {
  color: var(--accent);
  text-decoration: none;
}
.logo-mark {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(245, 197, 24, 0.25));
}
.logo-text {
  background: linear-gradient(105deg, var(--petal) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dealer {
  color: var(--muted);
  font-size: 0.95rem;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.view {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-online {
  background: rgba(95, 184, 120, 0.18);
  color: var(--leaf);
}
.badge-offline {
  background: rgba(240, 113, 120, 0.15);
  color: var(--danger);
}
.badge-demo {
  background: rgba(245, 197, 24, 0.14);
  color: var(--accent);
}
.badge-ctrl {
  background: rgba(240, 180, 41, 0.15);
  color: var(--warn);
}
.badge-area {
  background: var(--bg-soft);
  color: var(--muted);
  text-transform: none;
}

/* Summary cards */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.summary .card .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.summary .card .value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.summary .card .value.accent {
  color: var(--leaf);
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.chip:hover {
  border-color: var(--muted);
  color: var(--text);
}
.chip.active {
  background: rgba(245, 197, 24, 0.16);
  border-color: var(--accent-dim);
  color: var(--accent);
}

/* Site table / cards */
.site-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

table.sites {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.sites th {
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
table.sites td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.sites tr:last-child td {
  border-bottom: none;
}
table.sites tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}
table.sites tbody tr:hover {
  background: rgba(245, 197, 24, 0.06);
}
table.sites .name {
  font-weight: 600;
}
table.sites .proto {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
}
.num {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
}
.pos {
  color: var(--leaf);
}
.neg {
  color: var(--info);
}

.empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

/* Site detail */
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.back:hover {
  color: var(--accent);
  text-decoration: none;
}


.site-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.btn-icon.settings-gear,
.settings-gear {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--cream);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.btn-icon.settings-gear:hover,
.settings-gear:hover {
  border-color: rgba(245, 197, 24, 0.55);
  color: #f5c518;
  background: rgba(245, 197, 24, 0.08);
}
.btn-icon.settings-gear[aria-expanded="true"],
.settings-gear[aria-expanded="true"] {
  border-color: rgba(245, 197, 24, 0.7);
  color: #f5c518;
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.12);
}
.site-settings-card[hidden],
.site-settings-card.is-collapsed[hidden] {
  display: none !important;
}

.settings-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.btn-icon.settings-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.btn-icon.settings-close:hover {
  color: var(--cream);
  border-color: rgba(224, 122, 106, 0.55);
  background: rgba(224, 122, 106, 0.12);
}

.site-head h1 {
  margin: 0 0 0.25rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
.site-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.85rem;
  font-weight: 600;
}

/* Energy flow */
.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 0.5rem 0.35rem;
  align-items: center;
  justify-items: center;
  min-height: 220px;
  padding: 0.5rem 0;
}

.flow-node {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  min-width: 110px;
  text-align: center;
}
.flow-node .n-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.flow-node .n-val {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.flow-node.pv {
  border-color: rgba(240, 180, 41, 0.45);
}
.flow-node.pv .n-val {
  color: var(--pv);
}
.flow-node.batt {
  border-color: rgba(61, 214, 140, 0.45);
}
.flow-node.batt .n-val {
  color: var(--batt);
}
.flow-node.load {
  border-color: rgba(199, 146, 234, 0.45);
}
.flow-node.load .n-val {
  color: var(--load);
}
.flow-node.grid {
  border-color: rgba(92, 200, 255, 0.45);
}
.flow-node.grid .n-val {
  color: var(--grid);
}
.flow-node.hub {
  background: linear-gradient(145deg, #243545, #1a2835);
  border-color: var(--accent-dim);
  grid-column: 3;
  grid-row: 2;
}

.flow-arrow {
  color: var(--muted);
  font-size: 1.25rem;
  opacity: 0.7;
}
.flow-arrow.active {
  color: var(--accent);
  opacity: 1;
}

.flow .pv-slot {
  grid-column: 3;
  grid-row: 1;
}
.flow .batt-slot {
  grid-column: 1;
  grid-row: 2;
}
.flow .load-slot {
  grid-column: 5;
  grid-row: 2;
}
.flow .grid-slot {
  grid-column: 3;
  grid-row: 3;
}
.flow .arr-pv {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  margin-top: 4.2rem;
}
.flow .arr-batt {
  grid-column: 2;
  grid-row: 2;
}
.flow .arr-load {
  grid-column: 4;
  grid-row: 2;
}
.flow .arr-grid {
  grid-column: 3;
  grid-row: 3;
  align-self: start;
  margin-bottom: 4.2rem;
}

/* Simpler flow layout for reliability */
.flow-simple {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem 0.4rem;
  padding: 0.75rem 0;
}
.flow-simple .flow-node {
  min-width: 120px;
}
.flow-simple .hub {
  min-width: 100px;
  border-color: var(--accent-dim);
  background: linear-gradient(145deg, #243545, #1a2835);
}
.arrow {
  color: var(--muted);
  font-size: 1.4rem;
  user-select: none;
}
.arrow.on {
  color: var(--accent);
}

/* SOC daisy gauge (petal slices, no arc ring) */
.soc-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0 0.25rem;
}
.soc-daisy {
  width: 168px;
  height: 168px;
  position: relative;
}
.soc-daisy svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.soc-petal {
  transition: fill 0.45s ease, filter 0.45s ease, opacity 0.45s ease;
}
.soc-petal.charged {
  fill: var(--accent);
  filter: drop-shadow(0 0 3px rgba(245, 197, 24, 0.55));
}
.soc-petal.empty {
  fill: #3a3428;
  opacity: 0.72;
}
.soc-daisy-core {
  fill: var(--bg-elev);
  stroke: rgba(245, 197, 24, 0.22);
  stroke-width: 1.25;
}
.soc-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.soc-center .pct {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--petal);
  line-height: 1.05;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.soc-center .lbl,
.soc-center .kwh {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.soc-center .kwh {
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

/* Inverters */
.inv-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.inv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.inv-row .label {
  font-weight: 600;
}

/* Control rows (SOC card etc.) — v0.3.9.3: the old "Styring" setpoint card was removed */
.ctrl-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.ctrl-row:last-of-type {
  border-bottom: none;
}
/* Invertere card: full width on its own row (was half of a .grid-2) */
.inv-card {
  margin-bottom: 1rem;
}
.btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #1a1408;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}
.btn:hover:not(:disabled) {
  filter: brightness(1.08);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.toast {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  /* long server messages (paths / chown command) must wrap on mobile */
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.toast.ok {
  color: var(--leaf);
}
.toast.err {
  color: var(--danger);
}

/* Expandable raw */
details.raw {
  margin-top: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
details.raw summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
details.raw pre {
  margin: 0.75rem 0 0;
  overflow: auto;
  font-size: 0.78rem;
  color: var(--text);
  background: var(--bg);
  padding: 0.85rem;
  border-radius: 8px;
  max-height: 320px;
}

.error-banner {
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.4);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.loading {
  padding: 3rem;
  text-align: center;
  color: var(--muted);
}


/* Daisy battery class badges */
.badge-bellis {
  background: rgba(247, 242, 232, 0.12);
  color: var(--bellis);
  border: 1px solid rgba(247, 242, 232, 0.35);
  text-transform: none;
}
.badge-vulgare {
  background: rgba(232, 223, 200, 0.14);
  color: var(--cream);
  border: 1px solid rgba(232, 223, 200, 0.4);
  text-transform: none;
}
.badge-maximum {
  background: rgba(245, 197, 24, 0.16);
  color: var(--maximum);
  border: 1px solid rgba(245, 197, 24, 0.45);
  text-transform: none;
}
.badge-ukendt {
  background: var(--bg-soft);
  color: var(--muted);
  text-transform: none;
  font-weight: 500;
}

.daisy-class {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.daisy-class .class-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.daisy-class .class-da {
  font-size: 0.85rem;
  color: var(--muted);
}
.daisy-class .class-latin {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--cream);
}
.daisy-class .class-range {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.topbar {
  border-bottom-color: rgba(245, 197, 24, 0.18);
}

/* ---- Priser & ladeplan (v0.3) ---- */
.energy-section {
  margin-bottom: 1rem;
}
.energy-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.energy-head .section-title {
  margin: 0;
}
.energy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.88rem;
}
.badge-elo {
  background: rgba(92, 200, 255, 0.14);
  color: var(--info);
  text-transform: none;
}
.badge-tariff-demo {
  background: rgba(245, 197, 24, 0.14);
  color: var(--accent);
  text-transform: none;
}
.badge-engine-soldim {
  background: rgba(95, 184, 120, 0.18);
  color: #7dcea0;
  text-transform: none;
}
.badge-engine-greedy {
  background: rgba(154, 166, 181, 0.18);
  color: var(--muted);
  text-transform: none;
}

.energy-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.energy-stats .stat {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}
.energy-stats .stat .label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.energy-stats .stat .value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.chart-wrap {
  position: relative;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
  overflow: hidden;
}
.chart-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.chart-legend .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}
.chart-legend .swatch.line {
  height: 3px;
  border-radius: 1px;
  vertical-align: 3px;
}
/* v0.3.18: dashed legend swatch (Salgspris) */
.chart-legend .swatch.line.dashed {
  height: 2px;
  width: 18px;
  border: 0;
  background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 8px) !important;
  vertical-align: 3px;
}
/* v0.3.74: Ladeplan legend toggles + hover/tap tooltip */
.chart-legend .swatch.line.dotted {
  height: 2px;
  width: 18px;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px) !important;
  vertical-align: 3px;
}
.chart-legend .legend-btn {
  font: inherit;
  color: var(--text, #e8dfc8);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
}
.chart-legend .legend-btn.off { opacity: 0.45; text-decoration: line-through; }
.chart-legend .legend-btn:focus-visible { outline: 2px solid #f5c518; outline-offset: 2px; }
.chart-legend .legend-hint { flex-basis: 100%; font-size: 0.75rem; }
#energy-chart { touch-action: pan-y; cursor: crosshair; }
.chart-tip {
  position: absolute;
  z-index: 3;
  min-width: 190px;
  max-width: 280px;
  pointer-events: none;
  background: rgba(14, 18, 24, 0.94);
  border: 1px solid #f5c518;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #f2efe6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
}
.chart-tip .ct-title { font-weight: 600; margin-bottom: 0.2rem; }
.chart-tip .ct-action { color: #f5c518; margin-bottom: 0.25rem; }
.chart-tip .ct-row { display: flex; gap: 0.4rem; align-items: center; }
.chart-tip .ct-row i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.chart-tip .ct-row span { flex: 1; color: #c8cdd6; }
.energy-stats .stat-sub {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tariff-summary {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.solar-now {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.solar-now .big {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pv);
}

.badge-eds {
  background: rgba(95, 184, 120, 0.16);
  color: #7dcea0;
  text-transform: none;
}
.badge-fallback {
  background: rgba(232, 160, 80, 0.16);
  color: #e8a050;
  text-transform: none;
}
.masterdata-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem 1rem;
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
}
.masterdata-card .md-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.masterdata-card .md-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.masterdata-card .md-val {
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}


/* Plan economics (Forventet / Reel) */
.economics-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.85rem;
  grid-column: 1 / -1;
}
.econ-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
  color: var(--text);
}
.econ-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1.2fr) auto 1fr;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  padding: 0.28rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.econ-row:first-of-type {
  border-top: none;
}
.econ-label {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.econ-total {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.econ-split {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.econ-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(92, 200, 255, 0.15);
  color: #8ed0f0;
  text-transform: none;
}
.econ-tag-real {
  background: rgba(95, 184, 120, 0.18);
  color: #7dcea0;
}
.econ-actual-empty .econ-split {
  grid-column: 2 / -1;
}
.econ-help {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
@media (max-width: 640px) {
  .econ-row {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .econ-actual-empty .econ-split {
    grid-column: auto;
  }
}

/* ===== Daisy energy hub flow (icons + directed lines) ===== */
.flow-hub-card .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.flow-price-wrap {
  text-transform: none;
  letter-spacing: normal;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.flow-sell-price {
  font-size: 0.74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.flow-price-pill {
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(245, 197, 24, 0.12);
  border: 1px solid rgba(245, 197, 24, 0.35);
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.flow-hub.soldim {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0.2rem auto 0.1rem;
  aspect-ratio: 1 / 1;
}
.flow-hub svg.flow-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.flow-hub .wire {
  fill: none;
  stroke-width: 0.72;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flow-hub .wire.idle {
  stroke: rgba(180, 190, 205, 0.45);
  stroke-dasharray: none;
  opacity: 0.18;
  stroke-width: 0.55;
}
.flow-hub .wire.on {
  stroke-dasharray: 1.6 3.8;
  opacity: 0.88;
  animation: flow-dash 1.35s linear infinite;
}
@keyframes flow-dash {
  to { stroke-dashoffset: -12; }
}
.flow-hub .wire.pv-load { stroke: #e8c547; }
.flow-hub .wire.pv-batt { stroke: #c9a227; }
.flow-hub .wire.pv-sell { stroke: #e8a05c; }
.flow-hub .wire.buy-batt { stroke: #5b9fd4; }
.flow-hub .wire.buy-load { stroke: #6bb8e8; }
.flow-hub .wire.batt-load { stroke: #5fad7a; }
.flow-hub .wire.batt-sell { stroke: #e07a6a; }
.flow-hub .flow-bead {
  fill: currentColor;
  opacity: 0.95;
  filter: drop-shadow(0 0 2.5px currentColor);
  pointer-events: none;
}
.flow-hub .flow-bead.pv-load,
.flow-hub .flow-bead.pv-batt,
.flow-hub .flow-bead.pv-sell { color: #e8c547; }
.flow-hub .flow-bead.buy-batt,
.flow-hub .flow-bead.buy-load { color: #6bb8e8; }
.flow-hub .flow-bead.batt-load { color: #5fad7a; }
.flow-hub .flow-bead.batt-sell { color: #e07a6a; }
.flow-hub .slot {
  position: absolute;
  width: 96px;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
}
.flow-hub .slot.pv { left: 20%; top: 16%; }
.flow-hub .slot.load { left: 80%; top: 16%; }
.flow-hub .slot.batt { left: 50%; top: 76%; width: 104px; }
.flow-hub .slot.gridIn { left: 18%; top: 90%; }
.flow-hub .slot.gridOut { left: 82%; top: 90%; }
.flow-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.3rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #121820;
  border: 2.5px solid var(--border);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.25);
}
.flow-icon svg {
  width: 34px;
  height: 34px;
  display: block;
}
.flow-icon.pv {
  color: #f0d060;
  border-color: #f0d060;
  background: radial-gradient(circle at 40% 35%, rgba(240,208,96,0.22), #121820 70%);
  box-shadow: 0 0 20px rgba(240, 208, 96, 0.28);
}
.flow-icon.load {
  color: #7dcea0;
  border-color: #7dcea0;
  background: radial-gradient(circle at 40% 35%, rgba(125,206,160,0.2), #121820 70%);
  box-shadow: 0 0 20px rgba(125, 206, 160, 0.25);
}
.flow-icon.batt {
  position: relative;
  color: #4a9a68;
  border-color: #4a9a68;
  background: radial-gradient(circle at 40% 35%, rgba(74,154,104,0.22), #121820 70%);
  box-shadow: 0 0 22px rgba(74, 154, 104, 0.3);
  width: 72px;
  height: 72px;
}
.flow-icon.batt svg { width: 38px; height: 38px; }
.flow-icon.gridIn {
  color: #6bb8e8;
  border-color: #6bb8e8;
  background: radial-gradient(circle at 40% 35%, rgba(107,184,232,0.2), #121820 70%);
  box-shadow: 0 0 20px rgba(107, 184, 232, 0.25);
}
.flow-icon.gridOut {
  color: #e07a6a;
  border-color: #e07a6a;
  background: radial-gradient(circle at 40% 35%, rgba(224,122,106,0.2), #121820 70%);
  box-shadow: 0 0 20px rgba(224, 122, 106, 0.25);
}
.flow-icon.active {
  transform: scale(1.05);
}
.flow-slot-label {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.flow-slot-val {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 0.05rem;
}
.flow-slot-val.pv { color: #f0d060; }
.flow-slot-val.load { color: #7dcea0; }
.flow-slot-val.batt { color: #6bbf88; }
.flow-slot-val.gridIn { color: #6bb8e8; }
.flow-slot-val.gridOut { color: #e07a6a; }
.flow-slot-sub {
  font-size: 0.66rem;
  color: var(--muted);
  margin-top: 0.08rem;
  min-height: 0.85rem;
}
.flow-soc-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #1a222c;
  border: 1px solid rgba(74, 154, 104, 0.8);
  color: #7dcea0;
  border-radius: 999px;
  padding: 0.05rem 0.38rem;
  font-variant-numeric: tabular-nums;
}
.flow-legend-dirs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  justify-content: center;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.flow-legend-dirs span i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.28rem;
  vertical-align: -1px;
}
.flow-legend-dirs .lg-pv { background: #f0d060; }
.flow-legend-dirs .lg-load { background: #7dcea0; }
.flow-legend-dirs .lg-batt { background: #4a9a68; }
.flow-legend-dirs .lg-buy { background: #6bb8e8; }
.flow-legend-dirs .lg-sell { background: #e07a6a; }
@media (max-width: 520px) {
  .flow-hub.soldim { max-width: 340px; }
  .flow-hub .slot { width: 80px; }
  .flow-icon { width: 54px; height: 54px; }
  .flow-icon svg { width: 28px; height: 28px; }
  .flow-icon.batt { width: 60px; height: 60px; }
  .flow-slot-val { font-size: 0.85rem; }
}
/* ===== end Daisy energy hub flow ===== */


/* ===== Site settings (kWp + moms) ===== */
.site-settings-card .settings-form { margin-top: 0.35rem; }
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
@media (max-width: 720px) {
  .settings-grid { grid-template-columns: 1fr; }
}
.settings-field { display: flex; flex-direction: column; gap: 0.35rem; }
.settings-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.settings-field input[type="number"] {
  width: 100%;
  max-width: 12rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--cream);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.settings-hint {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.moms-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  width: fit-content;
}
.moms-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
}
.moms-btn.active {
  background: rgba(245, 197, 24, 0.18);
  color: var(--cream);
}
.moms-btn:not(.active):hover {
  color: var(--cream);
  background: rgba(255,255,255,0.04);
}
.settings-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
}
.badge-moms-on {
  background: rgba(125, 206, 160, 0.15);
  border: 1px solid rgba(125, 206, 160, 0.4);
  color: #7dcea0;
}
.badge-moms-off {
  background: rgba(92, 200, 255, 0.12);
  border: 1px solid rgba(92, 200, 255, 0.35);
  color: #5cc8ff;
}
.badge-kwp {
  background: rgba(240, 208, 96, 0.12);
  border: 1px solid rgba(240, 208, 96, 0.35);
  color: #f0d060;
}
/* ===== end site settings ===== */


/* ===== Extended Indstillinger ===== */
.settings-section {
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.settings-section:first-of-type {
  margin-top: 0.35rem;
  padding-top: 0;
  border-top: 0;
}
.settings-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
}
.settings-field input[type="text"],
.settings-field input[type="email"],
.settings-field input[type="tel"],
.settings-field input[type="password"],
.settings-field input[type="search"],
.settings-field select {
  width: 100%;
  max-width: 22rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--cream);
  font-size: 0.95rem;
}
.settings-hint.elo-hint {
  color: #9ec8e8;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--cream);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
}
.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

/* ===== Main nav ===== */
.main-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
}
.nav-link:hover { color: var(--cream); }
.nav-link.active {
  color: var(--cream);
  border-color: var(--border);
  background: rgba(245, 197, 24, 0.12);
}

/* ===== Status dots ===== */
.status-icons {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
}
.status-green { background: #3ecf7a; }
.status-yellow { background: #e6c84a; }
.status-red { background: #e05555; }
.status-gray { background: #6a6f78; }

/* ===== Kunder ===== */
.kunder-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
}
.kunder-head h1 {
  margin: 0 0 0.15rem;
  font-size: 1.45rem;
}
.kunder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.kunder-search {
  min-width: 14rem;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--cream);
}
.kunder-table .addr-cell {
  max-width: 16rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.kunder-row-actions {
  white-space: nowrap;
  display: flex;
  gap: 0.35rem;
}
.legend-popover {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  max-width: 28rem;
}
.legend-title { font-weight: 700; margin-bottom: 0.5rem; }
.legend-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.65rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
}
.legend-list li { display: flex; align-items: center; gap: 0.5rem; }
.legend-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1rem;
  z-index: 80;
  overflow: auto;
}
.modal-backdrop.hidden { display: none; }
.modal-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem 1.25rem;
  width: min(640px, 100%);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.modal-head h2 { margin: 0; font-size: 1.15rem; }


/* ===== Auth / login ===== */
.user-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.user-label {
  font-size: 0.85rem;
  color: var(--cream);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role {
  color: var(--muted);
  font-weight: 500;
}
.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

/* Logged-out welcome — warm paper, quiet Nordic utility */
body.body-login {
  background: #f4f0e6;
  color: #1c2420;
}
body.body-login #app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f4f0e6;
}
body.body-login .topbar,
body.body-login .footer {
  display: none !important;
}
body.body-login .view {
  max-width: none;
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 2rem 1.25rem 1.5rem;
  background-color: #efe9dc;
  background-image:
    linear-gradient(
      165deg,
      rgba(247, 243, 234, 0.92) 0%,
      rgba(244, 240, 230, 0.82) 42%,
      rgba(239, 233, 220, 0.78) 100%
    ),
    url("/static/img/welcome-daisies.jpg");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  color: #1c2420;
}
.welcome-inner {
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 2.5rem 3rem;
  align-items: center;
}
.welcome-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.1rem;
}
.welcome-logo-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 4px rgba(212, 160, 18, 0.35));
}
.welcome-logo-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #152018;
  line-height: 1;
}
.welcome-logo-text em {
  font-style: normal;
  color: #d4a012;
  background: linear-gradient(105deg, #f5c518 0%, #d4a012 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.welcome-intro h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.55rem, 2.6vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #152018;
}
.welcome-lead {
  margin: 0 0 1.35rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #3a4540;
  max-width: 36rem;
}
.welcome-trust {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 36rem;
}
.welcome-trust li {
  position: relative;
  padding-left: 1.15rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #3a4540;
}
.welcome-trust li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}

.welcome-login {
  display: flex;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(217, 210, 194, 0.95);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(28, 36, 32, 0.04), 0 14px 36px rgba(28, 36, 32, 0.1);
  padding: 1.6rem 1.45rem 1.45rem;
}
.login-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #152018;
}
.login-card .login-sub {
  margin: 0 0 1.2rem;
  color: #5a655f;
  font-size: 0.88rem;
  line-height: 1.4;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #3a4540;
  font-weight: 600;
}
.login-form input {
  appearance: none;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cfc7b6;
  background: #fff;
  color: #152018;
  font-size: 1rem;
  font-family: inherit;
}
.login-form input::placeholder {
  color: #8a928c;
}
.login-form input:focus {
  outline: none;
  border-color: #2f5d3a;
  box-shadow: 0 0 0 3px rgba(47, 93, 58, 0.18);
}
.login-form .btn {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 1rem;
  background: #2f5d3a;
  color: #f7f3ea;
  font-weight: 700;
}
.login-form .btn:hover:not(:disabled) {
  filter: none;
  background: #254a2f;
}
.login-form .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.login-error {
  color: #a33a3a;
  font-size: 0.85rem;
  min-height: 1.2em;
}
.login-hint {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #5a655f;
  line-height: 1.4;
}
.welcome-foot {
  margin: 2rem auto 0;
  max-width: 920px;
  width: 100%;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(221, 213, 196, 0.85);
  font-size: 0.8rem;
  color: #5a655f;
  text-align: left;
}

@media (max-width: 820px) {
  .welcome {
    padding: 1.5rem 1rem 1.25rem;
  }
  .welcome-inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    align-items: stretch;
  }
  .welcome-login {
    justify-content: stretch;
  }
  .login-card {
    max-width: none;
  }
  .welcome-foot {
    text-align: center;
  }
}


/* ElOverblik metering picker */
.elo-mp-modal-card {
  width: min(720px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.elo-mp-toolbar {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}
.elo-mp-toolbar input[type="search"] {
  flex: 1;
  min-width: 0;
}
.elo-mp-list {
  overflow: auto;
  max-height: 55vh;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.elo-mp-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.elo-mp-row:last-child { border-bottom: 0; }
.elo-mp-row:hover { background: rgba(245, 197, 24, 0.08); }
.elo-mp-row-main .name { font-weight: 600; }
.elo-mp-row-main .proto { font-size: 0.8rem; color: var(--muted); }
.elo-mp-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  align-self: center;
}


/* ElOverblik native fuldmagt / tilmeld */
.tilmeld-page { max-width: 720px; margin: 0 auto; }
.tilmeld-page h1 { margin-bottom: 0.35rem; }
.tilmeld-lead { color: var(--muted); margin-bottom: 1.25rem; line-height: 1.45; }
.elo-invite-wait {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: rgba(245, 197, 24, 0.06);
  margin-top: 1rem;
}
.elo-invite-wait h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.elo-invite-wait ol { margin: 0.4rem 0 0.9rem 1.2rem; color: var(--muted); line-height: 1.45; }
.elo-invite-wait .wait-status {
  font-weight: 600;
  margin: 0.5rem 0;
}
.elo-invite-wait .wait-status.ok { color: var(--ok, #5fb878); }
.elo-invite-wait .wait-status.err { color: var(--danger); }
.elo-invite-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.elo-mp-pick-inline { margin-top: 1rem; }
.elo-mp-pick-inline .elo-mp-list { max-height: 280px; }

/* ===== Brugere (admin) ===== */
.brugere-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.brugere-card {
  padding: 1rem 1.1rem;
}
.brugere-card h2 {
  margin: 0 0 0.75rem;
}
.brugere-form {
  display: grid;
  gap: 0.65rem;
}
.brugere-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.25rem;
}
.brugere-dealer-select {
  min-width: 12rem;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--cream);
}
.brugere-save-status.err,
#create-admin-status.err,
#create-dealer-status.err {
  color: var(--danger);
}


/* ===== Dashboard v1 shell + site overview (mockup-aligned) ===== */
:root {
  --radius-lg: 16px;
  --glass: rgba(26, 34, 44, 0.86);
  --glass-border: rgba(255, 255, 255, 0.06);
  --shadow-elev: 0 8px 28px rgba(0, 0, 0, 0.38);
}

body.has-sidebar {
  /* reserved for layout class */
}

#app {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #121820 0%, #0e1218 100%);
  border-right: 1px solid var(--border);
  padding: 1rem 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.app-sidebar[hidden] {
  display: none !important;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.25rem 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-dealer {
  font-size: 0.75rem;
  color: var(--muted);
  padding-left: 0.15rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav .nav-section {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.85rem 0.65rem 0.35rem;
}

.sidebar-nav a,
.sidebar-nav button.nav-link-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav button.nav-link-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.sidebar-nav a.active,
.sidebar-nav button.nav-link-btn.active {
  color: var(--accent);
  background: rgba(245, 197, 24, 0.12);
  box-shadow: inset 0 0 0 1px rgba(245, 197, 24, 0.22);
}

.sidebar-nav .nav-ico {
  width: 18px;
  height: 18px;
  opacity: 0.9;
  flex-shrink: 0;
}

.sidebar-foot {
  font-size: 0.72rem;
  padding: 0.5rem 0.65rem 0;
  border-top: 1px solid var(--border);
}

.sidebar-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--cream);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  place-items: center;
  cursor: pointer;
}

.top-site-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.35rem;
  padding: 0.2rem 0.55rem 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  max-width: min(360px, 42vw);
}

.top-site-chip.hidden { display: none !important; }

.top-site-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(145deg, rgba(245, 197, 24, 0.35), rgba(95, 184, 120, 0.25));
  color: var(--petal);
  border: 1px solid rgba(245, 197, 24, 0.35);
  flex-shrink: 0;
}

.clock {
  font-variant-numeric: tabular-nums;
}

.mobile-nav {
  display: none;
  gap: 0.4rem;
  padding: 0.55rem 1rem 0;
  overflow-x: auto;
}

.mobile-nav a,
.mobile-nav button {
  flex: 0 0 auto;
}

body.app-authed .mobile-nav:not(.hidden) {
  display: flex;
}

/* Elevated glass cards */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev);
  backdrop-filter: blur(8px);
}

.view {
  max-width: 1280px;
  width: 100%;
}

/* KPI strip — v0.3.10.2 compact 4-up (no orphan Netto card) */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.55rem 0 0.75rem;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  /* Solid Daisy card — less glass / empty padding */
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: none;
}

.kpi-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.kpi-ico svg { width: 16px; height: 16px; }
.kpi-ico.price { color: var(--accent); background: rgba(245, 197, 24, 0.14); }
.kpi-ico.load { color: var(--leaf); background: rgba(95, 184, 120, 0.12); }
.kpi-ico.soc { color: var(--batt); background: rgba(95, 184, 120, 0.14); }
.kpi-ico.grid { color: var(--grid); background: rgba(92, 200, 255, 0.12); }

.kpi-card .label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.05rem;
}
.kpi-card .value {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.kpi-card .sub {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.05rem;
  line-height: 1.25;
}

/* Site dashboard grids */
.dash-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.7fr);
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.dash-metrics {
  display: grid;
  grid-template-columns: minmax(200px, 0.9fr) repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.metric-mini .label {
  font-size: 0.75rem;
  color: var(--muted);
}
.metric-mini .value {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0.25rem 0 0.15rem;
  font-variant-numeric: tabular-nums;
}
.metric-mini .value.pv { color: var(--pv); }
.metric-mini .value.load { color: var(--leaf); }
.metric-mini .value.grid { color: var(--grid); }
.metric-mini .value.batt { color: var(--batt); }
.metric-mini .sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.status-live-card .status-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
}
.status-live-card .status-row:last-child { border-bottom: 0; }

.coming-soon {
  opacity: 0.72;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
}
.coming-soon .section-title { margin-bottom: 0; }

.dash-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.65fr);
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.site-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.75rem;
}
.site-subnav a,
.site-subnav button {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.site-subnav a:hover,
.site-subnav button:hover {
  color: var(--text);
  text-decoration: none;
}
.site-subnav a.active,
.site-subnav button.active {
  color: var(--accent);
  border-color: rgba(245, 197, 24, 0.4);
  background: rgba(245, 197, 24, 0.12);
}

/* Hub-centric energy flow (inverter center) */
.flow-hub.deye-hub {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0.15rem auto 0.2rem;
  aspect-ratio: 1.05 / 1;
}
.flow-hub.deye-hub .slot.pv { left: 50%; top: 12%; }
.flow-hub.deye-hub .slot.load { left: 88%; top: 50%; }
.flow-hub.deye-hub .slot.batt { left: 50%; top: 88%; width: 110px; }
.flow-hub.deye-hub .slot.grid { left: 12%; top: 50%; }
.flow-hub.deye-hub .slot.hub {
  left: 50%;
  top: 50%;
  width: 96px;
  z-index: 3;
}
.flow-hub .flow-icon.hub {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  color: var(--petal);
  border-color: rgba(245, 197, 24, 0.55);
  background: linear-gradient(155deg, #2a3544 0%, #1a222c 70%);
  box-shadow: 0 0 24px rgba(245, 197, 24, 0.18);
}
.flow-hub .flow-icon.hub svg { width: 34px; height: 34px; }
.flow-hub .flow-icon.grid {
  color: #6bb8e8;
  border-color: #6bb8e8;
  background: radial-gradient(circle at 40% 35%, rgba(107, 184, 232, 0.2), #121820 70%);
  box-shadow: 0 0 20px rgba(107, 184, 232, 0.25);
}
.flow-slot-val.grid { color: #6bb8e8; }
.flow-hub .wire.pv-hub { stroke: #e8c547; }
.flow-hub .wire.load-hub { stroke: #7dcea0; }
.flow-hub .wire.batt-hub { stroke: #4a9a68; }
.flow-hub .wire.grid-hub { stroke: #6bb8e8; }
.flow-hub .flow-bead.pv-hub { color: #e8c547; }
.flow-hub .flow-bead.load-hub { color: #7dcea0; }
.flow-hub .flow-bead.batt-hub { color: #4a9a68; }
.flow-hub .flow-bead.grid-hub { color: #6bb8e8; }
.flow-legend-dirs .lg-grid { background: #6bb8e8; }

.soc-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.batt-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(95, 184, 120, 0.14);
  color: var(--leaf);
}
.batt-status-pill.idle {
  background: rgba(154, 166, 181, 0.14);
  color: var(--muted);
}
.batt-status-pill.dis {
  background: rgba(92, 200, 255, 0.14);
  color: var(--grid);
}

/* Hide duplicate top logo when sidebar visible */
@media (min-width: 900px) {
  body.app-authed .app-sidebar { display: flex; }
  body.app-authed .app-sidebar[hidden] { display: flex !important; }
  body.app-authed .logo-top { display: none; }
  body.app-authed .sidebar-toggle { display: none; }
  body.app-authed .mobile-nav { display: none !important; }
  body.app-authed .main-nav { display: none; } /* sidebar replaces horizontal admin nav on desktop */
  .view { padding-left: 1.35rem; padding-right: 1.35rem; }
}

@media (max-width: 899px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-elev);
  }
  body.sidebar-open .app-sidebar {
    transform: translateX(0);
    display: flex !important;
  }
  body.sidebar-open .app-sidebar[hidden] {
    display: flex !important;
  }
  .sidebar-toggle {
    display: inline-grid;
  }
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-hero,
  .dash-lower,
  .dash-metrics {
    grid-template-columns: 1fr;
  }
  .top-site-chip {
    max-width: 46vw;
  }
}

@media (max-width: 520px) {
  .flow-hub.deye-hub { max-width: 340px; }
  .kpi-card .value { font-size: 1.02rem; }
  .brand .dealer { display: none; }
}

body.body-login .app-sidebar,
body.body-login .sidebar-toggle,
body.body-login .mobile-nav,
body.body-login .top-site-chip {
  display: none !important;
}
body.body-login .app-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* ===== end Dashboard v1 ===== */

/* ---------- Adaptiv ladeplan (input-info) ---------- */
.adaptive-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.2rem 0 0.85rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(245, 197, 24, 0.04);
  font-size: 0.8rem;
  color: var(--cream);
}
.adaptive-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-right: 0.15rem;
}
.adaptive-sep {
  color: var(--muted);
  opacity: 0.6;
}

/* ---------- Daisy Assistent (floating button + panel) ---------- */
.ai-fab[hidden],
.ai-panel[hidden],
.ai-hint[hidden],
.ai-panel-foot[hidden],
.ai-fab-dot[hidden] {
  display: none !important;
}
body.has-ai-fab .view {
  padding-bottom: 6.5rem; /* keep last content clear of the button */
}
.ai-fab {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 60; /* above content/topbar/sidebar, below modals (80) */
  width: 62px;
  height: 62px;
  padding: 5px;
  border-radius: 50%;
  border: 1.5px solid rgba(245, 197, 24, 0.55);
  background: radial-gradient(circle at 50% 38%, #26303d 0%, #121820 72%);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(245, 197, 24, 0.07);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.ai-fab:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55), 0 0 18px rgba(245, 197, 24, 0.35);
}
.ai-fab:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.ai-fab.is-open {
  border-color: var(--accent);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(245, 197, 24, 0.22);
}
.ai-fab .ai-flower {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 5px rgba(245, 197, 24, 0.25));
}
.ai-fab-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(245, 197, 24, 0.7);
}
.ai-fab-dot.warn {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(240, 113, 120, 0.7);
}

/* Living flower: petals sway, pupils look around, eyelids blink (CSS only) */
.ai-flower .ai-petals {
  transform-box: view-box;
  transform-origin: 32px 32px;
  animation: ai-sway 7s ease-in-out infinite alternate;
}
.ai-flower .ai-pupil {
  animation: ai-look 11.3s ease-in-out infinite;
}
.ai-flower .ai-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: ai-blink 6.7s linear infinite;
}
.ai-flower.mini .ai-petals {
  animation: none;
}
@keyframes ai-sway {
  from { transform: rotate(-2.5deg); }
  to { transform: rotate(2.5deg); }
}
@keyframes ai-look {
  0%, 12% { transform: translate(0, 0); }
  15%, 27% { transform: translate(-1.3px, 0.1px); }
  30%, 36% { transform: translate(0, 0); }
  39%, 52% { transform: translate(1.3px, 0.25px); }
  55%, 60% { transform: translate(0, 0); }
  63%, 71% { transform: translate(0.3px, -1.2px); }
  74%, 80% { transform: translate(-0.9px, -0.8px); }
  83%, 100% { transform: translate(0, 0); }
}
@keyframes ai-blink {
  0%, 38% { transform: scaleY(1); }
  40% { transform: scaleY(0.08); }
  42%, 88% { transform: scaleY(1); }
  90% { transform: scaleY(0.08); }
  92% { transform: scaleY(1); }
  94% { transform: scaleY(0.08); }
  96%, 100% { transform: scaleY(1); }
}

.ai-hint {
  position: fixed;
  right: calc(18px + 62px + 12px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  max-width: 220px;
  padding: 0.5rem 0.75rem;
  border-radius: 12px 12px 4px 12px;
  background: var(--bg-elev);
  border: 1px solid rgba(245, 197, 24, 0.5);
  color: var(--petal);
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  animation: ai-pop 0.25s ease-out;
}
@keyframes ai-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.ai-panel {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + 62px + 12px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  width: min(410px, calc(100vw - 36px));
  max-height: min(75vh, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(245, 197, 24, 0.06), rgba(245, 197, 24, 0) 140px),
    var(--bg-card);
  border: 1px solid rgba(245, 197, 24, 0.32);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform-origin: bottom right;
  animation: ai-panel-in 0.22s ease-out;
}
@keyframes ai-panel-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.ai-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-panel-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.ai-panel-title .ai-flower {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.ai-panel-title h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.ai-panel-close {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.ai-panel-close:hover,
.ai-panel-close:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}
.ai-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.9rem 1rem 1rem;
}
.ai-panel-foot {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 0.65rem 1rem 0.7rem;
  background: var(--bg-card);
}
.ai-disabled {
  margin: 0.25rem 0;
}
.ai-status-god {
  background: rgba(95, 184, 120, 0.18);
  color: var(--leaf);
}
.ai-status-ok {
  background: rgba(245, 197, 24, 0.14);
  color: var(--accent);
}
.ai-status-warn {
  background: rgba(240, 113, 120, 0.15);
  color: var(--danger);
}
.ai-summary {
  font-size: 0.93rem;
  line-height: 1.5;
  color: var(--text);
}
.ai-meta {
  font-size: 0.75rem;
  margin-top: 0.35rem;
}
.ai-sugg {
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}
.ai-sugg li {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  background: var(--bg-elev);
}
.ai-sugg-type {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.ai-sugg-title {
  font-weight: 600;
  margin: 0.15rem 0 0.2rem;
}
.ai-sugg-why {
  font-size: 0.82rem;
  line-height: 1.4;
}
.ai-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.85rem;
}
.ai-actions .toast {
  margin-top: 0;
}
.ai-chat {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}
.ai-chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.ai-chat-empty {
  font-size: 0.85rem;
  margin: 0;
}
.ai-msg {
  max-width: 88%;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ai-msg-user {
  align-self: flex-end;
  background: rgba(245, 197, 24, 0.14);
  color: var(--petal);
  border-bottom-right-radius: 3px;
}
.ai-msg-bot {
  align-self: flex-start;
  background: var(--bg-soft);
  color: var(--text);
  border-bottom-left-radius: 3px;
}
.ai-chat-form {
  display: flex;
  gap: 0.5rem;
}
.ai-chat-form input {
  flex: 1;
  min-width: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.5rem 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
}
.ai-chat-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.ai-chat-form input:disabled,
.ai-chat-form .btn:disabled,
.ai-actions .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ai-quota {
  font-size: 0.72rem;
  margin-top: 0.4rem;
}

@media (max-width: 899px) {
  body.sidebar-open .ai-fab,
  body.sidebar-open .ai-hint {
    display: none !important;
  }
}

/* Mobile: full-screen sheet */
@media (max-width: 640px) {
  .ai-fab {
    width: 56px;
    height: 56px;
    right: calc(14px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .ai-hint {
    right: calc(14px + 56px + 10px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + 12px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 110px);
  }
  .ai-panel {
    inset: 0;
    width: 100%;
    max-height: none;
    height: 100%;
    height: 100dvh;
    border: none;
    border-radius: 0;
    transform-origin: bottom center;
    animation-name: ai-sheet-in;
  }
  .ai-panel-head {
    padding-top: calc(0.7rem + env(safe-area-inset-top, 0px));
    padding-left: calc(1rem + env(safe-area-inset-left, 0px));
    padding-right: calc(0.8rem + env(safe-area-inset-right, 0px));
  }
  .ai-panel-foot {
    padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
  }
  body.ai-panel-open {
    overflow: hidden;
  }
  body.ai-panel-open .ai-fab,
  body.ai-panel-open .ai-hint {
    display: none !important;
  }
  .ai-msg {
    max-width: 95%;
  }
  .ai-chat-form input {
    font-size: 16px; /* avoid iOS zoom on focus */
  }
}
@keyframes ai-sheet-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-flower *,
  .ai-fab,
  .ai-hint,
  .ai-panel {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Topbar fit on small screens (360–414 px) ---------- */
@media (max-width: 640px) {
  .topbar {
    padding: 0.55rem 0.7rem;
    gap: 0.5rem;
  }
  .brand {
    flex-wrap: nowrap;
    min-width: 0;
    flex: 1 1 auto;
    gap: 0.45rem;
  }
  .top-site-chip {
    min-width: 0;
    max-width: none;
    flex: 0 1 auto;
    margin-left: 0;
  }
  .top-site-chip .badge {
    flex-shrink: 0;
  }
  .topbar-meta {
    flex: 0 0 auto;
    gap: 0.4rem;
  }
  .topbar-meta .clock {
    display: none;
  }
  .user-bar {
    gap: 0.4rem;
  }
  /* Only avatar initials; name stays available to screen readers + tooltip */
  .user-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  #logout-btn {
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }
}
@media (max-width: 480px) {
  .logo-top .logo-text {
    display: none;
  }
}

/* v0.3.5 — savings headline + price components */
.econ-headline {
  padding: 0.35rem 0 0.6rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.econ-headline-main {
  font-size: 1rem;
  color: var(--text);
}
.econ-headline-main strong {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  color: #7dcea0;
}
.econ-headline-sub {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.price-components {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.price-components summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}
.price-components ul {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
}
.price-components li {
  padding: 0.15rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  overflow-wrap: anywhere;
}
.price-components .pc-val {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin: 0 0.35rem;
}
.price-components .pc-warn {
  color: #f0c36b;
}
.price-components .pc-formula,
.price-components .pc-sell {
  margin-top: 0.3rem;
}


/* ===== v0.3.6 Elaftale (supplier contract) ===== */
.elaftale-card {
  margin: 0 0 0.9rem;
  padding: 0.85rem 1rem 0.9rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.elaftale-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.elaftale-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.elaftale-form .settings-grid { gap: 0.85rem 1.25rem; }
.elaftale-markup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.elaftale-markup-row input[type="text"] {
  width: 8rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--cream);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.elaftale-form .elaftale-fee input[type="text"] { max-width: 8rem; }
.elaftale-readonly {
  font-weight: 600;
  color: var(--text);
  padding: 0.45rem 0;
}
.elaftale-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--cream);
  cursor: pointer;
}
.elaftale-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--leaf); }
.elaftale-fee { margin-top: 0.55rem; }
.elaftale-help {
  margin: 0.8rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.elaftale-reminder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  background: rgba(95, 184, 120, 0.1);
  border: 1px solid rgba(95, 184, 120, 0.3);
  color: var(--cream);
  font-size: 0.84rem;
}
.elaftale-reminder.soft { margin-bottom: 0.7rem; }
.linkish {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--leaf);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.price-components .pc-hint { color: #9ec8a8; }
[hidden].elaftale-other, [hidden].elaftale-fee { display: none !important; }
/* ===== end Elaftale ===== */

/* ===== v0.3.7 Inverterindstillinger (admin / forhandler) ===== */
.inv-panel[hidden],
.inv-backdrop[hidden],
.inv-confirm-wrap[hidden] {
  display: none !important;
}
.flow-hub .slot.hub-clickable {
  cursor: pointer;
  border-radius: 16px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.flow-hub .slot.hub-clickable .flow-icon.hub {
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.flow-hub .slot.hub-clickable:hover .flow-icon.hub,
.flow-hub .slot.hub-clickable:focus-visible .flow-icon.hub,
.flow-hub .slot.hub-clickable[aria-expanded="true"] .flow-icon.hub {
  transform: translateY(-2px) scale(1.04);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.28), 0 0 28px rgba(245, 197, 24, 0.3);
}
.flow-hub .slot.hub-clickable:focus-visible .flow-slot-label {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.flow-hub .slot.hub-clickable .flow-slot-sub {
  color: var(--accent);
  font-weight: 600;
}
.hub-gear {
  position: absolute;
  right: -7px;
  top: -7px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  color: #1a1400;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.inv-backdrop {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(6, 9, 13, 0.55);
  backdrop-filter: blur(2px);
  animation: inv-fade 0.2s ease-out;
}
@keyframes inv-fade { from { opacity: 0; } to { opacity: 1; } }
.inv-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 76;
  width: min(500px, 100vw);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(245, 197, 24, 0.07), rgba(245, 197, 24, 0) 180px),
    var(--bg-card);
  border-left: 1px solid rgba(245, 197, 24, 0.32);
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.55);
  animation: inv-slide-in 0.24s ease-out;
}
@keyframes inv-slide-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.inv-panel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: calc(0.7rem + env(safe-area-inset-top, 0px)) 0.8rem 0.7rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.inv-panel-head h2 {
  margin: 0;
  flex: 1 1 auto;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--accent);
}
.inv-grab { display: none; }
.inv-icon-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.inv-icon-btn:hover,
.inv-icon-btn:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}
.inv-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
}
.inv-hero {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: radial-gradient(circle at 22% 45%, rgba(245, 197, 24, 0.13), rgba(26, 34, 44, 0) 62%), var(--bg-elev);
}
.inv-hero-img {
  height: 150px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, #f4f1ea 0%, #d9d5cc 70%, #bdb8ae 100%);
  overflow: hidden;
}
.inv-hero-img.generic { background: radial-gradient(circle at 50% 40%, #2a3544, #161c24); }
.inv-hero-img img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}
.inv-maker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.inv-model {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0.1rem 0 0.4rem;
  word-break: break-word;
}
.inv-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.inv-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.7rem;
  margin: 0;
  font-size: 0.82rem;
}
.inv-facts dt { color: var(--muted); }
.inv-facts dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-word; }
.inv-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  color: var(--muted);
}
.inv-badge.daisy {
  color: var(--accent);
  border-color: rgba(245, 197, 24, 0.5);
  background: rgba(245, 197, 24, 0.1);
}
.inv-badge.res-ok { color: var(--leaf); border-color: rgba(95, 184, 120, 0.5); }
.inv-badge.res-mismatch,
.inv-badge.res-error { color: var(--danger); border-color: rgba(240, 113, 120, 0.5); }
.inv-group { margin-top: 1.1rem; }
.inv-group h3 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.invs-row {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  margin-bottom: 0.5rem;
}
.invs-row.state-writable { border-color: #34465a; }
.inv-row-head { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.inv-label { font-weight: 600; font-size: 0.9rem; flex: 1 1 auto; }
.inv-reg {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: help;
}
.inv-val { margin-top: 0.2rem; font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--text); }
.inv-edit { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.inv-edit select,
.inv-edit input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.42rem 0.55rem;
  font: inherit;
  font-size: 0.9rem;
  min-height: 38px;
}
.inv-edit select:focus-visible,
.inv-edit input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.inv-num { display: inline-flex; align-items: center; gap: 0.3rem; }
.inv-num input { width: 7.5rem; }
.inv-unit, .inv-range { color: var(--muted); font-size: 0.8rem; }
.inv-save { min-height: 38px; }
.inv-hint, .inv-note { margin: 0.45rem 0 0; font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.inv-note { color: #d8c27a; }
.inv-result {
  margin-top: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 9px;
  font-size: 0.82rem;
  line-height: 1.35;
}
.inv-result.ok { background: rgba(95, 184, 120, 0.14); color: #9be0b0; border: 1px solid rgba(95, 184, 120, 0.4); }
.inv-result.bad { background: rgba(240, 113, 120, 0.12); color: #ffb3b8; border: 1px solid rgba(240, 113, 120, 0.45); }
.inv-result.muted { background: var(--bg-soft); color: var(--muted); }
.inv-faults {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.86rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.inv-faults.bad { border-color: rgba(240, 113, 120, 0.5); }
.inv-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.inv-dot.ok { background: var(--leaf); box-shadow: 0 0 8px rgba(95, 184, 120, 0.7); }
.inv-dot.bad { background: var(--danger); box-shadow: 0 0 8px rgba(240, 113, 120, 0.7); }
.inv-code {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  background: rgba(240, 113, 120, 0.15);
  color: #ffb3b8;
}
.inv-small { font-size: 0.78rem; }
.inv-info-banner {
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.88rem;
}
.inv-tou-wrap { overflow-x: auto; margin-top: 0.4rem; }
.inv-tou { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.inv-tou th, .inv-tou td { padding: 0.25rem 0.4rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.inv-tou th { color: var(--muted); font-weight: 600; }
.inv-tou td.num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-audit { list-style: none; margin: 0; padding: 0; }
.inv-audit li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.84rem; }
.inv-audit li:last-child { border-bottom: none; }
.inv-audit-top { display: flex; justify-content: space-between; gap: 0.5rem; color: var(--muted); font-size: 0.76rem; }
.inv-foot-note { margin-top: 1.2rem; font-size: 0.74rem; color: var(--muted); line-height: 1.45; }
.inv-loading { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); padding: 1.2rem 0.2rem; }
.inv-loading.slim { padding: 0.2rem 0 0.6rem; font-size: 0.82rem; }
.inv-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: inv-spin 0.8s linear infinite;
}
@keyframes inv-spin { to { transform: rotate(360deg); } }
.inv-confirm-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(6, 9, 13, 0.62);
}
.inv-confirm {
  width: min(380px, 100%);
  padding: 1.1rem 1.1rem 1rem;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid rgba(245, 197, 24, 0.45);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}
.inv-confirm h3 { margin: 0 0 0.4rem; color: var(--accent); font-size: 1rem; }
.inv-confirm p { margin: 0.3rem 0; }
.inv-oldnew {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.7rem 0;
  padding: 0.7rem;
  border-radius: 10px;
  background: var(--bg-elev);
  font-weight: 700;
}
.inv-oldnew .old { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.inv-oldnew .arrow { color: var(--accent); }
.inv-oldnew .new { color: var(--text); }
.inv-confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.8rem; }
body.inv-panel-open .ai-hint { display: none !important; }

/* Mobile: bottom sheet */
@media (max-width: 640px) {
  .inv-panel {
    top: auto;
    left: 0;
    width: 100%;
    height: 92vh;
    height: 92dvh;
    border-left: none;
    border-top: 1px solid rgba(245, 197, 24, 0.35);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.6);
    animation-name: inv-sheet-in;
  }
  .inv-panel-head { position: relative; padding-top: 1.1rem; }
  .inv-grab {
    display: block;
    position: absolute;
    top: 6px;
    left: 50%;
    width: 42px;
    height: 4px;
    margin-left: -21px;
    border-radius: 4px;
    background: var(--border);
  }
  .inv-hero { grid-template-columns: 96px 1fr; gap: 0.75rem; padding: 0.7rem; }
  .inv-hero-img { height: 118px; }
  .inv-edit select, .inv-edit input { font-size: 16px; } /* no iOS zoom */
  .inv-edit select { flex: 1 1 100%; }
  body.inv-panel-open { overflow: hidden; }
  body.inv-panel-open .ai-fab { display: none !important; }
}
@keyframes inv-sheet-in {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .inv-panel, .inv-backdrop, .inv-spinner, .flow-hub .slot.hub-clickable .flow-icon.hub {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== v0.3.8 Daisy-styring: pause, hurtige handlinger, TOU-editor ===== */
.inv-pause-card {
  margin: 0 0 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.inv-pause-card.active { border-color: rgba(95, 184, 120, 0.45); background: linear-gradient(180deg, rgba(95, 184, 120, 0.1), var(--bg-elev)); }
.inv-pause-card.paused { border-color: rgba(255, 159, 67, 0.7); background: linear-gradient(180deg, rgba(255, 159, 67, 0.16), var(--bg-elev)); box-shadow: 0 0 0 1px rgba(255, 159, 67, 0.18); }
.inv-pause-card.paused.unlimited { border-color: rgba(240, 113, 120, 0.8); }
.inv-pause-card.off { border-style: dashed; }
.inv-pause-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.inv-pause-txt { flex: 1 1 180px; min-width: 0; }
.inv-pause-txt h3 { margin: 0; font-size: 1rem; }
.inv-pause-txt p { margin: 0.15rem 0 0; }
.inv-pause-card.paused h3 { color: #ffb570; }
.inv-pause-until { font-weight: 700; font-size: 1.05rem; margin-top: 0.1rem; font-variant-numeric: tabular-nums; }
.inv-pause-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }
.inv-pause-dot.active { background: var(--leaf); box-shadow: 0 0 0 4px rgba(95, 184, 120, 0.2); }
.inv-pause-dot.paused { background: #ff9f43; box-shadow: 0 0 0 4px rgba(255, 159, 67, 0.25); animation: pause-pulse 2s ease-in-out infinite; }
@keyframes pause-pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 159, 67, 0.08); } }
@media (prefers-reduced-motion: reduce) { .inv-pause-dot.paused { animation: none; } }
.inv-pause-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.8rem; margin: 0.6rem 0 0.2rem; font-size: 0.84rem; }
.inv-pause-facts dt { color: var(--muted); }
.inv-pause-facts dd { margin: 0; overflow-wrap: anywhere; }
.btn.btn-warn { background: #ff9f43; color: #1f1200; }
.btn.inv-resume-btn { background: var(--leaf); color: #06140b; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.inv-warn {
  margin: 0.55rem 0;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  font-size: 0.84rem;
  color: #ffc9cc;
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.5);
}
.inv-pause-form { margin-top: 0.7rem; }
.inv-pause-form fieldset { border: 0; padding: 0; margin: 0; }
.inv-pause-form legend { font-weight: 700; font-size: 0.86rem; margin-bottom: 0.35rem; }
.inv-dur-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.inv-dur {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 0.65rem; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-card); font-size: 0.88rem;
}
.inv-dur.on { border-color: #ff9f43; box-shadow: 0 0 0 2px rgba(255, 159, 67, 0.3); }
.inv-dur.warn span::after { content: " ⚠"; color: var(--danger); }
.inv-dur input { accent-color: #ff9f43; }
.inv-ack { display: flex; gap: 0.45rem; align-items: flex-start; margin-top: 0.45rem; font-size: 0.84rem; cursor: pointer; }
.inv-reason { display: grid; gap: 0.25rem; margin-top: 0.6rem; font-size: 0.84rem; color: var(--muted); }
.inv-reason input {
  width: 100%; box-sizing: border-box; padding: 0.5rem 0.6rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit;
}
.inv-badge.paused { color: #ffb570; border-color: rgba(255, 159, 67, 0.55); }
.inv-note.paused { color: #ffb570; }

.inv-actions-locked p { margin: 0.2rem 0; }
.inv-act-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
.inv-act { border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); overflow: hidden; }
.inv-act-btn {
  display: grid; gap: 0.2rem; width: 100%; text-align: left; cursor: pointer;
  padding: 0.6rem 0.7rem; border: 0; background: transparent; color: var(--text); font: inherit;
}
.inv-act-btn:hover, .inv-act-btn:focus-visible { background: var(--bg-soft); outline: none; }
.inv-act-label { font-weight: 700; font-size: 0.9rem; }
.inv-act-desc { font-size: 0.76rem; color: var(--muted); line-height: 1.3; }
.inv-act.tone-charge { border-left: 3px solid var(--leaf); }
.inv-act.tone-stop { border-left: 3px solid var(--danger); }
.inv-act.tone-reset { border-left: 3px solid var(--info); }
.inv-act.tone-normal { border-left: 3px solid var(--accent); }
.inv-act-param { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; padding: 0 0.7rem 0.6rem; }
.inv-act-param input[type="range"] { flex: 1 1 110px; accent-color: var(--accent); }
.inv-act-pv { min-width: 3.2em; font-weight: 700; }

.inv-tou-edit { margin-top: 0.4rem; }
.inv-tou.editable input[type="text"],
.inv-tou.editable input[type="number"] {
  width: 100%; min-width: 4.6em; box-sizing: border-box; padding: 0.3rem 0.35rem;
  border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit;
  font-variant-numeric: tabular-nums;
}
.inv-tou.editable td.c { text-align: center; }
.inv-tou.editable input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

.inv-confirm.wide { width: min(460px, 100%); max-height: calc(100% - 2rem); overflow-y: auto; }
.inv-chg { list-style: none; margin: 0.5rem 0; padding: 0; display: grid; gap: 0.35rem; }
.inv-chg li { font-size: 0.84rem; }
.inv-oldnew.sm { justify-content: flex-start; margin: 0.2rem 0 0; padding: 0.35rem 0.55rem; font-size: 0.82rem; }
.inv-regs { margin: 0.4rem 0; font-size: 0.8rem; }
.inv-regs summary { cursor: pointer; color: var(--muted); }
.inv-regtab { width: 100%; border-collapse: collapse; margin-top: 0.3rem; }
.inv-regtab th, .inv-regtab td { padding: 0.15rem 0.4rem; border-bottom: 1px solid var(--border); text-align: right; }
.inv-regtab th { color: var(--muted); font-weight: 600; }

/* Status chip in Energiflow header + topbar badge */
.pause-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--muted); white-space: nowrap;
}
.pause-chip[data-pause-chip] { cursor: pointer; }
.pause-chip[data-pause-chip]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pause-chip.active { color: var(--leaf); border-color: rgba(95, 184, 120, 0.45); }
.pause-chip.paused { color: #ffb570; border-color: rgba(255, 159, 67, 0.6); background: rgba(255, 159, 67, 0.12); }
.pause-chip.calm { white-space: normal; font-weight: 600; color: var(--cream); border-color: var(--border); background: var(--bg-soft); }
.pause-chip.off { color: var(--muted); border-style: dashed; }
.badge.badge-pause { background: rgba(255, 159, 67, 0.18); color: #ffb570; border: 1px solid rgba(255, 159, 67, 0.5); margin-left: 0.3rem; }
.badge.badge-ctrl-off { background: var(--bg-soft); color: var(--muted); margin-left: 0.3rem; }
#top-site-pause[hidden] { display: none !important; }
.pause-calm {
  display: flex; align-items: center; gap: 0.55rem;
  margin: 0 0 0.9rem; padding: 0.65rem 0.85rem; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--cream); font-size: 0.9rem;
}
.pause-calm-ico { color: #ffb570; }
.plan-paused-banner {
  margin: 0.5rem 0 0.7rem; padding: 0.55rem 0.75rem; border-radius: 10px; font-size: 0.86rem; font-weight: 600;
  color: #ffb570; background: rgba(255, 159, 67, 0.1); border: 1px solid rgba(255, 159, 67, 0.45);
}
@media (max-width: 640px) {
  .inv-act-grid { grid-template-columns: 1fr; }
  .inv-dur-grid { grid-template-columns: 1fr 1fr; }
  .flow-hub-card .section-title { flex-wrap: wrap; gap: 0.35rem; }
}

/* ===== v0.3.9 Dashboard: i-dag, plan-hint, donut, grafer, Økonomi ===== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.flow-hub.deye-hub { margin-bottom: 4.1rem; }
.flow-today {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.02rem;
  margin-top: 0.12rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: rgba(26, 34, 44, 0.92);
  font-size: 0.66rem;
  line-height: 1.25;
  color: var(--cream);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  z-index: 4;
}
.flow-today span { display: block; }
.flow-today .flow-elec { color: #8fd3a6; font-weight: 600; }
.flow-hub.deye-hub .slot.pv .flow-today { margin-top: 0.05rem; }
.plan-hint {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0.25rem 0 0.35rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(245, 197, 24, 0.28);
  border-radius: 10px;
  background: rgba(245, 197, 24, 0.07);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}
.plan-hint:hover { background: rgba(245, 197, 24, 0.13); }
.plan-hint:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-hint-ico { font-size: 1rem; flex: 0 0 auto; width: 1.3rem; text-align: center; }
.plan-hint-text { flex: 1 1 auto; }
.plan-hint-go { flex: 0 0 auto; color: var(--accent); font-weight: 600; font-size: 0.78rem; white-space: nowrap; }
.plan-hint-adv {
  display: inline-block; margin-left: 0.3rem; padding: 0 0.4rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); font-size: 0.7rem;
}
.plan-hint-pause { border-color: rgba(255, 159, 67, 0.45); background: rgba(255, 159, 67, 0.1); }
.plan-hint-pause .plan-hint-go { color: #ffb570; }
.plan-hint-charge .plan-hint-ico { color: var(--info); }
.plan-hint-solar .plan-hint-ico { color: var(--accent); }
.plan-hint-discharge .plan-hint-ico,
.plan-hint-hold .plan-hint-ico { color: var(--leaf); }
.energy-section.plan-flash { animation: planFlash 1.6s ease-out 2; }
@keyframes planFlash {
  0% { box-shadow: 0 0 0 0 rgba(245, 197, 24, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(245, 197, 24, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .energy-section.plan-flash { animation: none; outline: 2px solid var(--accent); }
}

/* segmented buttons */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.seg-btn {
  appearance: none; border: 1px solid var(--border); background: var(--bg-soft); color: var(--muted);
  padding: 0.22rem 0.6rem; border-radius: 999px; font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { color: var(--accent); border-color: rgba(245, 197, 24, 0.45); background: rgba(245, 197, 24, 0.12); }
.seg-btn:focus-visible, .gc-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.empty-state {
  display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start;
  padding: 0.9rem 1rem; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: 0.85rem;
}
.empty-state strong { color: var(--cream); font-size: 0.95rem; }

/* donut */
.donut-card .section-title { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; margin-top: 0.4rem; }
.donut { position: relative; width: 170px; height: 170px; }
.donut-svg { width: 100%; height: 100%; }
.donut-own { stroke: var(--leaf); stroke-linecap: butt; }
.donut-bought { stroke: var(--grid); opacity: 0.85; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-pct { font-size: 1.6rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.donut-lbl { font-size: 0.72rem; color: var(--muted); }
.donut-legend { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 0.35rem; font-size: 0.82rem; }
.donut-legend li { display: grid; grid-template-columns: 12px 1fr auto auto; align-items: center; gap: 0.45rem; }
.donut-legend li i { width: 12px; height: 12px; border-radius: 3px; }
.donut-legend .dl-own { background: var(--leaf); }
.donut-legend .dl-bought { background: var(--grid); }
.donut-legend b { font-variant-numeric: tabular-nums; font-weight: 600; }
.donut-legend em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: right; }
.donut-legend small { color: var(--muted); }
.donut-legend .dl-total { grid-template-columns: 1fr auto; border-top: 1px solid var(--border); padding-top: 0.35rem; color: var(--muted); }

/* graph cards */
.graphs-section { margin: 0.4rem 0 0.9rem; }
.graphs-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.55rem; }
.graphs-head h2.section-title { margin: 0; font-size: 1rem; }
.graphs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.graph-card { padding-bottom: 0.7rem; min-width: 0; }
.gc-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.gc-title { font-weight: 700; color: var(--cream); font-size: 0.92rem; }
.gc-tabs { display: inline-flex; flex-wrap: wrap; gap: 0.2rem; }
.gc-tab {
  appearance: none; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted);
  padding: 0.2rem 0.45rem; font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer;
}
.gc-tab:hover { color: var(--text); }
.gc-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.gc-canvas { display: block; width: 100%; height: 200px; touch-action: pan-y; }
.gc-foot { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.3rem; font-size: 0.72rem; }
.gc-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.75rem; color: var(--muted); font-size: 0.74rem; }
.gc-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 0.3rem; vertical-align: 3px; }
.gc-legend i.dash { background: repeating-linear-gradient(90deg, #f5c518 0 4px, transparent 4px 7px) !important; }
.gc-readout { color: var(--cream); min-height: 1em; }

/* Økonomi */
.econ-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 0.9rem; }
.econ-kpi { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.econ-kpi .label { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.econ-kpi .value { font-size: 1.35rem; font-weight: 700; color: var(--leaf); font-variant-numeric: tabular-nums; }
.econ-kpi .value.neg { color: var(--danger); }
.econ-kpi .sub { font-size: 0.74rem; color: var(--muted); }
.econ-invest .value, .econ-roi .value { color: var(--cream); }
.econ-invest .econ-edit { align-self: flex-start; margin-top: 0.3rem; }
.econ-invest.editing { grid-column: span 2; }
.econ-invest-form { display: grid; gap: 0.5rem; }
.econ-invest-form label { display: grid; gap: 0.2rem; font-size: 0.78rem; color: var(--muted); }
.econ-invest-form input, .econ-invest-form select {
  font: inherit; font-size: 0.9rem; padding: 0.4rem 0.5rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
}
.econ-invest-actions { display: flex; gap: 0.4rem; }
.econ-progress { height: 6px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin-top: 0.35rem; }
.econ-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf-dim), var(--leaf)); }
.econ-charts { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 0.9rem; margin-bottom: 0.9rem; }
.econ-charts canvas { display: block; width: 100%; }
.econ-charts .section-title { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
#econ-cum { height: 240px; }
#econ-week { height: 220px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.econ-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.econ-table th, .econ-table td { padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--border); text-align: left; }
.econ-table th { color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; }
.econ-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.econ-table td.neg { color: var(--danger); }
.econ-table td.pct-good { color: #0e1218; background: rgba(95, 184, 120, 0.85); font-weight: 700; }
.econ-table td.pct-bad { color: #fff; background: rgba(240, 113, 120, 0.7); font-weight: 700; }
.econ-status { display: inline-block; font-size: 0.68rem; padding: 0 0.4rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.econ-status.st-ufuldstændig { border-color: rgba(255, 159, 67, 0.55); color: #ffb570; }
.econ-status.st-i_gang { border-color: rgba(92, 200, 255, 0.5); color: var(--info); }
.econ-status.st-recon { border-style: dashed; }
.econ-method summary { cursor: pointer; font-weight: 600; color: var(--cream); }
.econ-method p, .econ-method li { font-size: 0.84rem; color: var(--muted); }
.econ-empty { margin-bottom: 0.9rem; }

@media (max-width: 1280px) {
  .econ-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .graphs-grid, .econ-charts { grid-template-columns: 1fr; }
  .econ-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .econ-invest.editing { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .flow-today { font-size: 0.6rem; padding: 0.05rem 0.3rem; }
  .flow-hub.deye-hub { margin-bottom: 4rem; }
  .plan-hint { font-size: 0.8rem; flex-wrap: wrap; align-items: flex-start; }
  .plan-hint-text { flex: 1 1 0; min-width: 0; }
  .plan-hint-go { flex-basis: 100%; margin-left: 1.85rem; }
  .econ-kpi .value { font-size: 1.1rem; }
  .donut { width: 150px; height: 150px; }
}

/* v0.3.9.2 — calm note when register values and energy balance disagree
   (plant switching mode). Deliberately low-key: no warning colours. */
.flow-settling {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.35rem auto 0;
  padding: 0.25rem 0.7rem;
  width: fit-content;
  max-width: 100%;
  font-size: 0.76rem;
  line-height: 1.3;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  text-align: center;
}
.flow-settling-dot {
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--info);
  opacity: 0.8;
  animation: flow-settling-pulse 1.8s ease-in-out infinite;
}
@keyframes flow-settling-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-settling-dot { animation: none; }
}


/* ===== v0.3.10 Daisy fee / Din gevinst ===== */
.econ-hero-win {
  text-align: center;
  padding: 1.1rem 1rem 1rem;
  margin-bottom: 0.9rem;
  background: linear-gradient(160deg, rgba(95,184,120,0.14), rgba(22,28,36,0.4));
  border: 1px solid rgba(95,184,120,0.28);
}
.econ-hero-label {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.econ-hero-value {
  font-size: 2.15rem;
  font-weight: 750;
  color: #5fb878;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin: 0.15rem 0;
}
.econ-hero-sub { font-size: 0.88rem; color: var(--muted); }
.econ-hero-andel {
  margin-top: 0.55rem;
  font-size: 0.72rem;
  opacity: 0.75;
  letter-spacing: 0.01em;
}
.badge-andel {
  background: rgba(95,184,120,0.12);
  color: #9fd6ae;
  border: 1px solid rgba(95,184,120,0.28);
  font-weight: 500;
}
.econ-subscription summary,
.econ-fee-admin summary {
  cursor: pointer;
  font-weight: 600;
}
.econ-sub-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.9rem;
  align-items: baseline;
}
.econ-sub-row:last-of-type { border-bottom: 0; }
.kpi-card.kpi-win {
  border-color: rgba(95, 184, 120, 0.35);
  background: linear-gradient(135deg, rgba(95, 184, 120, 0.08), var(--bg-card) 55%);
}
.kpi-card.kpi-win .value { color: var(--leaf); }
.kpi-card.kpi-win .kpi-ico { color: var(--leaf); }
.kpi-card.kpi-win .kpi-ico.soc { background: rgba(245, 197, 24, 0.12); color: var(--accent); }

/* ===== v0.3.11.1 durable quarter proof log with six-year retention ===== */
.econ-quarter-log .section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.econ-day-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.econ-day-pick input[type="date"] {
  background: var(--card-2, #1a222c);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem 0.45rem;
  font: inherit;
}
.econ-quarter-table { font-size: 0.82rem; }
.econ-quarter-table th, .econ-quarter-table td { white-space: nowrap; }

/* ===== v0.3.11.1 retention release; phase C: zoomable documentation chart ===== */
.qchart-wrap {
  margin: 0.75rem 0 1.1rem;
  background: linear-gradient(180deg, rgba(245, 197, 24, 0.04), transparent 40%),
    var(--bg-elev, #161c24);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem 0.5rem;
}
.qchart-wrap canvas {
  display: block;
  width: 100%;
  height: 300px;
  cursor: grab;
  border-radius: 8px;
  touch-action: none;
}
.qchart-wrap canvas.qchart-dragging { cursor: grabbing; }
.qchart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  margin-bottom: 0.45rem;
}
.qchart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
}
.qchart-tog {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.qchart-tog input { accent-color: var(--accent); }
.qchart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.35rem 0 0.15rem;
}
.qchart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.qchart-legend i {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.econ-quarter-log .qchart-wrap + #econ-quarter-body {
  margin-top: 0.35rem;
}


/* ===== v0.3.18 Din gevinst = hele anlægget (Sparet | Tjent | Sol) + bevislog ===== */
.econ-hero-value.neg { color: var(--danger); }
.econ-hero-parts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.75rem auto 0;
  max-width: 30rem;
}
.econ-hero-part {
  flex: 1 1 0;
  min-width: 6.5rem;
  padding: 0.15rem 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.econ-hero-part + .econ-hero-part { border-left: 1px solid rgba(255, 255, 255, 0.09); }
.econ-part-label {
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.econ-part-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.econ-part-value.neg { color: var(--danger); }
.econ-gain-kpi .econ-kpi-parts,
.kpi-card .kpi-win-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.econ-gain-kpi .econ-kpi-parts { margin: 0.15rem 0 0.2rem; }
.econ-kpi-parts .dot,
.kpi-win-parts .dot { opacity: 0.5; }
.econ-sub-val {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 500;
}
.econ-sub-rates {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.8;
}
.econ-proof .section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}
.econ-proof-status {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}
.econ-proof-status.ok::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--leaf);
  vertical-align: 1px;
}
.econ-proof-status.warn { color: var(--danger); }
.econ-proof-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 0.9rem;
  margin-top: 0.6rem;
}
.econ-proof-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.econ-proof-form input[type="date"],
.econ-proof-form select {
  background: var(--card-2, #1a222c);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.88rem;
}
.econ-proof-form .btn { margin-left: auto; }
.econ-proof .toast { margin-top: 0.6rem; }
.econ-proof-foot { margin-top: 0.5rem; font-size: 0.76rem; }
@media (max-width: 560px) {
  .econ-proof-form .btn { margin-left: 0; width: 100%; }
  .econ-hero-part { padding: 0.15rem 0.5rem; min-width: 5.5rem; }
}

/* ===== v0.3.19 Inverterens batterigrænser (Batt Low / Shutdown / Batt Mode) ===== */
.lim-card {
  margin: 0 0 0.9rem; padding: 0.85rem 1rem 0.9rem; border-radius: var(--radius-lg, 16px);
  background: linear-gradient(180deg, rgba(245, 197, 24, 0.07), rgba(245, 197, 24, 0.025)), var(--bg-card);
  border: 1px solid rgba(245, 197, 24, 0.32); color: var(--text);
}
.lim-card.crit {
  background: linear-gradient(180deg, rgba(240, 113, 120, 0.08), rgba(240, 113, 120, 0.025)), var(--bg-card);
  border-color: rgba(240, 113, 120, 0.42);
}
.lim-head { display: flex; align-items: flex-start; gap: 0.65rem; }
.lim-ico {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  color: var(--accent); background: rgba(245, 197, 24, 0.12);
}
.lim-card.crit .lim-ico { color: var(--danger); background: rgba(240, 113, 120, 0.12); }
.lim-title { font-weight: 650; font-size: 0.98rem; color: var(--petal); }
.lim-sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; }
.lim-list { list-style: none; margin: 0.65rem 0 0; padding: 0 0 0 calc(32px + 0.65rem); display: grid; gap: 0.55rem; }
.lim-item-title { font-size: 0.86rem; font-weight: 600; color: var(--cream); }
.lim-item-text { font-size: 0.92rem; line-height: 1.45; }
.lim-item-detail { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; line-height: 1.4; }
.lim-actions { margin-top: 0.75rem; padding-left: calc(32px + 0.65rem); }
.lim-open { white-space: normal; text-align: left; }
.lim-floor { color: var(--accent); font-size: 0.82em; font-weight: 600; }
.lim-calm-ico { color: var(--leaf); }
@media (max-width: 640px) {
  .lim-list, .lim-actions { padding-left: 0; }
  .lim-open { width: 100%; text-align: center; }
}
/* settings panel: highlighted field with the recommended value */
.invs-row.has-advice { border-color: rgba(245, 197, 24, 0.45); box-shadow: inset 3px 0 0 var(--accent); }
.inv-advice {
  margin: 0.45rem 0 0.35rem; padding: 0.5rem 0.65rem; border-radius: 10px; font-size: 0.86rem; line-height: 1.45;
  background: rgba(245, 197, 24, 0.08); border: 1px solid rgba(245, 197, 24, 0.28); color: var(--text);
}
.inv-advice.critical { background: rgba(240, 113, 120, 0.08); border-color: rgba(240, 113, 120, 0.35); }
.inv-advice-rec { margin-top: 0.35rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.inv-advice-rec strong { color: var(--accent); }
.invs-row.inv-row-flash { animation: invFlash 2.2s ease-out 1; }
@keyframes invFlash {
  0% { box-shadow: inset 3px 0 0 var(--accent), 0 0 0 3px rgba(245, 197, 24, 0.55); }
  100% { box-shadow: inset 3px 0 0 var(--accent), 0 0 0 0 rgba(245, 197, 24, 0); }
}
@media (prefers-reduced-motion: reduce) { .invs-row.inv-row-flash { animation: none; } }
/* onboarding check step */
.ob-limits { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 0.88rem; line-height: 1.45;
  background: rgba(95, 184, 120, 0.08); border: 1px solid rgba(95, 184, 120, 0.3); }
.ob-limits.warn { background: rgba(245, 197, 24, 0.08); border-color: rgba(245, 197, 24, 0.35); }
.ob-limits.crit { background: rgba(240, 113, 120, 0.08); border-color: rgba(240, 113, 120, 0.4); }
.ob-limits h4 { margin: 0 0 4px; font-size: 0.9rem; }
.ob-limits p { margin: 4px 0 0; }

/* v0.3.23 — Kundetype (Privat/Erhverv) */
.ctype-radios { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.15rem 0 0.25rem; }
.ctype-radio { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem; border: 1px solid var(--border, #d9dee5);
  border-radius: 999px; cursor: pointer; font-weight: 500; background: var(--surface, #fff); }
.ctype-radio:has(input:checked) { border-color: var(--accent, #2f7d5b); background: color-mix(in srgb, var(--accent, #2f7d5b) 9%, transparent); }
.ctype-radio input { accent-color: var(--accent, #2f7d5b); margin: 0; }

/* ===== v0.3.25 lager: I batteriet (stille linje) ===== */
.inv-line, .econ-hero-inv { font-size: 0.78rem; opacity: 0.75; margin-top: 2px; }

/* v0.3.26 Driftssager (Daisy Teamleder) */
.ds-page { max-width: 1200px; margin: 0 auto; padding: 8px 4px 32px; }
.ds-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ds-head h1 { margin: 0 0 4px; }
.ds-head-actions { display: flex; gap: 8px; }
.ds-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; margin-bottom: 12px; }
.ds-pill { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 0.85rem; color: var(--cream); }
.ds-pill-test { border-color: var(--info); color: var(--info); }
.ds-pill-live { border-color: var(--leaf); color: var(--leaf); }
.ds-pill-stop { border-color: var(--danger); color: var(--danger); }
.ds-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ds-chip { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 0.88rem; }
.ds-chip.active, .ds-chip:hover { border-color: var(--accent); color: var(--text); }
.ds-chip span { opacity: 0.7; margin-left: 2px; }
.ds-table-wrap { padding: 0; overflow-x: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ds-table th, .ds-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ds-table th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ds-row { cursor: pointer; }
.ds-row:hover { background: var(--bg-soft); }
.ds-resolved { opacity: 0.6; }
.ds-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.ds-small { font-size: 0.82rem; }
.ds-reason { color: var(--warn); margin-top: 2px; }
.ds-actions { white-space: nowrap; }
.ds-sev { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 0.78rem; font-weight: 600; background: var(--bg-soft); }
.ds-sev-info { color: var(--muted); }
.ds-sev-minor { color: var(--info); }
.ds-sev-major { color: var(--warn); }
.ds-sev-critical { color: var(--danger); }
.ds-empty { padding: 28px; text-align: center; color: var(--muted); }
.ds-detail { margin-top: 14px; padding: 14px; }
.ds-detail code { white-space: pre-wrap; word-break: break-word; color: var(--cream); }
.ds-hist { color: var(--muted); font-size: 0.85rem; padding-left: 18px; }

/* ===================== v0.3.33 — UI-finpudsning (Daisy) =====================
 * Varmere, roligere palet; ens afstande og typografi; Din gevinst som blikfang;
 * abonnement/Daisy-andel dæmpet; tydelige indlæs-/tom-/fejltilstande; mobil.
 * Kun tilføjelser/overstyringer — ingen funktioner fjernet. */
:root {
  --bg: #0f1317;
  --bg-elev: #151a20;
  --bg-card: #1a2027;
  --bg-soft: #232b34;
  --border: #2a333d;
  --border-soft: rgba(232, 223, 200, 0.07);
  --text: #f4f0e6;
  --muted: #a3adb9;          /* ≥ 7:1 mod kortbaggrund */
  --muted-2: #8b95a1;        /* stadig ≥ 4,5:1 — kun til sekundær småtekst */
  --radius: 14px;
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-5: 1.5rem;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.18);
}
body { font-feature-settings: "tnum" 0; -webkit-font-smoothing: antialiased; }
h1 { font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem); letter-spacing: -0.015em; line-height: 1.2; }
.card { border-radius: var(--radius); border-color: var(--border); }
:where(a, button, [role="button"], input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* KPI-strip: Din gevinst først og lidt bredere; altid 4 kort (ingen enlig) */
.kpi-strip {
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-4);
}
.kpi-card { padding: 0.7rem 0.85rem; border-radius: 12px; min-height: 64px; }
.kpi-card .label { font-size: 0.7rem; letter-spacing: 0.04em; }
.kpi-card .sub { font-size: 0.74rem; }
.kpi-card.kpi-win {
  border-color: rgba(95, 184, 120, 0.45);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(245, 197, 24, 0.10), transparent 55%),
    linear-gradient(135deg, rgba(95, 184, 120, 0.12), var(--bg-card) 60%);
}
.kpi-card.kpi-win .value { font-size: 1.32rem; }
.kpi-card.kpi-win .label { color: var(--cream); }
.kpi-card.kpi-win-empty .value { color: var(--muted); }
.kpi-card.kpi-win-empty { border-style: dashed; border-color: rgba(95, 184, 120, 0.35); }

/* Økonomi: helten er blikfanget, abonnement og Daisy-andel holdes stille */
.econ-hero-win .econ-hero-value { letter-spacing: -0.02em; }
.econ-hero-andel,
.econ-subscription,
.econ-subscription summary,
.econ-sub-row,
.econ-sub-val { color: var(--muted); }
.econ-subscription { background: transparent; border-color: var(--border-soft); box-shadow: none; }
.econ-subscription summary { font-weight: 500; font-size: 0.88rem; }
.econ-hero-andel { font-size: 0.76rem; }

/* Indlæsning / tom / fejl */
.loading {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: 3.5rem 1rem; font-size: 0.92rem;
}
.daisy-spin {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0 22%, transparent 23%),
              conic-gradient(from 0deg, var(--petal) 0 8%, transparent 8% 12.5%, var(--petal) 12.5% 20.5%, transparent 20.5% 25%,
                var(--petal) 25% 33%, transparent 33% 37.5%, var(--petal) 37.5% 45.5%, transparent 45.5% 50%,
                var(--petal) 50% 58%, transparent 58% 62.5%, var(--petal) 62.5% 70.5%, transparent 70.5% 75%,
                var(--petal) 75% 83%, transparent 83% 87.5%, var(--petal) 87.5% 95.5%, transparent 95.5% 100%);
  -webkit-mask: radial-gradient(circle, #000 64%, transparent 66%);
          mask: radial-gradient(circle, #000 64%, transparent 66%);
  opacity: 0.9;
  animation: daisy-spin 2.4s linear infinite;
}
@keyframes daisy-spin { to { transform: rotate(360deg); } }
.skel {
  display: inline-block; height: 0.9em; border-radius: 6px; vertical-align: middle;
  background: linear-gradient(90deg, var(--bg-soft), rgba(255, 255, 255, 0.07), var(--bg-soft));
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
}
.skel-num { width: 5.5ch; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .daisy-spin, .skel { animation: none; }
}
.empty-state { color: var(--muted); }
.empty-state strong { color: var(--text); font-weight: 600; }
.error-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; color: #ffb3b8; }
.error-banner .btn { flex-shrink: 0; }

/* Mobil */
@media (max-width: 900px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card.kpi-win .value { font-size: 1.2rem; }
}
@media (max-width: 520px) {
  .view { padding-left: 0.85rem; padding-right: 0.85rem; }
  .kpi-strip { gap: 0.45rem; }
  .kpi-card { padding: 0.6rem 0.65rem; gap: 0.45rem; min-height: 0; }
  .kpi-ico { width: 26px; height: 26px; }
  .kpi-card .value { font-size: 0.98rem; }
  .kpi-card.kpi-win .value { font-size: 1.12rem; }
  .site-subnav { gap: 0.35rem; }
  .econ-kpis { gap: 0.5rem; }
}

/* v0.3.35 Systemydelser (beta) — deliberately muted */
.anc-muted { opacity: .92; filter: saturate(.6); }
.anc-muted h2 .badge { font-size: .7em; padding: 2px 8px; border-radius: 10px; background: #eee; color: #666; vertical-align: middle; }
.anc-table { width: 100%; border-collapse: collapse; font-size: .9em; }
.anc-table th, .anc-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(0,0,0,.06); vertical-align: top; }
.anc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #bbb; }
.anc-dot.ok { background: #7a9e7e; }
.anc-dot.no { background: #c9a27e; }
.anc-verdict { text-transform: capitalize; color: #666; }
.anc-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.anc-form label { display: flex; flex-direction: column; font-size: .85em; color: #666; }

/* v0.3.39 Mobil-værn: ingen vandret overflow ≤ 600px.
   Grid-spor er minmax(0,1fr) (ikke 1fr, der vokser til længste ubrudte tekst),
   fane-rækker scroller inde i sig selv, og lange ord/IP:port brydes. */
@media (max-width: 600px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  @supports (overflow: clip) { html, body { overflow-x: clip; } }
  .app-main, .view { min-width: 0; max-width: 100vw; }
  .view { overflow-wrap: break-word; }  /* v0.3.42: ikke «anywhere» — det kollapsede tabelkolonner */
  .dash-hero, .dash-lower, .dash-metrics, .graphs-grid, .econ-charts,
  .settings-grid, .inv-act-grid, .grid-2, .welcome-inner { grid-template-columns: minmax(0, 1fr); }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card, .kpi-card, .kpi-card > *, .dash-hero > *, .dash-lower > *, .dash-metrics > *,
  .graphs-grid > *, .econ-kpis > * { min-width: 0; max-width: 100%; }
  .main-nav, .site-subnav {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: 100%;
  }
  .main-nav::-webkit-scrollbar, .site-subnav::-webkit-scrollbar { display: none; }
  .main-nav > *, .site-subnav > * { flex: 0 0 auto; white-space: nowrap; }
  .topbar, .brand { min-width: 0; max-width: 100%; }
  .top-site-chip { min-width: 0; max-width: 100%; overflow: hidden; }
  .top-site-name { min-width: 0; }
  .view pre, .view code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .view img, .view canvas, .view svg { max-width: 100%; }
  form label, .econ-proof-form > * { min-width: 0; max-width: 100%; }
  .econ-proof-form { flex-wrap: wrap; }
  .econ-row { grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr); }
  .econ-row > * { min-width: 0; }
  .section-title { flex-wrap: wrap; min-width: 0; }
  .pause-chip { white-space: normal; max-width: 100%; }
}
@media (max-width: 360px) {
  .kpi-strip { grid-template-columns: minmax(0, 1fr); }
}

/* v0.3.42 Mobil-tabeller (≤ 700px).
   Tabeller brydes ALDRIG bogstav-for-bogstav: celler er nowrap og tabellen scroller vandret i sig selv.
   Flåde-tabellen («Anlæg») vises som kort. */
@media (max-width: 700px) {
  .view table, .view table th, .view table td {
    overflow-wrap: normal; word-break: normal; hyphens: manual;
  }
  .view table:not(.fleet-table) {
    display: block; width: 100%; max-width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  }
  .view table:not(.fleet-table) th,
  .view table:not(.fleet-table) td { white-space: nowrap; min-width: 3rem; }
  .view table:not(.fleet-table) th:first-child,
  .view table:not(.fleet-table) td:first-child { min-width: 4.5rem; }
  .site-table-wrap, .table-scroll, .inv-tou-wrap, .inst-tw { max-width: 100%; overflow-x: auto; }

  /* Flåde: kort pr. anlæg */
  .site-table-wrap:has(> .fleet-table) { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.fleet-table, table.fleet-table tbody { display: block; width: 100%; }
  table.fleet-table thead { display: none; }
  table.fleet-table tr {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 0.4rem 0.5rem;
    grid-template-areas: "name name name soc" "area cls . bat" "proto proto proto pv" "status ctrl ctrl ctrl";
    align-items: center; padding: 0.8rem 0.9rem; margin-bottom: 0.6rem;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  table.fleet-table td { display: block; padding: 0; border: 0; min-width: 0; }
  table.fleet-table .c-name { grid-area: name; }
  table.fleet-table .c-name .name { font-size: 1rem; font-weight: 700; color: var(--text); overflow-wrap: break-word; }
  table.fleet-table .c-name .proto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  table.fleet-table .c-area { grid-area: area; }
  table.fleet-table .c-class { grid-area: cls; }
  table.fleet-table .c-proto { grid-area: proto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.fleet-table .c-soc { grid-area: soc; font-size: 1.25rem; font-weight: 700; text-align: right; white-space: nowrap; }
  table.fleet-table .c-bat { grid-area: bat; font-weight: 600; text-align: right; white-space: nowrap; }
  table.fleet-table .c-pv { grid-area: pv; text-align: right; white-space: nowrap; color: var(--muted); }
  table.fleet-table .c-pv::before { content: "PV "; color: var(--muted-2); font-weight: 400; }
  table.fleet-table .c-bat::before { content: "Batteri "; color: var(--muted-2); font-weight: 400; font-size: 0.8rem; }
  table.fleet-table .c-status { grid-area: status; }
  table.fleet-table .c-ctrl { grid-area: ctrl; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.fleet-table .c-ctrl > div { display: inline; margin-left: 0.3rem; }

  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .summary > * { min-width: 0; }
  .summary .card { padding: 0.75rem 0.85rem; }
  .summary .card .value { font-size: 1.35rem; }
  .filters { flex-wrap: wrap; max-width: 100%; }
  .view select, .view input, .view textarea { max-width: 100%; min-width: 0; }
  .filters .chip { flex: 0 0 auto; white-space: nowrap; }
}

/* v0.3.48: salg af overskud (målt SOC over forventet) */
.surplus-info .adaptive-tag { background: rgba(201, 160, 255, 0.16); color: #d9c2ff; }
.surplus-info.surplus-active .adaptive-tag { background: rgba(255, 140, 66, 0.22); color: #ffb27a; }

/* v0.3.50 Marstek self-use control */
.self-use-info { margin: 0.5rem 0; padding: 0.5rem 0.75rem; border-radius: 8px; background: rgba(46, 160, 67, 0.08); font-size: 0.9rem; }
.self-use-warn { margin-top: 0.35rem; color: #b45309; }

/* v0.3.65 language dropdown + long-string safety (de/fi) */
.lang-slot { display: inline-flex; align-items: center; }
.lang-select { max-width: 11rem; font: inherit; font-size: .85rem; padding: .25rem .4rem; border-radius: 8px;
  border: 1px solid var(--border, #d0d7de); background: var(--surface, #fff); color: inherit; }
.login-lang { display: flex; justify-content: flex-end; margin-bottom: .25rem; }
html:not([lang="da"]) .btn, html:not([lang="da"]) .badge, html:not([lang="da"]) .sidebar-nav a,
html:not([lang="da"]) .mobile-nav a, html:not([lang="da"]) th, html:not([lang="da"]) label { overflow-wrap: anywhere; hyphens: auto; }
html:not([lang="da"]) .btn { white-space: normal; }
@media (max-width: 640px) {
  .topbar-meta .lang-select { max-width: 6.5rem; }
  .topbar-meta .clock { display: none; }
  html:not([lang="da"]) .mobile-nav a { font-size: .72rem; }
}
