/* V6.4 final scale guard: full-screen stage without uncontrolled oversized typography.
   Purpose: make every public page easier to inspect by enforcing one global rhythm. */
:root{
  --vf-page-pad:clamp(16px,2.2vw,42px);
  --vf-stage-max:1760px;
  --vf-tool-max:1540px;
  --vf-player-max:1580px;
  --vf-content-max:1180px;
  --vf-reading-max:880px;
  --vf-section-y:clamp(46px,6vw,86px);
  --vf-section-tight-y:clamp(30px,4vw,56px);
  --vf-h1-home:clamp(2.8rem,5.3vw,5.15rem);
  --vf-h1-tool:clamp(2.45rem,4.7vw,4.65rem);
  --vf-h1-content:clamp(2.08rem,3.7vw,3.65rem);
  --vf-h2:clamp(1.75rem,3.1vw,3rem);
  --vf-h3:clamp(1.12rem,1.55vw,1.36rem);
  --vf-lead:clamp(1.02rem,1.28vw,1.22rem);
  --vf-body:clamp(0.98rem,1vw,1.06rem);
  --vf-small:0.92rem;
}
html,body{width:100%;max-width:100%;overflow-x:hidden;}
body{font-size:var(--vf-body);text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;}
.container,.container-wide,.header-inner,.home-hero .container,.compact-hero .container,.reference-hero .container{
  width:min(calc(100% - (var(--vf-page-pad) * 2)),var(--vf-stage-max)) !important;
  max-width:none !important;
}
.header-inner{min-height:68px !important;width:min(calc(100% - (var(--vf-page-pad) * 2)),1840px) !important;}
.main-nav{gap:6px !important;}
.nav-link,.nav-button{font-size:0.95rem !important;padding:9px 11px !important;}
.lang-pill{padding:10px 16px !important;font-size:0.95rem !important;}
.brand{font-size:1.12rem !important;}
.mega-menu{display:none !important;}
.nav-item.menu-open>.mega-menu{display:grid !important;}
.mega-menu.grouped-mega{grid-template-columns:repeat(4,minmax(190px,1fr)) !important;width:min(1120px,calc(100vw - 42px)) !important;max-height:min(76vh,760px);overflow:auto;}
.mega-column{display:grid;gap:8px;align-content:start;}
.mega-column>span{font-size:.82rem;font-weight:950;color:#047857;text-transform:uppercase;letter-spacing:.04em;padding:4px 6px;}
.mega-link{min-height:auto !important;padding:11px 12px !important;border-radius:16px !important;}
.mega-link strong{font-size:.94rem !important;}
.mega-link small,.mega-link span{font-size:.82rem !important;line-height:1.32 !important;}
.home-hero .hero-inner{min-height:min(900px,calc(100svh - 68px)) !important;padding-top:clamp(42px,5vw,74px) !important;padding-bottom:clamp(40px,5vw,76px) !important;}
.hero-inner{padding-top:clamp(42px,5vw,78px) !important;padding-bottom:clamp(38px,4.8vw,72px) !important;}
h1{font-size:var(--vf-h1-tool) !important;line-height:0.98 !important;letter-spacing:-0.058em !important;max-width:min(1180px,100%) !important;margin-bottom:18px !important;}
.home-hero h1{font-size:var(--vf-h1-home) !important;max-width:min(1320px,100%) !important;}
.content-hero h1,.article-hero h1{font-size:var(--vf-h1-content) !important;line-height:1.04 !important;letter-spacing:-0.048em !important;}
h2{font-size:var(--vf-h2) !important;line-height:1.08 !important;letter-spacing:-0.038em !important;}
h3{font-size:var(--vf-h3) !important;line-height:1.2 !important;letter-spacing:-0.02em !important;}
.lead{font-size:var(--vf-lead) !important;line-height:1.58 !important;max-width:min(840px,100%) !important;}
p,li{font-size:var(--vf-body);line-height:1.68;}
.hero-chips,.trust-row{gap:8px !important;margin-bottom:14px !important;}
.chip,.mini-label{font-size:.9rem !important;padding:7px 12px !important;}
.section{padding-top:var(--vf-section-y) !important;padding-bottom:var(--vf-section-y) !important;}
.section-tight{padding-top:var(--vf-section-tight-y) !important;padding-bottom:var(--vf-section-tight-y) !important;}
.section-head{max-width:960px !important;margin-bottom:28px !important;}
.inputbar,.hero-inputbar{width:100%;max-width:min(1120px,100%) !important;margin-top:20px !important;margin-bottom:18px !important;grid-template-columns:minmax(0,1fr) auto auto auto !important;}
.field{min-width:0;font-size:1rem !important;}
.btn{font-size:1rem !important;padding:13px 20px !important;white-space:nowrap;}
.btn.small{font-size:.91rem !important;padding:10px 13px !important;}
.home-hero .player-window,.compact-hero .player-window,.hero-player,.player-window{
  width:100% !important;
  max-width:min(var(--vf-player-max),100%) !important;
  min-height:clamp(320px,38vw,650px) !important;
  max-height:72svh !important;
  aspect-ratio:16/7.8 !important;
  margin-top:20px !important;
}
.playlist-tabs{max-width:min(var(--vf-player-max),100%) !important;margin-top:16px !important;}
.player-topbar{min-height:40px;}
.player-center{padding:16px;}
.player-main-copy{font-size:clamp(1rem,1.25vw,1.24rem) !important;}
.player-current-url{font-size:.92rem !important;}
.play-triangle{font-size:clamp(2.8rem,5vw,4.4rem) !important;}
.player-controls{padding:0 22px 18px;}
.single-column,.reference-single-flow,.content-split,.tool-directory,.public-route-strip,.share-strip.useful-share,.operation-stage,.tool-panel,.polished-tool-panel,.embed-console,.decision-table{
  width:100% !important;
  max-width:min(var(--vf-tool-max),100%) !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
.tool-panel,.polished-tool-panel,.embed-console,.operation-stage,.card,.soft-card,.tool-group{padding:clamp(20px,2vw,30px) !important;}
.operation-stage .tool-panel,.operation-stage .polished-tool-panel{box-shadow:none !important;border-radius:24px !important;}
.grid-3,.grid-2,.process,.primary-tool-grid{max-width:min(var(--vf-tool-max),100%) !important;margin-left:auto !important;margin-right:auto !important;}
.primary-tool-grid{gap:18px !important;}
.tool-link{grid-template-columns:minmax(180px,260px) minmax(0,1fr) auto !important;}
.tool-link strong{font-size:1rem !important;}
.tool-link span{font-size:.94rem !important;}
.footer-cta{padding:clamp(38px,5vw,66px) 0 !important;}
.site-footer{padding-top:42px !important;}
.footer-grid{grid-template-columns:repeat(6,minmax(0,1fr)) !important;gap:clamp(16px,2vw,26px) !important;}
.footer-grid h3{font-size:1rem !important;}
.footer-grid a{font-size:.92rem !important;line-height:1.4 !important;margin:7px 0 !important;}
.content-hero-inner,.article-hero-inner{padding-top:clamp(38px,4.8vw,66px) !important;padding-bottom:clamp(30px,4vw,52px) !important;max-width:var(--vf-content-max) !important;}
.hub-grid{grid-template-columns:repeat(auto-fit,minmax(280px,1fr)) !important;gap:18px !important;}
.hub-card{min-height:0 !important;padding:20px !important;}
.hub-card h2{font-size:clamp(1.16rem,1.38vw,1.42rem) !important;line-height:1.18 !important;}
.hub-card p{font-size:.98rem !important;line-height:1.55 !important;}
.article-shell{max-width:var(--vf-content-max) !important;}
.article-body,.refined-article{max-width:var(--vf-reading-max) !important;}
.refined-article h2{font-size:clamp(1.55rem,2.2vw,2.22rem) !important;margin-top:40px !important;}
.refined-article p,.refined-article li{font-size:clamp(1rem,1vw,1.05rem) !important;line-height:1.76 !important;}
.answer-panel,.example-box,.check-list,.step-list,.faq-card{padding:clamp(18px,2vw,24px) !important;}
.related-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr)) !important;}
.share-strip{gap:8px !important;padding:14px !important;}
.share-strip a,.share-strip button{font-size:.91rem !important;padding:9px 12px !important;}
@media(min-width:1800px){
  :root{--vf-stage-max:1920px;--vf-tool-max:1680px;--vf-player-max:1760px;}
  .home-hero .player-window,.compact-hero .player-window,.hero-player,.player-window{min-height:clamp(520px,33vw,760px) !important;}
}
@media(max-width:1120px){
  .mega-menu.grouped-mega{grid-template-columns:repeat(2,minmax(200px,1fr)) !important;left:auto;right:0;}
  .inputbar,.hero-inputbar{grid-template-columns:1fr auto auto !important;}
  .inputbar .icon-only{display:none !important;}
  .tool-link{grid-template-columns:1fr auto !important;}
  .tool-link span{grid-column:1/-1;}
  .footer-grid{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
}
@media(max-width:760px){
  :root{--vf-page-pad:14px;--vf-section-y:40px;--vf-section-tight-y:26px;--vf-h1-home:clamp(2.28rem,10.6vw,3.05rem);--vf-h1-tool:clamp(2.08rem,9.2vw,2.75rem);--vf-h1-content:clamp(1.95rem,8.6vw,2.55rem);--vf-lead:1rem;}
  .header-inner{min-height:62px !important;}
  .brand{font-size:1.02rem !important;}
  .main-nav{display:none;}
  .main-nav.open{display:flex;position:absolute;left:10px;right:10px;top:calc(100% + 8px);background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);padding:12px;flex-wrap:wrap;align-items:flex-start;z-index:40;}
  .mobile-menu-toggle{display:inline-flex !important;margin-left:auto;}
  .header-actions{margin-left:0 !important;}
  .lang-pill{padding:8px 12px !important;font-size:.9rem !important;}
  .nav-item{position:static;}
  .mega-menu.grouped-mega{position:static !important;width:100% !important;max-height:55vh;grid-template-columns:1fr !important;margin-top:8px;box-shadow:none !important;border-radius:18px !important;}
  .home-hero .hero-inner{min-height:auto !important;padding-top:28px !important;padding-bottom:32px !important;}
  .hero-chips .chip:nth-child(n+2){display:none;}
  .inputbar,.hero-inputbar{grid-template-columns:1fr 1fr !important;gap:10px !important;}
  .inputbar .field,.hero-inputbar .field{grid-column:1/-1;}
  .btn{width:100%;padding:12px 14px !important;}
  .home-hero .player-window,.compact-hero .player-window,.hero-player,.player-window{min-height:230px !important;max-height:none !important;aspect-ratio:16/10 !important;border-radius:22px !important;}
  .playlist-tabs{border-radius:22px !important;}
  .tabs{grid-template-columns:1fr !important;border-radius:18px !important;}
  .grid-3,.grid-2,.process,.primary-tool-grid,.form-grid,.reading-route{grid-template-columns:1fr !important;}
  .section-head{text-align:left !important;}
  .tool-link{grid-template-columns:1fr !important;}
  .footer-grid{grid-template-columns:1fr 1fr !important;}
  .content-hero-inner,.article-hero-inner{text-align:left !important;}
  .hub-grid{grid-template-columns:1fr !important;}
}
@media(max-width:430px){
  :root{--vf-page-pad:10px;}
  .container,.container-wide,.header-inner,.home-hero .container,.compact-hero .container,.reference-hero .container{width:calc(100% - 20px) !important;}
  .footer-grid{grid-template-columns:1fr !important;}
  .share-strip{justify-content:flex-start !important;overflow-x:auto;}
  .decision-table table{min-width:640px;}
}

/* V6.4 core-route first viewport tightening: tool inputs must not be buried below decorative hero copy. */
.compact-hero .hero-inner,.reference-hero .hero-inner{padding-top:clamp(30px,4vw,56px) !important;padding-bottom:clamp(28px,3.8vw,48px) !important;}
.compact-hero .breadcrumbs,.reference-hero .breadcrumbs{margin-bottom:10px !important;font-size:.92rem !important;}
.compact-hero .hero-chips,.reference-hero .hero-chips{margin-bottom:12px !important;}
.compact-hero .hero-chips .chip:nth-child(n+3),.reference-hero .hero-chips .chip:nth-child(n+3){display:none !important;}
.compact-hero .lead,.reference-hero .lead{max-width:820px !important;margin-bottom:18px !important;}
.compact-hero .notice,.reference-hero .notice{margin-top:16px !important;padding:13px 16px !important;font-size:.95rem !important;}
.page-continuity-note{display:none !important;}
.tool-stage-section{padding-top:clamp(22px,3vw,38px) !important;}
@media(max-width:760px){
  .compact-hero .breadcrumbs,.reference-hero .breadcrumbs{display:none !important;}
  .compact-hero .hero-chips,.reference-hero .hero-chips{display:none !important;}
  .compact-hero .hero-inner,.reference-hero .hero-inner{padding-top:26px !important;padding-bottom:28px !important;}
  .compact-hero .notice,.reference-hero .notice{font-size:.9rem !important;margin-top:12px !important;}
  .tool-stage-section{padding-top:18px !important;}
}
