/* PTSD Self-Check (PCL-5). Site chrome on screen (tokens from common.css,
   2026-11-17); a clean light worksheet when printed, for the doctor. */
* { margin: 0; padding: 0; box-sizing: border-box; }


body { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; line-height: 1.6; color: var(--text); background: var(--bg); }
a { color: var(--accent); }
a:hover { color: var(--highlight); }
.sheet { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.back { font-size: 0.88rem; margin-bottom: 1.25rem; }
body.has-snav .back { padding-left: 2.9rem; min-height: 36px; display: flex; align-items: center; }

header { text-align: center; margin-bottom: 1.5rem; }
.label { font-size: 0.78rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--label); margin-bottom: 0.5rem; }
h1 { font-size: 2rem; font-weight: 300; line-height: 1.2; }
h1 strong { font-weight: 700; color: var(--highlight); }
h2 { font-size: 1.2rem; color: var(--highlight); margin-bottom: 0.6rem; }
.sub { color: var(--text-dim); margin-top: 0.6rem; font-size: 1.02rem; }
.sub strong { color: var(--text); }

.note { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--highlight); border-radius: 8px; padding: 0.8rem 1rem; font-size: 0.93rem; color: var(--text-dim); margin-bottom: 1.4rem; }
.note strong { color: var(--text); }
.keep-mount { margin: -0.6rem 0 1.4rem; }
.event { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--text-dim); margin-bottom: 1.2rem; }
.event input { font: inherit; font-size: 1rem; padding: 0.55rem 0.7rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }
.event input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.instructions { font-size: 0.92rem; color: var(--text-dim); margin-bottom: 0.7rem; }
.stem { font-weight: 700; margin-bottom: 1rem; }

.cluster { border: none; margin-bottom: 1.2rem; }
.cluster legend { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--highlight); padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); width: 100%; margin-bottom: 0.3rem; }
.q { padding: 0.8rem 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.q-text { margin-bottom: 0.55rem; }
.q-num { font-weight: 700; color: var(--text-dim); margin-right: 0.15rem; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; }
.scale label { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; border: 1px solid var(--border); border-radius: 6px; padding: 0.4rem 0.2rem; cursor: pointer; text-align: center; background: var(--surface); }
.scale label:hover { border-color: var(--accent-dim); }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale .n { font-weight: 700; font-size: 1.05rem; }
.scale .l { font-size: 0.7rem; color: var(--text-dim); line-height: 1.2; }
.scale label:has(input:checked) { background: var(--highlight); border-color: var(--highlight); color: var(--on-highlight); }
.scale label:has(input:checked) .l { color: var(--on-highlight); opacity: 0.8; }
.scale label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.result { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; margin: 1.5rem 0; }
.result.flag { border-color: var(--highlight); }
.total { font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--highlight); }
.of { font-size: 1rem; color: var(--text-dim); margin-left: 0.3rem; font-weight: 400; }
.answered { font-size: 0.8rem; color: var(--text-dim); margin: 0.2rem 0 0.6rem; }
.clusters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin-bottom: 0.6rem; }
.clusters div { background: var(--surface-2); border-radius: 5px; padding: 0.35rem 0.5rem; }
.clusters span { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.clusters strong { font-size: 1.1rem; }
.clusters small { color: var(--text-dim); margin-left: 0.2rem; }
.message { font-size: 0.95rem; }

.mini { position: fixed; left: 50%; bottom: 0.8rem; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 0.45rem 1.1rem; font-size: 0.9rem; box-shadow: 0 4px 14px var(--shadow); white-space: nowrap; z-index: 10; }
.mini.flag { border-color: var(--highlight); }
.mini strong { font-size: 1.15rem; color: var(--highlight); }
.mini span { color: var(--text-dim); margin-left: 0.5rem; font-size: 0.8rem; }

.next ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; color: var(--text-dim); }
.next strong { color: var(--text); }
.crisis { border: 1px solid var(--red); border-radius: 8px; padding: 0.7rem 0.9rem; font-size: 0.93rem; }
.crisis a { color: var(--text); font-weight: 700; }
footer { margin-top: 1.6rem; font-size: 0.78rem; color: var(--text-dim); display: flex; flex-direction: column; gap: 0.3rem; }
.actions { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.actions button { font: inherit; font-weight: 600; padding: 0.65rem 1.2rem; border-radius: 6px; border: 1px solid var(--highlight); background: var(--highlight); color: var(--on-highlight); cursor: pointer; }
.actions button.ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.actions button.ghost:hover { color: var(--text); border-color: var(--text-dim); }

@media (max-width: 560px) {
    .sheet { padding: 2rem 1rem 4rem; }
    h1 { font-size: 1.7rem; }
    .scale .l { font-size: 0.62rem; }
    .clusters { grid-template-columns: repeat(2, 1fr); }
}

/* Print: a light, plain worksheet to hand a doctor */
@media print {
    body { background: #fff; color: #000; }
    .sheet { padding: 0; max-width: none; }
    a { color: #000; }
    h1, h1 strong, h2, .total, .cluster legend { color: #000; }
    .sub, .instructions, .answered, .clusters span, .clusters small, .q-num, .scale .l, footer, .next ul, .of { color: #333; }
    .note, .result, .clusters div, .scale label { background: #fff !important; border-color: #999; color: #000; }
    .result { border: 2px solid #000; }
    .q, .cluster legend { border-color: #ccc; }
    .scale label:has(input:checked) { background: #000 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .scale label:has(input:checked) .l { color: #fff !important; }
    .no-print, .back, .crisis, .event input::placeholder { display: none !important; }
    .event input { border: 1px solid #999; background: #fff; color: #000; }
}
