/* Steeple Cast dashboard — the app's own console palette, deliberately dark. */
:root {
  --ink: #0e1116;
  --surface: #171b22;
  --elevated: #1f242d;
  --stroke: #2b313b;
  --text: #f5f7fa;
  --text2: #9aa4b2;
  --text3: #5c6675;
  --accent: #4f7cff;
  --accent-dim: #2e4a99;
  --live: #ff3b30;
  --ready: #30d158;
  --warn: #ffb020;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
h1, h2, h3, .brand { font-family: ui-rounded, -apple-system, system-ui, sans-serif; }

.shell { max-width: 880px; margin: 0 auto; padding: 28px 20px 80px; }
header.top { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
header.top svg { flex: none; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.brand small { display: block; font-size: 12px; font-weight: 500; color: var(--text3); letter-spacing: 0; }
header.top .spacer { flex: 1; }

.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--stroke); }
.tabs button {
  appearance: none; background: none; border: none; cursor: pointer;
  color: var(--text2); font: 600 14px ui-rounded, system-ui, sans-serif;
  padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.card {
  background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px;
  padding: 20px; margin-bottom: 16px;
}
.card h2 { font-size: 16px; font-weight: 750; margin: 0 0 4px; }
.card .sub { color: var(--text2); font-size: 13px; margin: 0 0 14px; }

label.field { display: block; margin: 12px 0; }
label.field span {
  display: block; font: 600 11px ui-monospace, Menlo, monospace;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3); margin-bottom: 6px;
}
input[type="text"], input[type="password"], textarea, select {
  width: 100%; background: var(--elevated); color: var(--text);
  border: 1px solid var(--stroke); border-radius: 9px; padding: 10px 12px;
  font: 14px ui-monospace, "SF Mono", Menlo, monospace;
}
textarea { min-height: 90px; resize: vertical; font-family: inherit; }
select { font-family: inherit; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  appearance: none; border: none; cursor: pointer; border-radius: 10px;
  font: 650 14px ui-rounded, system-ui, sans-serif; padding: 10px 16px;
  background: var(--accent); color: white;
}
.btn:hover { filter: brightness(1.1); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.btn.secondary { background: var(--elevated); color: var(--text); border: 1px solid var(--stroke); }
.btn.danger { background: transparent; color: var(--live); border: 1px solid var(--stroke); }
.btn:disabled { opacity: 0.5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

.preview {
  background: var(--elevated); border: 1px dashed var(--stroke); border-radius: 9px;
  padding: 10px 12px; font-weight: 650; margin-top: 8px;
}
.hint { color: var(--text3); font-size: 12.5px; margin-top: 6px; }
.hint code { background: var(--elevated); border-radius: 4px; padding: 1px 5px;
  font: 12px ui-monospace, Menlo, monospace; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  font: 650 12px ui-rounded, system-ui, sans-serif; padding: 4px 11px;
  background: var(--elevated); border: 1px solid var(--stroke); color: var(--text2);
}
.badge.on { color: var(--ready); }
.badge.on::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: var(--ready); }

.devices { width: 100%; border-collapse: collapse; font-size: 14px; }
.devices th { text-align: left; font: 600 11px ui-monospace, Menlo, monospace;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3);
  padding: 8px 10px; border-bottom: 1px solid var(--stroke); }
.devices td { padding: 10px; border-bottom: 1px solid var(--stroke); }
.devices tr:last-child td { border-bottom: none; }
.devices .revoked { color: var(--text3); text-decoration: line-through; }

.pairbox { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.pairbox .qr { background: white; border-radius: 12px; padding: 12px; line-height: 0; }
.pairbox .code { font: 800 34px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.14em; }
.pairbox .ttl { color: var(--text3); font-size: 12.5px; }

.signin { text-align: center; padding: 80px 20px; }
.signin h1 { font-size: 28px; margin: 18px 0 6px; }
.signin p { color: var(--text2); margin: 0 0 26px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--elevated); border: 1px solid var(--stroke); color: var(--text);
  border-radius: 10px; padding: 10px 18px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.toast.show { opacity: 1; }
.hidden { display: none !important; }
footer { color: var(--text3); font-size: 12.5px; margin-top: 34px; text-align: center; }
footer a { color: var(--text2); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Links. There was no rule at all, so text links fell back to the browser's default
   dark blue (#00e) and visited purple — both close to invisible on this near-black
   background. A light tint of the accent reads at roughly 8:1 here; the accent itself
   is under 4.5:1, which is why it stays on buttons and is not used for body text. */
a, a:visited { color: #9db8ff; text-decoration: underline;
  text-decoration-color: rgba(157, 184, 255, 0.35); text-underline-offset: 3px; }
a:hover, a:focus-visible { color: #cddbff; text-decoration-color: currentColor; }
/* Buttons that happen to be links keep their button colours. Without this, a:visited
   (0,1,1) outranks .btn (0,1,0) and a clicked "Sign in" turns link-coloured. */
a.btn, a.btn:visited { color: #fff; text-decoration: none; }
a.btn.secondary, a.btn.secondary:visited { color: var(--text); }
footer a, footer a:visited { color: var(--text2); text-decoration-color: rgba(255,255,255,0.2); }
footer a:hover { color: var(--text); }
