/* IoT Connect web UI — design tokens, shell, components.
   Look follows the RTK Ntrip web UI (light page, blue top bar, white cards).
   Spec: docs/superpowers/specs/2026-10-06-licensing-plans-design.md (Phase 1) */

:root {
  --bg: #e9edf3;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --surface-3: #e2e7ee;
  --border: #d9dfe7;
  --border-strong: #bcc7d4;
  --text: #333333;
  --text-2: #555555;
  --heading: #005a9e;
  --muted: #778899;
  --faint: #9aa7b4;
  --link: #005a9e;
  --link-hover: #004b82;
  --accent: #005a9e;
  --accent-hover: #004b82;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2fd;
  --accent-border: #90caf9;
  --ok: #2e7d32;
  --ok-soft: #e8f5e9;
  --ok-border: #a5d6a7;
  --warn: #e65100;
  --warn-soft: #fff3e0;
  --warn-border: #ffcc80;
  --err: #c62828;
  --err-soft: #ffebee;
  --err-border: #ef9a9a;
  --neutral: #607d8b;
  --neutral-soft: #eceff1;
  --switch-off: #bcc7d4;
  --knob: #ffffff;
  --topbar: #005a9e;
  --hero-from: #0b3b66;
  --hero-to: #005a9e;
  --topbar-ink: #ffffff;
  --topbar-link: rgba(255, 255, 255, 0.85);
  --topbar-chip: rgba(255, 255, 255, 0.15);
  --topbar-chip-strong: rgba(255, 255, 255, 0.25);
  --topbar-chip-border: rgba(255, 255, 255, 0.3);
  --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-knob: 0 1px 3px rgba(0, 0, 0, 0.3);
  --backdrop: rgba(0, 0, 0, 0.45);
  --r-sm: 4px;
  --r: 6px;
  --r-lg: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); min-height: 100vh; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.spacer { flex: 1; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--r);
  background: transparent; border: 1px solid var(--border-strong); color: var(--text);
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-danger { border-color: var(--err-border); color: var(--err); }
.btn-danger:hover { background: var(--err-soft); color: var(--err); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r); border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ── form fields ── */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select {
  min-height: 44px; padding: 0 12px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); font-size: 14px;
}
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 160px; }
.field-inline { flex: 1; }

/* ── auth ── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 16px; }
.auth-title { font-size: 22px; font-weight: 600; }
.auth-alt { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ── shell: RTK top bar ── */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--heading); }
.brand-mark { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
.shell { min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 16px;
  background: var(--topbar); color: var(--topbar-ink);
}
.brand-pill {
  flex: none; padding: 5px 12px; border-radius: var(--r-sm);
  background: var(--topbar-chip); border: 1px solid var(--topbar-chip-border);
  color: var(--topbar-ink); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap;
}
.brand-pill:hover { background: var(--topbar-chip-strong); color: var(--topbar-ink); }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--topbar-link); text-decoration: none; font-size: 14px; white-space: nowrap;
}
.nav-link:hover { background: var(--topbar-chip); color: var(--topbar-ink); }
.nav-link.active { background: var(--topbar-chip-strong); color: var(--topbar-ink); font-weight: 600; }
.nav-sep { flex: none; width: 1px; height: 20px; margin: 0 6px; background: var(--topbar-chip-border); }
.nav-section { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 16px 12px 6px; }
.topbar-user { flex: none; display: flex; align-items: center; gap: 8px; }
.topbar-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--topbar-link); }
.topbar-btn {
  display: inline-flex; align-items: center; text-decoration: none;
  min-height: 36px; padding: 0 12px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; font-size: 13px;
  background: var(--topbar-chip); border: 1px solid var(--topbar-chip-border); color: var(--topbar-ink);
}
.topbar-btn:hover { background: var(--topbar-chip-strong); }
.topbar-btn-light { background: var(--surface); color: var(--accent); border-color: var(--surface); }
.topbar-btn-light:hover { background: var(--accent-soft); color: var(--accent); }
.content { width: 100%; max-width: 1280px; margin: 0 auto; min-width: 0; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 20px; outline: none; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px; }
  .topbar-user { margin-left: auto; }
  .topbar-name { display: none; }
  .nav-links { order: 3; flex-basis: 100%; margin-left: 0; }
  .content { padding: 16px 16px 40px; }
}

/* ── page header, breadcrumb, tabs ── */
.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.page-title { flex: 1 1 260px; min-width: 0; }
.page-title h1 { font-size: 24px; font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.page-title p { margin: 4px 0 0; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.breadcrumb { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px; display: flex; flex-direction: column; }
.fact span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.fact strong { font-family: var(--mono); font-weight: 500; font-size: 13px; }

/* ── search, pills ── */
.search { display: flex; align-items: center; gap: 8px; flex: 0 1 300px; min-height: 44px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); color: var(--muted); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; font-weight: 500; font-size: 13px; }
.pill[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pill-count { font-family: var(--mono); font-size: 12px; opacity: 0.75; }

/* ── cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h2 { font-size: 15px; font-weight: 600; color: var(--heading); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card-title { color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title:hover { color: var(--link); }
.device-card-head { display: flex; align-items: flex-start; gap: 10px; }
.device-card-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }

/* ── chip, status ── */
.chip { display: inline-flex; align-items: center; font-size: 12px; border-radius: 6px; padding: 2px 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip-accent { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.chip-ok { color: var(--ok); border-color: var(--ok-border); background: var(--ok-soft); }
.chip-warn { color: var(--warn); border-color: var(--warn-border); background: var(--warn-soft); }
.chip-err { color: var(--err); border-color: var(--err-border); background: var(--err-soft); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-on { color: var(--ok); }
.status-off { color: var(--muted); }

/* ── stats ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: var(--r); padding: 10px 12px; min-width: 0; }
.stat-label { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
.stat-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-unit { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 3px; }

/* ── outputs ── */
.output-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.output-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.output-row:last-child { border-bottom: 0; }
.output-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.output-name { font-weight: 500; }
.output-caption { font-size: 12px; color: var(--muted); }
.tone-ok { color: var(--ok); }
.tone-warn { color: var(--warn); }

/* ── switch, segmented ── */
.switch { position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px; border: 0; padding: 0; background: var(--switch-off); cursor: pointer; transition: background 0.15s; }
.switch[aria-pressed="true"] { background: var(--accent); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--knob); box-shadow: var(--shadow-knob); transition: left 0.15s; }
.switch[aria-pressed="true"] .switch-knob { left: 23px; }
.switch.is-pending { opacity: 0.6; }
.switch:disabled { opacity: 0.35; cursor: not-allowed; }
.switch-sm { width: 40px; height: 24px; }
.switch-sm .switch-knob { width: 18px; height: 18px; }
.switch-sm[aria-pressed="true"] .switch-knob { left: 19px; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.seg-btn { border: 0; border-radius: 6px; padding: 0 12px; min-height: 32px; font-size: 13px; font-weight: 500; background: transparent; color: var(--muted); cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-knob); }

/* ── rules, empty ── */
.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rule { background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; }
.rule-off { color: var(--muted); }
.empty { margin: 0; color: var(--muted); }

/* ── modal ── */
.modal-backdrop { position: fixed; inset: 0; background: var(--backdrop); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1000; }
.modal { width: 100%; max-width: 640px; max-height: 90vh; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-pop); }
.modal h2 { font-size: 18px; }
.modal-body { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.group-box { border: 1px solid var(--border); border-radius: var(--r); padding: 12px; margin: 0; }
.group-head { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ── toast ── */
#toast { position: fixed; bottom: 24px; right: 24px; max-width: calc(100vw - 48px); background: var(--surface); color: var(--text); padding: 12px 18px; border-radius: var(--r); border: 1px solid var(--accent); box-shadow: var(--shadow-pop); display: none; z-index: 2000; }
#toast.show { display: block; }
#toast.ok { border-color: var(--ok); }
#toast.err { border-color: var(--err); color: var(--err); }

/* ── legacy classes: alarm section and device config tabs (moved unchanged) ── */
.legacy h2 { font-size: 13px; font-weight: 600; color: var(--heading); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.legacy h3 { font-size: 15px; font-weight: 600; margin: 18px 0 10px; }
.frow { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.frow label { min-width: 150px; color: var(--muted); font-size: 13px; }
.frow input[type=text], .frow input[type=password], .frow input[type=email], .frow input[type=number], .frow select {
  min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); min-width: 200px;
}
.frow input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.legacy .btn { margin-top: 8px; }
.legacy .btn:not(.btn-sm):not(.btn-warn) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-warn { border-color: var(--err-border) !important; color: var(--err) !important; background: transparent !important; }
.section-note { color: var(--muted); font-size: 13px; }
.rcwl-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 14px; }
.device-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 14px; }
.device-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; cursor: pointer; }
.legacy .device-card:hover { border-color: var(--accent); }
.device-card-name { font-weight: 600; margin-bottom: 8px; }
.device-card-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reading-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: var(--ok); background: var(--ok-soft); border: 1px solid var(--ok-border); }
.state-off { color: var(--neutral); background: var(--neutral-soft); border-color: var(--border-strong); }
.inv-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; color: var(--warn); border: 1px solid var(--warn-border); }
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 14px 0; overflow-x: auto; }
.tablinks { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); min-height: 44px; padding: 0 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.tablinks.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabcontent { display: none; }

/* PIN pad (alarm) */
.pin-modal-backdrop { position: fixed; inset: 0; background: var(--backdrop); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.pin-modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; width: 300px; text-align: center; }
.pin-modal h3 { margin-bottom: 16px; }
.pin-display { font-size: 1.6em; letter-spacing: 0.3em; min-height: 1.4em; margin-bottom: 16px; color: var(--accent); }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.pin-key { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); min-height: 52px; border-radius: var(--r-sm); font-size: 1.1em; cursor: pointer; }
.pin-key:hover { border-color: var(--accent); }
.pin-modal .frow { justify-content: center; }

/* ── Board Builder (Admin → Board Types) ── */
#boards { display: flex; flex-direction: column; gap: 20px; }
.table-scroll { overflow-x: auto; }
.bb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bb-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px 6px; white-space: nowrap; }
.bb-table td { padding: 6px; border-top: 1px solid var(--border); vertical-align: middle; }
.bb-table td.mono { white-space: nowrap; }
.bb-table input[type=text], .bb-table select { min-height: 36px; padding: 0 8px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.bb-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.bb-table tr.bb-off td { opacity: 0.45; }
.bb-table tr.bb-err td { background: var(--err-soft); }
.bb-table tr.bb-warn td { background: var(--warn-soft); }
.bb-actions { display: flex; gap: 8px; justify-content: flex-end; }
.bb-note { font-size: 12px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-identity { align-items: flex-end; }
.bb-name { flex: 2 1 260px; }
.bb-name input { font-size: 18px; font-weight: 600; }
.bb-chip-box { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.bb-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.bb-main, .bb-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1100px) { .bb-layout { grid-template-columns: minmax(0, 1fr); } }
.bb-bus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.bb-bus { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.bb-bus.is-on { border-color: var(--accent-border); }
.bb-bus-head { display: flex; align-items: center; justify-content: space-between; }
.bb-slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bb-slot select, .bb-slot input { min-height: 36px; min-width: 96px; }
.bb-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bb-issue { display: flex; gap: 10px; align-items: baseline; color: var(--text-2); }
.bb-issue .status-dot { flex: none; transform: translateY(-1px); }
.bb-issue-err { color: var(--err); }
.bb-issue-err .status-dot { color: var(--err); }
.bb-issue-warn .status-dot { color: var(--warn); }
.bb-preview-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bb-preview-group .nav-section { padding: 0; }
.bb-free-list { font-size: 12px; flex-basis: 100%; }
select.bb-err, input.bb-err { border-color: var(--err) !important; }
select.bb-warn, input.bb-warn { border-color: var(--warn) !important; }

/* chip picker */
.modal-wide { max-width: 980px; }
.chip-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; overflow-y: auto; }
.chip-card { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer; }
.chip-card:hover, .chip-card:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.chip-card-title { font-weight: 700; font-size: 16px; }
.chip-card-big { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip-card-big small { font-size: 13px; font-weight: 500; color: var(--muted); }
.chip-card-fact { font-size: 12px; color: var(--text-2); font-family: var(--mono); }
.chip-card-fact b { font-family: var(--font); font-weight: 600; color: var(--muted); margin-right: 4px; }

/* device board type */
.fact-button { cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.fact-button:hover { border-color: var(--accent); }
.board-options { gap: 6px; }
.board-options .nav-section { padding: 10px 0 2px; }
.board-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; }
.board-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.board-option input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.board-option > span { display: flex; flex-direction: column; gap: 2px; }
.board-option .muted { font-size: 12px; }

/* ── tables, licenses, plans ── */
.page-stack { display: flex; flex-direction: column; gap: 20px; }
[hidden] { display: none !important; }
.small { font-size: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px 6px; white-space: nowrap; border-bottom: 1px solid var(--border-strong); }
.data-table td { padding: 8px 6px; border-top: 1px solid var(--border); vertical-align: top; }
@media (max-width: 760px) {
  .data-table-stack thead { display: none; }
  .data-table-stack tr { display: block; padding: 10px 0; border-top: 1px solid var(--border); }
  .data-table-stack tr:first-child { border-top: 0; }
  .data-table-stack td { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 4px 0; border: 0; }
  .table-scroll:has(.data-table-stack) { overflow-x: visible; }
  .data-table-stack td::before { content: attr(data-label); flex: 0 0 96px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
  .data-table-stack td:empty { display: none; }
}
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.license-key { white-space: nowrap; color: var(--ok); font-weight: 600; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; align-items: stretch; }
.plan-card.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-card); }
.plan-price { font-size: 26px; font-weight: 700; color: var(--heading); }
.plan-features { margin: 0; padding-left: 18px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.plan-action { display: flex; gap: 8px; align-items: center; }
.notice-warn { border-color: var(--warn-border); background: var(--warn-soft); }
.payment-instructions { margin: 0; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; font-family: var(--mono); font-size: 13px; }
.field textarea { min-height: 96px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); font: inherit; resize: vertical; }

/* ── downloads ── */
.dl-install { display: flex; align-items: center; gap: 12px; }
.dl-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dl-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dl-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); }

/* ── home ── */
.home { display: flex; flex-direction: column; gap: 8px; }
.home-hero { margin: -24px calc(50% - 50vw) 8px; padding: 64px 24px 56px; text-align: center; color: var(--topbar-ink);
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); }
.home-hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 14px; color: var(--topbar-ink); }
.home-hero p { max-width: 720px; margin: 0 auto 26px; font-size: 18px; color: var(--topbar-link); }
.home-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.home-btn-light { background: var(--surface); color: var(--accent); border-color: var(--surface); }
.home-btn-light:hover { background: var(--accent-soft); color: var(--accent); }
.home-btn-outline { color: var(--topbar-ink); border-color: var(--topbar-chip-border); }
.home-btn-outline:hover { background: var(--topbar-chip); color: var(--topbar-ink); }
.home-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.home-chips span { padding: 4px 12px; border-radius: 999px; background: var(--topbar-chip); border: 1px solid var(--topbar-chip-border); font-size: 13px; }
.home-section { padding: 28px 0 8px; display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 64px; }
.home-section h2 { font-size: 26px; text-align: center; color: var(--heading); margin: 0; }
.home-lead { text-align: center; color: var(--text-2); margin: 0 auto; max-width: 760px; line-height: 1.6; }
.home-demo-login { margin-top: 12px; }
.home-demo-login code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; }
.demo-banner { background: var(--warn-soft); border-bottom: 1px solid var(--warn-border); color: var(--text); padding: 8px 16px; text-align: center; font-size: 0.92em; }
.demo-banner a { color: var(--link); font-weight: 600; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.home-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.home-feature h3, .home-case h3, .home-kind h3 { margin: 0; font-size: 16px; color: var(--heading); }
.home-feature p, .home-case p, .home-kind p { margin: 0; color: var(--text-2); line-height: 1.5; }
.home-icon { font-size: 26px; }
.home-kind-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-group { margin: 8px 0 0; color: var(--text-2); font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; }
.home-board-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.home-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.home-steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 18px; color: var(--text-2); }
.home-steps li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-bottom: 8px; }
.home-steps strong { display: block; color: var(--text); }
.home-faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; margin: 0 auto; width: 100%; }
.home-faq summary { cursor: pointer; font-weight: 600; color: var(--heading); }
.home-faq p { margin: 8px 0 0; color: var(--text-2); line-height: 1.5; }
.home-footer { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; padding: 28px 0 8px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 24px; }
.home-diagram-card { padding: 16px; }
.home-diagram { width: 100%; height: auto; }
.home-diagram-tall { display: none; max-width: 420px; margin: 0 auto; }
@media (max-width: 760px) { .home-diagram-wide { display: none; } .home-diagram-tall { display: block; } .home-hero { margin-top: -16px; } }
.dg-col { font: 700 12px var(--font); letter-spacing: 0.1em; fill: var(--heading); }
.dg-box { fill: var(--surface); stroke: var(--border-strong); }
.dg-box-dark { fill: var(--accent-hover); stroke: var(--accent-hover); }
.dg-cloud { fill: var(--accent); }
.dg-title { font: 700 13px var(--font); fill: var(--text); }
.dg-sub { font: 11px var(--font); fill: var(--muted); }
.dg-title-dark { font: 700 13px var(--font); fill: var(--accent-ink); }
.dg-sub-dark { font: 11px var(--font); fill: var(--topbar-link); }
.dg-item { font: 12px var(--font); fill: var(--text-2); }
.dg-link { fill: none; stroke: var(--accent-border); stroke-width: 3; }
.dg-dot { fill: var(--accent); }
@media (prefers-reduced-motion: reduce) { .dg-dot { display: none; } }
/* ── your own devices ── */
.diy-section { margin-top: 18px; }
.diy-head h2 { margin: 0 0 4px; }
.diy-add { display: flex; flex-wrap: wrap; gap: 8px; }
.diy-add input { flex: 1 1 180px; min-width: 0; }
.diy-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.diy-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.diy-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.diy-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.diy-kv dt { color: var(--muted); }
.diy-kv dd { margin: 0; overflow-wrap: anywhere; }
.diy-warn { background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: 6px; padding: 8px 12px; margin: 0; }
