:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-soft: #f6f7f9;
  --surface-hover: #eceef2;
  --sidebar: var(--panel);
  --sidebar-soft: var(--panel-soft);
  --text: #202226;
  --muted: #5d626b;
  --border: #d9dde3;
  --border-strong: #858d99;
  --accent: #ff7a1a;
  --accent-2: #ff9f45;
  --accent-soft: #fff1e7;
  --accent-ink: #a64100;
  --accent-border: #efb486;
  --on-accent: #281304;
  --on-bot-avatar: #080a0c;
  --green: #187345;
  --green-soft: #eaf9f1;
  --red: #ba3434;
  --red-soft: #fff0f0;
  --purple: #6251c7;
  --purple-soft: #efedff;
  --blue: #245fc3;
  --blue-soft: #ebf2ff;
  --shadow: 0 12px 32px rgba(27, 31, 38, .07);
  --shadow-pop: 0 16px 40px rgba(18, 22, 28, .16);
  --overlay: rgba(12, 14, 18, .55);
  --primary-bg: #24262b;
  --on-primary: #ffffff;
  --inverse-bg: #24262b;
  --inverse-text: #ffffff;
  --inverse-muted: #b6bdc8;
  --inverse-border: #494f59;
  --switch-off: #747c88;
  --switch-thumb: #ffffff;
  --switch-on-thumb: #ffffff;
  --focus: #a64100;
  --focus-soft: rgba(166, 65, 0, .14);
  --selection: rgba(255, 122, 26, .22);
  --status-ring: rgba(24, 115, 69, .16);
  --discord-brand: #4752c4;
  --discord-bg: #ffffff;
  --discord-embed: #f2f3f5;
  --discord-text: #313338;
  --discord-muted: #5c5e66;
  --discord-secondary-bg: #e3e5e8;
  --discord-secondary-text: #313338;
  --discord-success: #1f7041;
  --discord-danger: #c53137;
  --discord-profile-bg: #ffffff;
  --discord-profile-border: #d9dde3;
  --discord-profile-muted: #5c5e66;
  --discord-profile-banner: #8fa58e;
  --discord-profile-offline: #80848e;
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar-width: 262px;
  --sidebar-rail: 76px;
  --sidebar-offset: var(--sidebar-rail);
  --motion-duration: 220ms;
  --motion-ease: cubic-bezier(.2, .8, .2, 1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214;
  --panel: #1b1d21;
  --panel-soft: #23262b;
  --surface-hover: #2d3138;
  --text: #f0f1f3;
  --muted: #afb5bf;
  --border: #363a42;
  --border-strong: #727c8b;
  --accent-soft: #38291e;
  --accent-ink: #ffac6c;
  --accent-border: #815131;
  --green: #70d5a0;
  --green-soft: #15382a;
  --red: #ff9999;
  --red-soft: #402427;
  --purple: #b5aaff;
  --purple-soft: #302a4a;
  --blue: #8fb5ff;
  --blue-soft: #202f49;
  --primary-bg: #eceef2;
  --on-primary: #181a1e;
  --switch-off: #727c8b;
  --switch-on-thumb: #281304;
  --focus: #ffac6c;
  --focus-soft: rgba(255, 172, 108, .16);
  --status-ring: rgba(112, 213, 160, .16);
  --shadow: 0 12px 32px rgba(0, 0, 0, .18);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, .35);
  --discord-bg: #313338;
  --discord-embed: #2b2d31;
  --discord-text: #dbdee1;
  --discord-muted: #b5bac1;
  --discord-secondary-bg: #4e5058;
  --discord-secondary-text: #ffffff;
  --discord-profile-bg: #0c0d0f;
  --discord-profile-border: #303238;
  --discord-profile-muted: #b5bac1;
}

:root[data-custom-theme="haoomod"] {
  --bg: #080b10;
  --panel: #171b21;
  --panel-soft: #232a31;
  --sidebar: #14181e;
  --muted: #b9c1cc;
  --border: #3c4651;
  --accent: #00a8ff;
  --accent-2: #65ceff;
  --accent-soft: #163547;
  --accent-ink: #72d0ff;
  --accent-border: #267da8;
  --on-accent: #062332;
  --switch-on-thumb: #062332;
  --focus: #72d0ff;
  --focus-soft: rgba(0, 168, 255, .18);
  --selection: rgba(0, 168, 255, .3);
}
:root[data-custom-theme="haoomod"] body { background: linear-gradient(125deg, #05080c 8%, #071321 48%, #06283a 80%, #073c49 100%); background-attachment: fixed; }
.theme-transitioning { overflow: hidden; }
.theme-transition { padding: 0; margin: 0; border: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; color: #edf7ff; background: transparent; overflow: hidden; }
.theme-transition::before { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, #03080d, #052137 70%, #064454); opacity: 1; transition: opacity 650ms ease; }
.theme-transition::backdrop { background: transparent; }
.theme-transition[open] { display: block; animation: themeLettersIn 250ms ease both; }
.theme-transition[open].is-leaving { animation: themeLettersOut 300ms ease both; }
.theme-transition.is-draining::before, .theme-transition.is-draining .theme-transition-content, .theme-transition.is-draining .theme-transition-brand { opacity: 0; pointer-events: none; }
.theme-transition-letters { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.theme-transition-brand { position: absolute; top: max(28px, env(safe-area-inset-top)); left: max(28px, env(safe-area-inset-left)); color: #d2e8f2; font-size: 13px; font-weight: 600; text-shadow: 0 2px 8px #03080d; transition: opacity 300ms ease; }
.theme-transition h2 { position: absolute; inset: 45% 20px auto; margin: 0; color: #edf7ff; font-size: 64px; font-weight: 800; line-height: 1.2; text-align: center; transform: translateY(-50%); }
.theme-transition.is-ready h2 { animation: themeLettersBurst 1s ease both; }
.theme-transition-content { position: absolute; bottom: max(40px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(220px, calc(100% - 56px)); display: grid; justify-items: center; gap: 14px; text-align: center; padding: 18px 20px; background: #05111be6; border-radius: 6px; transition: opacity 300ms ease; pointer-events: none; }
.theme-transition-status { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0; color: #d2e8f2; font-size: 13px; }
[data-transition-loader] { display: grid; place-items: center; color: #52c5ff; animation: themeLoaderSpin 1.8s linear infinite; }
.theme-transition-content progress { appearance: none; -webkit-appearance: none; width: 100%; height: 3px; overflow: hidden; border: 0; background: #36414d; color: #00a8ff; }
.theme-transition-content progress::-webkit-progress-bar { background: #36414d; }
.theme-transition-content progress::-webkit-progress-value { background: #00a8ff; }
.theme-transition-content progress::-moz-progress-bar { background: #00a8ff; }
.theme-transition-finish { position: absolute; z-index: 1; top: max(20px, env(safe-area-inset-top)); right: max(20px, env(safe-area-inset-right)); color: #c7e9fa; border: 0; border-radius: 6px; }
.theme-transition-finish:hover { color: #ffffff; background: #153447; }
@keyframes themeLettersBurst { 0%, 60% { opacity: 1; transform: translateY(-50%) scale(1); } 100% { opacity: 0; transform: translateY(-50%) scale(1.14); } }
@keyframes themeLettersIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes themeLettersOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes themeLoaderSpin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
  .theme-transition h2 { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-transition[open], .theme-transition[open].is-leaving, .theme-transition h2, [data-transition-loader] { animation: none; }
  .theme-transition-letters { visibility: hidden; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.ete-panel { max-width: 1120px; }
.welcome-template-control { display: flex; align-items: center; gap: 8px; }
.welcome-template-control .select { flex: 1; min-width: 0; }
.welcome-template-control .button { flex-shrink: 0; }
.levels-tabs { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0 0 24px; border-bottom: 1px solid var(--border); }
.levels-tabs [role=tab] { min-height: 44px; padding: 10px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.levels-tabs [aria-selected=true] { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }
.levels-tabs [role=tab]:hover { color: var(--text); }
.levels-tabs [role=tab]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.levels-tab-panel { animation: levelsPanelIn 180ms ease-out; }
.levels-curve { width: 100%; margin-top: 24px; border-collapse: collapse; font-size: 13px; text-align: left; font-variant-numeric: tabular-nums; }
.levels-curve caption { text-align: left; font-weight: 600; margin-bottom: 12px; }
.levels-curve th, .levels-curve td { padding: 12px 8px; border-bottom: 1px solid var(--border); }
.levels-curve th { color: var(--muted); font-weight: 500; }
.levels-member-search { display: flex; align-items: end; gap: 12px; }
.levels-member-search .field { flex: 1; min-width: 0; margin: 0; }
.levels-member-search .button { flex-shrink: 0; }
.levels-member-result { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding: 12px; border-radius: 6px; background: var(--panel-soft); }
.levels-member-result img { border-radius: 50%; flex: 0 0 40px; }
.levels-member-result div { min-width: 0; overflow-wrap: anywhere; }
.levels-member-result span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.levels-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-block: 20px; margin: 0 0 20px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.levels-metrics dt { font-size: 12px; color: var(--muted); }
.levels-metrics dd { margin: 6px 0 0; font-size: 18px; overflow-wrap: anywhere; }
.levels-members > .button { margin-top: 20px; }
@keyframes levelsPanelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) { .levels-tabs { gap: 0 16px; } .levels-tabs [role=tab] { font-size: 12px; } .levels-member-search { flex-wrap: wrap; } .levels-member-search .field { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { .levels-tab-panel { animation: none; } }
.ete-panel fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ete-panel .field-grid { align-items: start; }
.ete-panel .full { grid-column: 1 / -1; min-width: 0; }
.ete-panel .setting-row { min-height: 54px; gap: 18px; border-bottom: 1px solid var(--border); }
.ete-panel .setting-row label { font-size: 12px; font-weight: 600; }
.ete-panel .input, .ete-panel .select, .ete-panel .textarea { font-size: 13px; min-height: 40px; }
.ete-panel input[type=color] { width: 76px; padding: 4px; }
.ete-panel .textarea { min-height: 110px; resize: vertical; }
.ete-panel .field label { font-size: 12px; }
.ete-panel .field small { font-size: 11px; }
.ete-group, .ete-collection { padding-top: 22px; border-top: 1px solid var(--border); margin-top: 6px; }
.ete-group h2, .ete-collection h2 { font-size: 15px; margin: 0 0 18px; }
.ete-collection-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ete-collection-head h2 { margin: 0; }
.ete-collection-head h2 span { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }
.ete-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.ete-item summary { cursor: pointer; font-size: 13px; font-weight: 600; margin-bottom: 16px; overflow-wrap: anywhere; }
.ete-item-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.ete-item .ete-collection { padding-left: 16px; border-left: 2px solid var(--border); }
.ete-panel .danger { color: var(--red); }
.ete-empty { color: var(--muted); font-size: 13px; }
.ete-panel :disabled { cursor: not-allowed; opacity: .65; }
.ete-panel :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ete-up-icon { transform: rotate(180deg); }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
input, select, textarea { outline: none; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 75;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  background: linear-gradient(180deg, var(--inverse-bg) 0%, var(--inverse-bg) 100%);
  color: var(--inverse-text);
  overflow: hidden;
}
.brand { min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 0 7px 14px; }
.brand-mark {
  width: 37px; height: 37px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: var(--on-accent); font-weight: 900; box-shadow: 0 7px 22px var(--focus-soft);
}
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 15px; letter-spacing: 0; }
.brand-copy span { font-size: 10px; color: var(--muted); margin-top: 5px; text-transform: uppercase; letter-spacing: 0; }

.bot-card { margin: 4px 3px 14px; padding: 11px; border: 1px solid var(--border); border-radius: 14px; background: var(--inverse-bg); display: flex; align-items: center; gap: 10px; }
.bot-avatar { flex: 0 0 39px; width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--on-accent); background: linear-gradient(145deg, var(--accent), var(--accent-2)); }
.bot-meta { min-width: 0; flex: 1; display: grid; }
.bot-meta .eyebrow { font-size: 8px; color: var(--muted); letter-spacing: 0; font-weight: 800; }
.bot-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; margin: 2px 0 3px; }
.bot-meta > span:last-child { color: var(--muted); font-size: 10px; }
.status-dot { display: inline-block; width: 7px; height: 7px; background: var(--green); border-radius: 50%; margin-right: 5px; box-shadow: 0 0 0 3px var(--status-ring); }
.chevron-button, .icon-button { border: 0; background: transparent; }
.chevron-button { color: var(--muted); padding: 5px; }

.sidebar-search { margin: 0 3px 11px; height: 38px; border: 1px solid var(--border); border-radius: 11px; background: var(--inverse-bg); display: flex; align-items: center; gap: 8px; padding: 0 11px; color: var(--muted); }
.sidebar-search input { width: 100%; border: 0; background: transparent; color: var(--text); font-size: 11px; }
.sidebar-search input::placeholder { color: var(--muted); }

.sidebar-nav { flex: 1; overflow: auto; padding: 0 3px 12px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; min-height: 0; }
.nav-group { margin-bottom: 13px; }
.nav-label { margin: 0 9px 6px; color: var(--muted); font-size: 8.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
.nav-item { width: 100%; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 10px; padding: 0 10px; margin: 2px 0; text-align: left; font-size: 11.5px; transition: .18s ease; }
.nav-item:hover { color: var(--inverse-text); background: var(--inverse-bg); transform: translateX(2px); }
.nav-item.active { color: var(--inverse-text); background: linear-gradient(90deg, var(--focus-soft), var(--focus-soft)); box-shadow: inset 2px 0 var(--accent); }
.nav-icon { width: 18px; height: 18px; display: grid; place-items: center; font-size: 14px; color: var(--muted); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-badge { margin-left: auto; min-width: 20px; height: 18px; display: grid; place-items: center; border-radius: 20px; font-size: 9px; font-weight: 800; color: var(--accent-ink); background: var(--focus-soft); }
.nav-item.hidden-by-search, .nav-group.hidden-by-search { display: none; }

.sidebar-footer { border-top: 1px solid var(--border); padding: 13px 5px 0; display: flex; align-items: center; justify-content: space-between; }
.client-mini { min-width: 0; display: flex; gap: 9px; align-items: center; }
.client-avatar { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: var(--inverse-bg); color: var(--border-strong); font-size: 9px; font-weight: 800; }
.client-mini div:last-child { min-width: 0; display: grid; }
.client-mini strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.client-mini span { color: var(--muted); font-size: 9px; margin-top: 2px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); transition: .18s; }
.icon-button:hover { background: var(--inverse-bg); color: var(--inverse-text); }

.page-area { width: calc(100% - var(--sidebar-width)); margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar { height: 72px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; background: var(--panel); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.server-select { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; border: 1px solid transparent; border-radius: 12px; transition: .18s; }
.server-select:hover { background: var(--panel); border-color: var(--border); box-shadow: 0 6px 18px var(--overlay); }
.server-avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--inverse-bg); color: var(--inverse-text); font-size: 12px; font-weight: 800; }
.server-select > div:nth-child(2) { display: grid; }
.server-select span { color: var(--muted); font-size: 9px; }
.server-select strong { font-size: 11.5px; margin-top: 2px; }
.server-arrow { margin-left: 5px; }
.connection-pill { height: 30px; padding: 0 10px; border: 1px solid var(--green-soft); border-radius: 999px; display: flex; align-items: center; gap: 6px; color: var(--green); background: var(--green-soft); font-size: 9.5px; }
.connection-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--status-ring); }
.notification-button { position: relative; border: 1px solid var(--border); background: var(--panel); }
.notification-button:hover { background: var(--panel); color: var(--text); box-shadow: 0 5px 15px var(--overlay); }
.notification-button i { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; border: 2px solid var(--panel); }
.profile-button { height: 44px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 5px; }
.profile-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--inverse-bg); color: var(--inverse-text); font-size: 10px; font-weight: 800; }
.profile-copy { display: grid; text-align: left; }
.profile-copy strong { font-size: 10.5px; }
.profile-copy span { color: var(--muted); font-size: 8.5px; margin-top: 2px; }
.profile-button > span { color: var(--muted); font-size: 10px; }
.menu-button { display: none; color: var(--text); }
.mobile-only { display: none; }

.content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 30px 34px 110px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: 26px; letter-spacing: 0; }
.page-heading p { margin: 7px 0 0; max-width: 720px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.heading-actions { display: flex; gap: 9px; }
.button { min-height: 38px; border-radius: 11px; padding: 0 14px; border: 1px solid var(--border); background: var(--panel); font-weight: 750; font-size: 10.5px; transition: .18s ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 7px 18px var(--overlay); }
.button.primary { border-color: var(--inverse-bg); background: var(--inverse-bg); color: var(--inverse-text); }
.button.accent { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.button.ghost { background: transparent; }
.button.danger { color: var(--red); border-color: var(--red-soft); background: var(--red-soft); }

.hero { min-height: 202px; border-radius: 24px; overflow: hidden; position: relative; padding: 29px; background: linear-gradient(120deg, var(--inverse-bg) 0%, var(--inverse-bg) 64%, var(--inverse-bg) 100%); color: var(--inverse-text); box-shadow: var(--shadow); margin-bottom: 18px; }
.hero::before { content: ""; position: absolute; width: 330px; height: 330px; right: -70px; top: -135px; border-radius: 50%; background: radial-gradient(circle, var(--focus-soft), transparent 68%); }
.hero::after { content: ""; position: absolute; inset: 0; opacity: .12; background-image: radial-gradient(var(--panel) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent, black); }
.hero-content { position: relative; z-index: 2; max-width: 660px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--inverse-border); background: var(--inverse-border); border-radius: 999px; color: var(--inverse-muted); font-size: 9px; }
.hero-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero h2 { margin: 17px 0 8px; font-size: 24px; letter-spacing: 0; }
.hero p { margin: 0; max-width: 570px; color: var(--inverse-muted); font-size: 11.5px; line-height: 1.6; }
.hero-actions { display: flex; gap: 8px; margin-top: 19px; }
.hero .button { background: var(--inverse-border); color: var(--inverse-text); border-color: var(--inverse-border); }
.hero .button.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.stat-card { position: relative; min-height: 126px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 17px; overflow: hidden; }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--muted); font-size: 9.5px; font-weight: 700; }
.stat-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; }
.stat-icon.orange { background: var(--accent-soft); color: var(--accent); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-number { display: block; margin-top: 13px; font-size: 25px; font-weight: 850; letter-spacing: 0; }
.stat-foot { margin-top: 3px; color: var(--muted); font-size: 8.8px; }
.stat-foot strong { color: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,.85fr); gap: 15px; }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: 0 5px 18px var(--overlay); }
.card-header { min-height: 62px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--border); }
.card-title { display: grid; }
.card-title strong { font-size: 12px; }
.card-title span { color: var(--muted); font-size: 9px; margin-top: 3px; }
.card-body { padding: 18px; }

.activity-chart { height: 175px; display: flex; align-items: flex-end; gap: 9px; padding: 18px 3px 6px; border-bottom: 1px solid var(--panel-soft); }
.chart-column { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; }
.chart-column span { width: 100%; min-height: 8px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); transition: .25s ease; }
.chart-column:hover span { filter: saturate(1.15); transform: translateY(-2px); }
.chart-column::after { content: attr(data-label); position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 8px; }
.chart-summary { display: flex; gap: 20px; margin-top: 28px; }
.chart-summary div { display: grid; }
.chart-summary strong { font-size: 12px; }
.chart-summary span { color: var(--muted); font-size: 8.5px; margin-top: 2px; }

.quick-list { display: grid; gap: 8px; }
.quick-item { width: 100%; min-height: 55px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); display: flex; align-items: center; gap: 10px; text-align: left; transition: .18s; }
.quick-item:hover { border-color: var(--border); transform: translateY(-1px); box-shadow: 0 7px 20px var(--overlay); }
.quick-symbol { width: 33px; height: 33px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-soft); font-size: 13px; }
.quick-item div { min-width: 0; display: grid; flex: 1; }
.quick-item strong { font-size: 10px; }
.quick-item span { color: var(--muted); font-size: 8.5px; margin-top: 2px; }
.quick-item > b { color: var(--muted); }

.module-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.module-card { padding: 16px; border: 1px solid var(--border); border-radius: 15px; background: var(--panel); transition: .18s; }
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.module-card-top { display: flex; align-items: center; justify-content: space-between; }
.module-card-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--panel-soft); }
.module-card h3 { margin: 12px 0 4px; font-size: 11.5px; }
.module-card p { margin: 0; color: var(--muted); font-size: 8.9px; line-height: 1.5; }

.settings-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(290px,.7fr); gap: 15px; align-items: start; }
.settings-stack { display: grid; gap: 14px; }
.settings-section { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.section-head { padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.section-head-copy { display: grid; }
.section-head strong { font-size: 12px; }
.section-head span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.section-content { padding: 18px 19px; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 9.5px; font-weight: 750; }
.field small { color: var(--muted); font-size: 8.4px; line-height: 1.45; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--border-strong); background: var(--panel); border-radius: 10px; color: var(--text); transition: .18s; }
.input, .select { height: 40px; padding: 0 11px; font-size: 10.5px; }
.textarea { min-height: 92px; resize: vertical; padding: 11px; font-size: 10.5px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--border-strong); box-shadow: 0 0 0 4px var(--focus-soft); }
.inline-prefix { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.inline-prefix span { height: 38px; display: grid; place-items: center; padding: 0 10px; background: var(--panel-soft); color: var(--muted); border-right: 1px solid var(--border); font-size: 9px; }
.inline-prefix input { border: 0; border-radius: 0; }

.setting-row { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--panel-soft); }
.setting-row:first-child { padding-top: 0; }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-copy { min-width: 0; display: grid; }
.setting-copy strong { font-size: 10.5px; }
.setting-copy span { color: var(--muted); font-size: 8.7px; line-height: 1.45; margin-top: 3px; }
.switch { width: 39px; height: 22px; border: 0; border-radius: 999px; background: var(--border-strong); padding: 3px; transition: .2s; flex: 0 0 auto; }
.switch::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); box-shadow: 0 2px 7px var(--overlay); transition: .2s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(17px); }

.preview-card { position: sticky; top: 92px; border-radius: 19px; overflow: hidden; background: var(--inverse-bg); color: var(--inverse-text); box-shadow: var(--shadow); }
.preview-head { padding: 15px 17px; border-bottom: 1px solid var(--inverse-border); display: flex; align-items: center; justify-content: space-between; }
.preview-head strong { font-size: 10.5px; }
.preview-head span { color: var(--inverse-muted); font-size: 8.5px; }
.discord-preview { min-height: 355px; padding: 21px 17px; background: var(--discord-bg); }
.discord-channel { color: var(--muted); font-size: 9px; margin-bottom: 17px; }
.discord-message { display: flex; gap: 10px; }
.discord-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg,var(--accent),var(--accent-2)); color: var(--on-accent); font-weight: 900; font-size: 9px; }
.discord-copy { flex: 1; min-width: 0; }
.discord-author { display: flex; gap: 6px; align-items: center; font-size: 10px; font-weight: 800; }
.bot-tag { padding: 2px 4px; border-radius: 3px; background: var(--discord-brand); font-size: 6px; font-weight: 800; }
.discord-time { color: var(--muted); font-size: 7px; font-weight: 400; }
.discord-text { color: var(--discord-text); font-size: 9px; margin: 4px 0 8px; }
.discord-embed { border-left: 3px solid var(--accent); border-radius: 4px; background: var(--discord-embed); padding: 11px; }
.discord-embed strong { font-size: 9px; }
.discord-embed p { color: var(--discord-muted); font-size: 8px; line-height: 1.45; margin: 5px 0 10px; }
.discord-actions { display: flex; gap: 6px; }
.discord-actions button { height: 24px; border: 0; border-radius: 4px; background: var(--discord-brand); color: var(--inverse-text); padding: 0 8px; font-size: 7px; font-weight: 750; }

.rule-list, .log-list, .command-list, .audit-list { display: grid; gap: 8px; }
.rule-card, .log-row, .command-row, .audit-row { border: 1px solid var(--border); border-radius: 13px; background: var(--panel); }
.rule-card { padding: 13px 14px; display: flex; align-items: center; gap: 11px; }
.rule-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); }
.rule-copy { flex: 1; display: grid; }
.rule-copy strong { font-size: 10.5px; }
.rule-copy span { color: var(--muted); font-size: 8.6px; margin-top: 3px; }

.log-row, .audit-row { padding: 11px 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.log-copy, .audit-copy { display: grid; }
.log-copy strong, .audit-copy strong { font-size: 9.7px; }
.log-copy span, .audit-copy span { color: var(--muted); font-size: 8.3px; margin-top: 2px; }
.log-time, .audit-time { color: var(--muted); font-size: 8px; white-space: nowrap; }

.toolbar { display: flex; gap: 9px; align-items: center; margin-bottom: 12px; }
.toolbar .input { max-width: 280px; }
.filter-chip { height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--muted); font-size: 9px; }
.filter-chip.active { color: var(--text); border-color: var(--border); background: var(--panel-soft); }
.command-row { min-height: 55px; padding: 10px 13px; display: grid; grid-template-columns: 36px minmax(150px,1fr) minmax(110px,.7fr) auto; align-items: center; gap: 10px; }
.command-symbol { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-soft); color: var(--muted); font-weight: 900; font-size: 10px; }
.command-copy { display: grid; }
.command-copy strong { font-size: 10px; }
.command-copy span { color: var(--muted); font-size: 8px; margin-top: 2px; }
.command-permission { color: var(--muted); font-size: 8.5px; }

.integration-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.integration-card { border: 1px solid var(--border); border-radius: 16px; background: var(--panel); padding: 16px; display: grid; min-height: 168px; }
.integration-logo { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-soft); font-size: 15px; }
.integration-card h3 { margin: 12px 0 4px; font-size: 11.5px; }
.integration-card p { margin: 0; color: var(--muted); font-size: 8.8px; line-height: 1.5; }
.integration-foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; }
.integration-status { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8.5px; }
.integration-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.integration-status.connected { color: var(--green); }
.integration-status.connected i { background: var(--green); }

.permission-table { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; }
.permission-row { min-height: 51px; display: grid; grid-template-columns: minmax(170px,1.5fr) repeat(3,minmax(90px,.6fr)); align-items: center; border-bottom: 1px solid var(--border); }
.permission-row:last-child { border-bottom: 0; }
.permission-row.header { min-height: 40px; background: var(--panel-soft); color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
.permission-row > div { padding: 0 13px; }
.permission-name { display: grid; }
.permission-name strong { font-size: 9.7px; }
.permission-name span { color: var(--muted); font-size: 8px; margin-top: 2px; }
.check { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); font-size: 10px; }
.check.on { color: var(--inverse-text); background: var(--green); border-color: var(--green); }

.empty-search { padding: 20px; color: var(--muted); font-size: 10px; text-align: center; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 8px; font-weight: 800; }
.badge.green { color: var(--green); background: var(--green-soft); }
.badge.orange { color: var(--accent-ink); background: var(--accent-soft); }
.badge.gray { color: var(--muted); background: var(--panel-soft); }

.save-bar { position: fixed; left: calc(var(--sidebar-width) + 34px); right: 34px; bottom: 20px; z-index: 60; min-height: 58px; border: 1px solid var(--border); border-radius: 15px; background: var(--panel); color: var(--inverse-text); box-shadow: 0 20px 50px var(--overlay); backdrop-filter: blur(16px); padding: 9px 10px 9px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; transform: translateY(110px); opacity: 0; pointer-events: none; transition: .25s ease; }
.save-bar.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.save-bar > div:first-child { display: flex; align-items: center; gap: 9px; }
.save-bar strong { font-size: 10px; }
.save-bar span:not(.unsaved-dot) { color: var(--muted); font-size: 8.5px; }
.unsaved-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--focus-soft); }
.save-actions { display: flex; gap: 7px; }
.save-bar .button.ghost { color: var(--muted); border-color: var(--border); }
.save-bar .button.primary { background: var(--panel); color: var(--inverse-bg); border-color: var(--panel); }

.toast { position: fixed; right: 25px; top: 89px; z-index: 80; min-width: 290px; max-width: calc(100vw - 36px); border: 1px solid var(--green-soft); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 45px var(--overlay); padding: 12px; display: flex; gap: 10px; align-items: center; transform: translateX(360px); opacity: 0; transition: .27s ease; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast-icon { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-weight: 900; }
.toast div { display: grid; }
.toast strong { font-size: 9.7px; }
.toast span:last-child { color: var(--muted); font-size: 8px; margin-top: 2px; }
.backdrop { display: none; }

@media (max-width: 1120px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .module-grid, .integration-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .preview-card { position: static; }
}

@media (max-width: 820px) {
  :root { --sidebar-width: 255px; }
  .sidebar { transform: translateX(-100%); transition: .25s ease; box-shadow: 20px 0 50px var(--overlay); }
  .sidebar.open { transform: translateX(0); }
  .page-area { width: 100%; margin-left: 0; }
  .menu-button, .mobile-only { display: grid; }
  .mobile-only { margin-left: auto; }
  .topbar { padding: 0 17px; }
  .connection-pill, .profile-copy, .profile-button > span { display: none; }
  .content { padding: 22px 17px 100px; }
  .save-bar { left: 17px; right: 17px; bottom: 14px; }
  .backdrop { position: fixed; inset: 0; z-index: 70; background: var(--overlay); backdrop-filter: blur(2px); }
  .backdrop.show { display: block; }
}

@media (max-width: 600px) {
  .topbar { height: 64px; }
  .server-select > div:nth-child(2) span { display: none; }
  .server-select strong { max-width: 140px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .hero { padding: 23px 20px; }
  .stats-grid, .module-grid, .integration-grid, .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .permission-table { overflow-x: auto; }
  .permission-row { min-width: 600px; }
  .command-row { grid-template-columns: 34px 1fr auto; }
  .command-permission { display: none; }
  .save-bar { align-items: stretch; flex-direction: column; gap: 8px; }
  .save-bar > div:first-child { align-items: flex-start; display: grid; grid-template-columns: 15px 1fr; }
  .save-bar > div:first-child span:last-child { grid-column: 2; }
  .save-actions .button { flex: 1; }
}

/* ==================================================================
   EVOLUÇÃO — componentes, estados, animações e acessibilidade
   (sobrescreve regras anteriores quando necessário)
   ================================================================== */

/* ---------- Base e tipografia ---------- */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--selection); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.content:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.ic { display: inline-block; flex: 0 0 auto; vertical-align: middle; }

/* ---------- Sidebar / navegação ---------- */
.nav-icon .ic { display: block; }
.nav-fade { animation: navFade .28s ease; }
@keyframes navFade { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

.bot-slot { margin: 4px 3px 14px; }
.bot-card { margin: 0; width: 100%; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.bot-card:hover { border-color: var(--border); background: var(--inverse-bg); }
.status-dot.off { background: var(--muted); box-shadow: 0 0 0 3px var(--surface-hover); }

/* ---------- Tooltips (data-tip) ---------- */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 9px); left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: var(--inverse-bg); color: var(--inverse-text); font-size: 9.5px; font-weight: 600;
  padding: 5px 9px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: .18s ease;
  z-index: 90; box-shadow: 0 8px 22px var(--overlay);
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Dropdowns / menus ---------- */
.dd-wrap { position: relative; }
.menu-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 70; min-width: 268px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 50px var(--overlay); padding: 7px;
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: .16s ease;
}
.menu-pop.open { opacity: 1; transform: none; animation: surfaceIn var(--motion-duration) var(--motion-ease) backwards; }
@keyframes surfaceIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
details[open] > :not(summary) { animation: revealIn var(--motion-duration) var(--motion-ease) backwards; }
@keyframes revealIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.backdrop.show { animation: fadeIn var(--motion-duration) ease backwards; }
.menu-pop[hidden] { display: none; }
.bot-slot .menu-pop { left: 3px; right: auto; width: calc(var(--sidebar-width) - 40px); min-width: 218px; transform-origin: top left; }
#serverMenu { left: 0; right: auto; transform-origin: top left; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 10px; background: transparent; text-align: left;
  font-size: 10.5px; color: var(--text); transition: .14s;
}
.menu-item:hover { background: var(--panel-soft); }
.menu-item.active { background: var(--accent-soft); }
.menu-item > .ic { color: var(--muted); }
.menu-item.active > .ic { color: var(--accent); }
.menu-item.danger, .menu-item.danger > .ic { color: var(--red); }
.menu-item.danger:hover { background: var(--red-soft); }
.menu-avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--inverse-text); font-size: 9px; font-weight: 800; flex: 0 0 auto; }
.menu-avatar.dark { background: var(--inverse-bg); }
.menu-copy { min-width: 0; flex: 1; display: grid; }
.menu-copy strong { font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-copy span { color: var(--muted); font-size: 8.6px; margin-top: 2px; }
.menu-copy .status-dot { margin-right: 3px; }
.menu-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 9px; border-bottom: 1px solid var(--panel-soft); margin-bottom: 5px;
}
.menu-head strong { font-size: 8.5px; text-transform: uppercase; letter-spacing: 0; color: var(--muted); font-weight: 800; }
.menu-head > span:not(.profile-avatar):not(.notif-icon) { color: var(--muted); font-size: 8.5px; }
.menu-foot { padding-top: 7px; border-top: 1px solid var(--panel-soft); margin-top: 5px; }
.menu-sep { height: 1px; background: var(--panel-soft); margin: 5px 4px; }
.link-button { border: 0; background: none; color: var(--accent); font-size: 8.5px; font-weight: 750; padding: 2px 4px; }
.link-button:hover { text-decoration: underline; }

.profile-head { justify-content: flex-start; gap: 10px; }
.profile-head .profile-avatar { flex: 0 0 auto; }
.profile-head div { display: grid; }
.profile-head strong { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 11px; }
.profile-head span { color: var(--muted); font-size: 8.6px; margin-top: 2px; }

.notif-pop { min-width: 320px; }
.notif-item { align-items: flex-start; padding: 10px; }
.notif-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; }
.notif-icon.purple { background: var(--purple-soft); color: var(--purple); }
.notif-icon.orange { background: var(--accent-soft); color: var(--accent); }
.notif-icon.green { background: var(--green-soft); color: var(--green); }
.notif-icon.blue { background: var(--blue-soft); color: var(--blue); }
.notif-side { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.notif-side em { color: var(--muted); font-size: 7.5px; font-style: normal; }
.unread-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.notif-badge { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; border: 2px solid var(--panel); }

/* ---------- Pill de conexão ---------- */
.connection-pill.off { color: var(--muted); border-color: var(--border); background: var(--panel-soft); }
.connection-pill.off span { background: var(--muted); box-shadow: none; }

/* ---------- Botões ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-ic { vertical-align: -2px; }
.block { width: 100%; }
.danger-solid { background: var(--red); border-color: var(--red); color: var(--inverse-text); }
.danger-solid:hover { box-shadow: 0 7px 18px var(--red-soft); }
.button.loading { position: relative; color: transparent !important; pointer-events: none; }
.button.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px;
  border: 2px solid var(--inverse-border); border-top-color: var(--panel); border-radius: 50%;
  animation: spin .7s linear infinite;
}
.button:not(.primary):not(.danger-solid):not(.accent).loading::after {
  border-color: var(--overlay); border-top-color: var(--inverse-bg);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Campos de formulário ---------- */
.select-with-icon { position: relative; display: flex; align-items: center; }
.select-with-icon .select-icon { position: absolute; left: 11px; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.select-with-icon .select { padding-left: 30px; padding-right: 28px; appearance: none; -webkit-appearance: none; }
.select-with-icon .select-arrow { position: absolute; right: 10px; color: var(--muted); pointer-events: none; display: grid; place-items: center; }

.inline-prefix .prefix-select { height: 38px; border: 0; background: transparent; padding: 0 8px; font-size: 9px; color: var(--muted); min-width: 92px; width: auto; }

.color-row { display: flex; align-items: center; gap: 10px; }
.color-input { width: 44px; height: 40px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel); cursor: pointer; }
.color-hex { font-size: 10px; background: var(--panel-soft); border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; color: var(--muted); }

.mini-select { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 8px; height: 38px; background: var(--panel); color: var(--muted); }
.mini-select select { border: 0; background: transparent; font-size: 10px; color: var(--text); padding: 0; height: 36px; max-width: 172px; cursor: pointer; }

.schema-switch { display: block; }
.schema-switch .setting-row { padding: 6px 0; }

/* ---------- Tonalidades de ícones ---------- */
.tone-orange { background: var(--accent-soft) !important; color: var(--accent) !important; }
.tone-purple { background: var(--purple-soft) !important; color: var(--purple) !important; }
.tone-blue { background: var(--blue-soft) !important; color: var(--blue) !important; }
.tone-green { background: var(--green-soft) !important; color: var(--green) !important; }
.quick-chev { display: grid; place-items: center; color: var(--muted); }

/* ---------- Alertas da visão geral ---------- */
.alert-strip {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--accent-border); background: var(--accent-soft); color: var(--accent-ink);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 18px;
  animation: pageIn .35s ease;
}
.alert-strip .ic { flex: 0 0 auto; margin-top: 1px; }
.alert-strip div { display: grid; }
.alert-strip strong { font-size: 10.5px; }
.alert-strip div span { color: var(--accent-ink); font-size: 8.8px; margin-top: 2px; }
.alert-strip.info { border-color: var(--blue-soft); background: var(--blue-soft); color: var(--blue); }
.alert-strip.info div span { color: var(--blue); }

/* ---------- Hero ---------- */
.hero-kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--status-ring); }
.hero-kicker .dot.off { background: var(--muted); box-shadow: none; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); font-size: 9px; font-weight: 650; flex-wrap: wrap; }
.breadcrumb .ic { color: var(--muted); }
.breadcrumb .crumb.current { color: var(--accent); font-weight: 800; }
.heading-copy { min-width: 0; }

/* ---------- Transição de página ---------- */
.page-wrap { animation: pageIn var(--motion-duration) var(--motion-ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Skeletons ---------- */
.skel-page { display: grid; gap: 16px; }
.skel-line {
  height: 14px; border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--panel-soft) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
}
.skel-line.slim { height: 9px; }
.skel-line.w90 { width: 90%; } .skel-line.w70 { width: 70%; } .skel-line.w40 { width: 40%; } .skel-line.w30 { width: 30%; }
.skel-line.dark { background: linear-gradient(90deg, var(--border) 25%, var(--inverse-bg) 50%, var(--border) 75%); background-size: 200% 100%; }
.skel-hero {
  height: 200px; border-radius: 24px;
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--panel-soft) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
}
.skel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.skel-card { height: 126px; border-radius: 18px; border: 1px solid var(--border); background: var(--panel); position: relative; overflow: hidden; }
.skel-card::after {
  content: ""; position: absolute; inset: 14px; border-radius: 12px;
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--panel-soft) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
}
.skel-nav-group { display: grid; gap: 9px; padding: 10px 8px; margin-bottom: 4px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Estados vazios / erro ---------- */
.state-box { padding: 44px 20px; display: grid; justify-items: center; text-align: center; gap: 6px; animation: pageIn .3s ease; }
.state-box .state-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--panel-soft); color: var(--muted); display: grid; place-items: center; margin-bottom: 6px; }
.state-box strong { font-size: 12px; }
.state-box > span:not(.state-icon) { color: var(--muted); font-size: 9.5px; max-width: 340px; line-height: 1.5; }
.state-box.error .state-icon { background: var(--red-soft); color: var(--red); }
.state-action { margin-top: 10px; }

/* ---------- Toast ---------- */
.toast.success .toast-icon { background: var(--green-soft); color: var(--green); }
.toast.error .toast-icon { background: var(--red-soft); color: var(--red); }
.toast.info .toast-icon { background: var(--blue-soft); color: var(--blue); }
.toast-icon .ic { display: block; }

/* ---------- Modais ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: var(--overlay); backdrop-filter: blur(3px); opacity: 0; transition: .2s ease; }
.modal {
  position: fixed; left: 50%; top: 50%; z-index: 101;
  width: min(430px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  transform: translate(-50%, -46%) scale(.97); opacity: 0;
  transition: .2s cubic-bezier(.22, .8, .3, 1);
  background: var(--panel); border-radius: 18px; box-shadow: 0 30px 80px var(--overlay);
}
#modalRoot.open .modal-backdrop { opacity: 1; }
#modalRoot.open .modal { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#modalRoot.open .modal-backdrop { animation: fadeIn var(--motion-duration) ease backwards; }
#modalRoot.open .modal { animation: modalIn var(--motion-duration) var(--motion-ease) backwards; }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-title { display: flex; gap: 11px; align-items: flex-start; min-width: 0; }
.modal-icon { width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.modal-icon.danger { background: var(--red-soft); color: var(--red); }
.modal-title > div { display: grid; }
.modal-title strong { font-size: 13px; }
.modal-title span { color: var(--muted); font-size: 9px; margin-top: 3px; line-height: 1.4; }
.modal-body { padding: 16px 20px 20px; display: grid; gap: 12px; }
.modal-text { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--panel-soft); }
.modal-body .field { gap: 5px; }

/* ---------- Linhas de configuração especiais ---------- */
.log-config-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--panel-soft); }
.log-config-row:first-child { padding-top: 0; }
.log-config-row:last-child { border-bottom: 0; padding-bottom: 0; }
.row-controls { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.rule-actions { display: flex; align-items: center; gap: 6px; }
.danger-soft:hover { background: var(--red-soft); color: var(--red); }

.log-icon { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; }
.log-icon.blue { background: var(--blue-soft); color: var(--blue); }
.log-icon.green { background: var(--green-soft); color: var(--green); }
.log-icon.purple { background: var(--purple-soft); color: var(--purple); }
.log-icon.orange { background: var(--accent-soft); color: var(--accent); }

.command-icon { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-soft); color: var(--muted); }

.toolbar-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 10px; background: var(--panel); color: var(--muted); height: 44px; }

/* ---------- Auditoria ---------- */
.audit-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.audit-icon.purple { background: var(--purple-soft); color: var(--purple); }
.audit-icon.orange { background: var(--accent-soft); color: var(--accent); }
.audit-icon.green { background: var(--green-soft); color: var(--green); }
.audit-icon.blue { background: var(--blue-soft); color: var(--blue); }
.audit-icon.gray { background: var(--panel-soft); color: var(--muted); }
.mini-avatar { width: 18px; height: 18px; border-radius: 6px; background: var(--inverse-bg); color: var(--inverse-text); font-size: 6.5px; font-weight: 800; display: grid; place-items: center; flex: 0 0 auto; }
.audit-actor { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; flex-wrap: wrap; }
.audit-actor strong { font-size: 9.7px; }
.audit-verb { color: var(--muted); font-size: 8.3px; }
.audit-change { display: grid; gap: 4px; }
.audit-change > strong { font-size: 9.3px; }
.change-line { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.change-chip { font-size: 8px; background: var(--panel-soft); color: var(--muted); border-radius: 6px; padding: 2px 7px; }
.change-chip.to { background: var(--green-soft); color: var(--green); font-weight: 700; }

.role-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 8px; font-weight: 800; color: var(--muted); background: var(--panel-soft); border-radius: 999px; padding: 3px 8px; text-transform: none; letter-spacing: 0; }

/* ---------- Cartões escuros (previews) ---------- */
.preview-dark { padding: 17px; background: var(--inverse-bg); color: var(--inverse-text); }
.preview-dark .setting-row { border-color: var(--inverse-border); }
.preview-dark .setting-copy strong { color: var(--inverse-text); }
.preview-dark .setting-copy span { color: var(--inverse-muted); }
.preview-pct { color: var(--inverse-text); font-size: 11px; font-weight: 800; }
.mono { color: var(--inverse-muted); font-size: 9px; letter-spacing: 0; }
.module-hero { display: flex; gap: 11px; align-items: center; padding: 4px 0 12px; border-bottom: 1px solid var(--inverse-border); margin-bottom: 6px; }
.module-hero .module-card-icon { background: var(--focus-soft); color: var(--accent-ink); margin-top: 0; }
.module-hero .module-card-icon.lg { width: 38px; height: 38px; }
.module-hero div { display: grid; }
.module-hero div strong { color: var(--inverse-text); font-size: 12px; }
.module-hero div span { color: var(--inverse-muted); font-size: 8.6px; margin-top: 2px; }
.module-note { color: var(--inverse-muted); font-size: 8.8px; line-height: 1.55; margin: 8px 0 0; }

.badge.purple { color: var(--purple); background: var(--purple-soft); }
.badge.blue { color: var(--blue); background: var(--blue-soft); }
.profile-button > .ic { color: var(--muted); }

/* ---------- Discord preview ---------- */
.discord-channel { display: flex; align-items: center; gap: 5px; }
.discord-actions button { display: inline-flex; align-items: center; gap: 5px; }
.discord-actions .ic { width: 9px; height: 9px; }

/* ---------- Responsividade complementar ---------- */
@media (max-width: 1120px) {
  .skel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .menu-pop { max-height: min(420px, 60vh); overflow: auto; }
  .notif-pop { min-width: min(320px, calc(100vw - 40px)); }
}
@media (max-width: 600px) {
  .skel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skel-hero { height: 150px; }
  .log-config-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .row-controls { width: 100%; justify-content: space-between; }
  .mini-select { flex: 1; }
  .mini-select select { max-width: none; width: 100%; }
  .menu-pop { min-width: min(280px, calc(100vw - 32px)); }
  .audit-row { grid-template-columns: auto 1fr; }
  .audit-time { grid-column: 2; }
  .alert-strip { margin-bottom: 14px; }
}
@media (max-width: 400px) {
  .skel-grid { grid-template-columns: 1fr; }
}

/* ---------- Movimento reduzido (acessibilidade) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
    scroll-behavior: auto !important;
  }
}

/* ==================================================================
   AUTENTICAÇÃO — telas de loading e login (API real)
   ================================================================== */

/* ---------- Tela de carregamento ---------- */
.boot-screen {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--inverse-bg) 0%, var(--inverse-bg) 100%);
}
.boot-inner { display: grid; justify-items: center; gap: 18px; }
.boot-mark {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: var(--on-accent);
  font-size: 26px; font-weight: 900; box-shadow: 0 12px 34px var(--focus-soft);
}
.boot-label { color: var(--muted); font-size: 10px; }
.spinner-lg {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--inverse-border); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.boot-screen .state-box { color: var(--inverse-text); }
.boot-screen .state-box strong { color: var(--inverse-text); }
.boot-screen .state-box > span:not(.state-icon) { color: var(--inverse-muted); }

/* ---------- Tela de login ---------- */
.auth-screen {
  position: fixed; inset: 0; z-index: 190; overflow: auto;
  display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 520px at 78% -12%, var(--focus-soft), transparent 60%),
    linear-gradient(180deg, var(--inverse-bg) 0%, var(--inverse-bg) 100%);
}
.auth-glow { position: fixed; inset: 0; pointer-events: none; opacity: .5; }
.auth-card {
  width: min(430px, 100%); text-align: center; padding: 44px 40px 36px;
  border: 1px solid var(--border); border-radius: 24px;
  background: var(--panel); backdrop-filter: blur(14px);
  box-shadow: 0 30px 90px var(--overlay);
  display: grid; justify-items: center; gap: 14px;
  animation: pageIn .45s cubic-bezier(.22, .8, .3, 1);
}
.auth-card .boot-mark { margin-bottom: 6px; }
.auth-card h1 { margin: 0; color: var(--inverse-text); font-size: 26px; letter-spacing: 0; }
.auth-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; max-width: 330px; }
.discord-login {
  margin-top: 10px; min-height: 46px; padding: 0 22px; border: 0; border-radius: 13px;
  background: var(--discord-brand); color: var(--inverse-text) !important; font-size: 11.5px; font-weight: 750;
  text-decoration: none; box-shadow: 0 10px 26px var(--focus-soft);
  transition: .18s ease;
}
.discord-login:hover { transform: translateY(-2px); box-shadow: 0 14px 34px var(--focus-soft); }
.auth-error { color: var(--red) !important; font-size: 10px !important; background: var(--red-soft); border: 1px solid var(--red-soft); border-radius: 10px; padding: 8px 12px; }
.auth-footer { color: var(--muted); font-size: 8.5px; }

/* ---------- Avatares reais (imagens) ---------- */
.bot-avatar.img, .profile-avatar.img, .client-avatar.img, .server-avatar.img, .menu-avatar.img { overflow: hidden; }
.bot-avatar img, .profile-avatar img, .client-avatar img, .server-avatar img, .menu-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block;
}

/* ---------- Menus: estado vazio e itens estáticos ---------- */
.menu-empty {
  padding: 22px 14px; display: grid; justify-items: center; gap: 8px; text-align: center;
  color: var(--muted);
}
.menu-empty .ic { opacity: .7; }
.menu-empty span { font-size: 9.5px; line-height: 1.5; max-width: 230px; color: var(--muted); }
.menu-item.static { cursor: default; }
.menu-item.static:hover { background: transparent; }

/* Appearance: semantic surfaces, compact controls and the desktop icon rail. */
body { font-size: 13px; line-height: 1.5; }
button, input, select, textarea { touch-action: manipulation; }
:focus-visible, .ete-panel :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input, select, textarea { accent-color: var(--accent-ink); }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 220; padding: 12px 16px; background: var(--panel); color: var(--text); border: 2px solid var(--focus); border-radius: var(--radius-sm); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.page-area, .content, .topbar-left, .topbar-right, .heading-copy, .field, .setting-copy,
.rule-copy, .log-copy, .audit-copy, .command-copy, .menu-copy, .section-head-copy { min-width: 0; }
.content, .modal, .menu-pop, .save-info, .auth-card { overflow-wrap: anywhere; }
.topbar { background: var(--panel); border-color: var(--border); padding-inline: 24px; }
.topbar-left { flex: 1; }
.topbar-left > .dd-wrap { min-width: 0; }
.topbar-right { flex-shrink: 0; }
.server-select { min-height: 44px; max-width: 100%; color: var(--text); background: var(--panel); border-color: transparent; border-radius: var(--radius); }
.server-select:hover, .server-select[aria-expanded="true"] { background: var(--surface-hover); border-color: var(--border); box-shadow: none; }
.server-select > div:nth-child(2) { min-width: 0; text-align: left; }
.server-select strong { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-avatar { flex: 0 0 36px; }
.profile-button, .notification-button { color: var(--text); background: var(--panel); border-radius: var(--radius); }
.notification-button:hover { color: var(--text); background: var(--surface-hover); box-shadow: none; }
.profile-copy strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button, .chevron-button { width: 44px; height: 44px; flex: 0 0 44px; color: var(--muted); border-radius: var(--radius-sm); }
.icon-button:hover { color: var(--text); background: var(--surface-hover); }
.button, .filter-chip, .menu-item, .link-button { min-height: 44px; font-size: 13px; border-radius: var(--radius-sm); }
.button { padding: 8px 14px; color: var(--text); background: var(--panel); }
.button.primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--on-primary); }
.button.accent { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.button.danger { color: var(--red); background: var(--red-soft); border-color: var(--red); }
.button.danger-solid { color: var(--inverse-text); background: var(--red); border-color: var(--red); }
:root[data-theme="dark"] .button.danger-solid { color: var(--on-accent); }
.button:hover, .quick-item:hover, .module-card:hover, .nav-item:hover, .discord-login:hover { transform: none; box-shadow: none; }
.button:not(.primary):not(.accent):not(.danger):not(.danger-solid):not(.discord-login):hover { background: var(--surface-hover); }
.button:disabled { opacity: .65; }
.button.loading::after { border-color: var(--on-primary); border-top-color: transparent; }
.button:not(.primary):not(.danger-solid):not(.accent).loading::after { border-color: var(--muted); border-top-color: transparent; }
.card, .stat-card, .module-card, .integration-card, .quick-item, .rule-card, .log-row,
.command-row, .audit-row, .settings-section, .permission-table, .menu-pop, .modal,
.toast, .auth-card, .preview-card, .alert-strip { border-radius: var(--radius); }
.card { box-shadow: none; }
.card-header, .section-head, .section-content, .card-body { padding: 16px; }
.settings-section, .card, .stat-card, .module-card, .integration-card,
.quick-item, .rule-card, .log-row, .command-row, .audit-row { background: var(--panel); }
.page-heading { align-items: flex-start; }
.page-heading h1 { font-size: 26px; line-height: 1.25; }
.page-heading p, .hero p { font-size: 13px; }
.heading-actions { flex-wrap: wrap; }
.hero { min-height: 0; padding: 20px; background: var(--panel-soft); color: var(--text); border-radius: 0; border-bottom: 1px solid var(--border); box-shadow: none; }
.hero::before, .hero::after, .auth-glow { display: none; }
.hero h2 { font-size: 22px; line-height: 1.3; }
.hero p, .hero-kicker { color: var(--muted); }
.hero-kicker { background: transparent; border-color: var(--border); border-radius: var(--radius-sm); }
.hero .button { background: var(--panel); border-color: var(--border); color: var(--text); }
.hero .button.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hero-actions { flex-wrap: wrap; }
.stat-number { font-variant-numeric: tabular-nums; }
.badge { white-space: nowrap; flex-shrink: 0; }
.preview-head strong { font-size: 12px; }
.card-title strong, .section-head strong, .setting-copy strong, .field label,
.quick-item strong, .rule-copy strong, .module-card h3, .integration-card h3,
.command-copy strong, .log-copy strong, .audit-copy strong { font-size: 13px; }
.stat-label, .stat-foot, .card-title span, .section-head span, .setting-copy span,
.field small, .quick-item span, .module-card p, .integration-card p, .rule-copy span,
.log-copy span, .audit-copy span, .log-time, .audit-time, .filter-chip,
.command-copy span, .command-permission, .integration-status, .permission-name span,
.permission-row.header, .badge, .breadcrumb, .menu-copy span, .menu-head strong,
.menu-head > span:not(.profile-avatar):not(.notif-icon), .profile-head span,
.profile-copy span, .server-select span, .connection-pill, .notif-side em,
.alert-strip div span, .state-box > span:not(.state-icon), .toast span:last-child,
.modal-title span, .modal-text, .color-hex, .role-chip, .audit-verb, .change-chip,
.boot-label, .auth-card p, .auth-footer, .menu-empty span { font-size: 12px; }
.stat-foot, .log-time, .audit-time, .menu-empty { color: var(--muted); }
.stat-icon.orange, .breadcrumb .crumb.current, .link-button { color: var(--accent-ink); }
.tone-orange { color: var(--accent-ink) !important; }
.input, .select, .textarea, .color-input, .mini-select, .toolbar-search, .inline-prefix {
  min-width: 0; min-height: 44px; background: var(--panel); color: var(--text); border-color: var(--border-strong); border-radius: var(--radius-sm);
}
.input, .select, .textarea, .mini-select select, .inline-prefix .prefix-select,
.ete-panel .input, .ete-panel .select, .ete-panel .textarea { min-height: 44px; font-size: 13px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-soft); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline-color: var(--focus); }
.inline-prefix > span { height: auto; min-height: 44px; align-self: stretch; }
.inline-prefix input { border-radius: 0; }
.toolbar, .rule-actions, .row-controls, .ete-item-actions, .section-head, .ete-collection-head { flex-wrap: wrap; }
.toolbar-search { min-width: 0; }
.toolbar-search > .input { min-height: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.toolbar-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-soft); }
.toolbar-search > .input:focus-visible { outline: 0; }
.mini-select select { max-width: 100%; }
.color-input { width: 44px; height: 44px; }
.switch { position: relative; width: 44px; height: 44px; padding: 0; background: transparent; overflow: visible; }
.switch::before { content: ""; position: absolute; inset: 11px 0; border-radius: 999px; background: var(--switch-off); }
.switch::after { position: absolute; left: 4px; top: 14px; background: var(--switch-thumb); box-shadow: none; }
.switch.on { background: transparent; }
.switch.on::before { background: var(--accent-ink); }
.switch.on::after { transform: translateX(20px); background: var(--switch-on-thumb); }
.check { width: 44px; height: 44px; border-color: var(--border-strong); }
.check.on { color: var(--panel); }
.appearance-theme { gap: 10px; }
.appearance-theme > span:first-of-type { flex: 1; }
.appearance-switch { position: relative; width: 36px; height: 20px; flex: 0 0 36px; border-radius: 999px; background: var(--switch-off); }
.appearance-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--switch-thumb); transition: transform .15s ease; }
.appearance-theme[aria-checked="true"] .appearance-switch { background: var(--accent-ink); }
.appearance-theme[aria-checked="true"] .appearance-switch::after { transform: translateX(16px); background: var(--switch-on-thumb); }
.menu-pop { color: var(--text); background: var(--panel); box-shadow: var(--shadow-pop); max-width: calc(100vw - 32px); }
.menu-item:hover { background: var(--surface-hover); }
.menu-item > .ic, .profile-button > .ic { color: var(--muted); }
.menu-item.active > .ic { color: var(--accent-ink); }
.menu-copy strong { font-size: 13px; }
.menu-head { border-color: var(--border); }
.menu-head strong, .profile-head strong { color: var(--text); }
.menu-sep { background: var(--border); }
.connection-pill { color: var(--green); background: var(--green-soft); border-color: var(--green); }
.connection-pill.off { color: var(--muted); background: var(--panel-soft); border-color: var(--border); }
.notif-badge { border-color: var(--panel); }
.alert-strip { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-border); }
.alert-strip.info { color: var(--blue); background: var(--blue-soft); border-color: var(--blue); }
.alert-strip div span, .alert-strip.info div span { color: inherit; }
.modal { color: var(--text); background: var(--panel); box-shadow: var(--shadow-pop); max-height: calc(100dvh - 32px); }
.modal-backdrop, .backdrop { background: var(--overlay); }
.modal h2 { margin: 0; color: var(--text); font-size: 18px; line-height: 1.35; }
.modal dl { margin: 0; display: grid; gap: 12px; }
.modal dt { color: var(--muted); font-size: 12px; }
.modal dd { margin: 2px 0 0; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.modal-foot { background: var(--panel-soft); flex-wrap: wrap; }
.save-bar { left: calc(var(--sidebar-offset) + 24px); right: 24px; color: var(--text); background: var(--panel); border-color: var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.save-bar, .toast { transition-duration: var(--motion-duration); transition-timing-function: var(--motion-ease); }
.save-bar strong { font-size: 13px; }
.save-bar span:not(.unsaved-dot) { color: var(--muted); font-size: 12px; }
.save-info { flex: 1; min-width: 0; }
.save-info > div { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.save-bar .save-info > div > strong, .save-bar .save-info > div > span:last-child { display: block; grid-column: 1; white-space: normal; overflow-wrap: anywhere; }
.save-actions { flex-shrink: 0; }
.save-bar .button.ghost { color: var(--text); border-color: var(--border-strong); }
.save-bar .button.primary { color: var(--on-primary); background: var(--primary-bg); border-color: var(--primary-bg); }
.save-bar .button .btn-label { color: inherit; font-size: inherit; }
.toast { min-width: 0; width: min(340px, calc(100vw - 32px)); right: 16px; color: var(--text); background: var(--panel); border-color: var(--border); box-shadow: var(--shadow-pop); visibility: hidden; transform: translateY(-8px); pointer-events: none; }
.toast.show { visibility: visible; transform: none; pointer-events: auto; }
.toast strong { font-size: 13px; }
.toast-icon { flex: 0 0 32px; }
[data-tip]::after { color: var(--inverse-text); background: var(--inverse-bg); box-shadow: var(--shadow-pop); }
[data-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%); }
.boot-screen, .auth-screen { color: var(--text); background: var(--bg); }
.boot-screen .state-box, .boot-screen .state-box strong, .auth-card h1 { color: var(--text); }
.boot-label, .boot-screen .state-box > span:not(.state-icon), .auth-card p, .auth-footer { color: var(--muted); }
.boot-mark, .brand-mark { color: var(--on-accent); background: var(--accent); box-shadow: none; border-radius: var(--radius); }
.auth-card { padding: 32px 24px; border-color: var(--border); background: var(--panel); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; }
.auth-error { color: var(--red) !important; font-size: 12px !important; background: var(--red-soft); border-color: var(--red); }
.discord-login, .discord-actions button, .bot-tag { color: var(--inverse-text); background: var(--discord-brand); }
.discord-login { box-shadow: none; }
.spinner-lg { border-color: var(--border-strong); border-top-color: var(--accent-ink); }
.preview-card, .preview-dark { color: var(--text); background: var(--panel); }
.preview-head, .preview-dark .setting-row, .module-hero { border-color: var(--border); }
.preview-dark .setting-copy strong, .preview-pct, .module-hero div strong { color: var(--text); }
.preview-head > span, .preview-channel, .preview-dark .setting-copy span, .module-note, .module-hero div span, .mono { color: var(--muted); }
.discord-preview { color: var(--discord-text); background: var(--discord-bg); }
.discord-time, .discord-embed p { color: var(--discord-muted); }
.discord-actions button { min-height: 44px; font-size: 12px; }
.sidebar { height: 100dvh; padding: 12px 8px; background: var(--sidebar); color: var(--text); border-right: 1px solid var(--border); }
.brand { min-height: 56px; gap: 8px; padding: 0 4px 12px; flex: 0 0 auto; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 36px; }
.brand-copy { min-width: 0; flex: 1; }
.brand-copy strong { font-size: 14px; }
.brand-copy span { color: var(--muted); font-size: 12px; text-transform: none; }
.sidebar-pin { display: grid; margin-left: auto; }
.brand:has(.brand-logo) { min-height: 92px; }
.brand-logo { display: block; width: 174px; height: 76px; min-width: 0; object-fit: contain; flex: 1; }
.ete-user-picker { min-width: 0; border: 0; padding: 0; margin: 0; }
.ete-user-picker legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.ete-user-list { display: grid; gap: 6px; margin-bottom: 8px; }
.ete-user-row { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 56px; padding: 6px 10px; border-radius: 8px; background: var(--sidebar-soft); border: 1px solid var(--border); }
.ete-user-avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--panel-soft); color: var(--muted); }
.ete-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ete-user-name { min-width: 0; flex: 1; display: grid; gap: 3px; }
.ete-user-name strong { font-size: 13px; overflow-wrap: anywhere; }
.ete-user-name small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ete-user-add { display: flex; gap: 8px; }
.ete-user-add .input { min-width: 0; flex: 1; }
.ete-user-error { color: var(--red); margin: 8px 0 0; font-size: 12px; }
.verification-status { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 18px; font-size: 13px; }
.verification-status p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.verification-status .verification-error { color: var(--red); }
.verification-effect { display: grid; gap: 18px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.verification-effect h3 { margin: 0 0 10px; font-size: 13px; }
.verification-effect ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.verification-effect li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.emoji-field { display: flex; height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; }
.emoji-field:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.emoji-field .input { min-width: 0; min-height: 42px; height: 42px; flex: 1; border: 0; border-radius: 0; background: transparent; outline: 0; box-shadow: none; }
.emoji-field .icon-button { flex: 0 0 42px; height: 42px; width: 42px; border: 0; border-left: 1px solid var(--border); border-radius: 0; }
.emoji-picker-modal { width: min(420px, calc(100vw - 24px)); }
.emoji-picker-modal .modal-body { padding: 12px; }
.emoji-picker-modal .modal-foot { display: none; }
.emoji-picker-host { min-height: 300px; min-width: 0; }
.emoji-picker-host emoji-picker { width: 100%; height: min(430px, calc(100dvh - 190px)); --background: var(--panel); --border-color: var(--border); --border-radius: 6px; --button-active-background: var(--accent-soft); --button-hover-background: var(--surface-hover); --category-font-color: var(--text); --input-font-color: var(--text); --input-placeholder-color: var(--muted); --input-border-color: var(--border-strong); --indicator-color: var(--accent); --outline-color: var(--focus); --num-columns: 8; }
.emoji-server-state { margin: 0 12px 12px; min-height: 20px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 480px) {
  .emoji-picker-host emoji-picker { --num-columns: 7; --category-emoji-size: 18px; --category-emoji-padding: 5px; --emoji-padding: 6px; }
  .emoji-picker-modal .modal-body { padding: 8px; }
}
@media (max-width: 350px) {
  .emoji-picker-host emoji-picker { --num-columns: 6; --category-emoji-size: 16px; --category-emoji-padding: 4px; }
}
.ete-role-chip:disabled { opacity: 1; cursor: default; }
.ete-role-option > span { min-width: 0; overflow-wrap: anywhere; }
.discord-reaction { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; border: 1px solid var(--blue); border-radius: 6px; padding: 4px 8px; background: var(--blue-soft); font-size: 13px; }
.discord-reaction .discord-emoji { width: 18px; height: 18px; }
.appearance-options { padding: 4px 8px 8px; }
.appearance-track { position: relative; height: 44px; }
.appearance-track::before { content: ""; position: absolute; inset: 6px 0; background: var(--panel-soft); border: 1px solid var(--border-strong); border-radius: 16px; }
.appearance-ticks { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; pointer-events: none; }
.appearance-ticks i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.appearance-range { position: relative; display: block; appearance: none; -webkit-appearance: none; width: 100%; min-height: 44px; height: 44px; padding: 0; margin: 0; background: transparent; cursor: grab; border: 0; border-radius: 16px; }
.appearance-range:active { cursor: grabbing; }
.appearance-range::-webkit-slider-runnable-track { height: 32px; background: transparent; border: 0; }
.appearance-range::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; box-sizing: border-box; width: 26px; height: 26px; margin-top: 3px; border: 2px solid var(--accent-border); border-radius: 50%; background: var(--accent); }
.appearance-range::-moz-range-track { height: 32px; background: transparent; border: 0; }
.appearance-range::-moz-range-thumb { box-sizing: border-box; width: 26px; height: 26px; border: 2px solid var(--accent-border); border-radius: 50%; background: var(--accent); }
.appearance-labels { display: flex; gap: 4px; }
.appearance-option { min-width: 0; min-height: 48px; flex: 1; display: grid; justify-items: center; align-content: center; gap: 4px; padding: 4px 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.appearance-option:hover { background: var(--surface-hover); }
.appearance-option[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); }
.appearance-avatar { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.sidebar-pin[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); }
.sidebar-pin[data-tip]::after { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; transform: none; }
.bot-slot { margin: 4px 0 12px; }
.bot-card { min-height: 60px; padding: 8px; gap: 8px; color: var(--text); background: var(--sidebar-soft); border-color: var(--border); border-radius: var(--radius); }
.bot-card:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.bot-meta .eyebrow, .bot-meta > span:last-child { color: var(--muted); font-size: 12px; }
.bot-meta strong { font-size: 13px; }
.bot-avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: var(--radius-sm); color: var(--on-accent); background: var(--accent); }
.bot-avatar, .menu-avatar:not(.dark) { color: var(--on-bot-avatar); }
.sidebar-search { min-height: 44px; height: 44px; margin: 0 0 12px; color: var(--muted); background: var(--sidebar-soft); border-color: var(--border-strong); border-radius: var(--radius-sm); }
.sidebar-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.sidebar-search input { min-width: 0; min-height: 42px; color: var(--text); font-size: 13px; }
.sidebar-search input::placeholder { color: var(--muted); }
.sidebar-nav { padding: 0 0 12px; scrollbar-color: var(--border-strong) transparent; }
.nav-label { height: 18px; margin: 0 10px 6px; overflow: hidden; white-space: nowrap; color: var(--muted); font-size: 12px; }
.nav-item { min-height: 44px; height: auto; padding: 10px 12px; color: var(--muted); border-radius: var(--radius-sm); font-size: 13px; }
.nav-text { min-width: 0; overflow-wrap: anywhere; }
.nav-icon { flex: 0 0 18px; color: var(--muted); }
.nav-item:hover { color: var(--text); background: var(--surface-hover); }
.nav-item.active { color: var(--accent-ink); background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.nav-item.active .nav-icon { color: var(--accent-ink); }
.sidebar-footer { padding: 12px 4px 0; gap: 8px; border-color: var(--border); flex: 0 0 auto; }
.client-mini strong { font-size: 12px; }
.client-mini span { color: var(--muted); font-size: 12px; }
.bot-slot .menu-pop { left: 0; width: 100%; min-width: 0; max-height: calc(100dvh - 210px); overflow: auto; }

/* Draft preview mirrors Discord's message hierarchy, not the editor chrome. */
.ete-workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
.ete-preview { min-width: 0; position: sticky; top: 88px; max-height: calc(100dvh - 112px); overflow: auto; padding-left: 20px; border-left: 1px solid var(--border); scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
@media (min-width: 1181px) { body:has(.save-bar.show) .ete-preview:not(.ete-command-response) { max-height: calc(100dvh - 200px); } }
.ete-preview-head { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 4px 8px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ete-preview-head h2 { margin: 0; font-size: 15px; line-height: 1.4; color: var(--text); }
.ete-preview-head .badge { grid-column: 1; justify-self: start; white-space: normal; }
.ete-preview-head .icon-button { grid-column: 2; grid-row: 1 / 3; }
.ete-preview-controls { display: grid; min-width: 0; gap: 6px; padding-top: 12px; }
.ete-preview-controls:empty { display: none; }
.ete-panel .textarea { height: 120px; min-height: 100px; max-height: 480px; }
.ete-panel .field:has(> .ete-variable-picker) { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.ete-panel .field:has(> .ete-variable-picker) > :not(label):not(.ete-variable-picker) { grid-column: 1 / -1; }
.ete-variable-picker { position: relative; min-width: 0; }
.ete-variable-picker > summary { min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px; color: var(--accent-ink); cursor: pointer; font-size: 12px; border-radius: var(--radius-sm); }
.ete-variable-picker > summary:hover, .ete-variable-picker[open] > summary { background: var(--accent-soft); }
.ete-variable-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 360px; max-width: calc(100vw - 48px); max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; background: var(--panel); box-shadow: var(--shadow-pop); }
.ete-variable-list button { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) 16px; align-items: center; gap: 8px; width: 100%; min-height: 48px; border: 0; border-radius: 4px; padding: 8px; background: transparent; color: var(--text); text-align: left; }
.ete-variable-list button:hover { background: var(--surface-hover); }
.ete-variable-list code { color: var(--accent-ink); font-size: 12px; overflow-wrap: anywhere; }
.ete-variable-list span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.ete-preview-examples, .ete-result-summary { margin: 12px 0; border-block: 1px solid var(--border); }
.ete-preview-examples > summary, .ete-result-summary > summary { min-height: 44px; padding: 12px 0; font-size: 13px; font-weight: 600; cursor: pointer; }
.ete-preview-examples .field-grid { padding: 4px 0 16px; gap: 12px; }
.ete-preview-examples label { color: var(--muted); font-size: 12px; }
.ete-preview-examples input { min-width: 0; }
.ete-result-summary dl, .ete-effect-values { margin: 0; }
.ete-result-summary dl > div:not(.ete-result-group), .ete-effect-values > div { padding: 10px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; }
.ete-result-summary dt, .ete-effect-values dt { color: var(--muted); font-size: 12px; }
.ete-result-summary dd, .ete-effect-values dd { margin: 0; color: var(--text); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ete-result-group { padding: 8px 0; }
.ete-result-group h4 { margin: 8px 0; font-size: 13px; }
.ete-result-group summary { cursor: pointer; padding-block: 10px; font-size: 13px; overflow-wrap: anywhere; }
.ete-result-group p { color: var(--muted); font-size: 13px; }
.ete-effect-preview { padding-block: 8px; font-size: 14px; color: var(--text); }
.ete-effect-preview h3 { font-size: 14px; margin: 16px 0 8px; }
.ete-effect-flow { margin: 16px 0; padding-left: 24px; }
.ete-effect-flow li { padding: 8px 0 8px 4px; line-height: 1.5; overflow-wrap: anywhere; }
.ete-voice-example { border-left: 2px solid var(--border-strong); padding-left: 12px; }
.ete-voice-example h3, .ete-voice-example > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 40px; margin: 0; }
.ete-voice-example svg { flex-shrink: 0; }
.discord-select-preview { width: 100%; padding: 10px 12px; background: var(--discord-secondary-bg); color: var(--discord-secondary-text); border-radius: 4px; font-size: 14px; }
.discord-select-preview ul { padding-left: 16px; }
.ete-command-sync { display: flex; align-items: center; gap: 10px; padding: 0 0 20px; color: var(--muted); font-size: 13px; }
.ete-command-sync > svg { flex-shrink: 0; }
.ete-command-sync > span { display: grid; gap: 4px; overflow-wrap: anywhere; }
.ete-command-sync strong { color: var(--text); font-weight: 600; }
.ete-command-preview { display: grid; gap: 8px; padding: 16px 0; border-block: 1px solid var(--border); margin-bottom: 20px; font-size: 13px; color: var(--muted); }
.ete-command-preview-label { font-weight: 600; color: var(--text); }
.ete-command-response.ete-preview { position: static; top: auto; width: min(100%, 580px); min-width: 0; max-height: none; overflow: visible; padding: 0; border: 0; margin-top: 8px; }
.ete-command-response > summary { min-height: 44px; padding-block: 12px; cursor: pointer; color: var(--text); }
.ete-command-response .discord-preview { margin-top: 8px; }
.ete-command-response .discord-image { max-height: 300px; }
.ete-command-composer { border: 1px solid var(--border); background: var(--discord-embed); color: var(--discord-text); border-radius: var(--radius-sm); padding: 12px; font-family: ui-monospace, monospace; font-size: 14px; overflow-wrap: anywhere; }
.ete-command-preview strong { font-weight: 500; color: var(--text); }
.ete-command-toolbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 16px; }
.ete-command-toolbar .toolbar-search { flex: 1 1 240px; }
.ete-command-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.ete-command-filters .filter-chip { display: inline-flex; align-items: center; gap: 8px; height: auto; }
.ete-command-filters .filter-chip.active { color: var(--accent-ink); border-color: var(--accent-border); background: var(--accent-soft); }
.ete-command-filters .filter-chip span { font-variant-numeric: tabular-nums; color: var(--muted); }
.ete-command-table { width: 100%; border-collapse: collapse; table-layout: fixed; color: var(--text); font-size: 13px; }
.ete-command-table th { padding: 12px; text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border-strong); }
.ete-command-table td { padding: 16px 12px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.ete-command-table th:nth-child(1) { width: 23%; }
.ete-command-table th:nth-child(2) { width: 30%; }
.ete-command-table th:nth-child(3) { width: 20%; }
.ete-command-path code { color: var(--accent-ink); font-size: 13px; }
.ete-command-access .badge { white-space: normal; line-height: 1.5; }
.ete-command-editor > div { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 4px; }
.ete-command-editor .input { min-width: 0; font-family: ui-monospace, monospace; }
.ete-command-editor .input[aria-invalid="true"] { border-color: var(--red); }
.ete-command-error { display: block; color: var(--red); font-size: 12px; line-height: 1.5; margin-top: 4px; }
.ete-command-error:empty { display: none; }
.ete-command-table.has-availability th:nth-child(1) { width: 18%; }
.ete-command-table.has-availability th:nth-child(2) { width: 28%; }
.ete-command-table.has-availability th:nth-child(3) { width: 17%; }
.ete-command-table.has-availability th:nth-child(4) { width: 16%; }
.ete-command-table.has-availability th:nth-child(5) { width: 21%; }
.command-availability { display: inline-grid; grid-template-columns: repeat(3, 44px); width: 134px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel); vertical-align: top; }
.command-availability button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; color: var(--muted); background: transparent; }
.command-availability button:first-child { border-radius: 5px 0 0 5px; }
.command-availability button:last-child { border-radius: 0 5px 5px 0; }
.command-availability button:hover:not(:disabled) { color: var(--text); background: var(--surface-hover); }
.command-availability button:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.command-availability-default[aria-checked="true"] { color: var(--text); background: var(--panel-soft); }
.command-availability-deny[aria-checked="true"] { color: var(--red); background: var(--red-soft); }
.command-availability-allow[aria-checked="true"] { color: var(--green); background: var(--green-soft); }
.command-availability button:disabled { cursor: not-allowed; }
.ete-command-availability small { display: block; min-height: 32px; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.command-availability-preview { justify-self: start; }
[data-command-enabled="false"] .ete-command-path code { color: var(--muted); }
@media (max-width: 1180px) {
  .ete-command-table.has-availability, .ete-command-table.has-availability tbody { display: block; }
  .ete-command-table.has-availability thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ete-command-table.has-availability tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
  .ete-command-table.has-availability td { padding: 0; border: 0; }
  .ete-command-table.has-availability :is(.ete-command-path, .ete-command-description, .ete-command-editor) { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  .ete-command-table, .ete-command-table tbody { display: block; }
  .ete-command-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ete-command-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
  .ete-command-table td { padding: 0; border: 0; }
  .ete-command-path, .ete-command-description { grid-column: 1 / -1; }
  .ete-command-access { align-self: center; }
}
@media (max-width: 480px) {
  .ete-command-table tr, .ete-command-table.has-availability tr { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ete-preview-examples .field-grid { grid-template-columns: minmax(0, 1fr); }
  .ete-variable-list { max-width: calc(100vw - 40px); }
  .ete-command-filters { width: 100%; }
}
.ete-preview-controls label { font-size: 12px; font-weight: 600; color: var(--text); }
.ete-preview-status, .ete-preview-note { margin: 12px 0; font-size: 12px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.ete-preview .discord-preview { min-height: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--discord-text); background: var(--discord-bg); font-size: 14px; }
.ete-preview .discord-channel { margin-bottom: 16px; color: var(--discord-muted); font-size: 13px; overflow-wrap: anywhere; }
.ete-preview .discord-message { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
.ete-preview .discord-avatar { width: 36px; height: 36px; color: var(--on-accent); background: var(--accent); font-size: 14px; }
.discord-message-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.ete-preview .discord-author { flex-wrap: wrap; color: var(--discord-text); font-size: 14px; line-height: 1.4; }
.ete-preview .bot-tag { color: var(--inverse-text); font-size: 10px; }
.ete-preview .discord-embed { margin-top: 8px; padding: 12px; color: var(--discord-text); background: var(--discord-embed); overflow: hidden; }
.ete-preview .discord-embed-title { margin: 0 0 8px; font-size: 16px; line-height: 1.4; color: var(--discord-text); }
.ete-preview .discord-text { margin: 4px 0 8px; color: var(--discord-text); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ete-preview .discord-embed strong { font-size: inherit; }
.ete-preview .discord-embed a { color: var(--blue); text-decoration: underline; }
.ete-preview .discord-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ete-preview .discord-field { min-width: 0; grid-column: 1 / -1; font-size: 14px; overflow-wrap: anywhere; }
.ete-preview .discord-field.inline { grid-column: auto; }
.ete-preview pre { max-width: 100%; overflow: auto; margin-block: 8px; padding: 8px; background: var(--discord-bg); border: 1px solid var(--border); border-radius: 4px; white-space: pre-wrap; }
.ete-preview code { font-size: 13px; background: var(--discord-bg); }
.ete-preview .discord-mention { padding: 1px 3px; border-radius: 3px; color: var(--blue); background: var(--blue-soft); }
.discord-image { display: block; width: 100%; height: auto; max-height: 400px; object-fit: contain; margin-top: 12px; border-radius: 4px; }
.discord-thumbnail { float: right; width: 72px; height: 72px; object-fit: cover; margin: 0 0 8px 12px; border-radius: 4px; }
.discord-embed-author, .discord-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.discord-embed-author { margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.discord-footer { clear: both; margin-top: 12px; color: var(--discord-muted); font-size: 12px; }
.discord-author-icon, .discord-footer-icon { width: 20px; height: 20px; object-fit: cover; border-radius: 50%; }
.discord-emoji { display: inline-block; width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.discord-image-error { display: block; margin-block: 8px; color: var(--discord-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.ete-preview .discord-actions { flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ete-preview .discord-button { min-width: 44px; min-height: 44px; height: auto; max-width: 100%; padding: 8px 12px; border-radius: 4px; font-size: 14px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.ete-preview .discord-button:disabled { opacity: 1; cursor: default; color: var(--discord-secondary-text); background: var(--discord-secondary-bg); }
.ete-preview .discord-button[data-style="1"] { background: var(--discord-brand); color: var(--inverse-text); }
.ete-preview .discord-button[data-style="3"] { background: var(--discord-success); color: var(--inverse-text); }
.ete-preview .discord-button[data-style="4"] { background: var(--discord-danger); color: var(--inverse-text); }
.ete-preview .discord-button[data-disabled="true"] { opacity: .55; }
.discord-profile { --profile-banner: var(--discord-profile-banner); width: min(100%, 320px); position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--discord-profile-border); border-radius: var(--radius); color: var(--discord-text); background: var(--discord-profile-bg); }
.discord-profile-banner { position: relative; width: 100%; height: 105px; background: var(--profile-banner); }
.discord-profile-banner-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.discord-profile-more { position: absolute; right: 12px; top: 12px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--inverse-text); background: var(--overlay); }
.discord-profile-avatar-wrap { position: relative; width: 92px; height: 92px; margin: -50px 0 0 16px; border: 6px solid var(--discord-profile-bg); border-radius: 50%; background: var(--discord-profile-bg); }
.discord-profile-avatar { display: block; width: 80px; height: 80px; object-fit: cover; border-radius: 50%; }
.discord-profile-bio { white-space: pre-wrap; overflow-wrap: anywhere; margin: 14px 0; font-size: 13px; }
.identity-sync { display: grid; gap: 6px; padding-top: 18px; color: var(--muted); font-size: 13px; }
.identity-sync small { font-size: 12px; }
.identity-global-warning { margin: 0; color: var(--accent-ink); font-size: 13px; line-height: 1.5; }
.identity-global-error { margin: 0; color: var(--red); font-size: 13px; }
.identity-global-error:not([hidden]) { animation: revealIn var(--motion-duration) var(--motion-ease); }
.identity-confirm { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; }
.identity-confirm input { flex: 0 0 18px; width: 18px; height: 18px; accent-color: var(--accent-ink); margin-top: 2px; }
.identity-presence-preview { display: grid; gap: 6px; padding: 12px; border-left: 3px solid var(--border-strong); background: var(--panel-soft); font-size: 13px; overflow-wrap: anywhere; }
.identity-photo-controls { display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; font-size: 12px; color: var(--discord-profile-muted); }
[data-profile-image-state][data-valid="false"] { color: var(--red); }
[data-profile-image-state][data-valid="true"]:not(:empty) { color: var(--green); }
.input[data-profile-image][aria-invalid="true"] { border-color: var(--red); }
.discord-profile-avatar-fallback { display: grid; place-items: center; background: var(--discord-brand); color: var(--inverse-text); font-size: 28px; font-weight: 700; }
.discord-profile-presence { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border: 5px solid var(--discord-profile-bg); border-radius: 50%; background: var(--discord-profile-offline); }
.discord-profile-presence[data-mode="online"] { background: var(--green); }
.discord-profile-presence[data-mode="idle"] { background: var(--accent-ink); }
.discord-profile-presence[data-mode="dnd"] { background: var(--red); }
.discord-profile-presence[data-mode="streaming"] { background: var(--purple); }
.discord-profile-presence:is([data-mode="offline"], [data-mode="invisible"])::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--discord-profile-bg); }
.discord-profile-presence[data-mode="dnd"]::after { content: ""; position: absolute; left: 3px; right: 3px; top: 7px; height: 2px; background: var(--discord-profile-bg); }
.discord-profile-body { padding: 8px 16px 16px; }
.discord-profile-body h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; color: var(--discord-text); font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.discord-profile .bot-tag { margin-left: 0; padding: 2px 4px; font-size: 10px; }
.discord-profile-tag { margin-top: 6px; font-size: 14px; overflow-wrap: anywhere; }
.discord-profile-activity { margin-top: 12px; font-size: 13px; overflow-wrap: anywhere; }
.discord-profile-mutual { display: flex; align-items: center; gap: 6px; margin-block: 18px; color: var(--discord-profile-muted); font-size: 12px; }
.discord-profile-guilds { display: flex; align-items: center; padding-right: 4px; }
.discord-profile-guilds:empty { display: none; }
.discord-profile-guild { width: 20px; height: 20px; margin-right: -4px; border: 2px solid var(--discord-profile-bg); border-radius: 50%; object-fit: cover; }
.discord-profile-roles { margin-bottom: 16px; }
.discord-profile-roles h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; }
.discord-profile-roles > div { display: flex; flex-wrap: wrap; gap: 4px; }
.discord-profile-role { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 24px; padding: 3px 8px; border: 1px solid var(--discord-profile-border); border-radius: 6px; font-size: 12px; overflow-wrap: anywhere; }
.discord-profile-role i { --role-color: var(--discord-profile-muted); flex: 0 0 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--role-color); }
.discord-profile-no-roles { color: var(--discord-profile-muted); font-size: 12px; }
.discord-profile-composer { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 10px; border: 1px solid var(--discord-profile-border); border-radius: 6px; color: var(--discord-profile-muted); font-size: 14px; }
.discord-profile-composer span { min-width: 0; overflow-wrap: anywhere; }
.discord-profile-composer .ic { flex-shrink: 0; }
.discord-profile-warning { max-width: 40ch; }
.ete-panel .ete-role-picker { min-width: 0; display: grid; gap: 8px; }
.ete-role-picker legend { margin-bottom: 8px; color: var(--text); font-size: 13px; font-weight: 600; }
.ete-role-options { min-width: 0; max-height: 264px; overflow: auto; border-block: 1px solid var(--border); scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.ete-panel .ete-role-option { display: flex; min-height: 44px; gap: 8px; align-items: center; margin: 0; color: var(--text); font-size: 13px; font-weight: 400; cursor: pointer; }
.ete-role-option:hover { background: var(--surface-hover); }
.ete-role-option > span { min-width: 0; overflow-wrap: anywhere; }
.ete-role-option input[type="checkbox"] { appearance: none; position: relative; width: 44px; height: 44px; flex: 0 0 44px; margin: 0; background: transparent; cursor: pointer; }
.ete-role-option input[type="checkbox"]::before { content: ""; position: absolute; inset: 12px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--panel); }
.ete-role-option input[type="checkbox"]:checked::before { background: var(--accent-ink); border-color: var(--accent-ink); }
.ete-role-option input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 19px; top: 15px; width: 6px; height: 10px; border: solid var(--switch-on-thumb); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ete-role-chips { display: flex; min-width: 0; flex-wrap: wrap; gap: 8px; }
.ete-role-chips:empty { display: none; }
.ete-role-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 44px; min-height: 44px; max-width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); background: var(--panel-soft); font-size: 13px; text-align: left; }
.ete-role-chip span { min-width: 0; overflow-wrap: anywhere; }
.ete-role-chip:hover { background: var(--surface-hover); }

@media (max-width: 1180px) {
  .ete-workspace { grid-template-columns: minmax(0, 1fr); }
  .ete-preview { position: static; max-height: none; padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--border); }
}
@media (min-width: 821px) {
  .sidebar {
    --sidebar-label-opacity: 0;
    --sidebar-label-x: -6px;
    --sidebar-label-visibility: hidden;
    --sidebar-icon-x: 8.5px;
    --sidebar-search-x: 10.5px;
    --sidebar-control-x: calc(var(--sidebar-rail) - var(--sidebar-width) - 3.5px);
    width: var(--sidebar-rail);
    transition: width 220ms cubic-bezier(.2, .8, .2, 1), box-shadow 220ms ease;
  }
  .topbar { padding-left: 24px; }
  .page-area { width: calc(100% - var(--sidebar-offset)); margin-left: var(--sidebar-offset); }
  .sidebar:is(:hover, :focus-within), :root[data-sidebar-pinned="true"] .sidebar {
    --sidebar-label-opacity: 1;
    --sidebar-label-x: 0px;
    --sidebar-label-visibility: visible;
    --sidebar-icon-x: 0px;
    --sidebar-search-x: 0px;
    --sidebar-control-x: 0px;
    width: var(--sidebar-width);
    box-shadow: var(--shadow-pop);
  }
  /* Keep labels at their final width while only the fixed overlay expands. */
  .sidebar > :is(.brand, .bot-slot, .sidebar-search, .sidebar-nav, .empty-search, .sidebar-footer) { width: calc(var(--sidebar-width) - 17px); flex-shrink: 0; }
  .sidebar-nav { overflow-x: hidden; }
  .sidebar .nav-item { height: 44px; transform: none; transition: color 180ms ease, background-color 180ms ease; }
  .sidebar :is(.brand-mark, .brand-copy, .brand-logo, .bot-meta, .bot-card > .ic, .bot-card > .chevron-button, .nav-text, .nav-badge, .nav-label, #clientMini, .empty-search, .sidebar-search input) {
    opacity: var(--sidebar-label-opacity);
    transform: translateX(var(--sidebar-label-x));
    visibility: var(--sidebar-label-visibility);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 220ms ease, transform 220ms cubic-bezier(.2, .8, .2, 1), visibility 220ms linear;
  }
  .sidebar :is(.sidebar-pin, .sidebar-footer > .icon-button) { transform: translateX(var(--sidebar-control-x)); transition: transform 220ms cubic-bezier(.2, .8, .2, 1), color 180ms ease, background-color 180ms ease; }
  .sidebar .nav-icon { transform: translateX(var(--sidebar-icon-x)); transition: transform 220ms cubic-bezier(.2, .8, .2, 1); }
  .sidebar-search > .ic { transform: translateX(var(--sidebar-search-x)); transition: transform 220ms cubic-bezier(.2, .8, .2, 1); }
}
@media (max-width: 820px) {
  :root { --sidebar-offset: 0px; }
  .sidebar { width: min(280px, calc(100vw - 44px)); visibility: hidden; transition: transform .18s ease, visibility .18s; }
  .sidebar.open { visibility: visible; }
  .sidebar-pin { display: none; }
  .brand { padding-inline: 4px; }
  .page-area { width: 100%; margin-left: 0; }
  .topbar { padding-inline: 12px; gap: 8px; }
  .topbar-left, .topbar-right { gap: 8px; }
  .topbar-left > .dd-wrap { flex: 1; }
  .server-select { width: 100%; padding: 4px; gap: 8px; }
  .server-select strong { max-width: 100%; }
  .server-select > div:nth-child(2) { flex: 1; }
  .profile-button { width: 44px; height: 44px; padding: 5px; justify-content: center; }
  .profile-button > .ic { display: none; }
  .profile-avatar { flex: 0 0 32px; width: 32px; height: 32px; }
  #serverMenu, #profileMenu, #notifPop { position: fixed; top: 76px; left: 12px; right: 12px; width: auto; min-width: 0; max-width: none; max-height: calc(100dvh - 100px); }
  .content { padding-inline: 16px; }
  .save-bar { left: 12px; right: 12px; }
  .input, .select, .textarea, .mini-select select, .sidebar-search input,
  .ete-panel .input, .ete-panel .select, .ete-panel .textarea { font-size: 16px; }
  .toolbar-search { flex: 1 1 100%; }
}
@media (max-width: 600px) {
  .content { padding-bottom: 180px; }
  .topbar { height: 64px; }
  .server-select .server-arrow { display: none; }
  .server-avatar { width: 28px; height: 28px; flex-basis: 28px; }
  .server-select strong { font-size: 12px; }
  #serverMenu, #profileMenu, #notifPop { top: 68px; }
  .page-heading h1 { font-size: 24px; }
  .heading-actions .button { flex: 1 1 auto; }
  .rule-card { flex-wrap: wrap; }
  .rule-copy { flex-basis: calc(100% - 60px); }
  .rule-actions { margin-left: auto; }
  .permission-table { max-width: 100%; }
  .log-row, .audit-row { grid-template-columns: auto minmax(0, 1fr); }
  .log-time, .audit-time { grid-column: 2; white-space: normal; }
  .save-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .save-bar { min-height: 144px; }
  .save-bar .save-info { grid-template-columns: 8px minmax(0, 1fr); gap: 10px; }
  .save-info .unsaved-dot { margin-top: 6px; }
  .save-actions .button { min-width: 0; padding-inline: 8px; }
  .toast { top: 76px; }
  .auth-screen { padding: 16px; }
}
