:root {
  --bg: #F5F6FA; --surface: #FFFFFF; --surface-2: #EEF0F6; --text: #12141C; --muted: #5D6375; --line: #DCDFE8;
  --accent: #C6F432; --accent-ink: #0A0C14; --blue: #4453D6; --danger: #C42B2B; --ok: #1B7F3B; --warn: #9A5B00;
  --radius: 14px; --tabs-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0A0C14; --surface: #141824; --surface-2: #1C2131; --text: #F3F4F8; --muted: #9AA0B4; --line: #2A3045;
    --blue: #8F9BFF; --danger: #FF7676; --ok: #6FD08C; --warn: #F2B65A; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
a { color: var(--blue); }
h1 { font-size: 24px; line-height: 1.2; margin: 4px 0 4px; overflow-wrap: anywhere; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 10px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 16px; margin: 0; overflow-wrap: anywhere; }
p { margin: 6px 0; }
.muted { color: var(--muted); } .small { font-size: 14px; } .center { text-align: center; }

.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 32px; outline: none; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); text-decoration: none; }
.tabs a.on { color: var(--text); font-weight: 600; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on svg { stroke: var(--text); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 8px; }
.list a.item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list a.item:last-child { border-bottom: 0; }
.list .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { min-width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); }
.score.A { background: var(--accent); color: var(--accent-ink); }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.hot { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 8px; font-size: 13px; letter-spacing: 0; }

button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 12px 16px; min-height: 44px; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button.ghost, .btn.ghost { background: var(--surface-2); color: var(--text); }
button.danger { background: transparent; color: var(--danger); border: 1px solid currentColor; }
button.small, .btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
button:disabled { opacity: .5; cursor: default; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px; }
textarea.short { min-height: 90px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; margin: 0; padding: 8px 12px 8px 0; min-height: 44px; }
label.check input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--accent); }
textarea { min-height: 150px; resize: vertical; line-height: 1.45; }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 12px; }

.msg { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
ul.issues { padding-left: 18px; margin: 0; } ul.issues li { margin: 4px 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 28px; line-height: 1.1; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); } th { color: var(--muted); font-weight: 500; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 14px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.login { max-width: 380px; margin: 10vh auto 0; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); z-index: 10; max-width: 520px; margin: 0 auto; background: var(--text); color: var(--bg); border-radius: 12px; padding: 12px 16px; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
#toast.show { opacity: 1; transform: none; }
details summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } .filters { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
