/**
 * Beam Comparison Tool — Zekelman Industries style tokens
 * Colors & status palette: https://www.zekelman.com/style-guide/
 * Layout tuned for dense, single-viewport dashboard use.
 */
:root {
  /* Theme (style guide) */
  --zk-primary: #e51837;
  --zk-primary-dark: #901903;
  --zk-primary-hover: #ff2b4b;
  --zk-primary-active: #c30824;
  --zk-secondary: #00bad3;
  --zk-secondary-dark: #007383;
  --zk-black: #000000;
  --zk-gray: #6a6a6c;
  --zk-lightgray: #cecfd1;
  --zk-white: #ffffff;
  /* Base */
  --zk-base: #2e2e2e;
  --zk-base-emphasis: #000000;
  --zk-base-muted: #6a6a6c;
  --zk-base-subtle: #cecfd1;
  --zk-base-canvas: #ffffff;
  /* Status (style guide) */
  --zk-success: #22c55e;
  --zk-success-muted: #16a34a;
  --zk-info-emphasis: #3b82f6;
  --zk-info-muted: #2e65bf;
  --zk-warning-muted: #ca8a04;
  --zk-error-emphasis: #dc2626;
  /* App shell */
  --zk-page: #f0f1f3;
  --zk-canvas: var(--zk-base-canvas);
  --zk-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --zk-radius: 8px;
  --zk-radius-sm: 6px;
  --zk-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
  --zk-shadow-topbar: 0 1px 0 rgba(0, 0, 0, 0.04);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* html {
  font-size: 15px;
} */

/* body {
  margin: 0;
  font-family: var(--zk-font-sans);
  font-size: 0.875rem;
  color: var(--zk-base);
  background: var(--zk-page);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
} */

.zk-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
}

.zk-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--zk-canvas);
  border-bottom: 1px solid var(--zk-base-subtle);
  box-shadow: var(--zk-shadow-topbar);
}

.zk-topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.zk-topbar__icon {
  color: var(--zk-primary);
  display: flex;
  align-items: center;
}

.zk-topbar__icon svg {
  width: 17px;
  height: 17px;
}

.zk-topbar__name {
  font-weight: 600;
  font-size: 1.625rem;
  color: var(--zk-base);
  letter-spacing: -0.01em;
}

.zk-topbar__tag {
  font-size: 1.5rem;
  color: var(--zk-base-muted);
}

.zk-calc {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 0.75rem 0.65rem;
  width: 100%;
}

.zk-page-hero {
  text-align: center;
  margin-bottom: 0.45rem;
  padding: 0 0.25rem;
}

.zk-page-hero__title {
  margin: 0;
  font-size: clamp(2.2rem, 4.4vw, 2.56rem);
  font-weight: 700;
  color: var(--zk-base);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.zk-phi {
  font-style: normal;
  font-family: inherit;
}

.zk-dashboard {
  display: grid;
  gap: 0.65rem;
  align-items: start;
}

@media (min-width: 920px) {
  .zk-dashboard {
    grid-template-columns: minmax(220px, 252px) minmax(0, 1fr);
  }
}

.zk-card {
  background: var(--zk-canvas);
  border-radius: var(--zk-radius);
  box-shadow: var(--zk-shadow-card);
  border: 1px solid var(--zk-lightgray);
}

.zk-sidebar {
  padding: 0.65rem 0.7rem;
  position: sticky;
  top: 0.5rem;
}

.zk-sidebar__intro {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--zk-base-subtle);
}

.zk-sidebar__intro-icon {
  color: var(--zk-base-muted);
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.zk-sidebar__intro-icon svg {
  width: 15px;
  height: 15px;
}

.zk-sidebar__heading {
  margin: 0;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--zk-base);
}

.zk-sidebar__sub {
  margin: 0.1rem 0 0;
  font-size: 1.375rem;
  color: var(--zk-base-muted);
  line-height: 1.35;
}

.zk-calc__grid {
  display: grid;
  gap: 0.55rem;
}

.zk-sidebar__actions {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.zk-sidebar__actions .zk-btn--primary {
  width: 100%;
}

.zk-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.zk-field__label {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--zk-base);
  letter-spacing: 0.01em;
}

.zk-field__hint {
  font-size: 1.25rem;
  color: var(--zk-base-muted);
  line-height: 1.35;
}

.zk-field input,
.zk-field select {
  font: inherit;
  font-size: 1.625rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--zk-base-subtle);
  border-radius: var(--zk-radius-sm);
  min-height: 2rem;
  color: var(--zk-base);
  background: var(--zk-canvas);
}

.zk-field input:focus,
.zk-field select:focus {
  outline: 2px solid var(--zk-secondary);
  outline-offset: 1px;
  border-color: var(--zk-secondary-dark);
}

.zk-field input[readonly] {
  background: var(--zk-page);
  color: var(--zk-base-muted);
  cursor: not-allowed;
}

.zk-field input[readonly]:focus {
  outline-color: var(--zk-base-subtle);
  border-color: var(--zk-base-subtle);
}

.zk-bracing-radios {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--zk-base-subtle);
  border-radius: var(--zk-radius-sm);
  background: var(--zk-page);
}

.zk-bracing-option {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.35rem 0.4rem;
  border-radius: var(--zk-radius-sm);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1.35;
  color: var(--zk-base);
  transition: background 0.12s ease;
}

.zk-bracing-option:hover {
  background: rgba(0, 0, 0, 0.04);
}

.zk-bracing-option:has(input:checked) {
  background: rgba(185, 48, 42, 0.08);
  outline: 1px solid var(--zk-primary-dark);
  outline-offset: -1px;
}

.zk-bracing-option input[type="radio"] {
  flex-shrink: 0;
  margin: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--zk-primary-dark);
  cursor: pointer;
}

.zk-bracing-option__label {
  flex: 1;
  min-width: 0;
}

.zk-bracing-option__pct {
  font-weight: 700;
}

.zk-btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: var(--zk-radius-sm);
  border: none;
  cursor: pointer;
  font-size: 1.625rem;
}

.zk-btn--large {
  font-size: 1.625rem;
}

.zk-btn--primary {
  background: var(--zk-primary);
  color: var(--zk-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.zk-btn--primary:hover {
  background: var(--zk-primary-hover);
}

.zk-btn--primary:active {
  background: var(--zk-primary-active);
}

.zk-btn__icon {
  display: flex;
  opacity: 1;
}

.zk-btn__icon svg {
  width: 15px;
  height: 15px;
}

.zk-btn--ghost {
  background: transparent;
  border: 1px solid var(--zk-base-subtle);
  color: var(--zk-base-muted);
}

.zk-btn--ghost:hover {
  border-color: var(--zk-gray);
  color: var(--zk-base);
}

.zk-calc__status {
  margin: 0.45rem 0 0;
  font-size: 1.375rem;
  color: var(--zk-base-muted);
  min-height: 1rem;
  line-height: 1.35;
}

.zk-calc__status--error {
  color: var(--zk-error-emphasis);
}

.zk-main {
  min-width: 0;
}

.zk-main--stack {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.zk-summary-strip {
  padding: 0.5rem 0.65rem;
  background: #e8e9ec;
  border-radius: var(--zk-radius);
  border: 1px solid var(--zk-lightgray);
}

.zk-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.65rem;
  align-items: start;
}

@media (min-width: 800px) {
  .zk-summary-grid {
    grid-template-columns: minmax(7.5rem, 1.15fr) repeat(4, minmax(0, 1fr));
    align-items: center;
  }
}

/* Wide flange designation in summary strip — larger than metric labels */
.zk-sum-wf-head {
  margin: 0;
  line-height: 1.2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.35rem;
}

.zk-sum-wf-head__name {
  font-size: 2.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--zk-base-emphasis);
  font-variant-numeric: tabular-nums;
  text-transform: none;
}

.zk-sum-wf-head__tag {
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--zk-base-muted);
}

.zk-sum-item {
  min-width: 0;
}

.zk-sum-item__label {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--zk-base-muted);
}

.zk-sum-item__value {
  margin: 0.05rem 0 0;
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--zk-base);
  line-height: 1.2;
}

.zk-sum-item__num--accent {
  color: var(--zk-info-muted);
  font-size: 1.875rem;
}

.zk-sum-item__unit-inline {
  margin-left: 0.15rem;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--zk-base-muted);
}

.zk-sum-item__badge-wrap {
  margin: 0.1rem 0 0;
}

/* Utilization badge — info accent, square pill per dashboard reference */
.zk-metric__badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-weight: 700;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--zk-white);
  background: var(--zk-info-muted);
  border-radius: 4px;
}

.zk-metric__badge--muted {
  background: var(--zk-lightgray);
  color: var(--zk-base-muted);
}

.zk-metric__badge.zk-metric__badge--long {
  font-size: 0.6875rem;
  line-height: 1.25;
  max-width: 12rem;
  white-space: normal;
  text-align: center;
  padding: 0.25rem 0.45rem;
}

.zk-metric__badge--good {
  background: var(--zk-success-muted);
  color: var(--zk-white);
}

.zk-metric__badge--warn {
  background: #ca8a04;
  color: var(--zk-white);
}

.zk-metric__badge--bad {
  background: var(--zk-error-emphasis);
  color: var(--zk-white);
}

.zk-muted {
  color: var(--zk-base-muted);
  font-size: 1.625rem;
  margin: 0 0 0.65rem;
}

.zk-kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.625rem;
}

.zk-kv th,
.zk-kv td {
  text-align: left;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--zk-base-subtle);
  vertical-align: top;
}

.zk-kv th {
  width: 42%;
  font-weight: 600;
  color: var(--zk-base-muted);
}

.zk-hss-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.zk-hss-panels-stacked {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.zk-hss-block {
  padding-top: 0.35rem;
  border-top: 1px solid var(--zk-base-subtle);
}

.zk-hss-block:first-of-type {
  padding-top: 0;
  border-top: none;
}

.zk-hss-block__title {
  margin: 0 0 0.2rem;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--zk-base);
  letter-spacing: -0.01em;
}

.zk-hss-block__hint {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  color: var(--zk-base-muted);
  line-height: 1.35;
}

.zk-hss-block__zero-msg {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--zk-base);
  line-height: 1.4;
}

.zk-hss-details {
  margin-top: 0.15rem;
  border-top: 1px solid var(--zk-base-subtle);
  padding-top: 0.45rem;
}

.zk-hss-details__summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.625rem;
  color: var(--zk-base);
  list-style-position: outside;
}

.zk-hss-details[open] .zk-hss-details__summary {
  margin-bottom: 0.35rem;
}

.zk-hss-tabs__bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.zk-hss-tabs__tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  padding: 0.4rem 0.45rem;
  border-radius: var(--zk-radius-sm);
  border: 1px solid var(--zk-lightgray);
  background: #f6f7f8;
  color: var(--zk-base);
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.zk-hss-tabs__tab:hover {
  background: #eef0f2;
}

.zk-hss-tabs__tab[aria-selected="true"] {
  background: var(--zk-canvas);
  border-color: var(--zk-secondary);
  box-shadow: 0 0 0 1px rgba(0, 186, 211, 0.25);
}

.zk-hss-tabs__tab-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.zk-hss-tabs__tab-hint {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--zk-base-muted);
}

.zk-hss-tabs__panel[hidden] {
  display: none;
}

.zk-table-wrap--scroll {
  max-height: min(52vh, 22rem);
  overflow-y: auto;
  overflow-x: auto;
}

.zk-table-wrap--scroll .zk-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px 0 var(--zk-base-subtle);
}

.zk-hss-diag__note {
  font-size: 1.25rem;
  color: var(--zk-base-muted);
  margin: 0 0 0.4rem;
  line-height: 1.4;
}

.zk-hss-diag__note strong {
  font-weight: 600;
  color: var(--zk-base);
}

.zk-table-wrap--diag {
  max-height: min(58vh, 28rem);
}

.zk-data-table--diag {
  font-size: 1.125rem;
}

.zk-data-table--diag th,
.zk-data-table--diag td {
  padding: 0.18rem 0.26rem;
  white-space: nowrap;
}

.zk-result-card {
  padding: 0.55rem 0.6rem 0.45rem;
}

.zk-result-card__head {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin-bottom: 0.4rem;
}

.zk-result-card__icon {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--zk-radius-sm);
  color: var(--zk-base);
}

.zk-result-card__icon svg {
  width: 15px;
  height: 15px;
}

.zk-result-card__icon--lock {
  background: rgba(0, 186, 211, 0.12);
  color: var(--zk-secondary-dark);
}

.zk-result-card__icon--bolt {
  background: rgba(229, 24, 55, 0.1);
  color: var(--zk-primary-dark);
}

.zk-result-card__title {
  margin: 0;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--zk-base);
  line-height: 1.25;
}

.zk-result-card__sub {
  margin: 0.1rem 0 0;
  font-size: 1.25rem;
  color: var(--zk-base-muted);
  line-height: 1.35;
}

.zk-table-wrap {
  overflow-x: auto;
}

.zk-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.375rem;
}

.zk-data-table th,
.zk-data-table td {
  padding: 0.28rem 0.35rem;
  border-bottom: 1px solid var(--zk-base-subtle);
  text-align: left;
  vertical-align: middle;
}

.zk-data-table th {
  background: #f6f7f8;
  font-weight: 600;
  color: var(--zk-base-muted);
}

.zk-data-table__empty {
  text-align: center;
  font-style: italic;
  color: var(--zk-base-muted);
  padding: 0.65rem !important;
}

.zk-badge-best {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.08rem 0.3rem;
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--zk-white);
  background: var(--zk-success-muted);
  border-radius: 3px;
  vertical-align: middle;
}

.zk-util__row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.zk-util__pct {
  font-weight: 600;
  min-width: 2.85rem;
  text-align: right;
  font-size: 1.25rem;
}

.zk-util__pct--good {
  color: var(--zk-success-muted);
}

.zk-util__pct--warn {
  color: #b45309;
}

.zk-util__pct--bad {
  color: var(--zk-error-emphasis);
}

.zk-util__pct--unknown {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
  font-weight: 600;
  font-size: 0.5625rem;
  line-height: 1.25;
  color: var(--zk-base-muted);
}

.zk-util__bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--zk-lightgray);
  overflow: hidden;
  min-width: 32px;
}

.zk-util__fill {
  height: 100%;
  border-radius: 3px;
}

/* Utilization bar: under 90% green, 90–100% yellow, over 100% red */
.zk-util__fill--low {
  background: var(--zk-success-muted);
}

.zk-util__fill--mid {
  background: linear-gradient(90deg, #eab308, var(--zk-warning-muted));
}

.zk-util__fill--high {
  background: var(--zk-error-emphasis);
}

.zk-details {
  margin-top: 0.65rem;
  padding: 0.5rem 0.65rem;
}

.zk-details__summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--zk-base);
  font-size: 1.625rem;
}

.zk-results-scroll {
  max-height: min(50vh, 440px);
  overflow: auto;
  margin-top: 0.5rem;
  border: 1px solid var(--zk-base-subtle);
  border-radius: var(--zk-radius-sm);
}

.zk-results-scroll--wide {
  overflow-x: auto;
}

.zk-results__table--grid {
  min-width: 700px;
}

.zk-results__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.375rem;
}

.zk-results__table th,
.zk-results__table td {
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid var(--zk-base-subtle);
}

.zk-results__table--grid thead th {
  position: sticky;
  top: 0;
  background: var(--zk-canvas);
  z-index: 1;
}

.zk-app-footer {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--zk-base-subtle);
  font-size: 1.25rem;
  color: var(--zk-base-muted);
  text-align: center;
  line-height: 1.45;
}

.zk-app-footer p {
  margin: 0;
}
