/* Portal chrome (list of decks, admin). Deliberately quiet: the decks carry the identity. */
:root {
  --bg: #f3f4f2;
  --surface: #ffffff;
  --ink: #1b1d22;
  --ink-2: #636873;
  --line: #d9dcd6;
  --accent: #2d5bd7;
  --danger: #b3261e;
  --r: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 'Hanken Grotesk', system-ui, sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 14px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.top-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; }
.top-mark { width: 14px; height: 18px; border-radius: 3px; background: var(--ink); box-shadow: 5px 3px 0 var(--accent); }
.top nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 14px; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.top-user { color: var(--ink); font-weight: 500; }

.page { max-width: 1160px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px) 96px; }
.intro h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.025em; line-height: 1.05; margin: 0 0 12px; }
.intro p { color: var(--ink-2); max-width: 60ch; margin: 0 0 40px; font-size: 18px; }
.empty { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 14px; max-width: 80ch; }

.decks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.deck-card { display: flex; flex-direction: column; gap: 8px; min-height: 200px; padding: 24px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
.deck-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.deck-card[data-theme="trame"] { background: #e8ebee; border-color: #c6ccd5; box-shadow: inset 0 -5px 0 #3b3af0; }
.deck-card[data-theme="nocturne"] { background: #121417; color: #ece8df; border-color: #2f343b; box-shadow: inset 0 -5px 0 #d6a84e; }
.deck-card-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.deck-card-sub { color: inherit; opacity: .7; }
.deck-card-tracks { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.deck-alt { display: inline-block; margin: 10px 0 0 4px; font-size: 14px; color: var(--ink-2); }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .07); }
.deck-card[data-theme="nocturne"] .chip { background: rgba(255, 255, 255, .1); }
.chip--muted { background: transparent; border: 1px solid currentColor; opacity: .6; }

.message { max-width: 560px; margin: 10vh auto; }
.message h1 { font-size: 2rem; letter-spacing: -0.02em; margin: 0 0 12px; }
.message p { color: var(--ink-2); font-size: 18px; margin: 0 0 28px; }

.btn { display: inline-block; border: 0; border-radius: 999px; background: var(--ink); color: #fff; padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn--small { padding: 7px 14px; font-size: 14px; }
.btn-link { border: 0; background: none; padding: 0; font: inherit; font-size: 14px; color: var(--accent); cursor: pointer; }
.btn-link--danger { color: var(--danger); }

/* admin */
.flash { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); display: inline-block; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 32px; position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 2; }
.admin-nav a { text-decoration: none; color: var(--ink); padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; }
.admin-nav a:hover { border-color: var(--ink); }
.block { margin-bottom: 72px; scroll-margin-top: 64px; }
.block h1 { font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 20px; }
.block h2 { font-size: 1.2rem; margin: 36px 0 12px; }
.block h3 { font-size: 1rem; margin: 20px 0 8px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 1.1rem; margin-bottom: 6px; }
.stat small { color: var(--ink-2); margin-top: 6px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--ink-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num { text-align: right; }
.nowrap { white-space: nowrap; }
td small { color: var(--ink-2); }
.meter { display: inline-block; width: 120px; height: 6px; border-radius: 6px; background: #eceee9; margin-right: 10px; vertical-align: middle; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }

.recent { margin-top: 24px; }
.recent summary { cursor: pointer; font-weight: 600; }
.recent ul { list-style: none; padding: 0; font-size: 13px; }
.recent li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.recent time { color: var(--ink-2); margin-right: 8px; }
code { font-size: 12px; background: #e8eae5; padding: 1px 6px; border-radius: 4px; }

.deck-admin { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 16px; }
.deck-admin header { display: flex; align-items: baseline; justify-content: space-between; }
.deck-admin h2 { margin: 0 0 14px; }
.deck-admin-links { display: flex; gap: 16px; font-size: 14px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 12px 0; }
.inline-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.inline-form legend { float: left; font-weight: 600; margin-right: 12px; }
.chk { font-size: 14px; white-space: nowrap; }
.grants { list-style: none; padding: 0; margin: 0 0 8px; }
.grants li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.grants .chips { display: flex; gap: 4px; }
.grants form { margin-left: auto; }
.row-form { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.row-form input[type="text"] { width: 150px; }
form.inline { display: inline; margin-left: 10px; }
input[type="text"], input[type="email"], select { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.card-form { margin-top: 24px; max-width: 520px; display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.card-form h2 { margin: 0; }
.card-form label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
.card-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.card-form legend { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.card-form .btn { justify-self: start; }
.groups { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.groups li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; }
.groups span { color: var(--ink-2); font-size: 14px; margin-left: 6px; }
