/*
 * PBS unified table header geometry — v1.3.267
 * One visual contract for main-table and subtable headers in every mode.
 */
:root {
  --pbs-table-header-height: var(--pbs-table-row-height);
  --pbs-table-header-padding-block: var(--pbs-table-cell-padding-block);
  --pbs-table-header-radius: var(--pbs-table-corner-radius);
}

/* Main table roots used by all current modes. */
:is(
  #main-table.fire-hazard-zoned-table,
  #size-table.fire-hazard-zoned-table,
  #fc-table.fc-zoned-table,
  #main-table.openings-zoned-table,
  #facade-table.facade-zoned-table,
  #main-table.boundary-zoned-table,
  table.subtable,
  table.room-subtable,
  table.openings-table,
  table.opening-table,
  table.segment-table,
  table.facade-table,
  table.fc-subtable,
  table.fc-room-table,
  table.room-table
) {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: var(--pbs-table-header-radius) !important;
  overflow: hidden !important;
}

/* The header row itself always has the central row height. */
:is(
  #main-table.fire-hazard-zoned-table,
  #size-table.fire-hazard-zoned-table,
  #fc-table.fc-zoned-table,
  #main-table.openings-zoned-table,
  #facade-table.facade-zoned-table,
  #main-table.boundary-zoned-table,
  table.subtable,
  table.room-subtable,
  table.openings-table,
  table.opening-table,
  table.segment-table,
  table.facade-table,
  table.fc-subtable,
  table.fc-room-table,
  table.room-table
) > thead > tr:first-child {
  height: var(--pbs-table-header-height) !important;
  min-height: var(--pbs-table-header-height) !important;
  max-height: var(--pbs-table-header-height) !important;
}

/* Header cells cannot add their own vertical size. */
:is(
  #main-table.fire-hazard-zoned-table,
  #size-table.fire-hazard-zoned-table,
  #fc-table.fc-zoned-table,
  #main-table.openings-zoned-table,
  #facade-table.facade-zoned-table,
  #main-table.boundary-zoned-table,
  table.subtable,
  table.room-subtable,
  table.openings-table,
  table.opening-table,
  table.segment-table,
  table.facade-table,
  table.fc-subtable,
  table.fc-room-table,
  table.room-table
) > thead > tr:first-child > th {
  height: var(--pbs-table-header-height) !important;
  min-height: var(--pbs-table-header-height) !important;
  max-height: var(--pbs-table-header-height) !important;
  padding-top: var(--pbs-table-header-padding-block) !important;
  padding-bottom: var(--pbs-table-header-padding-block) !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  overflow: hidden !important;
}

/* Header grids/wrappers fill the available 28 px content area without adding padding. */
:is(
  #main-table.fire-hazard-zoned-table,
  #size-table.fire-hazard-zoned-table,
  #fc-table.fc-zoned-table,
  #main-table.openings-zoned-table,
  #facade-table.facade-zoned-table,
  #main-table.boundary-zoned-table,
  table.subtable,
  table.room-subtable,
  table.openings-table,
  table.opening-table,
  table.segment-table,
  table.facade-table,
  table.fc-subtable,
  table.fc-room-table,
  table.room-table
) > thead > tr:first-child > th > :is(
  div, span, .header-grid, .header-cell, .header-content,
  .fh-middle-grid, .fire-load-header-grid,
  .fc-middle-grid, .fc-header-grid,
  .facade-zone-middle-grid, .openings-zone-middle-grid,
  .boundary-zone-middle-grid
) {
  min-height: 0 !important;
  max-height: 100% !important;
  height: 100% !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
  align-items: center !important;
}

/* Header controls use the same central control height and no extra vertical margins. */
:is(
  #main-table.fire-hazard-zoned-table,
  #size-table.fire-hazard-zoned-table,
  #fc-table.fc-zoned-table,
  #main-table.openings-zoned-table,
  #facade-table.facade-zoned-table,
  #main-table.boundary-zoned-table,
  table.subtable,
  table.room-subtable,
  table.openings-table,
  table.opening-table,
  table.segment-table,
  table.facade-table,
  table.fc-subtable,
  table.fc-room-table,
  table.room-table
) > thead :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .unit-input-wrapper, .metric-input-shell) {
  height: var(--pbs-table-control-height) !important;
  min-height: var(--pbs-table-control-height) !important;
  max-height: var(--pbs-table-control-height) !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}

/* Explicitly expose identical rounded upper corners in every mode. */
:is(
  #main-table.fire-hazard-zoned-table,
  #size-table.fire-hazard-zoned-table,
  #fc-table.fc-zoned-table,
  #main-table.openings-zoned-table,
  #facade-table.facade-zoned-table,
  #main-table.boundary-zoned-table,
  table.subtable,
  table.room-subtable,
  table.openings-table,
  table.opening-table,
  table.segment-table,
  table.facade-table,
  table.fc-subtable,
  table.fc-room-table,
  table.room-table
) > thead > tr:first-child > th:first-child {
  border-top-left-radius: var(--pbs-table-header-radius) !important;
}

:is(
  #main-table.fire-hazard-zoned-table,
  #size-table.fire-hazard-zoned-table,
  #fc-table.fc-zoned-table,
  #main-table.openings-zoned-table,
  #facade-table.facade-zoned-table,
  #main-table.boundary-zoned-table,
  table.subtable,
  table.room-subtable,
  table.openings-table,
  table.opening-table,
  table.segment-table,
  table.facade-table,
  table.fc-subtable,
  table.fc-room-table,
  table.room-table
) > thead > tr:first-child > th:last-child {
  border-top-right-radius: var(--pbs-table-header-radius) !important;
}
