/**
 * BK Properties — public site (home, features, search).
 *
 * Small on purpose: a top bar with the 3x3 apps menu, a centred home screen, a plain
 * content page, and a one-line footer. Light and dark are driven entirely by the design
 * tokens below (Issue 97); this file also owns the token set the /admin/* shell extends.
 */

/* ── Tokens ─────────────────────────────────────────────────── */

/*
 * Design tokens (Issue 97). One documented set drives every surface — the landing page,
 * the dashboard and the /admin/* shell all read these, so the whole app is themed from
 * here. Light is the default ``:root``; the dark palette below flips the same names when
 * the OS prefers dark (unless the user forced light) or the user picks dark via the toggle.
 * Because every rule uses ``var(--token)``, only these values change between themes.
 * A short inventory lives in docs/DESIGN/design-system.md.
 */
:root {
  color-scheme: light;

  /* ── Neutrals: page, surfaces, ink, lines ───────────────────
     Warm off-white page; white panels lift off it without needing heavy borders. */
  --bg: #f7f6f3;
  --surface: #ffffff;
  --bg-soft: #eeece7;          /* hover wash, footer */
  --ink: #1a1e24;              /* body text */
  --muted: #565f6a;            /* secondary text, labels */
  --line: #dfdcd5;             /* borders */
  --line-soft: #e9e6e0;        /* hairlines */

  /* ── Brand green ────────────────────────────────────────────
     One green in five roles: ``--brand`` accent/fill, ``--brand-hover`` fill-hover,
     ``--brand-deep`` strong text/accents on tints, ``--brand-soft``/``--brand-tint`` washes.
     ``--on-brand`` is the readable foreground on a brand fill. */
  --brand: #0f6e56;
  --brand-hover: #0a5240;
  --brand-deep: #0a5240;
  --brand-soft: #e9f3ef;
  --brand-tint: #d8ebe3;       /* icon circles */
  --on-brand: #ffffff;

  /* ── Semantic status ────────────────────────────────────────
     Danger and warning read identically wherever they appear (buttons, badges, text, rows). */
  --danger: #b3261e;           /* destructive fill */
  --danger-deep: #8f1d17;      /* destructive fill hover */
  --danger-ink: #b3261e;       /* destructive text on the page */
  --danger-soft: #fbe9e7;      /* destructive hover wash */
  --on-danger: #ffffff;
  --warn-bg: #fdeccf;          /* warning badge / row wash */
  --warn-ink: #8a5a00;

  /* ── Code surfaces ──────────────────────────────────────────
     The log/terminal block is deliberately dark in both themes; prose code follows the theme. */
  --code-bg: #0f1720;
  --code-ink: #dfe6ee;
  --md-code-bg: #f6f8fa;
  --md-link: #0969da;

  /* ── Type ───────────────────────────────────────────────────*/
  --font: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* The apps menu follows Google's launcher, Roboto included. */
  --font-ui: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* ── Metrics: layout, radius, focus, elevation ──────────────*/
  --shell: 46rem;
  --gutter: clamp(1rem, 5vw, 2rem);
  --tap: 2.75rem;
  --radius: 10px;              /* inputs / small controls */
  --radius-lg: 16px;           /* cards / panels */
  --radius-pill: 999px;
  --focus-ring: var(--brand-soft);   /* 3px glow paired with a --brand outline */
  --shadow: 0 1px 2px rgba(26, 30, 36, .06), 0 10px 30px rgba(26, 30, 36, .12);
  --shadow-icon: 0 2px 6px rgba(15, 110, 86, .28);
  /* Google's launcher elevation: a tight contact shadow plus a wide soft one. */
  --shadow-menu: 0 1px 3px rgba(26, 30, 36, .30), 0 4px 8px 3px rgba(26, 30, 36, .15);
}

/* ── Dark palette ─────────────────────────────────────────────
   Applied when the OS prefers dark and the user has not forced light, and always when the
   user explicitly chooses dark. Same token names, dark values — the whole app flips together.
   Brand is lifted so it reads as an accent on dark surfaces; ``--on-brand`` becomes a dark ink
   so brand fills keep AA contrast. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14171b;
    --surface: #1b1f25;
    --bg-soft: #23282f;
    --ink: #e7e9ec;
    --muted: #a2abb6;
    --line: #2f353d;
    --line-soft: #262b32;

    --brand: #2fb896;
    --brand-hover: #45cba9;
    --brand-deep: #5fd6b4;
    --brand-soft: #17322a;
    --brand-tint: #1f4d40;
    --on-brand: #06231b;

    --danger: #a83228;
    --danger-deep: #bb3a2f;
    --danger-ink: #f3938a;
    --danger-soft: #3a201e;
    --on-danger: #ffffff;
    --warn-bg: #3a2f16;
    --warn-ink: #f0c674;

    --md-code-bg: #23282f;
    --md-link: #6cb6ff;

    --focus-ring: rgba(95, 214, 180, .30);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .55);
    --shadow-icon: 0 2px 6px rgba(0, 0, 0, .5);
    --shadow-menu: 0 1px 3px rgba(0, 0, 0, .6), 0 4px 8px 3px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14171b;
  --surface: #1b1f25;
  --bg-soft: #23282f;
  --ink: #e7e9ec;
  --muted: #a2abb6;
  --line: #2f353d;
  --line-soft: #262b32;

  --brand: #2fb896;
  --brand-hover: #45cba9;
  --brand-deep: #5fd6b4;
  --brand-soft: #17322a;
  --brand-tint: #1f4d40;
  --on-brand: #06231b;

  --danger: #a83228;
  --danger-deep: #bb3a2f;
  --danger-ink: #f3938a;
  --danger-soft: #3a201e;
  --on-danger: #ffffff;
  --warn-bg: #3a2f16;
  --warn-ink: #f0c674;

  --md-code-bg: #23282f;
  --md-link: #6cb6ff;

  --focus-ring: rgba(95, 214, 180, .30);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .55);
  --shadow-icon: 0 2px 6px rgba(0, 0, 0, .5);
  --shadow-menu: 0 1px 3px rgba(0, 0, 0, .6), 0 4px 8px 3px rgba(0, 0, 0, .45);
}

/* ── Base ───────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: var(--brand);
  color: var(--on-brand);
  padding: .55rem 1rem;
  border-radius: 0 0 10px 10px;
  font-size: .9rem;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }

/* ── Top bar ────────────────────────────────────────────────── */

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem var(--gutter);
}

.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  background: var(--brand);
  color: var(--on-brand);
  flex: none;
  box-shadow: var(--shadow-icon);
  transition: transform .15s ease;
}
.brand:hover .brand-mark { transform: translateY(-1px); }
.brand-mark svg { width: 1.15rem; height: 1.15rem; }
.brand-text { font-size: .9375rem; }
.home .brand { visibility: hidden; }          /* the wordmark below carries the brand */

.topbar-actions { display: flex; align-items: center; gap: .35rem; }

.topbar-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 .95rem;
  border-radius: 999px;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink);
  transition: background .15s ease, color .15s ease;
}
.topbar-link:hover { background: var(--brand-soft); color: var(--brand-deep); }

/* ── Apps menu (3x3) ────────────────────────────────────────── */

.apps-button {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.apps-button svg { width: 1.4rem; height: 1.4rem; }
.apps-button:hover { background: var(--brand-soft); color: var(--brand-deep); }
.apps-button[aria-expanded="true"] { background: var(--brand); color: var(--on-brand); }

/* Panel: solid white card, always fully opaque, sitting clearly above the page
   on Google-launcher elevation. It stays open until Escape or a click outside. */
.apps-panel {
  position: absolute;
  top: calc(100% - .25rem);
  right: var(--gutter);
  z-index: 40;
  width: min(21.5rem, calc(100vw - 2 * var(--gutter)));
  max-height: min(34rem, calc(100dvh - 5rem));
  overflow-y: auto;
  padding: .6rem;
  background: var(--surface);
  border: 1px solid rgba(26, 30, 36, .08);
  border-radius: 20px;
  box-shadow: var(--shadow-menu);
}
.apps-panel[hidden] { display: none; }

.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .15rem; }

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: .5rem;
  /* Reset so the signed-in "Sign out" tile (a <button>) matches the <a> tiles. */
  width: 100%;
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .9rem .35rem .8rem;
  border-radius: 14px;
  font-family: var(--font-ui);
  font-size: .78125rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: .01em;
  text-align: center;
  color: var(--ink);
  transition: background .12s ease, color .12s ease;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-deep);
  transition: background .12s ease, color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.app-icon svg { width: 1.4rem; height: 1.4rem; }

/* Hover/focus fills the whole cell — the same shape you clicked — and flips the
   icon to solid green so the target is unmistakable. */
.app:hover,
.app:focus-visible {
  background: var(--brand-tint);
  color: var(--brand-deep);
}
.app:hover .app-icon,
.app:focus-visible .app-icon {
  background: var(--brand);
  color: var(--on-brand);
  transform: scale(1.06);
  box-shadow: var(--shadow-icon);
}
.app:active .app-icon { transform: scale(.98); }

/* ── Home ───────────────────────────────────────────────────── */

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem var(--gutter) 4rem;
  text-align: center;
}

.wordmark {
  font-size: clamp(2.25rem, 1.4rem + 4vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}
.wordmark span { color: var(--brand); }

.tagline { color: var(--muted); font-size: 1.0625rem; }

.search {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: min(34rem, 100%);
  margin-top: .75rem;
  padding: .3rem .3rem .3rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(26, 30, 36, .04);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.search:hover { border-color: #cfcbc2; box-shadow: 0 2px 10px rgba(26, 30, 36, .10); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow); }

.search-icon { display: grid; place-items: center; color: var(--brand); flex: none; }
.search-icon svg { width: 1.2rem; height: 1.2rem; }

.search input {
  flex: 1;
  min-width: 0;
  height: var(--tap);
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
}
.search input:focus { outline: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search button {
  flex: none;
  min-height: 2.25rem;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}
.search button:hover { background: var(--brand-hover); box-shadow: var(--shadow-icon); }

.home-links {
  margin-top: .5rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .9375rem;
  color: var(--muted);
}
.home-links a {
  padding: .35rem .6rem;
  border-radius: 999px;
  color: var(--brand-deep);
  font-weight: 500;
  transition: background .15s ease;
}
.home-links a:hover { background: var(--brand-soft); }

/* ── Content pages ──────────────────────────────────────────── */

.page {
  flex: 1;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(1.5rem, 5vw, 3rem) var(--gutter) 4rem;
}

.page h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.25rem); }
.lead { margin-top: .6rem; color: var(--muted); }

.group {
  margin-top: 2.5rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.modules > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: .9rem .75rem;
  margin-inline: -.75rem;
  border-radius: 10px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 5rem;
  transition: background .15s ease;
}
.modules > div:hover { background: var(--surface); }
.modules dt { font-weight: 500; }
.modules dd { color: var(--muted); }
.modules > div:target { background: var(--brand-soft); }
.modules > div:target dt { color: var(--brand-deep); }
.modules-later dt { color: var(--muted); }

.page-cta { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .6rem; }

.button {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: .9375rem;
  font-weight: 500;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
}
.button:hover { background: var(--brand-hover); box-shadow: var(--shadow-icon); }
.button-quiet {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.button-quiet:hover {
  background: var(--surface);
  border-color: var(--brand);
  color: var(--brand-deep);
  box-shadow: none;
}

.search-inline { margin: 0 0 2.5rem; width: min(34rem, 100%); }

.empty h1 { font-size: 1.5rem; }
.empty p { margin-top: .6rem; color: var(--muted); }
.empty a { color: var(--brand-deep); font-weight: 500; }
.empty a:hover { text-decoration: underline; }

/* ── Listing search results ─────────────────────────────────── */

.results-count { margin: 0 0 1.25rem; color: var(--muted); font-size: .9375rem; }

.listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  list-style: none;
}
.listing-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.listing-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.listing-title { font-size: 1.0625rem; font-weight: 600; }
.listing-location { color: var(--muted); font-size: .9375rem; }
.listing-facts { display: flex; flex-wrap: wrap; gap: .35rem .85rem; color: var(--muted); font-size: .875rem; }
.listing-rent { margin-top: .25rem; font-weight: 600; color: var(--brand-deep); }
.listing-rent span { color: var(--muted); font-weight: 400; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}
.pagination-status { color: var(--muted); font-size: .9375rem; }
.pagination-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pagination-link:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-soft); }
.pagination-link.is-disabled { color: var(--muted); border-color: var(--line); pointer-events: none; opacity: .6; }

/* ── Legal pages (privacy, terms) ───────────────────────────── */

/* Long-form prose: the module list resets `ul`/`ol`, so re-establish readable
   list markers and vertical rhythm just inside the legal document body. */
.legal { max-width: 52rem; }
.legal .lead { font-size: 1.0625rem; }
.legal-updated {
  margin-top: .35rem;
  font-size: .875rem;
  color: var(--muted);
}
.legal-note {
  margin-top: 1.25rem;
  padding: .9rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: var(--surface);
  font-size: .9375rem;
  color: var(--muted);
}
.legal section { margin-top: 2.25rem; scroll-margin-top: 5rem; }
.legal h2 {
  font-size: 1.25rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.legal h3 { margin-top: 1.5rem; font-size: 1.0625rem; font-weight: 600; }
.legal p { margin-top: .9rem; }
.legal p + p { margin-top: .75rem; }
.legal ul, .legal ol { margin-top: .9rem; padding-left: 1.4rem; }
.legal ul { list-style: disc; }
.legal ol { list-style: decimal; }
.legal li { margin-top: .4rem; }
.legal li::marker { color: var(--muted); }
.legal a { color: var(--brand-deep); font-weight: 500; }
.legal a:hover { text-decoration: underline; }
.legal dfn { font-style: normal; font-weight: 600; }

/* Contact card for the POPIA Information Officer. */
.legal-contact {
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.legal-contact dt { font-weight: 600; }
.legal-contact dd { color: var(--muted); }
.legal-contact dd + dt { margin-top: .6rem; }

/* Data-retention table — scrolls horizontally on narrow screens rather than
   forcing the page body to. */
.table-scroll { margin-top: 1.1rem; overflow-x: auto; }
.retention-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: .9375rem;
}
.retention-table caption {
  text-align: left;
  color: var(--muted);
  font-size: .875rem;
  padding-bottom: .6rem;
}
.retention-table th,
.retention-table td {
  padding: .7rem .85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.retention-table thead th {
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}
.retention-table tbody tr:hover { background: var(--surface); }

/* ── Footer ─────────────────────────────────────────────────── */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: 1rem var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: .8125rem;
  color: var(--muted);
}
.footer nav { display: flex; gap: .35rem; }
.footer a {
  padding: .3rem .6rem;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.footer a:hover { background: var(--brand-soft); color: var(--brand-deep); }

/* ── Status modal ───────────────────────────────────────────── */
/* Readiness popup opened from the footer "Status" link; mirrors the sign-in modal. */

.status-modal-backdrop {
  position: fixed; inset: 0;
  z-index: var(--z-modal, 100);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4rem 1rem 1rem;
  background: rgba(26, 30, 36, .32);
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.status-modal-backdrop.open { visibility: visible; opacity: 1; pointer-events: auto; }

.status-modal {
  width: min(34rem, 100%);
  max-height: min(80vh, 42rem);
  display: flex; flex-direction: column;
  padding: 1.6rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-menu);
  position: relative;
  transform: translateY(-10px);
  transition: transform .2s ease;
}
.status-modal-backdrop.open .status-modal { transform: translateY(0); }

/* The flex rows below set an explicit display, which would otherwise beat the [hidden]
   attribute's display:none — make hidden authoritative inside the modal. */
.status-modal [hidden] { display: none !important; }

.status-modal-close {
  position: absolute; top: .75rem; right: .75rem;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  border: 0; background: none; border-radius: 50%;
  font-size: 1.35rem; line-height: 1; color: var(--muted); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.status-modal-close:hover { background: var(--brand-soft); color: var(--brand-deep); }
.status-modal h2 { font-size: 1.15rem; margin-bottom: 1rem; padding-right: 1.5rem; }

.status-summary { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.status-pill {
  display: inline-flex; align-items: center;
  padding: .2rem .7rem; border-radius: 999px;
  font-family: var(--font-ui); font-size: .8rem; font-weight: 500;
  text-transform: capitalize; letter-spacing: .01em;
  background: var(--bg-soft); color: var(--ink);
}
.status-pill--ok { background: var(--brand-tint); color: var(--brand-deep); }
.status-pill--degraded { background: #fbeecb; color: #8a6100; }
.status-pill--down { background: #f7d9d6; color: #8a1c14; }
.status-code { font-family: var(--font-ui); font-size: .8rem; color: var(--muted); }

.status-loading { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--muted); }
.status-error { font-size: .875rem; color: var(--danger-ink); }
.status-spinner {
  display: inline-block; width: 1rem; height: 1rem;
  border: 2px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: bkp-status-spin .7s linear infinite;
}
@keyframes bkp-status-spin { to { transform: rotate(360deg); } }

.status-json {
  overflow: auto;
  margin: 0;
  padding: .9rem 1rem;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .8125rem;
  line-height: 1.55;
  white-space: pre;
  tab-size: 2;
}
.status-json:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.status-json .tok-key  { color: var(--ink); font-weight: 600; }
.status-json .tok-str  { color: var(--brand-deep); }
.status-json .tok-num  { color: #8a5a00; }
.status-json .tok-bool { color: #6b3fa0; }
.status-json .tok-null { color: #8a1c14; }

/* ── Small screens ──────────────────────────────────────────── */

@media (max-width: 34rem) {
  .modules > div { grid-template-columns: 1fr; gap: .15rem; }
  .footer { justify-content: center; text-align: center; }
  .search { padding-left: .85rem; }
  .search button { padding: 0 .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; }
  .status-spinner { animation: none; }
}
