:root {
  --bg: #f4f7fb;
  --bg-2: #eaf0f9;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --surface-3: #eff5ff;
  --line: #d7e1ef;
  --line-strong: #b8c8df;
  --text: #122235;
  --muted: #5b6f87;
  --soft: #31455d;
  --accent: #0ea5a3;
  --accent-strong: #0b8b89;
  --accent-soft: rgba(14, 165, 163, 0.14);
  --warning: #b45309;
  --danger: #dc2626;
  --success: #15803d;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-sm: 0 8px 20px rgba(18, 34, 53, 0.06);
  --shadow-md: 0 16px 34px rgba(18, 34, 53, 0.1);
  --mono: "JetBrains Mono", monospace;
  --sans: "Outfit", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 6% 0%, rgba(14, 165, 163, 0.15), transparent 24%),
    radial-gradient(circle at 94% 4%, rgba(14, 165, 163, 0.11), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

a {
  color: inherit;
}

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

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(184, 200, 223, 0.8);
  background: rgba(248, 251, 255, 0.9);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
  box-shadow: var(--shadow-sm);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand-copy strong {
  display: block;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-actions,
.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user span {
  color: var(--soft);
  font-weight: 500;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: #dbe5f4;
}

.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.button {
  color: #f8feff;
  font-weight: 600;
  background: linear-gradient(180deg, #11b7b4 0%, #0d9b99 100%);
  border-color: rgba(11, 139, 137, 0.7);
  box-shadow: 0 8px 18px rgba(14, 165, 163, 0.22);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #14c2bf 0%, #0fa9a7 100%);
}

.ghost-button {
  color: var(--soft);
  background: #ffffff;
  border-color: var(--line);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.button:focus-visible,
.ghost-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(14, 165, 163, 0.32);
  outline-offset: 2px;
}

.page {
  max-width: 1380px;
  margin: 0 auto;
  padding: 22px;
}

.landing {
  display: grid;
  gap: 20px;
  padding-top: 28px;
}

.hero-panel,
.panel,
.table-panel,
.command-section,
.settings-section,
.overview-grid > section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.hero-panel,
.panel,
.command-section,
.settings-section,
.overview-grid > section {
  padding: 22px;
}

.hero-panel {
  display: grid;
  gap: 20px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.72rem;
}

.hero-panel h1,
.page-heading h1,
.workspace-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero-panel p,
.page-heading p,
.workspace-header p,
.section-intro {
  margin: 0;
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.6;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.kpi-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.84rem;
  color: var(--muted);
}

.kpi-card strong {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.feature-list,
.stats-list,
.metadata-list,
.detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.feature-list li,
.stat-row,
.metadata-list li,
.detail-list li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.feature-list strong,
.metadata-list strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.feature-list span,
.metadata-list span,
.detail-list span,
.empty-note,
.help-note {
  color: var(--muted);
}

.stats-table,
.server-table,
.option-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table th,
.stats-table td,
.option-table th,
.option-table td,
.server-table th,
.server-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.stats-table th,
.option-table th,
.server-table th {
  color: var(--muted);
  font-weight: 500;
  background: var(--surface-2);
}

.stats-table tr:last-child td,
.option-table tr:last-child td,
.server-table tr:last-child td {
  border-bottom: none;
}

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

.server-table-wrap,
.option-table-wrap,
.code-block {
  overflow-x: auto;
}

.server-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}

.server-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #d9e5f6;
}

.server-avatar-fallback,
.guild-icon-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-strong);
}

.status-pill,
.inline-code,
.setting-token,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.84rem;
  color: var(--soft);
}

.status-pill.is-accent,
.chip.is-accent {
  border-color: rgba(14, 165, 163, 0.45);
  background: var(--accent-soft);
  color: #0b6665;
}

.status-pill.is-warning {
  border-color: rgba(180, 83, 9, 0.34);
  background: rgba(245, 158, 11, 0.14);
  color: #7a3f08;
}

.status-pill.is-danger {
  border-color: rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.1);
  color: #9a1e1e;
}

.inline-code,
.code-block {
  font-family: var(--mono);
  letter-spacing: -0.01em;
}

.workspace-header {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.workspace-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.workspace-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workspace-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-nav a {
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
}

.workspace-nav a:hover,
.workspace-nav a:focus-visible {
  color: var(--accent-strong);
  border-color: rgba(14, 165, 163, 0.45);
  background: var(--accent-soft);
}

.guild-mark {
  display: flex;
  align-items: center;
  gap: 16px;
}

.guild-icon,
.guild-icon-fallback {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-3);
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.stack {
  display: grid;
  gap: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading h2,
.section-heading h3,
.subsection h3 {
  margin: 0;
  font-size: 1.08rem;
}

.subsection {
  display: grid;
  gap: 12px;
}

.subsection + .subsection {
  margin-top: 22px;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.settings-section {
  margin-bottom: 18px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field.is-disabled {
  opacity: 0.64;
}

.field label,
.field legend {
  color: var(--soft);
  font-weight: 500;
}

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

.field input[type="text"],
.field input[type="number"],
.field input[type="color"],
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.field input[type="color"] {
  padding: 6px;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.toggle-copy strong {
  display: block;
  margin-bottom: 4px;
}

.toggle-copy span {
  color: var(--muted);
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
  display: inline-block;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #b8c8df;
  transition: background-color 160ms ease;
}

.switch span::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(18, 34, 53, 0.2);
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: #0ea5a3;
}

.switch input:checked + span::before {
  transform: translateX(22px);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-row .ghost-button {
  min-height: 34px;
  min-width: 54px;
  padding: 0 12px;
}

.checklist-grid,
.race-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.checklist-card,
.race-role-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.checklist-card label,
.race-role-card label {
  display: flex;
  gap: 10px;
  align-items: start;
  cursor: pointer;
}

.checklist-card input[type="checkbox"] {
  margin-top: 2px;
}

.checklist-copy strong {
  display: block;
  margin-bottom: 4px;
}

.checklist-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.race-role-card {
  display: grid;
  gap: 8px;
}

.settings-actions {
  position: sticky;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(8px);
}

.save-status {
  color: var(--muted);
  font-weight: 500;
}

.save-status.is-success {
  color: var(--success);
}

.save-status.is-error {
  color: var(--danger);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 220px auto;
  gap: 12px;
  margin: 16px 0 18px;
}

.category-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-switcher button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--soft);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.category-switcher button.is-active,
.category-switcher button:hover,
.category-switcher button:focus-visible {
  border-color: rgba(14, 165, 163, 0.46);
  background: var(--accent-soft);
  color: #0b6665;
}

.command-category {
  margin-top: 22px;
}

.command-category:first-of-type {
  margin-top: 0;
}

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

.command-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
}

.command-card summary {
  list-style: none;
  cursor: pointer;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.command-card summary::-webkit-details-marker {
  display: none;
}

.command-card[open] {
  border-color: rgba(14, 165, 163, 0.38);
  box-shadow: 0 10px 22px rgba(14, 165, 163, 0.11);
}

.command-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.command-header h3 {
  margin: 0;
  font-size: 1.02rem;
}

.command-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.command-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.command-body {
  padding: 0 16px 16px;
  display: grid;
  gap: 16px;
}

.code-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f9ff;
  font-size: 0.88rem;
}

.code-block code {
  white-space: pre-wrap;
}

.depth-1 {
  padding-left: 24px !important;
}

.depth-2 {
  padding-left: 40px !important;
}

.depth-3 {
  padding-left: 56px !important;
}

.command-empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-2);
}

.footer-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .overview-grid,
  .settings-grid,
  .checklist-grid,
  .race-role-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 880px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .topbar,
  .workspace-main,
  .settings-actions,
  .page-heading {
    align-items: start;
    flex-direction: column;
  }

  .settings-actions {
    position: static;
  }
}

@media (max-width: 640px) {
  .page,
  .topbar {
    padding: 16px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .server-name {
    min-width: 220px;
  }

  .command-header {
    flex-direction: column;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
