:root {
  --bg: #f5f6f8; --card: #fff; --text: #1b1f24; --muted: #6a737d; --line: #e3e6ea;
  --primary: #2457d6; --primary-ink: #fff; --ok: #1a7f37; --warn: #9a6700; --err: #cf222e;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1216; --card: #171b21; --text: #e6e8eb; --muted: #8b949e; --line: #2a3038;
          --primary: #4c7dff; --ok: #3fb950; --warn: #d29922; --err: #f85149; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
pre.code { background: var(--bg); border: 1px solid var(--line); padding: .7rem 1rem; border-radius: 8px; font-size: 1.1rem; user-select: all; }

.topbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem 1.2rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; color: var(--text); white-space: nowrap; }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; align-items: center; flex: 1; }
.nav a, .nav .linklike { padding: .35rem .65rem; border-radius: 6px; color: var(--muted); }
.nav a.active, .nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav .sep { flex: 1; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: .2rem .6rem; font-size: 1.1rem; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; }

.container { max-width: 1200px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.container.narrow { max-width: 440px; padding-top: 8vh; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1rem; }
.center { text-align: center; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.heading h1 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.links { margin-top: 1rem; font-size: .9rem; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; align-items: end; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.row { display: flex; gap: .4rem; align-items: center; }
.inline { display: inline; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .8rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat b { display: block; font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.bad b { color: var(--err); }
.stat.warn b { color: var(--warn); }

label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
input, select { font: inherit; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); width: 100%; }
input[type=checkbox] { width: auto; }
input.tiny { width: 4.5rem; padding: .25rem .4rem; }
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
details summary { cursor: pointer; margin-bottom: .5rem; }

.btn { display: inline-block; font: inherit; font-weight: 500; padding: .5rem .95rem; border-radius: 7px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.danger { color: var(--err); }
.btn.sm { padding: .25rem .6rem; font-size: .85rem; }
.actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.actions.bar { margin-bottom: 1rem; }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--card); }
.flash.success { border-color: var(--ok); }
.flash.error { border-color: var(--err); color: var(--err); }
.flash.info { border-color: var(--primary); }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
table.compact td { padding: .4rem .3rem; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .45rem; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.badge.ok { color: var(--ok); } .badge.err { color: var(--err); } .badge.warn { color: var(--warn); }
.badge.muted { color: var(--muted); } .badge.pdf { color: var(--err); }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; flex: 1 1 180px; }
.notices { list-style: none; padding: 0; margin: 0 0 .8rem; }
.notice { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.notices.card .notice { padding: .7rem 0; }
.notice:last-child { border-bottom: 0; }
.notice .meta { color: var(--muted); font-size: .8rem; }
.preview li { margin-bottom: .4rem; word-break: break-word; }
.pager { display: flex; gap: 1rem; justify-content: center; align-items: center; color: var(--muted); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; }
  .nav.open { display: flex; }
  .nav .sep { display: none; }
  .container { padding: 1rem .8rem 3rem; }
  .container.narrow { padding-top: 2rem; }
}

/* ---------- icons ---------- */
.icon { width: 1.05em; height: 1.05em; flex: none; vertical-align: -.17em; }
.btn, .badge, .nav a, .nav .linklike, .more, .site, .site-cell, .flash, summary, .ok-text { display: inline-flex; align-items: center; gap: .4em; }
.btn .icon { width: 1em; height: 1em; }
.badge { gap: .25em; }
.badge .icon { width: .9em; height: .9em; }
.flash { display: flex; gap: .6rem; align-items: flex-start; }
.flash > .icon { margin-top: .2rem; }
.flash.success > .icon { color: var(--ok); }
.flash.info > .icon { color: var(--primary); }
.ok-text { color: var(--ok); }
.more { font-weight: 500; gap: .15em; }
.nav-toggle .icon { width: 1.3rem; height: 1.3rem; vertical-align: middle; }

.brand { display: inline-flex; align-items: center; gap: .55rem; }
.brand-mark { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 7px; background: var(--primary); color: #fff; }
.brand-mark .icon { width: 1.1rem; height: 1.1rem; }
.brand-mark.lg { width: 2.6rem; height: 2.6rem; border-radius: 10px; }
.brand-mark.lg .icon { width: 1.5rem; height: 1.5rem; }
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: .3rem; }
.auth-brand h1 { margin: 0; }

.stat { position: relative; }
.stat .stat-icon { position: absolute; top: .9rem; right: 1rem; width: 1.25rem; height: 1.25rem; color: var(--muted); opacity: .7; }
.stat.bad .stat-icon { color: var(--err); opacity: 1; }
.stat.warn .stat-icon { color: var(--warn); opacity: 1; }

/* ---------- website favicons ---------- */
.favicon { width: 16px; height: 16px; flex: none; border-radius: 3px; object-fit: contain; }
.favicon.md { width: 28px; height: 28px; border-radius: 6px; padding: 4px; background: #fff; border: 1px solid var(--line); }
.favicon.lg { width: 40px; height: 40px; border-radius: 9px; padding: 6px; background: #fff; border: 1px solid var(--line); }
.favicon.placeholder { display: inline-grid; place-items: center; color: var(--muted); }
.favicon.placeholder .icon { width: 100%; height: 100%; }
.favicon.placeholder.md, .favicon.placeholder.lg { background: var(--bg); }
.site-cell { gap: .7rem; align-items: center; }
h1.site-cell { display: flex; margin: 0; }
.site { gap: .35em; vertical-align: middle; }

/* ---------- notices ---------- */
.notice { display: flex; gap: .7rem; align-items: flex-start; }
.notice-icon { display: inline-grid; place-items: center; width: 2rem; height: 2rem; flex: none; border-radius: 7px; background: var(--bg); color: var(--muted); }
.notice-icon.pdf { color: var(--err); }
.notice-body { min-width: 0; }
.notice .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .15rem; }
.dot { color: var(--muted); }
.filters label.check { flex: none; white-space: nowrap; }
.btn.ai { border-color: #7c5cff; color: #7c5cff; }
.ai-result.ok { border-color: var(--ok); }
.ai-result.warn { border-color: var(--warn); }
.ai-result h2 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.btn[disabled] { opacity: .6; cursor: progress; }
.hint { font-weight: 400; font-size: .78rem; color: var(--muted); } .hint code { font-size: .95em; }
