@font-face {
  font-family: 'Ubuntu Sans';
  src: url('/fonts/ubuntu-sans-latin.woff2?v=1') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: 'Ubuntu Sans Mono';
  src: url('/fonts/ubuntu-sans-mono-latin.woff2?v=1') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #111214;
  --surface: #17181b;
  --raised: #1e1f23;
  --border: #2a2c31;
  --border-strong: #3a3d44;
  --text: #ececee;
  --muted: #a2a4aa;
  --faint: #55585f;
  --accent: #ff5b3a;
  --accent-text: #1c0904;
  --link: #ff7a5c;
  --link-hover: #ff9b82;
  --live: #3dd68c;
  --font: 'Ubuntu Sans', system-ui, sans-serif;
  --mono: 'Ubuntu Sans Mono', ui-monospace, monospace;
  --radius: 6px;
  --radius-lg: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, kbd, samp { font-family: var(--mono); }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 500; }
p { margin: 0; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* buttons: one primary, one outline, one quiet, one danger */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: none; color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--raised); color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 500; }
.btn-primary:hover { background: #ff6f52; color: var(--accent-text); }
.btn-quiet { border-color: transparent; color: var(--muted); }
.btn-danger { border-color: var(--text); color: var(--text); }
.btn-danger-solid { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 500; }

/* tabs and filter rows are the only pills */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 0; border-radius: 999px; padding: 6px 14px; background: none; color: var(--muted); cursor: pointer; text-decoration: none; }
.tab:hover { color: var(--text); }
.tab[aria-current='page'] { background: var(--text); color: var(--bg); font-weight: 500; }

/* status: a filled dot for live, a hollow ring for failed, a muted dot for everything else */
.status { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--faint); }
.dot-live { background: var(--live); }
.dot-failed { background: none; border: 1.5px solid var(--text); }
.dot-working { background: var(--muted); animation: pulse 1.2s ease-in-out infinite; }
.status-live { color: var(--live); font-weight: 500; }
.status-failed { font-weight: 500; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .dot-working { animation: none; } }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 38px; padding: 8px 10px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface);
}
textarea.input { font-family: var(--mono); font-size: 13px; resize: vertical; }
.input:focus, .btn:focus-visible, .tab:focus-visible, a:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.error { color: var(--text); background: var(--raised); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; }

/* app frame */
.topbar { height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--border); }
.wordmark { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.wordmark:hover { color: var(--text); }
.topbar .sep { color: var(--faint); }
.topbar .grow { flex-grow: 1; }
.topbar select.input { width: auto; min-height: 32px; padding: 4px 8px; }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.topbar nav a:not(.btn) { color: var(--muted); text-decoration: none; }
.topbar nav a:not(.btn):hover { color: var(--text); }

.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar .label { font-size: 12px; color: var(--muted); padding: 0 12px 8px; }
.side-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.side-item:hover { background: var(--raised); color: var(--text); }
.side-item[aria-current='page'] { background: var(--raised); }
.side-item .name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.side-item .meta { font-size: 12px; color: var(--muted); padding-left: 16px; }
.main { flex-grow: 1; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-head .title { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-head .sub { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); }

/* deploys and other lists of facts are tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { font-weight: 500; color: var(--muted); text-align: left; padding: 0 12px 8px 0; }
table.data td { padding: 12px 12px 12px 0; border-top: 1px solid var(--border); vertical-align: top; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface); }
table.data tr[aria-selected='true'] td { background: var(--raised); color: var(--text); }
table.data .num { text-align: right; padding-right: 0; color: var(--muted); }
/* rows with buttons in them centre the text on the buttons */
table.data td.break { overflow-wrap: anywhere; }
table.data.with-actions td { vertical-align: middle; padding-top: 6px; padding-bottom: 6px; }

.log {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; font: 12.5px/1.65 var(--mono); color: #c9cbd0; white-space: pre-wrap; overflow-wrap: anywhere;
  min-height: 280px; max-height: 60vh; overflow-y: auto;
}
.log .live { color: var(--live); }

.split { display: flex; gap: 24px; align-items: flex-start; }
.split > .grow { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.facts { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; gap: 18px; }
.fact { display: flex; flex-direction: column; gap: 6px; }
.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-size: 20px; font-weight: 500; }
.fact .v small { font-size: 13px; color: var(--muted); font-weight: 400; }
.meter { height: 4px; background: var(--border); border-radius: 2px; }
.meter > div { height: 4px; background: var(--text); border-radius: 2px; }
.facts .note { border-top: 1px solid var(--border); padding-top: 16px; font-size: 13px; color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel .field { max-width: 560px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { width: 100%; max-width: 380px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* choice rows for plans and sources: a table-like list, not cards */
.choices { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.choice { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 0; border-top: 1px solid var(--border); background: none; text-align: left; cursor: pointer; width: 100%; }
.choice:first-child { border-top: 0; }
.choice:hover { background: var(--raised); }
.choice[aria-pressed='true'] { background: var(--raised); }
.choice .radio { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex-shrink: 0; }
.choice[aria-pressed='true'] .radio { border: 4px solid var(--accent); }
.choice .what { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.choice .what span { color: var(--muted); font-size: 13px; }
.choice .price { font-weight: 500; white-space: nowrap; }

/* auth pages: a small centred form is the one centred thing */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth .box { width: 100%; max-width: 380px; margin: 72px auto 0; padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }
.auth .box .wordmark { margin-bottom: 8px; }

/* legal pages: long text at reading width */
.legal { max-width: 760px; padding: 40px 24px 72px; display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 1.6; }
.legal section { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.legal ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

.empty { padding: 40px 0; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.toast { position: fixed; bottom: 20px; left: 20px; right: 20px; max-width: 420px; background: var(--raised); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; }

@media (max-width: 860px) {
  .topbar { height: auto; min-height: 56px; padding: 10px 16px; gap: 10px 12px; flex-wrap: wrap; }
  .topbar .grow { display: none; }
  .topbar nav { width: 100%; justify-content: space-between; }
  .layout { min-height: 0; }
  .layout { flex-direction: column; }
  .sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px; }
  .main { padding: 20px 16px; }
  .split { flex-direction: column; }
  .facts { width: auto; flex-direction: row; flex-wrap: wrap; }
  .facts .fact { min-width: 120px; }
}
