/* v9 (cycle 7): phone + tablet first. Bottom tab bar, thumb decision cards, sticky Adjusted EBITDA, tablet two-pane evidence. */
#btab,#mebar,#moresheet{display:none}
@media (max-width:1024px){
 body.has-btab{padding-bottom:calc(64px + env(safe-area-inset-bottom))}
 body.has-btab nav#nav{display:none!important}
 #btab{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;z-index:60;background:#FBF9F4;border-top:1px solid #1B1A17;padding-bottom:env(safe-area-inset-bottom)}
 #btab button{position:relative;min-height:60px;border:0;background:transparent;font:500 11px 'IBM Plex Sans',system-ui,sans-serif;color:#4A4636;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;cursor:pointer}
 #btab button i{font:600 13px 'IBM Plex Mono',monospace;font-style:normal;width:26px;height:22px;display:flex;align-items:center;justify-content:center;border:1px solid #cfc8b6;background:#fff}
 #btab button[aria-current="page"]{color:#1F4D3A;font-weight:600}#btab button[aria-current="page"] i{background:#1F4D3A;color:#fff;border-color:#1F4D3A}
 #btab button[aria-current="page"]:after{content:"";position:absolute;top:0;left:22%;right:22%;height:3px;background:#1F4D3A}
 #btab .bdg{position:absolute;top:6px;left:56%;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#9B2C1F;color:#fff;font:600 10px/18px 'IBM Plex Mono',monospace}
 #mebar.on{display:flex;position:fixed;left:0;right:0;bottom:calc(60px + env(safe-area-inset-bottom));z-index:59;background:#1B1A17;color:#F6F3EB;padding:10px 16px;justify-content:space-between;align-items:center;gap:10px;font:12px 'IBM Plex Mono',monospace}
 #mebar b{font:600 18px 'Source Serif 4','Source Serif Pro',Georgia,serif;color:#fff}#mebar .o{color:#E9C46A}#mebar button{min-height:40px;padding:0 12px;background:#F6F3EB;color:#1B1A17;border:0;font:600 12px 'IBM Plex Mono',monospace;cursor:pointer}
 body.has-mebar{padding-bottom:calc(124px + env(safe-area-inset-bottom))}
 #moresheet.on{display:block;position:fixed;left:0;right:0;bottom:calc(60px + env(safe-area-inset-bottom));z-index:61;background:#FBF9F4;border-top:1px solid #1B1A17;max-height:70vh;overflow:auto;box-shadow:0 -8px 24px rgba(27,26,23,.18)}
 #moresheet h4{margin:0;padding:14px 16px 6px;font:600 15px 'Source Serif 4',Georgia,serif}
 #moresheet button{display:flex;width:100%;min-height:48px;align-items:center;gap:12px;padding:0 16px;border:0;border-top:1px solid #e1dbcc;background:transparent;font:14px 'IBM Plex Sans',system-ui,sans-serif;color:#1B1A17;text-align:left;cursor:pointer}
 #moresheet button i{font:600 12px 'IBM Plex Mono',monospace;font-style:normal;width:26px;color:#5b6472}#moresheet button[aria-current="page"]{background:#EFEBE0;font-weight:600}

 article.adj .adj-c{display:flex;flex-wrap:wrap;gap:8px;align-items:center}article.adj .seg{flex:1 1 100%}
 article.adj .dec,article.adj [role="group"]{display:grid!important;grid-template-columns:repeat(3,1fr);gap:6px;width:100%}
 article.adj button[data-d]{min-height:48px;font-size:14px}
 article.adj input[id^="note-"]{min-height:44px;font-size:16px;width:100%;margin-top:6px}
}
/* tablet two-pane evidence: drawer docks right, list stays usable */
@media (min-width:700px) and (max-width:1366px){
 body.pane2 .shell{margin-right:min(50vw,600px);transition:margin .2s}
 body.pane2 .drawer{width:min(50vw,600px);box-shadow:-1px 0 0 #1B1A17}
 body.pane2 .scrim{opacity:0!important;pointer-events:none!important}
 body.pane2.has-mebar #mebar{right:min(50vw,600px)}
}
@media (max-width:1024px){body.has-btab .drawer{height:calc(100% - 60px - env(safe-area-inset-bottom))}header.top .env{display:none!important}}
#undo{position:fixed;left:12px;right:12px;bottom:calc(132px + env(safe-area-inset-bottom));z-index:62;display:flex;justify-content:space-between;align-items:center;gap:10px;background:#FBF9F4;border:1px solid #1B1A17;padding:8px 8px 8px 14px;font:13px 'IBM Plex Sans',system-ui,sans-serif;box-shadow:0 6px 18px rgba(27,26,23,.18)}
#undo button{min-height:44px;padding:0 16px;background:#1F4D3A;color:#fff;border:0;font:600 13px 'IBM Plex Mono',monospace;cursor:pointer}
@media (min-width:1025px){#undo{left:auto;right:24px;bottom:24px;width:360px}}
@media (max-width:1024px){header.top .top-r label{font-size:0!important}header.top .top-r label select{font-size:13px}body.pane2 header.top .caseinfo,body.pane2 header.top #restored{display:none!important}}
body.pane2 header.top{margin-right:min(50vw,600px)}
body.pane2 header.top .top-r label,body.pane2 header.top .tourbtn{display:none!important}
