/* Zer0Lag. Layout and components follow the "paint" landing/admin style (solid panels, caution
   stripe, ASCII wordmark, ribboned cards). Brand: "Neon", a hot-pink-to-sky-blue gradient on near-black.
   Every colour lives in these tokens; change the brand here. */
:root {
  --bg: #0B0B0A;
  --bg-2: #10100E;
  --panel: #151512;
  --panel-2: #1B1B17;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #EEECE6;
  --head: #FAF8F2;
  --muted: #B5B1A3;
  --muted-2: #A29E90;
  --faint: #77746A;
  /* brand: "Neon", hot pink -> sky blue (user's gradient, 2026-11-03).
     Ember backup: ~/zerolag-css-backup-*-ember.css (was #FFB020 -> #FF4A1C, accent #FF7A1A) */
  --grad-from: #FF1B6B;       /* hot pink. literal: wordmark.js and burn.js read it */
  --grad-to: #45CAFF;         /* sky blue. literal: wordmark.js and burn.js read it */
  --grad: linear-gradient(90deg, var(--grad-from) 0%, var(--grad-to) 100%);
  --accent: #FF4D8D;          /* links, outlines, tabs, switches (a touch lighter than #FF1B6B for contrast) */
  --accent-2: #45CAFF;        /* secondary highlights (badges, tags, notes) */
  --accent-rgb: 255 77 141;
  --accent-2-rgb: 69 202 255;
  --accent-hover: #FF7AAA;
  --accent-light: #FFD1E2;
  --accent-2-light: #C7EEFF;
  --accent-fg: #14060C;       /* text on brand-coloured buttons */
  --glow: rgba(255, 27, 107, 0.20);
  /* status (kept apart from the brand so "online", "warning" and "error" don't read as decoration) */
  --ok: #4ADE80;
  --ok-rgb: 74 222 128;
  --ok-light: #BBF7D0;
  --warn: #FACC15;
  --warn-rgb: 250 204 21;
  --danger: #EF4444;
  --danger-rgb: 239 68 68;
  --danger-text: #FCA5A5;
  --danger-light: #FECACA;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--sans);
  --body: var(--sans);
  --mono: ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --wrap: 1160px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
code, .mono { font-family: var(--mono); }
.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; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.aurora { display: none; }

/* Panels (the class is still called glass; panels are solid now) */
.glass { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* --- Header: blurred sticky bar with a caution stripe -------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.site-header::after { content: ""; display: block; height: 3px; background: var(--grad); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; min-height: 64px; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.1rem; letter-spacing: -0.01em; color: var(--head); text-decoration: none; }
.brand:hover { color: #FFF; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--grad); color: var(--accent-fg); display: grid; place-items: center; flex: none; box-shadow: 0 6px 22px -8px var(--glow); }
.logo svg { width: 18px; height: 18px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 4px 26px; flex: 1 1 auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .95rem; min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--head); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.nav-login { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; min-height: 44px; display: inline-flex; align-items: center; }
.nav-login:hover { color: var(--head); }
.nav-user { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav-user form { margin: 0; }
.nav-admin { color: var(--muted); font-weight: 600; font-size: .95rem; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav-admin:hover { color: var(--head); }
.nav-admin[aria-current="page"] { color: var(--head); box-shadow: inset 0 -2px 0 var(--accent); }
.avatar { width: 30px; height: 30px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--accent); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.nav-username { color: var(--muted); font-size: .95rem; }
@media (max-width: 700px) { .nav-username { display: none; } }

/* --- Buttons --------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 10px; cursor: pointer;
  font: 600 .95rem var(--sans); text-decoration: none; color: var(--text);
  border: 1px solid var(--line-strong); background: transparent;
  transition: transform .15s, border-color .15s, background .15s, filter .15s;
}
.btn:hover { border-color: var(--text); color: var(--head); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--grad); color: var(--accent-fg); border: 0; box-shadow: 0 8px 30px -8px var(--glow); }
.btn-primary:hover { color: var(--accent-fg); filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-violet { background: var(--accent-2); color: var(--accent-fg); border: 0; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .88rem; }
.btn-xs { min-height: 32px; padding: 0 10px; font-size: .8rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #1A0508; border: 0; }
.btn-danger:hover { color: #1A0508; filter: brightness(1.08); }
.btn-danger-ghost { color: var(--danger-text); border-color: rgb(var(--danger-rgb) / .45); }
.btn-danger-ghost:hover { color: var(--danger-light); border-color: var(--danger); }
[aria-disabled="true"].btn, .btn:disabled { opacity: .5; cursor: default; transform: none; }
.link-arrow { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

/* --- Type -------------------------------------------------------------------------------- */
.eyebrow { display: inline-block; margin: 0; font-size: .78rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.h1 { margin: 0; font-size: clamp(2rem, 4.8vw, 3.3rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: var(--head); }
.h2 { margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 760; line-height: 1.15; letter-spacing: -0.02em; color: var(--head); }
.h3 { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--head); }
.grad-text { background: linear-gradient(120deg, var(--grad-from), var(--grad-to)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { margin: 0; font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.muted { color: var(--muted-2); }
.small { font-size: .85rem; }
.strong { font-weight: 650; color: var(--head); }

/* --- Sections ------------------------------------------------------------------------------- */
.section { padding-block: 88px; display: flex; flex-direction: column; gap: 32px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.band { background: var(--bg-2); border-block: 1px solid var(--line); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
@media (max-width: 700px) { .section { padding-block: 64px; } }

/* --- Hero: centred wordmark over a striped glow ------------------------------------------- */
.hero { position: relative; isolation: isolate; padding-block: 24px 64px; display: flex; flex-direction: column; align-items: center; gap: 44px; }
.hero::before {
  content: ""; position: absolute; inset: -40px calc(50% - 50vw) auto; height: 640px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(620px 320px at 50% 6%, var(--glow), transparent 70%);
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.hero-copy { max-width: 860px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.hero-copy .lede { margin-inline: auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }
.hero-card { width: 100%; max-width: 560px; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; background: linear-gradient(180deg, var(--panel), var(--panel-2)); border-color: var(--line-strong); box-shadow: var(--shadow); }
@media (max-width: 600px) { .hero { padding-block: 16px 48px; gap: 32px; } }

/* ASCII wordmark. wordmark.js draws it on a canvas and burn.js burns it into existence, then keeps it alight.
   The <pre> stays as the no-JS fallback and, once drawn, as text for screen readers. */
.ascii-wrap { position: relative; width: fit-content; max-width: 100%; margin: 0 auto;
  font-size: clamp(4px, 2.6vw, 20px); margin-top: 6em; /* 48 columns, two lines: fits a phone; room above for the flames */ }
.ascii-fire { position: absolute; pointer-events: none; }
.ascii-wrap.grid .ascii { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ascii-wrap .ascii { font-size: 1em; } /* the wrapper carries the size, so the canvases can use em too */
/* With JS on, the text fallback stays invisible (still taking its space, so nothing shifts) until wordmark.js
   switches to the canvas, so it never flashes before the ignition. If the scripts fail, it shows after 4s. */
.js .ascii-wrap:not(.grid) .ascii { visibility: hidden; animation: zl-wordmark-fallback 0s 4s forwards; }
@keyframes zl-wordmark-fallback { to { visibility: visible; } }
.ascii {
  margin: 0 auto; width: fit-content; max-width: 100%; text-align: left; white-space: pre; overflow: hidden;
  font: 700 clamp(4px, 2.6vw, 20px)/.94 var(--mono); letter-spacing: 0;
  /* the no-JS fallback gets the same teal-to-lavender gradient as the canvas */
  background: linear-gradient(90deg, var(--grad-from), var(--grad-to)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px var(--glow));
}
.ascii .ln { display: block; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Featured server */
.server-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.server-name { font-weight: 750; font-size: 1.15rem; color: var(--head); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat small { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.stat strong { font: 700 1.3rem var(--mono); color: var(--head); font-variant-numeric: tabular-nums; }

/* --- Badges and pills (dot + tint) --------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-online { color: var(--ok); border-color: rgb(var(--ok-rgb) / .4); background: rgb(var(--ok-rgb) / .08); }
.badge-online .dot { box-shadow: 0 0 8px var(--ok); }
.badge-offline { color: var(--faint); }
.badge-violet { color: var(--accent-2-light); border-color: rgb(var(--accent-2-rgb) / .45); background: rgb(var(--accent-2-rgb) / .08); }
.badge-warn { color: var(--warn); border: 1px solid rgb(var(--warn-rgb) / .5); background: rgb(var(--warn-rgb) / .07); }
.badge-danger { color: var(--danger-text); border-color: rgb(var(--danger-rgb) / .45); background: rgb(var(--danger-rgb) / .08); }
.tag { align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.pill { font-size: .8rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; color: var(--text); background: rgba(11, 11, 10, .7); border: 1px solid var(--line-strong); }
.pill-teal { color: var(--accent-light); border-color: rgb(var(--accent-rgb) / .5); }
.pill-violet { color: var(--accent-2-light); border-color: rgb(var(--accent-2-rgb) / .55); }

/* --- Feature cards with tinted icon tiles ---------------------------------------------------- */
.feature { padding: 26px; display: flex; flex-direction: column; gap: 8px; transition: border-color .2s, transform .2s; }
.feature:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.feature .icon.violet { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 15%, transparent); }
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { margin: 0; font-size: 1.1rem; color: var(--head); }
.feature p { margin: 0; color: var(--muted); font-size: .97rem; }
@media (prefers-reduced-motion: reduce) { .feature { transition: none; } .feature:hover { transform: none; } }

/* --- Numbered steps -------------------------------------------------------------------------- */
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.steps li { position: relative; padding: 60px 24px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 6px; }
.steps .num {
  position: absolute; top: 22px; left: 24px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 700 .85rem var(--sans); color: var(--accent-fg); background: var(--grad);
}
.steps strong { font-size: 1.05rem; color: var(--head); }
.steps span:last-child { color: var(--muted); font-size: .97rem; }

/* --- CTA band --------------------------------------------------------------------------------- */
.cta {
  margin-block: 72px; padding: 48px 32px; border-radius: 22px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: radial-gradient(520px 220px at 50% 0%, var(--glow), transparent 70%), var(--panel);
}
.band:has(> .cta) { background: none; border: 0; }
.cta-copy { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cta-copy p { margin: 0; color: var(--muted); }

.empty { padding: 32px 20px; text-align: center; color: var(--muted-2); }
.soon { padding-block: 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; max-width: 680px; }

/* --- Footer --------------------------------------------------------------------------------- */
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 40px 0 44px; color: var(--muted-2); font-size: .92rem; }
.foot-grid { display: grid; gap: 32px; grid-template-columns: 2fr 1fr 1fr 1fr; padding-bottom: 32px; }
.foot-grid nav { display: flex; flex-direction: column; gap: 10px; }
.foot-grid h2 { margin: 0 0 4px; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 650; }
.foot-grid a { color: var(--muted-2); text-decoration: none; }
.foot-grid a:hover { color: var(--head); }
.foot-tag { margin: 12px 0 0; max-width: 26em; }
.foot-base { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding-top: 22px; border-top: 1px solid var(--line); font-size: .85rem; }
.foot-base a { color: var(--muted-2); }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }

/* --- Alerts ------------------------------------------------------------------------------------ */
.flashes { padding-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.alert { padding: 11px 16px; border-radius: 10px; font-size: .92rem; background: var(--panel-2); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent-2); color: var(--text); }
.alert-error { border-left-color: var(--danger); color: var(--danger-light); background: color-mix(in srgb, var(--danger) 8%, var(--panel-2)); }
.alert-success { border-left-color: var(--ok); color: var(--ok-light); }
.alert-info, .alert-message { border-left-color: var(--accent-2); color: var(--accent-2-light); }
.note { margin: 0; padding: 10px 14px; border-radius: 10px; font-size: .9rem; color: var(--accent-2-light); background: color-mix(in srgb, var(--accent-2) 8%, transparent); border: 1px solid rgb(var(--accent-2-rgb) / .3); }

/* --- Auth ------------------------------------------------------------------------------------- */
.auth { min-height: calc(100vh - 220px); display: flex; align-items: center; justify-content: center; padding-block: 56px; }
.auth-card { width: 100%; max-width: 440px; padding: 34px 32px; border-radius: 20px; display: flex; flex-direction: column; gap: 22px; background: linear-gradient(180deg, var(--panel), var(--panel-2)); border-color: var(--line-strong); box-shadow: var(--shadow); }
@media (max-width: 480px) { .auth-card { padding: 26px 20px; } }
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.auth-head p { margin: 0; }
.auth-head .logo { width: 44px; height: 44px; border-radius: 12px; }
.auth-head .logo svg { width: 26px; height: 26px; }
.auth-title { margin: 6px 0 0; font-size: 1.7rem; font-weight: 780; letter-spacing: -0.02em; line-height: 1.15; color: var(--head); }
.auth-foot { margin: 0; text-align: center; font-size: .92rem; }

/* --- Forms ------------------------------------------------------------------------------------ */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.field label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field-hint { font-size: .8rem; color: var(--faint); }
.field-error { font-size: .82rem; color: var(--danger-text); }
.field input, .field select, .field textarea {
  min-height: 44px; padding: 0 12px; border-radius: 10px; font: inherit; font-size: .95rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-strong); width: 100%; min-width: 0;
}
.field textarea { min-height: 120px; padding: 10px 12px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(255, 255, 255, .3); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field select option { background: var(--panel-2); color: var(--text); }
.field input[type="file"] { min-height: 0; padding: 8px; font-size: .88rem; }
.field input[type="file"]::file-selector-button {
  margin-right: 12px; min-height: 34px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  font: 600 .85rem var(--sans); color: var(--text); background: var(--panel-2); border: 1px solid var(--line-strong);
}
/* Checkboxes look like switches */
.check { display: flex; align-items: center; gap: 12px; font-size: .95rem; color: var(--text); min-height: 44px; cursor: pointer; }
/* .check (not .field) wins here: form fields give inputs a 44px min-height and padding, which made the
   switches tall and narrow, so those are reset for switches */
.check input[type="checkbox"], .field .check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; padding: 0; cursor: pointer;
  width: 56px; min-width: 56px; height: 28px; min-height: 28px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: radial-gradient(circle 10px at 14px 50%, var(--faint) 98%, transparent) #24241F;
  transition: background .15s, border-color .15s;
}
.check input[type="checkbox"]:checked, .field .check input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: radial-gradient(circle 10px at calc(100% - 14px) 50%, var(--accent) 98%, transparent) rgb(var(--accent-rgb) / .2);
}
.field .check input[type="checkbox"]:focus { border-color: var(--line-strong); outline: none; }
.field .check input[type="checkbox"]:checked:focus { border-color: var(--accent); }
.check input[type="checkbox"]:focus-visible, .field .check input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .check input[type="checkbox"] { transition: none; } }

.form-panel { padding: 26px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 600px) { .form-panel { padding: 18px; } }
.form-panel .section-head { align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px 20px; }
.field-wide { grid-column: 1 / -1; }
.checks { margin: 0; padding: 18px 0 0; border: none; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.checks legend { padding: 0; margin-bottom: 8px; font-size: .75rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.toolbar .field { flex: 1 1 200px; max-width: 320px; }
.settings-form .checks + .checks { margin-top: 22px; }

/* --- Admin ------------------------------------------------------------------------------------- */
.admin { padding-block: 32px 72px; display: flex; flex-direction: column; gap: 24px; }
.admin-top { display: flex; flex-direction: column; gap: 8px; }
.admin-tabs, .file-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar, .file-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a, .file-tabs a {
  flex: 0 0 auto; white-space: nowrap; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted-2); font-weight: 600; font-size: .95rem; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.admin-tabs a:hover, .file-tabs a:hover { color: var(--head); }
.admin-tabs a[aria-current="page"], .file-tabs a[aria-current="page"] { color: var(--head); border-bottom-color: var(--accent); }
.file-tabs .count, .inbox-box .h3 .count, .console-side .h3 .count { font: 500 .75rem var(--mono); padding: 1px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); margin-left: 6px; }
.file-tabs a[aria-current="page"] .count { color: var(--accent); border-color: rgb(var(--accent-rgb) / .35); }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.admin-stat { padding: 16px 18px; }
.admin-stat small { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.admin-stat strong { display: block; margin-top: 6px; font-size: 1.9rem; font-weight: 750; letter-spacing: -0.03em; color: var(--head); font-variant-numeric: tabular-nums; }
.admin-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.quick { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; transition: border-color .15s, transform .15s; }
.quick strong { color: var(--head); font-size: 1.02rem; }
.quick:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-2px); }

.table-box { overflow-x: auto; padding: 0; }
.table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; padding: 14px 16px 10px; }
.table td { padding: 11px 16px; border-top: 1px solid var(--line); color: var(--text); vertical-align: middle; overflow-wrap: anywhere; }
.table tbody tr:hover { background: rgba(255, 255, 255, .022); }
.table .mono { font-size: .85rem; }
.table td .badge + .badge { margin-left: 4px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; margin: 0 8px 0 0; }
.row-actions a { font-weight: 600; text-decoration: none; margin-left: 8px; }
.back-link { align-self: flex-start; font-size: .9rem; }
.meta-line { margin: -12px 0 0; font-size: .9rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; font-size: .92rem; }
.kv dt { color: var(--muted-2); }
.kv dd { margin: 0; color: var(--text); word-break: break-all; }

.danger-zone { padding: 22px 26px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; border-color: rgb(var(--danger-rgb) / .35); }
.danger-zone p { margin: 4px 0 0; }
.danger-zone form { margin: 0; }
.danger-zone .dz-copy { flex: 1 1 320px; min-width: 0; }
.danger-zone .dz-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.danger-zone .dz-form .field { min-width: 220px; }
.danger-link { color: var(--danger); margin-left: 12px; }

/* Game pictures in admin */
.thumb-cell { width: 84px; }
.game-thumb { display: block; width: 72px; height: 40px; border-radius: 8px; object-fit: cover; }
.game-thumb-empty { display: flex; align-items: center; justify-content: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--accent); font-weight: 800; }
.picture-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.picture-preview { flex: 0 0 auto; width: 288px; max-width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: .88rem; background: var(--bg); border: 1px solid var(--line-strong); }
.picture-preview img { width: 100%; height: 100%; object-fit: cover; }
.picture-fields { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.launch-report { margin: 10px 0 6px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; gap: 12px; }
.launch-report.is-ok { border-color: rgb(var(--ok-rgb) / .35); box-shadow: inset 3px 0 0 var(--ok); }
.launch-report.is-bad { border-color: rgb(var(--danger-rgb) / .4); box-shadow: inset 3px 0 0 var(--danger); }
.launch-report .section-head { margin: 0; }
.launch-report .section-head strong { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 400; }
.report-problems { margin: 0; padding-left: 20px; color: var(--danger-text); }
.report-notes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.log-box { padding: 14px 16px; border-radius: 12px; max-height: 520px; overflow: auto; font: 13px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; color: var(--text); background: var(--bg-2); }
.inbox-box { margin-top: 28px; }

/* --- Browse ------------------------------------------------------------------------------------ */
.browse { padding-block: 56px 80px; display: flex; flex-direction: column; gap: 24px; }
.browse-head { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.browse-search {
  display: flex; align-items: center; gap: 10px; max-width: 640px; padding: 6px 6px 6px 16px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; color: var(--muted-2);
}
.browse-search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.browse-search input { flex: 1; min-width: 0; min-height: 42px; border: none; background: none; color: var(--text); font: inherit; outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; font-size: .88rem; font-weight: 600; text-decoration: none; color: var(--muted); border: 1px solid var(--line-strong); }
.chip:hover { color: var(--head); border-color: var(--text); }
.chip[aria-current="true"] { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.result-count { margin: 0; font-size: .9rem; }

/* Mailing list card at the bottom of Browse */
.list-card {
  margin-top: 24px; padding: 26px 28px; border-radius: 16px; display: grid; grid-template-columns: auto 1fr minmax(300px, 420px);
  align-items: center; gap: 18px 22px; position: relative; overflow: hidden;
}
.list-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad); }
.list-card-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.list-card-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.list-card-copy p { margin: 0; }
.list-card-action { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.list-form { max-width: none; }
.list-form-on { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .list-card { grid-template-columns: auto 1fr; }
  .list-card-action { grid-column: 1 / -1; }
  .list-form-on { justify-content: flex-start; }
}
@media (max-width: 480px) { .list-card { padding: 20px 18px; } .list-card-icon { width: 44px; height: 44px; } }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.game-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; text-decoration: none; color: inherit; transition: transform .2s, border-color .2s, box-shadow .2s; }
.game-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 20px 50px -25px var(--glow); color: inherit; }
.game-card-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, var(--panel-2), var(--panel)); border-bottom: 1px solid var(--line); }
.game-card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.game-card:hover .game-card-art img { transform: scale(1.04); }
.art-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 64px var(--mono); color: color-mix(in srgb, var(--accent) 45%, transparent); }
.art-tag { position: absolute; left: 12px; bottom: 12px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; background: rgba(11, 11, 10, .82); }
.art-tag-native { color: var(--accent-light); border: 1px solid rgb(var(--accent-rgb) / .5); }
.art-tag-mod { color: var(--accent-2-light); border: 1px solid rgb(var(--accent-2-rgb) / .55); }
.game-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game-card-genre { font-size: .72rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.game-card-title { margin: 0; font-size: 1.25rem; font-weight: 750; letter-spacing: -0.01em; line-height: 1.2; color: var(--head); }
.game-card-desc { margin: 0; font-size: .93rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.game-card-meta { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; gap: 8px; font: .8rem var(--mono); color: var(--muted-2); }
.game-card-meta .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; opacity: .6; }
.game-card-meta .meta-live { color: var(--ok); }
.game-card-meta .meta-live .dot { opacity: 1; box-shadow: 0 0 10px var(--ok); }
@media (prefers-reduced-motion: reduce) { .game-card, .game-card-art img, .quick { transition: none; } .game-card:hover, .quick:hover { transform: none; } }

/* --- Game page ---------------------------------------------------------------------------------- */
.game-hero { position: relative; isolation: isolate; min-height: 380px; display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--line); }
.game-hero-art { position: absolute; inset: 0; z-index: -1; background: radial-gradient(620px 300px at 20% 0%, var(--glow), transparent 70%); }
.game-hero-art img { width: 100%; height: 100%; object-fit: cover; }
.game-hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 2%, rgba(11, 11, 10, .85) 38%, rgba(11, 11, 10, .4) 75%, rgba(11, 11, 10, .25)); }
.game-hero:not(.has-art) .game-hero-art::after { background: none; }
.game-hero.has-art { min-height: 500px; }
.game-hero-body { width: 100%; padding-block: 48px 40px; display: flex; flex-direction: column; gap: 16px; }
.game-hero .hero-actions { justify-content: flex-start; }
.crumbs { font-size: .88rem; color: var(--muted-2); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--head); text-decoration: underline; }
.game-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.game-hero-stats { display: flex; flex-wrap: wrap; gap: 12px 36px; }
.game-hero-stats div { display: flex; align-items: baseline; gap: 8px; }
.game-hero-stats strong { font: 700 1.7rem var(--mono); color: var(--head); font-variant-numeric: tabular-nums; }
.game-hero-stats span { color: var(--muted); font-size: .95rem; }
.game-about, .game-howto { padding-top: 40px; display: flex; flex-direction: column; gap: 14px; }
.game-about > * { max-width: 760px; }
.game-about p { margin: 0; color: var(--muted); font-size: 1.02rem; white-space: pre-line; }

/* Downloads */
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.file-row { padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.file-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.file-main { flex: 999 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.file-title { margin: 0; font-size: 1.05rem; color: var(--head); }
.file-version { font: 500 .8rem var(--mono); color: var(--accent-2); margin-left: 4px; }
.file-desc { margin: 0; color: var(--muted); font-size: .95rem; white-space: pre-line; }
.file-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font: .8rem var(--mono); color: var(--muted-2); overflow-wrap: anywhere; }
.file-meta .meta-live { color: var(--ok); }
.file-hash { font-size: .8rem; color: var(--muted-2); }
.file-hash summary { cursor: pointer; width: fit-content; }
.file-hash code { display: block; margin-top: 6px; font-size: .75rem; color: var(--text); overflow-wrap: anywhere; }
.file-action { flex: 1 0 auto; display: flex; justify-content: flex-end; align-self: center; }
.files-panel { padding: 22px 26px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 600px) { .files-panel { padding: 18px; } }
.files-panel .table-box { border: 1px solid var(--line); border-radius: 12px; }
.files-panel .row-actions form { margin: 0 0 0 10px; }

/* --- Pricing -------------------------------------------------------------------------------------- */
.pricing { gap: 36px; }
.pricing-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.pricing-head .lede { max-width: 640px; }
.period-toggle { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; margin-top: 8px; }
.period-toggle a { min-height: 38px; padding: 0 18px; border-radius: 999px; display: inline-flex; align-items: center; font-size: .88rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.period-toggle a:hover { color: var(--head); }
.period-toggle a[aria-current="page"] { background: var(--accent); color: var(--accent-fg); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; align-items: stretch; padding-top: 14px; }
.plan-card { position: relative; padding: 32px 28px 28px; border-radius: 20px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, var(--panel), var(--panel-2)); }
.plan-popular { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow), 0 20px 50px -25px var(--glow); }
.plan-flag { position: absolute; top: -13px; left: 28px; padding: 4px 12px; border-radius: 999px; font-size: .72rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-fg); background: var(--grad); }
.plan-name { margin: 0; font-size: 1.4rem; font-weight: 780; letter-spacing: -0.02em; color: var(--head); }
.plan-tagline { margin: 0; font-size: .95rem; }
.plan-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 8px 0; min-height: 48px; }
.plan-price strong { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; color: var(--head); font-variant-numeric: tabular-nums; }
.plan-trial { flex-basis: 100%; }
.trial-note { margin: 4px 0 0; }
.trial-note strong { color: var(--accent); }
.plan-features { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 11px; flex: 1 1 auto; }
.plan-features li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: .95rem; }
.plan-features svg { flex: none; margin-top: 4px; color: var(--accent); }
.plan-cta { margin-top: 18px; }
.plan-cta form { margin: 0; }
.plan-cta .btn { width: 100%; }
.plan-status { padding: 18px 22px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; border-color: rgb(var(--accent-rgb) / .4); box-shadow: inset 3px 0 0 var(--accent); }
.plan-status > div { display: flex; flex-direction: column; gap: 2px; }
.plan-status strong { color: var(--head); }
.plan-status form { margin: 0; }
.pricing-foot { margin: 0; text-align: center; }

/* FAQ: +/– */
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 760px; width: 100%; margin: 24px auto 0; }
.faq > .h2 { text-align: center; margin-bottom: 14px; }
.faq details { padding: 4px 20px; border-radius: 14px; }
.faq details[open] { border-color: var(--line-strong); }
.faq summary { cursor: pointer; list-style: none; padding: 15px 0; font-weight: 600; color: var(--head); display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 0; padding: 0 0 16px; }

/* --- Your servers + console ---------------------------------------------------------------------- */
.account .own-servers { display: grid; gap: 14px; margin: 20px 0 28px; }
.own-server { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.own-server .section-head { margin: 0; align-items: flex-start; }
.own-server p { margin: 0; }
.account .form-panel { margin: 20px 0 32px; }
.fav-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.fav-row { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.play-key { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; margin: 18px 0; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.play-key code { font-size: .95rem; padding: 10px 14px; border-radius: 10px; background: var(--bg); border: 1px solid rgb(var(--accent-rgb) / .4); color: var(--accent-light); word-break: break-all; user-select: all; }
.play-key form { margin: 0; }

.console { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; margin-top: 16px; }
@media (max-width: 860px) { .console { grid-template-columns: 1fr; } }
.console-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.console-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.console-status { font: 600 .85rem var(--mono); color: var(--faint); }
.console-status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 1px; }
.console-status[data-state="running"] { color: var(--ok); }
.console-out { margin: 0; padding: 14px 16px; height: 440px; overflow: auto; font: 13px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--text); background: #080806; border-color: var(--line-strong); }
.console-cmd { color: var(--accent); }
.console-ok { color: var(--ok-light); }
.console-err { color: var(--danger-text); }
.console-input { display: flex; gap: 10px; align-items: center; }
.console-input input { flex: 1; min-width: 0; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: .9rem var(--mono); }
.console-input input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.console-side { padding: 16px 18px; align-self: start; display: flex; flex-direction: column; gap: 10px; }
.console-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.console-players li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cat-row { display: flex; gap: 10px; align-items: center; margin: 0; }
.cat-row input { min-height: 36px; padding: 0 10px; border-radius: 8px; font: inherit; font-size: .9rem; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); min-width: 0; flex: 1 1 200px; }
.cat-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.cat-row .cat-sort { flex: 0 0 80px; }

/* --- Legal pages (Terms, Privacy): long-form reading ---------------------------------------- */
.legal { max-width: 780px; padding-block: 64px 96px; }
.legal-head { display: flex; flex-direction: column; gap: 14px; padding-bottom: 28px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.legal-toc { margin: 28px 0 8px; padding: 18px 22px; columns: 2 220px; column-gap: 28px; }
.legal-toc ol { margin: 0; padding-left: 1.3em; }
.legal-toc li { margin: 0 0 6px; break-inside: avoid; }
.legal-toc a { color: var(--muted); text-decoration: none; }
.legal-toc a:hover { color: var(--accent); }
.legal section { padding-top: 36px; scroll-margin-top: 90px; }
.legal h2 { margin: 0 0 12px; font-size: 1.3rem; font-weight: 720; letter-spacing: -0.01em; color: var(--head); }
.legal h3 { margin: 22px 0 8px; font-size: 1.02rem; font-weight: 680; color: var(--head); }
.legal p, .legal li { color: var(--muted); line-height: 1.7; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 1.25em; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--text); }
.legal-summary { padding: 18px 22px; margin-top: 24px; }
.legal-summary p:last-child, .legal-summary ul:last-child { margin-bottom: 0; }
.legal-todo { background: rgba(250, 204, 21, 0.16); color: var(--warn); padding: 0 4px; border-radius: 4px; }
.legal-consent { margin: 4px 0 0; line-height: 1.55; }
/* A server's description, under its name */
.server-desc { margin: 4px 0 0; color: var(--muted); font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
td .server-desc { max-width: 42ch; }
/* Play key: the current key, behind a "Show" toggle */
.key-reveal { margin-top: 4px; }
.key-reveal summary { cursor: pointer; color: var(--accent); width: fit-content; }
.key-reveal code { display: inline-block; margin-top: 8px; }
.geo-credit { display: block; margin-top: 4px; opacity: .8; }
/* Game guide: admin shortcut and editor */
.guide-admin-link { display: inline-block; margin-top: 10px; }
.guide-edit textarea { font-family: var(--mono); font-size: .9rem; line-height: 1.55; min-height: 260px; }

/* --- Admin → Security ------------------------------------------------------------------------------------- */
.nowrap { white-space: nowrap; }
.code-block { margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font: .85rem/1.6 var(--mono); color: var(--text); overflow-x: auto; white-space: pre; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px 20px; }
.two-col > section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.two-col .table { min-width: 0; }
.kv-grid { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 20px; }
.kv-grid dt { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.kv-grid dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 650; color: var(--head); }
.ip-list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.table-compact td { padding-block: 8px; }
.log-table { min-width: 860px; }
.log-msg { font-size: .8rem; max-width: 520px; white-space: normal; overflow-wrap: anywhere; color: var(--muted); }

/* --- Admin → System --------------------------------------------------------------------------------------- */
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.preset { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.preset:hover { border-color: var(--text); color: var(--head); }
.preset-swatch { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(90deg, var(--p-from), var(--p-to)); }
.colour-pick { display: flex; gap: 8px; align-items: center; }
.colour-pick input[type="color"] { width: 48px; height: 44px; padding: 3px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; flex: none; }
.colour-pick input:not([type="color"]) { flex: 1; }
.theme-preview { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.theme-preview-bar { height: 3px; background: var(--grad); }
.theme-preview-body { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 22px; background: radial-gradient(420px 160px at 30% 0%, var(--glow), transparent 70%); }
.theme-preview-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.theme-preview-link { color: var(--accent); }
.theme-preview-link:hover { color: var(--accent-hover); }
.theme-preview-note { margin: 0; padding: 0 22px 16px; }

/* --- Forum ------------------------------------------------------------------------------------------------ */
.forum { padding-block: 32px 72px; display: flex; flex-direction: column; gap: 20px; }
.forum-boards { padding: 0; }
.forum-board { display: grid; grid-template-columns: minmax(0, 1fr) 110px minmax(0, 260px); gap: 8px 20px; align-items: center; padding: 18px 22px; }
.forum-board + .forum-board { border-top: 1px solid var(--line); }
.forum-board .h3 a { color: var(--head); text-decoration: none; }
.forum-board .h3 a:hover { color: var(--accent); }
.forum-board-main p { margin: 4px 0 0; }
.forum-board-count strong { color: var(--head); }
.forum-board-last a { color: var(--text); }
@media (max-width: 720px) { .forum-board { grid-template-columns: 1fr; } }
.forum-flags { display: flex; gap: 6px; }
.forum-mod { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; }
.forum-move { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.forum-move select { min-height: 32px; }
.forum-posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.forum-post { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 90px; }
.forum-post:target { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.forum-post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.forum-post-head strong { color: var(--head); }
.forum-post-time { margin-left: auto; text-decoration: none; }
.forum-body { overflow-wrap: anywhere; }
.forum-body p { margin: 0 0 .8em; }
.forum-body p:last-child { margin-bottom: 0; }
.forum-post-actions { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; }
.board-delete { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.board-delete input { max-width: 240px; min-height: 32px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.board-delete input, .forum-move select { min-height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: inherit; font-size: .85rem; }
/* Server cards on a game's page */
.server-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.server-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; transition: border-color .2s, box-shadow .2s; }
.server-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 20px 50px -30px var(--glow); }
.server-card.is-offline { opacity: .75; }
.server-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.server-card-title { margin: 0; font-size: 1.15rem; font-weight: 750; line-height: 1.25; color: var(--head); overflow-wrap: anywhere; }
.server-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.server-card .server-desc { margin: 0; }
.badge-free { color: var(--text); border-color: var(--line-strong); }
.badge-paid { color: var(--accent-light); border-color: rgb(var(--accent-rgb) / .5); background: rgb(var(--accent-rgb) / .1); }
.server-card-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 12px 0; border-block: 1px solid var(--line); }
.server-card-facts dt { font-size: .72rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.server-card-facts dd { margin: 2px 0 0; font-size: .92rem; overflow-wrap: anywhere; }
.server-card-sub { margin: 0 0 8px; font-size: .9rem; font-weight: 700; color: var(--head); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.server-card-sub .muted { font-weight: 400; }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rule { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 10px; border-radius: 8px; font-size: .88rem; background: rgba(255, 255, 255, .025); }
.rule-label { color: var(--muted); }
.rule-value { font-family: var(--mono); font-size: .85rem; color: var(--text); text-align: right; white-space: nowrap; }
.rule-changed { background: rgb(var(--accent-rgb) / .1); box-shadow: inset 2px 0 0 var(--accent); }
.rule-changed .rule-value { color: var(--accent-light); font-weight: 650; }
.rule-default { font-weight: 400; color: var(--muted-2); font-size: .78rem; }
.server-card-foot { margin-top: auto; padding-top: 4px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.server-card-addr { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
/* Under construction: admins' reminder bar, and the holding page everyone else sees */
.construction-bar { padding: 8px 20px; text-align: center; font-size: .88rem; color: #14110A; background: var(--warn); }
.construction-bar a { color: inherit; font-weight: 650; text-decoration: underline; }
.construction-bar a:focus-visible { outline: 2px solid #14110A; outline-offset: 2px; }
.construction { padding-block: 72px 120px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
.construction .ascii-wrap { margin-bottom: 12px; }
.construction .lede { max-width: 34em; }

/* --- Admin → Mail: its own tab, chat style (templates/admin/mail_app.html, js/mail.js) ------------------- */
.admin-tabs .count { font: 600 .72rem var(--mono); padding: 1px 7px; border-radius: 999px; margin-left: 4px;
  background: var(--accent); color: var(--accent-fg); }
.mail-dns-value { overflow-wrap: anywhere; word-break: break-all; max-width: 420px; font-size: .82rem; user-select: all; }

.mx-body { height: 100vh; height: 100dvh; overflow: hidden; margin: 0; }
.mx { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; height: 100%; }
.mx-blocked { max-width: 560px; margin: 12vh auto; padding: 32px; }

/* Sidebar */
.mx-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg-2); }
.mx-side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 12px; }
.mx-brand { margin: 0; font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; color: var(--head); }
.mx-brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mx-brand-big { font-size: 2.2rem; }
.mx-me { margin: 2px 0 0; font-size: .78rem; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.mx-search { padding: 0 16px 10px; }
.mx-search input { width: 100%; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel);
  color: var(--text); font: inherit; }
.mx-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.mx-list { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.mx-conv { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; color: var(--text); text-decoration: none; }
.mx-conv:hover { background: var(--panel); }
.mx-conv[aria-current="page"] { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.mx-conv:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mx-conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mx-conv-top, .mx-conv-bottom { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mx-conv-name { font-weight: 600; color: var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.mx-conv-time { font-size: .75rem; color: var(--faint); flex-shrink: 0; }
.mx-conv-snippet { font-size: .86rem; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-you { color: var(--faint); }
.mx-conv-unread .mx-conv-snippet { color: var(--text); }
.mx-conv-unread .mx-conv-time { color: var(--accent); }
.mx-badge { flex-shrink: 0; min-width: 20px; padding: 1px 6px; border-radius: 999px; text-align: center; font: 700 .72rem var(--mono);
  background: var(--grad); color: var(--accent-fg); }
.mx-avatar { --h: 200; flex-shrink: 0; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  font: 700 .9rem var(--mono); color: #0B0B0A; background: hsl(var(--h) 75% 72%); }
.mx-side-foot { display: flex; gap: 4px; padding: 10px 12px; border-top: 1px solid var(--line); }
.mx-side-foot a { flex: 1; text-align: center; padding: 7px 6px; border-radius: 8px; font-size: .86rem; color: var(--muted); text-decoration: none; }
.mx-side-foot a:hover, .mx-side-foot a[aria-current="page"] { color: var(--head); background: var(--panel); }
.mx-count { font: 600 .72rem var(--mono); color: var(--muted-2); }
.mx-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.mx-dot.ok { background: var(--ok); }
.mx-dot.warn { background: #FBBF24; }
.mx-none { color: var(--muted-2); padding: 18px 12px; text-align: center; margin: 0; }

/* Main pane */
.mx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: var(--bg); }
.mx-flashes { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); z-index: 5; width: min(560px, 92%);
  display: flex; flex-direction: column; gap: 6px; }
.mx-newmail { position: absolute; top: 72px; right: 20px; z-index: 6; }
.mx-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; min-height: 66px; border-bottom: 1px solid var(--line);
  background: var(--bg-2); }
.mx-head-who { flex: 1; min-width: 0; }
.mx-head-name { margin: 0; font-size: 1.05rem; color: var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.mx-head-who .mx-head-name { flex: none; }
.mx-head-addr { margin: 1px 0 0; font-size: .78rem; color: var(--muted-2); }
.mx-back { display: none; font-size: 1.3rem; color: var(--text); text-decoration: none; padding: 2px 8px; }

.mx-thread { flex: 1; overflow-y: auto; padding: 20px clamp(12px, 4vw, 48px) 8px; display: flex; flex-direction: column; gap: 10px; }
.mx-thread:focus { outline: none; }
.mx-day { align-self: center; margin: 10px 0 4px; padding: 3px 12px; border-radius: 999px; font-size: .75rem; color: var(--muted-2);
  background: var(--panel); border: 1px solid var(--line); }
.mx-msg { display: flex; flex-direction: column; max-width: min(680px, 82%); }
.mx-in { align-self: flex-start; align-items: flex-start; }
.mx-out { align-self: flex-end; align-items: flex-end; }
.mx-bubble { padding: 10px 14px; border-radius: 18px; line-height: 1.5; overflow-wrap: anywhere; min-width: 60px; }
.mx-in .mx-bubble { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-bottom-left-radius: 6px; }
.mx-out .mx-bubble { background: linear-gradient(135deg, rgb(var(--accent-rgb) / .9), rgb(var(--accent-2-rgb) / .85)); color: var(--accent-fg);
  border-bottom-right-radius: 6px; }
.mx-subj { margin: 0 0 4px; font-weight: 700; font-size: .86rem; }
.mx-in .mx-subj { color: var(--head); }
.mx-also { margin: 0 0 4px; font-size: .78rem; opacity: .8; }
.mx-text { white-space: pre-wrap; }
.mx-empty { opacity: .7; font-style: italic; }
.mx-quoted { margin-top: 6px; font-size: .86rem; }
.mx-quoted summary { cursor: pointer; opacity: .75; font-size: .8rem; }
.mx-quoted .mx-text { margin-top: 6px; padding-left: 10px; border-left: 2px solid currentColor; opacity: .8; }
.mx-files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mx-files a { display: inline-block; padding: 5px 10px; border-radius: 10px; font-size: .84rem; text-decoration: none; color: inherit;
  background: rgb(0 0 0 / .18); }
.mx-in .mx-files a { background: var(--panel); border: 1px solid var(--line-strong); }
.mx-files a:hover { text-decoration: underline; }
.mx-files span { opacity: .7; font-size: .76rem; }
.mx-meta { display: flex; align-items: center; gap: 6px; margin: 3px 6px 0; font-size: .74rem; color: var(--faint); }
.mx-meta a { color: var(--muted-2); }
.mx-meta form { display: inline; margin: 0; }
.mx-link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted-2); cursor: pointer; text-decoration: underline; }
.mx-link:hover { color: var(--danger-light, #fca5a5); }

.mx-composer { padding: 10px clamp(12px, 4vw, 48px) 14px; border-top: 1px solid var(--line); background: var(--bg-2); }
.mx-composer-subject input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: .85rem; padding: 4px 4px 8px; margin-bottom: 8px; }
.mx-composer-subject input:focus { outline: none; color: var(--text); border-bottom-color: var(--accent); }
.mx-composer-row { display: flex; align-items: flex-end; gap: 8px; }
.mx-composer textarea { flex: 1; resize: none; min-height: 44px; max-height: 240px; padding: 11px 16px; border-radius: 22px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); font: inherit; line-height: 1.45; }
.mx-composer textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.mx-send { border-radius: 999px; min-height: 44px; padding-inline: 20px; }
.mx-attach { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 1.15rem;
  border: 1px solid var(--line-strong); background: var(--panel); flex-shrink: 0; }
.mx-attach:hover { border-color: var(--accent); }
.mx-attach:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.mx-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mx-hint { display: flex; justify-content: space-between; gap: 10px; margin: 6px 4px 0; font-size: .75rem; color: var(--faint); min-height: 1em; }

.mx-panel { flex: 1; overflow-y: auto; padding: 22px clamp(16px, 4vw, 48px); display: flex; flex-direction: column; gap: 16px; }
.mx-new { max-width: 760px; }
.mx-trash-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.mx-trash-main { flex: 1; min-width: 0; }
.mx-trash-main p { margin: 0; }
.mx-welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 24px; }

.mx-dialog { width: min(900px, 94vw); height: min(80vh, 900px); padding: 0; border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--panel); color: var(--text); }
.mx-dialog::backdrop { background: rgb(0 0 0 / .6); }
.mx-dialog[open] { display: flex; flex-direction: column; }
.mx-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; font-size: .82rem; color: var(--muted-2); }
.mx-dialog iframe { flex: 1; border: 0; background: #fff; border-radius: 0 0 14px 14px; }

/* Phones: one pane at a time */
@media (max-width: 760px) {
  .mx { grid-template-columns: 1fr; }
  .mx-open .mx-side { display: none; }
  .mx-body:not(.mx-open) .mx-main { display: none; }
  .mx-back { display: inline-block; }
  .mx-msg { max-width: 90%; }
  .mx-head form .btn { padding-inline: 8px; }
  .mx-wide { display: none; }
}

/* Admin → Users → New: the one-time temporary password (templates/admin/user_created.html) */
.temp-pass { max-width: 680px; gap: 16px; }
.temp-pass p { margin: 0; }
.temp-pass-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid rgb(var(--accent-rgb) / .45); }
.temp-pass-value { flex: 1; font: 600 1.35rem var(--mono); letter-spacing: .04em; color: var(--head); user-select: all; overflow-wrap: anywhere; }
.temp-pass-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.temp-pass-facts dt { color: var(--muted-2); }
.temp-pass-facts dd { margin: 0; overflow-wrap: anywhere; }

/* Account → Password; header name links to it */
.nav-me { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; border-radius: 999px; }
.nav-me:hover .nav-username { color: var(--head); text-decoration: underline; }
.account-password { padding: 22px 26px; display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 20px; }
.account-password h2 { flex-basis: 100%; margin: 0; }
.account-password p { flex: 1 1 320px; margin: 0; }
.auth-card .alert p { margin: 0; }
.auth-card .alert p + p { margin-top: 4px; }

/* Friends (templates/account/friends.html) and sharing a server with friends (server_edit.html) */
.nav-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; text-align: center;
  font: 700 .72rem/1.5 var(--mono); background: var(--grad); color: var(--accent-fg); }
.friends .h3 .count { font: 500 .75rem var(--mono); padding: 1px 8px; border-radius: 999px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: 2px; }
.friend-add { margin-top: 16px; }
.friend-add-row { display: flex; gap: 10px; flex-wrap: wrap; }
.friend-add-row input { flex: 1 1 220px; }
.share-panel { margin: 20px 0; }
.share-panel p { margin: 0; }
.share-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; border-top: none; padding-top: 0; }

/* --- Account pages, 2026-11-03 layout: main column + sidebar (Your servers, Friends, Edit server) ------------ */
.acct-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 20px; margin-bottom: 18px; }
.acct-head p.lede { margin: 6px 0 0; max-width: 62ch; }
.acct-head .head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.acct-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.acct-main, .acct-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.acct-side { position: sticky; top: 88px; }
@media (max-width: 920px) { .acct-grid { grid-template-columns: 1fr; } .acct-side { position: static; } }
.acct-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 18px 0 2px; }
.acct-block-head:first-child { margin-top: 0; }
.acct-block-head .h3 .count, .card-title .count { font: 500 .75rem var(--mono); padding: 1px 8px; border-radius: 999px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: 2px; }
.side-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.side-card .h3 { font-size: 1rem; }
.side-card p { margin: 0; }
.side-card form { margin: 0; }
.side-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.side-card.play-key { margin: 0; }
.side-card.danger-zone { border-color: rgb(var(--danger-rgb) / .35); }

/* Plan usage strip */
.plan-strip { padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-bottom: 18px; }
.plan-strip .plan-name { font-weight: 700; color: var(--head); }
.plan-strip .meter { flex: 1 1 160px; max-width: 260px; height: 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.plan-strip .meter span { display: block; height: 100%; background: var(--grad); }
.plan-strip .muted { font-size: .9rem; }

/* Avatars (colour from the username, like Admin → Mail) */
.av { --h: 200; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 700 .9rem var(--sans);
  color: #fff; background: hsl(var(--h) 55% 38%); border: 1px solid hsl(var(--h) 60% 55% / .6); }
.av-sm { width: 30px; height: 30px; font-size: .75rem; }

/* Chips (server facts, shared servers) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; padding: 3px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip strong { color: var(--text); font-weight: 600; }
.chip-room { border-color: rgb(var(--accent-2-rgb) / .4); color: var(--accent-2-light); }

/* Server cards (Your servers, Shared with you) */
.srv-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.srv-card > * { margin: 0; }
.srv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.srv-top .h3 { overflow-wrap: anywhere; }
.srv-top .sub { margin: 2px 0 0; font-size: .88rem; color: var(--muted-2); }
.srv-desc { color: var(--muted); font-size: .92rem; }
.addr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.addr code { font: .9rem var(--mono); padding: 6px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-strong); color: var(--head); user-select: all; }
.srv-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.srv-foot .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.srv-foot form { margin: 0; display: contents; }
.srv-shared { font-size: .88rem; color: var(--muted-2); }
.srv-card.is-shared { border-color: rgb(var(--accent-2-rgb) / .3); }

/* "Create a server" folds away once you have one */
.create-srv { padding: 0; }
.create-srv > summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--head); border-radius: var(--radius); }
.create-srv > summary::-webkit-details-marker { display: none; }
.create-srv > summary .plus { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--accent-fg); font-weight: 800; }
.create-srv[open] > summary { border-bottom: 1px solid var(--line-soft); border-radius: var(--radius) var(--radius) 0 0; }
.create-srv[open] > summary .plus { transform: rotate(45deg); }
.create-srv form { padding: 18px 20px 20px; margin: 0; }
.create-srv .form-actions { margin-top: 14px; }

/* Compact list rows (favourites, requests) */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row { padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row .who { flex: 1 1 180px; min-width: 0; display: flex; align-items: center; gap: 12px; }
.row .who > div { min-width: 0; }
.row .who strong { color: var(--head); overflow-wrap: anywhere; }
.row .who .small { display: block; }
.row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row .actions form { margin: 0; }
.row-request { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* Friend cards with per-server share toggles */
.friend-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 96px; }
.friend-card:target { border-color: var(--accent); }
.friend-card .who { display: flex; align-items: center; gap: 12px; }
.friend-card .who strong { font-size: 1.02rem; color: var(--head); overflow-wrap: anywhere; }
.friend-card .who .small { display: block; }
.friend-card form { margin: 0; }
.friend-card .label { font-size: .8rem; font-weight: 650; color: var(--muted); margin: 0 0 6px; }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--panel-2); font-size: .86rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--faint); }
.toggle:has(input:checked) { color: var(--head); border-color: rgb(var(--accent-rgb) / .6); background: rgb(var(--accent-rgb) / .12); }
.toggle:has(input:checked)::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 2px var(--panel-2); }
.toggle:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.friend-card .card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.js .friend-card [data-autosave] .save-btn { display: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; color: var(--danger-text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--danger-light); }

/* Steps ("How sharing works") */
.how-steps { counter-reset: step; }
.how-steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: .9rem; color: var(--muted); }
.how-steps li::before { content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font: 700 .75rem var(--mono); background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--head); }

/* Edit server */
.edit-form .fieldset-title { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: .95rem; }
.edit-form .fieldset-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.account .acct-grid .form-panel { margin: 0; }
.share-panel .share-checks { margin: 0; }
.side-card ol.how-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.side-card .rows .row, .side-card ul > .row { padding: 0; }
.side-card .friend-add-row .field { flex: 1 1 160px; }
.side-card.danger-zone { padding: 18px 20px; align-items: stretch; justify-content: flex-start; }
.side-card.danger-zone details > summary { cursor: pointer; color: var(--danger-text); }
.side-card.danger-zone details[open] { display: grid; gap: 10px; }
.side-card.danger-zone .dz-form { margin-top: 4px; }
.side-card.danger-zone .dz-form .field { min-width: 0; flex: 1 1 100%; }
.side-card.play-key code { font-size: .85rem; }
.create-srv summary .muted { margin-left: auto; font-weight: 500; }
.side-card .friend-add-row { align-items: flex-end; }
.side-card .friend-add-row .field input { flex: none; }
.friend-card .card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.friend-card .toggles + .card-foot { margin-top: 8px; }
.side-card ul.chips { display: flex; }
.share-panel .form-actions { margin-top: 0; padding-top: 0; border-top: 0; }

/* Admin → Mail: subjects per person, and "Show original" (rendered emails) — 2026-11-03 */
.mx-head-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.mx-head-actions form { margin: 0; }
.mx-head-addr a { color: var(--muted); text-decoration: none; }
.mx-head-addr a:hover { color: var(--head); text-decoration: underline; }
.mx-subjects-panel { gap: 10px; }
.mx-section { margin: 0; font-size: .75rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mx-subjects { display: flex; flex-direction: column; gap: 6px; }
.mx-subject { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); text-decoration: none; }
.mx-subject:hover { border-color: var(--line-strong); background: var(--panel-2); }
.mx-subject:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mx-subject .mx-conv-name { white-space: normal; overflow-wrap: anywhere; }
.mx-subject-n { flex-shrink: 0; font: 600 .75rem var(--mono); color: var(--faint); }
.mx-composer-label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.mx-original { gap: 16px; }
.mx-mail { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; flex-shrink: 0; }
.mx-mail-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mx-mail-head p { margin: 0; overflow-wrap: anywhere; }
.mx-mail-head strong { color: var(--head); }
.mx-mail-frame { display: block; width: 100%; height: 480px; border: 0; background: #F2F1EC; }
.mx-mail-text { padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }
.mx-mail .mx-files { padding: 0 16px 12px; }
.mx-orig-note { margin: 0; text-align: center; }
@media (max-width: 700px) { .mx-head-actions .btn { padding: 0 8px; } }

/* Admin → Games → Crash reports */
.btn.is-disabled { opacity: .45; pointer-events: none; }
.crash-note { margin: 16px 0; padding: 14px 18px; }
.crash-note p { margin: 0; }
.crash-log { margin: 16px 0; padding: 0; overflow: hidden; }
.crash-log summary { cursor: pointer; padding: 12px 16px; font-weight: 650; color: var(--head); }
.crash-log pre { margin: 0; max-height: 60vh; overflow: auto; padding: 14px 16px; border-top: 1px solid var(--line);
  font: .8rem/1.5 var(--mono); color: var(--text); background: var(--bg); white-space: pre; }
.crash-table td:nth-child(-n+2), .crash-table td:nth-child(4), .crash-table td:nth-child(7) { white-space: nowrap; }
.crash-table .crash-note-cell { width: 18%; max-width: 200px; }
.crash-note-cell span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* Member profiles (/u/<name>, Your profile) */
.av-img { object-fit: cover; background: var(--panel-2); padding: 0; }
.av-lg { width: 112px; height: 112px; font-size: 2.2rem; }
.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.profile-who { flex: 1 1 280px; min-width: 0; }
.profile-who p { margin: 4px 0 0; }
.profile-bio { color: var(--text); white-space: pre-line; overflow-wrap: anywhere; max-width: 62ch; }
.profile-totals { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.profile-totals li { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.profile-totals span { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.profile-totals strong { font-size: 1.4rem; color: var(--head); font-variant-numeric: tabular-nums; }
.profile-body { max-width: 820px; }
.profile-game { padding: 12px; display: flex; gap: 14px; align-items: center; }
.profile-game img, .profile-game-ph { width: 96px; height: 54px; border-radius: 8px; object-fit: cover; flex: none; background: var(--panel-2); }
.profile-game .h3 a { color: inherit; text-decoration: none; }
.profile-game .h3 a:hover { text-decoration: underline; }
.profile-game p { margin: 2px 0 0; }
.profile-game.is-hidden { opacity: .6; }
.profile-comment-form { padding: 12px; display: flex; gap: 10px; align-items: flex-end; }
.profile-comment-form textarea { flex: 1; min-height: 44px; resize: vertical; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: inherit; }
.profile-comment { align-items: flex-start; flex-wrap: nowrap; }
.profile-comment-main { flex: 1; min-width: 0; }
.profile-comment-main p { margin: 0; }
.profile-comment-main a { color: var(--head); text-decoration: none; }
.profile-comment-body { white-space: pre-line; overflow-wrap: anywhere; margin-top: 2px !important; }
.profile-comment-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.profile-comment-actions form { margin: 0; }
.report summary { cursor: pointer; color: var(--muted-2); list-style: none; }
.report summary::-webkit-details-marker { display: none; }
.report[open] form { display: flex; gap: 6px; margin-top: 4px; }
.report input { width: 160px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: inherit; font-size: .8rem; }
.profile-edit-pic { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.profile-edit-games { border: 0; padding: 14px 0 0; margin: 14px 0 0; border-top: 1px solid var(--line-soft); }
.profile-edit-games legend { padding: 0; margin-bottom: 10px; }
.profile-edit-games .field-hint { display: block; margin-top: 8px; }
.nav-me .av-img { width: 30px; height: 30px; border-radius: 8px; }
.forum-author, .friend-name { color: inherit; text-decoration: none; }
.forum-author:hover, .friend-name:hover { text-decoration: underline; }
.forum-post-head .av-img.avatar { width: 30px; height: 30px; border-radius: 8px; }

/* Admin → Users → Moderation */
.mod-sub { margin: 26px 0 10px; }
.mod-row { align-items: flex-start; flex-wrap: nowrap; }
.mod-row-main { flex: 1; min-width: 0; }
.mod-row-main p { margin: 0; }
.mod-row-main a { color: var(--head); }
.mod-reasons { margin: 6px 0 0; padding-left: 18px; }
.mod-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 300px; }
.mod-actions form { margin: 0; }
.mod-select { min-height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); font: inherit; font-size: .8rem; }
.mod-panel { margin-top: 20px; }
.mod-profile { display: flex; gap: 16px; align-items: center; margin: 12px 0; }
.mod-profile-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mod-profile-main p { margin: 0; }
.mod-mute { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.mod-mute p { margin: 0 0 8px; }
.profile-comment { display: flex; gap: 12px; padding: 12px 16px; }
.profile-comment-av { flex: none; text-decoration: none; }
.profile-thread { padding: 4px 0; }
.profile-thread .profile-comment { padding: 10px 16px; }
.profile-comment.is-reply { margin-left: 44px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.profile-comment:target { box-shadow: inset 3px 0 0 var(--accent); }
.profile-reply { margin: 0 16px 10px 60px; }
.profile-reply summary { cursor: pointer; color: var(--muted-2); list-style: none; display: inline-block; }
.profile-reply summary::-webkit-details-marker { display: none; }
.profile-reply summary:hover { color: var(--head); }
.profile-reply form { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
.profile-reply textarea { flex: 1; min-height: 36px; resize: vertical; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: inherit; font-size: .92rem; }
@media (max-width: 600px) { .profile-comment.is-reply { margin-left: 20px; } .profile-reply { margin-left: 16px; } }
.otp-input { font: 700 1.6rem var(--mono) !important; letter-spacing: .4em; text-align: center; }
.otp-resend { color: var(--accent); text-decoration: underline; font-size: inherit; }
.devices-card { margin-top: 16px; }
.devices-card .h3 { margin: 0 0 4px; }
.devices-card .rows .row { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.form-grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.plan-slots { border: 0; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line-soft); }
.plan-slots legend { padding: 0; margin-bottom: 12px; }
.plan-slots [data-slots-summary] { margin: 12px 0 0; }
.pt-panel { margin-top: 20px; }
.pt-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0 16px; font-size: .92rem; }
.pt-facts dt { color: var(--muted); }
.pt-facts dd { margin: 0; color: var(--text); }
.pt-form { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 0; }
.pt-form .field { min-width: 0; }
.pt-form .pt-days input { width: 100px; }
.pt-form input[type=number] { width: 130px; }
.pt-limits { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.pt-panel > p.small { margin: 8px 0 0; }

/* --- Member messages (templates/messages.html: the webmail's .mx layout) ----------------------------------- */
img.mx-avatar { object-fit: cover; background: var(--panel-2); }
.mx-head-link { color: inherit; text-decoration: none; }
.mx-head-link:hover { text-decoration: underline; }
.mx-head .mx-dot { margin-right: 5px; }
.mx-seen { color: var(--muted-2); }
.mx-cant { margin: 4px 0; text-align: center; color: var(--muted-2); font-size: .9rem; }
.mx-to-row { display: flex; gap: 8px; }
.mx-to-row input { flex: 1; min-width: 0; }
.mx-new .mx-conv-name { align-self: center; }
.friend-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.friend-actions form { margin: 0; }

/* Verified tick for sysadmins (_avatar.html verified()): a tooltip on hover/focus says what it means */
.verified { --verified-fg: #0B0B0A; position: relative; display: inline-flex; vertical-align: -2px; margin-left: 3px;
  color: var(--accent-2); line-height: 0; cursor: help; border-radius: 50%; }
.verified svg { width: 1em; height: 1em; min-width: 14px; min-height: 14px; }
.h2 .verified svg, .mx-head-name .verified svg { width: .8em; height: .8em; }
.verified:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.verified::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px);
  padding: 5px 9px; border-radius: 8px; white-space: nowrap; font: 600 .75rem/1.3 var(--sans, system-ui, sans-serif); letter-spacing: 0;
  text-transform: none; color: var(--head); background: var(--panel-2); border: 1px solid var(--line-strong);
  box-shadow: 0 6px 20px rgb(0 0 0 / .45); opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; z-index: 30; }
.verified:hover::after, .verified:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
/* In the chat list the name clips its overflow, so the tooltip opens beside the tick instead of above */
.mx-conv .verified::after { left: calc(100% + 6px); bottom: auto; top: 50%; transform: translate(4px, -50%); }
.mx-conv .verified:hover::after { transform: translate(0, -50%); }
.nav-me .verified { margin-left: -4px; }
@media (prefers-reduced-motion: reduce) { .verified::after { transition: none; } }
.mx-conv-who { display: flex; align-items: center; gap: 2px; min-width: 0; }
.profile-head .head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.profile-head .head-actions form { margin: 0; }
/* The chat header sits at the top of the window: open its tooltip below the tick */
.mx-head .verified::after { bottom: auto; top: calc(100% + 8px); transform: translate(-50%, -4px); }
.mx-head .verified:hover::after, .mx-head .verified:focus-visible::after { transform: translate(-50%, 0); }
.mx-head-title { display: flex; align-items: center; gap: 4px; min-width: 0; }

/* Admin → Admins (master admin picks each admin's sections; templates/admin/admins.html) */
.admins-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.admin-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.admin-card .card-head { display: flex; justify-content: space-between; gap: 12px; }
.admin-card .who > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.admin-card .who .muted.small { flex-basis: 100%; }
.admin-sections fieldset { border: 0; margin: 0; padding: 0; }
.admin-section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 18px; }
.admin-section { align-items: flex-start; min-height: 0; padding: 6px 0; }
.admin-section > span { display: flex; flex-direction: column; gap: 2px; }
.admin-transfer summary { cursor: pointer; color: var(--muted-2); }
.admin-transfer-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.admin-transfer-form .field { margin: 0; }

/* Messenger and Mail: pin the app to the visible viewport. 100vh/100dvh can be taller than what's on screen
   (mobile toolbars, the on-screen keyboard), which pushed the composer below the fold. mail.js also follows
   visualViewport and sets --mx-h. */
.mx-body { position: fixed; inset: 0; height: auto; overscroll-behavior: none; }
.mx { position: fixed; top: 0; left: 0; right: 0; height: var(--mx-h, 100%); grid-template-rows: minmax(0, 1fr); }
.mx-main > .mx-thread, .mx-main > .mx-panel { min-height: 0; }
.mx-composer { flex-shrink: 0; }

/* Messenger: Chats | Friends switch, and the friends hub (templates/messages.html, view=friends) */
.mx-tabs { display: flex; gap: 4px; margin: 0 16px 10px; padding: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.mx-tabs a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.mx-tabs a:hover { color: var(--head); }
.mx-tabs a[aria-current="page"] { background: var(--panel-2); color: var(--head); box-shadow: inset 0 0 0 1px var(--line-strong); }
.mx-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mx-face { position: relative; display: inline-flex; flex-shrink: 0; }
.mx-online { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 2px var(--bg-2); }
.mx-add-friend { display: flex; gap: 8px; margin-left: auto; flex: 0 1 340px; min-width: 0; }
.mx-add-friend input { flex: 1; min-width: 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--text); font: inherit; font-size: .9rem; }
.mx-add-friend input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.mx-hub { gap: 22px; }
.mx-hub section { display: flex; flex-direction: column; gap: 8px; }
.mx-hub .mx-trash-row form { margin: 0; }
.mx-hub .mx-none { text-align: left; padding: 6px 0; }
.mx-friend { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.mx-friend-head { display: flex; align-items: center; gap: 12px; }
.mx-friend-head form { margin: 0; }
.mx-friend .mx-trash-main p { margin: 0; }
.mx-share { display: flex; flex-direction: column; gap: 6px; padding-left: 54px; }
.mx-share p { margin: 0; }
.mx-share fieldset { border: 0; margin: 0; padding: 0; }
@media (max-width: 760px) {
  .mx-head .mx-add-friend { flex-basis: 60%; }
  .mx-share { padding-left: 0; }
  .mx-friend-head { flex-wrap: wrap; }
}

/* Header account menu (base.html): avatar + name opens My profile, Servers, Settings, Log out */
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; padding: 4px 8px 4px 4px; min-height: 44px; border-radius: 999px; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary:hover, .nav-menu[open] > summary { background: var(--panel); }
.nav-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-menu > summary[aria-current="page"] .nav-username { color: var(--head); }
.nav-caret { color: var(--muted-2); transition: transform .15s; }
.nav-menu[open] .nav-caret { transform: rotate(180deg); }
.nav-menu-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 210px; padding: 6px; display: flex; flex-direction: column;
  border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-strong); box-shadow: 0 14px 40px rgb(0 0 0 / .5); }
.nav-menu-who { margin: 0; padding: 8px 10px 10px; font-size: .8rem; color: var(--muted-2); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.nav-menu-who strong { color: var(--head); }
.nav-menu-list a, .nav-menu-list button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; border: 0; background: none;
  color: var(--text); font: inherit; font-size: .92rem; text-decoration: none; cursor: pointer; }
.nav-menu-list a:hover, .nav-menu-list button:hover, .nav-menu-list a:focus-visible, .nav-menu-list button:focus-visible { background: var(--panel); color: var(--head); outline: none; }
.nav-menu-list a[aria-current="page"] { color: var(--head); box-shadow: inset 3px 0 0 var(--accent); }
.nav-menu-list form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.nav-menu-list button { color: var(--muted); }
.nav-menu .nav-me:hover .nav-username { text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .nav-caret { transition: none; } }

/* Header icon links (Admin, Forum, Messages): label in a tooltip below, count badge on the corner */
.nav-icon { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  color: var(--muted); text-decoration: none; }
.nav-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon:hover { color: var(--head); background: var(--panel); }
.nav-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-icon[aria-current="page"] { color: var(--head); background: var(--panel); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-icon .nav-count { position: absolute; top: 2px; right: 0; margin: 0; min-width: 17px; padding: 0 5px; font-size: .66rem; line-height: 17px;
  box-shadow: 0 0 0 2px var(--bg); }
.nav-icon::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translate(-50%, -4px);
  padding: 4px 9px; border-radius: 8px; white-space: nowrap; font: 600 .75rem/1.3 var(--sans); color: var(--head);
  background: var(--panel-2); border: 1px solid var(--line-strong); box-shadow: 0 6px 20px rgb(0 0 0 / .45);
  opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; z-index: 61; }
.nav-icon:hover::after, .nav-icon:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.nav-user:has(.nav-icon) { gap: 6px; }
.nav-user .nav-menu { margin-left: 6px; }
@media (hover: none) { .nav-icon::after { display: none; } }
@media (prefers-reduced-motion: reduce) { .nav-icon::after { transition: none; } }
