:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --soft: #f8fafc;
  --border: #e5e7eb;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --up: #16a34a;
  --up-bg: #f0fdf4;
  --up-border: #bbf7d0;
  --down: #dc2626;
  --down-bg: #fef2f2;
  --down-border: #fecaca;
  --accent: #0f172a;
  --link: #1d4ed8;
  --soft-2: #f1f5f9;
  --border-strong: #94a3b8;
  --input-border: #cbd5e1;
  --up-strong: #14532d;
  --down-strong: #7f1d1d;
  --down-bg-hover: #fee2e2;
  --accent-hover: #1e293b;
  --accent-text: #ffffff;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #78350f;
  --empty: #e2e8f0;
  --flash: #fef9c3;
  --shimmer: rgba(255, 255, 255, 0.55);
  --overlay: rgba(255, 255, 255, 0.86);
  --head-1: #1e293b;
  --head-2: #0f172a;
  --logo-bg: #0f172a;
  color-scheme: light;
  --radius: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.25; margin: 0; }
h2 { font-size: 15px; font-weight: 650; }
code, kbd { font-family: var(--mono); font-size: 0.88em; background: var(--soft); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.break { word-break: break-all; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.topbar { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; font-size: 17px; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
.topnav { display: flex; gap: 18px; font-size: 13.5px; }
.topnav a { color: var(--text-2); }

/* hero + search */
.hero { text-align: center; padding: 44px 0 28px; }
.hero h1 { font-size: clamp(26px, 4.2vw, 38px); letter-spacing: -0.02em; font-weight: 780; }
.hero-small { padding-top: 64px; }
.lede { color: var(--text-2); max-width: 620px; margin: 10px auto 22px; }
.search { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.search input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--input-border); border-radius: var(--radius); font: inherit; font-size: 16px; color: var(--text); background: var(--panel); }
.search input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08); }
.search button, .form-grid button { height: 44px; padding: 0 22px; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; }
.search button:hover, .form-grid button:hover { background: var(--accent-hover); }
.search button[disabled] { opacity: 0.7; cursor: progress; }
.search:not(.search-big) { margin: 0; max-width: 460px; }
.search:not(.search-big) input, .search:not(.search-big) button { height: 38px; font-size: 15px; }
.hero-sum { margin-top: 12px; }

/* panels */
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 14px 16px; margin: 0 0 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols > .panel { margin: 0 0 16px; min-width: 0; }
.live-dot { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--up); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--up); }

/* badges */
.badge { display: inline-block; min-width: 46px; white-space: nowrap; text-align: center; font-size: 11px; font-weight: 750; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 999px; }
.badge-up { color: var(--up); background: var(--up-bg); border: 1px solid var(--up-border); }
.badge-down { color: var(--down); background: var(--down-bg); border: 1px solid var(--down-border); }
.badge-unknown { color: var(--muted); background: var(--soft); border: 1px solid var(--border); }

/* top sites grid */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.site-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--panel); transition: border-color 0.12s; }
.site-card:hover { border-color: var(--border-strong); text-decoration: none; }
.site-main { display: flex; flex-direction: column; min-width: 0; }
.site-name { font-weight: 620; font-size: 14px; }
.site-domain { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }

/* feeds */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 1fr auto 92px; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; }
.feed li:first-child { border-top: 0; }
.feed li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed li > :last-child { text-align: right; }
.feed-down li a { color: var(--down); font-weight: 600; }
.empty { color: var(--muted); font-size: 14px; display: block !important; }


/* bookmarklet */
.bookmarklet { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px dashed var(--up); border-radius: 999px; background: var(--up-bg); color: var(--up); font-weight: 700; cursor: grab; }
.bookmarklet::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.bookmarklet:hover { text-decoration: none; }

/* status page */
.status-search { padding: 18px 0 14px; }
.verdict { display: flex; gap: 16px; align-items: center; padding: 22px 22px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; }
.verdict h1 { font-size: clamp(20px, 3vw, 28px); letter-spacing: -0.015em; }
.verdict p { margin: 6px 0 0; color: var(--text-2); }
.verdict .dom { word-break: break-all; }
.verdict-up { background: var(--up-bg); border-color: var(--up-border); }
.verdict-up h1 { color: var(--up-strong); }
.verdict-down { background: var(--down-bg); border-color: var(--down-border); }
.verdict-down h1 { color: var(--down-strong); }
.verdict-icon { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 28px; font-weight: 800; }
.verdict-up .verdict-icon { background: var(--up); }
.verdict-down .verdict-icon { background: var(--down); }
.cols-status { grid-template-columns: 1.15fr 1fr; }
.btn-link { font-size: 13px; font-weight: 600; }

.diag { width: 100%; border-collapse: collapse; font-size: 14px; }
.diag th { text-align: left; font-weight: 500; color: var(--muted); width: 38%; padding: 7px 10px 7px 0; vertical-align: top; }
.diag td { padding: 7px 0; }
.diag tr + tr th, .diag tr + tr td { border-top: 1px solid var(--border); }

.tips { margin: 0; padding-left: 20px; font-size: 14px; }
.tips li { padding: 4px 0; }
.tips li strong { display: block; font-weight: 600; }
.tips li span { color: var(--text-2); }

/* chart */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--up); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--panel); stroke: var(--up); stroke-width: 1.5; }
.chart .down-mark { fill: var(--down); opacity: 0.28; }
.chart-empty { padding: 36px 0; text-align: center; border: 1px dashed var(--border); border-radius: 6px; }
.legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.legend .lg-line { background: var(--up); }
.legend .lg-down { background: var(--down); opacity: 0.5; height: 10px; width: 4px; margin-left: 8px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0 0; }
.stats div { background: var(--soft); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
.stats dt { font-size: 11.5px; color: var(--muted); }
.stats dd { margin: 0; font-weight: 700; font-size: 15px; }

/* forms */
.report { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-report { height: 36px; padding: 0 16px; border: 1px solid var(--down-border); background: var(--down-bg); color: var(--down); border-radius: var(--radius); font: inherit; font-weight: 650; cursor: pointer; }
.btn-report:hover { background: var(--down-bg-hover); }
.form-grid { display: grid; gap: 10px; margin-bottom: 14px; }
.form-grid .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label { display: grid; gap: 4px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.form-grid input, .form-grid textarea { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--input-border); border-radius: 6px; color: var(--text); width: 100%; resize: vertical; }
.form-grid input:focus, .form-grid textarea:focus { outline: none; border-color: var(--text); }
.form-grid button { justify-self: start; height: 38px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; border: 1px solid; }
.flash-ok { background: var(--up-bg); border-color: var(--up-border); color: var(--up-strong); }
.flash-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }

.footer { padding: 18px 16px 36px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border); margin-top: 12px; }


/* ---------- status page layout with sidebar ---------- */
.status-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.status-main, .status-side { min-width: 0; }
.status-side .panel { padding: 12px 14px; }
.side-sticky { margin-bottom: 16px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border); }
.side-list li:first-child { border-top: 0; }
.side-list a { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); }
.side-list a > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side-list strong { font-weight: 600; font-size: 13.5px; }
.side-list .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.feed-compact li { grid-template-columns: 1fr auto 70px; font-size: 13px; }
.live-note { margin: -8px 0 12px; }

/* site icons */
.ficon { width: 16px; height: 16px; border-radius: 3px; vertical-align: -3px; margin-right: 6px; flex: none; background: var(--soft); }
.panel-head h2 .ficon { margin-right: 2px; }
.verdict-body { flex: 1; min-width: 0; }
.verdict-favicon { flex: none; width: 40px; height: 40px; border-radius: 8px; background: #fff; padding: 4px; border: 1px solid var(--border); }
.verdict-pending { background: var(--soft); border-color: var(--border); }
.verdict-pending .verdict-icon { background: var(--empty); }
.spinner { width: 24px; height: 24px; border: 3px solid #94a3b8; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* diagnostics actions */
.diag-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-ghost { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-weight: 600; font-size: 13.5px; background: var(--panel); }
.btn-ghost:hover { border-color: var(--border-strong); text-decoration: none; }
.btn-ghost-down { color: var(--down); border-color: var(--down-border); background: var(--down-bg); }

/* status history */
.chart-bars .bar { fill: #3b82f6; }
.chart-bars .bar-down { fill: var(--down); opacity: 0.22; }
.chart-bars .axis-down { fill: var(--down); font-weight: 700; }
.table-scroll { overflow-x: auto; margin-top: 8px; }
.history { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.history th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.history td { padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.history tr:last-child td { border-bottom: 0; }
.history .num { text-align: right; }
.history tbody tr:nth-child(even) { background: var(--soft); }

/* ads */
.ad { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 0 16px; overflow: hidden; }
.ad-top, .ad-inline { min-height: 100px; }
.ad-sidebar { min-height: 270px; }
.ad-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.adsbygoogle { display: block; width: 100%; }
.ad-ins-sidebar { display: inline-block; width: 300px; height: 250px; }
.ad-preview { border: 1px dashed var(--input-border); border-radius: var(--radius); background: repeating-linear-gradient(45deg, var(--soft), var(--soft) 10px, var(--soft-2) 10px, var(--soft-2) 20px); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.ad-top.ad-preview, .ad-inline.ad-preview { height: 100px; }
.ad-sidebar.ad-preview { height: 250px; }

/* content pages */
.prose { max-width: 760px; padding: 28px 0 8px; }
.prose h1 { font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.015em; margin-bottom: 10px; }
.prose h2 { font-size: 19px; margin: 30px 0 8px; padding-top: 8px; scroll-margin-top: 64px; }
.prose h3 { font-size: 15px; margin: 18px 0 6px; }
.prose p, .prose li { color: var(--text-2); }
.prose li { margin: 4px 0; }
.lede-left { font-size: 16px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.toc a { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--text-2); }
.toc a:hover { border-color: var(--border-strong); text-decoration: none; }
.simple { border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.simple th, .simple td { border: 1px solid var(--border); padding: 6px 12px; text-align: left; }
.simple th { background: var(--soft); }
.footer p { margin: 4px 0; }
.footer a { color: var(--muted); text-decoration: underline; }



/* ---------- check / refresh animations (CSS only) ---------- */
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.96); } 55% { transform: scale(1.015); } 100% { transform: scale(1); } }
@keyframes ring-up { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); } 100% { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); } }
@keyframes ring-down { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); } 100% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); } }
@keyframes flash-bg { 0% { background: var(--flash); } 100% { background: transparent; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes badge-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.anim-in { animation: fade-in 0.35s ease-out both; }
.anim-changed { animation: pop 0.45s ease-out both; }
.verdict.anim-in .verdict-icon, .verdict.anim-changed .verdict-icon { animation: pop 0.45s ease-out both; }
.verdict-up.anim-in .verdict-icon, .verdict-up.anim-changed .verdict-icon { animation: pop 0.45s ease-out, ring-up 1s ease-out 0.1s 2; }
.verdict-down.anim-in .verdict-icon, .verdict-down.anim-changed .verdict-icon { animation: pop 0.45s ease-out, ring-down 1s ease-out 0.1s 2; }

/* While re-checking: shimmer over the panels and pulse the badges */
.is-checking { position: relative; }
.is-checking::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, transparent 0, var(--shimmer) 50%, transparent 100%) no-repeat;
  background-size: 400px 100%; animation: shimmer 1.1s linear infinite; }
.is-checking .badge { animation: badge-pulse 0.9s ease-in-out infinite; }
.verdict.is-checking .verdict-icon { animation: badge-pulse 0.9s ease-in-out infinite; }

.btn-recheck { display: inline-flex; align-items: center; gap: 5px; }
.recheck-icon, .refresh-dot { display: inline-block; font-size: 14px; line-height: 1; }
.is-spinning .recheck-icon, .refresh-dot.is-spinning { animation: spin 0.8s linear infinite; }
.btn-recheck.is-spinning { pointer-events: none; opacity: 0.7; }
.refresh-note { display: inline-flex; align-items: center; gap: 6px; }
.refresh-dot { color: var(--muted); }

/* Homepage grid: tick = re-checked, same status; changed = status flipped */
.site-card.anim-tick .badge { animation: pop 0.4s ease-out; }
.site-card.anim-tick { animation: fade-in 0.3s ease-out; }
.site-card.anim-changed { animation: flash-bg 1.6s ease-out; }
.site-card.anim-changed .badge-up { animation: pop 0.45s ease-out, ring-up 1s ease-out 2; }
.site-card.anim-changed .badge-down { animation: pop 0.45s ease-out, ring-down 1s ease-out 2; }
.feed li.anim-new { animation: fade-in 0.35s ease-out, flash-bg 1.6s ease-out; }

/* Loader: three green blocks hopping in sequence */
.loader { display: inline-flex; align-items: flex-end; gap: 4px; height: 18px; vertical-align: middle; }
.loader i { width: 7px; height: 7px; border-radius: 2px; background: var(--up); animation: hop 0.9s ease-in-out infinite; }
.loader i:nth-child(2) { animation-delay: 0.15s; background: #22c55e; }
.loader i:nth-child(3) { animation-delay: 0.3s; background: #4ade80; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); opacity: 0.6; } 30% { transform: translateY(-9px); opacity: 1; } }
.search button.is-loading[disabled] { opacity: 1; }
.search button.is-loading { display: inline-flex; align-items: center; gap: 8px; }
.search button.is-loading .loader i { background: #4ade80; }
.search button.is-loading .loader i:nth-child(2) { background: #86efac; }
.search button.is-loading .loader i:nth-child(3) { background: #bbf7d0; }
.verdict-icon-loading { background: var(--panel) !important; border: 1px solid var(--up-border); }
.verdict-icon-loading .loader { height: 20px; }
.verdict-overlay { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 12px;
  border-radius: inherit; background: var(--overlay); font-weight: 650; color: var(--text); animation: fade-in 0.2s ease-out; }
.verdict-overlay .loader { height: 22px; }
.verdict-overlay .loader i { width: 10px; height: 10px; border-radius: 3px; }
.verdict { position: relative; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; max-width: calc(100% - 32px);
  background: var(--text); color: var(--accent-text); padding: 10px 16px; border-radius: 8px; font-size: 14px; animation: fade-in 0.25s ease-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .is-checking::after { display: none; }
  .is-checking { opacity: 0.6; }
}


/* ---------- section header bars ---------- */
.panel > .panel-head, .panel > form + .panel-head { margin: -14px -16px 12px; padding: 9px 16px; min-height: 42px;
  background: linear-gradient(180deg, var(--head-1), var(--head-2)); color: #fff; border-radius: 7px 7px 0 0; }
.status-side .panel > .panel-head { margin: -12px -14px 10px; padding: 8px 14px; }
.panel > .panel-head h2 { color: #fff; font-size: 14.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.panel > .panel-head h2[data-i]::before { content: ""; flex: none; width: 16px; height: 16px; background: #4ade80;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.panel > .panel-head .muted, .panel > .panel-head .legend { color: #cbd5e1; }
.panel > .panel-head .btn-link { color: #93c5fd; }
.panel > .panel-head .btn-link:hover { color: #bfdbfe; }
.panel > .panel-head .live-dot { color: #4ade80; }
.panel > .panel-head .live-dot::before { background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); animation: pulse-light 2s infinite; }
@keyframes pulse-light { 70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.panel > .panel-head .refresh-dot { color: #cbd5e1; }
.panel > .panel-head .ficon { background: #fff; padding: 1px; border-radius: 4px; width: 18px; height: 18px; }
.panel > .panel-head .h-site { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.panel > .panel-head.ph-down { background: linear-gradient(180deg, #b91c1c, #991b1b); }
.panel > .panel-head.ph-down h2[data-i]::before { background: #fecaca; }
.panel > .panel-head.ph-down .live-dot { color: #fecaca; }
.panel > .panel-head.ph-down .live-dot::before { background: #fecaca; }
.panel > .panel-head .legend .lg-line { background: #4ade80; }
.panel > .panel-head .legend .lg-down { background: #fca5a5; opacity: 1; }
@media (max-width: 760px) {
  .panel > .panel-head { padding: 9px 14px; margin: -14px -16px 12px; flex-wrap: wrap; row-gap: 2px; }
  .panel > .panel-head h2 { font-size: 14px; }
}
h2[data-i="bookmark"] { --i: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 3h12v18l-6-4-6 4z%22/%3E%3C/svg%3E"); }
h2[data-i="grid"] { --i: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%223%22 width=%227%22 height=%227%22 rx=%221%22/%3E%3Crect x=%2214%22 y=%223%22 width=%227%22 height=%227%22 rx=%221%22/%3E%3Crect x=%223%22 y=%2214%22 width=%227%22 height=%227%22 rx=%221%22/%3E%3Crect x=%2214%22 y=%2214%22 width=%227%22 height=%227%22 rx=%221%22/%3E%3C/svg%3E"); }
h2[data-i="clock"] { --i: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%229%22/%3E%3Cpath d=%22M12 7v5l3 2%22/%3E%3C/svg%3E"); }
h2[data-i="alert"] { --i: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3 2 20h20z%22/%3E%3Cpath d=%22M12 10v4M12 17h.01%22/%3E%3C/svg%3E"); }
h2[data-i="bars"] { --i: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 20V10M10 20V4M16 20v-7M22 20H2%22/%3E%3C/svg%3E"); }
h2[data-i="layers"] { --i: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m12 3 9 5-9 5-9-5z%22/%3E%3Cpath d=%22m3 13 9 5 9-5%22/%3E%3C/svg%3E"); }
h2[data-i="chart"] { --i: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 3v18h18%22/%3E%3Cpath d=%22m7 15 4-5 4 3 5-7%22/%3E%3C/svg%3E"); }
h2[data-i="wrench"] { --i: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2.4-.6-.6-2.4z%22/%3E%3C/svg%3E"); }


/* ---------- "someone just checked" activity toast ---------- */
.activity { position: fixed; left: 16px; bottom: 16px; z-index: 30; width: 330px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06);
  opacity: 0; transform: translateX(-24px) translateY(8px); }
.activity.is-in { animation: activity-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards; }
.activity.is-leaving { animation: activity-out 0.4s ease-in forwards; }
@keyframes activity-in { from { opacity: 0; transform: translateX(-24px) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes activity-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(14px); } }
.activity-link { display: flex; gap: 12px; align-items: center; padding: 12px 36px 12px 12px; color: var(--text); }
.activity-link:hover { text-decoration: none; }
.activity-link:hover b { text-decoration: underline; }
.activity-badge { position: relative; flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); border: 1px solid var(--border); }
.activity-badge img { width: 20px; height: 20px; border-radius: 4px; }
.activity-badge::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; }
.activity-badge.is-up::after { background: var(--up); animation: ring-up 1.2s ease-out 0.4s 2; }
.activity-badge.is-down::after { background: var(--down); animation: ring-down 1.2s ease-out 0.4s 2; }
.activity-text { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; line-height: 1.35; }
.activity-text strong { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.activity-status { font-size: 10.5px; font-weight: 750; letter-spacing: 0.04em; padding: 0 5px; border-radius: 4px; }
.activity-status.is-up { color: var(--up); background: var(--up-bg); }
.activity-status.is-down { color: var(--down); background: var(--down-bg); }
.activity-time { font-size: 11.5px; color: var(--muted) !important; }
.activity-close { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; background: none; border-radius: 6px;
  color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.activity-close:hover { background: var(--soft); color: var(--text); }
@media (max-width: 760px) {
  .activity { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; border-radius: 10px; }
  .activity-link { padding: 9px 34px 9px 10px; gap: 10px; }
  .activity-badge { width: 32px; height: 32px; }
  .activity-time { display: none; }
}
@media (max-width: 340px) { .activity { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .activity.is-in { animation: none; opacity: 1; transform: none; }
  .activity.is-leaving { animation: none; opacity: 0; }
}


/* ---------- top sites: show first N, toggle the rest (works without JS) ---------- */
.site-grid .site-card.extra { display: none; }
.show-all-toggle:checked + .site-grid .site-card.extra { display: flex; animation: fade-in 0.3s ease-out both; }
.show-all-btn { display: flex; align-items: center; justify-content: center; margin: 12px auto 2px; width: max-content; padding: 7px 18px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text); background: var(--panel); cursor: pointer; user-select: none; }
.show-all-btn:hover { border-color: var(--border-strong); background: var(--soft); }
.show-all-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.show-all-btn .sa-less { display: none; }
.show-all-toggle:checked ~ .show-all-btn .sa-more { display: none; }
.show-all-toggle:checked ~ .show-all-btn .sa-less { display: inline; }




/* ---------- visit site link ---------- */
.verdict-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.btn-visit { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; background: var(--accent); color: var(--accent-text);
  font-size: 13.5px; font-weight: 600; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.btn-visit:hover { background: var(--accent-hover); text-decoration: none; }
.btn-visit:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.ext-icon { flex: none; vertical-align: -1px; }
.ext-link .ext-icon { margin-left: 2px; opacity: 0.7; }
@media (max-width: 760px) {
  .verdict { flex-wrap: wrap; }
  .verdict-side { width: 100%; align-items: stretch; }
  .btn-visit { justify-content: center; max-width: none; }
}


/* ---------- live status dots on UP / DOWN badges (CSS only, compositor-friendly) ---------- */
.badge-up, .badge-down { position: relative; padding-left: 17px; }
.badge-up::before, .badge-down::before, .badge-up::after, .badge-down::after {
  content: ""; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; }
.badge-up::before { background: var(--up); }
.badge-down::before { background: var(--down); animation: dot-blink 1.2s ease-in-out infinite; }
.badge-up::after { background: var(--up); animation: dot-ring 2s ease-out infinite; }
.badge-down::after { background: var(--down); animation: dot-ring 1.2s ease-out infinite; }
@keyframes dot-ring { 0% { transform: scale(1); opacity: 0.55; } 80%, 100% { transform: scale(3); opacity: 0; } }
@keyframes dot-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
/* Stagger the grid a little so 60 dots don't pulse in lockstep */
.site-card:nth-child(3n+1) .badge::after { animation-delay: -0.4s; }
.site-card:nth-child(3n+2) .badge::after { animation-delay: -0.9s; }
.feed li:nth-child(2n) .badge::after { animation-delay: -0.6s; }

/* Verdict banner: soft ring around the big status icon */
.verdict-up .verdict-icon, .verdict-down .verdict-icon { position: relative; }
.verdict-up .verdict-icon::after, .verdict-down .verdict-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; animation: icon-ring 2.2s ease-out infinite; }
.verdict-up .verdict-icon::after { border: 2px solid var(--up); }
.verdict-down .verdict-icon::after { border: 2px solid var(--down); animation-duration: 1.3s; }
@keyframes icon-ring { 0% { transform: scale(1); opacity: 0.7; } 80%, 100% { transform: scale(1.6); opacity: 0; } }

/* Activity toast + similar-sites status chips get the same dot */
.activity-status.is-up, .activity-status.is-down { position: relative; padding-left: 13px; }
.activity-status.is-up::before, .activity-status.is-down::before { content: ""; position: absolute; left: 4px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; }
.activity-status.is-up::before { background: var(--up); }
.activity-status.is-down::before { background: var(--down); animation: dot-blink 1.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .badge-up::after, .badge-down::after, .verdict-icon::after { display: none; }
  .badge-down::before { animation: none; }
}


/* ---------- "Rate IsSiteUpOrDown" ---------- */
.stars { position: relative; display: inline-block; color: var(--empty); letter-spacing: 1px; font-size: 16px; line-height: 1; }
.stars-fill { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: #f59e0b; }
.stars-0{width:0%}.stars-5{width:5%}.stars-10{width:10%}.stars-15{width:15%}.stars-20{width:20%}.stars-25{width:25%}.stars-30{width:30%}.stars-35{width:35%}.stars-40{width:40%}.stars-45{width:45%}.stars-50{width:50%}.stars-55{width:55%}.stars-60{width:60%}.stars-65{width:65%}.stars-70{width:70%}.stars-75{width:75%}.stars-80{width:80%}.stars-85{width:85%}.stars-90{width:90%}.stars-95{width:95%}.stars-100{width:100%}
.site-rate { margin-top: 8px; margin-bottom: 4px; }
.sr-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 16px 18px;
  border: 1px solid var(--warn-border); border-radius: 10px; background: linear-gradient(135deg, var(--warn-bg), var(--panel) 70%); }
.sr-left h2 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.sr-summary { display: flex; align-items: center; gap: 8px; }
.sr-avg { font-size: 15px; }
.sr-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sr-stars { display: inline-flex; flex-direction: row-reverse; border: 0; margin: 0; padding: 0; }
.sr-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sr-stars label { font-size: 30px; line-height: 1; padding: 0 2px; color: var(--empty); cursor: pointer; transition: color 0.1s, transform 0.1s; }
.sr-stars label:hover, .sr-stars label:hover ~ label, .sr-stars input:checked ~ label { color: #f59e0b; }
.sr-stars label:hover { transform: scale(1.12); }
.sr-stars input:focus-visible + label { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
.sr-more { display: none; gap: 10px; align-items: center; flex-wrap: wrap; flex-basis: 100%; }
.sr-form:has(input[name="score"]:checked) { flex-basis: 100%; }
.sr-form:has(input[name="score"]:checked) .sr-more { display: flex; animation: fade-in 0.25s ease-out; }
.sr-improve { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.sr-improve legend { font-size: 13.5px; font-weight: 650; margin-bottom: 6px; padding: 0; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 5px 12px; border: 1px solid var(--input-border); border-radius: 999px; font-size: 13px; color: var(--text-2); background: var(--panel); transition: background 0.12s, border-color 0.12s, color 0.12s; }
.chip:hover span { border-color: var(--border-strong); }
.chip input:checked + span { background: var(--up-bg); border-color: var(--up); color: var(--up-strong); font-weight: 600; }
.chip input:checked + span::before { content: "✓ "; }
.chip input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.sr-more input[name="message"] { height: 36px; flex: 1; min-width: 200px; width: auto; padding: 0 10px; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; font-size: 14px; }
.sr-more button { height: 36px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; }
.sr-form.is-done .sr-stars, .sr-form.is-done .sr-more { display: none !important; }
.sr-thanks { margin: 0; font-weight: 600; color: var(--up-strong); animation: fade-in 0.3s ease-out; }
@media (max-width: 760px) {
  .sr-inner { flex-direction: column; align-items: flex-start; }
  .sr-more { flex-wrap: wrap; width: 100%; }
  .sr-more input[name="message"] { flex: 1; width: auto; max-width: none; }
  .sr-stars label { font-size: 34px; }
}

h2[data-i="book"] { --i: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 4h6a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H4z%22/%3E%3Cpath d=%22M20 4h-6a3 3 0 0 0-3 3v13a2 2 0 0 1 2-2h7z%22/%3E%3C/svg%3E"); }

/* ---------- guides, FAQ, contact, footer ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack > .panel { margin: 0; }
.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list li + li { border-top: 1px solid var(--border); }
.guide-list a { display: flex; flex-direction: column; padding: 8px 0; color: var(--text); }
.guide-list a:hover strong { text-decoration: underline; }
.guide-list strong { font-weight: 600; font-size: 14px; }
.page-hero { padding: 28px 0 8px; max-width: 760px; }
.page-hero h1 { font-size: clamp(26px, 3.6vw, 34px); letter-spacing: -0.02em; margin-bottom: 8px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 16px 0 24px; }
.guide-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--panel); transition: border-color 0.12s, transform 0.12s; }
.guide-card:hover { border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; }
.guide-card strong { font-size: 16px; line-height: 1.35; }
.guide-desc { color: var(--text-2); font-size: 14px; }
.guide-meta { color: var(--muted); font-size: 12.5px; margin-top: auto; }
.guide-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.guide-tags span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--up-strong); background: var(--up-bg); border-radius: 4px; padding: 1px 6px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.guide-byline { margin: -2px 0 6px; }
.guide h2 { scroll-margin-top: 64px; }
.callout { margin: 20px 0; padding: 12px 16px; border-left: 4px solid var(--up); background: var(--up-bg); border-radius: 0 8px 8px 0; color: var(--text-2); }
.guide-cta { margin: 28px 0 8px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--soft); display: flex; flex-direction: column; gap: 10px; }
.faq { max-width: 820px; margin: 12px 0 24px; }
.faq-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--panel); }
.faq-item summary { cursor: pointer; list-style: none; padding: 14px 44px 14px 16px; font-weight: 650; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--muted); transition: transform 0.15s; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item summary:hover { background: var(--soft); border-radius: 10px; }
.faq-a { padding: 0 16px 6px; color: var(--text-2); }
.faq-a p { margin: 0 0 10px; }
.contact-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; margin: 12px 0 24px; }
.contact-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; }
.contact-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.contact-email { font-size: clamp(20px, 3vw, 26px); font-weight: 750; letter-spacing: -0.01em; word-break: break-all; }
.contact-topics { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text-2); }
.contact-topics li { margin: 4px 0; }
.contact-side h3 { margin: 0 0 8px; font-size: 15px; }
.contact-side ul { margin: 0; padding-left: 18px; font-size: 14px; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; padding: 8px 0 16px; }
.footer-cols h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); margin: 0 0 8px; }
.footer-cols nav { display: flex; flex-direction: column; gap: 6px; }
.footer-cols nav a { color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.footer-cols nav a:hover { color: var(--text); text-decoration: underline; }
.footer-brand p { margin: 8px 0 0; max-width: 260px; }
.footer-note { border-top: 1px solid var(--border); padding-top: 12px; }
@media (max-width: 760px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .contact-wrap { grid-template-columns: 1fr; }
}


/* ---------- logo ---------- */
.brand { gap: 8px; }
.logo-mark { flex: none; border-radius: 8px; }
.logo-up, .logo-down { transform-box: fill-box; animation: bob-up 1.6s ease-in-out infinite; }
.logo-down { animation-name: bob-down; }
@keyframes bob-up { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
@keyframes bob-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(1.6px); } }
.brand:hover .logo-up, .brand:hover .logo-down { animation-duration: 0.8s; }
.wordmark { font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.wm-up { color: var(--up); }
.wm-or { color: var(--muted); font-weight: 600; margin: 0 1px; }
.wm-down { color: var(--down); }
@media (prefers-reduced-motion: reduce) { .logo-up, .logo-down { animation: none; } }


/* ---------- dark theme: system preference by default, or forced by the toggle ---------- */
:root[data-theme="dark"] {
  --bg: #0b1120;
  --panel: #111827;
  --soft: #172033;
  --soft-2: #1e293b;
  --border: #263244;
  --border-strong: #475569;
  --input-border: #334155;
  --text: #e5e7eb;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --up: #22c55e;
  --up-bg: rgba(34, 197, 94, 0.12);
  --up-border: rgba(34, 197, 94, 0.35);
  --up-strong: #86efac;
  --down: #f87171;
  --down-bg: rgba(248, 113, 113, 0.12);
  --down-border: rgba(248, 113, 113, 0.38);
  --down-strong: #fecaca;
  --down-bg-hover: rgba(248, 113, 113, 0.2);
  --accent: #e2e8f0;
  --accent-hover: #cbd5e1;
  --accent-text: #0f172a;
  --link: #60a5fa;
  --warn-bg: rgba(245, 158, 11, 0.1);
  --warn-border: rgba(245, 158, 11, 0.35);
  --warn-text: #fcd34d;
  --empty: #334155;
  --flash: rgba(250, 204, 21, 0.16);
  --shimmer: rgba(255, 255, 255, 0.07);
  --overlay: rgba(17, 24, 39, 0.86);
  --head-1: #1e293b;
  --head-2: #172033;
  --logo-bg: #1e293b;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #0b1120;
  --panel: #111827;
  --soft: #172033;
  --soft-2: #1e293b;
  --border: #263244;
  --border-strong: #475569;
  --input-border: #334155;
  --text: #e5e7eb;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --up: #22c55e;
  --up-bg: rgba(34, 197, 94, 0.12);
  --up-border: rgba(34, 197, 94, 0.35);
  --up-strong: #86efac;
  --down: #f87171;
  --down-bg: rgba(248, 113, 113, 0.12);
  --down-border: rgba(248, 113, 113, 0.38);
  --down-strong: #fecaca;
  --down-bg-hover: rgba(248, 113, 113, 0.2);
  --accent: #e2e8f0;
  --accent-hover: #cbd5e1;
  --accent-text: #0f172a;
  --link: #60a5fa;
  --warn-bg: rgba(245, 158, 11, 0.1);
  --warn-border: rgba(245, 158, 11, 0.35);
  --warn-text: #fcd34d;
  --empty: #334155;
  --flash: rgba(250, 204, 21, 0.16);
  --shimmer: rgba(255, 255, 255, 0.07);
  --overlay: rgba(17, 24, 39, 0.86);
  --head-1: #1e293b;
  --head-2: #172033;
  --logo-bg: #1e293b;
  color-scheme: dark;
  }
}
.logo-mark rect { fill: var(--logo-bg); }
.topbar { background: var(--bg); }
.panel > .panel-head { box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04); }
.activity { background: var(--panel); }
.activity-badge::after { border-color: var(--panel); }

/* ---------- theme toggle (sun / moon) ---------- */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.theme-toggle { position: relative; width: 36px; height: 36px; flex: none; border: 1px solid var(--border); border-radius: 50%;
  background: var(--panel); color: var(--text); cursor: pointer; display: grid; place-items: center; transition: border-color 0.15s, background 0.2s; }
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.theme-toggle svg { position: absolute; width: 18px; height: 18px; transition: transform 0.45s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0.25s; }
.theme-toggle .icon-sun { color: #f59e0b; opacity: 0; transform: rotate(-90deg) scale(0.4); }
.theme-toggle .icon-moon { color: #6366f1; opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.4); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.4); }
}
:root.theme-anim, :root.theme-anim * { transition: background-color 0.3s, border-color 0.3s, color 0.2s !important; }

@media (max-width: 980px) {
  .status-layout { grid-template-columns: 1fr; }
  .side-sticky { position: static; }
}
@media (max-width: 760px) {
  .feed-compact li { grid-template-columns: 1fr auto 64px; }
  .verdict-favicon { display: none; }
}

@media (max-width: 760px) {
  .cols, .cols-status { grid-template-columns: 1fr; gap: 0; }
  .topnav { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid .row { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  .verdict { padding: 16px; align-items: flex-start; }
  .verdict-icon { width: 40px; height: 40px; font-size: 22px; }
  .feed li { grid-template-columns: 1fr auto 80px; }
}
@media (prefers-reduced-motion: reduce) { .pulse, .spinner { animation: none; } }
.footer .brand { text-decoration: none; color: var(--text); }
.sr-more input[name="message"], .form-grid input, .form-grid textarea { background: var(--panel); color: var(--text); }
