/* ============================================================
   iPhone / narrow-screen reading mode

   This file is linked after each guide's print stylesheet, with chrome.js as
   a file:// fallback.
   Phone rules are screen-scoped; print rules preserve every letter-size sheet.
   ============================================================ */

@media screen{
  .guide-skip{position:fixed;z-index:2000;top:8px;left:8px;padding:10px 14px;border-radius:8px;background:var(--ink);color:#fff;font-weight:800;text-decoration:none;transform:translateY(-160%)}
  .guide-skip:focus{transform:none}
  .guide-context-nav{
    position:sticky;
    z-index:900;
    top:0;
    width:100%;
    border-bottom:1px solid rgba(11,11,12,.18);
    background:rgba(250,247,242,.97);
    box-shadow:0 5px 22px rgba(11,11,12,.12);
    backdrop-filter:blur(16px) saturate(1.15);
    -webkit-backdrop-filter:blur(16px) saturate(1.15);
  }
  .guide-context-inner{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:10px 18px;
    width:min(calc(100% - 28px),8.5in);
    min-height:64px;
    margin:0 auto;
    padding:8px 0;
  }
  .guide-breadcrumb{
    display:flex;
    align-items:center;
    gap:6px;
    min-width:0;
    color:var(--ink-3);
    font-size:12px;
    line-height:1.25;
  }
  .guide-breadcrumb a{color:var(--primer-red-deep);font-weight:800;text-decoration:none;white-space:nowrap}
  .guide-breadcrumb a:hover{text-decoration:underline;text-underline-offset:3px}
  .guide-breadcrumb-current{min-width:0;overflow:hidden;color:var(--ink);font-weight:800;text-overflow:ellipsis;white-space:nowrap}
  .guide-breadcrumb-current::before{content:"/";margin-right:6px;color:var(--ink-4);font-weight:500}
  .guide-breadcrumb-separator{color:var(--ink-4)}
  .guide-context-actions{display:flex;align-items:stretch;gap:6px;min-width:0}
  .guide-context-actions :is(a,button,summary,select){min-height:44px}
  .guide-nav-step,
  .guide-nav-pdf,
  .reader-contents-toggle,
  .guide-related summary,
  .guide-nav-chooser select{
    border:1px solid var(--rule-hair);
    border-radius:9px;
    background:#fff;
    color:var(--ink);
    font-family:"Hanken Grotesk",ui-sans-serif,system-ui,sans-serif;
  }
  .guide-nav-step{
    display:flex;
    flex-direction:column;
    justify-content:center;
    max-width:132px;
    padding:5px 9px;
    overflow:hidden;
    text-decoration:none;
  }
  .guide-nav-kicker{color:var(--primer-red-deep);font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
  .guide-nav-title{overflow:hidden;font-size:11px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}
  .guide-nav-step--next{text-align:right}
  .guide-nav-step.is-disabled{justify-content:center;color:var(--ink-4);font-size:11px;font-weight:700;pointer-events:none}
  .guide-nav-step.is-disabled .guide-nav-kicker{color:inherit}
  .guide-nav-chooser{display:flex;flex-direction:column;justify-content:center;gap:2px;min-width:142px}
  .guide-nav-chooser > span{padding-left:3px;color:var(--ink-3);font-size:9px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
  .guide-nav-chooser select{width:100%;min-width:0;padding:0 28px 0 9px;font-size:12px;font-weight:700}
  .guide-related{position:relative}
  .guide-related summary,
  .guide-nav-pdf,
  .reader-contents-toggle{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 11px;
    color:var(--ink);
    font-size:12px;
    font-weight:800;
    text-decoration:none;
    cursor:pointer;
    list-style:none;
  }
  .guide-related summary::-webkit-details-marker{display:none}
  .guide-related summary::after{content:"+";margin-left:6px;color:var(--primer-red);font-family:"JetBrains Mono",ui-monospace,monospace}
  .guide-related[open] summary::after{content:"\2212"}
  .guide-related-menu{
    position:absolute;
    z-index:5;
    top:calc(100% + 7px);
    right:0;
    display:grid;
    width:min(280px,calc(100vw - 28px));
    padding:6px;
    border:1px solid var(--rule-hair);
    border-radius:10px;
    background:#fff;
    box-shadow:0 16px 38px rgba(11,11,12,.2);
  }
  .guide-related-menu a{padding:10px;border-radius:6px;color:var(--ink);font-size:13px;font-weight:700;text-decoration:none}
  .guide-related-menu a:hover{background:var(--paper-warm);color:var(--primer-red-deep)}
  .guide-nav-pdf{border-color:var(--primer-red);background:var(--primer-red);color:#fff;gap:5px}
  .guide-context-actions :is(a,summary,select):focus-visible,
  .guide-context-actions button:focus-visible,
  .guide-breadcrumb a:focus-visible{outline:3px solid var(--primer-red);outline-offset:2px}
  @media (hover:hover){
    .guide-context-actions :is(.guide-nav-step,.guide-related summary,.guide-nav-chooser select):hover{border-color:var(--ink)}
    .guide-nav-pdf:hover{border-color:var(--primer-red-deep);background:var(--primer-red-deep)}
  }
  .mobile-figure-scroll{display:contents}
  .mobile-table-scroll{display:contents}

  body.idx .ix-phone-note{display:none}
  body.idx .ix-tools{margin:14px 0 4px}
  body.idx .ix-search-label{
    display:block;
    margin:0 0 6px;
    font-size:10px;
    font-weight:800;
    letter-spacing:.1em;
    text-transform:uppercase;
    color:var(--ink-3);
  }
  body.idx .ix-search-shell{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
  body.idx .ix-search,
  body.idx .ix-clear{
    min-height:44px;
    border:1px solid var(--rule-hair);
    border-radius:9px;
    background:#fff;
    color:var(--ink);
    font:600 16px/1.2 "Hanken Grotesk",ui-sans-serif,system-ui,sans-serif;
  }
  body.idx .ix-search{width:100%;padding:9px 13px;outline:none;-webkit-appearance:none;appearance:none}
  body.idx .ix-search::placeholder{color:var(--ink-4)}
  body.idx .ix-search:focus{border-color:var(--primer-red);box-shadow:0 0 0 3px rgba(218,41,28,.12)}
  body.idx .ix-clear{padding:0 14px;color:var(--primer-red-deep);font-size:13px;font-weight:800;cursor:pointer}
  body.idx .ix-results{min-height:17px;margin-top:5px;font-size:11px;color:var(--ink-3)}
  body.idx .ix-empty{
    margin:24px 0;
    padding:18px;
    border:1px dashed var(--rule-hair);
    border-radius:10px;
    background:#fff;
    text-align:center;
    color:var(--ink-2);
  }
  body.idx .ix-empty b,
  body.idx .ix-empty span{display:block}
  body.idx .ix-empty span{margin-top:4px;font-size:13px;color:var(--ink-3)}
  body.idx [hidden]{display:none !important}
  body.idx :is(.gc-main,.gc-download,.ix-sec-t a):focus-visible{outline:3px solid var(--primer-red);outline-offset:-3px}
}

/* ============================================================
   Continuous web reader

   The same .page sections remain letter sheets in print. On screen they are
   chapters in one reading surface, with a sticky outline on wide viewports
   and an accessible drawer on tablets and phones.
   ============================================================ */
@media screen{
  html{scroll-padding-top:var(--guide-context-offset,88px)}
  body.mcp-reader{background:#f2f0ec}
  body.mcp-reader.reader-outline-open{overflow:hidden}

  .reader-shell{
    display:grid;
    grid-template-columns:248px minmax(0,880px);
    align-items:start;
    justify-content:center;
    gap:28px;
    width:min(100%,1240px);
    margin:0 auto;
    padding:28px 24px 64px;
  }
  .reader-shell > main{min-width:0}
  .reader-outline{
    position:sticky;
    z-index:40;
    top:88px;
    max-height:calc(100vh - 112px);
    overflow:auto;
    border:1px solid rgba(20,33,61,.14);
    border-radius:14px;
    background:rgba(255,255,255,.96);
    box-shadow:0 12px 34px rgba(20,33,61,.08);
    scrollbar-width:thin;
  }
  .reader-outline-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    padding:17px 17px 13px;
    border-bottom:1px solid var(--rule-soft);
  }
  .reader-outline-kicker{
    display:block;
    color:var(--primer-red-deep);
    font:800 10px/1.2 "JetBrains Mono",ui-monospace,monospace;
    letter-spacing:.08em;
    text-transform:uppercase;
  }
  .reader-outline h2{
    margin:5px 0 0;
    color:#14213d;
    font-size:18px;
    line-height:1.12;
    letter-spacing:-.015em;
  }
  .reader-outline-close{
    display:none;
    width:40px;
    height:40px;
    flex:0 0 40px;
    border:1px solid var(--rule-hair);
    border-radius:9px;
    background:#fff;
    color:var(--ink);
    font:500 25px/1 "Hanken Grotesk",ui-sans-serif,system-ui,sans-serif;
    cursor:pointer;
  }
  .reader-outline-list{margin:0;padding:8px;list-style:none}
  .reader-outline-list li{margin:0;padding:0}
  .reader-outline-list a{
    display:grid;
    grid-template-columns:28px minmax(0,1fr);
    gap:8px;
    align-items:start;
    padding:9px 8px;
    border-radius:8px;
    color:var(--ink-2);
    font-size:12px;
    font-weight:700;
    line-height:1.28;
    text-decoration:none;
  }
  .reader-outline-list a:hover{background:var(--paper-warm);color:var(--primer-red-deep)}
  .reader-outline-list a[aria-current]{background:#14213d;color:#fff}
  .reader-outline-number{
    color:var(--primer-red-deep);
    font:800 10px/1.45 "JetBrains Mono",ui-monospace,monospace;
  }
  .reader-outline-list a[aria-current] .reader-outline-number{color:#fca311}
  .reader-outline-list a:focus-visible,
  .reader-outline-close:focus-visible{outline:3px solid #fca311;outline-offset:2px}
  .reader-outline-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 16px 15px;border-top:1px solid var(--rule-soft)}
  .reader-outline-foot a{color:var(--primer-red-deep);font-size:12px;font-weight:800;text-decoration:none}
  .reader-outline-foot a:hover{text-decoration:underline;text-underline-offset:3px}
  .reader-backdrop{display:none}
  .reader-contents-toggle{
    display:none;
    align-items:center;
    justify-content:center;
    gap:6px;
    padding:0 12px;
    border:1px solid var(--rule-hair);
    border-radius:9px;
    background:#fff;
    color:var(--ink);
    font:800 12px/1 "Hanken Grotesk",ui-sans-serif,system-ui,sans-serif;
    cursor:pointer;
  }

  body.mcp-reader .stage{
    display:block;
    min-height:0;
    padding:0;
    gap:0;
    overflow:hidden;
    border:1px solid rgba(20,33,61,.13);
    border-radius:16px;
    background:#fff;
    box-shadow:0 22px 54px rgba(20,33,61,.12);
  }
  body.mcp-reader .stage > .page{
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    min-height:0;
    margin:0 !important;
    padding:34px 40px 30px !important;
    overflow:visible !important;
    border:0;
    border-bottom:1px solid var(--rule-soft);
    background:#fff;
    box-shadow:none !important;
    font-size:14.5px;
    line-height:1.44;
    letter-spacing:0;
    scroll-margin-top:var(--guide-context-offset,92px);
  }
  body.mcp-reader .stage > .page:last-child{border-bottom:0}
  body.mcp-reader .page > .ptab{display:none !important}
  body.mcp-reader .page:not(:first-child) > .head,
  body.mcp-reader .page:not(:first-child) > .evidence-notice{display:none}
  body.mcp-reader .reader-chapter-title{
    display:block;
    margin:0 0 20px;
    padding:0 0 11px;
    border-bottom:2px solid #14213d;
    color:#14213d;
    font-size:25px;
    font-weight:850;
    line-height:1.12;
    letter-spacing:-.025em;
  }
  body.mcp-reader .stage [id]{scroll-margin-top:var(--guide-context-offset,92px)}
  body.mcp-reader .page > .head{margin-bottom:18px}
  body.mcp-reader .head .title h1{font-size:28px !important;line-height:1.02}
  body.mcp-reader .head .title .sub{font-size:11px !important;line-height:1.35}
  body.mcp-reader .head .meta{font-size:10px}
  body.mcp-reader .head .meta .vcode{display:none}

  body.mcp-reader .page :where(p,li,dd,dt){line-height:1.44}
  body.mcp-reader .page .reader-text-floor{
    font-size:12.5px !important;
    line-height:1.38 !important;
  }
  body.mcp-reader .page :is(.micro,.small,.fine,.muted-note,.note-sm,.dose,.mono,code,.num-mono,.xref){
    font-size:12.5px !important;
    line-height:1.4 !important;
  }
  body.mcp-reader .page :is(.indic,.hold,.never,.diff,.factoid,.checklist,.policy,.sc,.ec,.defcard,.t-card){
    font-size:13px !important;
    line-height:1.42 !important;
  }
  body.mcp-reader .page .band{margin-top:20px}
  body.mcp-reader .page .band h2{font-size:16px !important;line-height:1.2}
  body.mcp-reader .page .band .tag{font-size:10px !important}
  body.mcp-reader .page :is(.sub-h,.blk-h,.policy-h,.sys-h,.sc-h,.ec-h,.drug-hd,.drug .d-hd){
    font-size:12px !important;
    line-height:1.3 !important;
  }
  body.mcp-reader .page table :is(th,td),
  body.mcp-reader .page table.tbl :is(th,td){font-size:12px !important;line-height:1.36 !important}
  body.mcp-reader .page table thead th,
  body.mcp-reader .page table.tbl thead th{font-size:10.5px !important}
  body.mcp-reader .page figure{max-width:100%;height:auto}
  body.mcp-reader .page :is(img,svg,canvas,video){max-width:100%;height:auto}

  body.mcp-reader .page > .pfoot:not(:has(.reflist-inline:not(:empty))){display:none}
  body.mcp-reader .page > .pfoot:has(.reflist-inline:not(:empty)){
    display:block;
    margin-top:26px;
    padding-top:12px;
    border-top:1px solid var(--rule-hair);
    line-height:1.45;
  }
  body.mcp-reader .pfoot:has(.reflist-inline:not(:empty))::before{
    content:"Sources for this chapter";
    display:block;
    margin-bottom:5px;
    color:var(--primer-red-deep);
    font-size:10px;
    font-weight:850;
    letter-spacing:.08em;
    text-transform:uppercase;
  }
  body.mcp-reader .pfoot .toc,
  body.mcp-reader .pfoot .stamp{display:none}
  body.mcp-reader .pfoot .refs{font-size:11px !important;line-height:1.45}
  body.mcp-reader .pfoot .rf{white-space:normal;overflow-wrap:anywhere}
}

@media screen and (max-width:1024px){
  :root{color-scheme:light}

  html{
    min-width:0;
    max-width:100%;
    overflow-x:hidden !important;
    overflow-x:clip !important;
    scroll-behavior:smooth;
    text-size-adjust:100%;
    -webkit-text-size-adjust:100%;
  }

  body:not(.idx){
    width:100%;
    min-width:0;
    max-width:100%;
    overflow-x:hidden !important;
    overflow-x:clip !important;
    background:#f2f0ec;
    padding:0;
  }

  .guide-context-inner{
    grid-template-columns:minmax(0,1fr);
    gap:6px;
    width:100%;
    min-height:0;
    padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left));
  }
  .guide-breadcrumb{font-size:11px}
  .guide-breadcrumb a:nth-of-type(2),
  .guide-breadcrumb-separator{display:none}
  .guide-breadcrumb-current::before{content:"/"}
  .guide-context-actions{
    display:grid;
    grid-template-columns:44px minmax(0,1fr) auto auto 44px;
    grid-template-areas:"previous chooser contents pdf next";
    gap:5px;
  }
  .guide-nav-step--previous{grid-area:previous}
  .guide-nav-chooser{grid-area:chooser}
  .reader-contents-toggle{grid-area:contents;display:flex;min-width:98px}
  .guide-nav-pdf{grid-area:pdf}
  .guide-nav-step--next{grid-area:next}
  .guide-related{display:none}
  .guide-nav-step{align-items:center;width:44px;padding:0;text-align:center}
  .guide-nav-kicker{font-size:0}
  .guide-nav-step--previous .guide-nav-kicker::after{content:"\2190";font-size:20px}
  .guide-nav-step--next .guide-nav-kicker::after{content:"\2192";font-size:20px}
  .guide-nav-step.is-disabled .guide-nav-kicker::after{color:var(--ink-4)}
  .guide-nav-title{display:none}
  .guide-nav-step.is-disabled{font-size:0}
  .guide-nav-chooser{min-width:0}
  .guide-nav-chooser > span{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
  .guide-nav-chooser select{height:44px;font-size:13px}
  .guide-related summary{padding:0 9px;font-size:12px;white-space:nowrap}
  .guide-nav-pdf{padding:0 10px;font-size:12px}
  .guide-related-menu{right:auto;left:50%;transform:translateX(-50%)}

  .reader-shell{display:block;width:100%;padding:0}
  .reader-outline{
    position:fixed;
    z-index:1200;
    top:0;
    bottom:0;
    left:0;
    width:min(86vw,360px);
    max-height:none;
    border:0;
    border-right:1px solid rgba(20,33,61,.16);
    border-radius:0 16px 16px 0;
    box-shadow:0 20px 60px rgba(11,11,12,.28);
    transform:translateX(-105%);
    transition:transform .2s ease;
  }
  .reader-outline-open .reader-outline{transform:none}
  .reader-outline-close{display:block}
  .reader-backdrop{
    position:fixed;
    z-index:1100;
    inset:0;
    display:block;
    border:0;
    background:rgba(11,11,12,.44);
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
  }
  .reader-outline-open .reader-backdrop{opacity:1;pointer-events:auto}

  .stage{
    display:block;
    width:100% !important;
    min-width:0;
    max-width:100% !important;
    min-height:0;
    padding:0 !important;
    margin:0 !important;
    overflow-x:hidden;
    overflow-x:clip;
    background:#f2f0ec;
  }

  .stage > .page{
    box-sizing:border-box;
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    min-height:0;
    margin:0 !important;
    padding-top:16px !important;
    padding-right:max(16px,env(safe-area-inset-right)) !important;
    padding-bottom:30px !important;
    padding-left:max(16px,env(safe-area-inset-left)) !important;
    overflow-x:hidden !important;
    overflow-x:clip !important;
    overflow-y:visible !important;
    box-shadow:none !important;
    font-size:15px;
    line-height:1.46;
    letter-spacing:0;
    overflow-wrap:break-word;
    word-break:normal;
  }

  body.mcp-reader .stage{border:0;border-radius:0;box-shadow:none}
  body.mcp-reader .stage > .page{
    padding-top:22px !important;
    padding-bottom:30px !important;
  }
  body.mcp-reader .reader-chapter-title{margin-bottom:16px;font-size:22px}
  body.mcp-reader .page .reader-text-floor{font-size:13px !important;line-height:1.42 !important}

  .stage > .page > *,
  .stage > .page :where(div,section,article,aside,header,footer,figure,ul,ol,dl){min-width:0}

  /* Remove fixed-PDF edge furniture in the phone reader. */
  .page > .ptab{display:none !important}

  /* Masthead: wrap instead of clipping a one-line print title. */
  .page > .head{
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    gap:8px 10px;
    align-items:center;
    margin:0 0 12px;
    padding:0 0 10px;
    border-bottom:2px solid var(--ink);
  }
  .head .brand{grid-column:1;grid-row:1;min-width:0}
  .head .brand .primer-logo,
  .head--mini .brand .primer-logo,
  .head .logo,
  .head--mini .logo{
    height:40px !important;
    width:auto !important;
    max-width:108px !important;
    max-height:40px !important;
    object-fit:contain;
  }
  .head .title{grid-column:2;grid-row:1;min-width:0;overflow:visible}
  .head .title h1,
  .head--mini .title h1{
    margin:0;
    overflow:visible;
    white-space:normal;
    text-overflow:clip;
    font-size:22px !important;
    line-height:1.06;
    letter-spacing:-.02em;
  }
  .head .title .sub,
  .head--mini .title .sub{
    margin-top:5px;
    overflow:visible;
    white-space:normal;
    text-overflow:clip;
    font-size:11px !important;
    line-height:1.3;
    letter-spacing:.045em;
  }
  .head .meta{
    grid-column:1 / -1;
    grid-row:2;
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
    text-align:left;
    white-space:normal;
    font-size:11px !important;
  }
  .head .meta .page-tag,
  .head .meta .modality{font-size:11px !important}
  .head .meta .modality{margin-top:0;padding:4px 8px;border-radius:999px}
  .head .meta .vcode{display:none}
  .evidence-notice{gap:7px;margin:7px 0 10px;padding:8px 10px;font-size:13px;line-height:1.4}
  .evidence-notice b{font-size:11px;line-height:1.35}

  /* Establish a legible 15px content baseline despite print-specific pt sizes. */
  .page :where(p,li,td,th,dd,dt){
    font-size:inherit !important;
    line-height:inherit !important;
  }
  .page :where(h2){font-size:17px !important;line-height:1.2}
  .page :where(h3){font-size:16px !important;line-height:1.22}
  .page :where(h4){font-size:15px !important;line-height:1.25}
  .page :where(figcaption,caption){font-size:13px !important;line-height:1.4}
  .page :where(.small,.fine,.muted-note,.note-sm){font-size:13px !important;line-height:1.42}
  .page :where(.dose,.mono,code,.num-mono,.xref){font-size:13px !important}
  .page :where(cite,sup,.rf){font-size:11px !important}

  /* Section banners become two-line headings on narrow screens. */
  .page .band{
    display:grid;
    grid-template-columns:26px minmax(0,1fr);
    gap:5px 9px;
    align-items:center;
    margin:20px 0 8px !important;
  }
  .page .band .num{grid-column:1;grid-row:1;width:26px;height:26px;font-size:12px !important}
  .page .band h2{grid-column:2;grid-row:1;min-width:0;white-space:normal}
  .page .band .rule{display:none}
  .page .band .tag{
    grid-column:2;
    grid-row:2;
    max-width:none;
    padding:0;
    white-space:normal;
    font-size:11px !important;
    line-height:1.32;
  }
  .page .sub-h,
  .page .blk-h,
  .page .policy-h,
  .page .sys-h,
  .page .sc-h,
  .page .ec-h,
  .page .drug-hd,
  .page .drug .d-hd{font-size:13px !important;line-height:1.3}

  /* Print columns become a natural vertical reading order. */
  .page :is(.cols2,.cols3,.cols4,.emg,.emg.c3,.defrow,.rx-grid,.fork,
            .grp-grid,.targets,.drug-grid.cols-2,.drug-grid.cols-3,
            .device-page,.circuit-wrap,.mcs,.mgmt,
            .grade-grid,.trev,.hts-grid,.callouts,.scn-grid,
            .scn-shows,.always,.sys-grid,.frame-strip,.status-grid,
            .geo-strip,.visit-grid,.always-visit,.phases,.upd-grid,
            .hemo-grid,.crit-grid,.crit-grid.three,.rev-strip,.phone-grid,
            .fam,.echo-grid,.ckl,.surv-strip,.gdmt,.bio-grid,
            .dir-grid,.score-legend,.risk-actions,.tools-strip,.ldl-goals,
            .nproto .np-grid,.contact-card,.wtd,.src-lib,.attr-vs,
            .twocol-tab,.grade-stack,.ci-strip,.drug-grid,.score-pair,
            .drug.feature .drug-body){
    grid-template-columns:minmax(0,1fr) !important;
  }
  body.mcp-phone #aorta .page .flow .row,
  body.mcp-phone #tac .page .chads{grid-template-columns:minmax(0,1fr) !important}
  .page :is(.cols2,.cols3) > .col{
    padding:10px 0 !important;
    border-right:0 !important;
    border-bottom:1px solid var(--rule-hair);
  }
  .page :is(.cols2,.cols3) > .col:last-child{border-bottom:0}
  .page :is(.rx-grid,.fork,.grade-grid) > *{
    border-right:0 !important;
    border-bottom:1px solid var(--rule-hair) !important;
  }
  .page :is(.rx-grid,.fork,.grade-grid) > *:last-child{border-bottom:0 !important}

  .page .emerg{grid-template-columns:minmax(0,1fr) !important;font-size:14px}
  .page .emerg .lbl{justify-content:flex-start;text-align:left;padding:7px 10px}
  .page .emerg .cells,
  .page .emerg .cells.c5{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .page .emerg .cell{padding:8px;border-right:0;border-bottom:1px dashed rgba(156,16,16,.35)}

  .page .statline{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0}
  .page .statline > div{padding:9px 7px;border-bottom:1px solid var(--rule-hair)}
  .page .statline .sv{font-size:18px !important;line-height:1.08}
  .page .statline .sk{font-size:11px !important;line-height:1.25}

  .page .trev .tl{border-right:0;border-bottom:3px solid var(--primer-red)}
  .page .trev .trow{grid-template-columns:84px minmax(0,1fr) !important;gap:8px}
  .page .drug .d-row,
  .page .emg .ec-b .er{grid-template-columns:78px minmax(0,1fr) !important;gap:8px}
  .page .drug .d-hd,
  .page .emg .ec-h{grid-template-columns:minmax(0,1fr) auto !important}
  .page .drug.combo .combo-body{grid-template-columns:minmax(0,1fr) !important}
  .page .drug{grid-template-columns:minmax(0,1fr) !important}
  .page .drug .d-name{
    min-width:0 !important;
    padding:0 0 8px !important;
    border-right:0 !important;
    border-bottom:1px dotted var(--rule-soft);
  }
  .page .contact-card .cc-h{grid-column:1 !important}
  .page .contact-card .cc-ways div{grid-template-columns:minmax(88px,auto) minmax(0,1fr) !important;gap:8px}
  .page .contact-card .cc-team{margin-top:8px}
  body.mcp-phone #aorta .page .flow .arrow{min-height:24px;transform:rotate(90deg)}
  .page .wex{display:grid !important;grid-template-columns:minmax(0,1fr) !important;gap:6px !important}
  .page .wex-step,
  .page .wex-step.tier-hi{min-width:0 !important;width:auto !important;flex:none !important}
  .page .wex-arrow{min-height:24px !important;transform:rotate(90deg);flex:none !important}
  .page .callif{white-space:normal !important}
  .page .algo-body{grid-template-columns:minmax(0,1fr) !important}
  .page .lever{grid-template-columns:96px minmax(0,1fr) !important}
  .page .lever .lk{width:auto !important;min-width:0;padding-right:8px}

  /* Preserve true comparison matrices as pannable structures. */
  .page :is(.device-compare,.hls-compare,.mech-strip,.plvl,.role-grid){
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
  }
  .page .device-compare{
    grid-template-columns:minmax(126px,.7fr) repeat(2,minmax(190px,1fr)) !important;
  }
  .page .hls-compare{
    grid-template-columns:132px repeat(2,minmax(190px,1fr)) !important;
  }
  .page .mech-strip{
    grid-template-columns:minmax(92px,auto) repeat(4,minmax(168px,1fr)) !important;
  }
  .page .mech-strip.mech-strip--5{
    grid-template-columns:minmax(92px,auto) repeat(5,minmax(164px,1fr)) !important;
  }
  .page .plvl{grid-template-columns:repeat(10,minmax(66px,1fr)) !important}
  .page .role-grid{grid-template-columns:repeat(2,minmax(250px,1fr)) !important}
  .page .cal-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .page .cal{min-width:1040px}
  .page :is(.device-compare,.hls-compare,.mech-strip,.plvl,.role-grid,.cal-wrap):focus-visible{
    outline:3px solid var(--primer-red);
    outline-offset:2px;
  }

  .mobile-figure-scroll{
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    padding:2px 0 8px;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
  }
  .mobile-figure-scroll.is-scrollable::before{
    content:"Swipe diagram ↔";
    position:sticky;
    left:0;
    z-index:1;
    display:inline-block;
    margin:0 0 6px;
    padding:4px 7px;
    border-radius:999px;
    background:rgba(11,11,12,.88);
    color:#fff;
    font-size:10px;
    font-weight:800;
    letter-spacing:.045em;
    text-transform:uppercase;
  }
  .mobile-figure-scroll:focus-visible{outline:3px solid var(--primer-red);outline-offset:2px}
  .page .mobile-figure-stack{display:block !important}
  .page .mobile-figure-stack > *{width:100% !important;max-width:100% !important}
  .page svg.mobile-figure-fit{display:block;width:100% !important;max-width:100% !important;height:auto !important}
  .page .mobile-figure-scroll > svg{
    display:block;
    width:var(--mobile-figure-width,700px) !important;
    max-width:none !important;
    height:auto !important;
  }

  /* Tables retain their clinical relationships; wide ones pan independently. */
  .page table,
  .page table.tbl,
  .page table.proto-tbl{
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
    font-size:13px !important;
    line-height:1.38;
    border-collapse:collapse;
  }
  .page table :is(th,td),
  .page table.tbl :is(th,td){
    padding:7px 8px !important;
    font-size:13px !important;
    line-height:1.38;
    overflow-wrap:break-word;
    word-break:normal;
  }
  .page table thead th,
  .page table.tbl thead th{font-size:11px !important;line-height:1.3;letter-spacing:.055em}
  .page table:has(tr > :nth-child(3)) tr > *{min-width:132px}
  .page table:has(tr > :nth-child(4)) tr > *{min-width:118px}
  .page table:has(tr > :nth-child(6)) tr > *{min-width:104px}
  body.mcp-phone table :is(th,td),
  body.mcp-phone table :is(col,colgroup){width:auto !important}
  body.mcp-phone .page table :is(th,td){white-space:normal !important}
  .page :where(.nowrap,table .phase,table td.k){white-space:normal !important}

  /* Counter a few guide-local print-density declarations that use !important. */
  body.mcp-phone #aorta .tight td{
    padding:7px 8px !important;
    font-size:13px !important;
    line-height:1.38 !important;
  }

  .mobile-table-scroll{
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
  }
  .page .mobile-table-scroll > table{
    display:table;
    width:100% !important;
    max-width:none !important;
    table-layout:auto !important;
    overflow:visible;
  }
  .page .mobile-table-scroll > table:has(tr > :nth-child(3)){min-width:600px}
  .page .mobile-table-scroll > table:has(tr > :nth-child(4)){min-width:720px}
  .page .mobile-table-scroll > table:has(tr > :nth-child(6)){min-width:940px}
  .page .mobile-table-scroll > table:has(tr > :nth-child(8)){min-width:1160px}
  .mobile-table-scroll.is-wide::before{
    content:"Swipe table ↔";
    position:sticky;
    left:0;
    z-index:1;
    display:inline-block;
    margin:3px 0 5px;
    padding:4px 7px;
    border-radius:999px;
    background:rgba(11,11,12,.88);
    color:#fff;
    font-size:10px;
    font-weight:800;
    letter-spacing:.045em;
    text-transform:uppercase;
  }
  .mobile-table-scroll:focus-visible{outline:3px solid var(--primer-red);outline-offset:2px}

  /* Cards and callouts get enough air for quick bedside scanning. */
  .page :is(.indic,.hold,.warn,.factoid,.checklist,.policy,.sc,.ec,.drug,
            .defcard,.contact-card,.combo,.t-card){line-height:1.42}
  .page :is(.indic,.hold){padding:9px 10px}
  .page :is(.algo .step,.drug .d-body,.emg .ec-b,.defcard){padding-top:8px;padding-bottom:8px}
  .page ul.dense,
  .page ol.dense{column-count:1 !important}
  .page ul.dense li,
  .page ol.dense li{padding-top:4px;padding-bottom:4px;line-height:1.42}
  .page :is(.drug .d-row,.trev .trow,.emg .er,.mcs .row-m,.tl-row,
            .tips .tip,.spec-rows,.scn-step,.v-row,.upd-row){
    grid-template-columns:minmax(84px,auto) minmax(0,1fr) !important;
  }

  .page figure{max-width:100% !important;height:auto !important}
  .page :is(img,svg,canvas,video){max-width:100% !important;max-height:none !important;height:auto !important}
  body.mcp-phone[data-guide-id="impella"] .page :is(.tree,figure.shot.center){
    width:100% !important;
    max-width:100% !important;
  }
  /* References remain available, but version tracking noise is minimized. */
  .page > .pfoot{
    display:block;
    margin-top:24px;
    padding-top:12px;
    border-top:1px solid var(--rule-hair);
    line-height:1.45;
  }
  .pfoot .refs{font-size:12px !important;line-height:1.45}
  .pfoot .rf{white-space:normal !important;overflow-wrap:anywhere}
  .pfoot .toc{margin-bottom:8px}
  .pfoot .stamp{margin-top:10px;text-align:left;font-size:11px !important}
  .pfoot .stamp .vcode{display:none}

  /* Library landing page. */
  body.idx{min-width:0;overflow-x:hidden;background:var(--paper-warm);padding:0 14px 40px}
  .ix-wrap{width:100%;max-width:640px}
  .ix-head{align-items:flex-start;gap:11px;padding:18px 0 14px;margin:0 0 8px}
  .ix-head .primer-logo{height:46px}
  .ix-head h1{font-size:28px;line-height:1.02}
  .ix-head .sub{font-size:12px;line-height:1.4;letter-spacing:.045em}
  body.idx .ix-phone-note{display:none}
  body.idx .ix-phone-note b{font-size:12px;letter-spacing:.05em;text-transform:uppercase;color:var(--primer-red-deep)}
  body.idx .ix-tools{
    position:sticky;
    z-index:20;
    top:0;
    margin:0 -14px 5px;
    padding:9px 14px 7px;
    background:rgba(250,247,242,.96);
    border-bottom:1px solid rgba(11,11,12,.1);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
  }
  body.idx .ix-search-label{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    padding:0 !important;
    margin:-1px !important;
    overflow:hidden !important;
    clip:rect(0,0,0,0) !important;
    white-space:nowrap !important;
    border:0 !important;
  }
  body.idx .ix-results{margin-top:4px}
  .ix-section{gap:10px;margin-top:25px}
  #ix-content > .ix-section:first-child{margin-top:16px}
  .ix-sec-t{font-size:19px;white-space:normal}
  .ix-sec-n{font-size:10px}
  .ix-subsection{font-size:11px;margin-top:14px}
  .ix-grid{grid-template-columns:minmax(0,1fr);gap:12px;margin-top:9px}
  .gcard{border-radius:12px;box-shadow:0 2px 10px rgba(11,11,12,.06)}
  .gcard:hover{transform:none;box-shadow:0 2px 10px rgba(11,11,12,.06)}
  .gcard .gc-top{padding:15px 16px 14px}
  .gcard .gc-n{font-size:10px}
  .gcard .gc-t{font-size:21px;line-height:1.08;margin-top:6px}
  .gcard .gc-s{font-size:11px;line-height:1.35}
  .gcard .gc-body{padding:12px 16px 15px}
  .gcard .gc-pages li{font-size:14px;line-height:1.42;padding:6px 0 6px 22px}
  .gcard .gc-pages li .pn{top:7px;font-size:10px}
  .gcard .gc-go{min-height:44px;margin-top:8px;font-size:13px}
  .gcard .gc-download{min-height:48px;padding:10px 16px;font-size:12px}
  .gcard{touch-action:manipulation}
  .gcard:active{transform:scale(.99)}
  .ix-foot{display:block;margin-top:24px;padding-top:14px}
  .ix-foot .note{max-width:none;font-size:13px;line-height:1.5}
  .ix-foot .stamp{margin-top:12px;text-align:left;font-size:11px}
}

@media screen and (max-width:480px){
  .guide-context-actions{position:relative}
  .guide-related{position:static}
  .guide-related-menu{left:0;right:0;width:auto;transform:none}
}

@media screen and (max-width:1024px) and (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .reader-outline,.reader-backdrop{transition:none}
  .gcard{transition:none}
  .gcard:active{transform:none}
}

@media print{
  .guide-skip,
  .guide-context-nav,
  .reader-outline,
  .reader-backdrop,
  .reader-contents-toggle,
  .reader-chapter-title{display:none !important}
  .reader-shell{display:block !important;width:auto !important;margin:0 !important;padding:0 !important}
  .reader-shell > main{display:block !important}
  .mobile-figure-scroll,
  .mobile-table-scroll{display:contents !important}
  .mobile-figure-scroll::before,
  .mobile-table-scroll::before{display:none !important;content:none !important}
}

@media screen and (max-width:370px){
  .guide-context-actions{
    grid-template-columns:44px minmax(0,1fr) minmax(0,1fr) 44px;
    grid-template-areas:
      "previous chooser chooser next"
      "contents contents pdf pdf";
  }
  .guide-nav-step--previous{grid-area:previous}
  .guide-nav-chooser{grid-area:chooser}
  .reader-contents-toggle{grid-area:contents;width:100%}
  .guide-nav-pdf{grid-area:pdf;width:100%}
  .guide-nav-step--next{grid-area:next}
  .reader-contents-toggle,.guide-nav-pdf{min-height:44px}
  .stage > .page{padding-left:max(13px,env(safe-area-inset-left)) !important;padding-right:max(13px,env(safe-area-inset-right)) !important}
  .head .brand .primer-logo,
  .head--mini .brand .primer-logo{height:36px;max-width:92px}
  .head .title h1,
  .head--mini .title h1{font-size:20px !important}
  .page .partbar{flex-direction:column !important;align-items:flex-start !important;gap:3px !important}
  .page .partbar :is(.pt,.pd){width:auto !important;max-width:100% !important;overflow-wrap:break-word !important;word-break:normal !important}
  .page :is(.geo-strip,.always-visit,.phases,.rev-strip) > *{border-right:0 !important;border-bottom:1px solid var(--rule-hair) !important}
  .page :is(.geo-strip,.always-visit,.phases,.rev-strip) > *:last-child{border-bottom:0 !important}
}
