/* osir.co.uk: UPS & Battery Backup Runtime Calculator and Equipment Running Cost Calculator */

/* Device rows (shared by both tools) */
.pd-rows { display: grid; gap: 10px; margin-top: 12px; }
.pd-row { display: grid; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.pd-row-top { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.pd-row-top .t-select { min-width: 0; text-overflow: ellipsis; }
.pd-row-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.pd-row-nums .t-field > span { font-size: 12px; }
.pd-row-nums .t-input { height: 38px; font-size: 14px; padding: 0 10px; }
.pd-row .t-select, .pd-row .t-input { background: var(--surface-solid); }
.pd-note { font-size: 12.5px; color: var(--muted); }
.pd-total { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--brand-1) 7%, transparent); font-size: 14px; color: var(--text-2); }
.pd-total b { color: var(--text); font-variant-numeric: tabular-nums; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pd-h3 { margin-top: 22px; font-size: 16px; font-weight: 750; }
.pd-link { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

/* UPS: runtime by year */
.ups-years { display: grid; gap: 8px; margin-top: 14px; }
.ups-year { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.ups-year span:first-child { color: var(--text-2); font-weight: 650; }
.ups-track { height: 12px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; position: relative; }
.ups-track i { display: block; height: 100%; min-width: 2px; border-radius: 0 5px 5px 0; background: #16a34a; }
.ups-track i.is-warn { background: #d97706; }
.ups-track i.is-bad { background: #dc2626; }
.ups-track b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .55; }
.ups-year-val { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; min-width: 74px; }
.ups-legend { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* Sortable comparison table */
.ups-sort { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-align: left; white-space: nowrap; }
.ups-sort:hover { color: var(--link); }
.ups-pick { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--link); cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.ups-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.ups-table td { vertical-align: top; }
.ups-table td.ups-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ups-filter { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 10px; }
.ups-filter .t-field { flex: 0 1 260px; }
.ups-spec { margin-top: 12px; }
.ups-spec td:first-child { color: var(--muted); width: 42%; }

@media (max-width: 560px) {
  .ups-year { grid-template-columns: 84px minmax(0, 1fr) auto; gap: 8px; font-size: 13px; }
  .ups-year-val { min-width: 0; }
  .pd-row-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pd-row { padding: 10px; }
}

/* Running cost table */
#rc-table td.rc-num, #rc-table th.rc-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#rc-table tfoot th, #rc-table tfoot td { font-weight: 750; border-top: 2px solid var(--border-strong); }
.ups-table td:nth-child(2) { min-width: 170px; }
.ups-table td:nth-child(5) { min-width: 120px; }
#ups-rec-tiles .u-tile b { font-size: 16px; }
