:root {
  --bg: #050b18;
  --bg-2: #0a1120;
  --bg-3: #0b1e3a;
  --panel: #101d33;
  --panel-2: #13243d;
  --panel-3: #172a47;
  --border: #1c3658;
  --border-2: #2a4d7f;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #3b82f6;
  --accent-2: #6366f1;
  --accent-soft: #60a5fa;
  --accent-faint: rgba(59, 130, 246, .18);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --glow: rgba(96, 165, 250, .22);
  --glow-2: rgba(99, 102, 241, .18);
  --shadow: 0 16px 36px rgba(2, 8, 23, .22);
  --shadow-soft: 0 8px 22px rgba(2, 8, 23, .14);
  --radius: 14px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-3) 48%, var(--bg) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background: url("/assets/space-nebula.png") center / cover no-repeat;
  filter: blur(18px) saturate(.9) brightness(.78);
  opacity: .94;
  transform: scale(1.06);
}

body::after {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(5, 11, 24, .38), rgba(5, 11, 24, .48) 44%, rgba(5, 11, 24, .68)),
    linear-gradient(90deg, rgba(5, 11, 24, .12), transparent 48%, rgba(5, 11, 24, .38));
}

#network-background {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: screen;
}

button, input, select, textarea {
  font: inherit;
  letter-spacing: 0;
}

button { cursor: pointer; }
code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .9em;
}
[hidden] { display: none !important; }

.login-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.login-panel {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 29, 51, .96), rgba(10, 17, 32, .92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-panel h1 {
  margin: 12px 0 8px;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 34px;
  line-height: 1.05;
}

.login-panel form { margin-top: 26px; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.login-divider::before, .login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.discord-link {
  min-height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: rgba(16, 29, 51, .88);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background-color .2s ease;
}
.discord-link:hover {
  border-color: var(--border-2);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
  transform: translateY(-1px);
}
.discord-link svg { width: 17px; }

.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, .32);
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 22px rgba(59, 130, 246, .16);
}
.brand-mark.small {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
}
.brand-mark svg { width: 24px; }

.app-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  color: var(--text);
  background: rgba(5, 11, 24, .76);
  border-right: 1px solid rgba(28, 54, 88, .9);
  backdrop-filter: blur(18px);
  overflow: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(16, 29, 51, .88);
  font-family: Montserrat, Inter, sans-serif;
  font-weight: 800;
  color: white;
  box-shadow: var(--shadow-soft);
}

#main-nav {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(16, 29, 51, .76);
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  border-radius: 12px;
  text-align: left;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.nav-item svg { width: 19px; flex: 0 0 19px; }
.nav-item:hover {
  color: var(--text);
  border-color: rgba(96, 165, 250, .2);
  background: rgba(59, 130, 246, .08);
}
.nav-item.active {
  color: white;
  border-color: rgba(96, 165, 250, .35);
  background: linear-gradient(135deg, rgba(59, 130, 246, .18), rgba(99, 102, 241, .16));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}

.logout {
  margin-top: auto;
  border: 1px solid var(--border);
  background: rgba(16, 29, 51, .78);
}

.workspace { min-width: 0; background: transparent; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgba(28, 54, 88, .8);
  background: rgba(5, 11, 24, .7);
  backdrop-filter: blur(18px);
}

.server-picker-wrap { min-width: 0; display: grid; gap: 4px; }
.server-picker { position: relative; width: min(360px, 50vw); }

.server-toggle {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: rgba(16, 29, 51, .86);
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.server-toggle:hover,
.server-toggle[aria-expanded="true"] {
  border-color: rgba(96, 165, 250, .35);
  background: rgba(19, 36, 61, .95);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}

.server-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, rgba(59, 130, 246, .6), rgba(99, 102, 241, .6));
  font-size: 11px;
  font-weight: 800;
}

.server-current {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.server-chevron {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(96, 165, 250, .06);
}
.server-chevron svg { width: 16px; height: 16px; transition: transform .22s ease; }
.server-toggle[aria-expanded="true"] .server-chevron svg { transform: rotate(180deg); }

.server-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  min-width: 290px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 17, 32, .98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.server-options {
  max-height: min(340px, 55vh);
  display: grid;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.server-option {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  text-align: left;
}
.server-option:hover,
.server-option.active {
  border-color: rgba(96, 165, 250, .25);
  background: rgba(59, 130, 246, .08);
}
.server-option .server-avatar { width: 32px; height: 32px; }
.server-option-copy, .server-option-copy strong, .server-option-copy small { min-width: 0; display: block; }
.server-option-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.server-option-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.server-option > svg { width: 16px; height: 16px; color: var(--accent-soft); opacity: 0; }
.server-option.active > svg { opacity: 1; }
.server-empty {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.add-server-link {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, rgba(59, 130, 246, .18), rgba(99, 102, 241, .16));
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.add-server-link:hover {
  border-color: rgba(96, 165, 250, .35);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}

.server-toggle:focus-visible,
.server-option:focus-visible,
.add-server-link:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(96, 165, 250, .95);
  outline-offset: 3px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.status > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .12);
}
.status.offline > span {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}
.status.connecting > span {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .12);
}

.content {
  max-width: 1460px;
  margin: 0 auto;
  padding: 38px clamp(18px, 4vw, 52px) 72px;
}

.view { display: none; }
.view.active { display: block; }

.page-heading {
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

.page-heading h1 {
  margin: 5px 0 0;
  color: var(--text);
  font-family: Montserrat, Inter, sans-serif;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.08;
}
.page-heading .eyebrow,
.topbar .eyebrow { color: var(--muted); }

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-heading h2,
.form-panel h2 {
  margin: 0 0 5px;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 18px;
}
.section-heading p, .form-panel p, .danger-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: rgba(16, 29, 51, .88);
  border-radius: 12px;
  color: var(--muted);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.icon-button:hover {
  color: var(--text);
  border-color: rgba(96, 165, 250, .35);
  background: rgba(19, 36, 61, .95);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}
.icon-button svg { width: 17px; }

.metrics,
.section-block,
.form-panel,
.composer,
.profile-item,
.list-row,
.audit-row,
.brand,
#main-nav,
.logout,
.login-panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16, 29, 51, .96), rgba(10, 17, 32, .94));
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
  overflow: hidden;
}
.metrics > div {
  padding: 22px 24px;
  border-right: 1px solid var(--border);
  transition: background-color .2s ease, box-shadow .2s ease;
}
.metrics > div:last-child { border-right: 0; }
.metrics > div:hover {
  background: rgba(59, 130, 246, .06);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .08);
}
.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.metrics strong {
  display: block;
  margin-top: 8px;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 28px;
}

.section-block {
  padding: 26px;
  margin-bottom: 24px;
}
.section-block.flush {
  padding: 0;
  overflow: hidden;
}
.section-block.flush .section-heading { padding: 24px 24px 0; }

.suggestion-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.suggestion-grid > div { border-left: 2px solid var(--border); padding-left: 16px; }
.suggestion-grid svg { width: 20px; color: var(--accent); }
.suggestion-grid h3 { margin: 10px 0 6px; font-size: 14px; }
.suggestion-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.feature-showcase { padding: 30px 24px 22px; }
.feature-showcase .section-heading { justify-content: center; margin-bottom: 26px; text-align: center; }
.feature-showcase .section-heading h2 { font-size: 22px; }
.feature-showcase .section-heading p { max-width: 620px; }
.feature-carousel { position: relative; }
.feature-viewport { margin: 0 50px; padding: 4px; overflow: hidden; }
.feature-track {
  display: flex;
  gap: 14px;
  transition: transform .7s cubic-bezier(.22, .8, .25, 1);
  will-change: transform;
}
.feature-card {
  min-height: 238px;
  flex: 0 0 calc((100% - 42px) / 4);
  padding: 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(16, 29, 51, .98), rgba(12, 21, 38, .94));
  opacity: .72;
  transform: translateY(0);
  transition: opacity .35s ease, transform .35s ease, border-color .35s ease, background-color .35s ease, box-shadow .35s ease;
}
.feature-card.active {
  border-color: rgba(96, 165, 250, .35);
  background: linear-gradient(180deg, rgba(19, 36, 61, .98), rgba(16, 29, 51, .98));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08), var(--shadow-soft);
  opacity: 1;
  transform: translateY(-3px);
}
.feature-icon,
.offer-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid rgba(96, 165, 250, .26);
  border-radius: 50%;
  color: var(--accent-soft);
  background: linear-gradient(135deg, rgba(59, 130, 246, .18), rgba(99, 102, 241, .16));
  box-shadow: 0 0 22px rgba(59, 130, 246, .12);
}
.feature-icon svg,
.offer-icon svg { width: 24px; height: 24px; }
.feature-card h3 { margin: 0 0 14px; font-family: Montserrat, Inter, sans-serif; font-size: 17px; line-height: 1.25; }
.feature-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.carousel-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: rgba(16, 29, 51, .96);
  box-shadow: var(--shadow-soft);
  transform: translateY(-50%);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.carousel-arrow:hover {
  border-color: rgba(96, 165, 250, .35);
  background: rgba(19, 36, 61, .98);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}
.carousel-arrow svg { width: 20px; height: 20px; }
.carousel-prev { left: 0; }
.carousel-next { right: 0; }
.carousel-dots {
  min-height: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
}
.carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(148, 163, 184, .34);
  transition: width .25s ease, background-color .25s ease, box-shadow .25s ease;
}
.carousel-dot.active {
  width: 22px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}

.custom-bot-offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(250px, 320px);
  align-items: center;
  gap: 28px;
  padding: 30px;
}
.offer-copy {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.offer-copy h2 {
  margin: 5px 0 9px;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 20px;
  line-height: 1.3;
}
.offer-copy > div > p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.offer-price {
  min-width: 148px;
  padding: 7px 28px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
}
.offer-price span, .offer-price strong { display: block; white-space: nowrap; }
.offer-price span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.offer-price strong {
  margin-top: 7px;
  color: white;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 22px;
}
.offer-contacts { display: grid; gap: 9px; }
.contact-link {
  min-height: 50px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: rgba(16, 29, 51, .9);
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.contact-link:hover {
  border-color: rgba(96, 165, 250, .35);
  background: rgba(19, 36, 61, .98);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
  transform: translateY(-1px);
}
.contact-link > svg:first-child { width: 21px; height: 21px; color: var(--accent-soft); }
.contact-link > svg:last-child { width: 14px; height: 14px; color: var(--muted); }
.contact-link span, .contact-link b, .contact-link small { min-width: 0; display: block; }
.contact-link b { font-size: 13px; }
.contact-link small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.split-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 24px; align-items: start; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.automation-replies { margin-top: 24px; }
.youtube-form { margin-top: 24px; }
.youtube-profile-toolbar {
  display: flex;
  justify-content: flex-end;
}
.youtube-profile-list {
  display: grid;
  gap: 12px;
}
.youtube-profile {
  border: 1px solid rgba(28, 54, 88, .9);
  border-radius: 14px;
  background: rgba(8, 15, 30, .58);
  overflow: hidden;
}
.youtube-profile-summary {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}
.youtube-profile-summary:hover,
.youtube-profile-summary[aria-expanded="true"] {
  background: rgba(59, 130, 246, .08);
}
.youtube-profile-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, .2);
  border-radius: 12px;
  color: var(--accent-soft);
  background: rgba(59, 130, 246, .08);
}
.youtube-profile-title,
.youtube-profile-title strong,
.youtube-profile-title small {
  min-width: 0;
  display: block;
}
.youtube-profile-title strong {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 14px;
}
.youtube-profile-title small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.youtube-profile-body {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid rgba(28, 54, 88, .75);
}
.youtube-source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 16px;
}
.youtube-category-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.youtube-category {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(28, 54, 88, .85);
}
.youtube-category-heading {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.youtube-category-heading h3 {
  margin: 0;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 15px;
  line-height: 1.25;
}
.ticket-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .48fr);
}
.ticket-two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ticket-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 6px;
  border-top: 1px solid rgba(28, 54, 88, .8);
}
.ticket-fields-head h3 {
  margin: 0 0 4px;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 16px;
}
.ticket-fields-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.ticket-field-list {
  display: grid;
  gap: 12px;
}
.ticket-field {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(28, 54, 88, .88);
  border-radius: 14px;
  background: rgba(8, 15, 30, .72);
}
.ticket-field-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ticket-field-title strong {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 13px;
}
.ticket-field-title .delete {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239, 68, 68, .2);
  border-radius: 10px;
  color: #fecaca;
  background: rgba(239, 68, 68, .08);
}
.ticket-field-title .delete:hover {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .08);
}
.toggle.compact {
  width: auto;
  grid-template-columns: auto auto;
  gap: 8px;
  font-size: 12px;
}

.form-panel, .composer {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16, 29, 51, .98), rgba(10, 17, 32, .96));
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}
.form-panel.narrow { max-width: 620px; }
label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(8, 15, 30, .96);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); opacity: 1; }
select option { color: var(--text); background: var(--bg); }
input, select { min-height: 44px; }
select[multiple] {
  min-height: 118px;
  padding: 8px;
}
select[multiple] option {
  min-height: 28px;
  padding: 6px 8px;
  border-radius: 8px;
}
.reaction-rule-fields {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(28, 54, 88, .82);
  border-radius: 12px;
  background: rgba(8, 15, 30, .44);
}
.reaction-rule-fields[hidden] { display: none; }
textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(96, 165, 250, .45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
label small { color: var(--muted); font-weight: 400; }

.avatar-editor {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(28, 54, 88, .9);
  border-radius: 16px;
  background: rgba(8, 15, 30, .72);
}
.avatar-preview {
  position: relative;
  width: 112px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(96, 165, 250, .28), transparent 38%),
    linear-gradient(135deg, rgba(59, 130, 246, .18), rgba(99, 102, 241, .18));
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .08), 0 18px 30px rgba(0, 0, 0, .18);
  user-select: none;
  touch-action: none;
}
.avatar-preview.draggable { cursor: grab; }
.avatar-preview:focus-visible {
  outline: 2px solid rgba(96, 165, 250, .5);
  outline-offset: 5px;
}
.avatar-preview.dragging {
  cursor: grabbing;
  border-color: rgba(96, 165, 250, .5);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .14), 0 0 30px rgba(59, 130, 246, .16);
}
.avatar-preview img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  transform-origin: center;
  transition: transform .16s ease;
  pointer-events: none;
}
.avatar-preview.dragging img { transition: none; }
.avatar-zoom-control {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
}
.avatar-zoom-control input,
.avatar-zoom-control small {
  grid-column: 1 / -1;
}
.avatar-zoom-control span {
  color: var(--accent-soft);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 12px;
  font-weight: 800;
}
.avatar-zoom-control input[type="range"] {
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}
.avatar-zoom-control input[type="range"]:focus {
  box-shadow: none;
}
.avatar-zoom-control input[type="range"]:focus-visible {
  outline: 2px solid rgba(96, 165, 250, .45);
  outline-offset: 3px;
}
.avatar-zoom-control input[type="range"]:disabled {
  opacity: .45;
  cursor: default;
}

.color-input {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 15, 30, .96);
  overflow: hidden;
}
.color-input input { width: 52px; border: 0; padding: 5px; }
.color-input output { padding: 0 10px; color: var(--muted); font-family: ui-monospace, monospace; }

.toggle { grid-template-columns: auto 1fr; align-items: center; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle > span:first-of-type {
  width: 40px;
  height: 24px;
  position: relative;
  border-radius: 999px;
  background: rgba(100, 116, 139, .72);
  transition: .15s;
}
.toggle > span:first-of-type::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  transition: .15s;
}
.toggle input:checked + span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle b, .toggle small { display: block; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

button.primary,
button.secondary,
button.danger,
.oauth-login {
  min-height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 15px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background-color .2s ease, color .2s ease;
}

button.primary,
.oauth-login {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 1px rgba(59, 130, 246, .18), 0 10px 28px rgba(59, 130, 246, .16);
}
button.primary:hover,
.oauth-login:hover {
  box-shadow: 0 0 0 1px rgba(96, 165, 250, .22), 0 0 0 3px rgba(59, 130, 246, .1), 0 14px 30px rgba(59, 130, 246, .18);
  transform: translateY(-1px);
}

button.secondary {
  color: var(--text);
  border-color: var(--border);
  background: rgba(16, 29, 51, .92);
}
button.secondary:hover {
  border-color: rgba(96, 165, 250, .3);
  background: rgba(19, 36, 61, .98);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}

button.danger {
  color: white;
  background: var(--danger);
}
button.danger:hover {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
  transform: translateY(-1px);
}

button.full { width: 100%; margin-top: 18px; }
button svg { width: 17px; height: 17px; }
button:disabled { opacity: .55; cursor: wait; }

.form-error { min-height: 20px; color: #fca5a5; font-size: 13px; }

.item-list { display: grid; gap: 8px; padding: 10px; border-top: 1px solid rgba(28, 54, 88, .8); }
.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 12px 14px;
  background: rgba(16, 29, 51, .86);
}
.list-row:last-child { border-bottom: 1px solid var(--border); }
.list-main { min-width: 0; display: flex; align-items: center; gap: 12px; }
.role-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 0 0 3px rgba(147, 197, 253, .06);
}
.list-copy { min-width: 0; }
.list-copy strong, .list-copy span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-copy strong { font-size: 13px; }
.list-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; }

.row-actions { display: flex; gap: 5px; }
.row-actions button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  border-radius: 10px;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.row-actions button:hover {
  color: var(--text);
  border-color: rgba(96, 165, 250, .18);
  background: rgba(59, 130, 246, .08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .06);
}
.row-actions button.delete:hover {
  color: #fecaca;
  border-color: rgba(239, 68, 68, .18);
  background: rgba(239, 68, 68, .08);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .08);
}

.empty {
  padding: 30px 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.composer {
  max-width: 900px;
  padding: 0;
  overflow: hidden;
  gap: 0;
}
.composer-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 15, 30, .88);
}
.message-format-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 17, 32, .72);
}
.message-format-label {
  margin-right: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.format-option {
  position: relative;
  display: block;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.format-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.format-option span {
  display: block;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(16, 29, 51, .72);
  transition: border-color .2s ease, color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.format-option:hover span,
.format-option input:focus-visible + span {
  border-color: rgba(96, 165, 250, .4);
  color: var(--text);
}
.format-option input:checked + span {
  border-color: rgba(96, 165, 250, .45);
  color: white;
  background: linear-gradient(135deg, rgba(59, 130, 246, .2), rgba(99, 102, 241, .18));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}
.embed-fields {
  display: grid;
  gap: 18px;
  padding: 20px 22px;
  border-top: 1px solid rgba(28, 54, 88, .65);
  border-bottom: 1px solid var(--border);
  background: rgba(8, 15, 30, .68);
}
.embed-fields-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.embed-fields-heading h3 {
  margin: 0 0 4px;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 15px;
}
.embed-fields-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.embed-color-preview {
  width: 8px;
  min-width: 8px;
  height: 54px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(59, 130, 246, .24);
}
.embed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.composer > label { padding: 22px; }
.composer textarea {
  border: 0;
  padding: 2px 0;
  box-shadow: none;
}
.composer .form-actions {
  padding: 15px 22px;
  border-top: 1px solid var(--border);
}
.counter { justify-self: end; color: var(--muted); font-size: 11px; font-weight: 400; }
.muted { color: var(--muted); font-size: 12px; }

.profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border-top: 1px solid rgba(28, 54, 88, .8);
  background: transparent;
}
.profile-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 16px;
  background: rgba(16, 29, 51, .86);
}
.profile-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  object-fit: cover;
  color: white;
  background: linear-gradient(135deg, rgba(59, 130, 246, .45), rgba(99, 102, 241, .45));
  border: 1px solid rgba(96, 165, 250, .2);
  border-radius: 50%;
  font-weight: 800;
}

.danger-panel { border-top: 3px solid var(--danger); }
.infraction-search { max-width: 900px; margin-top: 24px; }
.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 20px;
}
.danger-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fecaca;
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .2);
  border-radius: 14px;
}

.audit-list { display: grid; gap: 8px; padding: 10px; border-top: 0; }
.audit-row {
  display: grid;
  grid-template-columns: 170px minmax(150px, .5fr) 1fr;
  gap: 16px;
  padding: 14px;
  background: rgba(16, 29, 51, .86);
  font-size: 12px;
}
.audit-row:last-child { border-bottom: 1px solid var(--border); }
.audit-row time, .audit-row code { color: var(--muted); }
.item-list > .empty, .profile-list > .empty, .audit-list > .empty {
  border: 1px dashed rgba(28, 54, 88, .95);
  border-radius: 14px;
  background: rgba(16, 29, 51, .58);
}
.profile-list > .empty { grid-column: 1 / -1; }

.toast-region {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 40px));
}
.toast {
  padding: 13px 15px;
  color: white;
  background: rgba(16, 29, 51, .96);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toast-in .2s ease-out;
}
.toast.error {
  border-color: rgba(239, 68, 68, .3);
  background: rgba(127, 29, 29, .95);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.login-panel,
.metrics,
.section-block,
.form-panel,
.composer,
.feature-card,
.profile-item,
.list-row,
.audit-row,
.brand,
#main-nav,
.logout {
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease, transform .2s ease;
}
.login-panel:hover,
.metrics:hover,
.section-block:hover,
.form-panel:hover,
.composer:hover,
.feature-card:hover,
.profile-item:hover,
.list-row:hover,
.audit-row:hover,
.brand:hover,
#main-nav:hover,
.logout:hover {
  border-color: rgba(96, 165, 250, .18);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .06), var(--shadow-soft);
}

.login-panel,
.metrics,
.section-block,
.form-panel,
.composer,
.feature-card,
.profile-item,
.list-row,
.audit-row {
  position: relative;
  overflow: hidden;
}
.login-panel::after,
.metrics::after,
.section-block::after,
.form-panel::after,
.composer::after,
.feature-card::after,
.profile-item::after,
.list-row::after,
.audit-row::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: -45%;
  bottom: -45%;
  left: -42%;
  width: 22%;
  background: linear-gradient(90deg, transparent, rgba(147, 197, 253, .08), transparent);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
  transition: left .62s ease, opacity .18s ease;
}
.login-panel:hover::after,
.metrics:hover::after,
.section-block:hover::after,
.form-panel:hover::after,
.composer:hover::after,
.feature-card:hover::after,
.profile-item:hover::after,
.list-row:hover::after,
.audit-row:hover::after {
  left: 122%;
  opacity: .62;
}

@media (prefers-reduced-motion: reduce) {
  .feature-track, .feature-card, .carousel-dot { transition: none; }
  .login-panel::after, .metrics::after, .section-block::after, .form-panel::after, .composer::after, .feature-card::after, .profile-item::after, .list-row::after, .audit-row::after { transition: none; display: none; }
}

@media (max-width: 1200px) {
  .feature-card { flex-basis: calc((100% - 28px) / 3); }
  .custom-bot-offer { grid-template-columns: minmax(0, 1fr) auto; }
  .offer-contacts { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .split-layout { grid-template-columns: 1fr; }
  .ticket-layout { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .youtube-category-list { grid-template-columns: 1fr; }
  .suggestion-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-list { grid-template-columns: 1fr; }
  .feature-card { flex-basis: calc((100% - 14px) / 2); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    z-index: 10;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 66px;
    flex-direction: row;
    padding: 7px;
    overflow-x: auto;
  }
  .brand, .logout { display: none; }
  #main-nav {
    display: flex;
    width: 100%;
    gap: 3px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .nav-item {
    min-width: 62px;
    min-height: 52px;
    justify-content: center;
    padding: 7px;
  }
  .nav-item span { display: none; }
  .topbar { min-height: 66px; padding: 10px 16px; }
  .server-picker { width: min(340px, 58vw); }
  .content { padding: 26px 16px 92px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics > div { border-bottom: 1px solid var(--border); }
  .metrics > div:nth-child(2) { border-right: 0; }
  .metrics > div:nth-child(n+3) { border-bottom: 0; }
  .composer-toolbar { grid-template-columns: 1fr; }
  .audit-row { grid-template-columns: 1fr; gap: 5px; }
  .custom-bot-offer { grid-template-columns: 1fr; gap: 22px; }
  .offer-price { padding: 16px 0; border: 1px solid var(--border); border-right: 0; border-left: 0; text-align: left; }
  .offer-contacts { grid-column: auto; }
}
@media (max-width: 480px) {
  .login-panel { padding: 26px 20px; border-radius: 16px; }
  .suggestion-grid { grid-template-columns: 1fr; }
  .metrics > div { padding: 17px; }
  .youtube-source-grid { grid-template-columns: 1fr; }
  .ticket-two-columns { grid-template-columns: 1fr; }
  .youtube-category-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .avatar-editor {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .avatar-zoom-control { width: 100%; }
  .feature-showcase { padding: 24px 12px 18px; }
  .feature-showcase .section-heading { padding: 0 10px; }
  .feature-viewport { margin: 0 38px; }
  .feature-card { min-height: 224px; flex-basis: 100%; padding: 22px 20px; }
  .carousel-arrow { width: 34px; height: 34px; }
  .custom-bot-offer { padding: 22px 20px; }
  .offer-copy { display: grid; gap: 13px; }
  .offer-contacts { grid-template-columns: 1fr; }
  .section-block, .form-panel { padding: 20px; }
  .section-block.flush { padding: 0; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .inline-form { grid-template-columns: 1fr; }
  .form-actions button { width: 100%; }
  .status { font-size: 0; }
}
