/* StackIQ app shell: the parts of the top bar, Display panel and phone bar that system.css leaves open (menus built on
   <details>, so they work without scripts; ui.JS adds Escape, tap outside and aria-expanded). Every page puts its shell in a
   .ds part (research/ui.py, page), so these rules reach old pages too and the old CSS never reaches the shell. */
.shell{display:contents}
:where(.ds) .navdd>summary,:where(.ds) .tabbar summary{list-style:none;cursor:pointer}
:where(.ds) .navdd>summary::-webkit-details-marker,:where(.ds) .tabbar summary::-webkit-details-marker{display:none}
:where(.ds) .navdd>summary:not(.iconbtn){display:flex;align-items:center;gap:6px;min-height:var(--tap);padding:0 12px;border-radius:var(--r-md);color:var(--muted);font-size:var(--t-base);font-weight:500;white-space:nowrap}
:where(.ds) .navdd>summary:hover{background:var(--hover);color:var(--ink)}
:where(.ds) .navdd.on>summary{color:var(--ink);background:var(--inset)}
:where(.ds) .navdd[open]>summary>.i:last-child{transform:rotate(180deg)}
:where(.ds) .ddpanel{box-shadow:var(--shadow-pop)}
:where(.ds) .ddpanel .grp,:where(.ds) .tsheet .grp{padding:6px 6px 2px}
:where(.ds) .menu a[aria-current=page]{background:var(--chip);color:var(--ink);font-weight:600}
:where(.ds) .menu a[aria-current=page] .i{color:inherit}
:where(.ds) .bar .nav .i{color:inherit}
.brand-refresh .brand{gap:8px;font-size:var(--t-xl)}
.brand-refresh .brand svg{width:34px;height:34px;flex:none}
.brand-refresh .nav{min-width:max-content}
.brand-refresh .bar-in>.search{min-width:0}
.assets-back{padding-top:var(--s3);padding-bottom:var(--s1)}
.assets-back a{display:inline-flex;align-items:center;gap:8px;min-height:var(--tap);color:var(--ink);font-weight:600;text-decoration:none}
.assets-back a:hover{text-decoration:underline}
/* Display: theme and data colours, as radio buttons (one choice each, arrow keys move it) */
:where(.ds) .disp .ddpanel{left:auto;right:0;width:min(340px,calc(100vw - 2 * var(--gutter)));grid-template-columns:1fr;gap:10px}
:where(.ds) .disp fieldset{border:0;margin:0;padding:0;display:grid;gap:2px;min-width:0}
:where(.ds) .disp legend{padding:4px 6px}
:where(.ds) .opt{display:flex;align-items:center;gap:10px;min-height:var(--tap);padding:6px 8px;border-radius:var(--r-md);cursor:pointer;font-size:var(--t-base);line-height:1.3;color:var(--ink)}
:where(.ds) .opt:hover{background:var(--hover)}
:where(.ds) .opt:has(input:checked){background:var(--chip);font-weight:600}
:where(.ds) .opt input{accent-color:var(--navy);width:18px;height:18px;margin:0;flex:none}
:where(.ds) .opt .i{color:var(--muted)}
:where(.ds) .opt small{display:block;font-size:var(--t-xs);font-weight:400;color:var(--muted)}
:where(.ds) .foot a{color:var(--muted)}
@media (min-width:900px){:where(.ds) .bar .spacer{display:none}}
@media (min-width:900px) and (max-width:1199px){:where(.ds) .bar-in{gap:var(--s3)}:where(.ds) .bar .nav .i{display:none}:where(.ds) .bar .nav a,:where(.ds) .navdd>summary:not(.iconbtn){padding:0 8px}:where(.ds) .bar .search{flex-basis:220px}}
@media (max-width:899px){
 body{padding-bottom:calc(var(--bottom-h) + env(safe-area-inset-bottom))}
 :where(.ds) .bar .disp{display:none}   /* on a phone Display is in the menu */
 :where(.ds) .pmenu[open]>summary{background:var(--chip);color:var(--ink)}
 :where(.ds) .pmpanel{position:fixed;left:8px;right:8px;top:calc(var(--bar-h) + 4px);z-index:50;max-height:calc(100dvh - var(--bar-h) - 16px);overflow:auto;padding:10px 12px 14px;box-shadow:var(--shadow-pop);display:grid;gap:10px}
}
@media (min-width:900px){:where(.ds) .pmenu{display:none}}
/* WO29, decision "a": the phone menu. Search, then the five sections (the open one light grey, as on the ETF page), then Display */
:where(.ds) .pmpanel .tabbar{display:grid;gap:2px}
:where(.ds) .pmpanel .tabbar>a,:where(.ds) .pmpanel .tabbar>details>summary{display:flex;align-items:center;gap:12px;min-height:48px;padding:0 10px;border-radius:var(--r-md);color:var(--ink);font-size:var(--t-base);font-weight:500;text-decoration:none;cursor:pointer;list-style:none}
:where(.ds) .pmpanel .tabbar>a .i,:where(.ds) .pmpanel .tabbar>details>summary .i{color:var(--muted)}
:where(.ds) .pmpanel .tabbar>a[aria-current=page],:where(.ds) .pmpanel .tabbar>details.on>summary{background:var(--chip);font-weight:700}
:where(.ds) .pmpanel .tabbar>details>summary::after{content:"";margin-left:auto;width:8px;height:8px;margin-right:6px;border:solid var(--teal);border-width:0 2px 2px 0;transform:translateY(-2px) rotate(45deg)}
:where(.ds) .pmpanel .tabbar>details[open]>summary::after{transform:translateY(2px) rotate(-135deg)}
:where(.ds) .pmpanel .tsheet{position:static;display:grid;grid-template-columns:1fr 1fr;gap:0 12px;padding:4px 0 8px 12px;border:0;box-shadow:none;background:none}
:where(.ds) .pmpanel .tsheet .menu a{min-height:44px;font-size:var(--t-base)}
:where(.ds) .pmpanel .grp{padding:6px 10px 2px}
:where(.ds) .pm-srch{padding:0 0 8px;border-bottom:1px solid var(--line);margin-bottom:4px}
:where(.ds) .pm-srch .search{flex:none;display:flex;gap:8px;max-width:none}
:where(.ds) .pm-srch .search input{flex:1;min-width:0;font-size:var(--t-base)}
:where(.ds) .pm-srch .chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
:where(.ds) .pm-srch .chips:empty{display:none}
:where(.ds) .pm-srch .tchip{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 14px 0 8px;border:1px solid var(--line-strong);border-radius:var(--r-pill);color:var(--ink);font-size:var(--t-xs);font-weight:600}
:where(.ds) .pm-srch .av{position:relative;display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;overflow:hidden;color:#fff;font-size:var(--t-xs);font-weight:700}
:where(.ds) .pm-srch .av img{position:absolute;inset:0;width:100%;height:100%;padding:3px;border-radius:50%;background:#fff;object-fit:contain}
:where(.ds) .pm-disp{border-top:1px solid var(--line);padding-top:6px}
:where(.ds) .pm-disp fieldset{border:0;margin:0;padding:0;display:grid;gap:2px;min-width:0}
:where(.ds) .pm-disp legend{padding:4px 6px}
@media (max-width:459px){:where(.ds) .pmpanel .tsheet{grid-template-columns:1fr}}
:where(.ds) .pmpanel{grid-template-columns:minmax(0,1fr)}:where(.ds) .pmpanel>*,:where(.ds) .pmpanel .tabbar>*{min-width:0}:where(.ds) .pmenu:not([open])>.pmpanel{display:none}   /* WO29: the closed phone menu takes no room */
