/* Ezee Fiber Design System tokens (colors_and_type.css), plus the app status
   colours EzeeLinks' new-ui.css layers on top of it. The brand palette has no
   green or red, so pass/fail colour comes from those --status-* values. */
:root {
  --ez-orange: #fb612f;
  --ez-orange-600: #e0501f;
  --ez-orange-50: #fff1ea;
  --ez-white: #ffffff;
  --ez-navy: #1a2638;
  --ez-navy-700: #111a28;
  --ez-gray: #d9d9d6;
  --ez-gray-50: #f6f6f4;
  --ez-gray-100: #ececea;
  --ez-gray-400: #9b9b97;
  --ez-gray-700: #4b4f57;

  --bg: var(--ez-white);
  --bg-alt: var(--ez-gray-50);
  --fg: var(--ez-navy);
  --fg-muted: var(--ez-gray-700);
  --fg-subtle: var(--ez-gray-400);
  --fg-accent: var(--ez-orange);
  --border: var(--ez-gray);
  --border-strong: var(--ez-navy);

  --status-ok: #0ca30c;
  --status-warn: #fab219;
  --status-fail: #d03b3b;
  --status-ok-bg: #e9f6e9;
  --status-warn-bg: #fff6e1;
  --status-fail-bg: #fbecec;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --shadow-sm: 0 1px 2px rgba(26, 38, 56, 0.06);
  --shadow-md: 0 6px 18px -6px rgba(26, 38, 56, 0.18);
  --shadow-lg: 0 24px 48px -16px rgba(26, 38, 56, 0.25);

  --font-sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fz-h3: 28px;
  --fz-h4: 22px;
  --fz-body: 17px;
  --fz-small: 14px;
  --fz-caption: 12px;

  --ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;

  --action-bar-h: 88px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg-alt);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fz-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p { margin: 0; }

button, input { font: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  height: 60px;
  padding: 0 var(--space-4);
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.brand img { height: 28px; width: auto; display: block; }
.brand .app-name {
  font-size: var(--fz-small); font-weight: 500; color: var(--fg-muted);
  padding-left: var(--space-3); border-left: 1px solid var(--border);
  white-space: nowrap;
}

.user-menu { position: relative; }
.user-menu > summary {
  list-style: none; cursor: pointer;
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  display: grid; place-items: center;
  background: var(--ez-navy); color: var(--ez-white);
  font-size: var(--fz-small); font-weight: 500;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu .menu {
  position: absolute; right: 0; top: 48px; min-width: 240px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: var(--space-4);
}
.user-menu .menu .who { font-weight: 500; }
.user-menu .menu .upn { font-size: var(--fz-small); color: var(--fg-muted); word-break: break-all; }
.user-menu .menu a { margin-top: var(--space-4); }

/* ---------- Layout ---------- */
main {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) calc(var(--action-bar-h) + var(--space-6));
}

.intro h1 { font-size: var(--fz-h3); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.intro p { color: var(--fg-muted); margin-top: var(--space-1); }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  margin-top: var(--space-4);
}
.card > h2 {
  font-size: var(--fz-h4); font-weight: 500; line-height: 1.2;
  margin-bottom: var(--space-4);
}
.eyebrow {
  font-size: var(--fz-caption); font-weight: 500; letter-spacing: 0.06em;
  color: var(--fg-accent); margin-bottom: var(--space-1);
}

/* ---------- Search ---------- */
.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--ez-gray-100);
  border-radius: var(--radius-pill);
  padding: var(--space-1);
  gap: var(--space-1);
}
.segmented button {
  border: 0; background: transparent; cursor: pointer;
  min-height: 40px; border-radius: var(--radius-pill);
  font-size: var(--fz-small); font-weight: 500; color: var(--fg-muted);
  transition: background var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard);
}
.segmented button[aria-checked="true"] {
  background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm);
}

.field-label {
  display: block; margin-top: var(--space-4); margin-bottom: var(--space-2);
  font-size: var(--fz-small); font-weight: 500;
}
.text-input {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--space-5);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  font-size: var(--fz-body); /* 17px - keeps iOS from zooming on focus */
  outline: none;
  transition: border-color var(--dur-base) var(--ease-standard);
}
.text-input::placeholder { color: var(--fg-subtle); }
.text-input:focus { border-color: var(--border-strong); }
.text-input[aria-invalid="true"] { border-color: var(--ez-orange); }
.hint { font-size: var(--fz-small); color: var(--fg-muted); margin-top: var(--space-2); padding: 0 var(--space-2); }
.form-error { font-size: var(--fz-small); color: var(--ez-orange-600); margin-top: var(--space-2); padding: 0 var(--space-2); }
.form-error:empty { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 52px; padding: 14px 24px;
  border: 0; border-radius: var(--radius-pill);
  font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background var(--dur-base) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { cursor: progress; opacity: 0.7; }
.btn-block { width: 100%; }
.btn-primary { background: var(--ez-orange); color: var(--ez-white); }
.btn-primary:hover { background: var(--ez-orange-600); }
.btn-secondary { background: var(--ez-navy); color: var(--ez-white); }
.btn-secondary:hover { background: var(--ez-navy-700); }
.btn-ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.btn-small { min-height: 40px; padding: 10px 18px; font-size: var(--fz-small); }
#search-form .btn { margin-top: var(--space-4); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Status ---------- */
.status-line { margin-top: var(--space-4); color: var(--fg-muted); display: flex; gap: var(--space-2); align-items: center; }
.status-line:empty { display: none; }
.alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  margin-top: var(--space-4); padding: var(--space-4);
  border-radius: var(--radius-md); background: var(--ez-orange-50); color: var(--fg);
}
.alert .icon { color: var(--ez-orange-600); margin-top: 2px; }

/* Keeps results clear of the sticky top bar when scrolled into view. */
#results { scroll-margin-top: 76px; }

/* ---------- Verdict ---------- */
.verdict { padding: var(--space-5); }
.verdict-head { display: flex; gap: var(--space-4); align-items: flex-start; }
.verdict-badge {
  width: 52px; height: 52px; flex: none; border-radius: var(--radius-pill);
  display: grid; place-items: center;
}
.verdict-badge .icon { width: 28px; height: 28px; stroke-width: 2; }
.verdict.ok .verdict-badge { background: var(--status-ok-bg); color: var(--status-ok); }
.verdict.warn .verdict-badge { background: var(--status-warn-bg); color: #b07800; }
.verdict.fail .verdict-badge { background: var(--status-fail-bg); color: var(--status-fail); }
.verdict h2 { font-size: var(--fz-h3); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.verdict .detail { color: var(--fg-muted); margin-top: var(--space-2); }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-5); }
.metric {
  background: var(--bg-alt); border-radius: var(--radius-md); padding: var(--space-4);
}
.metric .k { font-size: var(--fz-small); color: var(--fg-muted); }
.metric .v { font-size: var(--fz-h4); font-weight: 700; line-height: 1.2; margin-top: var(--space-1); display: flex; align-items: center; gap: var(--space-2); }
.metric .v small { font-size: var(--fz-small); font-weight: 400; color: var(--fg-muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--fg-subtle); }
.dot.ok { background: var(--status-ok); }
.dot.warn { background: var(--status-warn); }
.dot.fail { background: var(--status-fail); }

/* Light-level gauge: -30 to -5 dBm, red below -25, green to -10, amber above. */
.gauge { margin-top: var(--space-4); }
.gauge-track {
  position: relative; height: 10px; border-radius: var(--radius-pill); overflow: visible;
  display: grid; grid-template-columns: 5fr 15fr 5fr; gap: 2px;
}
.gauge-track span:nth-child(1) { background: var(--status-fail); border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.gauge-track span:nth-child(2) { background: var(--status-ok); }
.gauge-track span:nth-child(3) { background: var(--status-warn); border-radius: 0 var(--radius-pill) var(--radius-pill) 0; }
.gauge-marker {
  position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px;
  background: var(--ez-navy); border-radius: 2px; box-shadow: 0 0 0 2px var(--bg);
}
.gauge-scale { position: relative; height: 18px; font-size: var(--fz-caption); color: var(--fg-muted); margin-top: var(--space-2); }
.gauge-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.gauge-scale span:first-child { transform: none; }
.gauge-scale span:last-child { transform: translateX(-100%); }

/* Link quality: FEC / BIP counters, upstream and downstream. */
.lq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.link-quality .lq-head h2 { font-size: var(--fz-h4); font-weight: 700; line-height: 1.2; }
.lq-sub { font-size: var(--fz-small); color: var(--fg-muted); margin-top: var(--space-1); }
.lq-head .pill { flex: none; padding: 4px 14px; font-size: var(--fz-small); }
.pill.ok { background: var(--status-ok-bg); color: var(--status-ok); }
.lq-grid {
  display: grid; grid-template-columns: max-content minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3); align-items: center; margin-top: var(--space-5);
}
.lq-col { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: var(--fz-small); }
.lq-col strong { font-weight: 500; }
.lq-col span { color: var(--fg-muted); }
.lq-label { font-weight: 500; }
.lq-cell .v { justify-content: center; margin-top: 0; }
.lq-cell .lq-na { color: var(--fg-muted); }

.checked-at { font-size: var(--fz-small); color: var(--fg-muted); margin-top: var(--space-4); }

.history { margin-top: var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-4); }
.history h3 { font-size: var(--fz-small); font-weight: 500; margin-bottom: var(--space-2); }
.history ol { list-style: none; margin: 0; padding: 0; }
.history li {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center;
  font-size: var(--fz-small); padding: var(--space-2) 0;
}
.history li + li { border-top: 1px solid var(--ez-gray-100); }
.history .time { color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.history .state { display: inline-flex; align-items: center; gap: var(--space-2); }
.history .light { font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---------- Key/value rows ---------- */
.rows { margin: 0; }
.row {
  display: flex; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-3) 0; border-top: 1px solid var(--ez-gray-100);
}
.row:first-child { border-top: 0; padding-top: 0; }
.row dt { color: var(--fg-muted); font-size: var(--fz-small); flex: none; padding-top: 2px; }
.row dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.row dd a { color: var(--fg); text-decoration-color: var(--ez-orange); text-underline-offset: 3px; }
.customer-name { font-size: var(--fz-h4); font-weight: 700; line-height: 1.2; }
.customer-address { color: var(--fg-muted); margin: var(--space-1) 0 var(--space-4); }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: var(--fz-caption); font-weight: 500; letter-spacing: 0.02em;
  background: var(--ez-orange-50); color: var(--ez-orange-600);
}
.pill.neutral { background: var(--ez-gray-100); color: var(--fg); }

/* ---------- Equipment ---------- */
.devices { list-style: none; margin: 0; padding: 0; }
.device { padding: var(--space-4) 0; border-top: 1px solid var(--ez-gray-100); }
.device:first-child { border-top: 0; padding-top: 0; }
.device-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.device-title { font-weight: 500; }
.device-meta { font-size: var(--fz-small); color: var(--fg-muted); margin-top: var(--space-1); }
.serial { font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.02em; margin-top: var(--space-1); overflow-wrap: anywhere; }
.device-head .serial { margin-top: 0; font-size: 16px; font-weight: 500; }

/* ---------- Checks ---------- */
.checks { list-style: none; margin: 0; padding: 0; }
.check { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--ez-gray-100); }
.check:first-child { border-top: 0; padding-top: 0; }
.check .icon { margin-top: 2px; }
.check.ok .icon { color: var(--status-ok); }
.check.warn .icon { color: #b07800; }
.check.fail .icon { color: var(--status-fail); }
.check-head { display: flex; justify-content: space-between; gap: var(--space-3); font-weight: 500; }
.check-head .value { font-weight: 400; color: var(--fg-muted); text-align: right; overflow-wrap: anywhere; }
.check-detail { font-size: var(--fz-small); color: var(--fg-muted); margin-top: 2px; }

/* ---------- Address type-ahead ---------- */
.combo { position: relative; }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + var(--space-2)); z-index: 30;
  list-style: none; margin: 0; padding: var(--space-2) 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  max-height: 60vh; overflow-y: auto;
}
.suggestion {
  display: flex; gap: var(--space-3); align-items: center;
  padding: var(--space-3) var(--space-4); cursor: pointer;
}
.suggestion .icon { color: var(--fg-accent); }
.suggestion .body { display: flex; flex-direction: column; min-width: 0; }
.suggestion .line1 { font-weight: 500; }
.suggestion .line2 { font-size: var(--fz-small); color: var(--fg-muted); }
.suggestion[aria-selected="true"], .suggestion:active { background: var(--bg-alt); }
.suggestion + .suggestion { border-top: 1px solid var(--ez-gray-100); }
.suggestion-note { padding: var(--space-3) var(--space-4); font-size: var(--fz-small); color: var(--fg-muted); }

/* ---------- Card notes (single-line state) ---------- */
.card-note { display: flex; gap: var(--space-3); align-items: center; color: var(--fg-muted); }
.card-note.ok { color: var(--fg); }
.card-note.ok .icon { color: var(--status-ok); }
.card-note.fail { color: var(--fg); }
.card-note.fail .icon { color: var(--status-fail); }
.card-note.warn { color: var(--fg); }
.card-note.warn .icon { color: var(--status-warn); }
.card-note + .devices { margin-top: var(--space-4); }

/* ---------- Is it just this house? (verdict first, levels on tap) ---------- */
.nb-verdict { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-radius: var(--radius-md); margin-top: var(--space-3); }
.nb-verdict .icon { flex-shrink: 0; margin-top: 2px; }
.nb-verdict.fail { background: var(--status-fail-bg); }
.nb-verdict.fail .icon, .nb-verdict.fail strong { color: #a52a2a; }
.nb-verdict.power, .nb-verdict.warn { background: var(--status-warn-bg); }
.nb-verdict.power .icon, .nb-verdict.warn .icon { color: #b07800; }
.nb-verdict.power strong, .nb-verdict.warn strong { color: #6b4a00; }
.nb-verdict.ok { background: var(--status-ok-bg); }
.nb-verdict.ok .icon { color: var(--status-ok); }
.nb-verdict.info { background: var(--bg-alt); }
.nb-words { display: flex; flex-direction: column; gap: 2px; }
.nb-words strong { font-size: var(--fz-body); font-weight: 700; }
.nb-words span { font-size: 15px; line-height: 1.4; }
.nb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-3); }
.nb-chip { font-size: 13px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 10px; overflow-wrap: anywhere; }
.neighbors .check-detail { margin-top: var(--space-3); }
.nb-toggle { margin-top: var(--space-3); justify-content: space-between; }
.nb-toggle .icon { transform: rotate(90deg); transition: transform var(--dur-fast) var(--ease-standard); }
.nb-toggle[aria-expanded="true"] .icon { transform: rotate(-90deg); }
.nb-levels { display: flex; flex-direction: column; gap: 2px; margin-top: var(--space-2); }
.nb-level { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; }
.nb-level.hit { background: var(--status-fail-bg); }
.nb-level-head { display: flex; justify-content: space-between; gap: var(--space-3); font-weight: 500; }
.nb-level.hit .nb-level-head { font-weight: 700; }
.nb-bar { height: 6px; border-radius: var(--radius-pill); background: var(--ez-gray-100); overflow: hidden; }
.nb-fill { height: 6px; border-radius: var(--radius-pill); background: var(--fg-subtle); }
.nb-fill.strong { background: var(--status-fail); }
.nb-scope { font-size: var(--fz-caption); color: var(--fg-muted); overflow-wrap: anywhere; }
.nb-scan { margin-top: var(--space-2); }

/* ---------- Neighbor scan sheet (full screen on a phone) ---------- */
body.sheet-open { overflow: hidden; }
.scan-sheet { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg-alt); }
.scan-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); padding-top: calc(var(--space-3) + env(safe-area-inset-top)); background: var(--bg); border-bottom: 1px solid var(--border); }
.scan-head h2 { margin: 0; font-size: var(--fz-h4); font-weight: 700; letter-spacing: -0.01em; }
.scan-close { width: 44px; height: 44px; padding: 0; justify-content: center; flex-shrink: 0; }
.scan-body { flex: 1; overflow-y: auto; width: 100%; max-width: 560px; margin: 0 auto; padding: var(--space-4); }
.scan-summary { margin: 0 0 var(--space-4); font-weight: 500; }
.scan-group { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-2) var(--space-4); margin-bottom: var(--space-4); }
.scan-group h3 { margin: var(--space-2) 0; font-size: var(--fz-small); font-weight: 500; color: var(--fg-muted); }
.scan-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--ez-gray-100); }
.scan-who { display: flex; flex-direction: column; min-width: 0; }
.scan-address { font-weight: 500; overflow-wrap: anywhere; }
.scan-serial { font-size: var(--fz-caption); color: var(--fg-muted); font-family: var(--font-mono); }
.scan-state { display: flex; align-items: center; gap: 6px; font-size: var(--fz-small); }
.scan-light { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.scan-light.ok { color: var(--status-ok); }
.scan-light.warn { color: #b07800; }
.scan-light.fail { color: var(--status-fail); }
.scan-foot { padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.92); border-top: 1px solid var(--border); }
/* On a wide screen, keep the header and the button on the list's centered
   560px column; on a phone the column is the full width anyway. */
.scan-head, .scan-foot { padding-inline: max(var(--space-4), calc((100% - 560px) / 2 + var(--space-4))); }

/* ---------- ONT alarms ---------- */
.alarms { list-style: none; margin: 0; padding: 0; }
.alarm { padding: var(--space-4) 0; border-top: 1px solid var(--ez-gray-100); }
.alarm:first-child { border-top: 0; padding-top: 0; }
.alarm-head { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center; }
.alarm.fail .alarm-head .icon { color: var(--status-fail); }
.alarm.warn .alarm-head .icon { color: #b07800; }
.alarm-title { font-weight: 500; overflow-wrap: anywhere; }
.pill.sev-fail { background: var(--status-fail-bg); color: var(--status-fail); }
.pill.sev-warn { background: var(--status-warn-bg); color: #8a5e00; }
.alarm-cause { font-size: var(--fz-small); color: var(--fg-muted); margin-top: var(--space-2); }
.alarm-steps { margin: var(--space-2) 0 0; padding-left: var(--space-5); font-size: var(--fz-small); }
.alarm-steps li + li { margin-top: var(--space-1); }
.alarm-time { font-size: var(--fz-caption); color: var(--fg-subtle); margin-top: var(--space-2); }

/* ---------- Wi-Fi mesh ---------- */
.mesh-title { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 500; }
.mesh-meta { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; flex: none; }
.bars span { width: 4px; border-radius: 1px; background: var(--ez-gray); }
.bars span:nth-child(1) { height: 20%; }
.bars span:nth-child(2) { height: 40%; }
.bars span:nth-child(3) { height: 60%; }
.bars span:nth-child(4) { height: 80%; }
.bars span:nth-child(5) { height: 100%; }
.bars span.on { background: var(--ez-navy); }

/* ---------- Address matches ---------- */
.matches { list-style: none; margin: 0; padding: 0; }
.matches li + li { border-top: 1px solid var(--ez-gray-100); }
.match {
  width: 100%; display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) 0; border: 0; background: none; text-align: left; cursor: pointer;
}
.match .icon:first-child { color: var(--fg-accent); }
.match .body { flex: 1; min-width: 0; }
.match .line1 { font-weight: 500; }
.match .line2 { font-size: var(--fz-small); color: var(--fg-muted); }
.match .nowrap { white-space: nowrap; }
.match .chev { color: var(--fg-subtle); }
.match:active { background: var(--bg-alt); }

.meta { font-size: var(--fz-small); color: var(--fg-subtle); text-align: center; margin-top: var(--space-5); }
.card .meta { text-align: left; margin-top: var(--space-2); overflow-wrap: anywhere; }

.recent { padding: var(--space-3) var(--space-4); }
.recent summary { cursor: pointer; font-weight: 500; min-height: 32px; display: flex; align-items: center; }
.recent-list { display: flex; flex-direction: column; margin-top: var(--space-2); }
.recent-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 48px; padding: var(--space-2) 0; border: 0; border-top: 1px solid var(--ez-gray-100); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.recent-item .line1 { font-weight: 500; }
.recent-item .line2 { font-size: var(--fz-small); color: var(--fg-muted); }

.app-version { font-size: var(--fz-caption); color: var(--fg-muted); text-align: center; margin-top: var(--space-7); }

/* ---------- Sticky action bar ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.action-bar .inner { max-width: 560px; margin: 0 auto; display: flex; gap: var(--space-3); }
.action-bar .btn-primary { flex: 1; }
.action-bar .note { font-size: var(--fz-caption); color: var(--fg-muted); text-align: center; margin-top: var(--space-2); }

[hidden] { display: none !important; }

/* ---------- Sign-in page ---------- */
.signin-page { min-height: 100vh; display: grid; place-items: center; padding: var(--space-4); }
.signin-card {
  width: 100%; max-width: 400px; text-align: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: var(--space-7) var(--space-5);
}
.signin-card img { height: 40px; width: auto; }
.signin-card h1 { font-size: var(--fz-h3); font-weight: 700; letter-spacing: -0.02em; margin-top: var(--space-6); }
.signin-card p { color: var(--fg-muted); margin-top: var(--space-2); }
.signin-card .btn { margin-top: var(--space-6); }
.signin-card .notice { margin-top: var(--space-5); font-size: var(--fz-small); }
.signin-card .notice.error { color: var(--ez-orange-600); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 1ms !important; }
}
