:root {
  color-scheme: dark;
  --bg: #111215;
  --surface: #1a1c21;
  --surface-raised: #22252b;
  --surface-soft: #292c33;
  --border: #34373f;
  --text: #f5f6f8;
  --muted: #a7abb4;
  --orange: #f16436;
  --orange-hover: #ff784d;
  --discord: #5865f2;
  --green: #3ba55d;
  --yellow: #f0b232;
  --red: #ed4245;
  --radius: 14px;
  --motion-fast: 150ms;
  --motion-normal: 180ms;
  --motion-slow: 220ms;
  --motion-ease: cubic-bezier(0.2, 0.75, 0.25, 1);
  --motion-stagger: 35ms;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  min-height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}
button,
input,
select {
  font: inherit;
}
button,
select,
input,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--orange) 55%, transparent);
  outline-offset: 2px;
}

.landing-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 10%, rgb(241 100 54 / 12%), transparent 34rem), var(--bg);
}
.landing-shell {
  width: min(100%, 540px);
}
.landing-card {
  padding: clamp(28px, 6vw, 52px);
  text-align: center;
  background: rgb(26 28 33 / 94%);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgb(0 0 0 / 35%);
}
.landing-logo {
  border-radius: 28px;
  object-fit: cover;
}
.landing-card h1 {
  margin: 8px 0;
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1.05;
}
.landing-lead {
  margin: 20px 0 4px;
  font-weight: 700;
  font-size: 1.12rem;
}
.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 28px 0;
  list-style: none;
  text-align: left;
}
.feature-list li {
  padding: 12px;
  background: var(--surface-raised);
  border-radius: 10px;
}
.legal-consent {
  max-width: 410px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.legal-consent a,
.landing-footer a,
.account-legal-links a {
  color: #d7d9df;
  text-decoration-color: rgb(215 217 223 / 40%);
  text-underline-offset: 3px;
}
.legal-consent a:hover,
.landing-footer a:hover,
.account-legal-links a:hover {
  color: white;
}
.landing-footer {
  display: grid;
  gap: 8px;
  padding-top: 18px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.73rem;
  border-top: 1px solid var(--border);
}
.landing-footer-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 14px;
  background: #15171b;
  border-right: 1px solid var(--border);
}
.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 24px;
}
.brand-block img {
  border-radius: 13px;
  object-fit: cover;
}
.brand-block strong {
  display: block;
  font-size: 0.96rem;
}
.brand-block span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}
.nav-list {
  display: grid;
  gap: 5px;
}
.nav-item {
  position: relative;
  display: flex;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 11px 13px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease);
}
.nav-item::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -1px;
  width: 2px;
  content: '';
  background: var(--orange);
  border-radius: 999px;
  opacity: 0;
  transform: scaleY(0.55);
  transition:
    opacity var(--motion-fast) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease);
}
.nav-icon,
.button-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-icon {
  flex: 0 0 18px;
  transition:
    color var(--motion-fast) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease);
}
.nav-item.is-active {
  color: white;
  background: rgb(241 100 54 / 13%);
  border-color: rgb(241 100 54 / 28%);
}
.nav-item.is-active .nav-icon {
  color: var(--orange);
}
.nav-item.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}
.nav-item:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.nav-item:disabled:hover {
  color: var(--muted);
  background: transparent;
}
.account-block {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
  padding: 12px 8px 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
}
.avatar {
  border-radius: 50%;
  background: var(--surface-soft);
  object-fit: cover;
}
.account-copy {
  min-width: 0;
}
.account-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}
.account-copy strong {
  display: block;
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-legal-links {
  display: flex;
  grid-column: 1 / -1;
  gap: 12px;
  justify-content: center;
  font-size: 0.68rem;
}
.icon-button,
.menu-button {
  min-width: 36px;
  min-height: 36px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease);
}
.icon-button .button-icon,
.menu-button .button-icon {
  display: block;
  margin: auto;
}
.main-area {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 18px;
  align-items: end;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 42px);
  background: rgb(17 18 21 / 92%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.menu-button {
  display: none;
  align-self: center;
}
.guild-picker {
  min-width: 0;
  width: min(100%, 360px);
}
.guild-select-row {
  display: flex;
  gap: 9px;
  align-items: center;
}
.guild-icon {
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--surface-soft);
  object-fit: cover;
}
.guild-picker label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.connection-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-left: auto;
  align-self: center;
  padding: 6px 10px;
  color: #bceaca;
  font-size: 0.75rem;
  background: rgb(59 165 93 / 12%);
  border: 1px solid rgb(59 165 93 / 30%);
  border-radius: 999px;
}
.connection-pill::before {
  width: 7px;
  height: 7px;
  content: '';
  background: var(--green);
  border-radius: 50%;
}
.connection-pill.is-loading,
.connection-pill.is-degraded {
  color: #ffe0a2;
  background: rgb(240 178 50 / 12%);
  border-color: rgb(240 178 50 / 35%);
}
.connection-pill.is-loading::before,
.connection-pill.is-degraded::before {
  background: var(--yellow);
  animation: status-soft-pulse 1.6s ease-in-out infinite;
}
.connection-pill.is-offline {
  color: #ffc1c2;
  background: rgb(237 66 69 / 12%);
  border-color: rgb(237 66 69 / 35%);
}
.connection-pill.is-offline::before {
  background: var(--red);
}
.content-wrap {
  width: min(100%, 1220px);
  padding: clamp(24px, 4vw, 46px);
  margin: 0 auto;
  transition: opacity var(--motion-normal) var(--motion-ease);
}
.content-wrap.is-guild-switching {
  pointer-events: none;
  opacity: 0.18;
}
.content-wrap.motion-guild-enter {
  animation: guild-content-in var(--motion-normal) var(--motion-ease) both;
}
.install-onboarding {
  display: grid;
  min-height: min(680px, calc(100vh - 190px));
  place-items: center;
}
.install-onboarding.motion-panel-enter {
  animation: panel-in var(--motion-normal) var(--motion-ease) both;
}
.install-card {
  width: min(100%, 760px);
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 15%, rgb(88 101 242 / 13%), transparent 19rem),
    linear-gradient(145deg, rgb(241 100 54 / 10%), transparent 55%), var(--surface);
  border: 1px solid rgb(241 100 54 / 38%);
  border-radius: 20px;
  box-shadow: 0 26px 80px rgb(0 0 0 / 28%);
}
.install-card.is-success {
  border-color: rgb(59 165 93 / 48%);
}
.install-server {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 22px;
  background: rgb(12 13 16 / 48%);
  border-bottom: 1px solid var(--border);
}
.install-server-icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  color: white;
  font-size: 0.82rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--discord), #3943a7);
  border-radius: 14px;
}
.install-server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.install-server-copy {
  display: grid;
  min-width: 0;
}
.install-server-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.install-server-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.install-badge {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 10px;
  margin-left: auto;
  color: #ffd6c8;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgb(241 100 54 / 13%);
  border: 1px solid rgb(241 100 54 / 34%);
  border-radius: 999px;
}
.install-badge.is-pending,
.install-badge.is-delayed {
  color: #ffe1a7;
  background: rgb(240 178 50 / 12%);
  border-color: rgb(240 178 50 / 36%);
  animation: status-soft-pulse 1.6s ease-in-out infinite;
}
.install-badge.is-success {
  color: #bff0cb;
  background: rgb(59 165 93 / 13%);
  border-color: rgb(59 165 93 / 40%);
}
.install-card-body {
  padding: clamp(28px, 6vw, 52px);
}
.install-card-body h1 {
  max-width: 620px;
  margin: 8px 0 12px;
  font-size: clamp(1.7rem, 5vw, 2.65rem);
  line-height: 1.08;
}
.install-description {
  max-width: 620px;
  margin: 0;
  color: #e6e8ec;
  font-size: 1.02rem;
}
.install-detail {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.panel[hidden] {
  display: none;
}
.panel.motion-panel-enter {
  animation: panel-in var(--motion-normal) var(--motion-ease) both;
}
.page-heading,
.section-heading {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.page-heading {
  margin-bottom: 26px;
}
.page-heading h1 {
  margin: 2px 0 0;
  font-size: clamp(1.55rem, 4vw, 2.3rem);
  line-height: 1.15;
}
.page-description {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.eyebrow {
  margin: 0;
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.82rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.status-card,
.card,
.notice-card,
.item-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition:
    transform var(--motion-normal) var(--motion-ease),
    background-color var(--motion-normal) var(--motion-ease),
    border-color var(--motion-normal) var(--motion-ease),
    box-shadow var(--motion-normal) var(--motion-ease),
    opacity var(--motion-normal) var(--motion-ease);
}
.status-card {
  min-height: 128px;
  padding: 18px;
}
.status-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}
.status-card strong {
  display: block;
  margin-top: 14px;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}
.status-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}
.status-card.is-primary {
  background: linear-gradient(135deg, rgb(241 100 54 / 13%), var(--surface) 58%);
  border-color: rgb(241 100 54 / 42%);
}
.status-card.motion-card-enter {
  animation: card-in var(--motion-normal) var(--motion-ease) both;
  animation-delay: calc(var(--motion-order, 0) * var(--motion-stagger));
}
.motion-order-1 {
  --motion-order: 1;
}
.motion-order-2 {
  --motion-order: 2;
}
.motion-order-3 {
  --motion-order: 3;
}
.overview-notices {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}
.setup-banner,
.ready-banner,
.setup-checklist {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.setup-banner {
  border-color: rgb(240 178 50 / 42%);
}
.ready-banner {
  border-color: rgb(59 165 93 / 38%);
}
.ready-banner.is-newly-ready {
  animation: ready-in var(--motion-slow) var(--motion-ease) both;
}
.setup-banner strong,
.ready-banner strong,
.setup-banner span,
.ready-banner span {
  display: block;
}
.setup-banner span,
.ready-banner span {
  color: var(--muted);
  font-size: 0.82rem;
}
.setup-checklist {
  align-items: stretch;
  flex-direction: column;
}
.checklist-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.checklist-item {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  background: var(--surface-raised);
  border-radius: 8px;
  transition:
    color var(--motion-normal) var(--motion-ease),
    background-color var(--motion-normal) var(--motion-ease),
    transform var(--motion-normal) var(--motion-ease),
    opacity var(--motion-normal) var(--motion-ease);
}
.checklist-item.is-complete {
  color: #bceaca;
}
.checklist-item.is-newly-complete {
  animation: checklist-complete var(--motion-slow) var(--motion-ease) both;
}
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  background: var(--green);
  border-radius: 50%;
}
.status-dot.warning {
  background: var(--yellow);
}
.status-dot.is-degraded,
.status-dot.is-checking {
  animation: status-soft-pulse 1.6s ease-in-out infinite;
}
.status-dot.is-offline {
  background: var(--red);
}
.card,
.notice-card {
  padding: clamp(18px, 3vw, 26px);
}
.card h2,
.section-heading h2 {
  margin: 0 0 16px;
  font-size: 1rem;
}
.section-heading h2 + p {
  margin: -10px 0 16px;
}
.notice-card {
  margin-bottom: 18px;
  border-color: rgb(241 100 54 / 40%);
}
.notice-card h2 {
  margin-top: 0;
}
.split-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 26px;
  align-items: start;
}
.stack {
  display: grid;
  gap: 16px;
}
.stack h2 {
  margin-bottom: 0;
}
.item-list,
.result-list {
  display: grid;
  gap: 10px;
}
.result-list {
  margin-top: 14px;
}
.item-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 13px;
}
.item-row.motion-item-enter {
  animation: item-in var(--motion-normal) var(--motion-ease) both;
}
.item-row.motion-item-exit {
  pointer-events: none;
  animation: item-out var(--motion-normal) var(--motion-ease) both;
}
.item-list.motion-list-refresh,
.result-list.motion-list-refresh {
  animation: list-refresh var(--motion-fast) var(--motion-ease) both;
}
.item-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-soft);
}
.item-icon.placeholder {
  display: grid;
  place-items: center;
  color: var(--orange);
  font-weight: 800;
}
.item-copy {
  min-width: 0;
}
.item-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-copy span {
  color: var(--muted);
  font-size: 0.78rem;
}
.author-row {
  align-items: start;
}
.author-copy {
  display: grid;
  gap: 3px;
}
.author-channel-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 750;
}
.author-channel-field > span {
  color: var(--text);
  font-size: inherit;
}
.author-channel-select {
  max-width: 460px;
}
.author-channel-status {
  min-height: 1rem;
  color: var(--muted);
  font-size: 0.74rem;
}
.author-channel-status.error,
.author-channel-warning {
  color: #ffc1c2;
}
.author-channel-warning {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 5px;
  font-size: 0.76rem;
}
.author-channel-warning[hidden] {
  display: none;
}
.button-compact {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.74rem;
}
.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  align-items: center;
  margin-top: 4px;
}
.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  color: #ffb59d;
  font-size: 0.7rem;
  font-weight: 750;
  background: rgb(241 100 54 / 12%);
  border: 1px solid rgb(241 100 54 / 28%);
  border-radius: 999px;
}
.source-badge.author {
  color: #c9cdfd;
  background: rgb(88 101 242 / 12%);
  border-color: rgb(88 101 242 / 30%);
}
.managed-label {
  color: var(--muted);
  font-size: 0.76rem;
  text-align: right;
}
.count-badge {
  min-width: 28px;
  padding: 3px 8px;
  text-align: center;
  color: var(--orange);
  background: rgb(241 100 54 / 12%);
  border-radius: 999px;
}
.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.form-card {
  display: grid;
  gap: 26px;
}
.form-status,
.validation-message {
  min-height: 1.25rem;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.validation-message.error,
.form-status.error {
  color: #ffc1c2;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.field {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}
.field small,
fieldset > small {
  color: var(--muted);
  font-weight: 400;
}
input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: #121418;
  border: 1px solid var(--border);
  border-radius: 9px;
  transition:
    border-color var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease);
}
input:hover,
select:hover {
  border-color: #4b4f59;
}
fieldset {
  padding: 0;
  margin: 0;
  border: 0;
}
legend {
  margin-bottom: 12px;
  font-weight: 750;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.check-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.all-loaders {
  margin-bottom: 10px;
}
.loader-options.is-disabled {
  opacity: 0.48;
}
.loader-options {
  transition: opacity var(--motion-fast) var(--motion-ease);
}
.version-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.version-chip {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 8px;
  color: #e8e9ed;
  font-size: 0.75rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.version-chip button {
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.check-card {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    opacity var(--motion-fast) var(--motion-ease);
}
.check-card:has(input:checked) {
  background: rgb(241 100 54 / 10%);
  border-color: rgb(241 100 54 / 55%);
}
.check-card input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--orange);
}
.check-card small,
.toggle-list small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
.toggle-list {
  display: grid;
  gap: 10px;
}
.toggle-list > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px;
  background: var(--surface-raised);
  border-radius: 10px;
  transition: opacity var(--motion-fast) var(--motion-ease);
}
.toggle-list > label:has(input:disabled) {
  opacity: 0.5;
}
.switch {
  width: 42px;
  min-height: 22px;
  accent-color: var(--orange);
  transition: opacity var(--motion-fast) var(--motion-ease);
}
.inline-form {
  display: flex;
  gap: 8px;
}
.inline-form input {
  min-width: 0;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}
hr {
  height: 1px;
  margin: 22px 0;
  background: var(--border);
  border: 0;
}

.button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  color: white;
  font-weight: 750;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease),
    opacity var(--motion-fast) var(--motion-ease);
}
.button:not(:disabled):active,
.icon-button:not(:disabled):active,
.menu-button:not(:disabled):active {
  transform: scale(0.98);
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}
.button.is-loading {
  cursor: wait;
}
.button.is-loading::before {
  width: 13px;
  height: 13px;
  content: '';
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: button-spin 700ms linear infinite;
}
.refresh-button.is-loading::before {
  display: none;
}
.refresh-button.is-loading .refresh-icon {
  animation: button-spin 700ms linear infinite;
}
.button.is-success {
  border-color: rgb(59 165 93 / 55%);
}
.button-large {
  min-height: 48px;
  padding-inline: 22px;
}
.button-primary {
  background: var(--orange);
}
.button-secondary {
  background: var(--surface-soft);
  border-color: var(--border);
}
.button-danger {
  background: rgb(237 66 69 / 15%);
  border-color: rgb(237 66 69 / 40%);
}
.button-discord {
  background: var(--discord);
}
.full-width {
  width: 100%;
}

.automod-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}
.automod-permission-card {
  padding: clamp(22px, 4vw, 34px);
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgb(240 178 50 / 12%), var(--surface) 65%);
  border: 1px solid rgb(240 178 50 / 42%);
  border-radius: var(--radius);
}
.automod-permission-card h2 {
  margin: 0 0 8px;
}
.automod-permission-card p {
  max-width: 680px;
  margin: 0 0 18px;
  color: var(--muted);
}
.automod-status-grid {
  margin-bottom: 18px;
}
.automod-master-card,
.automod-card-heading,
.automod-switch-label,
.toggle-row,
.automod-save-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.automod-master-card h2,
.automod-card-heading h2 {
  margin: 0;
}
.automod-master-card p,
.automod-card-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.automod-switch-label {
  flex: 0 0 auto;
  font-weight: 800;
}
.automod-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.automod-rule-card,
.automod-keyword-card,
.automod-options-card {
  display: grid;
  gap: 16px;
}
.automod-card-heading {
  align-items: flex-start;
}
.automod-rule-status {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.automod-rule-status.is-active {
  color: #bff0cb;
  background: rgb(59 165 93 / 12%);
  border-color: rgb(59 165 93 / 38%);
}
.automod-rule-status.is-warning {
  color: #ffe0a2;
  background: rgb(240 178 50 / 12%);
  border-color: rgb(240 178 50 / 38%);
}
.automod-rule-status.is-error {
  color: #ffc1c2;
  background: rgb(237 66 69 / 12%);
  border-color: rgb(237 66 69 / 38%);
}
.toggle-row {
  padding: 13px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.toggle-row span {
  min-width: 0;
}
.toggle-row strong,
.toggle-row small {
  display: block;
}
.toggle-row small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
}
.toggle-row .switch {
  flex: 0 0 42px;
}
.automod-chip-editor {
  display: grid;
  gap: 9px;
}
.automod-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 30px;
}
.automod-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  max-width: 100%;
  padding: 5px 8px 5px 10px;
  color: #f0f1f4;
  font-size: 0.76rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.automod-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.automod-chip button {
  display: grid;
  width: 22px;
  min-height: 22px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.automod-rule-actions {
  min-height: 1px;
}
.automod-rule-actions .button {
  width: 100%;
}
.automod-options-card select[multiple] {
  min-height: 142px;
}
.automod-save-actions {
  justify-content: flex-end;
}
.automod-save-actions .form-status {
  margin-right: auto;
}
.segmented-control {
  display: inline-flex;
  max-width: 100%;
  padding: 3px;
  margin-bottom: 12px;
  background: #121418;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.segmented-control button {
  min-height: 34px;
  padding: 6px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease);
}
.segmented-control button.is-active {
  color: white;
  background: var(--surface-soft);
}
.compact-field {
  margin-bottom: 12px;
}
.show-more {
  margin-top: 10px;
}
.resolved-author {
  padding: 14px;
  background: var(--surface-raised);
  border: 1px solid rgb(88 101 242 / 35%);
  border-radius: 10px;
}
.resolved-author strong,
.resolved-author span {
  display: block;
}
.resolved-author span {
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.preview-controls {
  display: flex;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}
.preview-controls .field {
  flex: 1;
}
.discord-stage {
  padding: clamp(16px, 4vw, 34px);
  background: #313338;
  border-radius: var(--radius);
}
.discord-embed {
  max-width: 660px;
  padding: 16px 18px;
  background: #2b2d31;
  border-left: 4px solid var(--orange);
  border-radius: 4px;
  box-shadow: 0 8px 30px rgb(0 0 0 / 18%);
}
.discord-author {
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 700;
}
.discord-title-row {
  display: flex;
  gap: 16px;
  align-items: start;
}
.discord-title-row h2 {
  margin: 0;
  font-size: 1.05rem;
}
.discord-thumbnail {
  width: 68px;
  height: 68px;
  margin-left: auto;
  border-radius: 10px;
  object-fit: cover;
}
.discord-description {
  margin: 14px 0;
  color: #dbdee1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.discord-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.discord-field strong,
.discord-field span {
  display: block;
}
.discord-field strong {
  font-size: 0.78rem;
}
.discord-field span {
  color: #dbdee1;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}
.discord-footer {
  margin-top: 16px;
  color: #b5bac1;
  font-size: 0.7rem;
}
.discord-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 660px;
  margin-top: 10px;
}
.discord-button {
  padding: 8px 13px;
  color: #dbdee1;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  background: #4e5058;
  border-radius: 4px;
}
.discord-stage.motion-preview-enter {
  animation: preview-in var(--motion-slow) var(--motion-ease) both;
}

.skeleton-grid,
.skeleton-list {
  display: grid;
  gap: 10px;
}
.skeleton-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-column: 1 / -1;
}
.skeleton-card,
.skeleton-row {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.skeleton-card {
  min-height: 128px;
}
.skeleton-row {
  min-height: 72px;
}
.skeleton-card::after,
.skeleton-row::after {
  display: block;
  width: 46%;
  height: 100%;
  content: '';
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 3%), transparent);
  animation: skeleton-soft 1.4s ease-in-out infinite;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 16px;
  color: white;
  background: #25282e;
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: 10px;
  box-shadow: 0 14px 42px rgb(0 0 0 / 40%);
}
.toast.motion-toast-enter {
  animation: toast-in var(--motion-slow) var(--motion-ease) both;
}
.toast.motion-toast-exit {
  animation: toast-out var(--motion-slow) var(--motion-ease) both;
}
.toast.error {
  border-left-color: var(--red);
}
.toast.warning {
  border-left-color: var(--yellow);
}
.toast.info {
  border-left-color: var(--discord);
}
.confirm-dialog {
  width: min(92vw, 430px);
  padding: 24px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.confirm-dialog.is-opening {
  animation: dialog-in var(--motion-normal) var(--motion-ease) both;
}
.confirm-dialog.is-closing {
  animation: dialog-out var(--motion-normal) var(--motion-ease) both;
}
.confirm-dialog::backdrop {
  background: rgb(0 0 0 / 65%);
  backdrop-filter: blur(2px);
}
.confirm-dialog.is-opening::backdrop {
  animation: backdrop-in var(--motion-normal) var(--motion-ease) both;
}
.confirm-dialog.is-closing::backdrop {
  animation: backdrop-out var(--motion-normal) var(--motion-ease) both;
}
.confirm-dialog h2 {
  margin-top: 0;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (hover: hover) and (pointer: fine) {
  .nav-item:not(:disabled):hover {
    color: var(--text);
    background: var(--surface);
  }
  .nav-item:not(:disabled):hover .nav-icon {
    transform: translateX(1px);
  }
  .icon-button:hover,
  .menu-button:hover {
    color: white;
    background: var(--surface-soft);
    border-color: #50545f;
  }
  .status-card:hover,
  .card:hover,
  .notice-card:hover {
    background-color: color-mix(in srgb, var(--surface) 94%, white);
    border-color: #464a54;
    box-shadow: 0 10px 28px rgb(0 0 0 / 12%);
    transform: translateY(-2px);
  }
  .button:hover {
    transform: translateY(-1px);
  }
  .button-primary:hover {
    background: var(--orange-hover);
  }
  .button-secondary:hover {
    border-color: #50545f;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes guild-content-in {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes ready-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes checklist-complete {
  from {
    opacity: 0.72;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes item-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes item-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(6px);
  }
}
@keyframes list-refresh {
  from {
    opacity: 0.72;
  }
  to {
    opacity: 1;
  }
}
@keyframes preview-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(8px);
  }
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes dialog-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.97);
  }
}
@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes status-soft-pulse {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}
@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes skeleton-soft {
  0%,
  100% {
    opacity: 0.25;
    transform: translateX(-110%);
  }
  50% {
    opacity: 0.6;
    transform: translateX(220%);
  }
}

@media (max-width: 980px) {
  .status-grid,
  .skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .check-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .split-layout {
    grid-template-columns: 1fr;
  }
  .automod-rule-grid {
    grid-template-columns: 1fr;
  }
  .checklist-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    width: min(86vw, 290px);
    transform: translateX(-105%);
    transition: transform var(--motion-normal) var(--motion-ease);
    box-shadow: 20px 0 60px rgb(0 0 0 / 45%);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .menu-button {
    display: inline-grid;
    place-items: center;
  }
  .topbar {
    align-items: center;
    padding-inline: 14px;
  }
  .guild-picker {
    flex: 1 1 auto;
    min-width: 0;
  }
  .connection-pill {
    display: none;
  }
  .content-wrap {
    padding: 24px 16px 40px;
  }
  .form-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }
  .check-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .preview-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .setup-banner,
  .ready-banner {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .landing-body {
    padding: 12px;
  }
  .landing-card {
    padding: 24px 18px;
  }
  .feature-list,
  .status-grid,
  .skeleton-grid,
  .check-grid.compact {
    grid-template-columns: 1fr;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .install-server {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .install-badge {
    margin-left: 62px;
  }
  .install-actions {
    flex-direction: column;
  }
  .install-actions .button {
    width: 100%;
  }
  .automod-master-card,
  .automod-card-heading,
  .automod-save-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .automod-switch-label {
    justify-content: flex-start;
  }
  .toggle-row {
    gap: 12px;
  }
  .automod-save-actions .button,
  .automod-chip-editor .inline-form .button {
    width: 100%;
  }
  .inline-form,
  .dialog-actions {
    flex-direction: column;
  }
  .item-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .item-row > .button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .managed-label {
    grid-column: 1 / -1;
    text-align: left;
  }
  .checklist-items {
    grid-template-columns: 1fr;
  }
  .discord-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .motion-panel-enter,
  .motion-guild-enter,
  .motion-card-enter,
  .is-newly-ready,
  .is-newly-complete,
  .motion-item-enter,
  .motion-item-exit,
  .motion-list-refresh,
  .motion-preview-enter,
  .motion-toast-enter,
  .motion-toast-exit,
  .confirm-dialog.is-opening,
  .confirm-dialog.is-closing,
  .status-dot.is-degraded,
  .status-dot.is-checking,
  .connection-pill.is-loading::before,
  .connection-pill.is-degraded::before,
  .button.is-loading::before,
  .refresh-button.is-loading .refresh-icon,
  .skeleton-card::after,
  .skeleton-row::after {
    animation: none !important;
  }
  .button:not(:disabled):active,
  .icon-button:not(:disabled):active,
  .menu-button:not(:disabled):active,
  .status-card:hover,
  .card:hover,
  .notice-card:hover,
  .button:hover,
  .nav-item:not(:disabled):hover .nav-icon {
    transform: none !important;
  }
}
