/* Dark UI + soft white glow only (no color accents) */
:root {
  --bg: #000000;
  --bg-elev: rgba(10, 10, 10, 0.88);
  --bg-hover: #111111;
  --fg: #ededed;
  --fg-2: #a1a1a1;
  --fg-3: #666666;
  --fg-4: #444444;
  --line: #333333;
  --line-2: #1a1a1a;
  --white: #ffffff;
  --black: #000000;
  --r: 0;
  --r-card: 0;
  --font: "Fusion Pixel 12", monospace;
  --pixel: "Fusion Pixel 12", monospace;
  --mono: "Fusion Pixel Mono", "Fusion Pixel 12", monospace;
  --header-h: 64px;
  --max: 1080px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --h-ctrl: 48px;
  --h-ctrl-sm: 28px;
  --fs: 18px;
  --fs-ui: 12px;
  --fs-body: 18px;
  --fs-lg: 36px;
  --fs-xl: 52px;
  --gap: 12px;
  --pad: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--fg-2);
  background: var(--bg);
  /* pixel font: keep crisp (not antialiased) */
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.08);
}

/* —— White shimmer glow (monochrome only) —— */
.bg-stage {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.bg-base {
  position: absolute;
  inset: 0;
  background: #000;
}
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform, opacity;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 68%);
}
.bg-glow-a {
  width: min(80vw, 720px);
  height: min(60vw, 520px);
  top: -18%;
  left: 50%;
  margin-left: min(-40vw, -360px);
  animation: glow-breathe-a 10s ease-in-out infinite alternate;
}
.bg-glow-b {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  top: 35%;
  left: -12%;
  opacity: 0.55;
  animation: glow-breathe-b 14s ease-in-out infinite alternate;
}
.bg-glow-c {
  width: min(50vw, 380px);
  height: min(50vw, 380px);
  bottom: 5%;
  right: -10%;
  opacity: 0.4;
  animation: glow-breathe-c 12s ease-in-out infinite alternate;
}
@keyframes glow-breathe-a {
  0% { transform: translate(0, 0) scale(1); opacity: 0.35; }
  100% { transform: translate(0, 6%) scale(1.08); opacity: 0.65; }
}
@keyframes glow-breathe-b {
  0% { transform: translate(0, 0) scale(1); opacity: 0.2; }
  100% { transform: translate(8%, -4%) scale(1.12); opacity: 0.45; }
}
@keyframes glow-breathe-c {
  0% { transform: translate(0, 0) scale(1.05); opacity: 0.18; }
  100% { transform: translate(-6%, 4%) scale(1.15); opacity: 0.4; }
}
/* soft moving white sheen */
.bg-sheen {
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.04) 45%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 55%,
    transparent 70%
  );
  background-size: 200% 200%;
  animation: sheen-sweep 14s ease-in-out infinite;
  opacity: 0.9;
}
@keyframes sheen-sweep {
  0% { background-position: 0% 40%; opacity: 0.5; }
  50% { background-position: 100% 60%; opacity: 1; }
  100% { background-position: 0% 40%; opacity: 0.5; }
}
.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 85% 75% at 50% 35%,
    transparent 30%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

@media (max-width: 900px) {
  .bg-glow { filter: blur(56px); }
  .bg-glow-a { opacity: 0.9; }
  .bg-sheen { opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-glow,
  .bg-sheen,
  .pulse,
  .view.is-on,
  .view.is-on > *,
  .card,
  .btn,
  .toast {
    animation: none !important;
  }
  .btn:active:not(:disabled),
  .home-stat:hover,
  .card:hover {
    transform: none !important;
  }
  .bg-glow-a { opacity: 0.4; }
  .bg-sheen { opacity: 0.35; }
}

/* flags / emoji → 12px grid, nearest-neighbour (see site.js pixelizeText) */
.px-emoji {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin: 0 3px 0 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
  user-select: none;
  pointer-events: none;
}
.lib-orig .px-emoji,
.card-title .px-emoji {
  width: 18px;
  height: 18px;
}

button,
input,
textarea,
select {
  font-family: inherit;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
}

::selection {
  background: #ededed;
  color: #000;
}

/* subtle custom scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #333 #0a0a0a;
}

.offline {
  position: sticky;
  top: 0;
  z-index: 60;
  text-align: center;
  padding: 8px 12px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  color: #ededed;
  font-size: 14px;
}
.offline[hidden] { display: none !important; }

.hint-warn { color: #ededed !important; }

.kbd-hint { margin-top: 16px; }
kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #333;
  background: #0a0a0a;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
}

.session {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.session:hover { background: var(--bg-hover); color: var(--fg); }

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* kill browser default blue links / autofill yellow bleed */
a { color: var(--fg); }
a:visited { color: var(--fg); }
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--fg) !important;
  box-shadow: 0 0 0 1000px var(--bg) inset !important;
  transition: background-color 9999s ease-out;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 8px 12px;
  background: var(--white);
  color: var(--black);
  font-weight: 500;
  border-radius: var(--r);
}
.skip:focus { left: 12px; top: 12px; }

/* —— Language —— */
.lang-switch {
  display: inline-flex;
  align-items: stretch;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  flex-shrink: 0;
  /* keep selected btn background inside the frame (don't paint over bottom border) */
  overflow: hidden;
  box-sizing: border-box;
}
.lang-btn {
  appearance: none;
  border: none;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 14px;
  padding: 0 12px;
  min-width: 40px;
  /* fill content box only — fixed 40px covered parent's 1px bottom border when is-on */
  height: auto;
  min-height: 0;
  align-self: stretch;
  flex: 1 1 auto;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.lang-btn:last-child { border-right: none; }
.lang-btn:hover { color: var(--fg); background: var(--bg-hover); }
.lang-btn.is-on {
  color: var(--fg);
  background: var(--bg-hover);
}
.lang-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}
.lang-modal[hidden] { display: none !important; }
.lang-modal-card {
  width: min(100%, 360px);
  padding: 24px;
  border: 1px solid var(--line);
  background: #0a0a0a;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.lang-modal-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 400;
  color: var(--fg);
}
.lang-picks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.lang-picks .btn { width: 100%; }

@media (max-width: 900px) {
  .lang-switch { height: 40px; }
  .lang-btn {
    font-size: 12px;
    padding: 0 10px;
    min-width: 40px;
  }
}

/* —— Header —— */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  height: auto;
  border-bottom: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}

.header-inner {
  width: min(100% - 32px, var(--max));
  min-height: var(--header-h);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: nowrap;
  padding: 10px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  flex-shrink: 0;
  order: 0;
}
.logo:visited { color: var(--fg); }
.logo-mark {
  display: flex;
  width: 16px;
  height: 16px;
  color: var(--fg);
  flex-shrink: 0;
}
.logo-mark svg {
  display: block;
  width: 16px;
  height: 16px;
}
.logo-text {
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}
.logo-text span {
  font-weight: 400;
  color: var(--fg-3);
  margin-left: 2px;
}

/* nav — 4 groups only, must fit one row */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
  flex-wrap: nowrap;
  order: 1;
  overflow: visible;
}

.nav {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--fg-3);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  padding: 7px 11px;
  border-radius: var(--r);
  cursor: pointer;
  transition:
    color 0.18s var(--ease),
    background 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
  white-space: nowrap;
  line-height: 1.2;
}
.nav:hover {
  color: var(--fg);
  background: var(--bg-hover);
}
.nav.is-on {
  color: var(--fg);
  background: var(--bg-hover);
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.55);
}
.nav:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}

/* group-tabs removed — 4 flat screens */
.group-tabs { display: none !important; }
.gtab { display: none; }
.gtab.is-on {
  color: var(--fg);
  border-color: var(--line);
  background: var(--bg-elev);
}
.gtab:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}

.header .btn-icon {
  min-width: 36px;
  padding: 0 10px;
  font-size: 18px;
  line-height: 1;
}

/* live + session + actions — right cluster */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 0;
  order: 2;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
  animation: pulse-ring 2s var(--ease-out) infinite;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); opacity: 1; }
  70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); opacity: 0.75; }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); opacity: 1; }
}
.badge-n {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 400;
  color: var(--fg);
  line-height: 1;
}
.badge-l {
  font-size: 16px;
  color: var(--fg-3);
  font-weight: 400;
  line-height: 1;
}

/* —— Buttons —— */
/* [hidden] must beat display:inline-flex on .btn (otherwise Trial stays visible) */
.btn[hidden],
button[hidden],
.page-head-actions [hidden],
.is-hidden {
  display: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
  padding: 0 16px;
  height: var(--h-ctrl);
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.18s var(--ease),
    border-color 0.18s var(--ease),
    color 0.18s var(--ease),
    transform 0.12s var(--ease),
    box-shadow 0.18s var(--ease);
  white-space: nowrap;
  image-rendering: pixelated;
  flex-shrink: 0;
}
@media (hover: hover) and (pointer: fine) {
  .btn:active:not(:disabled) {
    transform: scale(0.96);
  }
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}
.btn-primary:hover:not(:disabled) {
  background: #eaeaea;
  border-color: #eaeaea;
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.18);
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--fg-4);
}

.btn-sm {
  min-height: 40px;
  height: auto;
  padding: 0 12px;
  font-size: 13px;
}

.btn-kbd {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  padding: 0 6px;
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.1);
  color: var(--black);
}

/* header controls — min 40px hit area */
.header .btn,
.header .btn-sm {
  min-height: 40px;
  height: 40px;
  font-size: 15px;
  padding: 0 14px;
}
.header .session {
  min-height: 40px;
  height: 40px;
  font-size: 15px;
  max-width: 140px;
  padding: 0 12px;
}
.header .badge-live {
  min-height: 40px;
  height: 40px;
}

/* —— Home landing —— */
.home-hero {
  margin-bottom: 28px;
  max-width: 720px;
}
.home-hero h1 {
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.12;
  margin-bottom: 14px;
  color: var(--fg);
}
.home-lead {
  max-width: 38em;
}
.home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 28px;
}
.home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.home-stat {
  min-width: 120px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg-elev);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.home-stat:hover {
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}
.home-stat-v {
  display: block;
  font-family: var(--mono);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--fg);
  margin-bottom: 4px;
}
.home-stat-l {
  font-size: 13px;
  color: var(--fg-3);
}
.home-grid {
  margin-top: 8px;
}
.home-steps {
  margin-top: 20px;
}
.home-ol {
  margin: 0;
  padding-left: 1.2em;
}
.home-ol li {
  margin-bottom: 8px;
  color: var(--fg-2);
  line-height: 1.45;
}

/* —— Layout —— */
.main {
  position: relative;
  z-index: 1;
  padding: 32px 0 64px;
  min-height: calc(100dvh - var(--header-h) - 56px);
}

.container {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

.view[hidden] { display: none !important; }
/* tab switch is high-frequency — keep under 300ms (review-animations / feel-better) */
.view.is-on {
  animation: view-in 0.2s var(--ease-out) both;
}
.view.is-on > * {
  animation: rise-in 0.22s var(--ease-out) both;
}
.view.is-on > *:nth-child(1) { animation-delay: 0.02s; }
.view.is-on > *:nth-child(2) { animation-delay: 0.05s; }
.view.is-on > *:nth-child(3) { animation-delay: 0.08s; }
.view.is-on > *:nth-child(4) { animation-delay: 0.1s; }
.view.is-on > *:nth-child(5) { animation-delay: 0.12s; }
.view.is-on > *:nth-child(6) { animation-delay: 0.14s; }
@keyframes view-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 20px;
  margin-bottom: 16px;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--fg-3);
  letter-spacing: 0;
  line-height: 1.3;
}
h1 {
  margin: 0 0 10px;
  font-size: var(--fs-xl);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--fg);
  text-wrap: balance;
}
.lead {
  margin: 0;
  max-width: 36rem;
  font-size: 18px;
  color: var(--fg-2);
  text-wrap: pretty;
  line-height: 1.55;
}
.lead strong {
  color: var(--fg);
  font-weight: 400;
}

.hint {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--fg-3);
  min-height: 1.2em;
  line-height: 1.5;
}
.muted {
  margin: 0;
  color: var(--fg-3);
  font-size: 18px;
}

/* —— Cards —— layered depth (shadows over harsh borders) —— */
.card {
  background: var(--bg-elev);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-card);
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 24px 48px rgba(0, 0, 0, 0.28);
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.25s var(--ease),
    transform 0.2s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06) inset,
      0 1px 0 rgba(255, 255, 255, 0.08) inset,
      0 12px 32px rgba(0, 0, 0, 0.5),
      0 28px 56px rgba(0, 0, 0, 0.35),
      0 0 32px rgba(255, 255, 255, 0.04);
  }
}
.card-flush {
  padding: 0;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 18px;
  font-weight: 400;
  color: var(--fg);
}
.card-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}

/* —— Inputs —— */
.label {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 400;
  color: var(--fg-2);
}
.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.input {
  flex: 1 1 180px;
  min-width: 0;
  height: var(--h-ctrl);
  padding: 0 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.3;
  transition: border-color 0.05s var(--ease);
}
.input.mono {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0;
}
.input::placeholder { color: var(--fg-3); }
.input:focus {
  outline: none;
  border-color: var(--fg-3);
}
.input:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
  border-color: var(--fg);
}
textarea.input {
  height: auto;
  min-height: 140px;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
  width: 100%;
  flex: none;
  display: block;
}

/* —— Library —— */
.lib-search .lib-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.lib-search .lib-row .input {
  flex: 1 1 200px;
}
.lib-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.lib-filters .chk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--fg-2);
  cursor: pointer;
}
.lib-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  max-height: min(70vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  content-visibility: auto;
}
.lib-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
}
.lib-more {
  width: 100%;
  margin-top: 4px;
}
.lib-card .card-head {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.lib-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.rate-badge {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 2px 8px;
  white-space: nowrap;
}
.rate-none {
  color: var(--fg-3);
}
.lib-rate {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lib-rate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  align-items: stretch;
}
.lib-rate-actions .btn {
  width: 100% !important;
  min-width: 0;
  min-height: 44px !important;
  height: 44px !important;
  margin: 0;
  padding: 0 12px;
  font-size: 13px;
  justify-content: center;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-rate-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.02);
}
.lib-rate-panel[hidden] {
  display: none !important;
}
.lib-rate .lib-comment {
  width: 100%;
}
.lib-rate .lib-rate-btn {
  width: 100%;
  min-height: 44px;
}
.lib-rate-msg {
  margin: 0;
}
.score-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.score-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 14px;
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  cursor: pointer;
}
.score-chip.is-on,
.score-chip:hover {
  color: var(--fg);
  border-color: var(--fg);
  background: var(--bg-hover);
}
.lib-comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.lib-comment-row {
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  font-size: 15px;
  color: var(--fg-2);
  line-height: 1.4;
}
.break-all {
  word-break: break-all;
}
.level-card {
  margin-bottom: 10px;
}
.level-card.is-hi {
  border-color: var(--fg-4);
}
.levels-cards {
  display: none;
}

.lib-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 12px 0 0;
}
.lib-dl > div {
  min-width: 0;
}
.lib-dl dt {
  font-size: 12px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 2px;
}
.lib-dl dd {
  margin: 0;
  font-size: 15px;
  color: var(--fg);
  word-break: break-word;
}
.pill {
  font-size: 12px;
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.pill-live {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.4);
}
.pill-off {
  color: var(--fg-3);
}
.inline-code,
button.linkish {
  font-family: var(--mono);
  font-size: inherit;
}
button.linkish {
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (max-width: 700px) {
  .lib-dl {
    grid-template-columns: 1fr;
  }
}

/* —— Node name legend (3-letter codes) —— */
#nameLegendCard {
  margin-top: 16px;
}
.code-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 16px;
  margin-top: 12px;
}
.code-col h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.code-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.code-list li {
  font-size: 15px;
  color: var(--fg-2);
  line-height: 1.35;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.code-pill {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  min-width: 1.6em;
  text-align: center;
  flex-shrink: 0;
}
.code-pill-ex {
  min-width: 2.8em;
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.28);
}
.plain-list.quiet {
  margin-top: 14px;
  font-size: 14px;
  color: var(--fg-3);
}
.plain-list.quiet li {
  margin-bottom: 4px;
}
@media (max-width: 900px) {
  .code-legend {
    grid-template-columns: 1fr 1fr;
  }
  .code-col-wide {
    grid-column: 1 / -1;
  }
}

/* —— Steps —— */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.mini {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 14px;
  background: var(--bg-elev);
  backdrop-filter: blur(10px);
  transition:
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.25s var(--ease);
}
.mini:hover {
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.mini-n {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-3);
  margin-bottom: 6px;
}
.mini strong {
  display: block;
  color: var(--fg);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 4px;
}
.mini p {
  margin: 0;
  font-size: 18px;
  color: var(--fg-3);
  line-height: 1.45;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-l {
  font-size: 12px;
  color: var(--fg-3);
  font-weight: 400;
}
.stat-v {
  font-family: var(--mono);
  font-size: var(--fs-lg);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-v.small { font-size: 12px; line-height: 1.3; }
.stat-v small {
  font-size: 12px;
  color: var(--fg-3);
  margin-left: 4px;
  font-weight: 400;
}

/* —— Profile —— */
.profile h3 {
  margin: 0 0 12px;
  font-size: var(--fs-lg);
  font-weight: 400;
  color: var(--fg);
  letter-spacing: 0;
}
.profile dl {
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px 10px;
  font-size: 12px;
}
.profile dt { color: var(--fg-3); }
.profile dd {
  margin: 0;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.profile .note { margin: 0; }
.profile .mono-dd {
  font-family: var(--mono);
  font-size: var(--fs);
  font-weight: 400;
  color: var(--fg-3);
}

/* —— Table —— */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
}
.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  line-height: 1.4;
}
.table th {
  font-size: 12px;
  font-weight: 400;
  color: var(--fg-3);
  background: var(--bg-hover);
}
.table td { color: var(--fg-2); }
.table td:first-child {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--fg);
  font-size: 18px;
}
.table tr:last-child td { border-bottom: none; }
/* highlight = gray wash, not blue */
.table tr.is-you {
  background: rgba(255, 255, 255, 0.06);
}
.table tr.is-you td { color: var(--fg); }
.table tr.is-you td:first-child { color: var(--white); }

/* —— Raw —— */
.raw { margin-top: 4px; }
.raw summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  color: var(--fg);
  padding: 4px 0;
}
.raw summary code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-2);
}
.raw pre {
  margin: 12px 0;
  padding: 12px;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 12px;
  overflow: auto;
  max-height: 240px;
  line-height: 1.45;
}
.raw a {
  font-size: 12px;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 400;
}
.raw a:hover { color: var(--white); }

/* —— Footer —— */
.footer {
  border-top: 1px solid var(--line-2);
  padding: 16px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  position: relative;
  z-index: 1;
}

.header {
  padding-top: env(safe-area-inset-top, 0px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.card[data-state="empty"] .input {
  opacity: 0.65;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--fg-3);
}
.footer-meta {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.footer a {
  color: var(--fg-2);
  text-decoration: none;
}
.footer a:hover,
.footer a:visited { color: var(--fg); }

/* —— Toast —— */
.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 70;
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  border: 1px solid var(--white);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  -webkit-font-smoothing: none;
  animation: toast-in 0.35s var(--ease-out) both;
}
.toast[hidden] { display: none !important; }
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* —— Product extras —— */
.session {
  font-size: 12px;
  font-weight: 400;
  color: var(--fg);
  padding: 0 8px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-elev);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session[hidden] { display: none !important; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.format-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.label-inline {
  font-size: 12px;
  color: var(--fg-3);
  font-weight: 400;
}
.select {
  height: 28px;
  padding: 0 8px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 12px;
}
.select:focus {
  outline: none;
  border-color: var(--fg-3);
}
.select:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
  border-color: var(--fg);
}
.select:disabled { opacity: 0.45; }

.sub-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
}
.qr-box img {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: var(--r);
  background: var(--bg);
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: 0;
}
.qr-box[hidden] { display: none !important; }
.qr-cap {
  font-size: 12px;
  color: var(--fg-3);
}

.soft-card {
  margin-top: 12px;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 6px 20px rgba(0, 0, 0, 0.32),
    0 16px 40px rgba(0, 0, 0, 0.22);
}
.hr {
  border: none;
  border-top: 1px solid var(--line-2);
  margin: 16px 0;
}

.devices { display: flex; flex-direction: column; gap: 8px; }
.dev-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--bg);
}
.dev-ua {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 12px;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dev-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-3);
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plain-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 18px;
  color: var(--fg-2);
  line-height: 1.5;
}
.plain-list li:last-child { border-bottom: none; }
.plain-list b {
  color: var(--fg);
  font-weight: 400;
  margin-right: 6px;
}

.client-card strong {
  display: block;
  color: var(--fg);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 4px;
}
.client-card .os {
  font-size: 12px;
  color: var(--fg-3);
  margin-bottom: 6px;
}
.client-card p {
  margin: 0;
  font-size: 18px;
  color: var(--fg-2);
  line-height: 1.45;
}

.mobile-nav {
  display: none;
}
.mobile-nav .nav-ico {
  display: block;
  font-size: 16px;
  line-height: 1;
  margin-bottom: 2px;
}
.mobile-nav .nav-lbl {
  display: block;
  font-size: 11px;
  line-height: 1.1;
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .header-nav { display: none; }
  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 60;
    justify-content: space-around;
    align-items: stretch;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line-2);
    border-bottom: none;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  }
  .mobile-nav .nav {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 6px 2px;
    font-size: 11px;
    border-radius: 0;
  }
  .mobile-nav .nav.is-on {
    color: var(--fg);
    background: transparent;
    box-shadow: none;
  }
  .mobile-nav .nav.is-on .nav-ico {
    color: var(--fg);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
  }
  .toast {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .group-tabs {
    top: var(--header-h);
    position: sticky;
  }
  .header-inner { flex-wrap: nowrap; }
  .header-right { margin-left: auto; }
  .grid-3 { grid-template-columns: 1fr; }
  .split,
  .grid-2 { grid-template-columns: 1fr; }
  .sub-grid { grid-template-columns: 1fr; }
  h1 { font-size: 32px; }
  .page-head .btn-primary { width: 100%; height: var(--h-ctrl); }
  .main {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  .footer {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .levels-table-wrap { display: none; }
  .levels-cards { display: block; }
  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-row .btn { width: 100%; min-height: 44px; }
  .home-cta { flex-direction: column; }
  .home-cta .btn { width: 100%; min-height: 44px; }
  .input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .input-row .btn { width: 100%; }
  .format-row {
    flex-wrap: wrap;
  }
  .lib-dl {
    grid-template-columns: 1fr;
  }
  .code-legend {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --fs-body: 16px;
    --fs-xl: 36px;
    --fs-lg: 28px;
  }
  body { font-size: 16px; }
  .logo-text { display: none; }
  .badge-l { display: none; }
  .session {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-inner {
    gap: 8px;
    width: min(100% - 16px, var(--max));
    padding: 8px 0;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .container {
    width: min(100% - 16px, var(--max));
  }
  .qr-box { max-width: 160px; margin: 0 auto; }
  .card { padding: 14px; }
  .header .btn-primary span.btn-kbd { display: none; }
  .home-hero h1 { font-size: 28px; }
  .plain-list li { font-size: 16px; }
  .table { font-size: 13px; }
  .mono, .input.mono { overflow-wrap: anywhere; word-break: break-all; }
}

@media (max-width: 380px) {
  .session { display: none !important; }
  .btn-sm#btnRefresh { display: none; }
  .score-chip {
    min-width: 30px;
    min-height: 34px;
    font-size: 13px;
  }
}

/* —— My nodes (sticky sub pool) —— */
.my-nodes-sum {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 2px 0;
  user-select: none;
}
.my-nodes-sum::-webkit-details-marker,
.my-nodes-sum::marker {
  display: none;
  content: '';
}
#myNodesCard.fold > summary.my-nodes-sum {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}
#myNodesCard.fold[open] > summary.my-nodes-sum {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 8px;
}
.my-nodes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  content-visibility: auto;
  margin-top: 8px;
  padding-right: 2px;
}
.my-node {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 6px 16px rgba(0, 0, 0, 0.28);
  content-visibility: auto;
  contain-intrinsic-size: auto 72px;
}
.my-node-name {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.my-node-meta {
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.my-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.my-node-actions .btn {
  min-height: 40px;
  height: 40px;
  font-size: 12px;
  padding: 0 12px;
}
.region-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  grid-column: 1 / -1;
}
.region-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 12px;
  padding: 0 12px;
  min-height: 40px;
  min-width: 40px;
  cursor: pointer;
  transition:
    border-color 0.15s var(--ease),
    color 0.15s var(--ease),
    background 0.15s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .region-chip:hover {
    border-color: var(--fg-3);
    color: var(--fg);
    background: var(--bg-hover);
  }
}
.region-chip.is-on {
  border-color: var(--fg-3);
  color: var(--fg);
  background: var(--bg-hover);
}
.region-chip:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}

/* —— Compact IA: 4 screens, denser cards —— */
.main {
  padding: 20px 0 48px;
}
.page-head-tight {
  margin-bottom: 10px;
  gap: 10px 16px;
  align-items: center;
}
.page-head-tight h1 {
  font-size: clamp(22px, 4vw, 28px);
  margin: 0 0 4px;
  line-height: 1.15;
}
.lead-tight {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--fg-3);
  max-width: 40em;
}
.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.stat-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 56px;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
}
.stat-inline-v {
  font-family: var(--mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  line-height: 1.1;
}
.stat-inline-l {
  font-size: 11px;
  color: var(--fg-3);
  text-transform: uppercase;
}
.card-dense {
  padding: 12px 14px;
  margin-bottom: 10px;
}
.card-dense .card-head {
  margin-bottom: 8px;
}
.hint.tight {
  margin: 4px 0 8px;
  font-size: 13px;
  line-height: 1.35;
}
.stack-dense {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.split-dense {
  gap: 10px;
  margin-bottom: 10px;
}
.btn-row-inline {
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.btn-row-inline .btn {
  width: auto !important;
  min-height: 40px;
  height: 40px;
  font-size: 14px;
  padding: 0 14px;
}
/* Subscription URL — single bar (url + copy), slim secondary row */
.sub-url-bar {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: var(--h-ctrl);
  border: 1px solid var(--line);
  background: #000;
  transition: border-color 0.12s var(--ease), box-shadow 0.18s var(--ease);
}
.sub-url-bar:focus-within {
  border-color: var(--fg-3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.sub-url-input.input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: var(--h-ctrl);
  min-height: var(--h-ctrl);
  margin: 0;
  border: none !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  padding: 0 14px;
}
.sub-url-input.input:focus,
.sub-url-input.input:focus-visible {
  outline: none;
  border: none !important;
  box-shadow: none;
}
.sub-url-copy {
  flex: 0 0 auto;
  align-self: stretch;
  height: auto !important;
  min-height: var(--h-ctrl) !important;
  margin: 0;
  padding: 0 18px;
  border: none !important;
  border-left: 1px solid var(--line) !important;
  border-radius: 0 !important;
  font-size: 14px;
  box-shadow: none !important;
}
.sub-url-copy:hover:not(:disabled) {
  box-shadow: none !important;
}
.sub-url-copy:disabled {
  opacity: 0.35;
}

.sub-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-top: 10px;
}
.sub-format-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 220px;
}
.sub-format-inline label {
  flex: 0 0 auto;
  margin: 0;
  font-size: 12px;
  line-height: 1;
  color: var(--fg-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sub-format-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 280px;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 0;
  cursor: pointer;
}
.sub-format-select:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.sub-format-select:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}
.sub-side-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.btn-ghost {
  background: transparent;
  color: var(--fg-2);
  border-color: transparent;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}
.btn-ghost:hover:not(:disabled) {
  color: var(--fg);
  background: var(--bg-hover);
  border-color: var(--line);
  box-shadow: none;
}
.btn-ghost:disabled {
  opacity: 0.35;
}
@media (max-width: 560px) {
  .sub-url-bar {
    flex-direction: column;
  }
  .sub-url-copy {
    width: 100%;
    border-left: none !important;
    border-top: 1px solid var(--line) !important;
    min-height: 44px !important;
  }
  .sub-meta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .sub-format-inline {
    flex: 1 1 auto;
  }
  .sub-format-select {
    max-width: none;
  }
  .sub-side-actions {
    width: 100%;
  }
  .sub-side-actions .btn-ghost {
    flex: 1 1 0;
    justify-content: center;
  }
}
.nodes-search-box {
  margin: 10px 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}
.nodes-search-box .label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--fg-2);
}
.nodes-search-box .input {
  width: 100%;
  flex: none;
  display: block;
  min-height: 44px;
  height: 44px;
  border-color: rgba(255, 255, 255, 0.2);
  background: #000;
}
.fold > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font);
  color: var(--fg);
  padding: 4px 0;
  user-select: none;
}
.fold > summary::-webkit-details-marker,
.fold > summary::marker {
  display: none;
  content: '';
}
.fold-sum-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}
/* text chevron ▸ — visible with pixel fonts (border-triangle often invisible) */
.fold-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  color: var(--fg);
  transition: transform 0.15s var(--ease);
}
.fold[open] > summary .fold-chevron {
  transform: rotate(90deg);
}
.fold-hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--fg-4);
  font-weight: 400;
}
.fold[open] > summary .fold-hint {
  display: none;
}
.name-example-line {
  margin: 0 0 12px !important;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  color: var(--fg-3);
}
.name-example-line #nameLegendFmt {
  color: var(--fg-2);
}
.fold[open] > summary {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 8px;
}
.fold > summary:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}
.fold > summary:hover .fold-chevron {
  color: var(--white);
}
.grid-4.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.stats-row .stat {
  padding: 10px 12px;
  margin: 0;
}
.stats-row .stat-v {
  font-size: 22px;
}
.compact-list li {
  margin-bottom: 4px;
  font-size: 15px;
}
.hr.tight {
  margin: 10px 0;
}
.chk.tight {
  margin-top: 8px;
  font-size: 13px;
}
.fmt-stats {
  font-size: 13px;
  line-height: 1.5;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.qr-box img {
  width: 120px;
  height: 120px;
}
@media (max-width: 900px) {
  .grid-4.stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .btn-row-inline .btn {
    flex: 1 1 auto;
  }
  .page-head-actions {
    width: 100%;
    justify-content: space-between;
  }
}
