/* ============================================================================
   Hytale Workshop — Mods console design system
   "Dark gamer console": slate surface ladder, single teal accent, monospace logs.
   Token-driven (semantic vars, surface hierarchy, scales) — mirrors the rigor of the
   reference dashboard, in this site's own palette. One file, no build step.
   ============================================================================ */

/* ── Self-hosted fonts (graceful: system fallbacks if a woff2 is missing) ──── */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/InterVariable.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/JetBrainsMono.woff2") format("woff2");
}

/* ── Tokens ────────────────────────────────────────────────────────────────── */
:root {
  /* Surface ladder — each step clearly distinguishable (bg < surface < card < raised). */
  --bg:        #0f1115;
  --surface:   #14161b;
  --card:      #1a1d24;
  --raised:    #21252e;   /* popovers, modals, hover wells */
  --line:      #2a2f3a;
  --line-soft: #20242c;
  --line-strong: #3a4250;

  /* Text */
  --fg:    #e7ebf0;
  --muted: #9aa4b2;
  --faint: #6b7480;

  /* Brand — teal */
  --accent:       #2dd4bf;
  --accent-hover: #5eead4;
  --accent-press: #14b8a6;
  --accent-wash:  rgba(45, 212, 191, .12);
  --accent-line:  rgba(45, 212, 191, .35);
  --on-accent:    #04201c;   /* dark ink reads better on a light-teal fill */

  /* Functional */
  --ok:   #3fb950;  --ok-wash:   rgba(63, 185, 80, .12);
  --warn: #e3b341;  --warn-wash: rgba(227, 179, 65, .12);
  --err:  #f85149;  --err-wash:  rgba(248, 81, 73, .12);
  --info: #58a6ff;  --info-wash: rgba(88, 166, 255, .12);

  /* Type */
  --font-ui:   "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;

  /* Radii */
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-pill: 999px;

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(0,0,0,.3);
  --shadow-2: 0 4px 16px rgba(0,0,0,.35);
  --shadow-3: 0 16px 48px rgba(0,0,0,.5);

  /* Motion */
  --t:  150ms cubic-bezier(.4, 0, .2, 1);
  --t-slow: 280ms cubic-bezier(.4, 0, .2, 1);

  /* Focus ring */
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-line);
}

/* ── Reset / base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
/* The UA `[hidden]{display:none}` rule is low-priority, so an author `display` on an id/class
   (e.g. #drop-overlay, .vote-banner, .empty) would otherwise beat it and the element would show
   even when the `hidden` attribute is set. Make `hidden` authoritative everywhere. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(45,212,191,.05), transparent 60%),
    var(--bg);
  color: var(--fg);
  font: 400 15px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0 0 .25rem; }
h3 { font-size: .95rem; margin: 0; }
code, kbd, .mono { font-family: var(--font-mono); }
.icon { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.125em; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
code {
  background: var(--surface); border: 1px solid var(--line-soft);
  padding: 1px 5px; border-radius: var(--r-sm); font-size: .85em;
}
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
::selection { background: var(--accent-wash); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #49526380; }

/* ── Header / nav ──────────────────────────────────────────────────────────── */
header.site {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.25rem;
  padding: .65rem 1.25rem;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 750; letter-spacing: -.02em; color: var(--fg); font-size: 1rem;
}
.brand .mark {
  display: grid; place-items: center; width: 26px; height: 26px;
  background: linear-gradient(145deg, var(--accent), var(--accent-press));
  color: var(--on-accent); border-radius: 7px; font-size: 15px; font-weight: 800;
  box-shadow: 0 0 0 1px var(--accent-line), 0 2px 8px rgba(45,212,191,.25);
}
header.site nav { display: flex; gap: .15rem; margin-left: .5rem; }
header.site nav a {
  position: relative; color: var(--muted); font-weight: 500; font-size: .9rem;
  padding: .4rem .7rem; border-radius: var(--r-sm); transition: color var(--t), background var(--t);
}
header.site nav a:hover { color: var(--fg); background: var(--accent-wash); }
header.site nav a.active { color: var(--fg); }
header.site nav a.active::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: -.66rem; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.header-right { margin-left: auto; display: flex; align-items: center; gap: .85rem; }

/* User chip */
.user-chip { display: inline-flex; align-items: center; gap: .5rem; }
.user-chip img, .avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line-strong); background: var(--raised);
}
.avatar.fallback { display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.user-chip .uname { font-size: .85rem; font-weight: 550; color: var(--fg); }

/* ── Layout ────────────────────────────────────────────────────────────────── */
main { max-width: 1040px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-head .sub { color: var(--muted); font-size: .9rem; }
.section { margin-top: 1.75rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: .6rem; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tiny { font-size: .8rem; }
.wrap { flex-wrap: wrap; }

/* ── Cards / panels ────────────────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--card) 92%, #000));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow-1);
}
.card h3 { margin-bottom: .15rem; }
.card .hint { display: block; color: var(--muted); margin-top: .55rem; font-size: .82rem; line-height: 1.5; }
.panel-title { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: .95rem; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  --btn-bg: var(--raised); --btn-fg: var(--fg); --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: 550 .88rem/1 var(--font-ui); white-space: nowrap; cursor: pointer; user-select: none;
  padding: .58rem .9rem; border-radius: var(--r); border: 1px solid var(--btn-line);
  background: var(--btn-bg); color: var(--btn-fg);
  transition: background var(--t), border-color var(--t), transform var(--t), box-shadow var(--t), color var(--t);
}
.btn:hover { background: color-mix(in srgb, var(--btn-bg) 80%, #fff); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-line: transparent;
  font-weight: 650; box-shadow: 0 2px 10px rgba(45,212,191,.22);
}
.btn-primary:hover { --btn-bg: var(--accent-hover); }
.btn-secondary { --btn-bg: var(--surface); }
.btn-secondary:hover { background: var(--raised); border-color: var(--accent-line); }
.btn-ghost { --btn-bg: transparent; --btn-line: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--accent-wash); color: var(--fg); }
.btn-danger { --btn-bg: transparent; --btn-fg: var(--err); --btn-line: color-mix(in srgb, var(--err) 45%, transparent); }
.btn-danger:hover { background: var(--err-wash); border-color: var(--err); }
.btn-sm { padding: .38rem .6rem; font-size: .82rem; border-radius: var(--r-sm); }
.btn-icon { padding: .45rem; width: 34px; height: 34px; }
.btn-block { width: 100%; }

/* ── Inputs ────────────────────────────────────────────────────────────────── */
.input, input[type=text], input[type=search], input[list], select {
  width: 100%; padding: .55rem .7rem; font: 400 .9rem var(--font-ui);
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.input:focus, input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
input::placeholder { color: var(--faint); }
.field-icon { position: relative; }
.field-icon svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.field-icon input { padding-left: 2.1rem; }
label.lbl { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .35rem; font-weight: 550; }

/* ── Badges / pills ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .12rem .5rem; border-radius: var(--r-pill); font-size: .72rem; font-weight: 600;
  letter-spacing: .02em; border: 1px solid var(--line-strong); color: var(--muted);
  background: var(--surface); white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-code  { color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, transparent); background: var(--info-wash); }
.badge-asset { color: #c08cff; border-color: rgba(192,140,255,.35); background: rgba(192,140,255,.1); }
.badge-live     { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 40%, transparent);   background: var(--ok-wash); }
.badge-reverted { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-wash); }
.badge-error    { color: var(--err);  border-color: color-mix(in srgb, var(--err) 40%, transparent);  background: var(--err-wash); }
.badge-queued   { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); background: var(--info-wash); }
.badge-unknown  { color: var(--faint); }
.badge-mine { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }

/* Status dot with live pulse */
.dot-lg { display: inline-block; width: 9px; height: 9px; border-radius: 50%; position: relative; flex: none; }
.dot-lg.up { background: var(--ok); }
.dot-lg.up::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--ok); animation: pulse 2s ease-out infinite;
}
.dot-lg.down { background: var(--faint); }
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dot-lg.up::after { animation: none; } }

/* ── Status strip ──────────────────────────────────────────────────────────── */
.statusbar {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  padding: .7rem 1rem; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); font-size: .9rem;
}
.statusbar .sep { width: 1px; height: 16px; background: var(--line-strong); }
.statusbar b { font-weight: 650; }

/* ── Dropzone ──────────────────────────────────────────────────────────────── */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; text-align: center; padding: 1.5rem 1rem; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r); background: var(--bg);
  color: var(--muted); transition: border-color var(--t), background var(--t), color var(--t);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-wash); color: var(--fg); }
.dropzone.dragover { box-shadow: inset 0 0 0 1px var(--accent-line); }
.dropzone svg { width: 26px; height: 26px; color: var(--accent); }
.dropzone .dz-main { font-weight: 600; color: var(--fg); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-file {
  display: none; align-items: center; gap: .5rem; margin-top: .6rem; padding: .45rem .65rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: .85rem;
}
.dz-file.show { display: flex; }
.dz-file .name { font-family: var(--font-mono); color: var(--fg); }

/* ── Segmented control / chips ─────────────────────────────────────────────── */
.segmented { display: inline-flex; padding: 2px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r); gap: 2px; }
.segmented .seg {
  padding: .3rem .6rem; font-size: .8rem; font-weight: 550; color: var(--muted);
  border-radius: var(--r-sm); cursor: pointer; user-select: none; transition: background var(--t), color var(--t);
  border: none; background: transparent;
}
.segmented .seg:hover { color: var(--fg); }
.segmented .seg.on { background: var(--accent-wash); color: var(--accent); }
.segmented .seg.on[data-level="WARN"] { background: var(--warn-wash); color: var(--warn); }
.segmented .seg.on[data-level="SEVERE"] { background: var(--err-wash); color: var(--err); }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .55rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  font-size: .78rem; color: var(--muted); cursor: pointer; transition: all var(--t); user-select: none;
}
.chip:hover { border-color: var(--accent-line); color: var(--fg); }
.chip.on { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent); }
.chip .x { opacity: .6; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  text-align: left; padding: .6rem .9rem; color: var(--muted); font-weight: 600; font-size: .78rem;
  letter-spacing: .03em; text-transform: uppercase; background: var(--surface);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--fg); }
th.sortable .arrow { opacity: 0; margin-left: .2rem; font-size: .7rem; }
th.sortable.asc .arrow, th.sortable.desc .arrow { opacity: 1; }
th.sortable.desc .arrow { display: inline-block; transform: rotate(180deg); }
tbody td { padding: .7rem .9rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
tr.row-reverted { background: var(--warn-wash); }
tr.row-error    { background: var(--err-wash); }
.cell-main { font-weight: 600; color: var(--fg); }
.cell-sub { color: var(--faint); font-size: .78rem; font-family: var(--font-mono); }
td.right, th.right { text-align: right; }
.ver { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }

details.detail > summary {
  cursor: pointer; color: var(--muted); font-size: .8rem; list-style: none;
}
details.detail > summary::-webkit-details-marker { display: none; }
details.detail > summary::before { content: "▸ "; color: var(--faint); }
details.detail[open] > summary::before { content: "▾ "; }
details.detail pre { margin-top: .5rem; }

/* ── Pre / logs ────────────────────────────────────────────────────────────── */
pre {
  white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: .7rem .8rem;
  border-radius: var(--r-sm); border: 1px solid var(--line); font-family: var(--font-mono);
  font-size: .8rem; line-height: 1.5; max-height: 280px; overflow: auto; color: var(--muted);
}

/* ── Flash (no-JS fallback) + Toasts ──────────────────────────────────────── */
.flash { padding: .7rem .95rem; border-radius: var(--r); margin: .6rem 0; border: 1px solid var(--line); background: var(--surface); font-size: .9rem; }
.flash.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-wash); }
.flash.error, .flash.err { border-color: color-mix(in srgb, var(--err) 40%, transparent); background: var(--err-wash); }
.flash.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-wash); }
.js .flash[data-toasted] { display: none; }

#toasts { position: fixed; top: .9rem; right: .9rem; z-index: 100; display: flex; flex-direction: column; gap: .55rem; max-width: min(380px, 92vw); }
.toast {
  display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .85rem;
  background: var(--raised); border: 1px solid var(--line-strong); border-left-width: 3px;
  border-radius: var(--r); box-shadow: var(--shadow-2); font-size: .88rem;
  animation: toast-in var(--t-slow) both;
}
.toast.leaving { animation: toast-out var(--t) forwards; }
.toast.ok    { border-left-color: var(--ok); }
.toast.error, .toast.err { border-left-color: var(--err); }
.toast.warn  { border-left-color: var(--warn); }
.toast .ti { flex: none; margin-top: 1px; }
.toast.ok .ti { color: var(--ok); } .toast.error .ti, .toast.err .ti { color: var(--err); } .toast.warn .ti { color: var(--warn); }
.toast .tx { flex: 1; line-height: 1.45; }
.toast .tc { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0 .1rem; }
.toast .tc:hover { color: var(--fg); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* ── Vote banner ───────────────────────────────────────────────────────────── */
.vote-banner {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .9rem 1.1rem; border-radius: var(--r-lg); border: 1px solid var(--accent-line);
  background: linear-gradient(120deg, var(--accent-wash), transparent 70%), var(--card);
  box-shadow: var(--shadow-1);
}
.vote-banner .vb-icon { color: var(--accent); }
.vote-banner .vb-body { flex: 1; min-width: 200px; }
.vote-banner .vb-title { font-weight: 650; }
.vote-tally { display: flex; gap: .5rem; align-items: center; font-family: var(--font-mono); font-size: .85rem; }
.vote-tally .yes { color: var(--ok); } .vote-tally .no { color: var(--err); }
.countdown { font-family: var(--font-mono); font-weight: 650; color: var(--accent); }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center;
  padding: 2.5rem 1rem; color: var(--muted);
}
.empty svg { width: 34px; height: 34px; color: var(--line-strong); }
.empty .et { font-weight: 600; color: var(--fg); }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: rgba(6, 8, 12, .6); backdrop-filter: blur(3px); padding: 1rem;
  animation: fade var(--t) both;
}
.modal {
  width: min(440px, 100%); background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 1.25rem; animation: pop var(--t-slow) both;
}
.modal h3 { margin-bottom: .5rem; }
.modal p { color: var(--muted); font-size: .9rem; margin: 0 0 1.1rem; }
.modal .actions { display: flex; justify-content: flex-end; gap: .55rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ── Full-page drop overlay ────────────────────────────────────────────────── */
#drop-overlay {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(4px);
  animation: fade var(--t) both; padding: 2rem;
}
#drop-overlay .drop-inner {
  display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center;
  width: min(560px, 90%); padding: 3rem 2rem; pointer-events: none;
  border: 2px dashed var(--accent); border-radius: var(--r-lg); background: var(--accent-wash);
}
#drop-overlay .drop-inner svg { width: 42px; height: 42px; color: var(--accent); }
#drop-overlay .drop-title { font-size: 1.2rem; font-weight: 650; color: var(--fg); }

.btn.pulse { animation: pulse-btn 1.6s ease-out 2; }
@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 2px 10px rgba(45,212,191,.22); }
  50% { box-shadow: 0 0 0 4px var(--accent-wash), 0 2px 16px rgba(45,212,191,.5); }
}

/* ── Grids ─────────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 160px; }

/* ── Console ───────────────────────────────────────────────────────────────── */
/* The console page fills the whole viewport with a flex column (no magic-number heights):
   body -> header (fixed) + main (grows); main -> title + description + shell (grows);
   shell -> bar + meta (fixed) + log (grows). So the log is always as tall as possible. */
body.console-page { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.console-page header.site { flex: 0 0 auto; }
body.console-page main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  padding-top: 1.1rem; padding-bottom: 1.1rem; }
body.console-page .console-shell { flex: 1 1 auto; min-height: 0; }

.console-shell { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg); display: flex; flex-direction: column; }
.console-shell .console-bar, .console-shell .console-meta { flex: 0 0 auto; }
.console-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .6rem .8rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.console-bar .conn { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); margin-left: auto; }
.console-bar .conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.console-bar .conn.live .dot { background: var(--ok); }
.console-bar .conn.dead .dot { background: var(--err); }
.console-meta { display: flex; gap: .8rem; align-items: center; padding: .35rem .8rem; font-size: .76rem; color: var(--faint); border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.console-out {
  /* Grows to fill the shell (which fills the viewport); font size is Ctrl+scroll zoomable.
     NOTE: this is a <pre>, so it inherits the generic `pre { max-height: 280px }` rule — that
     cap is what kept the log short with dead space below. Neutralise it here. */
  flex: 1 1 auto; min-height: 0; max-height: none; border: 0; border-radius: 0;
  overflow: auto; padding: .5rem .2rem; margin: 0;
  background: var(--bg); font-family: var(--font-mono); font-size: var(--log-fs, 12.5px); line-height: 1.5;
  /* Bottom-anchor like a real terminal: lines stick to the bottom edge, so when there are fewer
     lines than the box is tall the empty space sits ABOVE (not a gap below). The ::before's
     margin-top:auto soaks up the spare space and collapses once content overflows, so scrolling
     still reaches the first line. */
  display: flex; flex-direction: column;
}
.console-out::before { content: ""; margin-top: auto; flex: 0 0 auto; }
/* Fullscreen: the shell covers the window; the flex chain already gives the log all the space. */
.console-shell.fs { position: fixed; inset: 0; z-index: 80; border-radius: 0; box-shadow: none; }
.console-out .ln { padding: 0 .8rem; white-space: pre-wrap; word-break: break-word; border-left: 2px solid transparent; }
.console-out .ln:hover { background: rgba(255,255,255,.02); }
.console-out .ln.lvl-SEVERE { color: #ffb4ad; border-left-color: var(--err); background: var(--err-wash); }
.console-out .ln.lvl-WARN { color: #f0d28a; border-left-color: var(--warn); }
.console-out .ln.lvl-INFO { color: var(--fg); }
.console-out .ln.lvl-FINE { color: var(--faint); }
.console-out .ln .lg { color: var(--accent); opacity: .85; }
.popover-list { position: relative; }
.popover-list .menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 5; min-width: 200px; max-height: 260px; overflow: auto;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow-2);
  padding: .35rem; display: none;
}
.popover-list.open .menu { display: block; }
.popover-list .opt { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: var(--r-sm); cursor: pointer; font-size: .82rem; }
.popover-list .opt:hover { background: var(--accent-wash); }
.popover-list .opt input { width: auto; }

/* ── Landing / denied ──────────────────────────────────────────────────────── */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.hero { max-width: 460px; text-align: center; }
.hero .mark-lg {
  display: inline-grid; place-items: center; width: 60px; height: 60px; margin-bottom: 1.2rem;
  background: linear-gradient(145deg, var(--accent), var(--accent-press)); color: var(--on-accent);
  border-radius: 16px; font-size: 30px; font-weight: 800; box-shadow: 0 8px 30px rgba(45,212,191,.3);
}
.hero h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
.hero p { color: var(--muted); margin: 0 0 1.5rem; line-height: 1.6; }
.btn-discord { --btn-bg: #5865f2; --btn-fg: #fff; --btn-line: transparent; font-weight: 600; padding: .7rem 1.2rem; }
.btn-discord:hover { background: #4752e0; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  header.site { gap: .6rem; padding: .55rem .8rem; }
  header.site nav a { padding: .35rem .5rem; }
  .user-chip .uname { display: none; }
  main { padding: 1.1rem .8rem 3rem; }
  .console-out { height: 56vh; }
}
