/* Context Map — screen-reader-first, no graphics. Mobile-first, large targets for
   one-handed use in a crowd, AAA contrast, and grey luminance boundaries so it
   survives macOS/iOS Invert Colours (coloured edges flip hue and lose contrast). */

:root {
    --ink: #111;
    --ink-soft: #333;
    --line: #5a5a5a;
    --fill: #f4f6f8;
    --focus: #0033aa;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 1.25rem;
    max-width: 42rem;
    margin-inline: auto;
    font: 1.125rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: #fff;
    hyphens: none;
}

h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.5rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1.0625rem; margin: 1rem 0 0.25rem; }

h1:focus { outline: none; }   /* programmatic focus target, no visible ring */

p { margin: 0 0 0.75rem; }

/* ── Disclaimer ─────────────────────────────────────────────────────────── */
.cm-disclaimer ul { margin: 0.5rem 0 1rem; padding-inline-start: 1.25rem; }
.cm-disclaimer li { margin: 0 0 0.6rem; }

.cm-risk {
    padding: 0.875rem 1rem;
    background: var(--fill);
    border: 2px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
}

.cm-consent {
    margin: 1.25rem 0;
    padding: 0.875rem 1rem;
    background: var(--fill);
    border: 2px solid var(--line);
    border-radius: 8px;
}
.cm-consent label {
    display: flex;
    gap: 0.625rem;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 600;
}
.cm-consent input[type="checkbox"] {
    inline-size: 1.5rem;
    block-size: 1.5rem;
    margin: 0.15rem 0 0;
    flex-shrink: 0;
    accent-color: var(--focus);
}

/* ── Buttons (big targets) ──────────────────────────────────────────────── */
.cm-btn {
    display: block;
    inline-size: 100%;
    min-block-size: 3.25rem;
    padding: 0.75rem 1rem;
    margin: 0 0 0.75rem;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
}
.cm-btn:hover { background: var(--fill); }

/* TEMPORARY — CNIB @ Pride highlight (remove ~2026-07-04 with the booth POI). Bright
   CNIB yellow so the booth button stands out; text stays var(--ink) #111, AAA on the
   yellow. Hover darkens slightly to keep the feedback the grey hover would otherwise
   lose (the id selector outranks .cm-btn:hover). */
#cm-cnib-pride { background: #fff100; }
#cm-cnib-pride:hover { background: #f2e400; }

.cm-btn:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}
.cm-btn:disabled {
    color: #6a6a6a;
    background: #ececec;
    border-color: #9a9a9a;
    cursor: not-allowed;
}

/* The Start button stands a little prouder once enabled. */
.cm-start { margin-top: 0.5rem; }

/* "Describe as I move" pressed state — soft fill + heavier grey border (the boundary
   carries the state under invert, not colour). aria-pressed also tells the AT. */
.cm-btn[aria-pressed="true"] {
    background: var(--fill);
    border-color: var(--ink);
    border-width: 3px;
}
.cm-btn[aria-pressed="true"]::after {
    content: " — on";
    font-weight: 700;
}

/* ── App output ─────────────────────────────────────────────────────────── */
.cm-intro { color: var(--ink-soft); }

.cm-controls { margin: 1.25rem 0; }

.cm-detail:empty { display: none; }
.cm-detail {
    margin: 1rem 0;
    padding: 0.875rem 1rem;
    background: var(--fill);
    border: 2px solid var(--line);
    border-radius: 8px;
}
.cm-detail ul { margin: 0.25rem 0 0.75rem; padding-inline-start: 1.25rem; }
.cm-detail li { margin: 0.15rem 0; }

.cm-logwrap h2 { font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.cm-log { display: flex; flex-direction: column; gap: 0.4rem; }
.cm-line {
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
}
.cm-line:first-child { font-weight: 600; border-width: 2px; }

/* ── Screen-reader-only live region ─────────────────────────────────────── */
.cm-sr-only {
    position: absolute;
    inline-size: 1px; block-size: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap; border: 0;
}

@media (prefers-contrast: high) {
    :root { --line: #000; }
    .cm-risk, .cm-consent, .cm-detail, .cm-btn { border-color: #000; }
    .cm-btn:disabled { color: #000; border-color: #000; }
}

@media (prefers-reduced-motion: no-preference) {
    .cm-btn { transition: background 0.12s ease; }
}
