:root {
  color-scheme: dark;
  --ink: #f2f2eb;
  --muted: #929894;
  --faint: #5c6461;
  --surface: #191c1c;
  --line: #343a38;
  --line-soft: #292f2d;
  --coral: #ff715b;
  --mint: #b6f4ce;
  --amber: #f5c66d;
  font-family: "Bahnschrift", "Avenir Next", "Segoe UI", sans-serif;
  background: var(--surface);
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--surface);
  background-size: 72px 100%;
}

.topbar {
  height: 64px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  background: rgb(25 28 28 / 88%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.brand-light { color: #aab1ad; font-weight: 500; }
.brand-mark { display: block; width: 24px; height: 24px; flex: none; }

.topbar-tools, .support-links { display: flex; align-items: center; }
.topbar-tools { gap: 24px; }
.support-links { gap: 8px; }
.support-label {
  margin-right: 3px;
  color: var(--muted);
  font: 10px ui-monospace, "SFMono-Regular", Consolas, monospace;
  white-space: nowrap;
}
.support-link {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: background-color 120ms, opacity 120ms;
}
.support-link:hover { background: rgb(255 255 255 / 8%); }
.support-link:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.support-logo { display: block; width: 22px; height: 22px; object-fit: contain; }
.support-logo-kofi { width: 27px; height: 22px; }
.download-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 3px;
  background: var(--coral);
  color: #191c1c;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms;
}
.download-link:hover { background: var(--mint); }
.download-link:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

.connection {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.connection-dot, .footer-indicator i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 11px rgb(245 198 109 / 55%);
}

.connection[data-state="connected"] .connection-dot { background: var(--mint); box-shadow: 0 0 11px rgb(182 244 206 / 55%); }
.connection[data-state="disconnected"] .connection-dot { background: var(--coral); box-shadow: 0 0 11px rgb(255 113 91 / 45%); }

main { max-width: 1040px; margin: 0 auto; padding: 72px 36px 24px; }
.no-token .parameter-count, .no-token .parameter-section { display: none; }
.service-description {
  max-width: 680px;
  margin-top: 8px;
  padding-top: 27px;
  border-top: 1px solid var(--line);
  animation: rise-in 420ms ease-out both;
}
.service-description[hidden] { display: none; }
.service-description h2 { max-width: 540px; margin: 0; font-size: 30px; line-height: 1.12; font-weight: 620; }
.service-description > p:last-child { max-width: 620px; margin: 16px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }

.heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 36px;
  animation: rise-in 420ms ease-out both;
}

.eyebrow, .count-label, .list-head, .page-footer {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 1px;
}

.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--mint); }
.eyebrow-line { width: 23px; height: 1px; background: var(--coral); }
h1 { margin: 0; font-size: 40px; line-height: 1.05; font-weight: 650; }
.subtitle { margin: 11px 0 0; color: var(--muted); font-size: 14px; }
.parameter-count { display: flex; align-items: baseline; gap: 10px; padding-bottom: 3px; }
.count-value { color: var(--coral); font-size: 26px; font-variant-numeric: tabular-nums; font-weight: 600; }

.parameter-section { border-top: 1px solid var(--line); }
.list-head, .parameter-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(260px, 1.2fr);
  align-items: center;
  column-gap: 28px;
}
.list-head { min-height: 42px; border-bottom: 1px solid var(--line-soft); }
.list-head span:last-child { padding-left: 1px; }
.parameter-row {
  min-height: 84px;
  border-bottom: 1px solid var(--line-soft);
  animation: row-in 320ms ease-out both;
}
.parameter-meta { min-width: 0; display: flex; align-items: center; gap: 12px; }
.parameter-name { overflow-wrap: anywhere; font-size: 15px; font-weight: 570; }
.type-label { flex: none; color: var(--faint); font: 10px ui-monospace, "SFMono-Regular", Consolas, monospace; text-transform: uppercase; }
.control { min-width: 0; display: flex; align-items: center; gap: 14px; }
.current-value { min-width: 48px; color: var(--mint); font: 12px ui-monospace, "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; text-align: right; }

button, input { font: inherit; }
button { cursor: pointer; }
.bool-button {
  min-width: 104px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #222827;
  color: #b4bbb7;
  font: 11px ui-monospace, "SFMono-Regular", Consolas, monospace;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.bool-button[aria-pressed="true"] { border-color: var(--mint); background: rgb(182 244 206 / 10%); color: var(--mint); }
.range-control { flex: 1; accent-color: var(--coral); min-width: 80px; height: 4px; cursor: pointer; }
.number-input, .text-input {
  width: min(170px, 50%);
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 10px;
  outline: none;
  background: #202524;
  color: var(--ink);
  font: 13px ui-monospace, "SFMono-Regular", Consolas, monospace;
}
.number-input:focus, .text-input:focus { border-color: var(--mint); }
.set-button {
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--coral);
  border-radius: 3px;
  background: transparent;
  color: var(--coral);
  font: 10px ui-monospace, "SFMono-Regular", Consolas, monospace;
  transition: color 120ms, background 120ms;
}
.set-button:hover { background: var(--coral); color: #191c1c; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
button:disabled, input:disabled { cursor: not-allowed; opacity: .45; }

.empty-state { min-height: 180px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state p { margin: 12px 0 0; font-size: 13px; }
.empty-glyph { color: var(--coral); font: 700 18px ui-monospace, monospace; }
.page-footer { display: flex; justify-content: space-between; gap: 14px; padding-top: 22px; color: var(--faint); font-size: 9px; }
.footer-indicator { display: inline-flex; align-items: center; gap: 8px; }
.footer-indicator i { width: 5px; height: 5px; background: var(--mint); box-shadow: none; }

@keyframes rise-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes row-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 620px) {
  .topbar { height: auto; min-height: 58px; padding: 8px 14px; gap: 10px; }
  .brand { gap: 7px; font-size: 11px; }
  .topbar-tools { gap: 10px; }
  .support-links { gap: 5px; }
  .support-link { width: 30px; height: 32px; }
  .support-logo { width: 20px; height: 20px; }
  .support-logo-kofi { width: 24px; height: 20px; }
  .support-logo-patreon { width: 24px; height: 20px; }
  .download-link { min-height: 32px; padding: 0 9px; font-size: 10px; }
  #connection-label { display: none; }
  main { padding: 48px 18px 20px; }
  .heading { align-items: start; padding-bottom: 27px; }
  h1 { font-size: 32px; }
  .service-description { padding-top: 21px; }
  .service-description h2 { font-size: 26px; }
  .service-description > p:last-child { font-size: 14px; }
  .parameter-count { flex-direction: column; align-items: end; gap: 2px; padding-top: 3px; }
  .count-value { font-size: 22px; }
  .list-head, .parameter-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .list-head { min-height: 34px; }
  .list-head span:last-child { display: none; }
  .parameter-row { padding: 16px 0 17px; gap: 13px; }
  .control { padding-left: 0; }
  .type-label { margin-left: auto; }
  .current-value { min-width: 42px; }
  .page-footer { font-size: 8px; }
}

@media (max-width: 420px) {
  .support-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}