/* Open Newsrooms demo (/demo/ and /demo/verify/). Builds on styles.css. */

.dm-mono, .dm-pre, .dm-words, .dm-kv dd.dm-mono { font-family: var(--mono); }

/* Visible focus everywhere on these pages: styles.css removes the outline on fields. */
.dm-step :focus-visible, .dm-banner :focus-visible, .dm-steps :focus-visible, .dm-result:focus-visible,
.dm-step .build-form input:focus-visible, .dm-step .build-form textarea:focus-visible {
  outline: 2px solid var(--red); outline-offset: 2px;
}
.dm-result:focus { outline: none; }
.dm-result:focus-visible { outline: 2px solid var(--red); }

/* ---------- Banner ---------- */
.dm-banner-title { font-size: clamp(26px, 3.2vw, 40px); line-height: 1.15; letter-spacing: -0.015em; font-weight: 500; }
.dm-banner-body { gap: 20px; }
.dm-rules { font-size: 18px; line-height: 1.5; }
.dm-reset { font-family: var(--mono); font-size: 14px; line-height: 1.5; }
.dm-reset--warn { color: #ffb4a8; }
.dm-servers { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 13px; }
.dm-server::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--muted-light); vertical-align: 1px; }
.dm-server--ok::before { background: #7bc47f; }
.dm-server--bad::before { background: #ff8a80; }
.dm-note--light { color: var(--muted-light); }
.section--dark .btn.dm-btn-light { color: var(--paper); border-color: var(--paper); background: transparent; }
.section--dark .btn.dm-btn-light:hover { background: var(--paper); color: var(--ink); }
.btn.dm-btn-red { background: var(--red); border-color: var(--red); color: #fff; }
#dm-start-over-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-family: var(--mono); font-size: 13px; }

/* ---------- Step list ---------- */
.dm-steps { padding-top: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--ink); }
.dm-steps-list { display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--mono); font-size: 14px; }
.dm-steps-list a { text-decoration: none; }
.dm-steps-list a:hover { text-decoration: underline; }
.dm-num { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; }

/* ---------- Steps ---------- */
.dm-step .split { align-items: start; }
.dm-intro { gap: 18px; }
.dm-intro .body-text { font-size: 19px; }
.dm-panel { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dm-panel > .btn, .dm-panel .stack > .btn, .dm-result .btn { align-self: flex-start; }
.dm-tight { gap: 10px; }
.dm-split-top { margin-top: 12px; padding-top: 24px; border-top: 1px solid var(--rule-light); }
.dm-legend { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; padding: 0; }
.dm-hint { font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: -6px; }
.dm-note { font-family: var(--mono); font-size: 13px; line-height: 1.55; color: var(--muted); }
.dm-needs { font-family: var(--mono); font-size: 14px; padding: 12px 14px; border: 1px dashed var(--muted); }
.dm-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dm-btn-small { padding: 9px 14px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--ghost:disabled:hover { background: transparent; color: var(--ink); }
.btn[aria-busy="true"] { cursor: progress; }

.dm-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dm-choices { display: flex; flex-direction: column; gap: 8px; }
.build-form .dm-choice { font-family: var(--serif); font-size: 17px; color: var(--ink); padding: 10px 12px; border: 1px solid var(--rule-light); }
.build-form .dm-choice:has(input:checked) { border-color: var(--ink); background: rgba(0, 0, 0, .03); }
.build-form .dm-choice input { accent-color: var(--red); }
.build-form .check-row { color: var(--ink); }
.dm-handle { display: flex; align-items: stretch; min-width: 0; }
.dm-handle input { flex: 1 1 auto; min-width: 0; }
.dm-suffix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--ink); border-left: 0; font-family: var(--mono); font-size: 14px; color: var(--muted); white-space: nowrap; }

.dm-answers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 0; margin: 0; padding: 16px; background: rgba(0, 0, 0, .03); border-left: 3px solid var(--ink); }
.dm-answers dt { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 10px; }
.dm-answers dt:first-child { margin-top: 0; }
.dm-answers dd { margin: 0; font-size: 17px; line-height: 1.45; }

/* The 12 words */
.dm-words-box { display: flex; flex-direction: column; gap: 10px; }
.dm-words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; counter-reset: w; font-size: 15px; }
.dm-words li { counter-increment: w; padding: 8px 10px; border: 1px solid var(--ink); background: var(--paper); overflow-wrap: anywhere; }
.dm-words li::before { content: counter(w) '.'; display: inline-block; min-width: 2.2em; color: var(--muted); font-size: 12px; }

/* Passes */
.dm-passes { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; max-width: 360px; }
.dm-passes span { aspect-ratio: 1; border: 1px dashed var(--muted-light); }
.dm-passes span.on { border: 1px solid var(--ink); background: var(--ink); }
.dm-passes span.spent { border: 1px solid var(--ink); background: repeating-linear-gradient(45deg, transparent 0 3px, var(--muted-light) 3px 4px); }

/* Checklists that tick through */
.dm-checklist { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 13px; line-height: 1.45; }
.dm-checklist li { position: relative; padding-left: 26px; color: var(--muted); }
.dm-checklist li::before { content: ''; position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border: 1px solid var(--muted-light); }
.dm-checklist li.busy { color: var(--ink); }
.dm-checklist li.busy::before { border-color: var(--red); background: var(--red); animation: dm-pulse 1s ease-in-out infinite; }
.dm-checklist li.done { color: var(--ink); }
.dm-checklist li.done::before { content: '✓'; border-color: var(--ink); background: var(--ink); color: var(--paper); font-size: 11px; line-height: 14px; text-align: center; }
.dm-checklist li.fail { color: var(--red); }
.dm-checklist li.fail::before { content: '×'; border-color: var(--red); color: var(--red); font-size: 13px; line-height: 13px; text-align: center; }
@keyframes dm-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dm-checklist li.busy::before { animation: none; } }

/* Status lines */
.dm-status { font-family: var(--mono); font-size: 13px; line-height: 1.5; min-height: 0; }
.dm-status:empty { display: none; }
.dm-status--error { color: var(--red); padding: 10px 12px; border: 1px solid var(--red); }
.dm-status--ok { color: #2f6b34; }

/* Results */
.dm-result { display: flex; flex-direction: column; gap: 16px; }
.dm-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 15px; }
.dm-kv dt { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.dm-kv dd { margin: 0; overflow-wrap: anywhere; }
.dm-kv dd.dm-mono { font-size: 13px; }
.dm-kv dd.dm-none { color: var(--muted); font-style: italic; }
.dm-kv dd.dm-hit { color: var(--red); font-weight: 600; }
.dm-kv dd.dm-chosen { color: var(--ink); font-weight: 600; }
.dm-pre { margin: 0; padding: 12px 14px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(0, 0, 0, .04); border: 1px solid var(--rule-light); }

.dm-happened { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--ink); background: var(--paper); }
.dm-happened-title { margin: 0; font-size: 20px; font-weight: 600; }
.dm-happened > p { font-size: 17px; line-height: 1.5; }
.dm-sees { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.dm-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; font-size: 15px; line-height: 1.45; }
.dm-list li { position: relative; padding-left: 14px; }
.dm-list li::before { content: '–'; position: absolute; left: 0; color: var(--muted); }

.dm-verdict { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 14px 16px; font-size: 18px; line-height: 1.4; border: 2px solid var(--ink); }
.dm-verdict strong { font-family: var(--mono); font-size: 15px; letter-spacing: .06em; padding: 2px 8px; }
.dm-verdict--valid { border-color: #2f6b34; }
.dm-verdict--valid strong { background: #2f6b34; color: #fff; }
.dm-verdict--invalid { border-color: var(--red); }
.dm-verdict--invalid strong { background: var(--red); color: #fff; }
.dm-verdict--chosen { border-color: var(--ink); }
.dm-verdict--chosen strong { background: var(--ink); color: var(--paper); }

/* Step 6: the visitor chooses to link the two; said plainly, not as an alarm. */
.dm-choice-note { font-size: 17px; line-height: 1.45; padding: 10px 14px; border-left: 3px solid var(--ink); background: rgba(0, 0, 0, .03); }
.dm-linked { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 2px solid var(--ink); background: var(--paper); }
.dm-linked > p { font-size: 17px; line-height: 1.5; }
.dm-linked:focus { outline: none; }

.dm-checks { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.dm-checks li { position: relative; padding-left: 24px; }
.dm-checks li::before { position: absolute; left: 0; font-family: var(--mono); font-weight: 600; }
.dm-checks li.ok::before { content: '✓'; color: #2f6b34; }
.dm-checks li.bad::before { content: '×'; color: var(--red); }

.dm-proof-parts { display: flex; flex-direction: column; gap: 6px; font-size: 16px; line-height: 1.45; counter-reset: p; }
.dm-proof-parts li { counter-increment: p; padding-left: 26px; position: relative; }
.dm-proof-parts li::before { content: counter(p); position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border: 1px solid var(--ink); border-radius: 50%; font-family: var(--mono); font-size: 11px; display: grid; place-items: center; }

.dm-qr-box { display: flex; flex-direction: column; gap: 8px; }
.dm-qr { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 0; }
.dm-qr svg { width: 180px; height: 180px; flex: none; border: 1px solid var(--ink); background: #fff; }
.dm-qr figcaption { flex: 1 1 180px; font-family: var(--mono); font-size: 13px; line-height: 1.5; }

.dm-route { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.dm-route > div { display: flex; flex-direction: column; gap: 6px; }
.dm-route .dm-hint { margin-top: 0; }
.dm-route .dm-mono { font-size: 13px; }
.dm-moved { font-size: 18px; line-height: 1.45; font-weight: 500; }

/* Step 6 */
.dm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 20px; }
.dm-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--ink); min-width: 0; }
.dm-knows { font-size: 18px; line-height: 1.5; }
.dm-knows li::before, .dm-rules li::before { color: var(--muted); }
.section--dark .dm-rules li::before { color: var(--muted-light); }

@media (max-width: 760px) {
  .dm-words { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dm-kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dm-kv dd { margin-bottom: 8px; }
  .dm-intro .body-text, .dm-rules, .dm-knows { font-size: 17px; }
  .dm-qr svg { width: 160px; height: 160px; }
}
