/* Napalm Manager. Tokens follow design/reference.png. */

@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  /* Surfaces */
  --bg: #0b0b0d;
  --sidebar: #0e0e11;
  --card: #141417;
  --raised: #1b1b1f;
  --well: #0d0d10;
  --line: #26262b;
  --line-strong: #34343a;
  /* Text */
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #8b8b94;
  /* Flame */
  --flame: #f26a1b;
  --flame-hi: #ff7d33;
  --flame-ink: #1a0b03;
  --flame-tint: rgb(242 106 27 / 0.13);
  /* Signals */
  --ok: #22c55e;
  --ok-tint: rgb(34 197 94 / 0.12);
  --warn: #f5a524;
  --warn-tint: rgb(245 165 36 / 0.13);
  --bad: #f05252;
  --bad-tint: rgb(240 82 82 / 0.13);
  --info: #5b8def;
  --info-tint: rgb(91 141 239 / 0.15);
  --discord: #5865f2;

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r-card: 14px;
  --r-ctl: 10px;
  --r-sm: 7px;
  --sidebar-w: 282px;
  --pad: 28px;
  --gap: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow-pop: 0 18px 50px rgb(0 0 0 / 0.55), 0 2px 8px rgb(0 0 0 / 0.4);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.5 var(--font);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.22rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--flame-hi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
code, .mono { font-family: var(--mono); font-feature-settings: normal; font-variant-numeric: tabular-nums; }
code { font-size: 0.86em; }
button { font: inherit; color: inherit; }
[hidden], .is-hidden { display: none !important; }
::selection { background: rgb(242 106 27 / 0.35); }
:focus-visible { outline: 2px solid var(--flame); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--text-2); }
.small { font-size: 0.85rem; }
.bad { color: var(--bad); }
.center { text-align: center; }
.right { text-align: right; }

.icon { width: 18px; height: 18px; flex: none; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--flame); color: var(--flame-ink); padding: 8px 14px; border-radius: var(--r-ctl); font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- App shell ---------- */
body.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.content { flex: 1; padding: 6px var(--pad) var(--pad); display: grid; align-content: start; gap: var(--gap); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px 16px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  view-transition-name: sidebar;
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.icon-btn.sidebar__close, .icon-btn.topbar__menu, .scrim { display: none; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.logo { flex: none; filter: drop-shadow(0 0 14px rgb(242 106 27 / 0.35)); }
.logo__core { fill: var(--sidebar); }
.brand__word { display: grid; line-height: 1; }
.brand__name { font-size: 1.42rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; }
.brand__sub { margin-top: 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.42em; text-transform: uppercase; color: var(--text-2); }

.server-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.server-card:hover { text-decoration: none; border-color: var(--line-strong); background: var(--raised); }
.server-card__thumb { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; }
.server-card__text { display: grid; gap: 3px; min-width: 0; }
.server-card__name { font-size: 0.95rem; font-weight: 700; line-height: 1.25; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.server-card__chev { color: var(--text-2); }

.sidebar__label { margin: 0 0 8px; padding: 0 12px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 14px;
  border-radius: var(--r-ctl);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.nav__link .icon { width: 20px; height: 20px; color: var(--text-2); transition: color 0.15s; }
.nav__link:hover { background: var(--raised); text-decoration: none; }
.nav__link:hover .icon { color: var(--text); }
.nav__link.is-active { background: var(--flame-tint); color: var(--flame-hi); }
.nav__link.is-active .icon { color: var(--flame-hi); }
.nav__link.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--flame); }
.nav__badge {
  margin-left: auto;
  min-width: 26px;
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--raised);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sidebar__foot { margin-top: auto; display: grid; gap: 12px; }
.health {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}
.health:hover { text-decoration: none; border-color: var(--line-strong); }
.health .icon { margin-left: auto; width: 16px; height: 16px; color: var(--text-2); }

.me { position: relative; border-top: 1px solid var(--line); padding-top: 12px; }
.me__card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  list-style: none;
}
.me__card::-webkit-details-marker { display: none; }
.me__card:hover { background: var(--raised); }
.me__text { display: grid; min-width: 0; line-height: 1.3; }
.me__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me__text span { color: var(--text-2); font-size: 0.86rem; }
.me__chev { color: var(--text-2); transition: transform 0.15s; }
.me[open] .me__chev { transform: rotate(-90deg); }

/* ---------- Avatars ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--raised); flex: none; }
.me .avatar { width: 40px; height: 40px; }
.avatar--initials { display: inline-grid; place-items: center; font-size: 0.8rem; font-weight: 800; color: var(--text); background: linear-gradient(140deg, #3a2417, #1d1d22); border: 1px solid var(--line-strong); }
.avatar--40 { width: 40px; height: 40px; font-size: 0.85rem; }
.avatar--36 { width: 36px; height: 36px; }
.stack { display: flex; padding-left: 10px; }
.stack .avatar { width: 34px; height: 34px; margin-left: -10px; border: 2px solid var(--card); }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 16px var(--pad) 12px; }
.topbar__titles { min-width: 0; flex: 1; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 6px; padding: 0; font-size: 0.92rem; color: var(--text-2); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }
.page-title { font-size: clamp(1.6rem, 2.3vw, 2.05rem); font-weight: 800; letter-spacing: -0.02em; }
.topbar__tools { display: flex; align-items: center; gap: 12px; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--raised);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover { text-decoration: none; border-color: #46464e; background: #222227; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--flame); border-color: var(--flame); color: var(--flame-ink); box-shadow: 0 6px 22px rgb(242 106 27 / 0.28); }
.btn--primary:hover { background: var(--flame-hi); border-color: var(--flame-hi); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--raised); }
.btn--square { width: 48px; padding: 0; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 0.85rem; gap: 7px; }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--block { width: 100%; }
.btn--discord { width: 100%; min-height: 52px; background: var(--discord); border-color: var(--discord); color: #fff; font-size: 1rem; }
.btn--discord:hover { background: #4752e0; border-color: #4752e0; }
.btn--discord .icon { width: 22px; height: 22px; }
.btn.is-pending { position: relative; color: transparent; pointer-events: none; }
.btn.is-pending::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-color: var(--text) var(--text) transparent transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn--primary.is-pending::after { border-color: var(--flame-ink) var(--flame-ink) transparent transparent; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--raised); text-decoration: none; }
.console .icon-btn { width: 40px; height: 40px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  font-weight: 600;
  font-size: 0.92rem;
}
.chip .icon { width: 16px; height: 16px; }

/* Status pill (uppercase like the mockup's ONLINE) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 13px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill--ok { color: var(--ok); background: var(--ok-tint); border-color: rgb(34 197 94 / 0.45); }
.pill--warn { color: var(--warn); background: var(--warn-tint); border-color: rgb(245 165 36 / 0.45); }
.pill--bad { color: var(--bad); background: var(--bad-tint); border-color: rgb(240 82 82 / 0.45); }
.pill--idle { color: var(--text-2); background: var(--raised); border-color: var(--line-strong); }
.pill--ok::before { animation: beat 2.4s var(--ease) infinite; }
.card__head .pill { height: 28px; text-transform: none; letter-spacing: 0; font-size: 0.84rem; font-weight: 700; }

/* Dot + text in a signal colour */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; }
.dot-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dot-label--ok { color: var(--ok); }
.dot-label--warn { color: var(--warn); }
.dot-label--bad { color: var(--bad); }
.dot-label--idle { color: var(--text-2); }
.server-card .dot-label, .stat__sub.dot-label { color: var(--text-2); }
.server-card .dot-label--ok::before, .stat__sub.dot-label--ok::before { background: var(--ok); }
.server-card .dot-label--warn::before, .stat__sub.dot-label--warn::before { background: var(--warn); }
.server-card .dot-label--bad::before, .stat__sub.dot-label--bad::before { background: var(--bad); }
.server-card .dot-label--ok { color: var(--ok); }
.health--ok .dot, .conn--ok .dot { background: var(--ok); }
.health--warn .dot { background: var(--warn); }
.health--bad .dot, .conn--bad .dot { background: var(--bad); }
.health--ok .dot { animation: beat 2.4s var(--ease) infinite; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--raised);
  color: var(--text-2);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}
.tag--warn { background: var(--warn-tint); color: var(--warn); }
.tag--bad { background: var(--bad-tint); color: var(--bad); }

.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-2); }

/* ---------- Cards ---------- */
.card {
  min-width: 0;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card__icon { width: 22px; height: 22px; color: var(--flame-hi); }
.lede { color: var(--text-2); margin: -4px 0 18px; max-width: 72ch; }

/* ---------- Banners, empty states ---------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid;
  border-radius: 12px;
  font-weight: 600;
}
.banner .icon { margin-top: 2px; }
.banner ul { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }
.banner--ok { color: var(--text); border-color: rgb(34 197 94 / 0.35); background: var(--ok-tint); }
.banner--ok .icon { color: var(--ok); }
.banner--bad { color: var(--text); border-color: rgb(240 82 82 / 0.4); background: var(--bad-tint); }
.banner--bad .icon { color: var(--bad); }
.content > .banner { animation: drop 0.35s var(--ease) both; }

.empty { display: grid; justify-items: center; gap: 4px; padding: 6px 0 4px; text-align: center; color: var(--text-2); }
.empty img { width: 120px; height: 120px; }
.empty--big { padding: 24px 0; }
.empty--big img { width: 140px; height: 140px; }

/* ---------- Overview ---------- */
.overview {
  display: grid;
  gap: var(--gap);
  grid-template-columns: minmax(0, 1fr) 384px;
  grid-template-areas:
    "hero hero"
    "stats stats"
    "console side";
  align-items: start;
}
.hero { grid-area: hero; }
.stats { grid-area: stats; }
.overview > .console { grid-area: console; }
.side { grid-area: side; display: grid; gap: var(--gap); }
.side .card { padding: 16px 22px; }
.side .card__head { margin-bottom: 10px; }
.side .facts { margin-bottom: 12px; }
.side .roster__row { padding: 5px 0; }
.side .roster .avatar { width: 34px; height: 34px; }
.side .btn--block { min-height: 40px; }

.hero {
  position: relative;
  min-height: 258px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
  isolation: isolate;
}
.hero__art { position: absolute; inset: 0 0 0 auto; width: 70%; z-index: -1; overflow: hidden; border-radius: 0 calc(var(--r-card) - 1px) calc(var(--r-card) - 1px) 0; }
.hero__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 46%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgb(0 0 0 / 0.55) 18%, #000 42%);
  mask-image: linear-gradient(90deg, transparent 0%, rgb(0 0 0 / 0.55) 18%, #000 42%);
  animation: art-in 1.1s var(--ease) both;
}
.hero__body { position: relative; display: grid; align-content: center; gap: 11px; min-height: 258px; max-width: 640px; padding: 24px 32px; }
.hero__eyebrow { display: flex; align-items: center; gap: 16px; }
.hero__name { font-size: clamp(2rem, 3.2vw, 2.6rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.08; overflow-wrap: anywhere; }
.hero__job { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 1.05rem; min-height: 1.6em; }
.hero__job strong { color: var(--text); }
.hero__job.is-running { color: var(--text); }
.hero__job.is-failed { color: var(--bad); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 2px 0 0; padding: 0; color: var(--text-2); font-size: 1rem; }
.hero__meta li { display: inline-flex; align-items: center; gap: 9px; padding-right: 18px; }
.hero__meta li + li { padding-left: 18px; border-left: 1px solid var(--line-strong); }
.hero__meta strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero__meta .icon { width: 20px; height: 20px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero__actions .action { margin: 0; }
.hero__actions .btn { min-height: 50px; }

/* Overflow menu */
.more, .me { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.menu__panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  min-width: 270px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--raised);
  box-shadow: var(--shadow-pop);
  animation: pop 0.14s var(--ease) both;
}
.menu__panel--up { top: auto; bottom: calc(100% + 8px); left: 0; right: 0; min-width: 0; }
.menu__panel form { margin: 0; }
.menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}
.menu__item:hover:not(:disabled) { background: #26262c; }
.menu__item:disabled { opacity: 0.45; cursor: not-allowed; }
.menu__item--danger, .menu__item--danger .icon { color: var(--bad); }
.menu__text { display: grid; line-height: 1.3; }
.menu__text small { color: var(--text-2); font-weight: 500; font-size: 0.8rem; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.stat {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 16px;
  align-content: start;
  padding: 17px 22px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
  min-width: 0;
}
.stat__head { display: contents; }
.stat__head .icon { grid-row: 1 / span 3; width: 28px; height: 28px; color: var(--text-2); }
.stat__head h3 { font-size: 1rem; font-weight: 600; color: var(--text); }
.stat > :not(.stat__head) { grid-column: 2; }
.stat__value { margin-top: 8px; font-size: 1.95rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__value.mono { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
.stat__of { color: var(--text); }
.stat__sub { margin-top: 8px; color: var(--text-2); font-size: 0.9rem; }
.stat__sub .mono { color: var(--text); }
.stat__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meter { margin-top: 12px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter__fill { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--ok); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 0.8s var(--ease); }

/* Live dot used by the console */
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; font-weight: 600; color: var(--text-2); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.live[data-state="live"] { color: var(--ok); }
.live[data-state="live"]::before { background: var(--ok); animation: beat 2.4s var(--ease) infinite; }
.live[data-state="error"] { color: var(--warn); }
.live[data-state="error"]::before { background: var(--warn); }

/* ---------- Console ---------- */
.console { display: flex; flex-direction: column; padding: 18px 22px 14px; }
.console__head { margin-bottom: 12px; }
.console__tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--well);
  transition: background 0.12s, border-color 0.12s;
  flex: none;
}
.check__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 10px;
  border: solid var(--flame-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.12s var(--ease);
}
.check input:checked + .check__box { background: var(--flame); border-color: var(--flame); }
.check input:checked + .check__box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--flame); outline-offset: 2px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--well);
  color: var(--text-2);
  transition: border-color 0.15s;
}
.search:focus-within { border-color: var(--flame); }
.search input { width: 150px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.92rem; outline: none; padding: 0; }
.search input::placeholder { color: var(--text-3); }

.tabs { display: inline-flex; align-self: flex-start; margin-bottom: 10px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); overflow: hidden; }
.tab {
  min-width: 66px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab:last-child { border-right: 0; }
.tab:hover { color: var(--text); background: var(--raised); }
.tab[aria-pressed="true"] { background: var(--flame); color: var(--flame-ink); }

.log {
  height: 236px;
  overflow: auto;
  padding: 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--well);
  font: 400 13.5px/1.9 var(--mono);
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}
.log:focus-visible { outline-offset: -2px; }
.line { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 0 16px; }
.line__time { display: none; }
.log.has-time .line { grid-template-columns: 74px 58px minmax(0, 1fr); }
.log.has-time .line__time { display: block; }
.line:hover { background: rgb(255 255 255 / 0.03); }
.line__time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.line__msg { color: #d6d6db; white-space: pre-wrap; overflow-wrap: anywhere; }
.line__tag {
  justify-self: start;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.75;
  letter-spacing: 0.04em;
}
.lt-info { background: var(--info-tint); color: #8fb3ff; }
.lt-join { background: var(--ok-tint); color: #4ade80; }
.lt-leave { background: var(--raised); color: var(--text-2); }
.lt-save { background: var(--flame-tint); color: var(--flame-hi); }
.lt-warn { background: var(--warn-tint); color: var(--warn); }
.lt-error { background: var(--bad-tint); color: #ff7b7b; }
.line--warn .line__msg { color: #f6d28f; }
.line--error .line__msg { color: #ffb0ae; }
.line--note .line__msg { color: var(--text-2); font-style: italic; }
.line.is-new { animation: flash-line 1.6s ease-out; }
.log__empty { padding: 28px 16px; text-align: center; color: var(--text-3); font-family: var(--font); }
.log__skeleton { display: grid; gap: 14px; padding: 8px 16px; }
.log__skeleton span { height: 11px; border-radius: 6px; background: linear-gradient(90deg, var(--raised) 0%, #24242a 50%, var(--raised) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.log__skeleton span:nth-child(2) { width: 72%; }
.log__skeleton span:nth-child(3) { width: 86%; }
.log__skeleton span:nth-child(4) { width: 54%; }

.console__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--text-2); font-size: 0.88rem; font-weight: 600; }
.console__stream { display: inline-flex; align-items: center; gap: 8px; }
.console__stream.is-live .dot { background: var(--ok); }
.console__stream.is-error .dot { background: var(--warn); }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.console--full { height: calc(100vh - 210px); min-height: 420px; }
.console--full .log { flex: 1; height: auto; }

/* Switch */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch__track { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background 0.18s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.18s var(--ease); }
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--flame); outline-offset: 2px; }
.settings .switch input:checked + .switch__track { background: var(--flame); }

/* ---------- Roster, facts ---------- */
.roster { list-style: none; margin: 0; padding: 0; }
.roster__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 6px 0; border-top: 1px solid var(--line); }
.roster__row:first-child { border-top: 0; padding-top: 0; }
.roster__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster__time { color: var(--text); font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.roster--big .avatar { width: 48px; height: 48px; }
.roster--big .roster__row { padding: 12px 0; }
.roster__row.is-new { animation: drop 0.4s var(--ease) both; }

.facts { margin: 0 0 16px; display: grid; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.facts div:first-child { padding-top: 0; }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.players-page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -24px -22px; padding: 0 24px 6px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th { font-size: 0.82rem; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: rgb(255 255 255 / 0.02); }
.table td.center, .table th.center { text-align: center; }
.table td.right, .table th.right { text-align: right; }
.file { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file .icon { color: var(--text-2); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.new-row input[type="text"] { border-style: dashed; }

/* ---------- Forms ---------- */
input[type="text"], input[type="number"], input[type="password"], select {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--well);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus, select:focus { outline: none; border-color: var(--flame); box-shadow: 0 0 0 3px var(--flame-tint); }
input:user-invalid { border-color: var(--bad); }
select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="checkbox"] { accent-color: var(--flame); width: 17px; height: 17px; }
.narrow { width: 5.5rem; }

.settings, .roles { padding-bottom: 0; }
fieldset { margin: 0 0 18px; padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 12px; background: rgb(255 255 255 / 0.012); }
legend { padding: 0 8px; font-weight: 700; font-size: 0.95rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px 22px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field--inline { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.field--inline .field__help { flex-basis: 100%; }
.field__help { color: var(--text-2); font-size: 0.84rem; }
.range { display: flex; align-items: center; gap: 10px; }
.range input[type="range"] { flex: 1; min-width: 0; accent-color: var(--flame); }
.range input[type="number"] { width: 6rem; }
.range__unit { color: var(--text-2); }
.custom { animation: drop 0.3s var(--ease) both; }
.save-row {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 -24px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-card) var(--r-card);
  background: rgb(20 20 23 / 0.92);
  backdrop-filter: blur(8px);
}
.secret { display: flex; gap: 6px; }
.secret input { width: 9rem; }
.roles .table th { white-space: normal; font-size: 0.78rem; }
.roles .table td { padding: 8px 6px; }
.roles input[type="text"] { width: 9.5rem; }

/* ---------- Activity ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.timeline__item:first-child { border-top: 0; padding-top: 0; }
.timeline__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.timeline__head span { color: var(--text-2); }
.timeline__detail { margin-top: 3px; color: var(--text-2); font-size: 0.9rem; overflow-wrap: anywhere; }
.timeline__time { color: var(--text-3); font-size: 0.85rem; white-space: nowrap; }
.timeline__item.is-failed .avatar { border-color: var(--bad); }

/* ---------- Bell popover ---------- */
.bell { position: relative; }
.bell__dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border: 2px solid var(--bg); border-radius: 50%; background: var(--flame); }
.popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--raised);
  box-shadow: var(--shadow-pop);
  animation: pop 0.14s var(--ease) both;
}
.popover__head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.feed { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.feed li { display: grid; gap: 2px; padding: 9px 10px; border-radius: 8px; font-size: 0.9rem; }
.feed li:hover { background: #24242a; }
.feed__meta { color: var(--text-3); font-size: 0.8rem; }
.feed .is-failed strong { color: var(--bad); }
.feed__empty { color: var(--text-2); }

/* ---------- Status bar ---------- */
.statusbar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px var(--pad);
  border-top: 1px solid var(--line);
  background: rgb(11 11 13 / 0.9);
  backdrop-filter: blur(8px);
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 600;
}
.conn { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Toasts and modal ---------- */
.toasts { position: fixed; right: 20px; bottom: 56px; z-index: 60; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--raised);
  box-shadow: var(--shadow-pop);
  font-weight: 600;
  animation: toast-in 0.25s var(--ease) both;
}
.toast .icon { color: var(--ok); margin-top: 2px; }
.toast--bad .icon { color: var(--bad); }
.toast.is-leaving { animation: toast-out 0.2s ease-in both; }

.modal {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}
.modal[open] { animation: modal-in 0.18s var(--ease) both; }
.modal::backdrop { background: rgb(5 5 7 / 0.66); backdrop-filter: blur(3px); }
.modal__body { display: grid; gap: 12px; padding: 24px; }
.modal__body h2 { font-size: 1.25rem; }
.modal__body p { color: var(--text-2); }
.modal__warn { display: flex; gap: 10px; padding: 11px 13px; border-radius: 10px; background: var(--warn-tint); color: var(--warn) !important; font-weight: 600; }
.modal__typed { display: grid; gap: 7px; font-weight: 600; font-size: 0.92rem; }
.modal__typed input { width: 100%; font-family: var(--mono); letter-spacing: 0.08em; }
.modal__actions { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 10px; margin-top: 6px; }
.modal.is-danger [data-modal-ok] { background: var(--bad); border-color: var(--bad); color: #fff; box-shadow: none; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--flame); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; }

/* ---------- Error / notice card ---------- */
.notice { display: grid; justify-items: center; gap: 12px; max-width: 520px; margin: 24px auto; padding: 32px; text-align: center; }
.notice__art { width: 150px; height: 150px; }
.notice p { color: var(--text-2); }
.notice .btn { margin-top: 8px; }

/* ---------- Sign-in (no shell) ---------- */
body.bare { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; overflow-x: hidden; }
.bare__art { position: fixed; inset: 0; z-index: 0; }
.bare__art img { width: 100%; height: 100%; object-fit: cover; animation: art-in 1.4s var(--ease) both; }
.bare__art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgb(11 11 13 / 0.15) 0%, rgb(11 11 13 / 0.5) 70%, rgb(11 11 13 / 0.85) 100%); }
.bare__main { position: relative; z-index: 1; width: 100%; display: grid; justify-items: center; gap: 18px; }
.bare__brand { display: grid; place-items: center; }
.signin {
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  padding: 34px 32px 28px;
  border: 1px solid rgb(255 255 255 / 0.09);
  border-radius: 20px;
  background: rgb(20 20 23 / 0.82);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-pop);
  text-align: center;
  animation: rise 0.6s 0.15s var(--ease) both;
}
.signin__brand { display: grid; justify-items: center; gap: 12px; margin-bottom: 6px; }
.signin__brand .logo__core { fill: #17171a; }
.signin__word { display: grid; line-height: 1; }
.signin h1 { font-size: 1.45rem; font-weight: 800; }
.signin__lede { color: var(--text-2); margin-bottom: 8px; }
.signin__note { color: var(--text-3); font-size: 0.85rem; }
.signin__dev { color: var(--text-2); font-size: 0.85rem; }
.signin .banner { text-align: left; }
.notice--bare { margin: 0; background: rgb(20 20 23 / 0.85); backdrop-filter: blur(14px); }

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
  .overview { grid-template-columns: minmax(0, 1fr) 340px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .overview { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "stats" "console" "side"; }
  .side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .players-page { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  :root { --pad: 20px; }
  body.app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(var(--sidebar-w), 86vw);
    transform: translateX(-102%);
    transition: transform 0.25s var(--ease);
    box-shadow: var(--shadow-pop);
  }
  .sidebar:target, .nav-open .sidebar { transform: none; }
  .icon-btn.sidebar__close, .icon-btn.topbar__menu { display: inline-grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgb(5 5 7 / 0.6); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .sidebar:target ~ .scrim, .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding-top: 16px; }
}
@media (max-width: 760px) {
  :root { --pad: 16px; --gap: 14px; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar__titles { order: 2; flex-basis: 100%; }
  .topbar__tools { margin-left: auto; gap: 8px; }
  .topbar__settings span, .chip { display: none; }
  .topbar__settings { width: 44px; padding: 0; }
  .side { grid-template-columns: minmax(0, 1fr); }
  .hero { min-height: 0; }
  .hero__art { position: relative; inset: auto; width: 100%; height: 150px; z-index: 0; border-radius: calc(var(--r-card) - 1px) calc(var(--r-card) - 1px) 0 0; }
  .hero__art img { object-position: 80% 45%; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }
  .hero__body { min-height: 0; margin-top: -34px; padding: 0 18px 20px; }
  .hero__name { font-size: 1.9rem; }
  .hero__actions { gap: 8px; }
  .hero__actions .btn { min-height: 46px; padding: 0 11px; gap: 7px; font-size: 0.9rem; }
  .hero__actions .btn--square { width: 46px; padding: 0; }
  .hero__actions .action:first-child { flex-basis: 100%; }
  .hero__actions .action:first-child .btn { width: 100%; }
  .card { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px -18px; padding: 0 16px 6px; }
  .save-row { margin: 0 -16px; padding: 14px 16px; }
  .console { padding: 16px 14px 12px; }
  .console__tools { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .line, .log.has-time .line { display: block; padding: 3px 12px; }
  .log.has-time .line__time { display: inline; margin-right: 8px; }
  .line__tag { display: inline-block; margin-right: 8px; }
  .log { height: 300px; }
  .log { font-size: 12.5px; line-height: 1.6; }
  .statusbar { font-size: 0.78rem; }
  .timeline__item { grid-template-columns: 36px minmax(0, 1fr); }
  .timeline__time { grid-column: 2; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat { padding: 18px; }
}

/* ---------- Motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0.55); } 70% { box-shadow: 0 0 0 7px rgb(34 197 94 / 0); } 100% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0); } }
@keyframes art-in { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes flash-line { from { background: rgb(242 106 27 / 0.1); } to { background: transparent; } }
@keyframes bump { 0% { color: var(--flame-hi); transform: translateY(-2px); } 100% { color: inherit; transform: none; } }
.bump { display: inline-block; animation: bump 0.6s var(--ease); }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.16s; }

@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; }
  @view-transition { navigation: none; }
}
