/* Console styles. Handwritten, no framework, no build step, and no request to
   any other host: every asset the page loads is a sibling file.

   The palette matches site/styles.css so the console and the marketing page
   look like one product. Contrast ratios are carried over from there and were
   measured; do not darken --text-muted without re-measuring it.

   No @import, no url() to another origin, no web font. A console that argues
   the product has no moving parts you have to trust must not pull a typeface
   from someone else's CDN. */

:root {
  --bg: #0c0e14;
  --bg-raised: #13161f;
  --surface: #191d28;
  --border: #262b3a;
  --border-bright: #394054;
  --text: #e9ebf2;        /* 16.2:1 on --bg */
  --text-muted: #a7aec0;  /* 8.7:1 on --bg, 7.6:1 on --surface */
  --accent: #ffab5e;      /* 10.3:1 on --bg */
  --accent-strong: #ffc48c;
  --ok: #7fd6a2;
  --warn: #ffd479;
  --bad: #ff9a8f;
  --max: 1080px;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* An element given an explicit display would otherwise stay visible when
   hidden, turning every `el.hidden = true` in admin.js into a silent no-op. */
[hidden] { display: none !important; }

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

:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 3px;
}

code, .mono { font-family: var(--mono); font-size: 0.92em; word-break: break-word; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: #1a1200;
  padding: 10px 16px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; color: #1a1200; text-decoration: none; }

/* ---- Top bar --------------------------------------------------------- */
.topbar { border-bottom: 1px solid var(--border); background: var(--bg-raised); }
.topbar-inner {
  width: 100%; max-width: var(--max); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; min-height: 60px;
}
.brand { font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { color: var(--text-muted); font-weight: 400; }
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--text-muted); }

/* ---- Layout ---------------------------------------------------------- */
main { flex: 1 0 auto; padding: 28px 0 48px; }
.loading { color: var(--text-muted); }

h1 { font-size: 24px; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 10px; }
h2 { font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 8px; }
h3 { font-size: 16px; margin-bottom: 6px; }
p + p, p + ul, ul + p, h2 + p, h1 + p { margin-top: 10px; }
ul { padding-left: 20px; }
li + li { margin-top: 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.muted { color: var(--text-muted); }
.small { font-size: 14px; }

/* ---- Buttons and controls -------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--accent); color: #1a1200;
  border: 1px solid transparent; border-radius: 8px;
  padding: 9px 16px; font: inherit; font-weight: 700;
  cursor: pointer; text-align: center;
}
.btn:hover { background: var(--accent-strong); color: #1a1200; text-decoration: none; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn-quiet {
  background: transparent; color: var(--text);
  border-color: var(--border-bright); font-weight: 400;
}
.btn-quiet:hover { background: var(--bg-raised); color: var(--text); }

select {
  background: var(--bg-raised); color: var(--text);
  border: 1px solid var(--border-bright); border-radius: 8px;
  padding: 8px 10px; font: inherit; max-width: 100%;
}
label { display: block; color: var(--text-muted); font-size: 14px; margin-bottom: 4px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row-between { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* ---- Notices --------------------------------------------------------- */
.notice {
  border: 1px solid var(--border-bright); border-left-width: 4px;
  border-radius: 8px; padding: 12px 14px; margin-top: 14px;
  background: var(--bg-raised);
}
.notice-warn { border-left-color: var(--warn); }
.notice-bad { border-left-color: var(--bad); }
.notice-ok { border-left-color: var(--ok); }

/* ---- Fleet table ----------------------------------------------------- */
/* The table scrolls inside its own container so the page itself never scrolls
   sideways at 360px. */
.table-scroll { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 15px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:last-child td { border-bottom: 0; }

.chip {
  display: inline-block; border-radius: 999px; padding: 1px 9px;
  font-size: 13px; border: 1px solid var(--border-bright); color: var(--text-muted);
  white-space: nowrap;
}
.chip-ok { color: var(--ok); border-color: var(--ok); }
.chip-warn { color: var(--warn); border-color: var(--warn); }
.chip-bad { color: var(--bad); border-color: var(--bad); }

.empty { color: var(--text-muted); margin-top: 14px; }

/* ---- Footer ---------------------------------------------------------- */
.foot { border-top: 1px solid var(--border); padding: 20px 0; color: var(--text-muted); font-size: 14px; }

/* ---- The error page rendered by src/http.ts -------------------------- */
.page-error { padding: 48px 0; }
.page-error .wrap > * + * { margin-top: 14px; }

@media (max-width: 520px) {
  h1 { font-size: 21px; }
  .card { padding: 16px; }
}
