/* A goal near the drawing; evidence and transitions follow it in normal flow. */
.journey-header{border-left:3px solid var(--wine);padding:8px 12px;margin:0 0 12px;background:#faf7f7;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 12px}
.journey-header strong{font-size:17px;grid-column:1}.journey-header p{font-size:16px;line-height:1.35;margin:0;grid-column:1;max-width:80ch}
.journey-header #journey-action{color:var(--muted);font-size:15px}.journey-header-actions{grid-column:2;grid-row:1/4;display:flex;align-items:center;gap:8px;max-width:220px}
.journey-header button,.journey-body button,.collection-controls button,.collection-pages button,.ordinary-target button{min-height:44px;font-size:14px}
.journey-body{padding:14px;border-top:1px solid var(--line);margin:8px 0 0;background:#fcfbf8}.journey-body p{font-size:16px;line-height:1.5;margin:0 0 10px;max-width:85ch}
.journey-body .journey-completion{border-left:3px solid #899298;padding:6px 9px;color:var(--ink)}.journey-body .journey-completion.complete{border-color:#246c63;background:#edf7f4}
.journey-buttons{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.journey-transition{color:var(--wine);font-weight:600;padding-top:10px}
.journey-body>button{margin:0 8px 10px 0}.journey-proof{margin:12px 0;padding:12px;border:1px solid #ddd4c8;border-radius:6px}
.journey-cases{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0}.journey-cases .read{border-color:#246c63}.journey-cases [aria-pressed=true]{background:#246c63;color:white}
.journey-active #ux-purpose,.journey-active #panel-blockers>.ux-purpose,.journey-active #ux-ext-purpose{display:none}
.journey-active #ux-ext-size-reason,.journey-active #ux-target-reason{display:none}
.journey-active #ux-provenance{font-size:14px;margin:0}
.collection-controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0}.collection-controls label{font-size:16px;display:flex;align-items:center;gap:8px}.collection-controls select{max-width:100%;min-height:44px}
#collection-status{font-size:16px;line-height:1.5;margin:10px 0 15px}.collection-pages{display:flex;align-items:center;gap:8px;justify-content:center;flex-wrap:wrap;margin:15px 0}
#gallery .collection-card{display:flex;flex-direction:column;gap:7px;align-items:stretch;text-align:left;min-width:0;font-size:16px;padding:12px;background:#fff}
#gallery .collection-card svg{width:100%;height:120px;max-width:none}#gallery .collection-card span{font-size:14px;line-height:1.45;overflow-wrap:anywhere}
#gallery .collection-card:disabled{opacity:1;color:#665a5a;background:#f7f4f2;border-style:dashed;cursor:default}
#gallery{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}.journey-overview{display:block;width:100%;max-width:600px;height:160px;margin:6px auto 12px}.journey-overview-caption{font-size:14px!important;color:var(--muted);text-align:center}
.ordinary-target{border-top:1px solid var(--line);padding-top:14px;display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin-top:14px}.ordinary-target strong{flex-basis:100%;font-size:17px}.ordinary-target p{flex-basis:100%;font-size:14px;line-height:1.4;margin:4px 0}.journey-proof>details>summary{cursor:pointer;min-height:44px;padding:8px 0}
@media(max-width:780px){
 #gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.journey-overview{height:135px}
 .journey-header{padding:6px 9px;grid-template-columns:1fr;margin-bottom:8px;gap:3px}.journey-header strong{font-size:16px}.journey-header p{font-size:15px}.journey-header #journey-action{font-size:14px}.journey-header-actions{grid-column:1;grid-row:auto;max-width:none}.journey-header button{font-size:13px;padding:6px 9px}
 .journey-body{padding:12px 10px}.journey-body p{font-size:15px}.journey-body button{font-size:14px}.journey-buttons{gap:6px}.journey-buttons button{flex:1 1 135px}
 .collection-controls label{display:block;width:100%}.collection-controls select{display:block;width:100%;margin-top:5px}.collection-pages{gap:6px}#collection-page{order:-1;width:100%;text-align:center}
 #gallery .collection-card svg{height:115px}.journey-active .ux-target-size{margin-bottom:0}
}
@media(max-width:600px){#gallery{grid-template-columns:1fr}}

/* A static highlight works with reduced motion and never changes graph geometry. */
.result-emphasis{outline:3px solid #a84460;outline-offset:4px}
.result-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
[tabindex="-1"]:focus-visible{outline:3px solid #a84460;outline-offset:4px}
.journey-phases{margin:10px 0;padding:12px;border:1px solid #cbded7;background:#f0f7f3;border-radius:6px}
.journey-phases strong{font-size:17px}.journey-phases p{font-size:16px;line-height:1.45;margin:6px 0}
.journey-phases button{min-height:44px;font-size:14px}.journey-phases .journey-extra{color:#625447}
.journey-phases[hidden]{display:none}
@media(max-width:780px){.journey-phases{padding:10px}.journey-phases p{font-size:15px}}

/* Explicit evidence, in normal flow; no celebration animation or auto-advance. */
.achievement{margin:12px 10px;padding:16px 18px;border:2px solid #246c63;border-left-width:6px;border-radius:8px;background:#eaf5ef;color:#163f3a;box-shadow:0 2px 7px #163f3a0d}
.achievement[hidden],.witness-help[hidden],.journey-find-witness[hidden]{display:none}
.achievement-heading{display:flex;align-items:center;gap:10px}.achievement h3{margin:0;font-size:23px;color:#163f3a}
.achievement-icon{display:grid;place-items:center;flex:0 0 30px;height:30px;border-radius:50%;background:#246c63;color:white;font:700 21px/1 system-ui}
.achievement .achievement-origin{font-size:14px;font-weight:700;margin:7px 0 5px}.achievement .achievement-reason{font-size:17px;line-height:1.4;margin:5px 0 10px;max-width:80ch}
.achievement .achievement-progress{font-size:14px;margin:0 0 5px}.achievement progress{display:block;width:100%;height:7px;accent-color:#246c63;margin-bottom:12px}
.achievement-actions{display:flex;flex-wrap:wrap;gap:8px}.achievement button{min-height:44px;font-size:15px}.achievement .primary{background:#246c63;border-color:#246c63;color:white;font-weight:700;min-width:150px}
.achievement-docked{position:fixed;z-index:40;bottom:12px;right:16px;width:min(540px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;margin:0;box-shadow:0 5px 24px #163f3a33}
.achievement-dismiss{background:transparent}.witness-help{flex-basis:100%;margin:0 0 8px;padding:12px;border:2px solid var(--wine);background:#fcf5f7;border-radius:6px;max-width:650px}
.witness-help strong{font-size:18px}.witness-help p{font-size:16px;line-height:1.4;margin:7px 0}.witness-help button{min-height:44px;font-size:14px}.witness-help .witness-help-pointer{font-size:15px;font-weight:700;color:var(--wine);margin-bottom:0}
.witness-help-target{outline:3px solid var(--wine);outline-offset:4px!important}.journey-find-witness{grid-column:1;justify-self:start;font-size:14px;min-height:44px;margin-top:5px}
@media(max-width:780px){.achievement{margin:10px 0;padding:12px}.achievement h3{font-size:22px}.achievement .achievement-reason{font-size:16px}.achievement-actions button{flex:1 1 130px}.achievement-docked{margin:0;right:12px;bottom:12px;width:calc(100vw - 24px)}.achievement .achievement-origin,.achievement .achievement-progress{font-size:13px}}

/* UXr6: the active step and its real actions share the drawing's panel. */
.journey-active .journey-header{display:block;margin:10px 0;padding:12px;border:1px solid #cbded7;border-left:4px solid var(--wine);border-radius:6px;background:#faf8f6;min-width:0}
.journey-active #journey-title{display:block;font-size:17px;line-height:1.3;margin:0 0 8px}
.journey-active #journey-goal{font-size:16px;margin-bottom:6px}
.journey-active #journey-action{font-size:16px;color:var(--ink);line-height:1.4;margin:6px 0 10px}
.journey-primary,.journey-phases .journey-buttons{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
.journey-primary button,.journey-phases .journey-buttons button{min-height:48px;font-size:16px;flex:1 1 180px}
.journey-active .journey-phases{padding:0;margin:8px 0;border:0;background:transparent}.journey-phases strong{font-size:16px}.journey-phases p{font-size:16px;line-height:1.4}
.journey-manual{margin:10px 0 4px}.journey-manual summary,.journey-tools summary,.journey-notes summary{min-height:44px;padding:10px 0;cursor:pointer;font-size:15px}.journey-manual button{margin:4px 0;width:100%}
.journey-tools{border-top:1px solid var(--line);margin-top:8px}.journey-tools button{margin:4px;max-width:100%;white-space:normal}.journey-tools>button{display:block}.journey-tools>button[hidden]{display:none}
.journey-active #journey-navigation{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.journey-active #journey-navigation>button{flex:1 1 100px;min-height:44px}
.journey-active .journey-body{margin:0;padding:0 12px 10px;background:transparent;border-top:0}.journey-body #journey-completion{display:none}.journey-notes p{margin:8px 0}.journey-notes>button{margin:6px 0}
.journey-active .achievement{margin:8px 0}.journey-active .achievement-docked{margin:0}.journey-primary:empty{display:none}#journey-next{display:none!important}
.journey-active .graph-card>.card-head{padding-bottom:8px}.journey-active .graph-card>.graph-hint{font-size:14px}.journey-active #surviving-matchings{width:100%;font-weight:700}
#surviving-matchings{min-height:48px;margin:8px 0}#matching-gallery{scroll-margin-top:16px}#collection #gallery{min-height:205px}
@media(max-width:780px){.journey-active .journey-header{padding:10px}.journey-active .journey-header #journey-title{font-size:16px}.journey-active #journey-action,.journey-active #journey-goal,.journey-phases p{font-size:15px}.journey-active .journey-phases .journey-buttons>button{flex-basis:100%}.journey-active .achievement{padding:10px}.journey-active .achievement .achievement-reason{font-size:15px}.journey-active .achievement button{font-size:14px}.journey-active .achievement-actions button{flex:1 1 105px;min-width:0}.journey-primary button{min-width:0;white-space:normal}}

.journey-scene-heading{padding:12px 12px 4px;background:#faf8f6;border-bottom:1px solid var(--line)}.journey-scene-heading #journey-title{margin:0 0 6px;font-size:16px}.journey-scene-heading #journey-goal{margin:0 0 6px;font-size:15px;line-height:1.35}.guide-survivors .collection-controls>label{display:none}.guide-survivors #collection-status{min-height:3em}.guide-survivors .section-head p{margin-bottom:8px}#journey-result-anchor{height:0}

.journey-primary>#regions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%;margin:0}.journey-primary>#regions button{min-height:44px;min-width:0;padding:6px 4px;font-size:14px;white-space:normal}.journey-primary>#regions button:first-child{grid-column:1/-1}

/* Explicit paths to cases, real count progress, and next investigations. */
#journey-read-cases{display:block;min-height:48px;width:100%;margin:8px 0;font-weight:700;border:2px solid var(--wine)}
#journey-read-cases[hidden],.journey-count-panel[hidden],.journey-entry[hidden],.journey-experiments[hidden]{display:none}
.journey-count-panel{border:1px solid #cbded7;padding:10px;margin:10px 0;border-radius:6px;background:#f0f7f3}
.journey-count-panel p{font-size:15px;line-height:1.4;margin:0 0 8px}.journey-count-panel progress{display:block;width:100%;height:14px;accent-color:#246c63;margin:8px 0}.journey-count-panel progress[hidden]{display:none}.journey-count-panel button{min-height:44px}
.journey-entry{padding:12px;border:1px solid #cbded7;border-left:4px solid var(--wine);background:#faf8f6;margin:10px 0}.journey-entry p{font-size:15px;line-height:1.4;margin:6px 0}.journey-entry button,.journey-experiments button{min-height:48px;white-space:normal}
.journey-experiments{grid-column:1/-1;border-top:1px solid var(--line);padding-top:12px;margin-top:8px}.journey-experiments p{font-size:15px;line-height:1.4}.journey-experiments .journey-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.journey-experiments button{min-width:0;font-size:14px}
#journey-cases-title{font-size:18px;margin:8px 0}#journey-cases{scroll-margin-top:20px}
@media(max-width:780px){.journey-experiments .journey-buttons{grid-template-columns:1fr}.journey-entry .journey-buttons>button{flex-basis:100%}}
/* Count status on its own row: Run and Cancel keep a stable size while the progress text changes. */
.journey-primary>#extremal-exact{flex:1 1 100%;margin:0}

/* Primary experiments and the secondary return use separate rows. */
.journey-experiment-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;border-top:1px solid var(--line);margin-top:16px;padding-top:14px}
.journey-experiment-footer[hidden]{display:none}
.journey-experiment-footer p{flex:1 1 240px;margin:0!important;color:var(--muted);max-width:65ch}
.journey-experiment-footer button{flex:0 1 auto;background:transparent;color:var(--wine);border-color:var(--line);min-height:44px}
.collection-activity{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border:1px solid #cbded7;border-left:3px solid #246c63;background:#f0f7f3;border-radius:4px;padding:10px 12px;margin:10px 0}
.collection-activity[hidden],#collection-progress[hidden]{display:none}
.collection-activity p{flex:1 1 240px;min-width:0;margin:0!important;font-size:15px;line-height:1.4}
.collection-activity-actions{display:flex;flex-wrap:wrap;gap:8px}
.collection-activity button{min-height:44px;font-size:14px;white-space:normal}
.collection-activity[data-phase="preparing"] p::before,.collection-activity[data-phase="searching"] p::before{content:'●';color:#246c63;display:inline-block;margin-right:8px}
.collection-activity[data-phase="failed"],.collection-activity[data-phase="timeout"],.collection-activity[data-phase="limit"]{border-color:#b89797;background:#faf3f1}
#collection-progress{display:block;width:100%;height:14px;accent-color:#246c63;margin:10px 0}
@media(max-width:600px){.journey-experiment-footer{align-items:stretch}.journey-experiment-footer p,.journey-experiment-footer button{flex-basis:100%;width:100%}.collection-activity{align-items:stretch;padding:10px}.collection-activity p{flex-basis:100%}.collection-activity-actions{width:100%}.collection-activity-actions button{flex:1 1 130px}}

#collection-live{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
