:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f1;
  --surface: #ffffff;
  --surface-2: #f6f6f1;
  --ink: #1a1a1a;
  --ink-2: #2d2d2d;
  --ink-3: #555555;
  --ink-mute: #8a8a8a;
  --rule: #d6d6cc;
  --rule-faint: #ededed;
  --blue: #1c3661;
  --blue-soft: #5b7fa8;
  --blue-deep: #142747;
  --blue-tint: #eef1f7;
  --blue-tint-2: #dde3ee;
  /* Accent = the blue used for text / links / headings that sit on light
     surfaces. Equal to the brand navy in light mode; it lifts to a
     readable blue in dark mode (where the navy itself is reserved for
     fills like the header, sidebar and buttons). */
  --accent: #1c3661;
  --accent-strong: #142747;
  /* Text on a gold fill (primary buttons, active nav, login button).
     Deep navy in both themes — gold is light, so it never wants the
     lifted accent. */
  --on-gold: #142747;
  --green: #4a7c4e;
  --gold: #c9a955;
  --gold-bright: #dec376;
  --gold-dark: #a08538;
  --red: #a83232;
  --discord: #5865F2;
  --discord-dark: #4752C4;
  --shadow-sm: 0 1px 2px rgba(20, 39, 71, 0.06);
  --shadow-md: 0 2px 6px rgba(20, 39, 71, 0.08);
  --shadow-lg: 0 4px 12px rgba(20, 39, 71, 0.10);
  --display: 'Outfit', system-ui, -apple-system, sans-serif;
  --body: 'Outfit', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --max: 1280px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 4px;
}

/* ── Dark theme ──────────────────────────────────────────────
   Overrides the palette tokens only; every component already draws
   its colours from these variables, so the whole site re-themes from
   this one block.
     · --blue / --blue-deep stay a rich navy — they fill the header,
       sidebar and buttons, where white text needs a dark backing.
     · --accent is the lifted blue used for text and links on dark
       cards, where the navy would be unreadable. */
:root[data-theme="dark"] {
  --bg: #0f1217;
  --bg-soft: #161a21;
  --surface: #1b202a;
  --surface-2: #222834;
  --ink: #e7eaf0;
  --ink-2: #cfd4de;
  --ink-3: #a3aab8;
  --ink-mute: #717a8a;
  --rule: #2c333f;
  --rule-faint: #232934;
  --blue: #1f3a63;
  --blue-soft: #6f93bf;
  --blue-deep: #16273f;
  --blue-tint: #1e2636;
  --blue-tint-2: #28344c;
  --accent: #6f9bd6;
  --accent-strong: #88b0e4;
  --green: #6aa86e;
  --gold: #d2b466;
  --gold-bright: #e4cd86;
  --gold-dark: #b89545;
  --red: #d06a6a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.40);
  --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.50);
  color-scheme: dark;
}

/* Soft status callouts ship as light pastels (light bg + dark text),
   which glare on a dark page. Re-tint them to dark equivalents that keep
   the same red / green / gold semantics. */
:root[data-theme="dark"] .auth-error,
:root[data-theme="dark"] .user-row-badge--suspended,
:root[data-theme="dark"] .user-suspended-banner,
:root[data-theme="dark"] .bl-warn,
:root[data-theme="dark"] .notif-delete:hover {
  background: #2c1a1c;
  border-color: #5a2e32;
  color: #e6a3a3;
}
:root[data-theme="dark"] .user-row.is-suspended { background: var(--surface-2); }
:root[data-theme="dark"] .hb-badge-pub {
  background: #16271a;
  border-color: #2f4a34;
  color: #8ccf91;
}
:root[data-theme="dark"] .hb-render .hb-warning {
  background: #2a2418;
  border-color: #4a3f22;
}

/* .btn-white keeps a white fill in dark mode (it sits on navy/imagery),
   so its label needs the deep navy, not the lifted accent. */
:root[data-theme="dark"] .btn-white { color: var(--blue-deep); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: 0; }
ol, ul { list-style: none; }
::selection { background: var(--blue); color: white; }

.hdr {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--blue);
  border-bottom: 3px solid var(--gold);
}
.hdr-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
}
.hdr-brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.hdr-seal {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: white;
  padding: 2px;
}
.hdr-mark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.hdr-mark-top {
  font-size: 16px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hdr-mark-bot {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 3px;
}
.hdr-nav {
  justify-self: center;
  display: flex;
  gap: 28px;
}
.hdr-nav a {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.15s ease;
  position: relative;
  padding: 4px 0;
}
.hdr-nav a:hover { color: white; }
.hdr-nav a.on { color: var(--gold); }
.hdr-nav a.on::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  background: var(--gold);
}

.hdr-auth {
  justify-self: end;
  display: flex;
  align-items: center;
  position: relative;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  background: var(--gold);
  color: var(--on-gold);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.15s ease;
  border: 1px solid var(--gold);
}
.login-btn:hover { background: var(--gold-bright); }
.login-btn-arrow { transition: none; }
.login-btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-deep);
  flex-shrink: 0;
}
.login-btn-dot--blue { background: white; }

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
}
.user-pill-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-deep);
}
.user-pill-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--gold);
  background: var(--blue-deep);
}
.user-pill-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.user-pill-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
}
.user-pill-rank {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 2px;
}
.user-pill-out {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.15s ease;
}
.user-pill-out:hover { color: var(--gold); }

.notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  margin-right: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.notif-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}
.notif-btn.is-open {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-gold);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: white;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--blue);
}
.notif-badge[hidden] { display: none; }

.notif-panel {
  position: absolute;
  top: calc(100% + 25px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-panel[hidden] { display: none; }

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
}
.notif-panel-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.notif-mark-all {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background 0.15s ease;
}
.notif-mark-all:hover { background: var(--blue-tint); }

.notif-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}
.notif-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule-faint);
  cursor: pointer;
  transition: background 0.15s ease;
  align-items: start;
}
.notif-list li:hover { background: var(--bg-soft); }
.notif-list li:last-child { border-bottom: none; }
.notif-list li.is-unread { background: var(--blue-tint); }
.notif-list li.is-unread:hover { background: var(--blue-tint-2); }

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
  margin-top: 6px;
  flex-shrink: 0;
}
.notif-list li.is-unread .notif-dot { background: var(--blue); }

.notif-content { min-width: 0; }
.notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.3;
}
.notif-body {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.45;
  margin-bottom: 4px;
}
.notif-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.notif-delete {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--ink-mute);
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  opacity: 0;
}
.notif-list li:hover .notif-delete { opacity: 1; }
.notif-delete:hover {
  background: #fbecec;
  color: var(--red);
}

.notif-empty,
.notif-empty-feed {
  text-align: center;
  padding: 32px 18px;
  font-size: 13px;
  color: var(--ink-mute);
}

.hero {
  position: relative;
  padding: clamp(60px, 8vw, 110px) var(--gutter) clamp(70px, 9vw, 130px);
  background: var(--blue);
  border-bottom: 3px solid var(--gold);
  color: white;
}

.hero-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: white;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero-title-accent {
  color: var(--gold);
  display: inline-block;
}

.hero-lede {
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  max-width: 520px;
  margin-bottom: 36px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--gold);
  color: var(--on-gold);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}
.btn-ghost {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.5);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: white;
}
.btn-white {
  background: white;
  color: var(--accent);
  border-color: white;
}
.btn-white:hover { background: var(--bg-soft); }
.btn-discord {
  background: var(--discord);
  color: white;
  border-color: var(--discord);
}
.btn-discord:hover {
  background: var(--discord-dark);
  border-color: var(--discord-dark);
}

.section .btn-ghost,
.auth-page .btn-ghost,
.dash .btn-ghost,
.err-page .btn-ghost,
.admin-shell .btn-ghost {
  color: var(--ink);
  border-color: var(--rule);
}
.section .btn-ghost:hover,
.auth-page .btn-ghost:hover,
.dash .btn-ghost:hover,
.err-page .btn-ghost:hover,
.admin-shell .btn-ghost:hover {
  background: var(--bg-soft);
  border-color: var(--ink);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: clamp(28px, 5vw, 56px);
  padding-top: 28px;
  border-top: 1px solid rgba(201, 169, 85, 0.3);
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--display);
  font-size: clamp(30px, 3.5vw, 40px);
  font-weight: 800;
  color: white;
  line-height: 1;
  letter-spacing: -0.01em;
}
.stat-sup {
  font-size: 0.5em;
  color: var(--gold);
  font-weight: 700;
  vertical-align: super;
  margin-left: 2px;
}
.stat-lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 10px;
}

.hero-seal-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1;
  max-width: 380px;
  margin: 0 auto;
  width: 100%;
}
.hero-seal-img {
  position: relative;
  width: 100%;
  height: auto;
  z-index: 1;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section {
  padding: clamp(70px, 9vw, 110px) 0;
  position: relative;
}
.section-about { background: var(--bg); }
.section-divisions { background: var(--bg-soft); }
.section-join { background: var(--bg); }

.section-header {
  margin-bottom: clamp(40px, 5vw, 64px);
  max-width: 720px;
}
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold-dark);
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
}
.section-tag.light {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.section-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.section-title-accent {
  color: var(--gold-dark);
  display: inline-block;
}
.section-lede {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-3);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.pillar-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow 0.15s ease;
}
.pillar-card:hover { box-shadow: var(--shadow-md); }
.pillar-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.pillar-card h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.pillar-card p {
  font-size: 14.5px;
  color: var(--ink-3);
  line-height: 1.6;
}

.divs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.div-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.div-card:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.div-card-seal {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  object-fit: contain;
}

.div-card-body {
  flex: 1;
  min-width: 0;
}
.div-card-body h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.div-card-body p {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.55;
  margin: 0;
}

.join-card {
  position: relative;
  background: var(--blue);
  border-top: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: clamp(40px, 5vw, 72px);
  box-shadow: var(--shadow-md);
}
.join-card-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(40px, 5vw, 64px);
  align-items: center;
}
.join-content { color: white; }
.join-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: white;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.join-lede {
  font-size: 15.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 28px;
  max-width: 480px;
}
.join-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.join-pending {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.85);
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
}
.join-list {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(201, 169, 85, 0.3);
  border-radius: var(--radius);
  padding: 24px;
}
.join-list h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(201, 169, 85, 0.3);
}
.join-list ul { display: flex; flex-direction: column; }
.join-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}
.join-list li:last-child { border-bottom: none; }
.check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  position: relative;
}
.check::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 4px;
  border-left: 2px solid var(--blue-deep);
  border-bottom: 2px solid var(--blue-deep);
  transform: translate(-50%, -65%) rotate(-45deg);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  border-color: var(--blue-soft);
  box-shadow: var(--shadow-sm);
}
.card--id { grid-column: span 5; }
.card--rank {
  grid-column: span 7;
  background: var(--blue);
  color: white;
  border: 1px solid var(--blue);
  border-top: 3px solid var(--gold);
}
.card--rank:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  border-top-color: var(--gold);
}
.card--status { grid-column: span 5; }
.card--quick { grid-column: span 7; }
.card--feed { grid-column: span 12; }

.card-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold-dark);
  text-transform: uppercase;
  display: block;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.card-tag.light {
  color: var(--gold);
  border-bottom-color: rgba(201, 169, 85, 0.3);
}

.id-body {
  display: flex;
  align-items: center;
  gap: 18px;
}
.id-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.id-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  color: var(--gold);
  background: var(--blue);
}
.id-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.id-handle {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
}
.id-id {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  margin-top: 8px;
  letter-spacing: 0.08em;
}

.rank-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
}
.rank-mark {
  width: 78px;
  height: 78px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 169, 85, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}
.rank-mark svg { width: 40px; height: 40px; }
.rank-mark--link {
  text-decoration: none;
  cursor: pointer;
  padding: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.rank-mark--link:hover {
  border-color: var(--gold);
  transform: scale(1.04);
}
.rank-mark-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.rank-pre {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rank-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 2.5vw, 30px);
  letter-spacing: 0.01em;
  color: white;
  text-transform: uppercase;
  line-height: 1.1;
}
.rank-group {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 6px;
}
.rank-id {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-top: 8px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.status-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}
.status-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.status-note {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.55;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.quick {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.quick:hover {
  background: var(--blue);
  border-color: var(--accent);
  color: white;
}
.quick-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--rule);
}
.quick:hover .quick-icon {
  background: var(--gold);
  color: var(--on-gold);
  border-color: var(--gold);
}
.quick-arrow {
  color: var(--ink-mute);
  font-size: 16px;
  transition: color 0.15s ease;
}
.quick:hover .quick-arrow { color: var(--gold); }

.feed { display: flex; flex-direction: column; }
.feed li {
  display: grid;
  grid-template-columns: auto 80px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-faint);
}
.feed li:last-child { border-bottom: none; }
.feed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.feed-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.feed-text {
  font-size: 14px;
  color: var(--ink-2);
}

.auth-page {
  min-height: calc(100vh - 73px);
  padding: clamp(40px, 5vw, 72px) var(--gutter) clamp(70px, 8vw, 100px);
  background: var(--bg-soft);
  position: relative;
}
.auth-inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold-dark);
  text-transform: uppercase;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
}
.auth-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.auth-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.auth-title-accent {
  color: var(--gold-dark);
  display: inline-block;
}
.auth-lede {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-3);
  margin-bottom: 32px;
  max-width: 560px;
}
.auth-lede strong { color: var(--accent); font-weight: 700; }

.auth-form {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.auth-form--center {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}
.auth-label { display: block; margin-bottom: 16px; }
.auth-label-text {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
  font-weight: 600;
}
.auth-input {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(28, 54, 97, 0.15);
}
.auth-input::placeholder { color: var(--ink-mute); }

.auth-error {
  font-size: 13.5px;
  color: #8a1f1f;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fbecec;
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.5;
}
.auth-btn {
  width: 100%;
  justify-content: center;
}

.auth-discord-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 6px 6px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.auth-discord-pill-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  flex-shrink: 0;
}
.auth-discord-pill-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
  background: var(--discord);
}
.auth-discord-pill-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.auth-discord-pill-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
  font-weight: 600;
}
.auth-discord-pill-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}
.auth-discord-pill-check {
  color: var(--green);
  flex-shrink: 0;
  margin-left: 4px;
}

.auth-steps { padding-top: 28px; border-top: 1px solid var(--rule); }
.auth-steps-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 600;
  display: block;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  width: fit-content;
}
.auth-steps-list { display: flex; flex-direction: column; }
.auth-steps-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-faint);
  font-size: 14.5px;
  color: var(--ink-2);
  align-items: center;
}
.auth-steps-list li:last-child { border-bottom: none; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--gold);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
}

.code-block {
  background: var(--blue);
  color: white;
  border: 1px solid var(--blue);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.code-block-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(201, 169, 85, 0.3);
}
.code-block-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.code-block-value code {
  font-family: var(--mono);
  font-size: clamp(13px, 1.8vw, 17px);
  font-weight: 600;
  color: white;
  letter-spacing: 0.04em;
  user-select: all;
  word-break: break-all;
}
.code-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: var(--on-gold);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.15s ease;
  min-width: 86px;
  justify-content: center;
}
.code-copy:hover { background: var(--gold-bright); }
.code-copy-default,
.code-copy-done { display: inline-flex; align-items: center; gap: 6px; }
.code-copy-done { display: none; }
.code-copy.copied .code-copy-default { display: none; }
.code-copy.copied .code-copy-done { display: inline-flex; }

.verify-steps { display: flex; flex-direction: column; margin-bottom: 28px; }
.verify-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-faint);
  align-items: center;
}
.verify-steps li:last-child { border-bottom: none; }
.verify-steps li p {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.verify-steps li a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}
.verify-steps li a:hover { color: var(--accent-strong); }
.verify-steps li strong { font-weight: 700; color: var(--accent); }
.verify-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.verify-actions-form { display: inline-block; }

.err-page {
  min-height: calc(100vh - 73px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px var(--gutter);
  background: var(--bg-soft);
  position: relative;
}
.err-inner {
  position: relative;
  text-align: center;
  max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 48px 36px;
  box-shadow: var(--shadow-sm);
}
.err-code {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(80px, 12vw, 140px);
  line-height: 1;
  color: var(--accent);
  margin: 12px 0;
  letter-spacing: -0.02em;
}
.err-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.err-msg {
  font-size: 15.5px;
  color: var(--ink-3);
  margin-bottom: 28px;
  line-height: 1.65;
}

.ftr {
  background: var(--blue-deep);
  color: rgba(255, 255, 255, 0.7);
  padding: clamp(48px, 5vw, 64px) var(--gutter) 24px;
  border-top: 3px solid var(--gold);
}
.ftr-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 56px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ftr-mark { display: flex; align-items: center; gap: 16px; }
.ftr-seal {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface);
  padding: 2px;
}
.ftr-mark-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ftr-mark-motto {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 4px;
}
.ftr-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.ftr-col h5 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(201, 169, 85, 0.25);
}
.ftr-col a {
  display: block;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.7);
  padding: 5px 0;
  transition: color 0.15s ease;
}
.ftr-col a:hover { color: var(--gold); }
.ftr-bot {
  max-width: var(--max);
  margin: 20px auto 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: 12px;
}

.perm-inner { max-width: 1200px; }

.perm-group {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.perm-group-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
}
.perm-group-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}
.perm-group-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.perm-group-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
}

.perm-empty {
  padding: 18px 22px;
  font-size: 13.5px;
  color: var(--ink-mute);
  font-style: italic;
}

.perm-table-wrap {
  overflow-x: auto;
}
.perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.perm-table th,
.perm-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--rule-faint);
}
.perm-table th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--rule);
}
.perm-table tbody tr:hover { background: var(--bg-soft); }
.perm-table tbody tr:last-child td { border-bottom: none; }

.perm-rank-col { width: 280px; }
.perm-col { text-align: center; min-width: 140px; }
.perm-cell { text-align: center; }

.perm-rank-cell-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.perm-rank-id {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-mute);
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 2px 6px;
  min-width: 32px;
  text-align: center;
}
.perm-rank-name {
  color: var(--ink);
  font-weight: 500;
}

.perm-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.perm-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.perm-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--rule);
  border-radius: 10px;
  transition: background 0.2s ease;
}
.perm-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--surface);
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.perm-checkbox:checked + .perm-toggle-track {
  background: var(--green);
}
.perm-checkbox:checked + .perm-toggle-track::after {
  transform: translateX(16px);
}
.perm-checkbox:disabled + .perm-toggle-track {
  opacity: 0.5;
  cursor: wait;
}

.perm-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--blue-deep);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--green);
}
.perm-toast.is-error {
  border-left-color: var(--red);
}
.perm-toast[hidden] { display: none; }

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 73px);
  background: var(--bg-soft);
}

.admin-sidebar {
  background: var(--blue);
  border-right: 1px solid var(--rule);
  padding: 28px 0;
  position: sticky;
  top: 73px;
  height: calc(100vh - 73px);
  overflow-y: auto;
}

.admin-sidebar-head {
  padding: 0 22px 18px;
  border-bottom: 1px solid rgba(201, 169, 85, 0.2);
  margin-bottom: 14px;
}
.admin-sidebar-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 6px;
}
.admin-sidebar-sublabel {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  display: block;
  margin-top: 2px;
  margin-bottom: 8px;
}
.admin-sidebar-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: block;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  padding: 0 12px;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.15s ease, color 0.15s ease;
  margin-bottom: 2px;
}
.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}
.admin-nav-link.is-active {
  background: var(--gold);
  color: var(--on-gold);
}
.admin-nav-link.is-active:hover {
  background: var(--gold-bright);
  color: var(--on-gold);
}
.admin-nav-link svg {
  flex-shrink: 0;
}
.admin-nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9px;
  min-width: 18px;
  text-align: center;
  letter-spacing: 0.04em;
}

.admin-content {
  padding: clamp(28px, 4vw, 48px) clamp(20px, 4vw, 48px);
  min-width: 0;
}

.admin-page-head {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--gold);
  max-width: 720px;
}
.admin-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.admin-title-accent { color: var(--gold-dark); }
.admin-lede {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-3);
  max-width: 560px;
}
.admin-lede strong { color: var(--accent); font-weight: 700; }

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.admin-stat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
  display: block;
  margin-bottom: 10px;
}
.admin-stat-value {
  font-family: var(--display);
  font-weight: 800;
  font-size: 32px;
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}
.admin-stat-meta {
  font-size: 12px;
  color: var(--ink-mute);
  display: block;
}

.admin-section {
  margin-bottom: 36px;
}
.admin-section-head {
  margin-bottom: 16px;
}
.admin-section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.admin-action-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-action-card:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.admin-action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-action-body h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.admin-action-body p {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0;
}
.admin-action-arrow {
  font-size: 20px;
  color: var(--ink-mute);
  transition: color 0.15s ease;
}
.admin-action-card:hover .admin-action-arrow {
  color: var(--accent);
}

.user-search-form {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.user-search-input {
  flex: 1;
  min-width: 240px;
  margin: 0;
}
.user-search-form .btn { flex-shrink: 0; }

.user-empty {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 14px;
}
.user-empty-inline {
  font-size: 13.5px;
  color: var(--ink-mute);
  font-style: italic;
  padding: 6px 0;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.user-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.user-row:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.user-row.is-suspended {
  border-left-color: var(--red);
  background: #fefafa;
}
.user-row.is-suspended:hover {
  border-left-color: var(--red);
}

.user-row-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-soft);
}
.user-row-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--gold);
  background: var(--blue);
}

.user-row-main { min-width: 0; }
.user-row-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.user-row-meta {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-row-badge {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius);
}
.user-row-badge--suspended {
  background: #fbecec;
  color: var(--red);
  border: 1px solid #f5d0d0;
}

.user-row-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-row-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.user-row-time {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.user-row-arrow {
  font-size: 18px;
  color: var(--ink-mute);
  transition: color 0.15s ease;
}
.user-row:hover .user-row-arrow { color: var(--accent); }

.user-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.user-pagination-info {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-back-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 18px;
  transition: color 0.15s ease;
}
.user-back-link:hover { color: var(--accent); }

.user-profile-head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--gold);
}
.user-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  flex-shrink: 0;
}
.user-profile-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 40px;
  color: var(--gold);
  background: var(--blue);
}
.user-profile-info { flex: 1; min-width: 0; }
.user-profile-info .admin-title { margin-bottom: 6px; }
.user-profile-meta {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.user-suspended-banner {
  background: #fbecec;
  border: 1px solid #f5d0d0;
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.user-suspended-banner strong { color: var(--red); display: block; margin-bottom: 4px; }
.user-suspended-meta {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.user-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.user-profile-page > .card {
  margin-bottom: 18px;
}
.user-profile-page > .card:last-of-type {
  margin-bottom: 0;
}

.user-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 13.5px;
}
.user-dl dt {
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding-top: 4px;
}
.user-dl dd {
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
}
.user-mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.user-memberships {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.user-membership {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.user-membership-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.user-membership-body { flex: 1; min-width: 0; }
.user-membership-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.user-membership-rank {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.user-membership-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold-dark);
  text-transform: uppercase;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.user-audit-actor {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  margin-left: 8px;
  letter-spacing: 0.04em;
}

.user-actions-card .user-action-btn {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}
.user-actions-card .user-action-btn:hover {
  background: var(--blue);
  color: white;
  border-color: var(--accent);
}

.user-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-faint);
  flex-wrap: wrap;
}
.user-action:last-child { border-bottom: none; }
.user-action-info { flex: 1; min-width: 240px; }
.user-action-info h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.user-action-info p {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0;
}
.user-action-info p strong { color: var(--red); }

.user-action--danger .user-action-btn--danger {
  background: var(--surface);
  color: var(--red);
  border-color: var(--red);
}
.user-action--danger .user-action-btn--danger:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.auth-notice {
  background: var(--blue-tint);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

.profile-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.profile-tab {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 12px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.profile-tab:hover { color: var(--accent); }
.profile-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--gold);
}

.profile-tab-panel { display: none; }
.profile-tab-panel.is-active { display: block; }

.discord-guilds {
  display: grid;
  gap: 16px;
}
.discord-guild {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.discord-guild.is-member {
  border-left-color: var(--green);
  background: var(--surface);
}
.discord-guild.is-not-member {
  opacity: 0.6;
}

.discord-guild-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.discord-guild-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--blue);
}
.discord-guild-icon--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  color: var(--gold);
}
.discord-guild-info { flex: 1; min-width: 0; }
.discord-guild-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.discord-guild-meta {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 4px;
}
.discord-guild-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold-dark);
  text-transform: uppercase;
  padding: 4px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.discord-error {
  color: var(--red);
  font-style: italic;
}

.discord-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-faint);
}
.discord-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(88, 101, 242, 0.08);
  border: 1px solid rgba(88, 101, 242, 0.2);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: var(--role-color, var(--ink));
  position: relative;
}
.discord-role::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--role-color, var(--ink-mute));
}

.discord-no-roles {
  font-size: 12.5px;
  color: var(--ink-mute);
  font-style: italic;
  padding-top: 12px;
  border-top: 1px solid var(--rule-faint);
}

.notif-page-list {
  display: flex;
  flex-direction: column;
}
.notif-page-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-faint);
  cursor: pointer;
  transition: background 0.15s ease;
}
.notif-page-item:last-child { border-bottom: none; }
.notif-page-item:hover {
  background: var(--bg-soft);
}
.notif-page-item.is-unread {
  background: var(--blue-tint);
  margin: 0 -14px;
  padding-left: 14px;
  padding-right: 14px;
  border-radius: var(--radius);
}
.notif-page-item.is-unread .notif-dot { background: var(--blue); }

.notif-page-content { min-width: 0; }
.notif-page-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}
.notif-page-body {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.5;
  margin-bottom: 6px;
}
.notif-page-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.notif-page-link {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.notif-page-link:hover {
  background: var(--blue);
  border-color: var(--accent);
  color: white;
}

.hb-edit-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}
.hb-edit-main { display: flex; flex-direction: column; gap: 18px; }
.hb-edit-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 90px; }

.hb-editor-card { padding: 28px 32px; }
.hb-editor-card #hb-editor {
  font-family: var(--body);
  color: var(--ink);
}
.hb-editor-card .ce-block__content,
.hb-editor-card .ce-toolbar__content {
  max-width: 100%;
}
.hb-editor-card .codex-editor__redactor {
  padding-bottom: 80px !important;
}
.hb-editor-card .ce-paragraph,
.hb-editor-card .ce-block { font-size: 15px; line-height: 1.65; }
.hb-editor-card h1.ce-header { font-size: 28px; color: var(--accent); font-family: var(--display); font-weight: 800; text-transform: uppercase; }
.hb-editor-card h2.ce-header { font-size: 22px; color: var(--accent); font-family: var(--display); font-weight: 700; text-transform: uppercase; }
.hb-editor-card h3.ce-header { font-size: 18px; color: var(--accent); font-family: var(--display); font-weight: 700; text-transform: uppercase; }
.hb-editor-card h4.ce-header { font-size: 16px; color: var(--accent); font-family: var(--display); font-weight: 700; }

.ce-image-block {
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 12px;
}
.ce-image-block-figure {
  display: flex;
  flex-direction: column;
  margin: 0;
}
.ce-image-block-figure--left { align-items: flex-start; }
.ce-image-block-figure--center { align-items: center; }
.ce-image-block-figure--right { align-items: flex-end; }
.ce-image-block-figure--small .ce-image-block-img { max-width: 240px; }
.ce-image-block-figure--medium .ce-image-block-img { max-width: 480px; }
.ce-image-block-figure--large .ce-image-block-img { max-width: 720px; }
.ce-image-block-figure--full .ce-image-block-img { max-width: 100%; width: 100%; }

.ce-image-block-img {
  max-height: 480px;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  object-fit: contain;
}

.ce-image-block-caption {
  font-size: 13px;
  color: var(--ink-3);
  font-style: italic;
  margin-top: 8px;
  outline: none;
  padding: 4px;
  border-radius: var(--radius);
  width: 100%;
  text-align: inherit;
}
.ce-image-block-caption:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-mute);
}

.ce-image-block-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}

.ce-image-block-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ce-image-block-group-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-right: 4px;
}
.ce-image-block-btn {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ce-image-block-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ce-image-block-btn.is-active {
  background: var(--blue);
  color: white;
  border-color: var(--accent);
}
.ce-image-block-replace {
  margin-left: auto;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 5px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.ce-image-block-replace:hover { background: var(--bg-soft); border-color: var(--accent); }

.ce-image-block-placeholder {
  width: 100%;
  padding: 28px;
  background: var(--bg-soft);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.ce-image-block-placeholder:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hb-image-palette {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}
.hb-image-palette-card {
  aspect-ratio: 1;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.15s ease;
}
.hb-image-palette-card:hover { border-color: var(--accent); }
.hb-image-palette-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hb-image-palette-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--ink-mute);
  padding: 20px;
  font-style: italic;
}
.hb-image-palette-empty a { color: var(--accent); text-decoration: underline; }

.hb-img-add-form {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 8px;
}
.hb-img-add-form .auth-input { margin: 0; }

.hb-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.hb-img-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.hb-img-card.is-removed { opacity: 0.4; }
.hb-img-thumb {
  aspect-ratio: 4/3;
  background: var(--bg-soft);
}
.hb-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hb-img-meta { padding: 10px 12px; }
.hb-img-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.hb-img-cat {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 3px;
}
.hb-img-remove {
  width: 100%;
  padding: 6px 0;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface);
  cursor: pointer;
}
.hb-img-remove:hover { background: #fbecec; }
.hb-img-removed-tag {
  display: block;
  text-align: center;
  padding: 6px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}

.hb-edit-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.hb-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.hb-rule strong {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--gold-dark);
  margin-right: 6px;
}
.hb-rule-remove {
  width: 22px;
  height: 22px;
  border-radius: var(--radius);
  color: var(--ink-mute);
  font-size: 16px;
  line-height: 1;
}
.hb-rule-remove:hover { background: #fbecec; color: var(--red); }
.hb-rule-add {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.hb-rule-add .auth-input { margin: 0; flex: 1; }
.hb-rule-add .btn { white-space: nowrap; padding: 8px 12px; font-size: 11px; }

.hb-badge-pub {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: #e8f5e9;
  color: var(--green);
  border: 1px solid #c8e6c9;
}

.hb-view-head {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--gold);
}
.hb-view-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 12px 0 12px;
}
.hb-view-summary {
  font-size: 16px;
  color: var(--ink-3);
  line-height: 1.6;
  font-style: italic;
}

.hb-view-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.hb-view-side {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hb-toc-card { padding: 18px 20px; }
.hb-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hb-toc-link {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink-3);
  border-left: 2px solid var(--rule);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.hb-toc-link:hover {
  color: var(--accent);
  border-left-color: var(--gold);
  background: var(--bg-soft);
}
.hb-toc-link.is-active {
  color: var(--accent);
  background: var(--blue-tint);
  border-left-color: var(--gold);
  font-weight: 600;
}
.hb-toc-link--3 { padding-left: 24px; font-size: 12.5px; }
.hb-toc-link--4 { padding-left: 38px; font-size: 12px; }

.hb-render {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 48px);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.hb-render .hb-h {
  font-family: var(--display);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.2;
  position: relative;
  scroll-margin-top: 90px;
}
.hb-render .hb-h--1 { font-size: 30px; margin: 1.4em 0 0.5em; }
.hb-render .hb-h--2 {
  font-size: 24px;
  margin: 1.4em 0 0.5em;
  padding-bottom: 0.3em;
  border-bottom: 2px solid var(--gold);
}
.hb-render .hb-h--3 { font-size: 19px; margin: 1.2em 0 0.4em; }
.hb-render .hb-h--4 { font-size: 16px; margin: 1.1em 0 0.3em; }
.hb-render .hb-anchor {
  position: absolute;
  left: -1.2em;
  color: var(--ink-mute);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.hb-render .hb-h:hover .hb-anchor { opacity: 1; }
.hb-render .hb-p { margin-bottom: 1em; }
.hb-render .hb-list { margin: 0 0 1em 1.5em; }
.hb-render .hb-list li { margin-bottom: 0.3em; }
.hb-render a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--gold); }
.hb-render mark { background: rgba(201, 169, 85, 0.3); padding: 0 3px; }
.hb-render code { font-family: var(--mono); background: var(--bg-soft); border: 1px solid var(--rule); border-radius: var(--radius); padding: 2px 6px; font-size: 13px; }
.hb-render .hb-quote {
  border-left: 3px solid var(--gold);
  padding: 0.5em 1.2em;
  margin: 1.2em 0;
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.hb-render .hb-quote--center { text-align: center; border-left: none; border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); }
.hb-render .hb-quote-cite {
  display: block;
  margin-top: 0.5em;
  font-size: 13px;
  color: var(--ink-3);
  font-style: italic;
}
.hb-render .hb-warning {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fef9e7;
  border: 1px solid #f3e5a8;
  border-left: 4px solid var(--gold-dark);
  padding: 14px 18px;
  margin: 1.2em 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.hb-render .hb-warning-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hb-render .hb-warning-msg { color: var(--ink-2); font-size: 14.5px; }
.hb-render .hb-delim {
  border: none;
  text-align: center;
  margin: 2em 0;
  position: relative;
  height: 1em;
}
.hb-render .hb-delim::before {
  content: '◆ ◆ ◆';
  color: var(--gold);
  letter-spacing: 0.5em;
  font-size: 12px;
}
.hb-render .hb-code {
  background: var(--blue-deep);
  color: white;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 1.2em 0;
  font-family: var(--mono);
  font-size: 13px;
  overflow-x: auto;
}
.hb-render .hb-code code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
.hb-render .hb-table-wrap { overflow-x: auto; margin: 1.2em 0; }
.hb-render .hb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.hb-render .hb-table th,
.hb-render .hb-table td {
  border: 1px solid var(--rule);
  padding: 8px 12px;
  text-align: left;
}
.hb-render .hb-table th {
  background: var(--blue);
  color: white;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12.5px;
}
.hb-render .hb-image {
  margin: 1.4em 0;
  display: flex;
  flex-direction: column;
}
.hb-render .hb-image--left { align-items: flex-start; }
.hb-render .hb-image--center { align-items: center; }
.hb-render .hb-image--right { align-items: flex-end; }
.hb-render .hb-image--small img { max-width: 240px; }
.hb-render .hb-image--medium img { max-width: 480px; }
.hb-render .hb-image--large img { max-width: 720px; }
.hb-render .hb-image--full img { max-width: 100%; width: 100%; }
.hb-render .hb-image img {
  max-height: 480px;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  display: block;
}
.hb-render .hb-image figcaption {
  font-size: 13px;
  color: var(--ink-3);
  font-style: italic;
  margin-top: 8px;
  text-align: inherit;
}
.hb-render .hb-embed { margin: 1.2em 0; }
.hb-render .hb-embed-frame {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.hb-render .hb-embed-frame iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
.hb-render .hb-embed figcaption {
  font-size: 13px;
  color: var(--ink-3);
  font-style: italic;
  margin-top: 6px;
}

@media (max-width: 1024px) {
  .hdr-inner {
    grid-template-columns: auto auto;
  }
  .hdr-nav { display: none; }
  .hdr-mark { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-seal-wrap { max-width: 280px; order: -1; margin: 0 auto 8px; }
  .pillars { grid-template-columns: 1fr; gap: 14px; }
  .divs-grid { grid-template-columns: 1fr 1fr; }
  .join-card-inner { grid-template-columns: 1fr; }
  .card--id, .card--rank, .card--status, .card--quick, .card--feed { grid-column: span 12; }
  .ftr-inner { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    height: auto;
    padding: 18px 0;
    border-right: none;
    border-bottom: 3px solid var(--gold);
  }
  .admin-sidebar-head {
    padding: 0 22px 14px;
    margin-bottom: 10px;
  }
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding: 0 12px;
  }
  .admin-nav-link {
    flex-shrink: 0;
  }
  .hb-edit-grid { grid-template-columns: 1fr; }
  .hb-edit-side { position: static; }
  .hb-view-grid { grid-template-columns: 1fr; }
  .hb-view-side { position: static; order: -1; }
  .hb-img-add-form { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .login-btn-label { display: none; }
  .login-btn { padding: 9px 14px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 24px; }
  .divs-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .feed li { grid-template-columns: auto 60px 1fr; gap: 12px; }
  .ftr-cols { grid-template-columns: 2fr 2fr; }
  .ftr-bot { font-size: 10px; }
  .id-body { flex-direction: column; align-items: flex-start; gap: 14px; }
  .rank-body { grid-template-columns: 1fr; gap: 18px; text-align: center; }
  .rank-mark { margin: 0 auto; }
  .verify-actions { flex-direction: column; align-items: stretch; }
  .verify-actions-form { display: block; }
  .verify-actions .btn { width: 100%; justify-content: center; }
  .auth-discord-pill { width: 100%; }
  .notif-panel {
    right: 0;
    width: calc(100vw - 24px);
    max-width: 360px;
  }
  .notif-btn { margin-right: 6px; }
}

.legal-page {
  background: var(--bg-soft);
  padding: clamp(48px, 6vw, 80px) var(--gutter) clamp(80px, 8vw, 120px);
  min-height: calc(100vh - 73px);
}
.legal-inner {
  max-width: 820px;
  margin: 0 auto;
}
.legal-head {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--gold);
}
.legal-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 12px 0 12px;
}
.legal-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 600;
}

.legal-body {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 56px);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
}
.legal-intro {
  font-size: 16px;
  color: var(--ink);
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.legal-body h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 2em 0 0.6em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--rule);
}
.legal-body h2:first-of-type { margin-top: 0; }
.legal-body h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1.6em 0 0.4em;
}
.legal-body p { margin-bottom: 1em; }
.legal-body ul {
  margin: 0 0 1.2em 1.5em;
  list-style: disc;
}
.legal-body ul li {
  margin-bottom: 0.4em;
  list-style: disc;
}
.legal-body strong { color: var(--accent); font-weight: 700; }
.legal-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 2px;
}
.legal-body a:hover { color: var(--accent-strong); }

.hb-url-help {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 8px;
  line-height: 1.5;
}
.hb-url-help strong { color: var(--accent); font-weight: 700; }

.hb-edit-preview {
  width: 100%;
  height: 480px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}
.hb-edit-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.hb-view-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}

.hb-embed-wrap {
  width: 100%;
  height: calc(100vh - 280px);
  min-height: 600px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.hb-embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.auth-divider span {
  flex-shrink: 0;
}

.bl-add-form {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 10px;
  align-items: center;
}
@media (max-width: 640px) {
  .bl-add-form { grid-template-columns: 1fr; }
}

.bl-list { display: flex; flex-direction: column; gap: 0; }
.bl-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.bl-row:last-child { border-bottom: none; }
.bl-row.is-removed { opacity: 0.55; }
.bl-row-main { flex: 1; min-width: 0; }
.bl-row-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 4px;
}
.bl-row-meta {
  font-size: 12.5px;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.bl-row-reason {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-left: 3px solid var(--gold);
}
.bl-row-remove {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red);
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}
.bl-row-remove:hover { background: #fbecec; border-color: var(--red); }
.bl-row-removed-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  padding: 4px 10px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.bl-match-list { display: flex; flex-direction: column; gap: 12px; }
.bl-match-list li {
  padding: 14px 16px;
  background: var(--bg-soft);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
}
.bl-match-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
}
.bl-match-meta {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 4px;
}

.bl-history-card.is-active {
  border-top: 3px solid var(--red);
}
.bl-warn {
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: #991b1b;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 14px;
}
.bl-history-list { display: flex; flex-direction: column; gap: 0; }
.bl-history-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-faint);
}
.bl-history-list li:last-child { border-bottom: none; }
.bl-history-list li.is-active .bl-history-name { color: var(--red); }
.bl-history-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
}
.bl-history-meta {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 4px;
  font-family: var(--mono);
}
.bl-history-meta strong { color: var(--red); }

.hb-perm-everyone {
  padding: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.hb-perm-everyone-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.hb-perm-everyone-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.hb-perm-everyone-label span {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}
.hb-perm-everyone-label strong {
  color: var(--accent);
}

.hb-perm-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.2s ease;
}
.hb-perm-groups.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.hb-perm-group {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.hb-perm-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--rule);
}

.hb-perm-group-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hb-perm-group-select-all {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.hb-perm-group-select-all:hover {
  background: var(--blue-tint);
  border-color: var(--accent);
}

.hb-perm-rank-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px;
  padding: 8px;
}

.hb-perm-rank {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: var(--radius);
}
.hb-perm-rank:hover {
  background: var(--bg-soft);
}
.hb-perm-rank input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.hb-perm-rank > span:nth-child(2) {
  flex: 1;
  font-size: 13.5px;
  color: var(--ink-2);
}
.hb-perm-rank-tier {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
}

.hb-view-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hb-view-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.hb-view-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 4px;
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.hb-view-head-text {
  flex: 1;
  min-width: 0;
}

.hb-view-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}

.hb-view-summary {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 4px;
  margin-bottom: 0;
}

.hb-view-open {
  flex-shrink: 0;
}

.hb-embed-wrap {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  height: calc(100vh - 200px);
  min-height: 700px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.hb-embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 768px) {
  .hb-view-head {
    flex-wrap: wrap;
  }
  .hb-view-open {
    width: 100%;
    justify-content: center;
  }
  .hb-embed-wrap {
    height: calc(100vh - 280px);
  }
}

@media (max-width: 1024px) {
  .dash-shell,
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .dash-sidebar,
  .admin-sidebar {
    position: static;
    height: auto;
    padding: 16px 0;
    border-right: none;
    border-bottom: 3px solid var(--gold);
  }
  .dash-sidebar-head,
  .admin-sidebar-head {
    padding: 0 18px 12px;
    margin-bottom: 8px;
  }
  .dash-nav,
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding: 0 12px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .dash-nav-link,
  .admin-nav-link {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 12.5px;
    min-height: 40px;
  }
  .admin-content,
  .dash-content {
    padding: 20px 16px;
  }
  .admin-page-head,
  .dash-page-head {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }
}

@media (max-width: 768px) {
  .hb-embed-wrap {
    height: calc(100vh - 200px);
    min-height: 500px;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .user-back-link {
    padding: 4px 0;
    font-size: 14px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }

  .hb-edit-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hb-edit-side {
    position: static;
  }
  .hb-edit-preview {
    height: 320px;
  }

  .user-row {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 12px 14px;
  }
  .user-row-side {
    display: none;
  }
  .user-row-meta {
    white-space: normal;
  }

  .user-profile-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 18px;
  }
  .user-profile-avatar {
    width: 72px;
    height: 72px;
  }
  .profile-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .profile-tab {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 12px;
  }

  .bl-add-form,
  .hb-img-add-form {
    grid-template-columns: 1fr;
  }
  .bl-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .bl-row-remove {
    width: 100%;
  }

  .perm-table th,
  .perm-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
  .perm-rank-col {
    width: auto;
    min-width: 200px;
  }

  .legal-body {
    padding: 24px 18px;
    font-size: 14.5px;
  }
  .legal-head {
    margin-bottom: 24px;
    padding-bottom: 18px;
  }
}

@media (max-width: 640px) {
  body { font-size: 15px; }

  .hdr-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .hdr-seal {
    width: 36px;
    height: 36px;
  }
  .user-pill {
    padding: 3px 6px 3px 3px;
    gap: 6px;
  }
  .user-pill-meta { display: none; }
  .user-pill-avatar,
  .user-pill-avatar--fallback {
    width: 28px;
    height: 28px;
  }
  .notif-btn {
    width: 34px;
    height: 34px;
    margin-right: 6px;
  }

  .auth-page {
    padding: 28px 14px 56px;
  }
  .auth-inner {
    max-width: 100%;
  }
  .auth-title {
    font-size: 30px;
  }
  .auth-form {
    padding: 20px 16px;
  }
  .auth-input {
    font-size: 16px;
    padding: 12px 12px;
  }
  .btn {
    padding: 12px 18px;
    font-size: 12.5px;
    min-height: 44px;
  }
  .btn-oauth {
    width: 100%;
    justify-content: center;
  }

  .admin-title,
  .dash-title {
    font-size: 24px;
  }
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .admin-stat-card {
    padding: 14px 16px;
  }
  .admin-stat-value {
    font-size: 24px;
  }
  .admin-actions-grid {
    grid-template-columns: 1fr;
  }
  .admin-action-card {
    padding: 14px 16px;
  }

  .user-search-form {
    flex-direction: column;
  }
  .user-search-input {
    min-width: 0;
  }
  .user-pagination {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .hb-embed-wrap {
    height: calc(100vh - 180px);
    min-height: 420px;
  }

  .id-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .rank-body {
    grid-template-columns: 1fr;
    gap: 14px;
    text-align: center;
  }
  .rank-mark {
    margin: 0 auto;
  }
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .ftr {
    padding: 36px 18px 18px;
  }
  .ftr-cols {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .ftr-inner {
    gap: 28px;
    padding-bottom: 24px;
  }

  .legal-title {
    font-size: 28px;
  }
  .legal-body {
    padding: 20px 14px;
    font-size: 14px;
  }
  .legal-body h2 {
    font-size: 17px;
  }
}

@media (max-width: 380px) {
  .hdr-mark-top { font-size: 14px; }
  .auth-title { font-size: 26px; }
  .admin-title,
  .dash-title { font-size: 21px; }
  .ftr-cols {
    grid-template-columns: 1fr;
  }
}

.hb-image-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}
.hb-image-palette-card {
  width: 72px;
  height: 72px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.15s ease;
}
.hb-image-palette-card:hover { border-color: var(--accent); }
.hb-image-palette-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hb-image-palette-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--blue-tint);
}
.hb-image-palette-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--ink-mute);
  padding: 20px;
  font-style: italic;
}
.hb-image-palette-empty a { color: var(--accent); text-decoration: underline; }

.hb-image-palette-none {
  border-style: dashed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 300;
  color: var(--ink-mute);
  line-height: 1;
}
.hb-image-palette-none:hover {
  border-color: var(--red);
  color: var(--red);
}
.hb-image-palette-none.is-selected {
  border-color: var(--accent);
  color: var(--accent);
  border-style: solid;
}

.hb-category-section {
  margin-bottom: 28px;
}
.hb-category-section:last-child {
  margin-bottom: 0;
}
.hb-category-title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
/* ── Settings page ─────────────────────────────────────────── */
.settings-grid {
  display: grid;
  gap: 20px;
  max-width: 720px;
}
.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.setting-text { flex: 1; }
.setting-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.setting-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  margin-top: 4px;
}

/* Toggle switch */
.switch {
  position: relative;
  flex-shrink: 0;
  display: inline-block;
  margin-top: 2px;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch-track {
  display: block;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--rule);
  border: 1px solid var(--rule);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease;
}
.switch input:checked + .switch-track {
  background: var(--blue);
  border-color: var(--accent);
}
.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(20px);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
