:root {
  --bg: #070a10;
  --surface: rgba(17, 22, 32, .94);
  --surface-2: #171d29;
  --surface-3: #202838;
  --line: rgba(151, 169, 202, .16);
  --line-bright: rgba(130, 148, 255, .42);
  --text: #f7f9fc;
  --muted: #9ba7ba;
  --blue: #7184ff;
  --violet: #9b6dff;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #4c5870 transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #536079, #343e52);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background-color: #667490; }

html, body { height: 100%; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -.012em;
  background: #070a10;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(800px 500px at 12% -8%, rgba(24, 119, 255, .23), transparent 66%),
    radial-gradient(650px 450px at 94% 8%, rgba(255, 74, 47, .15), transparent 68%),
    radial-gradient(900px 620px at 52% 110%, rgba(115, 70, 255, .16), transparent 68%),
    linear-gradient(145deg, #070a10 0%, #0b1019 48%, #080a0f 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

.topbar {
  height: 72px;
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(0, 1fr) auto;
  gap: 24px;
  background: rgba(8, 11, 17, .86);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(151,169,202,.24), 0 8px 25px rgba(29,91,255,.2);
}
.brand { transition: opacity .18s, transform .18s; }
.brand:hover { opacity: .9; transform: translateY(-1px); }
.global-nav {
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}
.global-nav::-webkit-scrollbar { display: none; }
.top-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 126px;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #929eb1;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 720;
  white-space: nowrap;
  transition: color .18s, background .18s;
}
.top-tab::after {
  content: "";
  position: absolute;
  left: 17px;
  right: 17px;
  bottom: 0;
  height: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  transform: scaleX(0);
  transition: transform .2s ease;
}
.top-tab:hover { color: #e7ebf3; background: rgba(255,255,255,.035); }
.top-tab.active { color: #fff; background: linear-gradient(180deg, transparent, rgba(113,132,255,.1)); }
.top-tab.active::after { transform: scaleX(1); }

.button { transition: transform .16s, filter .16s, box-shadow .16s; }
.button:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(83,96,255,.3); }
.account-name { color: #aeb7c6; margin-right: 10px; }

.home-hero { max-width: 1080px; padding: 78px 24px 70px; position: relative; }
.home-hero .hero-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: linear-gradient(120deg, rgba(7,140,255,.34), rgba(255,81,47,.24));
  filter: blur(82px);
  top: 10px;
  left: calc(50% - 180px);
  z-index: -1;
}
.hero-logo {
  width: 92px;
  height: 92px;
  border-radius: 25px;
  box-shadow: 0 20px 65px rgba(23,40,137,.55), 0 0 0 1px rgba(255,255,255,.15);
  margin-bottom: 18px;
  animation: floatLogo 4s ease-in-out infinite;
}
.home-hero h1 {
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  font-weight: 850;
  letter-spacing: -.058em;
  font-size: clamp(50px, 8vw, 82px);
  margin: 12px 0 18px;
  line-height: .95;
}
.home-hero h1 span { background: linear-gradient(100deg,#6bc5ff 5%,#8294ff 47%,#ff8f68 95%); background-clip: text; color: transparent; }
.home-hero > p { font-size: 19px; max-width: 610px; line-height: 1.55; color: #aab3c2; }
.hero-button { font-size: 16px; padding: 13px 19px; border-radius: 11px; }
.hero-button span { padding-left: 7px; }
.commands-section { margin-top: 78px; text-align: left; }
.commands-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }
.commands-heading h2 { font-size: 27px; margin: 5px 0 0; letter-spacing: -.035em; }
.command-count { color: #9ba5b5; background: rgba(21,26,36,.82); border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; font-size: 12px; }
.command-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.command-card {
  min-height: 132px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(27,33,45,.9), rgba(14,18,26,.94));
  box-shadow: 0 18px 60px rgba(0,0,0,.27);
  transition: transform .18s, border-color .18s;
}
.command-card:hover { transform: translateY(-3px); border-color: var(--line-bright); }
.command-icon { width: 55px; height: 55px; border-radius: 15px; background: linear-gradient(145deg,#5c70ff,#7652e7); display: grid; place-items: center; font-size: 30px; font-weight: 850; flex: 0 0 auto; }
.command-card > div:nth-child(2) { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.command-card code { color: #aeb8ff; font-size: 13px; }
.command-card strong { font-size: 17px; }
.command-card span { color: #929dad; font-size: 13px; line-height: 1.4; }
.ready-dot { margin-left: auto !important; color: #72e49a !important; background: #153b25; padding: 5px 9px; border-radius: 999px; font-weight: 750; }
.more-card { border-style: dashed; background: rgba(16,20,29,.7); }
.more-symbol { width: 47px; height: 47px; border-radius: 50%; display: grid; place-items: center; background: #242b39; color: #aeb7c7; font-size: 25px; flex: 0 0 auto; }

.dashboard-shell { max-width: 1240px; padding-top: 52px; }
.page-kicker { color: #95a3ff; font-size: 12px; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; margin-bottom: 9px; }
.page-title { font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif; font-size: 38px; letter-spacing: -.045em; }
.server {
  background: linear-gradient(145deg, rgba(27,34,47,.94), rgba(16,21,30,.97));
  border-color: var(--line);
  box-shadow: 0 16px 50px rgba(0,0,0,.2);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.server.ready:hover { transform: translateY(-3px); border-color: var(--line-bright); box-shadow: 0 22px 58px rgba(0,0,0,.3); }
.server.disabled.addable { opacity: 1; filter: none; border-color: rgba(113,132,255,.3); }
.server.disabled.addable .server-name { color: #fff; }

.server-shell { max-width: 1580px; padding: 22px; }
.workspace { height: calc(100vh - 116px); grid-template-columns: 252px minmax(0,1fr); gap: 14px; }
.sidebar, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 65px rgba(0,0,0,.25);
  backdrop-filter: blur(18px);
}
.sidebar { height: 100%; position: static; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sidebar-fixed { flex: 0 0 auto; padding: 15px 14px 10px; border-bottom: 1px solid var(--line); background: rgba(10,14,21,.55); }
.back { margin: 2px 4px 12px; color: #aab4c5; }
.back:hover { color: #fff; }
.server-heading { padding: 5px 4px 8px; font-size: 19px; letter-spacing: -.025em; }
.channel-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 7px 8px 18px; }
.channel-group + .channel-group { margin-top: 6px; }
.side-label { margin: 15px 9px 6px; color: #78859a; font-size: 10px; letter-spacing: .12em; }
.channel {
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) auto;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 8px 9px;
  color: #9ca8b9;
  transition: color .15s, background .15s, transform .15s;
}
.channel:hover { color: #eef1f6; background: rgba(255,255,255,.055); transform: translateX(2px); }
.channel.active { color: #fff; background: linear-gradient(90deg,rgba(102,119,255,.22),rgba(105,88,235,.1)); box-shadow: inset 3px 0 #7686ff; }
.channel-symbol { opacity: .8; text-align: center; }
.channel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-count { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: #293246; color: #b8c2d2; font-size: 10px; text-align: center; }
.empty.compact { padding: 25px 8px; }

.panel { height: 100%; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.panel-head { position: static; flex: 0 0 72px; padding: 0 20px; background: rgba(15,20,29,.92); border-color: var(--line); }
.panel-title { font-size: 18px; letter-spacing: -.02em; }
.messages-wrap { position: relative; flex: 1; min-height: 0; }
.messages { height: 100%; overflow-y: auto; min-height: 0; scroll-behavior: smooth; padding: 8px 0 70px; }
.message { grid-template-columns: 44px minmax(0,1fr); padding: 10px 20px; animation: messageIn .2s ease-out; }
.message:hover { background: rgba(255,255,255,.032); }
.message-body { min-width: 0; }
.message-meta { min-height: 20px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.author { font-size: 15px; }
.timestamp, .status { margin-left: 0; }
.jump { position: static; margin-left: auto; opacity: 0; color: #aeb7ff; transition: opacity .15s; }
.message:hover .jump { opacity: 1; }
.reply-preview { display: flex; gap: 7px; align-items: center; color: #aeb7c7; font-size: 12px; margin: 0 0 6px; border-left: 2px solid #5b667c; padding-left: 8px; overflow: hidden; }
.reply-preview > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-author { font-weight: 800; color: #d8ddea; flex: 0 0 auto; }
.system-tag { font-size: 9px; background: #3c455b; padding: 2px 5px; border-radius: 4px; }
.embed-media { max-width: min(510px,100%); max-height: 420px; border-radius: 9px; display: block; margin-top: 8px; }

.jump-stack { position: absolute; right: 18px; bottom: 16px; z-index: 12; display: flex; flex-direction: column; align-items: stretch; gap: 7px; pointer-events: none; }
.jump-pill {
  width: 92px;
  height: 34px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #4b5871;
  background: rgba(31,39,54,.96);
  color: #fff;
  border-radius: 999px;
  padding: 0 12px;
  font-weight: 720;
  box-shadow: 0 8px 25px rgba(0,0,0,.45);
  cursor: pointer;
  pointer-events: auto;
}
.jump-pill.visible { display: flex; animation: pop .17s ease-out; }
.jump-pill:hover { background: #303b52; border-color: #7483a1; }

.member-list { padding-bottom: 20px; }
.member { width: 100%; color: var(--text); text-align: left; }
.member.clickable:hover { background: rgba(255,255,255,.045); }
.voice-view { padding: 26px; overflow-y: auto; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 12px; margin: 18px 0 22px; }
.voice-member { width: 100%; display: flex; align-items: center; gap: 11px; padding: 13px; color: var(--text); text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 13px; cursor: pointer; }
.voice-member:hover { background: var(--surface-3); border-color: rgba(130,148,255,.3); }
.notice-card { color: #9ca8b9; line-height: 1.55; border: 1px solid var(--line); background: rgba(10,14,21,.65); border-radius: 12px; padding: 14px; }

.error-state { width: min(560px, calc(100% - 32px)); margin: 110px auto; padding: 38px; text-align: center; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.error-state h1 { margin: 12px 0 8px; font-size: 28px; }
.error-state p { color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.error-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: auto; border-radius: 14px; color: #ff9299; background: rgba(255,75,87,.13); font-size: 25px; font-weight: 850; }

.modal { backdrop-filter: blur(10px); }
.profile-card { background: #151b26; border-color: var(--line); }
.profile-banner { background: linear-gradient(120deg,#253db1,#7c43df); }

@keyframes floatLogo { 50% { transform: translateY(-7px); } }
@keyframes messageIn { from { opacity: 0; transform: translateY(4px); } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.94); } }

@media (max-width: 900px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; }
  .brand span { display: none; }
  .workspace { grid-template-columns: 218px minmax(0,1fr); }
}

@media (max-width: 700px) {
  .topbar { grid-template-columns: auto minmax(0,1fr) auto; padding: 0 10px; }
  .account-name, #accountArea .secondary { display: none; }
  .top-tab { min-width: 106px; padding: 0 10px; }
  .server-shell { padding: 10px; }
  .workspace { height: calc(100vh - 92px); grid-template-columns: 168px minmax(0,1fr); gap: 8px; }
  .server-heading { font-size: 16px; }
  .message { padding: 9px 11px; grid-template-columns: 38px minmax(0,1fr); gap: 9px; }
  .avatar { width: 38px; height: 38px; }
  .jump { display: none; }
  .command-grid { grid-template-columns: 1fr; }
  .ready-dot { display: none; }
  .home-hero { padding-top: 62px; }
}

@media (max-width: 500px) {
  .top-tab span { display: none; }
  .top-tab { min-width: 82px; font-size: 12px; }
  .workspace { grid-template-columns: 132px minmax(0,1fr); }
  .channel { padding-inline: 5px; grid-template-columns: 18px minmax(0,1fr); }
  .voice-count { display: none; }
}
