/* v1.3.255 — single authoritative Odstupy central-column and content-edge contract.
   Header, main rows, subtable header and subtable rows consume the same tokens.
   No local column width is introduced here. */
#facade-table {
  --od-wide: var(--pbs-column-extra-wide, 112px);
  --od-standard: var(--pbs-column-regular, 88px);
  --od-c1: var(--od-wide);      /* Dĺžka / šírka */
  --od-c2: var(--od-wide);      /* Výška */
  --od-c3: var(--od-standard);  /* p / parapet */
  --od-c4: var(--pbs-column-half, 44px); /* Otv / počet */
  --od-c5: var(--od-standard);  /* Plocha */
  --od-c6: var(--od-standard);  /* Otvory */
  --od-c7: var(--od-standard);  /* Fasáda */
  --od-c8: var(--od-standard);  /* Odstup */
  --od-central-cell-pad: 4px;
  --od-middle: calc(
    var(--od-c1) + var(--od-c2) + var(--od-c3) + var(--od-c4) +
    var(--od-c5) + var(--od-c6) + var(--od-c7) + var(--od-c8)
  );
}

/* Header labels and every main row use the identical eight tracks. */
#facade-table .facade-zone-middle-grid {
  display: grid !important;
  grid-template-columns:
    var(--od-c1) var(--od-c2) var(--od-c3) var(--od-c4)
    var(--od-c5) var(--od-c6) var(--od-c7) var(--od-c8) !important;
  gap: 0 !important;
  width: var(--od-middle) !important;
  min-width: var(--od-middle) !important;
  max-width: var(--od-middle) !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
#facade-table .facade-zone-middle-grid > * {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-left: var(--od-central-cell-pad) !important;
  padding-right: var(--od-central-cell-pad) !important;
  box-sizing: border-box !important;
}

/* Requested header alignment. */
#facade-table .facade-zone-header .facade-zone-middle-grid > :nth-child(3),
#facade-table .facade-zone-header .facade-zone-middle-grid > :nth-child(4) {
  text-align: center !important;
  justify-content: center !important;
}
#facade-table .facade-zone-header .facade-zone-middle-grid > :nth-child(7) {
  text-align: right !important;
  justify-content: flex-end !important;
}

/* The nested table is a physical projection of the same tracks:
   left | 112 | 112 | 88 | 88 | 88 | 88 | 88 | 88 | right. */
#facade-table .opening-table {
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
#facade-table .opening-table > colgroup > col:nth-child(2),
#facade-table .opening-table > thead > tr > :nth-child(2),
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(2) {
  width: var(--od-c1) !important; min-width: var(--od-c1) !important; max-width: var(--od-c1) !important;
}
#facade-table .opening-table > colgroup > col:nth-child(3),
#facade-table .opening-table > thead > tr > :nth-child(3),
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(3) {
  width: var(--od-c2) !important; min-width: var(--od-c2) !important; max-width: var(--od-c2) !important;
}
#facade-table .opening-table > colgroup > col:nth-child(4),
#facade-table .opening-table > thead > tr > :nth-child(4),
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(4) {
  width: var(--od-c3) !important; min-width: var(--od-c3) !important; max-width: var(--od-c3) !important;
}
#facade-table .opening-table > colgroup > col:nth-child(5),
#facade-table .opening-table > thead > tr > :nth-child(5),
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(5) {
  width: var(--od-c4) !important; min-width: var(--od-c4) !important; max-width: var(--od-c4) !important;
}
#facade-table .opening-table > colgroup > col:nth-child(6),
#facade-table .opening-table > thead > tr > :nth-child(6),
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(6) {
  width: var(--od-c5) !important; min-width: var(--od-c5) !important; max-width: var(--od-c5) !important;
}
#facade-table .opening-table > colgroup > col:nth-child(7),
#facade-table .opening-table > thead > tr > :nth-child(7),
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(7) {
  width: var(--od-c6) !important; min-width: var(--od-c6) !important; max-width: var(--od-c6) !important;
}
#facade-table .opening-table > colgroup > col:nth-child(8),
#facade-table .opening-table > thead > tr > :nth-child(8),
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(8) {
  width: var(--od-c7) !important; min-width: var(--od-c7) !important; max-width: var(--od-c7) !important;
}
#facade-table .opening-table > colgroup > col:nth-child(9),
#facade-table .opening-table > thead > tr > :nth-child(9),
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(9) {
  width: var(--od-c8) !important; min-width: var(--od-c8) !important; max-width: var(--od-c8) !important;
}

/* Identical cell box model prevents right-aligned values from appearing shifted
   even when their numerical track widths are already equal. */
#facade-table .opening-table > thead > tr > :nth-child(n+2):nth-child(-n+9),
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(n+2):nth-child(-n+9) {
  padding-left: var(--od-central-cell-pad) !important;
  padding-right: var(--od-central-cell-pad) !important;
  box-sizing: border-box !important;
}

/* Openings-area is central track 6: child 6 in main grids, cell 7 in subtables. */
#facade-table .facade-zone-middle-grid > :nth-child(6),
#facade-table .opening-table > thead > tr > :nth-child(7),
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(7) {
  text-align: right !important;
  justify-content: flex-end !important;
}
#facade-table .facade-zone-middle-grid > :nth-child(6) > *,
#facade-table .opening-table > thead > tr > :nth-child(7) > *,
#facade-table .opening-table > tbody > tr:not(.opening-add-row) > :nth-child(7) > * {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: right !important;
  justify-content: flex-end !important;
  box-sizing: border-box !important;
}
#facade-table .opening-table .opening-area-value {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
