:root {
  --bg: #ffffff; --fg: #15171a; --muted: #5a6068; --line: #e2e4e8; --panel: #f5f6f8;
  --accent: #1d5fd1; --accent-fg: #ffffff; --ok: #0a6b2d; --warn: #8a5a00; --bad: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111316; --fg: #e9ebee; --muted: #a2a8b0; --line: #2b2f35; --panel: #1a1d21;
    --accent: #6ea0ff; --accent-fg: #0b1220; --ok: #5ccf87; --warn: #e3b552; --bad: #ff8a80;
  }
}
:root[data-theme="dark"] {
  --bg: #111316; --fg: #e9ebee; --muted: #a2a8b0; --line: #2b2f35; --panel: #1a1d21;
  --accent: #6ea0ff; --accent-fg: #0b1220; --ok: #5ccf87; --warn: #e3b552; --bad: #ff8a80;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main, header.top, footer { max-width: 46rem; margin: 0 auto; padding: 0 16px; }
header.top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }
nav a { margin-right: 12px; color: var(--muted); text-decoration: none; }
nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }
a { color: var(--accent); }
h1 { font-size: 1.8rem; line-height: 1.2; margin: 1.6rem 0 0.6rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.6rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 16px 0; }
.tiers { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.price { font-size: 1.6rem; font-weight: 700; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 8px; padding: 12px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.55; cursor: not-allowed; }
form.check { display: flex; flex-wrap: wrap; gap: 8px; }
input, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; min-width: 0; flex: 1 1 14rem; }
.small { font-size: 0.9rem; color: var(--muted); }
.grade { font-size: 2.2rem; font-weight: 800; }
.st-good { color: var(--ok); } .st-needs-attention { color: var(--warn); } .st-broken-or-missing { color: var(--bad); }
details { border-top: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }
footer { margin-top: 3rem; padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.chat { position: fixed; right: 16px; bottom: 16px; z-index: 5; }
.chat-box { display: none; width: min(22rem, calc(100vw - 32px)); max-height: 70vh; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); flex-direction: column; }
.chat.open .chat-box { display: flex; }
.chat.open .chat-toggle { display: none; }
.chat-log { overflow-y: auto; padding: 12px; flex: 1; }
.chat-log p { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-log p.me { background: transparent; border: 1px solid var(--line); }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.chat-head button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; }
.chat form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chat form input { flex: 1 1 auto; }
.optin label.tick { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; }
.optin label.tick input { flex: 0 0 auto; width: auto; margin-top: 5px; }
.optin .hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
