/*
 * Before you switch: pre-flight (static/preflight.js), on /<domain> next to Make it safe and on the
 * record at /r/<domain>. The front page's language, on its tokens only (instrument.css :root and
 * feel.css "One language for every public page"): rounded surfaces, pill buttons (.i-btn), system
 * type with tabular figures, --safe for an answer, --bad for a hello that got none, --warn when it
 * could not be tested. Both themes follow from the tokens. Transform and opacity only; the replay
 * runs once when the person presses the button, and nothing moves under prefers-reduced-motion.
 */
.pf { display: grid; gap: 16px; min-width: 0; }
#preflight { scroll-margin-top: 84px; }
.pf-lede { margin: 0; max-width: 66ch; color: var(--muted); font-size: var(--fs-md, 17px); line-height: 1.5; }
.pf-lede b { color: var(--text); font-weight: 650; }

.pf-race { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pf-lane { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) minmax(130px, 200px); align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md, 16px); background: var(--bg); }
.pf-lane[hidden] { display: none; }
.pf-name { display: grid; gap: 3px; min-width: 0; }
.pf-name b { font: 650 15px/1.25 var(--sans); color: var(--text); letter-spacing: -.01em; }
.pf-size { font: 13px/1.35 var(--sans); color: var(--dim); font-variant-numeric: tabular-nums; }
.pf-track { position: relative; height: 12px; border-radius: var(--r-pill, 999px); background: var(--bg-3); overflow: hidden; }
.pf-bar { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0); background: var(--dim); border-radius: inherit; transition-property: transform; transition-timing-function: linear; }
.pf-mark { display: none; }
.pf-out { font: 600 14px/1.3 var(--sans); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pf-res::before { content: ""; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; vertical-align: -5px; font: 800 12px/1 var(--sans); }
.pf-lane[data-result="ok"] .pf-bar { background: var(--safe); }
.pf-lane[data-result="ok"] .pf-res { color: var(--text); }
.pf-lane[data-result="ok"] .pf-res::before { content: "\2713"; background: var(--safe); color: var(--safe-ink); }
.pf-lane[data-result="bad"] { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.pf-lane[data-result="bad"] .pf-bar { background: var(--bad); }
.pf-lane[data-result="bad"] .pf-res { color: var(--bad); }
.pf-lane[data-result="bad"] .pf-res::before { content: "\2715"; background: var(--bad); color: var(--bg); }
.pf[data-state="racing"] .pf-lane:not([data-result]) .pf-bar { background: var(--text); }
.pf[data-state="sending"] .pf-res { color: var(--dim); }
.pf[data-anim] .pf-lane[data-result] .pf-res { animation: pf-land 260ms var(--ease, ease-out) 1 both; }
@keyframes pf-land { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.pf-axis { display: none; margin: -6px 0 0; }
.pf-axis.on { display: block; }

.pf-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.pf .pf-go { cursor: pointer; }
.pf .pf-go[disabled], .pf .pf-go[aria-busy="true"] { opacity: .6; cursor: progress; }
.pf .pf-go[hidden] { display: none; }
.pf-fine { font-size: 13.5px; color: var(--dim); line-height: 1.45; margin: 0; }
.pf-say { flex: 1 1 260px; min-width: 0; }
.pf a:focus-visible, .pf summary:focus-visible, .pf .pf-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pf-verdict { border: 1px solid var(--line); border-radius: var(--r-md, 16px); background: var(--bg); padding: 18px 20px; display: grid; gap: 10px; }
.pf-verdict[hidden] { display: none; }
.pf[data-anim] .pf-verdict { animation: pf-land 320ms var(--ease, ease-out) 1 both; }
.pf-verdict p { margin: 0; line-height: 1.5; max-width: 72ch; }
.pf-v-h { font: 700 clamp(20px, 2vw, 26px)/1.2 var(--sans); letter-spacing: -.02em; color: var(--text); display: flex; align-items: center; gap: 12px; }
.pf-v-ic { width: 14px; height: 14px; border-radius: 50%; background: var(--dim); flex: none; }
.pf-verdict[data-v="safe_to_turn_on"] .pf-v-ic, .pf-verdict[data-v="already_safe"] .pf-v-ic { background: var(--safe); box-shadow: 0 0 0 5px var(--glow); }
.pf-verdict[data-v="path_problem"] { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.pf-verdict[data-v="path_problem"] .pf-v-ic { background: var(--bad); }
.pf-verdict[data-v="couldnt_test"] .pf-v-ic { background: var(--warn); }
.pf-cause { color: var(--muted); }
.pf-sub { font: 600 12px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-top: 4px !important; }
.pf-fixes { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; line-height: 1.5; }
.pf-more summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.pf-more ul { margin: 6px 0 10px; padding-left: 1.2em; color: var(--muted); line-height: 1.5; }
.pf-more p { margin: 10px 0 0; color: var(--muted); }
.pf a { color: var(--text); text-underline-offset: 3px; }
.pf-scope { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.pf-inside { font-weight: 650; }

@media (max-width: 640px) {
  .pf-lane { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "track" "out"; gap: 8px; padding: 12px 14px; }
  .pf-name { grid-area: name; }
  .pf-out { grid-area: out; text-align: left; }
  .pf-track { grid-area: track; }
  .pf-verdict { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-bar { transition: none !important; }
  .pf[data-anim] .pf-lane[data-result] .pf-res, .pf[data-anim] .pf-verdict { animation: none; }
}
