:root {
  color-scheme: dark;
  --bg: #07131a;
  --bg-deep: #041017;
  --panel: rgba(9, 24, 31, 0.88);
  --panel-strong: rgba(12, 31, 40, 0.96);
  --panel-soft: rgba(18, 42, 53, 0.72);
  --text: #edf7f7;
  --muted: #9ab2b6;
  --accent: #57d6c3;
  --accent-soft: rgba(87, 214, 195, 0.16);
  --accent-warm: #f2b66d;
  --danger: #ff7d74;
  --success: #6fe0a9;
  --warning: #f0c96a;
  --border: rgba(120, 158, 165, 0.22);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  position: relative;
  overflow-x: hidden;
  font-family: "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(87, 214, 195, 0.12), transparent 22rem),
    radial-gradient(circle at right 15%, rgba(242, 182, 109, 0.09), transparent 20rem),
    linear-gradient(180deg, #09161d 0%, var(--bg) 35%, var(--bg-deep) 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: 0.22;
}

.bg-orb {
  position: fixed;
  inset: auto;
  width: 24rem;
  height: 24rem;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.28;
}

.bg-orb-a {
  top: -8rem;
  right: -4rem;
  background: rgba(87, 214, 195, 0.2);
}

.bg-orb-b {
  bottom: 8rem;
  left: -6rem;
  background: rgba(242, 182, 109, 0.13);
}

.site-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  padding: 2.75rem 0 1.5rem;
  align-items: end;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-header h1,
.panel h2,
.section-card h2 {
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: 0.02em;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  line-height: 0.95;
}

.page-intro {
  max-width: 48rem;
  margin: 0.9rem 0 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.page-context {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.status-badge {
  min-width: 10rem;
  margin: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(6, 18, 24, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 0.18rem;
  font-size: 0.94rem;
}

.status-badge span {
  color: var(--muted);
  font-size: 0.77rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-badge strong {
  font-size: 0.98rem;
}

.status-badge.subtle {
  background: rgba(12, 25, 33, 0.7);
}

.status-badge[data-state="online"],
[data-state="online"] {
  color: var(--success);
}

.status-badge[data-state="simulated"],
[data-state="simulated"] {
  color: var(--warning);
}

.status-badge[data-state="offline"],
[data-state="offline"] {
  color: var(--danger);
}

.status-badge[data-state="active"],
[data-state="active"] {
  color: var(--danger);
}

.status-badge[data-state="blocked"],
[data-state="blocked"] {
  color: var(--warning);
}

.status-badge[data-state="ready"],
[data-state="ready"] {
  color: var(--success);
}

.status-badge[data-state="no_action"],
[data-state="no_action"] {
  color: var(--accent);
}

.status-badge[data-state="success"],
[data-state="success"] {
  color: var(--success);
}

.status-badge[data-state="on"],
[data-state="on"] {
  color: var(--accent-warm);
}

.status-badge[data-state="home"],
[data-state="home"] {
  color: var(--success);
}

.status-badge[data-state="away"],
[data-state="away"] {
  color: #8d9da3;
}

.status-badge[data-state="unknown"],
[data-state="unknown"] {
  color: var(--warning);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.4rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(7, 19, 26, 0.72);
  color: var(--muted);
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  background: rgba(16, 38, 49, 0.92);
  border-color: rgba(87, 214, 195, 0.32);
  transform: translateY(-1px);
}

.nav-link.active {
  color: #041017;
  background: linear-gradient(135deg, var(--accent) 0%, #a6f1d4 100%);
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(87, 214, 195, 0.18);
}

.nav-link-admin {
  min-width: auto;
  padding-inline: 1.1rem;
}

.source-pill,
.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.source-pill {
  background: rgba(87, 214, 195, 0.16);
  color: var(--accent);
  border-color: rgba(87, 214, 195, 0.28);
}

.meta-pill {
  background: rgba(120, 158, 165, 0.12);
  color: var(--text);
  border-color: rgba(120, 158, 165, 0.22);
}

.meta-pill-activity {
  background: rgba(242, 182, 109, 0.14);
  color: #ffd7a4;
  border-color: rgba(242, 182, 109, 0.22);
}

.meta-pill-area {
  background: rgba(111, 224, 169, 0.12);
  color: #bdf2d3;
  border-color: rgba(111, 224, 169, 0.22);
}

.check-cell {
  text-align: center;
}

.table-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: rgba(111, 224, 169, 0.16);
  color: var(--success);
  border: 1px solid rgba(111, 224, 169, 0.26);
  font-weight: 700;
  line-height: 1;
}

main.site-shell {
  display: grid;
  gap: 1.2rem;
  padding-bottom: 2rem;
}

.hero-grid,
.panel-grid,
.metric-grid {
  display: grid;
  gap: 1rem;
}

.hero-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.panel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.section-card {
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background:
    linear-gradient(180deg, rgba(18, 41, 52, 0.3), transparent 55%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: rise-in 420ms ease both;
}

.section-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  padding: 1.25rem;
  color: var(--text);
  text-decoration: none;
  min-height: 12.5rem;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.section-card:nth-child(2) {
  animation-delay: 60ms;
}

.section-card:nth-child(3) {
  animation-delay: 120ms;
}

.section-card:hover,
.section-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(87, 214, 195, 0.32);
  background:
    linear-gradient(180deg, rgba(27, 61, 76, 0.56), transparent 60%),
    var(--panel-strong);
}

.section-icon {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 1.25rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(87, 214, 195, 0.16), rgba(87, 214, 195, 0.03));
  color: var(--accent);
}

.section-icon svg {
  width: 2.45rem;
  height: 2.45rem;
}

.eco-house-indicator {
  color: var(--muted);
}

.eco-house-indicator .eco-house-lamp {
  fill: currentColor;
}

.eco-house-indicator[data-state="home"],
.eco-house-indicator[data-state="home_candidate"] {
  color: var(--success);
  background: linear-gradient(135deg, rgba(111, 224, 169, 0.2), rgba(111, 224, 169, 0.05));
}

.eco-house-indicator[data-state="away"],
.eco-house-indicator[data-state="away_candidate"] {
  color: #8d9da3;
  background: linear-gradient(135deg, rgba(121, 138, 145, 0.18), rgba(121, 138, 145, 0.04));
}

.eco-house-indicator[data-state="unknown"],
.eco-house-indicator[data-state="unavailable"] {
  color: var(--warning);
}

.section-kicker {
  margin: 0 0 0.45rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
}

.section-card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.section-value {
  margin: 0.9rem 0 0.25rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 0.95;
}

.section-value-unit {
  font-size: 0.45em;
  font-weight: 400;
  opacity: 0.75;
  font-family: inherit;
}

.eco-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.eco-summary-flag {
  width: 5rem;
  height: 5rem;
  border-radius: 1.35rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(121, 158, 165, 0.12);
  background: var(--panel-soft);
}

.eco-summary-flag svg {
  width: 3rem;
  height: 3rem;
}

.section-meta {
  margin: 0;
  color: var(--muted);
}

.panel {
  padding: 1.3rem;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.18rem;
}

.key-value,
.metric-grid {
  margin: 0;
}

.key-value {
  display: grid;
  gap: 0.85rem;
}

.key-value div,
.metric-card {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(121, 158, 165, 0.12);
  border-radius: 1rem;
  background: var(--panel-soft);
}

.key-value dt,
.metric-card dt {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.key-value dd,
.metric-card dd {
  margin: 0.4rem 0 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.metric-card dd {
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: 1.55rem;
  line-height: 1;
}

.section-heading {
  display: flex;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin-bottom: 0.35rem;
}

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

.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
}

.expander {
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background: rgba(8, 20, 26, 0.72);
  overflow: hidden;
}

.expander > summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.expander > summary::-webkit-details-marker {
  display: none;
}

.expander > summary::after {
  content: "+";
  float: right;
  color: var(--accent);
}

.expander[open] > summary::after {
  content: "\2212";
}

.expander-content {
  display: grid;
  gap: 1rem;
  padding: 0 1rem 1rem;
}

/* ── Section-level progressive disclosure ──────────────────────────────── */
.section-expander {
  margin-block: 0;
}

.section-expander > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid transparent;
  user-select: none;
  transition: color 0.15s, border-color 0.15s;
}

.section-expander > summary::-webkit-details-marker { display: none; }

.section-expander > summary::after {
  content: "+";
  font-size: 1.1rem;
  color: var(--accent);
  line-height: 1;
}

.section-expander[open] > summary {
  color: var(--text);
  border-bottom-color: var(--border);
}

.section-expander[open] > summary::after {
  content: "\2212";
}

.section-expander > summary:hover {
  color: var(--text);
}

.control-form + .control-form {
  margin-top: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.presence-form-grid {
  display: grid;
  gap: 1rem;
}

.presence-field-group {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid rgba(121, 158, 165, 0.12);
  border-radius: 1rem;
  background: rgba(8, 22, 29, 0.56);
}

.presence-field-group legend {
  padding: 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.presence-field-row {
  display: grid;
  gap: 0.85rem;
}

.presence-time-input {
  font-variant-numeric: tabular-nums;
  font-family: "Bahnschrift", "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
  letter-spacing: 0.03em;
}

.control-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.control-form input,
.control-form select,
.control-form textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: rgba(5, 17, 23, 0.92);
  color: var(--text);
  font: inherit;
}

.control-form input:focus-visible,
.control-form select:focus-visible,
.control-form textarea:focus-visible {
  outline: 2px solid rgba(87, 214, 195, 0.25);
  outline-offset: 1px;
  border-color: rgba(87, 214, 195, 0.42);
}

.control-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.form-span-full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.instruction-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
  display: grid;
  gap: 0.65rem;
}

.instruction-list li {
  padding-left: 0.1rem;
  color: var(--muted);
}

.copy-field-list {
  display: grid;
  gap: 0.9rem;
}

.copy-field {
  display: grid;
  gap: 0.45rem;
}

.copy-field label {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.copy-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
}

.copy-field-row input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: rgba(5, 17, 23, 0.92);
  color: var(--text);
  font: inherit;
}

.button-inline {
  min-width: 6.4rem;
  padding-inline: 1rem;
}

.button-inline[data-state="success"] {
  border-color: rgba(111, 224, 169, 0.32);
  color: var(--success);
}

.button-inline[data-state="error"] {
  border-color: rgba(255, 125, 116, 0.32);
  color: var(--danger);
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(135deg, var(--accent) 0%, #a6f1d4 100%);
  color: #041017;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
  box-shadow: 0 12px 24px rgba(87, 214, 195, 0.18);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.button-secondary {
  background: rgba(12, 25, 33, 0.7);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

.button-danger {
  background: rgba(52, 14, 18, 0.9);
  border-color: rgba(255, 125, 116, 0.32);
  color: #ffd5d1;
  box-shadow: none;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid rgba(121, 158, 165, 0.12);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 42rem;
  background: rgba(5, 17, 23, 0.68);
}

thead {
  background: rgba(11, 31, 40, 0.96);
}

th,
td {
  padding: 0.9rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(121, 158, 165, 0.12);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(87, 214, 195, 0.05);
}

.empty-cell {
  text-align: center;
  color: var(--muted);
}

.status-line {
  margin: 1rem 0 0;
  color: var(--muted);
}

.admin-error {
  color: var(--danger);
}

/* Inline feedback messages (JS-driven, e.g. WiFi/hotspot actions) */
.inline-msg {
  display: none;
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.inline-msg--success {
  background: rgba(111, 224, 169, 0.12);
  border: 1px solid rgba(111, 224, 169, 0.28);
  color: var(--success);
}

.inline-msg--error {
  background: rgba(255, 125, 116, 0.10);
  border: 1px solid rgba(255, 125, 116, 0.28);
  color: var(--danger);
}

.inline-msg--info {
  background: rgba(87, 214, 195, 0.08);
  border: 1px solid rgba(87, 214, 195, 0.22);
  color: var(--accent);
}

/* Network scan list (WiFi section in /system) */
.wifi-network-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.4rem;
}

.wifi-network-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--panel-soft);
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color 120ms ease, background 120ms ease;
}

.wifi-network-list li:hover {
  border-color: rgba(87, 214, 195, 0.4);
  background: rgba(87, 214, 195, 0.06);
}

.wifi-network-list .net-signal {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

code {
  padding: 0.14rem 0.35rem;
  border-radius: 0.4rem;
  background: rgba(87, 214, 195, 0.08);
  color: #b9fff2;
}

.site-footer {
  padding: 0 0 2.4rem;
  color: var(--muted);
}

.site-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 1rem;
  padding: 1.1rem 0 0;
  border-top: 1px solid rgba(121, 158, 165, 0.14);
}

.footer-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 7.5rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(121, 158, 165, 0.08);
  border-radius: 1.15rem;
  background: rgba(8, 20, 26, 0.34);
  box-shadow: none;
}

.footer-card-plain {
  background: none;
  border: none;
  box-shadow: none;
  padding: 1.1rem 0 0;
}

.footer-heading {
  margin: 0 0 0.55rem;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer .footer-card:not(.footer-card-plain) .footer-heading {
  color: rgba(237, 247, 247, 0.8);
  font-size: 0.82rem;
}

.site-footer .footer-card:not(.footer-card-plain) p {
  color: rgba(154, 178, 182, 0.92);
}

.site-footer .footer-card:not(.footer-card-plain) .text-link {
  color: #c5d4d7;
  font-weight: 500;
}

.site-footer .footer-card:not(.footer-card-plain) .text-link:hover,
.site-footer .footer-card:not(.footer-card-plain) .text-link:focus-visible {
  color: var(--accent);
}

.site-footer-grid > :nth-child(1) { text-align: left; }
.site-footer-grid > :nth-child(2) { text-align: left; }
.site-footer-grid > :nth-child(3) { text-align: left; }
.site-footer-grid > :nth-child(4) { text-align: right; }

.footer-card-developer {
  position: relative;
  overflow: hidden;
}

.footer-card-developer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/static/laytherm_logo_dark.svg");
  background-size: 90% auto;
  background-repeat: no-repeat;
  background-position: right;
  opacity: 0.18;
  pointer-events: none;
}

.weather-card {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.weather-icon-cell {
  display: flex;
  align-items: center;
}

.weather-temp-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.weather-temp {
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.weather-range {
  color: var(--muted);
  font-size: 0.88rem;
}

.weather-details-cell {
  display: flex;
  gap: 2rem;
  margin: 0;
  flex-wrap: wrap;
}

.weather-details-cell div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.weather-details-cell dt {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.weather-details-cell dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.weather-forecast-cell {
  display: flex;
  gap: 1.5rem;
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
}

.weather-forecast-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  min-width: 4rem;
}

.forecast-label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.forecast-temps {
  font-size: 0.85rem;
}

/* ── Weather page hero card ─────────────────────────────────────────────── */
.weather-page-hero {
  gap: 1.2rem;
}

.weather-display-card {
  position: relative;
  z-index: 1;
  margin-top: 1.15rem;
  padding: 1rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(121, 158, 165, 0.14);
  background:
    linear-gradient(160deg, rgba(9, 26, 34, 0.9) 0%, rgba(5, 17, 23, 0.78) 100%),
    radial-gradient(circle at top right, rgba(255, 210, 77, 0.08), transparent 44%);
}

.weather-display-main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.weather-display-visual,
.weather-display-detail-card {
  border-radius: 1.2rem;
  border: 1px solid rgba(121, 158, 165, 0.14);
  background: rgba(5, 17, 23, 0.44);
}

.weather-display-visual {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 1.2rem;
}

.weather-display-icon-frame {
  display: grid;
  place-items: center;
  width: 6rem;
  height: 6rem;
  border-radius: 1.45rem;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.weather-display-icon-frame img {
  width: 4.5rem;
  height: 4.5rem;
}

.weather-display-temp {
  margin: 0.35rem 0 0;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: clamp(2.8rem, 10vw, 4.3rem);
  line-height: 0.94;
  color: var(--text);
}

.weather-display-condition {
  margin: 0.5rem 0 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
}

.weather-display-feels-like {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
}

.weather-display-feels-like strong {
  color: var(--accent);
  margin-left: 0.25rem;
}

.weather-display-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.weather-display-detail-card {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  padding: 1rem 1.05rem;
}

.weather-display-detail-card span {
  color: var(--text-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.weather-display-detail-card strong {
  color: var(--text);
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: clamp(1.2rem, 4.6vw, 2rem);
  line-height: 1.05;
}

.weather-display-detail-card p {
  margin: 0;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .weather-display-main {
    grid-template-columns: 1fr;
  }

  .weather-display-visual {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .weather-display-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 10-day forecast table ──────────────────────────────────────────────── */
.weather-forecast-table {
  width: 100%;
}

.weather-forecast-table .num-col {
  text-align: right;
  white-space: nowrap;
}

.weather-forecast-table td,
.weather-forecast-table th {
  padding: 0.55rem 0.75rem;
}

.forecast-day-cell {
  font-weight: 700;
  white-space: nowrap;
  min-width: 6rem;
}

.forecast-condition-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.forecast-table-icon {
  flex-shrink: 0;
}

.forecast-high {
  color: var(--text);
  font-weight: 700;
}

.forecast-low-cell {
  color: var(--text-muted);
}

.precip-prob {
  font-size: 0.85rem;
  font-weight: 600;
}

.precip-prob-low  { color: var(--text-muted); }
.precip-prob-mid  { color: var(--text); }
.precip-prob-high { color: var(--accent); }

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1000px) {
  .hero-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .page-header,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .header-meta {
    justify-content: flex-start;
  }

  .weather-card {
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    row-gap: 1rem;
  }

  .weather-forecast-cell {
    grid-column: 1 / -1;
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
  }
}

/* ── Electricity price widget (overview) ───────────────────────────────── */
.electricity-widget-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.elec-widget-main { }

.elec-widget-price {
  font-family: Bahnschrift, 'DIN Alternate', sans-serif;
  font-size: 2rem;
  line-height: 1;
  margin: 0;
  color: var(--text);
}

.elec-widget-unit {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
}

.elec-widget-range {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
}

.elec-chart-wrap {
  width: 100%;
  overflow: hidden;
}

.elec-chart-svg {
  width: 100%;
  height: 48px;
  display: block;
}

.ecb { fill: var(--accent); opacity: 0.55; }
.ecb-current { fill: var(--accent); opacity: 1; }
.ecb-tomorrow { fill: var(--accent-warm); opacity: 0.45; }

/* ── Electricity price page ─────────────────────────────────────────────── */
.elec-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem 3rem;
  align-items: start;
}

.elec-hero-main {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.elec-hero-price {
  font-family: Bahnschrift, 'DIN Alternate', sans-serif;
  font-size: 3.5rem;
  line-height: 1;
  margin: 0;
  color: var(--text);
}

.elec-hero-unit {
  font-size: 1rem;
  color: var(--text-muted);
  margin-left: 0.2em;
}

.elec-area-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0.4em;
  padding: 0.2em 0.5em;
  align-self: center;
}

.elec-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 2.5rem;
  align-content: start;
}

.elec-hero-meta > div { display: flex; flex-direction: column; gap: 0.2rem; }

.elec-hero-meta dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.elec-hero-meta dd {
  font-size: 1rem;
  font-weight: 700;
}

.elec-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

@media (max-width: 700px) {
  .elec-hero { grid-template-columns: 1fr; }
  .elec-hero-actions { align-items: flex-start; }
}

.elec-chart-full-wrap {
  margin: 1rem -1.3rem -1.3rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.elec-chart-full-svg {
  width: 100%;
  height: auto;
  display: block;
  min-width: 0;
}

.chart-tick-major {
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.6;
}

.chart-tick-minor {
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.3;
}

.chart-hour-label {
  font-size: 13px;
  fill: var(--text);
  opacity: 0.8;
  font-family: inherit;
}

.chart-day-label {
  font-size: 12px;
  fill: var(--accent);
  opacity: 0.55;
  font-family: inherit;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chart-day-divider {
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.45;
  stroke-dasharray: 3 3;
}

.chart-booking-block {
  fill: var(--danger);
  opacity: 0.18;
}

.chart-temp-ref {
  stroke: #f5e642;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.45;
}

.chart-price-avg-ref {
  stroke: rgba(87, 214, 195, 0.95);
  stroke-width: 1.5;
  stroke-dasharray: 8 5;
  opacity: 0.95;
}

.chart-price-avg-label {
  font-size: 12px;
  fill: rgba(87, 214, 195, 0.95);
  opacity: 0.95;
  font-family: inherit;
  font-weight: 700;
}

.chart-temp-dot {
  fill: #f5e642;
  opacity: 0.9;
}

.chart-temp-label {
  font-size: 12px;
  fill: #f5e642;
  opacity: 0.9;
  font-family: inherit;
  font-weight: 600;
}

.chart-legend {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
  padding: 0 1.3rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  line-height: 1.45;
}

.ecb-legend {
  display: inline-block;
  width: 12px;
  height: 10px;
  border-radius: 2px;
  vertical-align: middle;
}

.ecb-legend-today    { background: var(--accent); opacity: 0.6; }
.ecb-legend-tomorrow { background: var(--accent-warm); opacity: 0.5; }
.ecb-legend-current  { background: var(--accent); }
.ecb-legend-booking  { background: var(--danger); opacity: 0.5; }
.ecb-legend-price-avg { background: rgba(87, 214, 195, 0.95); height: 3px; border-radius: 999px; }
.ecb-legend-temp     { background: #f5e642; opacity: 0.85; border-radius: 50%; }

.elec-price-table { width: 100%; }
.elec-price-table td, .elec-price-table th { padding: 0.4rem 0.6rem; }
.elec-row-current { font-weight: 700; }

.price-pill {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.1em 0.4em;
  border-radius: 0.3em;
}

.price-low  { color: #4cd97b; }
.price-mid  { color: var(--text); }
.price-high { color: #f87171; }

/* ── Legionella window ──────────────────────────────────────────────────── */
.chart-legionella-window {
  fill: #4cd97b;
  opacity: 0.18;
}

.chart-legionella-border {
  fill: none;
  stroke: #4cd97b;
  stroke-width: 1.5;
  opacity: 0.7;
}

.ecb-legend-legionella {
  background: #4cd97b;
  opacity: 0.7;
}

.legionella-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.5rem 1.3rem 0;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid #4cd97b;
  background: rgba(76, 217, 123, 0.06);
  border-radius: 0 0.4rem 0.4rem 0;
}

.legionella-hint strong {
  color: var(--text);
}

.legionella-hint-warn {
  color: var(--warning, #f5a623);
}

.legionella-row-mark {
  font-size: 0.55rem;
  color: #4cd97b;
  margin-left: 0.35em;
  vertical-align: middle;
}

/* ── Responsive: electricity page on mobile ─────────────────────────────── */
@media (max-width: 600px) {
  .elec-hero {
    grid-template-columns: 1fr;
  }

  .elec-hero-actions {
    align-items: flex-start;
  }

  .elec-hero-price {
    font-size: 2.5rem;
  }

  /* Chart: let it scroll horizontally rather than squish below 48h of bars */
  .elec-chart-full-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0.85rem -1rem -1rem;
  }

  .elec-chart-full-svg {
    min-width: 340px;
    height: auto;
  }

  .chart-legend {
    padding: 0 0.95rem;
    font-size: 0.68rem;
  }

  .legionella-hint {
    margin: 0.5rem 0.95rem 0;
    font-size: 0.75rem;
  }

  /* Price tables: side-by-side → stacked on mobile */
  .panel-grid:has(.elec-price-table) {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-shell {
    width: min(100% - 1rem, 100%);
  }

  .hero-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .section-card {
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 34rem;
  }

  .site-footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile-first shell and primary operational views */

:root {
  --text-muted: var(--muted);
  --surface-line: rgba(255, 255, 255, 0.03);
  --surface-glow: radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 28%);
}

body {
  padding-bottom: 6.4rem;
}

.app-main {
  display: grid;
  gap: 1.15rem;
  padding-bottom: 1.2rem;
}

.app-topbar {
  padding: 1rem 0 1rem;
}

.app-topbar-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.app-brand {
  min-width: 0;
}

.app-brand h1 {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.app-topbar .page-context {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.topbar-pill,
.topbar-pill:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.55rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 158, 165, 0.18);
  background: rgba(8, 22, 29, 0.72);
  color: var(--text);
  text-decoration: none;
  backdrop-filter: blur(14px);
}

.topbar-pill span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.topbar-pill strong {
  font-size: 0.84rem;
  font-weight: 700;
}

.topbar-pill-user {
  padding-right: 0.9rem;
}

.topbar-pill-alert strong {
  color: var(--danger);
}

.topbar-icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  border: 1px solid rgba(121, 158, 165, 0.18);
  border-radius: 1rem;
  background: rgba(8, 22, 29, 0.72);
  color: var(--text);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.topbar-icon-button:hover,
.topbar-icon-button:focus-visible {
  background: rgba(16, 38, 49, 0.9);
  border-color: rgba(87, 214, 195, 0.28);
  transform: translateY(-1px);
}

.topbar-icon-button span {
  display: block;
  width: 1rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.topbar-icon-button span + span {
  margin-top: 0.18rem;
}

.topbar-icon-button-close {
  position: relative;
}

.topbar-icon-button-close span {
  position: absolute;
  margin: 0;
}

.topbar-icon-button-close span:first-child {
  transform: rotate(45deg);
}

.topbar-icon-button-close span:last-child {
  transform: rotate(-45deg);
}

.desktop-nav {
  display: none;
}

.mobile-more-sheet[hidden] {
  display: none !important;
}

.mobile-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.mobile-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 12, 16, 0.7);
  backdrop-filter: blur(8px);
}

.mobile-more-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  border-top-left-radius: 1.7rem;
  border-top-right-radius: 1.7rem;
  border: 1px solid rgba(121, 158, 165, 0.18);
  border-bottom: none;
  background:
    linear-gradient(180deg, rgba(18, 41, 52, 0.34), transparent 42%),
    rgba(8, 20, 26, 0.96);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.4);
  padding: 1rem 1rem 1.2rem;
  max-height: min(78vh, 38rem);
  overflow: auto;
}

.mobile-more-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
}

.mobile-more-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.mobile-more-content {
  display: grid;
  gap: 1rem;
}

.mobile-more-group {
  display: grid;
  gap: 0.6rem;
}

.mobile-more-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mobile-more-links {
  display: grid;
  gap: 0.55rem;
}

.mobile-more-link,
.mobile-more-link:visited {
  display: block;
  padding: 0.92rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(121, 158, 165, 0.14);
  background: rgba(12, 25, 33, 0.82);
  color: var(--text);
  text-decoration: none;
}

.mobile-more-link.active {
  border-color: rgba(87, 214, 195, 0.34);
  background: rgba(87, 214, 195, 0.12);
  color: var(--accent);
}

.mobile-tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.7rem 0.65rem calc(0.7rem + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(3, 12, 16, 0), rgba(3, 12, 16, 0.9) 30%),
    rgba(3, 12, 16, 0.82);
  backdrop-filter: blur(14px);
}

.mobile-tab {
  display: grid;
  place-items: center;
  min-height: 3.35rem;
  padding: 0.5rem 0.4rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(121, 158, 165, 0.08);
  background: rgba(9, 22, 28, 0.72);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.mobile-tab.active,
.mobile-tab[aria-expanded="true"] {
  color: var(--accent);
  border-color: rgba(87, 214, 195, 0.24);
  background: rgba(87, 214, 195, 0.1);
}

.mobile-tab-more {
  appearance: none;
  font: inherit;
  cursor: pointer;
}

.page-stack {
  display: grid;
  gap: 1.15rem;
}

.page-group {
  display: grid;
  gap: 0.85rem;
}

.group-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.group-header h2 {
  margin: 0.15rem 0 0;
  font-size: 1.24rem;
}

.group-kicker {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-panel,
.support-card,
.stack-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(121, 158, 165, 0.16);
  border-radius: 1.55rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 38%),
    linear-gradient(180deg, rgba(18, 41, 52, 0.3), transparent 58%),
    rgba(9, 24, 31, 0.92);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.24);
}

.hero-panel::before,
.support-card::before,
.stack-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, transparent 18%, rgba(255, 255, 255, 0.035) 33%, transparent 48%),
    linear-gradient(125deg, transparent 58%, rgba(255, 255, 255, 0.02) 70%, transparent 84%);
  pointer-events: none;
}

.hero-panel-inner {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hero-chip,
.hero-chip:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 158, 165, 0.16);
  background: rgba(7, 19, 26, 0.58);
  color: var(--text);
  text-decoration: none;
}

.hero-chip span {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.hero-chip strong {
  font-size: 0.85rem;
}

.hero-chip.hero-chip-house {
  min-height: 2.85rem;
  padding-right: 0.95rem;
}

.hero-chip-house svg {
  width: 1.4rem;
  height: 1.4rem;
}

.hero-chip-alert strong {
  color: var(--danger);
}

.hero-main-grid {
  display: grid;
  gap: 1rem;
}

.hero-context-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-content: start;
}

.overview-hero .hero-context-grid {
  gap: 0.9rem;
}

.hero-kicker {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-copy h2 {
  margin: 0.3rem 0 0;
  font-size: 1.55rem;
}

.hero-reading {
  margin: 0.85rem 0 0;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: clamp(3.2rem, 12vw, 4.3rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.hero-reading-small {
  font-size: clamp(2.25rem, 9vw, 3.2rem);
}

.hero-reading-label {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
}

.hero-support-line {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.hero-support-line strong {
  color: var(--text);
  margin-left: 0.35rem;
}

.hero-weather-card,
.hero-side-stat {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-height: 10.2rem;
  padding: 0.95rem 1rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(121, 158, 165, 0.14);
  background: rgba(5, 17, 23, 0.46);
}

.hero-side-stat-link,
.hero-side-stat-link:visited {
  color: inherit;
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.hero-side-stat-link:hover,
.hero-side-stat-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(87, 214, 195, 0.28);
  background: rgba(8, 24, 31, 0.72);
}

.hero-weather-card {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 1rem;
}

.overview-weather-card {
  grid-template-columns: 1fr;
  gap: 1rem;
  min-height: 0;
}

.overview-weather-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.overview-weather-primary {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.overview-weather-primary .hero-weather-temp {
  margin-top: 0;
  font-size: clamp(2.35rem, 7vw, 3.15rem);
}

.overview-weather-primary .hero-weather-condition {
  margin-top: 0.1rem;
}

.overview-weather-card .hero-weather-feels-like {
  margin: 0.12rem 0 0;
}

.hero-weather-icon-wrap {
  display: grid;
  place-items: center;
  width: 4.7rem;
  height: 4.7rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.02);
}

.hero-weather-icon-wrap img {
  width: 3.5rem;
  height: 3.5rem;
}

.hero-weather-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-weather-temp {
  margin: 0.25rem 0 0;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: clamp(2rem, 8vw, 2.7rem);
  line-height: 0.95;
}

.hero-weather-condition {
  margin: 0.35rem 0 0;
  color: var(--text);
  font-weight: 700;
}

.hero-weather-feels-like {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

.hero-weather-feels-like strong {
  color: var(--accent);
  margin-left: 0.3rem;
}

.hero-weather-meta {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
}

.hero-weather-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.overview-weather-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
}

.overview-weather-stats div {
  display: grid;
  gap: 0.22rem;
}

.overview-weather-stats dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overview-weather-stats dd {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
}

.hero-weather-detail-grid p {
  margin: 0;
  display: grid;
  gap: 0.2rem;
}

.hero-weather-detail-grid span {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-weather-detail-grid strong {
  color: var(--text);
  font-size: 0.96rem;
}

.hero-electricity-card {
  min-height: 0;
  justify-content: center;
}

.overview-electricity-card {
  gap: 0.55rem;
  align-content: start;
}

.overview-electricity-head {
  display: grid;
  gap: 0.25rem;
}

.overview-electricity-card .hero-electricity-price {
  margin-top: 0;
}

.overview-electricity-card .hero-electricity-meta {
  max-width: none;
}

.hero-electricity-price {
  margin: 0.4rem 0 0;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  line-height: 0.95;
}

.hero-electricity-price span {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-electricity-meta {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  max-width: 28ch;
}

.overview-support-grid,
.support-card-grid {
  display: grid;
  gap: 0.85rem;
}

.support-card,
.support-card:visited {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
}

.support-card h3 {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
}

.support-kicker {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.support-value {
  margin: 0.55rem 0 0;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: clamp(1.55rem, 7vw, 2.1rem);
  line-height: 0.95;
}

.support-value-compact {
  font-size: clamp(1.05rem, 5vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.support-unit {
  font-size: 0.9rem;
}

.support-meta {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.support-meta strong {
  color: var(--text);
}

.pump-activity-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
}

.pump-activity-visual {
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.03);
}

.pump-activity-icon {
  width: 2.6rem;
  height: 2.6rem;
  color: var(--muted);
}

.pump-activity-icon svg {
  width: 100%;
  height: 100%;
}

[data-pump-activity-state="heat"] .pump-activity-icon {
  color: var(--accent-warm);
}

[data-pump-activity-state="hot_water"] .pump-activity-icon {
  color: #79d7ff;
}

[data-pump-activity-state="pause"] .pump-activity-icon {
  color: #8d9da3;
}

.hero-action-row {
  display: flex;
  justify-content: stretch;
}

.hero-primary-button {
  width: 100%;
  min-height: 3.35rem;
}

.booking-logic-grid {
  display: grid;
  gap: 0.85rem;
}

.booking-logic-summary {
  display: grid;
  gap: 1rem;
}

.booking-logic-notes {
  display: grid;
  gap: 0.8rem;
}

.booking-logic-notes p {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
}

.booking-logic-notes span,
.stack-card-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.action-panel {
  display: grid;
  gap: 1rem;
}

.action-panel-copy h2 {
  margin-bottom: 0.5rem;
}

.action-panel-copy p {
  margin: 0;
  color: var(--text-muted);
}

.stack-list {
  display: grid;
  gap: 0.75rem;
}

.stack-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 0.95rem 1rem;
}

.stack-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.stack-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.stack-card-main {
  min-width: 0;
}

.stack-card-main h3 {
  margin: 0.55rem 0 0;
  font-size: 1.08rem;
}

.stack-card-meta {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.stack-card-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 0.25rem;
  min-width: 4.4rem;
  color: var(--text-muted);
}

.stack-card-side strong {
  color: var(--text);
  font-size: 1rem;
}

.stack-card-empty {
  grid-template-columns: 1fr;
}

.stack-card-empty h3,
.stack-card-empty p {
  margin: 0;
}

.alarm-severity-pill {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.alarm-severity-info {
  background: rgba(87, 214, 195, 0.14);
  border-color: rgba(87, 214, 195, 0.24);
  color: var(--accent);
}

.alarm-severity-warning {
  background: rgba(240, 201, 106, 0.14);
  border-color: rgba(240, 201, 106, 0.28);
  color: var(--warning);
}

.alarm-severity-alarm,
.alarm-severity-critical {
  background: rgba(255, 125, 116, 0.14);
  border-color: rgba(255, 125, 116, 0.28);
  color: #ffd2ce;
}

.alarm-action-form .form-actions {
  margin-top: 0.8rem;
}

.service-call-grid {
  grid-template-columns: 1fr;
}

.contact-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.contact-action-row .button {
  min-width: 8rem;
}

.service-log-card {
  align-items: start;
}

.service-log-entry-text {
  margin-top: 0.85rem;
  color: var(--text);
  line-height: 1.65;
  white-space: normal;
  word-break: break-word;
}

.forecast-stack-card .stack-card-side {
  min-width: 4.5rem;
}

.section-link-grid .support-card {
  min-height: 8.25rem;
}

.preference-list {
  margin-top: 0.25rem;
}

.preference-card {
  gap: 1rem;
}

.preference-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
}

.preference-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(157, 182, 198, 0.16);
  background: rgba(10, 17, 22, 0.58);
  color: var(--text);
  font-size: 0.9rem;
}

.preference-toggle input {
  margin: 0;
}

.admin-inline-grid {
  margin-top: 1rem;
}

.admin-user-list {
  display: grid;
  gap: 0.9rem;
}

.admin-user-card {
  background: rgba(8, 22, 29, 0.9);
}

.admin-user-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.admin-user-summary-copy {
  min-width: 0;
}

.admin-user-summary-copy strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
}

.admin-user-summary-copy p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.admin-user-summary-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.admin-user-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(121, 158, 165, 0.18);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.28rem 0.65rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-user-pill-self {
  color: var(--accent);
  border-color: rgba(87, 214, 195, 0.35);
}

.admin-user-card-body {
  display: grid;
  gap: 1rem;
}

.admin-user-key-value {
  margin: 0;
}

.admin-user-edit-form {
  display: grid;
  gap: 1rem;
}

.admin-user-actions {
  justify-content: flex-start;
}

@media (max-width: 640px) {
  .preference-toggle-grid {
    grid-template-columns: 1fr;
  }
}

.alert-banner-wrap {
  margin-top: -0.1rem;
}

.alert-banner,
.alert-banner:visited {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 1rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(255, 125, 116, 0.24);
  background: rgba(86, 18, 16, 0.22);
  color: #ffd2ce;
  text-decoration: none;
}

.alert-banner h2,
.alert-banner p {
  margin: 0;
}

.alert-banner-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 125, 116, 0.16);
}

.alert-banner-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.site-footer {
  padding-bottom: 1.2rem;
}

.site-footer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: auto;
}

.site-footer-grid > :nth-child(1),
.site-footer-grid > :nth-child(2),
.site-footer-grid > :nth-child(3) {
  text-align: left;
}

.site-footer .footer-card {
  min-height: 0;
}

.footer-card-plain {
  padding-left: 0;
}

.footer-card-developer,
.footer-card-developer::before {
  display: none;
}

@media (min-width: 720px) {
  .hero-main-grid,
  .booking-logic-grid,
  .overview-support-grid,
  .support-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-card-grid > .support-card:nth-child(3):last-child {
    grid-column: span 2;
  }

  .booking-logic-summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
  }

  .presence-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .presence-field-row {
    grid-template-columns: minmax(0, 1fr) minmax(6.5rem, 8rem);
    align-items: end;
  }
}

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
  }

  .site-shell {
    width: min(1240px, calc(100% - 2.5rem));
  }

  .app-topbar {
    padding-top: 1.35rem;
  }

  .desktop-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
  }

  .app-topbar-actions .topbar-icon-button,
  .mobile-tabbar,
  .mobile-more-sheet {
    display: none !important;
  }

  .page-stack {
    gap: 1.35rem;
  }

  .hero-panel-inner,
  .support-card,
  .stack-card,
  .panel {
    padding: 1.2rem;
  }

  .hero-main-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(21rem, 0.85fr);
    align-items: stretch;
  }

  .overview-hero .hero-main-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(23rem, 25rem);
    align-items: start;
  }

  .overview-hero .hero-context-grid {
    width: 100%;
    max-width: 25rem;
    justify-self: end;
  }

  .overview-support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .support-card-grid > .support-card:nth-child(3):last-child {
    grid-column: span 1;
  }

  .booking-logic-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
  }

  .site-footer-grid {
    gap: 1.2rem;
  }
}

@media (max-width: 719px) {
  .topbar-pill-user {
    display: none;
  }

  .app-topbar-actions {
    gap: 0.45rem;
  }

  .topbar-pill {
    min-width: 0;
    padding-inline: 0.65rem;
  }

  .topbar-pill span {
    display: none;
  }

  .hero-weather-card {
    min-height: 0;
  }

  .hero-weather-detail-grid {
    grid-template-columns: 1fr;
  }

  .hero-context-grid {
    grid-template-columns: 1fr;
  }

  .overview-weather-stats {
    grid-template-columns: 1fr;
  }

  .stack-card {
    grid-template-columns: 1fr;
  }

  .stack-card-side {
    justify-items: start;
    grid-auto-flow: column;
    justify-content: space-between;
  }

  .pump-activity-card {
    grid-template-columns: 1fr;
  }

  .pump-activity-visual {
    width: 3.8rem;
    height: 3.8rem;
  }
}
