:root {
  --red: #C00000;
  --red-ink: #ffffff;
  --bg: #ffffff;
  --surface: #f5f4f2;
  --text: #1b1b1b;
  --muted: #5c5c5c;
  --line: #e2e0dc;
  --ok: #1e7a3c;
  --warn: #9a5b00;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #e23a3a;
    --bg: #141414;
    --surface: #1f1f1f;
    --text: #f2f2f2;
    --muted: #b0b0b0;
    --line: #333333;
    --ok: #5cc27e;
    --warn: #e2a64b;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
main { max-width: 520px; margin: 0 auto; }
header.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
header.brand img { width: 36px; height: 36px; border-radius: 8px; }
header.brand span { font-weight: 700; font-size: 20px; }
header.brand small { color: var(--muted); font-weight: 400; margin-left: auto; font-size: 13px; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 10px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 15px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 14px 0; }
ol, ul { padding-left: 22px; margin: 0 0 12px; }
li { margin-bottom: 6px; }
label { display: block; font-weight: 600; font-size: 15px; margin: 12px 0 6px; }
input, select {
  width: 100%; font: inherit; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.seg { display: flex; gap: 8px; }
.seg label { position: relative; flex: 1; margin: 0; font-weight: 500; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; background: var(--bg); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
.seg input:checked + span { color: var(--red); font-weight: 700; }
.seg label:has(input:checked) { border-color: var(--red); }
button, .btn {
  display: block; width: 100%; margin-top: 16px; padding: 15px; border: 0; border-radius: 12px;
  background: #C00000; color: #ffffff; font: inherit; font-weight: 700; text-align: center;
  text-decoration: none; cursor: pointer;
}
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 600; }
button:disabled { opacity: 0.55; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.status { font-weight: 600; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
code, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; }
.hidden { display: none !important; }
.deal-img {
  aspect-ratio: 4 / 3; border-radius: 14px; background: linear-gradient(135deg, #e9c79a, #b77a3d);
  display: flex; align-items: flex-end; padding: 14px; color: #fff; margin-bottom: 14px;
}
.deal-img strong { font-size: 22px; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scroll { overflow-x: auto; }
.pass { color: var(--ok); font-weight: 700; }
.fail { color: var(--red); font-weight: 700; }
.card h2:first-child { margin-top: 0; }
