:root {
  --bg: #0c1722;
  --panel: #101f2d;
  --surface: #142636;
  --line: #263a4d;
  --line-2: #2e465d;
  --text: #e6edf3;
  --muted: #9aafc0;
  --accent: #7da9d6;
  --accent-ink: #0f1b28;
  --danger: #e76464;
  --focus: 0 0 0 2px rgba(125, 169, 214, 0.45);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #3a556f #182736;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #182736;
}

*::-webkit-scrollbar-thumb {
  background: #3a556f;
  border: 2px solid #182736;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

.page-shell {
  width: min(800px, calc(100vw - 24px));
  margin: 24px auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #122435;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
}

.brand img {
  height: 28px;
  width: auto;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
}

.pill-link:hover,
.pill-link.active {
  color: var(--text);
  background: var(--line-2);
  border-color: var(--accent);
}

.hero {
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  color: var(--text);
}

.hero p {
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 600px;
}

.meta {
  margin-top: 12px;
  color: var(--accent);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.content {
  display: grid;
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  padding: 18px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.setting {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 31, 45, 0.45);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

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

.setting-sub {
  margin-top: 8px;
  background: rgba(16, 31, 45, 0.35);
}

.setting-stacked {
  align-items: flex-start;
  flex-direction: column;
}

.setting-copy {
  display: grid;
  gap: 4px;
}

.setting-title {
  font-size: 14px;
  font-weight: 650;
}

.setting-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 66ch;
}

.setting-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 84px;
}

.setting-control.wide {
  width: 100%;
  justify-content: flex-start;
  min-width: 0;
}

.field-stack {
  display: grid;
  gap: 6px;
  width: min(240px, 100%);
}

.field-stack.wide {
  width: 100%;
}

.field-stack input[type="number"],
.field-stack input[type="url"],
.field-stack input[type="text"] {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #122536;
  color: var(--text);
  padding: 10px 12px;
}

.field-stack input:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.field-feedback {
  min-height: 16px;
  font-size: 12px;
  color: var(--muted);
}

.field-feedback.error {
  color: var(--danger);
}

.is-hidden {
  display: none !important;
}

/* Switch (matches your theme but looks cleaner) */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #0f1f2d;
  border: 1px solid var(--line-2);
  position: relative;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.16s ease, background 0.16s ease;
}

.switch input:checked+span {
  background: rgba(125, 169, 214, 0.22);
  border-color: rgba(125, 169, 214, 0.45);
}

.switch input:checked+span::after {
  transform: translateX(22px);
  background: var(--accent);
}

.switch input:focus-visible+span {
  box-shadow: var(--focus);
}

/* Accordion */
.accordion {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 31, 45, 0.35);
  overflow: hidden;
}

.accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 12px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.accordion summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 14px;
  transform: translateY(-1px);
}

.accordion[open] summary::after {
  content: "▴";
}

.accordion-body {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.accordion-body p,
.accordion-body li {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.accordion-body ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.accordion-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 31, 45, 0.45);
  color: var(--text);
}

.warning {
  color: #f5c983;
}

/* Sticky actions */
.actions {
  position: sticky;
  bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 31, 45, 0.92);
  backdrop-filter: blur(6px);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-ghost {
  background: rgba(16, 31, 45, 0.5);
  border-color: var(--line);
}

/* Toast */
.toast {
  position: fixed;
  right: 24px;
  bottom: 18px;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #143048;
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: #3d1e24;
  border-color: #5f2a33;
}

@media (max-width: 720px) {
  .page-shell {
    width: calc(100vw - 14px);
    margin: 7px auto;
    padding: 10px;
  }

  .page-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .top-links {
    justify-content: center;
  }

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

  .setting-control {
    width: 100%;
    justify-content: flex-start;
  }

  .actions {
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
  }

  .toast {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}