:root {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #efece4; --ink: #17151a; --muted: #6b6672; --line: #e2ddd2;
  --accent: #ff5a1f; --accent-ink: #ffffff; --ok: #138a52; --ok-bg: #e3f5ea; --bad: #c62e2e; --bad-bg: #fbe5e3;
  --warn: #b26b00; --warn-bg: #fff1d6; --info: #2d5bd7; --shadow: 0 1px 2px rgba(20,16,10,.06), 0 8px 24px rgba(20,16,10,.06);
  --radius: 14px; --font: "Inter", system-ui, -apple-system, Segoe UI, sans-serif; --display: "Space Grotesk", var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e12; --surface: #18171d; --surface-2: #211f27; --ink: #f2f0f5; --muted: #9b96a6; --line: #2c2a33;
    --ok: #3ccf86; --ok-bg: #12301f; --bad: #ff6b6b; --bad-bg: #3a1717; --warn: #ffb547; --warn-bg: #362710; --info: #7ea2ff;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e12; --surface: #18171d; --surface-2: #211f27; --ink: #f2f0f5; --muted: #9b96a6; --line: #2c2a33;
  --ok: #3ccf86; --ok-bg: #12301f; --bad: #ff6b6b; --bad-bg: #3a1717; --warn: #ffb547; --warn-bg: #362710; --info: #7ea2ff;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(28px, 5vw, 46px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }

header.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 18px; height: 58px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 19px; text-decoration: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo i { width: 22px; height: 22px; border-radius: 7px; background: conic-gradient(from 200deg, var(--accent), #ffb21f, #ff2f6d, var(--accent)); display: inline-block; }
nav.main { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
nav.main a { text-decoration: none; padding: 7px 11px; border-radius: 9px; color: var(--muted); white-space: nowrap; font-weight: 500; font-size: 14px; }
nav.main a:hover { color: var(--ink); background: var(--surface-2); }
nav.main a.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.who { font-size: 13px; color: var(--muted); white-space: nowrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
section { margin: 28px 0; }

.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px var(--font); padding: 10px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 6px 10px; min-height: 32px; font-size: 13px; }
input, select, textarea { font: 15px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 42px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid transparent; }
button.chip { cursor: pointer; font-family: var(--font); }
button.chip.on { background: var(--ink); color: var(--bg); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.kpi .v { font-family: var(--display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi .s { font-size: 12.5px; color: var(--muted); }

.poster { border-radius: 12px; aspect-ratio: 16/9; position: relative; overflow: hidden; color: #fff; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; }
.poster b { font-family: var(--display); font-size: 22px; line-height: 1.1; text-shadow: 0 1px 12px rgba(0,0,0,.3); }
.ev-card { text-decoration: none; display: block; padding: 10px; }
.ev-card:hover { border-color: var(--muted); }
.ev-card .meta { padding: 10px 6px 4px; }

.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-weight: 600; z-index: 50; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hide { display: none !important; }
.spin { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: s 0.8s linear infinite; display: inline-block; }
@keyframes s { to { transform: rotate(360deg); } }
footer { padding: 40px 0; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  header.top .wrap { gap: 10px; }
  .who { display: none; }
  .card { padding: 14px; }
  .kpi .v { font-size: 22px; }
}
