:root {
  --bg: #f4f1ea;
  --surface: #fffdf9;
  --surface-2: #f7f4ed;
  --border: #e6e0d4;
  --border-strong: #d4ccbd;
  --text: #1d2823;
  --text-2: #56645c;
  --text-3: #87928b;
  --brand: #2f6b55;
  --brand-hover: #275b48;
  --brand-soft: #e2ede6;
  --brand-ink: #1f4f3d;
  --on-brand: #fff;
  --ring: rgba(47, 107, 85, .18);
  --gold: #a87634;
  --gold-soft: #f5ead8;
  --danger: #b04a3a;
  --danger-soft: #f8e5e0;
  --warn: #9a6516;
  --warn-soft: #f6ead3;
  --info: #35618a;
  --info-soft: #e3ecf5;
  --sidebar: #14201b;
  --sidebar-2: #1e2d27;
  --sidebar-text: #aebdb5;
  --toast: #17221e;
  --shadow: 0 1px 2px rgba(25, 35, 30, .04), 0 2px 10px rgba(25, 35, 30, .04);
  --shadow-lg: 0 2px 4px rgba(25, 35, 30, .05), 0 12px 32px rgba(25, 35, 30, .09);
  --radius: 14px;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1412;
    --surface: #151d1a;
    --surface-2: #1a2420;
    --border: #25312c;
    --border-strong: #33423b;
    --text: #e7ece9;
    --text-2: #a3b0a9;
    --text-3: #75837b;
    --brand: #5aab88;
    --brand-hover: #6dbd9a;
    --brand-soft: #1b3229;
    --brand-ink: #9cd6bb;
    --on-brand: #0a1a12;
    --ring: rgba(90, 171, 136, .25);
    --gold: #d9a85f;
    --gold-soft: #322819;
    --danger: #e47f6f;
    --danger-soft: #3a201c;
    --warn: #e1a54d;
    --warn-soft: #342715;
    --info: #80b0d9;
    --info-soft: #182736;
    --sidebar: #0a0f0d;
    --sidebar-2: #141c19;
    --toast: #24312c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14.5px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-3); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.top-gap { margin-top: 18px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
em { font-style: normal; font-weight: 400; color: var(--text-3); }
kbd { font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); }

/* Boot & auth */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .brand-mark { animation: breathe 1.4s ease-in-out infinite; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #4a9a78, #22513f); color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 12px rgba(34, 81, 63, .3);
}
.brand-mark.lg { width: 52px; height: 52px; border-radius: 15px; font-size: 26px; }
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 15% -10%, var(--brand-soft), transparent 70%), radial-gradient(700px 400px at 110% 110%, var(--gold-soft), transparent 70%), var(--bg);
}
.auth-card { width: min(420px, 100%); padding: 36px; display: grid; gap: 4px; }
.auth-card .brand-mark { margin-bottom: 20px; }
.auth-card h1 { font-size: 26px; margin-bottom: 4px; }
.auth-card .btn { margin-top: 8px; min-height: 46px; }
.auth-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--text-3); }
.eyebrow { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }

/* Layout */
.layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px; background: var(--sidebar); color: var(--sidebar-text); }
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 10px 28px; }
.brand strong { display: block; color: #fff; font-size: 15.5px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 12px; opacity: .7; }
nav { display: grid; gap: 3px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px;
  background: none; color: var(--sidebar-text); font-size: 14px; font-weight: 500; text-decoration: none; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--sidebar-2); color: #fff; }
.nav-link.active { background: var(--sidebar-2); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-link .badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--gold); color: #1d1408; font-size: 11.5px; font-weight: 700; text-align: center; }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-foot .env { margin: 0 12px; }

.main { width: 100%; max-width: 1320px; margin: 0 auto; padding: 32px 40px 72px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 26px; }
.topbar h1 { font-size: 27px; font-weight: 700; }
.sub { margin-top: 5px; color: var(--text-2); font-size: 14px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--text-2); font-size: 13px; font-weight: 500; text-decoration: none; }
.crumb:hover { color: var(--text); }
.crumb .ic { width: 15px; height: 15px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.env { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.env i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.env.prod { color: #7fd3a8; background: rgba(127, 211, 168, .1); }
.env.local { color: #e9b86a; background: rgba(233, 184, 106, .12); }
.auth .env.prod { color: var(--brand-ink); background: var(--brand-soft); }
.auth .env.local { color: var(--warn); background: var(--warn-soft); }

/* Buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(31, 79, 61, .25); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger-text { color: var(--danger); }
.btn.danger-text:hover { background: var(--danger-soft); color: var(--danger); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon-only { width: 36px; padding: 0; }
.btn.sm.icon-only { width: 32px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.busy { color: transparent !important; cursor: progress; opacity: 1; }
.btn.busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--text-3); border-top-color: transparent; animation: spin .7s linear infinite;
}
.btn.primary.busy::after, .btn.danger.busy::after { border-color: rgba(255, 255, 255, .85); border-top-color: transparent; }

/* Surfaces */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 15.5px; font-weight: 650; }
.panel-head a { font-size: 13px; font-weight: 600; text-decoration: none; }
.panel-body { padding: 20px; }
.section-title { font-size: 15.5px; font-weight: 650; margin-bottom: 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.kpi { padding: 18px 20px; display: grid; align-content: start; gap: 4px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.kpi-icon.gold { background: var(--gold-soft); color: var(--gold); }
.kpi-icon.info { background: var(--info-soft); color: var(--info); }
.kpi strong { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--text-3); font-size: 12.5px; }
.meter { display: block; width: 100%; height: 5px; margin-top: 8px; }
.meter .bg { fill: var(--surface-2); }
.meter .fill { fill: var(--brand); }

.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  padding: 10px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  color: var(--text-3); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; white-space: nowrap;
}
th.num { text-align: right; }
td { padding: 13px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface-2); }
.wide-table { min-width: 760px; }
tr.clickable { cursor: pointer; }
.cell-sub { display: block; margin-top: 2px; color: var(--text-3); font-size: 12.5px; }
.strong { font-weight: 600; }
.panel > .table-wrap:first-child th:first-child { border-top-left-radius: var(--radius); }
.panel > .table-wrap:first-child th:last-child { border-top-right-radius: var(--radius); }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12px; font-weight: 600;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.pill.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.pill.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.pill.info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.pill.gold { background: var(--gold-soft); border-color: transparent; color: var(--gold); }
.pill.live { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.pill.live::before { animation: pulse 1.2s ease-in-out infinite; }

/* Lists */
.feed { list-style: none; margin: 0; padding: 4px 20px 8px; }
.feed li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.feed-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.feed-ic .ic { width: 15px; height: 15px; }
.feed-ic.ok { background: var(--brand-soft); color: var(--brand-ink); }
.feed-ic.warn { background: var(--warn-soft); color: var(--warn); }
.feed-ic.info { background: var(--info-soft); color: var(--info); }
.mini { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 20px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.mini:last-child { border-bottom: 0; }
.mini:hover { background: var(--surface-2); }
.mini strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cal { display: grid; text-align: center; overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.cal span { white-space: nowrap; padding: 3px 0; background: var(--brand); color: var(--on-brand); font-size: 10.5px; font-weight: 700; letter-spacing: .03em; }
.cal strong { padding: 6px 0 7px; font-size: 21px; line-height: 1; font-variant-numeric: tabular-nums; }
.cal.sm span { font-size: 9.5px; padding: 2px 0; }
.cal.sm strong { font-size: 16px; padding: 5px 0; }
.cal.muted-cal span { background: var(--text-3); }

/* Toolbar */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.search {
  display: flex; align-items: center; gap: 8px; flex: 0 1 340px; min-width: 220px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text-3);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.search input { width: 100%; padding: 9px 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.segmented button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--border); }
.count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--border); color: var(--text-2); font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
[aria-selected="true"] .count { background: var(--brand-soft); color: var(--brand-ink); }

/* Topics */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.topic-card { display: flex; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.topic-body { display: grid; gap: 8px; padding: 16px 18px 18px; }
.topic-body h3 { font-size: 16px; font-weight: 650; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-3); font-size: 13px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .ic { width: 14px; height: 14px; }
.art { position: relative; height: 108px; display: grid; place-items: center; color: rgba(255, 255, 255, .92); overflow: hidden; }
.art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .22), transparent 45%), radial-gradient(circle at 10% 110%, rgba(0, 0, 0, .18), transparent 50%); }
.art .ic { width: 38px; height: 38px; stroke-width: 1.5; position: relative; z-index: 1; }
.art-nature { background: linear-gradient(135deg, #5a9a72, #285a44); }
.art-logic { background: linear-gradient(135deg, #5279a2, #2a4566); }
.art-music { background: linear-gradient(135deg, #bf8644, #7a4b20); }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.editor-side { position: sticky; top: 24px; display: grid; gap: 16px; }
.side-actions { display: grid; gap: 8px; margin-top: 18px; }
.hint { margin-top: 12px; color: var(--text-3); font-size: 12.5px; text-align: center; }
.tips h3 { font-size: 13.5px; margin-bottom: 8px; }
.tips ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; display: grid; gap: 6px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field.last { margin-bottom: 0; }
.field > span { color: var(--text-2); font-size: 13px; font-weight: 600; }
.control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.control::placeholder { color: var(--text-3); }
.control:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
textarea.control { min-height: 64px; resize: vertical; line-height: 1.5; }
select.control { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.image-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pick-card { position: relative; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pick-card input { position: absolute; opacity: 0; pointer-events: none; }
.pick-card .art { height: 60px; }
.pick-card .art .ic { width: 26px; height: 26px; }
.pick-card span { display: block; padding: 8px 10px; font-size: 13px; font-weight: 600; }
.pick-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.pick-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.q-card { margin-top: 16px; scroll-margin-top: 24px; }
.q-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--border); }
.q-title { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 14.5px; }
.q-num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; font-weight: 700; }
.q-tools { display: flex; gap: 2px; }
.q-body { padding: 18px; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); transition: border-color .15s, background .15s; }
.choice:focus-within { border-color: var(--brand); }
.choice .control { border: 0; box-shadow: none; padding: 7px 4px; background: transparent; }
.choice .pick { position: relative; display: grid; cursor: pointer; }
.choice .pick input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.letter { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 700; transition: .15s; }
.pick:hover .letter { border-color: var(--brand); color: var(--brand); }
.pick input:focus-visible + .letter { outline: 2px solid var(--brand); outline-offset: 2px; }
.correct-tag { display: none; padding-right: 6px; color: var(--brand-ink); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.choice:has(input[type="radio"]:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input[type="radio"]:checked) .letter { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.choice:has(input[type="radio"]:checked) .correct-tag { display: block; }
.add-q {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 16px; padding: 16px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: transparent; color: var(--text-2); font-weight: 600;
}
.add-q:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.add-q:disabled { opacity: .5; cursor: not-allowed; }
.add-q small { color: var(--text-3); font-weight: 500; }

dl.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--text-3); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
dl.kv.compact { grid-template-columns: auto 1fr; gap: 8px 12px; margin-top: 16px; font-size: 13.5px; }
dl.kv.compact dd { text-align: right; font-variant-numeric: tabular-nums; }

/* Tournaments */
.t-list { display: grid; gap: 14px; }
.t-card { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 20px; }
.t-card h3 { font-size: 16.5px; font-weight: 650; margin: 6px 0 2px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: 13px; }
.facts li { display: inline-flex; align-items: center; gap: 6px; }
.facts .ic { width: 15px; height: 15px; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 3px 9px; border-radius: 7px; background: var(--gold-soft); color: var(--gold); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.t-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.prize-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.prize-row .rank-tag { color: var(--text-2); font-size: 13px; font-weight: 600; }
.medal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 700; }
.medal.r1 { background: #f3d77a; color: #5b4300; }
.medal.r2 { background: #dcdfe3; color: #3f464e; }
.medal.r3 { background: #e9bb8f; color: #5a3212; }

/* Awards */
.steps { display: flex; margin: 0 0 22px; padding: 0; list-style: none; }
.steps li { position: relative; flex: 1; padding-top: 22px; color: var(--text-3); font-size: 12px; font-weight: 500; text-align: center; }
.steps li::before { content: ""; position: absolute; top: 5px; left: 50%; z-index: 1; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.steps li::after { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: var(--border-strong); }
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--text); }
.steps li.done::before { background: var(--brand); border-color: var(--brand); }
.steps li.done::after { background: var(--brand); }
.amount { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.copy { margin-left: 6px; vertical-align: middle; }

/* Notices & states */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; margin-bottom: 20px; border-radius: 12px; background: var(--info-soft); color: var(--info); font-size: 13.5px; line-height: 1.55; }
.notice .ic { margin-top: 1px; }
.notice div { color: var(--text-2); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice.flush { margin: 16px 0 0; }
.empty { padding: 52px 24px; text-align: center; color: var(--text-2); }
.empty-ic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.empty-ic .ic { width: 24px; height: 24px; }
.empty h3 { margin-bottom: 6px; color: var(--text); font-size: 16px; }
.empty p { max-width: 380px; margin: 0 auto; font-size: 14px; }
.empty .btn { margin-top: 18px; }
.empty.compact { padding: 32px 20px; }
.skeleton { display: grid; gap: 16px; }
.skeleton div { height: 110px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skeleton div:first-child { height: 90px; }
.skeleton div:last-child { height: 260px; }

/* Modal */
dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; overflow: auto;
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
}
dialog.modal.wide { width: min(820px, calc(100vw - 32px)); }
dialog.modal[open] { animation: pop .18s ease-out; }
dialog::backdrop { background: rgba(8, 14, 11, .5); backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px 0; }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 20px 24px 22px; }
.modal-body > p { color: var(--text-2); }
.modal-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-actions .spacer { margin-right: auto; }
.modal .table-wrap { margin: 0 -24px; }
.modal td:first-child, .modal th:first-child { padding-left: 24px; }
.modal td:last-child, .modal th:last-child { padding-right: 24px; }

/* Toasts */
#message { position: fixed; inset: auto 24px 24px auto; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; z-index: 50; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; background: var(--toast); color: #eef3f0; font-size: 14px; line-height: 1.45; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); animation: rise .2s ease-out; }
.toast .ic { margin-top: 1px; }
.toast.ok .ic { color: #7fd3a8; }
.toast.error .ic { color: #ff9d8c; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 50% { opacity: .25; } }
@keyframes breathe { 50% { transform: scale(.92); opacity: .7; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; overflow-x: auto; }
  .brand { padding: 0 4px 0 0; }
  .brand > div:last-child { display: none; }
  nav { display: flex; gap: 2px; }
  .nav-link { width: auto; min-height: 38px; padding: 0 10px; white-space: nowrap; }
  .nav-link.active { box-shadow: inset 0 -2px 0 var(--gold); }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .sidebar-foot .env, .sidebar-foot .nav-link span { display: none; }
  .main { padding: 22px 16px 56px; }
  .topbar h1 { font-size: 23px; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-side { position: static; order: -1; }
  .editor-side .tips { display: none; }
  .t-card { grid-template-columns: 52px minmax(0, 1fr); }
  .t-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .nav-link span, .nav-link .badge { display: none; }
  .kpis, .kpis.three { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .kpi strong { font-size: 25px; }
  .choices, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .search { flex: 1 1 100%; }
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.kv dd { margin-bottom: 10px; }
  dl.kv.compact { grid-template-columns: auto 1fr; gap: 8px 12px; }
  dl.kv.compact dd { margin: 0; }
  .auth-card { padding: 28px 22px; }
  #message { inset: auto 16px 16px 16px; }
}
