*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:      #17171a;
  --fg:      #edeae4;
  --mid:     #7a766f;
  --dim:     #3e3b38;
  --subtle:  #524f4b;
  --dimmer:  #2d2d2d;
  --rule:    #232120;
  --mono:    'DM Mono', monospace;
  --disp:    'Syne', sans-serif;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-weight: 300;
  min-height: 100svh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--rule);
  padding: 0 44px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg);
  flex-shrink: 0;
}
.h-left { display: flex; align-items: center; gap: 14px; }
.h-logo {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--fg);
  text-decoration: none;
  transition: color 0.12s;
}
.h-logo:hover { color: #fff; }
.h-sep { width: 1px; height: 14px; background: var(--dim); flex-shrink: 0; }
.h-tag {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}
.h-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--mid); flex-shrink: 0; }
.h-nav { display: flex; align-items: center; gap: 22px; }
.h-nav a {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.12s;
}
.h-nav a:hover, .h-nav a.active { color: var(--fg); }
.h-nav-sep {
  font-size: 12px;
  color: var(--dim);
  user-select: none;
  line-height: 1;
}
.h-logo-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}
.h-burger {
  display: none;
  align-items: center;
  background: none;
  border: none;
  color: var(--mid);
  cursor: pointer;
  padding: 4px;
  transition: color 0.12s;
}
.h-burger:hover { color: var(--fg); }
.h-burger svg { width: 16px; height: 16px; }

main {
  padding: 16px 44px 60px;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #19191c;
}
.ghost {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 34vw;
  line-height: 0.82;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.035);
  position: absolute;
  right: -2vw;
  bottom: -3vw;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}
main h1, main > p { position: relative; z-index: 1; }
main h1 {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--fg);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
}
main > p {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fastflags-shell {
  --shell-bg:       #1c1c1e;
  --shell-rule:     #202022;
  --shell-dim:      #35353a;
  --shell-subtle:   #55555b;
  --shell-mid:      #7a7a80;
  --shell-fg:       #e8e8ea;
  border: 1px solid var(--shell-dim);
  border-radius: 4px;
  background: var(--shell-bg);
  color: var(--shell-fg);
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Toolbar */
.fastflags-shell .fastflags-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--shell-rule);
  background: var(--shell-rule);
  flex-shrink: 0;
}
.fastflags-shell .fastflags-toolbar input,
.fastflags-shell .fastflags-toolbar select {
  background: var(--shell-bg);
  border: 1px solid var(--shell-dim);
  color: var(--shell-fg);
  border-radius: 2px;
  padding: 6px 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  min-height: 32px;
  outline: none;
  transition: border-color 0.12s;
}
.fastflags-shell .fastflags-toolbar input { min-width: 320px; flex: 0 1 400px; }
.fastflags-shell .fastflags-toolbar select {
  min-width: 0;
  width: auto;
  padding-right: 24px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--shell-mid) 50%),
    linear-gradient(135deg, var(--shell-mid) 50%, transparent 50%);
  background-position:
    calc(100% - 13px) 50%,
    calc(100% - 9px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.fastflags-shell .fastflags-toolbar input:focus,
.fastflags-shell .fastflags-toolbar select:focus { border-color: var(--shell-subtle); }
.fastflags-shell .fastflags-toolbar input::placeholder { color: var(--shell-subtle); }
.fastflags-shell .fastflags-toolbar select option { background: var(--shell-bg); }

/* Toolbar buttons */
.fastflags-shell .fastflags-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--shell-mid);
  background: transparent;
  border: 1px solid var(--shell-dim);
  border-radius: 2px;
  cursor: pointer;
  min-height: 32px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  white-space: nowrap;
}
.fastflags-shell .fastflags-toolbar button:hover:not(:disabled) {
  color: var(--shell-fg);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.03);
}
.fastflags-shell .fastflags-toolbar button:disabled { opacity: 0.35; cursor: not-allowed; }
.fastflags-shell .fastflags-toolbar button.active {
  color: var(--shell-fg);
  border-color: rgba(255,255,255,0.18);
}

.fastflags-shell .fastflags-toolbar button.btn-hot {
  color: var(--shell-fg);
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
}
.fastflags-shell .fastflags-toolbar button.btn-hot:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.14);
}
.fastflags-shell .mobile-filters-toggle {
  display: none;
}

/* Filter group — type + platform selects stay visually joined */
.fastflags-shell .filter-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  border: none;
}
.fastflags-shell .filter-group select {
  border: 1px solid var(--shell-dim);
  border-radius: 2px;
}
.fastflags-shell .filter-group select:focus { border-color: var(--shell-subtle); outline: none; }

/* Filter row — keeps whitelist-toggle + filter-group always together as one flex unit */
.fastflags-shell .filter-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Whitelist button — inactive: same as .active toolbar btn, active: same as .btn-hot */
.fastflags-shell .fastflags-toolbar button.whitelist-btn {
  color: var(--shell-fg);
  border-color: rgba(255,255,255,0.18);
  background: transparent;
}
.fastflags-shell .fastflags-toolbar button.whitelist-btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.32);
  background: rgba(255,255,255,0.03);
}
.fastflags-shell .fastflags-toolbar button.whitelist-btn.whitelist-active {
  color: var(--shell-fg);
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
}
.fastflags-shell .fastflags-toolbar button.whitelist-btn.whitelist-active:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.14);
}

.fastflags-shell .selection-actions { display: flex; flex: 1; gap: 6px; align-items: center; }
.fastflags-shell #selected-count {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--shell-subtle);
  white-space: nowrap;
}
.fastflags-shell .fastflags-stats {
  margin-left: auto;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--shell-subtle);
  white-space: nowrap;
}
.fastflags-shell .fastflags-state {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d9d7d2;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}
.fastflags-shell .fastflags-state:empty {
  display: none;
}
.preset-value-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.preset-value-control {
  width: 100%;
  background: #1a1a1a;
  color: var(--fg);
  border: 1px solid #4a9eff;
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 11px;
  border-radius: 3px;
}
.preset-value-control.is-invalid {
  border-color: #ff4a4a;
}
.preset-value-feedback {
  display: none;
  color: #ff8a8a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.preset-value-feedback.visible {
  display: block;
}
.fastflags-shell .fastflags-search-hint {
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--shell-rule);
  background: rgba(255,255,255,0.02);
  color: var(--shell-subtle);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.5;
}
.fastflags-shell .fastflags-search-hint code {
  color: var(--shell-fg);
  font-size: 11px;
}

/* ── TABLE WRAP (scrollable) ── */
.fastflags-shell .fastflags-table-wrap {
  flex: 1;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--shell-subtle) var(--shell-rule);
}
.fastflags-shell .fastflags-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.fastflags-shell .fastflags-table-wrap::-webkit-scrollbar-track { background: var(--shell-rule); }
.fastflags-shell .fastflags-table-wrap::-webkit-scrollbar-thumb {
  background: var(--shell-subtle);
  border: 2px solid var(--shell-rule);
  border-radius: 0;
}
.fastflags-shell .fastflags-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--shell-mid); }
.fastflags-shell .fastflags-table-wrap::-webkit-scrollbar-corner { background: var(--shell-rule); }

/* Table */
.fastflags-shell #fastflags-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1400px;
  font-family: Arial, Helvetica, sans-serif;
}
.fastflags-shell #fastflags-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
  background: #2d2d2d;
  color: var(--shell-mid);
  border-bottom: 1px solid var(--shell-dim);
  white-space: nowrap;
}
.fastflags-shell #fastflags-table tbody tr td {
  background: #1c1c1e;
}
.fastflags-shell #fastflags-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--shell-rule);
  vertical-align: top;
  color: var(--shell-fg);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  white-space: nowrap;
}
.fastflags-shell #fastflags-table tbody tr:hover td {
  background: #353535;
}
.fastflags-shell .fastflags-code {
  font-family: Arial, Helvetica, sans-serif;
  white-space: nowrap;
}
.fastflags-shell .cjv-tooltip {
  display: inline-block;
  margin-left: 4px;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  font-size: 10px;
  font-weight: bold;
  color: #454341;
  background: var(--shell-hover);
  border-radius: 50%;
  cursor: help;
  vertical-align: middle;
}
.fastflags-shell .select-col { width: 50px; text-align: center; }
.fastflags-shell .select-col.hidden { display: none; }

/* Expand button */
.fastflags-shell .expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--shell-dim);
  color: var(--shell-mid);
  border-radius: 2px;
  font-size: 7px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
  margin-left: 6px;
  transition: color 0.12s, border-color 0.12s;
}
.expand-btn:hover { color: var(--fg); border-color: var(--subtle); }
.value-short { vertical-align: middle; }
.value-mid  { white-space: pre-wrap; word-break: break-all; vertical-align: middle; }
.value-full { white-space: pre-wrap; word-break: break-all; }
td.value-expanded { white-space: pre-wrap !important; word-break: break-all; }
td.value-mid-expanded { white-space: pre-wrap !important; word-break: break-all; }

/* ── SMOOTH RESIZE TRANSITIONS ── */
header, footer, main, .fastflags-shell,
.fastflags-toolbar, .fastflags-pagination,
.fastflags-table-wrap, #fastflags-table,
.h-nav, .filter-group {
  transition: padding 0.25s ease, gap 0.25s ease, height 0.25s ease,
              min-width 0.25s ease, max-width 0.25s ease,
              background 0.25s ease, opacity 0.25s ease;
}
.fastflags-shell .fastflags-toolbar input,
.fastflags-shell .fastflags-toolbar select,
.fastflags-shell .fastflags-toolbar button {
  transition: padding 0.2s ease, width 0.2s ease, min-width 0.2s ease,
              color 0.12s, border-color 0.12s, background 0.12s, opacity 0.2s ease;
}
main h1  { transition: font-size 0.25s ease; }
main > p { transition: font-size 0.25s ease, margin-bottom 0.25s ease; }
.ghost   { transition: font-size 0.3s ease; }
.fastflags-table-wrap { position: relative; }

@keyframes loading-glow {
  0%, 100% { color: #706c67; }
  50%       { color: #eaeaea; }
}

#empty-overlay {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: var(--mid);
  pointer-events: none;
  z-index: 2;
}
#empty-overlay.visible { display: flex; }
#empty-overlay.loading { animation: loading-glow 2.8s ease-in-out infinite; }

/* ── SCROLL HINT (mobile — appears after flags load, fades in/out for 3s) ── */
#scroll-hint {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(to right, transparent 0%, transparent 60%, rgba(0,0,0,0.6) 80%, rgba(0,0,0,0.88) 100%);
  align-items: center;
  justify-content: flex-end;
  padding-right: 28px;
  pointer-events: none;
  z-index: 6;
}
#scroll-hint.visible { display: flex; }
#scroll-hint .sh-arrow {
  color: #fff;
  font-size: 28px;
  line-height: 1;
  animation: sh-bounce 1.1s ease-in-out infinite;
}
@keyframes sh-bounce {
  0%, 100% { transform: translateX(0);    opacity: 0.7; }
  50%       { transform: translateX(10px); opacity: 1; }
}

/* ── PAGINATION ── */
.fastflags-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-top: 1px solid var(--rule);
  background: var(--rule);
  flex-shrink: 0;
}
.fastflags-pagination button {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--shell-subtle);
  background: rgba(255,255,255,0.06);
  color: var(--shell-fg);
  border-radius: 3px;
  padding: 7px 16px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.fastflags-pagination button:hover:not(:disabled) {
  color: #fff;
  border-color: var(--shell-fg);
  background: rgba(255,255,255,0.12);
}
.fastflags-pagination button:disabled { opacity: 0.3; cursor: not-allowed; }
#page-stats {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 2px;
  transition: color 0.12s, background 0.12s;
}
#page-stats:hover { color: var(--shell-fg); background: rgba(255,255,255,0.04); }

footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  border-top: 1px solid var(--rule);
  background: var(--bg);
  padding: 0 44px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
footer.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.ft-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.ft-a { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--subtle); text-decoration: none; transition: color 0.12s; }
.ft-a:hover { color: var(--mid); }
.ft-vsep { width: 1px; height: 9px; background: var(--subtle); }
.ft-copy { font-size: 9px; letter-spacing: 0.08em; color: var(--subtle); }

/* Touch devices: force burger regardless of screen width */
@media (hover: none) and (pointer: coarse) {
  .h-burger { display: flex !important; }
  .h-nav { display: none; position: absolute; top: 50px; right: 20px;
    background: #17171a; border: 1px solid var(--rule);
    padding: 14px 20px; flex-direction: column; gap: 14px;
    z-index: 10; min-width: 200px; align-items: center; }
  .h-nav.open { display: flex !important; }
  .h-nav-desktop-only,
  .h-nav.open .h-nav-desktop-only { display: none !important; }
}

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  header { padding: 0 20px; }
  main { padding: 12px 16px 60px; }
  footer { height: auto; padding: 12px 20px; justify-content: center; }
  .h-burger { display: flex; }
  .h-nav {
    display: none;
    position: absolute;
    top: 50px; right: 20px;
    background: #17171a;
    border: 1px solid var(--rule);
    padding: 14px 20px;
    flex-direction: column;
    gap: 14px;
    z-index: 10;
    min-width: 200px;
    align-items: center;
  }
  .h-nav.open { display: flex; }
  /* hide desktop-only nav link on mobile — never show regardless of nav state */
  .h-nav-desktop-only,
  .h-nav.open .h-nav-desktop-only { display: none !important; }

  /* ── Dynamic h1: shrinks to fit 1 line, max = desktop size ── */
  main h1 {
    font-size: clamp(0.75rem, 5.2vw, 1.75rem);
  }

  /* ── Dynamic subtitle: scales to fill exactly 2 lines on mobile ── */
  main > p {
    font-size: clamp(6px, 1.85vw, 7.5px);
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  .subtitle-meta {
    white-space: nowrap;
    vertical-align: middle;
  }

  /* ── h-tag: compress on small screens, never wrap ── */
  .h-tag {
    font-size: clamp(7px, 1.8vw, 9px);
    letter-spacing: clamp(0.06em, 1vw, 0.2em);
    gap: 5px;
    line-height: 1;
    align-items: center;
  }
  .h-sep { display: none; }

  .fastflags-shell .fastflags-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px;
    align-items: stretch;
  }
  .fastflags-shell .fastflags-toolbar input {
    grid-column: 1 / 2;
    width: 100%;
    min-width: 0;
    flex: none;
    padding: 8px 10px;
    font-size: 12px;
    min-height: 36px;
  }
  .fastflags-shell .mobile-filters-toggle {
    display: inline-flex;
    grid-column: 2 / 3;
    justify-content: center;
    padding: 6px 10px;
    font-size: 10px;
    min-height: 36px;
  }
  .fastflags-shell .fastflags-toolbar button.whitelist-btn {
    grid-column: 1 / -1;
    display: none;
    justify-content: center;
    padding: 6px 10px;
    font-size: 10px;
    min-height: 32px;
  }
  .fastflags-shell .filter-group {
    grid-column: 1 / -1;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .fastflags-shell.filters-open .fastflags-toolbar button.whitelist-btn,
  .fastflags-shell.filters-open .filter-group {
    display: grid;
  }
  .fastflags-shell .filter-group select {
    width: 100%;
    min-width: 0;
    padding: 6px 28px 6px 10px;
    font-size: 11px;
    min-height: 32px;
  }
  .fastflags-shell .selection-actions {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
  }
  .fastflags-shell .selection-actions > button {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 6px 8px;
    font-size: 10px;
    letter-spacing: 0.03em;
    min-height: 32px;
  }
  .fastflags-shell .selection-actions > button:disabled {
    display: none;
  }
  .fastflags-shell #preset-state,
  .fastflags-shell #selected-count,
  .fastflags-shell .fastflags-stats {
    grid-column: 1 / -1;
    margin-left: 0;
    font-size: 9px;
    white-space: nowrap;
    text-align: left;
  }
  .fastflags-shell .fastflags-search-hint {
    display: none;
  }
  .fastflags-shell #fastflags-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }
  .fastflags-shell #fastflags-table thead {
    display: none;
  }
  .fastflags-shell #fastflags-table tbody,
  .fastflags-shell #fastflags-table tr,
  .fastflags-shell #fastflags-table td {
    display: block;
    width: 100%;
  }
  .fastflags-shell #fastflags-table tbody tr {
    border: 1px solid var(--shell-dim);
    border-radius: 8px;
    overflow: hidden;
    background: #1f1f22;
  }
  .fastflags-shell #fastflags-table tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    white-space: normal;
    border-bottom: 1px solid var(--shell-rule);
  }
  .fastflags-shell #fastflags-table tbody tr td:last-child {
    border-bottom: none;
  }
  .fastflags-shell #fastflags-table tbody tr td::before {
    content: attr(data-label);
    flex: 0 0 72px;
    color: var(--shell-mid);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .fastflags-shell #fastflags-table tbody tr td.select-col {
    justify-content: flex-start;
  }
  .fastflags-shell #fastflags-table tbody tr td.select-col::before {
    content: 'Select';
  }
  .fastflags-shell .flag-cell-title > .flag-status-badge {
    display: none;
  }
  .fastflags-shell .flag-cell-row {
    justify-content: flex-end;
  }
  .fastflags-shell .flag-cell-title {
    width: 100%;
    text-align: right;
  }
  .fastflags-shell #fastflags-table tbody tr td.select-col.flag-status-slot.hidden {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
  }
  .fastflags-shell #fastflags-table tbody tr td.select-col.flag-status-slot.hidden::before {
    content: none;
  }
  .fastflags-shell #fastflags-table tbody tr td.select-col.flag-status-slot.hidden .select-slot-label {
    color: var(--shell-mid);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-right: auto;
  }
  .fastflags-shell #fastflags-table tbody tr td.select-col.flag-status-slot.hidden .flag-status-badge {
    margin-left: 0;
  }
  .fastflags-shell #fastflags-table tbody tr td[colspan] {
    display: block;
  }
  .fastflags-shell #fastflags-table tbody tr td[colspan]::before {
    content: none;
  }
  .fastflags-shell .fastflags-code,
  .fastflags-shell .value-mid,
  .fastflags-shell .value-full,
  .fastflags-shell td.value-expanded,
  .fastflags-shell td.value-mid-expanded {
    white-space: pre-wrap !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .fastflags-shell .expand-btn {
    margin-left: 0;
    margin-top: 8px;
  }
  #scroll-hint {
    display: none !important;
  }
  .g-toast-stack {
    right: 12px;
    left: 12px;
    bottom: 80px;
  }
  .g-toast {
    max-width: none;
    min-width: 0;
  }
}

/* ── Very narrow phones: shrink selection-actions buttons further so all three fit side-by-side ── */
@media (max-width: 520px) {
  .fastflags-shell .fastflags-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .fastflags-shell .filter-group,
  .fastflags-shell .selection-actions {
    grid-template-columns: 1fr 1fr;
  }
  .fastflags-shell .selection-actions > button {
    padding: 6px 7px;
    font-size: 9px;
    letter-spacing: 0.02em;
    min-height: 30px;
  }
  .fastflags-shell .filter-group select {
    min-height: 30px;
    font-size: 10px;
  }
  .fastflags-shell .fastflags-stats,
  .fastflags-shell #selected-count,
  .fastflags-shell #preset-state {
    font-size: 9px;
  }
}

/* ── Hide the inline desktop separator on mobile ── */
@media (max-width: 680px) {
  .h-nav-sep.h-nav-desktop-only { display: none !important; }
}

@media (max-width: 480px) {
  header { padding: 0 14px; }
  footer { padding: 10px 14px; }
  .ft-right { gap: 8px; }
}

/* ── UPDATE TOOLTIP ── */
.update-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 7.5px;
  font-family: var(--mono);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.12s;
}
.update-tip-btn:hover { opacity: 0.75; }
.update-tip-popup {
  display: none;
  position: fixed;
  background: #2a2a2d;
  border: 1px solid var(--dim);
  color: var(--fg);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: none;
  white-space: normal;
  width: 230px;
  padding: 9px 11px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 200;
  line-height: 1.55;
}
.update-tip-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--dim);
}
.update-tip-popup.tip-open { display: block; }

/* ── PLATFORM TOOLTIPS (CJV & Deprecated) ── */
.platform-with-tip {
  display: inline;
  position: relative;
  transition: opacity 0.12s;
}
.platform-with-tip:hover {
  opacity: 0.8;
}
.platform-tip-btn.cjv-tip {
  color: inherit;
}
.platform-tip-btn.cjv-tip > span:first-child {
  color: #454341;
}
.platform-tip-btn.deprecated-tip {
  color: inherit;
}
.platform-tip-btn.deprecated-tip > span:first-child {
  color: #e74c3c;
}
.flag-status-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.flag-status-badge--new {
  background: rgba(97, 219, 134, 0.14);
  border: 1px solid rgba(97, 219, 134, 0.3);
  color: #8ef0a9;
}
.flag-status-badge--changed {
  background: rgba(255, 194, 92, 0.14);
  border: 1px solid rgba(255, 194, 92, 0.28);
  color: #ffd37c;
}
.flag-cell-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.flag-cell-title {
  min-width: 0;
  flex: 1 1 auto;
}
.flag-status-mobile {
  display: none;
}
.platform-tip-popup {
  display: none;
  position: fixed;
  background: #2a2a2d;
  border: 1px solid var(--dim);
  color: var(--fg);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  max-width: 220px;
  z-index: 10000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  pointer-events: none;
  white-space: normal;
  text-align: left;
  font-weight: 400;
  line-height: 1.55;
}
.platform-tip-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--dim);
}
.platform-tip-popup.tip-open { display: block; }

/* ── SHARE DRAWER MODAL ── */
.g-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.g-drawer.open { display: flex; }

.g-drawer__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.g-drawer__card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--dim);
  border-radius: 8px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
  animation: drawer-slide-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes drawer-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.g-drawer__card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.g-drawer__card-header h3 {
  margin: 0;
  font-family: var(--disp);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fg);
}

.g-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}
.g-drawer__close:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.g-drawer__content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* QR Code - Always Visible */
.g-drawer__qr-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 24px;
  background: var(--dimmer);
  border: 1px solid var(--dim);
  border-radius: 8px;
}

.g-drawer__qr-display {
  width: 384px;
  height: 384px;
  padding: 16px;
  background: #202022;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.g-drawer__qr-hint {
  font-size: 12px;
  color: var(--mid);
  letter-spacing: 0.01em;
  font-weight: 400;
}

/* Button container for inline layout */
.g-drawer__button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Option Buttons (Download QR, Copy QR) */
.g-drawer__option-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 10px 14px;
  background: #393731;
  border: none;
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}
.g-drawer__option-btn:hover:not(:disabled) {
  background: #454540;
}
.g-drawer__option-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.g-drawer__option-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.g-drawer__option-btn span {
  flex: 1;
}

.g-drawer__option-btn--json {
  background: #3d3d3d;
}
.g-drawer__option-btn--json:hover:not(:disabled) {
  background: #4a4a4a;
}

.g-drawer__arrow {
  opacity: 0.5;
  margin-left: auto;
}

/* URL Section */
.g-drawer__url-section {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--dimmer);
  border: 1px solid var(--dim);
  border-radius: 6px;
}

.g-drawer__url-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
  min-width: 0;
}

.g-drawer__json-output {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  background: var(--dimmer);
  border: 1px solid var(--dim);
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  padding: 14px 16px;
  outline: none;
}
.g-drawer__note {
  color: var(--mid);
  font-size: 12px;
  line-height: 1.5;
}
.g-drawer__note code {
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11px;
}
.g-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 76px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10020;
  pointer-events: none;
}
.g-toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(24,24,26,0.96);
  color: var(--fg);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.g-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.g-toast--success {
  border-color: rgba(74, 222, 128, 0.35);
}
.g-toast--error {
  border-color: rgba(255, 108, 108, 0.35);
}

.g-drawer__copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.g-drawer__copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}
.g-drawer__copy-btn.copied {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.g-drawer__copy-btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

@media (max-width: 600px) {
  .g-drawer {
    padding: 0;
    align-items: flex-end;
  }
  .g-drawer__card {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    animation: drawer-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes drawer-slide-up {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .g-drawer__actions {
    flex-direction: column;
  }
  .g-drawer__btn-text {
    display: inline;
  }
}
