/* Dark-first theme shared by every page (matches the card). */
:root {
  --bg: #0f0f12; --surface: #17171c; --surface-2: #1f1f26; --surface-3: #2a2a33; --text: #ededf0; --muted: #8e8e99;
  --border: #26262e; --gold: #f5b84a; --red: #e5484d; --accent: var(--gold); --ok: #3fb950; --danger: #ff6b6b;
  --radius: 16px; --shadow: 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text);
  line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1rem; } h3 { font-size: .95rem; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 460px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
input, select { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 16px; /* ≥16px stops iOS zoom-on-focus */ }
input[type=color] { padding: 2px; height: 46px; }
input[type=checkbox] { width: auto; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
button, .btn { appearance: none; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit;
  font-weight: 600; padding: 10px 16px; border-radius: 12px; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; min-height: 44px; white-space: nowrap; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.accent, .gold { background: var(--gold); color: #1a1207; border-color: var(--gold); }
.danger { color: var(--danger); }
.ghost { background: transparent; }
.big { font-size: 1.1rem; min-height: 58px; }
.full { width: 100%; }
.sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%) translateY(-20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; opacity: 0; transition: .25s; z-index: 100;
  max-width: calc(100vw - 32px); pointer-events: none; font-weight: 500; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--danger); color: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.table-wrap { overflow-x: auto; }
.grid { display: grid; gap: 12px; }
.chip { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-size: .9rem; min-height: 40px; font-weight: 500; color: var(--text); }
.chip.on { background: var(--gold); color: #1a1207; border-color: var(--gold); }
.hidden { display: none !important; }
.pill { display: inline-block; font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-weight: 600; }
.pill.warn { background: rgba(229,72,77,.18); color: #ff8a8d; }
.pill.gold { background: rgba(245,184,74,.18); color: var(--gold); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--muted); }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.tip { position: fixed; z-index: 200; display: none; pointer-events: none; background: #000; color: #fff; border: 1px solid var(--surface-3);
  padding: 7px 10px; border-radius: 10px; font-size: .78rem; line-height: 1.35; box-shadow: var(--shadow); max-width: 240px; }
[hidden] { display: none !important; }
