/* goChecker: the newsGo look. Cream page, white panels, one red accent,
   Inter for the interface and Playfair Display for titles, compact 14px text. */

/* ── Fonts (self-hosted; the CSP allows only this origin) ── */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/inter-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/inter-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/inter-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/playfair-display-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/playfair-display-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ── Tokens ── */
:root {
  --accent: #cc2200;
  --accent-dk: #a81c00;
  --bg: #f6f6ef;
  --surface: #fff;
  --border: #e5e5cb;
  --line: #f0f0f0;
  --head: #fafafa;
  --text: #1a1a1a;
  --muted: #666;

  /* status colours: the edge/background come from newsGo; the text is
     darkened a little so it stays readable on the pale backgrounds */
  --ok: #27ae60;     --ok-bg: #e8f5e9;     --ok-text: #1e7e46;
  --warn: #f39c12;   --warn-bg: #fff8e1;   --warn-text: #8a5a00;
  --bad: #c0392b;    --bad-bg: #fdecea;    --bad-text: #a52a1f;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Top bar ── */
.site-header { background: var(--accent); padding: 0.55rem 0; }
.brand {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.site-nav { display: flex; align-items: center; gap: 0.5rem; }
.nav-form { margin: 0; }

.nav-btn {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-btn:hover { background: var(--text); border-color: var(--text); color: #fff; }
.nav-btn--off { color: var(--muted); background: transparent; cursor: default; }
.nav-btn--off:hover { background: transparent; border-color: var(--border); color: var(--muted); }

/* in the red bar the buttons are outlined in white */
.site-header .nav-btn { background: transparent; border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.site-header .nav-btn:hover { background: #fff; border-color: #fff; color: var(--accent); }

:where(a, button, input, select):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.site-header :where(a, button):focus-visible { outline-color: #fff; }

/* ── Page ── */
.site-main { flex: 1; padding: 2rem 0 3rem; }

.headline {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.headline--small { font-size: clamp(1.5rem, 4vw, 1.9rem); margin-bottom: 0.2rem; }
.lede { margin: 0 0 1.5rem; max-width: 40rem; color: var(--muted); font-size: 1rem; }
.headline--small + .lede { font-size: 0.875rem; }

/* ── Forms ── */
.field {
  width: 100%;
  height: 3rem;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.field::placeholder { color: #8a8a8a; }
.field:hover { border-color: #cfcfae; }
.field[aria-invalid="true"] { border-color: var(--bad); }
select.field { appearance: auto; }
.field--sm { height: 2.4rem; padding: 0 0.6rem; font-size: 0.875rem; }

.btn-check-site {
  width: 100%;
  height: 3rem;
  padding: 0 1.75rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-check-site:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn-sm { width: auto; height: 2.4rem; padding: 0 1.1rem; font-size: 0.875rem; }

.hint { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.8125rem; }

.form-error, .notice {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 2px;
  background: var(--surface);
  font-weight: 600;
}
.form-error { border-left-color: var(--bad); background: var(--bad-bg); color: var(--bad-text); }
.notice { margin: 0 0 1rem; border-left-color: var(--ok); background: var(--ok-bg); color: var(--ok-text); }

.login-form .label { display: block; margin: 1.1rem 0 0.3rem; font-weight: 600; }
.login-submit { margin-top: 1.4rem; }

/* Show / hide the password (the button appears only when password-toggle.js runs). */
.password-field { position: relative; }
.password-field .field { padding-right: 4.5rem; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.password-toggle:hover { border-color: var(--accent); color: var(--accent); }
.password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.filters {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
}
.filters .label {
  display: block;
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.filters-row { margin-top: 0.4rem; }
.filter-actions { display: flex; align-items: center; gap: 1rem; }
.reset-link { color: var(--muted); font-weight: 600; }
.filters .form-error { margin-top: 0.75rem; }

/* ── Result card (public result page) ── */
.result {
  margin: 0 0 2.5rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--ok);
  border-radius: 2px;
  background: var(--surface);
}
.result--restricted { border-left-color: var(--warn); }
.result--down { border-left-color: var(--bad); }
.result-headline {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ok-text);
}
.result--restricted .result-headline { color: var(--warn-text); }
.result--down .result-headline { color: var(--bad-text); }
.result-reason { margin: 0 0 1rem; font-size: 1rem; }
.result-note {
  margin: 0 0 1rem;
  padding: 0.35rem 0.7rem;
  border-left: 4px solid var(--warn);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-weight: 600;
}
.result-details { margin: 1.25rem 0 0; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.result-details dt { color: var(--muted); font-weight: 600; }
.result-details dd { margin: 0 0 0.6rem; overflow-wrap: anywhere; }
@media (min-width: 576px) { .result-details dt, .result-details dd { margin-bottom: 0.4rem; } }

.again { margin: 0 0 0.9rem; font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; }
.back-link { font-weight: 600; color: var(--accent); }

/* ── Route check: run button and summary ── */
.run-form { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.run-form .btn-check-site { width: auto; min-width: 11rem; height: 2.6rem; }
.run-form .btn-check-site:disabled { background: #b8b8b0; border-color: #b8b8b0; cursor: default; }
.run-note { color: var(--muted); }

.run-summary { margin-bottom: 1.5rem; }
.run-meta { margin: 0 0 0.75rem; color: var(--muted); }

.stat {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 2px;
  background: var(--surface);
}
.stat--ok { border-left-color: var(--ok); }
.stat--slow { border-left-color: var(--warn); }
.stat--error { border-left-color: var(--bad); }
.stat--skipped { border-left-color: #b8b8b0; }
.stat-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stat-n { display: block; font-size: 2rem; font-weight: 700; line-height: 1; }

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
}
.results { width: 100%; margin: 0; border-collapse: collapse; font-size: 0.875rem; }
.results thead th {
  padding: 0.7rem 1rem;
  border-bottom: 2px solid var(--border);
  background: var(--head);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.results tbody td { padding: 0.7rem 1rem; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.results tbody tr:first-child td { border-top: 0; }
.results tbody tr:hover { background: var(--head); }
.cell-url { min-width: 14rem; overflow-wrap: anywhere; font-weight: 600; }
.cell-note { min-width: 12rem; overflow-wrap: anywhere; color: var(--muted); }

/* Access: public is plain, restricted is tinted */
.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 2px;
  background: #f0f0f0;
  color: #555;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge--restricted { background: var(--bad-bg); color: var(--bad-text); }

/* Result: visitor verdicts and route labels share one set of soft badges */
.verdict, .results .label {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.verdict--up, .label--ok { background: var(--ok-bg); color: var(--ok-text); }
.verdict--restricted, .label--slow { background: var(--warn-bg); color: var(--warn-text); }
.verdict--down, .label--error { background: var(--bad-bg); color: var(--bad-text); }
.label--skipped { background: #f0f0f0; color: #555; }

/* Speed: coloured text on a fixed scale */
.speed { font-weight: 700; }
.speed--fast { color: var(--ok-text); }
.speed--normal { color: #555; font-weight: 600; }
.speed--slow { color: var(--warn-text); }
.speed--none { color: #999; font-weight: 400; }

.btn-delete {
  padding: 0.15rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-delete:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad-text); }
.row-delete { margin: 0; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }
.pager-count { color: var(--muted); }

/* ── Footer ── */
.site-footer {
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

/* ── Phones ── */
@media (max-width: 575.98px) {
  .site-main { padding: 1.25rem 0 2rem; }
  .btn-check-site { width: 100%; }
  .run-form .btn-check-site { width: 100%; }
}

/* Under 768px each table row becomes a labelled card instead of scrolling sideways */
@media (max-width: 767.98px) {
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  .results thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
  .results, .results tbody, .results tr, .results td { display: block; width: 100%; }
  .results tbody tr {
    margin-bottom: 0.9rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 2px;
    background: var(--surface);
  }
  .results tbody td {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.55rem 0.9rem;
    border-top: 1px solid var(--line);
    text-align: right;
    overflow-wrap: anywhere;
  }
  .results tbody td:first-child { border-top: 0; }
  .results tbody td::before {
    content: attr(data-label);
    flex: none;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
  }
  .cell-url, .cell-note { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Tech page */
.tech-pre {
  margin: 0 0 1rem;
  padding: 1rem;
  overflow-x: auto;
  background: var(--head);
  border: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.site-footer a { color: inherit; text-decoration: underline; }
.tech-h2 { margin: 2rem 0 0.75rem; font-size: 1.25rem; font-weight: 700; }
.results tbody th { padding: 0.7rem 1rem; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
.results tbody tr:first-child th { border-top: 0; }

/* Charts page (colours: blue and orange are the first two categorical slots, grey is "other") */
:root {
  --series-client: #2a78d6;
  --series-doctor: #eb6834;
  --series-other: #8a8a82;
}
.btn-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.tile-note { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.75rem; }

.chart-card { margin: 0 0 1.5rem; padding: 0.25rem 1.25rem 1.25rem; border: 1px solid var(--border); border-radius: 2px; background: var(--surface); }
.chart-card .tech-h2 { margin-top: 1rem; }
.chart-empty { margin: 0; padding: 1rem 0; color: var(--ok-text); font-weight: 600; }
.chart-svg { display: block; width: 100%; height: auto; max-width: 40rem; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.axis-text--end { text-anchor: end; }
.axis-text--mid { text-anchor: middle; }
.hit { fill: transparent; }
g:hover > .hit { fill: rgba(0, 0, 0, 0.04); }
.seg--client { fill: var(--series-client); }
.seg--doctor { fill: var(--series-doctor); }
.seg--other { fill: var(--series-other); }

.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0 0 0.75rem; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--muted); }
.legend li, .hbar-role { display: inline-flex; align-items: center; gap: 0.4rem; }
.swatch { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; }
.swatch--client { background: var(--series-client); }
.swatch--doctor { background: var(--series-doctor); }
.swatch--other { background: var(--series-other); }
.swatch--ok { background: var(--ok); }
.swatch--bad { background: var(--bad); }
.swatch--none { background: var(--border); }

.chart-table { margin-top: 0.75rem; font-size: 0.875rem; }
.chart-table summary { cursor: pointer; color: var(--accent); font-weight: 600; }

.strip { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; margin: 0 0 0.75rem; padding: 0; list-style: none; }
.strip-cell { height: 2.25rem; border-radius: 2px; }
.strip-cell--ok { background: var(--ok); }
.strip-cell--bad { background: var(--bad); }
.strip-cell--none { background: var(--border); }

/* ── Cookie banner ── */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08); padding: 0.85rem 0; }
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.cookie-banner-text { margin: 0; flex: 1 1 20rem; }
.cookie-banner-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cookie-btn { height: 2.4rem; padding: 0 1.1rem; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); }
.cookie-btn:hover { border-color: var(--accent); }
.cookie-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.cookie-btn--primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
@media (max-width: 575px) { .strip { grid-template-columns: repeat(15, 1fr); } }

.hbars { margin: 0; padding: 0; list-style: none; }
.hbars li { margin: 0 0 0.9rem; }
.hbar-head { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.875rem; }
.hbar-path { overflow-wrap: anywhere; font-weight: 600; }
.hbar-role { flex: none; color: var(--muted); font-size: 0.8125rem; }
.hbar-svg { display: block; width: 100%; height: 0.5rem; margin: 0.3rem 0 0.2rem; }
.hbar-track { fill: var(--line); }
.hbar-value { color: var(--muted); font-size: 0.8125rem; }
