:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1c1b19;
  --muted: #6d6a63;
  --line: #e3dfd6;
  --accent: #1c1b19;
  --accent-ink: #f6f4ef;
  --up: #15803d;
  --up-soft: #dcfce7;
  --down: #c2410c;
  --down-soft: #ffedd5;
  --link: #1d4ed8;
  --focus: #2563eb;
  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --width: 720px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #1d1c1a;
    --ink: #f1efe9;
    --muted: #9b978e;
    --line: #2f2d29;
    --accent: #f1efe9;
    --accent-ink: #141413;
    --up: #4ade80;
    --up-soft: #12301d;
    --down: #fb923c;
    --down-soft: #3a1f0e;
    --link: #93b4ff;
    --focus: #60a5fa;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: var(--width); margin: 0 auto; padding: 0 16px 72px; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header / footer ---------- */
.nav {
  max-width: var(--width);
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--up);
  display: inline-block;
  animation: blink 2.4s ease-in-out infinite;
}
.nav-links { display: flex; gap: 20px; }
.nav-links a, .footer-links a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav-links a:hover, .footer-links a:hover, [aria-current="page"] { color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: var(--width); margin: 0 auto; padding: 32px 16px 40px; }
.footer-brand { margin: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.footer-tag { margin: 4px 0 18px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .95rem; }
.footer-copy { margin: 18px 0 0; color: var(--muted); font-size: .85rem; }

/* ---------- Checker (home page) ---------- */
.hero { padding: clamp(20px, 6vh, 56px) 0 0; }
.hero h1 {
  font-size: clamp(1.15rem, 3.2vw, 1.4rem);
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.checker {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 10px 0 -4px color-mix(in srgb, var(--ink) 12%, transparent);
}
.checker input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 clamp(1.15rem, 3.6vw, 1.5rem) var(--mono);
  padding: 16px 14px;
  outline: none;
}
.checker input::placeholder { color: var(--muted); opacity: .6; }
.checker button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 1.15rem var(--sans);
  padding: 0 30px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s, transform .1s;
}
.checker button:hover { opacity: .88; }
.checker button:active { transform: scale(.97); }
.checker button:disabled { opacity: .55; cursor: progress; }
.tagline { margin: 16px 2px 0; font-size: clamp(1.05rem, 2.8vw, 1.2rem); color: var(--muted); letter-spacing: -0.01em; }
.tagline strong { color: var(--ink); font-weight: 700; }
.tagline + .hero-note { margin-top: 4px; }
.hero-note { margin: 14px 2px 0; color: var(--muted); font-size: .95rem; }

#result { margin-top: 20px; }
#result:empty { display: none; }
.card {
  border-radius: 16px;
  padding: 22px 22px 20px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  animation: rise .25s ease-out;
}
.card.up   { background: var(--up-soft);   border-color: transparent; }
.card.down { background: var(--down-soft); border-color: transparent; }
.verdict {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
  margin: 0;
}
.card.up .verdict   { color: var(--up); }
.card.down .verdict { color: var(--down); }
.verdict .pip { width: 14px; height: 14px; border-radius: 50%; background: currentColor; flex: none; }
.card.up .pip { animation: pulse 1.8s ease-out infinite; }
.host { font-family: var(--mono); font-weight: 600; word-break: break-all; }
.detail { margin: 8px 0 0; }
.meta { margin: 10px 0 0; font: .85rem var(--mono); color: var(--muted); }
.tip { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); font-size: .95rem; }
.tip p { margin: 0; }
.pitch {
  margin-top: 14px;
  padding: 14px 16px 12px;
  background: var(--surface);
  border-radius: 12px;
  border-left: 4px solid var(--down);
}
.pitch.good { border-left-color: var(--up); }
.tip:has(> .pitch:first-child) { border-top: 0; padding-top: 0; }
.pitch .pitch-q { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; color: var(--ink); }
.pitch .pitch-text { margin-top: 4px; color: var(--ink); opacity: .85; }
.pitch .offer { margin-top: 12px; }
.offer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.button.small { padding: 9px 18px; font-size: .95rem; border-radius: 10px; }
.aff-note { font-size: .8rem; color: var(--muted); }
.offer .aff-note { flex-basis: 100%; }
.cta .aff-note { display: block; margin: 10px 0 0; font-weight: 400; font-size: .8rem; }
.footer-disclosure { margin: 18px 0 0; color: var(--muted); font-size: .85rem; max-width: 60ch; }
.card.error { color: var(--down); }
.card.checking { color: var(--muted); display: flex; align-items: center; gap: 12px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--ink);
  animation: spin .7s linear infinite;
}

.section-label {
  font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted);
  margin: 0 0 10px;
}
.recent { margin-top: 48px; }
.recent ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.recent-item {
  width: 100%;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border: 0; border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
a.recent-item { text-decoration: none; }
.recent-item:hover { background: var(--surface); }
.s { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--line); }
.s.up { background: var(--up); }
.s.down { background: var(--down); }

/* ---------- Down right now ---------- */
.down-now { margin-top: 40px; }
.down-now .section-label { display: flex; align-items: center; gap: 8px; color: var(--down); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--down); animation: blink 1.4s ease-in-out infinite; }

/* ---------- Popular sites grid ---------- */
.popular { margin-top: 48px; }
.pop-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pop-card {
  display: grid;
  grid-template-columns: 10px 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s;
}
.pop-card:hover { border-color: var(--ink); }
.pop-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-status { grid-column: 2; color: var(--muted); font-size: .85rem; }

/* ---------- Category links and pages ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.chip:hover { border-color: var(--ink); }
.chip.current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.category-head .chips { margin-top: 18px; }
.category-head + .popular { margin-top: 28px; }
.popular .section-label a { color: inherit; text-decoration: none; }
.popular .section-label a:hover { color: var(--ink); }

/* ---------- Website status pages ---------- */
.site-hero .back { display: inline-block; margin-bottom: 14px; }
.site-hero .site-title { font-size: clamp(1.9rem, 5.5vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); margin: 0 0 6px; }
.site-sub { margin: 0 0 18px; color: var(--muted); }
.history { margin-top: 48px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stats b { display: block; font-size: 1.3rem; letter-spacing: -0.01em; line-height: 1.2; }
.stats span { color: var(--muted); font-size: .85rem; }
.chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 90px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.bar { flex: 0 1 18px; min-width: 3px; border-radius: 3px 3px 0 0; background: var(--up); opacity: .8; }
.bar.down { background: var(--down); opacity: 1; }
.bar:hover { opacity: 1; }
.chart-note { margin: 8px 2px 0; color: var(--muted); font-size: .85rem; }
.sub-label { font-size: 1.05rem; margin: 28px 0 10px; letter-spacing: -0.01em; }
.outages { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.outages li {
  display: grid; grid-template-columns: 10px 150px 1fr; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: .95rem;
}
.outages li.ongoing { background: var(--down-soft); }
.outage-when { color: var(--muted); }
.outage-live { color: var(--down); font-weight: 700; }
.history td .s { vertical-align: 1px; margin-right: 4px; }
.history td:first-child { font-family: var(--sans); }
/* ---------- Visitor problem reports ---------- */
.reports { margin-top: 40px; }
.report-box { margin-top: 0; }
.report-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.report-btn {
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: 600 .95rem var(--sans);
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s;
}
.report-btn:hover:not(:disabled) { border-color: var(--ink); }
.report-btn:disabled { cursor: default; opacity: .55; }
.report-btn.chosen { opacity: 1; border-color: var(--down); }
.report-thanks { margin: 10px 0 0; font-size: .95rem; color: var(--ink); }
.report-stats { margin-top: 16px; }
.report-total { margin: 0 0 10px; }
.report-alert {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px; padding: 10px 14px;
  background: var(--down-soft); color: var(--down); font-weight: 600;
  border-radius: 10px;
}
.report-chart { height: 70px; }
.bar.report { flex: 1; background: var(--down); opacity: .85; }
.breakdown { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.breakdown li { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; font-size: .95rem; }
.kind-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.kind-bar span { display: block; height: 100%; background: var(--down); }
.pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Bookmarklet ---------- */
.bookmarklet { margin-top: 48px; }
.bm-box {
  display: flex; align-items: center; gap: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px;
}
.bm-link {
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; text-decoration: none;
  padding: 12px 18px; border-radius: 999px;
  cursor: grab;
  box-shadow: 0 6px 0 -2px color-mix(in srgb, var(--ink) 18%, transparent);
}
.bm-link::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--up); }
.bm-link:active { cursor: grabbing; }
.bm-box p { margin: 0; }
.bm-lead { font-weight: 700; font-size: 1.05rem; }
.bm-small { margin-top: 8px !important; color: var(--muted); font-size: .85rem; }
.bm-small code { font-family: var(--mono); font-size: .9em; }
.bm-hint { color: var(--down); font-weight: 600; }

.site-help { padding-top: 0; margin-top: 48px; }
.site-help h2 { margin-top: 0; }
.recent-item .name { font-family: var(--mono); font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .ago { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 4px; border-bottom: 1px solid var(--line); }

.how { margin-top: 56px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how-grid div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.how-grid b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.how-grid p { margin: 0; color: var(--muted); font-size: .95rem; }
.how-grid .host { word-break: normal; font-weight: 400; }
.more-links { margin-top: 18px; color: var(--muted); }

/* ---------- Content pages ---------- */
.prose { padding-top: clamp(16px, 4vh, 40px); font-size: 1.06rem; }
.prose h1 { font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 12px; }
.prose h2 { font-size: 1.45rem; letter-spacing: -0.02em; margin: 40px 0 8px; line-height: 1.25; }
.prose h3 { font-size: 1.15rem; margin: 28px 0 6px; }
.prose p, .prose li { max-width: 66ch; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.lede { font-size: 1.2rem; color: var(--muted); margin-top: 0; }
.updated { color: var(--muted); font-size: .9rem; }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--up); border-radius: 10px; padding: 14px 18px; margin: 24px 0; }
.callout p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
table { border-collapse: collapse; width: 100%; font-size: .98rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
td:first-child { font-family: var(--mono); white-space: nowrap; }

.guide-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.guide-list a {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px;
  transition: border-color .15s;
}
.guide-list a:hover { border-color: var(--ink); }
.guide-list b { display: block; font-size: 1.2rem; letter-spacing: -0.01em; margin-bottom: 4px; }
.guide-list span { color: var(--muted); }
.back { display: inline-block; margin-bottom: 18px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }

.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq details:first-of-type { border-top: 1px solid var(--line); margin-top: 24px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; padding: 14px 28px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.4rem; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; }

.cta { margin-top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.cta p { margin: 0 0 12px; font-weight: 600; font-size: 1.1rem; }
.button {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  text-decoration: none; font-weight: 700; padding: 12px 22px; border-radius: 12px;
}
.button:hover { opacity: .88; }

@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes rise  { from { opacity: 0; transform: translateY(6px); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 560px) {
  .checker { flex-direction: column; }
  .checker button { padding: 16px; }
  .how-grid { grid-template-columns: 1fr; }
  .pop-grid { grid-template-columns: repeat(2, 1fr); }
  .bm-box { flex-direction: column; align-items: flex-start; gap: 14px; }
  .breakdown li { grid-template-columns: 110px 1fr 40px; }
  .outages li { grid-template-columns: 10px 1fr; row-gap: 2px; }
  .outage-what { grid-column: 2; }
  .stats { gap: 6px; }
  .stats div { padding: 10px; }
  .stats b { font-size: 1rem; }
  .stats span { font-size: .75rem; }
  .nav-links { gap: 16px; }
}
