/* Keep the shell aligned when wide displays or browser zoom expose extra space. */
@media(min-width:761px){
 .header{padding-inline:max(clamp(24px,2.5vw,54px),calc((100% - 1920px)/2 + clamp(24px,2.5vw,54px)));column-gap:24px}
 .header .wordmark{flex:0 0 144px;min-width:144px}
 .header .search{min-width:0}
 .left-rail{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
 .left-rail>nav{flex-shrink:0}
 .right-rail{max-height:none;overflow:visible}
}
/* Container width, not monitor width, determines when the charts fit side by side. */
.funding-workspace{container-type:inline-size}
@container(max-width:700px){
 .funding-workspace .fm-analysis{grid-template-columns:minmax(0,1fr);gap:22px}
 .funding-workspace .funding-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}
 .funding-workspace .fm-panel-title{flex-wrap:nowrap}
 .funding-workspace .fm-rank{grid-template-columns:minmax(85px,1fr) minmax(26px,.6fr) minmax(90px,.8fr);gap:8px;padding:8px 4px}
 .funding-workspace .fm-rank-track{position:static;height:6px}
 .funding-workspace .fm-rank-value{grid-column:auto}
}
/* Every open menu stays inside its usable viewport and scrolls internally. */
html body .ui-facet-panel{box-sizing:border-box;min-width:0!important;overflow-y:auto;overscroll-behavior:contain}
html body .ui-facet-panel .catalog-options,html body .ui-facet-panel .facet-options{max-height:none;overflow:visible}
html body .fm-menu .fm-menu-options.ui-facet-panel{min-width:0;overflow-y:auto}
html body .ui-select-panel{min-width:0!important}
@media(max-height:500px){
 #site-more{max-height:calc(100dvh - 90px)}
 .account-menu nav{max-height:calc(100dvh - 80px);overflow-y:auto}
}

/* Reserve the company reader while one complete response is prepared. */
.reader-tabs.is-loading{display:block;height:44px;min-height:44px;border-bottom:1px solid var(--line,#e5e5e5)}
.company-profile-loading{min-height:420px;padding:24px 0;color:var(--muted,#777)}
.company-profile-loading h1{font-size:clamp(24px,3vw,32px);color:var(--text,#222);margin:0 0 16px}
.company-profile-loading p{font-size:14px}
.profile-loading-lines{display:grid;gap:16px;margin-top:40px;max-width:840px}
.profile-loading-lines i{display:block;height:14px;background:var(--line,#e5e5e5);border-radius:4px}
.profile-loading-lines i:last-child{width:65%}
@media(max-width:600px){.company-profile-loading{min-height:360px}.reader-tabs.is-loading{min-height:44px}}

/* Hover surfaces have permanent gutters, so paint never touches the text or moves it. */
html body :is(.record-list .record-row,.operation-record>summary,.operation-compact>details>summary,.market-flow>details>summary,.supply-company-list>button){
 box-sizing:border-box;position:relative;width:calc(100% + 20px);max-width:none;
 margin-inline:-10px;padding-inline:10px;border-radius:6px;
 transition:background-color 100ms ease,color 100ms ease;transform:none;
}
html body :is(.record-list .record-row,.operation-record>summary,.operation-compact>details>summary,.market-flow>details>summary,.supply-company-list>button):is(:hover,:focus-visible){background:var(--soft)!important;transform:none}
html body .record-list .record-row:hover strong{color:var(--ink)}
html body :is(.record-list .record-row,.operation-record>summary,.operation-compact>details>summary,.market-flow>details>summary,.supply-company-list>button):focus-visible{outline:2px solid var(--muted);outline-offset:-2px}
html body .right-rail :is(.discover-product,.discover-company){box-sizing:border-box;padding-inline:8px;width:100%;transition:background-color 100ms ease;transform:none}
html body :is(.product-tile,.company-tile,.investor-tile,.intelligence-entry){transition:background-color 100ms ease,border-color 100ms ease;transform:none}
html body :is(.product-tile,.company-tile,.investor-tile,.intelligence-entry):hover{transform:none}
@media(max-width:600px){html body :is(.record-list .record-row,.operation-record>summary,.operation-compact>details>summary,.market-flow>details>summary,.supply-company-list>button){width:calc(100% + 12px);margin-inline:-6px;padding-inline:6px}}
@media(prefers-reduced-motion:reduce){html body :is(.record-row,.operation-record>summary,.operation-compact>details>summary,.market-flow>details>summary,.supply-company-list>button,.discover-product,.discover-company,.product-tile,.company-tile,.investor-tile,.intelligence-entry){transition:none}}

html body .reader-dialog .record-list .record-row{padding-inline:10px}
@media(max-width:600px){html body .reader-dialog .record-list .record-row{padding-inline:6px}}

/* One fixed navigation geometry across every shell and scroll state. */
html{scrollbar-gutter:stable}
.left-rail .nav-item>span[data-icon]{display:flex;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:20px;line-height:1}
.left-rail .nav-item>svg,.left-rail .nav-item>span[data-icon]>svg{display:block;width:20px;height:20px;flex:none}
@media(min-width:761px){
 .left-rail{align-self:start;top:60px;height:calc(100dvh - 60px);padding:18px 0 20px;min-width:0}
 .left-rail>nav{display:flex;flex-direction:column;align-items:stretch;gap:2px;min-height:100%;height:auto}
 .left-rail .nav-item{display:flex;align-items:center;gap:12px;flex:0 0 44px;min-height:44px;height:44px;width:100%;padding:10px 8px;margin:0;line-height:20px;font-size:14px;white-space:nowrap;transform:none;transition:color 100ms ease}
 .left-rail .submit-nav{margin-top:24px}
 .left-rail .footer-trigger{margin-top:auto}
}
@media(max-width:760px){
 .left-rail>nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:stretch;gap:0}
 .left-rail .nav-item>span[data-icon]{flex:none}
}



/* Primary surface tabs share one height, baseline, and active underline. */
html body :is(#main>.tabs,#site-main>.page-tabs){box-sizing:border-box;display:flex;align-items:stretch;gap:16px;height:44px;min-height:44px;margin:0 0 14px;padding:0;border:0;border-bottom:1px solid var(--line);overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
html body :is(#main>.tabs>button[role=tab],#site-main>.page-tabs>a,#site-main>.page-tabs>button){box-sizing:border-box;position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;height:43px;min-height:43px;margin:0;padding:0 8px;border:0;border-radius:0;background:transparent;font-size:13px;font-weight:400;line-height:20px;white-space:nowrap;color:var(--muted)}
html body :is(#main>.tabs>button[role=tab],#site-main>.page-tabs>a,#site-main>.page-tabs>button)::after{content:none}
html body :is(#main>.tabs>button[aria-selected=true],#site-main>.page-tabs>[aria-current=page]){color:var(--ink)}
html body :is(#main>.tabs>button[aria-selected=true],#site-main>.page-tabs>[aria-current=page])::after{content:'';position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--ink)}
html body #main>.tabs>.filter-toggle{align-self:center;flex:none;margin-left:auto}
@media(min-width:761px){html body #main,html body #site-main:has(>.page-tabs){padding-top:18px}}
@media(max-width:760px){
 html body #main,html body #site-main:has(>.page-tabs){padding-top:0}
 html body :is(#main>.tabs,#site-main>.page-tabs){height:48px;min-height:48px;margin-bottom:12px;gap:12px;justify-content:flex-start}
 html body :is(#main>.tabs>button[role=tab],#site-main>.page-tabs>a,#site-main>.page-tabs>button){height:47px;min-height:47px;padding:0 5px;font-size:12px}
}

/* Match the established site focus appearance without changing keyboard behavior. */
html body :is(a,button,input,textarea,select,summary):focus-visible{outline:none;box-shadow:none}

/* Keep all six Discover recommendations in view while the feed scrolls. */
@media(min-width:1160px){
 html body:not(.site-wide) .right-rail{position:sticky;top:60px;align-self:start;box-sizing:border-box;padding:18px 0 12px;max-height:none;overflow:visible;--discover-row:clamp(32px,calc((100dvh - 260px)/6),56px)}
 html body .right-rail .rail-section{margin:0 0 16px;padding:0 0 12px}
 html body .right-rail .rail-section:last-child{margin:0;padding:0;border:0}
 html body .right-rail .rail-section h2{margin:0 0 12px;font-size:13px;line-height:20px}
 html body .right-rail :is(#radar,#follow-companies){display:grid;gap:8px}
 html body .right-rail :is(.discover-product,.discover-company){height:var(--discover-row);min-height:0;margin:0;padding-block:0;gap:10px}
 html body .right-rail .radar-img{width:80px;height:var(--discover-row);max-height:50px;object-fit:contain}
 html body .right-rail .radar-preview{flex:0 0 80px}
 html body .right-rail :is(.radar-product,.discover-company-copy strong){display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:13px;line-height:17px}
 html body .right-rail :is(.radar-brand,.discover-company-copy small){margin-top:2px;font-size:11px;line-height:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 html body .right-rail .radar-brand>span:not(.company-logo){line-height:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 html body .right-rail #browse-robots{margin:8px 0 0;padding:4px 8px;line-height:20px;font-size:12px}
}
@media(min-width:1160px) and (max-height:500px){
 html body:not(.site-wide) .right-rail{padding-block:8px}
 html body .right-rail .rail-section{margin-bottom:8px;padding-bottom:8px}
 html body .right-rail .rail-section h2{margin-bottom:6px}
 html body .right-rail :is(#radar,#follow-companies){gap:4px}
}

/* Feed filter menus keep search and actions outside the scrolling option list. */
#facet-bar .facet-popover.ui-facet-panel{display:flex;flex-direction:column;overflow:hidden;overscroll-behavior:contain}
#facet-bar .facet-popover.ui-facet-panel .facet-options{flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;overscroll-behavior:contain}
#facet-bar .facet-popover>input,#facet-bar .facet-popover>.text-button{flex:none}
#facet-bar .facet-popover>.text-button{position:relative;align-self:stretch;background:var(--paper);margin:4px 0 0;min-height:32px}
#facet-bar .facet-popover>.text-button:disabled{opacity:.45;cursor:default}
#facet-bar .facet>summary>b{box-sizing:border-box;min-width:16px;padding:0;text-align:center;font-variant-numeric:tabular-nums}
#facet-bar .facet>summary>b:empty{visibility:hidden}
#facet-bar .facet-options label:focus-within,#facet-bar :is(summary,input,button):focus-visible{outline:none!important;box-shadow:none!important}

/* Product names lead; the maker's mark belongs beside the maker, not the product title. */
html body .product-identity{align-items:flex-start;width:100%}
html body .product-identity-copy{width:100%;min-width:0}
html body .product-identity-title{position:relative;align-items:flex-start;gap:8px;min-height:24px}
html body .product-identity-title:has(>.like-button){display:block;padding-right:34px}
html body .product-identity-title .product-name{padding-top:2px;line-height:1.35}
html body .product-identity-title>.like-button{position:absolute;right:-6px;top:-4px;margin:0}
html body .product-identity-byline{margin-top:4px;min-height:20px}
html body .product-identity-byline .product-maker{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;line-height:20px}
html body .product-maker .company-logo{--logo-size:20px!important;width:20px;height:20px;flex:0 0 20px}
html body .product-maker>span:last-child{min-width:0;overflow-wrap:anywhere}
html body .product-tile-copy .product-meta{padding-top:12px;margin-top:auto}

@media(pointer:coarse),(max-width:600px){html body .product-identity-title:has(>.like-button){padding-right:44px}html body .product-identity-copy:has(.like-button) .product-identity-byline{padding-right:44px}}
