/* ============================================================================
 * magic-ui v0.2.0 — Tonal Chroma Studio (Chakra v3 + Radix + shadcn)
 * Auto-generated from tokens.json — DO NOT EDIT DIRECTLY
 * ============================================================================ */

:root,
[data-theme="graphite"] {
  --bg-board: #111216;
  --bg-recessed: #16181E;
  --bg-canvas: #1A1C23;
  --bg-panel: #21242D;
  --bg-surface: #282C37;
  --bg-elevated: #313644;
  --bg-hover: #3A4050;
  --bg-invert: #2DD4BF;

  --fg-primary: #F8FAFC;
  --fg-secondary: #CBD5E1;
  --fg-muted: #94A3B8;
  --fg-subtle: #64748B;
  --fg-invert: #042F2E;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(45, 212, 191, 0.42);
  --highlight-top: inset 0 1px 0 rgba(255, 255, 255, 0.09);

  /* Tonal Chroma Semantic Accents */
  --acc-teal: #2DD4BF;
  --acc-amber: #F59E0B;
  --acc-jade: #34D399;
  --acc-coral: #F87171;
  --acc-air: #38BDF8;
  --acc-violet: #A78BFA;

  --font-sans: "Inter", "Adwaita Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Adwaita Mono", ui-monospace, monospace;

  --radius-badge: 6px;
  --radius-control: 8px;
  --radius-card: 12px;
  --radius-modal: 14px;
}

[data-theme="daylight"] {
  --bg-board: #E2E8F0;
  --bg-recessed: #EDF2F7;
  --bg-canvas: #F8FAFC;
  --bg-panel: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-hover: #E2E8F0;
  --bg-invert: #0D9488;

  --fg-primary: #0F172A;
  --fg-secondary: #334155;
  --fg-muted: #64748B;
  --fg-subtle: #94A3B8;
  --fg-invert: #FFFFFF;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-default: rgba(15, 23, 42, 0.14);
  --border-strong: rgba(13, 148, 136, 0.42);
  --highlight-top: inset 0 1px 0 rgba(255, 255, 255, 0.75);

  --acc-teal: #0D9488;
  --acc-amber: #D97706;
  --acc-jade: #059669;
  --acc-coral: #DC2626;
  --acc-air: #0284C7;
  --acc-violet: #7C3AED;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--fg-primary);
  font-family: var(--font-sans);
}

/* ============================================================================
 * Typography & Telemetry Primitives
 * ============================================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-subtle);
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.unit {
  font-family: var(--font-mono);
  font-size: 0.84em;
  color: var(--fg-muted);
  margin-left: 2px;
}

svg.ico {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.status-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acc-jade);
  display: inline-block;
  flex-shrink: 0;
}

.kbd {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fg-muted);
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: 4.5px;
  padding: 1px 4.5px;
  line-height: 1.25;
}

/* ============================================================================
 * Chakra v3 Tinted Icon Wells (.icon-well)
 * ============================================================================ */
.icon-well {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-secondary);
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

[data-theme="daylight"] .icon-well {
  background: rgba(15, 23, 42, 0.05);
}

.icon-well svg.ico {
  width: 14.5px;
  height: 14.5px;
}

.icon-well.teal,
.ctrl-tile.active-neutral .icon-well,
.ctrl-tile.active-teal .icon-well {
  background: rgba(45, 212, 191, 0.16);
  border-color: rgba(45, 212, 191, 0.36);
  color: var(--acc-teal);
}

.icon-well.amber,
.ctrl-tile.active-warm .icon-well {
  background: rgba(245, 158, 11, 0.17);
  border-color: rgba(245, 158, 11, 0.38);
  color: var(--acc-amber);
}

.icon-well.jade,
.ctrl-tile.active-jade .icon-well {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.36);
  color: var(--acc-jade);
}

.icon-well.air,
.ctrl-tile.active-air .icon-well {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.36);
  color: var(--acc-air);
}

.icon-well.violet,
.ctrl-tile.active-violet .icon-well {
  background: rgba(167, 139, 250, 0.17);
  border-color: rgba(167, 139, 250, 0.38);
  color: var(--acc-violet);
}

.icon-well.coral,
.ctrl-tile.active-alert .icon-well {
  background: rgba(248, 113, 113, 0.17);
  border-color: rgba(248, 113, 113, 0.38);
  color: var(--acc-coral);
}

/* ============================================================================
 * Navigation Tabs & Buttons
 * ============================================================================ */
.nav-bar-demo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 4px 9px 4px 5px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5.5px;
  padding: 5px 10px;
  border-radius: 6.5px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.nav-tab:hover {
  color: var(--fg-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  background: rgba(45, 212, 191, 0.14);
  color: var(--acc-teal);
  border-color: rgba(45, 212, 191, 0.38);
  box-shadow: var(--highlight-top);
}

.btn {
  height: 31px;
  padding: 0 11px;
  border-radius: var(--radius-control);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.06s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(0.5px);
}

.btn:focus-visible {
  outline: 2px solid var(--acc-teal);
  outline-offset: 1px;
}

.btn-primary {
  background: var(--bg-invert);
  color: var(--fg-invert);
  font-weight: 600;
  border-color: var(--bg-invert);
  box-shadow: var(--highlight-top);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--fg-primary);
  border-color: var(--border-default);
  box-shadow: var(--highlight-top);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-active {
  background: rgba(45, 212, 191, 0.15);
  color: var(--acc-teal);
  border-color: rgba(45, 212, 191, 0.42);
  box-shadow: var(--highlight-top);
}

.btn-active:hover:not(:disabled) {
  background: rgba(45, 212, 191, 0.22);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-surface);
  color: var(--fg-primary);
  border-color: var(--border-default);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--acc-coral);
  border-color: rgba(248, 113, 113, 0.34);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.20);
  border-color: var(--acc-coral);
}

.btn-disabled,
.btn:disabled {
  background: var(--bg-surface);
  color: var(--fg-subtle);
  border-color: var(--border-subtle);
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sq {
  width: 31px;
  padding: 0;
}

/* ============================================================================
 * Segmented Controls & Numeric Steppers
 * ============================================================================ */
.seg-control {
  display: inline-flex;
  align-items: center;
  background: var(--bg-recessed);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 2.5px;
  gap: 2px;
}

.seg-item {
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.seg-item:hover:not(.active):not(.active-invert) {
  color: var(--fg-secondary);
}

.seg-item.active {
  background: var(--bg-elevated);
  color: var(--fg-primary);
  box-shadow: var(--highlight-top), 0 1px 2px rgba(0, 0, 0, 0.35);
}

.seg-item.active-invert {
  background: var(--bg-invert);
  color: var(--fg-invert);
  font-weight: 600;
}

.stepper {
  display: inline-flex;
  align-items: center;
  height: 31px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  overflow: hidden;
}

.stepper button,
.stepper .step-btn {
  padding: 0 9.5px;
  height: 100%;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.stepper button:hover,
.stepper .step-btn:hover {
  background: var(--bg-hover);
  color: var(--fg-primary);
}

.stepper strong,
.stepper .step-val {
  min-width: 30px;
  padding: 0 9px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-primary);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-recessed);
}

/* ============================================================================
 * Form Inputs, Selects, Checkboxes, Linear Sliders & Switches
 * ============================================================================ */
.field-wrap {
  height: 31px;
  background: var(--bg-recessed);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  padding: 0 9.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.field-wrap:focus-within {
  border-color: var(--acc-teal);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25);
}

.field-wrap input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--fg-primary);
}

.field-wrap input.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  -moz-appearance: textfield;
}

.field-wrap input[type="number"]::-webkit-outer-spin-button,
.field-wrap input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field-wrap input::placeholder {
  color: var(--fg-subtle);
}

select.magic-select {
  width: 100%;
  height: 31px;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-recessed);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  padding: 0 26px 0 9.5px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--fg-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s ease;
}

select.magic-select:focus {
  border-color: var(--acc-teal);
}

label.chk-item {
  display: inline-flex;
  align-items: center;
  gap: 6.5px;
  font-size: 11.5px;
  color: var(--fg-secondary);
  cursor: pointer;
  user-select: none;
}

label.chk-item:hover {
  color: var(--fg-primary);
}

input.magic-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  border-radius: 4.5px;
  border: 1px solid var(--border-default);
  background: var(--bg-recessed);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}

input.magic-checkbox:checked {
  background: var(--bg-invert);
  border-color: var(--bg-invert);
}

input.magic-checkbox:checked::before {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid var(--fg-invert);
  border-bottom: 2px solid var(--fg-invert);
  transform: rotate(-45deg) translate(0.5px, -0.5px);
}

input.magic-checkbox:focus-visible {
  outline: 2px solid var(--acc-teal);
  outline-offset: 1px;
}

/* Interactive Linear Range Sliders */
.slider-row {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 7.5px 10.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input[type="range"].magic-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--slider-color, var(--acc-teal)) 0%,
    var(--slider-color, var(--acc-teal)) var(--val, 50%),
    var(--bg-recessed) var(--val, 50%),
    var(--bg-recessed) 100%
  );
  outline: none;
  cursor: pointer;
  margin: 3px 0;
}

input[type="range"].magic-slider.warm {
  --slider-color: var(--acc-amber);
}

input[type="range"].magic-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 15px;
  border-radius: 4.5px;
  background: var(--fg-primary);
  border: 1px solid #0F172A;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

input[type="range"].magic-slider::-moz-range-thumb {
  width: 13px;
  height: 15px;
  border-radius: 4.5px;
  background: var(--fg-primary);
  border: 1px solid #0F172A;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

/* Tonal Chroma Toggle Switches */
.switch-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 7px 10.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.switch-card:hover {
  border-color: var(--border-default);
}

.hw-switch {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--bg-recessed);
  border: 1px solid var(--border-default);
  padding: 2px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.hw-switch .knob {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fg-muted);
  transition: transform 0.14s ease, background 0.14s ease;
}

.hw-switch.on {
  background: var(--bg-invert);
  border-color: var(--bg-invert);
}

.hw-switch.on .knob {
  background: var(--fg-invert);
  transform: translateX(14px);
}

/* ============================================================================
 * Tonal Chroma Smart Home Control Tiles (Chakra v3 + Radix Surface Tint)
 * ============================================================================ */
.ctrl-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease;
}

.ctrl-tile:hover {
  border-color: var(--border-default);
}

.ctrl-tile:active {
  transform: translateY(0.5px);
}

.ctrl-tile.active-warm {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%), var(--bg-surface);
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow: var(--highlight-top);
}

.ctrl-tile.active-neutral,
.ctrl-tile.active-teal {
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.15) 0%, rgba(45, 212, 191, 0.08) 100%), var(--bg-surface);
  border-color: rgba(45, 212, 191, 0.42);
  box-shadow: var(--highlight-top);
}

.ctrl-tile.active-jade {
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.15) 0%, rgba(52, 211, 153, 0.08) 100%), var(--bg-surface);
  border-color: rgba(52, 211, 191, 0.42);
  box-shadow: var(--highlight-top);
}

.ctrl-tile.active-air {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.15) 0%, rgba(56, 189, 248, 0.08) 100%), var(--bg-surface);
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: var(--highlight-top);
}

.ctrl-tile.active-violet {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.16) 0%, rgba(167, 139, 250, 0.08) 100%), var(--bg-surface);
  border-color: rgba(167, 139, 250, 0.42);
  box-shadow: var(--highlight-top);
}

.ctrl-tile.active-alert {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.16) 0%, rgba(248, 113, 113, 0.08) 100%), var(--bg-surface);
  border-color: rgba(248, 113, 113, 0.44);
  box-shadow: var(--highlight-top);
}

.ctrl-tile.active-warm::before,
.ctrl-tile.active-neutral::before,
.ctrl-tile.active-teal::before,
.ctrl-tile.active-jade::before,
.ctrl-tile.active-air::before,
.ctrl-tile.active-violet::before,
.ctrl-tile.active-alert::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}

.ctrl-tile.active-warm::before { background: var(--acc-amber); }
.ctrl-tile.active-neutral::before,
.ctrl-tile.active-teal::before { background: var(--acc-teal); }
.ctrl-tile.active-jade::before { background: var(--acc-jade); }
.ctrl-tile.active-air::before { background: var(--acc-air); }
.ctrl-tile.active-violet::before { background: var(--acc-violet); }
.ctrl-tile.active-alert::before { background: var(--acc-coral); }

/* Badges & Selectable Inspector Rows */
.badge-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 9.5px;
  font-weight: 500;
  padding: 2.5px 7px;
  border-radius: var(--radius-badge);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--fg-secondary);
}

.insp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10.5px;
  font-size: 11px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s ease;
}

.insp-row:hover:not(.selected) {
  background: rgba(255, 255, 255, 0.03);
}

.insp-row.selected {
  background: rgba(45, 212, 191, 0.10);
  border-left: 3px solid var(--acc-teal);
  padding-left: 7.5px;
}

/* ============================================================================
 * Promoted Catalog Primitives (Climate Card, KPI Strip, Power Bars, Map Pins, Modals)
 * ============================================================================ */
.climate-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 9.5px 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--highlight-top);
}

.climate-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  height: 32px;
  overflow: hidden;
}

.climate-stepper button.step-btn {
  width: 30px;
  height: 100%;
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.climate-stepper button.step-btn:hover {
  background: var(--bg-hover);
  color: var(--fg-primary);
}

.climate-stepper .step-val {
  padding: 0 11px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  background: var(--bg-recessed);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-primary);
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6.5px;
}

.kpi-cell {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 7.5px 9.5px;
  display: flex;
  flex-direction: column;
  gap: 2.5px;
}

.kpi-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-primary);
}

.balance-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 9.5px 11.5px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stacked-bar {
  height: 7px;
  background: var(--bg-recessed);
  border-radius: 3.5px;
  display: flex;
  gap: 2px;
  overflow: hidden;
}

.stacked-bar > div {
  transition: width 0.22s ease;
}

.ranked-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rank-row {
  display: grid;
  grid-template-columns: 112px 1fr 48px;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 5px;
  padding: 1.5px 3px;
  transition: background 0.12s ease;
}

.rank-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.rank-track {
  height: 5.5px;
  background: var(--bg-recessed);
  border-radius: 3px;
  overflow: hidden;
}

.rank-fill {
  height: 100%;
  transition: width 0.22s ease;
}

button.map-pin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: var(--radius-badge);
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--fg-secondary);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

button.map-pin:hover:not(.selected) {
  background: var(--bg-hover);
  color: var(--fg-primary);
}

button.map-pin.ap {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.36);
  color: var(--acc-teal);
}

button.map-pin.selected {
  background: var(--bg-invert);
  border-color: var(--bg-invert);
  color: var(--fg-invert);
  font-weight: 600;
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-modal);
  box-shadow: var(--highlight-top), 0 12px 28px rgba(0, 0, 0, 0.45);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8.5px;
}

.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 7.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-kv-list {
  display: flex;
  flex-direction: column;
  gap: 4.5px;
}

.modal-kv {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

button.toast-pill {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10.5px;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: var(--highlight-top);
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--fg-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}

button.toast-pill:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

button.toast-pill.diag-warn {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.32);
}

button.toast-pill.diag-warn:hover {
  background: rgba(248, 113, 113, 0.14);
  border-color: var(--acc-coral);
}

/* Floating Live Toast Notification */
.magic-toast {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8.5px 14px;
  border-radius: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--acc-teal);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--highlight-top), 0 12px 28px rgba(0, 0, 0, 0.48);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.magic-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.magic-toast.warn {
  border-left-color: var(--acc-coral);
}

/* ============================================================================
 * Gateway / Service Node Splash & Status Card (General-Purpose)
 * ============================================================================ */
.magic-splash-viewport {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
  background-color: var(--bg-board);
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
}

[data-theme="daylight"] .magic-splash-viewport {
  background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px);
}

.magic-node-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-modal);
  box-shadow: var(--highlight-top), 0 16px 36px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.magic-node-hdr {
  padding: 9px 14px;
  background: var(--bg-recessed);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.magic-node-body {
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.magic-node-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(45, 212, 191, 0.14);
  border: 1px solid rgba(45, 212, 191, 0.36);
  box-shadow: var(--highlight-top);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--acc-teal);
}

.magic-node-icon svg.ico {
  width: 18px;
  height: 18px;
}

.magic-node-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.magic-node-sub {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-muted);
  margin: 0;
}

.magic-node-ftr {
  padding: 8px 14px;
  background: var(--bg-recessed);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-subtle);
}
