:root {
  --site-action: #1467df;
  --site-action-hover: #1259bd;
  --site-action-edge: #8cb8ff;
  --site-rule: #405b75;
  --site-control-rule: #5a7898;
  --site-raised: #10253b;
  --site-title: #f4f8ff;
  --site-copy: #e3edf8;
  --site-note: #b8cce2;
  --site-radius-control: 8px;
  --site-radius-panel: 10px;
  --site-panel-shadow: 0 3px 12px rgba(0, 0, 0, .18);
}

html body:has(> .shared-site-header) .shared-site-header {
  border-bottom-color: var(--site-rule);
}
html body:has(> .shared-site-header) .shared-site-header .shared-site-brand {
  gap: 9px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  white-space: nowrap;
}
html body:has(> .shared-site-header) .shared-site-header .shared-site-brand::before {
  content: none;
}
html body:has(> .shared-site-header) .shared-site-header .site-brand-name {
  font-weight: 700 !important;
}
.site-brand-mark {
  display: block;
  flex: none;
  inline-size: 32px;
  block-size: 32px;
  color: #bde3ff;
}
.site-brand-short { display: none; }
html body:has(> .shared-site-header) .shared-site-header #shared-navigation a {
  border-radius: var(--site-radius-control);
  text-decoration: none !important;
}
html body:has(> .shared-site-header) .shared-site-header #shared-navigation a[aria-current="page"] {
  background: #173759 !important;
  color: #fff !important;
  box-shadow: inset 0 -2px #87baff;
}

/* Primary links and actions share the same treatment in the header and pages. */
html body:has(> .shared-site-header) :is(
  .site-cta--primary,
  .shared-site-header .shared-post,
  #post-report > summary,
  #panel-regions .dashboard-side section:first-child > a.redesign-report-cta,
  .company-action-panel .report-invitation-actions .work-button:not(.work-button-secondary),
  #main .help-contact a.help-phone,
  .report-invitation a.button.primary,
  .home-dashboard-actions .lookup-panel a.work-button
) {
  box-sizing: border-box;
  min-height: 44px !important;
  border: 1px solid var(--site-action-edge) !important;
  border-radius: var(--site-radius-control) !important;
  background: var(--site-action) !important;
  color: #fff !important;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  box-shadow: none;
}
html body:has(> .shared-site-header) :is(
  .site-cta--primary,
  .shared-site-header .shared-post,
  #post-report > summary,
  #panel-regions .dashboard-side section:first-child > a.redesign-report-cta,
  .company-action-panel .report-invitation-actions .work-button:not(.work-button-secondary),
  #main .help-contact a.help-phone,
  .report-invitation a.button.primary,
  .home-dashboard-actions .lookup-panel a.work-button
):hover {
  background: var(--site-action-hover) !important;
}
html body:has(> .shared-site-header) .site-cta--primary,
html body:has(> .shared-site-header) .site-cta--secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 15px;
}
html body:has(> .shared-site-header) :is(.site-cta--secondary,.company-action-panel .work-button-secondary) {
  min-height: 44px;
  border: 1px solid var(--site-control-rule) !important;
  border-radius: var(--site-radius-control) !important;
  background: var(--site-raised) !important;
  color: var(--site-title) !important;
}
html body:has(> .shared-site-header) :is(.site-cta--secondary,.company-action-panel .work-button-secondary):hover {
  background: #193957 !important;
}
html body:has(> .shared-site-header).help-page #main .help-contact a.help-phone {
  width: fit-content !important;
  max-width: 100%;
  padding-inline: 14px !important;
}
html body:has(> .shared-site-header) :is(#post-report :is(.post-entry-description,summary small),.help-contact .help-phone span) {
  color: #fff !important;
}

/* The panel shape and the details controls are shared; map symbols stay data-coded. */
html body:has(> .shared-site-header) :is(
  .map-canvas.map-card,
  #panel-regions .explorer-picker,
  #panel-regions .dashboard-side > section,
  #panel-regions .dashboard-record,
  #panel-public-reports .records-filter-bar,
  #public-report-list > .record-compact,
  #company-directory-results .company-distribution,
  #company-directory-results .company-list > .company-bar-row,
  #main .company-banner,
  #main .company-records,
  #main .company-action-panel,
  #main .company-reading > section,
  #main.help-main .help-consultation,
  #main.help-main .help-contact,
  #main.help-main .journey-action-list > a
) {
  border-radius: var(--site-radius-panel) !important;
  border-color: var(--site-rule) !important;
}
html body:has(> .shared-site-header) :is(
  #panel-regions .explorer-picker,
  #panel-regions .dashboard-side > section,
  #panel-public-reports .records-filter-bar,
  #public-report-list > .record-compact,
  #main .company-banner,
  #main .company-records,
  #main.help-main .help-contact
) {
  box-shadow: var(--site-panel-shadow);
}
html body:has(> .shared-site-header) :is(
  #main [role="tab"],
  #main button[aria-pressed],
  #main .records-filter-bar select,
  #main #apply-map-filters,
  #main .leaflet-control-zoom a,
  #main .search-field,
  #main .redesign-select select,
  #panel-regions #dashboard-filter-details > summary,
  #panel-regions #prefecture-list-disclosure > summary,
  #main .map-details > summary,
  #main .japan-records-count-details > summary
) {
  border-color: var(--site-control-rule) !important;
  border-radius: var(--site-radius-control) !important;
}
html body:has(> .shared-site-header) #main [role="tab"][aria-selected="true"] {
  background: #173759 !important;
  color: #fff !important;
  border-color: var(--site-action-edge) !important;
  box-shadow: inset 0 -2px #87baff !important;
}
html body:has(> .shared-site-header) #main .search-field svg {
  flex: none;
  opacity: 1;
  stroke-width: 1.8;
}
html body:has(> .shared-site-header) #panel-regions .explorer-picker .search-field {
  border-color: var(--site-action-edge) !important;
  background: #102740 !important;
}
html body:has(> .shared-site-header) #panel-regions .explorer-picker .filter-region-entry .unified-search-shortcut {
  background: transparent !important;
  color: #c6e2ff !important;
  border: 0 !important;
  box-shadow: none !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-inline: 2px !important;
}
html body:has(> .shared-site-header) #panel-regions .explorer-picker .filter-region-entry .unified-search-shortcut:hover {
  color: #fff !important;
}

/* Keep the hierarchy without moving the map stage or the ten-row company list. */
html body:has(> .shared-site-header) #main h1 {
  color: var(--site-title);
  font-size: clamp(27px, 2.3vw, 37px) !important;
  line-height: 1.18 !important;
  font-weight: 700;
}
html body:has(> .shared-site-header)[data-map-page="japan"] #main #experience-title {
  font-size: clamp(27px, 2vw, 34px) !important;
}
html body:has(> .shared-site-header)[data-workspace="company"] #main.company-detail-page .company-banner h1 {
  font-size: clamp(28px, 2.2vw, 35px) !important;
}
@media (min-width: 1001px) {
  html body:has(> .shared-site-header).world-page:not([data-world-search-embed]) #main > .explorer-heading {
    max-width: 1680px;
    margin-inline: auto !important;
    padding-block: 6px;
  }
}
html body:has(> .shared-site-header) #main :is(.section-heading,.company-records,.company-action-panel,.company-reading > section,.help-section-heading,.help-consultation,.journey-site-help) > h2,
html body:has(> .shared-site-header) #main.editorial-main > section > h2,
html body:has(> .shared-site-header) #main .section-heading > div > h2 {
  color: var(--site-title);
  padding-inline-start: 10px;
  border-inline-start: 3px solid #77aef4;
  font-size: clamp(19px, 1.65vw, 23px) !important;
  line-height: 1.3;
  font-weight: 700;
}
html body:has(> .shared-site-header) #panel-regions > .section-heading > div > h2 {
  font-size: clamp(18px, 1.5vw, 21px) !important;
}
html body:has(> .shared-site-header) #panel-regions .dashboard-side > section > h3 {
  color: var(--site-title);
  border-inline-start: 3px solid #77aef4;
  padding-inline-start: 9px;
  font-size: 18px !important;
  line-height: 1.35;
}
html body:has(> .shared-site-header) #main :is(.explorer-heading,.company-records,.company-action-panel,.company-reading,.help-heading,.help-consultation,.editorial-main) :is(p,li):not(.field-help,.work-label,.period-label,.source-credit,.help-source),
html body:has(> .shared-site-header) #main.editorial-main :is(p,li):not(.editorial-meta) {
  color: var(--site-copy);
  font-size: 16px;
  line-height: 1.62;
}
html body:has(> .shared-site-header) #main :is(.field-help,.work-label,.period-label,.source-credit,.editorial-meta,.help-source,.feed-meta) {
  font-size: 14px !important;
  line-height: 1.48;
}
html body:has(> .shared-site-header) #main :is(.company-banner,.company-records,.company-reading,.company-action-panel,.help-main-compact,.editorial-main) :is(.field-help,.work-label,.source-credit,.editorial-meta,.help-source) {
  color: var(--site-note);
}
html body:has(> .shared-site-header) #main .dashboard-record .feed-description {
  font-size: 15px !important;
  line-height: 1.55;
}

/* More room inside content sections; the map, chart and first company fold stay compact. */
html body:has(> .shared-site-header) #panel-public-reports #public-report-list > .record-compact {
  padding: 12px 16px !important;
  margin-block: 0 10px !important;
}
html body:has(> .shared-site-header).help-page #main.help-main > :is(.help-consultation,.journey-site-help) {
  margin-block: 16px !important;
  padding: 18px !important;
}
html body:has(> .shared-site-header).help-page #main.help-main .help-contacts {
  gap: 16px !important;
}
html body:has(> .shared-site-header).help-page #main.help-main .help-contacts .help-contact,
html body:has(> .shared-site-header)[data-workspace="company"] #main.company-detail-page :is(.company-records,.company-action-panel,.company-reading > section) {
  padding: 16px 18px !important;
}
html body:has(> .shared-site-header)[data-workspace="company"] #main.company-detail-page :is(.company-evidence-wide,.company-reading-grid) {
  margin-block-start: 16px !important;
}
html body:has(> .shared-site-header) #panel-regions .dashboard-side .dashboard-record {
  padding: 10px 12px !important;
}
html body:has(> .shared-site-header) #panel-regions .dashboard-side > section + section {
  margin-block-start: 10px;
}

@media (max-width: 720px) {
  html body:has(> .shared-site-header) .shared-site-header .shared-site-brand { gap: 4px; }
  html body:has(> .shared-site-header) .shared-site-header .shared-site-brand::after { content: none; }
  .site-brand-mark { inline-size: 22px; block-size: 22px; }
  .site-brand-name { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .site-brand-short { display: inline; font-size: 14px; }
}

/* The shorter side column gives the English tabs a second line; reserve that room. */
@media (min-width: 1500px) and (max-width: 1699px) {
  html[lang="en"] body[data-map-page="japan"]:not([data-dashboard-embed]) #main[data-active-tab="regions"] #panel-regions > .section-heading {
    top: 156px;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }
  html[lang="en"] body[data-map-page="japan"] #main #panel-regions > .section-heading > div > h2 {
    font-size: 18px !important;
  }
  html[lang="en"] body[data-map-page="japan"]:not([data-dashboard-embed]) #main[data-active-tab="regions"] #panel-regions .explorer-picker {
    margin-top: 218px !important;
  }
}
