/* =========================================================================
   Digits — design system stylesheet
   Direction C (home intercom / soft domestic hardware) reinterpreted for an
   app surface. Warm paper, walnut, brass spice. App-grade density, not
   marketing-page generosity.
   ========================================================================= */

/* --------- Fonts (self-hosted, woff2) --------- */

@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces-variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter Tight";
  src: url("/static/fonts/inter-tight-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("/static/fonts/inter-tight-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("/static/fonts/inter-tight-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --------- Tokens --------- */

:root {
  /* Palette (light) */
  --paper:      #f5f1ea;
  --paper-2:    #efe8d9;
  --ink:        #2a1f18;
  --ink-soft:   #5a4a38;
  --ink-muted:  #8a7a63;
  --rule:       #d6ccb8;
  --rule-soft:  #e4dbc7;
  --brass:      #c48b3a;
  --brass-soft: #e4c38a;
  --forest:     #3d6b4f;
  --rust:       #a05a3a;
  --ochre:      #c79a3a;

  /* Typography */
  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(42,31,24,0.05), 0 2px 6px -3px rgba(42,31,24,0.07);
  --shadow-2: 0 2px 4px rgba(42,31,24,0.06), 0 4px 14px -4px rgba(42,31,24,0.10);

  /* Radii */
  --radius-1: 8px;
  --radius-2: 12px;

  /* Layout */
  --rail-h: 56px;
  --page-max: 1180px;
  --page-pad: 24px;
}

/* --------- Reset / base --------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 15px; } /* compressed baseline for app density */

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* --------- Top rail --------- */

.rail {
  display: flex;
  align-items: center;
  height: var(--rail-h);
  padding: 0 var(--page-pad);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  gap: 28px;
}

.rail__brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.rail__mark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.01em;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  color: var(--ink);
}
.rail__household {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail__household::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--rule);
  margin: 0 10px 0 0;
  vertical-align: -1px;
}

.rail__nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  margin-right: 12px;
  flex: 1;
  justify-content: flex-end;
}
.rail__nav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.rail__nav a:hover {
  color: var(--ink);
  background: var(--paper-2);
  text-decoration: none;
}
.rail__nav a.is-active {
  color: var(--ink);
  font-weight: 500;
  box-shadow: inset 0 -2px 0 0 var(--brass);
  border-radius: 6px 6px 0 0;
}

.rail__session {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-muted);
}
.rail__session form { display: inline; }
.rail__session button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* --------- Page --------- */

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px var(--page-pad) 64px;
}
.page__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.page__title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-weight: 500;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin: 0;
}
.page__sub {
  font-size: 13px;
  color: var(--ink-muted);
}

/* --------- Stat strip (compressed, not KPI tiles) --------- */

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
  overflow: hidden;
}
.strip__cell {
  flex: 1 1 140px;
  padding: 14px 18px;
  border-right: 1px solid var(--rule-soft);
  min-width: 0;
}
.strip__cell:last-child { border-right: 0; }
.strip__label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 4px;
  font-weight: 500;
}
.strip__value {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.strip__value--brass { color: var(--brass); }
.strip__value--forest { color: var(--forest); }
.strip__cell--muted .strip__value { color: var(--ink-muted); }

@media (max-width: 640px) {
  .strip__cell {
    flex-basis: 50%;
    border-right: 1px solid var(--rule-soft);
    border-bottom: 1px solid var(--rule-soft);
  }
  .strip__cell:nth-child(2n) { border-right: 0; }
  .strip__cell:nth-last-child(-n+2) { border-bottom: 0; }
}

/* --------- Panel (generic card) --------- */

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.panel__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  letter-spacing: 0.01em;
}
.panel__title-sub {
  font-size: 12px;
  color: var(--ink-muted);
}
.panel__action {
  font-size: 12.5px;
  color: var(--ink-soft);
}
.panel__action:hover { color: var(--brass); text-decoration: none; }

/* --------- Line row (density-first) --------- */

.lines { list-style: none; margin: 0; padding: 0; }
.lines__row {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule-soft);
  min-height: 44px;
  color: var(--ink);
}
.lines__row:last-child { border-bottom: 0; }
.lines__row:hover { background: var(--paper-2); text-decoration: none; }

.lines__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-muted);
  justify-self: center;
}
.lines__dot--on {
  background: var(--forest);
  box-shadow: 0 0 0 3px rgba(61,107,79,0.12);
}

.lines__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lines__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.lines__state {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.lines__state--on { color: var(--forest); }

/* --------- Footer version string --------- */

.page__foot {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
  font-size: 11px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.page__foot .num {
  font-family: var(--font-mono);
  font-size: 11px;
}

/* --------- Mobile disclosure for nav --------- */

@media (max-width: 720px) {
  .rail { gap: 14px; padding: 0 16px; }
  .rail__nav {
    position: fixed;
    inset: var(--rail-h) 0 auto 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    align-items: stretch;
    padding: 6px 16px 12px;
    box-shadow: var(--shadow-2);
    display: none;
  }
  .rail__nav.is-open { display: flex; }
  .rail__nav a {
    padding: 10px 10px;
    font-size: 14px;
  }
  .rail__nav a.is-active {
    box-shadow: inset 3px 0 0 0 var(--brass);
    border-radius: 0 6px 6px 0;
  }
  .rail__toggle {
    margin-left: auto;
    padding: 6px 10px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    font-size: 13px;
    color: var(--ink-soft);
  }
  .rail__session { display: none; }
  .page { padding: 20px 16px 48px; }
  .page__title { font-size: 24px; }
}
@media (min-width: 721px) {
  .rail__toggle { display: none; }
}

/* =========================================================================
   Components
   ========================================================================= */

/* --------- Buttons --------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-1);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--paper-2); text-decoration: none; }
.btn:active { box-shadow: inset 0 1px 2px rgba(42,31,24,0.1); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn--primary:hover { background: #3a2d23; border-color: #3a2d23; }

.btn--brass {
  background: var(--brass);
  color: #2a1f10;
  border-color: #a67528;
  font-weight: 500;
}
.btn--brass:hover { background: #b57e32; border-color: #8e6322; }

.btn--danger {
  color: var(--rust);
  border-color: rgba(160, 90, 58, 0.35);
  background: rgba(160, 90, 58, 0.04);
}
.btn--danger:hover { background: rgba(160, 90, 58, 0.1); border-color: var(--rust); }

.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
  padding: 6px 10px;
}
.btn--quiet:hover { color: var(--ink); background: var(--paper-2); }

.btn--sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }

/* --------- Forms --------- */

.field { margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 5px;
}
.field__input,
.field__select,
.field__textarea {
  width: 100%;
  padding: 8px 12px;
  background: #fbf7ef;
  border: 1px solid var(--rule);
  border-radius: var(--radius-1);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(196,139,58,0.15);
}
.field__input::placeholder { color: var(--ink-muted); opacity: 0.6; }
.field__input--mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.field__input--center { text-align: center; }
.field__input--big {
  font-size: 20px;
  padding: 10px 14px;
  letter-spacing: 0.25em;
}
.field__hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
}
.field__hint--err { color: var(--rust); }
.field__input[aria-invalid="true"],
.field__input.is-invalid {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(160,90,58,0.1);
}

.form-row {
  display: grid;
  gap: 14px;
}
@media (min-width: 720px) {
  .form-row { grid-template-columns: repeat(3, 1fr); }
  .form-row--2 { grid-template-columns: repeat(2, 1fr); }
}

/* --------- Toggle (privacy) --------- */

.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.toggle__track {
  position: absolute;
  inset: 0;
  background: var(--rule);
  border-radius: 999px;
  transition: background-color 0.15s ease;
}
.toggle__track::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: #fbf7ef;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(42,31,24,0.2);
  transition: left 0.18s ease;
}
.toggle input:checked ~ .toggle__track { background: var(--brass); }
.toggle input:checked ~ .toggle__track::after { left: 18px; }
.toggle input:focus-visible ~ .toggle__track {
  box-shadow: 0 0 0 3px rgba(196,139,58,0.25);
}

/* --------- Chip / state badge (used sparingly — prefer dot) --------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  background: var(--paper-2);
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  border: 1px solid var(--rule-soft);
}
.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
}
.chip--on    { color: var(--forest); background: rgba(61,107,79,0.08); border-color: rgba(61,107,79,0.2); }
.chip--on    .chip__dot { background: var(--forest); }
.chip--warn  { color: var(--ochre); background: rgba(199,154,58,0.08); border-color: rgba(199,154,58,0.25); }
.chip--warn  .chip__dot { background: var(--ochre); }
.chip--live  { color: var(--brass); background: rgba(196,139,58,0.1); border-color: rgba(196,139,58,0.3); }
.chip--live  .chip__dot { background: var(--brass); animation: pulse 1.6s ease-in-out infinite; }
.chip--err   { color: var(--rust); background: rgba(160,90,58,0.08); border-color: rgba(160,90,58,0.25); }
.chip--err   .chip__dot { background: var(--rust); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196,139,58,0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(196,139,58,0); }
}

/* --------- Banner (flash messages) --------- */

.banner {
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-1);
  font-size: 13.5px;
  margin-bottom: 16px;
  background: var(--paper-2);
  color: var(--ink);
  line-height: 1.5;
}
.banner--ok    { color: var(--forest); background: rgba(61,107,79,0.06); border-color: rgba(61,107,79,0.25); }
.banner--warn  { color: var(--ochre); background: rgba(199,154,58,0.06); border-color: rgba(199,154,58,0.25); }
.banner--err   { color: var(--rust); background: rgba(160,90,58,0.06); border-color: rgba(160,90,58,0.25); }

/* --------- Key-value list (settings, detail) --------- */

.kv { margin: 0; padding: 0; }
.kv__row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13.5px;
}
.kv__row:last-child { border-bottom: 0; }
.kv__key {
  color: var(--ink-muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 500;
}
.kv__val { color: var(--ink); word-break: break-word; }
.kv__val--mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.kv__val--muted { color: var(--ink-muted); font-style: italic; }
@media (max-width: 640px) {
  .kv__row {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px 14px;
  }
}

/* --------- Radio card (voice style, update release) --------- */

.radio-card {
  display: block;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-1);
  cursor: pointer;
  background: var(--paper);
  transition: border-color 0.12s, background-color 0.12s, box-shadow 0.12s;
  position: relative;
}
.radio-card + .radio-card { margin-top: 8px; }
.radio-card:hover { background: var(--paper-2); }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card:has(input:checked) {
  border-color: var(--brass);
  background: rgba(196,139,58,0.05);
  box-shadow: 0 0 0 2px rgba(196,139,58,0.15);
}
.radio-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.radio-card__indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  flex-shrink: 0;
  position: relative;
  background: #fbf7ef;
}
.radio-card:has(input:checked) .radio-card__indicator {
  border-color: var(--brass);
}
.radio-card:has(input:checked) .radio-card__indicator::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--brass);
  border-radius: 50%;
}
.radio-card__desc {
  margin: 3px 0 0 24px;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.radio-card__meta {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

/* --------- Empty state --------- */

.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.55;
}
.empty__icon {
  color: var(--ink-muted);
  opacity: 0.55;
  margin: 0 auto 10px;
  display: block;
}
.empty a { color: var(--brass); }

/* --------- Tables --------- */

.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.t thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper-2);
}
.t tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: rgba(236,228,209,0.4); }
.t td.num, .t th.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.t td.r, .t th.r { text-align: right; }

/* --------- Signature graphic: phone silhouette (inline SVG container) --------- */

.phone-art {
  color: var(--ink);
  width: 100%;
  height: auto;
  display: block;
}
.phone-art .stroke { stroke: currentColor; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.phone-art .fill   { fill: currentColor; }
.phone-art .brass  { fill: var(--brass); }

/* --------- Signature: push-button keypad (pair-a-device ceremony) --------- */

/* Modeled after the Western Electric 2500-series desk phone used by Digits:
   12 keys (1-9, *, 0, #), light buttons inset into a darker chassis. */

.keypad {
  --kp-w: 260px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: var(--kp-w);
  margin: 0 auto;
  padding: 18px;
  background: linear-gradient(180deg, #2e231b 0%, #241a14 100%);
  border: 1px solid #1a120d;
  border-radius: var(--radius-2);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -2px 4px rgba(0,0,0,0.3),
    var(--shadow-2);
}
@media (max-width: 480px) {
  .keypad { --kp-w: 220px; gap: 8px; padding: 14px; }
}

.keypad__btn {
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, #f3ece0 0%, #e2d7c2 100%);
  border: 1px solid #b7a788;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 1px 1px rgba(0,0,0,0.3);
  transition: transform 0.06s ease, box-shadow 0.08s ease, background 0.1s;
  user-select: none;
  font-family: inherit;
  color: var(--ink);
}
.keypad__btn:hover {
  background: linear-gradient(180deg, #fbf5ea 0%, #ede2cc 100%);
}
.keypad__btn:active,
.keypad__btn.is-pressed {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.25),
    0 0 0 rgba(0,0,0,0);
  background: linear-gradient(180deg, #e0d5be 0%, #d0c2a6 100%);
}
.keypad__btn:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
.keypad__num {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  color: #1a120d;
  letter-spacing: -0.01em;
}
.keypad__letters {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 8px;
  letter-spacing: 0.14em;
  color: rgba(26,18,13,0.6);
  text-transform: uppercase;
  margin-top: 1px;
}
.keypad__btn--symbol .keypad__num {
  font-size: 20px;
  color: rgba(26,18,13,0.7);
}

/* Chassis label strip under the keypad (like the small card slot on real phones) */
.keypad-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.keypad-wrap__strip {
  width: 220px;
  height: 22px;
  background: #fbf7ef;
  border: 1px solid #b7a788;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-style: italic;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@media (max-width: 480px) {
  .keypad-wrap__strip { width: 180px; font-size: 10px; }
}

/* Pairing code display slots (the 6 digits being entered) */
.pin {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
}
.pin__slot {
  width: 36px;
  height: 48px;
  border: 1px solid var(--rule);
  border-bottom: 2px solid var(--rule);
  background: #fbf7ef;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.12s;
}
.pin__slot.is-filled { border-bottom-color: var(--brass); }
.pin__slot.is-active { border-bottom-color: var(--ink); }

/* --------- Layouts for two-column page sections --------- */

.cols {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 880px) {
  .cols--2 { grid-template-columns: 1fr 1fr; }
  .cols--side { grid-template-columns: 2fr 1fr; }
}

/* --------- Signature: hub-and-spoke for Connected Families (N ≥ 1) --------- */

.hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 32px;
  gap: 14px;
}
.hub__spokes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 24px 32px;
  width: 100%;
  max-width: 760px;
}
.hub__spoke {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 70px;
  max-width: 160px;
  position: relative;
  padding-bottom: 18px;
}
.hub__spoke::after {
  /* brass dashed thread going down from spoke to rail */
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  height: 14px;
  background: repeating-linear-gradient(to bottom, var(--brass) 0 3px, transparent 3px 6px);
}
.hub__house {
  width: 52px;
  height: 52px;
  color: var(--ink);
}
.hub__label {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-style: italic;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink);
  text-align: center;
  line-height: 1.25;
  max-width: 140px;
  overflow-wrap: break-word;
}
.hub__since {
  font-size: 10.5px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
  line-height: 1.2;
}
.hub__rail {
  width: calc(100% - 16px);
  max-width: 600px;
  height: 2px;
  background:
    radial-gradient(circle at 0 50%, var(--brass) 2px, transparent 2.5px),
    radial-gradient(circle at 100% 50%, var(--brass) 2px, transparent 2.5px),
    repeating-linear-gradient(to right, var(--brass) 0 4px, transparent 4px 9px);
  background-repeat: no-repeat, no-repeat, repeat-x;
  opacity: 0.85;
}
.hub__center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}
.hub__center::before {
  /* brass dashed thread going up from rail to center house */
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  height: 14px;
  background: repeating-linear-gradient(to bottom, var(--brass) 0 3px, transparent 3px 6px);
  margin-bottom: 2px;
}
.hub__center-house {
  width: 84px;
  height: 84px;
  color: var(--ink);
}
.hub__center-name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  text-align: center;
}
.hub__center-sub {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}
@media (max-width: 480px) {
  .hub { padding: 22px 12px 24px; }
  .hub__spokes { gap: 18px 22px; }
  .hub__house { width: 44px; height: 44px; }
  .hub__center-house { width: 68px; height: 68px; }
  .hub__label { font-size: 12.5px; }
  .hub__rail { max-width: none; width: calc(100% - 8px); }
}

/* --------- Collapsible disclosure (phone-detail service panel) --------- */

details.disclosure {
  border: 1px solid var(--rule);
  border-radius: var(--radius-1);
  background: var(--paper);
  overflow: hidden;
}
details.disclosure summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure summary::before {
  content: "▸";
  color: var(--ink-muted);
  font-size: 10px;
  transition: transform 0.15s;
  display: inline-block;
  width: 10px;
}
details.disclosure[open] summary::before { transform: rotate(90deg); }
details.disclosure summary:hover { color: var(--ink); background: var(--paper-2); }
details.disclosure > *:not(summary) { border-top: 1px solid var(--rule-soft); }

/* --------- Auth screens (login/onboard): standalone centered card --------- */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--paper);
}
.auth__frame {
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.auth__mark {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-weight: 500;
  font-size: 36px;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1;
  margin: 0 0 6px;
}
.auth__mark em { font-style: italic; color: var(--brass); font-weight: 500; }
.auth__tagline {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0 0 24px;
  letter-spacing: 0.02em;
}
.auth__card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-2);
  padding: 24px 22px;
  box-shadow: var(--shadow-1);
  text-align: left;
}
.auth__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.auth__divider::before, .auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule-soft);
}
.auth__phone {
  display: block;
  width: 160px;
  height: auto;
  margin: 0 auto 20px;
}

/* --------- Utilities --------- */

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }
.soft { color: var(--ink-soft); }
.brass { color: var(--brass); }
.serif { font-family: var(--font-display); font-variation-settings: "opsz" 144, "SOFT" 40; }
.italic { font-style: italic; }
.center { text-align: center; }
.hidden { display: none !important; }
.stack-sm > * + * { margin-top: 8px; }
.stack-md > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 20px; }
.hstack { display: flex; align-items: center; gap: 10px; }
.hstack--wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Panel body padding variants (head already has its own border) */
.panel__body { padding: 16px; }
.panel__body--tight { padding: 10px 14px; }

/* Responsive visibility helpers */
.show-sm { display: none; }
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .show-sm { display: block; }
}

