/* Social Corner Mod HQ (/SocialCornerAdmin) — same family as social-corner.css
   (Fredoka + Plus Jakarta Sans, aurora, glass cards) tuned for a dashboard.
   Modern bits: @starting-style dialog/popover entrances, container queries on
   cards, :has() states, color-mix() tints, View Transitions between tabs —
   each degrades gracefully. */

:root {
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-soft: color-mix(in oklab, var(--accent) 13%, transparent);
  --accent-ink: color-mix(in oklab, var(--accent) 72%, #000);
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fredoka", "Plus Jakarta Sans", system-ui, sans-serif;
  --r: 20px; --r-sm: 12px;

  --bg: #faf8ff;
  --surface: rgba(255, 255, 255, .8);
  --surface-solid: #ffffff;
  --sunken: #f2eefc;
  --line: rgba(80, 60, 140, .12);
  --text: #1c1830; --text-2: #5d5874; --text-3: #8f8aa6;
  --ok: #0ca30c; --ok-soft: rgba(12, 163, 12, .12);
  --warn: #c98500; --warn-soft: rgba(237, 161, 0, .14);
  --danger: #d03b3b; --danger-soft: rgba(208, 59, 59, .11);
  --shadow: 0 1px 2px rgba(60, 40, 120, .05), 0 10px 30px -10px rgba(60, 40, 120, .16);
  --shadow-lg: 0 30px 70px -18px rgba(60, 40, 120, .38);
  /* chart (dataviz reference palette: categorical slots 1 + 2) */
  --series-1: #2a78d6; --series-2: #eb6834; --grid: rgba(80, 60, 140, .1);
  --blob-a: rgba(139, 92, 246, .38); --blob-b: rgba(255, 128, 181, .3); --blob-c: rgba(80, 200, 255, .24);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d1a; --surface: rgba(30, 26, 48, .74); --surface-solid: #1c1830; --sunken: #262140;
    --line: rgba(200, 190, 255, .11); --text: #f1eefc; --text-2: #b4adcf; --text-3: #8a83a8;
    --accent-ink: color-mix(in oklab, var(--accent) 58%, #fff);
    --ok: #3fc23f; --warn: #fab219; --danger: #f06a6a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -10px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 70px -18px rgba(0, 0, 0, .8);
    --series-1: #3987e5; --series-2: #d95926; --grid: rgba(200, 190, 255, .09);
    --blob-a: rgba(139, 92, 246, .3); --blob-b: rgba(255, 95, 162, .15); --blob-c: rgba(60, 160, 255, .13);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0d1a; --surface: rgba(30, 26, 48, .74); --surface-solid: #1c1830; --sunken: #262140;
  --line: rgba(200, 190, 255, .11); --text: #f1eefc; --text-2: #b4adcf; --text-3: #8a83a8;
  --accent-ink: color-mix(in oklab, var(--accent) 58%, #fff);
  --ok: #3fc23f; --warn: #fab219; --danger: #f06a6a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -10px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 70px -18px rgba(0, 0, 0, .8);
  --series-1: #3987e5; --series-2: #d95926; --grid: rgba(200, 190, 255, .09);
  --blob-a: rgba(139, 92, 246, .3); --blob-b: rgba(255, 95, 162, .15); --blob-c: rgba(60, 160, 255, .13);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased; padding-bottom: calc(90px + env(safe-area-inset-bottom));
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-ink); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; margin: 0; }

/* ── Aurora ── */
.hq-aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hq-aurora i { position: absolute; width: 58vmax; height: 58vmax; border-radius: 50%; filter: blur(80px); animation: hq-drift 30s ease-in-out infinite alternate; }
.hq-aurora i:nth-child(1) { background: var(--blob-a); top: -24vmax; left: -14vmax; }
.hq-aurora i:nth-child(2) { background: var(--blob-b); top: -10vmax; right: -22vmax; animation-delay: -10s; }
.hq-aurora i:nth-child(3) { background: var(--blob-c); bottom: -30vmax; left: 22vw; animation-delay: -20s; }
@keyframes hq-drift { to { transform: translate(6vmax, 4vmax) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .hq-aurora i { animation: none; } }

/* ── Top bar ── */
.hq-top { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  background: color-mix(in oklab, var(--bg) 72%, transparent); border-bottom: 1px solid var(--line); }
.hq-top__in { max-width: 1320px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.hq-back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--text-2); text-decoration: none; transition: background .2s, color .2s; }
.hq-back:hover { background: var(--accent-soft); color: var(--accent-ink); }
.hq-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hq-brand__mark { width: 40px; height: 40px; display: grid; place-items: center; font-size: 21px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px -6px color-mix(in oklab, var(--accent) 70%, transparent);
  animation: hq-wiggle 6s ease-in-out infinite; }
@keyframes hq-wiggle { 0%, 92%, 100% { transform: rotate(0); } 94% { transform: rotate(-12deg); } 96% { transform: rotate(10deg); } 98% { transform: rotate(-5deg); } }
.hq-brand__txt { display: flex; flex-direction: column; line-height: 1.1; }
.hq-brand__txt b { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.hq-brand__txt small { color: var(--text-3); font-size: 12px; font-weight: 600; }
.hq-top__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.hq-me { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.hq-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); transition: transform .15s, color .2s; }
.hq-icon:hover { color: var(--accent-ink); transform: translateY(-1px); }
.hq-icon:active { transform: scale(.94); }

/* ── Shell ── */
.hq-shell { max-width: 1320px; margin: 0 auto; padding: 22px 16px 0; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
.hq-nav { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.hq-nav__btn { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 14px; background: none;
  color: var(--text-2); font-weight: 600; text-align: left; transition: background .2s, color .2s; }
.hq-nav__btn:hover { background: var(--accent-soft); color: var(--text); }
.hq-nav__btn[aria-current="page"] { background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 22%, transparent), color-mix(in oklab, var(--accent-2) 14%, transparent)); color: var(--text); }
.hq-nav__btn[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.hq-nav__emo { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--sunken); font-size: 16px; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.hq-nav__btn:hover .hq-nav__emo, .hq-nav__btn[aria-current="page"] .hq-nav__emo { transform: scale(1.12) rotate(-6deg); }
.hq-nav__n { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--danger); color: #fff; }
.hq-nav__sep { height: 1px; background: var(--line); margin: 6px 8px; }
.hq-nav__foot { padding: 10px 12px 4px; font-size: 12px; color: var(--text-3); }
.hq-nav__foot a { font-weight: 600; }

.hq-main { min-width: 0; outline: none; view-transition-name: hq-main; }
::view-transition-old(hq-main) { animation: hq-out .14s ease-in both; }
::view-transition-new(hq-main) { animation: hq-in .26s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes hq-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes hq-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 860px) {
  .hq-shell { grid-template-columns: 1fr; padding-top: 14px; }
  .hq-nav { position: fixed; z-index: 40; top: auto; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); flex-direction: row;
    overflow-x: auto; scrollbar-width: none; padding: 6px; gap: 2px; border-radius: 22px; box-shadow: var(--shadow-lg); }
  .hq-nav__btn { flex: 1 0 auto; flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 11px; }
  .hq-nav__btn[aria-current="page"]::before { display: none; }
  .hq-nav__n { position: absolute; top: 2px; right: 4px; min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; }
  .hq-nav__sep, .hq-nav__foot { display: none; }
  .hq-brand__txt small { display: none; }
}
@media (max-width: 520px) { .hq-me span:last-child { display: none; } .hq-me { padding-right: 4px; } }

/* ── Page head ── */
.hq-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.hq-head__txt { flex: 1 1 260px; min-width: 0; }
.hq-head h1 { font-size: clamp(24px, 3vw, 30px); display: flex; align-items: center; gap: 10px; }
.hq-head p { margin: 4px 0 0; color: var(--text-2); }
.hq-head__acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons, chips, inputs ── */
.hq-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 16px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--surface-solid); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; }
.hq-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.hq-btn:active { transform: translateY(0) scale(.97); }
.hq-btn:disabled { opacity: .55; pointer-events: none; }
.hq-btn--brand { border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 20px -8px color-mix(in oklab, var(--accent) 80%, transparent); }
.hq-btn--soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.hq-btn--danger { color: var(--danger); }
.hq-btn--danger:hover { background: var(--danger-soft); border-color: transparent; }
.hq-btn--sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 10px; }
.hq-btn--ghost { background: none; border-color: transparent; }
.hq-btn--ghost:hover { background: var(--sunken); box-shadow: none; }

.hq-seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px; background: var(--sunken); border: 1px solid var(--line); flex-wrap: wrap; }
.hq-seg button { border: 0; background: none; padding: 6px 13px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: background .2s, color .2s; }
.hq-seg button[aria-pressed="true"] { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.hq-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: var(--sunken); color: var(--text-2); white-space: nowrap; }
.hq-chip--ok { background: var(--ok-soft); color: var(--ok); }
.hq-chip--warn { background: var(--warn-soft); color: var(--warn); }
.hq-chip--danger { background: var(--danger-soft); color: var(--danger); }
.hq-role { --c: var(--accent); display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px 3px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
  color: color-mix(in oklab, var(--c) 72%, var(--text)); background: color-mix(in oklab, var(--c) 15%, transparent);
  border: 1px solid color-mix(in oklab, var(--c) 30%, transparent); white-space: nowrap; }

.hq-field { display: flex; flex-direction: column; gap: 6px; }
.hq-field > span { font-size: 13px; font-weight: 700; color: var(--text-2); }
.hq-field small { color: var(--text-3); font-size: 12px; }
.hq-input { width: 100%; min-height: 42px; padding: 9px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-solid);
  transition: border-color .2s, box-shadow .2s; }
.hq-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.hq-input { resize: vertical; min-height: 74px; field-sizing: content; max-height: 220px; }
.hq-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* switch */
.hq-switch { position: relative; flex: none; width: 44px; height: 26px; appearance: none; -webkit-appearance: none; margin: 0; border-radius: 99px;
  background: color-mix(in oklab, var(--text-3) 40%, transparent); cursor: pointer; transition: background .25s; }
.hq-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.hq-switch:checked { background: var(--accent); }
.hq-switch:checked::after { transform: translateX(18px); }
.hq-switch:disabled { opacity: .5; cursor: default; }

/* ── Cards ── */
.hq-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); container-type: inline-size; }
.hq-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.hq-card__head h2 { font-size: 18px; }
.hq-card__head .hq-sub { color: var(--text-3); font-size: 13px; }
.hq-card__head > :last-child:not(:first-child) { margin-left: auto; }
.hq-grid { display: grid; gap: 16px; }
.hq-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.hq-grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.hq-stack { display: flex; flex-direction: column; gap: 16px; }

/* KPI tiles */
.hq-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hq-kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.hq-kpi:hover { transform: translateY(-3px) rotate(-.4deg); }
.hq-kpi__emo { position: absolute; right: -6px; bottom: -12px; font-size: 54px; opacity: .14; transform: rotate(-12deg); pointer-events: none; }
.hq-kpi dt { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.hq-kpi dd { margin: 2px 0 0; font: 700 28px/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.hq-kpi small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.hq-kpi--alert { border-color: color-mix(in oklab, var(--danger) 40%, transparent); }
.hq-kpi--alert dd { color: var(--danger); }
button.hq-kpi { text-align: left; font: inherit; color: inherit; cursor: pointer; }

/* hero welcome */
.hq-hello { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: var(--r); margin-bottom: 16px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in oklab, var(--accent) 92%, #fff) 0%, var(--accent) 40%, var(--accent-2) 100%); box-shadow: var(--shadow-lg); }
.hq-hello h1 { font-size: clamp(22px, 3vw, 28px); }
.hq-hello p { margin: 4px 0 0; opacity: .9; }
.hq-hello__art { margin-left: auto; font-size: 54px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); animation: hq-float 4s ease-in-out infinite; }
@keyframes hq-float { 50% { transform: translateY(-8px) rotate(4deg); } }
.hq-hello .hq-role { background: rgba(255, 255, 255, .22); color: #fff; border-color: rgba(255, 255, 255, .35); }
.hq-hello__perms { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.hq-hello__perms span { padding: 2px 9px; border-radius: 99px; background: rgba(255, 255, 255, .18); font-size: 12px; font-weight: 600; }
@container (max-width: 520px) { .hq-hello__art { display: none; } }

/* ── Avatars ── */
.hq-ava { --h: 260; --size: 40px; position: relative; flex: none; display: inline-grid; place-items: center; width: var(--size); height: var(--size); overflow: hidden;
  border-radius: 50%; font: 700 calc(var(--size) * .38)/1 var(--font-display); color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 70% 62%), hsl(calc(var(--h) + 40) 72% 52%)); }
.hq-ava img { width: 100%; height: 100%; object-fit: cover; }
.hq-ava[data-shape="rounded"] { border-radius: 28%; }
.hq-ava[data-shape="square"] { border-radius: 10%; }
.hq-ava[data-shape="diamond"] { border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.hq-ava[data-shape="hexagon"] { border-radius: 0; clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); }
.hq-ava--anon { background: linear-gradient(135deg, #6b7280, #374151); }
.hq-ava--xs { --size: 28px; }
.hq-ava--sm { --size: 34px; }
.hq-ava--lg { --size: 54px; }
.hq-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hq-who__txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.hq-who__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-who__sub { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Moderator cards ── */
.hq-mod { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s; container-type: inline-size; }
.hq-mod::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; border-radius: var(--r) var(--r) 0 0; background: var(--c, var(--accent)); }
.hq-mod:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.hq-mod.is-expired { opacity: .65; }
.hq-mod.is-expired::before { background: var(--text-3); }
.hq-mod__top { display: flex; align-items: center; gap: 12px; }
.hq-mod__top .hq-who { flex: 1; }
.hq-perms { display: flex; flex-wrap: wrap; gap: 5px; }
.hq-perm { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--text-2); }
.hq-perm--off { opacity: .4; text-decoration: line-through; }
.hq-mod__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-3); }
.hq-mod__meta b { color: var(--text-2); font-weight: 700; }
.hq-mod__note { font-size: 13px; color: var(--text-2); background: var(--sunken); padding: 8px 11px; border-radius: 11px; border-left: 3px solid var(--c, var(--accent)); }
.hq-mod__acts { display: flex; gap: 6px; margin-top: auto; }
.hq-mod__acts .hq-btn:first-child { flex: 1; }

/* empty state */
.hq-empty { text-align: center; padding: 42px 20px; color: var(--text-2); }
.hq-empty__art { font-size: 54px; display: inline-block; animation: hq-float 4s ease-in-out infinite; }
.hq-empty h3 { margin: 10px 0 4px; font-size: 20px; color: var(--text); }
.hq-empty p { margin: 0 auto 16px; max-width: 420px; }

/* ── Roles ── */
.hq-rolecard { --c: var(--accent); position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s, box-shadow .2s, opacity .2s; }
.hq-rolecard::after { content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--c) 30%, transparent), transparent 70%); pointer-events: none; }
.hq-rolecard.is-drag { opacity: .45; }
.hq-rolecard.is-over { box-shadow: 0 0 0 3px var(--accent), var(--shadow-lg); }
.hq-rolecard__top { display: flex; align-items: center; gap: 12px; }
.hq-rolecard__emo { width: 48px; height: 48px; flex: none; display: grid; place-items: center; font-size: 25px; border-radius: 16px;
  background: color-mix(in oklab, var(--c) 18%, var(--surface-solid)); border: 1px solid color-mix(in oklab, var(--c) 32%, transparent); }
.hq-rolecard__name { font: 600 18px/1.2 var(--font-display); }
.hq-rolecard__desc { margin: 0; color: var(--text-2); font-size: 13.5px; }
.hq-grip { margin-left: auto; color: var(--text-3); cursor: grab; display: flex; gap: 2px; align-items: center; }
.hq-grip button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--text-3); display: grid; place-items: center; }
.hq-grip button:hover { background: var(--sunken); color: var(--text); }
.hq-grip svg { width: 16px; height: 16px; }

/* permission matrix */
.hq-matrix-wrap { overflow-x: auto; margin: -4px -6px; padding: 4px 6px; }
.hq-matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; min-width: 560px; }
.hq-matrix th, .hq-matrix td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.hq-matrix th:first-child, .hq-matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface-solid); z-index: 1; }
.hq-matrix thead th { font-weight: 700; font-size: 12.5px; color: var(--text-2); vertical-align: bottom; }
.hq-matrix tbody tr:hover td { background: color-mix(in oklab, var(--accent) 5%, var(--surface-solid)); }
.hq-matrix .hq-mgroup td { background: var(--sunken) !important; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); padding: 6px 10px; }
.hq-cell { width: 30px; height: 30px; border-radius: 10px; border: 1.5px solid var(--line); background: none; display: inline-grid; place-items: center;
  font-size: 15px; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), background .2s; }
.hq-cell:hover { transform: scale(1.12); }
.hq-cell[aria-pressed="true"] { background: var(--c, var(--accent)); border-color: transparent; color: #fff; }
.hq-cell[aria-pressed="true"]::before { content: "✓"; font-weight: 800; }

/* permission toggle list */
.hq-permlist { display: flex; flex-direction: column; gap: 14px; }
.hq-permgroup h4 { margin: 0 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.hq-permrow { display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-solid);
  cursor: pointer; transition: border-color .2s, background .2s; }
.hq-permrow + .hq-permrow { margin-top: 6px; }
.hq-permrow:has(:checked) { border-color: color-mix(in oklab, var(--accent) 45%, transparent); background: color-mix(in oklab, var(--accent) 6%, var(--surface-solid)); }
.hq-permrow__emo { font-size: 19px; width: 26px; text-align: center; }
.hq-permrow__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.hq-permrow__txt b { font-size: 14px; }
.hq-permrow__txt small { color: var(--text-3); font-size: 12.5px; }

/* ── Dialog ── */
.hq-dlg { width: min(640px, calc(100vw - 24px)); max-height: min(88dvh, 860px); padding: 0; border: 1px solid var(--line); border-radius: 26px;
  background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 1; transform: none; transition: opacity .22s, transform .3s cubic-bezier(.2, .9, .3, 1.2), overlay .3s allow-discrete, display .3s allow-discrete; }
.hq-dlg[open] { display: flex; flex-direction: column; }
@starting-style { .hq-dlg[open] { opacity: 0; transform: translateY(18px) scale(.97); } }
.hq-dlg::backdrop { background: rgba(15, 10, 35, .45); backdrop-filter: blur(5px); }
.hq-dlg__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.hq-dlg__head h2 { font-size: 20px; flex: 1; }
.hq-dlg__emo { font-size: 26px; }
.hq-dlg__body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.hq-dlg__foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--sunken); flex-wrap: wrap; }
.hq-dlg__foot .hq-spacer { margin-right: auto; }
@media (max-width: 560px) { .hq-dlg { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 26px 26px 0 0; max-height: 92dvh; } }

/* role picker inside the moderator editor */
.hq-rolepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hq-rolepick label { --c: var(--accent); position: relative; display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; border-radius: 15px; border: 1.5px solid var(--line);
  cursor: pointer; transition: border-color .2s, background .2s, transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.hq-rolepick label:hover { transform: translateY(-2px); }
.hq-rolepick label:has(:checked) { border-color: var(--c); background: color-mix(in oklab, var(--c) 10%, transparent); }
.hq-rolepick label:has(:checked)::after { content: "✓"; position: absolute; top: 8px; right: 10px; width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c); color: #fff; font-size: 11px; font-weight: 800; }
.hq-rolepick input { position: absolute; opacity: 0; pointer-events: none; }
.hq-rolepick b { font-size: 14px; }
.hq-rolepick span { font-size: 22px; }
.hq-rolepick small { color: var(--text-3); font-size: 11.5px; }

.hq-pickchips { display: flex; gap: 6px; flex-wrap: wrap; }
.hq-pickchips button { border: 1.5px solid var(--line); background: var(--surface-solid); padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.hq-pickchips button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.hq-swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hq-swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); transition: transform .2s; }
.hq-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--c); transform: scale(1.06); }
.hq-swatches input[type="color"] { width: 34px; height: 34px; border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; }
.hq-emos { display: flex; gap: 4px; flex-wrap: wrap; }
.hq-emos button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--sunken); font-size: 18px; transition: transform .2s; }
.hq-emos button:hover { transform: scale(1.15) rotate(-6deg); }

/* member search */
.hq-search { position: relative; }
.hq-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 18px; height: 18px; }
.hq-search .hq-input { padding-left: 40px; }
.hq-results { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 280px; overflow-y: auto; }
.hq-result { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 13px; background: none; text-align: left; width: 100%; }
.hq-result:hover, .hq-result:focus-visible { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 25%, transparent); }
.hq-result .hq-who { flex: 1; }
.hq-picked { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 15px; background: var(--accent-soft); }
.hq-picked .hq-who { flex: 1; }

/* ── Reports ── */
.hq-report { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hq-report.is-hidden { background: repeating-linear-gradient(135deg, var(--surface) 0 14px, color-mix(in oklab, var(--danger) 5%, var(--surface)) 14px 28px); }
.hq-report__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hq-report__top .hq-who { flex: 1; min-width: 160px; }
.hq-report__body { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 15px; padding: 12px 14px; border-radius: 14px; background: var(--sunken); }
.hq-report__media { display: flex; gap: 6px; overflow-x: auto; }
.hq-report__media img, .hq-report__media video { height: 110px; border-radius: 12px; object-fit: cover; background: var(--sunken); }
.hq-reasons { display: flex; flex-direction: column; gap: 5px; }
.hq-reason { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--text-2); }
.hq-reason::before { content: "🚩"; font-size: 12px; }
.hq-reason time { margin-left: auto; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.hq-report__acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Mutes ── */
.hq-list { display: flex; flex-direction: column; }
.hq-li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.hq-li:last-child { border-bottom: 0; }
.hq-li .hq-who { flex: 1 1 200px; }
.hq-li__mid { flex: 2 1 220px; min-width: 0; font-size: 13.5px; color: var(--text-2); }
.hq-li__mid b { color: var(--text); }
.hq-li.is-over { opacity: .55; }

/* ── Log timeline ── */
.hq-log { position: relative; display: flex; flex-direction: column; }
.hq-log__item { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; }
.hq-log__item::before { content: ""; position: absolute; left: 19px; top: 44px; bottom: -10px; width: 2px; background: var(--line); }
.hq-log__item:last-child::before { display: none; }
.hq-log__ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; font-size: 18px; background: var(--sunken); }
.hq-log__txt { font-size: 14px; line-height: 1.45; }
.hq-log__txt q { color: var(--text-2); font-style: italic; }
.hq-log__reason { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.hq-log__time { font-size: 12px; color: var(--text-3); white-space: nowrap; padding-top: 3px; }

/* ── Chart ── */
.hq-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.hq-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hq-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.hq-chart { position: relative; margin-top: 10px; }
.hq-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.hq-chart .ax { font: 11px var(--font-body); fill: var(--text-3); stroke: none; }
.hq-chart .gl { stroke: var(--grid); stroke-width: 1; }
.hq-chart .b1 { fill: var(--series-1); stroke: none; }
.hq-chart .b2 { fill: var(--series-2); stroke: none; }
.hq-chart .hit { fill: transparent; stroke: none; }
.hq-chart .hit:hover, .hq-chart .hit.is-on { fill: color-mix(in oklab, var(--accent) 8%, transparent); }
.hq-tip { position: absolute; z-index: 5; pointer-events: none; padding: 8px 11px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); font-size: 12.5px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.hq-tip b { display: block; margin-bottom: 3px; font-size: 12px; color: var(--text-2); }
.hq-tip span { display: flex; align-items: center; gap: 6px; }
.hq-tip i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.hq-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.hq-table th, .hq-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.hq-table th:first-child, .hq-table td:first-child { text-align: left; }
.hq-table th { color: var(--text-2); font-weight: 700; }

/* categories (horizontal bars) */
.hq-hbars { display: flex; flex-direction: column; gap: 10px; }
.hq-hbar { display: grid; grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) 42px; gap: 10px; align-items: center; font-size: 13.5px; }
.hq-hbar__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hq-hbar__track { display: block; height: 12px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.hq-hbar__fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--c); transform-origin: left; animation: hq-grow .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes hq-grow { from { transform: scaleX(0); } }
.hq-hbar__n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 700; }

/* leaderboard */
.hq-lb { display: flex; flex-direction: column; gap: 4px; counter-reset: lb; }
.hq-lb__row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 12px; counter-increment: lb; }
.hq-lb__row:hover { background: var(--sunken); }
.hq-lb__row::before { content: counter(lb); width: 24px; text-align: center; font: 700 15px var(--font-display); color: var(--text-3); }
.hq-lb__row:nth-child(1)::before { content: "🥇"; } .hq-lb__row:nth-child(2)::before { content: "🥈"; } .hq-lb__row:nth-child(3)::before { content: "🥉"; }
.hq-lb__row .hq-who { flex: 1; }
.hq-lb__n { font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* settings */
.hq-setting { display: flex; align-items: center; gap: 14px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.hq-setting:last-child { border-bottom: 0; }
.hq-setting__txt { flex: 1; min-width: 0; }
.hq-setting__txt b { display: block; font-size: 14.5px; }
.hq-setting__txt small { color: var(--text-3); font-size: 12.5px; }
.hq-setting .hq-input { width: 120px; }
.hq-setting select.hq-input { width: auto; }
.hq-savebar { position: sticky; bottom: 96px; z-index: 20; display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; border-radius: 18px;
  background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: hq-in .3s both; }
.hq-savebar span { flex: 1; font-weight: 600; }
@media (min-width: 861px) { .hq-savebar { bottom: 16px; } }

/* ── Popover menu ── */
.hq-pop { margin: 0; padding: 6px; min-width: 200px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-lg);
  opacity: 1; transform: none; transition: opacity .16s, transform .2s cubic-bezier(.2, .9, .3, 1.3), overlay .2s allow-discrete, display .2s allow-discrete; }
@starting-style { .hq-pop:popover-open { opacity: 0; transform: translateY(-6px) scale(.97); } }
.hq-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 11px; background: none; text-align: left; font-weight: 600; font-size: 14px; }
.hq-pop button:hover { background: var(--accent-soft); }
.hq-pop h5 { margin: 4px 10px 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }

/* ── Toasts, skeleton, gate ── */
.hq-toasts { position: fixed; z-index: 100; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.hq-toast { padding: 10px 18px; border-radius: 99px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: hq-toast .35s cubic-bezier(.2, .9, .3, 1.4) both; }
.hq-toast.is-err { background: var(--danger); color: #fff; }
@keyframes hq-toast { from { opacity: 0; transform: translateY(14px) scale(.9); } }
@media (min-width: 861px) { .hq-toasts { bottom: 24px; } }

.hq-skel { border-radius: var(--r); background: linear-gradient(100deg, var(--sunken) 30%, color-mix(in oklab, var(--sunken), var(--surface-solid) 60%) 50%, var(--sunken) 70%) 0 0 / 300% 100%;
  animation: hq-shimmer 1.4s linear infinite; min-height: 120px; }
@keyframes hq-shimmer { to { background-position: -150% 0; } }

.hq-gate { max-width: 520px; margin: 12vh auto 0; padding: 0 16px; text-align: center; }
.hq-gate .hq-card { padding: 34px 26px; }
.hq-gate__art { font-size: 64px; display: inline-block; animation: hq-float 4s ease-in-out infinite; }
.hq-gate h1 { font-size: 26px; margin: 12px 0 6px; }
.hq-gate p { color: var(--text-2); margin: 0 0 18px; }

.hq-confetti { position: fixed; z-index: 200; top: -12px; width: 9px; height: 14px; border-radius: 3px; pointer-events: none;
  animation: hq-fall var(--t, 1.6s) cubic-bezier(.25, .6, .4, 1) forwards; }
@keyframes hq-fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: .2; } }

.hq-note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 14px; font-size: 13.5px; background: var(--accent-soft); color: var(--text-2); }
.hq-note--warn { background: var(--warn-soft); }
.hq-mute-sm { color: var(--text-3); font-size: 12.5px; }
.hq-more { display: flex; justify-content: center; margin-top: 12px; }

/* Color Studio gradient name (Rainbow / Classic / custom gradient) — --grad set inline; color: stays the fallback.
   Static unless the tier has "Animate gradient" on (--flow). */
.hq-gradname {
  background-image: var(--grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hq-gradname--flow { background-size: 200% 100%; animation: hq-gradname 6s linear infinite; }
@keyframes hq-gradname { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .hq-gradname--flow { animation: none; } }
