:root {
  --bg: #0a0a1a; --surface: #12122a; --surface-2: #181836; --border: #26264a; --text: #e8ecf4; --muted: #9aa6bd;
  --accent: #8b5cf6; --accent-2: #a78bfa; --good: #22c55e; --warn: #f59e0b; --bad: #ef4444;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent-2); }
code, pre { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.86rem; }
pre { background: #07071a; border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; white-space: pre; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent-2); }
.top nav { display: flex; gap: 18px; align-items: center; }
.top nav a { color: var(--muted); text-decoration: none; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 120px; }
h1 { font-size: 1.7rem; margin: 0 0 6px; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.small { font-size: 0.88rem; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin: 18px 0; }
.narrow { max-width: 440px; margin: 40px auto; }

form label { display: block; margin: 0 0 12px; font-size: 0.92rem; color: var(--muted); }
input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 1rem; }
input:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, .button { cursor: pointer; font: inherit; border-radius: 8px; padding: 9px 16px; border: 1px solid transparent; text-decoration: none; display: inline-block; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: #7c4ff0; }
.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.link { background: none; border: none; padding: 0; color: var(--accent-2); text-decoration: underline; }
.msg { min-height: 1.5em; margin: 10px 0 0; }
.msg.error { color: var(--bad); }
.msg.ok { color: var(--good); }

.corral-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.card-top { display: flex; gap: 12px; align-items: center; }
.card-top img { width: 52px; height: 52px; border-radius: 12px; background: var(--surface-2); flex: none; }
.card-name { font-weight: 650; }
.card-tier { font-size: 0.82rem; color: var(--muted); text-transform: capitalize; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 0.86rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge.update { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.badge.current { background: rgba(34, 197, 94, 0.14); color: var(--good); }
.grade-good { color: var(--good); } .grade-mid { color: var(--warn); } .grade-low { color: var(--bad); }
.card-actions { display: flex; gap: 10px; align-items: center; margin-top: auto; flex-wrap: wrap; }
.card-actions label { font-size: 0.86rem; color: var(--muted); display: flex; gap: 6px; align-items: center; margin: 0; }
.card-actions input[type=checkbox] { width: auto; display: inline; margin: 0; }

.baker { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface-2); border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.baker input { width: 220px; display: inline-block; margin: 0; }
.how summary { cursor: pointer; font-weight: 600; }

@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .baker input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
