/* Vaqun dashboard: the A2 design (design/README.md, design/explorations/a2-*.html) as one stylesheet.
   Phase 2, prompt 137. Tokens first; the old base.html variable names are aliases of the new tokens,
   so pages that aren't migrated yet already use this palette. */

@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/unbounded-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF; }
/* A fallback metrically close to Onest, so the swap doesn't shift the layout. */
@font-face { font-family: "Onest Fallback"; src: local("Segoe UI"), local("Arial"); size-adjust: 101%; ascent-override: 95%; descent-override: 25%; line-gap-override: 0%; }

:root {
  /* Surfaces: cards sit darker than the page (Mee6 lightness, a faint cool cast). */
  --page: #25262e;
  --panel: #1e1f26;
  --raised: #2b2c35;
  --raised-2: #33343e;
  --inset: #16171c;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .12);
  --ink: #f2f4fb;
  --ink-2: #c4c7d4;
  --ink-3: #9a9eb0;
  --ink-4: #6f7385;

  /* Brand violet = the logo's (#9e5bf8, sampled from static/brand). White text on it is 3.96:1, so
     anything that carries text uses the deeper --accent-fill (4.74:1; hover 4.52:1). */
  --brand: #9e5bf8;
  --brand-hover: #ac72fa;
  --accent-fill: #8f4bf0;
  --accent-fill-hover: #934ff2;
  --on-accent: #ffffff;
  --accent-text: #c9a4ff;     /* 8.0:1 on a card, 7.3:1 on the page */
  --sel-fill: #3a2c54;        /* 22 % brand over the sidebar */
  --sel-ink: #e2ceff;         /* 8.7:1 on --sel-fill */
  --hover-fill: #2b253b;      /* 10 % */
  --brand-10: rgba(158, 91, 248, .10);
  --brand-20: rgba(158, 91, 248, .20);
  --brand-30: rgba(158, 91, 248, .30);
  --brand-40: rgba(158, 91, 248, .40);
  --white-10: rgba(255, 255, 255, .10);
  --white-16: rgba(255, 255, 255, .16);
  --focus: #c9a4ff;
  --premium: #c9a4ff;         /* Premium = the brand's light tone; badge ink #e2ceff on a 20 % tint: 8.9:1 */

  --ok: #5fd39b;
  --warn: #e8b65a;
  --danger: #f0766e;

  /* Module palette: one muted hue per module (no violet: it stays for actions and selection). */
  --p-coral: #ec7a70; --p-peach: #e8955c; --p-amber: #ddb04e; --p-lime: #9ccc5a; --p-mint: #55c99a;
  --p-teal: #4cc3cf; --p-sky: #5eaaf0; --p-blue: #7f9cf5; --p-orchid: #d98ad0; --p-rose: #ee86a6;
  --p-slate: #93a0bd;

  --font-ui: "Onest", "Onest Fallback", "Segoe UI", system-ui, sans-serif;
  --font-display: "Unbounded", "Onest", system-ui, sans-serif;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-lift: cubic-bezier(.22, 1, .36, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --t-hover: 220ms;

  /* Comfortable (default) */
  --side-w: 280px; --top-h: 72px; --pad: 32px; --gap: 24px; --card-pad: 22px;
  --ctl-h: 40px; --btn-h: 38px; --row-h: 36px; --tile: 52px; --tile-icon: 26px;
  --t-body: 14px; --t-sm: 13px; --t-xs: 12px; --t-title: 15px; --t-h: 18px; --t-h1: 24px;
  --r-sm: 6px; --r: 8px; --r-lg: 12px;

  /* Old base.html names → the tokens above (pages not migrated yet keep working). */
  --bg: var(--page); --bg-glow: var(--page); --surface: var(--panel); --surface-2: var(--raised); --surface-3: var(--raised-2);
  --border: var(--line-strong); --border-strong: var(--white-16); --text: var(--ink); --muted: var(--ink-3); --faint: var(--ink-3);  /* text on the public pages uses it: --ink-4 is 3.5:1, under AA (prompt 139 Lighthouse) */
  --accent: var(--accent-fill); --accent-hover: var(--accent-fill-hover); --accent-bright: var(--brand);
  --accent-soft: var(--brand-10); --accent-line: var(--brand-40);
  --cta: var(--accent-fill); --cta-glow: none; --cta-glow-hover: none; --cta-rim: transparent;
  --premium-fill: var(--brand-20); --premium-light: var(--premium); --premium-glow: transparent;
  --premium-edge: linear-gradient(135deg, #e2ceff, #9e5bf8 55%, #c9a4ff); --premium-ink: linear-gradient(90deg, #f4ecff, #e2ceff 50%, #c9a4ff);
  --err: var(--danger); --ok-soft: rgba(95, 211, 155, .14); --err-soft: rgba(240, 118, 110, .14);
  --radius: var(--r-lg); --radius-sm: var(--r);
  --tone: var(--hue, var(--accent-text)); --tone-soft: color-mix(in srgb, var(--hue, var(--brand)) 16%, transparent);
  /* The logo's tile everywhere on the page (prompt 145): a soft violet gradient, the brand violet (#9e5bf8) mixed into
     the sidebar's graphite at 60 % and 75 %. The bare cat is 1.0-1.3:1 on the UI's dark surfaces, so it needs a tile; on
     this one it's 2.5-3.2:1, and it's far calmer than the pre-A2 gradient (saturation .42-.50 against .69-.83). */
  --logo-tile: linear-gradient(135deg, #6b43a4, #7e4cc4);
}
[data-density="compact"] {
  --side-w: 252px; --top-h: 60px; --pad: 24px; --gap: 18px; --card-pad: 18px;
  --ctl-h: 34px; --btn-h: 32px; --row-h: 32px; --tile: 44px; --tile-icon: 22px;
  --t-body: 13.5px; --t-title: 14px; --t-h: 16px; --t-h1: 21px;
}
/* The old per-feature tones now pick a palette hue (violet is never one of them). */
.tone-red { --hue: var(--p-coral); } .tone-green { --hue: var(--p-mint); } .tone-yellow { --hue: var(--p-amber); }
.tone-blue { --hue: var(--p-sky); } .tone-cyan { --hue: var(--p-teal); } .tone-pink { --hue: var(--p-rose); }
.tone-orange { --hue: var(--p-peach); } .tone-purple { --hue: var(--p-orchid); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; color: var(--ink); background: var(--page); font-family: var(--font-ui); -webkit-font-smoothing: antialiased; }
body.app { font-size: var(--t-body); line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--sel-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
svg { flex: none; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.hint { color: var(--ink-3); font-size: var(--t-sm); margin: 6px 0 0; }
code { background: var(--raised); padding: 1px 6px; border-radius: 5px; font-size: .92em; }
body.app h1 { font-size: var(--t-h1); line-height: 1.25; margin: 0; letter-spacing: -0.01em; font-weight: 700; }
body.app h2 { font-size: var(--t-h); margin: 0 0 10px; font-weight: 600; letter-spacing: 0; }
body.app h3 { font-size: var(--t-title); margin: 0 0 6px; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--btn-h); padding: 0 16px;
  border: 0; border-radius: var(--r); background: var(--white-10); color: var(--ink); box-shadow: none; transform: none; overflow: visible;
  font-weight: 600; font-size: var(--t-body); line-height: 1; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease); }
.btn:hover { background: var(--white-16); color: var(--ink); transform: none; box-shadow: none; border-color: transparent; }
.btn:active { transform: scale(.97); box-shadow: none; }
.btn::after { content: none !important; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-fill-hover); color: var(--on-accent); }
.btn.danger { background: rgba(240, 118, 110, .14); color: var(--danger); }
.btn.danger:hover { background: rgba(240, 118, 110, .24); color: #ff9b94; }
.btn.ghost { background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--white-10); color: var(--ink); }
.btn.small, .btn.sm { height: 30px; padding: 0 11px; font-size: var(--t-sm); border-radius: var(--r); }
.btn.large { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: var(--r); background: none; color: var(--ink-2); display: inline-grid; place-items: center; cursor: pointer; flex: none; position: relative; padding: 0;
  transition: background-color .15s var(--ease), color .15s var(--ease); }
.icon-btn:hover { background: var(--white-10); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Form controls ---------- */
label { display: block; margin: 0 0 6px; font-size: var(--t-sm); font-weight: 500; color: var(--ink-3); }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row .field { margin-bottom: 0; }
fieldset { min-width: 0; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=range]):not([type=hidden]), select, textarea {
  max-width: 100%; min-height: var(--ctl-h); padding: 0 12px; border: 1px solid transparent; border-radius: var(--r); background: var(--inset); color: var(--ink);
  font-size: var(--t-body); outline: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
textarea { width: 100%; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select { padding-right: 34px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background: var(--inset) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9eb0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 10px center / 16px no-repeat; }
select[multiple] { padding: 6px; background-image: none; min-height: 110px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:not([type=checkbox]):not([type=radio]):hover, select:hover, textarea:hover { border-color: var(--brand-40); }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-30); }
input:disabled, select:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; }
input:disabled:hover, select:disabled:hover, textarea:disabled:hover { border-color: transparent; }
input[type=color] { width: 56px; height: var(--ctl-h); padding: 4px; border: 0; border-radius: var(--r); background: var(--inset); cursor: pointer; }
input[type=file] { font-size: var(--t-sm); color: var(--ink-2); max-width: 100%; }
input[type=file]::file-selector-button { height: 30px; margin-right: 10px; padding: 0 12px; border: 0; border-radius: var(--r); background: var(--white-10); color: var(--ink); font: 600 var(--t-sm) var(--font-ui); cursor: pointer; }
/* Checkbox and radio: drawn, not the browser's. */
input[type=checkbox]:not(.switch), input[type=radio] { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; vertical-align: -4px;
  border: 1.5px solid var(--ink-4); border-radius: 5px; background: var(--inset); cursor: pointer; display: inline-grid; place-content: center;
  transition: background-color .15s var(--ease), border-color .15s var(--ease); }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:not(.switch)::before { content: ""; width: 11px; height: 11px; background: #fff; transform: scale(0); transition: transform .12s var(--ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
input[type=radio]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .12s var(--ease); }
input[type=checkbox]:not(.switch):checked, input[type=radio]:checked { background: var(--brand); border-color: var(--brand); }
input[type=checkbox]:not(.switch):checked::before, input[type=radio]:checked::before { transform: scale(1); }
input[type=checkbox]:not(.switch):hover, input[type=radio]:hover { border-color: var(--brand); }

/* Toggle: 40 x 22 track, 16 px round thumb, both states. .toggle is a button[role=switch]; .switch the existing checkboxes. */
.toggle, input[type=checkbox].switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 40px !important; height: 22px !important; min-height: 0; padding: 0; margin: 0;
  border: 0; border-radius: 99px; background: #3a3b46; cursor: pointer; transition: background-color .15s var(--ease); }
.toggle::after, input[type=checkbox].switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35); transition: transform .18s var(--ease); }
.toggle[aria-checked="true"], input[type=checkbox].switch:checked { background: var(--brand); }
.toggle[aria-checked="true"]::after, input[type=checkbox].switch:checked::after { transform: translateX(18px); }
.toggle:disabled, input.switch:disabled { opacity: .4; cursor: not-allowed; }
input.switch.small { width: 40px !important; height: 22px !important; }
input.switch.small::after { width: 16px; height: 16px; }
input.switch.small:checked::after { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0; cursor: pointer; color: var(--ink); font-weight: 500; font-size: var(--t-body); }

/* Segmented control (radios or buttons). */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--inset); flex: none; max-width: 100%; }
.seg > button, .seg > label { height: calc(var(--ctl-h) - 6px); padding: 0 14px; margin: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-3);
  font-weight: 600; font-size: var(--t-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: color .15s var(--ease), background-color .15s var(--ease); }
.seg > label input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg > button:hover, .seg > label:hover { color: var(--ink); }
.seg > button[aria-checked="true"], .seg > label:has(input:checked) { background: var(--raised); color: var(--ink); }
.seg > label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg > label:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.seg svg { width: 14px; height: 14px; }
.seg .badge { height: 18px; padding: 0 6px; font-size: 10.5px; }

/* Enhanced select (vaqun.js wraps <select>; the select stays the form value). */
.sel { position: relative; display: inline-block; min-width: 0; max-width: 100%; vertical-align: middle; }
.sel > select { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.sel > .sel-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 160px; height: var(--ctl-h); padding: 0 10px 0 12px; border: 1px solid transparent; border-radius: var(--r);
  background: var(--inset); color: var(--ink); cursor: pointer; text-align: left; font-size: var(--t-body); transition: border-color .15s var(--ease); }
.sel > .sel-btn:hover { border-color: var(--brand-40); }
.sel > .sel-btn[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-30); }
.sel > .sel-btn:disabled { opacity: .5; cursor: not-allowed; }
.sel > .sel-btn .v { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel > .sel-btn svg { width: 16px; height: 16px; color: var(--ink-3); }
.pop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: min(360px, 90vw); max-height: 320px; overflow-y: auto; padding: 6px;
  border-radius: var(--r); background: var(--inset); box-shadow: 0 0 0 1px var(--line-strong), 0 16px 40px rgba(0, 0, 0, .45); transform-origin: top left; animation: pop .14s var(--ease); scrollbar-width: thin; }
.pop.up { top: auto; bottom: calc(100% + 6px); }
.pop .grp { padding: 8px 8px 4px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.pop .q { position: sticky; top: -6px; display: flex; align-items: center; gap: 8px; height: 34px; margin: -6px -6px 4px; padding: 0 10px; background: var(--inset); border-bottom: 1px solid var(--line); color: var(--ink-3); }
.pop .q svg { width: 14px; height: 14px; }
.pop .q input { flex: 1; min-width: 0; min-height: 0 !important; height: 32px; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: none !important; font-size: var(--t-sm); }
.pop [role="option"] { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--t-body); font-weight: 500; cursor: pointer; }
.pop [role="option"].hl, .pop [role="option"]:hover { background: var(--raised); color: var(--ink); }
.pop [role="option"][aria-selected="true"] { color: var(--sel-ink); }
.pop [role="option"][aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.pop .empty { padding: 8px; color: var(--ink-3); font-size: var(--t-sm); }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Role picker (prompt 146, templates/_role_picker.html + vaqun.js rolePicker) ----------
   A field like .sel's, a dropdown on the raised surface with a search, the chosen roles as chips under it (the home
   header's chip look). Role names fall back to symbol fonts: separators like "╰──➤ Staff" read as they do in Discord. */
.rp { --rp-font: var(--font-ui), "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "Apple Symbols", "DejaVu Sans", sans-serif;
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
.rp > select { width: 100%; }
.rp.rp-on > select { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.rp-field { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; max-width: 420px; min-width: 0; height: var(--ctl-h); padding: 0 10px 0 12px;
  border: 1px solid transparent; border-radius: var(--r); background: var(--inset); color: var(--ink); cursor: pointer; text-align: left;
  font: 500 var(--t-body) var(--rp-font); transition: border-color .15s var(--ease); }
.rp-field:hover { border-color: var(--brand-40); }
.rp-field[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-30); }
.rp-field:disabled { opacity: .5; cursor: not-allowed; }
.rp-field svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.rp-v { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-v.ph { color: var(--ink-3); display: block; }
.rp-clr { width: 28px; height: 28px; flex: none; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-3); font-size: 18px; line-height: 1; cursor: pointer; }
.rp-clr:hover { background: var(--white-10); color: var(--ink); }
.rp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.rp-chips:empty { display: none; }
.rp-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 220px; height: 28px; padding: 0 4px 0 10px; border: 0; border-radius: var(--r);
  background: var(--white-10); color: var(--ink); font: 600 var(--t-sm) var(--rp-font); }
.rp-chip .role-dot { width: 8px; height: 8px; margin: 0; background: var(--ink-4); }
.rp-cn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-chip.unknown { color: var(--ink-3); font-style: italic; }
.rp-chip.more { padding: 0 10px; color: var(--ink-2); cursor: pointer; }
.rp-chip.more:hover { background: var(--white-16); }
.rp-x { width: 22px; height: 22px; flex: none; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-3); font-size: 16px; line-height: 1; cursor: pointer; }
.rp-x:hover { background: var(--white-16); color: var(--ink); }
.rp-clear { border: 0; background: none; padding: 0 4px; color: var(--ink-3); font: 600 var(--t-sm) var(--font-ui); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rp-clear:hover { color: var(--ink); }
.rp-note, .rp-empty { flex-basis: 100%; margin: 0; color: var(--ink-3); font-size: var(--t-sm); }
.rp-panel { position: absolute; z-index: 60; top: calc(var(--ctl-h) + 6px); left: 0; width: min(420px, 100%); max-height: 360px; display: flex; flex-direction: column;
  border-radius: var(--r); background: var(--raised); box-shadow: 0 0 0 1px var(--line-strong), 0 16px 40px rgba(0, 0, 0, .45); animation: pop .14s var(--ease); overflow: hidden; }
.rp-panel[hidden] { display: none; }
.rp-panel.up { top: auto; bottom: calc(100% + 6px); }
.rp-q { display: flex; align-items: center; gap: 8px; margin: 8px; padding: 0 10px; height: 36px; border-radius: var(--r-sm); background: var(--inset); color: var(--ink-3); flex: none; }
.rp-q svg { width: 14px; height: 14px; flex: none; }
.rp-q input { flex: 1; min-width: 0; min-height: 0 !important; height: 34px; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: none !important; font-size: var(--t-sm); }
.rp-list { flex: 1 1 auto; min-height: 112px; overflow-y: auto; padding: 0 6px 6px; scrollbar-width: thin; }  /* three rows stay visible with the skipped group open */
.rp-row { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 8px; border-radius: var(--r-sm); color: var(--ink-2); font: 500 var(--t-body) var(--rp-font); cursor: pointer; }
.rp-row[hidden] { display: none; }
.rp-row.hl, .rp-row[role="option"]:hover { background: var(--white-10); color: var(--ink); }
.rp-row[aria-selected="true"] { background: var(--sel-fill); color: var(--sel-ink); }
.rp-row[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.rp-row .role-dot { width: 10px; height: 10px; margin: 0; background: var(--ink-4); }
.rp-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-box { width: 16px; height: 16px; flex: none; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--ink-4); }
.rp-row[aria-selected="true"] .rp-box { background: var(--brand) center / 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); box-shadow: none; }
.rp-tag { flex: none; padding: 1px 7px; border-radius: 99px; background: var(--white-10); color: var(--ink-3); font: 600 var(--t-xs) var(--font-ui); }
.rp-none { margin: 0; padding: 8px 14px 12px; color: var(--ink-3); font-size: var(--t-sm); }
.rp-locked { flex: none; margin: 0 6px 6px; border-top: 1px solid var(--line); }
.rp-locked summary { padding: 8px; color: var(--ink-3); font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.rp-lrows { max-height: 160px; overflow-y: auto; }
.rp-lrows .rp-row { cursor: default; opacity: .7; }
.rp-foot { flex: none; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--t-sm); }
.rp-foot[hidden] { display: none; }
@media (max-width: 600px) {
  /* Phones: the panel is a bottom sheet over a dimmed page; rows are touch-sized. */
  .rp-panel, .rp-panel.up { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: min(72vh, 560px); border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); z-index: 80; }
  .rp-row { min-height: 44px; }
  .rp-field { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .rp-panel { animation: none; } }

/* Popover (link / color / image pickers, small menus). */
.pp-wrap { position: relative; display: inline-block; }
.pp { position: absolute; z-index: 50; top: calc(100% + 6px); right: 0; width: 300px; max-width: calc(100vw - 32px); padding: 12px; border-radius: var(--r); background: var(--panel);
  box-shadow: 0 0 0 1px var(--line-strong), 0 16px 40px rgba(0, 0, 0, .45); animation: pop .14s var(--ease); display: flex; flex-direction: column; gap: 8px; font-family: var(--font-ui); text-align: left; }
.pp.left { left: 0; right: auto; }
.pp label { margin: 0; }

/* ---------- Surfaces ---------- */
.card { background: var(--panel); border: 0; border-radius: var(--r-lg); padding: var(--card-pad); margin: 0 0 var(--gap); }
.card:hover { border-color: transparent; }
.note, .info { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; margin: 0 0 16px; border-radius: var(--r); border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .025);
  color: var(--ink-2); font-size: var(--t-sm); line-height: 1.45; }
.note svg, .info svg { width: 15px; height: 15px; margin-top: 1px; color: var(--ink-3); flex: none; }
.flash { display: block; padding: 12px 14px; margin: 0 0 16px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); font-weight: 500; font-size: var(--t-body); animation: none; }
.flash.ok { color: #9be9c2; border-color: rgba(95, 211, 155, .35); background: rgba(95, 211, 155, .1); }
.flash.err { color: #ffb3ad; border-color: rgba(240, 118, 110, .4); background: rgba(240, 118, 110, .1); }
.flash-detail { display: block; margin-top: 4px; font-weight: 400; font-size: var(--t-sm); opacity: .9; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; background: var(--white-10); color: var(--ink-2); font-size: var(--t-xs); font-weight: 700; white-space: nowrap; box-shadow: none; }
.badge svg { width: 12px; height: 12px; }
.badge.premium, .badge.prem { background: var(--premium-fill); color: var(--sel-ink); box-shadow: none; }
.badge.premium::before { content: ""; width: 11px; height: 11px; flex: none; background: var(--premium);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 8l4.5 4L12 4l4.5 8L21 8l-2 11H5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 8l4.5 4L12 4l4.5 8L21 8l-2 11H5z'/%3E%3C/svg%3E") center / contain no-repeat; }
.badge.on { background: rgba(95, 211, 155, .16); color: var(--ok); }
.badge.watch { background: rgba(232, 182, 90, .16); color: var(--warn); }
.badge.off { background: var(--white-10); color: var(--ink-2); }
.badge.err { background: rgba(240, 118, 110, .16); color: var(--danger); }
.badge.accent { background: var(--brand-20); color: var(--sel-ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-4); }
.dot.on { background: var(--ok); } .dot.watch { background: var(--warn); } .dot.err { background: var(--danger); }

/* Icon tile: icon centred by grid, sized from tokens; --hue inherited (never declared here). */
.tile { width: var(--tile); height: var(--tile); border-radius: var(--r-lg); display: grid; place-items: center; flex: none; position: relative;
  background: color-mix(in srgb, var(--hue, var(--p-slate)) 16%, var(--panel)); color: var(--hue, var(--p-slate)); transition: none; }
.tile svg { width: var(--tile-icon); height: var(--tile-icon); display: block; }
.tile.sm { width: 32px; height: 32px; border-radius: var(--r); }
.tile.sm svg { width: 18px; height: 18px; }

/* Tables (the Anti-Nuke standard). */
table { width: 100%; border-collapse: collapse; }
.table-wrap { overflow-x: auto; }
th { text-align: left; padding: 0 12px 10px; color: var(--ink-3); font-size: var(--t-xs); font-weight: 600; text-transform: none; letter-spacing: 0; border-bottom: 0; }
td { text-align: left; padding: 8px 12px; border-top: 1px solid var(--line); border-bottom: 0; vertical-align: middle; }
tbody tr { transition: background-color .15s var(--ease); }
tbody tr:hover { background: rgba(255, 255, 255, .02); }

/* Tabs (links or buttons): underline in the accent text colour. */
.tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.tabs a, .tabs > button { position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; background: none;
  color: var(--ink-3); font-weight: 600; font-size: var(--t-body); white-space: nowrap; cursor: pointer; transition: color .15s var(--ease), background-color .15s var(--ease); }
.tabs a:hover, .tabs > button:hover { color: var(--ink); background: var(--white-10); }
.tabs a.active, .tabs a[aria-current="page"], .tabs > button[aria-selected="true"] { color: var(--ink); background: none; border-color: transparent; }
.tabs a.active::after, .tabs a[aria-current="page"]::after, .tabs > button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-text); }

/* Collapsible card. */
.sect { background: var(--panel); border-radius: var(--r-lg); margin: 0 0 var(--gap); }
.sect > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: var(--card-pad); cursor: pointer; border-radius: var(--r-lg); }
.sect > summary::-webkit-details-marker { display: none; }
.sect > summary .tt { flex: 1; min-width: 0; }
.sect > summary h2, .sect > summary h3 { margin: 0; font-size: var(--t-h); font-weight: 600; line-height: 1.3; }
.sect > summary p { margin: 3px 0 0; color: var(--ink-3); font-size: var(--t-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sect > summary .chev { width: 20px; height: 20px; color: var(--ink-3); transition: transform .2s var(--ease); }
.sect[open] > summary .chev { transform: rotate(180deg); }
.sect-body { margin: 0 var(--card-pad); padding: 16px 0 var(--card-pad); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }

/* Setting row: label + one-line help left, one control right (also the old .option). */
.srow, .option { display: flex; align-items: center; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.srow:last-child, .option:last-of-type { border-bottom: 0; }
.srow .tx, .option > label { flex: 1; min-width: 0; margin: 0; color: var(--ink); font-size: var(--t-body); font-weight: 600; cursor: pointer; }
.srow .tx > span:not(.badge):not(.as-title), .option > label .hint { display: block; margin: 2px 0 0; color: var(--ink-3); font-size: var(--t-sm); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: var(--raised); color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.chip:hover { background: var(--raised-2); color: var(--ink); }

/* Editor state chip, lock strip, drop zone, counters, inline errors. */
.state-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; background: var(--white-10); color: var(--ink-2); font-size: var(--t-xs); font-weight: 700; white-space: nowrap; }
.state-chip.dirty { background: rgba(232, 182, 90, .16); color: var(--warn); }
.state-chip svg { width: 13px; height: 13px; }
.lock-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 var(--gap); border-radius: var(--r); background: linear-gradient(90deg, rgba(158, 91, 248, .16), rgba(158, 91, 248, .04)); border: 1px solid rgba(158, 91, 248, .32); }
.lock-strip > svg { width: 18px; height: 18px; color: var(--premium); }
.lock-strip .tx { flex: 1; min-width: 0; font-size: var(--t-sm); color: var(--ink-2); }
.lock-strip .tx b { color: var(--ink); }
.count { color: var(--ink-3); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.count.near { color: var(--warn); }
.count.over { color: var(--danger); }
.err-line { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; color: var(--danger); font-size: var(--t-xs); font-weight: 600; }
.err-line svg { width: 14px; height: 14px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 16px; text-align: center; color: var(--ink-3); font-size: var(--t-sm); }
.empty-state img { width: 72px; height: 72px; opacity: .9; }
.empty-state b { color: var(--ink); font-size: var(--t-title); }

/* ---------- Shell (server pages) ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--panel); display: flex; flex-direction: column; min-width: 0; z-index: 30; border: 0; border-radius: 0; padding: 0; max-height: none; }
.side-scroll { flex: 1; overflow-y: auto; padding: 18px 16px 12px; scrollbar-width: thin; scrollbar-color: var(--raised) transparent; overscroll-behavior: contain; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; font: 700 18px/1 var(--font-display); letter-spacing: -0.01em; color: var(--ink); }
.side .brand:hover { color: var(--ink); }
.side .brand .mark-tile { width: 34px; height: 34px; border-radius: 10px; background: var(--logo-tile); display: grid; place-items: center; flex: none; }
.side .brand .mark-tile img { width: 80%; height: 80%; }
/* The page's logos on their tile (--logo-tile): the sidebar's, the public header's and the landing's (.logo-tile,
   .hero-cat). The tile is the wrapper; the cat inside is transparent, with nothing around it (no outline, glow or motion). */
.logo-tile { display: grid; place-items: center; background: var(--logo-tile); border-radius: 28%; }
.side .brand .mark-tile img.mark, .logo-tile img.mark, .hero-cat img.mark { background: transparent; }
.guild-switch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--r); background: var(--inset); color: var(--ink); text-align: left; transition: border-color .15s var(--ease); }
.guild-switch:hover { border-color: var(--brand-40); color: var(--ink); }
.guild-switch .gi { width: 30px; height: 30px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; overflow: hidden; flex: none; font-weight: 800; color: var(--ink-2); }
.guild-switch .gi img { width: 100%; height: 100%; object-fit: cover; }
.guild-switch .gn { flex: 1; min-width: 0; font-weight: 700; font-size: var(--t-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-switch .gn small { display: block; font-weight: 500; font-size: var(--t-xs); color: var(--ink-3); }
.guild-switch svg { width: 16px; height: 16px; color: var(--ink-3); }
.find { display: flex; align-items: center; gap: 8px; height: var(--ctl-h); margin: 10px 0 0; padding: 0 10px; border-radius: var(--r); background: var(--inset); border: 1px solid transparent; color: var(--ink-3); transition: border-color .15s var(--ease); cursor: text; font-weight: 400; }
.find:hover { border-color: var(--brand-40); }
.find:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-30); }
.find svg { width: 16px; height: 16px; }
.find input { flex: 1; min-width: 0; min-height: 0 !important; height: 30px; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; font-size: var(--t-sm); }
.find kbd { font: 600 11px var(--font-ui); color: var(--ink-3); padding: 2px 6px; border-radius: 4px; background: var(--raised); }
.side-body { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.side-tools { display: flex; justify-content: flex-end; margin: 4px 0 -4px; }
.side-all { background: none; border: 0; padding: 2px 6px; color: var(--ink-3); font-size: 11px; font-weight: 700; cursor: pointer; border-radius: var(--r-sm); }
.side-all:hover { color: var(--ink-2); }
.side-menu { display: none; }
.side .group { display: flex; flex-direction: column; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-top: 10px; padding: 6px 10px; border: 0; background: none; cursor: pointer;
  color: var(--ink-3); font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; border-radius: var(--r-sm); text-align: left; }
.group-head:hover { color: var(--ink-2); }
.group-meta { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.group-count { display: none; }
.group-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.group:not([data-open])[data-has-active] .group-dot { display: inline-block; }
.side .chev { width: 14px; height: 14px; flex: none; transition: transform .2s var(--ease); }
.group:not([data-open]) .group-head .chev { transform: rotate(-90deg); }
.group-items { display: grid; grid-template-rows: 1fr; }
.group:not([data-open]) .group-items { grid-template-rows: 0fr; visibility: hidden; opacity: 0; }
.side-ready .group-items { transition: grid-template-rows .22s var(--ease), opacity .18s var(--ease), visibility .22s; }
.group-inner { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
/* Row: 14 px medium; selected / hovered = a filled, violet-tinted row. No stripe, no tile. */
.side a.nav-link, .side a[data-tab] { display: flex; align-items: center; gap: 12px; min-height: var(--row-h); padding: 0 12px; border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--t-body); font-weight: 500;
  transition: background-color .15s var(--ease), color .15s var(--ease); transform: none; }
.side a.nav-link svg, .side a[data-tab] svg { width: 18px; height: 18px; color: var(--ink-3); transition: color .15s var(--ease); }
.side a.nav-link:hover, .side a[data-tab]:hover { background: var(--hover-fill); color: var(--ink); transform: none; }
.side a.nav-link:hover svg, .side a[data-tab]:hover svg { color: var(--ink-2); }
.side a.active { background: var(--sel-fill); color: var(--sel-ink); font-weight: 600; }
.side a.active svg { color: var(--sel-ink); }
.side a::before { content: none; }
.side a[data-tab][hidden-by-search] { display: none; }
.side .no-match { padding: 8px 12px; color: var(--ink-3); font-size: var(--t-sm); }
.promo-wrap { position: relative; padding: 0 16px 16px; }
.promo-wrap::before { content: ""; position: absolute; left: 0; right: 0; top: -36px; height: 36px; background: linear-gradient(to bottom, transparent, var(--panel)); pointer-events: none; }
.promo { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 14px 92px 14px 14px; border: 1px solid var(--brand-40);
  background: linear-gradient(135deg, #34265a 0%, #261f3d 55%, #1e1f26 100%); }
.promo .new { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; background: rgba(201, 164, 255, .18); color: var(--sel-ink); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.promo b { display: block; margin: 8px 0 10px; font-size: var(--t-sm); line-height: 1.35; color: var(--ink); }
.promo .cat { position: absolute; right: -14px; bottom: -18px; width: 104px; height: 104px; transform: rotate(-12deg); pointer-events: none; }
.promo .x { position: absolute; top: 6px; right: 6px; z-index: 1; width: 28px; height: 28px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.promo .x:hover { background: var(--white-10); color: var(--ink); }
.promo .x svg { width: 14px; height: 14px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 var(--pad); background: var(--panel); }
.top .crumb { flex: 1; min-width: 0; color: var(--ink-3); font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .crumb a { color: var(--ink-3); }
.top .crumb a:hover { color: var(--ink); }
.top .crumb b { color: var(--ink); font-weight: 600; }
.top form { margin: 0; }
.ham { display: none; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: var(--r); background: none; color: var(--ink-2); font-weight: 600; font-size: var(--t-sm); cursor: pointer; }
.lang-btn:hover { background: var(--white-10); color: var(--ink); }
.lang-btn svg { width: 16px; height: 16px; }
.icon-btn .ping { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--panel); }
.me { position: relative; }
.me > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px; border-radius: 99px; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: var(--t-sm); }
.me > summary::-webkit-details-marker { display: none; }
.me > summary:hover, .me[open] > summary { background: var(--white-10); color: var(--ink); }
.me > summary img { width: 32px; height: 32px; border-radius: 50%; background: var(--raised); }
.me > summary svg { width: 14px; height: 14px; }
.me .menu, .more .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; background: var(--panel); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line-strong), 0 18px 40px rgba(0, 0, 0, .5); z-index: 40; animation: pop .14s var(--ease); }
.me .menu a, .me .menu button, .more .menu a, .more .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); font-size: var(--t-body); font-weight: 500; text-align: left; cursor: pointer; }
.me .menu a:hover, .me .menu button:hover, .more .menu a:hover, .more .menu button:hover { background: var(--raised); color: var(--ink); }
.me .menu svg, .more .menu svg { width: 16px; height: 16px; color: var(--ink-3); }
.me .menu .sep, .more .menu .sep { height: 1px; margin: 6px 4px; background: var(--line); }
.me .menu .dens, .more .menu .dens { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; color: var(--ink-3); font-size: var(--t-sm); }
.me .menu form, .more .menu form { margin: 0; }
/* The public site's pages from the dashboard (prompt 141, _site_nav.html): two quiet links and More, between the
   breadcrumb and Premium. On a phone the links hide and More (a book icon) holds every page. */
.site-links { display: flex; align-items: center; gap: 2px; flex: none; }
.site-links > a, .more > summary { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: var(--r); color: var(--ink-2); font-weight: 600; font-size: var(--t-sm); white-space: nowrap; }
.site-links > a:hover, .more > summary:hover, .more[open] > summary { background: var(--white-10); color: var(--ink); }
.more { position: relative; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary svg { width: 14px; height: 14px; }
.more > summary svg.sm-only { width: 16px; height: 16px; }
.site-links .sm-only, .more .menu a.sm-only { display: none; }
.content { padding: var(--pad); display: flex; flex-direction: column; gap: 0; width: 100%; max-width: 1540px; }
.content > .flash, .content > .staff-visit { margin-bottom: var(--gap); }

/* Premium button (topbar), "eyeshine": once every --pp-cycle (6.5-9.5 s, per load) a band of light crosses it,
   the crown tips back as it passes, two glints light up on its band. Hover: one brighter pass, eyes stay lit.
   Only transform and opacity; paused while the tab is hidden; static under reduced motion. */
.plan-pill { position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r);
  background: var(--brand-20); color: var(--sel-ink); font-weight: 700; font-size: var(--t-sm); white-space: nowrap; }
.plan-pill:hover { color: var(--sel-ink); background: rgba(158, 91, 248, .28); }
.plan-pill svg { width: 14px; height: 14px; color: var(--premium); overflow: visible; }
.plan-pill::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .22) 48%, rgba(226, 206, 255, .34) 52%, transparent 70%);
  animation: pp-sweep var(--pp-cycle, 8s) cubic-bezier(.45, 0, .25, 1) 1.2s infinite; }
.plan-pill .pp-crown { transform-box: fill-box; transform-origin: 50% 100%; animation: pp-tilt var(--pp-cycle, 8s) ease-in-out 1.2s infinite; }
.plan-pill .pp-eye { fill: #ffffff; opacity: 0; transform-box: fill-box; transform-origin: center; animation: pp-eye var(--pp-cycle, 8s) ease-out 1.2s infinite; }
.plan-pill .pp-eye + .pp-eye { animation-delay: 1.32s; }
@keyframes pp-sweep { 0%, 86% { transform: translateX(-130%); } 97%, 100% { transform: translateX(130%); } }
@keyframes pp-tilt { 0%, 88% { transform: none; } 90.5% { transform: rotate(-9deg) translateY(-.5px); } 94% { transform: rotate(3deg); } 97%, 100% { transform: none; } }
@keyframes pp-eye { 0%, 89% { opacity: 0; transform: scale(.4); } 91% { opacity: 1; transform: scale(1.25); } 95% { opacity: .9; transform: scale(1); } 98%, 100% { opacity: 0; transform: scale(.4); } }
.plan-pill:hover::after { background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, .34) 47%, rgba(226, 206, 255, .46) 53%, transparent 75%); animation: pp-sweep-once 1.4s cubic-bezier(.45, 0, .25, 1) 1; }
.plan-pill:hover .pp-crown { animation: pp-tilt-once 1.4s var(--ease) 1; }
.plan-pill:hover .pp-eye { animation: pp-eye-hold 1.4s ease-out 1 forwards; }
.plan-pill:hover .pp-eye + .pp-eye { animation-delay: .12s; }
@keyframes pp-sweep-once { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@keyframes pp-tilt-once { 0% { transform: none; } 25% { transform: rotate(-11deg) translateY(-.5px); } 55% { transform: rotate(4deg); } 80%, 100% { transform: none; } }
@keyframes pp-eye-hold { 0%, 20% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; transform: scale(1.3); } 60%, 100% { opacity: 1; transform: scale(1); } }
html[data-tab-hidden] .plan-pill::after, html[data-tab-hidden] .plan-pill .pp-crown, html[data-tab-hidden] .plan-pill .pp-eye { animation-play-state: paused; }

/* Panel header (inside the one-page server app). */
.panel-head { display: flex; align-items: center; gap: 16px; margin: 0 0 var(--gap); }
.panel-head .tt { flex: 1; min-width: 0; }
.panel-head h2 { margin: 0; font-size: var(--t-h1); font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.panel-head p { margin: 4px 0 0; color: var(--ink-3); font-size: var(--t-body); }
.panel-head .tile { width: 48px; height: 48px; }
.panel-head .tile svg { width: 24px; height: 24px; }
.panel-head .acts { display: flex; align-items: center; gap: 10px; }

/* ---------- Module card (one shared component) ----------
   Hover: lift 3 px, a ring and soft shadow in the module's hue, a spotlight in the same hue under the cursor
   (--mx/--my, vaqun.js), the icon tips and pops, the action fills with the accent. Transform/opacity/gradient only. */
.modgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 1600px) { .modgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mod { --mx: 50%; --my: 0%; position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 12px; padding: var(--card-pad); border-radius: var(--r-lg); background: var(--panel);
  color: var(--ink); transition: transform var(--t-hover) var(--ease-lift); }
.mod:hover { color: var(--ink); }
.mod::before, .mod::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--t-hover) var(--ease-lift); }
.mod::before { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue) 42%, transparent), 0 22px 40px -22px rgba(0, 0, 0, .8), 0 12px 44px -24px color-mix(in srgb, var(--hue) 70%, transparent); }
.mod::after { background: radial-gradient(240px circle at var(--mx) var(--my), color-mix(in srgb, var(--hue) 11%, transparent), transparent 72%); }
.mod .tile::before { content: ""; position: absolute; inset: -8px; z-index: -1; border-radius: 20px; pointer-events: none; opacity: 0; transform: scale(.6);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--hue) 38%, transparent), transparent); transition: opacity var(--t-hover) var(--ease-lift), transform var(--t-hover) var(--ease-lift); }
.mod .tile svg { transition: transform 240ms var(--ease-pop); }
.mod-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mod h3 { margin: 2px 0 0; font-size: var(--t-title); font-weight: 700; }
.mod p { margin: 0; color: var(--ink-3); font-size: var(--t-sm); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(3 * 1.5em); }
.mod .btn { isolation: isolate; overflow: hidden; align-self: flex-start; margin-top: auto; }
.mod .btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent-fill); opacity: 0; transition: opacity var(--t-hover) var(--ease-lift); }
.mod .btn svg { transition: transform var(--t-hover) var(--ease-pop), opacity var(--t-hover) var(--ease-lift); }
.mod .btn .go { opacity: .6; }
@media (hover: hover) and (pointer: fine) {
  .mod:hover { transform: translateY(-3px); }
  .mod:hover::before, .mod:hover::after { opacity: 1; }
  .mod:hover .tile::before { opacity: 1; transform: none; }
  .mod:hover .tile svg { transform: rotate(-8deg) scale(1.1); }
  .mod:hover .btn::before { opacity: 1; }
  .mod:hover .btn .go { opacity: 1; transform: translateX(3px); }
}
.mod:focus-within::before { opacity: 1; }
@media (hover: none) { .mod { transition-duration: 120ms; } .mod:active { transform: scale(.985); } .mod:active::before { opacity: 1; } }

/* ---------- Mobile ---------- */
.drawer-scrim { display: none; }
@media (max-width: 860px) {
  :root, [data-density="compact"] { --pad: 16px; --gap: 16px; --top-h: 60px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s var(--ease); box-shadow: 0 0 40px rgba(0, 0, 0, .5); }
  .shell[data-drawer] .side { transform: none; }
  .shell[data-drawer] .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .45); }
  .ham { display: inline-grid; }
  .top .hide-sm { display: none; }
  .site-links .sm-only, .more .menu a.sm-only { display: flex; }
  .srow, .option { flex-wrap: wrap; gap: 10px; }
  .modgrid { grid-template-columns: minmax(0, 1fr); }
  .mod p { min-height: 0; }
  .panel-head { flex-wrap: wrap; }
  .seg { flex-wrap: wrap; }
}
@media (min-width: 861px) and (max-width: 1100px) { .modgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
  .mod:hover, .mod:active, .mod .tile svg, .mod .btn svg, .mod .tile::before { transform: none !important; }
  .mod::after, .mod .tile::before { display: none; }
}

/* ---------- Home (server page #home) ---------- */
.hello { position: relative; overflow: hidden; display: flex; align-items: center; gap: 22px; min-height: 132px; padding: 18px 150px 18px var(--card-pad);
  background: radial-gradient(420px 180px at 100% 100%, rgba(158, 91, 248, .16), transparent 70%), var(--panel); }
.hello .gicon { width: 64px; height: 64px; border-radius: 18px; background: var(--raised); display: grid; place-items: center; overflow: hidden; flex: none; align-self: flex-start; font: 800 26px var(--font-ui); color: var(--ink-2); }
.hello .gicon img { width: 100%; height: 100%; object-fit: cover; }
.hello .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.nameline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.nameline .gname { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nameline .meta { color: var(--ink-3); font-size: var(--t-sm); }
.greet { display: flex; align-items: center; gap: 4px; margin: 0; min-height: 28px; color: var(--ink-2); font-size: var(--t-body); }
.greet .line { min-width: 0; }
.greet .icon-btn { width: 28px; height: 28px; border-radius: var(--r-sm); color: var(--ink-3); }
.greet .icon-btn svg { width: 15px; height: 15px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick .btn svg { color: var(--hue); }
.nums { display: flex; gap: 8px; flex: none; }
.stat-tile { display: flex; align-items: center; gap: 10px; min-width: 132px; padding: 10px 14px 10px 10px; border-radius: var(--r); background: var(--raised); }
.stat-tile b { display: block; font-size: 19px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-tile div > span { color: var(--ink-3); font-size: var(--t-xs); }
.peek { position: absolute; right: -6px; bottom: -26px; width: 132px; height: 132px; transform: rotate(-10deg); pointer-events: none; opacity: .95; }
.strip { display: flex; align-items: center; gap: 22px; margin: 0 0 var(--gap); padding: 12px var(--card-pad); border-radius: var(--r-lg); background: var(--panel); color: var(--ink-2); font-size: var(--t-sm);
  border: 1px solid transparent; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.strip:hover { border-color: var(--brand-40); background: var(--raised); color: var(--ink-2); }
.strip .lead { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.strip .items { display: flex; gap: 22px; flex: 1; min-width: 0; flex-wrap: wrap; }
.strip .items > span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.strip .go { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 600; white-space: nowrap; }
.strip .go svg { width: 16px; height: 16px; }
.mods-head h2 { margin: 0 0 10px; font-size: 22px !important; font-weight: 700; }
.cat-h { margin: 6px 0 12px; font-size: var(--t-title); font-weight: 700; color: var(--ink-2); }
.modcat { margin: 0 0 var(--gap); }
.reco { display: flex; align-items: center; gap: 16px; margin: 0 0 var(--gap); padding: 14px var(--card-pad); border-radius: var(--r-lg); background: linear-gradient(90deg, rgba(158, 91, 248, .14), rgba(158, 91, 248, 0) 60%), var(--panel); }
.reco .tx { flex: 1; min-width: 0; }
.reco b { display: block; font-size: var(--t-body); }
.reco .tx span { color: var(--ink-3); font-size: var(--t-sm); }
@media (max-width: 1500px) { .stat-tile { min-width: 0; } }
@media (max-width: 1280px) { .hello { flex-wrap: wrap; } .nums { width: 100%; } .stat-tile { flex: 1; } }
@media (max-width: 860px) {
  .hello { padding: 16px; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
  .hello .gicon { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }
  .hello .who { display: contents; }
  .nameline { flex: 1; min-width: 0; padding-right: 44px; align-self: center; }
  .greet, .quick { width: 100%; }
  .peek { width: 76px; height: 76px; right: -10px; bottom: auto; top: -14px; transform: rotate(14deg); opacity: .9; }
  .quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick .btn { justify-content: flex-start; min-width: 0; }
  .quick .btn > span { overflow: hidden; text-overflow: ellipsis; }
  .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-tile { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; }
  .strip { flex-wrap: wrap; gap: 10px 16px; } .strip .lead { width: 100%; } .strip .items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; } .strip .items > span { white-space: normal; } .strip .go { width: 100%; }
  .reco { flex-wrap: wrap; } .reco .tx { flex-basis: calc(100% - 100px); } .reco .btn { flex: 1; }
}

/* ---------- Config tables (Anti-Nuke standard: Anti-Nuke, Anti-raid, Maximum Security) ---------- */
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
.as-title { display: block; margin: 0; color: var(--ink); font-size: var(--t-body); font-weight: 600; cursor: default; }
.srow > .tx { display: block; }
.srow .tx .badge { vertical-align: 1px; margin-left: 4px; }
.srow > select, .srow > .sel { width: 260px; flex: none; }
.srow.locked .tx, tr.locked td { color: var(--ink-4); }
.srow.locked .tx > span:not(.badge) { color: var(--ink-3); }
.card > h3 { margin: 0 0 4px; font-size: var(--t-h); font-weight: 600; }
table.rules th { padding: 0 12px 10px; }
table.rules td { padding: 8px 12px; }
table.rules td.nm { font-weight: 500; color: var(--ink); white-space: nowrap; }
table.rules td.nm .badge { margin-left: 6px; }
table.rules td.end { text-align: right; }
table.rules td.lim { white-space: nowrap; color: var(--ink-2); font-size: var(--t-sm); }
table.rules tr.locked td.nm { color: var(--ink-3); }
table.rules tr.locked input, table.rules tr.locked .sel, table.rules tr.locked select { opacity: .45; }
input.num { width: 64px !important; text-align: center; padding: 0 6px !important; font-variant-numeric: tabular-nums; }
table.rules .sel > .sel-btn { min-width: 200px; }
.addline { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.inline { display: inline; }
.sec-preview { margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--raised); }
.sec-preview p { margin: 0 0 8px; }
.ee-section.premium-set { margin: 12px 0 0; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--r); background: rgba(255, 255, 255, .02); }
.ee-section.premium-set.locked { opacity: 1; }
.ee-section.premium-set.locked > *:not(legend):not(.hint) { opacity: .5; }
.ee-section.premium-set > .ee-head { float: left; width: 100%; display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 0; color: var(--ink); font-size: var(--t-body); font-weight: 600; letter-spacing: 0; text-transform: none; }
.ee-section.premium-set > .ee-head > span:first-child { flex: 1; }
.ee-section.premium-set > .ee-head + * { clear: both; }
.sect-body > .ee-section.premium-set { margin: 0; }
.mc-block.mc-block.premium-set { margin: 12px 0 0; }
@media (max-width: 860px) {
  .srow > select, .srow > .sel { width: 100%; }
  /* Rule tables become one card per row. */
  table.rules thead { display: none; }
  table.rules, table.rules tbody, table.rules tr, table.rules td { display: block; width: 100%; }
  table.rules tr { padding: 10px 0; border-top: 1px solid var(--line); }
  table.rules td { border: 0; padding: 4px 0; white-space: normal !important; }
  table.rules td[data-label] { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
  table.rules td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: var(--t-sm); }
  table.rules td.end { text-align: left; }
  table.rules .sel, table.rules .sel > .sel-btn { min-width: 0; width: 100%; max-width: 240px; }
}
table.rules td.nm small { display: block; max-width: 340px; margin-top: 2px; color: var(--ink-3); font-size: var(--t-xs); font-weight: 400; white-space: normal; }
form:not([data-custom]) .custom-only, form[data-custom] .preset-only { display: none; }
.preset-only b { color: var(--ink); font-variant-numeric: tabular-nums; }
.weights { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.weights .field { margin: 0; }
.role-checks.ac-box { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 10px; max-height: 240px; overflow-y: auto; margin: 0 0 8px; padding: 6px; border-radius: var(--r); background: var(--inset); border: 0; }
.role-check { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 8px; border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--t-body); font-weight: 500; cursor: pointer; }
.role-check:hover { background: var(--raised); }
input.w-full { width: 100%; }
@media (max-width: 860px) {
  .panel-head .tt { flex: 1 1 calc(100% - 64px); }
  .panel-head .acts { width: 100%; }
  .panel-head .acts .btn { flex: 1; }
  .srow > .tx, .option > label { flex: 1 1 100%; }
  .srow > .seg { width: 100%; }
  .srow > .seg > button { flex: 1 1 auto; }
}

/* ---------- Bot identity (#identity): one box, the profile is the editor ---------- */
.bi-sub { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bi-info { width: 26px; height: 26px; }
.bi-info svg { width: 15px; height: 15px; }
.bi-limits { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: var(--t-sm); line-height: 1.55; }
.idbox { max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.pe { position: relative; overflow: hidden; border-radius: 16px; background: #111214; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); font-family: "gg sans", "Noto Sans", var(--font-ui); }
.pe-banner { position: relative; display: block; margin: 0; aspect-ratio: 3 / 1; cursor: pointer; background: linear-gradient(135deg, #3a2f7a, #7b4fe0 55%, #9e5bf8) center / cover no-repeat; }
.pe-banner .hint-chip { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; background: rgba(17, 18, 20, .72); color: #fff; font: 600 12.5px var(--font-ui);
  transition: transform .2s var(--ease-lift), background-color .15s var(--ease); }
.pe-banner .hint-chip svg { width: 14px; height: 14px; }
.pe-banner:hover .hint-chip, .pe-banner:focus-within .hint-chip { background: rgba(17, 18, 20, .9); transform: translateY(-2px); }
.pe-banner:focus-within { outline: 2px solid var(--focus); outline-offset: -2px; }
.pe-av { position: relative; display: block; width: 112px; height: 112px; margin: -56px 0 0 22px; border-radius: 50%; cursor: pointer; background: var(--logo-tile) center / cover no-repeat; box-shadow: 0 0 0 7px #111214; }  /* the Vaqun cat by default, on --logo-tile (a second layer of the inline style) */
.pe-av .veil { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 10, 14, .55); color: #fff; opacity: 0; transition: opacity .15s var(--ease); }
.pe-av .veil svg { width: 24px; height: 24px; }
.pe-av:hover .veil, .pe-av:focus-within .veil { opacity: 1; }
.pe-av:focus-within { outline: 2px solid var(--focus); outline-offset: 9px; }
.pe-av .cam { position: absolute; right: 2px; bottom: 2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-fill); color: #fff; box-shadow: 0 0 0 4px #111214; transition: transform .24s var(--ease-pop); }
.pe-av .cam svg { width: 15px; height: 15px; }
.pe-av:hover .cam { transform: rotate(-8deg) scale(1.1); }
.pe [aria-disabled] { cursor: not-allowed; }
.pe [aria-disabled] .hint-chip, .pe [aria-disabled] .cam, .pe [aria-disabled] .veil { display: none; }
.pe-body { padding: 10px 22px 22px; display: flex; flex-direction: column; gap: 4px; }
.pe-name { position: relative; margin-left: -8px; }
.pe-name input { width: 100%; height: 44px; min-height: 0 !important; padding: 0 70px 0 8px !important; border: 1px dashed transparent !important; border-radius: 8px !important; background: none !important; color: #f2f3f5 !important;
  font: 700 24px/1 "gg sans", "Noto Sans", var(--font-ui) !important; box-shadow: none !important; }
.pe-name input::placeholder { color: #949ba4; }
.pe-name input:hover:not(:disabled) { border-color: #4a4c5c !important; }
.pe-name input:focus { border: 1px solid var(--brand) !important; background: rgba(255, 255, 255, .03) !important; box-shadow: 0 0 0 4px var(--brand-30) !important; }
.pe-name .count { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: #949ba4; }
.pe-meta { display: flex; align-items: center; gap: 6px; color: #b5bac1; font-size: 13.5px; }
.say { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; color: var(--accent-text); font: 600 12.5px var(--font-ui); }
.say.warn { color: var(--warn); }
.pe-about { position: relative; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #1e1f22; }
.pe-about b { display: block; margin-bottom: 4px; color: #f2f3f5; font-size: 12px; font-weight: 700; }
.pe-about textarea { display: block; width: calc(100% + 16px); min-height: 92px; margin: 0 -8px; padding: 6px 8px 22px !important; border: 1px dashed transparent !important; border-radius: 8px !important; background: none !important; color: #dbdee1 !important;
  font: 14px/1.45 "gg sans", "Noto Sans", var(--font-ui) !important; resize: none; box-shadow: none !important; }
.pe-about textarea::placeholder { color: #949ba4; }
.pe-about textarea:hover:not(:disabled) { border-color: #4a4c5c !important; }
.pe-about textarea:focus { border: 1px solid var(--brand) !important; box-shadow: 0 0 0 4px var(--brand-30) !important; }
.pe-about .count { position: absolute; right: 14px; bottom: 10px; pointer-events: none; color: #949ba4; }
.side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cap { margin: 0 0 8px; color: var(--ink-3); font-size: var(--t-sm); font-weight: 500; }
.dc-av { position: relative; flex: none; display: block; border-radius: 50%; background: var(--logo-tile) center / cover no-repeat; }  /* the default Vaqun cat, on --logo-tile (a second layer of the inline style) */
.dc-av .on { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; background: #23a55a; box-shadow: 0 0 0 3px #2b2d31; }
.dc-list { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: #2b2d31; font-family: "gg sans", "Noto Sans", var(--font-ui); }
.dc-list .dc-av { width: 32px; height: 32px; }
.dc-list .nm, .dc-msg .hd { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dc-list .nm span:first-child, .dc-msg .hd b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #c9a8ff; font-weight: 600; font-size: 15px; }
.dc-list small { display: block; color: #b5bac1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-msg { display: flex; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: #313338; font-family: "gg sans", "Noto Sans", var(--font-ui); }
.dc-msg .dc-av { width: 36px; height: 36px; }
.dc-msg time { color: #949ba4; font-size: 11px; white-space: nowrap; }
.dc-msg p { margin: 2px 0 0; color: #dbdee1; font-size: 14px; }
.line { display: flex; align-items: center; gap: 8px; min-height: 32px; color: var(--ink-3); font-size: var(--t-sm); }
.line .pp-wrap { margin-left: auto; }
.line .icon-btn { width: 28px; height: 28px; }
.line .icon-btn svg { width: 15px; height: 15px; }
.line .pp { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; }
.changed { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.changed .row-c { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; color: var(--ink-2); font-size: var(--t-sm); }
.changed .none { margin: 0; color: var(--ink-3); font-size: var(--t-sm); }
.reset-link { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border: 0; border-radius: var(--r-sm); background: none; color: var(--accent-text); font-size: var(--t-xs); font-weight: 600; cursor: pointer; }
.reset-link:hover { background: var(--hover-fill); }
.reset-link svg { width: 12px; height: 12px; }
@media (max-width: 1100px) { .idbox { grid-template-columns: minmax(0, 1fr) 280px; } }
@media (max-width: 860px) {
  .idbox { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 20px; }
  .pe-av { width: 88px; height: 88px; margin: -44px 0 0 16px; }
  .pe-body { padding: 8px 16px 16px; }
  .pe-name input { font-size: 21px !important; }
}
.bi-sub { margin: 4px 0 0; color: var(--ink-3); font-size: var(--t-body); }
.top .crumb a { display: inline-block; max-width: min(40vw, 360px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---------- Editor chassis (prompt 138; design/explorations/a2-embed-builder.html) ----------
   The pages built around an embed: an editor header (back, title, switch, Discard / Save), one centred column, collapsed
   cards with a one-line summary, the message card. _chassis.html renders them. */
/* The header spans the whole main area (100cqw: .main is the container) while the content keeps its width, so nothing
   changes size when a panel is shown (no layout shift on load). */
.main { container-type: inline-size; }
.edhead { position: sticky; top: var(--top-h); z-index: 15; display: flex; align-items: center; gap: 12px; margin: calc(-1 * var(--pad)) calc((100% - 100cqw) / 2) var(--pad); padding: 14px var(--pad);
  background: var(--page); box-shadow: 0 1px 0 var(--line); }
.edhead .title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.edhead .title > h1 { margin: 0; padding: 4px 8px; border-radius: var(--r-sm); font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edhead .acts { display: flex; align-items: center; gap: 12px; }
.edhead .state-chip:not(.dirty) { display: none; }
.edhead .seg > button { height: calc(var(--ctl-h) - 6px); }
/* One centred column (800 px), like every other page's content. A column inside a column (a fieldset) just fills it. */
.ed-col { width: 100%; max-width: 800px; min-width: 0; margin: 0 auto; padding: 0; border: 0; display: flex; flex-direction: column; gap: var(--gap); }
.ed-col .ed-col { margin: 0; max-width: none; }
.ed-col.wide { max-width: 1120px; }
.ed-col :is(.card, .sect, .flash, .lock-strip) { margin: 0; }  /* the column's gap spaces them, forms (display: contents) included */
.ed-panel [data-ed-show][hidden] { display: none !important; }
.mbar { display: none; }

.sect > summary { transition: background-color .15s var(--ease); }
.sect > summary:hover { background: rgba(255, 255, 255, .015); }
.sect > summary .switch { margin-left: 4px; }
.sect[open] > summary .when-closed, .sect:not([open]) > summary .when-open { display: none; }
.sect-body > .srow { padding: 0; border: 0; }
.sect-body > .info { margin: 0; }
.srow .sel { width: 260px; flex: none; }
.srow .tx label.as-title { cursor: pointer; }
.info.one { padding: 8px 12px; margin: 0; font-size: var(--t-xs); align-items: center; }
.info.one svg { width: 14px; height: 14px; margin: 0; }
.info.one .badge { margin-left: auto; }
.icon-btn.sm { width: 28px; height: 28px; border-radius: var(--r-sm); color: var(--ink-3); }
.icon-btn.sm svg { width: 15px; height: 15px; }
.icon-btn.sm[aria-pressed="true"] { color: var(--accent-text); background: var(--brand-20); }
.info-pop .pp { width: 340px; gap: 10px; }
.pp-line { display: block; color: var(--ink-2); font-size: var(--t-sm); line-height: 1.5; }
.pp-title { color: var(--ink-3); font-size: var(--t-xs); font-weight: 600; }
.seg.sm > label, .seg.sm > button { height: 26px; padding: 0 10px; font-size: var(--t-xs); }
.seg > label { display: inline-flex; align-items: center; gap: 6px; }
code.cmd { white-space: nowrap; color: var(--ink); }

/* ---------- Embed editor: the message card, the Discord message edited in place ---------- */
.msg-card { padding: 16px var(--card-pad) var(--card-pad); min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; min-height: 28px; }
.msg-head h2 { flex: 1; min-width: 0; margin: 0 !important; font-size: var(--t-h); font-weight: 600; }
.msg-head .count { margin-left: 4px; }
.msg-card > .info.one { margin: -4px 0 14px; }
.ee-msg { min-width: 0; font-family: "gg sans", "Noto Sans", var(--font-ui); color: #dbdee1; }
.ee-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-width: 0; }
.ee-av { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: #111214; display: grid; place-items: center; flex: none; }
.ee-av img.mark { width: 80%; height: auto; padding: 0; }
.ee-nm { font-weight: 700; font-size: 14px; color: var(--ink); }
.dc-app { padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; }
.ee-time { color: var(--ink-3); font-size: 11px; }
.ee-body { margin-left: 44px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ee-embed-row { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.ee-swatch-btn { width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r); background: var(--inset); display: grid; place-items: center; cursor: pointer; }
.ee-swatch-btn:hover { box-shadow: 0 0 0 1px var(--brand-40); }
.ee-swatch-btn i { width: 14px; height: 14px; border-radius: 50%; background: var(--bar, #8b5cf6); }
.ee-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.ee-swatches button { aspect-ratio: 1; border: 0; border-radius: 6px; cursor: pointer; }
.ee-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }
.ee-color input[type=color] { width: 100%; }
.ee-embed { position: relative; flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; padding: 12px 14px 12px 12px;
  border-left: 4px solid var(--bar, #8b5cf6); border-radius: 4px var(--r) var(--r) 4px; background: var(--inset); font-size: 14px; }
.ee-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ee-part { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
.ee-part > .pp-wrap { display: block; }
/* The editable surfaces (the script lays one over each text input) and, without the script, the inputs themselves. */
.ee-ed, .ee .ee-in { flex: 1; min-width: 0; min-height: 1.5em; margin: -1px -4px; padding: 1px 4px; border: 0; border-radius: 4px; outline: none; background: transparent; box-shadow: none;
  color: #dbdee1; font: inherit; line-height: 1.5; cursor: text; transition: background-color .15s var(--ease), box-shadow .15s var(--ease); }
.ee .ee-in { height: auto; }
.ee-ed { white-space: pre-wrap; overflow-wrap: anywhere; }
.ee-ed.line { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.ee-ed.line:focus { text-overflow: clip; overflow-x: auto; scrollbar-width: none; }
.ee-ed:hover, .ee .ee-in:hover { background: rgba(255, 255, 255, .04); }
.ee-ed:focus, .ee .ee-in:focus { background: rgba(255, 255, 255, .05); box-shadow: 0 0 0 1px var(--brand-40); }
.ee-ed:empty::before { content: attr(data-ph); color: var(--ink-3); pointer-events: none; }
.ee-ed[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.ee-ed[aria-invalid="true"] { box-shadow: 0 0 0 1px var(--danger); }
.ee .ee-in::placeholder { color: var(--ink-3); }
.ee .ee-in:disabled { opacity: .55; }
.ee-author { font-weight: 600; font-size: 13px; }
.ee-title { font-weight: 700; color: var(--ink); }
.ee-desc .ee-ed, .ee-desc .ee-in { display: block; width: 100%; color: #dbdee1; resize: none; }
.ee-desc textarea.ee-in { min-height: 1.5em; field-sizing: content; }
.var { display: inline-block; margin: 0 1px; padding: 0 6px; border-radius: 5px; background: #3a3b48; color: var(--ink); font-weight: 600; font-size: .92em; line-height: 1.5; cursor: default; user-select: all; white-space: pre; }
.ee-slot { display: grid; place-items: center; flex: none; padding: 0; border: 1px dashed #4a4c5c; background: none; color: var(--ink-3); cursor: pointer; transition: border-color .15s var(--ease), color .15s var(--ease); }
.ee-slot:hover:not(:disabled) { border-color: var(--brand); color: var(--ink); }
.ee-slot:disabled, .ee-link:disabled, .ee-add:disabled { opacity: .45; cursor: not-allowed; }
/* Author and footer icon slots: one size (24 px), same left edge, glyph centred by grid. */
.ee-slot.round { width: 24px; height: 24px; border-radius: 50%; }
.ee-slot.round svg { width: 12px; height: 12px; display: block; }
.ee-slot.thumb { width: 72px; height: 72px; border-radius: var(--r); }
.ee-slot.thumb svg { width: 22px; height: 22px; }
.ee-slot.set { border-style: solid; border-color: var(--brand-40); color: var(--accent-text); background-size: cover; background-position: center; }
.ee-slot.wide { width: 100%; height: 56px; padding: 0 10px; border-radius: var(--r); display: flex; align-items: center; justify-content: flex-start; gap: 8px; font: 500 var(--t-sm) var(--font-ui); }
.ee-slot.wide svg { width: 18px; height: 18px; }
.ee-link { width: 26px; height: 26px; flex: none; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s var(--ease); }
.ee-part:hover .ee-link, .ee-part:focus-within .ee-link, .ee-link[aria-expanded="true"], .ee-link.set, .ee-link:focus-visible { opacity: 1; }
.ee-link:hover { background: var(--white-10); color: var(--ink); }
.ee-link.set { color: var(--accent-text); }
.ee-link svg { width: 14px; height: 14px; }
.ee-link.ts { width: 28px; height: 28px; opacity: 1; }
.ee-link.ts svg { width: 15px; height: 15px; }
.ee-link.ts[data-on="true"] { color: var(--accent-text); background: var(--brand-20); }
.ee-thumb { grid-column: 2; grid-row: 1; }
.ee-fields-zone, .ee-image, .ee-foot, .ee-fixed { grid-column: 1 / -1; }
[data-thumb="1"] .ee-fields-zone { grid-column: 1; }
.ee-fixed { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: var(--r); background: rgba(255, 255, 255, .035); color: var(--ink-2); font: var(--t-xs)/1.45 var(--font-ui); }
.ee-fixed svg { width: 14px; height: 14px; flex: none; }
.ee-image { display: block; position: relative; }
.ee-foot { font-size: 12px; color: #b5bac1; }
.ee-foot .ee-ed, .ee-foot .ee-in { color: #b5bac1; }
/* Fields: Discord's rule, live (vaqun: 3 inline per row, 2 with a thumbnail, never under 200 px; a lone one fills the row). */
.ee-fields-zone { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ee-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.ee-fields:empty { display: none; }
.fld { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 8px; border-radius: var(--r); background: rgba(255, 255, 255, .035); border: 1px solid var(--line); grid-column: 1 / -1; transition: border-color .15s var(--ease); }
.fld:focus-within { border-color: var(--brand-40); }
.fld-head { display: flex; align-items: flex-start; gap: 2px; }
.fld .fname { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; color: var(--ink); }
.fld .fval { min-height: 3em; color: #dbdee1; }
.fld input.fname, .fld textarea.fval { width: 100%; margin: 0 -4px; padding: 1px 4px; border: 0; border-radius: 4px; background: transparent; resize: none; font: inherit; }
.fld-btn { width: 24px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.fld-btn:hover { background: var(--white-10); color: var(--ink); }
.fld-btn.rm:hover { background: rgba(240, 118, 110, .15); color: var(--danger); }
.fld-btn svg { width: 13px; height: 13px; }
.fld-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--ink-3); font: 600 var(--t-xs) var(--font-ui); }
.fld-inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--ink-3); font: inherit; cursor: pointer; }
.fld-foot .where { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fld-foot .where svg { width: 14px; height: 14px; }
.ee-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; border: 0; background: none; color: var(--accent-text); font: 600 var(--t-sm) var(--font-ui); cursor: pointer; }
.ee-add:hover:not(:disabled) { color: var(--sel-ink); text-decoration: underline; }
.ee-add svg { width: 14px; height: 14px; }
.ee-add .count { color: var(--ink-3); font-weight: 500; }
.ee-vars { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 0 44px; color: var(--ink-3); font-size: var(--t-xs); font-family: var(--font-ui); }
.ee-vars .chip.more svg { width: 13px; height: 13px; }
.ee-more { flex-direction: row !important; flex-wrap: wrap; width: 320px; gap: 6px !important; }
.ee .pp { color: var(--ink); }
.ee .pp input:not([type=checkbox]):not([type=file]), .ee .pp select { width: 100%; }
.ee-upload { display: flex; flex-direction: column; gap: 6px; }
.ee-upload input[type=file] { width: 100%; font-size: var(--t-sm); }
.ee-body > .dc-embed { max-width: none; }
/* Greeting card: its editor (the card's preview is the bot's drawing in CSS: core/greeting_card.py). */
.gc-pane .gc-layout { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.gc-pane.locked .gc-layout { opacity: .55; }
.gc-fields { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.gc-row > label, .gc-row > .as-label, .gc-row.two label { display: block; margin: 0 0 6px; color: var(--ink-3); font-size: var(--t-sm); font-weight: 500; }
.gc-row input:not([type=radio]):not([type=file]):not([type=color]), .gc-row textarea { width: 100%; }
.gc-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gc-row.two input[type=color] { width: 100%; height: 40px; padding: 4px; }
.gc { position: relative; aspect-ratio: 1000 / 400; border-radius: 14px; overflow: hidden; container-type: inline-size; background: #15121f; }
.gc-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.gc::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(10, 8, 20, .27), rgba(10, 8, 20, .63)); }
.gc-ring { position: absolute; z-index: 1; left: 50%; top: 3.4cqw; width: 18.4cqw; height: 18.4cqw; margin-left: -9.2cqw; box-sizing: border-box; padding: .8cqw; border-radius: 50%; box-shadow: 0 .6cqw 2cqw rgba(0, 0, 0, .5); }
.gc-ring img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.gc-title, .gc-sub { position: absolute; z-index: 1; left: 5cqw; right: 5cqw; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 1.4cqw rgba(0, 0, 0, .65); }
.gc-title { top: 24.6cqw; font-size: 4.6cqw; line-height: 1.15; font-weight: 800; color: #fff; }
.gc-sub { top: 31.5cqw; font-size: 2.5cqw; line-height: 1.2; font-weight: 600; color: rgba(236, 233, 245, .88); }
.gc-custom-swatch { display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--ink-3); background-color: var(--raised-2); background-size: cover; background-position: center; }
.lv-banners { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.lv-banner { position: relative; display: flex; flex-direction: column; gap: 6px; margin: 0; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: var(--t-sm); }
.lv-banner input { position: absolute; opacity: 0; pointer-events: none; }
.lv-swatch { aspect-ratio: 10 / 3; border-radius: var(--r); background-size: cover; border: 2px solid transparent; transition: border-color .15s var(--ease); }
.lv-banner input:checked + .lv-swatch { border-color: var(--brand); }
.lv-banner input:focus-visible + .lv-swatch { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Discord's own colours, for messages drawn as Discord would (the eye in the message card, _discord_embed.html). */
.dc-message { display: flex; gap: 14px; padding: 16px; background: #313338; border-radius: var(--r); color: #dbdee1; font: 15px/1.375 "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; }
.dc-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; background: #111214; display: grid; place-items: center; overflow: hidden; }
.dc-avatar img.mark { width: 100%; height: 100%; padding: 7px; border-radius: 50%; }
.dc-body { min-width: 0; flex: 1; }
.dc-name { font-weight: 600; color: #f2f3f5; margin-bottom: 4px; }
.dc-time { color: #949ba4; font-size: 12px; font-weight: 500; margin-left: 4px; }
.dc-embed { display: grid; grid-template-columns: minmax(0, 1fr) auto; max-width: 520px; background: #2b2d31; border-left: 4px solid #8b5cf6; border-radius: 4px; padding: 10px 16px 14px 12px; gap: 0 16px; color: #dbdee1; font-size: 14px; }
.dc-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dc-author { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #f2f3f5; }
.dc-author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.dc-title { font-weight: 700; font-size: 16px; color: #f2f3f5; overflow-wrap: anywhere; }
.dc-title.link { color: #00a8fc; }
.dc-desc { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-desc code { background: #1e1f22; padding: 0 3px; border-radius: 3px; font-size: 13px; }
.dc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin-top: 4px; }
.dc-field { grid-column: 1 / -1; min-width: 0; font-size: 14px; }
.dc-field.inline { grid-column: auto; }
.dc-field b { display: block; color: #f2f3f5; margin-bottom: 2px; font-size: 14px; }
.dc-field span { white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-thumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; grid-column: 2; grid-row: 1; }
.dc-image { grid-column: 1 / -1; max-width: 100%; border-radius: 4px; margin-top: 12px; }
.dc-footer { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: #b5bac1; }
.dc-footer img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-button { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 4px; background: #4e5058; color: #fff; font-size: 14px; font-weight: 500; text-decoration: none; }
.dc-button.danger { background: #da373c; }

@media (max-width: 860px) {
  .edhead { flex-wrap: wrap; row-gap: 8px; padding: 10px var(--pad); }
  .edhead .title { flex: 1 1 0; }
  .edhead .ed-switch { order: 5; flex: 1 1 100%; }
  .edhead .ed-switch > button { flex: 1 1 0; }
  .edhead .desk { display: none; }
  .mbar { position: sticky; bottom: 0; z-index: 15; display: flex; gap: 8px; margin: var(--gap) calc(-1 * var(--pad)) calc(-1 * var(--pad)); padding: 10px 16px; background: var(--panel); box-shadow: 0 -1px 0 var(--line); }
  .mbar .btn { flex: 1; height: 44px; }
  .srow .sel { width: 100%; }
  .srow > .seg { flex: 1 1 100%; }
  .srow > .seg > label { flex: 1 1 auto; justify-content: center; }
  .msg-card { padding: 14px; }
  .ee-body, .ee-vars { margin-left: 0; }
  .ee-embed { grid-template-columns: minmax(0, 1fr); }
  .ee-thumb { position: absolute; top: 10px; right: 10px; }
  .ee-slot.thumb { width: 48px; height: 48px; }
  .ee-main { padding-right: 56px; }
  .ee-link { opacity: 1; }
  [data-thumb="1"] .ee-fields-zone { grid-column: 1 / -1; }
  .info-pop .pp { position: fixed; left: 16px; right: 16px; top: auto; width: auto; }
}

/* Labelled fields inside chassis cards (rewards, lists): label above, one line of help under. */
.fi { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fi > label { margin: 0; color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; }
.fi input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .fi textarea, .fi select { width: 100%; }
.fi.locked > :not(label) { opacity: .5; }
.fi-help { color: var(--ink-3); font-size: var(--t-xs); line-height: 1.45; }
.fi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
.sect-body > .fi, .sect-body > .fi-grid { margin: 0; }
.srow.locked .tx { opacity: .7; }
.ed-col > .lock-strip, .lock-col > .lock-strip { margin: 0; }
.lock-col { margin-bottom: var(--gap); }
.list-card { display: flex; flex-direction: column; gap: 12px; }
.list-card > .msg-head { margin: 0; }
.list-card > .btn { align-self: flex-start; }
.list-card > .flash { margin: 0; }
.rw-list { display: flex; flex-direction: column; gap: 12px; }
.rw-list:empty { display: none; }
.rw { margin: 0; padding: 16px; background: var(--raised); }
.rw.locked > .rw-body { opacity: .6; }
.rw-body { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.rw-body > .srow { padding: 0; border: 0; }
.rw > .info { margin: 0 0 12px; }
.rw-foot { display: flex; justify-content: flex-end; }

/* List / detail (Embed Builder, Reaction roles, Sticky messages…): the list is rows with a one-line summary; a row opens
   the item's editor view, which has the same header, column and cards as the single-message pages. */
.content > :not(.panels) ~ .panels .edhead { margin-top: 0; }
.ed-col > form { display: contents; }
.ed-list { margin: 0; padding: 6px; display: flex; flex-direction: column; }
.ed-list > .msg-head { margin: 10px 12px 6px; }
.ed-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r); color: var(--ink); text-decoration: none; transition: background-color .15s var(--ease); }
.ed-item:hover { background: var(--hover-fill); color: var(--ink); }
.ed-item .tt { flex: 1; min-width: 0; }
.ed-item b { display: block; font-size: var(--t-title); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-item .sum { display: block; color: var(--ink-3); font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-item > svg { width: 18px; height: 18px; color: var(--ink-3); }
.ed-item + .ed-item { box-shadow: 0 -1px 0 var(--line); }
.ed-item.add { color: var(--accent-text); font-weight: 600; }
.ed-item.add .tile { --hue: var(--accent-text); }
.ed-empty { padding: 20px 12px; color: var(--ink-3); font-size: var(--t-sm); text-align: center; }
.edhead .icon-btn.danger:hover { background: rgba(240, 118, 110, .14); color: var(--danger); }
.edhead .badge { flex: none; }
.usage { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: var(--t-sm); }
.usage .bar { flex: 1; max-width: 160px; height: 6px; border-radius: 99px; background: var(--raised-2); overflow: hidden; }
.usage .bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.ed-title-edit { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; margin: 0; color: var(--ink-3); cursor: text; }
.edhead input.ed-title-in { flex: 0 1 auto; width: auto; max-width: 100%; field-sizing: content; min-width: 4ch; min-height: 0 !important; height: auto; margin: 0; padding: 4px 8px !important; border: 0 !important; border-radius: var(--r-sm);
  background: transparent !important; box-shadow: none !important; color: var(--ink); font: 700 20px/1.3 var(--font-ui) !important; }
.edhead input.ed-title-in:hover, .edhead input.ed-title-in:focus { background: var(--hover-fill) !important; }
.edhead input.ed-title-in:focus { box-shadow: 0 0 0 1px var(--brand-40) !important; }
.ed-title-edit > svg { width: 16px; height: 16px; flex: none; }
.dur { display: flex; gap: 8px; }
.dur input { width: 100px; min-width: 0; flex: 1; }
.dur .sel, .dur select { flex: 1; min-width: 0; }
.setting-card { margin: 0; padding: 14px var(--card-pad); }
.setting-card > .srow { padding: 0; border: 0; }

/* Chassis pieces for list panes and multi-form pages (tickets, Voicemaster, the staff announcement editor). */
.ed-page { margin-top: 8px; }
.ed-page > .edhead { position: sticky; top: 0; margin: 0 0 var(--gap); padding: 14px 0; }
.ed-page .ed-col { margin-left: auto; margin-right: auto; }
.ed-page .ed-col .ed-col { margin: 0; }
.ed-page .ed-col + .ed-col:not(:empty), .ed-page [data-ed-show] { margin-top: 0; }
.ed-page > .ed-col:empty { display: none; }
.ed-page > .ed-col:not(:empty) { margin-bottom: var(--gap); }
.sect-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.sect-foot form { margin: 0; }
.sect-form { display: flex; flex-direction: column; gap: 14px; margin: 0; min-width: 0; }
.sect-form > .srow, .rw-body > .srow { padding: 0; border: 0; }
.sect.sub { background: var(--raised); margin: 0; }
.sect.sub > summary { padding: 12px 14px; }
.sect.sub > summary h3 { margin: 0; font-size: var(--t-title); }
.sect.sub > .sect-body { margin: 0 14px; padding: 14px 0; }
.chips .chip.on { background: var(--sel-fill); color: var(--sel-ink); }
.chips .chip.add { background: none; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-3); }
.chips .chip.add:hover { box-shadow: inset 0 0 0 1px var(--brand-40); color: var(--ink); }
.chips .chip svg { width: 13px; height: 13px; }
.chips .chip .dot { width: 7px; height: 7px; }
.tk-panels { padding: 16px var(--card-pad); gap: 12px; }
.tk-panels > .msg-head { margin: 0; }
.w260 { width: 260px; max-width: 100%; }
.pairs { display: flex; flex-direction: column; }
.pair { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.pair:last-child { border-bottom: 0; }
.pair form { margin: 0; }
.pair-emoji { width: 32px; text-align: center; flex: none; }
.pair-role { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pair-add { display: flex; gap: 8px; align-items: center; margin: 0; flex-wrap: wrap; }
.pair-add > input { width: 180px; flex: none; }
.pair-add > select, .pair-add > .sel { flex: 1; min-width: 180px; }
.emoji { font-size: 22px; line-height: 1; display: inline-block; vertical-align: middle; }
img.emoji { width: 24px; height: 24px; object-fit: contain; }
.role-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.role-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; }
.role-check { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 8px; border-radius: var(--r); color: var(--ink-2); font-size: var(--t-sm); font-weight: 500; cursor: pointer; }
.role-check:hover { background: var(--raised); }
.as-label { display: block; color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; }
.steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--raised); color: var(--ink-2); font-size: var(--t-sm); }
.step svg { width: 16px; height: 16px; color: var(--accent-text); flex: none; }
.rw-head { display: flex; align-items: center; gap: 8px; }
.lock-strip.working > svg { color: var(--accent-text); animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg > a { display: inline-flex; align-items: center; gap: 6px; height: calc(var(--ctl-h) - 6px); padding: 0 12px; border-radius: 6px; color: var(--ink-3); font-weight: 600; font-size: var(--t-sm); text-decoration: none; }
.seg.sm > a { height: 26px; padding: 0 10px; font-size: var(--t-xs); }
.seg > a:hover { color: var(--ink); }
.seg > a.on { background: var(--raised); color: var(--ink); }
.seg > a .dot { width: 7px; height: 7px; }
.an-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.an-stat { padding: 12px 14px; border-radius: var(--r); background: var(--raised); }
.an-stat b { display: block; font-size: 20px; }
.an-stat span { color: var(--ink-3); font-size: var(--t-xs); }
.an-filter { margin: 12px 0; }
.tk-listcard { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.tk-list-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tk-list-tools > input[type=search] { flex: 1; min-width: 200px; }
.ed-col > .table-wrap { margin: 0; }
@media (max-width: 860px) {
  .pair-add > input { width: 100%; flex: 1 1 100%; }
  .ed-page > .edhead { padding: 10px 0; }
}
.ed-col.spaced { margin-top: var(--gap); }


/* ---------- The other panels (prompt 138, mechanical migration): their own layout, moved out of server.html's inline
   <style>. Same rules, on the A2 tokens; cards stack their content with one rhythm instead of per-element margins. ---------- */
.mig .card:not(.mod):not(.hello), .mig .sect-body, .mig form.card { display: flex; flex-direction: column; gap: 14px; }
.mig .card > form:not(.inline):not(.row) { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.card > h3, .sect-body > h3, .card > .row > h3 { margin: 0; font-size: var(--t-title); font-weight: 700; }
.card > .srow, .sect-body > .srow, .card > form > .srow { padding: 0; border: 0; }
.fi-help { display: block; }
.blk { margin: 0; }
.info { margin: 0; }
.mig > .info, .mig > form > .info { margin: 0 0 var(--gap); }
.sect > summary > b { flex: 1; min-width: 0; }
.card.jl-danger { box-shadow: inset 0 0 0 1px rgba(240, 118, 110, .35); }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 55%, #fff)); border-radius: 99px; transform-origin: left; animation: grow .8s var(--ease); }
@keyframes grow { from { transform: scaleX(0); } }
.rule { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; transition: border-color .25s var(--ease); }
.rule:hover { border-color: var(--border-strong); }
.rule[open] { border-color: color-mix(in srgb, var(--tone) 45%, transparent); }
.rule summary { display: flex; align-items: center; gap: 12px; padding: 18px 22px; cursor: pointer; flex-wrap: wrap; }
.rule summary b { flex: 1; min-width: 120px; font-size: 16px; }
.rule summary .chev { width: 18px; height: 18px; color: var(--faint); transition: transform .3s var(--ease); }
.rule[open] summary .chev { transform: rotate(180deg); }
.rule .body { padding: 18px 22px 22px; border-top: 1px solid var(--border); }
.ac-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 700px) { .ac-two { grid-template-columns: 1fr; } }
.ac-box { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-height: 240px; overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.mc-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; }
.mc-kinds .role-check { align-items: flex-start; }
.mc-kinds input { margin-top: 4px; }
.mc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.mc-grid .field { margin-bottom: 12px; }
.mc-duration { display: flex; gap: 8px; }
.mc-duration input { width: 100px; min-width: 0; flex: 1; }
.mc-grid > .field > input { width: 100%; }
.mc-summary { display: block; font-size: 13px; font-weight: 500; margin-top: 2px; }
.role-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.role-check { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 10px; border-radius: 10px; font-weight: 500; cursor: pointer; transition: background .2s var(--ease); }
.role-check:hover { background: var(--surface-2); }
.emoji { font-size: 24px; line-height: 1; display: inline-block; vertical-align: middle; }
img.emoji { width: 26px; height: 26px; object-fit: contain; }
.rr-embed { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px 4px; margin: 6px 0 0; }
.rr-embed legend { font-weight: 700; padding: 0 6px; }
.rr-embed.locked { opacity: .6; }
.rr-embed input[type=color] { width: 64px; height: 40px; padding: 4px; }
/* Blocks stacked in the per-channel/per-rule forms. Declared after .ee-section and
   .switch-row (both margin: 0) and with two classes, so it can't be overridden again. */
.mc-block.mc-block { margin: 0 0 16px; }
/* Leveling: leaderboard + settings tabs. */
.lv-tabs, .gr-tabs, .bs-tabs { margin-bottom: 18px; }
.bs-status { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.bs-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted, #888); }
.bs-status .dot.on { background: var(--ok, #34d399); }
.bs-reward { margin: 10px 0; }
.bs-reward.locked { opacity: .65; }
.bs-test { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.bs-log { width: 100%; border-collapse: collapse; font-size: 13px; }
.bs-log th, .bs-log td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border, rgba(255,255,255,.08)); vertical-align: top; }
.lv-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 900px) { .lv-three { grid-template-columns: 1fr; } }
.lv-board td { vertical-align: middle; }
.lv-rank { width: 48px; font-weight: 800; }
.lv-user { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.lv-user img, .lv-noavatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); flex: none; }
.lv-mult-row { display: flex; gap: 8px; margin-bottom: 8px; }
.lv-mult-row select { flex: 1; min-width: 0; }
.lv-mult-row input { width: 90px; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 14px; }
.radio-row label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; cursor: pointer; }
#leveling input[type=color] { width: 100%; height: 42px; padding: 4px; }
.lv-accent-preview { height: 14px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.lv-accent-preview i { display: block; width: 62%; height: 100%; border-radius: 99px; }
/* Server logging: module → category → event. */
.log-cat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; transition: border-color .25s var(--ease); }
.log-cat:hover { border-color: var(--border-strong); }
.log-cat-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; flex-wrap: wrap; }
.log-cat-title { flex: 1; min-width: 150px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: none; border: 0; padding: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.log-cat-title b { font-size: 16px; }
.log-count { font-size: 13px; }
.log-cat-head select, .log-event-channel select { width: 240px; max-width: 100%; }
.log-chev { background: none; border: 0; padding: 4px; color: var(--faint); cursor: pointer; }
.log-chev svg { width: 18px; height: 18px; display: block; transition: transform .3s var(--ease); }
.log-cat.collapsed .log-chev svg { transform: rotate(-90deg); }
.log-events { border-top: 1px solid var(--border); padding: 4px 18px 8px; }
.log-event { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.log-event:last-child { border-bottom: 0; }
.log-event-name { display: flex; align-items: flex-start; gap: 12px; margin: 0; font-weight: 500; cursor: pointer; flex: 1; min-width: 200px; }
.log-event-name .switch { margin-top: 2px; }
.log-event-channel { display: flex; align-items: center; gap: 8px; }
.switch.small { width: 40px !important; height: 24px !important; }
.switch.small::after { width: 16px; height: 16px; }
.switch.small:checked::after { transform: translateX(16px); }
.log-save { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; margin-top: 16px; pointer-events: none; }
.log-save .btn { pointer-events: auto; }
@media (max-width: 640px) { .log-cat-head select, .log-event-channel select { width: 100%; } .log-event-channel { width: 100%; } .log-chev { display: none; } }
.mc-grid + .btn, .ac-two + .btn { margin-top: 4px; }
/* Sticky messages' "Text" and Boosts' "Simple": the embed builder's description alone. */
.ee-text-only .ee-part, .ee-text-only .ee-thumb, .ee-text-only .ee-fields-zone, .ee-text-only .ee-image, .ee-text-only .ee-foot, .ee-text-only .ee-color, .ee-text-only .ee-fixed { display: none; }
/* Tickets */
.tk-tabs { margin-bottom: 18px; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.tk-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px; }
.tk-chip.active { color: var(--text); border-color: color-mix(in srgb, var(--tone) 55%, transparent); background: var(--tone-soft); }
.tk-chip.tk-new { border-style: dashed; }
.tk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.tk-dot.on { background: #34d399; }
.tk-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.tk-option { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; font-weight: 500; }
.tk-option input { margin-top: 4px; }
.tk-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.tk-preset { position: relative; display: block; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; font-weight: 500; transition: border-color .2s var(--ease); }
.tk-preset input { position: absolute; opacity: 0; pointer-events: none; }
.tk-preset:has(input:checked) { border-color: var(--tone); box-shadow: 0 0 0 3px var(--tone-soft); }
.tk-preset:has(input:focus-visible) { outline: 2px solid var(--tone); outline-offset: 2px; }
.tk-preset b { display: block; margin-bottom: 4px; }
.tk-preset .hint { display: block; margin: 0 0 8px; }
.tk-preset-cats { display: flex; flex-wrap: wrap; gap: 5px; }
.tk-preset-cats i { font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.tk-use { gap: 6px; margin: -4px 0 12px; flex-wrap: nowrap; }
.tk-use select { flex: 1; min-width: 0; }
.tk-q { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.tk-q input[type=text], .tk-q input:not([type]) { width: 100%; }
.tk-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-fake-button { padding: 6px 14px; border-radius: 4px; background: #5865f2; color: #fff; font-size: 14px; font-weight: 500; }
.tk-fake-select { background: #1e1f22; border: 1px solid #1e1f22; border-radius: 4px; max-width: 420px; }
.tk-fake-select summary { padding: 8px 12px; color: #949ba4; cursor: pointer; }
.tk-fake-option { padding: 8px 12px; border-top: 1px solid #2b2d31; font-size: 14px; color: #dbdee1; }
.tk-fake-option span { color: #949ba4; font-size: 13px; }
.tk-list-tools { gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.tk-table td { vertical-align: middle; }
.tk-flow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.tk-flow-preview { position: sticky; top: 24px; }
.tk-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tk-steps { display: flex; flex-direction: column; gap: 10px; }
.tk-step { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px 14px; }
.tk-step.cut { border-style: dashed; border-color: color-mix(in srgb, var(--tone) 55%, transparent); text-align: center; }
.tk-step-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tk-step-head span { flex: 1; }
.tk-step textarea, .tk-step input:not([type=checkbox]), .tk-step select { width: 100%; }
.tk-step .row { gap: 6px; margin-bottom: 6px; flex-wrap: nowrap; }
.tk-step .row > * { min-width: 0; }
.tk-step label { font-size: 13px; }
.tk-preview-embed { background: #2b2d31; border-left: 4px solid #8b5cf6; border-radius: 4px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.tk-preview-embed dl { margin: 8px 0 0; } .tk-preview-embed dt { font-weight: 700; color: #f2f3f5; } .tk-preview-embed dd { margin: 0 0 6px; }
.tk-preview-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tk-preview-row button { border: 0; border-radius: 4px; padding: 6px 14px; background: #4e5058; color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.tk-preview-row button.primary { background: #5865f2; } .tk-preview-row button.success { background: #248046; }
.tk-preview-modal { background: #313338; border: 1px solid #1e1f22; border-radius: 8px; padding: 12px; margin-top: 8px; }
.tk-preview-modal input { width: 100%; margin: 4px 0 8px; }
.tk-preview-note { font-style: italic; color: #949ba4; font-size: 13px; margin-top: 6px; }
.tk-survey { margin: 6px 0 14px; } .tk-survey-row { display: grid; grid-template-columns: 80px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
@media (max-width: 1150px) { .tk-flow { grid-template-columns: 1fr; } .tk-flow-preview { position: static; } }
.jl-list { margin: 0 0 12px; padding-left: 20px; color: var(--muted); }
.jl-list li { margin: 4px 0; }
.jl-danger { border-color: color-mix(in srgb, var(--err) 45%, var(--border)); }
.perm-missing { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px; }
.perm-missing ul { margin: 6px 0; padding-left: 20px; }
.rr-edit { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.rr-edit summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.radio { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-weight: 500; cursor: pointer; }
.radio.locked { opacity: .6; cursor: not-allowed; }
.rr-content { white-space: pre-wrap; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: 14.5px; }
.bi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.bi-field { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface-2); }
.bi-field-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.bi-field-head label { margin: 0; }
.bi-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bi-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; }
.bi-banner { width: 100%; height: 72px; border-radius: 10px; object-fit: cover; background: var(--surface-3); display: block; margin-bottom: 10px; }
.bi-field input[type=file] { width: 100%; font-size: 14px; }
.role-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 9px; vertical-align: 0; }
/* Security (prompts 129-131): status lists, per-action cards and simple record rows that wrap on phones. */
.sec-list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.sec-table { display: grid; gap: 6px; }
.sec-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel-2, rgba(127,127,127,.08)); }
.sec-row > span { min-width: 0; overflow-wrap: anywhere; }
.sec-actions { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.sec-action { border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 12px; padding: 10px 12px; margin: 0; min-width: 0; }
.sec-action legend { display: flex; gap: 8px; align-items: center; padding: 0 4px; }
.sec-action.locked { opacity: .6; }
.sec-action-fields { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14px; }
.sec-preview { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2, rgba(127,127,127,.08)); }
/* A titled block inside a card (the old fieldsets: media rules, Premium sets): a raised sub-card, its title on top. */
.ee-section { margin: 0; padding: 14px 16px; border: 0; border-radius: var(--r); background: var(--raised); min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ee-section > legend, .ee-head { float: left; width: 100%; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; color: var(--ink); font-size: var(--t-body); font-weight: 600; }
.ee-section > legend > span:first-child { flex: 1; }
.ee-section > legend + * { clear: both; }
.ee-section.locked > *:not(legend) { opacity: .5; }
.ee-section > .srow { padding: 0; border: 0; }

/* ---------- Warns (prompt 154): the numbers, presets, the rules table's extras, the list, a warning's detail ---------- */
#warns .stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#warns .stat-row .stat { padding: 10px 14px; border-radius: var(--r); background: var(--raised); min-width: 0; }
#warns .stat-row .stat b { display: block; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
#warns .stat-row .stat span { color: var(--ink-3); font-size: var(--t-xs); }
#warns .fi + .fi { margin-top: 14px; }
#warns .fi textarea { width: 100%; }
#warns .wrules { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
#warns .wrule { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--raised); }
#warns .wrule.off { opacity: .6; }
#warns .wr-main, #warns .wr-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#warns .wrule label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-3); font-size: var(--t-sm); font-weight: 500; }
#warns .wr-at { color: var(--ink) !important; }
#warns .wr-arrow { color: var(--ink-3); }
@media (min-width: 761px) { #warns .wr-main { flex-wrap: nowrap; } #warns .wr-main > * { flex-shrink: 0; } #warns .wr-main select { flex-shrink: 1; min-width: 0; } }
#warns .wr-action { width: 160px; }
#warns .wr-dur select { width: 104px; }
#warns .wr-role select { width: 200px; }
#warns .wr-dur { display: inline-flex; align-items: center; gap: 6px; }
#warns .wr-tools { display: inline-flex; gap: 2px; margin-left: auto; }
#warns .wr-reason { flex: 1 1 180px; min-width: 0; }
#warns .wr-opts { padding-left: 32px; }
#warns .wrap { overflow-wrap: anywhere; }
#warns .filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
#warns .filters input, #warns .filters select { flex: 1 1 140px; min-width: 0; }
#warns .pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
#warns .warn-detail .kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0 14px; font-size: var(--t-sm); }
#warns .warn-detail .kv dt { color: var(--ink-3); }
#warns .warn-detail .kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
#warns .warn-detail .pair-add + .pair-add { margin-top: 8px; }
#warns .warn-detail .pair-add input { flex: 1 1 auto; min-width: 0; }
#warns td.date { white-space: nowrap; }
#warns .btn.locked { opacity: .55; cursor: default; }
@media (max-width: 760px) {
  #warns .stat-row,   #warns .warn-detail .kv { grid-template-columns: 1fr; }
  #warns .warn-detail .kv dt { margin-top: 6px; }
  #warns .wr-opts { padding-left: 0; }
  #warns .wr-action, #warns .wr-role select { width: 100%; }
}
