/* ==========================================================================
   Skeler Labs — app.css
   A strict red / black / white interface built for the operator workflow:
   fixed navigation, dense data surfaces, sharp borders and one accent colour.
   ========================================================================== */

/* --------------------------------------------------------------- tokens */
:root {
  --bg: #080808;
  --bg-deep: #050505;
  --surface: #101013;
  --surface-2: #151519;
  --surface-3: #1b1b20;
  --line: #26262c;
  --line-soft: #1b1b20;
  --white: #ffffff;
  --text: #e9e9ec;
  --muted: #9a9aa3;
  --muted-2: #86868f;

  --red: #e51b23;
  --red-bright: #ff3b41;
  --red-dark: #9e1016;
  --red-ink: #2a0a0d;
  --red-soft: rgba(229, 27, 35, 0.12);
  --red-line: rgba(229, 27, 35, 0.42);

  --radius: 6px;
  --radius-lg: 10px;
  --sidebar-w: 250px;
  --topbar-h: 64px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-pixel: "Press Start 2P", "JetBrains Mono", ui-monospace, monospace;

  --shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  --shadow-red: 0 0 0 1px rgba(229, 27, 35, 0.32), 0 18px 42px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 30% -12%, rgba(229, 27, 35, 0.1), transparent 62%),
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
}

::selection {
  background: var(--red);
  color: var(--white);
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

p { margin: 0; }
ul { margin: 0; padding: 0; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--font-mono); font-size: 0.86em; }
strong { color: var(--white); font-weight: 600; }

:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 2px;
}

.muted { color: var(--muted); }
.text-red { color: var(--red-bright); }
.hide-sm { }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------ app shell */
.shell {
  display: flex;
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 14px;
  background: var(--bg-deep);
  border-right: 1px solid var(--line-soft);
  transition: transform 240ms var(--ease);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: var(--topbar-h);
  flex: 0 0 auto;
  padding: 0 6px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--red-ink), #0a0a0b 70%);
  color: var(--red-bright);
  overflow: hidden;
}

.brand-mark svg { width: 21px; height: 21px; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.14em;
}

.brand-text span {
  margin-top: 4px;
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.32em;
}

.sidebar-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.agent-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 4px 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.agent-mini:hover { border-color: var(--red-line); background: var(--surface-2); }

.agent-mini-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.agent-mini-info strong {
  overflow: hidden;
  color: var(--white);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-mini-info span {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-tag {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tier-tag.ranked {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: var(--red-bright);
}

.agent-mini-guest { border-style: dashed; }

.agent-mini-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--red-bright);
}

.agent-mini-mark svg { width: 15px; height: 15px; }

.agent-mini-go {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted-2);
}

.agent-mini-go svg { width: 14px; height: 14px; }
.agent-mini-guest:hover .agent-mini-go { color: var(--red-bright); }

.guest-actions { display: flex; align-items: center; gap: 8px; }

.nav-group {
  display: block;
  margin-top: 16px;
}

.nav-label {
  display: block;
  margin: 0 10px 7px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 140ms var(--ease), background 140ms var(--ease);
}

.nav-item svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: 0.86; }
.nav-item > span:not(.nav-badge) { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-item:hover {
  background: var(--surface-2);
  color: var(--white);
}

.nav-item.active {
  background: var(--red-soft);
  color: var(--white);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--red);
}

.nav-item.active svg { color: var(--red-bright); opacity: 1; }

.nav-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.sidebar-foot {
  flex: 0 0 auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.uplink {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.uplink span:last-child { margin-left: auto; color: var(--muted-2); }

.dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-2);
}

.dot.ok { background: var(--white); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px rgba(229, 27, 35, 0.14); }

.foot-links {
  display: flex;
  gap: 12px;
  margin-top: 9px;
  padding: 0 8px;
}

.foot-links a {
  color: var(--muted-2);
  font-size: 10.5px;
  transition: color 140ms var(--ease);
}

.foot-links a:hover { color: var(--white); }

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--topbar-h);
  padding: 0 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(12px);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(480px, 46vw);
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted-2);
  transition: border-color 140ms var(--ease);
}

.global-search:focus-within { border-color: var(--red-line); }
.global-search svg { width: 15px; height: 15px; flex: 0 0 auto; }

.global-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
}

.global-search input::placeholder { color: var(--muted-2); }

kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.season-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.season-chip svg { width: 12px; height: 12px; color: var(--red-bright); }
.status-chip .dot { width: 5px; height: 5px; }
.status-chip.is-bad { border-color: var(--red-line); color: var(--red-bright); }

.account-menu { position: relative; }

.agent-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 9px 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms var(--ease), background 140ms var(--ease);
}

.agent-pill:hover { border-color: var(--red-line); background: var(--surface-2); }
.agent-pill .handle { max-width: 140px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.agent-pill > svg { width: 13px; height: 13px; color: var(--muted); }

.menu-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 236px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  animation: pop-in 140ms var(--ease);
}

.menu-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.menu-id strong { font-size: 12.5px; }
.menu-id span { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 130ms var(--ease), color 130ms var(--ease);
}

.menu-item svg { width: 14px; height: 14px; }
.menu-item:hover { background: var(--surface-3); color: var(--white); }
.menu-item.danger { color: var(--red-bright); }
.menu-item.danger:hover { background: var(--red-soft); color: var(--red-bright); }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------- content */
.page {
  flex: 1;
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  padding: 30px 32px 54px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.page-head > div:first-child { max-width: 760px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow .slash { color: var(--muted-2); }

.page-head h1 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
}

.page-sub {
  max-width: 680px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.head-peek {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  margin: 0 6px 0 auto;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45));
  transform: rotate(-5deg);
  transition: transform 220ms var(--ease);
}

.head-peek img { width: 100%; height: 100%; object-fit: contain; }
.head-peek.wide { width: 172px; }

.section { margin-top: 38px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 20px;
  font-weight: 600;
}

.section-head .eyebrow { margin-bottom: 6px; }

.count {
  display: inline-flex;
  align-items: center;
  min-width: 24px;
  height: 20px;
  margin-left: 8px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 400;
  vertical-align: 2px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  transition: color 140ms var(--ease), gap 140ms var(--ease);
}

.link-arrow svg { width: 14px; height: 14px; }
.link-arrow:hover { gap: 9px; color: var(--red-bright); }

.results-meta { color: var(--muted); font-size: 12px; }
.results-meta b { color: var(--white); font-weight: 600; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease), transform 100ms var(--ease);
}

.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--red-line); background: var(--surface-2); color: var(--white); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(229, 27, 35, 0.22);
}

.btn-primary:hover {
  border-color: var(--red-bright);
  background: var(--red-bright);
  color: var(--white);
}

.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { border-color: transparent; background: var(--surface-2); color: var(--white); }

.btn-danger { border-color: var(--red-line); color: var(--red-bright); }
.btn-danger:hover { border-color: var(--red); background: var(--red); color: var(--white); }

.btn-sm { min-height: 32px; padding: 0 11px; font-size: 11.5px; }
.btn-block { width: 100%; }

.btn[disabled],
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red-bright);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------------- surfaces */
.card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.card-head h3,
.card-head h2 { font-size: 15px; }

.card-head span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress-block { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.progress-block.wide { margin-top: 14px; }

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10.5px;
}

.progress-label .tag {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.bar {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 2px;
  background: #1c1c21;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red-dark), var(--red), var(--red-bright));
  transition: width 500ms var(--ease);
}

.bar.slim { height: 4px; }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--line-soft);
  overflow: hidden;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  background: var(--bg);
}

.mini-stat strong { color: var(--white); font-family: var(--font-mono); font-size: 15px; font-weight: 500; }
.mini-stat span { color: var(--muted-2); font-size: 9.5px; letter-spacing: 0.05em; text-transform: uppercase; }

.rank-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid var(--red-line);
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rank-tag svg { width: 11px; height: 11px; }
.rank-tag img { width: 11px; height: 11px; border-radius: 2px; object-fit: contain; }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 7px; }

.field-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field-opt { color: var(--muted-2); letter-spacing: 0; text-transform: none; }
.field-help { color: var(--muted-2); font-size: 10.5px; line-height: 1.5; }

.field input,
.field select,
.input,
.select,
.flag-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.field input::placeholder,
.flag-input::placeholder { color: var(--muted-2); }

.field input:focus,
.field select:focus,
.select:focus,
.flag-input:focus {
  outline: 0;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 27, 35, 0.14);
}

.field input[aria-invalid="true"] { border-color: var(--red); }

.select {
  min-height: 38px;
  width: auto;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  appearance: none;
  font-size: 12px;
  cursor: pointer;
}

.select-sm { min-height: 32px; font-size: 11px; background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; }

.form-msg {
  display: none;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.form-msg.show { display: block; }
.form-msg.bad { border-color: var(--red-line); background: var(--red-soft); color: var(--red-bright); }
.form-msg.ok { border-color: var(--line); background: rgba(255, 255, 255, 0.04); color: var(--white); }
.form-hint { color: var(--muted-2); font-size: 10.5px; line-height: 1.55; }

.stack-form { display: flex; flex-direction: column; gap: 14px; padding: 18px; }

/* ----------------------------------------------------------------- toasts */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  animation: toast-in 200ms var(--ease);
}

.toast svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: var(--red-bright); }
.toast.ok { border-left-color: var(--white); }
.toast.ok svg { color: var(--white); }
.toast.warn { border-left-color: var(--red-bright); }
.toast.leaving { opacity: 0; transform: translateX(12px); transition: all 200ms var(--ease); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------- avatars */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: #16161a;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.avatar.has-img { background: #000; padding: 0; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

.avatar.sm { width: 28px; height: 28px; font-size: 9px; }
.avatar.xs { width: 24px; height: 24px; font-size: 8px; }
.avatar.lg { width: 64px; height: 64px; font-size: 18px; border-width: 2px; }
.avatar.xl { width: 92px; height: 92px; font-size: 26px; border-width: 2px; }

/* --------------------------------------------------------------- dashboard */
.dash-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 28px;
  padding: 34px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(620px 260px at 8% -10%, rgba(229, 27, 35, 0.16), transparent 66%),
    linear-gradient(135deg, #121215, #0b0b0d 62%);
  overflow: hidden;
}

.dash-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0 86%, rgba(229, 27, 35, 0.04) 86%),
    linear-gradient(transparent 0 86%, rgba(229, 27, 35, 0.04) 86%);
  background-size: 34px 34px;
  opacity: 0.5;
  mask-image: linear-gradient(90deg, transparent, #000 55%);
}

.dash-hero > * { position: relative; z-index: 1; }

.dash-hero h1 {
  margin-top: 4px;
  font-size: clamp(28px, 3.3vw, 42px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.dash-hero-sub {
  max-width: 560px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.hero-next {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin-top: 16px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 5, 5, 0.45);
  color: var(--muted);
  font-size: 11px;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}

.hero-next:hover { border-color: var(--red-line); background: rgba(5, 5, 5, 0.7); }
.hero-next strong { color: var(--white); font-size: 12px; font-weight: 600; }
.hero-next-kicker { color: var(--red-bright); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
.hero-next-meta { color: var(--muted-2); font-family: var(--font-mono); font-size: 9.5px; }
.hero-next svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--red-bright); }

.dash-hero-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-left: 26px;
  border-left: 1px solid var(--line-soft);
}

.rank-emblem { position: relative; }
.emblem-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
}
.emblem-badge svg { width: 15px; height: 15px; }

.rank-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
}

.rank-level-label { color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; }
.rank-level-label strong { margin-left: 2px; color: var(--white); font-size: 13px; }

.emblem-foot {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-tile {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease);
}

.stat-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--red), transparent 72%);
  opacity: 0.55;
}

.stat-tile:hover { border-color: var(--red-line); transform: translateY(-1px); }

.stat-icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--red-bright);
  background: var(--bg);
}

.stat-icon svg { width: 17px; height: 17px; }
.stat-tile strong { color: var(--white); font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.1; }
.stat-tile > span:last-child { color: var(--muted-2); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }

.briefing-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: stretch;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface) 0%, #0c0c0f 52%, #050505 100%);
  overflow: hidden;
}

.briefing-copy { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 26px 28px; }
.briefing-copy h2 { font-size: clamp(18px, 2vw, 22px); letter-spacing: -0.02em; }
.briefing-copy p { max-width: 46ch; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.briefing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.briefing-art { position: relative; margin: 0; min-height: 216px; }
.briefing-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--surface) 0%, rgba(12, 12, 15, 0.55) 18%, transparent 46%);
  pointer-events: none;
}
.briefing-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.modules-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 12px;
}

.module-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 160ms var(--ease), transform 160ms var(--ease), background 160ms var(--ease);
}

.module-card:hover {
  border-color: var(--red-line);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.module-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--red-bright);
}

.module-icon svg { width: 18px; height: 18px; }
.module-info { flex: 1; min-width: 0; }
.module-kicker { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.module-info h3 { margin-top: 4px; font-size: 15px; }
.module-info p { margin-top: 5px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }

.module-progress {
  display: flex;
  justify-content: space-between;
  margin: 12px 0 6px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.module-go { align-self: flex-end; color: var(--muted-2); transition: color 140ms var(--ease), transform 140ms var(--ease); }
.module-go svg { width: 16px; height: 16px; }
.module-card:hover .module-go { color: var(--red-bright); transform: translateX(3px); }

/* --------------------------------------------------------------- lab cards */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.catalog-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  min-height: 280px;
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(229, 27, 35, 0.05), transparent 55%);
  color: var(--muted);
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}

.catalog-cta:hover {
  border-color: var(--red-line);
  background: linear-gradient(150deg, rgba(229, 27, 35, 0.1), transparent 60%);
}

.catalog-cta-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--red-bright);
}

.catalog-cta-icon svg { width: 17px; height: 17px; }
.catalog-cta strong { color: var(--white); font-family: var(--font-display); font-size: 16px; }
.catalog-cta-copy { max-width: 34ch; font-size: 12px; line-height: 1.6; }
.catalog-cta-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.catalog-cta-go svg { width: 13px; height: 13px; }

.lab-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.lab-card:hover {
  border-color: var(--red-line);
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

.lab-art {
  position: relative;
  display: block;
  aspect-ratio: 16 / 5;
  background:
    radial-gradient(240px 150px at 78% 32%, rgba(229, 27, 35, 0.2), transparent 68%),
    linear-gradient(145deg, #17171b, #0b0b0d);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

.lab-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 70% 40%, #000, transparent 75%);
}

.lab-art::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -52px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(229, 27, 35, 0.22);
  border-radius: 50%;
}

.type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(8, 8, 8, 0.72);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.type-badge svg { width: 11px; height: 11px; }
.type-challenge { border-color: var(--red-line); color: var(--red-bright); }

.solved-mark {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.solved-mark svg { width: 10px; height: 10px; }

.lab-art-glyph {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.08);
}

.lab-art-glyph svg { width: 62px; height: 62px; stroke-width: 1.1; }
.lab-card:hover .lab-art-glyph { color: rgba(229, 27, 35, 0.32); }

.lab-art-code {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 1;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Custom machine artwork. The link is rendered as a background so a broken or
   blocked image degrades to the card gradient instead of a broken-image icon.
   The art is never cropped: it fits inside the frame and the card background
   fills any leftover space. */
.lab-art-img {
  position: absolute;
  inset: 0;
  background-color: var(--bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: saturate(0.88) contrast(1.04);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lab-art.has-thumb::before { display: none; }

.lab-art.has-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  right: 0;
  bottom: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0.04) 0%, rgba(5, 5, 7, 0.38) 58%, rgba(5, 5, 7, 0.88) 100%);
}

.lab-cover {
  position: relative;
  aspect-ratio: 16 / 5;
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.lab-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(5, 5, 7, 0.55) 100%);
  pointer-events: none;
}

.lab-cover-img {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.lab-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px 15px;
}

.lab-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.diff {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.diff-very-easy { color: #d6d6da; border-color: #3a3a42; }
.diff-easy { color: #c3c3c9; border-color: #33333a; }
.diff-medium { color: #a9a9b1; border-color: #2c2c33; }
.diff-hard { border-color: var(--red-line); color: var(--red-bright); }
.diff-insane { border-color: var(--red); background: var(--red-soft); color: var(--red-bright); }

.lab-points {
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.lab-points.zero { color: var(--muted-2); }

.lab-season {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Gated drops: the artwork dims so locked and early labs read differently
   from the playable catalog at a glance. */
.lab-card.is-gated .lab-art-img { filter: saturate(0.45) contrast(1.05) brightness(0.5); }
.lab-card.is-gated .lab-art-glyph { color: rgba(229, 27, 35, 0.3); }

.access-mark {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--red-line);
  border-radius: 4px;
  background: rgba(8, 8, 8, 0.82);
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.access-mark svg { width: 10px; height: 10px; }
.access-scheduled { border-color: var(--line); color: var(--muted); }

.lab-body h3 { font-size: 15.5px; line-height: 1.25; }
.lab-body h3 a { transition: color 140ms var(--ease); }
.lab-body h3 a:hover { color: var(--red-bright); }

.lab-tagline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.lab-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-2);
  font-size: 9.5px;
  white-space: nowrap;
}

.meta-item svg { width: 12px; height: 12px; }
.meta-item.star svg { color: var(--red-bright); fill: rgba(229, 27, 35, 0.18); }

.lab-foot .go {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  transition: all 140ms var(--ease);
}

.lab-foot .go svg { width: 13px; height: 13px; }
.lab-foot .go:hover { border-color: var(--red); background: var(--red); color: var(--white); }

.is-solved .lab-art { background: radial-gradient(240px 150px at 78% 32%, rgba(255, 255, 255, 0.1), transparent 68%), linear-gradient(145deg, #17171b, #0b0b0d); }

/* ----------------------------------------------------------------- bottom */
.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 14px;
  margin-top: 38px;
  align-items: start;
}

.leaderboard-card { display: flex; flex-direction: column; }
.lb-list { flex: 1; padding: 6px 8px; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 5px;
  transition: background 130ms var(--ease);
}

.lb-row + .lb-row { border-top: 1px solid var(--line-soft); }
.lb-row:hover { background: var(--surface-2); }
.lb-row.you { background: var(--red-soft); }

.lb-rank { width: 24px; color: var(--muted-2); font-family: var(--font-mono); font-size: 10.5px; }
.lb-row:nth-child(1) .lb-rank { color: var(--red-bright); }

.lb-handle { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.lb-handle strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.country { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }
.lb-xp { color: var(--white); font-family: var(--font-mono); font-size: 11px; }
.lb-tier {
  margin-right: 8px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lb-tier-icon {
  width: 12px;
  height: 12px;
  margin-right: 4px;
  border-radius: 2px;
  object-fit: contain;
  vertical-align: -2px;
}

.lb-you-label {
  padding: 1px 5px;
  border: 1px solid var(--red-line);
  border-radius: 3px;
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 8px;
}

.leaderboard-card > .btn-block { margin: 8px 12px 12px; width: calc(100% - 24px); }

.continue-card { display: flex; flex-direction: column; }
.continue-inner { display: flex; align-items: center; gap: 16px; flex: 1; padding: 20px; }

.continue-glyph {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 1px solid var(--red-line);
  border-radius: var(--radius);
  background: var(--red-soft);
  color: var(--red-bright);
}

.continue-glyph svg { width: 26px; height: 26px; }
.continue-copy { flex: 1; min-width: 0; }
.continue-copy h3 { margin-top: 4px; font-size: 16px; }
.continue-copy p { margin-top: 5px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }

.continue-track {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 10px;
}

.continue-track svg { width: 12px; height: 12px; }

.resources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.resource-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.resource-card:hover { border-color: var(--red-line); background: var(--surface-2); }

.resource-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--red-bright);
}

.resource-icon svg { width: 16px; height: 16px; }
.resource-card h4 { font-size: 13px; }
.resource-card p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }

/* ------------------------------------------------------------------ catalog */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 140ms var(--ease);
}

.tab:hover { color: var(--white); }
.tab.active { color: var(--white); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--red);
}

.tab .count {
  height: 18px;
  min-width: 20px;
  margin-left: 0;
  padding: 0 5px;
  font-size: 9px;
}

.tab.active .count { border-color: var(--red-line); color: var(--red-bright); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 200px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted-2);
  transition: border-color 140ms var(--ease);
}

.search-input:focus-within { border-color: var(--red-line); }
.search-input svg { width: 14px; height: 14px; flex: 0 0 auto; }

.search-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.search-input input::placeholder { color: var(--muted-2); }

.view-toggle {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.view-toggle button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
}

.view-toggle button.active { background: var(--surface-3); color: var(--white); }
.view-toggle svg { width: 14px; height: 14px; }

.results-meta { margin-bottom: 14px; }

.chip-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.chip svg { width: 11px; height: 11px; }
.chip.hot { border-color: var(--red-line); background: var(--red-soft); color: var(--red-bright); }

.table-wrap {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow-x: auto;
}

.lab-table,
.admin-table,
.endpoint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.lab-table th,
.admin-table th,
.endpoint-table th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.endpoint-table td:first-child { white-space: nowrap; }

.lab-table td,
.admin-table td,
.endpoint-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.lab-table tbody tr:last-child td,
.admin-table tbody tr:last-child td,
.endpoint-table tbody tr:last-child td { border-bottom: 0; }

.lab-table tbody tr:hover,
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.row-lab { display: flex; align-items: center; gap: 10px; }
.row-lab > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.row-lab > span:last-child > span { color: var(--muted-2); font-size: 10px; }
.row-lab strong { font-size: 12px; }
.row-lab:hover strong { color: var(--red-bright); }

.thumb {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--red-bright);
}

.thumb svg { width: 15px; height: 15px; }

.thumb.thumb-img {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.pts { color: var(--white); font-family: var(--font-mono); font-size: 10.5px; }
.pts.zero { color: var(--muted-2); }

.access-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 7px;
  border: 1px solid var(--red-line);
  border-radius: 3px;
  background: var(--red-soft);
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.access-pill svg { width: 10px; height: 10px; }
.access-pill.access-scheduled { border-color: var(--line); background: var(--bg); color: var(--muted); }
.access-pill.is-open {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}
.access-pill.is-open::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 6px var(--red-bright);
}

.table-action {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.table-action svg { width: 12px; height: 12px; }
.table-action:hover { color: var(--red-bright); }

/* --------------------------------------------------------------- lab detail */
.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.crumbs a:hover { color: var(--white); }
.crumbs svg { width: 11px; height: 11px; }
.crumbs span { color: var(--muted); }

.lab-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 22px;
  border-bottom: 1px solid var(--line-soft);
}

.lab-hero-main { max-width: 780px; }
.lab-hero h1 { margin-top: 2px; font-size: clamp(26px, 3vw, 38px); }
.lab-tagline-lg { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
  margin-top: 22px;
}

.detail-main { display: flex; flex-direction: column; gap: 14px; }

.info-card { padding: 20px; }
.info-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 15px;
}

.info-card h2 svg { width: 16px; height: 16px; color: var(--red-bright); }

.prose { color: var(--muted); font-size: 13px; line-height: 1.72; }
.prose h3 { margin: 18px 0 6px; color: var(--white); font-size: 14px; }
.prose h3:first-child { margin-top: 0; }
.prose p + p { margin-top: 10px; }
.prose ul { margin: 8px 0; padding-left: 18px; }
.prose li { margin: 4px 0; }
.prose code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); color: var(--white); }

.hints { display: flex; flex-direction: column; gap: 7px; }

.hint {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}

.hint summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  cursor: pointer;
  list-style: none;
}

.hint summary::-webkit-details-marker { display: none; }
.hint summary svg { width: 13px; height: 13px; color: var(--red-bright); }
.hint summary .chev { margin-left: auto; transition: transform 160ms var(--ease); }
.hint[open] summary { color: var(--white); border-bottom: 1px solid var(--line-soft); }
.hint[open] summary .chev { transform: rotate(180deg); }
.hint-body { padding: 12px 13px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.track-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.track-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  transition: all 140ms var(--ease);
}

.track-chip svg { width: 12px; height: 12px; }
.track-chip:hover { border-color: var(--red-line); color: var(--white); }

.access-card {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  padding: 18px;
}

.access-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.access-head h3 { font-size: 15px; }

.access-rows { display: flex; flex-direction: column; margin-bottom: 16px; }

.access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px;
}

.access-row:last-child { border-bottom: 0; }
.access-row > span:first-child { color: var(--muted-2); }
.access-row strong { color: var(--white); font-family: var(--font-mono); font-size: 10.5px; font-weight: 400; text-align: right; }
.access-row code { color: var(--white); }

.access-note {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.55;
}

.access-note svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; color: var(--red-bright); }
.access-note code { color: var(--white); }

.access-sticker {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
}

.access-sticker img {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  object-fit: contain;
  transform: rotate(-4deg);
}

.access-sticker figcaption {
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.5;
}

.access-sticker figcaption strong { color: var(--text); font-size: 10.5px; }

/* Paywall panel shown in place of the launch/download/flag controls when a lab
   is locked to subscribers, inside its early-access window, or scheduled. */
.gate-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius);
  background:
    radial-gradient(200px 130px at 90% 0%, rgba(229, 27, 35, 0.15), transparent 72%),
    var(--bg);
}

.gate-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--red-line);
  border-radius: 5px;
  background: var(--red-soft);
  color: var(--red-bright);
}

.gate-icon svg { width: 15px; height: 15px; }

.gate-head strong {
  display: block;
  color: var(--white);
  font-size: 12.5px;
  letter-spacing: -0.01em;
}

.gate-head div > span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gate-panel > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.gate-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gate-list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.gate-list svg {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 1px;
  color: var(--red-bright);
}

.gate-panel .form-hint { margin: 0; }
.gate-panel .btn { margin-top: 2px; }

.access-row .gate-open,
.access-row .gate-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.access-row .gate-open { color: var(--muted); }
.access-row .gate-flag { color: var(--red-bright); }
.access-row .gate-open svg,
.access-row .gate-flag svg { width: 11px; height: 11px; }

.solved-panel {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.badge-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-line svg { width: 13px; height: 13px; color: var(--red-bright); }
.solved-panel p { margin-top: 5px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }

.flag-form { display: flex; flex-direction: column; gap: 7px; }

.flag-form label {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.flag-input { min-height: 40px; font-family: var(--font-mono); font-size: 12px; }

.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.related-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 140ms var(--ease);
}

.related-card:hover { border-color: var(--red-line); }
.related-card > div { display: flex; flex-direction: column; min-width: 0; }
.related-card strong { font-size: 12px; }
.related-card span { color: var(--muted-2); font-size: 9.5px; }

/* ------------------------------------------------------------------ tracks */
.tracks-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.track-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.track-top {
  display: flex;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(140deg, rgba(229, 27, 35, 0.06), transparent 60%);
}

.track-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--red-line);
  border-radius: var(--radius);
  background: var(--red-soft);
  color: var(--red-bright);
}

.track-icon svg { width: 19px; height: 19px; }
.track-top h3 { font-size: 16px; }
.track-tagline { margin-top: 4px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.track-body { display: flex; flex-direction: column; gap: 14px; flex: 1; padding: 18px; }
.track-desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.track-progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-size: 10px;
}

.track-lab-list { display: flex; flex-direction: column; gap: 2px; }

.track-lab {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 4px;
  color: var(--muted);
  transition: background 130ms var(--ease), color 130ms var(--ease);
}

.track-lab:hover { background: var(--surface-2); color: var(--white); }
.track-lab .t-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--line); }
.track-lab.done .t-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(229, 27, 35, 0.14); }
.track-lab .t-name { flex: 1; font-size: 11.5px; }
.track-lab .t-pts { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; }

.track-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 10px;
}

.manual-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.manual-card { padding: 20px; }
.manual-card h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.manual-card h3 svg { width: 15px; height: 15px; color: var(--red-bright); }
.manual-card p { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.manual-card ul { margin-top: 9px; padding-left: 17px; color: var(--muted); font-size: 11.5px; }
.manual-card li { margin: 4px 0; }

.code-block {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

.code-block .c { color: var(--muted-2); }
.code-block .k { color: var(--red-bright); }

.endpoint-table td:first-child { color: var(--white); font-family: var(--font-mono); font-size: 10.5px; white-space: nowrap; }
.endpoint-table td:last-child { color: var(--muted); }

/* ------------------------------------------------------------ manual page */
.manual-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.manual-facts span { display: inline-flex; align-items: center; gap: 6px; }
.manual-facts svg { width: 12px; height: 12px; color: var(--red-bright); }

.sticker-strip {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(520px 200px at 8% -40%, rgba(229, 27, 35, 0.12), transparent 70%),
    linear-gradient(160deg, var(--surface-2), var(--bg-deep));
  overflow: hidden;
}

.sticker-strip-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.sticker-strip-head .eyebrow { margin-bottom: 5px; }
.sticker-strip-head h2 { font-size: 20px; font-weight: 600; }
.sticker-strip-head p {
  max-width: 390px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.sticker-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sticker-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(8, 8, 10, 0.55);
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}

.sticker-card:hover {
  border-color: var(--red-line);
  background: var(--surface);
  transform: translateY(-2px);
}

.sticker-art {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background:
    radial-gradient(80px 60px at 50% 20%, rgba(255, 255, 255, 0.05), transparent 70%),
    var(--bg-deep);
  overflow: hidden;
}

.sticker-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(-3deg) scale(1.02);
  transition: transform 200ms var(--ease);
}

.sticker-art.infrastructure { width: 148px; }
.sticker-art.infrastructure img { transform: rotate(1deg) scale(1); }
.sticker-art.holding img { transform: rotate(-2deg) scale(1.02); }
.sticker-card:hover .sticker-art img { transform: rotate(0) scale(1.04); }
.sticker-card:hover .sticker-art.infrastructure img { transform: rotate(0) scale(1); }

.sticker-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sticker-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sticker-kicker svg { width: 11px; height: 11px; }
.sticker-body strong { color: var(--white); font-size: 13.5px; line-height: 1.25; }
.sticker-copy { color: var(--muted); font-size: 11px; line-height: 1.5; }

.sticker-go {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 140ms var(--ease);
}

.sticker-go svg { width: 11px; height: 11px; }
.sticker-card:hover .sticker-go { color: var(--white); }

.section-note {
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.55;
}

.delivery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.delivery-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.delivery-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.delivery-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--red-line);
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red-bright);
}

.delivery-icon svg { width: 17px; height: 17px; }

.delivery-card h3 { font-size: 15px; line-height: 1.3; }
.delivery-card p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.delivery-rows {
  display: flex;
  flex-direction: column;
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.delivery-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.delivery-rows span { color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; }
.delivery-rows strong { color: var(--white); font-weight: 400; text-align: right; }

.delivery-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--red-bright);
  font-size: 11.5px;
  font-weight: 500;
}

.delivery-link svg { width: 13px; height: 13px; transition: transform 140ms var(--ease); }
.delivery-link:hover { color: var(--white); }
.delivery-link:hover svg { transform: translateX(3px); }

.flag-card {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr);
  gap: 26px;
  margin-top: 38px;
  padding: 26px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(460px 200px at 6% 0%, rgba(229, 27, 35, 0.14), transparent 72%),
    var(--surface);
}

.flag-copy .eyebrow { margin-bottom: 7px; }
.flag-card h2 { font-size: clamp(19px, 2.1vw, 25px); line-height: 1.3; }
.flag-card h2 code {
  padding: 2px 7px;
  border: 1px solid var(--red-line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 500;
}

.flag-copy > p {
  max-width: 620px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.flag-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.flag-demo > code {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.flag-open { margin-top: 14px; }

.flag-rules {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding-left: 22px;
  border-left: 1px solid var(--line-soft);
}

.flag-rules li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.flag-rules svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; color: var(--red-bright); }

.api-section .section-head { align-items: center; }

.api-base {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
}

.api-base > span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.api-base code {
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.api-copy {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 140ms var(--ease), color 140ms var(--ease);
}

.api-copy svg { width: 12px; height: 12px; }
.api-copy:hover { border-color: var(--red-line); color: var(--white); }

.section-lede {
  max-width: 760px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.section-lede code { color: var(--white); font-family: var(--font-mono); font-size: 11px; }

.api-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.api-group { padding: 0; }

.api-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.api-group-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.api-group-head svg { width: 14px; height: 14px; color: var(--red-bright); }

.api-group-head > span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.api-group .endpoint-table { font-size: 11px; }
.api-group .endpoint-table td { padding: 9px 16px; }
.api-group .endpoint-table td:first-child { color: var(--white); font-size: 10px; }

.api-group .endpoint-table td:last-child { width: 46%; font-size: 10.5px; line-height: 1.45; }
.api-group .endpoint-table code { font-family: var(--font-mono); color: inherit; }

.method {
  display: inline-block;
  min-width: 40px;
  margin-right: 7px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-align: center;
  vertical-align: 1px;
}

.method.post { border-color: var(--red-line); background: var(--red-soft); color: var(--red-bright); }
.method.patch { border-color: var(--line); color: var(--white); }

.api-group-note {
  padding: 10px 16px 13px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.5;
}

.api-group-note code { color: var(--white); font-family: var(--font-mono); }

.api-example {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.api-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.api-example-head h3 { font-size: 13px; }
.api-example .code-block { border: 0; border-radius: 0; }

.status-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.status-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.status-card-head h3 { font-size: 15px; }
.status-card .access-rows { margin-bottom: 10px; }

.status-note {
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.6;
}

.status-foot {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

.status-foot span {
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------- leaderboard */
.rank-card { padding: 22px; display: flex; flex-direction: column; align-items: flex-start; }
.rank-card .sigil { width: 34px; height: 34px; margin-bottom: 12px; color: var(--red-bright); stroke-width: 1.2; }
.rank-card img.sigil { object-fit: contain; }
.rank-level { color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.rank-level strong { margin-left: 3px; color: var(--white); font-size: 16px; }
.rank-card .progress-block { margin-top: 15px; }

.cycle-card { padding: 22px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cycle-head { align-self: stretch; display: flex; justify-content: center; }
.pill-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill-select svg { width: 11px; height: 11px; color: var(--red-bright); }
.hex-avatar { margin: 16px 0 10px; }
.cycle-rank { margin: 8px 0 14px; color: var(--red-bright); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.13em; }
.cycle-card .progress-block { width: 100%; }
.cycle-card .mini-grid { width: 100%; }

.streak-card { padding: 20px; }
.streak-count { display: flex; align-items: center; gap: 9px; margin: 14px 0; }
.streak-count svg { width: 22px; height: 22px; color: var(--red-bright); }
.streak-count strong { font-family: var(--font-display); font-size: 30px; line-height: 1; }
.streak-count span { color: var(--muted); font-size: 11px; }
.week-dots { display: flex; justify-content: space-between; gap: 5px; }
.day-dot { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; color: var(--muted-2); font-family: var(--font-mono); font-size: 8.5px; }
.day-dot i { width: 100%; height: 5px; border-radius: 2px; background: var(--line); }
.day-dot.on i { background: var(--red); }
.day-dot.on { color: var(--white); }
.streak-objective { margin-top: 16px; }
.streak-objective .row { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted-2); font-size: 10px; }

.cert-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius-lg);
  background: radial-gradient(420px 220px at 90% 10%, rgba(229, 27, 35, 0.18), transparent 65%), var(--surface);
  overflow: hidden;
}

.cert-kicker { display: flex; align-items: center; gap: 6px; color: var(--red-bright); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.cert-kicker svg { width: 13px; height: 13px; }
.cert-title { margin: 12px 0 14px; font-size: clamp(22px, 2.4vw, 30px); max-width: 460px; }
.cert-title em { color: var(--red-bright); font-style: normal; }
.cert-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.cert-tags span { padding: 3px 8px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: 9.5px; }
.cert-banner .btn { align-self: flex-start; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 50px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state > svg { width: 30px; height: 30px; margin-bottom: 4px; color: var(--red-bright); }
.empty-state h3 { font-size: 16px; }
.empty-state p { max-width: 420px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.empty-state .btn { margin-top: 10px; }

.skel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer { to { transform: translateX(100%); } }

/* ----------------------------------------------------------------- account */
.account-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.account-stack { display: flex; flex-direction: column; gap: 14px; }
.account-card { padding: 0; }
.account-card > .card-head { padding: 16px 18px; }

.profile-card { padding: 22px; }

.profile-identity { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.profile-copy { min-width: 0; }
.profile-copy h2 { margin: 7px 0 3px; font-size: 22px; overflow: hidden; text-overflow: ellipsis; }
.profile-email { color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.profile-copy .rank-tag { margin-top: 9px; }
.profile-card .rank-level { margin-top: 18px; }

.profile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.profile-foot .mono { color: var(--muted-2); font-size: 9px; overflow: hidden; text-overflow: ellipsis; }

.profile-mascot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.profile-mascot img {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
  transform: rotate(-4deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.profile-mascot strong { display: block; color: var(--white); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.profile-mascot span { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }

.account-actions { padding: 14px 18px 18px; border-top: 1px solid var(--line-soft); margin-top: 4px; }

/* Membership card: plan state plus the WhatsApp purchase path. */
.membership-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px;
  background:
    radial-gradient(260px 160px at 92% -10%, rgba(229, 27, 35, 0.14), transparent 72%),
    var(--surface);
}

.membership-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.membership-head > div { min-width: 0; flex: 1; }

.membership-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--red-line);
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red-bright);
}

.membership-icon.is-free {
  border-color: var(--line);
  background: var(--bg);
  color: var(--muted);
}

.membership-icon svg { width: 17px; height: 17px; }

.membership-head .eyebrow { font-size: 8.5px; }

.membership-head h2 {
  margin-top: 3px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.membership-copy {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.membership-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 10px;
}

.membership-meta strong {
  margin-right: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.membership-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius);
  background: var(--red-soft);
}

.membership-price strong {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.membership-price span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.membership-card .form-hint { margin: 0; }
.membership-card .form-hint strong { color: var(--text); }

/* Avatar library picker, used on the account page. */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  padding: 14px 18px 4px;
}

.avatar-empty { padding: 0 18px 14px; font-size: 11px; line-height: 1.6; }

.avatar-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.avatar-choice:hover:not(:disabled) { border-color: var(--line); background: var(--surface-2); }
.avatar-choice:focus-visible { outline: 2px solid var(--red-line); outline-offset: 2px; }
.avatar-choice:disabled { cursor: wait; opacity: 0.6; }

.avatar-choice .avatar { width: 56px; height: 56px; border-color: rgba(255, 255, 255, 0.18); }
.avatar-choice .avatar img { transition: transform 200ms var(--ease); }
.avatar-choice:hover .avatar img { transform: scale(1.05); }

.avatar-choice.is-selected {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: var(--white);
}

.avatar-choice-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.avatar-choice-check {
  position: absolute;
  top: 7px;
  right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
}

.avatar-choice-check svg { width: 11px; height: 11px; stroke-width: 3; }

.avatar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px 16px;
}

.avatar-foot .form-msg { margin: 0; }

.account-progress .progress-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.progress-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.progress-tile span { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.progress-tile strong { color: var(--white); font-family: var(--font-display); font-size: 20px; font-weight: 600; }

/* ------------------------------------------------------------------- admin */
.admin-gate { max-width: 620px; padding: 24px; }
.admin-gate-head { display: flex; gap: 14px; margin-bottom: 18px; }
.admin-lock { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--red-line); border-radius: var(--radius); background: var(--red-soft); color: var(--red-bright); }
.admin-lock svg { width: 18px; height: 18px; }
.admin-gate h2 { font-size: 18px; }
.admin-gate p { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.admin-gate code { color: var(--white); }
.admin-login { display: flex; flex-direction: column; gap: 12px; }
.admin-login .btn { align-self: flex-start; }

.admin-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }

.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-stat strong { color: var(--white); font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.admin-stat span { color: var(--muted-2); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; }

.admin-panel { padding: 0; }
.admin-panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 18px 0; }
.admin-panel-head h2 { font-size: 18px; }
.admin-panel-head .eyebrow { margin-bottom: 4px; }

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.seg button {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}

.seg button.active { background: var(--surface-3); color: var(--white); }

.admin-count { margin-left: auto; color: var(--muted-2); font-family: var(--font-mono); font-size: 9.5px; white-space: nowrap; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { min-width: 900px; }
.admin-table td { padding: 12px 14px; }

.admin-name { display: block; color: var(--white); font-size: 12px; font-weight: 500; }
.admin-sub { display: block; margin-top: 2px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }

.admin-user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-user-cell > div { min-width: 0; }

.admin-thumb {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-color: var(--bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  vertical-align: -7px;
}

.thumb-preview {
  display: grid;
  place-items: center;
  min-height: 96px;
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
}

.thumb-preview.has-img {
  padding: 0;
  overflow: hidden;
  border-style: solid;
  border-color: var(--line);
}

.thumb-preview.is-broken {
  border-color: var(--red-line);
  color: var(--red-bright);
}

.thumb-preview-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Lab cards run a wider frame than season art. The preview mirrors that frame
   and shows the whole image, matching the uncropped catalog card. */
.thumb-preview.is-lab .thumb-preview-img {
  aspect-ratio: 16 / 5;
  background-size: contain;
}

.admin-type { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.5px; }
.admin-type svg { width: 12px; height: 12px; }

.admin-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.admin-status.is-live { border-color: rgba(255, 255, 255, 0.22); color: var(--white); }
.admin-status.is-draft { border-color: var(--red-line); color: var(--red-bright); }

.admin-row-actions { display: flex; align-items: center; gap: 5px; }
.admin-empty { padding: 24px; color: var(--muted); font-size: 12px; text-align: center; }
.admin-note { max-width: 760px; padding: 0 18px 16px; color: var(--muted-2); font-size: 10.5px; line-height: 1.55; }
.admin-panel > .admin-note { padding-top: 4px; }

.admin-head-tools { display: flex; align-items: center; gap: 10px; }

/* Season planner: one row per drop with its window and lifecycle controls. */
.season-list { display: flex; flex-direction: column; padding: 0 18px 18px; }

.season-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.season-item + .season-item { margin-top: 8px; }

.season-item.is-active {
  border-color: var(--red-line);
  background:
    linear-gradient(90deg, var(--red-soft), transparent 55%),
    var(--bg);
}

.season-main { flex: 1; min-width: 0; }

.season-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.season-title strong { color: var(--white); font-size: 13px; }

.season-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--line);
}

.season-item.is-active .season-dot {
  background: var(--red-bright);
  box-shadow: 0 0 0 3px rgba(229, 27, 35, 0.16);
}

.season-main p { margin-top: 5px; color: var(--muted); font-size: 11px; }

.season-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.avatar-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.avatar-admin-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.avatar-admin-item.is-retired { opacity: 0.72; }
.avatar-admin-item .avatar { width: 46px; height: 46px; }

.avatar-admin-copy { flex: 1 1 140px; min-width: 0; }
.avatar-admin-copy strong { display: block; color: var(--white); font-size: 12px; }
.avatar-admin-copy .mono { display: block; margin-top: 2px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-admin-copy > span:last-child { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.avatar-admin-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }

.avatar-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted-2);
  font-size: 10.5px;
}

.avatar-preview .avatar { width: 56px; height: 56px; }

/* Rank insignia: one row per rung with a live URL preview. */
.rank-admin-list { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 18px; }

.rank-admin-item {
  display: grid;
  grid-template-columns: 46px minmax(130px, 180px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.rank-admin-medal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--red-line);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(229, 27, 35, 0.22), rgba(229, 27, 35, 0.04) 72%);
  color: var(--red-bright);
}

.rank-admin-medal img { width: 30px; height: 30px; object-fit: contain; }
.rank-admin-medal svg { width: 20px; height: 20px; }

.rank-admin-copy strong { display: block; color: var(--white); font-size: 12px; }
.rank-admin-copy .mono { display: block; margin-top: 2px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }
.rank-admin-state { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; }

.rank-admin-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rank-admin-form .rank-admin-url { flex: 1 1 220px; min-width: 0; min-height: 38px; font-size: 12px; }

@media (max-width: 720px) {
  .rank-admin-item { grid-template-columns: 46px minmax(0, 1fr); }
  .rank-admin-form { grid-column: 1 / -1; }
}
.avatar-preview img:not([src]) { visibility: hidden; }

.admin-flag-state { color: var(--muted-2); font-family: var(--font-mono); font-size: 10px; }
.admin-flag-state.is-set { color: var(--white); }

/* payload upload (lab drawer) */
.payload-upload { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.payload-current {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.payload-current.is-empty { border-style: dashed; border-color: var(--line-soft); }
.payload-glyph {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--red-bright);
}
.payload-glyph svg { width: 18px; height: 18px; }
.payload-meta { min-width: 0; }
.payload-meta strong { display: block; color: var(--white); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.payload-meta span { display: block; margin-top: 2px; color: var(--muted-2); font-size: 10px; }
.payload-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.payload-progress { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.payload-progress-track { flex: 1; height: 4px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.payload-progress-bar { height: 100%; width: 0; background: var(--red-bright); transition: width 160ms linear; }
.payload-progress.is-error .payload-progress-bar { background: var(--red-dark); }
.payload-progress.is-error span { color: var(--red-bright); }
@media (max-width: 720px) {
  .payload-current { grid-template-columns: 36px minmax(0, 1fr); }
  .payload-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ------------------------------------------------------------------ drawer */
.drawer-scrim,
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(3px);
  animation: fade-in 160ms var(--ease);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: min(600px, 100vw);
  margin: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
  animation: drawer-in 240ms var(--ease);
}

@keyframes drawer-in { from { transform: translateX(28px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-kicker { color: var(--red-bright); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
.drawer-head h2 { margin-top: 3px; font-size: 20px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover { border-color: var(--red-line); color: var(--white); }
.icon-btn svg { width: 15px; height: 15px; }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }

.field-group { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.field-group:first-child { padding-top: 0; border-top: 0; }
.field-group-title { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

textarea.input { min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.6; }

.check-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 10.5px; cursor: pointer; }
.check input { width: 13px; height: 13px; accent-color: var(--red); }
.check:has(input:checked) { border-color: var(--red-line); color: var(--white); }

.hint-editor { display: flex; flex-direction: column; gap: 7px; }
.hint-row { display: flex; gap: 6px; align-items: flex-start; }
.hint-row textarea { min-height: 62px; }
.hint-row .icon-btn { width: 38px; height: 38px; }

.drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-deep);
}

.drawer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.drawer-actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-status { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }

.modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 100;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-card h3 { font-size: 17px; }
.modal-card p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.modal-card.is-wide {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}

.modal-card .eyebrow { margin-bottom: 6px; }

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.modal-card .form-msg { margin-top: 10px; }

/* ------------------------------------------------------------------- login */
.auth-body { background: var(--bg-deep); }
.auth-body::before { background: radial-gradient(900px 500px at 18% 10%, rgba(229, 27, 35, 0.13), transparent 62%); }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  min-height: 100dvh;
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 40px clamp(28px, 5vw, 76px);
  border-right: 1px solid var(--line-soft);
  overflow: hidden;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 40%, #000, transparent 76%);
  pointer-events: none;
}

.auth-brand > * { position: relative; z-index: 1; }
.auth-logo { height: auto; padding: 0; border: 0; width: fit-content; }
.auth-logo .brand-mark { width: 40px; height: 40px; }
.auth-brand-copy { margin: auto 0; padding: 48px 0; max-width: 600px; }

.auth-brand-copy h1 {
  margin-top: 12px;
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.auth-brand-copy h1 em { color: var(--red-bright); font-style: normal; }
.auth-brand-copy > p { max-width: 500px; margin-top: 18px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.auth-points { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; list-style: none; }
.auth-points li { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.auth-points svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: var(--red-bright); }
.auth-points strong { color: var(--white); }

.auth-terminal {
  width: min(480px, 100%);
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 5, 5, 0.86);
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.term-bar span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.term-bar span:first-child { background: var(--red); }
.term-bar b { margin-left: 8px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; font-weight: 400; }
.auth-terminal pre { margin: 0; padding: 14px; color: var(--text); font-family: var(--font-mono); font-size: 10.5px; line-height: 1.75; white-space: pre-wrap; }
.t-dim { color: var(--muted-2); }
.t-red { color: var(--red-bright); }

.auth-crew {
  position: relative;
  width: min(480px, 100%);
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #050505;
  overflow: hidden;
}

.auth-crew img { display: block; width: 100%; height: auto; }

.auth-crew figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 26px 12px 9px;
  background: linear-gradient(transparent, rgba(5, 5, 5, 0.94));
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-crew figcaption span { color: var(--red-bright); }

.auth-brand-foot { color: var(--muted-2); font-size: 10.5px; }

@media (max-height: 1040px) {
  .auth-terminal { display: none; }
}

@media (max-height: 900px) {
  .auth-brand-copy { padding: 26px 0; }
  .auth-brand-copy h1 { font-size: clamp(30px, 3.6vw, 44px); }
  .auth-points { display: none; }
  .auth-crew { max-width: 420px; margin-bottom: 18px; }
}

.auth-panel { display: grid; place-items: center; padding: 32px 24px; background: var(--bg); }

.auth-card {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  margin-bottom: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-deep);
}

.auth-tab {
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}

.auth-tab.active { background: var(--red); color: var(--white); }

.auth-head { margin-bottom: 20px; }
.auth-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 12px; border: 1px solid var(--red-line); border-radius: var(--radius); background: var(--red-soft); color: var(--red-bright); }
.auth-icon svg { width: 17px; height: 17px; }
.auth-head h2 { font-size: 24px; }
.auth-head p { margin-top: 5px; color: var(--muted); font-size: 12px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 60px; }

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.pw-toggle:hover { color: var(--white); border-color: var(--red-line); }
.auth-submit { min-height: 46px; margin-top: 2px; font-size: 13px; }
.auth-switch { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--muted); font-size: 11.5px; }
.auth-card > .auth-switch { margin-top: 14px; }
.auth-legal { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 9.5px; line-height: 1.6; }

/* ------------------------------------------------------------------ footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  padding: 18px 32px 26px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 10px;
}

.footer .f-links { display: flex; gap: 14px; margin: 0; padding: 0; }
.footer a:hover { color: var(--white); }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1320px) {
  .head-peek.wide { display: none; }
  .sticker-rail { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modules-grid .module-card:nth-child(3) { display: none; }
  .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .sticker-card { padding: 12px; gap: 11px; }
  .sticker-art { width: 88px; height: 88px; }
  .sticker-art.infrastructure { width: 118px; }
  .sticker-strip-head { flex-direction: column; gap: 10px; align-items: flex-start; }
  .sticker-strip-head p { max-width: none; }
  .sticker-rail,
  .delivery-grid { grid-template-columns: 1fr; }
  .head-peek { display: none; }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: 24px 0 60px rgba(0, 0, 0, 0.6); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-scrim { display: block; }

  .nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.64);
    backdrop-filter: blur(2px);
  }

  .main { margin-left: 0; }
  .nav-toggle { display: inline-flex; }
  .global-search { width: min(420px, 44vw); }
  .dash-hero { grid-template-columns: 1fr; }
  .dash-hero-side { align-items: flex-start; padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--line-soft); }
  .dash-hero-side .rank-meta { margin-top: 0; }
  .rank-emblem { display: none; }
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100dvh; min-width: 0; background: var(--bg-deep); }
  .auth-card { box-shadow: none; }
  .account-grid { grid-template-columns: 1fr; }
  .track-card { }
  .api-groups { grid-template-columns: 1fr; }
  .sticker-strip-head { align-items: flex-start; }
}

@media (max-width: 860px) {
  .page { padding: 22px 20px 44px; }
  .topbar { padding: 0 20px; gap: 12px; }
  .footer { padding: 16px 20px 22px; }
  .season-chip { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .head-actions { justify-content: flex-start; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .briefing-card { grid-template-columns: 1fr; }
  .briefing-copy { padding: 22px; }
  .briefing-art { min-height: 0; aspect-ratio: 16 / 9; }
  .briefing-art::before { background: linear-gradient(180deg, var(--surface) 0%, transparent 26%); }
  .bottom-grid { grid-template-columns: 1fr; }
  .tracks-grid { grid-template-columns: 1fr; }
  .manual-grid { grid-template-columns: 1fr; }
  .resources { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .access-card { position: static; }
  .related-grid { grid-template-columns: 1fr; }
  .hidden-sm { display: none; }
  .hide-sm { display: none; }
  .lab-hero { flex-direction: column; align-items: flex-start; }
  .account-progress .progress-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flag-card { grid-template-columns: 1fr; padding: 22px; }
  .flag-rules { padding-left: 0; padding-top: 18px; border-left: 0; border-top: 1px solid var(--line-soft); }
  .api-section .section-head { align-items: flex-start; flex-direction: column; gap: 14px; }
}

@media (max-width: 620px) {
  .global-search { flex: 1; width: auto; min-width: 0; }
  .global-search kbd { display: none; }
  .top-meta .agent-pill .handle { display: none; }
  .top-meta { gap: 8px; }
  .status-chip { display: none; }
  .guest-actions .btn-primary { display: none; }
  .sticker-strip { padding: 16px; }
  .sticker-art { width: 78px; height: 78px; }
  .sticker-card { align-items: flex-start; }
  .flag-card { padding: 18px; }
  .flag-demo > code { font-size: 11.5px; }
  .api-base { flex-wrap: wrap; padding: 8px 8px 8px 10px; }
  .api-base code { white-space: normal; overflow-wrap: anywhere; }
  .api-group .endpoint-table td:last-child { width: auto; }
  .lab-grid { grid-template-columns: 1fr; }
  .modules-grid { grid-template-columns: 1fr; }
  .modules-grid .module-card:nth-child(3) { display: flex; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-tile { grid-template-columns: 32px 1fr; padding: 13px; column-gap: 10px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-tile strong { font-size: 17px; }
  .hero-actions .btn { flex: 1; }
  .dash-hero { padding: 22px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .field-row, .field-row.three { grid-template-columns: 1fr; }
  .auth-panel { padding: 20px 14px; align-items: flex-start; }
  .auth-card { padding: 22px; }
  .auth-head h2 { font-size: 21px; }
  .account-progress .progress-tiles { grid-template-columns: 1fr 1fr; }
  .continue-inner { flex-wrap: wrap; }
  .continue-inner .btn { width: 100%; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-panel-head { padding: 16px 16px 0; }
  .admin-toolbar { padding: 12px 16px; }
  .admin-note { padding: 0 16px 14px; }
  .footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------- legacy fragments */
.agent-hero { }
.hero-id h2 { font-size: 24px; }
.hero-sub { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 11px; }
.hero-stats { display: flex; gap: 22px; }
.hero-stat { display: flex; flex-direction: column; }
.hero-stat strong { color: var(--white); font-family: var(--font-mono); font-size: 18px; }
.hero-stat span { color: var(--muted-2); font-size: 9px; text-transform: uppercase; }
.avatar-ring { display: inline-flex; }

/* --------------------------------------------------- dashboard (dense layout)
   Modelled on operator consoles: a compact identity strip, three panels of
   real account data, tabbed operations and a narrow modules/leaderboard rail.
   No full-width hero, no decorative stat tiles. */
.dash-page { max-width: 1460px; }

.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.dash-head-skel { width: 100%; }
.dash-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dash-id-copy { min-width: 0; }
.dash-id-copy .eyebrow { margin-bottom: 2px; font-size: 9px; letter-spacing: 0.14em; }
.dash-id-copy h1 { font-size: clamp(20px, 2.1vw, 26px); font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.dash-id-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.dash-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.dash-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.dash-card {
  display: flex;
  flex-direction: column;
  min-height: 186px;
  padding: 16px 16px 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.dash-label {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.dash-rank { align-items: stretch; }
.rank-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.rank-head .rank-copy { min-width: 0; padding-top: 2px; }
.rank-head .rank-name { margin-top: 7px; font-size: 22px; overflow-wrap: anywhere; }
.rank-head .rank-level { margin-top: 4px; }
.rank-crest {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  margin: -2px -4px 0 0;
  border: 1px solid var(--red-line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(229, 27, 35, 0.34), rgba(229, 27, 35, 0.05) 68%),
    rgba(255, 255, 255, 0.012);
  box-shadow:
    0 0 0 6px rgba(229, 27, 35, 0.04),
    inset 0 0 26px rgba(229, 27, 35, 0.16);
  color: var(--red-bright);
}
.rank-crest svg { width: 46px; height: 46px; }
.rank-crest img { width: 66px; height: 66px; object-fit: contain; }
.rank-medal {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid var(--red-line);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(229, 27, 35, 0.26), rgba(229, 27, 35, 0.05) 72%);
  color: var(--red-bright);
}
.rank-medal svg { width: 24px; height: 24px; }
.rank-medal img { width: 32px; height: 32px; object-fit: contain; }
.rank-name { display: block; color: var(--white); font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.2; }
.rank-level { display: block; margin-top: 2px; color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.rank-level b { color: var(--white); font-size: 12px; }

.dash-meter-block { margin-top: auto; padding-top: 14px; }
.dash-meter-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
}

.dash-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.4;
}

.clear-top { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.clear-top strong { color: var(--white); font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1; }
.clear-top span { color: var(--muted-2); font-size: 10px; }
.clear-rows { display: grid; gap: 7px; margin: 12px 0 0; }
.clear-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}
.clear-track { height: 4px; overflow: hidden; border-radius: 2px; background: #1c1c21; }
.clear-track i { display: block; height: 100%; background: rgba(255, 255, 255, 0.32); }
.clear-count { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; text-align: right; }

.activity-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 12px; }
.activity-streak strong { display: block; color: var(--white); font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1; }
.activity-streak span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 10px; }
.activity-xp { text-align: right; }
.activity-xp span { display: block; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.activity-xp strong { color: var(--white); font-family: var(--font-mono); font-size: 13px; }
.activity-card .spark { width: 100%; height: 46px; margin-top: 14px; }
.activity-card .dash-card-foot { margin-top: auto; padding-top: 8px; }

.dash-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 326px;
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.dash-panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.ops-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.ops-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.ops-tabs::-webkit-scrollbar { display: none; }

.ops-tab {
  position: relative;
  padding: 8px 10px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 140ms var(--ease);
}
.ops-tab span { margin-left: 5px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }
.ops-tab:hover { color: var(--white); }
.ops-tab.is-active { color: var(--white); border-bottom-color: var(--red); }
.ops-tab.is-active span { color: var(--red-bright); }
.ops-tab:focus-visible { outline: 2px solid var(--red-bright); outline-offset: -2px; }

.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}
.ops-grid .empty-state { grid-column: 1 / -1; }

.dash-side { display: grid; gap: 14px; align-content: start; }

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.side-head h2 { font-size: 13px; font-weight: 600; }
.side-count { margin-left: 5px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; font-weight: 400; }
.side-head .link-arrow { font-size: 10.5px; }

.side-modules { padding: 4px 0; }
.side-module { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.side-module + .side-module { border-top: 1px solid var(--line-soft); }
.side-module:hover { background: var(--surface-2); }
.side-module-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--red-bright);
}
.side-module-icon svg { width: 14px; height: 14px; }
.side-module-body { flex: 1; min-width: 0; }
.side-module-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.side-module-top strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-module-top span { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; white-space: nowrap; }
.side-empty { margin: 0; padding: 16px 14px; color: var(--muted-2); font-size: 11px; }

.side-lb { padding: 4px 0; }
.side-lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 11px; }
.side-lb-row + .side-lb-row { border-top: 1px solid var(--line-soft); }
.side-lb-row:hover { background: var(--surface-2); }
.side-lb-row.is-you { background: var(--red-soft); }
.side-lb-rank { width: 18px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }
.side-lb-name { flex: 1; min-width: 0; overflow: hidden; color: var(--text); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.side-lb-xp { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.side-you {
  padding: 0 4px;
  border: 1px solid var(--red-line);
  border-radius: 3px;
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 7.5px;
  text-transform: uppercase;
}

.dash-help {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #101013, #0b0b0d);
}
.dash-help:hover { border-color: var(--red-line); }
.dash-help img { width: 46px; height: 46px; flex: 0 0 auto; object-fit: contain; transform: rotate(-4deg); }
.dash-help-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dash-help-copy strong { color: var(--white); font-size: 11.5px; }
.dash-help-copy span { color: var(--muted-2); font-size: 10px; line-height: 1.4; }
.dash-help-go { color: var(--red-bright); }
.dash-help-go svg { width: 14px; height: 14px; }

.dash-community { display: grid; gap: 10px; }
.dash-community-card {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.dash-community-card .dash-help-media {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  color: var(--red-bright);
}
.dash-community-card .dash-help-media svg { width: 24px; height: 24px; }
.dash-community-card .dash-help-media img {
  width: 46px;
  height: 46px;
  max-width: 46px;
  object-fit: contain;
  transform: none;
}
.dash-community-card:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 2px; }
.dash-community-card.is-muted { cursor: default; }
.dash-community-card.is-muted:hover { border-color: var(--line-soft); }
.dash-community-card.is-muted .dash-help-media { color: var(--muted-2); }
.dash-community-card.is-muted .dash-help-copy strong { color: var(--muted); }

/* invite dialog */
.invite-scrim { z-index: 120; }
.invite-card { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; }
.invite-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.invite-close:hover { border-color: var(--red-line); color: var(--white); }
.invite-close svg { width: 14px; height: 14px; }
.invite-hero {
  display: grid;
  place-items: center;
  margin: 4px 0 16px;
}
.invite-hero img { width: 108px; height: 108px; object-fit: contain; transform: rotate(-4deg); }
.invite-hero svg { width: 68px; height: 68px; }
.invite-eyebrow {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.invite-card h3 { margin-top: 8px; font-size: 27px; letter-spacing: -0.02em; line-height: 1.1; }
.invite-copy { margin-top: 10px; font-size: 12.5px; line-height: 1.65; }
.invite-link-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: 18px; }
.invite-link-row .btn { flex: 0 0 auto; }
.invite-link {
  flex: 1 1 240px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.invite-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; color: var(--muted-2); font-size: 10.5px; }
.invite-code-row strong { color: var(--white); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em; }
.invite-code-row .btn { margin-left: auto; }
.invite-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.invite-stats strong { color: var(--white); font-family: var(--font-display); font-size: 24px; line-height: 1; }
.invite-stats span { color: var(--muted-2); font-size: 10.5px; }

/* lab rating */
.rate-card .rate-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rate-card .rate-head h2 { margin-bottom: 4px; }
.rate-card .rate-head .form-hint { margin-top: 4px; }
.rate-score { flex: 0 0 auto; text-align: right; }
.rate-score strong { display: block; color: var(--white); font-family: var(--font-display); font-size: 26px; line-height: 1; }
.rate-score span { display: block; margin-top: 3px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }
.rate-stars { display: flex; gap: 6px; margin-top: 14px; }
.rate-star {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted-2);
  cursor: pointer;
  transition: color 140ms var(--ease), border-color 140ms var(--ease), background 140ms var(--ease);
}
.rate-star svg { width: 17px; height: 17px; }
.rate-star:hover,
.rate-star:focus-visible { border-color: var(--red-line); color: var(--red-bright); }
.rate-star.is-on { border-color: var(--red-line); background: var(--red-soft); color: var(--red-bright); }
.rate-star:disabled { cursor: progress; opacity: 0.7; }
.rate-signin { margin-top: 12px; }
.rate-signin .btn { width: auto; }

@media (max-width: 1180px) {
  .dash-content { grid-template-columns: minmax(0, 1fr); }
  .dash-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-help { grid-column: 1 / -1; }
  .dash-community { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .dash-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-card { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .dash-head { flex-direction: column; align-items: flex-start; }
  .dash-head-actions { width: 100%; }
  .dash-head-actions .btn { flex: 1; justify-content: center; }
  .dash-top { grid-template-columns: minmax(0, 1fr); }
  .activity-card { grid-column: auto; }
  .dash-side { grid-template-columns: minmax(0, 1fr); }
  .dash-community { grid-template-columns: minmax(0, 1fr); }
  .ops-head { flex-wrap: wrap; }
  .ops-grid { grid-template-columns: minmax(0, 1fr); padding: 12px; }
}

@media (max-width: 620px) {
  .dash-card { min-height: 0; }
  .rank-head .rank-name { font-size: 20px; }
  .rank-crest { width: 76px; height: 76px; }
  .rank-crest svg { width: 40px; height: 40px; }
  .rank-crest img { width: 54px; height: 54px; }
  .dash-identity .avatar.lg { width: 52px; height: 52px; font-size: 15px; }
  .ops-grid { padding: 10px; }
  .dash-content { margin-top: 12px; }
}

/* --------------------------------------------------------- season archive */
.season-archive {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.season-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.season-card:hover {
  border-color: var(--red-line);
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.44);
}

.season-card.is-live { border-color: var(--red-line); }

.season-art {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    repeating-linear-gradient(-45deg, rgba(229, 27, 35, 0.07) 0 1px, transparent 1px 14px),
    linear-gradient(160deg, #141418, #09090b);
}

.season-art-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(0.92) contrast(1.04);
  transition: transform 420ms var(--ease), filter 220ms var(--ease);
}

.season-card:hover .season-art-img { transform: scale(1.035); filter: saturate(1) contrast(1.06); }

.season-art-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.05) 32%, rgba(5, 5, 5, 0.62) 100%);
  pointer-events: none;
}

.season-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(229, 27, 35, 0.4);
}

.season-glyph svg { width: 64px; height: 64px; stroke-width: 1.2; }

.season-index {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.season-badge {
  position: absolute;
  top: 11px;
  right: 11px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  background: rgba(5, 5, 5, 0.62);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.season-card.is-live .season-badge {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.season-card.is-scheduled .season-badge { border-color: rgba(255, 255, 255, 0.32); color: var(--muted); }

.season-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 14px 15px 13px;
}

.season-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.season-body h3 { font-size: 16px; }
.season-body h3 a:hover { color: var(--red-bright); }

.season-tagline {
  flex: 1;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.season-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 10px;
}

.season-foot .meta-item { display: inline-flex; align-items: center; gap: 5px; }
.season-foot .meta-item svg { width: 12px; height: 12px; }
.season-foot .go { color: var(--muted-2); transition: color 140ms var(--ease), transform 140ms var(--ease); }
.season-foot .go svg { width: 15px; height: 15px; }
.season-card:hover .season-foot .go { color: var(--red-bright); transform: translateX(3px); }

/* upgrade strip */
.pro-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.7fr);
  gap: 26px;
  margin-top: 34px;
  padding: 26px 28px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 220px at 8% 0%, rgba(229, 27, 35, 0.16), transparent 62%),
    linear-gradient(120deg, #120709 0%, #0b0b0e 58%, #08080a 100%);
}

.pro-strip-copy .eyebrow { margin-bottom: 8px; }
.pro-strip-copy h2 { font-size: clamp(20px, 2.2vw, 26px); }
.pro-strip-copy > p { max-width: 60ch; margin-top: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.65; }

.pro-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 18px;
  margin-top: 16px;
  list-style: none;
}

.pro-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.45;
}

.pro-features svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; color: var(--red-bright); }

.pro-strip-buy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  align-self: center;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.pro-price {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.pro-period {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pro-strip-buy .btn { margin-top: 12px; }
.pro-strip-buy .form-hint { margin-top: 9px; font-size: 10px; line-height: 1.5; color: var(--muted-2); }
.pro-strip-buy .form-hint strong { color: var(--text); }

@media (max-width: 1180px) {
  .season-archive { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .pro-strip { grid-template-columns: 1fr; }
  .pro-strip-buy {
    align-items: stretch;
    padding-left: 0;
    padding-top: 20px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .pro-strip-buy .btn { width: 100%; }
}

@media (max-width: 620px) {
  .season-archive { grid-template-columns: 1fr; }
  .pro-features { grid-template-columns: 1fr; }
  .pro-strip { padding: 20px 18px; }
}

/* ------------------------------------------------------------ admin tabs */
.admin-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.admin-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms var(--ease), background 150ms var(--ease), transform 120ms var(--ease);
}

.admin-tab:hover { border-color: var(--red-line); background: var(--surface-2); }
.admin-tab:active { transform: translateY(1px); }

.admin-tab.is-active {
  border-color: var(--red-line);
  background:
    linear-gradient(160deg, rgba(229, 27, 35, 0.1), transparent 62%),
    var(--surface);
  box-shadow: inset 0 -2px 0 var(--red);
}

.admin-tab-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
}

.admin-tab-icon svg { width: 14px; height: 14px; }
.admin-tab.is-active .admin-tab-icon { border-color: var(--red-line); color: var(--red-bright); }

.admin-tab-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 26px; }
.admin-tab-copy strong { color: var(--text); font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; }
.admin-tab-copy span { color: var(--muted-2); font-size: 9px; line-height: 1.35; }
.admin-tab.is-active .admin-tab-copy strong { color: var(--white); }

.admin-tab-count {
  position: absolute;
  top: 12px;
  right: 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.admin-tab.is-active .admin-tab-count { color: var(--red-bright); }

.admin-view { animation: view-in 180ms var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* overview landing */
.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.overview-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.overview-head { display: flex; align-items: flex-start; gap: 10px; }
.overview-head > div { flex: 1; min-width: 0; }
.overview-head h3 { margin-top: 2px; font-size: 15px; }
.overview-head .tier-tag { margin-top: 2px; }

.overview-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--red-bright);
}

.overview-icon svg { width: 15px; height: 15px; }
.overview-card > p { min-height: 36px; color: var(--muted); font-size: 11px; line-height: 1.55; }

.overview-rows { border-top: 1px solid var(--line-soft); }

.overview-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 10.5px;
}

.overview-rows > div:last-child { border-bottom: 0; }
.overview-rows strong { color: var(--text); font-family: var(--font-mono); font-size: 10px; font-weight: 500; }
.overview-card > .btn { align-self: flex-start; margin-top: auto; }
.overview-card > .btn svg { width: 13px; height: 13px; }

/* plan catalogue */
.plan-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  padding: 4px 18px 18px;
}

.plan-admin-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.plan-admin-card.is-hidden { opacity: 0.62; }
.plan-admin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.plan-admin-top h3 { margin-top: 2px; font-size: 18px; }
.plan-admin-tagline { color: var(--muted); font-size: 11.5px; line-height: 1.55; }

.plan-admin-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius);
  background: var(--red-soft);
}

.plan-admin-price strong {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.plan-admin-price span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-admin-features { display: flex; flex-direction: column; gap: 6px; list-style: none; }
.plan-admin-features li { display: flex; align-items: flex-start; gap: 8px; color: var(--text); font-size: 11px; line-height: 1.45; }
.plan-admin-features svg { width: 12px; height: 12px; flex: 0 0 auto; margin-top: 1px; color: var(--red-bright); }

.plan-admin-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.plan-admin-foot .mono { color: var(--muted-2); font-size: 9px; }

/* subscriptions */
.admin-stats-subs { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.subs-grant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  align-items: end;
  gap: 12px;
  padding: 14px 18px 18px;
}

.subs-grant-form .field { margin: 0; }
.subs-grant-form .form-hint { grid-column: 1 / -1; margin: 0; }
.subs-grant-form .btn { min-height: 40px; }

/* season artwork preview in the admin list */
.admin-season-thumb {
  width: 108px;
  aspect-ratio: 16 / 9;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-color: var(--bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.admin-season-thumb.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted-2);
  background:
    repeating-linear-gradient(-45deg, rgba(229, 27, 35, 0.07) 0 1px, transparent 1px 12px),
    var(--bg);
}

.admin-season-thumb.is-empty svg { width: 18px; height: 18px; }

@media (max-width: 1180px) {
  .admin-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-overview-grid { grid-template-columns: 1fr; }
  .admin-stats-subs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .admin-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subs-grant-form { grid-template-columns: 1fr; }
  .subs-grant-form .btn { width: 100%; }
}

@media (max-width: 620px) {
  .admin-tab-copy span { display: none; }
  .admin-tab { flex-direction: row; align-items: center; gap: 8px; }
  .admin-tab-copy { padding-right: 28px; }
  .admin-tab-count { top: 50%; transform: translateY(-50%); }
  .admin-season-thumb { width: 100%; }
  .season-item { align-items: flex-start; }
}
/* ---------------------------------------------------------------- upgrade */
/* Persistent free-account entry point in the app chrome. The header chip is
   deliberately arcade-flavoured: pixel lettering and a hard offset shadow that
   presses down like a physical cabinet button. */
.upgrade-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--red-line);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(229, 27, 35, 0.26), rgba(229, 27, 35, 0.08)),
    var(--surface);
  box-shadow: 2px 2px 0 rgba(229, 27, 35, 0.32);
  color: var(--white);
  white-space: nowrap;
  transition:
    transform 120ms var(--ease),
    box-shadow 120ms var(--ease),
    border-color 140ms var(--ease),
    background 140ms var(--ease);
}

.upgrade-chip > span {
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.75);
}

.upgrade-chip svg { width: 12px; height: 12px; color: var(--red-bright); }
.upgrade-chip strong { color: var(--red-bright); font-family: var(--font-mono); font-size: 9px; font-weight: 400; letter-spacing: 0.04em; }
.upgrade-chip:hover {
  border-color: var(--red);
  background:
    linear-gradient(180deg, rgba(229, 27, 35, 0.34), rgba(229, 27, 35, 0.14)),
    var(--surface);
  box-shadow: 1px 1px 0 rgba(229, 27, 35, 0.5);
  transform: translate(1px, 1px);
}
.upgrade-chip:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}
.upgrade-chip:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 2px;
}

/* Unverified accounts get a quiet outline chip until the mailbox is confirmed. */
.verify-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px dashed var(--red-line);
  border-radius: 4px;
  color: var(--red-bright);
  white-space: nowrap;
  transition:
    border-color 140ms var(--ease),
    background 140ms var(--ease);
}
.verify-chip > span {
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.75);
}
.verify-chip svg { width: 12px; height: 12px; }
.verify-chip:hover {
  border-style: solid;
  border-color: var(--red);
  background: var(--red-soft);
}
.verify-chip:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .verify-chip { padding: 0 8px; }
  .verify-chip > span { display: none; }
}

.sidebar-upgrade {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius);
  background:
    radial-gradient(140px 90px at 100% 0%, rgba(229, 27, 35, 0.18), transparent 72%),
    var(--surface);
  transition: border-color 140ms var(--ease);
}

.sidebar-upgrade:hover { border-color: var(--red); }
.sidebar-upgrade-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--red-line);
  border-radius: 4px;
  background: var(--red-soft);
  color: var(--red-bright);
}

.sidebar-upgrade-icon svg { width: 13px; height: 13px; }
.sidebar-upgrade-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.sidebar-upgrade-copy strong { color: var(--white); font-size: 11.5px; line-height: 1.3; }
.sidebar-upgrade-copy span { color: var(--muted); font-family: var(--font-mono); font-size: 9px; }
.sidebar-upgrade-go { width: 13px; height: 13px; flex: 0 0 auto; color: var(--red-bright); }

.upgrade-status { margin-bottom: 14px; }

.upgrade-status-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.upgrade-status-inner.is-premium,
.upgrade-status-inner.is-admin {
  border-color: var(--red-line);
  background:
    radial-gradient(280px 120px at 90% 0%, rgba(229, 27, 35, 0.16), transparent 72%),
    var(--surface);
}

.upgrade-status-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
}

.upgrade-status-inner.is-premium .upgrade-status-icon,
.upgrade-status-inner.is-admin .upgrade-status-icon {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: var(--red-bright);
}

.upgrade-status-icon svg { width: 16px; height: 16px; }
.upgrade-status-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.upgrade-status-copy .eyebrow { margin-bottom: 2px; font-size: 8.5px; }
.upgrade-status-copy strong { color: var(--white); font-family: var(--font-display); font-size: 15px; }
.upgrade-status-copy > span:last-child { color: var(--muted); font-size: 11px; line-height: 1.5; }

.upgrade-status-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 14px;
  border-right: 1px solid var(--line-soft);
  text-align: right;
}

.upgrade-status-meta span { color: var(--muted-2); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.upgrade-status-meta strong { color: var(--white); font-family: var(--font-mono); font-size: 10.5px; font-weight: 400; }

.upgrade-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.upgrade-main,
.upgrade-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.plan-card { padding: 22px; }

.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.plan-head-copy { min-width: 0; }
.plan-head-copy .eyebrow { margin-bottom: 7px; }
.plan-head-copy h2 { font-size: clamp(24px, 2.6vw, 32px); }
.plan-tagline { max-width: 520px; margin-top: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.65; }

.plan-price {
  flex: 0 0 auto;
  padding: 12px 15px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius);
  background: var(--red-soft);
  text-align: right;
}

.plan-price strong { display: block; color: var(--white); font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.plan-price span { color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.09em; text-transform: uppercase; }

.plan-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 20px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.plan-features svg { flex: 0 0 auto; width: 13px; height: 13px; margin-top: 2px; color: var(--red-bright); }

.plan-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--line-soft);
}

.plan-meta > div { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; background: var(--bg); }
.plan-meta span { color: var(--muted-2); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.plan-meta strong { color: var(--white); font-size: 11.5px; font-weight: 500; }

.plan-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.55;
}

.plan-note svg { flex: 0 0 auto; width: 13px; height: 13px; margin-top: 1px; color: var(--red-bright); }

.pay-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
  align-items: start;
}

.payment-qr {
  margin: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.payment-qr img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 2px; }
.payment-qr figcaption { padding-top: 8px; color: #4b4b52; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.07em; text-align: center; text-transform: uppercase; }

.pay-route { min-width: 0; }
.pay-steps { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }

.pay-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.pay-steps li:first-child { padding-top: 0; }
.pay-steps li:last-child { padding-bottom: 0; border-bottom: 0; }

.pay-step-num {
  flex: 0 0 auto;
  padding-top: 1px;
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.pay-steps strong { display: block; color: var(--white); font-size: 12px; }
.pay-steps div > span { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.55; }

.till-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.till-line code {
  padding: 5px 9px;
  border: 1px solid var(--red-line);
  border-radius: 4px;
  background: var(--red-soft);
  color: var(--white);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.pay-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.55;
}

/* Retention and refund terms stay visible next to the payment route. The
   square markers echo the arcade styling of the header CTA. */
.pay-terms {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px dashed var(--line-soft);
  list-style: none;
}

.pay-terms li {
  position: relative;
  padding-left: 14px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.pay-terms li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 6px;
  height: 6px;
  background: var(--red-bright);
}

.pay-terms strong { color: var(--white); font-weight: 600; }

.voucher-card,
.history-card,
.upgrade-help { padding: 0; }

.voucher-form { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 10px; }
.voucher-foot { padding: 0 18px 16px; color: var(--muted-2); font-size: 10px; line-height: 1.55; }

.upgrade-help > p { padding: 14px 18px 4px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.upgrade-help > .btn { width: calc(100% - 36px); margin: 12px 18px 18px; }

.upgrade-auth {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
  padding: 18px;
}

.upgrade-auth-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
}

.upgrade-auth-icon svg { width: 15px; height: 15px; }
.upgrade-auth p { color: var(--muted); font-size: 11px; line-height: 1.6; }

.proof-form { display: flex; flex-direction: column; gap: 13px; padding: 18px; }
.proof-form .field textarea {
  width: 100%;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
}

.proof-form .field textarea:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px rgba(229, 27, 35, 0.14); }
.proof-form input[type="file"] { padding: 9px 10px; font-size: 11px; cursor: pointer; }
.proof-form input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 10.5px;
  cursor: pointer;
}

.proof-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.proof-preview img { width: 96px; height: 96px; object-fit: contain; border-radius: 3px; background: #000; }
.proof-preview .btn { margin-left: auto; }

.proof-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 3px;
}

.proof-amount { color: var(--white); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em; }

.history-list { display: flex; flex-direction: column; }

.proof-item { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.proof-item:last-child { border-bottom: 0; }
.proof-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.proof-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.proof-status.is-pending { border-color: var(--red-line); background: var(--red-soft); color: var(--red-bright); }
.proof-status.is-approved { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.05); color: var(--white); }
.proof-status.is-rejected { border-color: var(--line); background: var(--bg); color: var(--muted-2); }

.proof-top .proof-amount { font-size: 11.5px; }
.proof-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; color: var(--muted-2); font-size: 9.5px; }
.proof-ref { margin-top: 6px; color: var(--muted); font-size: 10px; }
.proof-ref code { color: var(--white); }
.proof-review { margin-top: 6px; padding: 7px 9px; border-left: 2px solid var(--red-line); background: var(--bg); color: var(--muted); font-size: 10px; line-height: 1.5; }
.proof-policy { margin-top: 7px; color: var(--muted-2); font-size: 9.5px; line-height: 1.5; }
.proof-purged {
  display: block;
  padding: 22px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.history-empty { display: flex; gap: 10px; padding: 16px 18px; color: var(--muted-2); }
.history-empty svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px; color: var(--red-bright); }
.history-empty p { font-size: 10.5px; line-height: 1.6; }

@media (max-width: 1180px) {
  .upgrade-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .upgrade-chip strong { display: none; }
}

@media (max-width: 980px) {
  .upgrade-grid { grid-template-columns: 1fr; }
  .upgrade-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .upgrade-help { grid-column: 1 / -1; }
  .pay-grid { grid-template-columns: 190px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .upgrade-status-inner { flex-wrap: wrap; }
  .upgrade-status-meta { padding-right: 0; border-right: 0; text-align: left; }
  .upgrade-status-inner > .btn { width: 100%; }
  .plan-head { flex-direction: column; gap: 12px; }
  .plan-price { text-align: left; }
  .plan-features { grid-template-columns: 1fr; }
  .plan-meta { grid-template-columns: 1fr; }
  .pay-grid { grid-template-columns: 1fr; }
  .payment-qr { max-width: 220px; }
  .upgrade-side { grid-template-columns: 1fr; }
  .proof-submit-row { flex-direction: column; align-items: stretch; }
  .proof-submit-row .btn { width: 100%; }
  .upgrade-chip { display: none; }
}

/* Two-stage flag panel for hosted and download labs. */
.flag-stages { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }

.flag-stage {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.flag-stage.is-done { border-color: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.03); }
.flag-stage.is-locked { opacity: 0.74; }

.stage-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

.stage-num {
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.stage-head strong { flex: 1; color: var(--white); font-size: 11.5px; }

.stage-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stage-state svg { width: 10px; height: 10px; }
.stage-state.is-done { color: var(--white); }
.stage-state.is-locked { color: var(--muted-2); }

.stage-note { display: flex; align-items: flex-start; gap: 6px; color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.stage-note svg { flex: 0 0 auto; width: 12px; height: 12px; margin-top: 1px; }
.stage-form .flag-input { min-height: 36px; }
.stage-form .btn { min-height: 36px; }

.flag-pair { display: inline-flex; gap: 9px; }
.flag-pair > span { display: inline-flex; align-items: center; gap: 3px; color: var(--muted-2); font-size: 9.5px; }
.flag-pair > span.is-done { color: var(--white); }
.flag-pair svg { width: 10px; height: 10px; }

/* Admin billing workspace: receipt review and voucher control. */
.admin-table .admin-flag-state { display: block; margin-top: 4px; }
.admin-status.is-muted { border-color: var(--line); color: var(--muted-2); }

.proof-table td { vertical-align: middle; }

.proof-thumb {
  display: grid;
  place-items: center;
  width: 58px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  cursor: pointer;
}

.proof-thumb:hover { border-color: var(--red-line); }
.proof-thumb span { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted-2); }
.proof-thumb span.is-missing { color: var(--red-bright); }
.proof-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.proof-thumb svg { width: 14px; height: 14px; }

.proof-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.proof-facts > div {
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--bg);
}

.proof-facts span {
  display: block;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.proof-facts strong {
  display: block;
  margin-top: 3px;
  color: var(--white);
  font-size: 11.5px;
  word-break: break-word;
}

.proof-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--red-line);
  background: var(--red-soft);
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.5;
}

.proof-shot {
  display: grid;
  place-items: center;
  min-height: 220px;
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #050507;
}

.proof-shot img { display: block; max-width: 100%; height: auto; }
.proof-shot > span { color: var(--muted-2); font-size: 11px; }
.proof-actions { flex-wrap: wrap; }

.voucher-list { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 18px; }

.voucher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.voucher-item.is-live { border-left: 2px solid var(--red-bright); }
.voucher-item.is-paused,
.voucher-item.is-expired,
.voucher-item.is-spent { opacity: 0.72; }

.voucher-main { flex: 1; min-width: 0; }
.voucher-code { display: flex; align-items: center; gap: 8px; }

.voucher-code code {
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.voucher-code .icon-btn { width: 26px; height: 26px; }

.voucher-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.voucher-bar {
  height: 2px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-soft);
}

.voucher-bar span { display: block; height: 100%; background: var(--red-bright); }
.voucher-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }

.voucher-created-code {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--red-line);
  border-radius: var(--radius);
  background: var(--red-soft);
}

.voucher-created-code code {
  flex: 1;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.05em;
}

.plan-admin-pay {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-admin-pay strong { color: var(--white); }
.flag-editor { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

@media (max-width: 760px) {
  .proof-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voucher-actions { margin-left: 0; }
}

/* Email verification status panel. */
.verify-state { margin-bottom: 18px; }
.verify-state .skel { border-radius: var(--radius); }
.verify-status {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.verify-status-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}
.verify-status.is-ok .verify-status-icon {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: var(--red-bright);
}
.verify-status.is-bad .verify-status-icon {
  border-color: var(--red-line);
  color: var(--red-bright);
}
.verify-status svg { width: 15px; height: 15px; }
.verify-status strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.verify-status p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }

/* ------------------------------------------------------- onboarding deck
   A sticky numbered index beside one large card. Cards are authored in the
   admin portal, so the layout has to cope with a short paragraph or a long
   ordered checklist equally well. */
.guide-layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.guide-index {
  position: sticky;
  top: calc(var(--topbar-h) + 18px);
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.guide-index ol { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.guide-index li { margin: 0; }

.guide-index button {
  display: flex;
  align-items: baseline;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}

.guide-index button:hover { background: var(--surface-2); color: var(--text); }

.guide-index button.is-active {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: var(--white);
}

.guide-index .n {
  flex: 0 0 18px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.guide-index button.is-active .n { color: var(--red-bright); }

.guide-index-note {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.5;
}

.guide-index-note svg { flex: 0 0 12px; width: 12px; height: 12px; margin-top: 2px; color: var(--red-bright); }

.guide-stage { min-width: 0; }

.guide-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.guide-card.is-text { grid-template-columns: minmax(0, 1fr); }

.guide-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  margin: 0;
  padding: 22px;
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(420px 240px at 50% 12%, rgba(229, 27, 35, 0.14), transparent 68%),
    linear-gradient(160deg, var(--surface-2), var(--bg-deep));
}

.guide-art img {
  width: 100%;
  height: 100%;
  max-height: 380px;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5));
}

.guide-copy {
  display: flex;
  flex-direction: column;
  padding: 26px 28px;
  min-width: 0;
}

.guide-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.guide-step::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--red-line);
}

.guide-copy h3 { margin-top: 9px; font-size: clamp(19px, 2vw, 24px); }

.guide-body {
  flex: 1;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.guide-body p + p { margin-top: 9px; }
.guide-body ul,
.guide-body ol { margin: 9px 0 0; padding-left: 18px; }
.guide-body li { margin: 4px 0; }
.guide-body li::marker { color: var(--red-bright); font-family: var(--font-mono); font-size: 0.86em; }
.guide-body strong { color: var(--white); }
.guide-body code { color: var(--text); }

.guide-cta { align-self: flex-start; margin-top: 20px; }

.guide-empty {
  display: grid;
  place-items: center;
  padding: 60px 26px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.guide-empty a { color: var(--red-bright); text-decoration: underline; text-underline-offset: 2px; }

.guide-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.guide-controls .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.guide-controls .btn-primary:disabled { opacity: 0.3; }

.guide-dots { display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; }

.guide-dot {
  width: 16px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--line);
  cursor: pointer;
  transition: background 140ms var(--ease), width 140ms var(--ease);
}

.guide-dot:hover { background: var(--muted-2); }
.guide-dot.is-active { width: 26px; background: var(--red-bright); }

.guide-hint { margin-top: 10px; }

@media (max-width: 980px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-index { position: static; }
  .guide-index ol { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .guide-index li { flex: 0 0 auto; }
  .guide-index button { width: auto; white-space: nowrap; }
  .guide-index li button > span:last-child { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 760px) {
  .guide-card { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .guide-art { min-height: 200px; padding: 18px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .guide-art img { max-height: 220px; }
  .guide-copy { padding: 22px 20px; }
  .guide-controls { flex-wrap: wrap; }
  .guide-dots { order: 3; width: 100%; }
}

/* Admin editor for the onboarding deck: one row per card, ordered. */
.guide-admin-list { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 18px; }

.guide-admin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.guide-admin-item.is-retired { opacity: 0.72; }

.guide-admin-order {
  flex: 0 0 26px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.guide-admin-thumb {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(160deg, var(--surface-2), var(--bg-deep));
  color: var(--muted-2);
}

.guide-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.guide-admin-thumb svg { width: 18px; height: 18px; }
.guide-admin-thumb.is-empty { border-style: dashed; }

.guide-admin-copy { flex: 1 1 220px; min-width: 0; }
.guide-admin-copy strong { display: block; color: var(--white); font-size: 12.5px; }

.guide-admin-body {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.guide-admin-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guide-admin-meta .mono { text-transform: none; letter-spacing: 0; }

.guide-admin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.guide-admin-actions .btn { min-height: 30px; padding: 0 9px; font-size: 10.5px; }
.guide-admin-actions .btn:disabled { opacity: 0.35; cursor: not-allowed; }

.onboarding-form textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  resize: vertical;
}

.onboarding-form textarea::placeholder { color: var(--muted-2); }

.onboarding-form textarea:focus {
  outline: 0;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 27, 35, 0.14);
}

.onboarding-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted-2);
  font-size: 10.5px;
}

.onboarding-preview .guide-admin-thumb { flex-basis: 64px; width: 64px; height: 64px; }

@media (max-width: 620px) {
  .guide-admin-item { align-items: flex-start; }
  .guide-admin-order { flex-basis: 18px; }
  .guide-admin-copy { flex-basis: 100%; order: 3; }
  .guide-admin-actions { width: 100%; justify-content: flex-start; margin-left: 0; }
}

/* ---------------------------------------------------- admin community cards */
.community-form { display: grid; gap: 18px; padding: 4px 18px 18px; }

.community-fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.community-fieldset legend {
  padding: 0 6px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.community-preview { display: grid; gap: 6px; }
.community-preview-label {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.community-preview-body .dash-help { cursor: default; }
.community-preview-body .dash-help:hover { border-color: var(--line-soft); }
.community-preview.has-broken-media .community-preview-label { color: var(--red-bright); }
.community-preview.has-broken-media .community-preview-label::after {
  content: " — image failed to load";
}

.community-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.community-actions .form-msg { margin: 0; }

@media (max-width: 620px) {
  .community-form { padding: 4px 14px 14px; }
  .community-fieldset { padding: 12px; }
  .community-actions .btn { width: 100%; justify-content: center; }
}
