/* ── Glass polish pass ──────────────────────────────────────────────────────
   A soft blur + depth pass over the whole product. Everything here is
   additive: it layers backdrop blur, hairline highlights and a slightly
   heavier type scale on top of the existing tokens, so no page has to
   change its markup to pick it up.

   PERFORMANCE NOTES
   - The ambient light is painted with plain radial gradients, never a
     `filter: blur()` on a full-viewport layer. A blurred fixed layer with an
     infinite animation repaints the whole viewport every frame and drags
     the dashboard down.
   - Only the chrome (sidebar, top bar, modals) and the card surfaces carry
     a backdrop-filter. Every element with a backdrop-filter is its own
     compositing layer, so they are kept to the ones that actually sit on
     top of content.
   - Animations are transform/opacity only, so they run on the compositor
     without touching layout or paint.                                     */

:root {
  --glass-tint: rgba(12, 15, 24, 0.62);
  --glass-tint-2: rgba(16, 20, 32, 0.55);
  --glass-blur: 12px;
  --glass-blur-sm: 8px;
  --glass-line: rgba(255, 255, 255, 0.07);
  --glass-line-top: rgba(255, 255, 255, 0.13);
  --glass-shadow: 0 18px 44px -26px rgba(0, 0, 0, 0.85);
}

/* ── Type: one consistent scale, slightly tighter and better tracked ────── */
body {
  font-feature-settings: 'kern' 1, 'liga' 1, 'cv05' 1, 'ss03' 1;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h1 { line-height: 1.14; }
h2 { line-height: 1.2; }
h3 { line-height: 1.28; }

p, li, td, th { line-height: 1.58; }

.mono, code, pre, .panel-bar .mono {
  font-feature-settings: 'kern' 1, 'liga' 1, 'zero' 1;
  letter-spacing: 0;
}

/* Numbers in stat rails and tables line up in a column. */
.stat-v, .stat-card .stat-v, .stats-grid .stat-num,
.card-head .muted, .table td.num, .kv .v { font-variant-numeric: tabular-nums; }

/* ── Ambient light ─────────────────────────────────────────────────────────
   Radial gradients are already soft - no blur filter needed. The layer is
   fixed and transform-animated, which the compositor handles off the main
   thread. `will-change: transform` keeps it on its own layer.            */
.page-dash::before,
.page-site::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(58% 42% at 78% 0%, color-mix(in srgb, var(--acc) 11%, transparent), transparent 62%),
    radial-gradient(52% 40% at 6% 100%, color-mix(in srgb, var(--acc-2) 12%, transparent), transparent 60%);
  opacity: 0.8;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  animation: glass-drift 34s var(--ease) infinite alternate;
}

@keyframes glass-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
  to   { transform: translate3d(1.5%, 1.5%, 0) scale(1.06); }
}

/* ── Glass surfaces ────────────────────────────────────────────────────────
   The backdrop-filter only goes on the chrome that actually overlaps moving
   content (sidebar, top bar, modals, palette). Cards sit on a static
   background where a backdrop-filter buys nothing visually but costs a
   compositing layer per card - that is what made the dashboard stutter.   */
.dash-top,
.site-header,
.pal-box {
  background: var(--glass-tint) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  border-color: var(--glass-line) !important;
}

/* Cards get the tint and the highlight, but no backdrop-filter. */
.card,
.panel-window,
.acard {
  background: var(--glass-tint) !important;
  border-color: var(--glass-line) !important;
}

/* A hairline highlight along the top edge sells the glass. */
.dash-top,
.site-header,
.card,
.panel-window,
.acard,
.pal-box {
  position: relative;
}

.dash-top::before,
.site-header::before,
.card::before,
.panel-window::before,
.acard::before,
.pal-box::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--glass-line-top) 22%, var(--glass-line-top) 78%, transparent);
  border-radius: inherit;
}

/* The sidebar is a taller column than a card - give it its own, softer
   treatment so the blur has something to sit on. */
.dash-side {
  background:
    linear-gradient(180deg, var(--glass-tint-2), var(--glass-tint)) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-right: 1px solid var(--glass-line);
}

.dash-main,
.dash-content { position: relative; z-index: 1; }

/* ── Sidebar rows ───────────────────────────────────────────────────────── */
.side-nav a {
  border-radius: 10px;
  font-weight: 540;
  letter-spacing: -0.008em;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--glass-line);
}

.side-nav a.active {
  background: linear-gradient(90deg, var(--acc-soft), transparent 92%);
  border-color: var(--acc-line);
}

.side-label {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  opacity: 0.72;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card,
.acard,
.panel-window {
  border-radius: var(--r-lg);
  transition: border-color var(--dur) var(--ease);
}

.card:hover,
.acard:hover {
  border-color: rgba(255, 255, 255, 0.11);
}

.card-head h2 { font-weight: 640; letter-spacing: -0.018em; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  font-weight: 560;
  letter-spacing: -0.004em;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.input, .pal-input, textarea.input, select.input {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glass-line);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.input:focus, .pal-input:focus, textarea.input:focus, select.input:focus {
  border-color: var(--acc-line);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px var(--acc-focus);
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table th {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.table td { font-size: 0.9rem; }
.table tbody tr { transition: background-color var(--dur) var(--ease); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.028); }

/* ── Modals ─────────────────────────────────────────────────────────────── */
.modal-box,
.pal-box {
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  backdrop-filter: blur(18px) saturate(1.45);
  background: var(--glass-tint-2) !important;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95);
}

.modal-backdrop {
  background: rgba(4, 6, 11, 0.62);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.dash-hero {
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  backdrop-filter: blur(8px) saturate(1.2);
}

.hero-title { font-weight: 700; }

/* ── Focus ring everywhere ──────────────────────────────────────────────── */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--acc-focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .page-dash::before, .page-site::before { animation: none !important; }
  .btn:hover, .card:hover, .acard:hover { transform: none; }
}
EOF/* ── Reduced motion: respect user preference ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Skeleton loading bars ──────────────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  display: inline-block;
}
.skel-bar { height: 12px; }
.skel-bar.sm { height: 8px; }
.skel-bar.lg { height: 18px; }
@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Streamer mode: blur sensitive content for screen sharing ───────────── */
[data-streamer-mode="on"] .sten-sensitive,
[data-streamer-mode="on"] .side-user-name,
[data-streamer-mode="on"] .side-user-handle {
  filter: blur(6px);
  user-select: none;
}
[data-streamer-mode="on"] .sten-sensitive:hover {
  filter: blur(0);
}

/* ── Focus rings: brand-colored, visible ────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent, #38e8c6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Empty state illustration slot ─────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted, #8a8fa8);
}
.empty-state .empty-ico {
  width: 56px;
  height: 56px;
  opacity: 0.6;
}
.empty-state b {
  font-family: var(--pix);
  font-size: 1.1rem;
  color: var(--text, #e6e8f0);
}/* ── Mail stats row ─────────────────────────────────────────────────────── */
.mail-stats { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.mail-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0.6rem 0.85rem; border-radius: 10px;
  background: var(--glass-tint, rgba(12,15,24,0.62));
  border: 1px solid var(--glass-line, rgba(255,255,255,0.07));
  backdrop-filter: blur(var(--glass-blur-sm, 8px));
  min-width: 96px;
}
.mail-stat b { font-family: var(--pix); font-size: 1.15rem; color: var(--txt, #e6e8f0); line-height: 1; }
.mail-stat span { font-size: 0.7rem; color: var(--muted, #8a8fa8); text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Mail chips ─────────────────────────────────────────────────────────── */
.mail-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.mail-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.7rem; border-radius: 999px;
  background: var(--glass-tint-2, rgba(16,20,32,0.55));
  border: 1px solid var(--glass-line, rgba(255,255,255,0.07));
  color: var(--txt, #e6e8f0); cursor: pointer; font: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.mail-chip:hover { transform: translateY(-1px); border-color: var(--acc, #38e8c6); }
.mail-chip code { font-family: var(--mono); font-size: 0.78rem; }

/* ── Mail list items ────────────────────────────────────────────────────── */
.mail-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.mail-item {
  border-radius: 12px; border: 1px solid var(--glass-line, rgba(255,255,255,0.07));
  background: var(--glass-tint, rgba(12,15,24,0.62));
  backdrop-filter: blur(var(--glass-blur-sm, 8px));
  overflow: hidden;
}
.mail-item summary {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 0.9rem; cursor: pointer; list-style: none;
}
.mail-item summary::-webkit-details-marker { display: none; }
.mail-sub { flex: 1; font-weight: 600; font-size: 0.9rem; }
.mail-code {
  font-family: var(--mono); font-size: 0.8rem; padding: 2px 8px;
  border-radius: 6px; background: var(--acc-soft, rgba(56,232,198,0.11));
  color: var(--acc, #38e8c6); border: 1px solid var(--acc-line, rgba(56,232,198,0.32));
}
.mail-meta { font-size: 0.72rem; color: var(--muted, #8a8fa8); }
.mail-body-wrap { padding: 0.7rem 0.9rem; border-top: 1px solid var(--glass-line, rgba(255,255,255,0.07)); }
.mail-from { margin-bottom: 0.4rem; }
.mail-body { white-space: pre-wrap; font-size: 0.82rem; margin: 0 0 0.6rem; max-height: 240px; overflow: auto; }

/* ── Bot manage: sten-style banner hero + appearance editor ─────────────── */
.bot-hero2 {
  position: relative;
  margin-top: 14px;
  border: 1px solid var(--line, rgba(255,255,255,0.08));
  border-radius: 16px;
  background: linear-gradient(180deg, var(--panel, #0d1017), var(--panel-2, #101420));
  box-shadow: var(--shadow-sm, 0 10px 30px -22px rgba(0,0,0,0.7));
  overflow: hidden;
}
.bot-banner {
  position: relative;
  height: 128px;
  background-position: center 38%;
  background-size: cover;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--line, rgba(255,255,255,0.08));
}
/* Keep a designed look even before a custom banner is uploaded. */
.bot-banner:not([style]) ,
.bot-banner[style=""] { background-image: linear-gradient(120deg, rgba(56,232,198,0.18), rgba(56,232,198,0.04) 45%, transparent 72%), repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 10px, transparent 10px 22px); }
.bot-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(9,11,17,0.62));
  pointer-events: none;
}
.bot-banner-edit {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 9px;
  border: 1px solid var(--glass-line, rgba(255,255,255,0.12));
  background: rgba(10,13,20,0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #eaf6f3;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, background-color 0.15s;
}
.bot-banner-edit:hover { border-color: #38e8c6; color: #38e8c6; transform: translateY(-1px); background: rgba(10,13,20,0.85); }
.bot-banner-edit .ico { width: 15px; height: 15px; }
.bot-hero2-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0 1.35rem 1.15rem;
}
.bot-hero2 .bot-hero-id { margin-top: -30px; align-items: flex-end; }
.bot-hero2 .bot-hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  border: 3px solid var(--panel, #0d1017);
  box-shadow: 0 12px 26px -18px rgba(0,0,0,0.85);
  margin-bottom: -6px;
}
.bot-hero2 .bot-hero-text { padding-top: 12px; }
.bot-hero2 .bot-hero-name {
  font-family: var(--pix, inherit);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.bot-hero2 .bot-hero-actions { padding-top: 12px; }
@media (max-width: 720px) {
  .bot-banner { height: 96px; }
  .bot-hero2 .bot-hero-avatar { width: 72px; height: 72px; border-radius: 18px; margin-top: -24px; }
}

/* Appearance editor */
.bot-appearance {
  border-top: 1px solid var(--line, rgba(255,255,255,0.08));
  padding: 1rem 1.35rem 1.2rem;
  background: rgba(9,12,18,0.45);
}
.ba-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0.9rem; }
.ba-item {
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem;
  border: 1px solid var(--glass-line, rgba(255,255,255,0.07));
  border-radius: 12px;
  background: rgba(12,15,24,0.55);
}
.ba-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.ba-key {
  font-family: var(--pix, inherit);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #8a8fa8);
}
.ba-preview {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 0.7rem;
  border: 1px dashed var(--line-soft, rgba(255,255,255,0.1));
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}
.ba-avatar {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--glass-line, rgba(255,255,255,0.1));
  box-shadow: 0 12px 26px -18px rgba(0,0,0,0.85);
  background: var(--field-bg, rgba(255,255,255,0.04));
}
.ba-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-avatar span { font-family: var(--mono, monospace); font-weight: 700; font-size: 1.6rem; color: #38e8c6; }
.ba-banner {
  width: 100%;
  height: 104px;
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(56,232,198,0.14), rgba(56,232,198,0.03) 50%, transparent 75%), var(--field-bg, rgba(255,255,255,0.03));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border: 1px solid var(--glass-line, rgba(255,255,255,0.1));
}
.ba-foot { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; }

/* Presence controls: status dot + activity line, saved with the images */
.ba-presence {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.9rem;
  padding: 0.9rem;
  border: 1px solid var(--glass-line, rgba(255,255,255,0.07));
  border-radius: 12px;
  background: rgba(12,15,24,0.55);
}
.ba-presence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
  align-items: start;
}
.ba-presence-text { grid-column: 1 / -1; }

/* ── Manage page hero: zero overlap — banner strip, identity row below ──── */
.bot-hero2 .bot-hero-id { align-items: center; margin-top: 0; }
.bot-hero2 img.bot-hero-avatar,
.bot-hero2 span.bot-hero-avatar {
  margin: 0;
  width: 84px; height: 84px; border-radius: 20px;
}
.bot-hero2 .bot-hero-text { padding-top: 0; min-width: 0; }
.bot-hero2 .bot-hero-actions { padding-top: 0; }
.bot-hero2-in { padding: 1.15rem 1.35rem 1.25rem; }
.bot-hero2 .bot-banner { height: 132px; }
@media (max-width: 720px) {
  .bot-banner { height: 96px; }
  .bot-hero2 .bot-hero-avatar { width: 72px; height: 72px; border-radius: 16px; margin-top: 0; }
}

/* ── Manage page: full-width distributed tab bar ────────────────────────── */
.manage-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 14px 0 2px;
  padding: 0.32rem;
  border: 1px solid var(--glass-line, rgba(255,255,255,0.08));
  border-radius: 12px;
  background: rgba(11,14,21,0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 100%;
  overflow-x: auto;
}
.manage-tabs .manage-tab {
  flex: 1 1 0;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none; background: transparent;
  color: var(--muted, #8a8fa8);
  font: inherit; font-size: 0.86rem; font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 9px;
  cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.manage-tabs .manage-tab .ico { width: 16px; height: 16px; flex: none; opacity: 0.9; }
.manage-tabs .manage-tab:hover { color: var(--txt, #eaf6f3); background: rgba(148,163,199,0.07); box-shadow: none; }
.manage-tabs .manage-tab.active {
  background: var(--acc-soft, rgba(56,232,198,0.1));
  color: var(--acc, #38e8c6);
  box-shadow: inset 0 0 0 1px var(--acc-line, rgba(56,232,198,0.3));
}
.manage-tabs-sep { width: 1px; align-self: stretch; margin: 0.35rem 0.55rem; background: var(--glass-line, rgba(255,255,255,0.1)); flex: none; }
.manage-tabs .manage-tab-tour {
  flex: 0 0 auto;
  border: 1px dashed var(--glass-line, rgba(255,255,255,0.14));
  color: var(--muted, #8a8fa8);
}
.manage-tabs .manage-tab-tour:hover { color: var(--acc, #38e8c6); border-color: var(--acc-line, rgba(56,232,198,0.35)); }

/* ── First-open tutorial (tour card) ────────────────────────────────────── */
.tour-overlay { position: fixed; right: 18px; bottom: 18px; z-index: 90; }
.tour-card {
  position: relative;
  width: min(380px, calc(100vw - 36px));
  padding: 1rem 1.1rem 0.85rem;
  border: 1px solid var(--glass-line, rgba(255,255,255,0.12));
  border-radius: 16px;
  background: rgba(12,15,23,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.9);
  animation: tour-in 0.35s var(--ease, ease) both;
}
@keyframes tour-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.55rem; }
.tour-kicker {
  font-family: var(--pix, inherit);
  font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--acc, #38e8c6);
}
.tour-x { border: none; background: transparent; color: var(--muted, #8a8fa8); cursor: pointer; padding: 3px; border-radius: 6px; }
.tour-x:hover { color: var(--txt, #eaf6f3); }
.tour-x .ico { width: 14px; height: 14px; }
.tour-title { margin: 0 0 0.3rem; font-family: var(--pix, inherit); color: #eaf6f3; font-size: 1.05rem; font-weight: 600; }
.tour-text { margin: 0; color: #9fb3b0; font-size: 0.86rem; line-height: 1.5; min-height: 3.4em; }
.tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.85rem; }
.tour-dots { display: flex; gap: 5px; justify-content: center; margin-top: 0.7rem; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.18); transition: background 0.2s, transform 0.2s; }
.tour-dots i.on { background: var(--acc, #38e8c6); transform: scale(1.3); }
@media (prefers-reduced-motion: reduce) { .tour-card { animation: none; } }

/* ── Embeds: Discord 1:1 message preview ────────────────────────────────── */
.embed-layout {
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, 'Segoe UI', sans-serif;
}
.embed-preview {
  display: block;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  max-width: none;
  overflow: visible;
  padding: 0;
}
.embed-msg-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, 'Segoe UI', sans-serif;
  margin-bottom: 0.4rem;
}
.ep-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #5865f2; color: #fff;
  display: grid; place-items: center; flex: none;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.ep-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.ep-avatar .ico { width: 22px; height: 22px; }
/* Discord collapses empty embed parts — mirror that. */
.embed-preview-title:empty,
.embed-preview-desc:empty,
.embed-preview-author:empty { display: none !important; }
.ep-name { color: #f2f3f5; font-size: 1rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-badge {
  background: #5865f2; color: #fff;
  font-size: 0.6rem; font-weight: 700; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.02em;
  padding: 2px 4.5px 2.8px; border-radius: 3px; flex: none;
}
.ep-time { color: #949ba4; font-size: 0.76rem; flex: none; }
.embed-bubble {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  margin-left: 56px;
  background: #2b2d31;
  border-radius: 4px;
  overflow: hidden;
  max-width: 520px;
}
.embed-preview-bar { width: 4px; grid-row: 1 / span 99; border-radius: 0; }
.embed-preview-body { padding: 0.7rem 0.95rem 0.6rem; gap: 1rem; }
.embed-preview-title { font-size: 1rem; font-weight: 700; color: #f2f3f5; }
.embed-preview-author { font-size: 0.875rem; color: #f2f3f5; }
.embed-preview-desc { color: #dbdee1; font-size: 0.88rem; line-height: 1.35; }
.embed-preview-fields { gap: 0.55rem; margin-top: 0.2rem; }
.embed-preview-field strong { font-size: 0.875rem; color: #f2f3f5; }
.embed-preview-field span { font-size: 0.875rem; color: #dbdee1; }
.embed-preview-thumb { width: 84px; height: 84px; border-radius: 4px; }
.embed-preview-foot {
  color: #949ba4; font-size: 0.75rem;
  margin: 0 0.95rem;
  padding: 0.55rem 0 0.8rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.embed-preview-buttons { padding: 0.15rem 0.95rem 0.85rem; gap: 0.5rem; }
.pv-btn {
  padding: 0.4rem 1rem; border-radius: 8px;
  font-size: 0.875rem; font-weight: 500; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.25);
  white-space: nowrap;
}
@media (max-width: 640px) { .embed-bubble { margin-left: 0; } }/* Discord modal preview (bot manage → Verification → Form modals) */
.discord-modal-preview { background: #313338; border-radius: 8px; padding: 1rem; max-width: 420px; display: grid; gap: 0.9rem; color: #dbdee1; font-size: 0.9rem; }
.dmp-title { font-weight: 700; color: #f2f3f5; font-size: 1.05rem; }
.dmp-field { display: grid; gap: 0.35rem; }
.dmp-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #b5bac1; }
.dmp-input { background: #1e1f22; border-radius: 4px; padding: 0.6rem 0.7rem; color: #dbdee1; min-height: 2.2rem; }
.dmp-input.paragraph { min-height: 5.5rem; }
.dmp-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.2rem; }
.dmp-btn { border: 0; border-radius: 3px; padding: 0.45rem 0.9rem; font-size: 0.85rem; cursor: default; }
.dmp-btn.ghost { background: transparent; color: #dbdee1; }
.dmp-btn.primary { background: #5865f2; color: #fff; }

/* Big image under the embed preview body */
.embed-preview-image { width: calc(100% - 1.9rem); margin: 0 0.95rem 0.7rem; border-radius: 4px; max-height: 280px; object-fit: cover; }

/* Custom buttons card — verification tab */
.discord-action-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cbtn-preview {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.42rem 0.95rem; border-radius: 4px; font-size: 0.86rem;
  font-weight: 600; color: #fff; background: #5865f2; cursor: default;
}
.cbtn-preview.grey { background: #4e5058; }
.cbtn-preview.green { background: #248046; }
.cbtn-preview.red { background: #da373c; }
.cbtn-preview.off { opacity: 0.45; }
.embed-preview-footer {
  padding: 0 0.95rem 0.75rem; font-size: 0.75rem; color: #b5bac1;
  white-space: pre-wrap;
}

/* ── Bot manage: grouped toggles, token card, subnav, donut ─────────────── */
.toggle-groups { display: grid; gap: 0.85rem; margin-top: 0.9rem; }
.toggle-group {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  padding: 0.85rem 0.85rem 0.95rem;
}
.toggle-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.7rem; }
.toggle-group-head h3 { margin: 0; font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--txt); }
.toggle-group-head p { margin: 0.15rem 0 0; }
.toggle-group-head .p-tag { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.toggle-group .switch-grid { gap: 0.45rem; }
.toggle-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.toggle-actions .row-actions { margin: 0; }

.manage-subnav { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.manage-subnav-chip {
  border: 1px solid var(--line-soft); background: var(--panel); color: var(--muted);
  padding: 0.32rem 0.8rem; border-radius: var(--radius-pill);
  font-size: 0.78rem; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.manage-subnav-chip:hover { color: var(--txt); border-color: var(--line-strong); }
.manage-subnav-chip.active { color: var(--acc); border-color: var(--acc-line); background: var(--acc-soft); }
#phisher-card, #securing-card, #verify-dm-card, #modal-editor, #cbtn-card { scroll-margin-top: 5.5rem; }

.token-row { display: flex; align-items: stretch; gap: 0.55rem; flex-wrap: wrap; margin-top: 0.75rem; }
.token-value {
  flex: 1 1 340px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0.62rem 0.8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--field-bg); color: var(--muted);
  font-size: 0.8rem; letter-spacing: 0.02em; user-select: all;
}
.token-value.revealed { color: var(--txt); border-color: var(--acc-line); background: var(--acc-soft); }
.token-row .btn { flex: 0 0 auto; }

.donut-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; margin-top: 0.9rem; }
.donut-col-label { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.45rem; }
.donut-fields .field { margin-bottom: 0.5rem; }
@media (max-width: 860px) {
  .donut-grid { grid-template-columns: 1fr; }
  .token-row { flex-direction: column; }
  .token-row .btn { align-self: flex-start; }
}

/* ── Embed editor: counters, colour picker, dirty pill ─────────────────── */
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.char-count {
  font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums;
  font-style: normal; opacity: 0.75; transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.char-count.warn { color: #f5c56b; opacity: 1; }
.char-count.over { color: #ff7b7b; opacity: 1; }
.char-count.is-set { color: var(--acc); opacity: 1; letter-spacing: 0.04em; }

.color-row { display: flex; align-items: stretch; gap: 0.45rem; }
.color-row .input { flex: 1 1 auto; min-width: 0; }
.color-pick {
  flex: 0 0 auto; display: grid; place-items: center; width: 44px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--field-bg); cursor: pointer; padding: 3px;
  transition: border-color var(--dur) var(--ease);
}
.color-pick:hover { border-color: var(--line-strong); }
.color-pick input[type='color'] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 100%;
  border: none; border-radius: 6px; background: none; cursor: pointer; padding: 0;
}
.color-pick input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
.color-pick input[type='color']::-webkit-color-swatch { border: none; border-radius: 6px; }
.color-pick input[type='color']::-moz-color-swatch { border: none; border-radius: 6px; }

.color-swatches { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.1rem; }
.color-swatch {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; padding: 0;
  background: var(--sw, var(--acc)); border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--acc-glow, rgba(94, 234, 212, 0.35)); }

.embed-actions { align-items: center; }
.embed-dirty {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-left: auto; font-size: 0.74rem; font-weight: 600; color: #f5c56b;
}
.embed-dirty-dot { width: 6px; height: 6px; border-radius: 50%; background: #f5c56b; box-shadow: 0 0 8px rgba(245, 197, 107, 0.7); }

/* ── Command builder ───────────────────────────────────────────────────── */
.cmd-builder { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.1rem; margin-top: 0.9rem; }
.cmd-builder-form { display: grid; gap: 0.85rem; align-content: start; min-width: 0; }
.cmd-builder-side { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.cmd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.cmd-name-row { display: flex; align-items: stretch; }
.cmd-slash {
  display: inline-flex; align-items: center; padding: 0 0.6rem;
  border: 1px solid var(--line); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--panel); color: var(--acc); font-family: var(--mono); font-weight: 700;
}
.cmd-name-row .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.cmd-seg { display: inline-flex; gap: 0.25rem; padding: 0.22rem; border: 1px solid var(--line-soft); border-radius: var(--radius-pill); background: var(--panel); width: fit-content; }
.cmd-seg-btn {
  border: none; background: none; color: var(--muted); font: inherit; font-size: 0.8rem; font-weight: 600;
  padding: 0.36rem 0.85rem; border-radius: var(--radius-pill); cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.cmd-seg-btn:hover { color: var(--txt); }
.cmd-seg-btn.active { color: var(--acc); background: var(--acc-soft); }

.cmd-pane { display: grid; gap: 0.85rem; }
.cmd-pane[hidden] { display: none !important; }
.color-field { display: flex; gap: 0.45rem; }
.color-field input[type='color'] {
  -webkit-appearance: none; appearance: none; width: 44px; height: 38px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--field-bg);
  padding: 3px; cursor: pointer;
}
.color-field input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type='color']::-webkit-color-swatch { border: none; border-radius: 6px; }
.color-field input[type='color']::-moz-color-swatch { border: none; border-radius: 6px; }

.cmd-fields-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.cmd-fields { display: grid; gap: 0.55rem; }
.cmd-field-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto auto; gap: 0.45rem; align-items: center;
  padding: 0.5rem; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel);
}
.cmd-field-row .input { min-width: 0; }
.cmd-field-row .btn-xs { justify-self: end; }
.cmd-field-row.cmd-field-row-modal { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto auto auto; }

.cmd-inline { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); }
.cmd-modal-block { display: grid; gap: 0.6rem; padding: 0.75rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); }
.cmd-modal-pane { display: grid; gap: 0.65rem; padding-top: 0.35rem; }
.cmd-modal-pane[hidden] { display: none !important; }
.cmd-private { padding: 0.65rem 0.75rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); }
.cmd-actions { margin-top: 0.2rem; align-items: center; }

.cmd-preview .embed-preview-desc:empty::before { content: 'Reply text shows up here as you type.'; color: var(--muted); }
.cmd-modal-preview { margin-top: 0.75rem; }
.cmd-list { display: grid; gap: 0.5rem; }
.cmd-item {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.65rem;
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel);
  transition: border-color var(--dur) var(--ease);
}
.cmd-item:hover { border-color: var(--line-strong); }
.cmd-item-main { min-width: 0; flex: 1 1 auto; }
.cmd-item-name { font-family: var(--mono); font-size: 0.84rem; color: var(--txt); }
.cmd-item-desc { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.cmd-item-actions { display: flex; gap: 0.25rem; flex: 0 0 auto; }

@media (max-width: 980px) {
  .cmd-builder { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cmd-two { grid-template-columns: 1fr; }
  .cmd-field-row, .cmd-field-row.cmd-field-row-modal { grid-template-columns: 1fr; }
}

/* ── Sidebar polish ───────────────────────────────────────────────────── */
.side-brand { padding-bottom: 0.9rem; }
.side-search {
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--field-bg);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.side-search:focus-within { border-color: var(--acc-line); box-shadow: 0 0 0 3px var(--acc-glow, rgba(94, 234, 212, 0.14)); }
.side-search input { background: none; border: none; outline: none; }
.side-label { font-weight: 700; }
.side-nav a { position: relative; }
.side-nav a .nav-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav a .nav-badge {
  margin-left: auto; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 0.14rem 0.4rem; border-radius: var(--radius-pill);
  color: var(--muted); border: 1px solid var(--line-soft); background: var(--panel);
}
.side-nav a.active .nav-badge { color: var(--acc); border-color: var(--acc-line); background: var(--acc-soft); }
.side-nav a.active .ico { color: var(--acc); }
.side-nav a:focus-visible, .side-mini:focus-visible { outline: 2px solid var(--acc-line); outline-offset: 2px; }
.side-mini:hover { color: var(--txt); background: rgba(255, 255, 255, 0.045); }
