/* Strive Gaming dashboard theme */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand-primary: #7c3aed;
  --brand-secondary: #c4b5fd;
  --brand-primary-rgb: 124, 58, 237;
  --brand-secondary-rgb: 196, 181, 253;
  --brand-contrast: #fff;
  --bg: #030303;
  --bg-panel: #050505;
  --bg-card: #0a0a0a;
  --bg-card-2: #0d0d0d;
  --bg-hover: #141414;
  --bg-input: #070707;
  --border: #292929;
  --border-soft: #1c1c1c;
  --border-strong: #454545;
  --text: #f2f2f3;
  --text-dim: #b6b2c2;
  --text-faint: #8d8a96;

  /* Quiet violet accents over black. Existing status colours remain semantic. */
  --chrome-grad: var(--brand-primary);
  --chrome-text: linear-gradient(180deg, #fff, var(--brand-secondary));
  --silver: var(--brand-secondary);

  /* accents */
  --accent: var(--brand-primary);
  --accent-2: var(--brand-secondary);
  --accent-soft: rgba(var(--brand-primary-rgb), 0.1);
  --ring: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.18);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.11);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.11);
  --yellow: #fbbf24;
  --cyan: #38cfe0;
  --rose: #fb7185;
  --violet: #a78bfa;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="graphite"] {
  --bg: #080808;
  --bg-panel: #0d0d0d;
  --bg-card: #121212;
  --bg-card-2: #151515;
  --bg-input: #0b0b0b;
}
html[data-theme="midnight"] {
  --bg: #04070a;
  --bg-panel: #080c11;
  --bg-card: #0c1117;
  --bg-card-2: #10161d;
  --bg-hover: #151c24;
  --bg-input: #070b10;
  --border: #29323d;
  --border-soft: #1b242e;
  --border-strong: #3d4a58;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(5px); } to { opacity: 1; transform: none; } }

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before { content: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { letter-spacing: 0; }
button:focus-visible, a:focus-visible { outline: 1px solid var(--brand-primary); outline-offset: 2px; }

/* silver gradient text utility (brand headings) */
.chrome-text {
  background: var(--chrome-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ==========================================================================
   Boot loading screen
   ========================================================================== */
.loader {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
  transition: opacity 0.15s ease, visibility 0.15s;
}
.loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.loader.hide *, .loader.hide *::after { animation: none; }

/* ==========================================================================
   Inputs
   ========================================================================== */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10.5px 13px; width: 100%; font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-primary); box-shadow: var(--ring);
}
textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
::placeholder { color: var(--text-faint); }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239fa2b0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type="color"] { padding: 3px; cursor: pointer; height: 39px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #202029; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2d2d3a; }
::-webkit-scrollbar-track { background: transparent; }

.app { display: flex; height: 100vh; }

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  position: relative; width: 218px; flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column; padding: 12px 9px 9px;
  transition: transform 0.3s var(--ease);
}
.scrim { display: none; }

.brand { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 7px 10px; }
.brand img, .brand .brand-fallback {
  width: 30px; height: 30px; border-radius: 9px; object-fit: cover;
  border: 1px solid rgba(214, 217, 226, 0.18);
  box-shadow: 0 2px 10px rgba(190, 194, 210, 0.1);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: #101018; color: var(--silver);
}
.brand div { min-width: 0; }
.brand b {
  display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand small {
  font-size: 11px; font-weight: 650; letter-spacing: 0; text-transform: uppercase;
  background: var(--chrome-text);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.search {
  display: flex; align-items: center; gap: 8px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 9px;
  color: var(--text-faint); cursor: text; margin-bottom: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within { border-color: var(--brand-primary); box-shadow: var(--ring); }
.search svg { width: 14px; height: 14px; flex-shrink: 0; }
.search input { border: 0; background: none; padding: 0; flex: 1; min-width: 0; box-shadow: none !important; }
.search kbd {
  white-space: nowrap; font: 10px/1 inherit; color: var(--text-faint);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 9px; padding: 3px 6px;
}

.nav { flex: 1; overflow-y: auto; padding: 2px; margin: 0 -2px; }
.nav-section {
  margin: 12px 0 3px; padding: 0 8px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0; text-transform: uppercase; color: var(--text-faint);
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 31px; padding: 6px 9px; border-radius: 8px; color: var(--text-dim); text-align: left;
  font-size: 13px; font-weight: 500; transition: background 0.14s, color 0.14s;
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.82; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: rgba(var(--brand-primary-rgb), .14);
  color: #fff;
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 3px; background: var(--silver);
}
.nav-item.active svg { opacity: 1; }

.profile-wrap { position: relative; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.user-card {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px;
  padding: 6px 8px; border: 1px solid transparent; border-radius: 10px;
  color: var(--text); text-align: left; cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.user-card:hover, .user-card.open { background: var(--bg-hover); border-color: var(--border); }
.user-card img {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  border: 1px solid var(--border-strong); object-fit: cover;
}
.user-card .u-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; font-weight: 650;
}
.profile-menu {
  position: absolute; z-index: 80; left: 0; right: 0; bottom: calc(100% + 7px);
  width: 100%; max-width: 100%; box-sizing: border-box;
  padding: 5px; background: rgba(12, 12, 12, 0.98); border: 1px solid var(--border-strong);
  border-radius: 11px; box-shadow: 0 14px 36px rgba(0, 0, 0, .62);
  opacity: 0; visibility: hidden; transform: translateY(7px) scale(0.98); transform-origin: bottom right;
  pointer-events: none; transition: opacity 0.17s var(--ease), transform 0.17s var(--ease), visibility 0.17s;
}
.profile-menu.open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.pm-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 9px;
  width: 100%; max-width: 100%; min-height: 36px; padding: 7px 10px; box-sizing: border-box;
  border-radius: 8px; color: var(--text-dim); text-decoration: none;
  font-size: 1rem; font-weight: 650; transition: background 0.14s, color 0.14s;
}
.pm-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.pm-item:hover, .pm-item:focus-visible { color: var(--text); background: var(--bg-hover); outline: none; }
.pm-item.pm-danger { color: var(--red); }
.pm-item.pm-danger:hover, .pm-item.pm-danger:focus-visible { color: #ff9a9a; background: var(--red-soft); }
.gate-support { color: var(--brand-primary); text-decoration: none; font-weight: 650; }
.gate-support:hover { text-decoration: underline; }

/* ==========================================================================
   Main column
   ========================================================================== */
.main { flex: 1; overflow-y: auto; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; background: rgba(3, 3, 3, 0.94); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 24px; font-size: 13px; font-weight: 650;
}
.topbar .crumb { color: var(--text-faint); font-weight: 500; }
.topbar .crumb[hidden] { display: none; }
.topbar .crumb::after { content: "/"; margin-left: 12px; color: var(--border-strong); }
.menu-btn { display: none; padding: 6px; margin: -6px 0 -6px -8px; border-radius: 11px; color: var(--text-dim); }
.menu-btn svg { width: 20px; height: 20px; display: block; }
.menu-btn:hover { background: var(--bg-hover); color: var(--text); }

.content { max-width: 1220px; margin: 0 auto; padding: 30px 38px 130px; }
.content.overview-content, .content.unavailable-content { max-width: 1120px; }

.page-title { font-size: 19px; line-height: 1.25; font-weight: 720; margin-bottom: 3px; }
.page-sub { color: var(--text-faint); font-size: 12px; margin-bottom: 19px; max-width: 680px; }

/* ---------- banners ---------- */
.banner {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius); padding: 12px 16px; font-size: 13px; margin-bottom: 20px;
  animation: fadeUp 0.3s var(--ease);
}
.banner.warn { background: rgba(251, 191, 36, 0.06); border: 1px solid rgba(251, 191, 36, 0.26); color: var(--yellow); }
.banner.danger { background: rgba(248, 113, 113, 0.06); border: 1px solid rgba(248, 113, 113, 0.28); color: var(--red); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 9px; margin-bottom: 22px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 13px 15px;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.stat:hover { border-color: var(--border); transform: translateY(-1px); }
.stat::before { content: none; }
.stat::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
}
.stat .n { font-size: 20px; font-weight: 720; letter-spacing: 0; }
.stat .l { font-size: 13px; color: var(--text-faint); margin-top: 2px; }

/* ---------- tabs (underline style, like the reference) ---------- */
.tabs {
  display: flex; gap: 1px; margin-bottom: 20px; overflow-x: auto; max-width: 100%;
  border-bottom: 1px solid var(--border-soft);
}
.tab {
  position: relative; padding: 7px 11px 9px; color: var(--text-faint); white-space: nowrap;
  font-size: 13px; font-weight: 550; transition: color 0.16s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; font-weight: 650; }
.tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  border-radius: 2px; background: var(--chrome-grad);
  box-shadow: 0 0 10px rgba(var(--brand-primary-rgb), 0.34);
}

/* ---------- module cards ---------- */
.group-title { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 680; margin: 21px 0 9px; }
.group-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-soft), transparent); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }

.card {
  position: relative; overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px; cursor: pointer;
  transition: border-color 0.2s, transform 0.22s var(--ease), box-shadow 0.22s;
  display: flex; flex-direction: column; gap: 6px; min-height: 126px;
}
.card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s;
  background: rgba(255, 255, 255, 0.018);
  pointer-events: none;
}
.card::after {
  content: ""; position: absolute; top: 0; left: 8%; right: 8%; height: 1px; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transition: opacity 0.25s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, .32); }
.card:hover::before, .card:hover::after { opacity: 1; }
.card h3 { font-size: 12px; display: flex; align-items: center; gap: 8px; }
.card p { font-size: 10.75px; color: var(--text-faint); flex: 1; line-height: 1.45; }
.card-icon { display: block; }
.card-icon svg { width: 17px; height: 17px; color: var(--text-dim); transition: color 0.2s; }
.card:hover .card-icon svg { color: var(--silver); }
.card-foot { display: flex; align-items: center; justify-content: space-between; }
.card-go {
  font-size: 12px; color: var(--text-faint); opacity: 0; transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.card:hover .card-go { opacity: 1; transform: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; width: max-content;
  font-size: 11px; line-height: 1.2; font-weight: 700; border-radius: 6px; padding: 3px 7px;
  border: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge.on { background: rgba(126, 195, 146, .1); color: #a9d8b6; }
.badge.on:hover { background: rgba(126, 195, 146, .15); }
.badge.off { background: rgba(154, 158, 170, .1); color: var(--text-dim); }
.badge.off:hover { color: var(--text); background: rgba(154, 158, 170, .15); }
.badge.ready { background: rgba(214, 216, 223, .08); color: var(--text-dim); }
.badge.unavailable { background: rgba(154, 158, 170, .07); color: var(--text-faint); }
.unavailable-card { background: #080808; }
.unavailable-card .card-icon, .unavailable-card h3, .unavailable-card p { opacity: .74; }

/* ==========================================================================
   Module settings page
   ========================================================================== */
.mod-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; flex-wrap: wrap; }
.mod-head h1 { font-size: 22px; flex: 1; }

.switch { position: relative; width: 44px; height: 25px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 25px; transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.switch .track::after {
  content: ""; position: absolute; width: 19px; height: 19px; border-radius: 50%;
  background: var(--text-dim); top: 2px; left: 2px;
  transition: transform 0.22s var(--ease), background 0.2s;
}
.switch input:checked + .track {
  background: var(--chrome-grad); border-color: transparent;
  box-shadow: 0 2px 12px rgba(var(--brand-primary-rgb), 0.28);
}
.switch input:checked + .track::after { transform: translateX(19px); background: #101016; }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

.section {
  background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 17px 18px; margin-top: 12px;
}
.section > h2 { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 680; margin-bottom: 4px; }
.section > h2::before { content: none; }
.section > .hint {
  font-size: 13px; color: var(--text-faint); margin: 2px 0 0; max-width: 700px;
  padding-bottom: 12px;
}
.section > [data-sec] { border-top: 1px solid var(--border-soft); padding-top: 15px; margin-top: 2px; }
.section > [data-sec]:empty { display: none; border: 0; padding: 0; margin: 0; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 12px; font-weight: 620; margin-bottom: 6px; }
.field .help { font-size: 13px; color: var(--text-faint); margin-top: 5px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.toggle-field {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-input); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.toggle-field .t-label { flex: 1; }
.toggle-field .t-label b { display: block; font-size: 13px; }
.toggle-field .t-label span { font-size: 12px; color: var(--text-faint); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(200, 204, 218, 0.08); border: 1px solid rgba(200, 204, 218, 0.22);
  border-radius: 999px; padding: 4px 6px 4px 11px;
  font-size: 12.5px; font-weight: 500; animation: popIn 0.18s var(--ease);
}
.chip button {
  color: var(--text-dim); width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; transition: background 0.14s, color 0.14s;
}
.chip button:hover { color: #fff; background: var(--red); }

/* ---------- object list (collapsible rows) ---------- */
.obj-list { display: flex; flex-direction: column; gap: 10px; }
.obj-item {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: border-color 0.18s; animation: fadeUp 0.25s var(--ease);
}
.obj-item.open { border-color: var(--border-strong); }
.obj-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; cursor: pointer; user-select: none; transition: background 0.15s;
}
.obj-head:hover { background: var(--bg-hover); }
.obj-head .chev { flex-shrink: 0; transition: transform 0.2s var(--ease); color: var(--text-faint); }
.obj-head .chev svg { width: 14px; height: 14px; display: block; }
.obj-item.open .obj-head .chev { transform: rotate(90deg); }
.obj-head .obj-title {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.obj-head .obj-sub { font-size: 13px; color: var(--text-faint); font-weight: 500; white-space: nowrap; }
.obj-head .rm {
  flex-shrink: 0; color: var(--text-faint); font-size: 12px; padding: 5px 10px;
  border-radius: 10px; transition: background 0.14s, color 0.14s;
}
.obj-head .rm:hover { color: var(--red); background: var(--red-soft); }
.obj-body { display: none; padding: 4px 14px 15px; border-top: 1px solid var(--border-soft); }
.obj-item.open .obj-body { display: block; }
.obj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 12px; }
.obj-grid .field { margin-bottom: 0; }
.obj-grid .span2 { grid-column: span 2; }
.color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08); }

img.cemoji { width: 20px; height: 20px; vertical-align: -4px; object-fit: contain; }

/* ---------- emoji picker ---------- */
.emoji-input-wrap { display: flex; gap: 8px; align-items: stretch; }
.emoji-input-wrap input { flex: 1; min-width: 0; }
.emoji-btn {
  flex-shrink: 0; width: 40px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 16px;
  transition: border-color 0.15s, background 0.15s;
}
.emoji-btn:hover { border-color: var(--brand-primary); background: var(--bg-hover); }
.emoji-btn img.cemoji { width: 21px; height: 21px; vertical-align: 0; }

.emoji-pop {
  position: fixed; z-index: 90; width: 318px; max-height: 364px;
  background: #101010; border: 1px solid var(--border-strong); border-radius: 11px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: popIn 0.16s var(--ease);
}
.emoji-pop .ep-search { padding: 10px 10px 8px; }
.emoji-pop .ep-search input { padding: 8px 11px; font-size: 13px; }
.emoji-pop .ep-body { overflow-y: auto; padding: 0 10px 10px; }
.emoji-pop .ep-label {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0;
  color: var(--text-faint); margin: 10px 2px 6px;
}
.emoji-pop .ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-pop .ep-grid button {
  aspect-ratio: 1; border-radius: 11px; display: grid; place-items: center;
  font-size: 18px; transition: background 0.12s, transform 0.12s;
}
.emoji-pop .ep-grid button:hover { background: var(--bg-hover); transform: scale(1.12); }
.emoji-pop .ep-grid img { width: 22px; height: 22px; object-fit: contain; }
.emoji-pop .ep-empty { color: var(--text-faint); font-size: 12.5px; padding: 8px 2px 12px; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand-primary); color: var(--brand-contrast); border: 1px solid var(--brand-primary);
  border-radius: var(--radius-sm); padding: 9px 15px; font-weight: 700; font-size: 12px;
  box-shadow: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); box-shadow: none; }
.btn:active { transform: none; }
.btn.ghost {
  background: var(--bg-hover); border: 1px solid var(--border); color: var(--text);
  box-shadow: none; font-weight: 600;
}
.btn.ghost:hover { border-color: var(--border-strong); filter: none; }
.btn.danger {
  background: var(--red-soft); border: 1px solid rgba(248, 113, 113, 0.3); color: var(--red);
  box-shadow: none; font-weight: 600;
}
.btn.danger:hover { background: rgba(248, 113, 113, 0.2); filter: none; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none !important; filter: none !important; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn.loading { color: transparent; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 15px; height: 15px;
  border: 2px solid rgba(10, 10, 16, 0.28); border-top-color: var(--brand-contrast);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.btn.ghost.loading::after, .btn.danger.loading::after {
  border-color: rgba(255, 255, 255, 0.2); border-top-color: var(--text-dim);
}

/* ---------- save bar ---------- */
.savebar {
  position: fixed; left: 50%; transform: translateX(calc(-50% + 73px)); bottom: 18px; z-index: 40;
  width: min(540px, calc(100vw - 204px));
  background: rgba(13, 13, 13, 0.96); backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong); border-radius: 11px;
  padding: 12px 14px 12px 18px; display: none; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
}
.savebar.visible { display: flex; animation: slideUp 0.25s var(--ease); }
.savebar span { flex: 1; color: var(--text-dim); font-size: 13px; }
.savebar span::before { content: "●"; color: var(--yellow); margin-right: 8px; font-size: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 95;
  display: flex; align-items: center; gap: 9px;
  background: rgba(13, 13, 13, 0.97); backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 17px; font-size: 13px;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(10px); transition: all 0.22s var(--ease); pointer-events: none;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.toast.err::before { background: var(--red); }
.toast.show { opacity: 1; transform: none; }

/* ---------- modal ---------- */
.modal-scrim {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(3, 3, 6, 0.65); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeUp 0.18s ease;
}
.modal {
  width: 100%; max-width: 400px;
  background: #101010; border: 1px solid var(--border-strong); border-radius: 11px;
  padding: 24px; box-shadow: var(--shadow-lg);
  animation: popIn 0.2s var(--ease);
}
.modal h3 { font-size: 16px; margin-bottom: 8px; }
.modal p { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; margin-bottom: 20px; }
.modal .m-row { display: flex; justify-content: flex-end; gap: 9px; }

/* ---------- skeleton ---------- */
.skel { pointer-events: none; }
.skel .sk {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
  border: 1px solid var(--border-soft);
}
.skel .sk-title { height: 30px; width: 240px; margin-bottom: 10px; }
.skel .sk-sub { height: 15px; width: 380px; max-width: 80%; margin-bottom: 26px; }
.skel .sk-block { height: 130px; margin-bottom: 16px; }
.skel .sk-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 13px; margin-bottom: 26px; }
.skel .sk-row .sk { height: 86px; }

/* ---------- empty states ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 44px 20px; color: var(--text-dim);
  border: 1px dashed var(--border); border-radius: var(--radius);
  animation: fadeUp 0.3s var(--ease);
}
.empty .e-icon {
  width: 54px; height: 54px; border-radius: 11px; display: grid; place-items: center;
  background: var(--bg-hover); border: 1px solid var(--border-soft);
  font-size: 24px; margin-bottom: 13px;
}
.empty b { color: var(--text); font-size: 14.5px; margin-bottom: 4px; }
.empty p { font-size: 13px; color: var(--text-faint); max-width: 340px; margin-bottom: 14px; }

.unavailable-head { align-items: center; margin-bottom: 5px; }
.unavailable-head .page-icon {
  width: 31px; height: 31px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 9px; color: var(--text-dim); background: var(--bg-card);
}
.unavailable-head .page-icon svg { width: 15px; height: 15px; }
.availability-pill {
  display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--text-faint);
  background: var(--bg-card); font-size: 12px; font-weight: 650;
}
.unavailable-state {
  min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 44px 24px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card);
}
.unavailable-icon {
  width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: 12px; color: var(--text-dim); background: var(--bg-input);
}
.unavailable-icon svg { width: 21px; height: 21px; }
.unavailable-state h2 { font-size: 14px; margin-bottom: 5px; }
.unavailable-state p { max-width: 390px; color: var(--text-faint); font-size: 12px; line-height: 1.6; }

/* ---------- gate screens ---------- */
.gate {
  position: relative; isolation: isolate; width: 100%; min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 32px; overflow: hidden; text-align: center;
}
.gate-login {
  background-color: #050505;
  background-image: url('/assets/strive-gaming-gradient.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
.gate-login::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(0, 0, 0, .48);
}
.gate-login-card {
  width: min(420px, 100%); padding: 48px 48px 44px; color: #f7f7f8;
  background: rgba(7, 7, 8, .94); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px; box-shadow: 0 28px 90px rgba(0, 0, 0, .72);
}
.gate-login-logo {
  display: block; width: 92px; height: auto; aspect-ratio: 1; object-fit: cover;
  margin: 0 auto 24px; border-radius: 50%;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .12);
}
.gate-login-card h1 {
  margin: 0 0 9px; color: #fff; font-size: 31px; font-weight: 720; line-height: 1.2;
  letter-spacing: -.025em;
}
.gate-login-card p {
  margin: 0; color: #a7a7ad; font-size: 15px; line-height: 1.55;
}
.gate-login-divider {
  height: 1px; margin: 28px 0; background: rgba(255, 255, 255, .1);
}
.btn-discord {
  display: inline-flex; align-items: center; justify-content: center; gap: 11px; width: 100%; min-height: 52px;
  background: var(--brand-primary); color: var(--brand-contrast); border: 1px solid var(--brand-primary); border-radius: 10px; padding: 13px 20px;
  font-weight: 680; font-size: 15px; line-height: 1; text-decoration: none;
  box-shadow: none;
  transition: transform .16s var(--ease), background .16s, border-color .16s, box-shadow .2s;
}
.btn-discord:hover {
  filter: brightness(1.08);
}
.btn-discord:active { transform: translateY(0); }
.btn-discord svg { width: 20px; height: 20px; }

.gate-denied { background: #000; color: #f5f5f6; }
.gate-denied-content {
  position: relative; top: -40px; width: min(420px, 100%);
  display: flex; flex-direction: column; align-items: center;
  animation: fadeUp .35s var(--ease);
}
.gate-denied-icon {
  position: relative; display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 28px;
  color: #ff494d; background: rgba(237, 66, 69, .09); border: 1px solid rgba(237, 66, 69, .18);
  border-radius: 15px; box-shadow: 0 7px 18px rgba(237, 66, 69, .1);
}
.gate-denied-shield, .gate-denied-shield svg { display: block; width: 25px; height: 25px; }
.gate-denied-x {
  position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center;
  width: 9px; height: 9px; color: #ff494d; background: #110304; border-radius: 50%;
}
.gate-denied-x svg { width: 8px; height: 8px; stroke-width: 2.8; }
.gate-denied-content h1 {
  margin: 0 0 7px; color: #f7f7f8; font-size: 20px; font-weight: 720; line-height: 1.2;
  letter-spacing: -.025em;
}
.gate-denied-content p {
  max-width: 420px; margin: 0 0 24px; color: #8c8c92; font-size: 14px; line-height: 1.5;
}
.gate-denied-action {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 36px;
  color: #f1f1f3; background: #080808; border: 1px solid #29292c; border-radius: 9px;
  font-size: 14px; font-weight: 650; text-decoration: none;
  transition: color .16s, border-color .16s, background .16s, transform .16s var(--ease);
}
.gate-denied-action:hover { color: #fff; background: #0d0909; border-color: rgba(237, 66, 69, .48); transform: translateY(-1px); }
.gate-denied-action:active { transform: translateY(0); }

.gate-error { background: #030303; }
.gate-error-card {
  width: min(420px, 100%); padding: 42px 38px 38px; color: #f7f7f8; background: #090909;
  border: 1px solid #2d2d30; border-radius: 18px; box-shadow: 0 26px 80px rgba(0, 0, 0, .65);
}
.gate-error-logo { display: block; width: 72px; height: auto; margin: 0 auto 20px; border-radius: 50%; }
.gate-error-card h1 { margin: 0 0 9px; font-size: 25px; line-height: 1.25; }
.gate-error-card p { margin: 0 0 24px; color: #9c9ca2; font-size: 14px; line-height: 1.6; }
.gate-error-card .btn { min-width: 132px; }

.brand-footer a[hidden] { display: none; }

/* ---------- export grid ---------- */
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 14px; }
.export-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px; transition: border-color 0.2s, transform 0.2s var(--ease);
  display: flex; flex-direction: column;
}
.export-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.export-card h3 { font-size: 14px; margin-bottom: 4px; }
.export-card p { font-size: 12.5px; color: var(--text-faint); margin-bottom: 14px; flex: 1; line-height: 1.5; }
.export-card .row { display: flex; gap: 8px; }

/* ---------- docs ---------- */
.docs-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 20px; align-items: start; }
.docs-sidebar { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 10px; }
.docs-list { display: flex; flex-direction: column; gap: 3px; max-height: calc(100vh - 190px); overflow-y: auto; padding-right: 2px; }
.docs-group {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0;
  color: var(--text-faint); margin: 12px 0 4px; padding: 0 12px;
}
.docs-group:first-child { margin-top: 2px; }
.doc-list-item {
  width: 100%; text-align: left; background: transparent; border: 1px solid transparent;
  border-radius: 10px; padding: 8px 12px; color: var(--text-dim);
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.doc-list-item:hover { background: var(--bg-hover); color: var(--text); }
.doc-list-item.active {
  color: #fff; border-color: rgba(var(--brand-primary-rgb), 0.3);
  background: linear-gradient(90deg, rgba(var(--brand-primary-rgb), 0.12), rgba(var(--brand-primary-rgb), 0.03));
}
.doc-list-item span { display: block; font-weight: 600; font-size: 13px; }
.doc-list-item small { display: block; color: var(--text-faint); font-size: 13px; margin-top: 1px; }
.doc-empty { color: var(--text-faint); font-size: 13px; padding: 8px 2px; }
.doc-article {
  min-width: 0; background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 32px 36px; animation: fadeUp 0.25s var(--ease);
}
.doc-heading {
  display: flex; align-items: flex-start; gap: 12px; justify-content: space-between;
  border-bottom: 1px solid var(--border-soft); padding-bottom: 18px; margin-bottom: 20px;
}
.doc-heading h1 { font-size: 25px; line-height: 1.25; }
.doc-heading span {
  color: var(--text-faint); font-size: 13px; white-space: nowrap; padding: 4px 10px;
  background: var(--bg-input); border: 1px solid var(--border-soft); border-radius: 999px; margin-top: 5px;
}
.doc-markdown { color: var(--text-dim); font-size: 14px; line-height: 1.75; }
.doc-markdown h1, .doc-markdown h2, .doc-markdown h3, .doc-markdown h4 { color: var(--text); line-height: 1.3; margin: 28px 0 10px; }
.doc-markdown h1:first-child, .doc-markdown h2:first-child { margin-top: 0; }
.doc-markdown h1 { font-size: 22px; }
.doc-markdown h2 { font-size: 17px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.doc-markdown h3 { font-size: 15px; }
.doc-markdown h4 { font-size: 14px; }
.doc-markdown p { margin: 10px 0; }
.doc-markdown strong { color: var(--text); }
.doc-markdown ul, .doc-markdown ol { margin: 10px 0 15px 22px; }
.doc-markdown li { margin: 5px 0; }
.doc-markdown a, .doc-inline-link {
  color: var(--brand-primary); text-decoration: none; font-weight: 600; display: inline; padding: 0;
  border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.32); transition: border-color 0.14s;
}
.doc-markdown a:hover, .doc-inline-link:hover { border-bottom-color: var(--brand-primary); }
.doc-markdown code {
  background: var(--bg-input); border: 1px solid var(--border-soft); border-radius: 10px;
  color: #d3d6e6; padding: 2px 6px; font-size: 12.5px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
.doc-markdown pre {
  overflow-x: auto; background: #08080e; border: 1px solid var(--border);
  border-radius: 10px; padding: 15px 17px; margin: 13px 0 18px;
}
.doc-markdown pre code { border: 0; padding: 0; background: transparent; color: var(--text); font-size: 12.5px; line-height: 1.7; }
.doc-markdown hr { border: 0; border-top: 1px solid var(--border-soft); margin: 22px 0; }
.doc-table-wrap { overflow-x: auto; margin: 14px 0 18px; border: 1px solid var(--border-soft); border-radius: 10px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table th, .doc-table td { border-bottom: 1px solid var(--border-soft); padding: 9px 13px; text-align: left; }
.doc-table td:not(:last-child), .doc-table th:not(:last-child) { border-right: 1px solid var(--border-soft); }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table th { background: var(--bg-hover); color: var(--text); font-weight: 600; }
.doc-table tr:hover td { background: rgba(255, 255, 255, 0.015); }
.doc-pager {
  display: flex; justify-content: space-between; gap: 10px;
  border-top: 1px solid var(--border-soft); margin-top: 26px; padding-top: 18px;
}
.doc-pager button {
  display: flex; flex-direction: column; gap: 2px; max-width: 46%;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; text-align: left; transition: border-color 0.15s, background 0.15s;
}
.doc-pager button:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.doc-pager button small { font-size: 13px; color: var(--text-faint); }
.doc-pager button b { font-size: 13px; }
.doc-pager button.next { text-align: right; margin-left: auto; }

/* ---------- Discord embed preview (Org Social Hub) ---------- */
.dp-msg {
  display: flex; gap: 13px; background: #313338; border-radius: 7px; padding: 16px;
}
.dp-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.dp-right { min-width: 0; flex: 1; }
.dp-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.dp-head b { color: #f2f3f5; font-size: 15px; }
.dp-app {
  background: #5865f2; color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 1.5px 5px; border-radius: 4px; letter-spacing: 0;
}
.dp-time { color: #949ba4; font-size: 13px; }
.dp-embed {
  background: #2b2d31; border-left: 4px solid #c9ccd8; border-radius: 5px;
  padding: 13px 15px 13px 13px; max-width: 470px;
}
.dp-grid { display: flex; gap: 14px; }
.dp-main { min-width: 0; flex: 1; }
.dp-title { color: #f2f3f5; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.dp-tagline { color: #dbdee1; font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.dp-desc { color: #dbdee1; font-size: 13px; white-space: pre-wrap; margin-bottom: 4px; }
.dp-sep { color: #4e5058; font-size: 13px; letter-spacing: 0; margin: 6px 0; overflow: hidden; white-space: nowrap; }
.dp-link { color: #dbdee1; font-size: 13.5px; margin: 3px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dp-link b { color: #f2f3f5; }
.dp-a { color: #00a8fc; cursor: pointer; }
.dp-a:hover { text-decoration: underline; }
.dp-thumb { width: 74px; height: 74px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.dp-banner { width: 100%; border-radius: 8px; margin-top: 12px; max-height: 210px; object-fit: cover; }
.dp-footer {
  display: flex; align-items: center; gap: 7px; margin-top: 10px;
  color: #949ba4; font-size: 13px; font-weight: 500;
}
.dp-footer img { width: 19px; height: 19px; border-radius: 50%; object-fit: cover; }
.dp-msg img.cemoji { width: 18px; height: 18px; }

/* ---------- pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; width: max-content;
  font-size: 11px; line-height: 1.2; font-weight: 700; padding: 3px 7px; border-radius: 6px;
  border: 0; color: var(--text-dim); background: rgba(154, 158, 170, .08);
}
.pill::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.pill.ok { color: #a9d8b6; background: rgba(126, 195, 146, .1); }
.pill.bad { color: #dfc27e; background: rgba(194, 150, 64, .1); }

/* ==========================================================================
   Operational data views
   ========================================================================== */
.filterbar {
  display: grid;
  grid-template-columns: minmax(190px, 1.5fr) repeat(5, minmax(120px, 1fr)) auto;
  gap: 8px; align-items: end; margin-bottom: 18px;
}
.filterbar.compact { grid-template-columns: minmax(240px, 1.7fr) minmax(150px, .7fr) minmax(150px, .8fr) auto; }
.filterbar.log-filter { grid-template-columns: minmax(180px, 1.5fr) repeat(6, minmax(105px, 1fr)) auto; }
.filterbar input, .filterbar select { min-width: 0; height: 38px; }
.filterbar .btn { height: 38px; white-space: nowrap; }
.filterbar .btn svg, .table-empty .btn svg { width: 14px; height: 14px; }
.data-summary { min-height: 20px; margin: -4px 0 10px; color: var(--text-faint); font-size: 12px; }
.board-tools { display: flex; gap: 8px; align-items: center; margin: -10px 0 18px; }
.board-tools input { max-width: 330px; }
.board-tools .btn { white-space: nowrap; }
.board-tools .btn svg { width: 14px; height: 14px; }

.table-shell {
  width: 100%; overflow-x: auto; background: var(--bg-card);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
}
.data-table { width: 100%; min-width: 790px; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  background: #0e0e0e; color: var(--text-faint); font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0; text-align: left;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim); vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: rgba(255, 255, 255, 0.018); }
.data-table td b, .data-table td.strong { color: var(--text); font-weight: 650; }
.data-table td small {
  display: block; color: var(--text-faint); font-size: 12.5px; margin-top: 1px;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.truncate-cell { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { color: var(--text) !important; font-size: 15px; font-weight: 750; width: 56px; }
.muted { color: var(--text-faint); }
.mono {
  display: inline-block; max-width: 210px; color: var(--text-faint);
  font: 11px/1.5 "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.table-actions { display: flex; gap: 5px; align-items: center; }
.icon-btn {
  width: 30px; height: 30px; flex: 0 0 30px; display: inline-grid; place-items: center;
  color: var(--text-dim); background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none; transition: color .14s, border-color .14s, background .14s;
}
.icon-btn svg { width: 15px; height: 15px; display: block; }
.icon-btn:hover { color: #fff; border-color: var(--border-strong); background: #1b1b1b; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger-icon { color: var(--red); }
.icon-btn.loading { color: transparent; pointer-events: none; }
.icon-btn.loading::after {
  content: ""; width: 13px; height: 13px; border: 2px solid #555; border-top-color: #ddd;
  border-radius: 50%; animation: spin .7s linear infinite;
}

.status {
  display: inline-flex; align-items: center; justify-self: start; gap: 5px; width: max-content; min-height: 18px;
  white-space: nowrap; border: 0; border-radius: 6px; padding: 3px 7px;
  color: var(--text-dim); background: rgba(154, 158, 170, .1); font-size: 11px; line-height: 1.2; font-weight: 700;
  text-transform: capitalize; letter-spacing: .01em;
}
.status::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status-open, .status-active, .status-enabled, .status-published, .status-connected,
.status-passed, .status-approved, .status-accepted, .status-healthy {
  color: #a9d8b6; background: rgba(126, 195, 146, .1);
}
.status-closed, .status-disabled, .status-inactive, .status-disconnected, .status-not-configured {
  color: var(--text-dim); background: rgba(154, 158, 170, .1);
}
.status-flagged, .status-pending, .status-waiting, .status-warn, .status-moderation, .status-draft, .status-missing-keys {
  color: #dfc27e; background: rgba(194, 150, 64, .1);
}
.status-deleted, .status-denied, .status-error, .status-failed, .status-ban, .status-kick {
  color: #e7a1a1; background: rgba(190, 82, 82, .12);
}
.status-unban, .status-untimeout { color: var(--green); }
.risk {
  display: inline-block; min-width: 54px; padding: 3px 7px; text-align: center;
  color: var(--green); background: var(--green-soft); border-radius: 9px; font-weight: 700;
}
.risk.mid { color: var(--yellow); background: rgba(251, 191, 36, .08); }
.risk.high { color: var(--red); background: var(--red-soft); }
.mini-tag {
  display: inline-block; color: var(--text-dim); background: #151515; border: 1px solid var(--border);
  border-radius: 9px; padding: 2px 6px; margin: 1px; font-size: 12.5px; white-space: nowrap;
}
.table-empty { min-height: 260px; }
.table-empty .e-icon svg { width: 23px; height: 23px; }

.detail-modal { max-width: 680px; max-height: min(760px, calc(100vh - 36px)); display: flex; flex-direction: column; }
.detail-head {
  display: flex; align-items: center; gap: 12px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.detail-head h3 { flex: 1; margin: 0; font-size: 17px; }
.detail-body { overflow-y: auto; padding: 18px 2px 2px; }
.detail-modal > .m-row { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.detail-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; margin-bottom: 16px;
}
.detail-grid > div { min-width: 0; padding: 11px 13px; border-bottom: 1px solid var(--border-soft); }
.detail-grid > div:nth-child(odd) { border-right: 1px solid var(--border-soft); }
.detail-grid > div.wide { grid-column: 1 / -1; border-right: 0; }
.detail-grid dt { color: var(--text-faint); font-size: 12.5px; font-weight: 700; text-transform: uppercase; }
.detail-grid dd { color: var(--text); margin-top: 4px; overflow-wrap: anywhere; }
.answers { display: flex; flex-direction: column; gap: 9px; margin: 14px 0; }
.answer { padding: 12px 13px; background: var(--bg-input); border: 1px solid var(--border-soft); border-radius: 10px; }
.answer b { display: block; font-size: 12.5px; margin-bottom: 4px; }
.answer p { color: var(--text-dim); white-space: pre-wrap; overflow-wrap: anywhere; }
.modal-label { display: block; color: var(--text-dim); font-size: 12px; font-weight: 650; margin: 10px 0 6px; }
.json-block pre {
  max-height: 280px; overflow: auto; color: #d2d2d5; background: #070707;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  font: 11px/1.6 "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.editor-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }

.watcher-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.watcher-status { background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 13px; min-width: 0; }
.watcher-head { display: flex; align-items: center; gap: 8px; }
.watcher-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watcher-status .platform { display: block; color: var(--text-faint); font-size: 13px; text-transform: capitalize; margin: 3px 0 10px; }

/* ==========================================================================
   Phase 2A module workspaces and editable previews
   ========================================================================== */
.module-hero {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  margin-bottom: 18px;
}
.compact-module-hero h1 { font-size: 21px; line-height: 1.2; margin: 2px 0 5px; }
.compact-module-hero p { max-width: 640px; color: var(--text-faint); font-size: 12px; line-height: 1.55; }
.eyebrow { color: var(--text-faint); font-size: 11px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.switch-label { display: flex; align-items: center; gap: 9px; color: var(--text-dim); font-size: 13px; font-weight: 650; white-space: nowrap; }
.module-workspace { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(360px, .96fr); gap: 16px; align-items: start; }
.composer-column, .ticket-settings-column { min-width: 0; }
.composer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.composer-actions .btn:disabled, .platform-shell .btn:disabled { opacity: .42; cursor: not-allowed; }

.preview-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.preview-panel-head h2 { margin-bottom: 4px; }
.live-badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px;
  border: 1px solid rgba(214, 216, 223, .18); border-radius: 999px;
  background: #111; color: var(--silver); font-size: 11px; font-weight: 750; text-transform: uppercase;
}
.editable-preview-panel { overflow: visible; }
.live-discord-preview {
  min-width: 0; padding: 14px; border: 1px solid var(--border-soft); border-radius: 11px;
  background: #080808;
}
.live-message-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.live-message-head > img { width: 32px; height: 32px; object-fit: cover; border-radius: 50%; border: 1px solid var(--border); }
.live-message-head > div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.live-message-head b { font-size: 12px; }
.live-message-head span { padding: 2px 4px; border-radius: 3px; background: #5865f2; color: white; font-size: 9px; font-weight: 800; }
.live-message-head small { color: var(--text-faint); font-size: 11px; }
.live-message-content { margin: -2px 0 8px 41px; color: var(--text); font-size: 13px; }
.live-embed {
  position: relative; margin-left: 41px; padding: 12px 12px 10px 15px; overflow: visible;
  border: 1px solid #1d1d20; border-left: 4px solid var(--embed-color); border-radius: 4px 9px 9px 4px;
  background: #101012;
}
.live-embed > .preview-pencil:first-child { position: absolute; left: -14px; top: 8px; }
.live-embed-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.live-embed-copy { min-width: 0; }
.preview-editable { position: relative; min-width: 0; }
.preview-editable:hover > .preview-pencil, .preview-editable:focus-within > .preview-pencil { transform: scale(1.05); }
.preview-pencil {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0;
  border: 2px solid #0f0f11; border-radius: 50%; background: #2488ff; color: white;
  box-shadow: 0 5px 14px rgba(36, 136, 255, .35);
  transition: transform .16s var(--ease), background .16s, box-shadow .16s;
}
.preview-pencil:hover { background: #4399ff; box-shadow: 0 7px 18px rgba(36, 136, 255, .46); }
.preview-pencil:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.preview-pencil svg { width: 12px; height: 12px; }
.preview-editable > .preview-pencil { position: absolute; z-index: 4; right: -8px; top: -7px; }
.live-embed-author { display: flex; align-items: center; gap: 6px; min-height: 19px; color: var(--text-dim); font-size: 12px; font-weight: 700; }
.live-embed-author img { width: 18px; height: 18px; object-fit: cover; border-radius: 50%; }
.live-embed h3 { margin: 5px 0 4px; font-size: 13px; line-height: 1.35; }
.live-embed p { color: #d0d0d4; font-size: 13px; line-height: 1.5; white-space: pre-line; }
.live-embed-links { display: grid; gap: 6px; margin-top: 9px; }
.live-embed-links > span { display: grid; grid-template-columns: auto 1fr; gap: 1px 6px; align-items: center; }
.live-embed-links img { width: 15px; height: 15px; }
.live-embed-links b { color: #8fb9ff; font-size: 12px; }
.live-embed-links small { grid-column: 2; color: var(--text-faint); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-embed-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin-top: 10px; }
.live-embed-fields > div { min-width: 0; }
.live-embed-fields > div > b, .live-embed-fields > div > span { display: block; }
.live-embed-fields > div > b { margin-bottom: 2px; font-size: 12px; }
.live-embed-fields > div > span { color: var(--text-dim); font-size: 11px; line-height: 1.4; white-space: pre-line; }
.live-thumb-wrap { width: 86px; min-height: 1px; }
.live-embed-thumb { width: 78px; height: 78px; object-fit: cover; border-radius: 9px; }
.preview-image-slot, .preview-banner-slot {
  display: grid; place-items: center; border: 1px dashed #303038; border-radius: 8px;
  color: var(--text-faint); background: #0b0b0d; font-size: 10.5px;
}
.preview-image-slot { width: 64px; height: 64px; }
.preview-banner-slot { min-height: 100px; margin-top: 12px; }
.live-image-wrap { margin-top: 10px; }
.live-embed-image { display: block; width: 100%; max-height: 230px; object-fit: cover; border-radius: 7px; }
.live-embed-footer { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--text-faint); font-size: 10.5px; }
.live-embed-footer img { width: 16px; height: 16px; object-fit: cover; border-radius: 50%; }
.live-embed-ping { margin-top: 8px; padding-top: 8px; border-top: 1px solid #202025; color: var(--text-faint); font-size: 10.5px; }
.preview-empty-line { margin-top: 8px; padding: 8px; border: 1px dashed #303038; border-radius: 7px; color: var(--text-faint); font-size: 11px; }
.preview-editor-copy { margin-bottom: 14px; color: var(--text-faint); font-size: 13px; line-height: 1.5; }
.preview-editor-fields { display: grid; gap: 4px; }

.panel-list-section { padding: 0; overflow: visible; }
.panel-list-section .section-toolbar { padding: 15px 16px; }
.section-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-toolbar .btn, .analytics-actions .btn { white-space: nowrap; }
.section-toolbar h2 { margin-bottom: 3px; }
.panel-list-head, .panel-list-row { display: grid; grid-template-columns: minmax(220px, 1.3fr) .55fr .8fr 38px; align-items: center; gap: 14px; }
.panel-list-head { padding: 8px 16px; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); color: var(--text-faint); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.panel-list-row { min-height: 62px; padding: 10px 16px; }
.panel-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.panel-identity img { width: 32px; height: 32px; object-fit: cover; border: 1px solid var(--border); border-radius: 9px; }
.panel-identity b, .panel-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-identity b { font-size: 13px; }
.panel-identity small { margin-top: 2px; color: var(--text-faint); font-size: 11px; }
.panel-menu-wrap { position: relative; }
.panel-action-menu {
  position: absolute; z-index: 90; right: 0; top: calc(100% + 6px); width: 174px; padding: 5px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: #0d0d0f; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-5px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s;
}
.panel-action-menu.open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.panel-action-menu button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 7px 9px; border-radius: 7px; color: var(--text-dim); font-size: 13px; text-align: left; }
.panel-action-menu button:hover, .panel-action-menu button:focus-visible { background: var(--bg-hover); color: white; outline: none; }
.panel-action-menu button svg { width: 14px; height: 14px; }
.panel-action-menu button small { margin-left: auto; color: var(--text-faint); font-size: 10px; text-transform: uppercase; }
.panel-action-menu button.danger { color: var(--red); }
.panel-action-menu button.danger:hover, .panel-action-menu button.danger:focus-visible { background: var(--red-soft); color: #ff9a9a; }
.ticket-workspace { grid-template-columns: minmax(0, 1fr) minmax(390px, .86fr); }
.ticket-preview-panel { position: sticky; top: 70px; }
.ticket-select-preview { margin: 12px 14px 0 55px; }
.ticket-select-preview label { display: block; margin-bottom: 5px; color: var(--text-faint); font-size: 11px; }

.platform-state { display: flex; align-items: center; gap: 12px; }
.platform-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric-card, .analytics-metric { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
.metric-card span, .metric-card small, .analytics-metric span, .analytics-metric small { display: block; }
.metric-card span, .analytics-metric span { color: var(--text-faint); font-size: 11.5px; }
.metric-card b, .analytics-metric b { display: block; margin: 6px 0 4px; font-size: 20px; }
.metric-card small, .analytics-metric small { color: var(--text-faint); font-size: 11px; line-height: 1.4; }
.platform-shell { overflow: visible; }
.platform-list { display: grid; gap: 8px; margin-top: 14px; }
.platform-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 34px; align-items: center; gap: 10px; min-height: 54px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: 9px; background: #0b0b0d; }
.platform-avatar { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 50%; color: var(--silver); background: #141416; }
.platform-avatar svg { width: 15px; height: 15px; }
.platform-copy b, .platform-copy span, .platform-health small { display: block; }
.platform-copy b { font-size: 13px; }
.platform-copy span, .platform-health small { margin-top: 3px; color: var(--text-faint); font-size: 10.5px; }
.platform-health { text-align: right; }
.setup-card { margin-top: 14px; }
.setup-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.setup-grid > div { padding: 10px; border: 1px solid var(--border-soft); border-radius: 9px; background: #0b0b0d; }
.setup-grid b, .setup-grid span { display: block; }
.setup-grid b { margin-bottom: 4px; font-size: 12px; }
.setup-grid span { color: var(--text-faint); font-size: 11px; line-height: 1.45; }
.setup-note { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(251,191,36,.28); border-radius: 9px; background: rgba(251,191,36,.05); }
.setup-note b { color: var(--yellow); font-size: 12px; }
.setup-note span { color: var(--text-dim); font-size: 12px; line-height: 1.5; }

.analytics-content { max-width: 1040px; }
.analytics-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.analytics-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.analytics-metric { min-height: 112px; }
.analytics-metric b { font-size: 24px; }
.analytics-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.analytics-section { min-height: 205px; }
.data-note { color: var(--text-faint); font-size: 11px; }
.activity-pairs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.activity-pairs > div { padding: 12px; border: 1px solid var(--border-soft); border-radius: 9px; background: #0b0b0d; }
.activity-pairs span, .activity-pairs b { display: block; }
.activity-pairs span { color: var(--text-faint); font-size: 11px; line-height: 1.35; }
.activity-pairs b { margin-top: 8px; font-size: 18px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.insight-list { display: grid; margin-top: 8px; }
.insight-list > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 37px; border-bottom: 1px solid var(--border-soft); }
.insight-list > div:last-child { border-bottom: 0; }
.insight-list span { color: var(--text-dim); font-size: 12px; }
.insight-list b { font-size: 13px; }
.export-action-area { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 14px; }
.export-action-area p { margin-top: 4px; color: var(--text-faint); font-size: 12px; }
.export-action-area > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.level-board-table { margin-top: 12px; border: 1px solid var(--border-soft); border-radius: 9px; overflow: hidden; }
.level-board-head, .level-board-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 90px 54px; align-items: center; gap: 10px; }
.level-board-head { min-height: 30px; padding: 6px 10px; background: #0b0b0d; color: var(--text-faint); font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.level-board-row { min-height: 46px; padding: 7px 10px; border-top: 1px solid var(--border-soft); font-size: 12px; }
.level-board-row > span:nth-child(n+3), .level-board-row > b:last-child { text-align: right; }
.level-board-row strong, .level-board-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.level-board-row strong { font-size: 12px; }
.level-board-row small { margin-top: 2px; color: var(--text-faint); font-size: 10px; }
.watcher-error { color: var(--red); background: var(--red-soft); border: 1px solid rgba(248,113,113,.2); border-radius: 10px; padding: 8px; font-size: 13px; margin-bottom: 9px; overflow-wrap: anywhere; }
.watcher-status dl { display: grid; gap: 6px; }
.watcher-status dl > div { display: flex; gap: 8px; justify-content: space-between; }
.watcher-status dt { color: var(--text-faint); font-size: 13px; }
.watcher-status dd { color: var(--text-dim); font-size: 13px; text-align: right; }

/* welcome card preview */
.wc-note {
  font-size: 12.5px; color: var(--text-faint); border: 1px dashed var(--border);
  border-radius: 9px; padding: 9px 12px; margin-bottom: 12px;
}
.wc-note b { color: var(--text-dim); }
.wc-card {
  position: relative; width: 100%; aspect-ratio: 1000 / 380;
  border-radius: 14px; overflow: hidden;
  display: block;
  border: 1px solid var(--border-soft);
}
.wc-avatar {
  position: absolute; left: var(--wc-avatar-x); top: 14.2%; transform: translateX(-50%);
  width: var(--wc-avatar-size); aspect-ratio: 1; border-radius: 50%; overflow: visible;
  background: #14141c;
}
.wc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.wc-bg-pencil { position: absolute; z-index: 4; right: 10px; top: 10px; }
.wc-title {
  position: absolute; left: 6%; right: 6%; top: 58%; text-align: center;
  color: var(--wc-text); font-weight: 700; line-height: 1.15;
  font-size: clamp(14px, 4.2cqw, 34px); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-sub {
  position: absolute; left: 8%; right: 8%; top: 77.5%; text-align: center;
  color: var(--wc-text); opacity: .82; line-height: 1.2;
  font-size: clamp(11px, 2.4cqw, 19px); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-card { container-type: inline-size; }

.preview-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr); gap: 16px; align-items: start; }
.preview-form { min-width: 0; }
.preview-panel { position: sticky; top: 70px; min-width: 0; }
.preview-panel .dp-msg { overflow: hidden; }

/* ---------- branding ---------- */
.branding-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(350px, .82fr); gap: 14px; align-items: start; }
.branding-preview-panel { position: sticky; top: 70px; }
.branding-preview {
  display: grid; grid-template-columns: 128px minmax(0, 1fr); min-height: 338px;
  overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #030303;
}
.bp-sidebar { display: flex; flex-direction: column; gap: 6px; padding: 12px 9px; background: var(--bg-panel); border-right: 1px solid var(--border-soft); }
.bp-brand { display: flex; align-items: center; gap: 7px; padding-bottom: 10px; }
.bp-brand img { width: 27px; height: 27px; border-radius: 9px; object-fit: cover; }
.bp-brand div { min-width: 0; }
.bp-brand b, .bp-brand span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-brand b { font-size: 10.5px; }
.bp-brand span { color: var(--text-faint); font-size: 8.5px; }
.bp-nav {
  display: flex; align-items: center; gap: 7px; border-radius: 9px; padding: 7px;
  color: var(--text-faint); font-size: 9.5px;
}
.bp-nav svg { width: 12px; height: 12px; }
.bp-nav.active {
  color: #fff; background: #161616; border-left: 2px solid var(--silver);
}
.bp-main { display: flex; flex-direction: column; min-width: 0; }
.bp-top { min-height: 34px; padding: 10px 13px; border-bottom: 1px solid var(--border-soft); color: var(--text-faint); font-size: 8.5px; font-weight: 650; text-transform: uppercase; }
.bp-content { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.bp-login-logo { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 12px; }
.bp-login-logo img { width: 100%; height: 100%; object-fit: cover; }
.bp-content h3 { font-size: 14px; margin-bottom: 5px; }
.bp-content p { color: var(--text-faint); font-size: 9.5px; line-height: 1.5; max-width: 220px; margin-bottom: 12px; }
.bp-content > button {
  background: #e4e5e8; color: #090909; border: 1px solid #f1f1f2;
  border-radius: 8px; padding: 7px 12px; font-size: 9px; font-weight: 750;
}
.bp-embed {
  width: min(230px, 100%); margin-top: 15px; padding: 9px 10px; text-align: left;
  background: #0a0a0a; border: 1px solid var(--border-soft); border-left: 3px solid var(--silver); border-radius: 8px;
}
.bp-embed b, .bp-embed span { display: block; }
.bp-embed b { font-size: 9px; margin-bottom: 2px; }
.bp-embed span { color: var(--text-faint); font-size: 8px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60; width: 268px;
    transform: translateX(-100%); background: #050505;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
  }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .content { padding: 22px 18px 130px; }
  .savebar { left: 14px; right: 14px; width: auto; transform: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
  .docs-list { max-height: 230px; }
  .doc-article { padding: 20px; }
  .doc-heading { flex-direction: column; gap: 6px; }
  .field-row, .obj-grid { grid-template-columns: 1fr; }
  .obj-grid .span2 { grid-column: span 1; }
  .emoji-pop { width: min(318px, calc(100vw - 24px)); }
  .topbar { padding: 12px 16px; }
  .filterbar, .filterbar.compact, .filterbar.log-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filterbar input:first-child { grid-column: 1 / -1; }
  .filterbar .btn { grid-column: 1 / -1; }
  .detail-modal { max-height: calc(100vh - 24px); }
  .editor-row { grid-template-columns: 1fr; }
  .preview-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .board-tools { flex-wrap: wrap; }
  .board-tools input { max-width: none; flex: 1 1 100%; }
  .branding-layout { grid-template-columns: 1fr; }
  .branding-preview-panel { position: static; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-workspace, .ticket-workspace, .analytics-grid { grid-template-columns: 1fr; }
  .ticket-preview-panel { position: static; }
  .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
  .filterbar, .filterbar.compact, .filterbar.log-filter { grid-template-columns: 1fr; }
  .filterbar input:first-child, .filterbar .btn { grid-column: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > div, .detail-grid > div:nth-child(odd) { border-right: 0; }
  .detail-modal > .m-row { flex-wrap: wrap; }
  .detail-modal > .m-row .btn { flex: 1 1 140px; }
  .topbar .crumb { display: none; }
  .branding-preview { grid-template-columns: 105px minmax(0, 1fr); }
  .gate { padding: 20px; }
  .gate-login { background-position: 53% center; }
  .gate-login-card { width: min(382px, 100%); padding: 38px 28px 34px; border-radius: 17px; }
  .gate-login-logo { width: 78px; margin-bottom: 20px; }
  .gate-login-card h1, .gate-denied-content h1 { font-size: 28px; }
  .gate-login-divider { margin: 24px 0; }
  .gate-denied-content { top: 0; width: min(520px, 100%); }
  .gate-denied-content p { margin-bottom: 27px; font-size: 14px; line-height: 1.6; }
  .gate-denied-action { min-height: 48px; }
  .gate-error-card { padding: 36px 26px 32px; }
  .unavailable-state { min-height: 250px; padding: 34px 18px; }
  .module-hero { flex-direction: column; align-items: stretch; gap: 12px; }
  .switch-label, .platform-state { justify-content: space-between; }
  .platform-summary-grid, .setup-grid, .analytics-metrics, .activity-pairs { grid-template-columns: 1fr; }
  .panel-list-head { display: none; }
  .panel-list-row { grid-template-columns: minmax(0, 1fr) 34px; gap: 8px; }
  .panel-list-row > .status, .panel-list-row > .muted { grid-column: 1; width: max-content; }
  .panel-list-row .panel-menu-wrap { grid-column: 2; grid-row: 1; }
  .platform-row { grid-template-columns: 34px minmax(0, 1fr) 34px; }
  .platform-health { grid-column: 2; text-align: left; }
  .platform-row > .icon-btn { grid-column: 3; grid-row: 1; }
  .live-discord-preview { padding: 10px; }
  .live-embed { margin-left: 0; }
  .live-message-head { margin-bottom: 12px; }
  .live-embed-fields { grid-template-columns: 1fr; }
  .export-action-area { align-items: flex-start; flex-direction: column; }
  .export-action-area > div:last-child { justify-content: flex-start; }
  .modal-scrim { align-items: flex-end; padding: 0; }
  .detail-modal { width: 100%; max-width: none; max-height: min(88vh, 760px); border-radius: 16px 16px 0 0; }
}

/* Phase 3F: plain welcome delivery and the persisted Counting workspace. */
.welcome-delivery-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 13px 12px;
  padding: 9px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #0b0b0d;
  color: var(--text-dim);
}
.welcome-delivery-note > svg { width: 14px; height: 14px; flex: 0 0 14px; color: #e4e4e7; }
.welcome-delivery-note b,
.welcome-delivery-note span { display: block; }
.welcome-delivery-note b { color: var(--text); font-size: 10px; }
.welcome-delivery-note span { margin-top: 2px; color: var(--text-faint); font-size: 9px; }
.welcome-warning { margin: 10px 13px 0; }
.welcome-plain-payload {
  min-width: 0;
  margin-left: 52px;
  transition: opacity .18s ease;
}
.welcome-plain-payload.is-disabled { opacity: .48; }
.welcome-plain-copy {
  position: relative;
  min-height: 24px;
  padding: 2px 34px 2px 0;
  color: #dbdee1;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.welcome-empty-copy { color: #949ba4; font-style: italic; }
.welcome-preview-disabled {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 9px 52px;
  color: #d6b46b;
  font-size: 10px;
}
.welcome-preview-disabled svg { width: 12px; height: 12px; }
.welcome-attachment { margin-top: 10px; }
.welcome-attachment + .welcome-plain-copy { margin-top: 9px; }
.welcome-no-attachment { margin-top: 9px; }
#welcome-inline-preview .welcome-plain-payload { margin-left: 30px; }
#welcome-inline-preview .welcome-preview-disabled { margin-left: 30px; }

.counting-hero { margin-bottom: 12px; }
.counting-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.counting-stat {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(145deg, #0d0d0f, #09090b);
}
.counting-stat span { display: block; color: var(--text-faint); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.counting-stat strong { display: block; overflow: hidden; margin-top: 7px; color: var(--text); font-size: 19px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.counting-stat:last-child strong { font-size: 13px; line-height: 1.5; }
.counting-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  gap: 12px;
  align-items: start;
}
.counting-workspace .section { margin: 0; }
#counting-fields { margin-top: 12px; }
.counting-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.counting-config-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 15px;
}
.counting-config-summary > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #0b0b0d;
}
.counting-config-summary span,
.counting-config-summary b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.counting-config-summary span { color: var(--text-faint); font-size: 9px; }
.counting-config-summary b { margin-top: 4px; color: var(--text); font-size: 10.5px; }
.counting-muted-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.counting-muted-head h3 { margin: 0; font-size: 11px; }
.counting-muted-head span { color: var(--text-faint); font-size: 9px; }
.counting-muted-list { margin-top: 9px; border: 1px solid var(--border-soft); border-radius: 7px; overflow: hidden; }
.counting-muted-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; background: #0b0b0d; }
.counting-muted-list > div + div { border-top: 1px solid var(--border-soft); }
.counting-muted-list span,
.counting-muted-list b,
.counting-muted-list small { display: block; min-width: 0; }
.counting-muted-list b { color: var(--text); font-size: 10px; }
.counting-muted-list small { margin-top: 2px; color: var(--text-faint); font-size: 8.5px; }
.counting-muted-list time { flex: 0 0 auto; color: var(--text-dim); font-size: 9px; }
.counting-runtime-section .reference-empty.compact { min-height: 130px; margin-top: 9px; }

@media (max-width: 820px) {
  .counting-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .counting-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counting-config-summary { grid-template-columns: 1fr; }
  .welcome-plain-payload,
  #welcome-inline-preview .welcome-plain-payload,
  .welcome-preview-disabled,
  #welcome-inline-preview .welcome-preview-disabled { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   Phase 2C — reference-matched density, structure, and component geometry
   ========================================================================== */
.main { background: #000; }
@media (min-width: 901px) { .main { scrollbar-gutter: stable; } }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { border: 1px solid var(--bg); }
.sidebar { width: 146px; padding: 4px 5px 7px; background: #030303; }
.brand { min-height: 27px; gap: 3px; padding: 0 2px 5px; }
.brand img, .brand .brand-fallback { width: 17px; height: 17px; border-radius: 50%; }
.brand b { font-size: 9.5px; }
.brand small { display: none; }
.search { height: 24px; gap: 5px; margin-bottom: 4px; padding: 2px 5px; border-radius: 5px; }
.search svg { width: 10px; height: 10px; }
.search input { font-size: 9px; }
.search kbd { padding: 2px 4px; border-radius: 4px; font-size: 7.5px; }
.nav-section { margin: 14px 0 2px; padding: 0 5px; font-size: 7.5px; }
.nav-item { min-height: 22px; gap: 7px; padding: 3px 6px; border-radius: 4px; font-size: 9px; }
.nav-item svg { width: 12px; height: 12px; }
.nav-item.active::before { top: 5px; bottom: 5px; width: 2px; }
.profile-wrap { margin-top: 5px; padding-top: 5px; }
.user-card { min-height: 32px; gap: 6px; padding: 3px 5px; border-radius: 6px; }
.user-card img { width: 20px; height: 20px; flex-basis: 20px; }
.user-card .u-name { font-size: 9.5px; }
.profile-menu { border-radius: 7px; }
.pm-item { min-height: 34px; border-radius: 5px; font-size: 1rem; }

.topbar { min-height: 50px; justify-content: center; padding: 10px 22px; gap: 9px; font-size: 12.5px; }
.topbar .crumb::after { margin-left: 8px; }
.content, .content.overview-content, .content.unavailable-content, .analytics-content {
  width: 100%; max-width: 800px; padding: 17px 32px 100px;
}
.page-title { font-size: 14px; margin-bottom: 0; }
.page-sub { font-size: 10px; margin: 2px 0 14px; }
.mod-head { gap: 10px; margin-bottom: 2px; }
.mod-head h1 { font-size: 11px; }
.module-hero { margin-bottom: 14px; }
.compact-module-hero h1 { margin: 0 0 3px; font-size: 11px; }
.compact-module-hero p { max-width: 600px; font-size: 10.5px; line-height: 1.45; }
.eyebrow { display: none; }

.content input:not([type="checkbox"]):not([type="color"]),
.content select,
.detail-modal input:not([type="checkbox"]):not([type="color"]),
.detail-modal select {
  min-height: 24px; padding: 3px 7px; border-radius: 4px; font-size: 9.5px; line-height: 1.35;
}
.content textarea, .detail-modal textarea {
  min-height: 48px; padding: 5px 7px; border-radius: 4px; font-size: 9.5px; line-height: 1.4;
}
.content input[type="color"], .detail-modal input[type="color"] { height: 24px; padding: 2px; border-radius: 4px; }
.field { margin-bottom: 9px; }
.field > label { margin-bottom: 3px; font-size: 9.5px; line-height: 1.35; }
.field .help { margin-top: 3px; font-size: 8.5px; line-height: 1.35; }
.field-row { gap: 8px; }
.switch { width: 24px; height: 14px; }
.switch .track { border-radius: 14px; }
.switch .track::after { width: 10px; height: 10px; top: 1px; left: 1px; }
.switch input:checked + .track { box-shadow: none; }
.switch input:checked + .track::after { transform: translateX(10px); }
.section { margin-top: 8px; padding: 13px 14px; border-color: #1c1c1c; border-radius: 6px; background: #030303; }
.section > h2 { font-size: 10px; }
.section > .hint { padding-bottom: 9px; font-size: 9.5px; }
.section > [data-sec] { padding-top: 10px; }
.toggle-field { border-radius: 6px; padding: 10px 11px; }
.btn { border-radius: 5px; }
.btn-sm { min-height: 24px; padding: 4px 9px; font-size: 10px; }

.overview-content .tabs { margin-top: 19px; }
.overview-content > .tabs { gap: 4px; flex-wrap: wrap; overflow: visible; }
.overview-content > .tabs > .tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
}
.overview-content .tabs + .group-title { margin-top: 28px; }
.overview-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.overview-status-note { display: inline-flex; align-items: center; gap: 5px; color: var(--text-faint); font-size: 8.5px; line-height: 1; }
.overview-status-note::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.tabs { margin-bottom: 15px; }
.tab { padding: 5px 10px 7px; font-size: 10px; }
.tab.active::after { left: 9px; right: 9px; height: 1px; box-shadow: none; }
.group-title { margin: 16px 0 8px; font-size: 10.5px; }
.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.card { height: 124px; min-height: 124px; gap: 6px; padding: 12px; border-color: #1b1b1b; border-radius: 6px; background: #090909; }
.card h3 { font-size: 11px; }
.card p { font-size: 9.5px; line-height: 1.4; }
.card-icon svg { width: 14px; height: 14px; }
.card-go { display: none; }
.badge {
  min-height: 16px; gap: 5px; padding: 1px 0; border-radius: 0;
  background: none !important; color: var(--text-dim) !important;
  font-size: 9.5px; letter-spacing: .02em;
}
.badge::before { display: inline-block; width: 5px; height: 5px; }
.badge.on { width: max-content; min-height: 18px; padding: 2px 6px; border: 1px solid #27272a; border-radius: 4px; background: #171719 !important; color: #d5d5d8 !important; }
.badge.on::before { content: "✓"; width: auto; height: auto; background: none; color: #d5d5d8; font-size: 8px; line-height: 1; }
.status {
  min-height: 16px; gap: 5px; padding: 1px 0; border-radius: 0;
  background: none !important; font-size: 9.5px; letter-spacing: .02em;
}
.status::before { width: 5px; height: 5px; }
.pill { min-height: 16px; padding: 1px 0; border-radius: 0; background: none !important; font-size: 9.5px; }

.setup-notice {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 9px; align-items: start;
  margin: 8px 0 10px; padding: 9px 10px; border: 1px solid rgba(194, 150, 64, .28);
  border-radius: 6px; background: rgba(194, 150, 64, .045);
}
.setup-notice > div:first-child { display: grid; place-items: center; color: #d7b76d; }
.setup-notice svg { width: 13px; height: 13px; }
.setup-notice b, .setup-notice span { display: block; }
.setup-notice b { color: #dec27f; font-size: 10.5px; }
.setup-notice span { margin-top: 2px; color: var(--text-dim); font-size: 9.5px; line-height: 1.45; }
.setup-notice.compact { margin: 8px 0; padding: 8px 10px; }
.setup-notice.neutral { border-color: var(--border); background: #0b0b0d; }
.setup-notice.neutral > div:first-child, .setup-notice.neutral b { color: var(--text-dim); }

.module-workspace, .preview-layout { grid-template-columns: minmax(0, .92fr) minmax(480px, 1.08fr); gap: 18px; }
.preview-panel { top: 48px; }
.preview-panel-head { gap: 10px; margin-bottom: 10px; }
.preview-panel-head h2 { font-size: 13px; }
.live-badge { min-height: 18px; padding: 2px 6px; border-radius: 5px; font-size: 9.5px; }
.live-discord-preview, .welcome-discord-message, .poll-discord-message {
  min-width: 0; padding: 12px; border: 1px solid #26272b; border-radius: 5px; background: #313338;
}
.live-message-head { gap: 8px; margin-bottom: 8px; }
.live-message-head > img { width: 36px; height: 36px; border: 0; }
.live-message-head b { font-size: 15px; }
.live-message-head span { font-size: 10px; }
.live-message-head small { font-size: 11.5px; color: #949ba4; }
.live-message-content { margin: -2px 0 9px 52px; font-size: 14px; }
.live-embed {
  margin-left: 52px; padding: 14px 15px 12px 16px; border: 0; border-left: 4px solid var(--embed-color);
  border-radius: 4px; background: #2b2d31;
}
.live-embed h3 { font-size: 15px; }
.live-embed p { color: #dbdee1; font-size: 13.5px; }
.live-embed-author { font-size: 11.5px; }
.live-embed-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.live-embed-fields > div:not(.is-inline) { grid-column: 1 / -1; }
.live-embed-fields > div > b { font-size: 12px; }
.live-embed-fields > div > span { font-size: 11.5px; }
.live-embed-footer, .live-embed-ping, .live-embed-timestamp { color: #949ba4; font-size: 10px; }
.live-embed-timestamp { margin-top: 7px; }
.live-components { margin: 7px 0 0 52px; }
.live-components button { padding: 5px 11px; border-radius: 4px; background: #248046; color: white; font-size: 11px; font-weight: 650; }
.live-delivery {
  margin: 8px 0 0 52px; padding: 7px 9px; border-top: 1px solid #242428;
  color: #949ba4; font-size: 10px;
}
.preview-pencil {
  width: 16px; height: 16px; border-width: 1px; box-shadow: 0 2px 7px rgba(36, 136, 255, .24);
}
.preview-pencil svg { width: 7px; height: 7px; }
.preview-pencil:hover { transform: scale(1.06); box-shadow: 0 4px 11px rgba(36, 136, 255, .38); }
.preview-editable > .preview-pencil { right: 3px; top: 0; }
.live-embed > .preview-pencil:first-child { left: -12px; top: 8px; }
.preview-part-description > .preview-pencil { top: 3px; }
.preview-part-fields > .preview-pencil { top: 6px; }
.preview-part-footer > .preview-pencil, .preview-part-ping > .preview-pencil { top: 50%; transform: translateY(-50%); }
.preview-part-delivery > .preview-pencil { top: 50%; transform: translateY(-50%); }

.dp-embed { position: relative; }
.dp-color-pencil { position: absolute; z-index: 4; left: -12px; top: 8px; }
.dp-copy-block, .dp-links-block, .dp-thumb-wrap, .dp-banner-wrap { position: relative; }
.dp-thumb-wrap { flex: 0 0 auto; }
.dp-thumb-wrap .preview-image-slot { width: 74px; height: 74px; }
.dp-banner-wrap .preview-banner-slot { margin-top: 10px; }
.dp-banner-wrap > .preview-pencil { top: 12px; }
.dp-footer > .preview-pencil { top: 50%; transform: translateY(-50%); }

.welcome-discord-embed {
  position: relative; margin-left: 52px; padding: 14px 15px 12px 16px;
  border-left: 4px solid var(--embed-color); border-radius: 4px; background: #2b2d31;
}
.welcome-discord-copy { max-width: calc(100% - 72px); color: #dbdee1; font-size: 14px; line-height: 1.5; }
.welcome-member-thumb { position: absolute; top: 14px; right: 14px; width: 58px; height: 58px; border-radius: 9px; object-fit: cover; }
.welcome-card-slot { margin-top: 13px; }
.welcome-card-slot .wc-note { margin-bottom: 7px; background: #242529; }
.welcome-card-slot .wc-card { border: 0; border-radius: 5px; }
.welcome-fallback-banner { display: block; width: 100%; max-height: 230px; border-radius: 5px; object-fit: cover; }
.welcome-reference-section { margin-top: 0; padding: 0; overflow: hidden; }
.welcome-reference-head { min-height: 49px; padding: 10px 13px; border-bottom: 1px solid var(--border-soft); }
.welcome-reference-head .hint { margin-top: 2px; color: var(--text-faint); font-size: 9px; }
#welcome-message-fields { padding: 11px 13px 0; }
.welcome-format-row {
  display: flex; align-items: center; gap: 8px; margin: 0 13px 8px; color: var(--text-dim);
}
.welcome-format-row b, .welcome-format-row span { display: block; }
.welcome-format-row b { font-size: 9.5px; }
.welcome-format-row span { margin-top: 1px; color: var(--text-faint); font-size: 8.5px; }
#welcome-inline-preview { max-width: 390px; margin: 0 13px 13px; }
#welcome-inline-preview .welcome-discord-message { padding: 0; border: 0; background: transparent; }
#welcome-inline-preview .welcome-discord-embed { margin-left: 30px; }
.welcome-card-settings { margin-top: 10px; }
.welcome-actions { margin-top: 10px; }
.welcome-rail-pencil { position: absolute; z-index: 5; left: -12px; top: 10px; }
.wc-bg-pencil { top: 10px; right: 10px; }
/* Text pencils sit inline right after the text they edit — never floating over it */
.wc-title > .preview-pencil, .wc-sub > .preview-pencil,
.preview-part-message > .preview-pencil {
  position: static; display: inline-grid; margin-left: 9px; vertical-align: middle; transform: none;
}
.wc-avatar > .preview-pencil { right: -6px; top: auto; bottom: -4px; }
/* Pencils stay visible so every editable region is immediately discoverable. */
.editable-preview-panel .preview-pencil { opacity: 1; }
.editable-preview-panel:hover .preview-pencil,
.preview-pencil:focus-visible { opacity: 1; }
.wc-card { border-radius: 10px; }

.poll-workspace { grid-template-columns: 1fr; }
.poll-workspace > .preview-panel { grid-row: 1; position: static; }
.poll-workspace > .composer-column { grid-row: 2; }
.poll-discord-message { min-height: 424px; background: #29292d; }
.poll-message-head { display: flex; align-items: center; gap: 13px; margin-bottom: 8px; }
.poll-message-head > img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.poll-message-head b { font-size: 13px; }
.poll-message-head span { padding: 1px 4px; border-radius: 3px; background: #5865f2; color: white; font-size: 10px; font-weight: 800; }
.poll-message-head small { color: #949ba4; font-size: 11.5px; }
.poll-embed { position: relative; width: min(100%, 453px); margin: -28px 0 0 56px; padding: 15px 16px; border-left: 4px solid var(--embed-color); border-radius: 4px; background: #242429; color: #dbdee1; }
.poll-copy { padding-right: 64px; }
.poll-title { color: #f2f3f5; font-size: 16px; font-weight: 750; }
.poll-question { margin-top: 9px; font-size: 14px; line-height: 1.5; }
.poll-options { display: grid; gap: 7px; margin: 15px 0 12px; }
.poll-options > div { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.poll-option-mark { width: 17px; height: 17px; border-radius: 50%; object-fit: cover; }
.poll-logo { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.poll-banner { margin-top: 12px; }
.poll-banner img { display: block; width: 100%; aspect-ratio: 3 / 1; border-radius: 4px; object-fit: cover; }
.poll-footer { display: flex; align-items: center; gap: 5px; margin-top: 10px; padding-right: 20px; color: #dbdee1; font-size: 10px; }
.poll-footer span { color: #949ba4; }
.poll-footer > .preview-pencil { top: 50%; transform: translateY(-50%); }
.poll-footer > img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.poll-reactions { display: flex; gap: 5px; margin: 7px 0 0 56px; }
.poll-reactions span { display: flex; align-items: center; gap: 5px; min-width: 55px; min-height: 31px; padding: 3px 7px; border-radius: 6px; background: #36363b; color: #dbdee1; font-size: 10px; font-weight: 700; }
.poll-reactions img { width: 11px; height: 11px; border-radius: 50%; }
.poll-rail-pencil { position: absolute; z-index: 5; left: -12px; top: 10px; }
.poll-history { margin-top: 12px; }

.reference-accordion-stack { display: grid; gap: 7px; }
.reference-accordion { overflow: hidden; border: 1px solid #202024; border-radius: 6px; background: var(--bg-card); }
.reference-accordion > summary, .ticket-commands > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px;
  padding: 7px 13px; list-style: none; cursor: pointer;
}
.reference-accordion > summary::-webkit-details-marker, .ticket-commands > summary::-webkit-details-marker { display: none; }
.reference-accordion > summary span, .reference-accordion > summary b, .reference-accordion > summary small,
.ticket-commands > summary span, .ticket-commands > summary b, .ticket-commands > summary small { display: block; }
.reference-accordion > summary b, .ticket-commands > summary b { font-size: 9.5px; line-height: 1.2; }
.reference-accordion > summary small, .ticket-commands > summary small { margin-top: 2px; color: var(--text-faint); font-size: 8.5px; line-height: 1.2; }
.reference-accordion > summary svg, .ticket-commands > summary svg { width: 12px; height: 12px; transition: transform .16s; }
.reference-accordion[open] > summary svg, .ticket-commands[open] > summary svg { transform: rotate(90deg); }
.accordion-body { padding: 10px 13px; border-top: 1px solid var(--border-soft); }
.nuke-rule-group { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.nuke-rule-group:last-child { border-bottom: 0; }
.nuke-rule-group h3 { margin-bottom: 8px; font-size: 12px; }
.reference-unavailable { color: var(--text-faint); font-size: 11px; }

.segmented-tabs { display: inline-flex; margin: 1px 0 8px; padding: 2px; border-radius: 5px; background: #111113; }
.segmented-tabs button { min-height: 24px; padding: 4px 9px; border-radius: 4px; color: var(--text-faint); font-size: 9px; }
.segmented-tabs button.active { background: #202024; color: white; }
.reference-role-panel { margin-top: 0; }
.reference-role-panel .btn:disabled { opacity: .7; background: #e7e7e9; color: #111; cursor: not-allowed; }
.role-panel-actions { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 10.5px; }
.reference-empty { display: flex; min-height: 117px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--text-faint); text-align: center; }
.reference-empty svg { width: 18px; height: 18px; }
.reference-empty b { color: var(--text); font-size: 12px; }
.reference-empty span { max-width: 310px; font-size: 10.5px; }
.reference-empty.compact { min-height: 72px; }
.unsupported-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0 0; border-top: 1px solid var(--border-soft); }
.nuke-master-row { margin-bottom: 10px; padding-top: 0; border-top: 0; }
.unsupported-toggle > div > b,
.unsupported-toggle > div > span { display: block; }
.unsupported-toggle b { font-size: 9.5px; line-height: 1.3; }
.unsupported-toggle > div > span { margin-top: 2px; color: var(--text-faint); font-size: 8.5px; line-height: 1.3; }
.reference-command-note { display: flex; gap: 9px; margin-top: 8px; padding: 10px 13px; border: 1px solid var(--border-soft); border-radius: 6px; color: var(--text-faint); font-size: 10.5px; }
.reference-command-note b { color: var(--text); white-space: nowrap; }

.panel-list-section { margin-top: 0; padding: 0; scroll-margin-top: 46px; }
.section-toolbar h2 { font-size: 10px; line-height: 1.35; font-weight: 680; }
.panel-list-section .section-toolbar { align-items: center; min-height: 43px; padding: 8px 13px; }
.panel-list-actions { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 9px; }
.panel-list-head, .panel-list-row { grid-template-columns: minmax(220px, 1.3fr) .55fr .8fr 32px; gap: 12px; }
.panel-list-head { padding: 3px 16px; font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; }
.panel-list-row { min-height: 42px; padding: 4px 16px; }
.panel-list-section + .ticket-commands { margin-top: 17px; }
.panel-identity b { font-size: 10px; }
.panel-state-inline { display: inline-flex; align-items: center; gap: 5px; color: var(--text-faint); font-size: 10.5px; }
.panel-state-inline.is-live { color: #9fcfaf; }
.panel-list-row > .panel-state-inline {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}
.panel-list-row > .panel-state-inline::before { content: none; }
.staff-preview-message-empty { min-height: 24px; }
.ticket-commands { padding: 0; }
.ticket-command-list { border-top: 1px solid var(--border-soft); padding: 5px 12px 9px; }
.ticket-command-row { display: flex; align-items: center; justify-content: space-between; min-height: 47px; padding: 7px 8px; border-bottom: 1px solid var(--border-soft); background: #0b0b0d; }
.ticket-command-row:last-child { border-bottom: 0; }
.ticket-command-row b, .ticket-command-row span { display: block; }
.ticket-command-row b { font-size: 10px; }
.ticket-command-row span { margin-top: 2px; color: var(--text-faint); font-size: 10px; }
.ticket-command-row .ticket-control-kind {
  display: inline-flex; align-items: center; min-height: 20px; margin: 0; padding: 2px 6px;
  border: 1px solid #29292d; border-radius: 4px; color: var(--text-dim); font-size: 9px; white-space: nowrap;
}
.readonly-value {
  min-height: 27px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px;
  background: #070709; color: var(--text-dim); font-size: 10px; overflow-wrap: anywhere;
}
.ticket-editor-shell { margin-top: 10px; scroll-margin-top: 46px; }
.content.ticket-editor-content { max-width: 1220px; }
.content.ticket-editor-content .ticket-workspace { grid-template-columns: minmax(0, 1.05fr) minmax(480px, .95fr); }
.ticket-editor-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: #09090b; }
.ticket-editor-head h2 { font-size: 13px; }
.ticket-editor-head p { color: var(--text-faint); font-size: 10.5px; }
.ticket-workspace { margin-top: 8px; grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr); }
.ticket-preview-panel { top: 48px; }

.platform-hero { align-items: center; }
.platform-shell { margin-top: 0; padding: 0; overflow: hidden; }
.platform-shell .section-toolbar { align-items: center; min-height: 46px; padding: 9px 14px; border-bottom: 1px solid var(--border-soft); }
.platform-shell .section-toolbar .hint { margin-top: 2px; color: var(--text-faint); font-size: 9px; }
.platform-shell > .setup-notice { margin: 10px 14px 7px; }
.platform-search { width: calc(100% - 28px); height: 24px; min-height: 24px; margin: 14px 14px 7px; padding: 3px 7px; font-size: 9.5px; }
.platform-list { gap: 0; margin: 0 14px 14px; border: 1px solid var(--border-soft); border-radius: 5px; overflow: hidden; }
.platform-row { display: block; min-height: 0; padding: 0; border-radius: 5px; background: #0b0b0d; }
.platform-row + .platform-row { border-top: 1px solid var(--border-soft); }
.platform-row > summary { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 18px; align-items: center; gap: 8px; min-height: 38px; padding: 4px 8px; list-style: none; cursor: pointer; }
.platform-row > summary::-webkit-details-marker { display: none; }
.platform-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.platform-copy b, .platform-copy small { display: block; }
.platform-copy b { font-size: 11.5px; }
.platform-copy small { margin-top: 1px; color: var(--text-faint); font-size: 9.5px; }
.platform-state-inline { color: #9fcfaf; font-size: 10px; }
.platform-state-inline.has-error { color: #e1a0a0; }
.platform-chevron svg { width: 11px; height: 11px; transition: transform .16s; }
.platform-row[open] .platform-chevron svg { transform: rotate(90deg); }
.platform-row-detail { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; padding: 8px 9px; border-top: 1px solid var(--border-soft); }
.platform-row-detail span, .platform-row-detail b { display: block; }
.platform-row-detail span { color: var(--text-faint); font-size: 9.5px; }
.platform-row-detail b { margin-top: 2px; font-size: 10.5px; }
.platform-row-actions { display: flex; gap: 5px; }
.platform-compact-empty { display: flex; min-height: 42px; margin: 0 14px 14px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--border-soft); border-radius: 5px; color: var(--text-faint); text-align: center; }
.platform-compact-empty b { color: var(--text); font-size: 11px; }
.platform-compact-empty span { margin-top: 2px; font-size: 10px; }

.analytics-hero { margin-bottom: 11px; }
.analytics-toolbar { display: flex; justify-content: flex-end; gap: 7px; margin-bottom: 10px; }
.range-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.range-tabs button { min-width: 32px; padding: 5px 7px; border-right: 1px solid var(--border); color: var(--text-faint); font-size: 10px; }
.range-tabs button:last-child { border-right: 0; }
.range-tabs button.active { background: #202024; color: white; }
.export-menu { position: relative; }
.export-menu > summary { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; list-style: none; color: var(--text-dim); font-size: 10px; cursor: pointer; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu > summary svg { width: 11px; height: 11px; }
.export-menu > div { position: absolute; z-index: 30; right: 0; top: calc(100% + 5px); width: 130px; padding: 4px; border: 1px solid var(--border); border-radius: 5px; background: #0d0d0f; box-shadow: var(--shadow-md); }
.export-menu a { display: block; padding: 5px 7px; border-radius: 4px; color: var(--text-dim); font-size: 10.5px; text-decoration: none; }
.export-menu a:hover { background: var(--bg-hover); color: white; }
.reference-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.analytics-metric { min-height: 156px; padding: 12px; border-radius: 6px; }
.analytics-metric { background: #090909; border-color: #1b1b1b; }
.analytics-metric span { font-size: 11px; }
.analytics-metric b { margin: 4px 0 0; font-size: 18px; }
.metric-plot { position: relative; display: flex; align-items: flex-end; min-height: 76px; margin-top: 10px; border-bottom: 1px solid #6d6f75; }
.metric-plot span { width: 100%; padding-bottom: 8px; color: var(--text-faint); font-size: 9px; text-align: center; }
.metric-plot.has-current { background: linear-gradient(180deg, transparent 35%, rgba(214,216,223,.06)); }
.analytics-reference-section { min-height: 0; margin-top: 10px; padding: 0; }
.analytics-reference-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 13px; border-bottom: 1px solid var(--border-soft); }
.analytics-reference-head h2 { font-size: 12px; }
.analytics-reference-head p { margin-top: 2px; color: var(--text-faint); font-size: 10px; }
.server-stat-rows { padding: 7px 13px; }
.server-stat-rows > div { display: flex; justify-content: space-between; gap: 12px; min-height: 32px; align-items: center; }
.server-stat-rows span, .server-stat-rows small { display: block; }
.server-stat-rows span { font-size: 10.5px; }
.server-stat-rows small { color: var(--text-faint); font-size: 9px; }
.server-stat-rows b { font-size: 10.5px; }
.analytics-inline-note { padding: 0 13px 10px; color: var(--text-faint); font-size: 9.5px; }
.analytics-reference-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 72px; padding: 10px 13px 12px; }
.analytics-reference-foot span { max-width: 570px; color: var(--text-faint); font-size: 9.5px; }
.analytics-reference-foot .btn:disabled { opacity: .58; cursor: not-allowed; }
.join-summary { display: flex; gap: 10px; }
.join-summary span { color: var(--text-faint); font-size: 9px; text-transform: uppercase; }
.join-summary b { display: block; margin-top: 2px; color: var(--text); font-size: 11px; text-align: right; }
.analytics-event-list { min-height: 128px; padding: 5px 13px 10px; }
.analytics-event-list > div { display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 26px; border-bottom: 1px solid var(--border-soft); }
.analytics-event-list span, .analytics-event-list time { color: var(--text-faint); font-size: 9.5px; }
.analytics-event-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.analytics-empty-plot { display: grid; place-items: center; min-height: 128px; color: var(--text-faint); font-size: 10px; }
.member-flow-chart-wrap { min-height: 128px; padding: 4px 13px 10px; }
.member-flow-chart-wrap canvas { display: block; width: 100%; height: 128px; }
.analytics-secondary { margin-top: 10px; }

.integration-list { display: grid; border: 1px solid var(--border-soft); border-radius: 6px; overflow: hidden; }
.integration-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 45px; padding: 8px 10px; border-bottom: 1px solid var(--border-soft); }
.integration-row:last-child { border-bottom: 0; }
.integration-row b, .integration-row span { display: block; }
.integration-row b { font-size: 12px; }
.integration-row span { margin-top: 1px; color: var(--text-faint); font-size: 10px; }
.integration-row small { display: flex; align-items: center; gap: 5px; color: var(--text-faint); font-size: 10px; }
.integration-row small::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.integration-row.is-ready small { color: #9fcfaf; }
.integration-row.needs-setup small { color: #d8b86f; }

@media (max-width: 900px) {
  .sidebar { width: 268px; padding: 12px 9px 9px; }
  .brand { min-height: 42px; padding: 0 7px 10px; }
  .brand img, .brand .brand-fallback { width: 30px; height: 30px; border-radius: 9px; }
  .brand b { font-size: 13px; }
  .search { height: auto; padding: 6px 9px; }
  .search input { font-size: 12px; }
  .nav-item { min-height: 31px; padding: 6px 9px; font-size: 13px; }
  .nav-item svg { width: 15px; height: 15px; }
  .content, .content.overview-content, .content.unavailable-content, .analytics-content { max-width: none; padding: 22px 18px 120px; }
  .module-workspace, .preview-layout, .poll-workspace, .ticket-workspace,
  .content.ticket-editor-content .ticket-workspace { grid-template-columns: 1fr; }
  .platform-row-detail { grid-template-columns: 1fr; }
  .analytics-metrics.reference-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { position: sticky; justify-content: center; }
  .menu-btn { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }
}

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .analytics-metrics.reference-metrics { grid-template-columns: 1fr; }
  .analytics-toolbar, .analytics-reference-head, .ticket-editor-head { align-items: flex-start; flex-direction: column; }
  .join-summary { width: 100%; justify-content: space-between; }
  .poll-discord-message, .welcome-discord-message, .live-discord-preview { padding: 9px; }
  .poll-embed, .welcome-discord-embed, .live-embed { margin-left: 0; }
  .poll-reactions, .live-components { margin-left: 0; }
  .live-embed-fields { grid-template-columns: 1fr; }
  .live-embed-fields > div { grid-column: 1; }
  .panel-list-row { grid-template-columns: minmax(0, 1fr) 32px; gap: 8px; }
  .panel-list-row .panel-identity { grid-column: 1; grid-row: 1; }
  .panel-list-row .panel-state-inline { grid-column: 1; grid-row: 2; width: max-content; }
  .panel-list-row > .muted { grid-column: 1; grid-row: 3; width: max-content; }
  .panel-list-row .panel-menu-wrap { grid-column: 2; grid-row: 1; }
}

/* ==========================================================================
   UI + branding quality pass — readable density and large-display scaling
   ========================================================================== */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  vertical-align: middle;
}
.switch input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch .track {
  position: absolute;
  inset: 0;
  border: 1px solid #303035;
  border-radius: 999px;
  background: #111113;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .7);
  transition: background .2s var(--ease), border-color .2s, box-shadow .2s;
}
.switch .track::after {
  width: 16px;
  height: 16px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #55575d;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .62);
  transition: transform .22s var(--ease), background .2s;
}
.switch input:checked + .track {
  border-color: #68686f;
  background: #050506;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
}
.switch input:checked + .track::after {
  transform: translateX(16px);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}
.switch input:focus-visible + .track { outline: 2px solid #f1f1f3; outline-offset: 3px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .track { opacity: .62; }
.switch-label {
  min-height: 32px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: 11.5px;
}
.ticket-hero .switch-label { align-self: center; }
.toggle-field, .unsupported-toggle, .welcome-format-row { align-items: center; }

.content { max-width: 1480px; padding: 32px 42px 140px; }
.content.overview-content, .content.unavailable-content { max-width: 1320px; }
.analytics-content { max-width: 1440px; }
.page-title { font-size: 20px; }
.page-sub { font-size: 13px; line-height: 1.55; }
.mod-head h1, .compact-module-hero h1 { font-size: 20px; }
.compact-module-hero p { font-size: 13.5px; }
.section { padding: 20px 22px; border-radius: 10px; }
.section > h2, .section-toolbar h2 { font-size: 14px; }
.section > .hint, .section-toolbar .hint { font-size: 12px; line-height: 1.5; }
.content input:not([type="checkbox"]):not([type="color"]),
.content select,
.detail-modal input:not([type="checkbox"]):not([type="color"]),
.detail-modal select {
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13.5px;
}
.content textarea, .detail-modal textarea {
  min-height: 94px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
}
.content input[type="color"], .detail-modal input[type="color"] { height: 42px; border-radius: 9px; }
.field { margin-bottom: 16px; }
.field > label { margin-bottom: 7px; font-size: 13px; }
.field .help { margin-top: 6px; font-size: 11px; line-height: 1.5; }
.btn { border-radius: 7px; }
.btn-sm { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.card { min-height: 154px; height: 154px; padding: 17px; border-radius: 10px; }
.card h3 { font-size: 14px; }
.card p { font-size: 12px; }
.status, .pill, .badge, .availability-pill, .panel-state-inline {
  min-height: 20px;
  width: max-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #29292d;
  border-radius: 6px;
  background: #121214 !important;
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
}
.status::before, .pill::before, .badge::before, .panel-state-inline::before { width: 4px; height: 4px; }
.badge.on {
  min-height: 20px;
  padding: 3px 7px;
  border-color: #303034;
  border-radius: 6px;
  background: #171719 !important;
}
.integration-row small { white-space: nowrap; }
.preview-panel-head h2 { font-size: 14px; }
.live-badge { min-height: 22px; padding: 3px 8px; border-radius: 6px; font-size: 10px; }
.reference-accordion, .integration-list, .platform-list, .panel-list-section, .ticket-commands { border-radius: 8px; }
.reference-accordion > summary b, .ticket-commands > summary b { font-size: 11px; }
.reference-accordion > summary small, .ticket-commands > summary small { font-size: 9.5px; }
.ticket-command-row b { font-size: 11px; }
.ticket-command-row span { font-size: 10px; }
.ticket-command-row .switch { margin-left: 18px; }
.ticket-command-note { margin: 0; padding: 4px 20px 14px; color: var(--text-faint); font-size: 9.5px; line-height: 1.5; }

@media (min-width: 1600px) {
  body { font-size: 15px; }
  .sidebar { width: 230px; padding: 12px 10px 10px; }
  .brand { min-height: 42px; gap: 9px; padding: 0 7px 10px; }
  .brand img, .brand .brand-fallback { width: 30px; height: 30px; border-radius: 9px; }
  .brand b { font-size: 14px; }
  .search { height: 36px; gap: 8px; margin-bottom: 8px; padding: 6px 9px; border-radius: 8px; }
  .search svg { width: 14px; height: 14px; }
  .search input { font-size: 12px; }
  .search kbd { padding: 3px 6px; border-radius: 6px; font-size: 9px; }
  .nav-section { margin: 16px 0 4px; padding: 0 8px; font-size: 9.5px; }
  .nav-item { min-height: 34px; gap: 10px; padding: 7px 9px; border-radius: 7px; font-size: 12.5px; }
  .nav-item svg { width: 16px; height: 16px; }
  .profile-wrap { margin-top: 8px; padding-top: 8px; }
  .user-card { min-height: 46px; gap: 10px; padding: 7px 8px; border-radius: 9px; }
  .user-card img { width: 32px; height: 32px; flex-basis: 32px; }
  .user-card .u-name { font-size: 12.5px; }
  .profile-menu { border-radius: 9px; }
  .pm-item { min-height: 40px; border-radius: 7px; font-size: 1rem; }

  .topbar { min-height: 52px; padding: 11px 30px; gap: 10px; font-size: 13px; }
  .content { max-width: 1800px; padding: 38px 54px 160px; }
  .content.overview-content, .content.unavailable-content { max-width: 1640px; }
  .analytics-content { max-width: 1760px; }
  .content.ticket-editor-content { max-width: 1800px; }
  .page-title { font-size: 22px; }
  .page-sub { margin: 4px 0 22px; font-size: 14px; }
  .mod-head h1, .compact-module-hero h1 { font-size: 21px; }
  .compact-module-hero p { max-width: 820px; font-size: 14px; }
  .module-hero { margin-bottom: 22px; }

  .tabs { margin-bottom: 22px; }
  .tab { padding: 8px 14px 10px; font-size: 13px; }
  .group-title { margin: 24px 0 11px; font-size: 13px; }
  .cards { gap: 14px; }
  .card { min-height: 168px; height: 168px; gap: 9px; padding: 18px; border-radius: 10px; }
  .card h3 { font-size: 14px; }
  .card p { font-size: 12.5px; line-height: 1.5; }
  .card-icon svg { width: 19px; height: 19px; }
  .badge, .status, .pill, .availability-pill, .panel-state-inline { min-height: 23px; padding: 4px 8px; font-size: 11.5px; }
  .badge.on { min-height: 23px; padding: 4px 8px; }

  .section { margin-top: 14px; padding: 22px 24px; border-radius: 11px; }
  .section > h2, .section-toolbar h2 { font-size: 15px; }
  .section > .hint, .section-toolbar .hint { padding-bottom: 14px; font-size: 13px; }
  .section > [data-sec] { padding-top: 16px; }
  .field { margin-bottom: 16px; }
  .field > label { margin-bottom: 7px; font-size: 13px; }
  .field .help { margin-top: 6px; font-size: 11.5px; }
  .field-row { gap: 16px; }
  .content input:not([type="checkbox"]):not([type="color"]),
  .content select,
  .detail-modal input:not([type="checkbox"]):not([type="color"]),
  .detail-modal select {
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13px;
  }
  .content textarea, .detail-modal textarea { min-height: 96px; padding: 10px 12px; border-radius: 9px; font-size: 13px; }
  .content input[type="color"], .detail-modal input[type="color"] { height: 42px; border-radius: 9px; }
  .toggle-field { min-height: 58px; padding: 13px 15px; border-radius: 9px; }
  .toggle-field .t-label b { font-size: 13px; }
  .toggle-field .t-label span { font-size: 12px; }
  .switch { width: 42px; height: 24px; flex-basis: 42px; }
  .switch .track::after { width: 18px; height: 18px; }
  .switch input:checked + .track::after { transform: translateX(18px); }
  .switch-label { min-height: 36px; gap: 12px; font-size: 13px; }
  .btn-sm { min-height: 36px; padding: 7px 13px; border-radius: 8px; font-size: 12px; }

  .module-workspace, .preview-layout { grid-template-columns: minmax(0, 1fr) minmax(720px, 1fr); gap: 24px; }
  .content.ticket-editor-content .ticket-workspace { grid-template-columns: minmax(0, 1.05fr) minmax(720px, .95fr); gap: 24px; }
  .ticket-workspace { grid-template-columns: minmax(0, 1fr) minmax(680px, .9fr); gap: 24px; }
  .preview-panel, .ticket-preview-panel, .branding-preview-panel { top: 70px; }
  .preview-panel-head { margin-bottom: 17px; }
  .preview-panel-head h2 { font-size: 18px; }
  .preview-panel-head .hint { font-size: 13px; }
  .live-badge { min-height: 26px; padding: 4px 9px; font-size: 11.5px; }
  .live-discord-preview, .welcome-discord-message, .poll-discord-message { padding: 18px; border-radius: 8px; }
  .live-message-head > img { width: 44px; height: 44px; }
  .live-message-head b { font-size: 16px; }
  .live-message-head small { font-size: 12.5px; }
  .live-message-content { margin-left: 60px; font-size: 15px; }
  .live-embed, .welcome-discord-embed { margin-left: 60px; padding: 18px 19px 16px 20px; }
  .live-components, .live-delivery { margin-left: 60px; }
  .preview-pencil { width: 22px; height: 22px; }
  .preview-pencil svg { width: 10px; height: 10px; }
  .preview-editable > .preview-pencil { right: 5px; }
  .live-embed > .preview-pencil:first-child, .welcome-rail-pencil, .poll-rail-pencil, .dp-color-pencil { left: -15px; }
  #welcome-inline-preview { max-width: 720px; margin: 0 20px 20px; }
  #welcome-message-fields { padding: 16px 20px 0; }
  .welcome-format-row { margin: 0 20px 13px; }
  .welcome-reference-head { min-height: 66px; padding: 15px 20px; }
  .welcome-reference-head .hint { font-size: 11.5px; }

  .poll-discord-message { min-height: 650px; }
  .poll-message-head > img { width: 54px; height: 54px; }
  .poll-message-head b { font-size: 16px; }
  .poll-message-head small { font-size: 13px; }
  .poll-embed { width: min(100%, 780px); margin: -34px 0 0 70px; padding: 20px 22px; }
  .poll-title { font-size: 21px; }
  .poll-question { font-size: 17px; }
  .poll-options > div { font-size: 16px; }
  .poll-logo { width: 54px; height: 54px; }
  .poll-reactions { margin-left: 70px; }
  .poll-reactions span { min-width: 72px; min-height: 38px; font-size: 12px; }

  .reference-accordion-stack { gap: 11px; }
  .reference-accordion > summary, .ticket-commands > summary { min-height: 58px; padding: 10px 18px; }
  .reference-accordion > summary b, .ticket-commands > summary b { font-size: 13px; }
  .reference-accordion > summary small, .ticket-commands > summary small { font-size: 11.5px; }
  .accordion-body { padding: 15px 18px; }
  .panel-list-section .section-toolbar { min-height: 58px; padding: 11px 18px; }
  .panel-list-head, .panel-list-row { grid-template-columns: minmax(300px, 1.3fr) .55fr .8fr 38px; gap: 18px; }
  .panel-list-head { padding: 6px 20px; font-size: 11px; }
  .panel-list-row { min-height: 58px; padding: 8px 20px; }
  .panel-identity b { font-size: 13px; }
  .ticket-command-row { min-height: 60px; padding: 10px 12px; }
  .ticket-command-row b { font-size: 13px; }
  .ticket-command-row span { font-size: 11.5px; }
  .readonly-value { min-height: 40px; padding: 9px 11px; border-radius: 8px; font-size: 12.5px; }
  .ticket-editor-head { padding: 14px 17px; border-radius: 9px; }
  .ticket-editor-head h2 { font-size: 16px; }
  .ticket-editor-head p { font-size: 12.5px; }

  .platform-shell .section-toolbar { min-height: 62px; padding: 13px 20px; }
  .platform-shell .section-toolbar .hint { font-size: 11.5px; }
  .platform-search { width: calc(100% - 40px); height: 40px; margin: 20px 20px 10px; padding: 8px 11px; font-size: 13px; }
  .platform-list { margin: 0 20px 20px; border-radius: 8px; }
  .platform-row > summary { grid-template-columns: 38px minmax(0, 1fr) auto 22px; min-height: 54px; padding: 8px 12px; }
  .platform-avatar { width: 36px; height: 36px; }
  .platform-copy b { font-size: 14px; }
  .platform-copy small, .platform-state-inline { font-size: 11.5px; }
  .platform-compact-empty { min-height: 62px; margin: 0 20px 20px; }
  .platform-compact-empty b { font-size: 13px; }
  .platform-compact-empty span { font-size: 11.5px; }

  .analytics-toolbar { gap: 10px; margin-bottom: 16px; }
  .range-tabs button { min-width: 42px; padding: 8px 10px; font-size: 12px; }
  .export-menu > summary { padding: 8px 11px; font-size: 12px; }
  .reference-metrics { gap: 14px; margin-bottom: 16px; }
  .analytics-metric { min-height: 200px; padding: 18px; border-radius: 9px; }
  .analytics-metric span { font-size: 13px; }
  .analytics-metric b { font-size: 23px; }
  .metric-plot { min-height: 105px; }
  .integration-row { min-height: 62px; padding: 12px 15px; }
  .integration-row b { font-size: 14px; }
  .integration-row span, .integration-row small { font-size: 12px; }
  .branding-preview { min-height: 470px; }
  .unavailable-state { min-height: 420px; padding: 60px 32px; }
}

@media (max-width: 900px) {
  .page-title, .mod-head h1, .compact-module-hero h1 { font-size: 18px; }
  .page-sub, .compact-module-hero p { font-size: 12.5px; }
  .section { padding: 16px; border-radius: 10px; }
  .section > h2, .section-toolbar h2 { font-size: 13px; }
  .section > .hint, .section-toolbar .hint { font-size: 11.5px; }
  .content input:not([type="checkbox"]):not([type="color"]),
  .content select { min-height: 40px; padding: 8px 10px; font-size: 13px; }
  .content textarea { min-height: 92px; padding: 9px 10px; font-size: 13px; }
  .field > label { font-size: 12.5px; }
  .field .help { font-size: 11px; }
  .btn-sm { min-height: 34px; font-size: 12px; }
  .preview-panel-head h2 { font-size: 16px; }
  .switch-label { font-size: 12.5px; }
}

/* ==========================================================================
   Phase 2D — final preview and action-control cleanup
   ========================================================================== */
.btn {
  min-height: 40px;
  padding: 9px 14px;
  gap: 8px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
}
.btn svg { width: 14px; height: 14px; flex: 0 0 14px; }
.btn-sm { min-height: 32px; padding: 6px 11px; border-radius: 7px; font-size: 11.5px; }
.btn-sm svg { width: 13px; height: 13px; flex-basis: 13px; }
.module-actions,
.composer-actions,
.welcome-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.module-actions .btn,
.composer-actions .btn,
.welcome-actions .btn { white-space: nowrap; }

/* Preview controls remain discoverable without covering the content. */
.preview-pencil {
  width: 18px;
  height: 18px;
  border-width: 1px;
  opacity: 0;
  transform: scale(.88);
  box-shadow: 0 2px 7px rgba(36, 136, 255, .2);
  transition: opacity .14s ease, transform .16s var(--ease), background .16s, box-shadow .16s;
}
.editable-preview-panel .preview-pencil { opacity: 0; transform: scale(.88); }
.preview-pencil svg { width: 8px; height: 8px; }
.preview-pencil:hover,
.preview-pencil:focus-visible { opacity: 1; transform: scale(1.05); }
.preview-editable:hover > .preview-pencil,
.preview-editable:focus-within > .preview-pencil,
.live-embed:hover > .preview-pencil:first-child,
.live-embed:focus-within > .preview-pencil:first-child,
.welcome-discord-embed:hover .welcome-rail-pencil > .preview-pencil,
.welcome-discord-embed:focus-within .welcome-rail-pencil > .preview-pencil,
.poll-embed:hover .poll-rail-pencil > .preview-pencil,
.poll-embed:focus-within .poll-rail-pencil > .preview-pencil,
.dp-embed:hover .dp-color-pencil > .preview-pencil,
.dp-embed:focus-within .dp-color-pencil > .preview-pencil,
.wc-card:hover > .wc-bg-pencil > .preview-pencil,
.wc-card:focus-within > .wc-bg-pencil > .preview-pencil {
  opacity: 1;
  transform: scale(1);
}
.preview-editable > .preview-pencil { right: 3px; top: 1px; }
.live-embed > .preview-pencil:first-child,
.welcome-rail-pencil,
.poll-rail-pencil,
.dp-color-pencil { left: -13px; }
.wc-title > .preview-pencil,
.wc-sub > .preview-pencil,
.preview-part-message > .preview-pencil {
  position: absolute;
  display: grid;
  right: 8px;
  top: 50%;
  margin: 0;
  vertical-align: initial;
  transform: translateY(-50%) scale(.88);
}
.wc-title:hover > .preview-pencil,
.wc-sub:hover > .preview-pencil,
.preview-part-message:hover > .preview-pencil,
.wc-title:focus-within > .preview-pencil,
.wc-sub:focus-within > .preview-pencil,
.preview-part-message:focus-within > .preview-pencil {
  transform: translateY(-50%) scale(1);
}

/* Welcome: keep the generated card as the visual focus. */
#welcome-inline-preview { width: 100%; max-width: 780px; }
.welcome-discord-message { padding: 14px; }
.welcome-discord-copy {
  max-width: 100%;
  min-height: 24px;
  padding-right: 34px;
  line-height: 1.55;
}
.welcome-card-slot { margin-top: 15px; }
.welcome-card-slot .wc-card { border-radius: 8px; }
.wc-title,
.wc-sub { padding-inline: 28px; }

/* Polls: remove forced metadata and let optional content collapse naturally. */
#poll-preview { width: 100%; max-width: 980px; }
.poll-discord-message { min-height: 0; padding: 16px; }
.poll-embed {
  width: min(calc(100% - 56px), 760px);
  margin: 10px 0 0 56px;
  padding: 17px 18px;
}
.poll-message-content {
  width: max-content;
  max-width: calc(100% - 56px);
  margin: 3px 0 0 56px;
  padding-right: 27px;
  color: #dbdee1;
  font-size: 13px;
}
.poll-banner { margin-top: 15px; }
.poll-footer {
  min-height: 22px;
  margin-top: 12px;
  padding-right: 26px;
  color: #949ba4;
  font-size: 11px;
}
.poll-footer > .preview-pencil { top: 50%; }

/* Mod Logs preview selector and compact example embed. */
.preview-event-control {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #080808;
}
.preview-event-control label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
}
.preview-event-control select { min-height: 36px; }
.preview-event-control .help { margin-top: 6px; color: var(--text-faint); font-size: 10px; line-height: 1.45; }
.logging-preview-panel .live-discord-preview { min-height: 0; }
.logging-preview-panel .live-embed-fields { gap: 10px 18px; }
.logging-preview-panel .live-embed-fields b { margin-bottom: 3px; }
.log-route-category {
  padding: 15px 0;
  border-bottom: 1px solid var(--border-soft);
}
.log-route-category:first-child { padding-top: 0; }
.log-route-category:last-child { padding-bottom: 0; border-bottom: 0; }
.log-route-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 10px;
}
.log-route-category-head b { color: var(--text); font-size: 13px; }
.log-route-category-head span { color: var(--text-faint); font-size: 10.5px; }
.log-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.log-route-destination {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: var(--bg-card-2);
}
.log-route-destination:only-child { grid-column: 1 / -1; }
.log-route-destination > [data-log-route-server],
.log-route-destination > [data-log-route-channel] { margin-bottom: 10px; }
.log-route-destination-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 26px;
  margin-bottom: 10px;
}
.log-route-destination-head > div { min-width: 0; }
.log-route-destination-head b,
.log-route-destination-head span { display: block; }
.log-route-destination-head b { color: var(--text); font-size: 12px; }
.log-route-destination-head span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-route-destination .field { margin-bottom: 0; }
.log-route-warning { color: var(--text-dim); }

@media (min-width: 1600px) {
  .btn { min-height: 40px; padding: 9px 16px; border-radius: 9px; font-size: 13px; }
  .btn-sm { min-height: 34px; padding: 7px 12px; border-radius: 8px; font-size: 12px; }
  .module-actions, .composer-actions, .welcome-actions { gap: 12px; margin-top: 20px; }
  .preview-pencil { width: 18px; height: 18px; }
  .preview-pencil svg { width: 8px; height: 8px; }
  .preview-editable > .preview-pencil { right: 4px; }
  #welcome-inline-preview { max-width: 820px; }
  .welcome-discord-message { padding: 18px; }
  .welcome-discord-embed { margin-left: 60px; padding: 18px 20px; }
  .poll-discord-message { min-height: 0; padding: 20px; }
  .poll-embed { width: min(calc(100% - 70px), 860px); margin: 12px 0 0 70px; padding: 21px 23px; }
  .poll-message-content { max-width: calc(100% - 70px); margin-left: 70px; font-size: 15px; }
  .preview-event-control { margin-bottom: 18px; padding: 15px; border-radius: 10px; }
  .preview-event-control label { font-size: 13px; }
  .preview-event-control .help { font-size: 11.5px; }
}

@media (max-width: 900px) {
  .preview-pencil,
  .editable-preview-panel .preview-pencil { width: 16px; height: 16px; opacity: .52; transform: scale(1); }
  .preview-pencil svg { width: 7px; height: 7px; }
  .preview-pencil:hover,
  .preview-pencil:focus-visible,
  .preview-editable:focus-within > .preview-pencil { opacity: 1; }
}

@media (max-width: 900px) {
  .btn { min-height: 40px; padding: 9px 14px; font-size: 13px; }
  .btn-sm { min-height: 36px; padding: 7px 11px; font-size: 12px; }
  .module-actions, .composer-actions, .welcome-actions { justify-content: stretch; }
  .module-actions .btn, .composer-actions .btn, .welcome-actions .btn { flex: 1 1 160px; }
  #welcome-inline-preview, #poll-preview { max-width: none; }
  .welcome-discord-embed, .poll-embed { width: 100%; margin-left: 0; }
  .welcome-discord-copy { padding-right: 30px; }
  .poll-message-content { max-width: 100%; margin-left: 0; }
  .poll-reactions { margin-left: 0; }
  .logging-preview-panel { order: -1; position: static; }
  .log-route-grid { grid-template-columns: minmax(0, 1fr); }
  .log-route-category-head span { display: block; margin-top: 3px; }
  .poll-message-head { gap: 8px; }
  .poll-message-head > img { width: 36px; height: 36px; }
  .poll-message-head b { font-size: 12.5px; }
  .poll-message-head small { font-size: 10.5px; }
  .poll-logo { width: 38px; height: 38px; }
  .poll-copy { padding-right: 46px; }
}

/* Guild configuration diagnostics — compact, keyboard-readable sidebar cue. */
.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-warning-slot {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 14px;
  width: 14px;
  min-height: 14px;
  margin-left: auto;
}
.nav-warning {
  display: grid;
  place-items: center;
  color: #ef6268;
}
.nav-warning svg {
  width: 11px;
  height: 11px;
  opacity: 1;
  stroke-width: 2.25;
}
.nav-warning-tooltip {
  position: absolute;
  z-index: 80;
  right: -3px;
  bottom: calc(100% + 7px);
  display: grid;
  gap: 5px;
  width: 126px;
  padding: 7px 8px;
  border: 1px solid rgba(239, 98, 104, .28);
  border-radius: 8px;
  background: #121214;
  color: #ededf0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
  font-size: 8.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}
.nav-warning-tooltip span + span {
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.nav-item:hover .nav-warning-tooltip,
.nav-item:focus-visible .nav-warning-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-item.has-warning:focus-visible {
  outline: 1px solid rgba(239, 98, 104, .45);
  outline-offset: -1px;
}

@media (max-width: 900px) {
  .nav-warning-tooltip {
    right: 0;
    width: min(230px, calc(100vw - 34px));
    font-size: 11.5px;
  }
}

@media (min-width: 1600px) {
  .nav-warning-slot { flex-basis: 16px; width: 16px; }
  .nav-warning svg { width: 13px; height: 13px; }
  .nav-warning-tooltip {
    width: 210px;
    padding: 10px 11px;
    border-radius: 9px;
    font-size: 11.5px;
  }
}

/* Dashboard refinement: restrained switches, sharper charts, and a
   restrained readability increase on standard desktop widths. */
.switch .track {
  border: 1px solid #242426;
  background: #050506;
  box-shadow: none;
}
.switch .track::after {
  box-sizing: border-box;
  border: 1px solid #fff;
  background: #000;
  box-shadow: none;
}
.switch input:checked + .track {
  border-color: transparent;
  background: var(--brand-primary);
  box-shadow: none;
}
.switch input:checked + .track::after {
  background: #fff;
  border-color: #fff;
  box-shadow: none;
}
.switch input:focus-visible + .track {
  outline: 2px solid var(--brand-secondary);
  outline-offset: 3px;
  box-shadow: none;
}
.switch input:disabled + .track { opacity: 1; }

.field-disabled { opacity: .5; }
.field-disabled input,
.field-disabled select { cursor: not-allowed; }
.welcome-discord-embed.is-disabled { opacity: .48; }

.member-flow-chart-wrap {
  position: relative;
  min-height: 230px;
  padding: 10px 16px 14px;
}
.member-flow-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 206px;
  border-radius: 6px;
  cursor: crosshair;
  touch-action: pan-y;
}
.member-flow-chart-wrap canvas:focus-visible {
  outline: 2px solid var(--brand-secondary);
  outline-offset: 3px;
}
.member-flow-chart-tooltip {
  position: absolute;
  z-index: 6;
  display: grid;
  width: 164px;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid #34353a;
  border-radius: 9px;
  background: rgba(10, 10, 11, .96);
  color: #f3f3f5;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .52);
  font-size: 11.5px;
  line-height: 1.3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .13s ease, transform .13s ease, visibility .13s ease;
}
.member-flow-chart-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.member-flow-chart-tooltip > strong {
  padding-bottom: 6px;
  border-bottom: 1px solid #292a2e;
  font-size: 12px;
  font-weight: 700;
}
.flow-tooltip-row {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: #b7b8be;
}
.flow-tooltip-row i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.flow-tooltip-row b { color: #f3f3f5; font-variant-numeric: tabular-nums; }
.flow-tooltip-row.joined i,
.flow-tooltip-row.joined b { color: #57c785; }
.flow-tooltip-row.left i,
.flow-tooltip-row.left b { color: #e46d73; }
.flow-tooltip-row.net {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 1px;
}
.flow-tooltip-row.net b.positive { color: #57c785; }
.flow-tooltip-row.net b.negative { color: #e46d73; }
.sr-only {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}
.analytics-empty-plot { min-height: 230px; padding: 18px; text-align: center; }

@media (max-width: 900px) {
  .member-flow-chart-wrap { min-height: 210px; padding-inline: 10px; }
  .member-flow-chart-wrap canvas { height: 186px; }
  .member-flow-chart-tooltip { width: 154px; padding: 9px 10px; }
  .analytics-empty-plot { min-height: 210px; }
}

@media (min-width: 901px) and (max-width: 1599px) {
  .content { max-width: 1200px; padding-inline: 40px; }
  .content.overview-content,
  .content.unavailable-content { max-width: 1000px; }
  .analytics-content { max-width: 1140px; }
  .content.ticket-editor-content { max-width: 1320px; }

  .section { margin-top: 10px; padding: 16px 17px; }
  .section > h2,
  .section-toolbar h2 { font-size: 12.5px; }
  .section > .hint,
  .section-toolbar .hint { font-size: 11.5px; }
  .page-sub { font-size: 12px; }
  .mod-head h1,
  .compact-module-hero h1 { font-size: 16px; }
  .compact-module-hero p { font-size: 12.5px; }

  .content input:not([type="checkbox"]):not([type="color"]),
  .content select,
  .detail-modal input:not([type="checkbox"]):not([type="color"]),
  .detail-modal select {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12.5px;
  }
  .content textarea,
  .detail-modal textarea {
    min-height: 75px;
    padding: 9px 10px;
    font-size: 12.5px;
  }
  .field { margin-bottom: 13px; }
  .field > label { font-size: 12px; }
  .field .help { font-size: 10.5px; }
  .btn { min-height: 38px; padding: 8px 15px; font-size: 13px; }
  .btn-sm { min-height: 31px; font-size: 11.5px; }

  .live-discord-preview,
  .welcome-discord-message,
  .poll-discord-message { padding: 15px; }
  #welcome-inline-preview { max-width: 840px; }
  .module-workspace,
  .preview-layout { gap: 20px; }
  .ticket-command-row b { font-size: 12px; }
  .ticket-command-row span,
  .ticket-command-note { font-size: 10.5px; }
}

/* ==========================================================================
   Finder-style sidebar, centred switches, and scoped module refinements
   ========================================================================== */
.app { --sidebar-width: 280px; }

body.sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}
body.sidebar-resizing * { cursor: col-resize !important; }

.sidebar-collapse,
.sidebar-resize-handle { display: none; }

@media (min-width: 901px) {
  .sidebar {
    width: var(--sidebar-width);
    padding: 12px 11px 11px;
    background: #030303;
    transition: width .18s var(--ease), transform .3s var(--ease);
  }
  body.sidebar-resizing .sidebar { transition: none; }

  .brand { min-height: 48px; gap: 10px; padding: 0 6px 10px; }
  .brand img, .brand .brand-fallback { width: 34px; height: 34px; flex: 0 0 34px; }
  .brand-copy { min-width: 0; flex: 1; }
  .brand b { font-size: 14px; }
  .sidebar-collapse {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #a8a8ad;
    transition: background .15s, border-color .15s, color .15s, transform .18s var(--ease);
  }
  .sidebar-collapse svg { width: 16px; height: 16px; transform: rotate(180deg); }
  .sidebar-collapse:hover,
  .sidebar-collapse:focus-visible { background: #151517; border-color: #2a2a2d; color: #fff; outline: none; }

  .search { height: 40px; padding: 7px 10px; margin-bottom: 9px; border-radius: 9px; }
  .search svg { width: 16px; height: 16px; }
  .search input { font-size: 13px; }
  .search kbd { font-size: 9.5px; }
  .nav-section { margin: 17px 0 5px; padding: 0 8px; font-size: 10px; }
  .nav-item { min-height: 38px; gap: 11px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; }
  .nav-item svg { width: 17px; height: 17px; }
  .user-card { min-height: 48px; padding: 7px 8px; border-radius: 9px; }
  .user-card img { width: 34px; height: 34px; flex-basis: 34px; }
  .user-card .u-name { font-size: 13.5px; }

  .sidebar-resize-handle {
    position: absolute;
    z-index: 12;
    top: 0;
    right: -5px;
    bottom: 0;
    display: block;
    width: 10px;
    cursor: col-resize;
    touch-action: none;
    outline: none;
  }
  .sidebar-resize-handle::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 4px;
    width: 1px;
    background: #202023;
    transition: width .14s, background .14s;
  }
  .sidebar-resize-handle:hover::after,
  .sidebar-resize-handle:focus-visible::after,
  body.sidebar-resizing .sidebar-resize-handle::after { width: 2px; background: #fff; }

  .sidebar.collapsed { padding-inline: 8px; }
  .sidebar.collapsed .brand { justify-content: center; gap: 3px; padding-inline: 0; }
  .sidebar.collapsed .brand-copy,
  .sidebar.collapsed .search input,
  .sidebar.collapsed .search kbd,
  .sidebar.collapsed .nav-section,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .u-name { display: none; }
  .sidebar.collapsed .brand img { width: 26px; height: 26px; flex-basis: 26px; }
  .sidebar.collapsed .sidebar-collapse { width: 24px; height: 26px; flex-basis: 24px; }
  .sidebar.collapsed .sidebar-collapse svg { transform: none; }
  .sidebar.collapsed .search {
    width: 40px;
    height: 34px;
    justify-content: center;
    margin: 0 auto 7px;
    padding: 0;
    cursor: pointer;
  }
  .sidebar.collapsed .search svg { width: 15px; height: 15px; }
  .sidebar.collapsed .nav { margin-inline: 0; padding-inline: 0; }
  .sidebar.collapsed .nav-item {
    width: 40px;
    min-height: 34px;
    justify-content: center;
    margin-inline: auto;
    padding: 7px;
  }
  .sidebar.collapsed .nav-item svg { width: 16px; height: 16px; }
  .sidebar.collapsed .nav-warning-slot {
    position: absolute;
    top: 1px;
    right: 0;
    width: 12px;
    min-height: 12px;
    margin: 0;
  }
  .sidebar.collapsed .nav-warning svg { width: 9px; height: 9px; }
  .sidebar.collapsed .nav-warning-tooltip { display: none; }
  .sidebar.collapsed .profile-wrap { display: flex; justify-content: center; }
  .sidebar.collapsed .user-card { width: 40px; justify-content: center; padding: 5px; }
  .sidebar.collapsed .profile-menu {
    right: auto;
    left: calc(100% + 9px);
    bottom: 0;
    width: min(190px, calc(100vw - 92px));
    max-width: calc(100vw - 92px);
    transform-origin: bottom left;
  }
}

.sidebar-tooltip {
  position: fixed;
  z-index: 180;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid #2b2b2e;
  border-radius: 7px;
  background: #111113;
  color: #f4f4f5;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .58);
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(-3px);
  transition: opacity .13s, transform .13s, visibility .13s;
}
.sidebar-tooltip.show { opacity: 1; visibility: visible; transform: translateY(-50%); }

/* Exact switch geometry: 2px on every side, including the knob border. */
.switch {
  width: 44px;
  height: 26px;
  flex-basis: 44px;
}
.switch .track::after {
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  transition: transform .22s var(--ease), background .2s, border-color .2s;
}
.switch input:checked + .track::after { transform: translate(20px, -50%); }

/* Anti-Nuke configuration status */
.antinuke-warning { margin-bottom: 8px; }
.nuke-role-status {
  display: flex;
  min-height: 34px;
  align-items: center;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid #232326;
  border-radius: 7px;
  background: #080809;
  color: var(--text-faint);
  font-size: 10.5px;
}
.nuke-role-status span { display: flex; align-items: center; gap: 7px; }
.nuke-role-status svg { width: 13px; height: 13px; }
.nuke-role-status .ready { color: #b8d9c1; }
.nuke-role-status .warning { color: #e5c27c; }

/* Welcome message fidelity and Discord references */
.discord-mention {
  display: inline;
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(88, 101, 242, .28);
  color: #c9cdfb;
  font-weight: 550;
}
#welcome-inline-preview { max-width: 820px; }
.welcome-discord-message { width: 100%; max-width: 760px; }
.welcome-discord-embed {
  box-sizing: border-box;
  width: min(calc(100% - 60px), 560px);
  max-width: 560px;
  margin-left: 52px;
  padding: 14px 15px 13px 16px;
}
.welcome-embed-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 15px; align-items: start; }
.welcome-embed-main { min-width: 0; }
.welcome-embed-title {
  position: relative;
  margin-bottom: 6px;
  padding-right: 28px;
  color: #f2f3f5;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.welcome-discord-copy {
  position: relative;
  max-width: none;
  min-height: 20px;
  padding-right: 28px;
  white-space: pre-wrap;
}
.welcome-thumb-wrap { position: relative; width: 64px; flex: 0 0 64px; }
.welcome-member-thumb {
  position: static;
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}
.welcome-thumb-wrap > .preview-pencil { top: -8px; right: -8px; }
.welcome-card-slot { width: 100%; max-width: 528px; margin-top: 13px; }
.welcome-attachment { max-width: 620px; }
.welcome-embed-footer {
  position: relative;
  margin-top: 10px;
  padding-top: 8px;
  padding-right: 28px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  color: #949ba4;
  font-size: 10.5px;
  line-height: 1.35;
}

.discord-autocomplete {
  position: fixed;
  z-index: 520;
  overflow: hidden;
  max-width: calc(100vw - 24px);
  border: 1px solid #303035;
  border-radius: 10px;
  background: #101012;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .7);
}
.discord-autocomplete-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid #242428;
}
.discord-autocomplete-head b { font-size: 11px; }
.discord-autocomplete-head span { overflow: hidden; color: var(--text-faint); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.discord-autocomplete-results { max-height: 260px; overflow-y: auto; padding: 5px; }
.discord-autocomplete-results button {
  display: grid;
  width: 100%;
  min-height: 44px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--text-dim);
  text-align: left;
  touch-action: manipulation;
}
.discord-autocomplete-results button:hover,
.discord-autocomplete-results button[aria-selected="true"] {
  background: #242428;
  color: #fff;
  box-shadow: inset 2px 0 0 var(--silver);
}
.discord-autocomplete-results button:disabled {
  cursor: not-allowed;
  opacity: .52;
  background: transparent;
  box-shadow: none;
}
.discord-autocomplete-results button:disabled::after { content: none; }
.discord-autocomplete-results button[aria-selected="true"]::after {
  content: "✓";
  color: var(--silver);
  font-size: 12px;
  font-weight: 800;
}
.discord-autocomplete-results button:focus-visible { outline: 1px solid #fff; outline-offset: -1px; }
.discord-autocomplete-results img,
.discord-reference-icon { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.discord-reference-icon { display: grid; place-items: center; font-size: 18px; }
.discord-reference-icon svg { width: 15px; height: 15px; }
.discord-role-reference {
  position: relative;
  color: #f4f4f5;
  background: color-mix(in srgb, var(--discord-role-colour) 24%, #171719);
  border: 1px solid color-mix(in srgb, var(--discord-role-colour) 78%, #fff);
}
.discord-role-reference::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border: 2px solid #101012;
  border-radius: 50%;
  background: var(--discord-role-colour);
}
.discord-special-reference {
  border: 1px solid #4a4a50;
  background: #202024;
  color: #f4f4f5;
  font-size: 15px;
  font-weight: 800;
}
.discord-autocomplete-results button span:last-child { min-width: 0; }
.discord-autocomplete-results b,
.discord-autocomplete-results small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discord-autocomplete-results b { font-size: 12px; }
.discord-autocomplete-results small { margin-top: 2px; color: var(--text-faint); font-size: 10px; }
.discord-autocomplete-empty,
.discord-autocomplete-loading { padding: 18px 12px; color: var(--text-faint); font-size: 10.5px; text-align: center; }
.discord-format-help {
  margin-top: 7px;
  color: var(--text-faint);
  font-size: 10.5px;
  line-height: 1.45;
}
.discord-format-help b {
  color: var(--text-dim);
  font-weight: 750;
}

@media (max-width: 620px) {
  .discord-autocomplete-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .discord-autocomplete-results { max-height: min(260px, 42vh); }
  .discord-autocomplete-results button { min-height: 46px; }
}

/* The Roles mode switcher is a navigation control, not a small toggle. */
.segmented-tabs {
  min-height: 40px;
  margin: 4px 0 13px;
  padding: 4px;
  border: 1px solid #26262a;
  border-radius: 10px;
  background: #0a0a0b;
}
.segmented-tabs button {
  min-height: 32px;
  padding: 7px 17px;
  border-radius: 7px;
  color: #909096;
  font-size: 11.5px;
  font-weight: 650;
}
.segmented-tabs button:hover { color: #fff; background: #151517; }
.segmented-tabs button.active { background: #fff; color: #050506; }
.segmented-tabs button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 900px) {
  .sidebar-collapse,
  .sidebar-resize-handle,
  .sidebar-tooltip { display: none !important; }
  .welcome-discord-embed,
  #welcome-inline-preview .welcome-discord-embed { width: 100%; max-width: none; margin-left: 0; }
  .welcome-plain-payload,
  #welcome-inline-preview .welcome-plain-payload { margin-left: 0; }
  .welcome-discord-message { max-width: none; }
  .segmented-tabs { display: flex; width: 100%; }
  .segmented-tabs button { flex: 1; }
}

/* ========================================================================== 
   Welcome — frame 050–052 layout contract

   The reference keeps the editor in one compact, centred column: the primary
   delivery card first, an inline Discord preview, then a secondary settings
   card.  These final scoped rules intentionally win over older density passes
   without changing any other dashboard module.
   ========================================================================== */
.content.welcome-content {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding: 30px 40px 110px;
}

@media (min-width: 901px) {
  .content.welcome-content {
    transform: none;
  }
  .main:has(.welcome-content) .topbar .crumb,
  .main:has(.welcome-content) .topbar #topbar {
    position: relative;
    left: 0;
  }
  .sidebar.collapsed ~ .main .welcome-content { transform: none; }
  .sidebar.collapsed ~ .main .topbar .crumb,
  .sidebar.collapsed ~ .main .topbar #topbar { left: 0; }
}

.welcome-content .welcome-reference-section,
.welcome-content .welcome-card-settings {
  overflow: visible;
  margin-top: 0;
  padding: 0;
  border: 1px solid #29292c;
  border-radius: 10px;
  background: #050506;
  box-shadow: none;
}

.welcome-content .welcome-card-settings { margin-top: 18px; }

.welcome-content .welcome-reference-head,
.welcome-content .welcome-secondary-head {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #1d1d20;
}

.welcome-content .welcome-reference-head h2,
.welcome-content .welcome-secondary-head h2 {
  margin: 0;
  color: #f4f4f5;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.welcome-content .welcome-reference-head .hint,
.welcome-content .welcome-secondary-head .hint {
  margin-top: 4px;
  padding: 0;
  color: #77777d;
  font-size: 12px;
  line-height: 1.35;
}

.welcome-content .welcome-core-fields,
.welcome-content #welcome-message-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
  padding: 20px 20px 0;
}

.welcome-content [data-field-key="channelId"],
.welcome-content [data-field-key="message"] { grid-column: 1 / -1; }
.welcome-content [data-field-key="message"] .help { display: none; }

.welcome-content .field { margin-bottom: 17px; }
.welcome-content .field > label {
  margin-bottom: 7px;
  color: #d7d7da;
  font-size: 13px;
  font-weight: 700;
}

.welcome-content .field .help {
  margin-top: 6px;
  color: #717177;
  font-size: 11px;
  line-height: 1.4;
}

.welcome-content input:not([type="checkbox"]):not([type="color"]),
.welcome-content select {
  min-height: 44px;
  padding: 9px 12px;
  border-color: #28282b;
  border-radius: 8px;
  background-color: #0b0b0c;
  font-size: 13.5px;
}

.welcome-content textarea {
  min-height: 92px;
  padding: 10px 12px;
  border-color: #28282b;
  border-radius: 8px;
  background: #050506;
  font-size: 13.5px;
  line-height: 1.45;
}

.welcome-content [data-field-key="outputMode"],
.welcome-content [data-field-key="embedPlainPlacement"] {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.welcome-content [data-field-key="outputMode"] > label,
.welcome-content [data-field-key="embedPlainPlacement"] > label { margin: 0; }
.welcome-content [data-field-key="embedPlainPlacement"] .help { display: none; }

.welcome-content #welcome-inline-preview {
  width: auto;
  max-width: 1120px;
  margin: 8px 20px 22px;
  padding: 0;
}

.welcome-content #welcome-inline-preview .welcome-discord-message {
  width: 100%;
  max-width: 1120px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.welcome-content #welcome-inline-preview .live-message-head {
  min-height: 44px;
  gap: 10px;
  margin: 0 0 12px;
}

.welcome-content #welcome-inline-preview .live-message-head > img {
  width: 42px;
  height: 42px;
}

.welcome-content #welcome-inline-preview .live-message-head b { font-size: 15px; }
.welcome-content #welcome-inline-preview .live-message-head span {
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 10px;
}
.welcome-content #welcome-inline-preview .live-message-head small { margin-left: 6px; font-size: 12px; }

.welcome-content #welcome-inline-preview .welcome-preview-disabled {
  margin: 0 0 10px 56px;
  font-size: 11.5px;
}

.welcome-content #welcome-inline-preview .welcome-plain-payload,
.welcome-content #welcome-inline-preview .welcome-embed-outside {
  max-width: 1060px;
  margin-left: 56px;
}

.welcome-content #welcome-inline-preview .welcome-plain-copy {
  min-height: 28px;
  padding: 2px 34px 2px 0;
  font-size: 14px;
  line-height: 1.42;
}

.welcome-content #welcome-inline-preview .welcome-discord-embed {
  box-sizing: border-box;
  width: min(calc(100% - 56px), 1020px);
  max-width: calc(100% - 56px);
  min-height: 260px;
  margin-left: 56px;
  padding: 17px 18px 16px 19px;
  border-left-width: 4px;
  border-radius: 7px;
  background: #0d0d0f;
}

.welcome-content #welcome-inline-preview .welcome-embed-grid { gap: 16px; }
.welcome-content #welcome-inline-preview .welcome-embed-title {
  margin-bottom: 7px;
  padding-right: 30px;
  font-size: 16px;
  line-height: 1.3;
}
.welcome-content #welcome-inline-preview .welcome-discord-copy {
  min-height: 24px;
  padding-right: 30px;
  font-size: 14px;
  line-height: 1.5;
}

.welcome-content #welcome-inline-preview .welcome-thumb-wrap {
  width: 64px;
  flex-basis: 64px;
}
.welcome-content #welcome-inline-preview .welcome-member-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
}

.welcome-content #welcome-inline-preview .welcome-card-slot {
  width: 100%;
  max-width: 960px;
  margin-top: 14px;
}
.welcome-content #welcome-inline-preview .welcome-card-slot .wc-card {
  border-radius: 8px;
}
.welcome-content #welcome-inline-preview .wc-title,
.welcome-content #welcome-inline-preview .wc-sub {
  overflow: visible;
  text-overflow: clip;
}
.welcome-content #welcome-inline-preview .welcome-embed-footer {
  margin-top: 11px;
  padding-top: 9px;
  font-size: 11px;
}

.welcome-content .welcome-embed-tools-pencil {
  position: absolute;
  z-index: 6;
  top: 8px;
  right: 8px;
}
.welcome-content .welcome-embed-tools-pencil > .preview-pencil { position: static; }
.welcome-content .editable-preview-panel .preview-pencil,
.welcome-content .editable-preview-panel:hover .preview-pencil,
.welcome-content .editable-preview-panel:focus-within .preview-pencil {
  opacity: 1;
  transform: scale(1);
}
.welcome-content .welcome-delivery-note { display: none; }

.welcome-content #welcome-card-fields { padding: 20px 20px 4px; }
.welcome-content #welcome-card-fields .toggle-field {
  min-height: 62px;
  padding: 13px 14px;
  border-radius: 8px;
}
.welcome-content #welcome-card-fields .toggle-field .t-label b { font-size: 13px; }
.welcome-content #welcome-card-fields .toggle-field .t-label span { font-size: 11px; }
.welcome-content .welcome-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.welcome-content .welcome-actions .btn {
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .content.welcome-content { max-width: none; padding: 18px 16px 36px; }
  .welcome-content .welcome-reference-head,
  .welcome-content .welcome-secondary-head { min-height: 60px; padding: 13px 15px; }
  .welcome-content .welcome-reference-head h2,
  .welcome-content .welcome-secondary-head h2 { font-size: 15px; }
  .welcome-content .welcome-reference-head .hint,
  .welcome-content .welcome-secondary-head .hint { font-size: 11px; }
  .welcome-content .welcome-core-fields,
  .welcome-content #welcome-message-fields { grid-template-columns: 1fr; padding: 16px 15px 0; }
  .welcome-content [data-field-key="channelId"],
  .welcome-content [data-field-key="message"] { grid-column: 1; }
  .welcome-content [data-field-key="outputMode"],
  .welcome-content [data-field-key="embedPlainPlacement"] { grid-template-columns: 1fr; gap: 5px; }
  .welcome-content [data-field-key="embedPlainPlacement"] .help { grid-column: 1; margin-top: 0; }
  .welcome-content .field { margin-bottom: 14px; }
  .welcome-content .field > label { font-size: 12px; }
  .welcome-content .field .help { font-size: 10.5px; }
  .welcome-content input:not([type="checkbox"]):not([type="color"]),
  .welcome-content select { min-height: 40px; padding: 8px 10px; font-size: 13px; }
  .welcome-content textarea { min-height: 88px; padding: 9px 10px; font-size: 13px; }
  .welcome-content #welcome-inline-preview { max-width: none; margin: 6px 15px 18px; }
  .welcome-content #welcome-inline-preview .welcome-discord-message { max-width: none; }
  .welcome-content #welcome-inline-preview .live-message-head > img { width: 36px; height: 36px; }
  .welcome-content #welcome-inline-preview .live-message-head b { font-size: 13.5px; }
  .welcome-content #welcome-inline-preview .live-message-head small { font-size: 10.5px; }
  .welcome-content #welcome-inline-preview .welcome-plain-payload,
  .welcome-content #welcome-inline-preview .welcome-embed-outside,
  .welcome-content #welcome-inline-preview .welcome-discord-embed { width: 100%; max-width: none; min-height: 0; margin-left: 0; }
  .welcome-content #welcome-inline-preview .welcome-discord-embed { padding: 15px 14px 14px 16px; }
  .welcome-content #welcome-inline-preview .welcome-embed-title { font-size: 15px; }
  .welcome-content #welcome-inline-preview .welcome-discord-copy { font-size: 13px; }
  .welcome-content #welcome-inline-preview .welcome-thumb-wrap { width: 52px; flex-basis: 52px; }
  .welcome-content #welcome-inline-preview .welcome-member-thumb { width: 52px; height: 52px; }
  .welcome-content #welcome-card-fields { padding: 16px 15px 3px; }
  .welcome-content .welcome-actions { justify-content: stretch; }
}

/* ==========================================================================
   Settings — dashboard administrator access
   ========================================================================== */
.content.config-content {
  width: 100%;
  max-width: 1120px;
  padding-bottom: 110px;
}

.dashboard-admin-section {
  container-type: inline-size;
  overflow: hidden;
  padding: 24px 26px;
  border-color: #303033;
  background: #101012;
}
.dashboard-admin-section > h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}
.dashboard-admin-section > .hint {
  max-width: 720px;
  padding: 5px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.dashboard-admin-find {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .018);
}
.dashboard-admin-input-field > label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.dashboard-admin-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}
.content.config-content .dashboard-admin-input-row input {
  min-width: 0;
  min-height: 46px;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.content.config-content .dashboard-admin-input-row input[aria-invalid="true"] {
  border-color: rgba(248, 113, 113, .72);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .1);
}
.dashboard-admin-find-button,
.dashboard-admin-preview-actions .btn,
.dashboard-admin-remove,
.dashboard-admin-copy {
  min-height: 44px;
}
.dashboard-admin-find-button {
  min-width: 116px;
  padding-inline: 18px;
}
.dashboard-admin-input-field > p {
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}
.dashboard-admin-status {
  min-height: 22px;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.55;
}
.dashboard-admin-status:empty { min-height: 0; margin-top: 0; }
.dashboard-admin-status.is-error { color: #f6a1a1; }
.dashboard-admin-status.is-success { color: #8eddb7; }

#dashboard-admin-preview { overflow: hidden; }
.dashboard-admin-preview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, .8fr);
  gap: 18px 24px;
  align-items: center;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(var(--brand-primary-rgb), .07), rgba(255, 255, 255, .018));
  box-shadow: 0 16px 36px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translateY(-7px);
  transition: opacity .22s ease, transform .28s var(--ease), border-color .2s ease;
}
.dashboard-admin-preview-card.is-visible { opacity: 1; transform: none; }
.dashboard-admin-preview-card .dashboard-admin-identity { min-width: 0; }
.dashboard-admin-preview-card .dashboard-admin-id-line { justify-self: end; width: 100%; }
.dashboard-admin-server-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  padding-left: 82px;
}
.dashboard-admin-server-name span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.dashboard-admin-server-name b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-admin-profile-status {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 7px;
  color: var(--text-dim);
  font-size: 12px;
}
.dashboard-admin-profile-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .08);
}
.dashboard-admin-preview-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.dashboard-admin-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}
.dashboard-admin-avatar {
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: #141416;
  color: var(--text-dim);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .025);
  font-size: 20px;
  font-weight: 700;
}
.dashboard-admin-avatar.is-compact {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  font-size: 15px;
}
.dashboard-admin-avatar img,
.dashboard-admin-avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.dashboard-admin-avatar img { display: block; object-fit: cover; }
.dashboard-admin-avatar-fallback { display: grid; place-items: center; }
.dashboard-admin-name-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.dashboard-admin-name-block b {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-admin-identity.is-compact .dashboard-admin-name-block b { font-size: 14px; }
.dashboard-admin-name-block span {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-admin-id-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}
.dashboard-admin-id-line > div { min-width: 0; flex: 1; }
.dashboard-admin-id-line > div > span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.dashboard-admin-id-line code {
  display: block;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  letter-spacing: .025em;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-admin-copy {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #19191d;
  color: var(--brand-secondary);
  line-height: 1;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.dashboard-admin-copy svg { display: block; width: 18px; height: 18px; }
.dashboard-admin-copy:hover {
  border-color: var(--brand-secondary);
  background: rgba(var(--brand-primary-rgb), .16);
  color: var(--text);
}
.dashboard-admin-copy:focus-visible { outline: 2px solid var(--brand-secondary); outline-offset: 3px; }
.dashboard-admin-copy.is-copied { color: var(--green); border-color: rgba(52, 211, 153, .42); }

.dashboard-admin-list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding-bottom: 10px;
}
.dashboard-admin-list-head h3 { font-size: 14px; }
.dashboard-admin-list-head p,
.dashboard-admin-list-head > span {
  color: var(--text-faint);
  font-size: 11.5px;
}
.dashboard-admin-list-head > span { white-space: nowrap; }
.dashboard-admin-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #060607;
}
.dashboard-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, auto);
  gap: 20px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .16s ease;
}
.dashboard-admin-row:last-child { border-bottom: 0; }
.dashboard-admin-row:hover { background: rgba(255, 255, 255, .018); }
.dashboard-admin-row-main {
  display: grid;
  grid-template-columns: minmax(190px, .9fr) minmax(230px, 1.1fr);
  gap: 20px;
  align-items: center;
  min-width: 0;
}
.dashboard-admin-row-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}
.dashboard-admin-access-type,
.dashboard-admin-account-note {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #121214;
  color: var(--text-dim);
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.dashboard-admin-access-type.is-protected { border-color: var(--border-strong); color: var(--text); }
.dashboard-admin-account-note { color: var(--text-faint); font-weight: 600; }
.dashboard-admin-protected-note {
  max-width: 180px;
  color: var(--text-faint);
  font-size: 10.5px;
  line-height: 1.4;
  text-align: right;
}
.dashboard-admin-remove {
  min-width: 116px;
  padding: 9px 12px;
  white-space: nowrap;
}
.dashboard-admin-empty {
  padding: 28px 18px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

.dashboard-admin-remove-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, .9fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-input);
}
.dashboard-admin-remove-copy {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
}
.dashboard-admin-modal-status {
  min-height: 20px;
  margin-top: 10px;
  color: #f6a1a1;
  font-size: 12px;
}
.dashboard-admin-remove-modal .detail-modal .btn { min-height: 44px; }
.dashboard-admin-remove-modal [data-detail-close] { width: 44px; height: 44px; flex: 0 0 44px; }
.content.config-content > .section:not(.dashboard-admin-section) code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Reflow this card using its available width, including a resized sidebar. */
@container (max-width: 760px) {
  .dashboard-admin-preview-card { grid-template-columns: 1fr; }
  .dashboard-admin-row { grid-template-columns: 1fr; gap: 14px; }
  .dashboard-admin-row-actions { justify-content: flex-start; flex-wrap: wrap; padding-left: 66px; }
  .dashboard-admin-protected-note { max-width: none; text-align: left; }
}
@container (max-width: 520px) {
  .dashboard-admin-input-row { grid-template-columns: 1fr; }
  .dashboard-admin-find-button { width: 100%; }
  .dashboard-admin-row-main { grid-template-columns: 1fr; gap: 13px; }
  .dashboard-admin-row-main .dashboard-admin-id-line,
  .dashboard-admin-row-actions { padding-left: 60px; }
  .dashboard-admin-remove { width: 100%; }
}
@container (max-width: 320px) {
  .dashboard-admin-row-main .dashboard-admin-id-line,
  .dashboard-admin-row-actions { padding-left: 0; }
}

@media (max-width: 900px) {
  .content.config-content { max-width: none; padding: 24px 20px 110px; }
  .dashboard-admin-preview-card { grid-template-columns: 1fr; }
  .dashboard-admin-preview-card .dashboard-admin-id-line,
  .dashboard-admin-profile-status { justify-self: stretch; }
  .dashboard-admin-row { grid-template-columns: 1fr; gap: 14px; }
  .dashboard-admin-row-actions { justify-content: flex-start; flex-wrap: wrap; padding-left: 66px; }
  .dashboard-admin-protected-note { max-width: none; text-align: left; }
}

@media (max-width: 640px) {
  .content.config-content { padding: 20px 14px 108px; }
  .dashboard-admin-section { padding: 19px 16px; }
  .dashboard-admin-section > h2 { font-size: 17px; }
  .dashboard-admin-find { margin-top: 18px; padding: 15px; }
  .dashboard-admin-input-row { grid-template-columns: 1fr; }
  .dashboard-admin-find-button { width: 100%; }
  .dashboard-admin-preview-card { gap: 15px; padding: 16px; }
  .dashboard-admin-preview-card .dashboard-admin-id-line,
  .dashboard-admin-server-name { padding-left: 0; }
  .dashboard-admin-preview-actions { flex-direction: column; }
  .dashboard-admin-preview-actions .btn { width: 100%; }
  .dashboard-admin-list-head { align-items: flex-start; }
  .dashboard-admin-row { padding: 15px; }
  .dashboard-admin-row-main { grid-template-columns: 1fr; gap: 13px; }
  .dashboard-admin-row-main .dashboard-admin-id-line,
  .dashboard-admin-row-actions { padding-left: 60px; }
  .dashboard-admin-remove { width: 100%; }
  .dashboard-admin-remove-profile { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .content.config-content { padding-inline: 10px; }
  .dashboard-admin-section { padding-inline: 13px; }
  .dashboard-admin-find { padding: 13px; }
  .dashboard-admin-row-main .dashboard-admin-id-line,
  .dashboard-admin-row-actions { padding-left: 0; }
  .dashboard-admin-id-line code { font-size: 12.5px; }
  .dashboard-admin-row-actions > * { flex: 1 1 auto; }
  .dashboard-admin-access-type,
  .dashboard-admin-account-note { justify-content: center; }
  .dashboard-admin-protected-note { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-admin-preview-card,
  .dashboard-admin-copy { transition: none; }
}

/* Twitch/social notification editor -------------------------------------- */
.platform-integration-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--border-soft);
}
.platform-integration-status > div {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 13px 15px;
  background: #09090a;
}
.platform-integration-status span {
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.platform-integration-status b {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
}
.platform-integration-status.is-ready > div:first-child b { color: var(--green); }
.platform-integration-status.has-error > div:first-child b,
.platform-integration-status.has-error > div:last-child b { color: #f4a6a9; }

.social-message-preview {
  display: grid;
  gap: 12px;
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid var(--border-soft);
}
.social-watcher-modal .detail-modal > .m-row {
  flex-wrap: wrap;
}
.social-watcher-modal .detail-modal > .m-row .btn {
  flex: 1 1 190px;
}
.twitch-resolve-toolbar {
  display: flex;
  align-items: center;
  gap: 11px;
}
.twitch-resolve-toolbar > span {
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.4;
}
.twitch-channel-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #09090a;
}
.twitch-channel-card > img {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  object-fit: cover;
}
.twitch-channel-card > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.twitch-channel-card b,
.twitch-channel-card span,
.twitch-channel-card a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.twitch-channel-card b { color: var(--text); font-size: 13.5px; }
.twitch-channel-card span { color: var(--text-faint); font-size: 10.5px; }
.twitch-channel-card a {
  width: max-content;
  max-width: 100%;
  margin-top: 2px;
  color: #cdd0d8;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.youtube-latest-preview {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #09090a;
}
.youtube-latest-preview > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #050506;
  object-fit: cover;
}
.youtube-latest-preview > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}
.youtube-latest-preview span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.youtube-latest-preview b {
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
}
.youtube-latest-preview small {
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.4;
}
.youtube-latest-preview a {
  overflow: hidden;
  color: #cdd0d8;
  font-size: 11px;
  text-decoration: underline;
  text-overflow: ellipsis;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.social-rendered-preview {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #070708;
}
.social-rendered-preview > span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.social-rendered-preview pre {
  margin: 0;
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.social-preview-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 2px;
}
.social-preview-label > span {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.social-preview-label > small {
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}
.social-discord-preview {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border: 1px solid #313338;
  border-radius: 12px;
  background: #313338;
  color: #dbdee1;
}
.social-discord-preview.is-unresolved {
  opacity: .72;
}
.social-discord-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.social-discord-head > img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}
.social-discord-head > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}
.social-discord-head b {
  overflow: hidden;
  color: #f2f3f5;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-discord-head span {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 4px;
  background: #5865f2;
  color: #fff;
  font-size: 9px;
  font-weight: 750;
}
.social-discord-head small {
  overflow: hidden;
  color: #949ba4;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-discord-content {
  padding-left: 52px;
  color: #dbdee1;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.social-preview-embed {
  position: relative;
  display: grid;
  width: min(100%, 590px);
  min-width: 0;
  gap: 11px;
  margin-left: 52px;
  padding: 14px 14px 12px 18px;
  overflow: hidden;
  border: 1px solid #3f4147;
  border-radius: 4px;
  background: #2b2d31;
}
.social-preview-embed::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--social-accent);
  content: "";
}
.social-preview-author {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}
.social-preview-author > img {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}
.social-preview-author > b {
  overflow: hidden;
  color: #f2f3f5;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-preview-title {
  color: #00a8fc;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.social-preview-title:hover { text-decoration: underline; }
.social-preview-description {
  max-width: 65ch;
  color: #dbdee1;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.social-preview-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 34px;
}
.social-preview-fields > div {
  display: grid;
  min-width: 110px;
  gap: 2px;
}
.social-preview-fields b {
  color: #f2f3f5;
  font-size: 12px;
}
.social-preview-fields span {
  color: #dbdee1;
  font-size: 13px;
  line-height: 1.4;
}
.social-preview-image {
  display: block;
  width: 100%;
  max-height: 330px;
  border-radius: 4px;
  background: #1e1f22;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}
.social-preview-footer {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: #b5bac1;
  font-size: 11px;
  line-height: 1.35;
}
.social-preview-footer i {
  font-style: normal;
  opacity: .6;
}
.social-preview-link {
  display: inline-flex;
  width: max-content;
  max-width: calc(100% - 52px);
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-left: 52px;
  padding: 0 14px;
  border-radius: 4px;
  background: #4e5058;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background .16s ease, transform .16s ease;
}
.social-preview-link:hover {
  background: #5d6069;
  transform: translateY(-1px);
}
.social-preview-link svg {
  width: 14px;
  height: 14px;
}
.mass-mention-warning {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(242, 180, 83, .26);
  border-radius: 10px;
  background: rgba(242, 180, 83, .055);
  color: #e9c77f;
}
.mass-mention-warning > svg { width: 17px; height: 17px; }
.mass-mention-warning > div { display: grid; gap: 2px; }
.mass-mention-warning b { font-size: 12px; }
.mass-mention-warning span { color: #bca77d; font-size: 11px; line-height: 1.45; }
.mass-mention-status-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .018);
}
.mass-mention-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.mass-mention-status-head > div {
  display: grid;
  gap: 2px;
}
.mass-mention-status-head b {
  color: var(--text);
  font-size: 13px;
}
.mass-mention-status-head span {
  color: var(--text-faint);
  font-size: 11px;
}
.mass-mention-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.mass-mention-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 3px 12px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(0, 0, 0, .16);
}
.mass-mention-status-row > span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
.mass-mention-status-row > b {
  font-size: 11px;
  text-align: right;
}
.mass-mention-status-row > small {
  grid-column: 1 / -1;
  color: var(--text-faint);
  font-size: 10.5px;
  line-height: 1.45;
}
.mass-mention-status-row.is-allowed > b,
.mass-mention-status-row.is-safe > b { color: #9ed8b1; }
.mass-mention-status-row.is-blocked > b { color: #ef9b9b; }
.mass-mention-status-row.is-warning > b { color: #e9c77f; }
.mass-mention-status-row.is-pending > b { color: var(--text-muted); }

.discord-autocomplete-option:disabled,
.discord-autocomplete-option[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .48;
}
.discord-autocomplete-option:disabled:hover,
.discord-autocomplete-option[aria-disabled="true"]:hover {
  background: transparent;
  color: inherit;
}

@media (max-width: 700px) {
  .platform-integration-status { grid-template-columns: 1fr; }
  .twitch-resolve-toolbar { align-items: flex-start; flex-direction: column; }
  .twitch-channel-card { grid-template-columns: 44px minmax(0, 1fr); }
  .twitch-channel-card > img { width: 44px; height: 44px; }
  .twitch-channel-card > .btn {
    width: 100%;
    grid-column: 1 / -1;
  }
  .youtube-latest-preview { grid-template-columns: 1fr; }
  .mass-mention-status-head {
    align-items: stretch;
    flex-direction: column;
  }
  .mass-mention-status-head .btn { width: 100%; }
  .mass-mention-status-grid { grid-template-columns: 1fr; }
  .social-preview-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .social-preview-label > small { text-align: left; }
  .social-discord-preview { padding: 14px; }
  .social-discord-content { padding-left: 0; }
  .social-preview-embed,
  .social-preview-link {
    margin-left: 0;
  }
  .social-preview-link { max-width: 100%; }
  .social-preview-author > b { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .discord-autocomplete-option { transition: none; }
}

/* Staff tools share the same primary action as the rest of the dashboard. */
.staff-tools-content .btn:not(.ghost):not(.danger),
.staff-embed-modal .btn:not(.ghost):not(.danger),
.config-content .dashboard-admin-section .btn:not(.ghost):not(.danger) {
  background: var(--brand-primary);
  color: var(--brand-contrast);
  border-color: var(--brand-primary);
  box-shadow: none;
}
.staff-tools-content .btn:not(.ghost):not(.danger):hover,
.staff-embed-modal .btn:not(.ghost):not(.danger):hover,
.config-content .dashboard-admin-section .btn:not(.ghost):not(.danger):hover {
  background: var(--brand-primary);
  box-shadow: none;
  filter: brightness(1.08);
  transform: none;
}
.staff-tools-content .field { margin-bottom: 18px; }
.staff-tools-content select,
.staff-embed-modal select { min-height: 40px; padding: 9px 36px 9px 12px; }
.staff-tools-content .chips { margin-bottom: 8px; flex-wrap: wrap; }
.staff-tools-content [data-org-fields] { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.staff-tools-content [data-org-status]:empty,
.staff-tools-content [data-loa-error]:empty { display: none; }
.staff-tools-content [data-org-status],
.staff-tools-content [data-loa-error] { margin: 12px 0; font-size: 13px; color: var(--text-dim); }
.staff-tools-content [data-sticky-server],
.staff-tools-content [data-loa-filter] { max-width: 480px; }
.staff-tools-content [data-sticky-list] { margin-top: 20px; }
.staff-tools-content [data-loa-save] { margin-right: 10px; }
.staff-tools-content .table-shell { max-width: 100%; }
.staff-tools-content .data-table td { vertical-align: middle; overflow-wrap: anywhere; }
.staff-tools-content .table-actions { width: max-content; }
.staff-tools-content .table-actions .btn { flex-shrink: 0; white-space: nowrap; }
.staff-tools-content .section-toolbar { gap: 16px; }
.embed-area-tabs { margin-bottom: 24px; }
#embed-area { container-type: inline-size; }
.embed-builder-workspace { grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); }
@container (max-width: 850px) {
  .embed-builder-workspace { grid-template-columns: minmax(0,1fr); }
  .embed-builder-workspace > .preview-panel { position: static; }
}
.staff-template-summary { max-width: 780px; margin-top: 24px; }
.reaction-role-panels .table-shell { max-width: 100%; overflow-x: auto; }
.reaction-role-panels .data-table td { vertical-align: middle; overflow-wrap: anywhere; }
.reaction-role-panels .table-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 200px; }
.reaction-role-panels .data-table small { display: block; margin-top: 5px; }
.reaction-role-panels .role-panel-actions { display: flex; align-items: center; gap: 12px; }
.reaction-role-panels .section-toolbar { gap: 16px; flex-wrap: wrap; }
.reaction-role-preview-reactions { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0 0 46px; }
.reaction-role-preview-reactions > span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-hover); font-size: 12px; }
.reaction-role-preview-reactions img { width: 18px; height: 18px; object-fit: contain; }
.reaction-role-plain-preview { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px 0; }
.reaction-role-editor [data-reaction-preview] { margin-top: 18px; }
.reaction-role-editor .detail-modal > .m-row { flex-wrap: wrap; }
@media (max-width: 600px) {
  .reaction-role-preview-reactions { margin-left: 0; }
  .reaction-role-panels .role-panel-actions { width: 100%; justify-content: space-between; }
  .reaction-role-editor .detail-modal > .m-row .btn { flex: 1 1 auto; min-height: 44px; }
}
.staff-template-summary > h3 { font-size: 14px; margin-bottom: 8px; }
.staff-template-review { display: flex; gap: 8px; flex-wrap: wrap; }
.staff-template-review button:last-child { background: #404249; color: #fff; }
.staff-embed-modal { padding: 20px; backdrop-filter: none; align-items: center; }
.staff-embed-modal .detail-modal {
  width: 100%; max-width: 1180px; max-height: calc(100dvh - 40px);
  background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.staff-embed-modal .detail-body { min-height: 0; overscroll-behavior: contain; }
.staff-embed-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 24px; align-items: start; }
.staff-embed-workspace > * { min-width: 0; }
.staff-embed-form .section { margin-bottom: 16px; }
.staff-embed-form .field { margin-bottom: 18px; }
.staff-embed-form .field:last-child { margin-bottom: 0; }
.staff-embed-form .section[hidden] { display: none; }
.staff-embed-workspace .preview-panel { position: sticky; top: 0; }
.staff-embed-workspace .live-message-head > div { flex-wrap: wrap; }
.staff-embed-workspace .live-message-content { white-space: pre-wrap; overflow-wrap: anywhere; }
.staff-template-variables { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.staff-template-error { color: var(--red); font-size: 13px; margin: 16px 0 0; }
.staff-template-error:empty { display: none; }
.staff-embed-modal .detail-head,
.staff-embed-modal .m-row { flex-shrink: 0; }
@media (max-width: 1099px) {
  .staff-embed-workspace { grid-template-columns: minmax(0,1fr); }
  .staff-embed-workspace .preview-panel { position: static; }
}
@media (max-width: 600px) {
  .embed-area-tabs { flex-wrap: wrap; gap: 4px; }
  .embed-area-tabs button { flex: 1 1 auto; min-height: 40px; padding: 8px 10px; }
  .staff-tools-content [data-org-fields] { grid-template-columns: minmax(0,1fr); gap: 0; }
  .staff-tools-content .section-toolbar { align-items: stretch; flex-direction: column; }
  .staff-tools-content [data-loa-save] { margin-bottom: 10px; }
  .staff-embed-modal { padding: 10px; }
  .staff-embed-modal .detail-modal { max-height: calc(100dvh - 20px); border-radius: var(--radius); padding: 16px; }
  .staff-embed-form .field-row { grid-template-columns: minmax(0,1fr); }
  .staff-embed-form .section { padding: 14px; }
  .staff-embed-workspace { gap: 16px; }
  .staff-embed-workspace .live-embed { margin-left: 0; }
  .staff-embed-workspace .live-message-content { margin-left: 0; }
  .staff-template-summary .live-embed,
  .staff-template-summary .live-message-content,
  .staff-template-summary .live-components { margin-left: 0; }
  .staff-template-summary .live-message-head > div { flex-wrap: wrap; }
}

/* ==========================================================================
   Dashboard cleanup — spaced action groups, content-only previews, optional
   field disclosures and the embed builder layout. Scoped overrides only.
   ========================================================================== */

/* ---------- Action groups: even gaps, comfortable targets, wrap on small screens ---------- */
.module-actions,
.composer-actions,
.welcome-actions,
.welcome-content .welcome-actions,
.embed-builder-actions,
.embed-action-group,
.counting-actions,
.analytics-actions,
.staff-template-review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.module-actions .btn,
.composer-actions .btn,
.welcome-actions .btn,
.welcome-content .welcome-actions .btn,
.embed-builder-actions .btn,
.embed-action-group .btn,
.counting-actions .btn {
  min-height: 40px;
  white-space: nowrap;
}
.table-actions,
.platform-row-actions,
.reaction-role-panels .table-actions,
.dashboard-admin-row-actions {
  flex-wrap: wrap;
  gap: 10px;
}
.table-actions .btn,
.platform-row-actions .btn,
.dashboard-admin-row-actions .btn {
  min-height: 38px;
  padding: 7px 13px;
  white-space: nowrap;
}
.detail-modal > .m-row,
.modal .m-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.detail-modal > .m-row .btn,
.modal .m-row .btn { min-height: 40px; }

/* Destructive actions get breathing room on both sides; DOM order is untouched. */
.module-actions .btn.danger,
.composer-actions .btn.danger,
.welcome-actions .btn.danger,
.embed-builder-actions .btn.danger,
.embed-action-group .btn.danger,
.table-actions .btn.danger,
.platform-row-actions .btn.danger,
.detail-modal > .m-row .btn.danger,
.modal .m-row .btn.danger {
  margin-inline: 6px;
  background: transparent;
  border-color: rgba(248, 113, 113, .38);
}
.module-actions .btn.danger:hover,
.composer-actions .btn.danger:hover,
.welcome-actions .btn.danger:hover,
.embed-builder-actions .btn.danger:hover,
.embed-action-group .btn.danger:hover,
.table-actions .btn.danger:hover,
.platform-row-actions .btn.danger:hover,
.detail-modal > .m-row .btn.danger:hover,
.modal .m-row .btn.danger:hover { background: var(--red-soft); }
.module-actions .btn.danger:first-child,
.composer-actions .btn.danger:first-child,
.welcome-actions .btn.danger:first-child,
.embed-builder-actions .btn.danger:first-child,
.embed-action-group .btn.danger:first-child,
.table-actions .btn.danger:first-child,
.platform-row-actions .btn.danger:first-child,
.detail-modal > .m-row .btn.danger:first-child,
.modal .m-row .btn.danger:first-child { margin-left: 0; }
.module-actions .btn.danger:last-child,
.composer-actions .btn.danger:last-child,
.welcome-actions .btn.danger:last-child,
.embed-builder-actions .btn.danger:last-child,
.embed-action-group .btn.danger:last-child,
.table-actions .btn.danger:last-child,
.platform-row-actions .btn.danger:last-child,
.detail-modal > .m-row .btn.danger:last-child,
.modal .m-row .btn.danger:last-child { margin-right: 0; }

@media (max-width: 600px) {
  .module-actions,
  .composer-actions,
  .welcome-actions,
  .welcome-content .welcome-actions,
  .embed-builder-actions,
  .embed-action-group,
  .detail-modal > .m-row,
  .modal .m-row { gap: 10px; justify-content: stretch; }
  .module-actions .btn,
  .composer-actions .btn,
  .welcome-actions .btn,
  .embed-builder-actions .btn,
  .embed-action-group .btn,
  .detail-modal > .m-row .btn,
  .modal .m-row .btn { flex: 1 1 150px; min-height: 42px; margin-inline: 0; }
  .embed-builder-actions,
  .embed-action-group { width: 100%; }
  .table-actions .btn,
  .platform-row-actions .btn { min-height: 40px; }
}

/* ---------- Content-only previews: just the authored message, no fake sender ---------- */
.live-discord-preview.content-only,
.welcome-discord-message.content-only,
.dp-msg.content-only,
.dp-message.content-only,
.social-discord-preview.content-only,
.poll-discord-message.content-only {
  min-height: 0;
  gap: 8px;
}
.live-discord-preview.content-only > .live-message-head,
.welcome-discord-message.content-only > .live-message-head,
.welcome-discord-message.content-only .live-message-head,
.dp-message.content-only .dp-avatar,
.dp-message.content-only .dp-head,
.dp-msg.content-only .dp-avatar,
.dp-msg.content-only .dp-head,
.social-discord-preview.content-only > .social-discord-head,
.poll-discord-message.content-only > .poll-message-head { display: none; }

.live-discord-preview.content-only .live-message-content,
.live-discord-preview.content-only .live-embed,
.live-discord-preview.content-only .live-components,
.live-discord-preview.content-only .live-delivery { margin-left: 0; }
.live-discord-preview.content-only .live-message-content { margin-top: 0; margin-bottom: 8px; }
.live-discord-preview.content-only .live-message-content:last-child { margin-bottom: 0; }
.live-discord-preview.content-only .live-embed + .live-components { margin-top: 8px; }
.live-discord-preview.content-only .live-delivery { margin-top: 10px; padding-inline: 0; }

/* Welcome (incl. the high-specificity inline preview rules) */
.welcome-discord-message.content-only .welcome-discord-embed,
.welcome-discord-message.content-only .welcome-plain-payload,
.welcome-discord-message.content-only .welcome-embed-outside,
.welcome-discord-message.content-only .welcome-preview-disabled,
.welcome-content #welcome-inline-preview .welcome-discord-message.content-only .welcome-discord-embed,
.welcome-content #welcome-inline-preview .welcome-discord-message.content-only .welcome-plain-payload,
.welcome-content #welcome-inline-preview .welcome-discord-message.content-only .welcome-embed-outside,
.welcome-content #welcome-inline-preview .welcome-discord-message.content-only .welcome-preview-disabled {
  margin-left: 0;
}
.welcome-content #welcome-inline-preview .welcome-discord-message.content-only .welcome-discord-embed {
  width: 100%;
  max-width: 1020px;
  min-height: 0;
}
.welcome-discord-message.content-only .welcome-discord-embed { width: 100%; max-width: 560px; }
.welcome-discord-message.content-only .welcome-plain-payload { max-width: 100%; }
.welcome-discord-message.content-only .welcome-preview-disabled { margin-bottom: 10px; }
.welcome-discord-message.content-only .welcome-embed-outside { margin-block: 8px; }
.welcome-discord-message.content-only > :first-child { margin-top: 0; }
.welcome-discord-message.content-only > :last-child { margin-bottom: 0; }

/* Social Hub preview */
.dp-msg.content-only,
.dp-message.content-only { gap: 0; padding: 14px; }
.dp-msg.content-only .dp-right,
.dp-message.content-only .dp-right { width: 100%; }
.dp-msg.content-only .dp-embed,
.dp-message.content-only .dp-embed { max-width: 100%; margin-left: 0; }

/* Social alert preview */
.social-discord-preview.content-only { padding: 14px; }
.social-discord-preview.content-only .social-discord-content { padding-left: 0; }
.social-discord-preview.content-only .social-preview-embed { margin-left: 0; width: 100%; max-width: 590px; }

/* Polls */
.poll-discord-message.content-only { padding: 16px; }
.poll-discord-message.content-only .poll-embed {
  width: 100%;
  max-width: 760px;
  margin: 0;
}
.poll-discord-message.content-only .poll-message-content {
  width: auto;
  max-width: 100%;
  margin: 0 0 8px;
  padding-right: 27px;
}
.poll-discord-message.content-only .poll-reactions { margin-left: 0; flex-wrap: wrap; }

@media (min-width: 901px) {
  .live-discord-preview.content-only .live-message-content,
  .live-discord-preview.content-only .live-embed,
  .live-discord-preview.content-only .live-components,
  .live-discord-preview.content-only .live-delivery,
  .welcome-discord-message.content-only .welcome-discord-embed,
  .poll-discord-message.content-only .poll-embed,
  .poll-discord-message.content-only .poll-message-content { margin-left: 0; }
}
@media (max-width: 600px) {
  .live-discord-preview.content-only,
  .welcome-discord-message.content-only,
  .poll-discord-message.content-only,
  .social-discord-preview.content-only { padding: 12px; }
  .welcome-discord-message.content-only .welcome-discord-embed,
  .poll-discord-message.content-only .poll-embed { width: 100%; }
  .poll-discord-message.content-only .poll-message-content { max-width: 100%; margin-left: 0; }
}

/* Quiet empty state when there's nothing authored to preview */
.live-preview-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 140px;
  padding: 24px 20px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}
.live-preview-empty b,
.live-preview-empty strong { color: var(--text-dim); font-size: 13px; font-weight: 650; }
.live-preview-empty p,
.live-preview-empty span,
.live-preview-empty small { max-width: 34ch; margin: 0; color: var(--text-faint); }
.live-preview-empty svg { width: 22px; height: 22px; opacity: .6; }

/* ---------- Optional disclosures rendered by renderField ---------- */
.field.optional-fields { margin-bottom: 12px; }
.optional-fields > details {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, .012);
  transition: border-color .16s, background .16s;
}
.optional-fields > details:hover { border-color: var(--border); }
.optional-fields > details[open] {
  border-color: var(--border);
  background: var(--bg-card);
}
.optional-fields > details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px 8px 14px;
  border-radius: 10px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.optional-fields > details > summary::-webkit-details-marker { display: none; }
.optional-fields > details > summary::marker { content: ""; }
.optional-fields > details > summary::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-faint);
  border-bottom: 1.5px solid var(--text-faint);
  transform: rotate(-45deg);
  transition: transform .16s var(--ease);
}
.optional-fields > details[open] > summary::before { transform: rotate(45deg); }
.optional-fields > details > summary:focus-visible {
  outline: 0;
  box-shadow: var(--ring);
}
.optional-fields > details > summary > span:first-of-type {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.optional-fields .optional-state {
  flex: 0 0 auto;
  padding: 2px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}
.optional-fields > details:has(.optional-remove:not([hidden])) .optional-state {
  border-color: rgba(var(--brand-primary-rgb), .4);
  background: rgba(var(--brand-primary-rgb), .1);
  color: var(--brand-secondary);
}
.optional-fields .optional-remove {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--text-dim);
  font-size: 11.5px;
}
.optional-fields .optional-remove[hidden] { display: none !important; }
.optional-fields .optional-remove:hover { border-color: rgba(248, 113, 113, .4); color: var(--red); }
.optional-fields-body {
  padding: 14px 14px 4px;
  border-top: 1px solid var(--border-soft);
}
.optional-fields-body > .field:last-child { margin-bottom: 14px; }
.discord-format-help { margin-top: 6px; color: var(--text-faint); font-size: 11px; }
.discord-format-help > summary { cursor: pointer; width: fit-content; }
.discord-format-help > div { padding-block: 7px 2px; line-height: 1.6; }
.poll-discord-message.content-only .poll-copy { padding-right: 0; }
.poll-discord-message.content-only .poll-reactions span { justify-content: center; }
.live-link-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-right: 22px; }
.live-link-buttons > a,
.live-link-buttons > .is-invalid {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #5c5e66;
  border-radius: 5px;
  background: #4e5058;
  color: #f2f3f5;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.live-link-buttons > a:hover { background: #62646d; }
.live-components > .preview-pencil { min-height: 0; width: 20px; height: 20px; padding: 0; border-radius: 50%; background: #2488ff; color: white; }
.live-link-buttons > .is-invalid { border-color: var(--red); }
.live-link-buttons > a > svg,
.live-link-buttons > .is-invalid > svg { flex: 0 0 14px; width: 14px; height: 14px; }
.live-link-buttons img,
.live-quick-link img { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }
.live-quick-link { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 5px; overflow-wrap: anywhere; }
.live-quick-link small { width: 100%; color: #b5bac1; }
.live-embed-links { margin-top: 10px; }
.live-links-heading { display: block; margin-bottom: 6px; }
.is-inline-links > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.is-inline-links > div > i { color: #949ba4; font-style: normal; }
.is-bullet-links > .live-quick-link { display: flex; margin-block: 5px; }
.live-quick-links-field > div > span { display: grid; gap: 6px; }
@media (max-width: 600px) {
  .optional-fields > details > summary { flex-wrap: wrap; row-gap: 6px; }
  .optional-fields .optional-remove { min-height: 36px; }
  .optional-fields-body { padding: 12px 12px 2px; }
}

/* ---------- Embed builder page ---------- */
.embed-builder-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.embed-builder-page > * { min-width: 0; }
.embed-builder-page .embed-builder-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}
.embed-builder-page .embed-builder-workspace > * { min-width: 0; }
@container (max-width: 850px) {
  .embed-builder-page .embed-builder-workspace { grid-template-columns: minmax(0, 1fr); }
  .embed-builder-page .embed-builder-workspace > .preview-panel { position: static; }
}
@media (max-width: 1000px) {
  .embed-builder-page .embed-builder-workspace { grid-template-columns: minmax(0, 1fr); }
  .embed-builder-page .embed-builder-workspace > .preview-panel { position: static; }
}
.embed-editor-basics {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-card);
}
.embed-editor-basics > .field { margin-bottom: 0; }
.embed-editor-basics .field-row { gap: 14px; }
.embed-editor-basics .field .help,
.embed-options .field .help { font-size: 12px; line-height: 1.5; }
.embed-options {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.embed-options > details,
.embed-options > .field.optional-fields { margin-bottom: 0; }
.embed-options details.section,
.embed-options > details:not(.field) {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, .012);
}
.embed-options > details:not(.field) > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
  list-style: none;
  cursor: pointer;
}
.embed-options > details:not(.field) > summary::-webkit-details-marker { display: none; }
.embed-options > details:not(.field) > summary:focus-visible { outline: 0; box-shadow: var(--ring); }
.embed-options > details:not(.field)[open] { border-color: var(--border); background: var(--bg-card); }
.embed-options > details:not(.field) > :not(summary) { margin-inline: 14px; }
.embed-options > details:not(.field) > :nth-child(2) { margin-top: 4px; }
.embed-options > details:not(.field) > :last-child { margin-bottom: 14px; }
.embed-builder-actions {
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.embed-action-group { gap: 10px; }
.embed-preset-section {
  margin-top: 4px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-card);
}
.embed-preset-section > h2,
.embed-preset-section > h3 { margin-bottom: 4px; font-size: 14px; }
.embed-preset-section .table-shell { max-width: 100%; margin-top: 12px; overflow-x: auto; }
.embed-preset-section .data-table { min-width: 520px; }
.embed-preset-section .data-table td { vertical-align: middle; }
.embed-preset-section .truncate-cell { max-width: 260px; }
.embed-preset-section .table-actions { justify-content: flex-end; }
@media (max-width: 600px) {
  .embed-editor-basics,
  .embed-preset-section { padding: 14px; }
  .embed-builder-actions { flex-direction: column; align-items: stretch; }
  .embed-builder-actions > .btn { flex: 0 0 auto; }
  .embed-action-group { min-width: 0; }
  .embed-preset-section .data-table { min-width: 460px; }
}
@media (max-width: 900px) {
  .content { padding-inline: 18px; }
}

.obj-empty { padding: 16px; border: 1px dashed var(--border); border-radius: 8px; color: var(--text-faint); font-size: 12px; text-align: center; }

/* ==========================================================================
   Giveaways workspace and Anti-Nuke setup (scoped; appended last so it wins
   over the earlier compact/size-override layers without touching them)
   ========================================================================== */

/* ---------- giveaways: page head and toolbar ---------- */
#content.giveaways-content { min-width: 0; }
#content.giveaways-content > * { min-width: 0; }
#content.giveaways-content .giveaway-page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  margin-bottom: 18px;
}
#content.giveaways-content .giveaway-page-head > div { min-width: 0; flex: 1 1 320px; }
#content.giveaways-content .giveaway-page-head h1 { margin: 0 0 3px; font-size: 20px; line-height: 1.25; font-weight: 720; }
#content.giveaways-content .giveaway-page-head p { max-width: 62ch; margin: 0; color: var(--text-faint); font-size: 13px; line-height: 1.55; }
#content.giveaways-content .giveaway-page-head .btn { flex: 0 0 auto; min-height: 40px; padding: 0 18px; font-size: 13px; }

#content.giveaways-content .giveaway-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap;
  margin-bottom: 14px;
}
#content.giveaways-content .giveaway-filters {
  display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; padding: 3px;
  border: 1px solid var(--border-soft); border-radius: 11px; background: var(--bg-card);
}
#content.giveaways-content .giveaway-filters button {
  min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px;
  color: var(--text-dim); font-size: 13px; font-weight: 620; white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#content.giveaways-content .giveaway-filters button:hover { background: var(--bg-hover); color: var(--text); }
#content.giveaways-content .giveaway-filters button.active {
  border-color: rgba(var(--brand-primary-rgb), 0.45); background: var(--accent-soft); color: #fff;
}
#content.giveaways-content .giveaway-filters button:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 1px; }
#content.giveaways-content .giveaway-refresh { flex: 0 0 auto; min-height: 40px; padding: 0 16px; font-size: 13px; }

/* ---------- giveaways: list rows ---------- */
#content.giveaways-content .giveaway-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
#content.giveaways-content .giveaway-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(96px, auto) 156px minmax(130px, 170px);
  align-items: center; gap: 12px 24px; min-width: 0; padding: 16px 18px;
  border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--bg-card);
  transition: border-color 0.15s, background 0.15s;
}
#content.giveaways-content .giveaway-row:hover,
#content.giveaways-content .giveaway-row:focus-within { border-color: var(--border); background: var(--bg-card-2); }
#content.giveaways-content .giveaway-row > * { min-width: 0; }
#content.giveaways-content .giveaway-copy h2 {
  margin: 0 0 3px; font-size: 15.5px; line-height: 1.3; font-weight: 680; overflow-wrap: anywhere;
}
#content.giveaways-content .giveaway-copy p {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere;
}
#content.giveaways-content .giveaway-meta {
  display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 8px;
  color: var(--text-faint); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere;
}
#content.giveaways-content .giveaway-state { display: flex; align-items: center; }
#content.giveaways-content .giveaway-state .status,
#content.giveaways-content .giveaway-state .pill,
#content.giveaways-content .giveaway-state .badge { min-height: 24px; padding: 3px 9px; font-size: 12px; }
#content.giveaways-content .giveaway-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#content.giveaways-content .giveaway-counts strong,
#content.giveaways-content .giveaway-timing strong {
  display: block; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
#content.giveaways-content .giveaway-counts strong { font-size: 18px; line-height: 1.2; }
#content.giveaways-content .giveaway-timing strong { font-size: 13.5px; line-height: 1.35; }
#content.giveaways-content .giveaway-counts small,
#content.giveaways-content .giveaway-timing small {
  display: block; margin-top: 2px; color: var(--text-faint); font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere;
}
#content.giveaways-content .giveaway-row-actions {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--border-soft);
}
#content.giveaways-content .giveaway-row-actions .btn,
#content.giveaways-content .giveaway-row-actions a.btn {
  min-height: 40px; padding: 0 14px; font-size: 13px; text-decoration: none;
}

#content.giveaways-content .giveaway-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 44px 20px;
  border: 1px dashed var(--border); border-radius: var(--radius); text-align: center;
}
#content.giveaways-content .giveaway-empty h2 { margin: 0; font-size: 16px; font-weight: 680; }
#content.giveaways-content .giveaway-empty p { max-width: 46ch; margin: 0 0 10px; color: var(--text-faint); font-size: 13px; line-height: 1.55; }
#content.giveaways-content .giveaway-empty .btn { min-height: 40px; padding: 0 18px; font-size: 13px; }

@media (max-width: 1180px) {
  #content.giveaways-content .giveaway-row { grid-template-columns: minmax(96px, auto) minmax(150px, auto) minmax(0, 1fr); gap: 12px 28px; }
  #content.giveaways-content .giveaway-copy { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  #content.giveaways-content .giveaway-page-head h1 { font-size: 18px; }
  #content.giveaways-content .giveaway-page-head p { font-size: 12.5px; }
}
@media (max-width: 640px) {
  #content.giveaways-content .giveaway-page-head .btn { width: 100%; min-height: 44px; }
  #content.giveaways-content .giveaway-toolbar { align-items: stretch; flex-direction: column; }
  #content.giveaways-content .giveaway-filters { width: 100%; }
  #content.giveaways-content .giveaway-filters button { flex: 1 1 auto; padding: 0 10px; }
  #content.giveaways-content .giveaway-refresh { width: 100%; min-height: 44px; }
  #content.giveaways-content .giveaway-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 14px; gap: 12px 16px; }
  #content.giveaways-content .giveaway-state { grid-column: 1 / -1; }
  #content.giveaways-content .giveaway-counts { grid-column: 1 / -1; }
  #content.giveaways-content .giveaway-timing { grid-column: 1 / -1; }
  #content.giveaways-content .giveaway-row-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  #content.giveaways-content .giveaway-row-actions .btn,
  #content.giveaways-content .giveaway-row-actions a.btn { min-height: 44px; padding: 0 10px; }
  #content.giveaways-content .giveaway-empty { padding: 32px 16px; }
  #content.giveaways-content .giveaway-empty .btn { width: 100%; min-height: 44px; }
}

/* ---------- giveaways: editor modal ---------- */
.giveaway-editor { padding: 16px; }
.giveaway-editor .modal {
  display: flex; flex-direction: column; width: 100%; max-width: min(1040px, 100%);
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); min-width: 0;
  padding: 20px 24px;
}
.giveaway-editor .detail-head { flex: 0 0 auto; }
.giveaway-editor .detail-body {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 4px 4px 2px;
}
.giveaway-editor .m-row { flex: 0 0 auto; }
.giveaway-editor-workspace {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); align-items: start; gap: 24px;
  min-width: 0;
}
.giveaway-editor-workspace > * { min-width: 0; }
.giveaway-preview-panel { display: grid; gap: 14px; align-content: start; min-width: 0; }

.giveaway-form { min-width: 0; }
.giveaway-form .section {
  margin: 0; padding: 18px 0 20px; border: 0; border-top: 1px solid var(--border-soft); border-radius: 0; background: none;
}
.giveaway-form .section:first-child { padding-top: 0; border-top: 0; }
.giveaway-form .section > h2 { margin: 0 0 4px; font-size: 14px; font-weight: 680; }
.giveaway-form .section > .hint { padding-bottom: 12px; font-size: 12.5px; line-height: 1.5; }
.giveaway-form .field { margin-bottom: 14px; }
.giveaway-form .field:last-child { margin-bottom: 0; }
.giveaway-form .field > label { margin-bottom: 6px; font-size: 13px; }
.giveaway-form .field .help { margin-top: 5px; font-size: 12.5px; line-height: 1.5; }
.giveaway-form .field-row { gap: 14px; }
.giveaway-form .field-row > * { min-width: 0; }
.giveaway-editor input:not([type="checkbox"]):not([type="color"]),
.giveaway-editor select {
  min-height: 42px; padding: 9px 12px; border-radius: 9px; font-size: 14px; line-height: 1.4;
}
.giveaway-editor textarea { min-height: 96px; padding: 10px 12px; border-radius: 9px; font-size: 14px; line-height: 1.55; }

.giveaway-role-bonuses { display: grid; gap: 8px; min-width: 0; }
.giveaway-role-bonuses .obj-list { gap: 8px; }
.giveaway-role-bonuses .obj-head { min-height: 46px; }
.giveaway-role-bonuses .obj-head .obj-title,
.giveaway-role-bonuses .obj-head .obj-sub { font-size: 13px; }
.giveaway-role-bonuses .obj-head .rm { min-height: 36px; padding: 6px 11px; font-size: 12.5px; }
.giveaway-role-bonuses .obj-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.giveaway-role-bonuses .obj-grid .span2 { grid-column: 1 / -1; }
.giveaway-role-bonuses .obj-grid > * { min-width: 0; }

.giveaway-entry-example {
  min-width: 0; padding: 14px; border: 1px solid rgba(var(--brand-primary-rgb), 0.28);
  border-radius: 11px; background: rgba(var(--brand-primary-rgb), 0.05);
}
.giveaway-entry-example h3 { margin: 0; font-size: 14px; font-weight: 680; line-height: 1.35; }
.giveaway-entry-example p { margin: 3px 0 12px; color: var(--text-dim); font-size: 12.5px; line-height: 1.5; }
.giveaway-entry-example .giveaway-role-options,
.giveaway-entry-example > div:not(.giveaway-entry-result) {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 6px;
}
.giveaway-entry-example label {
  display: flex; align-items: center; gap: 9px; min-height: 40px; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--border-soft); border-radius: 8px; background: var(--bg-input);
  color: var(--text-dim); font-size: 13px; line-height: 1.35; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.giveaway-entry-example label:hover { border-color: var(--border-strong); color: var(--text); }
.giveaway-entry-example label:has(input:checked) {
  border-color: rgba(var(--brand-primary-rgb), 0.55); background: var(--accent-soft); color: var(--text);
}
.giveaway-entry-example label:focus-within { box-shadow: var(--ring); }
.giveaway-entry-example input[type="checkbox"] {
  flex: 0 0 auto; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0;
  accent-color: var(--brand-primary); cursor: pointer;
}
.giveaway-entry-example label span { min-width: 0; overflow-wrap: anywhere; }
.giveaway-entry-example label span:first-of-type { flex: 1 1 auto; }
.giveaway-entry-example label span + span { flex: 0 0 auto; color: var(--text-faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.giveaway-entry-result {
  display: flex; align-items: baseline; gap: 6px 14px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}
.giveaway-entry-result strong { flex: 0 0 auto; color: #fff; font-size: 28px; line-height: 1; font-weight: 720; font-variant-numeric: tabular-nums; }
.giveaway-entry-result small { flex: 1 1 0; min-width: 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }

.giveaway-rule-summary { display: grid; margin: 0; padding: 0; list-style: none; min-width: 0; }
.giveaway-rule-summary > li,
.giveaway-rule-summary > div {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 12px;
  padding: 9px 0; border-top: 1px solid var(--border-soft); color: var(--text-dim); font-size: 13px; line-height: 1.45;
}
.giveaway-rule-summary > :first-child { padding-top: 0; border-top: 0; }
.giveaway-rule-summary strong,
.giveaway-rule-summary b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.giveaway-rule-summary small,
.giveaway-rule-summary p { flex: 1 0 100%; margin: 0; color: var(--text-faint); font-size: 12.5px; line-height: 1.5; }

.giveaway-preview-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden;
  border: 1px solid var(--border-soft); border-radius: 9px; background: var(--border-soft);
}
.giveaway-preview-stats > * { min-width: 0; padding: 10px 12px; background: #080808; }
.giveaway-preview-stats strong,
.giveaway-preview-stats b,
.giveaway-preview-stats dd { display: block; margin: 0; color: var(--text); font-size: 14px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.giveaway-preview-stats small,
.giveaway-preview-stats dt { display: block; margin: 0 0 2px; color: var(--text-faint); font-size: 12px; font-weight: 500; line-height: 1.35; }
.live-embed .giveaway-preview-stats { gap: 8px 14px; margin-top: 10px; border: 0; background: none; }
.live-embed .giveaway-preview-stats > * { padding: 0; background: none; }

.giveaway-preview-panel .live-message-content,
.giveaway-preview-panel .live-embed { margin-left: 0; }
.giveaway-preview-panel .live-embed { padding: 12px 12px 10px 14px; overflow-wrap: anywhere; }
.giveaway-preview-panel .live-discord-preview { padding: 12px; }

.giveaway-editor-note { flex: 0 0 auto; margin: 12px 0 0; color: var(--text-faint); font-size: 12.5px; line-height: 1.5; }
.giveaway-form-error {
  flex: 0 0 auto; margin: 12px 0 0; padding: 10px 12px; border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 9px; background: var(--red-soft); color: var(--red); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere;
}
.giveaway-form-error:empty { display: none; }

@media (max-width: 900px) {
  .giveaway-editor-workspace { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 640px) {
  .giveaway-editor { padding: 0; }
  .giveaway-editor .modal {
    max-height: 92vh; max-height: 92dvh; padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  }
  .giveaway-editor .detail-body { padding-right: 2px; }
  .giveaway-form .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .giveaway-form .field-row > .field { margin-bottom: 14px; }
  .giveaway-form .field-row > .field:last-child { margin-bottom: 0; }
  .giveaway-role-bonuses .obj-head .rm { min-height: 40px; }
  .giveaway-entry-result strong { font-size: 24px; }
  .giveaway-editor .m-row .btn { min-height: 44px; }
}

/* ---------- anti-nuke: plain-language rule setup ---------- */
#content.antinuke-content { min-width: 0; }
#content.antinuke-content > * { min-width: 0; }
#content.antinuke-content .nuke-explanation {
  max-width: 72ch; margin: 0 0 16px; color: var(--text-dim); font-size: 14px; line-height: 1.65;
}
#content.antinuke-content .nuke-quick-summary {
  margin: 0 0 16px; padding: 0 0 14px; border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim); font-size: 13px; line-height: 1.6; list-style: none;
}
#content.antinuke-content .nuke-quick-summary > li,
#content.antinuke-content .nuke-quick-summary > span { display: inline-block; margin-right: 18px; }
#content.antinuke-content .nuke-quick-summary strong,
#content.antinuke-content .nuke-quick-summary b { color: var(--text); font-weight: 650; }
#content.antinuke-content .nuke-status-summary {
  margin: 0 0 14px; padding: 11px 13px; border: 1px solid var(--border-soft); border-radius: 9px;
  background: var(--bg-input); color: var(--text-dim); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere;
}
#content.antinuke-content .nuke-status-summary strong,
#content.antinuke-content .nuke-status-summary b { color: var(--text); font-weight: 650; }

#content.antinuke-content .nuke-rule-list {
  min-width: 0; overflow: hidden; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--bg-card);
}
#content.antinuke-content .nuke-rule-group {
  min-width: 0; padding: 16px 18px 18px; border-top: 1px solid var(--border-soft); transition: background 0.15s;
}
#content.antinuke-content .nuke-rule-group:first-child { border-top: 0; }
#content.antinuke-content .nuke-rule-group:hover,
#content.antinuke-content .nuke-rule-group:focus-within { background: rgba(255, 255, 255, 0.015); }
#content.antinuke-content .nuke-rule-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
#content.antinuke-content .nuke-rule-head h3 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 14.5px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
#content.antinuke-content .nuke-rule-head .switch,
#content.antinuke-content .nuke-rule-head .switch-label { flex: 0 0 auto; }
#content.antinuke-content .nuke-rule-description {
  max-width: 70ch; margin: 4px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.55;
}
#content.antinuke-content .nuke-rule-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; margin-top: 14px;
}
#content.antinuke-content .nuke-rule-fields > * { min-width: 0; }
#content.antinuke-content .nuke-rule-fields .field { margin: 0; }
#content.antinuke-content .nuke-rule-fields .field > label { margin-bottom: 6px; font-size: 13px; }
#content.antinuke-content .nuke-rule-fields .field .help { font-size: 12.5px; line-height: 1.5; }
#content.antinuke-content .nuke-rule-fields input:not([type="checkbox"]):not([type="color"]),
#content.antinuke-content .nuke-rule-fields select { min-height: 42px; padding: 9px 12px; border-radius: 9px; font-size: 14px; }
#content.antinuke-content .nuke-rule-sentence {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 9px; background: rgba(var(--brand-primary-rgb), 0.07);
  color: var(--text); font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere;
}
#content.antinuke-content .nuke-rule-sentence strong,
#content.antinuke-content .nuke-rule-sentence b { color: var(--brand-secondary); font-weight: 680; }

/* the shared accordion is tuned for dense reference rows; give the collapsed optional sections readable sizes here */
#content.antinuke-content .reference-accordion > summary { min-height: 52px; padding: 9px 16px; transition: background 0.15s; }
#content.antinuke-content .reference-accordion > summary:hover { background: var(--bg-hover); }
#content.antinuke-content .reference-accordion > summary:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -2px; }
#content.antinuke-content .reference-accordion > summary b { font-size: 13px; line-height: 1.3; }
#content.antinuke-content .reference-accordion > summary small { margin-top: 2px; font-size: 12.5px; line-height: 1.35; }
#content.antinuke-content .reference-accordion .accordion-body { padding: 14px 16px 16px; font-size: 13px; line-height: 1.55; }

@media (max-width: 640px) {
  #content.antinuke-content .nuke-rule-group { padding: 14px; }
  #content.antinuke-content .nuke-rule-fields { grid-template-columns: minmax(0, 1fr); }
  #content.antinuke-content .nuke-quick-summary > li,
  #content.antinuke-content .nuke-quick-summary > span { display: block; margin-right: 0; }
  #content.antinuke-content .reference-accordion > summary { min-height: 56px; }
}
#content.antinuke-content .nuke-rule-head { cursor: pointer; list-style: none; }
#content.antinuke-content .nuke-rule-head::-webkit-details-marker { display: none; }
#content.antinuke-content .nuke-rule-head > div { min-width: 0; flex: 1; }
#content.antinuke-content .nuke-rule-head > svg { flex: 0 0 16px; width: 16px; height: 16px; transition: transform .15s; }
#content.antinuke-content .nuke-rule-group[open] > .nuke-rule-head > svg { transform: rotate(90deg); }
#content.antinuke-content .nuke-rule-head:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 4px; }
#content.antinuke-content .nuke-rule-fields { display: block; }
#content.antinuke-content .nuke-rule-fields .field { margin-top: 14px; }
.giveaway-preview-panel .preview-panel > h2 { margin-bottom: 12px; }
.giveaway-entry-example label small { color: var(--text-faint); }
.giveaway-editor .m-row .btn { min-height: 42px; }
.giveaway-preview-panel .preview-panel { position: static; margin: 0; }
.giveaway-preview-panel > .section { margin: 0; }
.giveaway-preview-stats > :last-child { grid-column: 1 / -1; }
#content.antinuke-content summary .nuke-quick-summary { margin: 0; padding: 0; border: 0; }
.giveaway-message-buttons { display: flex; gap: 8px; margin-top: 8px; }
.giveaway-message-buttons button { min-height: 34px; padding: 6px 14px; border-radius: 5px; background: #248046; color: white; font-size: 13px; }
.giveaway-message-buttons button + button { background: #4e5058; }
@media (max-width: 640px) { .giveaway-editor .m-row .btn { min-height: 44px; } }
/* Optional inline timestamp helper, shared by message and embed text fields. */
.discord-timestamp { background:rgba(154,158,170,.16); border-radius:3px; padding:1px 3px; white-space:normal; }
.timestamp-picker { margin-top:10px; font-size:13px; }
.timestamp-picker > summary { cursor:pointer; width:fit-content; padding:8px 0; color:var(--accent, #a78bfa); }
.timestamp-picker-body { display:grid; gap:14px; padding:16px; margin-top:4px; border:1px solid var(--border, #29292f); border-radius:10px; background:rgba(255,255,255,.018); }
.timestamp-picker-grid { display:grid; grid-template-columns:minmax(0, 1.2fr) minmax(0, 1fr); gap:14px; }
.timestamp-picker-body label { display:block; margin-bottom:7px; }
.timestamp-picker-body input, .timestamp-picker-body select { width:100%; min-width:0; box-sizing:border-box; min-height:40px; }
.timestamp-picker-body .help { margin:0; line-height:1.5; }
.timestamp-picker-preview { display:grid; gap:6px; overflow-wrap:anywhere; }
.timestamp-picker-code { display:flex; gap:10px; min-width:0; }
.timestamp-picker-code input { flex:1; font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:12px; }
.timestamp-picker-code .btn { flex-shrink:0; }
.timestamp-picker-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.timestamp-picker-actions .btn { flex-shrink:0; }
@media (max-width:640px) {
  .timestamp-picker-grid { grid-template-columns:minmax(0, 1fr); }
  .timestamp-picker-body { padding:12px; }
  .timestamp-picker .btn, .timestamp-picker-body input, .timestamp-picker-body select { min-height:44px; }
  .timestamp-picker-actions { align-items:flex-start; }
}
/* AutoMod configuration and operational status. */
#content.automod-content { max-width: 1560px; }
.automod-content .mod-head {
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 24px;
  margin: 0 0 28px;
}
.automod-content .mod-head > div:first-child { min-width: 0; }
.automod-content .mod-head h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.automod-content .mod-head .page-sub { margin: 7px 0 0; font-size: 14px; line-height: 1.5; }
.automod-content .mod-head .switch-label { flex-shrink: 0; gap: 12px; font-size: 13px; }
.automod-policy-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--border);
}
.automod-policy-strip > div { min-width: 0; display: grid; align-content: start; gap: 6px; }
.automod-policy-strip b { font-size: 13px; line-height: 1.5; }
.automod-policy-strip span { color: var(--text-dim); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.automod-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  align-items: start;
  gap: 24px;
  margin-top: 24px;
}
.automod-form, .automod-sidebar { min-width: 0; display: grid; align-content: start; gap: 20px; }
.automod-workspace .section {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  margin: 0;
  padding: 24px;
}
.automod-workspace .section > h2 { margin: 0; font-size: 15px; line-height: 1.4; }
.automod-content .hint { margin: 0; padding: 0; color: var(--text-dim); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.automod-fields, .automod-test-fields { display: grid; gap: 18px; min-width: 0; }
.automod-workspace .field, .automod-workspace .field:first-child { min-width: 0; margin: 0; }
.automod-workspace .field > label { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.automod-workspace .field .help { margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; overflow-wrap: anywhere; }
.automod-workspace .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.automod-workspace .toggle-field { min-width: 0; gap: 18px; padding: 14px 16px; }
.automod-workspace .toggle-field .t-label { min-width: 0; }
.automod-workspace .toggle-field .t-label b { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.automod-workspace .toggle-field .t-label span { display: block; margin-top: 5px; font-size: 12.5px; line-height: 1.6; overflow-wrap: anywhere; }
.automod-workspace .toggle-field .switch { flex-shrink: 0; margin: 0; }
.automod-workspace .reference-accordion { min-width: 0; margin: 0; }
.automod-workspace .reference-accordion > summary {
  min-height: 50px;
  gap: 16px;
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.automod-workspace .reference-accordion > summary::after {
  content: '';
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  margin: 0 3px 4px;
  border-right: 1.5px solid var(--text-dim);
  border-bottom: 1.5px solid var(--text-dim);
  transform: rotate(45deg);
}
.automod-workspace .reference-accordion[open] > summary::after { margin-bottom: 0; transform: rotate(225deg); }
.automod-workspace .reference-accordion > summary:hover { background: var(--bg-hover); }
.automod-workspace .reference-accordion > summary:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -3px; }
.automod-workspace .reference-accordion .accordion-body { padding: 18px 16px; }
.automod-workspace .reference-accordion[open] > .accordion-body { display: grid; gap: 18px; }
.automod-workspace textarea, .automod-workspace select { display: block; width: 100%; min-width: 0; max-width: 100%; }
.automod-workspace textarea { resize: vertical; }
.automod-status-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: baseline; gap: 12px; font-size: 13px; line-height: 1.5; }
.automod-status-line + .automod-status-line { margin-top: 16px; }
.automod-status-line > span { color: var(--text-dim); }
.automod-status-line > b { text-align: right; overflow-wrap: anywhere; }
.automod-native-rules { margin: 20px 0; }
.automod-native-rules > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 8px 16px; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.5; }
.automod-native-rules > div > span { overflow-wrap: anywhere; }
.automod-native-rules > div > b { text-align: right; }
.automod-native-rules small { grid-column: 1 / -1; color: var(--text-dim); font-size: 12.5px; line-height: 1.6; overflow-wrap: anywhere; }
.automod-content .is-good { color: #92d7ad; }
.automod-content .is-bad, .automod-content .automod-problem { color: #e7a3a9; }
.automod-problem { display: block; font-size: 12.5px; line-height: 1.6; margin-top: 12px; overflow-wrap: anywhere; }
.automod-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.automod-actions .btn { flex: 1 1 140px; min-height: 42px; white-space: normal; line-height: 1.4; }
.automod-ai-test { display: flex; gap: 10px; align-items: center; margin: 0; font-size: 13px; line-height: 1.5; cursor: pointer; }
.automod-ai-test input { flex: 0 0 16px; width: 16px; height: 16px; margin: 0; }
.automod-ai-test span { min-width: 0; }
.automod-test-fields > .btn { min-height: 42px; justify-self: start; }
.automod-test-result { padding: 14px; margin: 0; background: rgba(100,180,130,.08); border: 1px solid #344c3d; border-radius: 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.automod-test-result.is-blocked { background: rgba(220,100,100,.06); border-color: #563638; }
.automod-test-result[hidden] { display: none; }
.automod-history { margin-top: 24px; padding: 24px; }
.automod-history .section-toolbar { flex-wrap: wrap; align-items: baseline; }
.automod-history .section-toolbar h2 { margin: 0; font-size: 15px; line-height: 1.5; }
.automod-history .reference-empty { padding: 28px 16px; font-size: 13px; line-height: 1.6; }
.automod-event { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.automod-event:last-child { border-bottom: 0; }
.automod-event > div { min-width: 0; }
.automod-event b { display: block; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.automod-event small { display: block; color: var(--text-dim); font-size: 12.5px; line-height: 1.6; margin-top: 6px; overflow-wrap: anywhere; }
.automod-event .status { flex-shrink: 0; }
.automod-exempt-channels { display: flex; flex-wrap: wrap; gap: 8px; }
.automod-exempt-channels:not(:empty) { margin: 0 0 12px; }
.automod-exempt-channels .btn { min-width: 0; height: auto; text-align: left; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1200px) {
  .automod-workspace { grid-template-columns: minmax(0, 1fr); }
  .automod-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 700px) {
  .automod-content .mod-head { align-items: flex-start; gap: 16px; }
  .automod-content .mod-head h1 { font-size: 22px; }
  .automod-content .mod-head .page-sub { font-size: 13px; }
  .automod-content .mod-head .switch-label { padding-top: 2px; }
  .automod-policy-strip { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .automod-sidebar { grid-template-columns: minmax(0, 1fr); }
  .automod-workspace .section { padding: 20px 18px; }
  .automod-history { padding: 20px 18px; }
  .automod-workspace .field-row { grid-template-columns: minmax(0, 1fr); }
  .automod-workspace .toggle-field { gap: 14px; padding: 14px; }
  .automod-event { align-items: flex-start; flex-direction: column; gap: 10px; }
  .automod-workspace .btn, .automod-workspace select { min-height: 44px; }
  .automod-test-fields > .btn { justify-self: stretch; }
}
@media (max-width: 360px) {
  .automod-content .mod-head { flex-wrap: wrap; }
  .automod-content .mod-head .switch-label { padding-top: 0; }
}
