:root {
  --bg: #08090c;
  --surface: #0e1014;
  --surface-2: #14161c;
  --border: #1f232b;
  --text: #e8eaef;
  --muted: #9aa1ad;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1b1d3a;
  --on-accent: #08090c;
  --good: #4ade80;
  --good-soft: #0d1f14;
  --warn: #fbbf24;
  --warn-soft: #221b0c;
  --bad: #f87171;
  --bad-soft: #261112;
  --info: #38bdf8;
  --info-soft: #0b1c28;
  --chart-a: #818cf8;
  --chart-b: #2dd4bf;
  --chart-c: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --ring: color-mix(in srgb, var(--accent) 35%, transparent);
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}


*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(1200px 500px at 50% -200px, color-mix(in srgb, var(--accent) 9%, transparent), transparent);
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.4em;
}
h1 {
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1rem;
}
p {
  margin: 0 0 1em;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.05em 0.4em;
}
.truncate {
  display: inline-block;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.center {
  text-align: center;
}
.break {
  word-break: break-all;
}
.inline {
  display: inline;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}
.container.wide {
  max-width: 1320px;
}

main.container {
  flex: 1;
  padding-top: 28px;
  padding-bottom: 48px;
}

/* Top bar */
.topbar {
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--chart-b));
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a:not(.button),
.link-button {
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.93rem;
}
.nav a:not(.button):hover,
.link-button:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.nav a.active {
  color: var(--text);
  background: var(--surface-2);
}
.nav a.button {
  margin-left: 6px;
  padding: 6px 14px;
}
.nav a.button-discord {
  margin: 0 6px 0 0;
  background: #5865f2;
  color: #fff;
}
.nav a.button-discord:hover {
  background: #4752c4;
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, #5865f2 35%, transparent);
}
.link-button {
  background: none;
  border: 0;
  cursor: pointer;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  font-size: 0.85rem;
}
.footer .container {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 0.93rem;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.button:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
  text-decoration: none;
  box-shadow: 0 0 0 4px var(--ring);
}
.button:active {
  transform: translateY(1px);
}
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.copy:focus-visible,
.link-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.button-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.button-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: color-mix(in srgb, var(--muted) 35%, var(--border));
  box-shadow: none;
}
.button-danger {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 30%, transparent);
}
.button-danger:hover {
  background: var(--bad);
  color: var(--on-accent);
  border-color: var(--bad);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 25%, transparent);
}
.button-small {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}
.button-block {
  width: 100%;
}

.copy {
  font: inherit;
  font-size: 0.75rem;
  font-family: var(--font);
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 6px;
}
.copy:hover {
  color: var(--text);
}
.copy-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
}

/* Cards and layout */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 55%, var(--surface)), var(--surface) 120px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}
.grid > .card {
  margin-bottom: 0;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 960px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 420px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head h1 {
  margin: 0;
}
.page-head p {
  margin: 4px 0 0;
}
.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Stats */
.stat {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 60%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.stat-value .badge {
  font-size: 0.9rem;
}
.stat-hint {
  color: var(--muted);
  font-size: 0.85rem;
}
.stat-good {
  box-shadow: inset 0 2px 0 var(--good), var(--shadow);
}
.stat-info {
  box-shadow: inset 0 2px 0 var(--info), var(--shadow);
}
.stat-warn {
  box-shadow: inset 0 2px 0 var(--warn), var(--shadow);
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
}
.badge::first-letter {
  text-transform: uppercase;
}
.badge-good {
  background: var(--good-soft);
  color: var(--good);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 22%, transparent);
}
.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 22%, transparent);
}
.badge-bad {
  background: var(--bad-soft);
  color: var(--bad);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 22%, transparent);
}
.badge-info {
  background: var(--info-soft);
  color: var(--info);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 22%, transparent);
}
.badge-neutral {
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--border);
}

/* Flash */
.flash {
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.flash-success {
  background: var(--good-soft);
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 25%, transparent);
}
.flash-error {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 25%, transparent);
}
.flash-info {
  background: var(--info-soft);
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 25%, transparent);
}

/* Alerts */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: var(--bad-soft);
  border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent);
}
.alert strong {
  color: var(--bad);
}
.notice {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--info-soft);
  color: var(--muted);
  border: 1px solid color-mix(in srgb, var(--info) 20%, transparent);
  font-size: 0.88rem;
}
meter.share {
  width: 70px;
  height: 6px;
  vertical-align: middle;
  border-radius: 999px;
  background: var(--surface-2);
}
meter.share::-webkit-meter-bar {
  background: var(--surface-2);
  border: 0;
  border-radius: 999px;
  height: 6px;
}
meter.share::-webkit-meter-optimum-value {
  background: var(--accent);
  border-radius: 999px;
}
meter.share::-moz-meter-bar {
  background: var(--accent);
  border-radius: 999px;
}

/* Forms */
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-label {
  font-weight: 500;
  font-size: 0.9rem;
}
.field-hint {
  color: var(--muted);
  font-size: 0.8rem;
}
input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--muted) 35%, var(--border));
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
textarea {
  font-family: var(--mono);
  font-size: 0.88rem;
  resize: vertical;
}
.notes-cell {
  width: 45%;
  min-width: 260px;
  white-space: normal;
}
.release-notes {
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 6.5em;
  overflow-y: auto;
  color: var(--muted);
}
.keys-box {
  min-height: 90px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar input {
  flex: 1 1 220px;
  width: auto;
}
.toolbar select {
  flex: 0 1 160px;
  width: auto;
}

.action-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}
.actions-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.actions-grid .action-form + .action-form {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.btn-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
}
.btn-stack .btn-stack {
  margin-top: 0;
}
.section-gap {
  margin-top: 20px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.inline-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 180px;
  font-size: 0.85rem;
  color: var(--muted);
}
.inline-field input {
  padding: 6px 10px;
}

/* Key-value list */
.kv {
  margin: 0 0 16px;
  display: grid;
  gap: 0;
}
.kv > div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.kv > div:last-child {
  border-bottom: 0;
}
.kv dt {
  color: var(--muted);
  font-size: 0.88rem;
}
.kv dd {
  margin: 0;
  min-width: 0;
}
@media (max-width: 520px) {
  .kv > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Tables */
.table-wrap {
  overflow: auto;
  max-height: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}
th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tbody tr {
  transition: background 0.12s ease;
}
tbody tr:hover {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}
td .action-form {
  margin: 0;
}
td time {
  white-space: nowrap;
}
td.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px 8px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}
.pagination a,
.pagination > span.muted {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.pagination a {
  color: var(--text);
}
.pagination a:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.pagination > span.muted {
  opacity: 0.5;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.tabs a {
  padding: 7px 14px;
  color: var(--muted);
  border-radius: 8px;
  white-space: nowrap;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}
.tabs a.active {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Charts */
.chart {
  margin: 0;
}
.chart figcaption {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.chart figcaption .muted {
  font-weight: 400;
}
.chart svg {
  width: 100%;
  height: auto;
  display: block;
}
.chart-axis {
  stroke: var(--border);
  stroke-width: 1;
}
.chart-label {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}
.chart-bar-a {
  fill: var(--chart-a);
}
.chart-bar-b {
  fill: var(--chart-b);
}
.chart-bar-c {
  fill: var(--chart-c);
}
.chart-bar-bad {
  fill: var(--bad);
  pointer-events: none;
}
.chart-bar:hover {
  opacity: 0.75;
}

/* Auth + hero */
.auth-card {
  max-width: 420px;
  margin: 32px auto;
  padding: 28px;
}
.auth-card form + p {
  margin: 18px 0 0;
}
.hero,
.video,
.apps {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}
.hero {
  padding: 56px 0 36px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-bottom: 36px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.apps {
  padding-bottom: 24px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 {
  margin: 0;
}
.app-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.app-list li + li {
  border-top: 1px solid var(--border);
}
.app-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text);
  transition: background 0.15s ease;
}
.app-row:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.app-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
}
.app-icon-0 {
  background: var(--accent-soft);
  color: var(--accent);
}
.app-icon-1 {
  background: color-mix(in srgb, var(--chart-b) 14%, var(--surface));
  color: var(--chart-b);
}
.app-icon-2 {
  background: var(--warn-soft);
  color: var(--warn);
}
.app-icon-3 {
  background: var(--info-soft);
  color: var(--info);
}
.app-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.app-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-host {
  color: var(--muted);
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-arrow {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: color 0.15s ease, transform 0.15s ease;
}
.app-row:hover .app-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}
@media (max-width: 720px) {
  .hero {
    padding-top: 28px;
  }
  .row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar .container {
    flex-wrap: wrap;
    height: auto;
    padding-top: 10px;
    padding-bottom: 8px;
    row-gap: 6px;
  }
  .nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav a:not(.button),
  .link-button {
    white-space: nowrap;
    padding: 6px 8px;
  }
  .nav form {
    margin-left: auto;
  }
}
