:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #060b1c;
  --surface: #0e1223;
  --surface-2: #151a2e;
  --border: #26324a;
  --border-strong: #3b4a66;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --positive: #4ade80;
  --negative: #f87171;
  --danger: #ef4444;
  --warning: #fbbf24;
  --ring: #93c5fd;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 48px rgba(2, 6, 23, 0.45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, monospace;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(34, 197, 94, 0.12), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

svg {
  display: block;
}

.container {
  width: min(1180px, 100% - 2 * var(--space-5));
  margin-inline: auto;
}

.container.narrow {
  width: min(460px, 100% - 2 * var(--space-5));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: #041006;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-4);
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(2, 6, 23, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  min-height: 64px;
  padding-block: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand strong {
  color: var(--accent);
  font-weight: 700;
}

.brand-mark {
  width: 28px;
  height: 28px;
  fill: var(--accent);
  stroke: var(--accent);
}

.brand-mark rect {
  fill: rgba(34, 197, 94, 0.55);
  stroke: none;
}

.topnav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-right: auto;
}

.topnav a {
  padding: 6px 11px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
}

.topnav a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.topnav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-auth {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Menu utilisateur */
.user-menu {
  position: relative;
}

.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 5px 5px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.user-trigger:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #041006;
  background: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.chevron {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.user-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.user-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 224px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.user-panel-meta {
  margin-bottom: 4px;
  padding: 8px 10px 10px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.45;
}

.user-panel-meta strong {
  color: var(--text);
  font-weight: 600;
}

.user-panel-link {
  display: block;
  width: 100%;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.user-panel-link:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.user-panel-form {
  margin: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status[data-state="ok"] .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.status[data-state="loading"] .status-dot {
  background: var(--warning);
  animation: pulse 1.2s ease-in-out infinite;
}

.status[data-state="stale"] .status-dot {
  background: var(--warning);
}

.status[data-state="error"] .status-dot {
  background: var(--danger);
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* Hero */
.hero {
  padding: var(--space-8) 0 var(--space-6);
  max-width: 720px;
}

.eyebrow {
  margin-bottom: var(--space-3);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lede {
  margin-top: var(--space-3);
  max-width: 62ch;
  color: var(--muted);
}

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.metric {
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(180deg, rgba(21, 26, 46, 0.9), rgba(14, 18, 35, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: var(--space-2);
  font-family: var(--mono);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.metric-detail {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: 0.82rem;
}

/* Panel */
.panel {
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-head,
.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

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

.small {
  font-size: 0.82rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.star-icon {
  color: var(--warning);
  font-size: 0.95rem;
  line-height: 1;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  color: #041006;
  background: var(--warning);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.search {
  position: relative;
  flex: 1 1 260px;
  max-width: 420px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  stroke: var(--muted);
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.94rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search input::placeholder {
  color: #64748b;
}

.search input:hover {
  border-color: var(--border-strong);
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.icon-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 1.15rem;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 8px 16px;
  color: #041006;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.btn:hover {
  background: #2ee06a;
  text-decoration: none;
}

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

.btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.btn-ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-sm {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
  margin-top: var(--space-3);
}

.btn-icon-text {
  white-space: nowrap;
}

.btn.is-active {
  color: var(--warning);
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.45);
}

.btn.is-active:hover {
  background: rgba(251, 191, 36, 0.14);
}

/* Table */
.table-wrap {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

caption {
  text-align: left;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.sort:hover {
  color: var(--text);
}

th.numeric .sort {
  justify-content: flex-end;
}

.sort-icon {
  color: var(--accent);
  font-size: 0.85rem;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(38, 50, 74, 0.6);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(21, 26, 46, 0.65);
}

td.symbole {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #d1fae5;
  white-space: nowrap;
}

.star-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-right: 4px;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.star-btn:hover {
  color: var(--warning);
  background: rgba(251, 191, 36, 0.12);
  transform: scale(1.08);
}

.star-btn[aria-pressed="true"] {
  color: var(--warning);
}

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

td.nom {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 84px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.badge.positive {
  color: var(--positive);
  background: var(--accent-soft);
}

.badge.negative {
  color: var(--negative);
  background: rgba(248, 113, 113, 0.12);
}

.badge.neutral {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
}

/* Sticky symbol column */
thead th:first-child,
tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}

thead th:first-child {
  z-index: 3;
  background: var(--surface-2);
}

tbody tr:hover td:first-child {
  background: var(--surface-2);
}

/* Alerts and states */
.alert {
  margin-bottom: var(--space-4);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.alert-error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.alert-success {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.alert-warning {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.empty {
  padding: var(--space-6) var(--space-4);
  color: var(--muted);
  text-align: center;
}

.skeleton-row td {
  padding: 14px;
}

.skeleton {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), #202741, var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) 0 var(--space-8);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.84rem;
}

/* Documentation API */
.doc-hero {
  padding-bottom: var(--space-5);
}

.base-url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  color: var(--muted);
  font-size: 0.9rem;
}

.base-url code {
  padding: 4px 9px;
  color: #d1fae5;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
}

.toc a {
  padding: 6px 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.84rem;
}

.toc a:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-strong);
  text-decoration: none;
}

.doc-section {
  scroll-margin-top: 90px;
}

.doc-section > p {
  margin-bottom: var(--space-4);
}

.endpoint {
  padding-top: var(--space-5);
  margin-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.endpoint:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.endpoint h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: 1rem;
  font-weight: 600;
}

.endpoint h3 code {
  padding: 3px 8px;
  color: #d1fae5;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.92rem;
}

.method {
  display: inline-flex;
  padding: 3px 8px;
  color: var(--positive);
  background: var(--accent-soft);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.params-wrap {
  max-height: none;
}

.params {
  font-size: 0.86rem;
}

.params thead th {
  position: static;
}

.params th,
.params td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.params th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.params th:first-child,
.params td:first-child {
  position: static;
  background: transparent;
}

.params code {
  color: #d1fae5;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.params td:first-child {
  white-space: nowrap;
}

.code-block {
  margin: var(--space-4) 0;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 7px 10px 7px 14px;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.copy-btn {
  min-height: 30px;
  padding: 4px 10px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}

.code-block pre {
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
}

.code-block code {
  color: #dbeafe;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre;
}

.callout {
  margin: var(--space-4) 0;
  padding: 12px 14px;
  color: #d1fae5;
  background: rgba(34, 197, 94, 0.07);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
}

.callout-warning {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.08);
  border-left-color: var(--warning);
}

.callout code {
  font-family: var(--mono);
  font-size: 0.85em;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
}

.grid-2 .code-block {
  margin: 0;
}

.doc-list {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding-left: 1.25rem;
  color: var(--muted);
}

.doc-list code {
  color: #d1fae5;
  font-family: var(--mono);
  font-size: 0.86em;
}

/* Pages compte et authentification */
.auth-page .footer,
.account-page .footer {
  margin-top: var(--space-7);
}

.auth-main {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: var(--space-7) 0;
}

.auth-card {
  padding: var(--space-6);
}

.auth-card h1 {
  margin-bottom: var(--space-2);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
}

.auth-intro {
  margin-bottom: var(--space-5);
}

.auth-form {
  gap: var(--space-2);
}

.auth-form input {
  margin-bottom: 2px;
}

.field-hint {
  margin: -2px 0 var(--space-2);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.auth-switch {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.account-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-7) 0 var(--space-5);
}

.account-head h1 {
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.account-head .lede {
  margin-top: var(--space-2);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.metric-value-sm {
  font-size: 1.02rem;
  line-height: 1.35;
}

.empty-state {
  display: grid;
  gap: var(--space-3);
  place-items: center;
  padding: var(--space-6) var(--space-4);
  text-align: center;
}

.icon-btn-static {
  position: static;
  transform: none;
  width: 28px;
  height: 28px;
}

/* Admin and error pages */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) 0 var(--space-5);
}

.page-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.subtitle {
  color: var(--muted);
  font-size: 0.88rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.form-stack {
  display: grid;
  gap: var(--space-2);
}

.form-stack label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.form-stack input {
  width: 100%;
  padding: 10px 12px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.form-stack input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.form-stack .btn {
  margin-top: var(--space-2);
}

.hint {
  margin-top: var(--space-4);
  color: var(--muted);
  font-size: 0.8rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
  margin: 0;
}

.details-grid div {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.details-grid dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.details-grid dd {
  margin: 4px 0 0;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.bar-list {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.bar-list li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.82rem;
}

.bar-label {
  color: var(--muted);
  font-family: var(--mono);
}

.bar-value {
  color: var(--muted);
  white-space: nowrap;
}

progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 0;
  border-radius: 999px;
  appearance: none;
}

progress::-webkit-progress-bar {
  background: var(--bg-soft);
  border-radius: 999px;
}

progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

details {
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: 0.86rem;
}

summary {
  cursor: pointer;
  color: var(--text);
}

details .table-wrap {
  margin-top: var(--space-3);
  max-height: 320px;
}

.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: var(--space-5);
  text-align: center;
}

.error-code {
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 700;
  line-height: 1;
}

.error-page p {
  margin: var(--space-3) auto var(--space-5);
  max-width: 46ch;
  color: var(--muted);
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 2 * var(--space-4), 1180px);
  }

  .hero {
    padding-top: var(--space-6);
  }

  .topnav {
    order: 3;
    width: 100%;
    margin-right: 0;
  }

  .status {
    display: none;
  }

  .topbar-actions {
    gap: var(--space-2);
  }

  .user-trigger-name,
  .chevron {
    display: none;
  }

  .user-trigger {
    padding: 4px;
    border-radius: 50%;
  }

  .btn-label {
    display: none;
  }

  .auth-main {
    padding: var(--space-5) 0;
  }

  .auth-card {
    padding: var(--space-4);
  }

  .account-head {
    padding-top: var(--space-5);
  }

  .toc {
    padding: var(--space-3) var(--space-4);
  }

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

  .panel {
    padding: var(--space-4);
  }

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

  .metric {
    padding: var(--space-3) var(--space-4);
  }

  .metric-value {
    font-size: 1.35rem;
  }

  .toolbar {
    align-items: stretch;
  }

  .search {
    max-width: none;
  }

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

  .bar-list li {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .bar-value {
    grid-column: 2;
  }
}

@media (max-width: 520px) {
  .topbar-auth > .btn:not(.btn-ghost) {
    display: none;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .btn {
    flex: 1 1 auto;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
