/* dashboard styles */

:root {
  --ink: #0d0d0f;
  --ink-2: #0d0d0f;
  --panel: #16161a;
  --panel-2: #1c1c21;
  --panel-3: #232329;
  --line: #3f3f46;
  --line-soft: #27272a;

  --accent: #1f8fff;
  --accent-ink: #ffffff;
  --accent-hover: color-mix(in srgb, var(--accent) 85%, white);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-border: color-mix(in srgb, var(--accent) 35%, transparent);
  --accent-light: color-mix(in srgb, var(--accent) 55%, white);
  --accent-glow: color-mix(in srgb, var(--accent) 45%, transparent);

  --success: #01a370;
  --success-soft: rgba(1, 163, 112, 0.12);
  --success-glow: rgba(1, 163, 112, 0.35);
  --danger: #e33131;
  --danger-soft: rgba(227, 49, 49, 0.12);
  --danger-glow: rgba(227, 49, 49, 0.35);
  --info: #2b9bc5;
  --info-soft: rgba(43, 155, 197, 0.12);
  --info-glow: rgba(43, 155, 197, 0.35);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --warning-glow: rgba(217, 119, 6, 0.35);

  --text: #f4f4f5;
  --text-dim: #d4d4d8;
  --muted: #a1a1aa;
  --muted-2: #71717a;

  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --radius-xl: 0;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 4px 4px 0 #000;
  --shadow-lg: 6px 6px 0 #000;
  --shadow-glow-accent: 3px 3px 0 #000;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { font-size: 15px; }
* { box-sizing: border-box; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

body {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background:
    var(--ink);
  background-attachment: fixed;
  color: var(--text-dim);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-shell { position: relative; z-index: 1; }
a { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }

h1, h2, h3, .font-display { font-family: 'JetBrains Mono', 'Courier New', monospace; letter-spacing: -0.011em; }

/* -------------------- Icons -------------------- */
.icon, svg[data-lucide], svg.lucide {
  width: 1rem;
  height: 1rem;
  stroke-width: 2px;
  flex-shrink: 0;
}
.icon-sm { width: 0.85rem; height: 0.85rem; }
.icon-xs { width: 0.7rem; height: 0.7rem; }
.icon-lg { width: 1.35rem; height: 1.35rem; }

/* -------------------- Form controls -------------------- */
input, select, textarea {
  outline: none;
  color-scheme: dark;
  font-family: inherit;
}
input[type="text"], input[type="number"], input[type="password"], input[type="email"], input[type="url"], select, textarea {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
input[type="text"]:hover, input[type="number"]:hover, select:hover, textarea:hover { border-color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="color"] { padding: 2px; cursor: pointer; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
::placeholder { color: var(--muted-2); }

code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85em;
  color: var(--accent-light);
  background: var(--accent-soft);
  padding: 0.12em 0.45em;
  border-radius: 4px;
}

.rounded-lg { border-radius: var(--radius) !important; }

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  transition: filter 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.12s var(--ease), box-shadow 0.15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 108%, white 0%), var(--accent) 60%);
  color: #fff;
  box-shadow: var(--shadow-glow-accent);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 10px 30px -6px var(--accent-glow); }
.btn.is-saving { opacity: 0.85; cursor: default; }
.btn-secondary { background: var(--panel-2); border-color: var(--line); color: var(--text-dim); }
.btn-secondary:hover { border-color: var(--muted-2); color: var(--text); background: var(--panel-3); transform: translateY(-1px); }
.btn-success { background: linear-gradient(155deg, color-mix(in srgb, var(--success) 108%, white 0%), var(--success) 60%); color: #fff; box-shadow: 0 8px 22px -8px var(--success-glow); }
.btn-success:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-danger { background: linear-gradient(155deg, color-mix(in srgb, var(--danger) 108%, white 0%), var(--danger) 60%); color: #fff; box-shadow: 0 8px 22px -8px var(--danger-glow); }
.btn-danger:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-save-green {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--success) 115%, white 10%), var(--success) 60%);
  color: #fff;
  box-shadow: 0 8px 24px -8px var(--success-glow);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius, 10px);
  font-weight: 600;
  border: 1px solid transparent;
  position: sticky; top: 12px; z-index: 20;
}
.btn-save-green:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -6px var(--success-glow); }
.btn-save-green:disabled { opacity: 0.7; cursor: default; transform: none; }
.btn-save-green.is-saving { opacity: 0.85; }
.btn-danger-text { color: var(--danger); font-size: 0.78rem; font-weight: 600; }
.btn-danger-text:hover { text-decoration: underline; }
.link-accent { color: var(--accent); font-weight: 500; }
.link-accent:hover { color: var(--accent-hover); text-decoration: underline; }

/* -------------------- Surfaces -------------------- */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 40%, var(--panel)), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease);
}
.card:hover { border-color: var(--line-soft); box-shadow: var(--shadow-md); }

/* big feature card for the overview page, brighter border + glow */
.focal-card {
  position: relative;
  background: radial-gradient(ellipse 120% 100% at 0% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%), linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 40%, var(--panel)), var(--panel));
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.focal-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
}

/* small stat list for the overview side rail */
.stat-list { display: flex; flex-direction: column; }
.stat-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: none; padding-bottom: 0; }
.stat-row:first-child { padding-top: 0; }
.stat-row-icon {
  width: 2rem; height: 2rem; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 1px solid;
}
.stat-row-icon.info { background: var(--info-soft); border-color: rgba(43,155,197,0.35); color: #7cc8e6; }
.stat-row-icon.success { background: var(--success-soft); border-color: rgba(1,163,112,0.35); color: #5fd9ac; }
.stat-row-icon.accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.stat-row-icon.warning { background: var(--warning-soft); border-color: rgba(217,119,6,0.35); color: #f0b869; }
.stat-row-label { font-size: 0.75rem; color: var(--muted); line-height: 1; margin-bottom: 0.2rem; }
.stat-row-value { font-size: 1.05rem; font-weight: 700; color: var(--text); }

.stub-card {
  position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 35%, var(--panel)), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.3rem;
  transition: border-color 0.15s ease, transform 0.18s var(--ease), box-shadow 0.18s ease;
}
.stub-card:hover { border-color: var(--muted-2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stub-icon {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  margin-bottom: 0.75rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.stub-number { font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

/* -------------------- Alerts -------------------- */
.alert { border-radius: var(--radius); padding: 0.65rem 1rem; font-size: 0.85rem; border: 1px solid; display: flex; align-items: flex-start; gap: 0.55rem; backdrop-filter: blur(2px); }
.alert-success { background: var(--success-soft); border-color: rgba(1,163,112,0.35); color: #5fd9ac; }
.alert-danger  { background: var(--danger-soft); border-color: rgba(227,49,49,0.35); color: #f0817e; }
.alert-warning { background: rgba(250,204,21,0.1); border-color: rgba(250,204,21,0.35); color: #facc15; }
.alert-info    { background: var(--info-soft); border-color: rgba(43,155,197,0.35); color: #7cc8e6; }
.alert-warn    { background: var(--warning-soft); border-color: rgba(217,119,6,0.35); color: #f0b869; }

/* -------------------- Badges -------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--muted);
  line-height: 1.5;
}
.badge-on { border-color: rgba(1,163,112,0.4); color: #5fd9ac; background: var(--success-soft); }
.badge-off { border-color: rgba(227,49,49,0.35); color: #f0817e; background: var(--danger-soft); }
.badge-warn { border-color: rgba(217,119,6,0.4); color: #f0b869; background: var(--warning-soft); }
.badge-accent { border-color: var(--accent-border); color: var(--accent-light); background: var(--accent-soft); }
.badge-free { border-color: rgba(43,155,197,0.35); color: #7cc8e6; background: var(--info-soft); }

.badge-new {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-new::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

/* -------------------- Sidebar / topnav brand -------------------- */
.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 30%, transparent), var(--accent-soft));
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.server-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.server-switch:hover { border-color: var(--muted-2); background: var(--panel-3); }
.server-switch-icon { width: 2rem; height: 2rem; border-radius: var(--radius-sm); object-fit: cover; background: var(--panel-3); flex-shrink: 0; }
.server-switch-name { font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-switch-chevron { margin-left: auto; color: var(--muted); flex-shrink: 0; }

/* -------------------- Nav (vertical, legacy) -------------------- */
.nav-section-label { font-size: 0.7rem; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.04em; padding: 1rem 0.6rem 0.4rem; }
.nav-link { position: relative; display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.65rem; border-radius: var(--radius-sm); color: var(--muted); font-size: 0.85rem; font-weight: 500; transition: background-color .15s ease, color .15s ease; }
.nav-link:hover { background: var(--panel-2); color: var(--text-dim); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-light); font-weight: 600; }

/* -------------------- Top marketing / select-server nav -------------------- */
.topbar { display: flex; align-items: center; gap: 1.75rem; padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--ink); }
.topbar-link { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.topbar-link:hover { color: var(--text); }
.topbar-link.active { color: var(--text); font-weight: 600; }

.server-pick-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem; transition: border-color 0.15s ease, transform 0.18s var(--ease), box-shadow 0.18s ease; }
.server-pick-card:hover { border-color: var(--muted-2); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.docs-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(135deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.25rem; transition: border-color 0.15s ease, transform 0.18s var(--ease); }
.docs-banner:hover { border-color: var(--accent); transform: translateY(-1px); }
.docs-banner-icon { width: 2.75rem; height: 2.75rem; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }

.docs-nav { display: flex; flex-direction: column; gap: 0.15rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.4rem; }
.docs-nav-item { display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0.7rem; border-radius: var(--radius); font-size: 0.83rem; font-weight: 500; color: var(--muted); transition: background 0.12s ease, color 0.12s ease; }
.docs-nav-item:hover { background: var(--panel-2); color: #e5e5ea; }
.docs-nav-item.active { background: var(--panel-3); color: #f5f5f7; }

.docs-content h2 { font-family: 'JetBrains Mono', 'Courier New', monospace; font-weight: 700; font-size: 1.15rem; color: #f0f0f2; margin: 1.75rem 0 0.6rem; }
.docs-content section:first-child h2 { margin-top: 0; }
.docs-content h3 { font-family: 'JetBrains Mono', 'Courier New', monospace; font-weight: 600; font-size: 0.95rem; color: #e5e5ea; margin: 1.1rem 0 0.4rem; }
.docs-content p { font-size: 0.875rem; line-height: 1.65; color: #c7c5d1; margin-bottom: 0.6rem; }
.docs-content ul, .docs-content ol { font-size: 0.875rem; line-height: 1.65; color: #c7c5d1; margin: 0 0 0.75rem 1.25rem; }
.docs-content ul { list-style: disc; }
.docs-content ol { list-style: decimal; }
.docs-content li { margin-bottom: 0.35rem; }
.docs-content li strong { color: #e5e5ea; }
.docs-content code { background: var(--panel-3); border: 1px solid var(--line); border-radius: 4px; padding: 0.1rem 0.4rem; font-family: 'JetBrains Mono', monospace; font-size: 0.8em; color: #ffb4d8; }
.docs-content section { border-bottom: 1px solid var(--line); padding-bottom: 1.75rem; }
.docs-content section:last-child { border-bottom: none; padding-bottom: 0; }
.server-pick-icon { width: 2.75rem; height: 2.75rem; border-radius: var(--radius); object-fit: cover; background: var(--panel-3); flex-shrink: 0; }
.server-pick-configure {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  width: 100%; margin-top: 0.9rem; padding: 0.5rem 0;
  border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700;
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent);
  transition: background-color .15s ease, transform .15s ease;
}
.server-pick-configure:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); transform: translateY(-1px); }
.server-pick-invite {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  width: 100%; margin-top: 0.9rem; padding: 0.5rem 0;
  border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--text-dim);
}
.server-pick-invite:hover { border-color: var(--muted-2); color: var(--text); }

/* -------------------- Question / builder cards -------------------- */
.qcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; transition: border-color .15s ease; }
.qcard:hover { border-color: var(--line-soft); }
.qcard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.qcard-title { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; color: var(--text); font-size: 0.92rem; }
.qcard-grip { color: var(--muted-2); cursor: grab; user-select: none; display: inline-flex; }
.qcard-actions { display: flex; align-items: center; gap: 0.5rem; }
.qcard-icon-btn {
  width: 1.75rem; height: 1.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--panel-3);
  transition: color .15s ease, border-color .15s ease;
}
.qcard-icon-btn:hover { color: var(--text); border-color: var(--muted-2); }
.qcard-icon-btn.danger:hover { color: var(--danger); border-color: rgba(227,49,49,0.5); }

.pill-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.pill-toggle span { padding: 0.3rem 0.75rem; font-size: 0.72rem; font-weight: 600; color: var(--muted); background: var(--panel-3); }
.pill-toggle span.selected { background: var(--accent); color: #fff; }

/* -------------------- Misc -------------------- */
.perf-divider { border: none; border-top: 1px solid var(--line); margin: 1.1rem 0; }
.gradient-heading {
  background: linear-gradient(155deg, var(--text) 30%, var(--text-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--text);
}

.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.glass-avatar { background: var(--panel-2); border: 1px solid var(--line); }

/* -------------------- Toggle switch -------------------- */
.toggle { position: relative; display: inline-block; width: 2.6rem; height: 1.45rem; vertical-align: middle; cursor: pointer; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--panel-3); border: 1px solid var(--line); border-radius: 999px; transition: background-color .15s ease, border-color .15s ease; }
.toggle-thumb { position: absolute; top: 2px; left: 2px; width: 1.05rem; height: 1.05rem; background: var(--muted); border-radius: 50%; transition: transform .15s var(--ease), background-color .15s ease; }
.toggle input:checked + .toggle-track { background: var(--accent-soft); border-color: var(--accent); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(1.15rem); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px var(--accent-soft); }

.topbar-avatar { width: 1.75rem; height: 1.75rem; border-radius: 999px; }

/* -------------------- Page header -------------------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.page-title { display: flex; align-items: center; gap: 0.65rem; font-weight: 800; font-size: 1.5rem; color: var(--text); letter-spacing: -0.015em; }
.page-title-icon {
  width: 2.15rem; height: 2.15rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  flex-shrink: 0;
}
.page-subtitle { color: var(--muted); font-size: 0.83rem; margin-top: 0.35rem; max-width: 46rem; line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.back-link { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.78rem; font-weight: 600; margin-bottom: 0.9rem; }
.back-link:hover { color: var(--accent); }

/* -------------------- Section title (inside cards) -------------------- */
.section-title { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1rem; color: var(--text); }
.section-title-icon {
  width: 1.85rem; height: 1.85rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--muted);
}

/* -------------------- List rows -------------------- */
.row-item { padding: 1rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; transition: background-color 0.15s ease; }
.row-item:hover { background: rgba(255,255,255,0.014); }
a.row-item { text-decoration: none; color: inherit; }
.row-icon {
  width: 2.15rem; height: 2.15rem;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--muted);
  flex-shrink: 0;
}

/* -------------------- Empty state -------------------- */
.empty-state { padding: 3rem 1.5rem; text-align: center; color: var(--muted); }
.empty-state-icon {
  width: 3rem; height: 3rem;
  border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  margin: 0 auto 0.9rem;
}
.empty-state-title { color: var(--text-dim); font-weight: 700; font-size: 0.9rem; margin-bottom: 0.25rem; }
.empty-state-text { font-size: 0.8rem; max-width: 24rem; margin: 0 auto; line-height: 1.55; }

/* activity feed / quick actions (overview) */
.activity-row { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.6rem 0; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--info); margin-top: 0.5rem; flex-shrink: 0; box-shadow: 0 0 0 3px var(--info-soft); }
.quick-action { display: flex; align-items: center; gap: 0.7rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 0.95rem; transition: border-color 0.15s ease, transform 0.18s var(--ease), box-shadow .18s ease, background-color .15s ease; }
.quick-action:hover { border-color: var(--accent-border); background: var(--panel-3); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-action-icon {
  width: 2.15rem; height: 2.15rem;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  flex-shrink: 0;
}
.quick-action-icon.success { background: var(--success-soft); border-color: rgba(1,163,112,0.35); color: #5fd9ac; }
.quick-action-icon.info { background: var(--info-soft); border-color: rgba(43,155,197,0.35); color: #7cc8e6; }
.quick-action-icon.warning { background: var(--warning-soft); border-color: rgba(217,119,6,0.35); color: #f0b869; }
.quick-action-icon.muted { background: var(--panel-3); border-color: var(--line); color: var(--muted); }
.quick-action-label { font-size: 0.83rem; font-weight: 600; color: var(--text); }
.quick-action-sub { font-size: 0.72rem; color: var(--muted); }

/* Overview: setup checklist + needs-attention rows */
.setup-check-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); font-size: 0.82rem; color: var(--text); transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease; }
.setup-check-row:hover { border-color: var(--accent-border); background: var(--panel-3); transform: translateX(2px); }
.setup-check-row.is-done { opacity: 0.55; }

.attention-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.25rem; font-size: 0.83rem; color: var(--text); transition: background-color 0.15s ease; border-radius: var(--radius-sm); }
.attention-row:hover { background: var(--panel-2); }
.attention-icon {
  width: 2rem; height: 2rem; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 1px solid;
}
.attention-icon.warning { background: var(--warning-soft); border-color: rgba(217,119,6,0.35); color: #f0b869; }
.attention-icon.info { background: var(--info-soft); border-color: rgba(43,155,197,0.35); color: #7cc8e6; }
.attention-icon.accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.attention-icon.success { background: var(--success-soft); border-color: rgba(1,163,112,0.35); color: #5fd9ac; }

/* -------------------- User profile footer -------------------- */
.user-footer { display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.55rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); }
.user-footer:hover { border-color: var(--muted-2); }
.user-footer-name { font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.1; }


/* -------------------- Panel / stat cards -------------------- */
.panel-card { background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 35%, var(--panel)), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem 1.2rem; transition: border-color .18s ease, box-shadow .18s ease; }
.panel-card:hover { border-color: var(--line-soft); box-shadow: var(--shadow-md); }
.panel-card-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 700; color: var(--text-dim); margin-bottom: 0.9rem; }
.panel-stat-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.panel-stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

.stat-tile {
  position: relative;
  background: linear-gradient(165deg, color-mix(in srgb, var(--panel-2) 45%, var(--panel)), var(--panel));
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1.15rem;
  overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s ease, border-color .18s ease;
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-tile-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.stat-tile-value { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.stat-tile-info { border-left-color: var(--info); }
.stat-tile-info::after { content:''; position:absolute; inset:0; background: radial-gradient(140px 90px at 100% 0%, var(--info-soft), transparent 70%); pointer-events:none; }
.stat-tile-success { border-left-color: var(--success); }
.stat-tile-success::after { content:''; position:absolute; inset:0; background: radial-gradient(140px 90px at 100% 0%, var(--success-soft), transparent 70%); pointer-events:none; }
.stat-tile-warning { border-left-color: var(--warning); }
.stat-tile-warning::after { content:''; position:absolute; inset:0; background: radial-gradient(140px 90px at 100% 0%, var(--warning-soft), transparent 70%); pointer-events:none; }
.stat-tile-danger { border-left-color: var(--danger); }
.stat-tile-danger::after { content:''; position:absolute; inset:0; background: radial-gradient(140px 90px at 100% 0%, var(--danger-soft), transparent 70%); pointer-events:none; }

.row-avatar { width: 2.1rem; height: 2.1rem; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.row-avatar-img { width: 2.1rem; height: 2.1rem; border-radius: 999px; border: 1px solid var(--line); flex-shrink: 0; object-fit: cover; }

/* -------------------- Field card (bordered field group) -------------------- */
.field-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.95rem 1.05rem; }
.field-card-label { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.15rem; }
.field-card-desc { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.65rem; line-height: 1.45; }
.field-section-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-2); margin: 0.35rem 0 0.2rem; }

/* -------------------- Edit-page tab bar -------------------- */
.edit-tabs { display: flex; align-items: center; gap: 0.15rem; border-bottom: 1px solid var(--line); margin-bottom: 1.3rem; overflow-x: auto; }
.edit-tab {
  padding: 0.65rem 0.9rem; font-size: 0.83rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
  background: none; border-top: none; border-left: none; border-right: none; cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.edit-tab:hover { color: var(--text-dim); }
.edit-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.edit-panel[hidden] { display: none; }

/* -------------------- Hero banner (Overview page) -------------------- */
.hero-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -45%;
  right: -10%;
  width: 26rem;
  height: 26rem;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
}
.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -55%;
  left: -6%;
  width: 20rem;
  height: 20rem;
  background: radial-gradient(circle, var(--info-soft) 0%, transparent 70%);
  pointer-events: none;
}
.hero-banner-left { display: flex; align-items: center; gap: 1.15rem; position: relative; z-index: 1; min-width: 0; }
.hero-guild-icon { width: 3.75rem; height: 3.75rem; border-radius: var(--radius-lg); object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.hero-guild-icon-fallback { display: flex; align-items: center; justify-content: center; background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.hero-eyebrow { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); display: flex; align-items: center; gap: 0.4rem; }
.hero-guild-name { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.018em; line-height: 1.2; }
.hero-banner-right { position: relative; z-index: 1; text-align: right; flex-shrink: 0; }
.hero-metric-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.2rem; }
.hero-metric-value { font-size: 2.9rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; line-height: 1; }
.hero-sparkline { margin-top: 0.4rem; }

@media (max-width: 640px) {
  .hero-banner { flex-direction: column; align-items: flex-start; }
  .hero-banner-right { text-align: left; }
}

/* -------------------- Accordion (Categories page) -------------------- */
.accordion-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .15s ease; }
.accordion-item:hover { border-color: var(--line-soft); }
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}
.accordion-swatch {
  width: 2.15rem; height: 2.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.accordion-title-text { font-weight: 700; font-size: 0.92rem; display: flex; align-items: center; }
.accordion-meta { margin-left: auto; font-size: 0.75rem; color: var(--muted); flex-shrink: 0; }
.accordion-chevron { color: var(--muted); transition: transform 0.2s ease; flex-shrink: 0; }
.accordion-trigger-open .accordion-chevron { transform: rotate(180deg); }
.accordion-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.22s ease; }
.accordion-panel[data-open="true"] { grid-template-rows: 1fr; }
.accordion-panel-inner { overflow: hidden; }
.accordion-panel[data-open="true"] .accordion-panel-inner { padding: 0 1.1rem 1.1rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }

/* -------------------- Small icon action buttons (row actions) -------------------- */
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 2.15rem; height: 2.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  transition: border-color .15s ease, color .15s ease, transform .15s var(--ease);
}
.icon-btn:hover { border-color: var(--muted-2); color: var(--text-dim); transform: translateY(-1px); }
.icon-btn-accent { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent); }
.icon-btn-accent:hover { border-color: var(--accent); }
.icon-btn-success { border-color: rgba(1,163,112,0.3); background: var(--success-soft); color: #5fd9ac; }
.icon-btn-success:hover { border-color: var(--success); }
.icon-btn-danger { border-color: rgba(227,49,49,0.3); background: var(--danger-soft); color: #f0817e; }
.icon-btn-danger:hover { border-color: var(--danger); }

/* -------------------- Sidebar navigation -------------------- */
.rail {
  width: 16.25rem;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  height: 100vh;
  height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.85rem;
  gap: 0.7rem;
  z-index: 30;
  overflow-y: auto;
}
/* pushes the content over because the sidebar is position: fixed */
.rail-content { margin-left: 16.25rem; min-width: 0; }

.sb-brand { display: flex; align-items: center; gap: 0.6rem; padding: 0.15rem 0.15rem 0.35rem; flex-shrink: 0; }
.sb-brand-name { font-family: 'Sora', 'JetBrains Mono', 'Courier New', monospace; font-weight: 800; font-size: 0.95rem; color: #f5f5f7; letter-spacing: -0.01em; }

.sb-guild-card { display: flex; align-items: center; gap: 0.65rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.55rem 0.65rem; flex-shrink: 0; transition: border-color .12s ease; }
.sb-guild-card:hover { border-color: var(--muted-2); }
.sb-guild-icon { width: 2.15rem; height: 2.15rem; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.sb-guild-icon-fallback { display: flex; align-items: center; justify-content: center; background: var(--panel-3); border: 1px solid var(--line); color: var(--muted); }
.sb-guild-name { font-size: 0.83rem; font-weight: 700; color: #f0f0f2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sb-plan-badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0.15rem; padding: 0.1rem 0.4rem; border-radius: 999px; }
.sb-plan-free { color: var(--muted); background: var(--panel-3); }
.sb-plan-premium { color: #1a1206; background: linear-gradient(135deg, #ffd876, #f0a83c); }
.sb-plan-badge-sm { margin-top: 0.1rem; }

.sb-upgrade-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.45rem;
  font-size: 0.8rem; font-weight: 700; color: #1a1206;
  background: linear-gradient(135deg, #ffe29a, #f0a83c);
  border-radius: var(--radius); padding: 0.55rem 0.7rem;
  box-shadow: 0 6px 18px -6px rgba(240,168,60,0.45);
  flex-shrink: 0;
  transition: transform .12s ease, box-shadow .12s ease;
}
.sb-upgrade-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -6px rgba(240,168,60,0.55); }

.sb-nav { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.15rem; overflow-y: auto; margin: 0 -0.2rem; padding: 0 0.2rem; }
.sb-section { margin-top: 0.65rem; }
.sb-section-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); padding: 0.3rem 0.5rem 0.35rem; }
.sb-link {
  display: flex; align-items: center; gap: 0.65rem;
  font-size: 0.83rem; font-weight: 500; color: var(--text-dim);
  padding: 0.48rem 0.55rem; border-radius: var(--radius-sm);
  transition: background-color .12s ease, color .12s ease;
}
.sb-link:hover { background: var(--panel-2); color: #f0f0f2; }
.sb-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sb-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-lock-badge { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; color: #f0a83c; background: rgba(240,168,60,0.14); border-radius: 999px; padding: 0.1rem 0.4rem; flex-shrink: 0; }

.sb-footer { flex-shrink: 0; display: flex; flex-direction: column; gap: 0.15rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.sb-user { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.4rem 0.1rem; }
.sb-user-avatar { width: 2.15rem; height: 2.15rem; border-radius: 999px; border: 2px solid var(--line); flex-shrink: 0; }
.sb-user-name { font-size: 0.8rem; font-weight: 600; color: #f0f0f2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }

.rail-topbar {
  height: 3.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}
.rail-topbar-guild { display: flex; align-items: center; gap: 0.6rem; }
.rail-topbar-icon { width: 1.6rem; height: 1.6rem; border-radius: var(--radius-sm); object-fit: cover; }
.rail-topbar-icon-fallback { display: flex; align-items: center; justify-content: center; background: var(--panel-3); border: 1px solid var(--line); color: var(--muted); }
.rail-topbar-name { font-size: 0.85rem; font-weight: 700; color: var(--text-dim); }

.nav-burger { display: none; }
.nav-backdrop { display: none; }
@media (max-width: 900px) {
  /* The sidebar becomes a slide-in drawer opened from the menu button in the top bar. */
  .rail { width: min(18rem, 86vw); transform: translateX(-102%); transition: transform .24s var(--ease); z-index: 60; box-shadow: none; }
  body.nav-open .rail { transform: none; box-shadow: 12px 0 40px rgba(0,0,0,.5); }
  .rail-content { margin-left: 0; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .nav-burger { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; margin-right: .6rem; border-radius: .6rem; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; flex-shrink: 0; }
  .rail-topbar { padding: 0 .85rem; position: sticky; top: 0; z-index: 20; }
  .rail-content > main { padding: 1rem .85rem 5rem !important; }
}


/* overview page components */

/* Animated live-status chip next to "Currently viewing" */
.hero-live-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #5fd9ac; background: var(--success-soft); border: 1px solid rgba(1,163,112,0.35);
  border-radius: 999px; padding: 0.15rem 0.55rem 0.15rem 0.4rem;
}
.hero-live-chip .live-dot { animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 0 3px var(--success-soft); } 50% { box-shadow: 0 0 0 6px transparent; } }

.hero-metric-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.15rem;
}

/* KPI strip - 4-across headline numbers with trend chips */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }

/* analytics has 5 kpis so it gets its own breakpoints (the inline override broke the ones above) */
.kpi-grid-5 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
@media (min-width: 700px) { .kpi-grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1100px) { .kpi-grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); } }

.kpi-card {
  position: relative;
  background: linear-gradient(165deg, color-mix(in srgb, var(--panel-2) 45%, var(--panel)), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s ease, border-color .2s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-soft); }
.kpi-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; }
.kpi-icon {
  width: 2.3rem; height: 2.3rem; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon.accent { background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent); }
.kpi-icon.success { background: var(--success-soft); border: 1px solid rgba(1,163,112,0.35); color: #5fd9ac; }
.kpi-icon.info { background: var(--info-soft); border: 1px solid rgba(43,155,197,0.35); color: #7cc8e6; }
.kpi-icon.warning { background: var(--warning-soft); border: 1px solid rgba(217,119,6,0.35); color: #f0b869; }
.heatmap-legend { display: inline-block; width: 44px; height: 8px; border-radius: 3px; margin: 0 4px; vertical-align: middle; background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(1,163,112,0.35), rgba(1,163,112,0.6), rgba(1,163,112,0.8), rgba(1,163,112,1)); }
.kpi-trend { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 999px; }
.kpi-trend.up { color: #5fd9ac; background: var(--success-soft); }
.kpi-trend.down { color: #f0817e; background: var(--danger-soft); }
.kpi-trend.flat { color: var(--muted); background: var(--panel-3); }
.kpi-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; font-weight: 600; }
.kpi-value { font-size: 1.85rem; font-weight: 800; color: var(--text); letter-spacing: -0.025em; line-height: 1; }
.kpi-foot { font-size: 0.72rem; color: var(--muted-2); margin-top: 0.5rem; }

/* Chart card wrapper used across the redesigned overview */
.chart-card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 0.75rem; flex-wrap: wrap; }
.chart-card-heading .section-title { margin-bottom: 0; }
.chip-select { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.3rem 0.6rem; font-size: 0.72rem; font-weight: 600; color: var(--muted); }

/* Timeline (Recent Activity) */
.timeline { position: relative; }
.timeline::before { content: ''; position: absolute; left: 0.62rem; top: 0.35rem; bottom: 0.35rem; width: 1px; background: linear-gradient(to bottom, var(--line), transparent); }
.timeline-row { position: relative; display: flex; align-items: flex-start; gap: 0.85rem; padding: 0.65rem 0; }
.timeline-icon {
  width: 1.35rem; height: 1.35rem; border-radius: 999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--muted);
  position: relative; z-index: 1; font-size: 0.65rem;
}
.timeline-icon.dot-accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.timeline-icon.dot-success { background: var(--success-soft); border-color: rgba(1,163,112,0.35); color: #5fd9ac; }
.timeline-icon.dot-info { background: var(--info-soft); border-color: rgba(43,155,197,0.35); color: #7cc8e6; }
.timeline-body { min-width: 0; flex: 1; }
.timeline-meta { font-size: 0.7rem; color: var(--muted-2); margin-top: 0.2rem; }

/* Leaderboard rows with progress bars */
.leaderboard-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0; }
.leaderboard-rank {
  width: 1.55rem; height: 1.55rem; border-radius: var(--radius-sm); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; font-family: 'JetBrains Mono', monospace;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--muted);
}
.leaderboard-rank.gold { background: rgba(217,119,6,0.16); border-color: rgba(217,119,6,0.4); color: #f0b869; }
.leaderboard-rank.silver { background: rgba(143,141,158,0.16); border-color: var(--line-soft); color: var(--text-dim); }
.leaderboard-rank.bronze { background: rgba(1,163,112,0.1); border-color: rgba(1,163,112,0.3); color: #5fd9ac; }
.leaderboard-body { flex: 1; min-width: 0; }
.leaderboard-name { font-size: 0.8rem; font-weight: 600; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-bar-track { height: 5px; border-radius: 999px; background: var(--panel-3); margin-top: 0.35rem; overflow: hidden; }
.leaderboard-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-light)); }

/* Denser quick-action grid variant for a fuller overview */
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0.75rem; }
@media (min-width: 640px) { .action-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.quick-link-group-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-2); margin-bottom: 0.65rem; }

/* Section wrapper label used above card groups on the overview */
.overview-eyebrow { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.overview-eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--line); }
/* searchable select, wraps a normal <select class='js-searchable'>. the real select stays hidden so forms still submit the same */
.searchable-select { position: relative; width: 100%; }
.searchable-select-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.searchable-select-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius, 0.6rem);
  padding: 0.55rem 0.75rem; font-size: 0.85rem; color: var(--text); cursor: pointer;
  text-align: left; transition: border-color .15s ease, background-color .15s ease;
  min-width: 0; /* required for the ellipsis below to actually kick in inside a flex/grid parent */
}
.searchable-select-trigger:hover { border-color: var(--muted-2, var(--line-soft)); }
.searchable-select-trigger.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchable-select-trigger .chev { width: 0.9rem; height: 0.9rem; color: var(--muted); flex-shrink: 0; transition: transform .15s ease; }
.searchable-select-trigger.open .chev { transform: rotate(180deg); }
.searchable-select-trigger-label {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.searchable-select-trigger-label.placeholder { color: var(--muted); }
.searchable-select-panel {
  position: fixed; z-index: 1000; /* portaled to <body>; see searchable-select.js for why */
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius, 0.6rem);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.45)); overflow: hidden;
}
.searchable-select-search-wrap { position: relative; border-bottom: 1px solid var(--line); }
.searchable-select-search-wrap .icon { position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%); width: 0.85rem; height: 0.85rem; color: var(--muted); }
.searchable-select-search {
  width: 100%; background: transparent; border: none; outline: none; color: var(--text);
  font-size: 0.85rem; padding: 0.6rem 0.75rem 0.6rem 2rem;
}
.searchable-select-list { max-height: 15rem; overflow-y: auto; padding: 0.3rem; }
.searchable-select-item {
  padding: 0.5rem 0.65rem; border-radius: 0.4rem; font-size: 0.85rem; color: var(--text-dim);
  cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.searchable-select-item:hover { background: var(--panel-3); color: var(--text); }
.searchable-select-item.selected { color: var(--accent-light); background: var(--accent-soft); }
.searchable-select-item.selected::after { content: '✓'; font-size: 0.75rem; flex-shrink: 0; }
.searchable-select-empty { padding: 1rem 0.65rem; text-align: center; color: var(--muted); font-size: 0.8rem; }

/* Generic page-level search bar (category list filters, etc.) */
.page-search { position: relative; max-width: 22rem; }
.page-search .icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 0.9rem; height: 0.9rem; color: var(--muted); }
.page-search input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius, 0.6rem);
  padding: 0.6rem 0.75rem 0.6rem 2.2rem; font-size: 0.85rem; color: var(--text);
}
.page-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Logging page: category card grid */
.log-category-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius, 0.7rem);
  padding: 1.1rem 1.15rem; display: flex; flex-direction: column; gap: 0.85rem;
  transition: border-color .15s ease, transform .15s ease;
}
.log-category-card:hover { border-color: var(--line-soft); }
.log-category-card.is-off { opacity: 0.55; }
.log-category-card.is-locked { opacity: 0.55; cursor: not-allowed; }
.log-category-card.is-locked select, .log-category-card.is-locked .toggle { pointer-events: none; }
.log-category-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.log-category-icon {
  width: 2.1rem; height: 2.1rem; border-radius: 0.55rem; display: flex; align-items: center; justify-content: center;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--accent-light); flex-shrink: 0;
}
.log-category-title { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.log-category-desc { font-size: 0.75rem; color: var(--muted); line-height: 1.45; margin-top: 0.15rem; }

/* colored section icons (settings, logging etc) */
.section-title-icon.accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.section-title-icon.success { background: var(--success-soft); border-color: rgba(1,163,112,0.35); color: #5fd9ac; }
.section-title-icon.info { background: var(--info-soft); border-color: rgba(43,155,197,0.35); color: #7cc8e6; }
.section-title-icon.warning { background: var(--warning-soft); border-color: rgba(217,119,6,0.35); color: #f0b869; }
.section-title-icon.danger { background: var(--danger-soft); border-color: rgba(227,49,49,0.3); color: #f0817e; }
.section-title-icon.pink { background: rgba(235,69,158,0.12); border-color: rgba(235,69,158,0.35); color: #ec7bbb; }

/* card with a glow on hover */
.card-lift { transition: transform .2s var(--ease), box-shadow .2s ease, border-color .2s ease; }
.card-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-soft); }

/* category icon on the logging page, set --cat-color on the card */
.log-category-card {
  border-top: 3px solid color-mix(in srgb, var(--cat-color, var(--accent)) 55%, var(--line));
  background: linear-gradient(165deg, color-mix(in srgb, var(--panel-2) 55%, var(--panel)), var(--panel-2));
}
.log-category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.log-category-icon {
  background: color-mix(in srgb, var(--cat-color, var(--accent)) 16%, var(--panel-3));
  border-color: color-mix(in srgb, var(--cat-color, var(--accent)) 40%, var(--line));
  color: color-mix(in srgb, var(--cat-color, var(--accent)) 75%, white);
}
.log-category-count-pill {
  font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.log-category-count-pill.on { background: var(--success-soft); border-color: rgba(1,163,112,0.35); color: #5fd9ac; }
@keyframes log-card-saved-pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-soft); }
  40% { box-shadow: 0 0 0 6px var(--accent-soft); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.log-category-card.just-saved { animation: log-card-saved-pulse 0.7s ease-out; }
.log-category-card.save-error { border-color: var(--danger) !important; }

/* inline save feedback for background saves */
.save-status { font-size: 0.75rem; display: inline-flex; align-items: center; gap: 0.3rem; opacity: 0; transition: opacity 0.2s ease; }
.save-status.visible { opacity: 1; }
.save-status.ok { color: #5fd9ac; }
.save-status.error { color: var(--danger); }
@keyframes row-saved-pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-soft); }
  40% { box-shadow: 0 0 0 6px var(--accent-soft); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.just-saved { animation: row-saved-pulse 0.7s ease-out; }
.save-error-outline { border-color: var(--danger) !important; }

/* toast for the auto-save fallback (ajax-forms.js) */
.ajax-save-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  background: var(--panel2, #232329); border: 1px solid var(--line, #333138);
  color: #5fd9ac; font-size: 0.8rem; font-weight: 600;
  padding: 0.55rem 1rem; border-radius: 0.6rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0; transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ajax-save-toast.visible { opacity: 1; transform: translateY(0); }
.ajax-save-toast.error { color: var(--danger); }

/* role multi-select (role-multiselect.js) */
.role-ms { position: relative; }
.role-ms-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.65rem 0.9rem; font-size: 0.85rem; color: var(--muted); cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.role-ms-trigger:hover { border-color: var(--accent-border); background: var(--panel-3); }
.role-ms-trigger.has-selection { color: var(--text); }
.role-ms-trigger i[data-lucide="chevron-down"] { color: var(--muted-2); flex-shrink: 0; transition: transform 0.15s ease; }
.role-ms.is-open .role-ms-trigger i[data-lucide="chevron-down"] { transform: rotate(180deg); }
.role-ms.is-open .role-ms-trigger { border-color: var(--accent-border); }
.role-ms-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  max-height: 260px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.35rem; box-shadow: var(--shadow-md);
}
/* only collapse once the js has set it up, so it stays open if the script fails */
.role-ms.js-enhanced:not(.is-open) .role-ms-panel { display: none; }
.role-ms-option { display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); font-size: 0.83rem; color: var(--text); cursor: pointer; }
.role-ms-option:hover { background: var(--panel-2); }
.role-ms-option input { accent-color: var(--accent); width: 0.95rem; height: 0.95rem; flex-shrink: 0; }
.role-ms-empty { padding: 0.6rem; font-size: 0.8rem; color: var(--muted); text-align: center; }

/* -------------------- Verification page: variable-hint popover -------------------- */
.variables-btn {
  font-size: 0.72rem; font-weight: 700; color: #5fd9ac; background: var(--success-soft);
  border: 1px solid rgba(1,163,112,0.35); border-radius: 999px; padding: 0.25rem 0.65rem;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.variables-btn:hover { background: rgba(1,163,112,0.25); }
.variables-hint { font-size: 0.75rem; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.4rem 0.6rem; margin-bottom: 0.5rem; }
.variables-hint code { color: #5fd9ac; }


/* collapsible sidebar groups. open state is saved per group (sidebar-groups.js), the group with the current page stays open */
.sb-group-tools { display: flex; gap: .35rem; margin: .5rem 0 .1rem; }
.sb-group-tool { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; font-size: .66rem; font-weight: 600; color: var(--muted); background: transparent; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: .28rem .3rem; cursor: pointer; transition: all .12s ease; }
.sb-group-tool:hover { color: var(--text); border-color: var(--muted-2); background: var(--panel-2); }

.sb-group { margin-top: .3rem; }
.sb-group-toggle { font-family: inherit; width: 100%; background: transparent; border: 0; cursor: pointer; text-align: left; border-radius: var(--radius-sm); color: var(--muted); transition: background-color .12s ease, color .12s ease; }
.sb-group-toggle:hover { background: var(--panel-2); color: var(--text-dim); }
.sb-group.has-active > .sb-group-toggle { color: var(--accent-light); }
.sb-group-toggle:focus-visible { outline: 2px solid var(--accent-border); outline-offset: 1px; }
.sb-group-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-group-count { font-size: .62rem; font-weight: 700; color: var(--muted-2); background: var(--panel-2); border-radius: 999px; padding: .05rem .4rem; letter-spacing: 0; }
.sb-group.is-open > .sb-group-toggle .sb-group-count { background: var(--accent-soft); color: var(--accent-light); }
.sb-group-chevron { color: var(--muted-2); flex-shrink: 0; transition: transform .2s ease; transform: rotate(-90deg); }
.sb-group.is-open > .sb-group-toggle .sb-group-chevron { transform: rotate(0deg); }

/* Smooth height animation with no JS measuring: grid row goes 0fr -> 1fr. */
.sb-group-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.sb-group.is-open > .sb-group-body { grid-template-rows: 1fr; }
.sb-group-inner { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: .1rem; padding-left: .35rem; opacity: 0; transition: opacity .18s ease; }
.sb-group.is-open > .sb-group-body > .sb-group-inner { opacity: 1; }
.sb-group:not(.is-open) .sb-group-inner { visibility: hidden; transition: opacity .18s ease, visibility 0s linear .22s; }

@media (prefers-reduced-motion: reduce) {
  .sb-group-body, .sb-group-inner, .sb-group-chevron { transition: none; }
}

/* list + edit page layout: card grids and tabs for long forms */
.item-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); margin-bottom: 2rem; }
.item-card { display: flex; flex-direction: column; gap: 0.85rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; transition: border-color .15s ease, transform .18s var(--ease), box-shadow .18s ease; }
.item-card:hover { border-color: var(--accent-border); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.item-card-top { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; min-width: 0; }
.item-swatch { width: 2.6rem; height: 2.6rem; border-radius: var(--radius); border: 1px solid var(--accent-border); background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.item-name { font-weight: 700; color: var(--text); font-size: 0.95rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-preview { font-size: 0.8rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 1.2rem; }
.item-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; min-height: 1.6rem; }
.chip { font-size: 0.7rem; font-weight: 600; color: var(--muted); background: var(--panel-3); border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.55rem; }
.chip-on { color: #5fd9ac; background: var(--success-soft); border-color: rgba(1,163,112,0.35); }
.chip-off { color: #f0b869; background: var(--warning-soft); border-color: rgba(217,119,6,0.35); }
.item-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.item-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.back-link { display: inline-block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.9rem; text-decoration: none; }
.back-link:hover { color: var(--text); }
.form-narrow { max-width: 680px; }
.search-box { width: 100%; max-width: 320px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem 0.8rem; font-size: 0.85rem; color: var(--text); }

/* ==================== Page-specific looks ==================== */

/* ---- Tab styles ---- */
.edit-tabs.pill-tabs { display: inline-flex; border-bottom: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; margin-bottom: 1.4rem; max-width: 100%; }
.pill-tabs .edit-tab { border-radius: 999px; border-bottom: 0; padding: 0.4rem 0.95rem; font-size: 0.8rem; }
.pill-tabs .edit-tab.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-border); }

.edit-tabs.step-tabs { counter-reset: step; gap: 0.5rem; border-bottom: 0; margin-bottom: 1.5rem; padding-bottom: 0; flex-wrap: wrap; overflow: visible; }
.step-tabs .edit-tab { counter-increment: step; display: inline-flex; align-items: center; gap: 0.55rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--line); }
.step-tabs .edit-tab::before { content: counter(step); width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--panel-3); color: var(--muted); font-size: 0.7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.step-tabs .edit-tab.active { border-color: var(--accent-border); background: var(--accent-soft); }
.step-tabs .edit-tab.active::before { background: var(--accent); color: #fff; }

.split-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.split-main { min-width: 0; }
.edit-tabs.side-nav { position: sticky; top: 1rem; flex-direction: column; align-items: stretch; gap: 2px; border-bottom: 0; margin: 0; overflow: visible; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.45rem; }
.side-nav .edit-tab { display: flex; align-items: center; gap: 0.6rem; text-align: left; width: 100%; border-bottom: 0; border-radius: calc(var(--radius) - 3px); padding: 0.55rem 0.7rem; font-size: 0.82rem; }
.side-nav .edit-tab:hover { background: var(--panel-3); }
.side-nav .edit-tab.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.side-nav .edit-tab .count { margin-left: auto; font-size: 0.68rem; color: var(--muted); }
@media (max-width: 860px) {
  .split-layout { grid-template-columns: minmax(0, 1fr); }
  .edit-tabs.side-nav { position: static; flex-direction: row; overflow-x: auto; }
  .side-nav .edit-tab { width: auto; white-space: nowrap; }
}

/* ---- Fake Discord message (panel previews) ---- */
.dc-msg { background: #313338; border-radius: 10px; padding: 0.85rem 1rem; color: #dbdee1; font-size: 0.85rem; line-height: 1.4; }
.dc-head { display: flex; gap: 0.7rem; }
.dc-avatar { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; }
.dc-body { min-width: 0; flex: 1; }
.dc-name { font-weight: 600; color: #f2f3f5; }
.dc-tag { background: #5865f2; color: #fff; font-size: 0.58rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-left: 0.4rem; vertical-align: 2px; }
.dc-embed { margin-top: 0.35rem; background: #2b2d31; border-left: 4px solid var(--dc-color, #1f8fff); border-radius: 4px; padding: 0.6rem 0.8rem 0.7rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 0.8rem; max-width: 30rem; }
.dc-author { grid-column: 1; font-size: 0.75rem; font-weight: 600; color: #f2f3f5; }
.dc-title { grid-column: 1; font-weight: 700; color: #f2f3f5; font-size: 0.95rem; }
.dc-desc { grid-column: 1; white-space: pre-wrap; word-break: break-word; color: #dbdee1; }
.dc-thumb { grid-column: 2; grid-row: 1 / span 3; width: 4rem; height: 4rem; border-radius: 6px; object-fit: cover; }
.dc-banner { grid-column: 1 / -1; width: 100%; max-height: 11rem; object-fit: cover; border-radius: 6px; margin-top: 0.35rem; }
.dc-footer { grid-column: 1 / -1; font-size: 0.68rem; color: #949ba4; margin-top: 0.2rem; }
.dc-components { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem; max-width: 30rem; }
.dc-btn { background: #4e5058; color: #fff; font-size: 0.78rem; font-weight: 600; border-radius: 4px; padding: 0.3rem 0.8rem; }
.dc-select { width: 100%; display: flex; align-items: center; justify-content: space-between; background: #1e1f22; border: 1px solid #1e1f22; color: #949ba4; border-radius: 4px; padding: 0.45rem 0.7rem; font-size: 0.8rem; }
.dc-empty { font-size: 0.75rem; color: #949ba4; }
.dc-hidden { display: none !important; }

/* ---- Builder: form on the left, live preview on the right ---- */
.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 1.6rem; align-items: start; }
.builder-preview { position: sticky; top: 1rem; }
.builder-preview-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); margin-bottom: 0.5rem; }
@media (max-width: 1100px) { .builder-layout { grid-template-columns: minmax(0, 1fr); } .builder-preview { position: static; order: -1; } }

/* ---- Message cards (Application Panels / Reaction Roles lists) ---- */
.msg-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s ease, box-shadow .18s ease; }
.msg-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-md); }
.msg-card-preview { padding: 0.9rem; background: #1e1f22; border-bottom: 1px solid var(--line); }
.msg-card-preview .dc-msg { padding: 0.7rem 0.8rem; }
.msg-card-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.msg-card-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.msg-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); margin-bottom: 2rem; }
.rr-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.rr-row { display: grid; grid-template-columns: minmax(280px, 1.1fr) minmax(0, 1fr); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rr-row .msg-card-preview { border-bottom: 0; border-right: 1px solid var(--line); }
.rr-side { padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: 0.8rem; }
.role-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.role-pill { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 600; color: var(--text-dim); background: var(--panel-3); border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.6rem; }
.role-pill::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); }
@media (max-width: 800px) { .rr-row { grid-template-columns: minmax(0, 1fr); } .rr-row .msg-card-preview { border-right: 0; border-bottom: 1px solid var(--line); } }

/* ---- Applications: stat ribbon + rows ---- */
.stat-ribbon { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.4rem; overflow: hidden; }
.stat-ribbon > div { padding: 0.9rem 1.2rem; border-right: 1px solid var(--line); }
.stat-ribbon > div:last-child { border-right: 0; }
.stat-ribbon .n { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-ribbon .l { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }
.stat-ribbon .n.accent { color: var(--accent); }
.app-rows { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 2rem; }
.app-row { display: grid; grid-template-columns: minmax(0, 1.6fr) auto auto; align-items: center; gap: 1.4rem; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius); padding: 0.95rem 1.1rem; transition: border-color .15s ease, transform .15s ease; }
.app-row:hover { border-color: var(--accent-border); border-left-color: var(--accent); transform: translateX(2px); }
.app-row.is-on { border-left-color: var(--success); }
.app-row-main { display: flex; align-items: center; gap: 0.85rem; min-width: 0; text-decoration: none; color: inherit; }
.app-row-title { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.app-row-desc { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42ch; }
.app-stats { display: flex; gap: 1.2rem; }
.app-stat { text-align: center; min-width: 3.4rem; }
.app-stat .n { font-weight: 800; font-size: 1.05rem; color: var(--text); line-height: 1.1; }
.app-stat .n.hot { color: var(--accent); }
.app-stat .l { font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 900px) { .app-row { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; } .app-stats { justify-content: flex-start; } }

/* ---- Tags: command list ---- */
.cmd-list { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; }
.cmd-row { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line); }
.cmd-row:last-child { border-bottom: 0; }
.cmd-row:hover { background: rgba(255,255,255,0.015); }
.cmd-top { display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.cmd-name { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 8px; padding: 0.25rem 0.65rem; width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-preview { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-uses { display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; color: var(--muted); min-width: 7rem; justify-content: flex-end; }
.cmd-bar { width: 3.2rem; height: 5px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.cmd-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.cmd-edit { margin-top: 0.75rem; display: none; }
.cmd-row.open .cmd-edit { display: block; }
.cmd-actions { display: flex; align-items: center; gap: 0.4rem; }
@media (max-width: 800px) { .cmd-top { grid-template-columns: 1fr auto; } .cmd-preview { grid-column: 1 / -1; order: 3; white-space: normal; } }

/* ---- Feeds: platform tiles ---- */
.platform-group { margin-bottom: 1.8rem; }
.platform-head { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--text); margin-bottom: 0.7rem; font-size: 0.9rem; }
.platform-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.platform-tiles { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.platform-tile { position: relative; background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 14%, var(--panel-2)), var(--panel-2) 55%); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); border-radius: var(--radius); padding: 0.95rem 1.05rem; display: flex; flex-direction: column; gap: 0.6rem; }
.platform-tile .src { font-weight: 700; color: var(--text); word-break: break-all; }
.platform-tile .dest { font-size: 0.75rem; color: var(--muted); }
.live-badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.68rem; font-weight: 700; color: #fff; background: #e33131; border-radius: 4px; padding: 0.1rem 0.45rem; width: fit-content; }
.live-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse-live 1.4s infinite; }
@keyframes pulse-live { 50% { opacity: 0.3; } }

/* ---- Counting hero + leaderboard podium ---- */
.counter-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; background: radial-gradient(600px 220px at 15% 0%, var(--accent-soft), transparent 70%), var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.8rem; margin-bottom: 1.4rem; }
.counter-number { font-size: clamp(3rem, 8vw, 5.2rem); font-weight: 900; line-height: 1; letter-spacing: -0.04em; color: var(--text); font-variant-numeric: tabular-nums; }
.counter-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.4rem; }
.counter-side { display: flex; gap: 1.6rem; flex-wrap: wrap; justify-content: flex-end; }
.counter-side .n { font-size: 1.6rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
@media (max-width: 760px) { .counter-hero { grid-template-columns: minmax(0, 1fr); } .counter-side { justify-content: flex-start; } }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 0.8rem; align-items: end; padding: 1.2rem 1.1rem 0.4rem; }
.podium-spot { text-align: center; background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 0.6rem; }
.podium-spot.first { padding-top: 1.4rem; padding-bottom: 1.2rem; border-color: var(--accent-border); background: linear-gradient(180deg, var(--accent-soft), var(--panel-3)); }
.podium-medal { font-size: 1.5rem; }
.podium-name { font-weight: 700; color: var(--text); margin: 0.3rem 0 0.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-meta { font-size: 0.72rem; color: var(--muted); }

/* ==================== Moderation / system pages ==================== */
.progress { height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hover, var(--accent))); border-radius: 999px; transition: width .4s ease; }

/* Suggestions / Appeals review queue */
.queue { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 2rem; }
.queue-card { position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem 1rem 1.4rem; overflow: hidden; }
.queue-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--stripe, var(--line)); }
.queue-card.s-pending { --stripe: #f59e0b; }
.queue-card.s-approved { --stripe: #10b981; }
.queue-card.s-denied { --stripe: #ef4444; }
.queue-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.queue-quote { margin-top: 0.5rem; padding: 0.6rem 0.85rem; background: var(--panel-3); border-radius: 8px; color: var(--text); font-size: 0.88rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.queue-meta { font-size: 0.74rem; color: var(--muted); margin-top: 0.45rem; }
.queue-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; flex-wrap: wrap; align-items: center; }
.queue-actions input { flex: 1; min-width: 12rem; }
.vote-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--panel-3); margin-top: 0.7rem; max-width: 18rem; }
.vote-bar > i:first-child { background: #10b981; }
.vote-bar > i:last-child { background: #ef4444; }
.vote-nums { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; margin-bottom: 1.2rem; }
.toolbar-group { display: flex; align-items: center; gap: 0.5rem; }
.toolbar-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2, var(--muted)); }

/* Infractions table */
.data-table-wrap { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; margin-bottom: 2rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-table th { text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel-3); white-space: nowrap; }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-dim, var(--text)); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.type-chip { display: inline-block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 6px; padding: 0.15rem 0.5rem; background: var(--panel-3); color: var(--muted); }
.type-warn { background: rgba(245,158,11,0.15); color: #f5b942; }
.type-mute, .type-timeout { background: rgba(59,130,246,0.15); color: #6aa7ff; }
.type-kick { background: rgba(249,115,22,0.15); color: #fb923c; }
.type-ban { background: rgba(239,68,68,0.15); color: #f87171; }
.mono-id { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.75rem; color: var(--muted); }

/* Activity feed */
.feed-day { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 1.4rem 0 0.6rem; }
.feed-day:first-child { margin-top: 0; }
.feed { position: relative; margin-left: 0.5rem; padding-left: 1.4rem; border-left: 2px solid var(--line); }
.feed-item { position: relative; padding: 0.55rem 0 0.8rem; }
.feed-item::before { content: ''; position: absolute; left: calc(-1.4rem - 6px); top: 0.9rem; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--accent)); box-shadow: 0 0 0 3px var(--panel); }
.feed-item.d-danger { --dot: #ef4444; } .feed-item.d-success { --dot: #10b981; } .feed-item.d-warn { --dot: #f59e0b; }
.feed-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--text); }
.feed-time { margin-left: auto; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.7rem; color: var(--muted); }
.feed-meta { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.feed-av { width: 1.3rem; height: 1.3rem; border-radius: 50%; }

/* Backups timeline */
.snap-timeline { position: relative; margin-left: 0.6rem; padding-left: 1.6rem; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 2rem; }
.snap { position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.95rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.snap::before { content: ''; position: absolute; left: calc(-1.6rem - 7px); top: 1.3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong, var(--muted)); box-shadow: 0 0 0 3px var(--panel); }
.snap.latest { border-color: var(--accent-border); } .snap.latest::before { background: var(--accent); }
.snap-when { font-weight: 700; color: var(--text); display: flex; gap: 0.5rem; align-items: center; }
.snap-stats { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.4rem; }

/* Templates gallery */
.tpl-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.tpl-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s var(--ease), border-color .15s ease; }
.tpl-card:hover { transform: translateY(-3px); border-color: var(--accent-border); }
.tpl-hero { height: 5.2rem; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; background: radial-gradient(120px 80px at 50% 0%, var(--accent-soft), transparent 70%), var(--panel-3); border-bottom: 1px solid var(--line); }
.tpl-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.danger-strip { display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.9rem 1.1rem; border-radius: var(--radius); border: 1px solid rgba(239,68,68,0.4); background: rgba(239,68,68,0.07); margin-bottom: 1.4rem; cursor: pointer; }

/* ==================== Ticket-area pages ==================== */
.rating-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2rem; align-items: center; background: radial-gradient(500px 200px at 10% 0%, rgba(245,158,11,0.10), transparent 70%), var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.8rem; margin-bottom: 1.4rem; }
.rating-big { font-size: 3.4rem; font-weight: 900; line-height: 1; color: var(--text); letter-spacing: -0.03em; }
.rating-stars { color: #f5b942; letter-spacing: 0.1em; margin-top: 0.3rem; }
.rating-rows { display: flex; flex-direction: column; gap: 0.35rem; }
.rating-row { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) 2rem; gap: 0.6rem; align-items: center; font-size: 0.72rem; color: var(--muted); }
.rating-row .progress { height: 6px; }
.rating-row .progress > i { background: #f5b942; }
.review-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); margin-bottom: 2rem; }
.review-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: 0.6rem; }
.review-stars { color: #f5b942; letter-spacing: 0.08em; }
.review-stars span { color: var(--line-strong, var(--line)); }
.review-text { font-size: 0.85rem; color: var(--text); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 700px) { .rating-hero { grid-template-columns: minmax(0, 1fr); } }

.split-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 1.4rem; align-items: start; }
.split-two > aside { position: sticky; top: 1rem; }
@media (max-width: 900px) { .split-two { grid-template-columns: minmax(0, 1fr); } .split-two > aside { position: static; } }
.person-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
.person-row:last-child { border-bottom: 0; }
.person-av { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--panel-3); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); flex-shrink: 0; }

.role-tiles { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); margin-bottom: 1.8rem; }
.role-tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.role-tile-name { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-head { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 1.6rem 0 0.8rem; }

/* ==================== User chip (avatar + name) ==================== */
.user-chip { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; max-width: 100%; vertical-align: middle; }
.user-av { width: 1.55rem; height: 1.55rem; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--panel-3); border: 1px solid var(--line); }
.user-av-fallback { display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: var(--muted); }
.user-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-unknown { color: var(--muted); font-weight: 500; }
.user-tag { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.user-tag.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.user-left { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--panel-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 0.3rem; }
.podium-av { width: 3.2rem; height: 3.2rem; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-border); margin: 0 auto 0.4rem; display: block; }
.podium-spot.first .podium-av { width: 4rem; height: 4rem; }

/* publish row inside a message card, channel picker fills the card */
.msg-publish { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-width: 0; }
.msg-publish select { flex: 1 1 auto; min-width: 0; width: 100%; max-width: none !important; background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.5rem 0.65rem; font-size: 0.78rem; color: var(--text); }
.msg-publish .btn { flex-shrink: 0; }

/* role picker, two panes (available | selected). built by role-multiselect.js */
.role-ms.js-enhanced { container-type: inline-size; }
.role-ms.js-enhanced > .role-ms-trigger,
.role-ms.js-enhanced > .role-ms-panel { display: none !important; }
.rp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.9rem; }
@container (max-width: 440px) { .rp { grid-template-columns: minmax(0, 1fr); } }
.rp-col { min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.rp-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); min-height: 1.3rem; }
.rp-head-right { display: inline-flex; align-items: center; gap: 0.5rem; }
.rp-count { font-size: 0.7rem; font-weight: 700; color: var(--accent-light); background: var(--accent-soft); border: 1px solid var(--accent-border); padding: 0.05rem 0.55rem; border-radius: 999px; letter-spacing: 0; }
.rp-clear { font-size: 0.7rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); background: none; border: 0; cursor: pointer; }
.rp-clear:hover { color: #f0817e; }
.rp-search { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.55rem 0.75rem; font-size: 0.82rem; color: var(--text); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.rp-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rp-avail, .rp-list { display: flex; flex-direction: column; gap: 0.3rem; max-height: 17rem; overflow-y: auto; padding-right: 0.15rem; }
.rp-item { display: flex; align-items: center; gap: 0.55rem; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 0.55rem; padding: 0.45rem 0.65rem; font-size: 0.82rem; color: var(--text-dim); cursor: pointer; transition: all 0.15s var(--ease); }
.rp-item:hover { border-color: var(--accent-border); color: var(--text); background: var(--panel-3); }
.rp-plus { margin-left: auto; color: var(--accent-light); font-weight: 800; opacity: 0; transition: opacity 0.15s; }
.rp-item:hover .rp-plus { opacity: 1; }
.rp-row { display: flex; align-items: center; gap: 0.55rem; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 0.6rem; padding: 0.4rem 0.5rem 0.4rem 0.65rem; font-size: 0.82rem; font-weight: 600; color: var(--text); }
.rp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-dot { width: 0.7rem; height: 0.7rem; border-radius: 999px; flex-shrink: 0; background: var(--muted-2); }
.rp-del { width: 1.55rem; height: 1.55rem; border-radius: 0.45rem; display: grid; place-items: center; color: var(--muted); background: none; border: 0; cursor: pointer; font-size: 0.8rem; transition: all 0.15s; }
.rp-del:hover { color: #f0817e; background: var(--danger-soft); }
.rp-empty { font-size: 0.78rem; color: var(--muted); text-align: center; padding: 1.1rem 0.7rem; border: 1px dashed var(--line); border-radius: 0.7rem; }

/* message editor (same as the mass dm composer) for textareas marked data-rte */
.rte { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-xl); overflow: hidden; }
.rte-tools { display: flex; align-items: center; gap: 0.2rem; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--line-soft); background: var(--ink-2); flex-wrap: wrap; }
.rte-tool { min-width: 2rem; height: 2rem; padding: 0 0.5rem; display: grid; place-items: center; border-radius: 0.5rem; border: 0; background: none; color: var(--muted); font-size: 0.85rem; cursor: pointer; transition: all 0.15s; }
.rte-tool:hover { color: var(--text); background: var(--panel-3); }
.rte-tools .sp { flex: 1; }
.rte-count { font-size: 0.74rem; color: var(--muted); padding-right: 0.4rem; }
.rte textarea.rte-body { width: 100%; min-height: 12rem; resize: vertical; background: var(--panel-2); border: 0; border-radius: 0; outline: none; padding: 1rem 1.1rem; font-size: 0.9rem; line-height: 1.65; color: var(--text); display: block; }
.rte-foot { padding: 0.7rem 1.1rem; border-top: 1px solid var(--line-soft); background: var(--ink-2); font-size: 0.76rem; color: var(--muted); }

/* ---- Phone layout pass ---- */
@media (max-width: 900px) {
  main .grid > *, .split-layout > *, .builder-layout > *, .split-two > * { min-width: 0; }
  .card, .stub-card { min-width: 0; max-width: 100%; }
  canvas, img, video { max-width: 100%; }
  pre, code { word-break: break-word; white-space: pre-wrap; }
  .page-header { flex-wrap: wrap; gap: .8rem; }
  .page-actions { flex-wrap: wrap; }
  main .flex.gap-2, main .flex.gap-3 { flex-wrap: wrap; }
  .gw-tabs, .tabs, .edit-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .data-table-wrap, .table-wrap { overflow-x: auto; }
  /* 16px stops iOS zooming into a field when you tap it. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea { font-size: 16px; }
  .btn, .icon-btn { min-height: 2.5rem; }
  .topbar { padding-left: .85rem; padding-right: .85rem; }
}
@media (max-width: 480px) {
  .page-title { font-size: 1.15rem; }
  .card.p-6, .card.p-5 { padding: 1rem; }
}
@media (max-width: 900px) {
  .docs-nav { display: flex; flex-direction: row; overflow-x: auto; gap: .3rem; }
  .docs-nav-item { white-space: nowrap; flex-shrink: 0; }
  .op-meta { grid-template-columns: minmax(0, 1fr) !important; }
  .docs-content { overflow-wrap: anywhere; }
}


/* ---- Phone pass 2 (from a full audit of every page at 320, 390 and 768px) ---- */
@media (max-width: 900px) {
  /* a 16px base on phones: every rem based size grows a little, which lifts all the small labels over 11px and reads better */
  html { font-size: 16px; }
  /* every form control stays at 16px, even where a utility class or a page style sets a smaller size, so iPhones never zoom in on tap */
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]), select, textarea { font-size: 16px !important; }

  /* the slide-out menu: rows big enough for a thumb */
  .rail .sb-link, .rail .sb-group-toggle { min-height: 2.65rem; }
  .rail .sb-group-tool { min-height: 2.4rem; font-size: .75rem; }
  .rail .icon-btn { min-width: 2.5rem; min-height: 2.5rem; }
  .rail .sb-plan-badge, .rail .badge-new, .rail .sb-lock-badge { font-size: .72rem; }

  /* small captions never go under 11px */
  .sb-group-name, .sb-group-count, .badge-new, .lg-state, .sb-plan-badge, .quick-action-sub, .badge, .timeline-meta, .kpi-label, .lg-group-title,
  .kpi-trend, .kpi-foot, .overview-eyebrow, .quick-link-group-label, .hero-eyebrow, .hero-live-chip, .hero-metric-label, .mc-label, .rte-count { font-size: .75rem; }
  small { font-size: .78rem; }

  /* things that used to be wider than a small screen */
  .server-pick-card { min-width: 0; overflow-wrap: anywhere; }
  .msg-card, .msg-card-preview, .dc-msg, .review-card { min-width: 0; max-width: 100%; }
  .dc-msg, .review-card { overflow-wrap: anywhere; }
  .lv-tabs { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .lv-tab { flex: none; }
  .btn, .icon-btn, .topbar-link, a.btn { -webkit-tap-highlight-color: transparent; }

  /* the last small labels that page styles size under 11px. 'body' in front makes these win over a page's own style block */
  body .tg-preview .nm span, body .tn-nm span, body .nm > span, body .app-stat .l, body .data-table th, body .tp-eyebrow, body .tp-app, body .an-pill, body .cm-lv .lv small, body .mm-scale,
  body .mm-bub .av .n, body .md-case .tag, body .mc-cmd small, body .lg-state, body .gw-cap, body .gw-cap .lt, body .ap-badge, body .ap-label,
  body .ap-reply > span, body .an-s small, body .dc-tag, body .fd-live, body .vm-tag, body .dc-footer { font-size: .75rem; }
}

/* full height pages use the visible height on phones, so the address bar doesn't add a pointless scroll */
@supports (height: 100dvh) {
  .min-h-screen { min-height: 100dvh; }
}

/* ---- Phone pass 3: things that worked but looked clumsy on a small screen ---- */
.demo-short { display: none; }
@media (max-width: 640px) {
  .demo-long { display: none; }
  .demo-short { display: inline; }

  /* the server banner on the overview was mostly padding */
  .hero-banner { padding: 1.1rem 1.1rem; gap: 1rem; }
  .hero-banner-left { gap: .8rem; }
  .hero-guild-icon { width: 3rem; height: 3rem; }
  .hero-guild-name { font-size: 1.25rem; }
}
@media (max-width: 860px) {
  /* filter rows become one swipeable line */
  main .flex.flex-wrap.scroll-row, main .flex.gap-2.scroll-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  main .scroll-row > * { flex: none; white-space: nowrap; }

  /* log settings: the three headline numbers sit side by side, and the category chips scroll in one line */
  body .lg-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body .lg-hero > div { padding: .8rem .65rem; border-right: 1px solid var(--line-soft); border-bottom: 0; }
  body .lg-hero > div:last-child { border-right: 0; }
  body .lg-hero b { font-size: 1.3rem; }
  body .lg-hero span { font-size: .72rem; letter-spacing: .02em; }
  body .lg-seg { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  body .lg-seg button { flex: none; white-space: nowrap; }
}

/* ---- Phone pass 4: a long name can never make a page wider than the screen ---- */
@media (max-width: 900px) {
  /* text wraps (or breaks inside a long word) instead of stretching its box. inherited, so it covers every page */
  body { overflow-wrap: anywhere; }
  /* the server name in the top bar is cut with an ellipsis instead */
  .rail-topbar-guild { flex: 1; min-width: 0; }
  .rail-topbar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---- Server templates: search bar, preview-able cards, and the preview overlay ---- */
.tpl-bar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tpl-search { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: min(240px, 100%); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 .7rem; }
.tpl-search:focus-within { border-color: var(--accent-border); }
.tpl-search i { color: var(--muted); flex: none; }
.tpl-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); padding: .6rem 0; font-size: .9rem; }
.tpl-count { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.tpl-empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; font-size: .9rem; }
.tpl-desc { font-size: .8rem; line-height: 1.45; color: var(--muted); margin: 0; }
.tpl-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; }
.tpl-actions .btn { white-space: nowrap; }

/* the hero is a button now, pressing it opens the preview */
button.tpl-hero { width: 100%; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; padding: 0; color: inherit; font: inherit; }
.tpl-hero-emoji { transition: transform .18s var(--ease), opacity .15s ease; }
.tpl-hero-peek { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .4rem; font-size: .78rem; font-weight: 600; color: var(--text); background: color-mix(in srgb, var(--ink) 60%, transparent); opacity: 0; transition: opacity .15s ease; }
button.tpl-hero:hover .tpl-hero-emoji, button.tpl-hero:focus-visible .tpl-hero-emoji { transform: scale(1.08); }
button.tpl-hero:hover .tpl-hero-peek, button.tpl-hero:focus-visible .tpl-hero-peek { opacity: 1; }

body.tpv-open { overflow: hidden; }
.tpv { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.tpv[hidden] { display: none; }
.tpv-backdrop { position: absolute; inset: 0; background: rgba(8, 8, 12, .72); }
.tpv-sheet { position: relative; width: min(980px, 100%); max-height: min(88vh, 880px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.tpv-head { display: flex; align-items: center; gap: .85rem; padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--line); }
.tpv-emoji { font-size: 1.9rem; line-height: 1; flex: none; }
.tpv-name { font-size: 1.05rem; font-weight: 650; color: var(--text); }
.tpv-sub { font-size: .8rem; color: var(--muted); margin-top: .15rem; line-height: 1.4; }
.tpv-stats { display: flex; flex-wrap: wrap; gap: .4rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--line-soft); background: var(--panel-2); }
.tpv-stat { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; color: var(--text-dim); background: var(--panel-3); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .6rem; }
.tpv-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); flex: 1; min-height: 0; overflow: hidden; }
.tpv-side { border-right: 1px solid var(--line); overflow-y: auto; padding: 1rem 1rem 1.25rem; background: var(--panel-2); }
.tpv-main { overflow-y: auto; padding: 1rem 1.25rem 1.5rem; }
.tpv-side-title { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; margin-bottom: .6rem; }
.tpv-role-list, .tpv-ch-list { list-style: none; margin: 0; padding: 0; }
.tpv-role { display: flex; align-items: center; gap: .45rem; padding: .3rem 0; font-size: .82rem; color: var(--text-dim); flex-wrap: wrap; }
.tpv-dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; }
.tpv-role-name { min-width: 0; overflow-wrap: anywhere; }
.tpv-perms { display: inline-flex; gap: .25rem; flex-wrap: wrap; margin-left: auto; }
.tpv-perm { font-size: .64rem; padding: .1rem .35rem; border-radius: var(--radius-sm); background: var(--panel-3); color: var(--muted); border: 1px solid var(--line); }
.tpv-perm.is-admin { color: #fca5a5; border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }
.tpv-cat { margin-bottom: 1.1rem; }
.tpv-cat-head { display: flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.tpv-cat-who { font-size: .72rem; color: var(--muted-2); margin: -.1rem 0 .4rem 1.1rem; }
.tpv-ch { display: flex; align-items: center; gap: .4rem; padding: .2rem .45rem; border-radius: var(--radius-sm); font-size: .84rem; color: var(--text-dim); }
.tpv-ch:hover { background: var(--panel-2); }
.tpv-ch-icon { color: var(--muted-2); flex: none; }
.tpv-ch-name { min-width: 0; overflow-wrap: anywhere; }
.tpv-ch-lock { color: var(--warning); flex: none; }
.tpv-ch.is-private .tpv-ch-name { color: var(--muted); }
.tpv-none, .tpv-loading { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: .5rem; padding: 1.5rem; }
.tpv-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.25rem; border-top: 1px solid var(--line); background: var(--panel-2); flex-wrap: wrap; }
.tpv-note { font-size: .75rem; color: var(--muted); }

@media (max-width: 900px) {
  .tpv { padding: 0; }
  .tpv-sheet { width: 100%; height: 100%; max-height: 100%; border-radius: 0; border: 0; }
  .tpv-body { grid-template-columns: minmax(0, 1fr); }
  .tpv-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .tpv-foot .btn { flex: 1; justify-content: center; }
  .tpv-stat, .tpv-perm, .tpv-cat-who, .tpv-note, .tpv-side-title { font-size: .72rem; }
  .tpl-actions { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Welcome & Goodbye page ---- */
.dc-field { grid-column: 1; margin-top: .35rem; }
.dc-field-name { display: block; font-size: .72rem; font-weight: 700; color: #f2f3f5; }
.dc-field-value { display: block; font-size: .8rem; color: #dbdee1; }

/* the two big switches at the top replace the usual thin tab strip */
.edit-tabs.wl-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; border-bottom: 0; overflow: visible; margin-bottom: 1.2rem; }
.edit-tab.wl-sw { display: flex; align-items: center; gap: .75rem; text-align: left; white-space: normal; padding: .85rem .95rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color .15s ease, background-color .15s ease, transform .18s var(--ease); }
.edit-tab.wl-sw:hover { border-color: var(--accent-border); transform: translateY(-1px); }
.edit-tab.wl-sw.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.wl-sw-ico { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; flex: none; border-radius: var(--radius); background: var(--panel-3); border: 1px solid var(--line); color: var(--muted); }
.edit-tab.wl-sw.active .wl-sw-ico { background: var(--panel); border-color: var(--accent-border); color: var(--accent); }
.wl-sw-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; flex: 1; }
.wl-sw-title { font-size: .88rem; font-weight: 650; color: var(--text); }
.wl-sw-sub { font-size: .72rem; font-weight: 400; color: var(--muted); line-height: 1.35; }
.wl-sw-state { flex: none; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .2rem .5rem; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line); color: var(--muted); }
.wl-sw-state.is-on { background: var(--success-soft); border-color: rgba(1, 163, 112, .35); color: #5fd9ac; }

.wl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 23rem); gap: 1.1rem; align-items: start; }
.wl-col { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }

.wl-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.wl-chips-label { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; margin-right: .2rem; }
.wl-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .5rem; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.wl-chip:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.wl-chip code { font-size: .7rem; color: var(--accent-light); background: none; padding: 0; }
.wl-chip span { font-size: .68rem; color: var(--muted); }

.wl-hint { display: flex; align-items: flex-start; gap: .4rem; font-size: .75rem; color: var(--muted); line-height: 1.45; margin: 0; }
.wl-hint i { margin-top: .15rem; flex: none; }
.wl-hint.is-warn { color: #f0b869; }
.wl-toggle-row { display: flex; align-items: flex-start; gap: .6rem; }
.wl-toggle-title { display: block; font-size: .85rem; color: var(--text); }
.wl-toggle-sub { display: block; font-size: .73rem; color: var(--muted); margin-top: .1rem; line-height: 1.4; }

.wl-preview { position: sticky; top: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; min-width: 0; }
.wl-preview-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .85rem; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.wl-preview-note { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted-2); }
.wl-preview-body { padding: .85rem; display: flex; flex-direction: column; gap: .7rem; }
.wl-preview-foot { font-size: .72rem; color: var(--muted-2); line-height: 1.45; margin: 0; }
.wl-mention { background: color-mix(in srgb, #5865f2 28%, transparent); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.wl-code { background: #1e1f22; border-radius: 3px; padding: 0 3px; font-size: .8em; }
.wl-quote { display: block; border-left: 3px solid #4e5058; padding-left: .5rem; }

/* a flat copy of the image card the bot draws, close enough to judge the colours by */
.wc-card { position: relative; border-radius: 10px; overflow: hidden; min-height: 7.5rem; background: linear-gradient(135deg, #1a1a2e, var(--accent)); }
.wc-card[hidden] { display: none; }
.wc-card-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.wc-card-bg:not([style*="url"]) { display: none; }
.wc-card-bg[style*="url"] + .wc-card-inner { background: rgba(0, 0, 0, .45); }
.wc-card-inner { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; min-height: 7.5rem; }
.wc-card-inner::before { content: ''; position: absolute; inset: .45rem; border: 2px solid rgba(255, 255, 255, .25); border-radius: 8px; pointer-events: none; }
.wc-card-avatar { width: 3.6rem; height: 3.6rem; border-radius: 50%; border: 3px solid #fff; object-fit: cover; flex: none; }
.wc-card-text { min-width: 0; }
.wc-card-heading { font-size: 1.15rem; font-weight: 800; color: #fff; letter-spacing: .02em; }
.wc-card-name { font-size: .92rem; color: rgba(255, 255, 255, .9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-card-sub { font-size: .74rem; color: rgba(255, 255, 255, .7); }

.wl-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; padding: .85rem 1rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.wl-actions-note { font-size: .73rem; color: var(--muted); flex: 1; min-width: 12rem; }

@media (max-width: 1100px) {
  .wl-grid { grid-template-columns: minmax(0, 1fr); }
  .wl-preview { position: static; }
}
@media (max-width: 900px) {
  .edit-tabs.wl-switch { grid-template-columns: minmax(0, 1fr); }
  .wl-sw-sub { font-size: .74rem; }
  .wl-sw-state { font-size: .72rem; }
  .wl-chip { min-height: 2.25rem; padding: .35rem .6rem; }
  .wl-chip code, .wl-chip span, .wl-chips-label, .wl-preview-foot, .wl-actions-note { font-size: .74rem; }
  .wl-actions .btn { flex: 1; justify-content: center; }
}

/* ---- Text to speech page ---- */
.tts-hero { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem; margin-bottom: 1.1rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color .15s ease, background-color .15s ease; }
.tts-hero.is-on { border-color: var(--accent); background: var(--accent-soft); }
.tts-hero-ico { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; flex: none; border-radius: var(--radius); background: var(--panel-3); border: 1px solid var(--line); color: var(--muted); }
.tts-hero.is-on .tts-hero-ico { background: var(--panel); border-color: var(--accent-border); color: var(--accent); }
.tts-hero-title { font-size: .95rem; font-weight: 650; color: var(--text); }
.tts-hero-sub { font-size: .78rem; color: var(--muted); margin-top: .1rem; line-height: 1.4; }

.tts-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.tts-col { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }

.tts-ch-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tts-ch-tools .tpl-search { flex: 1; min-width: min(180px, 100%); }
.tts-chlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: .3rem; max-height: 16rem; overflow-y: auto; padding: .35rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tts-ch { display: flex; align-items: center; gap: .45rem; padding: .4rem .55rem; border-radius: var(--radius-sm); cursor: pointer; font-size: .84rem; color: var(--text-dim); min-width: 0; }
.tts-ch:hover { background: var(--panel-2); }
.tts-ch[hidden] { display: none; }
.tts-ch input { accent-color: var(--accent); flex: none; width: 1rem; height: 1rem; }
.tts-ch-hash { color: var(--muted-2); flex: none; }
.tts-ch-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tts-ch input:checked ~ .tts-ch-name { color: var(--text); }

.tts-range { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem; gap: .6rem; align-items: center; }
.tts-range input[type="range"] { width: 100%; accent-color: var(--accent); }
.tts-test { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.tts-test .btn { white-space: nowrap; }

.tts-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.tts-steps li { display: flex; gap: .65rem; align-items: flex-start; }
.tts-steps li > span { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; flex: none; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent); font-size: .72rem; font-weight: 700; }
.tts-steps b { display: block; font-size: .85rem; color: var(--text); }
.tts-steps p { margin: .1rem 0 0; font-size: .76rem; color: var(--muted); line-height: 1.45; }

@media (max-width: 1100px) { .tts-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .tts-chlist { grid-template-columns: minmax(0, 1fr); max-height: 14rem; }
  .tts-ch { min-height: 2.4rem; }
  .tts-range { grid-template-columns: minmax(0, 1fr); }
  .tts-test { grid-template-columns: minmax(0, 1fr); }
  .tts-steps p, .tts-hero-sub { font-size: .78rem; }
}

/* ---- Settings page ------------------------------------------------------ */
/* same two-column shape as Text to Speech. the cards, section titles and toggle rows are the shared ones */
.cfg-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.cfg-col { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.cfg-sum { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; padding: .9rem 1.1rem; margin-bottom: 1.1rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.cfg-sum-ico { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; flex: none;
  border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent); }
.cfg-sum-text { min-width: 0; flex: 1; }
.cfg-sum-text b { display: block; font-size: .95rem; font-weight: 650; color: var(--text); }
.cfg-sum-text span { display: block; font-size: .78rem; color: var(--muted); margin-top: .1rem; line-height: 1.4; }
.cfg-field > label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-dim); margin-bottom: .35rem; }
.cfg-field > p { font-size: .73rem; color: var(--muted); margin-top: .3rem; line-height: 1.5; }
.cfg-sub { display: grid; gap: .8rem; border-top: 1px solid var(--line); padding-top: .85rem; }
.cfg-card:not(.is-on) .cfg-sub { display: none; }
.cfg-save { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  margin-top: 1.1rem; padding: .85rem 1.1rem;
  background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 -10px 28px -20px rgba(0,0,0,.9); }
.cfg-save-note { font-size: .76rem; color: var(--muted); margin-right: auto; }
@media (max-width: 1100px) { .cfg-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .cfg-sum { padding: .8rem .85rem; }
  .cfg-save { padding: .75rem .85rem; }
  .cfg-save-note { width: 100%; margin-right: 0; order: 2; }
}

/* -------------------- stealth look: square corners, hard borders, flat shadows -------------------- */
html { font-size: 14px; }
*:not(img):not(.avatar):not([class*="avatar"]):not([class*="dot"]):not([class*="emoji"]):not([class*="spin"]) { border-radius: 0 !important; }
.card, .rx .rx-card, .focal-card, .stub-card, .server-pick-card, .qcard, .rx .rx-tile {
  border: 2px solid var(--line) !important; box-shadow: 4px 4px 0 #000 !important; background-color: var(--panel);
}
h1, h2, .rx .rx-card-title, .rx .rx-title, .sb-group-label, .rx .rx-tabs button, .rx th, th { text-transform: uppercase; letter-spacing: .04em; }
h1 { font-weight: 800; }
.rx .rx-btn-primary, .btn-primary, .sb-upgrade-btn { background: var(--accent) !important; color: #fff !important; border: 2px solid var(--line) !important; box-shadow: 3px 3px 0 #000; text-transform: uppercase; font-weight: 800; }
input, select, textarea, .rx .rx-input { border-width: 2px !important; background-color: var(--ink) !important; }
.sb-link.active, .sb-nav a.active, .rx .rx-tabs button.active, .rx .rx-tab.active { background: var(--text) !important; color: var(--ink) !important; }
.brand-logo { width: 2.2rem; height: 2.2rem; object-fit: contain; flex-shrink: 0; }
