/* v153 -- Mobile homepage: stable header, measured story content, no clipping.
   Desktop presentation and case-study pages keep their prior behavior. */
@media (max-width:800px) {
  /* Safari toolbar changes must never move, stretch or resize the navigation. */
  body.sober-home .site-header { position:sticky; top:0; height:76px; padding:8px 0; }
  body.sober-home .site-header .header-inner {
    height:60px; transform:none !important; --gn-header-elastic-y:0px !important;
    --gn-header-elastic-stretch:1 !important; --liquid-header-y:0px !important;
    --liquid-header-stretch:1 !important; --liquid-content-y:0px !important;
    will-change:auto;
  }
  body.sober-home .site-header .header-inner::before,
  body.sober-home .site-header .header-inner > .brand,
  body.sober-home .site-header .project-switcher > summary,
  body.sober-home .site-header .header-actions {
    transform:none !important; transition-property:background-color,color,border-color,box-shadow !important;
    will-change:auto !important;
  }
  body.sober-home .site-header .header-inner::before,
  body.sober-home .site-header.is-v112-moving-down .header-inner::before,
  body.sober-home .site-header.is-v112-moving-up .header-inner::before{border-radius:20px;filter:none}
  /* The reading composition is a deliberate mobile storytelling mode: real
     document flow replaces the fixed-height spring/morph stages. */
  body.sober-home #allianz-trade-pay .at84-track,
  body.sober-home #apphalt-produit .ah-track{display:none!important}
  body.sober-home #allianz-trade-pay .ap-reading,
  body.sober-home #apphalt-produit .ah-product-reading{overflow:visible}
  body.sober-home #allianz-trade-pay .ap-reading{
    display:grid;gap:0;padding:0 20px 42px;
    background:#fff;color:#163550;
  }
  body.sober-home #allianz-trade-pay .ap-reading-step{
    position:relative;box-sizing:border-box;display:flex;flex-direction:column;
    gap:16px;width:100%;max-width:580px;margin:0 auto;
    padding:34px 0 44px;border-top:1px solid #dce7ee;
    color:#153952;scroll-margin-top:98px;
  }
  body.sober-home #allianz-trade-pay .ap-reading-copy>span{color:#056c82;font-size:11px;letter-spacing:.12em}
  body.sober-home #allianz-trade-pay .ap-reading-copy h3{font-size:clamp(33px,8.5vw,43px);line-height:1.07;max-width:22ch;color:#173b51;margin:12px 0}
  body.sober-home #allianz-trade-pay .ap-reading-copy p{font-size:15px;line-height:1.5;color:#496374;max-width:40ch;margin:0}
  body.sober-home #allianz-trade-pay .ap-reading-step .ap-art{
    width:100%;max-width:100%;min-width:0;transform:none!important;
    --ap-accent:#056c82;--ap-muted:#405c6e;
  }
  body.sober-home #allianz-trade-pay .ap-reading-step .ap-context{font-size:10px;line-height:1.45;margin-bottom:10px}
  body.sober-home #allianz-trade-pay .ap-reading-step .ap-window{height:auto!important;max-width:100%;overflow:hidden}
  body.sober-home #allianz-trade-pay .ap-reading-step .ap-grid{height:auto!important;min-height:0}
  body.sober-home #allianz-trade-pay .ap-reading-step .ap-module{position:relative!important;inset:auto!important;transform:none!important;width:auto!important;height:auto!important;opacity:1!important;visibility:visible!important;overflow:visible}
  body.sober-home #allianz-trade-pay .ap-reading-step .ap-footer{display:flex;min-width:0;flex-wrap:wrap}
  body.sober-home #allianz-trade-pay .ap-reading-step .gn146-provenance{
    display:block;position:static;max-width:100%;font-size:11px;line-height:1.4;
    color:#516c78;overflow-wrap:anywhere;margin:12px 0 0;
  }
  body.sober-home #allianz-trade-pay .ap-reading-step:nth-child(2),
  body.sober-home #allianz-trade-pay .ap-reading-step:nth-child(4){background:#f5f9fb;margin-inline:-10px;padding-inline:10px;border-radius:18px;border-top:1px solid #dae6ee}
  body.sober-home #allianz-trade-pay .ap-reading-step:last-child{border-bottom:1px solid #dce7ee}
  /* Each AppHalt illustration has its own reserved height. The UI capture
     stays in normal flow and can never cover its following caption. */
  body.sober-home #apphalt-produit .ah-product-reading{
    display:block;box-sizing:border-box;width:100%;max-width:620px;
    padding:8px 20px 42px;color:#eef3ff;
  }
  body.sober-home #apphalt-produit .ah-product-steps{gap:0}
  body.sober-home #apphalt-produit .ah-product-step,
  body.sober-home #apphalt-produit .ah-product-step:last-child{
    display:flex;flex-direction:column;gap:16px;width:100%;min-width:0;
    margin:0;padding:32px 0 42px;border-top:1px solid rgba(174,194,232,.22);
    scroll-margin-top:100px;
  }
  body.sober-home #apphalt-produit .ah-product-step>div:first-child{min-width:0}
  body.sober-home #apphalt-produit .ah-product-step>div>span{font-size:10px;letter-spacing:.13em;color:#adc8ff}
  body.sober-home #apphalt-produit .ah-product-step h3{font-size:clamp(31px,8vw,43px);line-height:1.08;max-width:23ch;margin:9px 0 12px}
  body.sober-home #apphalt-produit .ah-product-step p{font-size:15px;line-height:1.52;max-width:42ch}
  body.sober-home #apphalt-produit [data-ah-reading-art]{width:100%;max-width:100%;overflow:hidden}
  body.sober-home #apphalt-produit [data-ah-reading-art] .ah-art{height:350px;max-width:100%;overflow:hidden}
  body.sober-home #apphalt-produit .ah-product-reading [data-ah-reading-slot]{min-width:0;width:100%;position:relative;display:block}
  body.sober-home #apphalt-produit .ah-product-reading .ah-canvas{
    display:block;position:relative;width:100%;height:auto!important;max-width:100%;overflow:visible;
  }
  body.sober-home #apphalt-produit .ah-product-reading .ah-canvas>.ah-art{display:none!important}
  body.sober-home #apphalt-produit .ah-product-reading .ah-product-demo-host{
    position:relative!important;inset:auto!important;display:block;opacity:1!important;
    visibility:visible!important;transform:none!important;height:auto!important;
  }
  body.sober-home #apphalt-produit .ah-product-reading .ah-real-capture{
    display:flex;width:100%;height:auto;gap:12px;justify-content:flex-start;
  }
  body.sober-home #apphalt-produit .ah-product-reading .ah-real-capture img{
    display:block;width:100%;max-width:500px;height:auto;max-height:none!important;
    object-fit:contain;border-radius:16px;
  }
  body.sober-home #apphalt-produit .ah-product-reading .ah-real-capture figcaption{
    position:static!important;display:block;width:100%;max-width:48ch;
    min-height:0;line-height:1.5;font-size:12px;white-space:normal;
    color:#c7d2ee;opacity:1!important;transform:none!important;
  }
  body.sober-home #apphalt-produit .ah-product-reading .ah-download-fact{margin-top:15px!important}

}
@media (max-width:700px) {
  /* AI: one complete card rather than an accidental clipped neighbour. */
  body.sober-home #ia{scroll-margin-top:95px}
  body.sober-home #ia .aiv12-grid{
    box-sizing:border-box;display:flex;gap:0;max-width:100%;
    overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;
    scroll-snap-type:x mandatory;scrollbar-width:none;
    padding:6px 0 12px;scroll-padding-inline:0;
  }
  body.sober-home #ia .aiv12-card{
    box-sizing:border-box;flex:0 0 100%;width:100%;max-width:100%;
    min-width:0;scroll-snap-align:start;scroll-margin-top:110px;
  }
  body.sober-home #ia .aiv132-controls{position:relative;z-index:1;margin-top:12px}
  body.sober-home #ia .aiv138-artifact,
  body.sober-home #ia .aiv138-note-stack{min-width:0;overflow-wrap:anywhere}
  body.sober-home #ia .aiv138-note-stack > * {max-width:100%;overflow-wrap:anywhere}
}
@media (max-width:380px) {
  body.sober-home #allianz-trade-pay .ap-reading{padding-inline:16px}
  body.sober-home #apphalt-produit .ah-product-reading{padding-inline:16px}
}
@media (prefers-reduced-motion:reduce) {
  body.sober-home #ia .aiv12-card{animation:none!important;transition:none!important}
}

@media(max-width:800px){
  body.sober-home #allianz-trade-pay .ap-reading-step .ap-art[data-ap-phase="0"] .ap-order strong{color:#163950}
  body.sober-home #allianz-trade-pay .ap-reading-step .ap-art[data-ap-phase="0"] .ap-eyebrow{color:#496576}
  body.sober-home #allianz-trade-pay .ap-reading-step .ap-art[data-ap-phase="0"] .ap-footer-need{color:#4a6475}
  body.sober-home #allianz-trade-pay .ap-reading-step .ap-art[data-ap-phase="0"] .ap-order{margin-bottom:12px}
  body.sober-home #apphalt-produit .ah-product-step:last-child > [data-ah-reading-art]{display:none!important}
  body.sober-home #apphalt-produit .ah-product-step:nth-child(3) > [data-ah-reading-art]{height:auto;overflow:visible}
  body.sober-home #apphalt-produit .ah-product-reading .ah-product-step:last-child [data-ah-reading-slot]{display:block;width:100%;min-width:0}
  body.sober-home #apphalt-produit .ah-product-reading .ah-real-capture{align-items:center}
  body.sober-home #ia .aiv138-card{padding:18px;box-shadow:0 10px 27px rgba(26,49,88,.055)}
  body.sober-home #ia .aiv138-card h3{font-size:clamp(28px,7.5vw,34px);margin-bottom:9px}
  body.sober-home #ia .aiv138-card .aiv12-desc{font-size:13px;line-height:1.45}
  body.sober-home #ia .aiv138-artifact{margin-top:14px;min-height:0;padding:12px;gap:10px}
  body.sober-home #ia .aiv138-note-stack span{margin-left:0;font-size:12px;line-height:1.32;padding:8px 10px}
  body.sober-home #ia .aiv138-note-stack span:nth-child(n){margin-left:0}
  body.sober-home #ia .aiv138-takeaway{margin-top:14px;padding-top:11px;font-size:12px}
  body.sober-home #ia .aiv138-outcome{padding:10px 12px}
  body.sober-home #ia .aiv138-outcome strong{font-size:12px}
  body.sober-home #interface-en-contexte .sober-scene-controls [data-workshop-step]{visibility:hidden!important}
}
.v153-structure-preview{display:block;min-width:0;margin:0;padding:16px;border:1px solid #64789e;border-radius:18px;background:#e7ecf5;color:#253d63;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif}
.v153-structure-preview .v153-structure-bar{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:650;padding-bottom:12px;border-bottom:1px solid #b9c7dd}
.v153-structure-preview .v153-structure-bar i{width:7px;height:7px;border-radius:50%;background:#9cacbf}
.v153-structure-preview .v153-structure-bar strong{margin-left:auto;font-size:11px}
.v153-structure-preview .v153-structure-tabs{display:flex;gap:8px;margin:16px 0 12px;font-size:12px}
.v153-structure-preview .v153-structure-tabs span{flex:1;border:1px dashed #a8b7cd;border-radius:7px;text-align:center;padding:8px 5px}
.v153-structure-preview .v153-structure-tabs span:first-child{background:#fff;border-color:#94a9c9;font-weight:700}
.v153-structure-preview .v153-structure-row{display:grid;grid-template-columns:26px minmax(0,1fr) auto;align-items:center;gap:9px;padding:13px 10px;background:#fff;border:1px solid #b5c3d8;border-radius:11px}
.v153-structure-preview .v153-structure-row .v153-square{width:23px;height:23px;border-radius:5px;background:#e2e9f5;border:1px solid #a0b2cb}
.v153-structure-preview .v153-structure-row strong{display:block;font-size:13px}
.v153-structure-preview .v153-structure-row small{display:block;color:#5f7694;font-size:11px;margin-top:3px}
.v153-structure-preview .v153-structure-action{display:block;border:1px solid #9fb3d2;border-radius:7px;background:#edf3ff;padding:7px 12px;font-size:12px;font-weight:700}
.v153-structure-preview figcaption{margin-top:13px;color:#506a8a;font-size:12px;line-height:1.45}

/* Tablets use the same complete-card carousel and navigable controls. */
@media (min-width:701px) and (max-width:800px){
  body.sober-home #ia .aiv132-controls{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:10px}
  body.sober-home #ia .aiv132-position{font:600 13px/1.3 var(--sans,Arial,sans-serif);font-variant-numeric:tabular-nums}
  body.sober-home #ia .aiv132-buttons{display:flex;gap:10px}
  body.sober-home #ia .aiv132-buttons button{display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid #cbd8eb;border-radius:50%;background:#fff;color:#234675;cursor:pointer}
  body.sober-home #ia .aiv132-buttons button:disabled{opacity:.38;cursor:default}
  body.sober-home #ia .aiv132-buttons button:focus-visible{outline:3px solid #3154ef;outline-offset:3px}
  body.sober-home #ia .aiv132-buttons svg{display:block;width:18px;height:18px;fill:currentColor}
}

/* The AI walkthrough is a scrollable carousel only below 701px.
   On tablets, its three cards use the existing document layout; showing
   disabled carousel controls would suggest navigation that cannot work. */
@media (min-width:701px) and (max-width:800px){
  body.sober-home #ia .aiv132-controls{display:none!important}
}
