/* Responsive composition shared by the live pages. Content remains in the DOM.
   1180: navigation needs a second row; 640: phone controls; 600h: compact chrome. */
body .site-header .header-inner:not(.qa-workspace-header){
 display:grid;grid-template-columns:max-content minmax(0,1fr) max-content;
 align-items:center;gap:16px;box-sizing:border-box;
}
body .site-header .header-inner:not(.qa-workspace-header)>*{min-width:0}
body .site-header .header-inner:not(.qa-workspace-header)>nav{
 display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px 6px;margin:0;
}
body .site-header .header-inner:not(.qa-workspace-header)>nav a{
 display:inline-flex;align-items:center;justify-content:center;min-height:44px;
 font-size:14px;line-height:1.4;padding:10px 12px;text-align:center;
}
body .site-header .header-inner:not(.qa-workspace-header) .header-contact{
 display:inline-flex;align-items:center;justify-content:center;min-height:44px;
 white-space:nowrap;line-height:1.4;
}
body .site-header .header-contact-group{min-width:0}
body .site-header .header-inner:not(.qa-workspace-header) .header-brand{min-width:0}
body .site-header .header-contact-group .brand-developer{white-space:nowrap;max-width:none}

/* Flex and grid children must be allowed to shrink before their text wraps. */
.home-page :is(.search-options,.filter-grid,.quick-secondary-grid,.search-result-options,.search-refinement,.mode-preview-filters)>*,
.home-page :is(.rs-ru__query-field,.selected-results-content,.mode-preview-query,.mode-preview-heading>div),
.rs-ru-dialog :is(.detail-record-header,.detail-party-info,.detail-site-content){min-width:0}
.home-page :is(.filter-grid,.quick-secondary-grid) :is(input,select){max-width:100%;box-sizing:border-box}
.home-page .search-modes>:is(button,a){min-width:0}
.home-page .search-modes strong{line-height:1.4}
.home-page .search-refinement :is(button,strong){overflow-wrap:anywhere}
.home-page .rs-ru .results-table-wrap{min-width:0;overflow-x:auto;overscroll-behavior-x:contain}
.home-page .rs-ru .results-table-wrap:focus-visible{outline:3px solid #5681b5;outline-offset:-3px}
/* Aurora shadows stay visible, but deferred offscreen SVG coordinates must
   never enlarge the page while the browser is being narrowed. */
.home-page .hero-source-network.services-selected{overflow-x:clip;overflow-clip-margin:18px}
.home-page .mode-preview-heading h2{font-size:clamp(24px,calc(3.2vw / var(--rmi-zoom, 1)),38px);line-height:1.25}
.home-page .mode-preview-query input{min-width:0}
.home-page .mode-preview-query button{white-space:normal}
.selected-parameter-dialog{box-sizing:border-box;max-height:calc(calc(100dvh / var(--rmi-zoom, 1)) - 24px);overscroll-behavior:contain}
.selected-parameter-dialog :is(input,select,button){min-height:44px}
.selected-parameter-dialog .quick-filter-actions{flex-wrap:wrap}
body>header:not([class]){flex-wrap:wrap;gap:16px}
body>header:not([class])>a:not(.brand){display:inline-flex;align-items:center;min-height:44px}

@media(max-width:1180px){
 body .site-header .header-inner:not(.qa-workspace-header){grid-template-columns:minmax(0,1fr) auto;gap:10px 16px}
 body .site-header .header-inner:not(.qa-workspace-header)>.header-brand{grid-column:1;grid-row:1}
 body .site-header .header-inner:not(.qa-workspace-header)>:is(.header-contact,.header-contact-group){grid-column:2;grid-row:1;margin-left:0}
 body .site-header .header-inner:not(.qa-workspace-header)>nav{grid-column:1/-1;grid-row:2;width:100%;justify-content:flex-start;gap:4px}
 .home-page .rs-ru .hero-selected .hero-title-accent{font-size:clamp(26px,calc(3.3vw / var(--rmi-zoom, 1)),38px);line-height:1.25}
 .home-page .rs-ru .hero-selected .hero-selected-meta{flex-shrink:0}
}
@media(min-width:641px) and (max-width:1000px){
 .home-page .rs-ru .hero-selected{gap:20px}
 .home-page .rs-ru .hero-selected .hero-selected-meta{max-width:230px;padding-left:20px}
 .home-page .mode-preview-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
 .home-page .mode-preview-filters>label:last-child{grid-column:1/-1}
}
@media(max-width:760px){
 .home-page .search-mode-preview{padding:22px 18px}
 .home-page .mode-preview-heading{flex-wrap:wrap;gap:12px}
 .home-page .mode-preview-query>div{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
 .home-page .mode-preview-query button{min-height:46px;width:100%;margin:0}
 .home-page .mode-preview-steps{grid-template-columns:minmax(0,1fr);gap:18px}
 .home-page .mode-preview-footer{flex-wrap:wrap;gap:12px}
}
@media(max-width:640px){
 body .site-header .header-inner:not(.qa-workspace-header){padding:12px;gap:10px 8px}
 body .site-header .header-inner:not(.qa-workspace-header) .brand{font-size:22px}
 body .site-header .header-inner:not(.qa-workspace-header) .brand-developer{display:none}
 body .site-header .header-inner:not(.qa-workspace-header) .header-contact{font-size:12px;padding:9px 10px;gap:5px}
 body .site-header .header-inner:not(.qa-workspace-header)>nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
 body .site-header .header-inner:not(.qa-workspace-header)>nav a{font-size:13px;white-space:normal;padding:9px 7px}
 .home-page .rs-ru .hero-selected{display:block}
 .home-page .rs-ru .hero-selected .hero-selected-meta{margin-top:16px;border-left:0;border-top:1px solid #bfcee3;padding:12px 0 0;max-width:none}
 .home-page .rs-ru .hero-selected .hero-title-accent{font-size:clamp(24px,calc(6.3vw / var(--rmi-zoom, 1)),30px);letter-spacing:-.6px}
 .home-page .rs-ru .hero-selected .hero-title-ai{font-size:17px}
 .home-page .search-modes>:is(button,a){padding:10px 7px;gap:8px;min-height:86px;align-content:space-between}
 .home-page .search-modes strong{font-size:12px}
 .home-page .search-modes .search-mode-state{font-size:9px;white-space:normal;text-align:left;max-width:100%}
 .home-page .search-modes small{display:none}
 .home-page :is(.filter-grid,.quick-secondary-grid,.mode-preview-filters){grid-template-columns:minmax(0,1fr)!important}
 .home-page .mode-preview-filters>label:last-child{grid-column:auto}
 .home-page .rs-ru .search-options .search-data-note>summary{font-size:12px}
 .home-page .rs-ru :is(.filter-grid,.quick-secondary-grid) :is(input,select){font-size:16px;min-height:46px}
 .home-page .rs-ru .search-result-options{gap:10px;flex-wrap:wrap}
 .home-page .rs-ru .search-result-options>label{flex:1 1 180px}
 .home-page .rs-ru .search-result-options .view-switch{margin-left:0;max-width:100%}
 .selected-parameter-dialog{padding:18px 14px;width:calc(calc(100vw / var(--rmi-zoom, 1)) - 20px)}
 .selected-parameter-dialog :is(input,select){font-size:16px}
 .selected-parameter-dialog .quick-filter-actions button{flex:1 1 110px}
 .rs-ru-dialog.workspace-preview .detail-record-header #rs-ru-detail-title{font-size:clamp(19px,calc(5vw / var(--rmi-zoom, 1)),22px)!important}
 body>header:not([class]){padding-block:18px;gap:10px}
 body>header:not([class])>.brand{font-size:21px}
}
@media(max-width:380px){
 body .site-header .header-inner:not(.qa-workspace-header) .brand{font-size:20px;gap:7px}
 body .site-header .header-inner:not(.qa-workspace-header) .brand-mark{width:36px;height:36px}
 body .site-header .header-inner:not(.qa-workspace-header) .header-contact{font-size:11px;padding-inline:8px}
 body .site-header .header-inner:not(.qa-workspace-header) .header-contact>span{display:none}
 .home-page .search-modes strong{font-size:11px}
 .home-page .search-modes .search-mode-state{font-size:8px;padding:3px 4px}
}

/* More room for the actual record on short laptop windows and landscape phones. */
@media(max-height:600px){
 .rs-ru-dialog.workspace-preview[open]{height:calc(calc(100dvh / var(--rmi-zoom, 1)) - 12px);max-height:calc(calc(100dvh / var(--rmi-zoom, 1)) - 12px);margin:6px auto}
 .rs-ru-dialog.workspace-preview .rs-ru-dialog__head{min-height:52px;padding:6px 12px}
 .rs-ru-dialog.workspace-preview .workspace-footer{min-height:42px;padding:4px 12px;gap:8px}
 .rs-ru-dialog.workspace-preview .workspace-footer button{min-height:34px;padding:6px 10px}
 .rs-ru-dialog.workspace-preview .workspace-toc-select{min-height:40px}
 .selected-parameter-dialog{max-height:calc(calc(100dvh / var(--rmi-zoom, 1)) - 12px);margin:6px auto}
}

/* Dedicated mobile pages: preserve the compact footer, accommodate safe areas
   and long identifiers, and keep controls usable on 320px / landscape screens. */
body:has(.m-header){-webkit-text-size-adjust:100%;text-size-adjust:100%}
.m-menu nav{max-width:calc(calc(100vw / var(--rmi-zoom, 1)) - 32px);max-height:calc(calc(100dvh / var(--rmi-zoom, 1)) - 100px);overflow:auto;overscroll-behavior:contain}
.m-menu a{min-height:44px;line-height:1.45}
.m-card-bar{gap:8px}
.m-card-bar button{white-space:normal;line-height:1.4}
.m-result-head{flex-wrap:wrap}
.m-result-head h2{min-width:0}
.m-result :is(.m-result-identifiers,.m-result-company,.m-document>span:first-child),
.m-cover :is(h1,.m-meta),.m-section-body :is(dd,p,a){min-width:0;overflow-wrap:anywhere}
.m-document>span:first-child{min-width:0;overflow-wrap:anywhere}
@media(max-height:500px) and (orientation:landscape){
 .m-header{padding-block:8px}
 .m-card-bar{position:static}
 .m-menu nav{max-height:calc(calc(100dvh / var(--rmi-zoom, 1)) - 80px)}
}
@media(prefers-reduced-motion:reduce){
 body .site-header .header-inner a,.home-page .search-modes>:is(button,a){transition:none}
}

.search-modes>a{text-decoration:none;font:inherit;cursor:pointer}
