/* One fixed geometry per viewport for all six homepage areas. */
@media screen {
  html { overflow-y: scroll; scrollbar-gutter: stable; }
  body[data-hp] {
    --hp-unified-number-row: 0px;
    --hp-unified-tool-extra: 0px;
    --hp-unified-topbar: calc(84px + var(--hp-unified-tool-extra));
    --hp-unified-menu-rows: 2;
    --hp-unified-menu-row: calc(42px + var(--hp-unified-number-row));
    --hp-unified-menu-meta: calc(36px + var(--hp-unified-number-row) * 1.4);
    --hp-unified-kicker: calc(40px + var(--hp-unified-number-row));
    --hp-unified-title: calc(120px + var(--hp-unified-number-row));
    --hp-unified-subtitle: calc(72px + var(--hp-unified-number-row));
    --hp-unified-actions: calc(48px + var(--hp-unified-number-row));
    --hp-unified-copy: calc(var(--hp-unified-kicker) + var(--hp-unified-title) + var(--hp-unified-subtitle) + var(--hp-unified-actions));
    --hp-head-crest-slot: 128px;
    --hp-head-crest-height: 120px;
    --hp-head-title-size: 32px;
  }
  html.hp-field-numbering body[data-hp] {
    --hp-unified-number-row: calc(var(--hp-field-number-size,16px) * 1.4 + 12px);
    --hp-unified-tool-extra: calc(var(--hp-field-number-size,16px) * 2.8 + 12px);
  }
  body[data-hp] .hp-topbar {
    display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px 20px;
    box-sizing: border-box; height: var(--hp-unified-topbar); min-height: var(--hp-unified-topbar);
    padding: 12px 24px; align-items: center;
  }
  body[data-hp] .hp-brand {
    display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px;
    min-width: 0; width: 100%; max-width: 100%; align-items: center;
  }
  body[data-hp] .hp-brand-logo { width: 46px; height: 56px; object-fit: contain; }
  body[data-hp] .hp-brand-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 18px; line-height: 1.3; }
  body[data-hp] .hp-tools { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: clamp(282px,30vw,360px); gap: 10px; }
  body[data-hp] .hp-tools label { min-width: 0; font-size: 12px; line-height: 16px; gap: 3px; }
  body[data-hp] .hp-tools select { min-width: 0; width: 100%; height: 36px; min-height: 36px; margin: 0; }
  html.hp-field-numbering body[data-hp] .hp-tools .hp-field-native-number {
    min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; word-break: break-all;
    margin-inline-start: 0; line-height: 1.2;
  }
  body[data-hp] .hp-main-frame { overflow: clip; }
  body[data-hp] .hp-sectionbar {
    position: sticky; top: var(--hp-unified-topbar); z-index: 35;
    box-sizing: border-box; display: flex; flex-direction: column; align-items: stretch;
    gap: 8px; padding: 12px 24px;
    height: calc(var(--hp-unified-menu-rows) * var(--hp-unified-menu-row) + (var(--hp-unified-menu-rows) - 1) * 6px + var(--hp-unified-menu-meta) + 33px);
    min-height: 0;
  }
  body[data-hp] .hp-header-menu {
    --hp-header-max-rows: var(--hp-unified-menu-rows);
    box-sizing: border-box; flex: 0 0 auto; align-content: flex-start; gap: 6px;
    height: calc(var(--hp-unified-menu-rows) * var(--hp-unified-menu-row) + (var(--hp-unified-menu-rows) - 1) * 6px);
    min-height: 0; margin: 0; padding: 0;
  }
  body[data-hp] .hp-header-menu > a {
    box-sizing: border-box; min-height: var(--hp-unified-menu-row); height: var(--hp-unified-menu-row);
    margin: 0; padding: 7px 8px; font-size: 15px; line-height: 1.25;
    align-items: center; justify-content: center;
  }
  body[data-hp] .hp-header-meta { box-sizing: border-box; flex: 0 0 auto; height: var(--hp-unified-menu-meta); min-height: var(--hp-unified-menu-meta); gap: 8px; }
  body[data-hp] .hp-header-meta > .hp-page-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
  html.hp-field-numbering body[data-hp] .hp-header-meta > .hp-menu-pagination { grid-template-columns: minmax(0,1fr) minmax(30px,.8fr) minmax(0,1fr); flex-basis: 360px; }
  html.hp-field-numbering body[data-hp] .hp-header-meta > .hp-menu-pagination button {
    display: flex; flex-direction: column; gap: 0; width: 100%; min-width: 0;
    height: var(--hp-unified-menu-meta); min-height: var(--hp-unified-menu-meta); padding: 2px;
  }
  html.hp-field-numbering body[data-hp] .hp-header-meta > .hp-menu-pagination button::after {
    min-width: 0; margin: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; word-break: break-all;
  }
  body[data-hp] main.hp-content { padding: 24px; min-width: 0; }
  body[data-hp] main.hp-content > .hp-unified-header {
    box-sizing: border-box; display: grid;
    grid-template-columns: var(--hp-head-crest-slot) minmax(0,1fr) var(--hp-head-crest-slot);
    grid-template-rows: var(--hp-unified-copy); gap: 20px; align-items: center;
    width: 100%; min-width: 0; height: calc(var(--hp-unified-copy) + 42px);
    min-height: 0; margin: 0 0 24px; padding: 20px;
  }
  body[data-hp] main.hp-content > .hp-unified-header > .hp-unified-copy {
    grid-column: 2; grid-row: 1; display: grid; min-width: 0; width: 100%;
    height: var(--hp-unified-copy); margin: 0; padding: 0;
    grid-template-rows: var(--hp-unified-kicker) var(--hp-unified-title) var(--hp-unified-subtitle) var(--hp-unified-actions);
  }
  .hp-unified-copy > .hp-unified-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; width: 100%; text-align: center; }
  body[data-hp] main.hp-content > .hp-unified-header .hp-unified-slot > * { box-sizing: border-box; max-width: 100%; margin: 0; }
  body[data-hp] main.hp-content > .hp-unified-header h1 {
    width: 100%; font-size: var(--hp-head-title-size); font-weight: 700; line-height: 1.2;
    text-align: center; text-wrap: balance; overflow-wrap: anywhere; hyphens: auto;
  }
  body[data-hp] main.hp-content > .hp-unified-header .hp-unified-kicker > * { font-size: 12px; line-height: 1.3; }
  body[data-hp] main.hp-content > .hp-unified-header .hp-unified-subtitle > * { font-size: 16px; line-height: 1.4; }
  body[data-hp] main.hp-content > .hp-unified-header .hp-unified-actions > * { font-size: 14px; line-height: 1.3; }
  body[data-hp] main.hp-content > .hp-unified-header > .bh-crest { grid-column: 1; grid-row: 1; width: var(--hp-head-crest-slot); height: var(--hp-head-crest-height); margin: 0; }
  body[data-hp] main.hp-content > .hp-unified-header > .bh-crest:last-child { grid-column: 3; }
  .hp-unified-content { display: flow-root; min-width: 0; }
  .hp-unified-content > :first-child { margin-top: 0; }
  body.hp-embedded-widget[data-hp] main.hp-content > .hp-unified-header { display: none; }
  body.hp-embedded-widget[data-hp] main.hp-content { padding: 12px; }
}
@media screen and (max-width:1200px) {
  body[data-hp] { --hp-head-crest-slot: 104px; --hp-head-crest-height: 104px; --hp-head-title-size: 28px; }
}
@media screen and (max-width:800px) {
  body[data-hp] { --hp-unified-topbar: calc(128px + var(--hp-unified-tool-extra)); }
  body[data-hp] .hp-topbar { grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; padding: 10px 14px; }
  body[data-hp] .hp-brand-logo { width: 32px; height: 40px; }
  body[data-hp] .hp-tools { grid-column: 1/-1; width: 100%; gap: 8px; }
  body[data-hp] .hp-tools select { height: 34px; min-height: 34px; }
  body[data-hp] .hp-sectionbar { padding: 12px 16px; }
  body[data-hp] main.hp-content { padding: 16px; }
}
@media screen and (max-width:800px) {
  html.hp-field-numbering body[data-hp] { --hp-unified-topbar: calc(212px + var(--hp-unified-tool-extra)); }
  html.hp-field-numbering body[data-hp] .hp-topbar { grid-template-rows: 56px auto auto; align-content: center; }
  html.hp-field-numbering body[data-hp] .hp-brand { grid-column: 1/-1; grid-row: 1; }
  html.hp-field-numbering body[data-hp] #hp-nav-toggle { grid-column: 1/-1; grid-row: 2; justify-self: end; max-width: 100%; }
  html.hp-field-numbering body[data-hp] .hp-tools { grid-column: 1/-1; grid-row: 3; }
}
@media screen and (max-width:640px) {
  body[data-hp] { --hp-unified-menu-rows: 1; --hp-head-crest-slot: 52px; --hp-head-crest-height: 52px; --hp-head-title-size: 22px; }
  body[data-hp] .hp-sectionbar { padding-inline: 12px; }
  body[data-hp] main.hp-content { padding: 12px; }
  body[data-hp] main.hp-content > .hp-unified-header {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    grid-template-rows: 52px var(--hp-unified-copy); gap: 8px 12px;
    height: calc(52px + var(--hp-unified-copy) + 34px); padding: 12px;
  }
  body[data-hp] main.hp-content > .hp-unified-header > .hp-unified-copy { grid-column: 1/-1; grid-row: 2; }
  body[data-hp] main.hp-content > .hp-unified-header > .bh-crest:last-child { grid-column: 2; }
  html.hp-field-numbering body[data-hp] .hp-header-meta > .hp-page-title { flex-basis: 70px; font-size: 12px; }
}
@media print {
  .hp-unified-header { display: grid; grid-template-columns: 60px minmax(0,1fr) 60px; gap: 16px; align-items: center; height: auto; margin: 0 0 8mm; padding: 0; }
  .hp-unified-header > .bh-crest { width: 60px; height: 66px; margin: 0; }
  .hp-unified-header > .bh-crest img { position: static; width: 60px; height: 66px; max-width: 60px; max-height: 66px; object-fit: contain; }
  .hp-unified-copy { display: block; }
  .hp-unified-slot:empty { display: none; }
}
