/* AppHalt v167: persistent reconstructed interface, driven only by scroll. */
body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase]{--ah-product-ground:#141e35;--ah-product-ink:#f4f7ff;--ah-product-muted:#c3cee2;--ah-product-accent:#a7c7ff;background:var(--ah-product-ground)}
body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase]>.project-brief{background:var(--ah-product-ground)}
body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-stage{background:var(--ah-product-ground);height:calc(100svh - var(--story-header,76px))}
body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-stage-inner{padding:24px 65px 48px 5vw;grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr);gap:48px}
body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-canvas{height:auto;max-width:650px;aspect-ratio:auto;container-type:inline-size}
.ah167-scene{position:relative;height:470px;color:#263044;font-family:var(--sans,Arial,sans-serif);isolation:isolate}
.ah167-scene img{display:block;object-fit:contain}
.ah167-scene svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;flex:none}
.ah167-context{position:absolute;right:0;top:0;width:76%;height:135px;border:1px solid #99b7dc77;border-radius:14px;background:#dce8f5;box-shadow:0 14px 50px #0002;overflow:hidden;opacity:var(--ah-context-enter,1);transform:translate3d(calc((1 - var(--ah-context-enter,1))*12px),calc((1 - var(--ah-context-enter,1))*10px),0)}
.ah167-context-head{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid #bdccdd;background:#ecf3fa;font-size:13px}
.ah167-context-head img{width:20px;height:20px}.ah167-context-head>span{font-size:8px;letter-spacing:.08em;margin-left:auto;color:#52647c}
.ah167-context p{margin:10px 16px;font-size:13px;line-height:1.4}
body.sober-home #apphalt-produit[data-ah-native] [data-ah-reading-art] .ah167-context p{margin:10px 16px;font-size:13px;line-height:1.4}
.ah167-context-state{display:flex;align-items:center;gap:6px;font-size:10px;color:#3a566b;margin:8px 16px}
.ah167-dashboard{position:absolute;left:0;top:93px;width:94%;background:#f8f9fb;border:1px solid #c7d1de;border-radius:16px;box-shadow:0 25px 65px #0005;overflow:hidden;opacity:var(--ah-dashboard-enter,1);transform:translate3d(calc((1 - var(--ah-dashboard-enter,1))*-12px),calc((1 - var(--ah-dashboard-enter,1))*20px),0)}
.ah167-title{display:flex;align-items:center;gap:22px;height:48px;padding:0 18px;border-bottom:1px solid #d8dde5;background:linear-gradient(#fff,#f3f5f8);font-size:16px;color:#48515d}
.ah167-traffic{display:flex;gap:7px}.ah167-traffic i{width:11px;height:11px;border-radius:50%;background:#fa615a;border:1px solid #d75450}.ah167-traffic i:nth-child(2){background:#f6c444;border-color:#d8a937}.ah167-traffic i:nth-child(3){background:#62bd4f;border-color:#4d9f3d}
.ah167-tools{display:flex;margin-left:auto;gap:15px;color:#66727f}
.ah167-tabs{display:grid;grid-template-columns:1fr 1fr;margin:18px 16px 9px;padding:3px;background:#e7e9ee;border-radius:8px;font-size:12px;line-height:1.4;text-align:center;color:#5c6574}
.ah167-tabs span{padding:6px 3px}.ah167-tabs span:first-child{background:#1479f6;color:#fff;border-radius:6px;box-shadow:0 2px 4px #0568ce30}
.ah167-command{display:flex;align-items:center;gap:12px;padding:13px 18px 17px;font-size:16px}.ah167-command>img{width:31px;height:31px}
.ah167-action{margin-left:auto;min-width:100px;border-radius:7px;padding:8px 15px;background:#1479f6;color:#fff;text-align:center;box-shadow:0 2px 4px #0871df25;transform:scale(calc(1 - var(--ah-press,0)*.06));font-weight:600;font-size:14px}
.ah167-table-head{display:grid;grid-template-columns:minmax(0,1fr) 39%;padding:7px 18px;background:#edf0f4;border-block:1px solid #d5dbe4;font-size:12px;line-height:1.4;color:#637084}
.ah167-row{min-height:44px;display:grid;grid-template-columns:24px minmax(0,1fr) 39%;align-items:center;gap:9px;padding:0 18px;font-size:13px;line-height:1.35;border-bottom:1px solid #e7ebf0}.ah167-row img{width:22px;height:22px}.ah167-row b{font-weight:600}.ah167-row:nth-child(even){background:#f0f3f7}
.ah167-selected{background:rgb(217 232 255 / var(--ah-selection,1));position:relative}.ah167-selected:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#1979e6;opacity:var(--ah-selection,1)}
.ah167-status{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:600;color:#176b54}.ah167-status i{height:7px;width:7px;border-radius:50%;background:#26a47b}.ah167-idle{color:#6f7887;font-size:12px}
.ah167-footer{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 18px;background:#f7f9fc;font-size:11px;color:#516177}.ah167-footer>img{width:18px;height:18px}.ah167-state-mark{margin-left:auto;color:#28846b;opacity:var(--ah-selection,1)}
.ah167-focus{position:absolute;left:0;top:0;pointer-events:none;border:2px solid #549ff7;box-shadow:0 0 0 3px #549ff71a;border-radius:7px;box-sizing:border-box}
.ah167-click{position:absolute;pointer-events:none;width:34px;height:34px;border:2px solid #aacfff;border-radius:50%;opacity:0}
[data-paused="true"] .ah167-selected{background:#fff1d7}[data-paused="true"] .ah167-selected:before{background:#b17618}[data-paused="true"] .ah167-status{color:#885714}[data-paused="true"] .ah167-status i{background:#b57a20;border-radius:2px}[data-paused="true"] .ah167-focus{border-color:#c59849;box-shadow:0 0 0 3px #c5984922}
[data-paused="true"] .ah167-action{background:#245ca7}
.ah167-explanation{display:flex;gap:12px;align-items:center;margin:16px 0 0;min-height:44px;color:#deebff}.ah167-step{flex:none;font:400 30px/1 var(--serif,Georgia,serif);color:#9cbbeb;padding-right:12px;border-right:1px solid #516781}.ah167-explanation p{margin:0;font:500 13px/1.4 var(--sans,Arial,sans-serif)}
.ah167-provenance{margin:8px 0 0;font:400 10px/1.4 var(--sans,Arial,sans-serif);color:#9eafc9}
body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-product-step:last-child{display:grid}
[data-ah-reading-art]{container-type:inline-size}[data-ah-reading-art] .ah167-scene{max-width:650px;margin:auto}[data-ah-reading-art] .ah167-focus,[data-ah-reading-art] .ah167-click{display:none}
body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-product-reading{max-width:1300px}
@container(max-width:500px){
 .ah167-scene{height:390px}.ah167-context{width:89%;height:115px}.ah167-context-head{padding:9px 11px;font-size:11px;gap:6px}.ah167-context-head img{width:18px;height:18px}.ah167-context-head>span{font-size:7px}.ah167-context p{font-size:12px;margin:8px 11px}.ah167-context-state{display:none}
 body.sober-home #apphalt-produit[data-ah-native] [data-ah-reading-art] .ah167-context p{margin:8px 11px;font-size:12px}
 .ah167-dashboard{top:78px;width:97%;border-radius:12px}.ah167-title{height:37px;padding:0 12px;font-size:14px;gap:14px}.ah167-traffic{gap:5px}.ah167-traffic i{width:8px;height:8px}.ah167-tools{gap:8px}.ah167-tools svg{width:16px;height:16px}
 .ah167-tabs{margin:13px 10px 6px;font-size:11px}.ah167-tabs span{padding:5px 1px}
 .ah167-command{padding:10px 11px 13px;gap:7px;font-size:12px}.ah167-command>img{width:25px;height:25px}
 .ah167-action{min-width:68px;font-size:12px;padding:8px}
 .ah167-table-head{grid-template-columns:minmax(0,1fr) minmax(66px,31%);padding:6px 11px;font-size:11px}
 .ah167-row{min-height:37px;padding:0 11px;grid-template-columns:20px minmax(0,1fr) minmax(66px,31%);gap:7px;font-size:12px}.ah167-row img{width:19px;height:19px}
 .ah167-footer{min-height:36px;padding:6px 11px;font-size:10px;gap:6px}.ah167-footer svg{width:16px;height:16px}
 .ah167-explanation{margin-top:13px;gap:9px;min-height:36px}.ah167-explanation p{font-size:12px}.ah167-step{font-size:25px;padding-right:9px}.ah167-provenance{font-size:9px}
}
@media(max-width:800px){
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-stage-inner{grid-template-columns:1fr;grid-template-rows:150px minmax(0,1fr);gap:12px;padding:12px 42px 30px 20px;align-items:start}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-narrative{min-height:0;height:150px}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-beat h3{font-size:clamp(27px,6.7vw,36px)}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-beat p{font-size:13px;max-width:44ch}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-canvas{max-width:500px}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] [data-ah-motion-slot]{align-self:start}
}
@media(max-width:800px) and (max-height:720px) and (orientation:portrait){
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-stage-inner{grid-template-rows:124px minmax(0,1fr);gap:6px;padding:8px 36px 24px 16px}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-narrative{height:124px}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-beat h3{font-size:25px;margin-bottom:6px}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-beat p{font-size:12px;line-height:1.35}
 #apphalt-produit[data-ah-ready] .ah167-scene{height:317px}
 #apphalt-produit[data-ah-ready] .ah167-context{height:100px}
 #apphalt-produit[data-ah-ready] .ah167-context p{margin-block-start:6px}
 #apphalt-produit[data-ah-ready] .ah167-dashboard{top:66px}
 #apphalt-produit[data-ah-ready] .ah167-title{height:31px}
 #apphalt-produit[data-ah-ready] .ah167-tabs{margin-block:9px 5px}
 #apphalt-produit[data-ah-ready] .ah167-command{padding-block:8px 9px}
 #apphalt-produit[data-ah-ready] .ah167-footer{min-height:29px;padding-block:5px}
 #apphalt-produit[data-ah-ready] .ah167-explanation{margin-top:8px;min-height:30px}
 #apphalt-produit[data-ah-ready] .ah167-explanation p{font-size:11px}
 #apphalt-produit[data-ah-ready] .ah167-provenance{margin-top:5px}
}
@media(min-width:801px) and (max-height:760px){.ah167-scene{height:430px}.ah167-row{min-height:37px}.ah167-dashboard{top:85px}.ah167-title{height:42px}}
@media(prefers-reduced-motion:reduce){.ah167-context,.ah167-dashboard{transform:none}.ah167-focus,.ah167-click{display:none}}
body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-canvas{display:block}
.ah167-scene{width:100%}.ah167-explanation,.ah167-provenance{width:100%;text-align:left}
/* The dashboard participates in layout so its caption can never sit beneath it. */
.ah167-scene{height:auto;padding-top:93px}.ah167-dashboard{position:relative;top:auto}.ah167-context-state{display:none}
@container(max-width:500px){.ah167-scene{height:auto;padding-top:78px}.ah167-dashboard{top:auto}}
@media(max-width:800px) and (max-height:720px) and (orientation:portrait){
 #apphalt-produit[data-ah-ready] .ah167-scene{height:auto;padding-top:66px}
 #apphalt-produit[data-ah-ready] .ah167-dashboard{top:auto}
 #apphalt-produit[data-ah-ready] .ah167-row{min-height:27px}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-stage-inner{grid-template-rows:114px minmax(0,1fr);gap:5px}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-narrative{height:114px}
}
@media(min-width:801px) and (max-height:760px){.ah167-scene{height:auto;padding-top:85px}.ah167-dashboard{top:auto}}
.ah167-selected,.ah167-status,.ah167-action{transition:background-color .22s ease,color .22s ease}
@media(prefers-reduced-motion:reduce){.ah167-selected,.ah167-status,.ah167-action{transition:none}}

/* v179: more breathing room between mobile copy and the interface. */
@media(max-width:800px){
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-stage-inner{row-gap:28px}
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-product-step{row-gap:32px}
}
@media(max-width:800px) and (max-height:720px) and (orientation:portrait){
 body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase] .ah-stage-inner{row-gap:18px}
}

/* v180: a quiet, reversible entrance; the reading alternative is immediate. */
[data-ah-reading-art] .ah167-context,[data-ah-reading-art] .ah167-dashboard{opacity:1;transform:none}
@media(prefers-reduced-motion:reduce){.ah167-context,.ah167-dashboard{opacity:1;transform:none}}
html.motion-reduced .ah167-context,html.motion-reduced .ah167-dashboard{opacity:1;transform:none}

/* v185: dark opening and ending, light pause chapter; only scene colors change. */
body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase="2"] .ah-track{
 --ah-product-ground:#edf1fa;--ah-product-ink:#172246;--ah-product-muted:#4e607d;--ah-product-accent:#2859b0;
}
body.sober-home #apphalt-produit[data-ah-native].ah167 .ah-stage .ah167-explanation{color:var(--ah-scene-caption,#deebff)}
body.sober-home #apphalt-produit[data-ah-native].ah167[data-ah-phase="2"] .ah-stage{--ah-scene-caption:#4e607d}
body.sober-home #apphalt-produit[data-ah-native].ah167 .ah-stage :is(.ah-beat h3,.ah-beat p,.ah-tag,.ah167-explanation,.scene183-study-link,.story-navigation){transition:color .36s ease}
@media(prefers-reduced-motion:reduce){
 body.sober-home #apphalt-produit[data-ah-native].ah167 .ah-stage :is(.ah-beat h3,.ah-beat p,.ah-tag,.ah167-explanation,.scene183-study-link,.story-navigation){transition:none}
}

body.sober-home #apphalt-produit[data-ah-native].ah167 .ah-track{transition:background-color .36s ease}
@media(prefers-reduced-motion:reduce){body.sober-home #apphalt-produit[data-ah-native].ah167 .ah-track{transition:none}}

#apphalt-produit [data-ah-canvas] {
  --ah-context-enter: 0;
  --ah-dashboard-enter: 0;
}

#apphalt-produit .ah167-context { transition: filter .22s ease; }
#apphalt-produit [data-paused="true"] .ah167-context { filter: grayscale(1); }

.ah219-research {
  max-inline-size: 620px;
  border: 1px solid #c8d6e9;
  border-radius: 14px;
  background: #f6f8fd;
  color: #1b2e50;
  font: 450 .9375rem/1.4 var(--sans);
  box-shadow: 0 18px 42px -18px #020a20b0;
}

[data-ah-canvas] > .ah219-research {
  position: absolute;
  z-index: 2;
  inset: 50% 0 auto;
  translate: 0 -50%;
  pointer-events: none;
}

.ah219-research > header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px clamp(12px, 2vw, 22px);
  border-block-end: 1px solid #d8e2f1;
  font-size: .8125rem;
  font-weight: 650;
}

.ah219-research svg { inline-size: 16px; block-size: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; }

.ah219-research-body { padding: clamp(12px, 2vw, 22px); }

.ah219-research-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.ah219-research-options > div {
  padding: clamp(8px, 1.4vw, 15px);
  border: 1px solid #dbe4f1;
  border-radius: 8px;
  background: #fff;
}

.ah219-research-options strong { display: block; font-size: .875rem; }

#apphalt-produit .ah219-research-options p {
  margin: 5px 0 0;
  color: #4d607e;
  font-size: .8125rem;
  line-height: 1.4;
}

.ah219-research-need {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-start: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e4edff;
  color: #193e82;
  opacity: var(--ah-finding-arrival, 1);
}

.ah219-research-need span { display: block; font-size: .75rem; }
.ah219-research-need strong { display: block; font-size: .875rem; }

html.motion-reduced #apphalt-produit .ah167-context { transition: none; }
@media (prefers-reduced-motion: reduce) {
  #apphalt-produit .ah167-context { transition: none; }
}
