/* Unified responsive shell: Easy Calculators + FilePat */
:root{--shell-blue:#1f56a5;--shell-blue-dark:#153f7b;--shell-ink:#1e2b39;--shell-border:#d9e1eb;--shell-width:1160px;--shell-gutter:clamp(12px,2.5vw,28px)}
html,body{width:100%;max-width:100%;min-width:0;margin:0}
html{overflow-x:clip}
body{overflow-x:clip}
/* Older file-tool styles reserved top padding for a fixed legacy header. The shared header now participates in flow. */
html body.site-shell-ready{padding-top:0!important;margin-top:0!important;}
.site-shell-header,.site-shell-header *{box-sizing:border-box}
.site-shell-header{position:sticky;top:0;z-index:1000;display:block;width:100%;max-width:none;min-width:0;margin:0;padding:0;background:var(--shell-blue);color:#fff;border:0;border-bottom:3px solid var(--shell-blue-dark);border-radius:0;box-shadow:0 2px 8px rgba(13,42,78,.12);overflow:visible;font-family:Inter,"Noto Sans JP","Yu Gothic UI",Meiryo,Arial,sans-serif;line-height:1.35;letter-spacing:0}
.site-shell-header__inner{width:min(var(--shell-width),calc(100% - 40px));min-width:0;max-width:var(--shell-width);min-height:66px;margin:0 auto;padding:9px 0;display:grid;grid-template-columns:max-content minmax(0,1fr) max-content;grid-template-areas:"brand nav controls";align-items:center;gap:14px}
.site-shell-brand{grid-area:brand;display:inline-flex;align-items:center;min-width:0;max-width:100%;margin:0;padding:0;color:#fff!important;text-decoration:none!important;font-family:inherit;font-size:17px;font-weight:750;line-height:1.25;white-space:nowrap;overflow:visible}
.site-shell-brand:hover{color:#fff!important;text-decoration:none!important}
.site-shell-brand [lang="ja"],.site-shell-brand .lang-ja,.site-shell-nav [lang="ja"],.site-shell-nav .lang-ja{display:inline!important}
.site-shell-brand [lang="en"],.site-shell-brand .lang-en,.site-shell-nav [lang="en"],.site-shell-nav .lang-en{display:none!important}
html[lang="en"] .site-shell-brand [lang="ja"],html[data-lang="en"] .site-shell-brand [lang="ja"],html[lang="en"] .site-shell-brand .lang-ja,html[data-lang="en"] .site-shell-brand .lang-ja,html[lang="en"] .site-shell-nav [lang="ja"],html[data-lang="en"] .site-shell-nav [lang="ja"],html[lang="en"] .site-shell-nav .lang-ja,html[data-lang="en"] .site-shell-nav .lang-ja{display:none!important}
html[lang="en"] .site-shell-brand [lang="en"],html[data-lang="en"] .site-shell-brand [lang="en"],html[lang="en"] .site-shell-brand .lang-en,html[data-lang="en"] .site-shell-brand .lang-en,html[lang="en"] .site-shell-nav [lang="en"],html[data-lang="en"] .site-shell-nav [lang="en"],html[lang="en"] .site-shell-nav .lang-en,html[data-lang="en"] .site-shell-nav .lang-en{display:inline!important}
.site-shell-nav{grid-area:nav;display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;max-width:100%;margin:0;padding:0;border:0;background:transparent;overflow:visible}
.site-shell-nav>a{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:0 0 auto;min-width:0;min-height:38px;margin:0;padding:8px 10px;border:1px solid transparent;border-radius:7px;background:transparent;color:#fff!important;text-decoration:none!important;white-space:nowrap;font-family:inherit;font-size:12px;font-weight:650;line-height:1.2;box-shadow:none;transform:none}
.site-shell-nav>a:hover,.site-shell-nav>a:focus-visible,.site-shell-nav>a[aria-current="page"]{background:rgba(255,255,255,.15);color:#fff!important;text-decoration:none!important}
.site-shell-nav>a.xsite{border-color:rgba(255,255,255,.48);background:rgba(255,255,255,.08)}
.site-shell-nav .site-shell-filepat-logo{display:block;width:76px;height:26px;max-width:76px;max-height:26px;object-fit:contain;padding:2px 5px;margin:0;border:0;border-radius:4px;background:#fff;flex:0 0 auto}
.site-shell-controls{grid-area:controls;display:flex;align-items:center;justify-content:flex-end;flex:0 0 auto;gap:7px;min-width:0;margin:0;padding:0;background:transparent;border:0}
.site-shell-language,.site-shell-header .filepat-language-switch{display:inline-flex;align-items:center;justify-content:center;gap:2px;flex:0 0 auto;min-width:0;margin:0;padding:3px;border:1px solid rgba(255,255,255,.8);border-radius:9px;background:#fff;box-shadow:none;white-space:nowrap}
.site-shell-language button,.site-shell-header .filepat-language-switch a{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:62px;min-height:31px;margin:0;padding:6px 9px;border:0;border-radius:6px;background:transparent;color:var(--shell-blue-dark)!important;text-decoration:none!important;white-space:nowrap;font-family:inherit;font-size:12px;font-weight:700;line-height:1.15;box-shadow:none;cursor:pointer}
.site-shell-language button[aria-pressed="true"],html[lang="ja"] .site-shell-language button[data-lang="ja"],html[lang="en"] .site-shell-language button[data-lang="en"],html[data-lang="ja"] .site-shell-language button[data-lang="ja"],html[data-lang="en"] .site-shell-language button[data-lang="en"],.site-shell-header .filepat-language-switch a.active,.site-shell-header .filepat-language-switch a[aria-current="page"]{background:var(--shell-blue);color:#fff!important}
.site-shell-language button:not([aria-pressed="true"]):hover,.site-shell-header .filepat-language-switch a:not(.active):hover{background:#eaf1fa;color:var(--shell-blue-dark)!important}
.site-shell-font-controls{display:inline-flex;align-items:center;justify-content:center;gap:2px;flex:0 0 auto;margin:0;padding:3px;border:1px solid rgba(255,255,255,.8);border-radius:9px;background:#fff}
.site-shell-font-controls button,.site-shell-header .filepat-a11y__btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:28px;min-height:29px;margin:0;padding:5px 6px;border:0;border-radius:6px;background:transparent;color:var(--shell-blue-dark)!important;font-family:inherit;font-size:12px;font-weight:750;line-height:1;cursor:pointer;box-shadow:none}
.site-shell-font-controls button.active,.site-shell-font-controls button[aria-pressed="true"],.site-shell-header .filepat-a11y__btn.active{background:var(--shell-blue);color:#fff!important}
.site-shell-font-controls button:hover,.site-shell-header .filepat-a11y__btn:hover{background:#eaf1fa}
.site-shell-menu,.site-shell-header .filepat-menu-toggle{grid-area:menu;display:none;align-items:center;justify-content:center;flex:0 0 auto;width:40px;min-width:40px;height:38px;min-height:38px;margin:0;padding:7px;border:1px solid rgba(255,255,255,.65);border-radius:8px;background:transparent;color:#fff;cursor:pointer}
.site-shell-menu span,.site-shell-header .filepat-menu-toggle span{display:block;width:18px;height:2px;margin:2px auto;border-radius:2px;background:#fff}
.site-shell-header .filepat-a11y{display:inline-flex;align-items:center;justify-content:center;gap:5px;flex:0 0 auto;min-width:0;margin:0;padding:0;border:0;background:transparent}
.site-shell-header .filepat-a11y__label,.site-shell-header .filepat-a11y__sub{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.site-shell-header .filepat-a11y__group{display:inline-flex;align-items:center;gap:2px;margin:0;padding:3px;border:1px solid rgba(255,255,255,.8);border-radius:9px;background:#fff}
.site-shell-header .filepat-a11y__contrast{display:inline-flex;align-items:center;justify-content:center;width:31px;min-width:31px;height:31px;min-height:31px;margin:0;padding:0;border:1px solid rgba(255,255,255,.8);border-radius:8px;background:#fff;color:var(--shell-blue-dark);font-size:0;cursor:pointer}
.site-shell-header .filepat-a11y__contrast::before{content:"◐";font-size:16px}
.site-shell-header .filepat-a11y__contrast span{display:none}
.site-shell-header a:focus-visible,.site-shell-header button:focus-visible{outline:3px solid #ffd36b;outline-offset:2px}
/* Make top-level sections use the viewport, while individual content keeps its reading width. */
@media(max-width:1100px){
 .site-shell-header__inner{width:calc(100% - 32px);grid-template-columns:minmax(0,1fr) max-content;grid-template-areas:"brand controls" "nav nav";gap:8px 12px;padding:10px 0}
 .site-shell-nav{width:100%;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:2px 0}
 .site-shell-nav>a{font-size:12px}
}
@media(max-width:760px){
 html body.site-shell-ready{padding-top:0!important;margin-top:0!important;}
 .site-shell-header{position:sticky}
 .site-shell-header__inner{width:calc(100% - 24px);grid-template-columns:minmax(0,1fr) max-content;grid-template-areas:"brand menu" "controls controls" "nav nav";gap:8px;padding:9px 0}
 .site-shell-brand{font-size:15px;white-space:normal;overflow-wrap:anywhere}
 .site-shell-menu,.site-shell-header .filepat-menu-toggle{display:inline-flex;align-self:center}
 .site-shell-controls{grid-area:controls;width:100%;justify-content:flex-start;flex-wrap:wrap;gap:7px}
 .site-shell-language button,.site-shell-header .filepat-language-switch a{min-width:68px;min-height:36px;padding:7px 10px;font-size:12px}
 .site-shell-font-controls button,.site-shell-header .filepat-a11y__btn{min-width:34px;min-height:34px;font-size:13px}
 .site-shell-header .filepat-a11y__contrast{width:36px;min-width:36px;height:36px;min-height:36px}
 .site-shell-nav{display:none;grid-area:nav;width:100%;padding:7px 0 2px;flex-wrap:wrap;justify-content:flex-start;overflow:visible;border-top:1px solid rgba(255,255,255,.25)}
 .site-shell-nav.open,html.filepat-menu-open .site-shell-nav{display:flex}
 .site-shell-nav>a{min-height:40px;padding:8px 10px;font-size:12px}
 .site-shell-filepat-logo{width:66px!important;max-width:66px!important;height:23px!important;max-height:23px!important}
}
@media(max-width:390px){
 .site-shell-header__inner{width:calc(100% - 20px)}
 .site-shell-brand{font-size:14px}
 .site-shell-language button,.site-shell-header .filepat-language-switch a{min-width:62px;padding:7px 8px;font-size:11px}
 .site-shell-nav>a{font-size:11px;padding:8px}
}
@media(prefers-reduced-motion:reduce){.site-shell-header *{scroll-behavior:auto!important;transition:none!important}}

/* Keep the directory spacing clean after removing the title and second logo block. */
html body.site-shell-ready .filepat-home-selection-v1{margin-top:0!important}
html body.site-shell-ready .filepat-home-selection-v1 .fp-tool-controls{margin-top:0!important}
html body.site-shell-ready .site-shell-nav .site-shell-filepat-logo{display:block!important;flex:0 0 auto!important;width:76px!important;height:26px!important;min-width:76px!important;max-width:76px!important;max-height:26px!important;object-fit:contain!important;padding:2px 5px!important;margin:0!important;border:0!important;border-radius:4px!important;background:#fff!important}

/* Shared controls must not inherit the old FilePat mobile width:100% rule. */
html body.site-shell-ready .site-shell-header .site-shell-controls>.filepat-a11y{display:inline-flex!important;width:auto!important;max-width:100%!important;min-width:0!important;flex:0 0 auto!important;align-items:center!important;justify-content:center!important;flex-wrap:nowrap!important;gap:5px!important;margin:0!important;padding:0!important;overflow:visible!important;}
html body.site-shell-ready .site-shell-header .filepat-a11y__group{display:inline-flex!important;width:auto!important;max-width:100%!important;flex:0 0 auto!important;align-items:center!important;justify-content:center!important;flex-wrap:nowrap!important;margin:0!important;padding:3px!important;gap:2px!important;}
html body.site-shell-ready .site-shell-header .filepat-a11y__contrast{width:31px!important;min-width:31px!important;height:31px!important;min-height:31px!important;flex:0 0 31px!important;padding:0!important;}
@media(max-width:390px){
 html body.site-shell-ready .site-shell-controls{column-gap:5px!important;row-gap:5px!important}
 html body.site-shell-ready .site-shell-controls>.site-shell-language,html body.site-shell-ready .site-shell-controls>.filepat-language-switch{gap:1px!important;padding:2px!important}
 html body.site-shell-ready .site-shell-language button,html body.site-shell-ready .filepat-language-switch a{min-width:56px!important;padding:6px 7px!important}
 html body.site-shell-ready .site-shell-header .filepat-a11y__group{gap:1px!important;padding:2px!important}
 html body.site-shell-ready .site-shell-header .filepat-a11y__btn{min-width:27px!important;width:27px!important;padding:4px 3px!important}
 html body.site-shell-ready .site-shell-header .filepat-a11y__contrast{width:31px!important;min-width:31px!important;flex-basis:31px!important}
}


/* Shared layout finish: no legacy top spacer; full-bleed blue footer on all file-tool pages. */
html, body {
  margin: 0 !important;
  padding: 0 !important;
}
html body.site-shell-ready {
  margin: 0 !important;
  padding: 0 !important;
}
html body.site-shell-ready > .site-shell-header:first-child {
  position: sticky !important;
  top: 0 !important;
  left: auto !important;
  margin: 0 !important;
  transform: none !important;
}
html body footer.fp-footer-v2 {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 56px 0 0 !important;
  padding: 0 0 22px !important;
  border: 0 !important;
  border-top: 0 !important;
  border-radius: 0 !important;
  background: #123f7d !important;
  color: #d6e4f8 !important;
  box-sizing: border-box !important;
}
html body footer.fp-footer-v2::before {
  height: 3px !important;
  background: rgba(255,255,255,.24) !important;
}
html body footer.fp-footer-v2 .footer-logo {
  color: #fff !important;
}
html body footer.fp-footer-v2 .footer-brand p {
  color: #c6d9f1 !important;
}
html body footer.fp-footer-v2 .footer-socials a {
  background: rgba(255,255,255,.96) !important;
  border-color: rgba(255,255,255,.65) !important;
  color: #163f79 !important;
}
html body footer.fp-footer-v2 .footer-socials a span {
  color: #536b86 !important;
}
html body footer.fp-footer-v2 .footer-links b {
  color: #c6d9f1 !important;
}
html body footer.fp-footer-v2 .footer-links a {
  color: #e0ebfa !important;
}
html body footer.fp-footer-v2 .footer-links a:hover {
  color: #fff !important;
}
html body footer.fp-footer-v2 .copyright {
  border-top: 1px solid rgba(255,255,255,.22) !important;
  color: #b9cdea !important;
}
@media (max-width: 760px) {
  html body footer.fp-footer-v2 { margin-top: 38px !important; }
}


/* Mobile navigation: language and text-size controls live inside the hamburger panel. */
@media(max-width:760px){
  html body .site-shell-header__inner{
    width:calc(100% - 24px)!important;
    grid-template-columns:minmax(0,1fr) 42px!important;
    grid-template-areas:"brand menu" "nav nav" "controls controls"!important;
    align-items:center!important;gap:0 8px!important;padding:9px 0!important;
  }
  html body .site-shell-menu,html body .site-shell-header .filepat-menu-toggle{grid-area:menu!important;display:inline-flex!important;}
  html body .site-shell-header .site-shell-controls{
    display:none!important;grid-area:controls!important;width:100%!important;max-width:100%!important;
    margin:8px 0 0!important;padding:10px 0 2px!important;border-top:1px solid rgba(255,255,255,.28)!important;
    justify-content:flex-start!important;align-items:center!important;flex-wrap:wrap!important;gap:9px!important;
  }
  html body .site-shell-header.menu-open .site-shell-controls{display:flex!important;}
  html body .site-shell-header .site-shell-nav{display:none!important;grid-area:nav!important;width:100%!important;max-width:100%!important;
    margin:8px 0 0!important;padding:10px 0 2px!important;border-top:1px solid rgba(255,255,255,.28)!important;
    flex-wrap:wrap!important;justify-content:flex-start!important;overflow:visible!important;}
  html body .site-shell-header.menu-open .site-shell-nav,
  html body .site-shell-header .site-shell-nav.open{display:flex!important;}
  html body .site-shell-header .site-shell-nav>a{white-space:normal!important;min-height:40px!important;max-width:100%!important;}
  html body .site-shell-header .site-shell-language{order:1!important;}
  html body .site-shell-header .site-shell-font-controls{order:2!important;}
  html body .site-shell-header .site-shell-language button{min-width:76px!important;min-height:38px!important;font-size:13px!important;}
  html body .site-shell-header .site-shell-font-controls button{min-width:38px!important;min-height:38px!important;font-size:14px!important;}
}
@media(max-width:390px){
  html body .site-shell-header__inner{width:calc(100% - 20px)!important;}
  html body .site-shell-brand{font-size:14px!important;}
  html body .site-shell-header .site-shell-language button{min-width:70px!important;padding:7px 8px!important;}
}


/* Canonical hamburger icon: three centered bars; do not inherit legacy inline-span layout. */
@media (max-width: 760px) {
  html body.site-shell-ready .site-shell-header .site-shell-menu,
  html body.site-shell-ready .site-shell-header .filepat-menu-toggle {
    position: relative !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 42px !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    line-height: 0 !important;
    overflow: visible !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-menu span,
  html body.site-shell-ready .site-shell-header .filepat-menu-toggle span {
    position: absolute !important;
    display: block !important;
    left: 50% !important;
    top: 50% !important;
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 2px !important;
    min-height: 2px !important;
    max-height: 2px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 2px !important;
    background: currentColor !important;
    opacity: 1 !important;
    transform-origin: center center !important;
    transition: transform .15s ease, opacity .15s ease !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-menu span:nth-child(1),
  html body.site-shell-ready .site-shell-header .filepat-menu-toggle span:nth-child(1) {
    transform: translate(-50%, -6px) !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-menu span:nth-child(2),
  html body.site-shell-ready .site-shell-header .filepat-menu-toggle span:nth-child(2) {
    display: block !important;
    transform: translate(-50%, 0) !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-menu span:nth-child(3),
  html body.site-shell-ready .site-shell-header .filepat-menu-toggle span:nth-child(3) {
    transform: translate(-50%, 6px) !important;
  }
  html body.site-shell-ready .site-shell-header.menu-open .site-shell-menu span:nth-child(1),
  html body.site-shell-ready .site-shell-header.menu-open .filepat-menu-toggle span:nth-child(1) {
    transform: translate(-50%, 0) rotate(45deg) !important;
  }
  html body.site-shell-ready .site-shell-header.menu-open .site-shell-menu span:nth-child(2),
  html body.site-shell-ready .site-shell-header.menu-open .filepat-menu-toggle span:nth-child(2) {
    opacity: 0 !important;
  }
  html body.site-shell-ready .site-shell-header.menu-open .site-shell-menu span:nth-child(3),
  html body.site-shell-ready .site-shell-header.menu-open .filepat-menu-toggle span:nth-child(3) {
    transform: translate(-50%, 0) rotate(-45deg) !important;
  }
}


/* Final UI polish: consistent typography across calculator and FilePat pages. */
html body.site-shell-ready { font-family: Inter, "Noto Sans JP", "Yu Gothic UI", "Hiragino Sans", Meiryo, Arial, sans-serif !important; }
html body.site-shell-ready * { font-family: inherit !important; }
html body.site-shell-ready pre,
html body.site-shell-ready code,
html body.site-shell-ready kbd,
html body.site-shell-ready pre *,
html body.site-shell-ready code *,
html body.site-shell-ready kbd * { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace !important; }

/* Desktop has dedicated header space for navigation, language/contrast, and text size. */
html body.site-shell-ready .site-shell-header__inner {
  grid-template-columns: max-content minmax(0,1fr) max-content max-content !important;
  grid-template-areas: "brand nav controls font" !important;
}
html body.site-shell-ready .site-shell-controls { grid-area: controls !important; }
html body.site-shell-ready .site-shell-font-controls { grid-area: font !important; }

/* Mobile: A− / A / A＋ stays visible beside the hamburger button. Only other controls open with the menu. */
@media (max-width: 1100px) {
  html body.site-shell-ready .site-shell-header__inner {
    grid-template-columns: minmax(0,1fr) max-content max-content !important;
    grid-template-areas: "brand controls font" "nav nav nav" !important;
    align-items: center !important;
  }
}
@media (max-width: 760px) {
  html body.site-shell-ready .site-shell-header__inner {
    position: relative !important;
    width: calc(100% - 24px) !important;
    grid-template-columns: minmax(0,1fr) max-content max-content !important;
    grid-template-areas: "brand font menu" "nav nav nav" "controls controls controls" !important;
    gap: 8px 8px !important;
    padding: 9px 0 !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-font-controls {
    display: inline-flex !important;
    position: static !important;
    grid-area: font !important;
    align-self: center !important;
    justify-self: end !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 3px !important;
    transform: none !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-controls {
    display: none !important;
    grid-area: controls !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 4px 0 0 !important;
    padding: 10px 0 2px !important;
    border-top: 1px solid rgba(255,255,255,.28) !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 9px !important;
  }
  html body.site-shell-ready .site-shell-header.menu-open .site-shell-controls { display: flex !important; }
  html body.site-shell-ready .site-shell-header .site-shell-nav {
    display: none !important;
    grid-area: nav !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 4px 0 0 !important;
    padding: 10px 0 2px !important;
    border-top: 1px solid rgba(255,255,255,.28) !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    overflow: visible !important;
  }
  html body.site-shell-ready .site-shell-header.menu-open .site-shell-nav,
  html body.site-shell-ready .site-shell-header .site-shell-nav.open { display: flex !important; }
  html body.site-shell-ready .site-shell-header .site-shell-nav > a { white-space: normal !important; min-height: 40px !important; max-width: 100% !important; }
  html body.site-shell-ready .site-shell-header .site-shell-font-controls button,
  html body.site-shell-ready .site-shell-header .filepat-a11y__btn { min-width: 31px !important; width: 31px !important; min-height: 32px !important; height: 32px !important; padding: 4px 4px !important; font-size: 13px !important; }
  html body.site-shell-ready .site-shell-brand { font-size: 16px !important; }
  html body.site-shell-ready .site-shell-header .site-shell-language button,
  html body.site-shell-ready .site-shell-header .filepat-language-switch a { min-width: 70px !important; min-height: 36px !important; padding: 7px 9px !important; font-size: 12px !important; }
}
@media (max-width: 390px) {
  html body.site-shell-ready .site-shell-header__inner { width: calc(100% - 20px) !important; }
  html body.site-shell-ready .site-shell-brand { font-size: 15px !important; }
  html body.site-shell-ready .site-shell-header .site-shell-font-controls { gap: 1px !important; padding: 2px !important; }
  html body.site-shell-ready .site-shell-header .site-shell-font-controls button,
  html body.site-shell-ready .site-shell-header .filepat-a11y__btn { min-width: 28px !important; width: 28px !important; height: 30px !important; min-height: 30px !important; font-size: 12px !important; }
}

/* Tool pages: separate the working area from the long-form help below it. */
html body.site-shell-ready .page-guide-shell { margin-top: 76px !important; }
html body.site-shell-ready .info-section { margin-top: 78px !important; }
html body.site-shell-ready .seo-content { margin-top: 78px !important; }
html body.site-shell-ready .filepat-main-with-side-ad > .tool-layout { margin-bottom: 24px !important; }
html body.site-shell-ready .seo-page > .seo-main + section,
html body.site-shell-ready .seo-main + .page-guide-shell { margin-top: 74px !important; }
html body.site-shell-ready .panel { padding-bottom: 42px !important; }
@media (max-width: 760px) {
  html body.site-shell-ready .page-guide-shell { margin-top: 48px !important; }
  html body.site-shell-ready .info-section,
  html body.site-shell-ready .seo-content { margin-top: 52px !important; }
  html body.site-shell-ready .filepat-main-with-side-ad > .tool-layout { margin-bottom: 14px !important; }
  html body.site-shell-ready .panel { padding-bottom: 30px !important; }
}

/* Search the calculator and file-tool directory from one field on the home page. */
.home-function-search { max-width: 700px; margin: 20px 0 34px; }
.home-function-search > label { display: block; margin: 0 0 8px; color: #173f78; font-size: 15px; font-weight: 750; line-height: 1.5; }
.home-function-search__field { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 7px 4px 14px; border: 1px solid #cbd6e5; border-radius: 10px; background: #fff; box-shadow: 0 2px 7px rgba(21,63,123,.035); }
.home-function-search__field:focus-within { border-color: #477fc7; box-shadow: 0 0 0 3px rgba(71,127,199,.12); }
.home-function-search__icon { flex: 0 0 auto; color: #67809f; font-size: 25px; line-height: 1; transform: rotate(-15deg); }
.home-function-search__field input { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 38px; padding: 6px 0; border: 0; outline: 0; background: transparent; color: #1f2e40; font-size: 15px; }
.home-function-search__field input::placeholder { color: #8997a8; opacity: 1; }
.home-function-search__field button { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 7px; background: #edf2f8; color: #405976; font-size: 21px; line-height: 1; cursor: pointer; }
.home-function-search__field button:hover { background: #dfe8f4; }
.home-function-search > p { margin: 7px 0 0; color: #6f7e91; font-size: 12px; line-height: 1.65; }
.home-function-search .home-function-search__empty { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: #f4f7fb; color: #435873; }
.home-function-search [hidden], .in [hidden] { display: none !important; }
@media(max-width:640px) {
  .home-function-search { margin: 16px 0 28px; }
  .home-function-search > label { font-size: 14px; }
  .home-function-search__field { min-height: 46px; gap: 8px; padding-left: 11px; }
  .home-function-search__field input { font-size: 14px; }
}


/* FINAL HEADER COMPACTING FIX (2026-10): fit controls on one line and keep A+/A− unbroken. */
.site-shell-header__inner{
  grid-template-columns:max-content minmax(0,1fr) max-content max-content;
  grid-template-areas:"brand nav controls font";
  align-items:center;
  gap:10px;
  min-height:0;
  padding:6px 0;
}
.site-shell-header .site-shell-font-controls{
  grid-area:font;
  display:inline-flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:center!important;
  justify-self:end;
  width:max-content!important;
  max-width:none!important;
  min-width:max-content!important;
  margin:0!important;
  padding:2px!important;
  gap:1px!important;
  white-space:nowrap!important;
}
.site-shell-header .site-shell-font-controls button{
  display:inline-flex!important;
  flex:0 0 28px!important;
  width:28px!important;
  min-width:28px!important;
  max-width:28px!important;
  height:28px!important;
  min-height:28px!important;
  margin:0!important;
  padding:2px!important;
  align-items:center!important;
  justify-content:center!important;
  white-space:nowrap!important;
  word-break:keep-all!important;
  overflow-wrap:normal!important;
  line-height:1!important;
}
@media (min-width:761px) and (max-width:1100px){
  .site-shell-header__inner{
    width:calc(100% - 32px);
    grid-template-columns:minmax(0,1fr) max-content max-content;
    grid-template-areas:"brand controls font" "nav nav nav";
    gap:6px 10px;
    padding:6px 0;
  }
  .site-shell-header .site-shell-controls{grid-area:controls;justify-self:end;}
  .site-shell-header .site-shell-nav{grid-area:nav;}
}
@media (max-width:760px){
  .site-shell-header__inner{
    width:calc(100% - 24px)!important;
    grid-template-columns:minmax(0,1fr) max-content max-content!important;
    grid-template-areas:"brand font menu" "nav nav nav" "controls controls controls"!important;
    gap:5px 8px!important;
    min-height:0!important;
    padding:5px 0!important;
    align-items:center!important;
  }
  .site-shell-header .site-shell-brand{
    grid-area:brand!important;
    min-width:0!important;
    max-width:100%!important;
    font-size:16px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow-wrap:normal!important;
  }
  .site-shell-header .site-shell-menu,
  .site-shell-header .filepat-menu-toggle{
    grid-area:menu!important;
    justify-self:end!important;
    align-self:center!important;
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    padding:5px!important;
    margin:0!important;
  }
  .site-shell-header .site-shell-font-controls{
    grid-area:font!important;
    justify-self:end!important;
    align-self:center!important;
    display:inline-flex!important;
    flex-wrap:nowrap!important;
    width:max-content!important;
    min-width:max-content!important;
    max-width:none!important;
    margin:0!important;
    padding:2px!important;
    gap:1px!important;
  }
  .site-shell-header .site-shell-font-controls button{
    flex:0 0 28px!important;
    width:28px!important;
    min-width:28px!important;
    max-width:28px!important;
    height:28px!important;
    min-height:28px!important;
    padding:2px!important;
    font-size:11px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  .site-shell-header .site-shell-controls{
    display:none!important;
    grid-area:controls!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:4px 0 1px!important;
    justify-content:flex-start!important;
    flex-wrap:nowrap!important;
    gap:6px!important;
    border-top:1px solid rgba(255,255,255,.22)!important;
  }
  .site-shell-header.menu-open .site-shell-controls{display:flex!important;}
  .site-shell-header .site-shell-nav{
    display:none!important;
    grid-area:nav!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:5px 0 2px!important;
    flex-wrap:wrap!important;
    justify-content:flex-start!important;
    align-items:center!important;
    gap:3px!important;
    border-top:1px solid rgba(255,255,255,.22)!important;
    overflow:visible!important;
  }
  .site-shell-header .site-shell-nav.open,
  .site-shell-header.menu-open .site-shell-nav,
  html.filepat-menu-open .site-shell-header .site-shell-nav{display:flex!important;}
  .site-shell-header .site-shell-nav>a{
    min-height:32px!important;
    padding:6px 8px!important;
    font-size:11px!important;
    line-height:1.2!important;
    white-space:nowrap!important;
  }
  .site-shell-header .site-shell-nav .site-shell-filepat-logo{width:62px!important;min-width:62px!important;height:21px!important;max-height:21px!important;}
  .site-shell-header .site-shell-controls .site-shell-language,
  .site-shell-header .site-shell-controls .filepat-language-switch{max-width:100%!important;}
}
@media (max-width:360px){
  .site-shell-header__inner{width:calc(100% - 20px)!important;gap:4px 5px!important;}
  .site-shell-header .site-shell-brand{font-size:15px!important;}
  .site-shell-header .site-shell-font-controls button{flex-basis:26px!important;width:26px!important;min-width:26px!important;max-width:26px!important;}
}

/* Vector-based centering for the floating blue back-to-top button. */
.top{display:grid!important;place-items:center!important;padding:0!important;line-height:0!important;}
.top span{display:none!important;}
.top svg{display:block!important;width:22px!important;height:22px!important;flex:0 0 22px!important;margin:0!important;padding:0!important;overflow:visible!important;}
.top svg path{fill:none!important;stroke:currentColor!important;stroke-width:2.5!important;stroke-linecap:round!important;stroke-linejoin:round!important;}

/* Highest-specificity correction for the header: compact rows and an unbreakable A+/A/A− group. */
@media (max-width:760px){
  html body.site-shell-ready .site-shell-header__inner{
    width:calc(100% - 24px)!important;
    min-height:0!important;
    padding:4px 0!important;
    gap:5px 6px!important;
    grid-template-columns:minmax(0,1fr) max-content max-content!important;
    grid-template-areas:"brand font menu" "nav nav nav" "controls controls controls"!important;
    align-items:center!important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-brand{
    grid-area:brand!important;
    min-width:0!important;
    max-width:100%!important;
    font-size:15px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow-wrap:normal!important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-menu,
  html body.site-shell-ready .site-shell-header .filepat-menu-toggle{
    grid-area:menu!important;
    display:inline-flex!important;
    flex:0 0 36px!important;
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
    padding:0!important;
    margin:0!important;
    justify-self:end!important;
    align-self:center!important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-font-controls{
    grid-area:font!important;
    display:inline-flex!important;
    flex-wrap:nowrap!important;
    width:max-content!important;
    min-width:max-content!important;
    max-width:none!important;
    padding:2px!important;
    gap:1px!important;
    margin:0!important;
    justify-self:end!important;
    align-self:center!important;
    white-space:nowrap!important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-font-controls button{
    display:inline-flex!important;
    flex:0 0 28px!important;
    width:28px!important;
    min-width:28px!important;
    max-width:28px!important;
    height:28px!important;
    min-height:28px!important;
    max-height:28px!important;
    padding:2px!important;
    margin:0!important;
    font-size:11px!important;
    line-height:1!important;
    white-space:nowrap!important;
    word-break:keep-all!important;
    overflow-wrap:normal!important;
    align-items:center!important;
    justify-content:center!important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-controls{
    display:none!important;
    grid-area:controls!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:5px 0 1px!important;
    border-top:1px solid rgba(255,255,255,.24)!important;
    justify-content:flex-start!important;
    align-items:center!important;
    flex-wrap:nowrap!important;
    gap:6px!important;
  }
  html body.site-shell-ready .site-shell-header.menu-open .site-shell-controls{display:flex!important;}
  html body.site-shell-ready .site-shell-header .site-shell-nav{
    display:none!important;
    grid-area:nav!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:5px 0 2px!important;
    border-top:1px solid rgba(255,255,255,.24)!important;
    flex-wrap:wrap!important;
    justify-content:flex-start!important;
    align-items:center!important;
    gap:3px!important;
    overflow:visible!important;
  }
  html body.site-shell-ready .site-shell-header.menu-open .site-shell-nav,
  html body.site-shell-ready .site-shell-header .site-shell-nav.open{display:flex!important;}
  html body.site-shell-ready .site-shell-header .site-shell-nav>a{
    min-height:32px!important;
    padding:6px 8px!important;
    font-size:11px!important;
    line-height:1.2!important;
    white-space:nowrap!important;
  }
}
@media (max-width:360px){
  html body.site-shell-ready .site-shell-header__inner{width:calc(100% - 20px)!important;gap:4px 5px!important;}
  html body.site-shell-ready .site-shell-header .site-shell-brand{font-size:14px!important;}
  html body.site-shell-ready .site-shell-header .site-shell-font-controls button{
    flex-basis:26px!important;width:26px!important;min-width:26px!important;max-width:26px!important;
  }
}

/* Reliability patch v7: consistent back-to-top control on calculator and FilePat pages. */
html body .site-shell-back-to-top {
  position: fixed !important;
  right: 16px !important;
  bottom: 16px !important;
  z-index: 4999 !important;
  display: grid !important;
  place-items: center !important;
  box-sizing: border-box !important;
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #1f56a5 !important;
  color: #fff !important;
  text-decoration: none !important;
  line-height: 0 !important;
  box-shadow: 0 3px 10px rgba(16, 48, 91, .28) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  cursor: pointer !important;
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease !important;
  transform: translateY(4px) !important;
}
html body .site-shell-back-to-top.is-visible,
html body .site-shell-back-to-top.on {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}
html body .site-shell-back-to-top svg {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  flex: 0 0 22px !important;
}
html body .site-shell-back-to-top svg path {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.5 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
html body .site-shell-back-to-top:focus-visible {
  outline: 3px solid #173f78 !important;
  outline-offset: 3px !important;
}
@media (max-width: 760px) {
  html body .site-shell-back-to-top {
    right: 14px !important;
    bottom: 14px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  html body .site-shell-back-to-top { transition: none !important; }
}

/* Reliability patch v7: ensure mobile navigation controls are reachable above content. */
@media (max-width: 760px) {
  html body.site-shell-ready .site-shell-header { z-index: 5000 !important; }
  html body.site-shell-ready .site-shell-header__inner { position: relative !important; }
  html body.site-shell-ready .site-shell-header .site-shell-menu,
  html body.site-shell-ready .site-shell-header .filepat-menu-toggle {
    position: relative !important;
    z-index: 5002 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-nav {
    position: relative !important;
    z-index: 5001 !important;
    pointer-events: auto !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-nav a {
    position: relative !important;
    z-index: 5002 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
  }
}

/* Compact mobile header: keep the closed header to one grid row so hidden nav/control
   rows do not leave phantom row-gaps below the brand and controls. */
@media (max-width: 760px) {
  html body.site-shell-ready .site-shell-header {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-bottom-width: 2px !important;
  }
  html body.site-shell-ready .site-shell-header__inner {
    width: calc(100% - 20px) !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 4px 0 !important;
    margin: 0 auto !important;
    grid-template-columns: minmax(0, 1fr) max-content max-content !important;
    grid-template-areas: "brand font menu" !important;
    align-items: center !important;
    align-content: center !important;
    gap: 0 7px !important;
  }
  html body.site-shell-ready .site-shell-brand {
    white-space: nowrap !important;
    overflow: visible !important;
    font-size: 15px !important;
    line-height: 1.15 !important;
  }
  html body.site-shell-ready .site-shell-menu,
  html body.site-shell-ready .site-shell-header .filepat-menu-toggle {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 5px !important;
    align-self: center !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-font-controls {
    grid-area: font !important;
    padding: 2px !important;
    gap: 1px !important;
    align-self: center !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-font-controls button,
  html body.site-shell-ready .site-shell-header .filepat-a11y__btn {
    width: 27px !important;
    min-width: 27px !important;
    height: 27px !important;
    min-height: 27px !important;
    padding: 3px 2px !important;
    font-size: 12px !important;
    line-height: 1 !important;
  }
  html body.site-shell-ready .site-shell-header .site-shell-nav,
  html body.site-shell-ready .site-shell-header .site-shell-controls {
    display: none !important;
  }
  html body.site-shell-ready .site-shell-header.menu-open .site-shell-header__inner {
    grid-template-areas: "brand font menu" "nav nav nav" "controls controls controls" !important;
    gap: 5px 7px !important;
    padding: 5px 0 3px !important;
  }
  html body.site-shell-ready .site-shell-header.menu-open .site-shell-nav,
  html body.site-shell-ready .site-shell-header .site-shell-nav.open {
    display: flex !important;
    margin: 0 !important;
    padding: 6px 0 2px !important;
  }
  html body.site-shell-ready .site-shell-header.menu-open .site-shell-controls {
    display: flex !important;
    margin: 0 !important;
    padding: 6px 0 2px !important;
  }
}
@media (max-width: 390px) {
  html body.site-shell-ready .site-shell-header__inner { width: calc(100% - 16px) !important; }
  html body.site-shell-ready .site-shell-brand { font-size: 14px !important; }
  html body.site-shell-ready .site-shell-menu,
  html body.site-shell-ready .site-shell-header .filepat-menu-toggle { width: 30px !important; min-width: 30px !important; height: 30px !important; min-height: 30px !important; }
  html body.site-shell-ready .site-shell-header .site-shell-font-controls button,
  html body.site-shell-ready .site-shell-header .filepat-a11y__btn { width: 26px !important; min-width: 26px !important; height: 26px !important; min-height: 26px !important; }
}
