:root {
  color-scheme: dark;
  --zoe-font: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --zoe-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --zoe-bg: #080b12;
  --zoe-bg-soft: #0c111b;
  --zoe-surface: #121826;
  --zoe-elevated: #182033;
  --zoe-border: #2a3548;
  --zoe-border-strong: #3d4b63;
  --zoe-text: #f4efe6;
  --zoe-muted: #9aa3b2;
  --zoe-faint: #6b7384;
  --zoe-accent: #d4a017;
  --zoe-accent-strong: #e8b423;
  --zoe-accent-soft: rgba(212, 160, 23, 0.14);
  --zoe-primary: #d4a017;
  --zoe-secondary: #7eb8c9;
  --zoe-danger: #c23b3b;
  --zoe-success: #2f9e6b;
  --zoe-warning: #d97706;
  --zoe-info: #5b8def;
  --zoe-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --zoe-shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.22);
  --zoe-radius-sm: 8px;
  --zoe-radius: 12px;
  --zoe-radius-lg: 18px;
  --zoe-radius-pill: 999px;
  --zoe-space-1: 4px;
  --zoe-space-2: 8px;
  --zoe-space-3: 12px;
  --zoe-space-4: 16px;
  --zoe-space-5: 24px;
  --zoe-space-6: 32px;
  --zoe-space-7: 48px;
  --zoe-space-8: 72px;
  --zoe-container: 1120px;
  --zoe-container-narrow: 720px;
  --zoe-bp-tablet: 860px;
  --zoe-bp-notebook: 1100px;
  --zoe-focus: #e8b423;
  --zoe-status-active: #86efac;
  --zoe-status-inactive: #cbd5e1;
  --zoe-status-suspended: #fcd34d;
  --zoe-status-revoked: #fca5a5;
  --zoe-status-expired: #fcd34d;
  --zoe-status-ready: #86efac;
  --zoe-status-published: #86efac;
  --zoe-status-unknown: #fcd34d;
  --zoe-brand-min: 24px;
  --zoe-brand-mark: 36px;
  --zoe-brand-gap: 10px;
  --zoe-on-light-bg: #f4efe6;
  --zoe-on-light-text: #121826;
  --zoe-on-light-muted: #4b5563;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--zoe-bg);
  color: var(--zoe-text);
  font: 16px/1.55 var(--zoe-font);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--zoe-accent-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--zoe-text); }
:focus-visible {
  outline: 2px solid var(--zoe-focus);
  outline-offset: 3px;
}
.sr-only {
  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: 12px;
  top: -48px;
  z-index: 20;
  background: var(--zoe-accent);
  color: #1a1405;
  padding: 8px 12px;
  border-radius: var(--zoe-radius-sm);
}
.skip-link:focus { top: 12px; }

.container {
  width: min(var(--zoe-container), calc(100% - 40px));
  margin: 0 auto;
}
.container-narrow {
  width: min(var(--zoe-container-narrow), calc(100% - 40px));
  margin: 0 auto;
}
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: var(--zoe-space-5);
}
.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)); }

.btn,
button {
  font: inherit;
  border: 0;
  border-radius: var(--zoe-radius-sm);
  min-height: 40px;
  padding: 0 16px;
  cursor: pointer;
  background: var(--zoe-accent);
  color: #1a1405;
  font-weight: 600;
}
.btn:hover,
button:hover { background: var(--zoe-accent-strong); }
.btn-secondary,
button.ghost {
  background: transparent;
  color: var(--zoe-text);
  border: 1px solid var(--zoe-border-strong);
}
.btn-secondary:hover,
button.ghost:hover { background: var(--zoe-elevated); }
button.danger { background: var(--zoe-danger); color: #fff; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-link {
  background: transparent;
  color: var(--zoe-accent-strong);
  min-height: auto;
  padding: 0;
  font-weight: 500;
}

input, select, textarea {
  font: inherit;
  width: 100%;
  background: var(--zoe-bg);
  color: var(--zoe-text);
  border: 1px solid var(--zoe-border);
  border-radius: var(--zoe-radius-sm);
  min-height: 40px;
  padding: 8px 12px;
}
label {
  display: block;
  margin: 12px 0;
  color: var(--zoe-muted);
  font-size: 14px;
}
.muted { color: var(--zoe-muted); }
.faint { color: var(--zoe-faint); }
.error { color: #fca5a5; }

.card {
  background: var(--zoe-surface);
  border: 1px solid var(--zoe-border);
  border-radius: var(--zoe-radius);
  padding: var(--zoe-space-5);
  box-shadow: var(--zoe-shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.card:hover, .card:focus-within {
  border-color: var(--zoe-border-strong);
  box-shadow: var(--zoe-shadow);
}
.brand-on-dark {
  background: var(--zoe-bg);
  color: var(--zoe-text);
}
.brand-on-light {
  background: var(--zoe-on-light-bg);
  color: var(--zoe-on-light-text);
}
.brand-on-light .muted { color: var(--zoe-on-light-muted); }
.badge {
  display: inline-block;
  border-radius: var(--zoe-radius-pill);
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid var(--zoe-border);
  letter-spacing: 0.04em;
}
.badge.ok, .badge.status-active, .badge.status-ready, .badge.status-published { color: var(--zoe-status-active); }
.badge.warn, .badge.status-expired, .badge.status-suspended, .badge.status-unknown, .badge.status-inactive { color: var(--zoe-status-suspended); }
.badge.bad, .badge.status-revoked { color: var(--zoe-status-revoked); }
.alert, .flash {
  border-radius: var(--zoe-radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--zoe-border);
}
.alert-info { background: rgba(91, 141, 239, 0.12); color: #c7d7ff; }
.alert-warn { background: #422006; color: #fcd34d; border-color: #92400e; }
.alert-error, .flash.err { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
.alert-ok, .flash.ok { background: #052e16; color: #86efac; border-color: #166534; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--zoe-surface);
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--zoe-border);
  vertical-align: top;
}
th { color: var(--zoe-muted); font-weight: 600; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button {
  background: transparent;
  color: var(--zoe-text);
  border: 1px solid var(--zoe-border);
}
.tabs button.active, .tabs button[aria-selected="true"] {
  background: var(--zoe-elevated);
  border-color: var(--zoe-accent);
  color: var(--zoe-text);
}

.state { padding: 32px; color: var(--zoe-muted); }
.pager { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; color: var(--zoe-muted); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.modal-card {
  width: min(640px, 100%);
  background: var(--zoe-surface);
  border: 1px solid var(--zoe-border);
  border-radius: var(--zoe-radius);
  padding: 20px;
  box-shadow: var(--zoe-shadow);
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container, .container-narrow { width: min(100% - 32px, var(--zoe-container)); }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
