@font-face { font-family: Poppins; src: url('/assets/fonts/Poppins-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Poppins; src: url('/assets/fonts/Poppins-SemiBold.ttf') format('truetype'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: Poppins; src: url('/assets/fonts/Poppins-ExtraBold.ttf') format('truetype'); font-weight: 800 900; font-display: swap; }

:root {
  --canvas: #fafafa;
  --surface: #ffffff;
  --ink: #0a0a0a;
  --muted: #52525b;
  --accent: #fd0101;
  --line: #e4e4e7;
  --ok: #166534;
  --bad: #991b1b;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.5 Poppins, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
a { color: var(--ink); }

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

.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--ink); color: #fff; flex-wrap: wrap; }
.brand-mark { height: 28px; width: auto; }
.brand-name { font-weight: 800; letter-spacing: .02em; }
#nav { margin-left: auto; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
#nav a, #nav .link { color: #fff; text-decoration: none; background: none; border: 0; font: inherit; font-weight: 500; cursor: pointer; padding: 0; }
#nav a:hover, #nav .link:hover { color: var(--accent); background: none; }
.who { color: #a1a1aa; }

main { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 24px; font-weight: 800; margin: 0 0 16px; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
h1[tabindex='-1']:focus { outline: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.field span { font-weight: 500; }
input, select { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button { font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; }
/* Hover only on a button that can be pressed: one that waits (aria-disabled) or is busy keeps its look. */
button:not(:disabled, [aria-disabled='true']):hover { background: #c40000; border-color: #c40000; }
button:disabled, button[aria-disabled='true'] { opacity: .5; cursor: progress; }
button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
button.secondary:not(:disabled, [aria-disabled='true']):hover { background: #fff; border-color: var(--ink); }

.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 200px; margin: 0; }

.table { width: 100%; border-collapse: collapse; margin: 0 0 16px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td { overflow-wrap: anywhere; }
.table th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line); }
.badge.active, .badge.ok { background: #dcfce7; color: var(--ok); }
.badge.paused, .badge.disabled, .badge.failed, .badge.read_only { background: #fee2e2; color: var(--bad); }
.badge.invited, .badge.untested { background: #f4f4f5; color: var(--muted); }

.muted, .hint { color: var(--muted); }
.hint { font-size: 12px; margin: -4px 0 12px; }
.error { color: #b91c1c; font-weight: 500; margin: 12px 0 0; }
p.detail { margin: 0 0 12px; }
p.ok { color: var(--ok); font-weight: 500; margin: 12px 0 0; }
.warning { background: #fff7ed; border: 1px solid #fdba74; color: #7c2d12; border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.status { margin: 0 0 12px; }
.link-box { margin: 16px 0 0; padding: 12px; border: 1px dashed var(--accent); border-radius: 8px; display: grid; gap: 8px; }
.link-box p { margin: 0; }

@media (max-width: 640px) {
  /* 16px at least, or iOS zooms in on a focused field. */
  input, select, textarea, button { font-size: 16px; }
  .table thead { display: none; }
  .table tr { display: grid; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 2px 0; }
}
