/* =============================================================
   NBC FF — Phantom-faithful atomic design
   fonts, colors, spacing, cut-corner polygon all match ph4nt0m.lol
   brand swap: wordmark "LEAL", accent gold #eac836, logo.jpg
   ============================================================= */

:root {
  /* Brand accent (gold, same hex phantom uses for ruizenteam variant) */
  --ph-accent:          #eac836;
  --ph-accent-ink:      #0b0b0c;
  --ph-accent-text:     color-mix(in oklch, var(--ph-accent) 70%, white);
  --ph-accent-line:     color-mix(in oklch, var(--ph-accent) 55%, transparent);
  --ph-accent-soft:     color-mix(in oklch, var(--ph-accent) 16%, transparent);
  --ph-accent-glow:     color-mix(in oklch, var(--ph-accent) 45%, transparent);

  /* Surfaces */
  --ph-bg:              #070708;
  --ph-surface-1:       #0d0d10;
  --ph-surface-2:       #0f0f12;
  --ph-surface-3:       #121215;
  --ph-surface-4:       #16161a;
  --ph-surface-5:       #1c1c20;
  --ph-surface-tray:    #0a0a0c;

  /* Lines */
  --ph-line-1:          #16161a;
  --ph-line-2:          #1f1f24;
  --ph-line-3:          #222227;
  --ph-line-4:          #2a2a30;

  /* Text */
  --ph-text-1:          #f2f2f3;
  --ph-text-2:          #e7e7ea;
  --ph-text-3:          #c9c9cf;
  --ph-text-4:          #a9a9b0;
  --ph-text-5:          #8b8b92;
  --ph-text-6:          #6a6a72;
  --ph-text-7:          #5d5d64;
  --ph-text-8:          #4a4a52;
  --ph-text-label:      #8b8b92;

  /* Status */
  --ph-ok:              #66da85;
  --ph-bad:             #ff645f;
  --ph-bad-text:        #ff948c;
  --ph-warn:            #fbbf24;
  --ph-warn-ink:        #15120a;
  --ph-danger-fill:     #e23439;

  /* Cuts (clip-path polygon radius) */
  --ph-cut-xs:          6px;
  --ph-cut-sm:          10px;
  --ph-cut-md:          14px;
  --ph-cut-lg:          22px;
  --ph-cut-sheet:       24px;

  /* Sizes */
  --ph-header-h:        64px;
  --ph-control-h:       50px;
  --ph-primary-h:       62px;
  --ph-connect-h:       78px;
  --ph-input-h:         60px;
  --ph-hit-min:         44px;

  /* Spacing scale */
  --ph-s1: 4px;  --ph-s2: 6px;  --ph-s3: 8px;  --ph-s4: 10px;
  --ph-s5: 12px; --ph-s6: 14px; --ph-s7: 16px; --ph-s8: 18px;
  --ph-s9: 20px; --ph-s10:22px; --ph-s11:24px;

  /* Motion */
  --ph-dur:             .2s;
  --ph-dur-fast:        .15s;
  --ph-dur-ring:        .6s;
  --ph-ease:            cubic-bezier(.16, 1, .3, 1);
  --ph-press-scale:     .98;

  /* Fonts */
  --ph-f-display:       'Tektur';
  --ph-f-body:          'Chakra Petch';
  --ph-f-mono:          'JetBrains Mono';
  --ph-font-display:    var(--ph-f-display), ui-sans-serif, system-ui, sans-serif;
  --ph-font-body:       var(--ph-f-body), ui-sans-serif, system-ui, sans-serif;
  --ph-font-mono:       var(--ph-f-mono), ui-monospace, Menlo, Consolas, monospace;

  /* Type presets */
  --ph-type-body:       400 13px/1.55 var(--ph-font-body);
  --ph-type-body-sm:    400 11.5px/1.5 var(--ph-font-body);
  --ph-type-label:      600 11px/1 var(--ph-font-body);
  --ph-track-label:     .14em;
  --ph-type-page-title: 700 13px/1 var(--ph-font-display);
  --ph-track-page-title:.22em;
  --ph-type-wordmark:   900 64px/1 var(--ph-font-display);
  --ph-track-wordmark:  -.02em;
  --ph-type-key:        600 15px/1 var(--ph-font-mono);
  --ph-track-key:       .08em;
  --ph-type-button-lg:  700 14px/1 var(--ph-font-display);
  --ph-track-button-lg: .16em;

  /* Scanline */
  --ph-scanline:        rgba(255,255,255,.015);
}

/* ============================================================= */
/*  Reset / base                                                  */
/* ============================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--ph-bg);
  color: var(--ph-text-1);
  font: var(--ph-type-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: transparent; cursor: pointer; }
input { font: inherit; color: inherit; background: transparent; outline: none; }
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* ============================================================= */
/*  Background drift (two blurred white blobs)                    */
/* ============================================================= */

.ph-bg {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: var(--ph-bg);
}
.ph-drift {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
}
.ph-drift-a {
  left: 50%; top: -14%;
  width: 560px; height: 560px;
  transform: translateX(-50%);
  background: rgba(255,255,255,.05);
  animation: drift-a 22s ease-in-out infinite alternate;
}
.ph-drift-b {
  right: -12%; bottom: -18%;
  width: 480px; height: 480px;
  background: rgba(255,255,255,.035);
  animation: drift-b 28s ease-in-out infinite alternate;
}
@keyframes drift-a {
  from { transform: translate(-55%, -4%) scale(1); }
  to   { transform: translate(-45%, 6%)  scale(1.08); }
}
@keyframes drift-b {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(-8%, -4%) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .ph-drift { animation: none; }
}

/* ============================================================= */
/*  App shell                                                     */
/* ============================================================= */

.ph-viewport {
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}
.ph-app {
  width: 100%;
  max-width: 448px;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ph-scanlines {
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, var(--ph-scanline) 0 1px, transparent 1px 3px);
  z-index: 3;
}

/* Views (each view is a full ph-app column) */
.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}
[hidden] { display: none !important; }

/* ============================================================= */
/*  Atomic: clip-path cut corners (phantom signature)             */
/* ============================================================= */

.ph-cut-xs, .ph-cut-sm, .ph-cut-md, .ph-cut-lg {
  clip-path: polygon(
    var(--c) 0,
    100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%,
    0 var(--c)
  );
}
.ph-cut-xs { --c: var(--ph-cut-xs); }
.ph-cut-sm { --c: var(--ph-cut-sm); }
.ph-cut-md { --c: var(--ph-cut-md); }
.ph-cut-lg { --c: var(--ph-cut-lg); }

/* ============================================================= */
/*  Atomic: label / title / muted                                 */
/* ============================================================= */

.ph-label {
  font: var(--ph-type-label);
  letter-spacing: var(--ph-track-label);
  text-transform: uppercase;
  color: var(--ph-text-label);
}
.ph-title {
  font: var(--ph-type-page-title);
  letter-spacing: var(--ph-track-page-title);
  text-transform: uppercase;
}
.muted { color: var(--ph-text-6); }
.ph-pad-y { padding: 10px 0; }

/* ============================================================= */
/*  Header                                                        */
/* ============================================================= */

.ph-header {
  height: var(--ph-header-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  position: relative;
  z-index: 2;
}
.ph-header__title {
  flex: 1;
  min-width: 0;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ph-text-2);
}
.ph-lang {
  --c: var(--ph-cut-xs);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  background: var(--ph-surface-3);
  color: var(--ph-text-3);
  font: var(--ph-type-label);
  letter-spacing: .08em;
  font-size: 11.5px;
  text-transform: uppercase;
}

/* ============================================================= */
/*  Buttons                                                       */
/* ============================================================= */

.ph-btn {
  --c: var(--ph-cut-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--ph-control-h);
  padding: 0 22px;
  background: var(--ph-surface-4);
  color: var(--ph-text-2);
  font: var(--ph-type-label);
  letter-spacing: var(--ph-track-label);
  font-size: 11.5px;
  text-transform: uppercase;
  transition: background var(--ph-dur) var(--ph-ease), transform var(--ph-dur-fast);
}
.ph-btn:active { transform: scale(var(--ph-press-scale)); }
.ph-btn:disabled {
  background: var(--ph-surface-4);
  color: var(--ph-text-8);
  cursor: not-allowed;
  transform: none;
}
.ph-btn--primary {
  min-height: var(--ph-primary-h);
  background: var(--ph-accent);
  color: var(--ph-accent-ink);
  font: var(--ph-type-button-lg);
  letter-spacing: var(--ph-track-button-lg);
  text-transform: uppercase;
}
.ph-btn--primary:hover { background: color-mix(in oklch, var(--ph-accent) 92%, white); }
.ph-btn--connect { min-height: var(--ph-connect-h); font-size: 15px; }
.ph-btn--ghost { background: transparent; color: var(--ph-text-4); border: 0; clip-path: none; }
.ph-btn--ghost:hover { color: var(--ph-text-2); }
.ph-btn--block { width: 100%; }

.link-btn {
  color: var(--ph-text-4);
  font: var(--ph-type-label);
  letter-spacing: .08em;
  font-size: 11px;
  text-transform: uppercase;
  background: transparent;
}
.link-btn:hover { color: var(--ph-text-2); }

/* ============================================================= */
/*  GATE / LOGIN                                                  */
/* ============================================================= */

.ph-watermark {
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 640px; height: 640px;
  opacity: .04;
  pointer-events: none;
  z-index: 0;
}
.ph-watermark img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 50%;
  filter: grayscale(1) contrast(1.2);
}

.gate-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}
.gate-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.gate-logo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 36px var(--ph-accent-glow));
}
.gate-wordmark {
  font: var(--ph-type-wordmark);
  letter-spacing: var(--ph-track-wordmark);
  text-transform: uppercase;
  color: var(--ph-text-1);
  margin-inline-end: -.16em; /* trailing letter alignment, exactly like phantom */
}
.ph-tagline {
  font: var(--ph-type-body-sm);
  font-size: 11px;
  color: var(--ph-text-6);
  text-align: center;
}

.gate-form {
  padding: 0 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.field { display: flex; flex-direction: column; gap: 10px; }
.field-label { display: flex; align-items: center; gap: 8px; }
.ph-dot {
  width: 6px; height: 6px;
  background: var(--ph-accent);
  flex: none;
}
.field-err {
  min-height: 1em;
  font: var(--ph-type-body-sm);
  color: var(--ph-bad-text);
  padding: 0 4px;
}
.field-err:empty { display: none; }

/* Key input (two-layer clip-path trick for 1.5px gold border) */
.ph-keyinput {
  --c: var(--ph-cut-sm);
  background: var(--ph-line-3);
  padding: 1.5px;
  transition: background var(--ph-dur-fast);
}
.ph-keyinput:focus-within { background: var(--ph-accent-line); }
.ph-keyinput[data-error] { background: color-mix(in oklch, var(--ph-bad) 70%, transparent); }
.ph-keyinput[data-shake] { animation: ph-shake .38s ease-out; }
.ph-keyinput__inner {
  --c: var(--ph-cut-sm);
  height: var(--ph-input-h);
  background: #0e0e11;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 16px 8px;
}
.ph-keyinput input {
  flex: 1;
  min-width: 0;
  height: 100%;
  color: var(--ph-text-1);
  font: var(--ph-type-key);
  letter-spacing: var(--ph-track-key);
  text-transform: uppercase;
  background: transparent;
  border: 0;
}
.ph-keyinput input::placeholder {
  color: #3d3d44;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--ph-font-body);
  font-weight: 400;
}
.ph-keyinput__paste {
  --c: var(--ph-cut-xs);
  height: 42px;
  padding: 0 13px;
  background: var(--ph-surface-5);
  color: var(--ph-text-3);
  font: var(--ph-type-label);
  letter-spacing: .08em;
  font-size: 11.5px;
  text-transform: uppercase;
  flex: none;
}

@keyframes ph-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px); }
  40%     { transform: translateX( 5px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX( 3px); }
}

.gate-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  margin-top: 2px;
}
.gate-foot > span {
  font: var(--ph-type-body);
  color: var(--ph-text-4);
}
.gate-foot .muted {
  font: var(--ph-type-body-sm);
  color: var(--ph-text-7);
}

/* ============================================================= */
/*  HOME                                                          */
/* ============================================================= */

.home-main, .feat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 16px 24px;
}

.card {
  background: var(--ph-surface-1);
  border: none;
  position: relative;
}
.card.ph-cut-md { --c: var(--ph-cut-md); }

/* Session card (key + ring) */
.session-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--ph-surface-1) 0%, var(--ph-surface-2) 100%);
}
.session-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.session-key {
  font: 700 15px/1.2 var(--ph-font-mono);
  letter-spacing: .06em;
  color: var(--ph-text-1);
  word-break: break-all;
}
.session-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip {
  --c: var(--ph-cut-xs);
  padding: 3px 8px;
  background: var(--ph-surface-4);
  color: var(--ph-text-4);
  font: 500 10px/1.3 var(--ph-font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  clip-path: polygon(
    var(--c) 0, 100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%, 0 var(--c)
  );
}
.session-ring { flex: none; }

/* Tunnel card */
.tunnel-card {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tunnel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tunnel-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: var(--ph-type-label);
  letter-spacing: .1em;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--ph-text-3);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ph-text-7);
  box-shadow: 0 0 0 0 transparent;
}
.status-dot[data-state="ok"]   { background: var(--ph-ok);  box-shadow: 0 0 10px var(--ph-ok); }
.status-dot[data-state="warn"] { background: var(--ph-warn);box-shadow: 0 0 10px var(--ph-warn); }
.status-dot[data-state="bad"]  { background: var(--ph-bad); box-shadow: 0 0 10px var(--ph-bad); }
.tunnel-hint {
  font: var(--ph-type-body);
  font-size: 12px;
  color: var(--ph-text-5);
  line-height: 1.55;
}
.toast {
  text-align: center;
  font: 600 10px/1 var(--ph-font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ph-ok);
  margin-top: -4px;
}

/* Relay list */
.relay-card { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.relay-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.relay-list { display: flex; flex-direction: column; gap: 6px; }
.relay-item {
  --c: var(--ph-cut-xs);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ph-surface-2);
  color: var(--ph-text-2);
  font: 600 13px/1 var(--ph-font-body);
  cursor: pointer;
  transition: background var(--ph-dur-fast) var(--ph-ease);
  clip-path: polygon(
    var(--c) 0, 100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%, 0 var(--c)
  );
}
.relay-item:hover { background: var(--ph-surface-3); }
.relay-item[data-active="true"] {
  background: color-mix(in oklch, var(--ph-accent) 10%, var(--ph-surface-2));
  color: var(--ph-accent-text);
}
.relay-item__name { flex: 1; }
.relay-item__tag {
  font: 500 10px/1 var(--ph-font-mono);
  letter-spacing: .1em;
  color: var(--ph-text-6);
  text-transform: uppercase;
}
.relay-item__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ph-ok);
  flex: none;
}

/* Features entry */
.feat-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  color: var(--ph-text-2);
  background: var(--ph-surface-1);
  cursor: pointer;
  transition: background var(--ph-dur-fast) var(--ph-ease);
  border: 0;
  text-align: left;
}
.feat-entry:hover { background: var(--ph-surface-2); }
.feat-entry-title {
  margin-top: 4px;
  font: 600 14px/1.2 var(--ph-font-body);
}

.home-foot {
  text-align: center;
  padding-top: 8px;
}

/* ============================================================= */
/*  FEATURES                                                      */
/* ============================================================= */

.feat-warn {
  --c: var(--ph-cut-xs);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #15120a;
  color: #fad9a2;
  font: var(--ph-type-body);
  font-size: 12px;
  position: relative;
}
.feat-warn::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: repeating-linear-gradient(135deg, var(--ph-warn) 0 6px, transparent 6px 12px);
  opacity: .75;
}
.feat-warn__icon {
  --c: var(--ph-cut-xs);
  width: 18px; height: 18px;
  background: var(--ph-warn);
  color: var(--ph-warn-ink);
  font: 700 11px/1 var(--ph-font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  clip-path: polygon(
    var(--c) 0, 100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%, 0 var(--c)
  );
}

.feat-list { display: flex; flex-direction: column; gap: 10px; }

.feat-card {
  --c: var(--ph-cut-md);
  background: var(--ph-surface-1);
  overflow: hidden;
  transition: background var(--ph-dur-fast) var(--ph-ease);
  clip-path: polygon(
    var(--c) 0, 100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%, 0 var(--c)
  );
}
.feat-card[data-on="true"] {
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--ph-accent) 6%, var(--ph-surface-1)) 0%,
    var(--ph-surface-1) 100%);
}

.feat-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
}
.feat-head__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.feat-head__name {
  font: 600 14px/1.2 var(--ph-font-body);
  color: var(--ph-text-1);
  letter-spacing: .01em;
}
.feat-head__desc {
  font: var(--ph-type-body-sm);
  font-size: 11.5px;
  color: var(--ph-text-6);
  line-height: 1.5;
}

/* Toggle (pill switch) */
.toggle {
  --c: 3px;
  position: relative;
  flex: none;
  width: 44px; height: 24px;
  background: var(--ph-surface-5);
  border: 1px solid var(--ph-line-3);
  border-radius: 999px;
  transition: background var(--ph-dur) var(--ph-ease), border-color var(--ph-dur) var(--ph-ease);
  cursor: pointer;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--ph-text-5);
  border-radius: 50%;
  transition: left var(--ph-dur) var(--ph-ease), background var(--ph-dur) var(--ph-ease);
}
.toggle[data-on="true"] {
  background: var(--ph-accent);
  border-color: color-mix(in oklch, var(--ph-accent) 70%, white);
}
.toggle[data-on="true"]::after { left: 22px; background: var(--ph-accent-ink); }

/* Expand tray (collapsible under feat-head when enabled) */
.feat-tray {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--ph-line-2);
  padding-top: 14px;
  margin: 0 0 0 0;
}

/* Chip group (marker types) */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-opt {
  --c: var(--ph-cut-xs);
  padding: 7px 12px;
  background: var(--ph-surface-3);
  color: var(--ph-text-4);
  font: 500 11px/1 var(--ph-font-body);
  letter-spacing: .04em;
  cursor: pointer;
  transition: background var(--ph-dur-fast), color var(--ph-dur-fast);
  clip-path: polygon(
    var(--c) 0, 100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%, 0 var(--c)
  );
}
.chip-opt:hover { color: var(--ph-text-2); background: var(--ph-surface-4); }
.chip-opt[data-on="true"] {
  background: var(--ph-accent);
  color: var(--ph-accent-ink);
  font-weight: 600;
}

/* Range slider (Phantom .slider spec) */
.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--ph-line-3);
  cursor: pointer;
  transition: opacity .2s var(--ph-ease);
}
.range-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--ph-accent);
  border: 2px solid var(--ph-accent-ink);
  box-shadow: 0 1px 4px rgba(0,0,0,.55);
  transition: transform .14s var(--ph-ease);
}
.range-row input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
.range-row input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--ph-accent);
  border: 2px solid var(--ph-accent-ink);
  box-shadow: 0 1px 4px rgba(0,0,0,.55);
}
.range-row__val {
  flex: none;
  min-width: 70px;
  text-align: right;
  font: 600 12px/1 var(--ph-font-mono);
  color: var(--ph-accent-text);
  letter-spacing: .06em;
}

.aim-stops {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  font: 500 9.5px/1 var(--ph-font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ph-text-7);
}
.aim-stops span { transition: color var(--ph-dur-fast); }
.aim-stops span[data-on="true"] { color: var(--ph-accent-text); }

/* Sub-switch row (indented toggles inside Aim Lag) */
.sub-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--ph-surface-2);
  --c: var(--ph-cut-xs);
  clip-path: polygon(
    var(--c) 0, 100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%, 0 var(--c)
  );
}
.sub-row__label {
  flex: 1;
  font: 500 12px/1.2 var(--ph-font-body);
  color: var(--ph-text-2);
}

/* ============================================================= */
/*  PHANTOM RELAY                                                 */
/* ============================================================= */

.relay-mini {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 10px/1 var(--ph-font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ph-text-4);
}

.relay-strip {
  --c: var(--ph-cut-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--ph-surface-1);
  clip-path: polygon(
    var(--c) 0, 100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%, 0 var(--c)
  );
}
.relay-strip__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.relay-strip__state {
  font: 600 13px/1.2 var(--ph-font-body);
  color: var(--ph-text-2);
  letter-spacing: .02em;
}
.relay-strip__meta {
  font: 500 10px/1.4 var(--ph-font-mono);
  letter-spacing: .04em;
  color: var(--ph-text-6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--ph-line-2);
  --c: var(--ph-cut-sm);
  overflow: hidden;
  clip-path: polygon(
    var(--c) 0, 100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%, 0 var(--c)
  );
}
.stat-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--ph-surface-1);
}
.stat-cell b {
  font: 700 13.5px/1 var(--ph-font-mono);
  color: var(--ph-text-1);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-cell span {
  font: 600 9px/1 var(--ph-font-body);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ph-text-6);
}

.feat-group { display: flex; flex-direction: column; gap: 8px; }
.feat-group + .feat-group { margin-top: 6px; }
.feat-group__head { display: flex; align-items: center; gap: 10px; padding: 8px 4px 0; }
.feat-group__head::after { content: ""; flex: 1; height: 1px; background: var(--ph-line-2); }
.feat-group__title {
  font: 600 10px/1 var(--ph-font-body);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ph-text-6);
}

.live-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 5px;
  font: 600 8.5px/1.2 var(--ph-font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ph-ok);
  border: 1px solid color-mix(in oklch, var(--ph-ok) 35%, transparent);
  vertical-align: 1px;
}
.live-tag[data-live="false"] {
  color: var(--ph-text-8);
  border-color: var(--ph-line-3);
}

.phantom-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.panel-sub {
  font: 600 10px/1 var(--ph-font-body);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ph-text-6);
  padding: 12px 4px 0;
}

.evt-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--ph-line-2);
  --c: var(--ph-cut-sm);
  clip-path: polygon(
    var(--c) 0, 100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%, 0 var(--c)
  );
}
.evt-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 12px;
  background: var(--ph-surface-1);
  font: 500 10.5px/1.35 var(--ph-font-mono);
  color: var(--ph-text-5);
  overflow: hidden;
}
.evt-row time { flex: none; color: var(--ph-text-7); }
.evt-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt-row b { color: var(--ph-text-3); font-weight: 600; }
.evt-row[data-on="true"] b { color: var(--ph-ok); }

/* ============================================================= */
/*  Responsive                                                    */
/* ============================================================= */

@media (max-width: 380px) {
  .home-main, .feat-main { padding-left: 12px; padding-right: 12px; }
  .gate-wordmark { font-size: 56px; }
  .gate-logo { width: 130px; height: 130px; }
}
