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

:root {
  --bg: #08090f;
  --surface: rgba(18,22,35,0.65);
  --surface-solid: #111525;
  --surface-border: rgba(255,255,255,0.06);
  --card: #12162390;
  --card-hover: #1a1f35;
  --accent: #7c6aef;
  --accent-soft: rgba(124,106,239,0.12);
  --accent-glow: rgba(124,106,239,0.3);
  --green: #34d399;
  --green-bg: rgba(52,211,153,0.1);
  --red: #f87171;
  --red-bg: rgba(248,113,113,0.1);
  --blue: #38bdf8;
  --blue-bg: rgba(56,189,248,0.1);
  --orange: #fb923c;
  --orange-bg: rgba(251,146,60,0.1);
  --yellow: #fbbf24;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  /* Lightened 2026-08-30 from #6b7b91, which cleared the AA floor only against
   * --bg (4.61:1) -- the OPTIMISTIC backdrop. Its 245 uses sit on --card
   * (#12162390, translucent over --bg), where #6b7b91 was 4.39:1, under the
   * 4.5:1 floor for normal text. #74849b clears it on that card (4.98:1) and
   * stays far under --text-muted's 7.75:1, so the two levels survive. Pinned by
   * tests/test_the_body_text_is_readable.py, which asserts against --card. */
  --text-dim: #74849b;
  /* A darker accent for the one role --accent cannot serve: a FILLED button
   * with white text (white on --accent is 4.06:1, fails AA; on this, 4.97:1).
   * --accent stays light enough to read as TEXT on --bg, so fills use this. */
  --accent-strong: #6d5be0;
  --radius: 14px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Stars ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(255,255,255,0.45) 50%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.3) 50%, transparent 100%),
    radial-gradient(1.2px 1.2px at 55% 15%, rgba(255,255,255,0.35) 50%, transparent 100%),
    radial-gradient(1px 1px at 70% 45%, rgba(255,255,255,0.25) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 85% 75%, rgba(255,255,255,0.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 20% 80%, rgba(255,255,255,0.25) 50%, transparent 100%),
    radial-gradient(1.3px 1.3px at 45% 40%, rgba(255,255,255,0.3) 50%, transparent 100%),
    radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.25) 50%, transparent 100%),
    radial-gradient(1.4px 1.4px at 60% 85%, rgba(255,255,255,0.35) 50%, transparent 100%);
  pointer-events: none; z-index: 0;
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { 0% { opacity: .5; } 100% { opacity: 1; } }

.app { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 48px 24px 80px; }

.glass {
  background: var(--card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
}

/* ── Header ── */
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.logo {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px;
  /* `color` still has two jobs behind the gradient fill: it paints the
     underline and the selection, and it is what shows if background-clip:text
     is unavailable. Left unset, the wordmark on all 13 pages carried a
     #0000EE default-link underline under gradient glyphs (measured live). */
  color: var(--accent); text-decoration: none;
  background: linear-gradient(135deg, #7c6aef, #38bdf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  cursor: pointer; transition: opacity .2s;
}
.logo:hover { opacity: .8; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px;
  border-radius: 100px; background: var(--green-bg); border: 1px solid rgba(52,211,153,.25);
  font-size: .75rem; font-weight: 600; color: var(--green); text-transform: uppercase; letter-spacing: .5px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,.5); }
  50%     { box-shadow: 0 0 0 5px rgba(52,211,153,0); }
}
.subtitle { color: var(--text-dim); font-size: .85rem; margin-bottom: 40px; }

/* live indicator */
.live-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .7rem; color: var(--green); font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.live-indicator .live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

/* ── Game cards ── */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
/* `.home-nav` / `.home-subnav` / `.home-panel` deleted 2026-08-23 with the home
   tab strip they styled. The grid is one flat list under three kickers now. */
.game-grid + .section-kicker { margin-top: 26px; }
.section-kicker {
  color: var(--text-dim);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 0 0 12px 2px;
  text-transform: uppercase;
}
.game-card {
  padding: 28px 24px; cursor: pointer; transition: all .25s ease;
  position: relative; overflow: hidden;
}
.game-card.has-thumb { padding-top: 18px; }
.game-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-soft), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.game-card:hover { border-color: rgba(124,106,239,.25); transform: translateY(-2px); }
.game-card:hover::before { opacity: 1; }
.game-card .icon { font-size: 2rem; margin-bottom: 14px; position: relative; }
.game-thumb {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  height: 118px;
  margin: 0 0 16px;
  overflow: hidden;
  position: relative;
}
.game-thumb-img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.game-card .name { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; position: relative; }
.game-card .desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; position: relative; }
.game-card .stats { display: grid; grid-template-columns: auto auto; gap: 8px 16px; font-size: .75rem; font-weight: 600; color: var(--text-dim); margin-top: auto; }
.stat { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; }
.stat .dot { width: 6px; height: 6px; border-radius: 50%; }
.stat.online .dot { background: var(--green); } .stat.online { color: var(--green); }
.stat.offline .dot { background: var(--text-dim); } .stat.offline { color: var(--text-dim); }
/* A non-zero problem count must read as a PROBLEM, not go dimmer (--text-dim)
 * than the zeros beside it. .warn/.alert are the theme's own orange/red. */
.stat.warn .dot { background: var(--orange); } .stat.warn { color: var(--orange); }
.stat.alert .dot { background: var(--red); } .stat.alert { color: var(--red); }
.stat.items { color: var(--yellow); }
.game-card .arrow {
  position: absolute; right: 20px; top: 28px;
  font-size: 1.2rem; color: var(--text-dim); transition: all .25s;
}
.game-card:hover .arrow { color: var(--accent); transform: translateX(4px); }

.treasury-chart-grid {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.treasury-chart {
  min-width: 0;
  overflow: hidden;
  padding: 16px;
}
.treasury-chart-title {
  color: var(--text);
  font-size: .9rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.treasury-chart-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.treasury-chart-head .treasury-chart-title { margin-bottom: 0; }
.treasury-chart-reset {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  color: var(--text-dim);
  cursor: pointer;
  font: inherit;
  font-size: .68rem;
  font-weight: 800;
  padding: 4px 7px;
}
.treasury-chart-reset:hover { color: var(--blue); border-color: rgba(56,189,248,.35); }
.treasury-chart-body {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(88px, 108px) minmax(0, 1fr);
  min-width: 0;
}
.treasury-pie {
  aspect-ratio: 1;
  height: auto;
  max-width: 108px;
  width: 100%;
}
.treasury-pie-slice {
  cursor: pointer;
  transition: opacity .16s, transform .16s;
  transform-origin: 60px 60px;
}
.treasury-pie-slice:hover { opacity: .82; transform: scale(1.015); }
.treasury-legend {
  display: grid;
  gap: 7px;
  font-size: .78rem;
  min-width: 0;
  width: 100%;
}
.treasury-legend-row {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  gap: 7px;
  grid-template-columns: 10px minmax(0, 1fr) max-content;
  line-height: 1.25;
  padding: 0;
  text-align: left;
  width: 100%;
}
.treasury-legend-row:hover { color: var(--text); }
.treasury-legend-row.is-muted {
  opacity: .42;
  text-decoration: line-through;
}
.treasury-legend-swatch {
  border-radius: 3px;
  height: 10px;
  width: 10px;
}
.treasury-legend-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.treasury-legend-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.treasury-ledger-card {
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
}
.treasury-ledger-scroll { overflow-x: auto; }
.treasury-ledger-table {
  border-collapse: collapse;
  font-size: .82rem;
  min-width: 680px;
  width: 100%;
}
.treasury-ledger-table th {
  color: var(--text-dim);
  font-size: .68rem;
  letter-spacing: .05em;
  padding: 9px 12px;
  text-align: left;
  text-transform: uppercase;
}
.treasury-ledger-table td {
  border-top: 1px solid rgba(255,255,255,.055);
  color: var(--text-muted);
  padding: 9px 12px;
  vertical-align: middle;
}
.treasury-ledger-table td:last-child,
.treasury-ledger-table th:last-child { text-align: right; }
.treasury-ledger-time,
.treasury-ledger-ref,
.treasury-ledger-delta {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.treasury-ledger-ref {
  color: var(--text-dim);
  font-family: JetBrains Mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
}
.treasury-pill {
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 999px;
  color: var(--text-muted);
  display: inline-flex;
  font-size: .72rem;
  font-weight: 800;
  padding: 3px 8px;
  white-space: nowrap;
}
.treasury-baddies-table { min-width: 560px; }

@media (max-width: 520px) {
  .treasury-chart-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .treasury-legend { width: 100%; }
  .treasury-ledger-scroll {
    overflow-x: visible;
    padding: 10px;
  }
  .treasury-ledger-table {
    display: block;
    font-size: .78rem;
    min-width: 0;
  }
  .treasury-ledger-table thead { display: none; }
  .treasury-ledger-table tbody {
    display: grid;
    gap: 8px;
  }
  .treasury-ledger-table tr {
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    display: grid;
    gap: 6px 10px;
    grid-template-columns: minmax(0, 1fr) max-content;
    padding: 10px;
  }
  .treasury-ledger-table td {
    border-top: 0;
    padding: 0;
  }
  .treasury-ledger-table td:nth-child(1) { grid-column: 1; }
  .treasury-ledger-table td:nth-child(5) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }
  .treasury-ledger-table td:nth-child(2),
  .treasury-ledger-table td:nth-child(3),
  .treasury-ledger-table td:nth-child(4) {
    grid-column: 1 / -1;
  }
  .treasury-ledger-table td:nth-child(3)::before,
  .treasury-ledger-table td:nth-child(4)::before {
    color: var(--text-dim);
    display: inline-block;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .05em;
    margin-right: 7px;
    text-transform: uppercase;
  }
  .treasury-ledger-table td:nth-child(3)::before { content: "Event"; }
  .treasury-ledger-table td:nth-child(4)::before { content: "Ref"; }
  .treasury-ledger-ref {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ── Views ── */
.detail-view { display: none; }
.detail-view.active { display: block; }
.home-view.hidden { display: none; }

.detail-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.detail-subtitle { color: var(--text-muted); font-size: .85rem; margin-bottom: 28px; }

/* Tabs */
/* Wrap ALWAYS, not only on a narrow screen. The rule and its reason are the
   ones that were already here for <=640px -- an overflow-x scrollbar has no
   affordance, so a tab past the right edge is unreachable -- but the GATE was
   wrong, because the thing that overflows is the CONTENT COLUMN and `.app` caps
   it at 900px. So a strip too wide for 850px is too wide at every viewport, and
   widening the window can never help. Measured signed-in 2026-08-24: /wallet's
   eight tabs need 988px in an 850px box, and `Auto-sweep` and `Seed phrase` sat
   outside it at 1920, 1440, 1280 AND 1024 -- two of eight destinations that no
   click could reach on any screen the operator owns.
   `flex: 0 1 auto` and not `1 1 auto`: a stretched wrap gives the last row's
   two survivors 418px and 420px each, which reads as a broken layout rather
   than a tab strip. At its natural width a tab wraps into a segmented control
   and the 375px case is unchanged (same 206px, five rows). */
.tabs {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px;
  background: var(--surface-solid); border: 1px solid var(--surface-border);
  margin-bottom: 24px;
}
.tab-btn {
  flex: 0 1 auto; padding: 10px 16px; border: none; border-radius: 9px; background: transparent;
  color: var(--text-muted); font-family: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--accent-strong); color: #fff; box-shadow: 0 2px 12px var(--accent-glow); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Info Panel ── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.info-box { padding: 18px 20px; }
.info-box .label { font-size: .68rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.info-box .count { font-size: 1.8rem; font-weight: 800; transition: color .3s; letter-spacing: -0.5px; }
.info-box.green .count { color: var(--green); }
.info-box.dim .count { color: var(--text-dim); }
.info-box.yellow .count { color: #d97706; }

.user-list { padding: 20px; margin-bottom: 14px; }
.user-list h3 { font-size: .82rem; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.user-list h3 .badge { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; font-size: .7rem; font-weight: 700; background: var(--surface-solid); margin-right: 8px; }
.user-list h3 .badge.green { background: var(--green-bg); color: var(--green); }
.user-list h3 .badge.yellow { background: rgba(217, 119, 6, 0.15); color: #d97706; }
.user-list h3 .badge.dim { background: rgba(100,116,139,.15); color: var(--text-dim); }

/* ── Overview Panel Item ── */
.user-chip {
  font-size: .78rem; padding: 5px 12px; border-radius: 8px;
  background: var(--surface-solid); border: 1px solid var(--surface-border);
  color: var(--text-muted); font-weight: 500; display: inline-flex; align-items: center; gap: 8px;
}
.user-stats { color: var(--text-dim); font-size: 0.7rem; }
.no-users { color: var(--text-dim); font-size: .82rem; font-style: italic; }

.items-section { padding: 20px; }
.items-section h3 { font-size: .82rem; font-weight: 600; margin-bottom: 12px; }
.item-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.item-tag {
  font-size: .78rem; padding: 5px 12px; border-radius: 8px;
  background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.15);
  color: var(--yellow); font-weight: 500; cursor: pointer; transition: all .2s;
}
.item-tag:hover { background: rgba(251,191,36,.15); transform: scale(1.04); }

/* ── Forms ── */
.form-card { padding: 24px; margin-bottom: 16px; }
.form-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
.form-card .form-desc { font-size: .8rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }

.form-group { margin-bottom: 14px; position: relative; }
.form-group label {
  display: block; font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--surface-border); background: var(--surface-solid);
  color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: .85rem;
  outline: none; transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-group input::placeholder { color: var(--text-dim); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.checkbox-group { display: flex; align-items: center; gap: 8px; }
.checkbox-group input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.checkbox-group label { margin-bottom: 0; text-transform: none; font-size: .82rem; color: var(--text-muted); }

.submit-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px;
  border: none; border-radius: 10px; font-family: inherit; font-size: .85rem;
  font-weight: 600; cursor: pointer; transition: all .2s; margin-top: 4px;
}
.submit-btn.primary { background: var(--accent-strong); color: #fff; box-shadow: 0 2px 12px var(--accent-glow); }
.submit-btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.submit-btn.danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.submit-btn.danger:hover { background: rgba(248,113,113,.18); }
.submit-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Results ── */
.result-box {
  margin-top: 16px; padding: 16px 20px; border-radius: 10px;
  background: var(--surface-solid); border: 1px solid var(--surface-border);
  font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: var(--text-muted);
  white-space: pre-wrap; word-break: break-word; display: none; animation: fadeIn .2s ease;
}
.result-box.visible { display: block; }
.result-box.success { border-color: rgba(52,211,153,.25); }
.result-box.error { border-color: rgba(248,113,113,.25); color: var(--red); }

.results-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .82rem; white-space: normal; }
.results-table th {
  text-align: left; font-weight: 600; color: var(--text-dim); font-size: .7rem;
  text-transform: uppercase; letter-spacing: .5px; padding: 8px 12px;
  border-bottom: 1px solid var(--surface-border); white-space: nowrap;
}
.results-table td { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.03); color: var(--text-muted); }
.results-table tr:last-child td { border-bottom: none; }
.results-table .acct { color: var(--text); font-weight: 500; }
.results-table .cnt { font-family: 'JetBrains Mono', monospace; color: var(--accent); }

/* Wide tables/grids/panels scroll inside their own box instead of pushing the
 * body sideways at 390px. #panel is /fleet's single reused tab body; the others
 * are the specific renders the 390 sweep found overflowing (diag table, month
 * grid, gifting margin + fleet panels). The body must never scroll sideways. */
#diag-list, #calendar-grid, #g-margin-body, #panel-fleet, #panel { overflow-x: auto; }

/* ── Autocomplete ── */
.ac-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  max-height: 220px; overflow-y: auto;
  background: var(--surface-solid); border: 1px solid var(--surface-border);
  border-radius: 10px; margin-top: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  display: none;
}
.ac-dropdown.open { display: block; animation: fadeIn .15s ease; }
.ac-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; cursor: pointer; transition: background .15s;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.focused { background: var(--accent-soft); }
.ac-item .ac-name { font-size: .85rem; font-weight: 500; color: var(--text); }
.ac-item .ac-id {
  font-family: 'JetBrains Mono', monospace; font-size: .75rem;
  color: var(--text-dim); background: rgba(255,255,255,.04);
  padding: 2px 8px; border-radius: 5px;
}
.ac-item .ac-name mark {
  background: none; color: var(--accent); font-weight: 700;
}
.ac-hint {
  padding: 10px 14px; font-size: .78rem; color: var(--text-dim); font-style: italic;
}

/* ── Dropdowns ── */
.dropdown-wrapper { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 5px); z-index: 100;
  display: none; flex-direction: column; padding: 6px; min-width: 140px;
  background: var(--surface-solid); border: 1px solid var(--surface-border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px); animation: fadeIn 0.15s ease;
}
.dropdown-menu.visible { display: flex; }
.dropdown-menu button {
  padding: 8px 12px; text-align: left; background: transparent; border: none;
  color: var(--text-muted); font-size: 0.75rem; font-weight: 500; cursor: pointer;
  border-radius: 6px; transition: all 0.15s;
}
.dropdown-menu button:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.date-tag {
  font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono', monospace;
}
.date-tag.tradable { color: var(--green); background: var(--green-bg); border: 1px solid rgba(52,211,153,0.2); }
.date-tag.locked { color: var(--orange); background: var(--orange-bg); border: 1px solid rgba(251,146,60,0.2); }
.date-tag.unknown { color: var(--blue); background: var(--blue-bg); border: 1px solid rgba(56,189,248,0.2); }
.date-tag.expired { color: var(--red); background: var(--red-bg); border: 1px solid rgba(248,113,113,0.3); }

.device-card { transition: border-color 0.2s; }
.device-card:hover { border-color: rgba(124,106,239,0.3); }

.terminal-body { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; line-height: 1.6; }
.terminal-line { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.02); }
.term-ts { color: var(--text-dim); font-size: 0.72rem; }
.term-type { font-weight: 600; min-width: 60px; display: inline-block; }
.term-user { color: var(--accent); font-weight: 500; }

/* ── Overview Panel Item ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(8px); animation: fadeIn .2s ease;
}
.modal-overlay.open { display: flex; }
.modal-content {
  width: 100%; max-width: 400px; padding: 32px;
  position: relative; border: 1px solid var(--surface-border);
  animation: modalSlide .3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlide { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: none; } }
.modal-content h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 24px; color: var(--text); }
.modal-body { display: flex; flex-direction: column; gap: 20px; margin-bottom: 32px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; }
.glass-input {
  width: 100%; padding: 12px 16px; border-radius: 10px;
  background: var(--surface-solid); border: 1px solid var(--surface-border);
  color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: .9rem;
  outline: none; transition: all .2s;
}
.glass-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.term-line { display: flex; gap: 10px; line-height: 1.4; animation: fadeIn 0.2s ease; }
.term-time { color: var(--text-dim); }
.term-msg { color: var(--green); }
.term-empty { color: var(--text-dim); font-style: italic; text-align: center; margin-top: 20px; }

/* ── Spinner ── */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.refresh-btn {
  background: none; border: 1px solid var(--surface-border); color: var(--text-muted);
  padding: 6px 12px; border-radius: 8px; font-family: inherit; font-size: .78rem;
  font-weight: 500; cursor: pointer; transition: all .2s; display: inline-flex;
  align-items: center; gap: 5px;
}
.refresh-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Keyboard focus ring -- visible only on keyboard nav (not mouse-click), per
 * :focus-visible UA heuristic. Color matches the accent so it harmonizes with
 * the rest of the palette. */
.tab-btn:focus-visible,
.refresh-btn:focus-visible,
.bypass-btn:focus-visible,
.submit-btn:focus-visible,
.rarity-period-btn:focus-visible,
button:focus-visible,
a.refresh-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bypass-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--surface-border); color: var(--text-dim); padding: 6px 14px; border-radius: 8px; font-size: 0.75rem; cursor: pointer; transition: all 0.2s; display: none; font-weight:700; }
.bypass-btn:hover { background: var(--accent-strong); color: white; border-color: var(--accent-strong); }
.bypass-btn.active { background: var(--green); color: white; border-color: var(--green); box-shadow: 0 0 10px var(--green-bg); }

.footer { text-align: center; color: var(--text-dim); font-size: .75rem; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--surface-border); }

.toast {
  position: fixed; bottom: 28px; right: 28px; padding: 12px 20px; border-radius: 10px;
  font-size: .82rem; font-weight: 500; z-index: 100; transform: translateY(20px);
  opacity: 0; transition: all .3s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast.success { background: var(--green-bg); border: 1px solid rgba(52,211,153,.3); color: var(--green); }
.toast.error { background: var(--red-bg); border: 1px solid rgba(248,113,113,.3); color: var(--red); }

/* The in-panel twin of `.toast.error`, with NO rule in any stylesheet until
 * 2026-08-25: three callers render it, no JS queries it, so looking like a
 * failure is its only job -- and measured live on /gifting with the summary
 * endpoint 503ing it inherited `--text` at 16px, no background, no border, no
 * padding. It stays put instead of fading; a failed panel has nothing else. */
.error-banner {
  background: var(--red-bg);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  color: var(--red);
  padding: 12px 14px;
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.5;
}

/* ── Shared admin cards/tables ── */
.card {
  padding:18px;
  background:var(--card);
  border:1px solid var(--surface-border);
  border-radius:var(--radius);
  backdrop-filter:blur(16px);
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.stat-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
  gap:12px;
}
.card .stat {
  align-items:flex-start;
  flex-direction:column;
  gap:4px;
}
.stat-label {
  color:var(--text-dim);
  font-size:0.72rem;
  font-weight:700;
  letter-spacing:0.04em;
  text-transform:uppercase;
}
.stat-value {
  color:var(--text);
  font-size:1.05rem;
  font-weight:800;
}
.mono {
  font-family:'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}
.table-scroll {
  width:100%;
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.data-table {
  width:100%;
  min-width:520px;
  border-collapse:collapse;
  margin-top:12px;
  font-size:0.82rem;
}
.data-table th {
  text-align:left;
  padding:8px 10px;
  color:var(--text-dim);
  border-bottom:1px solid var(--surface-border);
  font-size:0.7rem;
  font-weight:700;
  letter-spacing:0.04em;
  text-transform:uppercase;
  white-space:nowrap;
}
.data-table td {
  padding:9px 10px;
  color:var(--text-muted);
  border-bottom:1px solid rgba(255,255,255,.04);
  vertical-align:top;
}
.data-table tr:last-child td { border-bottom:none; }

@media (max-width: 600px) {
  .app { padding: 32px 16px 60px; }
  .header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .info-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .card { padding:16px; }
  .data-table { min-width:500px; }
}

