:root {
  color-scheme: dark;
  --bg: #090d12;
  --bg-soft: #0d131b;
  --surface: #111821;
  --surface-raised: #151e29;
  --surface-soft: #0d141d;
  --line: #24303d;
  --line-strong: #354555;
  --text: #f4f8fb;
  --text-soft: #d6e0e8;
  --muted: #8d9baa;
  --primary: #89cff0;
  --primary-strong: #54b9e8;
  --primary-deep: #2589bc;
  --green: #52d6a5;
  --red: #ff7185;
  --yellow: #f5c96a;
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 22px;
  --shadow-sm: 0 8px 26px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% -10%, rgba(84, 185, 232, 0.14), transparent 34rem),
    radial-gradient(circle at 95% 8%, rgba(82, 214, 165, 0.06), transparent 28rem),
    linear-gradient(180deg, #0b1017 0, var(--bg) 32rem);
  color: var(--text);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.settings-surface {
  background: var(--bg);
}

.home-surface {
  background: var(--bg);
}

.app-surface {
  background: var(--bg);
}

.home-surface::before,
.app-surface::before {
  display: none;
}

.settings-surface::before {
  display: none;
}

.settings-surface .topbar {
  position: static;
}

.home-surface .topbar,
.app-surface .topbar {
  position: static;
}

.home-surface .button {
  transition: none;
}

.home-surface .button:hover {
  transform: none;
}

.home-surface .button.primary,
.home-surface .button.primary:hover {
  box-shadow: none;
}

.home-surface .brand-mark {
  box-shadow: none;
}

.app-surface .panel {
  background: #0e151e;
  box-shadow: none;
  contain: layout paint;
}

.app-surface .button {
  transition: none;
}

.app-surface .button:hover {
  transform: none;
}

.app-surface .button.primary,
.app-surface .button.primary:hover {
  box-shadow: none;
}

body::before {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  left: 0;
  height: 720px;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  opacity: 0.45;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  border-bottom: 1px solid rgba(137, 207, 240, 0.1);
  background: #0a0f15;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.public-nav > a:not(.button) {
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.public-nav > a:not(.button):hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.public-nav .button {
  margin-left: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: linear-gradient(145deg, #a8ddf5, var(--primary-deep));
  box-shadow: 0 10px 26px rgba(37, 137, 188, 0.3);
  color: #07131b;
  font-weight: 900;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.account-menu {
  position: relative;
}

.account-menu > summary {
  padding: 6px 9px 6px 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.account-menu > summary::-webkit-details-marker {
  display: none;
}

.account-menu[open] > summary,
.account-menu > summary:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.account img,
.avatar-fallback {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 800;
}

.account-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chevron {
  width: 7px;
  height: 7px;
  margin: -3px 2px 0 3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.account-menu[open] .account-chevron {
  margin-top: 3px;
  transform: rotate(225deg);
}

.account-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  width: 245px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #101821;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.38);
}

.account-popover-head {
  display: grid;
  padding: 10px 11px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}

.account-popover-head span {
  color: var(--muted);
  font-size: 12px;
}

.account-popover > a,
.account-popover .link-button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--text-soft);
  text-align: left;
}

.account-popover > a:hover,
.account-popover .link-button:hover {
  background: rgba(137, 207, 240, 0.07);
  color: var(--text);
}

.premium-menu-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(245, 201, 106, 0.08);
}

.link-button {
  padding: 7px 9px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.link-button:hover {
  color: var(--text);
}

.page,
.landing,
.narrow-page {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
}

.page {
  padding: 54px 0 110px;
}

.landing {
  width: min(1160px, calc(100% - 40px));
  padding: 0 0 80px;
}

.narrow-page {
  width: min(720px, calc(100% - 40px));
  padding: 72px 0 110px;
}

.eyebrow,
.field-kicker {
  display: block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.landing-home {
  overflow: hidden;
}

.landing-hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(68px, 8vw, 96px) 0 62px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border: 1px solid rgba(137, 207, 240, 0.2);
  border-radius: 999px;
  background: rgba(137, 207, 240, 0.045);
  color: #b8e4f8;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.hero-badge > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.landing-hero h1 {
  max-width: 1040px;
  margin: 24px auto 23px;
  font-size: clamp(48px, 5.25vw, 68px);
  line-height: 1.01;
  letter-spacing: -0.057em;
}

.landing-hero > p {
  max-width: 730px;
  margin: 0 auto;
  color: #a3b0bc;
  font-size: 18px;
  line-height: 1.68;
}

.landing-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-hero .landing-actions {
  justify-content: center;
  margin-top: 31px;
}

.capability-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
  contain: layout paint;
}

.capability-rail article {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 13px;
  padding: 21px 19px;
  background: #0d141c;
}

.capability-rail svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.capability-rail article > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.capability-rail strong {
  color: var(--text-soft);
  font-size: 14px;
}

.capability-rail span {
  color: #748493;
  font-size: 12px;
  line-height: 1.45;
}

.landing-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(480px, 1.12fr);
  align-items: center;
  gap: clamp(54px, 7vw, 90px);
  margin-top: 108px;
  scroll-margin-top: 24px;
}

.landing-feature-copy h2 {
  margin: 11px 0 0;
  font-size: clamp(34px, 4.1vw, 49px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.landing-feature-copy > p {
  max-width: 530px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.configuration-panel {
  overflow: hidden;
  border: 1px solid #2a3846;
  border-radius: 20px;
  background: #0d141c;
  contain: layout paint;
}

.configuration-panel-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px 19px;
  border-bottom: 1px solid var(--line);
  background: #101821;
}

.configuration-panel-head > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  color: #07131b;
  font-size: 12px;
  font-weight: 900;
}

.configuration-panel-head > strong {
  font-size: 14px;
}

.configuration-panel-head > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(82, 214, 165, 0.08);
}

.configuration-row {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 19px;
  border-bottom: 1px solid rgba(36, 48, 61, 0.72);
}

.configuration-row:last-child {
  border-bottom: 0;
}

.configuration-row > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 680;
}

.configuration-row > span > i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 2px solid var(--primary);
  border-radius: 50%;
}

.configuration-row > small {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #293746;
  border-radius: 7px;
  color: #81909e;
  font-size: 10px;
  font-weight: 750;
}

.guild-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.guild-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(20, 29, 39, 0.96), rgba(13, 19, 27, 0.96));
  box-shadow: var(--shadow-sm);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease,
    transform 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.link-button:focus-visible,
.danger-link:focus-visible {
  outline: 3px solid rgba(137, 207, 240, 0.24);
  outline-offset: 2px;
}

.button.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 10px 28px rgba(37, 137, 188, 0.22);
  color: #07131b;
}

.button.primary:hover {
  box-shadow: 0 14px 34px rgba(37, 137, 188, 0.3);
}

.button.secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
}

.button.secondary:hover {
  border-color: rgba(137, 207, 240, 0.35);
  background: rgba(137, 207, 240, 0.06);
}

.button.ghost {
  border-color: var(--line);
  color: var(--muted);
}

.button.large {
  min-height: 50px;
  padding: 0 23px;
}

.button.small {
  min-height: 35px;
  padding: 0 12px;
  font-size: 13px;
}

.button.full {
  width: 100%;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.page-heading h1 {
  margin: 5px 0 0;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.page-heading p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.guild-grid {
  margin-top: 32px;
}

.guild-card {
  padding: 22px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.app-surface .guild-card {
  contain: layout paint;
  transition: none;
}

.app-surface .guild-card:hover {
  transform: none;
}

.guild-card.disabled {
  opacity: 0.58;
}

.guild-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.guild-card-head img,
.guild-fallback {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.guild-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #243344, #15202c);
  color: var(--primary);
  font-weight: 800;
}

.guild-card-title {
  min-width: 0;
}

.guild-card h2,
.guild-card h3 {
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-group + .server-group {
  margin-top: 58px;
}

.server-group-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.server-group-heading h2 {
  margin: 5px 0 0;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.server-count {
  display: grid;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-weight: 750;
}

.server-group-copy {
  margin: 8px 0 0;
  color: var(--muted);
}

.available-guild-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guild-card.available {
  display: grid;
  gap: 24px;
  align-content: space-between;
  min-height: 166px;
  background: #0e151e;
}

.guild-card.available .guild-card-title h3 {
  overflow: visible;
  overflow-wrap: anywhere;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.connection-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #677483;
}

.connection-status.online {
  color: #80dbb6;
}

.connection-status.online i {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(82, 214, 165, 0.09);
}

.stats {
  display: flex;
  gap: 10px;
}

.stats > div {
  min-width: 92px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.stats span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats.compact {
  margin: 24px 0;
}

.stats.compact > div {
  flex: 1;
  min-width: 0;
  padding: 10px;
}

.setup-panel {
  padding: 36px;
}

.setup-panel h1 {
  margin: 8px 0;
  font-size: 36px;
  letter-spacing: -0.035em;
}

.muted,
.section-help {
  color: var(--muted);
}

.callout {
  margin: 22px 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-soft);
}

.callout code {
  color: var(--primary);
}

.stack-form {
  display: grid;
  gap: 17px;
  margin-top: 26px;
}

label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: var(--text-soft);
  font-weight: 650;
}

label small,
.limit-card small {
  color: var(--muted);
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid #2d3a48;
  border-radius: var(--radius-sm);
  outline: none;
  background: #0b1118;
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #3b4c5e;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-deep);
  background: #0d151e;
  box-shadow: 0 0 0 3px rgba(137, 207, 240, 0.1);
}

select[multiple] {
  padding: 6px;
}

select[multiple] option {
  padding: 7px;
  border-radius: 6px;
}

.alert {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 12px;
}

.alert.success {
  border-color: rgba(82, 214, 165, 0.3);
  background: rgba(82, 214, 165, 0.08);
  color: #91e8c7;
}

.alert.error {
  border-color: rgba(255, 113, 133, 0.34);
  background: rgba(255, 113, 133, 0.08);
  color: #ff9bab;
}

.empty-state {
  padding: 58px;
  text-align: center;
}

.error-code {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 113, 133, 0.1);
  color: var(--red);
  font-size: 28px;
  font-weight: 900;
}

.settings-heading {
  align-items: center;
}

.server-heading {
  min-width: 0;
}

.server-title-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.server-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
}

.server-icon-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #243344, #15202c);
  color: var(--primary);
  font-weight: 850;
}

.back-link {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.back-link:hover {
  color: var(--primary);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-toolbar {
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 24, 33, 0.62);
}

.section-nav {
  position: sticky;
  z-index: 20;
  top: 12px;
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  padding: 7px;
  overflow: auto;
  border: 1px solid rgba(137, 207, 240, 0.12);
  border-radius: 14px;
  background: #0d141d;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  contain: paint;
}

.section-nav a {
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.section-nav a:hover {
  background: rgba(137, 207, 240, 0.07);
  color: var(--text);
}

.section-nav a.active,
.section-nav a[aria-current="page"] {
  background: var(--primary);
  box-shadow: 0 5px 16px rgba(37, 137, 188, 0.18);
  color: #07131b;
}

.settings-page #settings-form {
  min-height: 620px;
}

.config-section {
  margin-bottom: 18px;
  padding: 30px;
  scroll-margin-top: 150px;
  contain: layout paint;
}

.settings-section-group {
  display: grid;
  gap: 18px;
}

.settings-section-group .config-section {
  margin-bottom: 0;
}

.config-section[hidden] {
  display: none;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-title > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.025em;
}

.section-title p {
  max-width: 460px;
  margin: 3px 0 0;
  color: var(--muted);
  text-align: right;
}

.step {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(137, 207, 240, 0.15);
  border-radius: 11px;
  background: rgba(137, 207, 240, 0.07);
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
}

.section-help {
  margin: -8px 0 22px;
  padding: 12px 14px;
  border-left: 2px solid rgba(137, 207, 240, 0.45);
  background: rgba(137, 207, 240, 0.035);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px;
}

.form-grid.dense {
  gap: 15px;
}

.field-wide {
  grid-column: 1 / -1;
}

.toggle {
  min-height: 72px;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.toggle:hover {
  border-color: #394b5c;
  background: rgba(137, 207, 240, 0.025);
}

.toggle:has(input:checked) {
  border-color: rgba(137, 207, 240, 0.28);
  background: rgba(137, 207, 240, 0.045);
}

.toggle input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--primary-strong);
}

.toggle span,
.toggle strong,
.toggle small {
  display: block;
}

.toggle small {
  margin-top: 3px;
}

.toggle.compact-toggle {
  width: fit-content;
  min-height: 0;
  align-self: end;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
}

.toggle.compact-toggle input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
}

.toggle.compact-toggle strong {
  font-size: 13px;
}

.limit-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.15fr);
  gap: 28px;
  padding: 22px;
  border: 1px solid rgba(137, 207, 240, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(120deg, rgba(137, 207, 240, 0.055), transparent 46%),
    var(--surface-soft);
}

.limit-card-copy {
  align-self: center;
}

.limit-card-copy strong,
.limit-card-copy small {
  display: block;
}

.limit-card-copy strong {
  margin: 8px 0 7px;
  font-size: 18px;
}

.limit-controls {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: end;
  gap: 14px;
}

.limit-controls > label:first-child {
  grid-column: 1 / -1;
}

.input-combo {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(120px, 1.2fr);
  gap: 8px;
}

.code-editor {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.09);
}

.code-editor summary {
  cursor: pointer;
  font-weight: 750;
}

.code-editor textarea {
  margin-top: 10px;
  font-family: "Cascadia Code", Consolas, monospace;
}

.rule-list {
  display: grid;
  gap: 14px;
}

.rule-card {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(7, 11, 16, 0.32);
  contain: layout paint;
}

.rule-card:hover {
  border-color: #354657;
}

.rule-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 14px 18px;
  list-style: none;
  cursor: pointer;
}

.rule-card-head::-webkit-details-marker {
  display: none;
}

.rule-card[open] .rule-card-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.rule-card-body {
  padding: 18px;
}

.rule-card-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rule-card-head .danger-link {
  flex: 0 0 auto;
  margin-left: 2px;
}

.access-rule-list {
  display: grid;
  gap: 12px;
}

.access-rule {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(340px, 1.5fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.access-permissions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.access-choice {
  position: relative;
  display: flex;
  min-height: 42px;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1118;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.access-choice:hover {
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.access-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.access-check {
  position: relative;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  border: 1px solid #405161;
  border-radius: 6px;
  background: #111923;
}

.access-choice input:checked + .access-check {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(137, 207, 240, 0.1);
}

.access-choice input:checked + .access-check::after {
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #07131b;
  border-bottom: 2px solid #07131b;
  content: "";
  transform: rotate(45deg);
}

.access-choice:has(input:checked) {
  border-color: rgba(137, 207, 240, 0.32);
  background: rgba(137, 207, 240, 0.07);
  color: var(--text);
}

.access-choice input:focus-visible + .access-check {
  outline: 3px solid rgba(137, 207, 240, 0.2);
  outline-offset: 2px;
}

.access-choice-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.premium-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(245, 201, 106, 0.32);
  border-radius: 999px;
  background: rgba(245, 201, 106, 0.08);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
}

.premium-badge.active {
  border-color: rgba(82, 214, 165, 0.35);
  background: rgba(82, 214, 165, 0.09);
  color: var(--green);
}

.premium-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.6fr) minmax(280px, 1.4fr);
  gap: 24px;
  padding: 22px;
  border: 1px solid rgba(245, 201, 106, 0.2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 201, 106, 0.08), rgba(137, 207, 240, 0.04));
}

.premium-grid > div {
  display: grid;
  align-content: center;
}

.premium-grid strong {
  font-size: 27px;
}

.premium-grid span {
  color: var(--muted);
}

.premium-grid ul {
  margin: 0;
  padding-left: 20px;
}

.premium-locked {
  opacity: 0.72;
}

.premium-section-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.premium-section-actions p {
  margin: 0;
}

.simple-heading {
  align-items: flex-start;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
}

.profile-card {
  display: grid;
  gap: 26px;
  padding: 28px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-identity img,
.profile-avatar-fallback {
  width: 70px;
  height: 70px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  color: var(--primary);
  font-size: 25px;
  font-weight: 850;
}

.profile-identity div {
  display: grid;
}

.profile-identity strong {
  font-size: 24px;
  line-height: 1.2;
}

.profile-identity span,
.profile-card p {
  color: var(--muted);
}

.account-status {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.account-status p {
  margin: 12px 0 0;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-role {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.role-owner {
  border-color: rgba(245, 201, 106, 0.38);
  background: rgba(245, 201, 106, 0.1);
  color: #f8d982;
}

.role-developer {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.1);
  color: #cbbcff;
}

.role-helper {
  border-color: rgba(82, 214, 165, 0.38);
  background: rgba(82, 214, 165, 0.09);
  color: #84e6bf;
}

.role-premium {
  border-color: rgba(137, 207, 240, 0.42);
  background: rgba(137, 207, 240, 0.1);
  color: #b9e8fd;
}

.role-standard {
  color: var(--muted);
}

.profile-actions,
.license-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-preference-card {
  padding: 24px;
}

.account-preference-card h2 {
  margin: 7px 0;
  font-size: 22px;
}

.account-preference-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.language-form {
  display: grid;
  gap: 12px;
}

.profile-admin {
  margin-top: 24px;
  padding: 26px;
}

.operator-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.profile-role-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.5fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 22px;
}

.profile-assignment-list {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.profile-assignment {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1118;
}

.profile-assignment img,
.mini-profile-avatar {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.mini-profile-avatar {
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  color: var(--primary);
  font-weight: 800;
}

.profile-assignment > div {
  display: grid;
}

.profile-assignment > div span {
  color: var(--muted);
  font-size: 12px;
}

.profile-assignment form {
  margin: 0;
}

.billing-heading {
  margin-bottom: 25px;
}

.billing-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.billing-summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: #0e151e;
}

.billing-summary-card > div {
  display: grid;
}

.billing-summary-card span,
.billing-summary-card small {
  color: var(--muted);
}

.billing-summary-card strong {
  font-size: 24px;
  line-height: 1.2;
}

.summary-icon {
  position: relative;
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-raised);
  color: var(--primary);
  font-weight: 900;
}

.summary-icon.ready::after,
.summary-icon.pending::after {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(82, 214, 165, 0.09);
  content: "";
}

.summary-icon.pending::after {
  background: var(--yellow);
  box-shadow: 0 0 0 5px rgba(245, 201, 106, 0.09);
}

.history-icon::before,
.history-icon::after {
  position: absolute;
  content: "";
}

.history-icon::before {
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary);
  border-radius: 50%;
}

.history-icon::after {
  width: 6px;
  height: 6px;
  border-bottom: 2px solid var(--primary);
  border-left: 2px solid var(--primary);
}

.checkout-workflow {
  margin-bottom: 22px;
  padding: 26px;
  border-color: rgba(137, 207, 240, 0.32);
  background: linear-gradient(145deg, rgba(19, 35, 47, 0.98), rgba(13, 20, 29, 0.98));
}

.checkout-workflow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.checkout-workflow h2 {
  margin: 6px 0 0;
}

.checkout-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.checkout-steps > div {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.checkout-steps > div > span {
  display: grid;
  width: 25px;
  height: 25px;
  margin-bottom: 9px;
  place-items: center;
  border-radius: 8px;
  background: rgba(137, 207, 240, 0.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.checkout-steps p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.checkout-code-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  margin-bottom: 10px;
}

.checkout-code {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(137, 207, 240, 0.32);
  border-radius: 11px;
  background: #091017;
  color: var(--primary);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.billing-unavailable {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
  padding: 20px;
  border-color: rgba(245, 201, 106, 0.23);
}

.billing-unavailable p {
  margin: 3px 0 8px;
  color: var(--muted);
}

.billing-unavailable code {
  display: block;
  margin: 10px 0 4px;
  color: var(--primary);
}

.operator-note {
  color: var(--muted);
  font-size: 12px;
}

.text-link {
  color: var(--primary);
  font-weight: 700;
}

.text-link:hover {
  color: #bce8fb;
}

.status-indicator {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(82, 214, 165, 0.09);
}

.status-indicator.pending {
  background: var(--yellow);
  box-shadow: 0 0 0 5px rgba(245, 201, 106, 0.09);
}

.premium-includes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 48px;
}

.premium-includes > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d141d;
}

.premium-includes > div > span:last-child {
  display: grid;
}

.premium-includes small {
  color: var(--muted);
}

.feature-check {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: rgba(82, 214, 165, 0.1);
  color: var(--green);
  font-weight: 900;
}

.billing-section {
  margin-bottom: 48px;
}

.license-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.license-card {
  display: grid;
  gap: 19px;
  padding: 20px;
  background: #0e151e;
}

.license-card.selected {
  border-color: rgba(137, 207, 240, 0.42);
  box-shadow: inset 0 0 0 1px rgba(137, 207, 240, 0.08);
}

.license-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.billing-server-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.billing-server-name img,
.billing-server-name .guild-fallback {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 14px;
}

.billing-server-name > div {
  display: grid;
  justify-items: start;
  min-width: 0;
}

.billing-server-name strong {
  overflow: hidden;
  max-width: 360px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-server-name > div span {
  color: var(--muted);
  font-size: 11px;
}

.license-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.license-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #657382;
}

.license-status.active {
  border-color: rgba(82, 214, 165, 0.24);
  background: rgba(82, 214, 165, 0.06);
  color: #83e4bd;
}

.license-status.active i {
  background: var(--green);
}

.license-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.license-details > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a1017;
}

.license-details dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.license-details dd {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.license-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.license-actions > .button {
  grid-column: 1 / -1;
}

.license-actions form,
.license-actions form .button {
  width: 100%;
  margin: 0;
}

.license-actions form .button {
  display: grid;
  min-height: 51px;
  line-height: 1.2;
}

.license-actions form .button small {
  font-size: 10px;
  opacity: 0.72;
}

.payment-history {
  padding: 24px;
}

.history-empty {
  padding: 28px 0 8px;
  color: var(--muted);
  text-align: center;
}

.history-empty p {
  margin: 4px 0 0;
}

.payment-table {
  margin-top: 16px;
  overflow-x: auto;
}

.payment-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 0.7fr 0.7fr 0.7fr;
  gap: 14px;
  min-width: 720px;
  align-items: center;
  padding: 13px 10px;
  border-top: 1px solid var(--line);
}

.payment-head {
  border-top: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.payment-row code {
  color: var(--muted);
  font-size: 12px;
}

.purchase-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding: 24px;
}

.purchase-intro h2 {
  margin: 6px 0 7px;
  font-size: 25px;
}

.purchase-intro p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}

.billing-price-options {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.billing-price-options > span {
  display: grid;
  min-width: 130px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a1118;
}

.billing-price-options > span.recommended {
  border-color: rgba(137, 207, 240, 0.36);
}

.billing-price-options strong {
  font-size: 19px;
}

.billing-price-options small {
  color: var(--muted);
}

.checkout-compact {
  margin-bottom: 18px;
  padding: 24px;
  border-color: rgba(137, 207, 240, 0.3);
}

.checkout-compact h2 {
  margin: 5px 0;
}

.checkout-compact p {
  margin: 0 0 17px;
  color: var(--muted);
}

.billing-section {
  margin: 42px 0 28px;
}

.billing-empty {
  margin-top: 18px;
}

.license-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.license-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(300px, auto);
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-radius: 16px;
}

.license-row.selected {
  border-color: rgba(137, 207, 240, 0.42);
}

.license-row .billing-server-name strong {
  max-width: 420px;
}

.license-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.license-row-actions form {
  margin: 0;
}

.billing-history {
  padding: 0;
  overflow: hidden;
}

.billing-history > summary {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
}

.billing-history > summary::-webkit-details-marker {
  display: none;
}

.billing-history > summary > span:first-child {
  display: grid;
}

.billing-history > summary small {
  color: var(--muted);
}

.details-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.billing-history[open] .details-chevron {
  transform: rotate(225deg);
}

.billing-history .payment-table,
.billing-history .history-empty {
  margin: 0;
  padding: 0 20px 20px;
}

.legal-page {
  padding-bottom: 10px;
}

.legal-page .page-heading {
  margin-bottom: 24px;
}

.legal-card {
  margin-bottom: 14px;
  padding: 24px;
}

.legal-card h2 {
  margin: 0 0 12px;
  font-size: 21px;
}

.legal-card p,
.legal-card li {
  color: var(--text-soft);
}

.legal-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 21px;
}

.legal-details {
  display: grid;
  gap: 12px;
  margin: 0;
}

.legal-details > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) 1fr;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.legal-details > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.legal-details dt {
  color: var(--muted);
}

.legal-details dd {
  margin: 0;
}

.legal-card a {
  color: var(--primary);
}

.markdown-content {
  color: var(--text-soft);
}

.markdown-content > :first-child {
  margin-top: 0;
}

.markdown-content > :last-child {
  margin-bottom: 0;
}

.markdown-content h2,
.markdown-content h3 {
  margin: 28px 0 10px;
  color: var(--text);
}

.markdown-content h2:first-child,
.markdown-content h3:first-child {
  margin-top: 0;
}

.markdown-content p {
  white-space: pre-line;
}

.markdown-content li + li {
  margin-top: 5px;
}

.content-language-note {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.content-selector {
  margin-bottom: 14px;
  padding: 18px;
}

.content-selector form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.45fr) auto;
  align-items: end;
  gap: 12px;
}

.content-editor {
  padding: 26px;
}

.content-editor form,
.content-editor form > label {
  display: grid;
  gap: 9px;
}

.content-editor textarea {
  min-height: 480px;
  resize: vertical;
  font-family: "Cascadia Code", Consolas, monospace;
  line-height: 1.6;
}

.content-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.pre-line {
  white-space: pre-line;
}

.legal-warning {
  display: grid;
  margin-bottom: 14px;
}

.legal-inline-warning {
  color: var(--yellow) !important;
}

.rule-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.rule-card[open] .rule-chevron {
  transform: rotate(45deg);
}

.rule-state {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.drag-handle {
  color: #607181;
}

.danger-link {
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #ff91a0;
  cursor: pointer;
}

.danger-link:hover {
  background: rgba(255, 113, 133, 0.08);
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.035);
}

.role-picker,
.user-picker {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.014);
}

.role-picker legend,
.user-picker legend {
  padding: 0 6px;
  color: var(--text-soft);
  font-weight: 700;
}

.role-picker > small,
.user-picker > small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 400;
}

.role-chip-list,
.user-chip-list {
  display: flex;
  min-height: 34px;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.role-chip-list:empty::before,
.user-chip-list:empty::before {
  align-self: center;
  color: var(--muted);
  content: attr(data-empty-label);
  font-size: 13px;
}

.role-chip,
.user-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 6px 10px;
  border: 1px solid rgba(137, 207, 240, 0.36);
  border-radius: 999px;
  background: rgba(137, 207, 240, 0.08);
  color: #eaf8ff;
}

.role-chip > span,
.user-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-chip button,
.user-chip button {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: inherit;
  cursor: pointer;
}

.role-picker-button {
  align-self: flex-start;
}

.picker-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #111923;
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.picker-dialog::backdrop {
  background: rgba(3, 7, 11, 0.72);
}

.picker-dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.picker-dialog-head {
  border-bottom: 1px solid var(--line);
}

.picker-dialog-head h2 {
  margin: 3px 0 0;
  font-size: 21px;
}

.picker-dialog > input {
  width: calc(100% - 36px);
  margin: 18px 18px 10px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 21px;
}

.role-dialog-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 390px;
  padding: 8px 18px 18px;
  overflow: auto;
}

.role-dialog-option {
  display: flex;
  min-width: 0;
  min-height: 42px;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b1118;
  cursor: pointer;
  font-weight: 600;
}

.role-dialog-option:has(input:checked) {
  border-color: rgba(137, 207, 240, 0.42);
  background: rgba(137, 207, 240, 0.08);
}

.role-dialog-option input {
  width: 17px;
  min-height: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--primary-strong);
}

.role-dialog-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.user-search-wrap {
  position: relative;
}

.user-results {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #111923;
  box-shadow: var(--shadow-lg);
}

.user-result {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.user-result:hover {
  background: rgba(137, 207, 240, 0.06);
}

.user-result-empty {
  display: block;
  padding: 11px 12px;
  color: var(--muted);
}

.color-picker {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1118;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-row input {
  min-width: 0;
  text-transform: uppercase;
}

.color-preview {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.17);
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}

.color-preset-label {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.color-presets button {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: var(--swatch);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.color-presets button:hover {
  border-color: #fff;
  transform: translateY(-1px) scale(1.06);
}

.save-bar {
  position: sticky;
  z-index: 25;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 24px;
  padding: 12px 13px 12px 19px;
  border: 1px solid rgba(137, 207, 240, 0.2);
  border-radius: 15px;
  background: #111923;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  contain: paint;
}

.save-bar span {
  color: var(--muted);
}

.legal-nav {
  display: flex;
  min-height: 48px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  color: #667686;
  font-size: 12px;
}

.legal-nav a:hover {
  color: var(--text-soft);
}

.legal-link-disabled {
  cursor: default;
  opacity: 0.42;
}

.flash-client {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.invalid {
  border-color: var(--red) !important;
}

@media (max-width: 980px) {
  .capability-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-feature {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .landing-feature-copy {
    max-width: 720px;
  }

  .configuration-panel {
    max-width: 720px;
  }

  .guild-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .available-guild-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-summary {
    grid-template-columns: 1fr 1fr;
  }

  .premium-includes,
  .license-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading p {
    text-align: left;
  }

  .purchase-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .license-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .license-row-actions {
    grid-column: 1 / -1;
  }

  .settings-heading .stats {
    width: 100%;
  }

  .limit-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .public-nav > a:not(.button) {
    display: none;
  }

  .form-grid,
  .limit-controls {
    grid-template-columns: 1fr;
  }

  .account-layout,
  .profile-role-form,
  .checkout-steps {
    grid-template-columns: 1fr;
  }

  .checkout-code-row,
  .license-row {
    grid-template-columns: 1fr;
  }

  .license-row .license-status {
    justify-self: start;
  }

  .license-row-actions {
    grid-column: auto;
    align-items: stretch;
    flex-direction: column;
  }

  .license-row-actions form,
  .license-row-actions .button {
    width: 100%;
  }

  .billing-price-options {
    width: 100%;
  }

  .billing-price-options > span {
    min-width: 0;
    flex: 1;
  }

  .premium-section-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .content-selector form {
    grid-template-columns: 1fr;
  }

  .content-editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .content-editor-actions .button {
    width: 100%;
  }

  .field-wide,
  .limit-controls > label:first-child {
    grid-column: auto;
  }

  .section-title {
    flex-direction: column;
  }

  .section-title p {
    text-align: left;
  }

  .save-bar span {
    display: none;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 0 17px;
  }

  .account-name {
    display: none;
  }

  .page,
  .landing,
  .narrow-page {
    width: min(100% - 24px, 1280px);
    padding-top: 36px;
  }

  .landing {
    padding-top: 0;
  }

  .landing-hero {
    padding: 60px 0 52px;
  }

  .landing-hero h1 {
    font-size: clamp(42px, 12vw, 57px);
  }

  .landing-hero > p {
    font-size: 16px;
  }

  .capability-rail {
    grid-template-columns: 1fr;
  }

  .landing-feature {
    margin-top: 72px;
  }

  .landing-feature-copy h2 {
    font-size: 34px;
  }

  .configuration-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .guild-grid {
    grid-template-columns: 1fr;
  }

  .billing-price-options {
    flex-direction: column;
  }

  .legal-details > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .operator-actions {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .role-dialog-list {
    grid-template-columns: 1fr;
  }

  .page-heading h1 {
    font-size: 34px;
  }

  .stats {
    width: 100%;
  }

  .stats > div {
    min-width: 0;
    flex: 1;
    padding: 10px;
  }

  .config-section,
  .setup-panel {
    padding: 20px;
  }

  .quick-actions form,
  .quick-actions button {
    width: 100%;
  }

  .landing-actions,
  .landing-actions .button {
    width: 100%;
  }

  .landing-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .action-toolbar {
    padding: 8px;
  }

  .section-nav {
    top: 8px;
  }

  .server-icon {
    width: 50px;
    height: 50px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .save-bar {
    bottom: 8px;
  }

  .save-bar .button {
    width: 100%;
  }

  .access-rule,
  .premium-grid {
    grid-template-columns: 1fr;
  }

  .access-permissions,
  .billing-summary,
  .premium-includes,
  .license-grid,
  .checkout-code-row {
    grid-template-columns: 1fr;
  }

  .profile-assignment {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-assignment > .profile-role,
  .profile-assignment > form {
    grid-column: 2;
    justify-self: start;
  }

  .license-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .license-details,
  .license-actions {
    grid-template-columns: 1fr;
  }

  .license-actions > .button {
    grid-column: auto;
  }

  .license-actions .button,
  .license-actions form {
    width: 100%;
  }
}
