/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  /* Neutrals are tinted toward the logo's shield (#171a21). */
  --bg: #0b0c10;
  --bg-subtle: #0f1115;
  --panel: #14161c;
  --panel-raised: #191c23;
  --hover: #1f222a;
  --border: #242730;
  --border-strong: #2f333d;

  --text: #eceef2;
  --text-2: #a3a8b4;
  --text-3: #6c717d;

  /* Brand red from the logo (#ff4d5a). Buttons use a slightly deeper shade for text contrast. */
  --red: #ff4d5a;
  --red-button: #e8404e;
  --red-hover: #d63443;
  --red-press: #bd2a38;
  --red-text: #ff8a93;
  --red-soft: rgba(255, 77, 90, 0.1);
  --red-line: rgba(255, 77, 90, 0.32);

  --green: #4cc38a;
  --green-soft: rgba(76, 195, 138, 0.1);
  --amber: #f1a10d;
  --amber-soft: rgba(241, 161, 13, 0.1);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  --topbar: 56px;
  --sidebar: 240px;
  --sidebar-collapsed: 60px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.2, 0, 0, 1);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: rgba(255, 77, 90, 0.35); }

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

.sprite { display: none; }
.icon { width: 16px; height: 16px; flex: none; }
.icon-xs { width: 12px; height: 12px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.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;
}
.clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ==========================================================================
   Brand
   ========================================================================== */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand-mark { width: 28px; height: 28px; flex: none; object-fit: contain; }
.brand-name { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; white-space: nowrap; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; line-height: 1;
  white-space: nowrap; cursor: pointer; user-select: none;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn .icon { width: 15px; height: 15px; margin-left: -2px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14.5px; }

.btn-primary { background: var(--red-button); color: #fff; }
.btn-primary:hover { background: var(--red-hover); }
.btn-primary:active { background: var(--red-press); }

.btn-secondary { background: var(--panel-raised); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--hover); border-color: #3a3a41; }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }

.btn.is-disabled { opacity: 0.4; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border-radius: var(--radius); border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .icon { width: 17px; height: 17px; }
.icon-btn-sm { width: 28px; height: 28px; border-radius: var(--radius-sm); }
.icon-btn-sm .icon { width: 15px; height: 15px; }
.icon-btn-danger:hover { background: var(--red-soft); color: var(--red-text); }

.link-quiet { color: var(--text-2); font-size: 13px; transition: color 0.15s; }
.link-quiet:hover { color: var(--text); }
.link-ext { display: inline-flex; align-items: center; gap: 4px; color: var(--red-text); }
.link-ext:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-id:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Forms
   ========================================================================== */
.input {
  width: 100%; height: 36px; padding: 0 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font: inherit; font-size: 13.5px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input.mono { font-family: var(--mono); font-size: 13px; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: #3a3a41; }
.input:focus { outline: none; border-color: var(--red-line); box-shadow: 0 0 0 3px var(--red-soft); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); padding: 0; }
.field-optional { color: var(--text-3); font-weight: 400; margin-left: 4px; }
.field-hint { font-size: 12px; color: var(--text-3); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.form-actions-start { justify-content: flex-start; }

.checkbox {
  appearance: none; flex: none; margin: 0;
  width: 16px; height: 16px;
  display: inline-grid; place-content: center;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 4px;
  cursor: pointer; transition: background-color 0.15s, border-color 0.15s;
}
.checkbox::after {
  content: ""; width: 8px; height: 4.5px; margin-top: -2px;
  border: 1.75px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(0); transition: transform 0.12s var(--ease);
}
.checkbox:checked { background: var(--red-button); border-color: var(--red-button); }
.checkbox:checked::after { transform: rotate(-45deg) scale(1); }
.checkbox:hover { border-color: #45454d; }

.choice-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer; }
.choice + .choice { border-top: 1px solid var(--border); }
.choice:hover { background: var(--panel-raised); }
.choice .checkbox { margin-top: 2px; }
.choice-label { display: block; font-size: 13.5px; color: var(--text); }
.choice-hint { display: block; font-size: 12.5px; color: var(--text-3); }

/* ==========================================================================
   Badges, alerts
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 1px solid var(--border-strong); color: var(--text-2);
  vertical-align: middle;
}
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-red { color: var(--red-text); background: var(--red-soft); border-color: transparent; }
.badge-green { color: var(--green); background: var(--green-soft); border-color: transparent; }
.badge-amber { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.badge-muted { color: var(--text-2); background: var(--panel-raised); border-color: var(--border); }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; margin-bottom: 20px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--panel); font-size: 13.5px;
}
.alert-icon { margin-top: 2px; }
.alert-success { border-color: rgba(76, 195, 138, 0.28); background: var(--green-soft); }
.alert-success .alert-icon { color: var(--green); }
.alert-error { border-color: var(--red-line); background: var(--red-soft); }
.alert-error .alert-icon { color: var(--red-text); }

.inline-note { padding: 10px 16px; font-size: 12.5px; color: var(--amber); border-bottom: 1px solid var(--border); }

.quote {
  margin: 12px 0 0; padding: 10px 14px;
  border-left: 2px solid var(--border-strong);
  background: var(--panel-raised); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2); white-space: pre-wrap;
}

/* ==========================================================================
   App shell
   ========================================================================== */
.app { min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar); padding: 0 14px 0 12px;
  background: rgba(11, 12, 16, 0.86);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-divider { width: 1px; height: 20px; background: var(--border-strong); }
.topbar-title { color: var(--text-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar-end form { margin: 0; }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-raised); }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip-name { font-size: 13px; color: var(--text); }
.user-chip-role { font-size: 11.5px; color: var(--text-3); }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar));
  transition: grid-template-columns 0.2s var(--ease);
}

.sidebar {
  position: sticky; top: var(--topbar);
  height: calc(100vh - var(--topbar));
  display: flex; flex-direction: column;
  padding: 10px;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-section {
  padding: 16px 10px 6px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3); white-space: nowrap;
}
.side-section:first-child { padding-top: 6px; }
.side-link {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; white-space: nowrap;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.side-link:hover { background: var(--hover); color: var(--text); }
.side-link.is-active { background: var(--panel-raised); color: var(--text); }
.side-link.is-active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 2px; border-radius: 0 2px 2px 0; background: var(--red);
}
.side-link.is-active .icon { color: var(--red-text); }
.side-label { overflow: hidden; text-overflow: ellipsis; }
.side-badge {
  margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--red-soft); color: var(--red-text);
  font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.side-foot {
  margin-top: auto; padding: 14px 10px 4px;
  display: flex; gap: 14px; font-size: 12px; color: var(--text-3);
  white-space: nowrap;
}
.side-foot a:hover { color: var(--text-2); }

.sidebar-backdrop { display: none; }

.content { min-width: 0; width: 100%; max-width: 1280px; padding: 28px 32px 56px; }

/* Collapsed sidebar (desktop only) */
@media (min-width: 901px) {
  html.sidebar-collapsed .layout { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
  html.sidebar-collapsed .side-label,
  html.sidebar-collapsed .side-foot { display: none; }
  html.sidebar-collapsed .side-section { padding: 10px 0; font-size: 0; }
  html.sidebar-collapsed .side-section::after { content: ""; display: block; height: 1px; margin: 0 6px; background: var(--border); }
  html.sidebar-collapsed .side-section:first-child { display: none; }
  html.sidebar-collapsed .side-link { justify-content: center; padding: 0; }
  html.sidebar-collapsed .side-badge {
    position: absolute; top: 5px; right: 6px;
    min-width: 0; width: 7px; height: 7px; padding: 0; font-size: 0; background: var(--red);
  }
}

/* Mobile: sidebar becomes a drawer */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar); bottom: 0; z-index: 40;
    width: 264px; height: auto;
    transform: translateX(-100%);
    transition: transform 0.22s var(--ease);
    box-shadow: var(--shadow);
  }
  html.sidebar-open .sidebar { transform: none; }
  html.sidebar-open .sidebar-backdrop {
    display: block; position: fixed; inset: var(--topbar) 0 0 0; z-index: 35;
    background: rgba(0, 0, 0, 0.55);
  }
  .content { padding: 22px 16px 48px; }
  .topbar-divider, .topbar-title, .user-chip-text { display: none; }
}

/* ==========================================================================
   Page structure
   ========================================================================== */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 24px;
}
.page-head h1 { font-size: 22px; }
.page-sub { margin-top: 4px; color: var(--text-2); font-size: 13.5px; max-width: 680px; }
.page-actions { display: flex; gap: 8px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-size: 13px; color: var(--text-2);
}
.back-link:hover { color: var(--text); }
.back-link .icon { width: 14px; height: 14px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel + .panel { margin-top: 16px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 50px; padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 14px; font-weight: 600; }
.panel-body { padding: 18px; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-main .panel + .panel { margin-top: 0; }
@media (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }

/* Metrics */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.metric {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.metric:hover { border-color: var(--border-strong); background: var(--panel-raised); }
.metric-label { font-size: 12.5px; color: var(--text-2); }
.metric-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.metric-foot { font-size: 12px; color: var(--text-3); }
.metric-foot-alert { color: var(--red-text); }

/* Key-value list */
.kv { margin: 0; padding: 6px 18px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; font-size: 13.5px; }
.kv > div + div { border-top: 1px solid var(--border); }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

/* Feed */
.feed { list-style: none; margin: 0; padding: 6px 0; }
.feed-item { display: flex; gap: 12px; padding: 10px 18px; align-items: flex-start; }
.feed-item + .feed-item { border-top: 1px solid var(--border); }
.feed-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feed-text { font-size: 13.5px; overflow-wrap: anywhere; }
.feed-text .mono { color: var(--text-2); }
.feed-meta { font-size: 12px; color: var(--text-3); }
.feed-dot {
  display: inline-block; flex: none; width: 7px; height: 7px; margin: 7px 8px 0 0;
  border-radius: 50%; background: var(--text-3);
}
.feed-item .feed-dot { margin-right: 0; }
td .feed-dot { margin: 0 8px 1px 0; vertical-align: middle; }
.feed-dot-users { background: var(--red); }
.feed-dot-servers { background: #c2410c; }
.feed-dot-appeals { background: var(--amber); }
.feed-dot-staff { background: #8b8bf5; }
.feed-dot-settings { background: var(--green); }

/* Empty states */
.empty { padding: 56px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.empty-title { color: var(--text); font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.empty-compact { padding: 24px 18px; }

/* ==========================================================================
   Toolbar, tables, tabs, pager
   ========================================================================== */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 34px; }
.select-wrap { flex: 0 0 auto; }
.select-wrap .input { width: auto; min-width: 170px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  padding: 10px 16px; text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-3); background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.table th.num { text-align: right; }
.table th.center { text-align: center; }
.table td { padding: 12px 16px; vertical-align: middle; color: var(--text-2); border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 0.12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
.col-wide { min-width: 240px; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }

.cell-primary { color: var(--text); font-weight: 500; }
.cell-id { display: block; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.cell-primary .badge { margin-left: 6px; font-weight: 400; }

.identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.initials {
  flex: none; width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  border-radius: 50%; background: var(--panel-raised); border: 1px solid var(--border-strong);
  font-size: 11.5px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em;
  object-fit: cover;
}
.initials-square { border-radius: 9px; }

.row-actions { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.icon-ok { color: var(--green); }

.tabs { display: flex; gap: 20px; padding: 0 18px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 0 12px; margin-bottom: -1px;
  font-size: 13.5px; color: var(--text-2); white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--red); }
.tab-count {
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--panel-raised); color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums;
}

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-3);
}
.pager-links { display: flex; gap: 8px; }

/* Appeals */
.appeal-list { list-style: none; margin: 0; padding: 0; }
.appeal { padding: 18px; }
.appeal + .appeal { border-top: 1px solid var(--border); }
.appeal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.appeal-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-3); }
.appeal-message { margin: 14px 0 0 44px; color: var(--text); line-height: 1.65; max-width: 760px; }
.appeal-review, .appeal-outcome { margin: 16px 0 0 44px; }
.appeal-review { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px dashed var(--border); }
@media (max-width: 640px) { .appeal-message, .appeal-review, .appeal-outcome { margin-left: 0; } }

/* Error state */
.error-state { max-width: 460px; margin: 64px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.error-code { font-family: var(--mono); font-size: 13px; color: var(--red-text); padding: 4px 10px; border: 1px solid var(--red-line); border-radius: 999px; }
.error-state h1 { font-size: 24px; }
.error-state p { color: var(--text-2); margin-bottom: 8px; }

/* ==========================================================================
   Dialogs
   ========================================================================== */
.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0; margin: auto;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.dialog-sm { width: min(420px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(2px); }
.dialog[open] { animation: dialog-in 0.16s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(0.985); } }
.dialog form { margin: 0; }
.dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px 0;
}
.dialog-title { font-size: 16px; }
.dialog-body { padding: 16px 18px 18px; }
.dialog-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 18px; border-top: 1px solid var(--border); background: var(--bg-subtle);
}

/* ==========================================================================
   Public site
   ========================================================================== */
.site { background: var(--bg); font-size: 15px; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 720px; }
.container-flash { padding-top: 20px; }
.container-flash .alert { margin-bottom: 0; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11, 12, 16, 0.82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.site-nav { display: flex; gap: 26px; font-size: 14px; color: var(--text-2); }
.site-nav a { transition: color 0.15s; }
.site-nav a:hover { color: var(--text); }
.site-header-end { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 14px; }
.site-header-end form { margin: 0; }
@media (max-width: 860px) { .site-nav { display: none; } }
@media (max-width: 480px) { .site-header-end .link-quiet { display: none; } }

.site-main { min-height: 60vh; }

.eyebrow { font-size: 13px; font-weight: 500; color: var(--red-text); margin-bottom: 18px; letter-spacing: 0.01em; }
.lead { font-size: 17px; color: var(--text-2); line-height: 1.65; }

/* Hero */
.hero {
  padding: 96px 0 88px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(to bottom, rgba(255, 77, 90, 0.07), transparent 420px),
    var(--bg);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.03em; line-height: 1.06; margin-bottom: 20px; max-width: 14ch; }
.hero .lead { max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero-note { margin-top: 20px; font-size: 13.5px; color: var(--text-2); }
.hero-note a, .faq a, .legal a, .section-head a { color: var(--red-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--red-line); }
@media (max-width: 960px) {
  .hero { padding: 64px 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
}

/* Product mock (Discord log message) */
.mock-window {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
}
.mock-bar {
  display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  border-bottom: 1px solid var(--border); background: var(--bg-subtle);
}
.mock-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.mock-channel { margin-left: 10px; font-size: 13px; color: var(--text-2); }
.mock-body { padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 18px; }
.mock-message { display: flex; gap: 12px; }
.mock-message-faded { opacity: 0.45; }
.mock-avatar { flex: none; }
.mock-avatar .brand-mark { width: 36px; height: 36px; }
.mock-content { flex: 1; min-width: 0; }
.mock-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 6px; }
.mock-author { color: var(--text); font-weight: 500; }
.mock-tag { font-size: 9.5px; font-weight: 600; padding: 1px 4px; border-radius: 3px; background: #5865f2; color: #fff; letter-spacing: 0.02em; }
.mock-time { font-size: 11.5px; color: var(--text-3); }
.mock-embed {
  border-left: 3px solid var(--red); border-radius: 4px;
  background: var(--panel-raised); padding: 12px 14px; max-width: 420px;
}
.mock-embed-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.mock-embed-text { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.mock-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mock-fields > div { display: flex; flex-direction: column; }
.mock-field-name { font-size: 12px; font-weight: 600; color: var(--text-2); }
.mock-field-value { font-size: 13px; color: var(--text); }

/* Sections */
.section { padding: 96px 0; }
.section-tight { padding: 56px 0 88px; }
.section-alt { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -0.025em; margin-bottom: 12px; }
.section-head p { color: var(--text-2); font-size: 16px; }
.section-head-left { margin: 0; text-align: left; }
@media (max-width: 720px) { .section { padding: 64px 0; } }

.feature-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--border); gap: 1px;
}
.feature { background: var(--bg); padding: 28px 28px 32px; }
.feature-icon { width: 20px; height: 20px; color: var(--red-text); margin-bottom: 18px; }
.feature h3 { font-size: 15.5px; margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
@media (max-width: 960px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: minmax(0, 1fr); } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.step { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); }
.step-number { display: block; font-family: var(--mono); font-size: 13px; color: var(--red-text); margin-bottom: 18px; }
.step h3 { font-size: 16px; margin-bottom: 8px; }
.step p { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
@media (max-width: 860px) { .steps { grid-template-columns: minmax(0, 1fr); } }

.faq-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 64px; align-items: start; }
@media (max-width: 860px) { .faq-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 0; cursor: pointer; list-style: none;
  font-size: 15.5px; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
  transform: rotate(45deg) translateY(-3px); transition: transform 0.2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq details p { padding: 0 32px 22px 0; color: var(--text-2); line-height: 1.7; }

.cta { padding: 0 0 96px; }
.cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 40px 44px;
  border: 1px solid var(--red-line); border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(255, 77, 90, 0.12), rgba(255, 77, 90, 0.03) 60%), var(--panel);
}
.cta h2 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 6px; }
.cta p { color: var(--text-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-subtle); padding: 56px 0 28px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.footer-brand p { margin-top: 14px; max-width: 280px; color: var(--text-3); }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h3 { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.footer-col a { color: var(--text-2); transition: color 0.15s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 13px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Appeal page */
.page-intro { margin-bottom: 28px; }
.page-intro h1 { font-size: 30px; letter-spacing: -0.025em; margin-bottom: 8px; }
.page-intro .lead { font-size: 15px; }
.status-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px; }
.status-card h2 { font-size: 16px; margin-bottom: 4px; }
.status-card p { color: var(--text-2); }
.status-icon { width: 22px; height: 22px; color: var(--red-text); margin-top: 1px; }
.status-icon-ok { color: var(--green); }
.hint-list { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }

/* Legal pages */
.legal-layout { display: grid; grid-template-columns: 200px minmax(0, 720px); gap: 64px; justify-content: center; }
.legal-toc {
  position: sticky; top: 96px; align-self: start;
  display: flex; flex-direction: column; gap: 8px; font-size: 13px;
}
.legal-toc-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 4px; }
.legal-toc a { color: var(--text-2); }
.legal-toc a:hover { color: var(--text); }
@media (max-width: 900px) { .legal-layout { grid-template-columns: minmax(0, 1fr); } .legal-toc { display: none; } }

.legal { color: var(--text-2); font-size: 15px; line-height: 1.75; }
.legal-head { padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.legal-head h1 { color: var(--text); font-size: 34px; letter-spacing: -0.025em; margin-bottom: 8px; }
.legal h2 { color: var(--text); font-size: 18px; margin: 40px 0 12px; scroll-margin-top: 88px; }
.legal h3 { color: var(--text); font-size: 15px; font-weight: 500; margin: 20px 0 6px; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 20px; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Copy ID buttons
   ========================================================================== */
.id-copy { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; vertical-align: middle; }
.id-copy .cell-id { display: inline; }
.cell-id-inline { display: inline; }
.copy-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 5px; background: transparent;
  color: var(--text-3); cursor: pointer;
  opacity: 0; transition: opacity 0.12s, background-color 0.12s, color 0.12s;
}
.copy-btn .icon { width: 13px; height: 13px; grid-area: 1 / 1; }
.copy-btn .icon-copied { display: none; color: var(--green); }
.copy-btn.is-copied .icon-copy { display: none; }
.copy-btn.is-copied .icon-copied { display: block; }
.copy-btn:hover { background: var(--hover); color: var(--text); }
tr:hover .copy-btn, .id-copy:hover .copy-btn, .appeal:hover .copy-btn, .kv .copy-btn, .page-sub .copy-btn,
.copy-btn:focus-visible, .copy-btn.is-copied { opacity: 1; }
@media (hover: none) { .copy-btn { opacity: 1; } }
.page-sub .id-copy .cell-id { font-size: 13px; }
.kv dd .id-copy { justify-content: flex-end; }
