/* Shared look for every mccol.dev site: warm neutrals + clay accent, light/dark from the device. */
:root {
  color-scheme: light dark;
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #efede6;
  --border: #e2dfd5;
  --text: #262522;
  --muted: #69665e;
  --faint: #8f8b80;
  --accent: #c2643c;
  --accent-strong: #ad5530;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --ok: #3b8a56;
  --warn: #9a6512;
  --danger: #c0453a;
  --term-bg: #1c1b19;
  --shadow: 0 1px 2px rgb(40 30 20 / 0.06), 0 4px 16px rgb(40 30 20 / 0.06);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --app-h: 100dvh;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1e1c;
    --surface: #292825;
    --surface-2: #33312d;
    --border: #3e3c37;
    --text: #f1efe8;
    --muted: #b1ada3;
    --faint: #858177;
    --accent: #d9794f;
    --accent-strong: #e58a63;
    --accent-ink: #1e130e;
    --ok: #6bc189;
    --warn: #e2a640;
    --danger: #ec7a6f;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.25), 0 6px 20px rgb(0 0 0 / 0.2);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.88em; color: var(--muted); overflow-wrap: anywhere; }
h1 { font: 600 24px/1.25 var(--serif); margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }

/* layout */
.view { min-height: var(--app-h); }
.center { display: grid; place-items: center; padding: 24px 16px; }
.card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.card p { margin: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; white-space: nowrap; color: var(--text); }
a.brand:hover { text-decoration: none; }
.mark {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  font: 700 13px var(--mono);
}
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.content { max-width: 760px; margin: 0 auto; padding: 24px 16px 56px; display: flex; flex-direction: column; gap: 16px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.panel p { margin: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* controls */
button, .btn {
  font: inherit; color: inherit; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 14px; background: none;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.primary:hover:not(:disabled) { background: var(--accent-strong); }
.secondary { background: var(--surface-2); border-color: var(--border); }
.secondary:hover { border-color: var(--faint); }
.ghost { color: var(--muted); }
.ghost:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
button.small, .btn.small { padding: 6px 10px; font-size: 13px; }
.danger { color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
input:not([type=radio]):not([type=checkbox]), select {
  width: 100%; min-width: 0;
  font: 16px var(--font); /* 16px stops iOS zooming on focus */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
input:focus, select:focus { border-color: var(--accent); outline: none; }
.row { display: flex; gap: 8px; }

.error { color: var(--danger); margin: 0; min-height: 1.5em; font-size: 14px; }
.notice { margin: 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); font-size: 14px; }
.empty { color: var(--faint); margin: 0; font-size: 14px; }
.badge { font: 500 11px var(--font); padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex-shrink: 0; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.wait { background: var(--warn); }
.dot.bad { background: var(--danger); }

.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50;
  max-width: calc(100vw - 32px); box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
