:root {
  color-scheme: dark;
  --page:      #0b0d0c;
  --surface-1: #141716;
  --surface-2: #1b1f1e;
  --ink:       #f3f3ee;
  --ink-dim:   #a8ada8;
  --ink-faint: #6f746f;
  --line:      #262b29;
  --brand:     #1baf7a;
  --brand-dim: #128a5c;
  --blue:      #3987e5;
  --blue-dim:  #1c5cab;
  --amber:     #eda100;
  --amber-dim: #c98500;
  --good:      #0ca30c;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, "Segoe UI", system-ui, sans-serif;

  /* Type scale. Large sizes get progressively tighter tracking — the single
     biggest difference between an amateur and a considered page. */
  --step-0: 15.5px;
  --step-1: 18px;
  --step-2: clamp(21px, 2.2vw, 25px);
  --step-3: clamp(27px, 3.4vw, 34px);
  --step-4: clamp(37px, 8vw, 54px);
  --prose: 68ch;

  /* One spacing rhythm, so sections don't each invent their own. */
  --section-y: clamp(66px, 8vw, 100px);
}

h1, h2, h3 { text-wrap: balance; }
h1 { letter-spacing: -0.022em; }
h2 { letter-spacing: -0.015em; }

/* Visible keyboard focus everywhere, not just on inputs. */
:where(a, button, select, input, textarea, summary):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Sections fade up as they enter view. Purely additive: without JS, or with
   reduced motion, everything is simply visible. */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal-ready { transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-ready, .reveal-in { opacity: 1; transform: none; transition: none; }
}

/* The header lifts off the page once you scroll. */
.site-header { transition: box-shadow 0.2s ease, border-color 0.2s ease; }
.site-header.scrolled {
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  border-bottom-color: var(--line);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 15% -10%, rgba(57,135,229,0.12), transparent 45%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.025) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.025) 40px),
    var(--page);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; }
::selection { background: var(--brand); color: #fff; }

/* --- header / nav --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  background: rgba(11,13,12,0.85);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.1px;
  text-decoration: none;
}
.mark { width: 22px; height: 22px; display: block; flex: none; }
.mark.small { width: 15px; height: 15px; }
nav.site-nav { display: flex; align-items: center; gap: 2px; font-size: 14px; }
nav.site-nav a {
  padding: 7px 12px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--ink-dim);
}
nav.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
nav.site-nav a.active { color: var(--ink); background: var(--surface-1); }
nav.site-nav a.cta { background: var(--brand); color: #fff; font-weight: 600; margin-left: 4px; }
nav.site-nav a.cta:hover { background: var(--brand-dim); }
.nav-user {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  margin-left: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* --- hero: full-bleed photo, text overlaid --- */
.hero-photo {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center 35%;
  margin-bottom: 50px;
}
.hero-photo::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,13,12,0.95) 0%, rgba(11,13,12,0.82) 38%, rgba(11,13,12,0.45) 70%, rgba(11,13,12,0.18) 100%),
              linear-gradient(0deg, rgba(11,13,12,0.55), transparent 40%);
}
@media (max-width: 700px) {
  .hero-photo::before { background: linear-gradient(0deg, rgba(11,13,12,0.97) 25%, rgba(11,13,12,0.75) 100%); }
  .hero-photo { min-height: 460px; align-items: flex-end; padding-bottom: 36px; }
}
.hero-photo .hero-inner {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 0 auto; padding: 0 24px; width: 100%;
}
.hero-photo .hero-inner > div { max-width: 560px; }

/* --- product gallery --- */
.gallery-section { max-width: 1080px; margin: 0 auto; padding: var(--section-y) 24px 8px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.gallery-item {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--surface-1);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.78), transparent);
  font-size: 12.5px; color: #fff; font-weight: 600;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 24px 56px;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
}
.eyebrow .ping {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(12,163,12,0.55);
  animation: ping 2s infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(12,163,12,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(12,163,12,0); }
  100% { box-shadow: 0 0 0 0 rgba(12,163,12,0); }
}
.hero h1, .hero-photo h1 {
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 16px;
  letter-spacing: -0.6px;
}
.hero h1 em, .hero-photo h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--brand), #8fe6c4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede, .hero-photo .lede {
  color: var(--ink-dim);
  font-size: var(--step-1);
  line-height: 1.6;
  max-width: 46ch;
  margin: 0 0 28px;
}
.hero .actions, .hero-photo .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px; font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-1);
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dim); }
.btn.accent { background: var(--amber); border-color: var(--amber); color: #1a1300; }
.btn.accent:hover { background: var(--amber-dim); }
.btn:hover { background: var(--surface-2); }

/* --- waveform graphic: floats over the hero photo on wide screens --- */
.wave-frame {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(20,23,22,0.88);
  backdrop-filter: blur(6px);
  padding: 18px;
  position: relative;
  overflow: hidden;
  width: 260px;
}
.hero-photo .wave-frame {
  position: absolute;
  right: 24px;
  bottom: -34px;
  z-index: 2;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
@media (max-width: 900px) {
  .hero-photo .wave-frame { display: none; }
}
.wave-frame .wave-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.wave-viewport {
  overflow: hidden;
  height: 110px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 49%, var(--line) 50%, transparent 51%),
    var(--page);
}
.wave-track {
  display: flex;
  width: 200%;
  height: 100%;
  animation: wave-scroll 4s linear infinite;
}
.wave-track svg { width: 50%; height: 100%; display: block; flex: none; }
@keyframes wave-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.wave-stats {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  font-family: var(--mono);
}
.wave-stats .stat-num { font-size: 20px; color: var(--ink); }
.wave-stats .stat-lbl { font-size: 11px; color: var(--ink-faint); }

/* --- spec sheet section (replaces generic feature cards) --- */
.spec-section { max-width: 1080px; margin: 0 auto; padding: 8px 24px var(--section-y); }
.spec-section h2 {
  font-size: 13px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.spec-item { background: var(--surface-1); padding: 18px 20px; }
.spec-item .k {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brand);
  margin-bottom: 6px;
}
.spec-item .v { font-size: 14px; color: var(--ink); margin: 0 0 4px; font-weight: 600; }
.spec-item .d { font-size: 12.5px; color: var(--ink-dim); margin: 0; line-height: 1.5; }

/* --- impact stats band --- */
.stats-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-1); }
.stats-inner {
  max-width: 1080px; margin: 0 auto; padding: 36px 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px;
}
.stat-block { text-align: center; }
.stat-block .num { font-family: var(--mono); font-size: var(--step-4); font-weight: 700; color: var(--brand); line-height: 1; }
.stat-block .lbl { margin-top: 8px; font-size: 12.5px; color: var(--ink-dim); }

/* --- solutions grid (icon cards) --- */
.solutions-section { max-width: 1080px; margin: 0 auto; padding: var(--section-y) 24px; }
.solutions-section .section-head { text-align: center; max-width: 560px; margin: 0 auto 36px; }
.solutions-section .section-head .eyebrow { justify-content: center; }
.solutions-section .section-head h2 { font-size: var(--step-3); margin: 0 0 12px; }
.solutions-section .section-head p { color: var(--ink-dim); font-size: var(--step-0); margin: 0; line-height: 1.65; }
.solutions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.solution-card {
  background: var(--surface-1); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; transition: border-color 0.15s ease, transform 0.15s ease;
}
.solution-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.3); }
.solution-card .icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(27,175,122,0.14); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.solution-card h3 { font-size: 15px; margin: 0 0 8px; }
.solution-card p { font-size: 13px; color: var(--ink-dim); line-height: 1.55; margin: 0 0 14px; }
.solution-card a { font-size: 13px; color: var(--brand); text-decoration: none; font-weight: 600; }
.solution-card a:hover { text-decoration: underline; }

/* --- CTA band --- */
.cta-band { max-width: 1080px; margin: 0 auto var(--section-y); padding: 0 24px; }
.cta-panel {
  background: linear-gradient(135deg, rgba(27,175,122,0.14), rgba(237,161,0,0.08));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 44px 32px;
  text-align: center;
}
.cta-panel h2 { font-size: var(--step-3); margin: 0 0 12px; }
.cta-panel p { color: var(--ink-dim); font-size: 14px; margin: 0 0 22px; }
.cta-panel .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* --- footer --- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 24px 24px; }
.footer-grid {
  max-width: 1080px; margin: 0 auto; padding-bottom: 32px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-col h4 { font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); margin: 0 0 14px; }
.footer-col p { font-size: 13px; color: var(--ink-dim); line-height: 1.6; margin: 0; max-width: 34ch; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col ul a { font-size: 13px; color: var(--ink-dim); text-decoration: none; }
.footer-col ul a:hover { color: var(--ink); }
.footer-bottom {
  max-width: 1080px; margin: 0 auto; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: var(--ink-faint);
}
.footer-brand { display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--ink-dim); }

/* --- auth pages --- */
.auth-wrap { max-width: 380px; margin: 72px auto; padding: 0 24px; }
.auth-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
}
.auth-card .eyebrow { margin-bottom: 10px; }
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card .sub { color: var(--ink-dim); font-size: 13px; margin: 0 0 22px; }
/* --- repairs --- */
.repair-form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px;
}
.repair-card { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: start; }
.repair-card:not(:has(.repair-thumb)) { grid-template-columns: 1fr; }
@media (max-width: 620px) { .repair-card { grid-template-columns: 1fr; } }
.repair-thumb {
  display: block; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 3 / 4; background: var(--surface-2);
}
.repair-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.repair-info h2 { font-size: 15px; }
.repair-status-form {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center;
}
.repair-status-form select,
.repair-status-form input[type="text"] {
  padding: 7px 10px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-size: 13px; font-family: inherit;
}
.repair-status-form input[type="text"] { flex: 1; min-width: 160px; }
input[type="file"] {
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px dashed var(--line);
  background: var(--surface-2); color: var(--ink-dim); font-size: 13px; font-family: inherit;
}
input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 6px 12px; border-radius: 6px; border: none;
  background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; font-family: inherit;
}

/* --- energy flow diagram --- */
.flow-panel { padding-bottom: 14px; }
.flow-diagram {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 12px 10px;
  max-width: 460px;
  margin: 6px auto 0;
  align-items: center;
  justify-items: center;
}
.flow-pv   { grid-column: 2; grid-row: 1; }
.flow-batt { grid-column: 1; grid-row: 2; }
.flow-inv  { grid-column: 2; grid-row: 2; }
.flow-load { grid-column: 3; grid-row: 2; }
.flow-grid { grid-column: 2; grid-row: 3; }

.flow-node {
  position: relative; z-index: 1;
  width: 100%; max-width: 132px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 8px;
  text-align: center;
}
.flow-node.flow-inv { border-color: var(--brand); background: rgba(27,175,122,0.10); }
.flow-node.flow-nodata { opacity: 0.45; }
.flow-icon { color: var(--brand); display: flex; justify-content: center; margin-bottom: 4px; }
.flow-nodata .flow-icon { color: var(--ink-faint); }
/* Drawn hardware, rather than a line icon — sized to read at node width. */
.flow-art { height: 52px; margin-bottom: 6px; }
.flow-art svg { height: 100%; width: auto; display: block; }
.flow-node { min-height: 136px; display: flex; flex-direction: column; justify-content: center; }
.flow-nodata { min-height: 0; }
.flow-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; color: var(--ink-faint); }
.flow-value { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 2px; line-height: 1.25; }
.flow-nodata .flow-value { font-size: 11.5px; font-weight: 400; color: var(--ink-faint); }
.flow-sub { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); margin-top: 3px; }

.soc-bar {
  height: 5px; border-radius: 3px; background: var(--line);
  margin: 6px 2px 0; overflow: hidden;
}
.soc-bar span {
  display: block; height: 100%; width: 0;
  background: var(--good);
  transition: width 0.4s ease, background 0.4s ease;
}
.soc-bar span.soc-warn { background: var(--amber); }
.soc-bar span.soc-low  { background: #e66767; }

.flow-links { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.flow-link {
  stroke: var(--line); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 6 6;
}
.flow-link.active {
  stroke: var(--brand);
  animation: flow-dash 0.9s linear infinite;
}
.flow-link.reverse { animation-direction: reverse; }
@keyframes flow-dash { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) {
  .flow-link.active { animation: none; }
}
.flow-note {
  font-size: 11.5px; color: var(--ink-faint); text-align: center;
  margin: 14px 0 4px; line-height: 1.5;
}
.flow-note code { font-family: var(--mono); color: var(--ink-dim); }

/* --- WhatsApp floating button --- */
.whatsapp-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
}
.whatsapp-fab:hover { transform: scale(1.07); }
@media (max-width: 600px) { .whatsapp-fab { right: 14px; bottom: 14px; width: 50px; height: 50px; } }

/* --- projects --- */
.project-list { display: flex; flex-direction: column; gap: 16px; }
.project-card {
  display: grid; grid-template-columns: 280px 1fr; gap: 0;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
@media (max-width: 720px) { .project-card { grid-template-columns: 1fr; } }
.project-image { aspect-ratio: 4 / 3; background: var(--surface-2); }
.project-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-body { padding: 20px 22px; }
.project-body h2 { font-size: 17px; margin: 0 0 8px; }
.project-meta {
  font-family: var(--mono); font-size: 11.5px; color: var(--brand);
  letter-spacing: 0.04em; margin-bottom: 10px;
}
.project-body p { margin: 0; font-size: 13.5px; color: var(--ink-dim); line-height: 1.6; }

/* --- inverter settings menu --- */
.settings-grid {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--line); display: flex; flex-direction: column; gap: 1px;
}
.setting-row {
  display: grid; grid-template-columns: 64px 1fr 240px; gap: 16px;
  align-items: center; background: var(--surface-1); padding: 14px 16px;
}
@media (max-width: 720px) {
  .setting-row { grid-template-columns: 52px 1fr; }
  .setting-control { grid-column: 2; }
}
.setting-dimmed { opacity: 0.55; }
.setting-error { background: rgba(230,103,103,0.08); }
.setting-id { font-family: var(--mono); line-height: 1.3; }
.setting-prog { display: block; font-size: 15px; color: var(--ink); }
.setting-mnemonic { display: block; font-size: 10.5px; color: var(--brand); letter-spacing: 0.06em; }
.setting-main label { font-size: 14px; font-weight: 600; color: var(--ink); }
.setting-help { margin: 4px 0 0; font-size: 12px; color: var(--ink-faint); line-height: 1.45; }
.setting-control select,
.setting-control input[type="number"] {
  width: 100%; padding: 8px 10px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); font-size: 13.5px; font-family: inherit;
}
.setting-control select:focus,
.setting-control input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.setting-number { display: flex; align-items: center; gap: 9px; }
.setting-readout { font-family: var(--mono); font-size: 13px; color: var(--ink); white-space: nowrap; }
.setting-range { display: block; margin-top: 5px; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

.contact-details {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 0 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.contact-details a {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--ink-dim); text-decoration: none;
}
.contact-details a svg, .contact-details .contact-location svg { color: var(--brand); flex: none; }
.contact-details a:hover { color: var(--ink); }
.contact-details .contact-location {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--ink-dim);
}

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; font-family: var(--mono); }
.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
}
.field input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.auth-card button {
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 6px;
}
.auth-card button:hover { background: var(--brand-dim); }
.error-msg {
  background: rgba(230,103,103,0.12);
  color: #f08a8a;
  border: 1px solid rgba(230,103,103,0.35);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* --- telemetry dashboard --- */
.page-sub {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 24px 0; max-width: 1080px; margin: 0 auto; flex-wrap: wrap;
}
.page-sub h1 { font-size: 18px; margin: 0; }
.page-sub .sub { color: var(--ink-dim); font-size: 13px; font-family: var(--mono); }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-dim); font-family: var(--mono); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #e66767; }
.dot.live { background: var(--good); }

main.dash { padding: 16px 24px 48px; max-width: 1080px; margin: 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 20px; }
.tile { background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; }
.tile .label { font-size: 11px; color: var(--ink-faint); margin-bottom: 5px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
.tile .value { font-size: 22px; font-variant-numeric: proportional-nums; }
.tile .unit { font-size: 13px; color: var(--ink-dim); margin-left: 2px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge.good { background: rgba(12,163,12,0.16); color: var(--good); }
.badge.off { background: var(--surface-2); color: var(--ink-faint); }
.badge .dot2 { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.switch {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  position: relative;
  padding: 0;
  cursor: pointer;
  flex: none;
}
.switch .switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: transform 0.15s ease, background 0.15s ease;
}
.switch[aria-pressed="true"] { background: rgba(12,163,12,0.22); border-color: var(--good); }
.switch[aria-pressed="true"] .switch-thumb { transform: translateX(18px); background: var(--good); }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- confirm/auth modal --- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-card {
  width: 100%; max-width: 360px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  transform: translateY(6px);
  transition: transform 0.12s ease;
}
.modal-overlay.open .modal-card { transform: translateY(0); }
.modal-card h3 { margin: 0 0 8px; font-size: 16px; }
.modal-card p { margin: 0 0 16px; color: var(--ink-dim); font-size: 13.5px; line-height: 1.5; }
.modal-card .field { margin-bottom: 16px; }
.modal-card .field label { display: block; font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; font-family: var(--mono); }
.modal-card .field input {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 14px;
}
.modal-card .field input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.modal-card .modal-error {
  background: rgba(230,103,103,0.12); color: #f08a8a;
  border: 1px solid rgba(230,103,103,0.35); border-radius: 8px;
  padding: 8px 11px; font-size: 12.5px; margin-bottom: 14px; display: none;
}
.modal-card .modal-error.show { display: block; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-actions button {
  padding: 9px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
}
.modal-actions button.danger { background: var(--amber); border-color: var(--amber); color: #1a1300; }
.modal-actions button:hover { filter: brightness(1.1); }
.modal-actions button:disabled { opacity: 0.6; cursor: not-allowed; }

section.chart { background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 10px; margin-bottom: 16px; }
section.chart h2 { font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-dim); margin: 0 0 10px; }
svg.plot { width: 100%; height: 180px; display: block; overflow: visible; }
.gridline { stroke: var(--line); stroke-width: 1; }
.line-path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.end-dot { r: 4; }
.hover-line { stroke: var(--ink-faint); stroke-width: 1; opacity: 0; pointer-events: none; }
.hover-dot { r: 4; opacity: 0; pointer-events: none; }
.tooltip {
  position: absolute; pointer-events: none;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 8px; font-size: 12px; font-family: var(--mono); color: var(--ink);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4); opacity: 0; white-space: nowrap;
}
.chart-wrap { position: relative; }
details.table-toggle { margin-top: 4px; }
details.table-toggle summary { cursor: pointer; font-size: 12px; color: var(--ink-dim); padding: 4px 0; font-family: var(--mono); }
table.readings { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; font-family: var(--mono); margin-top: 6px; }
table.readings th, table.readings td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--line); color: var(--ink-dim); }
table.readings th:first-child, table.readings td:first-child { text-align: left; }
table.readings th { color: var(--ink-faint); font-weight: 600; }
