/* FYLCORA D4 — responsive-only progressive enhancement. D1–D3 and runtime logic retained. */
/* Layout sizing: avoid flex/grid intrinsic width expansion while preserving table scrolling. */
:where(.wrap,.header-row,.footer-grid,.hero-inner,.tool-grid,.cat-grid,.step-grid,.work-grid,.tool-layout,.d2-filters){min-width:0}
:where(.wrap,.header-row,.footer-grid,.hero-inner,.tool-grid,.cat-grid,.step-grid,.work-grid,.tool-layout)>*{min-width:0}
:where(.hero,.section,.workspace-page,.legacy-tool,.d2-directory,.site-footer){overflow-wrap:break-word}
:where(.hero,.section,.workspace-page,.legacy-tool,.d2-directory) :is(img,video,svg){max-width:100%}
:where(.work-panel,.editor-card,.tool-card,.cat-card,.side-box,.info-panel) :is(input,select,textarea,button){max-width:100%}
:where(.work-panel,.editor-card,.tool-card,.cat-card,.side-box,.info-panel) :is(pre,.table-wrap,.table-responsive){max-width:100%;overflow-x:auto}
:where(.workspace-page,.legacy-tool) :is(table){max-width:100%}
:where(.workspace-page,.legacy-tool) :is(canvas){max-width:100%}
/* Maintain functional native scrolling for wide data tables instead of clipping them. */
:where(.workspace-page,.legacy-tool) :is(.table-wrap,.table-responsive){overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
@media (min-width:901px) and (max-width:1180px){
 .header-row{gap:12px}.desktop-nav{gap:8px}.desktop-nav a{font-size:clamp(11px,1vw,13px)}
 .hero-inner{gap:clamp(18px,3vw,38px)}
 .footer-grid{gap:clamp(15px,2vw,30px)}
}
@media (min-width:621px) and (max-width:900px){
 .hero-inner{grid-template-columns:minmax(0,1fr) minmax(0,.85fr);gap:22px}
 .d2-cat-grid,.d2-featured-grid,.d2-directory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .footer-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:26px}
 .workspace-page .work-grid,.legacy-tool .tool-layout{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:620px){
 .wrap{max-width:100%}
 .header-row{min-width:0}.brand{min-width:0;max-width:calc(100% - 98px)}.brand strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .header-actions{flex:none}.site-header .desktop-nav{max-width:100%}
 .hero-inner{grid-template-columns:minmax(0,1fr);gap:20px}
 .d2-hero .hero-art{max-width:100%;min-width:0}
 .d2-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .d2-cat-grid,.d2-featured-grid,.d2-directory-grid,.step-grid{grid-template-columns:minmax(0,1fr)}
 .d2-directory .d2-filters{max-width:100%;flex-wrap:wrap}
 .d2-directory .d2-search{width:100%;flex:1 1 100%;min-width:0}
 .d2-directory .chip{max-width:100%;white-space:normal;text-align:center;justify-content:center}
 .workspace-page .work-grid,.legacy-tool .tool-layout{grid-template-columns:minmax(0,1fr)}
 .workspace-page :is(.field-grid,.work-panel-body),.legacy-tool :is(.editor-inner,.editor-actions){min-width:0}
 .workspace-page :is(.work-panel .btn,.work-panel button),.legacy-tool .editor-actions :is(.btn,button){white-space:normal;overflow-wrap:anywhere}
 .site-footer .footer-bottom{display:flex;flex-wrap:wrap;gap:10px}
 .footer-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:390px){
 .header-row{gap:5px}.brand{max-width:calc(100% - 96px)}
 .brand-custom-logo{max-width:75px}.brand-mark{width:30px;height:30px}
 .footer-grid{grid-template-columns:minmax(0,1fr)}
 .d2-directory .chip{flex:1 1 auto}
 .workspace-page :is(.work-panel-body,.result-area),.legacy-tool .editor-inner{padding-inline:12px}
}
/* Scope pointer/touch improvements to known controls, never override hidden state. */
@media(pointer:coarse){
 :where(.desktop-nav a,.footer-grid a,.d2-directory .chip,.d2-featured-grid .tool-cta){min-height:44px}
 :where(.workspace-page,.legacy-tool) :is(button,.btn,input[type=file]){touch-action:manipulation}
}
@media(prefers-reduced-motion:reduce){
 .d2-cat-grid .cat-card,.d2-featured-grid .tool-card,.d2-directory-grid .tool-card{scroll-behavior:auto}
}
