/* Skill Builder portal: the Atelier tokens (desktop/src/design/tokens.css), day and night. */
:root {
  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Cascadia Mono', Consolas, monospace;
  --r-card: 14px;
  --r-ctrl: 10px;
  --r-pill: 999px;
  --bg: #F5F1E8;
  --surface: #FBF9F4;
  --surface2: #F1ECE2;
  --raised: #FFFFFF;
  --text: #1D1A16;
  --text2: #554E45;
  --text3: #6E675C;
  --line: #E1D9CA;
  --line2: #CFC5B3;
  --accent: #2D4A8C;
  --accent-ink: #FFFFFF;
  --accent-soft: #E4E9F3;
  --voice: #B8532A;
  --voice-soft: #F3E4D9;
  --ok: #2F6B45;
  --ok-soft: #E2EDE4;
  --warn: #8F5410;
  --warn-soft: #F4E8D1;
  --danger: #A63A2A;
  --danger-soft: #F4E1DC;
  --shadow-card: 0 1px 2px rgba(29,26,22,0.05), 0 8px 24px rgba(29,26,22,0.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16130F;
    --surface: #1F1B16;
    --surface2: #27221C;
    --raised: #2B261F;
    --text: #F2ECE2;
    --text2: #CBC2B4;
    --text3: #A69D8F;
    --line: #2F2A23;
    --line2: #3D372E;
    --accent: #8FA8E0;
    --accent-ink: #16130F;
    --accent-soft: #232A3A;
    --voice: #E08A5C;
    --voice-soft: #3A2A20;
    --ok: #7FBF95;
    --ok-soft: #1E2E23;
    --warn: #E0B070;
    --warn-soft: #33281A;
    --danger: #E58A7A;
    --danger-soft: #3A221E;
    --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-body);
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0 0 8px; letter-spacing: 0.01em; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
a { color: var(--accent); }
p { margin: 0 0 12px; }
.muted { color: var(--text3); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); }

/* the brand mark: a small stacked-blocks glyph and the word mark */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-family: var(--font-display); font-size: 20px; }
.brand .word { font-family: var(--font-display); font-size: 22px; }
.brand .word span { color: var(--voice); }

/* single-card pages: sign in, join, setup */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 28px;
}
.center .card { width: min(440px, 100%); }
.card + .card { margin-top: 16px; }

label { display: block; font-size: 13px; color: var(--text2); margin: 14px 0 6px; }
input[type=text], input:not([type]), select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--line2);
  border-radius: var(--r-ctrl);
  padding: 10px 12px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px var(--font-body);
  border: 1px solid transparent;
  border-radius: var(--r-ctrl);
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-ink);
}
button.wide { width: 100%; margin-top: 18px; padding: 12px 16px; }
button.quiet, .button.quiet { background: var(--surface2); color: var(--text); border-color: var(--line); }
button.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
button.small, .button.small { font-size: 13px; padding: 6px 10px; }
button:disabled { opacity: 0.55; cursor: default; }

.status { min-height: 22px; margin-top: 14px; font-size: 14px; color: var(--text2); }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

/* admin and account: a top bar and a wide column */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.top .brand { margin: 0; }
.top nav { display: flex; gap: 8px; align-items: center; }
main.wide { max-width: 1240px; margin: 0 auto; padding: 24px 28px 64px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; }
.kpi .n { font-family: var(--font-display); font-size: 32px; line-height: 1.1; }
.kpi .l { color: var(--text3); font-size: 13px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tools select { width: auto; padding: 6px 10px; font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.placed { background: var(--accent-soft); color: var(--accent); }
.pill.progress { background: var(--warn-soft); color: var(--warn); }
.pill.open { background: var(--surface2); color: var(--text3); }
.pill.revoked { background: var(--danger-soft); color: var(--danger); }
.pill.admin { background: var(--voice-soft); color: var(--voice); }

.stars { color: var(--voice); letter-spacing: 1px; }
.bar { height: 8px; background: var(--surface2); border-radius: var(--r-pill); overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--danger); border-radius: var(--r-pill); }

.link-box { display: flex; gap: 8px; margin-top: 12px; }
.link-box input { font-family: var(--font-mono); font-size: 12px; }
.empty { color: var(--text3); padding: 12px 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.note { margin-top: 18px; }
.hint { margin-top: 6px; }
main.narrow { max-width: 760px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 6px; }
.grid > .card + .card { margin-top: 0; }
.row-actions, td .pill { white-space: nowrap; }
