/* Shared logo, tab proportions and typography; page artwork stays page-owned. */
:root { --companion-header-height:80px;--companion-brand-width:290px;--companion-tab-width:clamp(165px,14vw,240px); }
.masthead { display:grid;grid-template-columns:var(--companion-brand-width) max-content minmax(0,1fr);grid-template-rows:80px;align-items:center;align-content:start;justify-content:normal;height:var(--companion-header-height);min-height:0;padding:0 24px 0 12px;gap:0 24px; }
.masthead .brand-home { grid-column:1;grid-row:1;display:flex;flex-direction:row;align-items:center;justify-content:center;align-self:center;width:var(--companion-brand-width);min-width:0;max-width:none;height:65px;padding:0;margin:0;text-decoration:none; }
.masthead .brand-logo-window { display:block;width:100%;height:65px;overflow:hidden; }
.masthead .brand-logo { display:block;width:calc(100% + 40px);height:100%;max-width:none;object-fit:cover;object-position:50% 74%;transform:translateX(-40px); }
.masthead .companion-nav { grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:flex-start;justify-self:start;align-self:center;order:0;width:max-content;height:54px;gap:2px;margin:0; }
.masthead .companion-nav a,.masthead .companion-tab { position:relative;display:flex;flex:none;align-items:center;justify-content:center;width:var(--companion-tab-width);min-width:0;height:54px;padding:0 16px 3px;margin:0;border:0;border-radius:0;background:url('/ui-assets/nav-normal.png') no-repeat center 48% / 100% 350%;box-shadow:none;font-family:'Yu Mincho','Meiryo',serif;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:.05em;color:#c5d8e6;text-decoration:none;white-space:nowrap; }
.masthead .companion-nav a::before,.masthead .companion-nav a::after { display:none; }
.masthead .companion-nav a[aria-current] { border:0;background-image:url('/ui-assets/nav-active.png');color:#fff5dc;box-shadow:none; }
.masthead > .header-tools,.masthead > .preview-tag { grid-column:3;grid-row:1;align-self:center;justify-self:end;margin:0; }
@media(max-width:1279px) { :root { --companion-brand-width:250px; }.masthead { column-gap:14px; } }
/* Keep map-only controls available without shifting its logo or navigation. */
@media(min-width:901px) and (max-width:1350px) {
  body[data-ads='off'] { --companion-header-height:120px; }
  body[data-ads='off'] .masthead { grid-template-rows:80px 40px; }
  body[data-ads='off'] .masthead > .header-tools { grid-column:1/-1;grid-row:2; }
}
@media(max-width:900px) {
  :root { --companion-header-height:118px;--companion-brand-width:215px;--companion-tab-width:clamp(140px,18vw,180px); }
  .masthead { grid-template-columns:minmax(0,1fr) auto;grid-template-rows:64px 54px; }
  .masthead .brand-home,.masthead .brand-logo-window { height:56px; }
  .masthead .companion-nav { grid-column:1/-1;grid-row:2;align-self:center;height:48px; }
  .masthead .companion-nav a,.masthead .companion-tab { height:48px;font-size:16px;background-size:100% 310%; }
  .masthead > .header-tools,.masthead > .preview-tag { grid-column:2;grid-row:1; }
}
@media(max-width:700px) {
  :root { --companion-header-height:114px;--companion-brand-width:205px;--companion-tab-width:calc((100% - 4px) / 3); }
  .masthead { grid-template-rows:64px 50px;padding-inline:12px;column-gap:8px; }
  .masthead .brand-home,.masthead .brand-logo-window { height:55px; }
  .masthead .companion-nav { width:100%;height:48px; }
  .masthead .companion-nav a,.masthead .companion-tab { height:48px;padding:0 5px 3px;font-size:13px; }
  body[data-ads='off'] { --companion-header-height:154px; }
  body[data-ads='off'] .masthead { grid-template-rows:64px 50px 40px; }
  body[data-ads='off'] .masthead > .header-tools { grid-column:1/-1;grid-row:3; }
}
@media(min-width:761px) { body[data-ads='off'] main { height:calc(100dvh - var(--companion-header-height)); } }
@media(max-width:760px) { body[data-ads='off'] main { min-height:calc(100dvh - var(--companion-header-height)); } }
