/* Beyond the Wire panel. Brand kit: palette 6B Classic Crimson, Sora / Manrope / IBM Plex Mono. */

:root {
  --bg: #0a1120; --surface: #111a2c; --line: #26344d; --text: #f3ead8; --muted: #a39c8f;
  --red: #ef4444; --on-red: #0a1120; --red-deep-fg: #fca5a5; --red-deep-bg: #450a0a;
  --ok: #4ade80; --maint: #f59e0b; --off: #8b93a3;
  --inset: #0d1526; --term-bg: #070c17; --term-text: #d9e1ee;
  --shadow: 0 1px 0 rgba(255,255,255,0.02), 0 12px 32px -18px rgba(0,0,0,0.7);
  --scrim: linear-gradient(180deg, rgba(10,17,32,0.86) 0%, rgba(10,17,32,0.92) 100%);
  --font-head: 'Sora', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f0e4; --surface: #fbf7ef; --line: #dccfb8; --text: #0b1526; --muted: #5f5a52;
    --red: #dc2626; --on-red: #fff8ee; --red-deep-fg: #991b1b; --red-deep-bg: #991b1b1f;
    --ok: #15803d; --maint: #b45309; --off: #6b7280;
    --inset: #f1e9da; --term-bg: #0b1526; --term-text: #e8eef8;
    --shadow: 0 1px 0 rgba(255,255,255,0.6), 0 12px 28px -20px rgba(60,40,10,0.35);
    --scrim: linear-gradient(180deg, rgba(246,240,228,0.80) 0%, rgba(246,240,228,0.88) 100%);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f0e4; --surface: #fbf7ef; --line: #dccfb8; --text: #0b1526; --muted: #5f5a52;
  --red: #dc2626; --on-red: #fff8ee; --red-deep-fg: #991b1b; --red-deep-bg: #991b1b1f;
  --ok: #15803d; --maint: #b45309; --off: #6b7280;
  --inset: #f1e9da; --term-bg: #0b1526; --term-text: #e8eef8;
  --shadow: 0 1px 0 rgba(255,255,255,0.6), 0 12px 28px -20px rgba(60,40,10,0.35);
  --scrim: linear-gradient(180deg, rgba(246,240,228,0.80) 0%, rgba(246,240,228,0.88) 100%);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  background-color: var(--bg);
}
body {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 64px; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 22px 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; line-height: 0; }
.brand img { height: 46px; width: auto; }
.brand .tag {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  line-height: 1; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted);
}
.logo-light { display: none; }
:root[data-theme="light"] .logo-dark { display: none; }
:root[data-theme="light"] .logo-light { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .logo-dark { display: none; }
  :root:not([data-theme="dark"]) .logo-light { display: block; }
}
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  font-family: var(--font-mono); font-size: 14px; text-decoration: none; color: var(--muted);
  padding: 8px 12px; border-radius: 8px; transition: color .15s, background-color .15s;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: color-mix(in srgb, var(--surface) 80%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.who b { color: var(--text); font-weight: 500; }
.role-pill { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--red); color: var(--red); margin-left: 6px; }

.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-mono); font-weight: 500; font-size: 14px; letter-spacing: .02em;
  border-radius: 10px; padding: 10px 16px; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap; background: transparent;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease-out), opacity .15s;
}
.btn-primary { background: var(--red); color: var(--on-red); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-ghost { color: var(--text); border-color: var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); }
.btn-ok    { color: var(--ok);    border-color: color-mix(in srgb, var(--ok) 45%, transparent);    background: color-mix(in srgb, var(--ok) 10%, transparent); }
.btn-warn  { color: var(--maint); border-color: color-mix(in srgb, var(--maint) 45%, transparent); background: color-mix(in srgb, var(--maint) 10%, transparent); }
.btn-stop  { color: var(--red-deep-fg); border-color: color-mix(in srgb, var(--red) 45%, transparent); background: var(--red-deep-bg); }
.btn-ok:hover:not(:disabled), .btn-warn:hover:not(:disabled), .btn-stop:hover:not(:disabled) { filter: brightness(1.12); }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .spinner { opacity: .7; }   /* reduced motion: a still, dimmed icon; it spins only when motion is allowed */

/* ---------- Layout bits ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px 0 24px; }
.prompt { font-family: var(--font-mono); font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.prompt .chev { color: var(--red); }
h1 { font-family: var(--font-head); font-weight: 800; font-size: clamp(32px, 4.5vw, 52px); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
h3 { font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.label { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); position: relative;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 20px; }

.win-bar { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--inset); border-radius: 13px 13px 0 0; }
.win-dots { display: flex; gap: 5px; }
.win-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: block; transition: background-color .25s; }
.win-title { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor;
}
.badge .icon { width: 13px; height: 13px; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok    { color: var(--ok);    background: color-mix(in srgb, var(--ok) 12%, transparent);    border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.badge.maint { color: var(--maint); background: color-mix(in srgb, var(--maint) 12%, transparent); border-color: color-mix(in srgb, var(--maint) 40%, transparent); }
.badge.off   { color: var(--off);   background: color-mix(in srgb, var(--off) 12%, transparent);   border-color: color-mix(in srgb, var(--off) 40%, transparent); }

/* ---------- Auth screens ---------- */
.auth { min-height: calc(100vh - 120px); display: grid; place-items: center; padding: 24px 0 64px; }
.auth .panel { width: min(440px, 100%); }
.auth .panel-body { padding: 28px; }
.auth h1 { font-size: 34px; margin-bottom: 6px; }
.auth .sub { color: var(--muted); margin-bottom: 22px; }

.field { margin-bottom: 16px; }
.field > label, .field > .label { display: block; margin-bottom: 7px; }
.input, select.input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); opacity: .75; }
.input:focus { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 20%, transparent); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }
.pw-row .btn-icon.on { color: var(--red); }
.pw-match { min-height: 1.2em; display: flex; align-items: center; gap: 6px; }
.pw-match.ok { color: var(--ok); }
.pw-match.bad { color: var(--maint); }
.pw-match .icon { width: 14px; height: 14px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.form-error {
  margin: 4px 0 14px; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  color: var(--red-deep-fg); background: var(--red-deep-bg); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
}
.full { width: 100%; padding: 13px; font-size: 15px; }

/* ---------- Server grid ---------- */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 18px; }
.server-card { display: flex; flex-direction: column; transition: border-color 150ms ease; }
.server-card:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--muted)); }
.server-card:hover .win-dots i:nth-child(1) { background: var(--red); }
.server-card:hover .win-dots i:nth-child(2) { background: var(--maint); }
.server-card:hover .win-dots i:nth-child(3) { background: var(--ok); }
.server-card .card-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.server-name { font-family: var(--font-head); font-weight: 700; font-size: 24px; line-height: 1.15; text-decoration: none; }
a.server-name:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stat { padding: 11px 13px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-val { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .label { font-size: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.empty {
  padding: 40px 24px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.empty h3 { color: var(--text); margin-bottom: 6px; }
.notice {
  display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13px;
  padding: 10px 12px; border-radius: 10px;
}
.notice.warn { color: var(--maint); background: color-mix(in srgb, var(--maint) 10%, transparent); border: 1px solid color-mix(in srgb, var(--maint) 35%, transparent); }
.notice.err  { color: var(--red-deep-fg); background: var(--red-deep-bg); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }
.notice.ok   { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }

/* ---------- Server detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 12px; }
.back:hover { color: var(--text); }
.back .icon { transform: rotate(180deg); width: 15px; height: 15px; }
.detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.tile-val { display: block; font-family: var(--font-head); font-weight: 700; font-size: 30px; line-height: 1.1; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.console { display: flex; flex-direction: column; }
.term {
  background: var(--term-bg); color: var(--term-text); font-family: var(--font-mono); font-size: 13px; line-height: 1.55;
  height: clamp(220px, 46vh, 480px); overflow: auto; padding: 14px 16px; white-space: pre-wrap; word-break: break-word;
  border-bottom: 1px solid var(--line);
}
.term .ln { display: block; }
.term .ln.warn { color: #fbbf24; }
.term .ln.error { color: #fca5a5; }
.term .ln.me { color: #93c5fd; }
.term-empty { color: #8b93a3; font-style: italic; }
.cmd-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.cmd-row .chev { font-family: var(--font-mono); color: var(--red); font-weight: 500; }
.cmd-row .input { font-family: var(--font-mono); font-size: 14px; padding: 10px 12px; }
.follow { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); cursor: pointer; }

.list { list-style: none; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .meta { font-size: 13px; color: var(--muted); }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }   /* minmax: wide tables scroll inside their box instead of widening the page */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.mono, td .mono { font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-family: var(--font-mono); font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--inset); border: 1px solid var(--line); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; max-height: 220px; overflow: auto; padding: 2px; }
.check { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: 14px; }
.check input { accent-color: var(--red); width: 16px; height: 16px; }
.check:has(input:checked) { border-color: var(--red); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { padding: 9px 14px; cursor: pointer; font-family: var(--font-mono); font-size: 13px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--red); color: var(--on-red); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: -2px; }

/* ---------- Support tickets ---------- */
.nav a { position: relative; white-space: nowrap; display: inline-flex; align-items: center; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: var(--red); color: var(--on-red); font-size: 12px; font-weight: 500; line-height: 1;
}
/* Tabs: one underline style everywhere (server sections, ticket views, player lists, billing, activity) */
.tabs { display: flex; gap: 2px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; margin-bottom: -1px;
  font-family: var(--font-mono); font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; cursor: pointer;
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--red); }
.filter-bar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.filter-bar .tabs { flex: 1; min-width: 0; margin-bottom: 0; }
.filter-select select { min-height: 38px; padding: 0 30px 0 12px; font-size: 14px; width: auto; }
@media (max-width: 640px) { .filter-bar { flex-direction: column; align-items: stretch; } .filter-select select { width: 100%; } }
.ticket-list { list-style: none; }
.ticket-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 16px 20px; border-top: 1px solid var(--line); text-decoration: none; transition: background-color .15s;
}
.ticket-list li:first-child .ticket-row { border-top: 0; }
.ticket-row:hover { background: color-mix(in srgb, var(--inset) 70%, transparent); }
.ticket-row .unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.ticket-row .unread-dot.read { background: transparent; }
.ticket-title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--muted); margin-top: 3px; }
.ticket-meta .mono { font-size: 12px; }
.ticket-snippet { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.ticket-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.badge.st-open        { color: var(--red);   background: color-mix(in srgb, var(--red) 10%, transparent);   border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.badge.st-in_progress { color: var(--maint); background: color-mix(in srgb, var(--maint) 12%, transparent); border-color: color-mix(in srgb, var(--maint) 40%, transparent); }
.badge.st-resolved    { color: var(--ok);    background: color-mix(in srgb, var(--ok) 12%, transparent);    border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.badge.st-closed      { color: var(--off);   background: color-mix(in srgb, var(--off) 12%, transparent);   border-color: color-mix(in srgb, var(--off) 40%, transparent); }
.urgent { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }

.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.thread { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.msg { max-width: 82%; }
.msg.mine { align-self: flex-end; }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.msg.mine .msg-head { justify-content: flex-end; }
.msg-head b { color: var(--text); font-weight: 700; }
.staff-pill { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; background: var(--red); color: var(--on-red); }
.msg-body {
  white-space: pre-wrap; word-break: break-word; padding: 12px 15px; border-radius: 14px; font-size: 15px;
  background: var(--inset); border: 1px solid var(--line);
}
.msg.staff .msg-body { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.msg.mine .msg-body { background: color-mix(in srgb, var(--red) 12%, var(--surface)); border-color: color-mix(in srgb, var(--red) 30%, var(--line)); }
.reply { border-top: 1px solid var(--line); padding: 16px 20px; }
/* Ticket composer: emoji, attachments, @mentions */
.composer { position: relative; }
.composer-tools { position: relative; display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.composer-tools .btn-sm { gap: 6px; }
textarea.input.drop { outline: 2px dashed var(--red); outline-offset: 2px; }
.emoji-pop { position: absolute; z-index: 30; left: 0; bottom: calc(100% + 6px); width: min(340px, calc(100vw - 48px)); max-height: 280px; overflow: auto;
  padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.emoji-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 6px 2px 4px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 2px; }
.emoji-grid button { font-size: 20px; line-height: 1; padding: 6px 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--inset); }
.attach-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attach-chip { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 6px 6px 8px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); font-size: 13px; }
.attach-chip img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; }
.attach-chip .icon { width: 20px; height: 20px; color: var(--muted); }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.attach-chip small { color: var(--muted); }
.btn-x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.btn-x:hover { color: var(--text); background: var(--surface); }
.mention-pop { position: absolute; z-index: 30; left: 20px; right: 20px; bottom: calc(100% - 14px); list-style: none; max-width: 320px; padding: 6px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.field.composer .mention-pop { left: 0; bottom: auto; top: 100%; }
.mention-pop li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.mention-pop li .icon { width: 15px; height: 15px; color: var(--muted); }
.mention-pop li small { margin-left: auto; color: var(--muted); font-size: 12px; }
.mention-pop li[aria-selected="true"], .mention-pop li:hover { background: var(--inset); }
.mention { color: var(--red); font-weight: 700; }
.mention.me { background: color-mix(in srgb, var(--red) 18%, transparent); border-radius: 5px; padding: 0 3px; }
.mention-badge { font-family: var(--font-mono); font-size: 12px; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); font-weight: 700; }
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg.mine .msg-files { justify-content: flex-end; }
.msg-img { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--inset); }
.msg-img img { display: block; max-width: min(260px, 100%); max-height: 200px; object-fit: contain; }
.msg-doc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--inset); color: var(--text); text-decoration: none; max-width: 100%; }
.msg-doc:hover { border-color: var(--red); }
.msg-doc .icon { width: 22px; height: 22px; color: var(--red); flex: none; }
.msg-doc span { display: flex; flex-direction: column; min-width: 0; }
.msg-doc b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-doc small { color: var(--muted); font-size: 12px; }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.5; font-family: var(--font-body); }
.reply-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.facts { list-style: none; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts li:first-child { border-top: 0; padding-top: 0; }
.facts li span:first-child { color: var(--muted); }
.side-actions { display: grid; gap: 8px; margin-top: 16px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
@media (max-width: 980px) { .ticket-layout { grid-template-columns: 1fr; } .msg { max-width: 100%; } }
@media (max-width: 640px) { .ticket-row { grid-template-columns: auto minmax(0, 1fr); } .ticket-side { grid-column: 2; flex-direction: row; align-items: center; } }

/* ---------- Billing ---------- */
.bill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.bill-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.bill-amount { font-family: var(--font-head); font-weight: 800; font-size: 34px; line-height: 1; }
.bill-amount small { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.bill-desc { font-weight: 700; font-size: 16px; }
.bill-sub { font-size: 13px; color: var(--muted); }
.badge.ch-unpaid   { color: var(--red);   background: color-mix(in srgb, var(--red) 10%, transparent);   border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.badge.ch-active, .badge.ch-paid, .badge.pay-paid { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.badge.ch-past_due, .badge.pay-failed { color: var(--maint); background: color-mix(in srgb, var(--maint) 12%, transparent); border-color: color-mix(in srgb, var(--maint) 40%, transparent); }
.badge.ch-canceled, .badge.ch-void, .badge.pay-refunded, .badge.pay-partially_refunded { color: var(--off); background: color-mix(in srgb, var(--off) 12%, transparent); border-color: color-mix(in srgb, var(--off) 40%, transparent); }
.section-gap { margin-top: 26px; }
.cap-note { padding: 10px 18px; margin: 0; }
.checklist { list-style: none; display: grid; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.checklist .icon { width: 18px; height: 18px; }
.checklist .ok-i { color: var(--ok); }
.checklist .bad-i { color: var(--maint); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Mods ---------- */
.mods { margin-top: 18px; }
.mods-body { display: flex; flex-direction: column; gap: 18px; }
.mods-settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.mods-settings .field { margin: 0; min-width: 180px; }
.mods-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mods-find { display: flex; flex-direction: column; gap: 14px; }
.mod-list { list-style: none; display: flex; flex-direction: column; }
.mod-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.mod-item:first-child { border-top: 0; }
.mod-item img, .mod-noicon { width: 48px; height: 48px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); object-fit: cover; }
.mod-title { font-size: 15px; }
.mod-desc { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mod-item .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mod-item .meta a { color: var(--red); }
.mod-item .meta .icon { width: 12px; height: 12px; vertical-align: -1px; }
.mods-side { display: flex; flex-direction: column; gap: 18px; }
.mods-queue, .mods-installed { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--inset); }
.mods-side h3 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 17px; }
.mods-side .list li { padding: 8px 0; }
.mod-mini { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.mod-mini img { border-radius: 6px; }
.mod-file { font-size: 13px; overflow-wrap: anywhere; flex: 1; }
.queue-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.queue-actions .btn { white-space: normal; text-align: center; }
#install-result { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
#install-result .notice { font-family: var(--font-body); font-size: 13.5px; align-items: flex-start; }
#install-result .notice a { color: inherit; text-decoration: underline; font-weight: 700; }
.notice:not(.ok):not(.err):not(.warn) { color: var(--muted); border: 1px solid var(--line); }
@media (max-width: 980px) { .mods-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .queue-actions { grid-template-columns: 1fr; } .mod-item { grid-template-columns: 40px minmax(0, 1fr); } .mod-item .btn { grid-column: 2; justify-self: start; } }

/* ---------- Website order tickets ---------- */
.ticket-side-col { display: flex; flex-direction: column; gap: 18px; }
.order-card { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.order-total { font-family: var(--font-head); font-weight: 800; font-size: 34px; line-height: 1; margin-bottom: 16px; }
.order-total small { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.order-card .facts li span:last-child { text-align: right; overflow-wrap: anywhere; }
.order-card a:not(.btn) { color: var(--red); }
.order-card .side-actions .btn { white-space: normal; text-align: center; width: 100%; min-width: 0; }

/* ---------- Setup (collapsible) & pay dialog ---------- */
details.setup > summary { list-style: none; cursor: pointer; }
details.setup > summary::-webkit-details-marker { display: none; }
details.setup > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-left: 12px; transition: transform .2s; }
details.setup[open] > summary::after { transform: rotate(225deg); }
details.setup:not([open]) > summary { border-bottom: 0; }
#setup-state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
#setup-state .icon { width: 14px; height: 14px; }
.ok-text { color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.warn-text { color: var(--maint); display: inline-flex; align-items: center; gap: 6px; }
dialog.pay-dialog { width: min(1000px, calc(100vw - 24px)); }
.pay-dialog .panel-head { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.pay-dialog #pay-mount { min-height: 220px; }
.hint .icon { width: 13px; height: 13px; vertical-align: -2px; }

/* ---------- Dialog ---------- */
dialog {
  margin: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
dialog::backdrop { background: rgba(5, 9, 18, .6); }
dialog .panel-body { padding: 22px; }
dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
dialog .dialog-actions .spacer { flex: 1; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px -16px rgba(0,0,0,.6);
}
.toast.ok .icon { color: var(--ok); }
.toast.err { border-color: color-mix(in srgb, var(--red) 50%, var(--line)); }
.toast.err .icon { color: var(--red); }

.skeleton { display: block; height: 14px; border-radius: 4px; background: var(--line); }

/* ---------- Motion ----------
   Product rules (web-animation-design): the panel is used many times a day, so page changes are a
   quick fade and nothing slides; the entrance plays once, on the first page after signing in.
   Enter/exit = ease-out; things that move on screen = ease-in-out; hover = colour only.
   Movement is opted in under prefers-reduced-motion: no-preference; with reduce, nothing animates. */
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes soft-pulse { 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* Dialogs: open 200ms from 96% (grow from the button that opened them), close ~20% faster.
   Dialog and backdrop share timing so they move as one. */
dialog, dialog::backdrop {
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out), overlay 160ms allow-discrete, display 160ms allow-discrete;
}
dialog { opacity: 0; transform: scale(.96); }
dialog[open] { opacity: 1; transform: none; transition-duration: 200ms; }
dialog::backdrop { opacity: 0; }
dialog[open]::backdrop { opacity: 1; transition-duration: 200ms; }
@starting-style {
  dialog[open] { opacity: 0; transform: scale(.96); }
  dialog[open]::backdrop { opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .view { animation: fade-in 150ms var(--ease-out) both; }
  #app.app-enter .view > * { animation: rise-in 300ms var(--ease-out) both; }
  #app.app-enter .view > :nth-child(2) { animation-delay: 40ms; }
  #app.app-enter .view > :nth-child(3) { animation-delay: 80ms; }
  #app.app-enter .view > :nth-child(n+4) { animation-delay: 120ms; }
  #app.app-enter .server-grid > * { animation: rise-in 300ms var(--ease-out) both; animation-delay: calc(60ms + min(var(--i, 0), 6) * 40ms); }
  .btn:active:not(:disabled) { transform: scale(.97); transition-duration: 60ms; }
  .btn .spinner { animation: spin .8s linear infinite; opacity: 1; }
  .skeleton { animation: soft-pulse 1.4s ease-in-out infinite; }
  .toast { animation: rise-in 200ms var(--ease-out) both; }
  .form-error { animation: rise-in 200ms var(--ease-out), shake .4s var(--ease-in-out) 200ms; }
  .menu[open] .menu-pop { animation: menu-in 150ms var(--ease-out) both; transform-origin: top right; }
  .more-sheet:not([hidden]) { animation: sheet-in 200ms var(--ease-out) both; transform-origin: bottom center; }
  .tab-panel:not([hidden]) { animation: fade-in 120ms var(--ease-out) both; }
}
@keyframes menu-in { from { opacity: 0; transform: scale(.96); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  dialog, dialog::backdrop { transition: none; }
  .btn, .input, .nav a { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .detail-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .term { height: 360px; font-size: 12px; }
  .stat-val { font-size: 16px; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}

/* ===== Shared by beyondthewire.us, status and panel (keep identical in all three) =====
   Header, Home · Status · Log in switcher, and buttons: same sizes and contrast everywhere. */
:root { --btn-line: color-mix(in srgb, var(--muted) 55%, var(--line)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; line-height: 0; text-decoration: none; }
.brand img { height: 52px; width: auto; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.btn { min-height: 46px; font-size: 15px; padding: 0 18px; border-radius: 10px; }
.btn-sm { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: 8px; }
.btn-icon { width: 46px; padding: 0; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--btn-line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--text); }
.sitenav { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--btn-line); border-radius: 12px; box-shadow: var(--shadow); }
.sitenav a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 8px; font-family: var(--font-mono); font-weight: 500; font-size: 15px; color: var(--text); text-decoration: none; white-space: nowrap; text-shadow: none; }
.sitenav a:hover { background: var(--inset); }
.sitenav a[aria-current="page"] { background: var(--red); color: var(--on-red); }
.sitenav .icon { width: 17px; height: 17px; }
@media (max-width: 640px) {
  .brand img { height: 38px; }
  .top-actions { width: 100%; }
  .sitenav { flex: 1; }
  .sitenav a { flex: 1; padding: 0 6px; gap: 6px; font-size: 14px; }
}

/* ===== Panel app shell (signed in): sidebar on wide screens, bottom tab bar on phones =====
   The same #appbar element is both; body.in-app switches the layout and the slim footer. */
.appbar { display: none; }
body.in-app .site-footer { display: none; }
.app-footer { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 56px; padding: 18px 0 8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* A calm backdrop inside the app: the photo stays on the sign-in page, the site and the status page. */
html:has(body.in-app) { background: radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--red) 7%, transparent), transparent 60%), var(--bg); }

.nav a, .nav-more { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--font-mono); font-weight: 500; font-size: 14px; border-radius: 8px; background: none; border: 0; cursor: pointer; white-space: nowrap; position: relative; }
.nav .icon { width: 18px; height: 18px; color: var(--muted); }
.nav a[aria-current="page"] .icon { color: var(--red); }
.side-brand, .side-search, .side-sites { display: none; }
kbd { font-family: var(--font-mono); font-size: 12px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); background: var(--inset); }

@media (min-width: 981px) {
  body.in-app .wrap { display: grid; grid-template-columns: 236px minmax(0, 1fr); column-gap: clamp(24px, 3vw, 44px); max-width: 1600px; }
  body.in-app .wrap > * { grid-column: 2; }
  body.in-app .topbar { display: none; }
  body.in-app .appbar {
    display: flex; flex-direction: column; gap: 14px; grid-column: 1; grid-row: 1 / span 20;
    position: sticky; top: 0; align-self: start; height: 100vh; padding: 22px 0 18px;
  }
  .side-brand { display: block; line-height: 0; padding: 0 6px 6px; }
  .side-brand img { height: 40px; width: auto; }
  .side-search { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--btn-line); background: var(--surface); color: var(--muted); font-family: var(--font-mono); font-size: 14px; cursor: pointer; }
  .side-search:hover { color: var(--text); border-color: var(--muted); }
  .side-search kbd { margin-left: auto; }
  body.in-app .appbar .nav { display: flex; flex-direction: column; gap: 2px; margin: 0; }
  .nav a { min-height: 40px; padding: 0 12px; }
  .nav a:hover { background: var(--surface); }
  .nav a[aria-current="page"] { background: var(--surface); box-shadow: inset 2px 0 0 var(--red), inset 0 0 0 1px var(--line); }
  .nav .nav-badge { margin-left: auto; position: static; }
  .nav-more, .more-sheet { display: none !important; }
  body.in-app .appbar-user { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
  body.in-app .appbar-user .who { font-size: 13px; }
  body.in-app .appbar-user .btn { justify-self: start; }
  /* same rows as the Home office sidebar footer */
  .side-sites { display: flex; flex-direction: column; gap: 2px; }
  .side-sites a { display: flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
  .side-sites a:hover { background: var(--surface); }
  body.in-app .demo-banner { margin-top: 22px; }
  body.in-app main#app { padding-top: 22px; }
}

@media (max-width: 980px) {
  /* compact header: logo, search, theme; the site switcher lives under More */
  body.in-app .topbar { padding-top: 14px; padding-bottom: 10px; flex-wrap: nowrap; }
  body.in-app .topbar .brand img { height: 34px; }
  body.in-app .topbar .brand .tag, body.in-app .sitenav { display: none; }
  body.in-app .top-actions { width: auto; }
  body.in-app .top-actions .btn-icon { width: 42px; min-height: 42px; }
  body.in-app .appbar {
    display: block; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  body.in-app .appbar .nav { display: flex; justify-content: space-around; gap: 2px; margin: 0; }
  .nav a, .nav-more { flex: 1; flex-direction: column; justify-content: center; gap: 2px; min-height: 54px; padding: 4px 2px; font-size: 12px; color: var(--muted); }
  .nav .icon { width: 22px; height: 22px; }
  .nav a[aria-current="page"] { background: none; box-shadow: none; }
  .nav a[aria-current="page"], .nav a[aria-current="page"] .icon { color: var(--text); }
  .nav a[aria-current="page"]::before { content: ''; position: absolute; top: -6px; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--red); }
  .nav [data-more] { display: none !important; }
  .nav .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); }
  body.in-app .appbar-user { display: none; }
  body.in-app .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .more-sheet {
    position: fixed; z-index: 41; left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom));
    background: var(--surface); border: 1px solid var(--btn-line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px;
  }
  .more-sheet nav { display: grid; gap: 2px; }
  .more-sheet nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-family: var(--font-mono); font-size: 15px; }
  .more-sheet nav a[aria-current="page"] { background: var(--inset); }
  .more-sheet .icon { color: var(--muted); }
  .more-sheet .more-foot { display: flex; align-items: center; gap: 16px; padding: 10px 12px 4px; margin-top: 6px; border-top: 1px solid var(--line); font-size: 14px; }
  .more-sheet .more-foot a { color: var(--muted); text-decoration: none; }
  .more-sheet .more-foot .btn { margin-left: auto; }
}

/* Quick search (Ctrl K) */
dialog.qs { width: min(640px, calc(100vw - 24px)); margin: 12vh auto auto; padding: 0; border-radius: 14px; }
.qs-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.qs-field .icon { color: var(--muted); }
.qs-field input { flex: 1; min-width: 0; min-height: 54px; background: none; border: 0; outline: none; font-size: 17px; color: var(--text); }
.qs-field input::-webkit-search-cancel-button { display: none; }
.qs-list { list-style: none; max-height: min(420px, 60vh); overflow: auto; padding: 6px; }
.qs-list li[role="option"] { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 10px; border-radius: 10px; cursor: pointer; }
.qs-list li[aria-selected="true"] { background: var(--inset); box-shadow: inset 2px 0 0 var(--red); }
.qs-list .icon { color: var(--muted); }
.qs-label { display: grid; min-width: 0; }
.qs-label, .qs-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-label small { color: var(--muted); font-size: 13px; }
.qs-kind { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.qs-empty { padding: 18px 12px; color: var(--muted); }

/* severity (Sev 1 most urgent) */
.sev { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--btn-line); color: var(--muted); }
.sev.sev-1 { background: var(--red); border-color: var(--red); color: var(--on-red); }
.sev.sev-2 { border-color: var(--red); color: var(--red); }
.ticket-side { gap: 8px; }
.impact { border: 0; padding: 0; margin: 0 0 4px; display: grid; gap: 8px; }
.impact .check { width: fit-content; }
.linkish { background: none; border: 0; padding: 0; color: var(--red); font: inherit; text-decoration: underline; cursor: pointer; }
.mods-updates:empty { display: none; }
.mods-updates h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mods-updates h3 .btn { margin-left: auto; }
.mods-updates { margin-bottom: 18px; }
#launcher .facts { margin-bottom: 12px; }
#launcher .notice { margin-top: 10px; }

/* upgrade cart */
.cart-dialog { width: min(620px, calc(100vw - 32px)); }
.cart-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.cart-plan { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--btn-line); border-radius: 10px; cursor: pointer; background: var(--surface); }
.cart-plan:has(input:checked) { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.cart-plan.is-lower { opacity: .5; cursor: not-allowed; }
.cart-plan input { accent-color: var(--red); margin-top: 3px; }
.cart-plan small { display: block; color: var(--muted); font-size: 13px; }
.cart-addons { display: grid; gap: 8px; margin-top: 8px; }
.cart-addons .check { width: auto; flex-wrap: wrap; gap: 8px; }
.cart-addons .mono, .cart-ram .mono { font-family: var(--font-mono); font-size: 13px; color: var(--red); }
.cart-ram { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--btn-line); border-radius: 10px; }
.cart-ram .stepper { display: inline-flex; align-items: center; gap: 10px; }
.cart { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--inset); border: 1px solid var(--line); }
.cart h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cart-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cart-lines li { display: flex; justify-content: space-between; gap: 12px; }
.cart-total { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .cart-plans { grid-template-columns: 1fr; } }

/* acknowledgement */
.ack { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; white-space: nowrap; border: 1px dashed var(--btn-line); color: var(--muted); }
.ack .icon { width: 12px; height: 12px; }
.ack.ok { border-style: solid; color: var(--text); }
.ack.need.mine { border: 1px solid var(--red); color: var(--red); font-weight: 600; }
.ack-card.sev-1 { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.ack-card.sev-2 { border-color: var(--red); }
.ack-card p { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; margin: 0; }
.nav-badge.sev-1 { background: var(--red); color: var(--on-red); }

/* demo */
.demo-cta { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.demo-cta p { font-size: 15px; color: var(--muted); }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 10px 0 14px; padding: 10px 14px;
  border-radius: 12px; border: 1px solid var(--red); background: color-mix(in srgb, var(--red) 10%, var(--surface)); font-size: 15px; }
.demo-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* automatic-renewal consent + subscription actions */
.consent { max-width: 560px; }
.consent-box { margin-top: 14px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--inset); }
.consent-box ul { margin: 10px 0 0 18px; display: grid; gap: 6px; font-size: 15px; }
.consent-price { font-family: var(--font-head); font-size: 28px; font-weight: 700; margin-top: 4px; }
.consent-price span { font-size: 15px; color: var(--muted); font-weight: 400; }
.consent-check { margin-top: 14px; width: auto; align-items: flex-start; line-height: 1.45; }
.consent-check a { color: var(--red); }
.sub-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ===== Shared footer (identical on beyondthewire.us, status and panel) ===== */
.site-footer { margin-top: 72px; padding: 36px 0 40px; border-top: 1px solid var(--line); font-size: 15px; color: var(--on-photo-muted, var(--muted)); display: block; font-family: var(--font-body); }
.site-footer a { color: var(--text); text-decoration: none; border: 0; }
.site-footer a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.sf-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 28px 32px; }
.sf-brand { display: grid; gap: 10px; align-content: start; max-width: 40ch; }
.sf-logo { display: inline-flex; align-items: center; gap: 12px; }
.site-footer .sf-logo:hover { text-decoration: none; color: var(--text); }
.sf-logo img { width: 32px; height: 32px; }
.sf-logo span { font-family: var(--font-head); font-weight: 700; font-size: 18px; line-height: 1.1; display: grid; }
.sf-logo small { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sf-col { display: grid; gap: 8px; align-content: start; }
.sf-col h2 { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; text-shadow: none; }
.sf-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; font-family: var(--font-mono); font-size: 12.5px; }
.sf-fine { opacity: .85; }
.site-footer, .site-footer p { text-shadow: var(--photo-halo, none); }
@media (max-width: 900px) { .sf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sf-brand { grid-column: 1 / -1; max-width: none; } }
@media (max-width: 560px) { .sf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sf-col a { padding: 4px 0; } }

/* suspensions */
.badge.susp { background: var(--red); color: var(--on-red); border-color: var(--red); }
.suspend-notice { border: 1px solid var(--red); border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; background: color-mix(in srgb, var(--red) 10%, var(--surface)); display: grid; gap: 8px; }
.server-card .suspend-notice { margin: 0; padding: 10px 12px; }
.sn-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sn-head .icon { color: var(--red); }
.sn-count { margin-left: auto; font-family: var(--font-mono); font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--red); color: var(--on-red); }
.sn-msg { white-space: pre-wrap; }
.sn-warn { font-size: 15px; }
.sn-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sn-actions:empty { display: none; }

/* status page listing */
.listing-form { display: grid; gap: 12px; }
.listing-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; }
.listing-form .btn { justify-self: start; }
.listing-staff { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ok-text { color: var(--ok); }
@media (max-width: 640px) { .listing-fields { grid-template-columns: 1fr; } }

/* account setup */
.nav-badge.alert { background: var(--red); color: var(--on-red); }
.setup-notice { margin-bottom: 16px; }
.setup-notice a { color: inherit; font-weight: 700; margin-left: 6px; }
.prof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.prof-wide, .prof-prefs { grid-column: 1 / -1; }
.prof-prefs { border: 0; padding: 0; margin: 0; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-row .check { width: auto; }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--inset); }
.pay-card { display: flex; align-items: center; gap: 12px; }
.pay-card .icon { width: 28px; height: 28px; color: var(--red); }
.autopay-check { margin-top: 14px; width: auto; align-items: flex-start; }
.autopay-terms { margin-top: 6px; }
.setup-steps { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; counter-reset: st; }
.setup-steps li { counter-increment: st; font-family: var(--font-mono); font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.setup-steps li::before { content: counter(st) ". "; }
.setup-steps li.cur { border-color: var(--red); color: var(--text); }
.setup-steps li.done { color: var(--ok); border-color: var(--ok); }
.setup-actions { margin-top: 18px; display: flex; justify-content: flex-end; }
@media (max-width: 640px) { .prof-grid { grid-template-columns: 1fr; } }

/* activity + read-only account view */
.activity-search { margin: 0 0 12px; max-width: 560px; }
.kind-pill { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: 4px; }
.kind-pill.k-staff { border-color: var(--red); color: var(--red); }
.kind-pill.k-customer { border-color: var(--ok); color: var(--ok); }
.ro-pill { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); margin-right: 6px; }
.ro-pill .icon { width: 13px; height: 13px; }
.person-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* server builder */
.builder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.builder-head p { max-width: 70ch; }
.builder-facts { margin-bottom: 12px; }
table.ports td, table.ports th { padding-top: 6px; padding-bottom: 6px; }
table.ports tr.free td { color: var(--muted); }
.build-dialog { width: min(720px, calc(100vw - 32px)); }
.build-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.res-form { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 170px) auto; justify-content: start; align-items: end; gap: 10px 14px; margin-top: 14px; }
.res-form .field:last-child { grid-column: 1 / -1; }
@media (max-width: 640px) { .build-grid, .res-form { grid-template-columns: 1fr; } }

/* Players card */
.pl-add { margin-bottom: 14px; }
.pl-add .input-row { flex-wrap: wrap; }
.pl-add .input-row .input { min-width: 160px; }
.pl-self { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 6px; }
.pl-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pl-list li { flex-wrap: wrap; }
@media (max-width: 560px) { .pl-acts { justify-content: flex-start; width: 100%; } }

/* Ticket assignee */
.ticket-meta .assignee { color: var(--text); font-weight: 600; }

/* Build tickets: allocation preview and build sheet */
.alloc { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--inset); border: 1px solid var(--line); }
.alloc h3 { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.alloc .facts li { padding: 6px 0; font-size: 13.5px; }
.code-block { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; }
.build-card .facts li span:last-child { text-align: right; overflow-wrap: anywhere; }
tr.reserved td { background: color-mix(in srgb, var(--maint) 8%, transparent); }
.missing-tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--red); color: var(--red); white-space: nowrap; }
.btn-danger-ghost { color: var(--red); }
.reserved-tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--maint); color: var(--maint); }
.wl-reason { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); margin-top: 6px; }

/* ===== Design tokens (same names in site/styles.css and the status page) =====
   Spacing, radius, type and motion steps. Colours stay per site (the palettes above). */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px;
  --text-xs: 12px; --text-sm: 14px; --text-md: 16px; --text-lg: 20px;
  --dur-fast: 120ms; --dur: 200ms; --dur-slow: 300ms;
  --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Buttons inside the panel: the main action is a calm solid; red means "this can hurt" (Stop, Ban, Suspend, Delete). */
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover:not(:disabled) { filter: none; background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.btn-danger { background: var(--red); color: var(--on-red); border-color: var(--red); }
.btn-danger:hover:not(:disabled) { filter: brightness(1.06); }
.btn-block { width: auto; }

/* Server page: pinned header (name, status, power, More) with section tabs */
.server-head { position: sticky; top: 0; z-index: 20; margin: 0 calc(-1 * var(--space-2)); padding: 0 var(--space-2); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); margin-bottom: var(--space-5); }
.server-head .page-head { padding: 12px 0 10px; align-items: center; }
.server-head h1 { font-size: clamp(28px, 4vw, 40px); }
.server-head .prompt { margin-bottom: 2px; }
.server-head .tabs { margin-bottom: 0; border-bottom: 0; }
.tab-panel > .panel + .panel, .tab-panel > section + section { margin-top: 18px; }

/* "More" menu (details/summary) */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 260px; padding: 6px; background: var(--surface); border: 1px solid var(--btn-line); border-radius: var(--radius); box-shadow: var(--shadow), 0 18px 40px -18px rgba(0,0,0,.55); }
.menu-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); text-align: left; cursor: pointer; font-family: var(--font-body); font-size: 15px; }
.menu-item:hover, .menu-item:focus-visible { background: var(--inset); }
.menu-item span { display: grid; }
.menu-item small { color: var(--muted); font-size: 13px; }
.menu-item.danger, .menu-item.danger .icon { color: var(--red-deep-fg); }
.menu-item .icon { margin-top: 2px; }

@media (max-width: 640px) {
  .server-head { top: 0; }
  .server-head .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .server-head .page-head .actions { flex-wrap: nowrap; }
  .server-head #power { flex: 1; }
  .server-head #power .btn { flex: 1; min-height: 42px; padding: 0 10px; }
  .server-head .prompt { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .term { height: clamp(180px, 34vh, 320px); }
}

/* Buttons sit at their natural width in panels (no full-width slabs); phones get full-width rows. */
.panel-body > .side-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-body > .side-actions .btn { width: auto; }
@media (max-width: 640px) { .panel-body > .side-actions .btn { flex: 1 1 auto; } }
/* Port table: in-use, reserved and the next two free slots; "Show all" for the rest */
table.ports.collapsed tr.extra { display: none; }
#ports-all { margin-top: 10px; }

section.panel + section.panel { margin-top: 18px; }

.seg { display: inline-flex; padding: 3px; border: 1px solid var(--btn-line); border-radius: 10px; background: var(--surface); }
.seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-family: var(--font-mono); font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--inset); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}
/* Before the first screen is drawn: keep the footer out of the way (it would otherwise sit at the
   top and jump down) and show a small loader after a short delay, so fast loads never flash it. */
#app:empty { min-height: 60vh; display: grid; place-items: center; }
#app:empty ~ .site-footer { display: none; }
#app:empty::before { content: ''; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--red);
  opacity: 0; animation: boot-in .2s .35s forwards; }
@media (prefers-reduced-motion: no-preference) { #app:empty::before { animation: boot-in .2s .35s forwards, spin .8s linear infinite; } }
@keyframes boot-in { to { opacity: 1; } }
