/* ==========================================================================
   CLIMATHIC ENERGYCALC - STYLESHEET
   ========================================================================== */

/* Global CSS Variables for default (Climathic) theme */
body {
  --primary-color-rgb: 0, 150, 136;
}

/* ==========================================================================
   SPINNER & PRELOADER OVERRIDES
   Override Materialize spinner colors to use theme primary color
   ========================================================================== */

/* Override teal spinner to use primary color */
.spinner-layer.spinner-teal-only {
  border-color: var(--primary-color, #009688) !important;
}

.spinner-layer.spinner-teal-only .circle {
  border-color: var(--primary-color, #009688) !important;
}

.preloader-wrapper.active .spinner-layer.spinner-teal-only .circle {
  border-color: var(--primary-color, #009688) !important;
}

/* ==========================================================================
   0. EQUIPMENT & DEVICE SELECTION STYLES
   Component styles for equipment configuration, device selection tables,
   and device information modals.
   ========================================================================== */


/* Equipment summary table styling */
.equipment-config-summary {
  background: #f1f5f6;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 0 0 18px 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.equipment-config-summary__title {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--primary-color, #009688);
  margin: 0 0 8px 0;
}




.equipment-config-summary__value {
  font-size: var(--font-size-base);
  color: var(--text-dark, #263238);
  font-weight: 600;
}

body.dark-mode .equipment-config-summary {
  background: rgba(36, 43, 50, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
}


body.dark-mode .equipment-config-summary__value {
  color: #ffffff;
}

.equipment-config-panel {
  margin-bottom: 32px;
  padding: 18px 20px 12px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-lg);
}








body.dark-mode .equipment-config-panel {
  background: rgba(33, 40, 45, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}


body.dark-mode .equipment-config-panel .select-wrapper input.select-dropdown {
  color: #ffffff;
}

@media (max-width: 600px) {
  .equipment-config-panel {
    padding: 16px 14px 10px;
  }
}

/* Manual load input styles */
.equipment-manual-intro {
  font-size: var(--font-size-md);
  color: var(--bluegray-600);
  margin: 0 0 20px 0;
  padding: 12px 16px;
  background: rgba(var(--primary-color-rgb, 0, 150, 136),0.05);
  border-left: 3px solid var(--primary-color);
  border-radius: var(--radius-xs);
}

.equipment-manual-load-group {
  background: #f8f9fa;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.equipment-manual-load-group:hover {
  box-shadow: 0 2px 8px rgba(var(--primary-color-rgb, 0, 150, 136),0.1);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136),0.2);
}




.equipment-manual-input input[type="number"] {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary-color);
  border-bottom: 2px solid rgba(var(--primary-color-rgb, 0, 150, 136),0.3);
}





body.dark-mode .equipment-manual-intro {
  background: rgba(var(--primary-color-rgb, 0, 150, 136),0.15);
  color: var(--bluegray-200);
}

body.dark-mode .equipment-manual-load-group {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.1);
}


body.dark-mode .equipment-manual-input input[type="number"] {
  color: var(--primary-light);
  border-bottom-color: rgba(var(--primary-color-rgb, 0, 150, 136),0.5);
}









.provided-breakdown-total {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: #0d47a1;
  border-bottom: 1px solid rgba(25, 118, 210, 0.15);
  padding-bottom: 4px;
  margin-bottom: 2px;
}




.ventilation-options {
  border-bottom: 1px dashed rgba(0,0,0,0.25);
}

#ventLimit4mWrap.config-option {
  padding-left: var(--space-md);
}

.ventilation-winter-fields {
  margin-left: var(--space-md);
  margin-top: var(--space-xs);
}

.ventilation-winter-row {
  margin-bottom: var(--space-xs);
}

/* Device selection summary & tables */
#results-area #devicesPanel > .chart-header {
  display: none;
}


.device-summary-empty {
  padding: var(--space-sm);
  color: #666666;
}

/* Equipment Sizing area responsiveness */


/* Fixed width container to prevent table expansion */
#equipmentStagingArea .chart-panel.equipment-selection-card {
  overflow: visible;
}

/* All device selection tables MUST not expand container width */
#equipmentStagingArea .summary-table,
#equipmentStagingArea .device-selection-table,
#equipmentStagingArea .air-curtain-table {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
}

/* Horizontal scroll for device selection tables - scrollbar only when needed */
.equipment-selection-card .summary-table-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

/* Hide scrollbar when not needed, show on hover/scroll */
.equipment-selection-card .summary-table-wrapper::-webkit-scrollbar {
  height: 6px;
  background: transparent;
}

.equipment-selection-card .summary-table-wrapper::-webkit-scrollbar-track {
  background: transparent;
  border-radius: var(--radius-xs);
}

.equipment-selection-card .summary-table-wrapper::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: var(--radius-xs);
  transition: background 0.2s;
}

.equipment-selection-card .summary-table-wrapper:hover::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

.equipment-selection-card .summary-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

body.dark-mode .equipment-selection-card .summary-table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

body.dark-mode .equipment-selection-card .summary-table-wrapper::-webkit-scrollbar-thumb {
  background: transparent;
}

body.dark-mode .equipment-selection-card .summary-table-wrapper:hover::-webkit-scrollbar-thumb {
  background: #555;
}

body.dark-mode .equipment-selection-card .summary-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* Ensure tables in equipment area are responsive */
#equipmentStagingArea table {
  width: 100%;
  table-layout: fixed;
}

/* Device name block - allow text selection */
.device-name-block,
.device-name-block .device-type,
.device-name-block .device-manufacturer,
.device-name-block .device-model,
.device-selection-name {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  cursor: text;
}

/* Device name column - constrain width and truncate overflow */
.devices-tables td.col-device,
.device-selection-table td.col-device,
.air-curtain-table td.col-device {
  max-width: 320px;
  /* Allow tags to wrap - don't hide overflow */
}


/* Location search under map */
.location-search-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 180px;
  background: rgba(255,255,255,0.58);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  z-index: var(--z-appbar); /* above map tiles */
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(4px);
}
#locationSearchInput {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.85);
  color: inherit;
  font-size: var(--font-size-xs);
  height: 28px;
  line-height: 16px;
}
.location-search-buttons #locationGeolocateBtn { order: 1; }
.location-search-buttons #locationSearchBtn { order: 2; }

/* Dark mode adjustments */
body.dark-mode .location-search-bar {
  background: rgba(30, 30, 30, 0.50);
  border-color: var(--text-dark);
}

body.dark-mode #locationSearchInput {
  background: rgba(40, 40, 40, 0.85);
  border-color: var(--text-dark);
  color: var(--gray-200);
}
/* When map fullscreen, keep search accessible pinned at top */
#map-container.fullscreen .location-search-bar {
  top: 10px;
  left: 10px;
  width: 180px;
  background: rgba(255,255,255,0.50);
}
body.dark-mode #map-container.fullscreen .location-search-bar { background: rgba(30,30,30,0.45); }

/* Position Leaflet zoom controls under our fullscreen button (top-right) */
 /* hide default top-left */

/* Custom styling for Leaflet zoom buttons to match search bar transparency */
.leaflet-control-zoom a {
  background: rgba(255,255,255,0.58) !important;
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-color);
  color: #111 !important;
  width: 34px;
  height: 34px;
  line-height: 32px;
  font-size: 20px;
  font-weight: 500;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md);
}

/* PDF download loader */
.pdf-download-loader {
  position: fixed;
  bottom: 24px;
  right: 24px;
  /* Must sit above the Materialize modal overlay (.modal-overlay, z-index 4000
     with backdrop-filter: blur) and the modal itself (z-index 5000). The report
     modal stays open during generation, so a loader below the overlay would be
     blurred by the overlay's backdrop-filter. 6000 keeps it sharp on top. */
  z-index: var(--z-popover);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pdf-download-loader.is-active {
  opacity: 1;
  pointer-events: auto;
}

.pdf-download-loader__panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.18);
  box-shadow: var(--shadow-xl);
}

body.dark-mode .pdf-download-loader__panel {
  background: rgba(26, 36, 48, 0.95);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.35);
  color: #fff;
}

.pdf-download-loader__label {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--primary-dark, #004d40);
}

body.dark-mode .pdf-download-loader__label {
  color: #a5d6d3;
}

body.dark-mode .leaflet-control-zoom a {
  background: rgba(30,30,30,0.50) !important;
  color: var(--gray-200) !important;
  border-color: var(--text-dark);
}
.leaflet-control-zoom a:hover {
  background: rgba(255,255,255,0.72) !important;
}
body.dark-mode .leaflet-control-zoom a:hover {
  background: rgba(45,45,45,0.60) !important;
}

/* Ensure zoom control sits above map overlays and is not obscured */

/* Slight spacing between + and - buttons */

/* Override any min-width from inline styles on smaller screens (air-curtain-table excluded – keeps its 800px floor) */
@media screen and (max-width: 1200px) {
  #equipmentStagingArea table[style*="min-width"]:not(.air-curtain-table) {
    min-width: 100% !important;
  }
}

@media screen and (max-width: 992px) {
  #equipmentStagingArea {
    padding: 0;
  }
  
  #equipmentStagingArea table {
    font-size: 0.9rem;
  }
  
  #equipmentStagingArea .device-modulation-cell {
    min-width: 140px;
  }
  
  #equipmentStagingArea th,
  #equipmentStagingArea td {
    padding: 10px 8px;
  }
}

@media screen and (max-width: 600px) {
  #equipmentStagingArea {
    padding: 0;
  }
  
  #equipmentStagingArea table {
    font-size: var(--font-size-sm);
  }
  
  #equipmentStagingArea th,
  #equipmentStagingArea td {
    padding: 8px 4px;
  }
  
  #equipmentStagingArea .device-modulation-cell {
    min-width: 120px;
  }
}



.devices-tables .device-choice-control input.with-gap + span::before,
.devices-tables .device-choice-control input.with-gap + span::after {
  margin: 0;
}

.devices-tables .modulation-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  min-width: 160px;
}

/* Keep Nastawa controls visually consistent across all device rows. */

.devices-tables .device-modulation-cell .modulation-control > .modulation-stage-control {
  width: 100%;
  justify-content: center;
}

.devices-tables .device-modulation-cell .modulation-control > .modulation-range,
.devices-tables .device-modulation-cell .modulation-control > .modulation-output,
.devices-tables .device-modulation-cell .modulation-control > .modulation-stage-detail {
  width: 100%;
  text-align: center;
}



.devices-tables .modulation-stage-button {
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: inherit;
  width: 28px;
  height: 24px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}


.devices-tables .modulation-stage-display {
  min-width: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 600;
}

.devices-tables .modulation-percent-input {
  width: 64px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: inherit;
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  text-align: right;
  font-weight: 600;
}

.devices-tables .modulation-percent-input:focus {
  outline: 2px solid rgba(25, 118, 210, 0.6);
  outline-offset: 1px;
}



/* Hide operating range in Nastawa column of selection tables */
.device-selection-table .modulation-range,
.device-selection-table .modulation-airflow-range,
.air-curtain-table .modulation-range,
.air-curtain-table .modulation-airflow-range {
  display: none;
}

.devices-tables .device-selection-option,
.device-selection-table .device-selection-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 100%;
}

.devices-tables .device-checkbox-label,
.device-selection-table .device-checkbox-label {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
  padding-top: 1px;
}

.devices-tables .device-selection-option input[type="checkbox"],
.device-selection-table .device-selection-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.devices-tables .device-selection-content,
.device-selection-table .device-selection-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 4px;
  justify-content: center;
}

.devices-tables .device-selection-name,
.device-selection-table .device-selection-name {
  font-weight: 600;
  line-height: 1.25;
  display: block;
  min-width: 0;
}

.devices-tables .device-feature-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.85em;
  color: var(--text-dark);
}

.devices-tables .device-feature-toggle .inline-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.devices-tables .device-feature-toggle input[type="checkbox"] {
  margin-top: 0;
}

.devices-tables .device-qty-cell {
  text-align: right;
}

.devices-tables .device-qty-input {
  width: 64px;
  padding: 2px 6px;
  text-align: right;
}

/* Recirculation control styles */



.device-cap-row[data-field="total"] {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #ddd;
  font-weight: 600;
}

.device-cap-row[data-field="total"] .device-cap-label {
  color: #2196F3;
}

.device-supply-cell > div:last-child {
  margin-top: 2px;
}

.device-supply-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}

.device-supply-label {
  color: var(--text-dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75em;
}

.device-supply-value {
  font-weight: 600;
}

/* Fixed layout to keep column widths consistent across selection tables */
.equipment-selection-card .summary-table {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
}

.devices-tables th.col-device,
.devices-tables td.col-device {
  width: 220px;
  max-width: 250px;
  /* No overflow here - table-layout:fixed handles column width;
     overflow on td would implicitly clip tags (CSS spec: overflow-x != visible forces overflow-y to auto) */
}









.devices-tables th.col-margin,
.devices-tables td.col-margin {
  width: 110px;
}

.devices-tables th.col-options,
.devices-tables td.col-options {
  width: 90px;
  text-align: center;
}

.devices-tables th.col-info,
.devices-tables td.col-info {
  width: 90px;
}

.devices-tables th.col-actions,
.devices-tables td.col-actions {
  width: 90px;
  min-width: 90px;
  text-align: center;
}



.devices-tables .device-cap-cell {
  text-align: right;
}

.devices-tables .device-cap-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 6px;
  font-size: 0.85em;
  line-height: 1.25;
}

.devices-tables .device-cap-row + .device-cap-row {
  margin-top: 4px;
}

.devices-tables .device-cap-label {
  color: var(--text-dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75em;
  text-align: right;
  min-width: max-content;
}

.devices-tables .device-cap-value {
  font-weight: 600;
}

/* Equipment tab cards: match UI guidelines */
.equipment-selection-card {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow: visible;
}

/* Prevent cards from expanding beyond container */
.chart-panel.equipment-selection-card {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

/* Refined device name block layout (three lines, tightened spacing) */
.device-name-block {
  line-height: 1.15;
  margin: 0;
  padding: 0;
  max-width: 100%;
  /* No overflow: hidden - would clip device function tags at the bottom */
}

.device-name-block .device-type {
  font-weight: 600;
  margin: 0 0 2px 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-name-block .device-manufacturer,
.device-name-block .device-model {
  margin: 0;
  padding: 0;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Subtle disabled look for equipment tab when feature toggle is off */
#tab-equipment.equipment-disabled .device-selection-name,
#tab-equipment.equipment-disabled .device-cap-row,
#tab-equipment.equipment-disabled .device-modulation-cell,
#tab-equipment.equipment-disabled .device-margin-cell {
  opacity: 0.6;
}
#tab-equipment.equipment-disabled button#equipmentLoadBtn {
  opacity: 0.85;
}

.equipment-selection-card .equipment-card-body {
  background: var(--surface);
  padding: 18px 22px;
  max-width: 100%;
  overflow: visible;
}



.equipment-selection-card .summary-table thead th {
  background: var(--surface);
  color: #111111;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-transform: none;
}

.equipment-selection-card .summary-table tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}




.equipment-selection-card .summary-table th {
  color: #111111;
}

.equipment-selection-card .summary-table th.col-options,
.equipment-selection-card .summary-table td.col-options,
.equipment-selection-card .summary-table th.col-info,
.equipment-selection-card .summary-table td.col-info,
.equipment-selection-card .summary-table th.col-actions,
.equipment-selection-card .summary-table td.col-actions {
  text-align: center;
  width: 90px;
}

.equipment-selection-card .summary-table td.device-options-cell,
.equipment-selection-card .summary-table td.device-info-cell,
.equipment-selection-card .summary-table td.device-actions-cell {
  vertical-align: middle;
}

/* Vertical align all multi-role cells to middle of row */
.equipment-selection-card .summary-table td.device-cap-cell,
.equipment-selection-card .summary-table td.device-modulation-cell,
.equipment-selection-card .summary-table td.device-supply-cell,
.equipment-selection-card .summary-table td.device-margin-cell,
.equipment-selection-card .summary-table td.device-score-cell,
.equipment-selection-card .summary-table td.device-qty-cell {
  vertical-align: middle;
}

/* Center align capacity, margin, and score columns */
.equipment-selection-card .summary-table td.device-cap-cell,
.equipment-selection-card .summary-table td.device-margin-cell,
.equipment-selection-card .summary-table td.device-score-cell {
  text-align: center;
}

.equipment-selection-card .summary-table th.col-cap {
  text-align: center;
}

/* Highlight related columns: Capacity and Modulation — data cells only, headers stay neutral */
.equipment-selection-card .summary-table td.device-cap-cell,
.equipment-selection-card .summary-table td.device-modulation-cell {
  background-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.03);
}

.equipment-selection-card .summary-table .device-modulation-cell {
  min-width: 220px;
}

.equipment-selection-card .summary-table .device-control-line {
  display: block;
  text-align: left;
  line-height: 1.3;
}

.equipment-selection-card .summary-table .device-options-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  color: var(--gray-800);
}

.equipment-selection-card .summary-table .device-options-trigger:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.5);
  color: var(--primary-dark, #00796b);
}

.equipment-selection-card .summary-table .device-options-trigger.is-active {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.16);
  border-color: var(--primary-color, #009688);
  color: var(--primary-dark, #00695c);
}

.equipment-selection-card .summary-table .device-options-trigger.is-disabled {
  opacity: 0.45;
  cursor: pointer;
  border-color: rgba(0, 0, 0, 0.12);
  background: transparent;
  color: var(--gray-500);
}

.equipment-selection-card .summary-table .device-options-trigger.is-disabled:hover {
  background: transparent;
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--gray-500);
}

/* Device actions row - flexbox layout for aligned buttons */
.equipment-selection-card .summary-table .device-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Hide gear options trigger in options column by product decision. */
.equipment-selection-card .summary-table .device-actions-row .device-options-trigger {
  display: none !important;
}

.equipment-selection-card .summary-table .device-options-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.equipment-selection-card .summary-table .device-info-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  cursor: pointer;
  color: var(--gray-800);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.equipment-selection-card .summary-table .device-info-trigger:hover {
  background: rgba(33, 150, 243, 0.08);
  border-color: rgba(33, 150, 243, 0.5);
  color: #1565c0;
}

.equipment-selection-card .summary-table .device-info-icon {
  pointer-events: none;
  line-height: 1;
}

/* =====================================================
   MIXING CHAMBER CONTROL (Matches Fan Modulation Style)
   ===================================================== */
.mixing-chamber-control {
  margin-top: 6px;
  text-align: center;
}

.mixing-chamber-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-size: 0.85em;
  line-height: 1.3;
  color: var(--text-dark);
}

.mixing-chamber-label {
  font-weight: 500;
}

.mixing-chamber-detail-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-size: 0.85em;
  line-height: 1.3;
  color: var(--text-dark);
}

.mixing-control-label {
  font-weight: 400;
}

/* Use same styles as fan modulation for inputs */
.mixing-chamber-control .modulation-input-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mixing-chamber-control .modulation-stage-button {
  border: 1px solid var(--border-color, #ddd);
  background: var(--surface, #fff);
  color: inherit;
  width: 26px;
  height: 24px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.75em;
  transition: background 0.15s ease;
}

.mixing-chamber-control .modulation-stage-button:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.1);
  border-color: var(--primary-dark, #00796b);
}

.mixing-chamber-control .modulation-stage-button:active {
  transform: scale(0.95);
}

.mixing-chamber-control .modulation-stage-display {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.mixing-chamber-control .modulation-percent-input {
  width: 56px;
  border: 1px solid var(--border-color, #ddd);
  background: var(--surface, #fff);
  color: inherit;
  border-radius: var(--radius-xs);
  padding: 2px 4px;
  text-align: right;
  font-weight: 600;
  font-size: 0.9em;
}

.mixing-chamber-control .modulation-percent-input:focus {
  outline: 2px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.5);
  outline-offset: 1px;
}

.mixing-chamber-control .modulation-percent-suffix {
  font-size: 0.8em;
  color: var(--bluegray-500);
  min-width: 28px;
}

/* Legacy styles kept for backward compatibility */
.mixing-chamber-arrows {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 4px;
}

.mixing-chamber-arrows .btn-damper {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
  border: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.3);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  color: var(--primary-dark, #00796b);
  transition: all 0.15s ease;
}

.mixing-chamber-arrows .btn-damper:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.12);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.5);
}

.mixing-chamber-arrows .btn-damper:active {
  transform: scale(0.95);
}

.mixing-chamber-arrows .damper-pct-display {
  min-width: 36px;
  text-align: center;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--primary-dark, #00796b);
  line-height: 28px;
}

.mixing-chamber-arrows .damper-pct-unit {
  font-size: 0.85em;
  font-weight: 400;
  color: var(--primary-light, #4db6ac);
  margin-right: 4px;
}

.mixing-chamber-range {
  font-size: 0.75em;
  color: var(--bluegray-400);
  text-align: center;
  margin-bottom: 2px;
}

.mixing-chamber-detail {
  font-size: 0.85em;
  color: var(--bluegray-800);
  text-align: center;
  font-weight: 500;
}

.mixing-chamber-detail .fresh-value {
  color: #4caf50;
  font-weight: 600;
}

/* Legacy slider styles (keep for backward compatibility) */
.mixing-chamber-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mixing-chamber-slider-row .btn-damper-dec,
.mixing-chamber-slider-row .btn-damper-inc {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
  border: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.3);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  color: var(--primary-dark, #00796b);
  transition: all 0.15s ease;
}

.mixing-chamber-slider-row .btn-damper-dec:hover,
.mixing-chamber-slider-row .btn-damper-inc:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.12);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.5);
}

.mixing-chamber-slider-row .damper-slider {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-xs);
  background: linear-gradient(to right, #ffb74d 0%, #4caf50 100%);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.mixing-chamber-slider-row .damper-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-round);
  background: var(--primary-dark, #00796b);
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.mixing-chamber-slider-row .damper-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.mixing-chamber-slider-row .damper-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-round);
  background: var(--primary-dark, #00796b);
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.damper-value-display {
  margin-top: 6px;
  font-size: 0.85em;
  color: var(--bluegray-800);
  text-align: center;
}

.damper-value-display .damper-pct-value {
  font-weight: 600;
  color: #4caf50;
}

.damper-value-display .damper-recirculation-pct {
  font-weight: 600;
  color: #ff9800;
}

/* Przycisk Kalkulatora punktu pracy */
.equipment-selection-card .summary-table .btn-calculator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  cursor: pointer;
  color: var(--gray-800);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.equipment-selection-card .summary-table .btn-calculator:hover {
  background: rgba(76, 175, 80, 0.08);
  border-color: rgba(76, 175, 80, 0.5);
  color: #2e7d32;
}

.equipment-selection-card .summary-table .btn-calculator .material-icons {
  font-size: 18px;
  pointer-events: none;
}

body.dark-mode .equipment-selection-card .summary-table {
  background: var(--surface);
}

body.dark-mode .equipment-selection-card .summary-table thead th {
  background: rgba(35, 39, 43, 0.92);
  color: #f2f5f8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

body.dark-mode .equipment-selection-card .summary-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}


body.dark-mode .equipment-selection-card .summary-table .device-options-trigger {
  border-color: rgba(255, 255, 255, 0.18);
  color: #d7d7d7;
}

body.dark-mode .equipment-selection-card .summary-table .device-options-trigger:hover {
  background: rgba(var(--primary-color-rgb), 0.18);
  border-color: rgba(var(--primary-color-rgb), 0.45);
  color: var(--primary-light, #4db6ac);
}

body.dark-mode .equipment-selection-card .summary-table .device-options-trigger.is-active {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.32);
  border-color: var(--primary-light, #26a69a);
  color: var(--primary-light, #26a69a);
}

body.dark-mode .equipment-selection-card .summary-table .device-options-trigger.is-disabled {
  color: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Device actions row - dark mode (inherits flex layout from light mode) */
body.dark-mode .equipment-selection-card .summary-table .device-actions-row {
  /* Inherits display: flex; align-items: center; justify-content: center; gap: 8px; */
}

body.dark-mode .equipment-selection-card .summary-table .device-info-trigger {
  border-color: rgba(255, 255, 255, 0.18);
  color: #d7d7d7;
}

body.dark-mode .equipment-selection-card .summary-table .device-info-trigger:hover {
  background: rgba(33, 150, 243, 0.16);
  border-color: rgba(33, 150, 243, 0.45);
  color: #64b5f6;
}

body.dark-mode .equipment-selection-card .summary-table .btn-calculator {
  border-color: rgba(255, 255, 255, 0.18);
  color: #d7d7d7;
}

body.dark-mode .equipment-selection-card .summary-table .btn-calculator:hover {
  background: rgba(76, 175, 80, 0.16);
  border-color: rgba(76, 175, 80, 0.45);
  color: #81c784;
}

/* Preserve aggregate row highlighting within equipment cards */
.equipment-selection-card .device-selection-aggregate-row {
  background-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.1) !important;
}

.device-options-modal .device-options-modal-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.device-options-device-name {
  font-size: 0.95em;
  color: #555555;
}

.device-options-body .device-option-item {
  margin-bottom: 16px;
}

.device-option-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.device-option-control input[type="checkbox"] {
  margin: 0;
}

.device-option-hint {
  margin-top: 8px;
  font-size: 0.85em;
  color: var(--gray-600);
}

body.dark-mode .device-options-device-name {
  color: var(--bluegray-100);
}

body.dark-mode .device-option-hint {
  color: rgba(255, 255, 255, 0.6);
}

.equipment-selection-card .device-selection-aggregate-row td {
  background-color: transparent !important;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}




/* Device Info Modal Header with action buttons */
.device-info-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.15);
  padding-bottom: 12px;
}

.device-info-modal-header .device-info-modal-title {
  margin-bottom: 0;
}

.device-info-modal-actions {
  display: flex;
  gap: 4px;
}

.device-info-modal-actions .btn-flat {
  padding: 8px;
  min-width: auto;
  border-radius: var(--radius-round);
  color: var(--primary-dark, #00695c);
}

.device-info-modal-actions .btn-flat:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.1);
}

.device-info-modal-actions .btn-flat .material-icons {
  font-size: 20px;
}

body.dark-mode .device-info-modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .device-info-modal-actions .btn-flat {
  color: var(--primary-soft);
}

body.dark-mode .device-info-modal-actions .btn-flat:hover {
  background: rgba(255, 255, 255, 0.1);
}

@keyframes titleSlideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.device-info-device-name {
  font-size: 0.95em;
  color: #555555;
}



.device-info-body > * {
  animation: contentFadeIn 0.6s ease-out backwards;
}

.device-info-body > *:nth-child(1) { animation-delay: 0.1s; }
.device-info-body > *:nth-child(2) { animation-delay: 0.2s; }
.device-info-body > *:nth-child(3) { animation-delay: 0.3s; }
.device-info-body > *:nth-child(4) { animation-delay: 0.4s; }
.device-info-body > *:nth-child(5) { animation-delay: 0.5s; }
.device-info-body > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.device-info-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 32px;
  padding: 28px 32px;
  border-radius: var(--radius-2xl);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: heroSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.device-info-hero:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

@keyframes heroSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.device-info-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  50%, 100% {
    left: 100%;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.device-info-hero-text {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 1;
}

.device-info-hero-heading {
  margin: 0;
  font-size: var(--font-size-xl);
  color: var(--primary-dark, #004d40);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.device-info-hero-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fieldFadeIn 0.6s ease-out backwards;
}

.device-info-hero-field:nth-child(1) { animation-delay: 0.1s; }
.device-info-hero-field:nth-child(2) { animation-delay: 0.2s; }
.device-info-hero-field:nth-child(3) { animation-delay: 0.3s; }
.device-info-hero-field:nth-child(4) { animation-delay: 0.4s; }

@keyframes fieldFadeIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.device-info-hero-field-label {
  font-size: var(--font-size-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(10, 60, 66, 0.7);
  font-weight: 700;
}

.device-info-hero-field-value {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--primary-dark, #004d40);
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.device-info-hero-media {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: clamp(240px, 38vw, 420px);
  max-width: 100%;
  overflow: hidden;
  z-index: 1;
  animation: mediaZoomIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes mediaZoomIn {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

body.dark-mode .device-info-hero {
  background: linear-gradient(135deg, rgba(0, 77, 64, 0.7), rgba(0, 121, 107, 0.5));
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.6),
              0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .device-info-hero-heading {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .device-info-hero-field-label {
  color: rgba(224, 242, 241, 0.75);
}

body.dark-mode .device-info-hero-field-value {
  color: var(--primary-soft);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Overview Tags (Medium, Functions, Models) */
.device-info-overview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 77, 64, 0.15);
}

.overview-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-xs);
  font-weight: 500;
  line-height: 1.3;
  background: rgba(0, 77, 64, 0.08);
  color: var(--primary-dark, #004d40);
  border: 1px solid rgba(0, 77, 64, 0.15);
  transition: all 0.2s ease;
}

.overview-tag--medium {
  background: rgba(33, 150, 243, 0.12);
  color: #1565c0;
  border-color: rgba(33, 150, 243, 0.25);
}

.overview-tag--thermal {
  background: rgba(244, 67, 54, 0.1);
  color: #c62828;
  border-color: rgba(244, 67, 54, 0.2);
}

.overview-tag--ventilation {
  background: rgba(76, 175, 80, 0.1);
  color: #2e7d32;
  border-color: rgba(76, 175, 80, 0.2);
}

.overview-tag--model {
  background: rgba(156, 39, 176, 0.1);
  color: #7b1fa2;
  border-color: rgba(156, 39, 176, 0.2);
}

body.dark-mode .device-info-overview-tags {
  border-top-color: rgba(167, 255, 235, 0.2);
}

body.dark-mode .overview-tag {
  background: rgba(167, 255, 235, 0.15);
  color: var(--primary-soft);
  border-color: rgba(167, 255, 235, 0.25);
}

body.dark-mode .overview-tag--medium {
  background: rgba(33, 150, 243, 0.25);
  color: #64b5f6;
  border-color: rgba(33, 150, 243, 0.35);
}

body.dark-mode .overview-tag--thermal {
  background: rgba(244, 67, 54, 0.2);
  color: #ef9a9a;
  border-color: rgba(244, 67, 54, 0.3);
}

body.dark-mode .overview-tag--ventilation {
  background: rgba(76, 175, 80, 0.2);
  color: #a5d6a7;
  border-color: rgba(76, 175, 80, 0.3);
}

body.dark-mode .overview-tag--model {
  background: rgba(156, 39, 176, 0.2);
  color: #ce93d8;
  border-color: rgba(156, 39, 176, 0.3);
}

.device-info-media {
	width: clamp(120px, 20vw, 180px);
	margin: 0;
  border-radius: var(--radius-lg);
  padding: 12px;
  overflow: visible;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-xl);
}

.device-info-media--hero {
	width: clamp(240px, 40vw, 420px);
	max-width: 100%;
	max-height: 320px;
	overflow: hidden;
}

.device-info-media img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 200px;
  display: block;
  object-fit: contain;
}

.device-info-media--hero img {
  max-height: 320px;
  max-width: 100%;
}

body.dark-mode .device-info-media {
  background: linear-gradient(135deg, rgba(6, 34, 44, 0.85), rgba(12, 140, 150, 0.35));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
}

.device-info-section--documents {
  background: #f2fbfb;
}

.device-info-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-info-links a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
}

.device-info-links a:hover {
  text-decoration: underline;
}

body.dark-mode .device-info-section--documents {
  background: rgba(0, 77, 64, 0.35);
}

body.dark-mode .device-info-links a {
  color: var(--primary-light);
}

@media (max-width: 720px) {
  .device-info-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .device-info-hero-media {
    width: 100%;
    justify-content: flex-start;
  }
  .device-info-media--hero {
    width: min(100%, 420px);
  }
}

.device-info-section {
  border: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.12);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #fafcfc 100%);
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  animation: sectionFadeIn 0.6s ease-out backwards;
}

@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.device-info-section:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(0, 0, 0, 0.15);
}

.device-info-section-title {
  margin: 0 0 12px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark, #004d40);
  letter-spacing: 0.02em;
}

.device-info-description {
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--bluegray-900);
}

body.dark-mode .device-info-description {
  color: var(--bluegray-50);
}

.device-info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
  font-size: var(--font-size-md);
}

.device-info-row--stacked {
  flex-direction: column;
  gap: 6px;
}

.device-info-label {
  font-weight: 600;
  color: var(--gray-800);
}

.device-info-value {
  color: #333333;
  text-align: right;
}

.device-info-value--left {
  text-align: left;
}

.device-info-list {
  margin: 0;
  padding-left: 16px;
  list-style: disc;
  color: #333333;
}

.device-info-empty {
  padding: 12px 0;
  color: var(--gray-700);
}

.device-info-component-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-info-component-item {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 12px;
}

.device-info-component-item:first-child {
  border-top: none;
  padding-top: 0;
}

.device-info-component-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.device-info-component-manufacturer {
  font-size: var(--font-size-sm);
  color: var(--gray-700);
}

.device-info-component-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.device-info-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.06);
  font-size: var(--font-size-sm);
}

.device-info-component-notes {
  margin-top: 6px;
  font-size: var(--font-size-sm);
  color: #555555;
}

.device-info-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-info-link {
  color: #1565c0;
  text-decoration: underline;
  font-size: 0.9rem;
}

.device-info-link:hover {
  text-decoration: none;
}

/* Features groups styling */
.device-info-features-group {
  margin-bottom: 16px;
}

.device-info-features-group:last-child {
  margin-bottom: 0;
}

.device-info-features-group--marketing {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed rgba(0, 77, 64, 0.2);
}

body.dark-mode .device-info-features-group--marketing {
  border-top-color: rgba(167, 255, 235, 0.2);
}

.device-info-function-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.device-info-function-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--gray-900);
  padding-left: 0;
  animation: fieldFadeIn 0.4s ease-out backwards;
}

.device-info-function-item:nth-child(1) { animation-delay: 0.05s; }
.device-info-function-item:nth-child(2) { animation-delay: 0.1s; }
.device-info-function-item:nth-child(3) { animation-delay: 0.15s; }
.device-info-function-item:nth-child(4) { animation-delay: 0.2s; }
.device-info-function-item:nth-child(5) { animation-delay: 0.25s; }

.device-info-function-item::before {
  content: '•';
  color: var(--primary-color, #009688);
  font-size: var(--font-size-xl);
  font-weight: bold;
  line-height: 1.3;
  flex-shrink: 0;
}

.device-info-function-label {
  flex: 1;
  font-weight: 600;
  color: var(--primary-dark, #00695c);
  font-size: var(--font-size-md);
}

.device-info-function-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: var(--font-size-sm);
  color: #555555;
  margin-top: 4px;
}

.device-info-function-sep {
  color: rgba(0, 0, 0, 0.45);
}

.device-info-function-range {
  display: block;
  font-size: var(--font-size-sm);
  color: #555555;
  line-height: 1.25;
}

body.dark-mode .device-info-section {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .device-info-section:has(> .device-info-section-card) {
  background: transparent;
  border-color: transparent;
}

body.dark-mode .device-info-label {
  color: var(--gray-300);
}

body.dark-mode .device-info-value {
  color: var(--gray-100);
}
.device-info-section--documents {
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  animation: fadeInUp 0.5s ease-out;
}

.device-info-section--documents:hover {
  box-shadow: none;
  transform: none;
}

.device-info-section--financial {
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  animation: fadeInUp 0.6s ease-out;
}

.device-info-section--financial:hover {
  box-shadow: none;
  transform: none;
}

.device-info-section-card {
  background: #ffffff;
  border-radius: var(--radius-2xl);
  padding: 28px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInCard 0.5s ease-out backwards;
}

/* Hover kart sekcji: delikatne uniesienie + szara poswiata wokol (zamiast kolorowej). */
.device-info-section .device-info-section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

/* Sekcja opakowujaca karte renderuje sie jako pojedyncza karta (bez "modalu w modalu"),
   analogicznie do sekcji Dokumenty - zewnetrzny box jest neutralizowany. Uniesienie
   przejmuje wewnetrzna karta, dlatego zewnetrzny box sie nie przesuwa (transform: none). */
.device-info-section:has(> .device-info-section-card) {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.device-info-section:has(> .device-info-section-card):hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.device-info-section-card .device-info-section-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-dark, #00695c);
  margin-bottom: 24px;
  animation: fieldFadeIn 0.4s ease-out backwards;
  animation-delay: 0.1s;
}

/* Ujednolicony naglowek sekcji w karcie urzadzenia - kazdy naglowek (Przeglad,
   Opis urzadzenia, Punkt pracy i pozostale) ma ten sam font i jest wysrodkowany.
   Koloru nie ustawiamy tutaj, by zachowac kolory trybu ciemnego z regul bazowych. */
.device-info-body .device-info-section-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 24px 0;
}

/* Naglowek Przeglad - jak pozostale, ale wyrownany do lewej (bez cienia tekstu).
   Margines zerowy, bo odstep w hero kontroluje uklad flex (gap). */
.device-info-body .device-info-hero-heading {
  text-align: left;
  text-shadow: none;
  margin: 0;
}

.device-info-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 1200px) {
  .device-info-links {
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
  }
  
  .device-info-function-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
  }
}

.device-info-link {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  position: relative;
  overflow: hidden;
  animation: fieldFadeIn 0.4s ease-out backwards;
}

.device-info-link:nth-child(1) { animation-delay: 0.05s; }
.device-info-link:nth-child(2) { animation-delay: 0.1s; }
.device-info-link:nth-child(3) { animation-delay: 0.15s; }
.device-info-link:nth-child(4) { animation-delay: 0.2s; }
.device-info-link:nth-child(5) { animation-delay: 0.25s; }
.device-info-link:nth-child(6) { animation-delay: 0.3s; }

.device-info-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(var(--primary-color-rgb, 0, 150, 136), 0.15), transparent);
  transition: left 0.5s ease;
}

.device-info-link:hover::before {
  left: 100%;
}

.device-info-link:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  transform: translateX(4px);
  text-decoration: underline;
}

.device-info-link--placeholder {
  color: rgba(5, 59, 64, 0.55);
  cursor: not-allowed;
  animation: fieldFadeIn 0.4s ease-out backwards;
}

.device-info-link--placeholder:hover {
  background: transparent;
  transform: none;
}

body.dark-mode .device-info-section--documents {
  background: transparent;
}

body.dark-mode .device-info-section--financial {
  background: transparent;
}

body.dark-mode .device-info-section-card {
  background: rgba(30, 30, 30, 0.95);
}

body.dark-mode .device-info-section .device-info-section-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

body.dark-mode .device-info-section-card .device-info-section-title {
  color: var(--primary-soft);
}

body.dark-mode .device-info-link {
  color: var(--primary-light);
}

body.dark-mode .device-info-link--placeholder {
  color: rgba(255, 255, 255, 0.45);
}

body.dark-mode .device-info-list,
body.dark-mode .device-info-empty,
body.dark-mode .device-info-component-manufacturer,
body.dark-mode .device-info-component-notes {
  color: var(--bluegray-100);
}

/* Selection Data Section - Project-specific parameters */
/* Simple styling matching Standard Technical Data */
.device-info-section--selection-data .device-info-section-card {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.04);
}

.device-info-table {
  width: 100%;
  border-collapse: collapse;
  animation: fieldFadeIn 0.4s ease-out backwards;
  animation-delay: 0.15s;
}

.device-info-table tr {
  border-bottom: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.1);
}

.device-info-table tr:last-child {
  border-bottom: none;
}

.device-info-table td {
  padding: 10px 4px;
  vertical-align: middle;
}

.device-info-table-label {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.9rem;
}

.device-info-table-value {
  text-align: right;
  font-weight: 500;
  color: var(--primary-dark, #00695c);
  font-size: var(--font-size-md);
}

body.dark-mode .device-info-section--selection-data .device-info-section-card {
  background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .device-info-table tr {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .device-info-table-label {
  color: var(--gray-300);
}

body.dark-mode .device-info-table-value {
  color: var(--primary-soft);
}

/* Operating Point Section - Vertical layout with white background */
.device-info-section--operating-point .device-info-section-card {
  background: #ffffff;
}

.device-info-section--operating-point .device-info-section-title {
  text-align: center;
  width: 100%;
  display: block;
}

.device-info-op-columns {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.device-info-op-column {
  width: 100%;
}

/* Operating point section: winter/summer side by side, like the OP calculator */
.device-info-section--operating-point .device-info-op-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.device-info-section--operating-point .device-info-specs-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 768px) {
  .device-info-section--operating-point .device-info-op-columns {
    grid-template-columns: 1fr;
  }
}

.device-info-op-column--winter .device-info-op-column-header {
  color: var(--bluegray-900);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--gray-300);
}

.device-info-op-column--summer .device-info-op-column-header {
  color: var(--bluegray-900);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--gray-300);
}

.device-info-op-column-header {
  font-weight: 600;
  font-size: var(--font-size-base);
  padding: 12px 0;
  margin-bottom: 16px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.device-info-op-column-header .material-icons {
  font-size: 1.1rem;
}

.device-info-op-warning {
  background: #fff3e0;
  border: 1px solid #ff9800;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  color: #e65100;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.device-info-op-warning .material-icons {
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.device-info-op-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.15);
}

.device-info-op-actions .btn-small {
  text-transform: none;
  font-weight: 500;
}

.device-info-specs-row--highlight {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  border-radius: var(--radius-xs);
  margin: 2px -4px;
  padding: 6px 8px !important;
}

.device-info-specs-value--primary {
  color: var(--primary-dark, #00695c) !important;
  font-weight: 600 !important;
}

body.dark-mode .device-info-section--operating-point .device-info-section-card {
  background: var(--bluegray-900);
}

body.dark-mode .device-info-op-column--winter .device-info-op-column-header {
  color: var(--gray-300);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--gray-800);
}

body.dark-mode .device-info-op-column--summer .device-info-op-column-header {
  color: var(--gray-300);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--gray-800);
}

body.dark-mode .device-info-op-warning {
  background: rgba(255, 152, 0, 0.15);
  border-color: #ff9800;
  color: #ffb74d;
}

body.dark-mode .device-info-op-actions {
  border-top-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .device-info-specs-row--highlight {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .device-info-specs-value--primary {
  color: var(--primary-soft) !important;
}

/* Standard Technical Data Section - Per-speed table */
.device-info-speed-table-wrapper {
  margin-bottom: 24px;
  animation: fieldFadeIn 0.4s ease-out backwards;
  animation-delay: 0.1s;
}

.device-info-subsection-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-dark, #00695c);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.device-info-speed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.04);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.device-info-speed-table thead {
  background: linear-gradient(90deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.15), rgba(0, 188, 212, 0.1));
}

.device-info-speed-table th {
  padding: 12px 10px;
  font-weight: 600;
  text-align: left;
  color: var(--primary-dark, #00695c);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.device-info-speed-table th.text-right {
  text-align: right;
}

.device-info-speed-table tbody tr {
  border-bottom: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  transition: background 0.2s ease;
}

.device-info-speed-table tbody tr:last-child {
  border-bottom: none;
}

.device-info-speed-table tbody tr:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.06);
}

.device-info-speed-table td {
  padding: 10px;
  color: var(--text-dark);
}

.device-info-speed-table td.text-right {
  text-align: right;
}

body.dark-mode .device-info-subsection-title {
  color: var(--primary-soft);
}

body.dark-mode .device-info-speed-table {
  background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .device-info-speed-table thead {
  background: linear-gradient(90deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.2), rgba(0, 188, 212, 0.15));
}

body.dark-mode .device-info-speed-table th {
  color: var(--primary-soft);
}

body.dark-mode .device-info-speed-table tbody tr {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .device-info-speed-table tbody tr:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.1);
}

body.dark-mode .device-info-speed-table td {
  color: var(--gray-300);
}

/* Standard Technical Data - Two Column Grouped Layout */
.device-info-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .device-info-specs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.device-info-spec-group {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.12);
  box-shadow: var(--shadow-md);
  animation: fieldFadeIn 0.4s ease-out backwards;
  transition: all 0.2s ease;
}

.device-info-spec-group:hover {
  box-shadow: 0 4px 16px rgba(var(--primary-color-rgb, 0, 150, 136), 0.12);
  transform: translateY(-2px);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.2);
}

.device-info-spec-group:nth-child(1) { animation-delay: 0.05s; }
.device-info-spec-group:nth-child(2) { animation-delay: 0.1s; }
.device-info-spec-group:nth-child(3) { animation-delay: 0.15s; }
.device-info-spec-group:nth-child(4) { animation-delay: 0.2s; }
.device-info-spec-group:nth-child(5) { animation-delay: 0.25s; }
.device-info-spec-group:nth-child(6) { animation-delay: 0.3s; }

.device-info-group-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-dark, #00796b);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.1);
}

.device-info-group-title i {
  font-size: 0.9rem;
  opacity: 0.8;
}

.device-info-specs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
}

.device-info-specs-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.device-info-specs-label {
  font-size: var(--font-size-sm);
  color: var(--bluegray-600);
  font-weight: 500;
}

.device-info-specs-value {
  font-size: 0.9rem;
  color: var(--primary-dark, #00695c);
  font-weight: 600;
  text-align: right;
}

/* Dark mode for specs grid */
body.dark-mode .device-info-spec-group {
  background: #1e2428;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
}

body.dark-mode .device-info-spec-group:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--primary-color-rgb), 0.3);
}

body.dark-mode .device-info-group-title {
  color: var(--primary-soft);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .device-info-specs-row {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .device-info-specs-label {
  color: var(--bluegray-200);
}

body.dark-mode .device-info-specs-value {
  color: var(--primary-soft);
}

/* Performance Section - Two Column Layout */
.device-info-performance-wrapper {
  position: relative;
  overflow: hidden;
}

.device-info-performance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  animation: fadeInUp 0.6s ease-out;
}

.device-info-performance-card {
  position: relative;
  border-radius: var(--radius-2xl);
  padding: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fdfd 100%);
  box-shadow: 0 8px 32px rgba(var(--primary-color-rgb, 0, 150, 136), 0.12),
              0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInCard 0.7s ease-out backwards;
}

.device-info-performance-card--unit {
  animation-delay: 0.1s;
}

.device-info-performance-card--selection {
  animation-delay: 0.2s;
}

@keyframes slideInCard {
  from {
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.device-info-performance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color, #009688), var(--primary-light, #00bcd4));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.device-info-performance-card:hover::before {
  transform: scaleX(1);
}

.device-info-performance-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(var(--primary-color-rgb, 0, 150, 136), 0.18),
              0 4px 16px rgba(0, 0, 0, 0.08);
}

.device-info-performance-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.12), rgba(0, 188, 212, 0.12));
  margin: 0 auto 16px;
  transition: all 0.3s ease;
  order: -3;
}

.device-info-performance-card:hover .device-info-performance-card-icon {
  transform: scale(1.1) rotate(5deg);
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.2), rgba(0, 188, 212, 0.2));
}

.device-info-performance-card-icon i {
  font-size: 32px;
  color: var(--primary-color, #009688);
  transition: all 0.3s ease;
}

.device-info-performance-subheading {
  font-size: var(--font-size-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-dark, #00695c);
  margin-bottom: 12px;
  text-align: center;
  animation: fieldFadeIn 0.4s ease-out backwards;
  animation-delay: 0.05s;
  order: -2;
}

.device-info-performance-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0, 87, 79, 0.7);
  margin-bottom: 16px;
  text-align: center;
  animation: fieldFadeIn 0.4s ease-out backwards;
  animation-delay: 0.1s;
  order: -1;
}

.device-info-performance-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.08), rgba(0, 188, 212, 0.08));
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  animation: fieldFadeIn 0.4s ease-out backwards;
  animation-delay: 0.15s;
  order: 0;
}

.device-info-performance-count-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: rgba(0, 87, 79, 0.8);
}

.device-info-performance-count-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark, #00695c);
}

.device-info-performance-card:hover .device-info-performance-card-icon i {
  color: var(--primary-dark, #00695c);
}

.device-info-performance-card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.device-info-performance-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark, #004d40);
  letter-spacing: 0.02em;
}

.device-info-performance-subheading {
  margin: 0;
  font-size: var(--font-size-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(0, 87, 79, 0.65);
  font-weight: 600;
}

.device-info-performance-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: var(--font-size-sm);
  color: rgba(0, 0, 0, 0.65);
}

.device-info-performance-count-text {
  font-weight: 600;
  color: var(--primary-dark, #004d40);
}

.device-info-performance-metrics {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.device-info-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.15), rgba(0, 188, 212, 0.12));
  color: var(--primary-dark, #00695c);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(var(--primary-color-rgb, 0, 150, 136), 0.15);
  animation: pulseBadge 2s ease-in-out infinite;
}

@keyframes pulseBadge {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.device-info-metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  transition: all 0.2s ease;
}

.device-info-metric:hover {
  padding-left: 8px;
  background: linear-gradient(90deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.04), transparent);
}

.device-info-metric:last-child {
  border-bottom: none;
}

.device-info-metric-label {
  font-size: var(--font-size-sm);
  color: rgba(0, 0, 0, 0.7);
  font-weight: 500;
  flex: 1;
}

.device-info-metric-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark, #004d40);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .device-info-performance-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.device-info-section--performance {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.device-info-section--performance:hover {
  box-shadow: none;
  border: none;
}

.device-info-section--performance .device-info-section-title {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 24px;
  color: var(--primary-dark, #00695c);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.device-info-financial-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-info-financial-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fieldFadeIn 0.4s ease-out backwards;
  position: relative;
  overflow: hidden;
}

.device-info-financial-field:nth-child(1) { animation-delay: 0.05s; }
.device-info-financial-field:nth-child(2) { animation-delay: 0.1s; }
.device-info-financial-field:nth-child(3) { animation-delay: 0.15s; }
.device-info-financial-field:nth-child(4) { animation-delay: 0.2s; }

.device-info-financial-field::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-color, #009688), var(--primary-light, #00bcd4));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.device-info-financial-field:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(var(--primary-color-rgb, 0, 150, 136), 0.2);
}

.device-info-financial-field:hover::before {
  opacity: 1;
}

.device-info-financial-label {
  text-transform: uppercase;
  font-size: var(--font-size-xs);
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.65);
  font-weight: 600;
  transition: color 0.3s ease;
}

.device-info-financial-field:hover .device-info-financial-label {
  color: rgba(0, 0, 0, 0.85);
}

.device-info-financial-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark, #00695c);
  position: relative;
  transition: all 0.3s ease;
}

.device-info-financial-field:hover .device-info-financial-value {
  color: var(--primary-dark, #004d40);
  transform: scale(1.05);
}

.device-info-financial-actions a,
.device-info-financial-actions span {
  font-weight: 600;
  text-decoration: none;
}

.device-info-financial-actions a {
  color: var(--primary-color);
}

.device-info-financial-actions a:hover {
  text-decoration: underline;
}

.device-info-financial-actions .device-info-link--placeholder {
  color: rgba(0, 0, 0, 0.45);
}

body.dark-mode .device-info-performance-card {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

body.dark-mode .device-info-performance-subheading,
body.dark-mode .device-info-performance-count-text,
body.dark-mode .device-info-performance-count {
  color: rgba(224, 242, 241, 0.8);
}

body.dark-mode .device-info-metric-label {
  color: rgba(255, 255, 255, 0.65);
}

body.dark-mode .device-info-metric-value {
  color: #7dfff3;
}

body.dark-mode .device-info-count-badge {
  background: rgba(125, 255, 243, 0.2);
  color: #7dfff3;
}

body.dark-mode .device-info-financial-label {
  color: rgba(255, 255, 255, 0.55);
}

body.dark-mode .device-info-financial-value {
  color: #ffab91;
}

body.dark-mode .device-info-financial-actions .device-info-link--placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Dark Mode Performance Cards */
body.dark-mode .device-info-performance-card {
  background: linear-gradient(135deg, rgba(0, 77, 64, 0.35), rgba(0, 121, 107, 0.25));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
              0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .device-info-performance-card:hover {
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.6),
              0 8px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .device-info-performance-card-title {
  color: #fff;
}

body.dark-mode .device-info-performance-subheading,
body.dark-mode .device-info-performance-count-text,
body.dark-mode .device-info-performance-count {
  color: rgba(224, 242, 241, 0.8);
}

body.dark-mode .device-info-performance-card-icon {
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.25), rgba(0, 188, 212, 0.2));
}

body.dark-mode .device-info-performance-card:hover .device-info-performance-card-icon {
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.35), rgba(0, 188, 212, 0.3));
}

body.dark-mode .device-info-performance-card-icon i {
  color: var(--primary-soft);
}

body.dark-mode .device-info-performance-card:hover .device-info-performance-card-icon i {
  color: var(--primary-soft);
}

body.dark-mode .device-info-metric {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .device-info-metric:hover {
  background: linear-gradient(90deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.15), transparent);
}

body.dark-mode .device-info-metric-label {
  color: rgba(255, 255, 255, 0.75);
}

body.dark-mode .device-info-metric-value {
  color: #7dfff3;
}

body.dark-mode .device-info-count-badge {
  background: linear-gradient(135deg, rgba(125, 255, 243, 0.25), rgba(0, 188, 212, 0.2));
  color: #7dfff3;
  box-shadow: 0 2px 12px rgba(125, 255, 243, 0.3);
}

body.dark-mode .device-info-chip {
  background: rgba(255, 255, 255, 0.12);
}

body.dark-mode .device-info-link {
  color: #64b5f6;
}

body.dark-mode .device-info-link:hover {
  background: rgba(100, 181, 246, 0.12);
}

body.dark-mode .device-info-function-item {
  color: var(--bluegray-100);
}

body.dark-mode .device-info-function-item::before {
  color: var(--primary-light, #4db6ac);
}

body.dark-mode .device-info-function-label {
  color: var(--primary-soft);
}

body.dark-mode .device-info-function-details {
  color: var(--bluegray-200);
}

body.dark-mode .device-info-function-range {
  color: var(--bluegray-100);
}

body.dark-mode .device-info-function-sep {
  color: rgba(255, 255, 255, 0.45);
}

body.dark-mode .device-info-financial-field {
  background: rgba(0, 0, 0, 0.3);
}

body.dark-mode .device-info-financial-field:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.15);
}

body.dark-mode .device-info-financial-field::before {
  background: linear-gradient(180deg, var(--primary-light), var(--primary-soft));
}

body.dark-mode .device-info-financial-label {
  color: rgba(255, 255, 255, 0.65);
}

body.dark-mode .device-info-financial-field:hover .device-info-financial-label {
  color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .device-info-financial-value {
  color: var(--primary-light, #4db6ac);
}

body.dark-mode .device-info-financial-field:hover .device-info-financial-value {
  color: var(--primary-soft);
}

body.dark-mode .device-info-performance-card-icon i {
  color: var(--primary-light, #4db6ac);
}

body.dark-mode .device-info-performance-card:hover .device-info-performance-card-icon i {
  color: var(--primary-soft);
}

body.dark-mode .device-info-performance-subheading {
  color: var(--primary-soft);
}

body.dark-mode .device-info-performance-label {
  color: rgba(224, 242, 241, 0.7);
}

body.dark-mode .device-info-performance-count {
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.15), rgba(0, 188, 212, 0.15));
}

body.dark-mode .device-info-performance-count-label {
  color: rgba(224, 242, 241, 0.8);
}

body.dark-mode .device-info-performance-count-value {
  color: #7dfff3;
}

body.dark-mode .equipment-selection-card .device-selection-aggregate-row {
  background-color: rgba(var(--primary-color-rgb), 0.24) !important;
}

body.dark-mode .equipment-selection-card .device-selection-aggregate-row td {
  border-top: 1px solid rgba(224, 224, 224, 0.14);
}

/* ==========================================================================
   1. BASE STYLES & VARIABLES - MOVED TO css/tokens.css, css/base.css
   ========================================================================== */

/* ==========================================================================
   1b. UTILITY LAYOUT HELPERS - MOVED TO css/utilities.css
   ========================================================================== */

/* ==========================================================================
   2. LAYOUT COMPONENTS
   ========================================================================== */

/* Banner & Header */







/* KPI meta (active hours) */

/* Ensure summary table stays full and scrolls horizontally on small screens */
.summary-table-wrapper {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
}
.summary-table-wrapper table.summary-table { 
  min-width: 600px;
  max-width: 100%;
}
/* Force summary table to remain a table (override generic mobile table rules) */

/* Preserve table layout on mobile: no stacking or display:block tricks */
table.styled.summary-table {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
}
table.styled.summary-table th, table.styled.summary-table td { white-space: nowrap; }
table.styled.summary-table th.select-col { text-align: center; }
.device-selection-row { transition: background-color 0.15s ease; }
.device-selection-row:hover {
  background-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  cursor: pointer;
}

/* === MULTI-FUNCTION DEVICE STYLES === */
.multi-function-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.15);
  border: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.4);
  border-radius: var(--radius-xs);
  color: var(--primary-dark, #00796b);
  font-size: 0.65em;
  font-weight: 500;
  cursor: help;
  white-space: nowrap;
  line-height: 1.1;
  max-width: fit-content;
  vertical-align: middle;
}
.device-multi-function-row {
  margin-top: 2px;
  line-height: 1;
  display: inline-block;
}
.multi-function-indicator .mf-link-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.multi-function-indicator .mf-funcs {
  white-space: nowrap;
}
body.dark-mode .multi-function-indicator {
  background: rgba(var(--primary-color-rgb), 0.2);
  border-color: rgba(var(--primary-color-rgb), 0.5);
  color: var(--primary-soft);
}
/* Multi-function sync animation when another linked device is selected */
.device-selection-row[data-is-multi-function="true"].mf-syncing {
  animation: mf-sync-pulse 0.4s ease-out;
}
@keyframes mf-sync-pulse {
  0% { box-shadow: 0 0 0 0 rgba(124, 77, 255, 0.6); }
  100% { box-shadow: 0 0 0 8px rgba(124, 77, 255, 0); }
}
/* === END MULTI-FUNCTION DEVICE STYLES === */

.selection-hint {
  margin: 6px 0 8px 0;
  font-size: 0.9em;
}
body.dark-mode .device-selection-row:hover { background-color: rgba(var(--primary-color-rgb), 0.24); }
body.dark-mode .selection-hint { color: rgba(224,224,224,0.85); }

/* Air Curtain Table Styles */
.air-curtain-table .opening-header-row {
  background-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.1);
}
.air-curtain-table .opening-header-cell {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.air-curtain-table .opening-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.air-curtain-table .opening-title {
  font-size: 0.95em;
  color: var(--primary-dark, #00796b);
}

/* Per-opening alternatives button */
.btn-expand-opening-alternatives {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.3);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.8em;
  color: var(--primary-dark, #00796b);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}
.btn-expand-opening-alternatives:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.05);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.5);
}
.btn-expand-opening-alternatives .expand-icon {
  font-size: 0.7em;
  transition: transform 0.2s ease;
}
.btn-expand-opening-alternatives.is-expanded .expand-icon {
  transform: rotate(90deg);
}
.btn-expand-opening-alternatives .alt-count {
  font-size: 0.85em;
  opacity: 0.7;
}
body.dark-mode .btn-expand-opening-alternatives {
  background: var(--bluegray-800);
  border-color: rgba(var(--primary-color-rgb), 0.4);
  color: var(--primary-light, #4db6ac);
}
body.dark-mode .btn-expand-opening-alternatives:hover {
  background: var(--bluegray-700);
  border-color: rgba(var(--primary-color-rgb), 0.6);
}

body.dark-mode .air-curtain-table .opening-header-row {
  background-color: rgba(var(--primary-color-rgb), 0.18);
}
body.dark-mode .air-curtain-table .opening-header-cell {
  border-bottom-color: rgba(255,255,255,0.08);
}
body.dark-mode .air-curtain-table .opening-title {
  color: var(--primary-light, #4db6ac);
}

/* Legacy opening group header (keep for compatibility) */
.air-curtain-table .opening-group-header {
  background-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  font-weight: 500;
}
.air-curtain-table .opening-group-header td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
body.dark-mode .air-curtain-table .opening-group-header {
  background-color: rgba(var(--primary-color-rgb), 0.15);
}
body.dark-mode .air-curtain-table .opening-group-header td {
  border-bottom-color: rgba(255,255,255,0.08);
}

.btn-expand-alternatives {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding: 5px 12px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.85em;
  color: var(--text-dark);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.btn-expand-alternatives:hover {
  background: var(--light-gray);
  border-color: rgba(0,0,0,0.25);
  box-shadow: var(--shadow-sm);
}
.btn-expand-alternatives .expand-icon {
  font-size: 0.75em;
  color: var(--primary-color, #00897b);
  transition: transform 0.2s ease;
}
.btn-expand-alternatives.is-expanded .expand-icon {
  transform: rotate(90deg);
}
body.dark-mode .btn-expand-alternatives {
  background: var(--gray-800);
  border-color: rgba(255,255,255,0.2);
  color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}
body.dark-mode .btn-expand-alternatives:hover {
  background: #4a4a4a;
  border-color: rgba(255,255,255,0.3);
}
body.dark-mode .btn-expand-alternatives .expand-icon {
  color: var(--primary-light, #4db6ac);
}

/* Expand button in card header */
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.chart-header .chart-title-text {
  flex: 1;
  min-width: 0;
}
.chart-header .btn-expand-alternatives {
  margin-left: auto;
  flex-shrink: 0;
}
.chart-header .btn-expand-alternatives .expand-label {
  font-size: 0.85em;
}
.chart-header .btn-expand-alternatives .alt-count {
  font-size: 0.8em;
  opacity: 0.7;
  margin-left: 4px;
}

/* "Więcej alternatyw" button — mirrors btn-expand-alternatives styling */
.btn-more-alternatives {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 5px 12px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.85em;
  color: var(--text-dark);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.btn-more-alternatives:hover {
  background: var(--light-gray);
  border-color: rgba(0,0,0,0.25);
  box-shadow: var(--shadow-sm);
}
.btn-more-alternatives .expand-icon {
  font-size: 0.75em;
  color: var(--primary-color, #00897b);
}
body.dark-mode .btn-more-alternatives {
  background: var(--gray-800);
  border-color: rgba(255,255,255,0.2);
  color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}
body.dark-mode .btn-more-alternatives:hover {
  background: #4a4a4a;
  border-color: rgba(255,255,255,0.3);
}
body.dark-mode .btn-more-alternatives .expand-icon {
  color: var(--primary-light, #4db6ac);
}
.chart-header .btn-more-alternatives {
  flex-shrink: 0;
}
.chart-header .btn-more-alternatives .expand-label {
  font-size: 0.85em;
}

.air-curtain-alternative {
  background-color: rgba(158,158,158,0.06);
}
body.dark-mode .air-curtain-alternative {
  background-color: rgba(158,158,158,0.1);
}

/* New air curtain alternative combination rows */
.device-alternative-row,
.alternative-combination {
  background-color: rgba(158,158,158,0.06);
}
body.dark-mode .device-alternative-row,
body.dark-mode .alternative-combination {
  background-color: rgba(158,158,158,0.1);
}

.alternative-header {
  background-color: rgba(158,158,158,0.08);
  font-style: italic;
}
.alternative-header td {
  color: rgba(0,0,0,0.6);
  font-size: 0.9em;
  padding: 6px 12px;
}
body.dark-mode .alternative-header {
  background-color: rgba(158,158,158,0.12);
}
body.dark-mode .alternative-header td {
  color: rgba(255,255,255,0.6);
}

/* Air curtain column styles */
.air-curtain-table .col-opening {
  max-width: 180px;
}
.air-curtain-table .col-opening .opening-desc {
  font-size: 0.85em;
  color: rgba(0,0,0,0.65);
}
body.dark-mode .air-curtain-table .col-opening .opening-desc {
  color: rgba(255,255,255,0.65);
}

/* Multi-line device model in air curtain table */
.air-curtain-table .device-model {
  line-height: 1.8;
  white-space: normal;
  word-wrap: break-word;
  padding: 4px 0;
  display: block;
}
.air-curtain-table .device-selection-row {
  height: auto !important;
  min-height: 80px;
}
.air-curtain-table .device-selection-row td {
  vertical-align: top;
  padding-top: 14px;
  padding-bottom: 14px;
  height: auto;
}
.air-curtain-table .device-name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.air-curtain-table .device-type {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary, #333);
  line-height: 1.3;
}
.air-curtain-table .device-manufacturer {
  font-size: var(--font-size-sm);
  color: var(--text-secondary, #666);
  line-height: 1.3;
}

/* Air curtain table layout - prevent text overlap */
.air-curtain-table {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
}
.air-curtain-table th,
.air-curtain-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 6px;
}
/* Air curtain table uses shared column widths from .device-selection-table */
/* Only override col-device for curtains due to longer names */
.air-curtain-table .col-device {
  width: 22%;
  min-width: 180px;
  max-width: 250px;
  white-space: normal;
  word-wrap: break-word;
}
/* Remove old specific column width overrides - use shared styles instead */
.air-curtain-table .col-info {
  width: 50px;
  min-width: 50px;
  text-align: center;
}
body.dark-mode .air-curtain-table .device-type {
  color: var(--text-primary-dark, #eee);
}
body.dark-mode .air-curtain-table .device-manufacturer {
  color: var(--text-secondary-dark, #aaa);
}

/* === UNIFIED DEVICE SELECTION TABLE STYLES === */
/* Apply consistent styling to all device selection tables */
.device-selection-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Ensure vertical alignment for all cells */
.device-selection-table td,
.air-curtain-table td {
  vertical-align: middle;
}

.device-selection-table td.col-device,
.air-curtain-table td.col-device {
  vertical-align: middle !important;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Unified column widths for all device selection tables */
.device-selection-table .col-device,
.air-curtain-table .col-device {
  min-width: 180px;
  max-width: 250px;
  width: 22%;
}
.device-selection-table .col-image,
.air-curtain-table .col-image {
  width: 80px;
  min-width: 80px;
  text-align: center;
}
.device-selection-table .col-qty,
.air-curtain-table .col-qty {
  width: 70px;
  min-width: 70px;
  text-align: right;
}
.device-selection-table .col-cap,
.air-curtain-table .col-cap {
  width: 140px;
  min-width: 140px;
  text-align: right;
}
.device-selection-table .col-setting,
.air-curtain-table .col-setting {
  width: 220px;
  min-width: 220px;
  text-align: left;
}
/* Bilans and Nastawa column subtle highlight — data cells only, headers stay neutral */
.device-selection-table td.col-cap,
.device-selection-table td.col-setting,
.air-curtain-table td.col-cap,
.air-curtain-table td.col-setting {
  background-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.03);
}
.device-selection-row:hover td.col-cap,
.device-selection-row:hover td.col-setting {
  background-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.09);
}
body.dark-mode .device-selection-row:hover td.col-cap,
body.dark-mode .device-selection-row:hover td.col-setting {
  background-color: rgba(var(--primary-color-rgb), 0.18);
}
.device-selection-table .col-supply {
  width: 90px;
  min-width: 80px;
  text-align: right;
}
.device-selection-table .col-margin {
  width: 80px;
  min-width: 70px;
  text-align: right;
}
.device-selection-table .col-options,
.air-curtain-table .col-options {
  width: 50px;
  min-width: 50px;
  text-align: center;
}
.device-selection-table .col-info,
.air-curtain-table .col-info {
  width: 50px;
  min-width: 50px;
  text-align: center;
}
.device-selection-table .col-actions,
.air-curtain-table .col-actions {
  width: 90px;
  min-width: 80px;
  text-align: center;
}
.device-selection-table .col-score {
  width: 70px;
  min-width: 60px;
  text-align: center;
}
/* Air curtain specific columns */
.air-curtain-table .col-length {
  width: 80px;
  min-width: 70px;
  text-align: right;
}
.air-curtain-table .col-reach {
  width: 80px;
  min-width: 70px;
  text-align: right;
}
.air-curtain-table .col-heating-type {
  width: 100px;
  min-width: 90px;
  text-align: left;
}
.air-curtain-table .col-heating-power {
  width: 90px;
  min-width: 80px;
  text-align: right;
}

/* Auto-height rows for all device tables */
.device-selection-table .device-selection-row,
.air-curtain-table .device-selection-row,
table.summary-table .device-selection-row {
  height: auto !important;
  min-height: 50px;
}
.device-selection-table .device-selection-row td,
.air-curtain-table .device-selection-row td,
table.summary-table .device-selection-row td {
  vertical-align: middle;
  padding: 8px 6px;
  height: auto;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
}
.device-selection-table .device-selection-row td.col-device,
.air-curtain-table .device-selection-row td.col-device,
table.summary-table .device-selection-row td.col-device {
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 14px;
}

/* Device name block - ensure text wraps properly */
.device-name-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
  overflow: visible;
}
/* Device type/role tags row must never be clipped */
.device-name-block .device-type-tags-row,
td.col-device > .device-type-tags-row {
  overflow: visible;
  flex-shrink: 0;
}
.device-name-block .device-type {
  font-weight: 600;
  font-size: var(--font-size-sm);
  line-height: 1.2;
  white-space: normal;
  word-wrap: break-word;
}
.device-name-block .device-manufacturer {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.2;
}
.device-name-block .device-model {
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.25;
  white-space: normal;
  word-wrap: break-word;
}
body.dark-mode .device-name-block .device-manufacturer {
  color: #aaa;
}


/* Device name block dark mode overrides */
body.dark-mode .device-selection-table .device-type,
body.dark-mode .air-curtain-table .device-type {
  color: var(--text-primary-dark, #eee);
}
body.dark-mode .device-selection-table .device-manufacturer,
body.dark-mode .air-curtain-table .device-manufacturer {
  color: var(--text-secondary-dark, #aaa);
}
body.dark-mode .device-selection-table .device-model,
body.dark-mode .air-curtain-table .device-model {
  color: var(--text-primary-dark, #eee);
}

/* === END UNIFIED DEVICE SELECTION TABLE STYLES === */

.air-curtain-row .col-select {
  text-align: center;
  width: 40px;
}
.device-select-checkbox {
  display: inline-block;
}
.device-select-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.device-selection-aggregate-row {
  background-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.1);
}
.device-selection-aggregate-row td {
  border-top: 1px solid rgba(0,0,0,0.12);
}
.device-selection-aggregate-row .aggregate-label {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.68);
}
.device-selection-aggregate-row .aggregate-cell .device-cap-label {
  color: rgba(0,0,0,0.58);
}
body.dark-mode .device-selection-aggregate-row {
  background-color: rgba(var(--primary-color-rgb), 0.24);
}
body.dark-mode .device-selection-aggregate-row td {
  border-top: 1px solid rgba(224,224,224,0.14);
}
body.dark-mode .device-selection-aggregate-row .aggregate-label {
  color: rgba(224,224,224,0.78);
}
body.dark-mode .device-selection-aggregate-row .aggregate-cell .device-cap-label {
  color: rgba(224,224,224,0.7);
}
.device-cap-cell .device-role-block,
.device-modulation-cell .device-role-block,
.device-supply-cell .device-role-block,
.device-margin-cell .device-role-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0;
  justify-content: center;
  align-items: center;
}
.device-cap-cell .device-role-block + .device-role-block,
.device-modulation-cell .device-role-block + .device-role-block,
.device-supply-cell .device-role-block + .device-role-block,
.device-margin-cell .device-role-block + .device-role-block {
  border-top: 1px solid rgba(0,0,0,0.08);
  margin-top: 8px;
  padding-top: 8px;
}
.device-role-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(0,0,0,0.78);
  text-align: center;
  margin-bottom: 6px;
}
.device-role-label--muted {
  color: rgba(0, 0, 0, 0.56);
  font-weight: 500;
}
.device-role-margin-value {
  text-align: center;
  font-weight: 600;
  font-size: var(--font-size-sm);
}
.device-supply-value {
  display: block;
  text-align: center;
  font-weight: 600;
  font-size: var(--font-size-sm);
}
.device-role-modulation {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-role-block .device-cap-row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
}

.device-role-block .device-cap-label {
  font-size: 0.75em;
  color: rgba(0, 0, 0, 0.58);
  text-align: right;
  min-width: max-content;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.device-role-block .device-cap-value {
  font-weight: 600;
  font-size: 0.85em;
}
.device-role-block:last-child { padding-bottom: 4px; }

/* Multi-function device modulation controls */
.device-role-modulation {
  margin-top: 4px;
  min-height: 28px;
}
.device-role-modulation .modulation-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  min-width: 160px;
}
.device-role-modulation .modulation-range {
  font-size: 0.85em;
  color: var(--text-dark);
  line-height: 1.3;
}
.device-role-modulation .modulation-output {
  font-size: 0.85em;
  color: var(--text-dark);
  line-height: 1.3;
}
.device-role-modulation .modulation-stage-select {
  max-width: 220px;
  font-size: 0.85em;
  color: var(--text-dark);
}
.device-role-modulation .modulation-unit {
  font-size: 0.85em;
  color: var(--text-dark);
  margin-left: 4px;
}

body.dark-mode .device-role-label { color: rgba(224,224,224,0.9); }
body.dark-mode .device-role-label--muted { color: rgba(224,224,224,0.72); }
body.dark-mode .device-role-block + .device-role-block { border-top-color: rgba(255,255,255,0.12); }
body.dark-mode .device-role-margin-value { color: rgba(224,224,224,0.95); }
body.dark-mode .device-supply-value { color: rgba(224,224,224,0.95); }
body.dark-mode .device-role-modulation .modulation-range,
body.dark-mode .device-role-modulation .modulation-output,
body.dark-mode .device-role-modulation .modulation-stage-select,
body.dark-mode .device-role-modulation .modulation-unit { color: rgba(224,224,224,0.78); }
body.dark-mode .modulation-percent-input {
  background: rgba(32,32,32,0.9);
  border-color: rgba(255,255,255,0.24);
  color: rgba(224,224,224,0.95);
}
body.dark-mode .modulation-percent-suffix {
  color: rgba(224,224,224,0.78);
}

/* Container */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}

/* ==========================================================================
   3. FORM ELEMENTS
   ========================================================================== */

/* Fieldsets */
fieldset {
  border: 1px solid var(--border-color);
  padding: 14px 14px 10px 14px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}


/* Buttons: gradient + glass effect */
.btn, .start-button,
button#welcomeStartBtn,
button#calculate,
button#generateReportBtn,
button#downloadConfigCodeBtn,
button#importConfigBtn,
button#nextTab,
button#prevTab {
  border-radius: var(--radius-lg) !important;
  background: var(--primary-gradient) !important;
  color: #fff !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--shadow-lg) !important;
  backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 2px));
}

/* Subtle sheen animations (header: one-off, buttons: looping) */
@keyframes sheen-sweep {
  0% { transform: translateX(-140%); }
  100% { transform: translateX(140%); }
}

/* Make element a container for sheen overlay */
.sheen-once::after, .sheen-loop::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(110deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.22) 45%,
    rgba(255,255,255,0.42) 50%,
    rgba(255,255,255,0.22) 55%,
    rgba(255,255,255,0) 100%
  );
  will-change: transform;
}

/* One-time sweep on header */
.sheen-once::after {
  animation: sheen-sweep 1200ms ease-out 150ms 1 both;
}
/* Gentle, periodic sweep on start/calculate */
.sheen-loop::after {
  animation: sheen-sweep 2400ms ease-in-out 1800ms infinite;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sheen-once::after, .sheen-loop::after { animation: none !important; }
}

/* Ensure key action buttons match the NEXT button style (solid primary color) */
.start-button,
#reportBtn,
#reportBtnResults,
#pdfBtn,
#aiEmailBtn,
#calculateBtn,
#equipmentLoadBtn {
  background: var(--primary-color) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  text-transform: uppercase !important;
}
.start-button:hover,
#reportBtn:hover,
#reportBtnResults:hover,
#pdfBtn:hover,
#aiEmailBtn:hover,
#calculateBtn:hover,
#equipmentLoadBtn:hover { background: var(--primary-dark) !important; }
.start-button:active,
#reportBtn:active,
#reportBtnResults:active,
#pdfBtn:active,
#aiEmailBtn:active,
#calculateBtn:active,
#equipmentLoadBtn:active { filter: brightness(0.97); }

#equipmentLoadBtn.is-loading {
  opacity: 0.72;
  cursor: progress;
}

/* App Bar (modern header) */
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--primary-color);
  color: #fff;
  padding: 10px 24px;
  min-height: var(--appbar-height);
}
.app-bar .banner-logo img {
  height: 46px;
  width: auto;
  display: block;
}


/* Ensure person icon and hamburger are the same size and aligned */
.app-bar .user-account-toggle,
.app-bar .device-catalog-toggle,
.app-bar .menu-toggle {
  width: 40px;
  height: 40px;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-bar .user-account-toggle svg,
.app-bar .device-catalog-toggle svg {
  width: 24px;
  height: 24px;
}

.menu-dropdown { position: relative; }

/* User Account Icon */
.user-account-toggle,
.device-catalog-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-round);
  transition: background-color 0.2s ease, transform 0.2s ease;
  color: #fff;
  position: relative;
}

.user-account-toggle:hover,
.device-catalog-toggle:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.05);
}

/* Zalogowany — zielona kropka badge */
.user-account-toggle.user-logged-in::after {
  content: '';
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  background: #4CAF50;
  border-radius: var(--radius-round);
  border: 2px solid var(--primary-color);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  pointer-events: none;
}

.user-account-toggle:focus-visible,
.device-catalog-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.user-account-toggle svg,
.device-catalog-toggle svg {
  display: block;
}

body.dark-mode .user-account-toggle,
body.dark-mode .device-catalog-toggle {
  color: #fff;
}

body.dark-mode .user-account-toggle:hover,
body.dark-mode .device-catalog-toggle:hover {
  background: rgba(255,255,255,0.2);
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-xxs);
  border-radius: var(--radius-round);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Spojnie z sasiednimi przyciskami app-baru (konto, katalog): podswietlamy
   TLO przycisku, nie kolor kresek — te pozostaja biale. Motywy OEM moga
   nadpisac kolor kresek w themes/*.css. */
.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: rgb(255 255 255 / 15%);
  transform: scale(1.05);
}

.menu-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.menu-toggle-line {
  display: block;
  width: 28px;
  height: 3px;
  border-radius: var(--radius-xs);
  background: #fff;
  transition: background-color 0.2s ease;
}

/* Dark mode app bar: use dark surface, not green */
body.dark-mode .app-bar {
  background: var(--appbar-bg) !important;
  color: #fff !important;
}
body.dark-mode .menu-toggle-line {
  background: #fff !important;
}

.menu-popup {
  display: none;
  position: fixed;
  right: 36px;
  top: 84px;
  /* Keep below modal overlay (4000) and modal (5000) */
  z-index: var(--z-dropdown);
  width: 280px;
  max-width: calc(100vw - var(--space-lg));
}

.menu-popup.show {
  display: block;
}

.menu-popup-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  overflow: hidden;
  /* More top padding so the close × doesn't overlap the first link */
  padding-top: calc(var(--space-xl) + var(--space-xs));
  padding-bottom: var(--space-md);
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(calc(var(--glass-blur) + 2px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) + 2px));
  border: 1px solid var(--glass-border);
}

.menu-popup-links {
  display: flex;
  flex-direction: column;
}

.menu-popup-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.1em;
  padding: var(--space-lg) var(--space-xl);
  text-decoration: none;
  border-radius: 0;
  gap: var(--space-xs);
  text-align: left;
}


.menu-popup-link + .menu-popup-link {
  border-top: 1px solid var(--glass-border);
}

.menu-popup-link:hover,
.menu-popup-link:focus {
  background: rgba(var(--primary-color-rgb, 0, 150, 136),0.08);
}

/* Hoverable sections for Regional and Units */
.menu-section {
  /* Reduced top padding to shrink space above section titles */
  padding: var(--space-md) var(--space-xl) var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--glass-border);
  transition: background-color .35s var(--easing-spring);
}
.menu-section:hover,
.menu-section:focus-within {
  background: rgba(var(--primary-color-rgb, 0, 150, 136),0.08);
}
.menu-section-title {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.menu-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.menu-section-header .menu-language-title {
  display: inline-block;
  margin-bottom: 0 !important;
}
.detected-location-subtitle {
  font-size: 0.75em;
  color: #666;
  margin-top: 2px;
  margin-bottom: 8px;
  font-weight: normal;
  opacity: 0.8;
}
/* Normalize inner spacing in sections */
.menu-section .menu-language-title {
  margin-top: 10px !important;
  margin-bottom: 6px !important;
}
.menu-section .menu-language-title.menu-section-title { margin-top: 0 !important; }
.menu-section .lang-dropdown {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}
/* Remove extra wrapper padding so Language/Currency match Units spacing */
.menu-section .lang-dropdown-wrapper {
  padding: 0 !important;
  gap: 0 !important;
}
/* Avoid double horizontal padding for Google translate host inside sections */
.menu-section .menu-translate-host { padding: 0 0 var(--space-sm) 0; }
/* If Google translate host is empty, collapse spacing so Language/ Currency gap matches Units */
.menu-section .menu-translate-host:empty {
  padding: 0 !important;
  height: 0 !important;
  margin: 0 !important;
}

/* Ensured parity: Regional section uses the same spacing as Units (no special compact overrides) */

.menu-popup-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted-text, #607d8b);
  font-size: 20px;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.menu-popup-close:hover,
.menu-popup-close:focus-visible {
  color: var(--text-dark, #222);
  background: rgb(0 0 0 / 6%);
}

body.dark-mode .menu-popup-card {
  background: var(--dark-surface);
  box-shadow: 0 8px 32px rgba(0,0,0,0.44);
}

body.dark-mode .menu-popup-close {
  color: var(--bluegray-300);
}

body.dark-mode .menu-popup-close:hover,
body.dark-mode .menu-popup-close:focus-visible {
  color: var(--gray-300);
  background: rgb(255 255 255 / 8%);
}

body.dark-mode .menu-popup-link {
  color: #4dd0e1;
}

body.dark-mode .menu-popup-link:hover,
body.dark-mode .menu-popup-link:focus {
  background: rgba(77,208,225,0.12);
}
body.dark-mode .menu-section:hover,
body.dark-mode .menu-section:focus-within {
  background: rgba(77,208,225,0.12);
}

.menu-language-title {
  display: block;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.05em;
  margin-bottom: var(--space-xxs);
}

.menu-translate-host {
  padding: 0 var(--space-xl) var(--space-sm) var(--space-xl);
}

@media (max-width: 880px) {
  .menu-popup {
    right: 12px;
    left: auto;
    top: calc(var(--appbar-height) + var(--tabs-height) + 8px);
  }

  .menu-popup-card {
    min-width: 240px;
    max-width: min(360px, calc(100vw - 24px));
  }
}

/* Sticky app bar with subtle glass effect (consistent with fullscreen) */
.glass-surface {
  background: var(--surface, rgba(255,255,255,0.6));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 3050; /* sit above tab bar */
}
.app-bar { background: var(--primary-gradient) !important; }
.app-bar { box-shadow: var(--shadow-lg); }
.app-bar { padding: 8px 20px; }
.app-bar { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
/* cleaned up: retained concrete app-bar styles above */
/* Ensure app bar uses glass-surface characteristics */
.app-bar { background: var(--appbar-bg) !important; }
body.dark-mode .app-bar { background: var(--appbar-bg) !important; }

/* Language dropdown list surface */
.lang-list {
  background: var(--surface) !important;
  border-color: var(--border-color) !important;
}

body.dark-mode .lang-current {
  background: #2a3a38 !important;
  border-color: var(--primary-color) !important;
  color: #fff !important;
}

body.dark-mode .lang-list button { color: var(--gray-300) !important; }
body.dark-mode .lang-list button:hover { background: rgba(77,208,225,0.12) !important; }

/* Select styling */
.input-field .select-wrapper input.select-dropdown {
  padding-right: 28px !important;
  height: 3rem !important;
  line-height: 3rem !important;
  margin-top: 0 !important;
  box-sizing: border-box;
  text-overflow: ellipsis;
  white-space: nowrap;
}

fieldset .input-field .select-wrapper input.select-dropdown {
  height: 3rem !important;
  line-height: 3rem !important;
  margin-top: 0 !important;
  padding-right: 28px !important;
  box-sizing: border-box;
}

/* Dark mode select dropdown text visibility (Materialize) */
body.dark-mode .select-wrapper input.select-dropdown {
  background: #2b2f33 !important;
  color: var(--gray-300) !important;
}
body.dark-mode .dropdown-content li > a, 
body.dark-mode .dropdown-content li > span {
  color: var(--gray-300) !important;
}

/* Native selects (fallback) */
body.dark-mode select {
  background: #2b2f33 !important;
  color: var(--gray-300) !important;
}

/* Specific: Building Orientation select and its generated input */
body.dark-mode #building_rotation,
body.dark-mode #building_rotation + input.select-dropdown {
  color: var(--gray-300) !important;
}

/* Global dropdown overlay behavior */
.dropdown-content {
  max-height: 60vh !important;
  overflow-y: auto !important;
  z-index: var(--z-dropdown) !important;
}

/* Non-selected dropdown items use neutral text color; only selected uses theme color */
.dropdown-content li > a,
.dropdown-content li > span {
  color: var(--text-dark, #555) !important;
}

.dropdown-content li.selected > a,
.dropdown-content li.selected > span {
  color: var(--primary-color) !important;
}
@media (max-width: 600px) {
  .dropdown-content { max-height: 70vh !important; }
}

/* Mobile: make Insulation Level select full width */
@media (max-width: 600px) {
  #insulationRatingContainer .col.s6 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  #insulationRatingContainer .select-wrapper,
  #insulationRatingContainer input.select-dropdown {
    width: 100% !important;
  }
  /* Ensure all columns/inputs in the insulation block span full width on mobile */
  #insulationRatingContainer .col,
  #insulationRatingContainer .col.s12,
  #insulationRatingContainer .input-field {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  /* Force the generated Materialize input to fill width */
  #insulation_rating + input.select-dropdown { width: 100% !important; }
}

fieldset .input-field .select-wrapper + label,
fieldset .input-field > label.active {
  top: -6px !important;
  line-height: 1.2 !important;
}

/* Single slope dropdown label - block display to prevent overlap */
#singleSlopeOptions > div:first-child {
  display: block !important;
  position: static !important;
  margin-bottom: 12px !important;
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

#singleSlopeOptions .select-wrapper {
  display: block !important;
  position: relative !important;
  margin-top: 0 !important;
}

#singleSlopeOptions .select-wrapper + label {
  display: none !important; /* Hide Materialize's auto-generated label */
}

/* ==========================================================================
   4. LAYOUT SECTIONS
   ========================================================================== */

/* Special Options Containers */
.temp-special-options {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  padding-left: var(--space-md);
  margin: 0 0 var(--space-lg) 0;
  padding-bottom: var(--space-sm);
  border-bottom: 1px dashed rgba(0,0,0,0.25);
}

.temp-special-options > * {
  width: 100%;
}

.temp-special-options .heating-type-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.temp-special-options .heating-type-inline.hidden {
  visibility: hidden !important;
}

.temp-special-options .heating-type-inline label {
  margin: 0;
  font-weight: normal;
}

.temp-special-options .heating-type-inline select {
  min-width: 160px;
}

.temp-special-options .heating-type-inline .select-wrapper {
  margin: 0 !important;
}

.temp-special-options .heating-type-inline .select-wrapper input.select-dropdown {
  margin-top: 0 !important;
  height: 3rem;
  line-height: 3rem;
  padding: 0 8px;
}

.temp-special-options .include-temp-gradient-wrapper {
  margin-top: var(--space-xxs);
}

/* Configuration containers */
#advancedUExternalContainer,
#configurationOptionsContainer {
  padding-left: 16px;
  margin-bottom: 12px; /* tighter */
  padding-bottom: 6px; /* tighter */
  border-bottom: none; /* remove dashed under configuration */
}

#configurationOptionsContainer.climate-config-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

#configurationOptionsContainer.climate-config-content > * {
  width: 100%;
}


/* Responsive horizontal/vertical checkbox layout */
.config-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
  width: 100%;
}

@media (max-width: 600px) {
  .config-option {
    /* Keep label/checkbox and the info icon on one line */
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--space-xxs);
  }
}

.operation-config-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-left: 16px;
  margin-bottom: 12px;
  padding-bottom: 6px;
}

.operation-config-content > * {
  width: 100%;
}

@media (max-width: 600px) {
  #configurationOptionsContainer.climate-config-content {
    width: 100%;
  }
  
  .operation-config-content {
    width: 100%;
  }
}

/* Single slope controls */
#singleSlopeControlsContainer {
  padding-left: 16px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: none; /* remove dashed here too */
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 32px;
}

#singleSlopeControlsContainer .heating-type-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  white-space: normal;
  margin-top: 12px;
}

/* Legacy label selector - keeping for backwards compatibility */
#singleSlopeOptions label[for="singleSlopeDirection"] {
  display: block !important;
  position: static !important;
  margin-bottom: 12px !important;
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

#singleSlopeControlsContainer .heating-type-inline.hidden {
  visibility: hidden !important;
}

#singleSlopeControlsContainer .heating-type-inline select {
  min-width: 160px;
  width: 100%;
  margin-top: 0;
}

#singleSlopeControlsContainer .heating-type-inline .select-wrapper {
  margin: 0 !important;
  width: 100%;
  position: relative;
  margin-top: 0 !important;
}

#singleSlopeControlsContainer .heating-type-inline .select-wrapper input.select-dropdown {
  margin-top: 0 !important;
  height: 3rem;
  line-height: 3rem;
  padding: 0 8px;
}

/* Ensure dropdown wrapper doesn't overlap label */
#singleSlopeOptions .heating-type-inline > span {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

#singleSlopeExternalContainer {
  padding-left: 16px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 8px 32px;
  flex-wrap: wrap;
}

/* ==========================================================================
   5. MAP COMPONENT
   ========================================================================== */

#map-container {
  width: 100%;
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  background: var(--gray-300);
  min-height: 330px;
  height: 48vh;
  max-height: 90vh;
}


#location-notification {
  position: absolute;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.55);
  color: #000;
  padding: 8px 32px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--glass-border);
  font-weight: bold;
  font-family: Arial, sans-serif;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: var(--z-overlay);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  text-align: center;
}

/* Map fullscreen button */
.map-fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  background: white;
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: var(--radius-xs);
  cursor: pointer;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  padding: 0;
}

.map-fullscreen-btn:hover {
  background: var(--light-gray);
  border-color: rgba(0,0,0,0.3);
  box-shadow: var(--shadow-md);
}


/* Fullscreen overlay backdrop */
.map-fullscreen-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9998;
}


/* Fullscreen map container - now as a modal */
#map-container.fullscreen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  height: 80vh;
  max-width: 90vw;
  max-height: 80vh;
  z-index: 9999;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}



/* Sortable Table Headers */

.sortable-header:hover {
  background-color: rgba(0,0,0,0.05);
}





/* ==========================================================================
   6. TAB NAVIGATION
   ========================================================================== */

.tab-navigation {
  background: var(--tabs-bg);
  margin: 0 0 20px 0;
  padding: 0;
  box-shadow: var(--shadow-md);
}

/* Sticky tab bar below app bar with glass effect */

/* Desktop: ensure tab content has proper spacing below sticky tabs */
@media (min-width: 881px) {
  .tab-content {
    scroll-margin-top: calc(var(--appbar-height) + var(--tabs-height) + 16px);
  }
}

/* Mobile: keep the app-bar and tabs fixed on top so they never scroll away */
@media (max-width: 880px) {
  .app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-overlay); /* ensure it sits above everything */
    min-height: var(--appbar-height);
    padding: 8px 12px;
  }

  .tab-navigation {
    position: fixed;
    top: calc(var(--appbar-height));
    left: 0;
    right: 0;
    z-index: 3950; /* just below app-bar */
    margin: 0;
    box-shadow: var(--shadow-xl);
  }

  /* push main page content down so it isn't hidden under fixed bars */
  /* apply only to top-level container to avoid double spacing */
  .page-content, main, body > .container {
    padding-top: calc(var(--appbar-height) + var(--tabs-height) + 8px) !important;
  }
  
  /* ensure tab content doesn't overlap with fixed tabs */
  .tab-content {
    padding-top: 12px !important;
  }
  
  /* Fix hero section negative margin eating into fixed header padding */
  .start-section-hero {
    margin-top: 0 !important;
  }

  /* ensure nav tabs remain horizontally scrollable on small screens */
  .nav-tabs { overflow-x: auto; }
}

.nav-tabs {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  white-space: nowrap;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
}


.nav-tab a {
  display: block;
  padding: 12px 16px;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  border-right: 1px solid rgba(255,255,255,0.2);
  transition: background var(--transition);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.nav-tab a:hover {
  background: rgba(255,255,255,0.2);
}


/* Tab Content */


/* Tab Navigation Buttons */
.tab-navigation-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  margin-bottom: 12px; /* small gap after NEXT/BACK */
  padding-top: 20px;
  border-top: 1px solid var(--gray-300);
  gap: 16px;
}


.tab-navigation-buttons .btn-back {
  background: var(--gray-600) !important;
}

.tab-navigation-buttons .btn-back:hover {
  background: var(--gray-700) !important;
}

.tab-navigation-buttons .btn-next {
  background: var(--primary-color) !important;
}

.tab-navigation-buttons .btn-next:hover {
  background: var(--primary-dark) !important;
}

/* ==========================================================================
   7. START SECTION LAYOUT
   ========================================================================== */

/* Default: hide Input Parameters block in results; JS will reveal when user opts in */

.start-section {
  text-align: center;
  padding: 12px 20px 40px;
  background: #f8f9fa;
  border-radius: var(--radius-md);
  margin: 20px 0;
}

/* ========================================
   REDESIGNED START PAGE - HERO SECTION
   ======================================== */

.start-section-hero {
  background: linear-gradient(135deg, #0C7C84 0%, #043F4A 100%);
  padding: 40px 20px;
  margin: -20px -20px 30px -20px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.start-section-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-icon {
  display: inline-block;
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-xl);
  padding: 12px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.hero-icon svg {
  width: 100%;
  height: 100%;
  stroke: white;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
  animation: fadeInUp 0.8s ease-out forwards;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin: 0 0 12px 0;
  opacity: 0.95;
  font-weight: 400;
  line-height: 1.6;
}

.hero-tagline {
  font-size: var(--font-size-base);
  opacity: 0;
  font-style: italic;
  margin: 0;
  font-weight: 300;
  animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

/* ========================================
   CONTENT WRAPPER & TWO COLUMNS
   ======================================== */



/* ========================================
   FEATURES SECTION - CARDS GRID
   ======================================== */


.start-features-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}






@keyframes featureFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-heading {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin: 0 0 24px 0;
  font-weight: 600;
}

/* Single Features Card with List */
.features-single-card {
  background: var(--white);
  border: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136),0.12);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  min-height: 320px;
}

.features-single-card:hover {
  box-shadow: 0 6px 20px rgba(var(--primary-color-rgb, 0, 150, 136),0.15);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136),0.3);
}

.features-single-card .section-heading {
  margin-top: 0;
  margin-bottom: 16px;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.features-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--text-dark);
  padding-left: 0;
}

.features-list li::before {
  content: '•';
  color: var(--primary-color);
  font-size: var(--font-size-lg);
  font-weight: bold;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.features-list li span {
  flex: 1;
  color: var(--gray-900);
  font-weight: 500;
}

/* Old feature-card and feature-text styles (kept for backward compatibility) */
.features-grid {
  display: grid;
  gap: 16px;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--white);
  border: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136),0.12);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-color-rgb, 0, 150, 136),0.15);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136),0.3);
}

.feature-card .feature-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 0, 150, 136), 0.12), rgba(var(--primary-color-rgb, 0, 150, 136), 0.06));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-card .feature-icon svg {
  stroke: var(--primary-color);
  width: 24px;
  height: 24px;
}

.feature-text {
  flex: 1;
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--text-dark);
}

.feature-text strong {
  color: var(--gray-900);
  font-weight: 600;
}

/* ========================================
   MODE CARDS - NEW DESIGN
   ======================================== */

.mode-and-actions {
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.start-mode-selection-cards {
  background: var(--white);
  border: 1px solid rgba(var(--primary-color-rgb, 0, 150, 136),0.12);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  min-height: 320px;
}

.start-mode-selection-cards:hover {
  box-shadow: 0 6px 20px rgba(var(--primary-color-rgb, 0, 150, 136),0.15);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136),0.3);
}

.start-mode-selection-cards .section-heading {
  margin-top: 0;
  margin-bottom: 14px;
}

.mode-description {
  color: var(--text-dark);
  font-size: var(--font-size-md);
  margin: 0 0 12px 0;
  opacity: 0.85;
}

.mode-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* scope-cards-grid: source of truth in hero.css */

.mode-card {
  display: block;
  cursor: pointer;
  position: relative;
}

.mode-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--white);
  border: 2px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.15);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  min-height: 46px;
}

.mode-card:hover .mode-card-content {
  transform: translateY(-1px);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.55);
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.03);
  box-shadow: 0 4px 14px rgba(var(--primary-color-rgb, 0, 150, 136), 0.15);
}

.mode-checkbox:checked + .mode-card-content {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.03);
  border-color: var(--primary-color);
  box-shadow: 0 4px 14px rgba(var(--primary-color-rgb, 0, 150, 136), 0.15);
}

/* Checkbox indicator styles */




.scope-card .mode-card-content {
  padding: 8px 12px;
  min-height: 42px;
}

.mode-card-text {
  flex: 1;
}

.mode-card-text strong {
  display: block;
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 3px;
}

.mode-card-text small {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dark);
  opacity: 0.8;
  line-height: 1.3;
}

.mode-card-note {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(216, 67, 21, 0.1);
  color: #d84315;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mode-card .info-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.1);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.mode-card .info-icon:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

/* ========================================
   LOCKED MODE CARD (requires login)
   ======================================== */

.mode-card-login-badge {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.07);
  color: #666;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 6px;
  width: fit-content;
}

.mode-card-login-badge .material-icons {
  font-size: var(--font-size-md);
  line-height: 1;
}

.mode-card--locked {
  cursor: default;
}

.mode-card--locked .mode-card-content {
  opacity: 0.65;
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
  cursor: default;
}

.mode-card--locked:hover .mode-card-content {
  transform: none;
  box-shadow: none;
  border-color: rgba(0, 0, 0, 0.08);
  cursor: default;
}

.mode-card--locked .mode-card-login-badge {
  display: flex;
}

.mode-card--locked .mode-card-text strong {
  color: #666;
}

/* ========================================
   SUB-OPTION STYLES (Known Loads)
   ======================================== */

.mode-sub-option {
  display: none; /* Hidden by default, shown by JavaScript */
  margin-left: 32px;
  margin-top: 4px;
  margin-bottom: 4px;
  padding-left: 12px;
  border-left: 3px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.2);
}

.mode-sub-card {
  display: block;
  cursor: pointer;
  position: relative;
}

.mode-sub-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-sub-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--white);
  border: 1.5px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.15);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  position: relative;
}

.mode-sub-card:hover .mode-sub-card-content {
  background: rgba(255,255,255,0.95);
  border-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.3);
  box-shadow: 0 2px 8px rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
}

.mode-sub-checkbox:checked + .mode-sub-card-content {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.03);
  border-color: var(--primary-color);
  box-shadow: 0 2px 12px rgba(var(--primary-color-rgb, 0, 150, 136), 0.15);
}

.mode-sub-card-text {
  flex: 1;
}

.mode-sub-card-text strong {
  display: block;
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 3px;
}

.mode-sub-card-text small {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dark);
  opacity: 0.75;
  line-height: 1.35;
}

.mode-sub-card .info-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.mode-sub-card .info-icon:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

/* ========================================
   ACTION BUTTONS - ENHANCED
   ======================================== */

.start-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-start-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 32px;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--primary-light, #00BFA5), var(--primary-color, #009688));
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  min-width: 280px;
  width: 100%;
  max-width: 480px;
  text-transform: uppercase;
}

.btn-start-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: var(--radius-round);
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-start-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-start-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-start-primary:active {
  transform: translateY(0);
}

.btn-start-primary svg {
  position: relative;
  z-index: 1;
}

.btn-start-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 32px;
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--primary-color);
  background: white;
  border: 2px solid rgba(var(--primary-color-rgb, 0, 150, 136),0.3);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 280px;
  width: 100%;
  max-width: 480px;
  text-transform: uppercase;
}

.btn-start-secondary:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136),0.05);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.btn-start-secondary svg {
  stroke: var(--primary-color);
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 900px) {
  .start-two-columns {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .hero-title {
    font-size: 2.2rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .hero-tagline {
    font-size: var(--font-size-base);
  }
  
  .start-section-hero {
    padding: 40px 20px;
  }
}

/* OLD STYLES - KEEP FOR COMPATIBILITY */

.start-layout {
  display: flex;
  gap: 40px;
  align-items: stretch;
  min-height: 500px;
}

.start-left-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 20px;
  min-width: 0;
}

.start-right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-left: 20px;
  min-width: 0;
}

.main-graphic {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  display: block;
}

/* Hero SVG polish: glass card look in Start tab */
.main-graphic-svg {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  padding: 8px;
}

.start-left-column h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: var(--font-size-2xl);
  margin-top: 0;
  text-align: left;
  line-height: 1.2;
}

.start-left-column p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-dark);
  margin-bottom: 30px;
  text-align: left;
  flex-grow: 1;
}

.start-left-column p strong {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.start-buttons-row {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

/* Application Mode Selection */
.start-mode-selection {
  background: rgba(var(--primary-color-rgb, 0, 150, 136),0.05);
  border: 2px solid rgba(var(--primary-color-rgb, 0, 150, 136),0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 30px 0;
  text-align: left;
}

.start-mode-selection h3 {
  color: var(--primary-color);
  font-size: 1.4rem;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.mode-description {
  color: var(--text-dark);
  font-size: var(--font-size-md);
  margin: 0 0 20px 0;
  opacity: 0.85;
}

.mode-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-option {
  display: flex !important;
  align-items: flex-start;
  padding: 16px;
  background: var(--white);
  border: 2px solid rgba(var(--primary-color-rgb, 0, 150, 136),0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  max-width: 100%;
  overflow: hidden;
}

.mode-option:hover {
  border-color: var(--primary-color);
  background: rgba(var(--primary-color-rgb, 0, 150, 136),0.03);
  box-shadow: 0 2px 8px rgba(var(--primary-color-rgb, 0, 150, 136),0.15);
}

.mode-option input[type="checkbox"] {
  margin-top: 4px;
  margin-right: 12px;
  flex-shrink: 0;
}

.mode-option span {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.mode-option span svg {
  flex-shrink: 0;
  vertical-align: middle;
}

.mode-option strong {
  color: var(--primary-dark);
  font-size: 1.05rem;
  font-weight: 600;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  flex: 1;
}

.mode-option .info-icon {
  flex-shrink: 0;
  margin-left: auto;
  display: inline-flex; /* ensure visible in flex row */
  align-items: center;
  justify-content: center;
  visibility: visible;
  opacity: 1;
  z-index: 1;
}

.mode-option input[type="checkbox"]:checked ~ span strong {
  color: var(--primary-color);
}

.mode-option:has(input[type="checkbox"]:checked) {
  border-color: var(--primary-color);
  background: rgba(var(--primary-color-rgb, 0, 150, 136),0.08);
  box-shadow: 0 0 0 1px var(--primary-color);
}

/* Safety: hide any legacy inline descriptions that may remain next to START modes */
.mode-option small[data-i18n^="start.mode."][data-i18n$=".desc"],
.mode-option .mode-desc,
.mode-option [data-i18n^="start.mode."][data-i18n$=".desc"] {
  display: none !important;
}

.start-calc-area,
.start-config-area {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
}

.start-button {
  background: var(--primary-color) !important;
  color: var(--white) !important;
  padding: 12px 40px !important;
  font-size: var(--font-size-lg) !important;
  border-radius: var(--radius-2xl) !important;
  box-shadow: 0 4px 8px rgba(var(--primary-color-rgb, 0, 150, 136),0.3) !important;
  transition: all var(--transition) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1.2 !important;
}

.start-button:hover {
  background: var(--primary-dark) !important;
  box-shadow: 0 6px 12px rgba(var(--primary-color-rgb, 0, 150, 136),0.4) !important;
  transform: translateY(-2px);
}

/* ==========================================================================
   8. TABLES & CHARTS
   ========================================================================== */


table.styled caption {
  background: var(--primary-gradient);
  color: var(--white);
  padding: 5px 10px;
  text-align: left;
  font-weight: bold;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

table.styled thead th {
  background: var(--primary-gradient);
  color: var(--white);
  font-weight: bold;
  position: sticky;
  top: 0;
  padding: 5px 10px;
}


/* Full-width humidity charts stacked vertically */
.chart-panel.humidity-chart-fullwidth {
  width: 100%;
  max-width: 100%;
  display: block;
  margin-bottom: 24px;
}

.chart-panel.humidity-chart-fullwidth .chart-container {
  position: relative;
  height: 400px;
  width: 100%;
}

.chart-panel.humidity-chart-fullwidth canvas {
  display: block;
}

.chart-header {
  background: var(--primary-gradient);
  color: var(--white);
  padding: 5px 10px;
  font-weight: bold;
}

/* ==========================================================================
   9. CHECKBOXES & FORM GROUPS
   ========================================================================== */

.options-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
}

.options-checkboxes > div {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 100%;
}

.results-checkboxes {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.fieldset-options-subheader {
  margin: 0 0 var(--space-sm) 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.results-checkboxes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
  width: 100%;
}

.results-checkbox-group {
  padding: var(--space-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: box-shadow .25s var(--easing-spring), transform .25s var(--easing-spring);
}

.results-checkbox-group:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.results-checkbox-group-title {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

body.dark-mode .results-checkbox-group {
  background: var(--dark-surface);
  border-color: rgba(255,255,255,0.12);
  box-shadow: none;
}

body.dark-mode .results-checkbox-group:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

#generatedConfigCode {
  width: 320px;
  max-width: 320px;
}

.legend-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* Make results visibility fieldset legend clickable */
#resultsVisibilityFieldset legend,
#resultsLegendHeader {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

#resultsLegendHeader:hover {
  color: var(--primary-color);
}

.legend-toggle-arrow {
  font-size: 1.2em;
  margin-left: var(--space-xs);
  transition: transform 0.2s ease;
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   10. SPECIAL COMPONENTS
   ========================================================================== */

/* Transparent container for building model (3D canvas mounted by JS) */
#buildingModelContainer {
  position: relative;
  width: 100%;
  z-index: 0;
}

.building-model-header {
  display: flex;
  align-items: center;
  gap: 4px;
  top: 5px;
  left: 5px;
}

/* Building Openings Modal */
#buildingOpeningModal, #dimensionInputModal {
  max-width: 500px;
  max-height: 85vh;
  overflow: visible;
}

/* Position modal on the right side on larger screens to avoid overlapping building */
@media only screen and (min-width: 993px) {
  #buildingOpeningModal {
    right: 2%;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  
  #dimensionInputModal {
    right: 2%;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
}

/* On mobile, center the modal */
@media only screen and (max-width: 992px) {
  #buildingOpeningModal, #dimensionInputModal {
    max-width: 90%;
    width: 90%;
  }
}

#buildingOpeningModal .modal-content,
#dimensionInputModal .modal-content {
  padding: 24px;
  max-height: calc(85vh - 56px);
  overflow-y: auto;
}

#buildingOpeningModal .modal-footer,
#dimensionInputModal .modal-footer {
  padding: 10px 24px;
}

#buildingOpeningModal .modal-title,
#dimensionInputModal h5 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary-color, #009688);
}

body.dark-mode #buildingOpeningModal .modal-title,
body.dark-mode #dimensionInputModal h5 {
  color: var(--primary-light, #4db6ac);
}

#openingActionButtons .btn-small {
  font-size: var(--font-size-sm);
  padding: 0 12px;
  height: 32px;
  line-height: 32px;
}

#openingActionButtons .material-icons {
  font-size: 18px;
}

#openingsList {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-xs);
  padding: 12px;
  background: var(--gray-50);
}

body.dark-mode #openingsList {
  background: #2a2a2a;
  border-color: #444;
}

/* Roof configuration section in modal */
#roofConfigSection {
  background: var(--light-gray);
  border-radius: var(--radius-xs);
  padding: 16px;
  margin-bottom: 24px;
}

body.dark-mode #roofConfigSection {
  background: #2a2a2a !important;
  border: 1px solid #444 !important;
  color: var(--gray-300) !important;
}

#roofConfigSection h6 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--primary-color, #009688);
}

body.dark-mode #roofConfigSection h6 {
  color: var(--primary-light, #4db6ac);
}

/* Info icon in modal */
#roofConfigSection .info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-round);
  background: var(--primary-color, #009688);
  color: white;
  font-size: 11px;
  font-weight: bold;
  font-style: normal;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.2s;
}

#roofConfigSection .info-icon:hover {
  background: var(--primary-dark, #00796b);
}

body.dark-mode #roofConfigSection .info-icon {
  background: var(--primary-light, #4db6ac);
}

body.dark-mode #roofConfigSection .info-icon:hover {
  background: var(--primary-light, #26a69a);
}

/* Adjacent Building Section in modal */
#adjacentBuildingSection {
  background: var(--light-gray);
  border-radius: var(--radius-xs);
  padding: 16px;
  margin-bottom: 24px;
}

body.dark-mode #adjacentBuildingSection {
  background: #2a2a2a !important;
  border: 1px solid #444 !important;
  color: var(--gray-300) !important;
}

#adjacentBuildingSection .btn-small {
  font-size: var(--font-size-sm);
  padding: 0 12px;
  height: 32px;
  line-height: 32px;
}


#openingsSummaryContainer {
  animation: fadeIn 0.3s ease-in;
  margin-top: 20px;
}

#openingsSummaryContainer h6 {
  color: var(--primary-color, #009688);
  border-bottom: 2px solid var(--primary-color, #009688);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

#openingsSummaryContainer table {
  font-size: 0.9rem;
  margin-top: 0;
  box-shadow: var(--shadow-sm);
}

#openingsSummaryContainer th {
  font-weight: 600;
  font-size: var(--font-size-sm);
  background: var(--light-gray);
  padding: 12px 8px;
}

#openingsSummaryContainer td {
  padding: 10px 8px;
  vertical-align: middle;
}

#openingsSummaryContainer small {
  color: #666;
  font-size: 0.8rem;
}

body.dark-mode #openingsSummaryContainer h6 {
  color: var(--primary-color, #26a69a);
  border-bottom-color: var(--primary-color, #26a69a);
}

body.dark-mode #openingsSummaryContainer th {
  background: #333;
}

body.dark-mode #openingsSummaryContainer small {
  color: #999;
}

body.dark-mode #openingsSummaryContainer table {
  box-shadow: var(--shadow-sm);
}

#dimension_error {
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  background: #ffebee;
  border-left: 4px solid #f44336;
}

body.dark-mode #dimension_error {
  background: #4a2020;
  border-left-color: #ef5350;
}

/* Info Icon */
.info-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  border: 1px solid #999;
  border-radius: var(--radius-round);
  text-align: center;
  font-size: 12px;
  color: var(--text-dark);
  margin-left: 5px;
  cursor: pointer;
}

/* Prevent info icon from wrapping to the next line on narrow screens */
@media (max-width: 600px) {
  .info-icon { flex: 0 0 auto; white-space: nowrap; }
  .inline-control, .config-option { flex-wrap: nowrap; }
}

/* Preset Values */
.preset-value input,
.preset-value select,
.preset-value .select-dropdown,
#buildingType,
#buildingSize,
#buildingType + .select-dropdown,
#buildingSize + .select-dropdown {
  font-weight: inherit !important;
  color: inherit !important;
}

.preset-note {
  display: none;
  margin-left: 8px;
  font-weight: 400;
  font-size: 0.95em;
  color: var(--primary-color, #009688);
}

.preset-word-badge {
  display: inline-block;
  background: var(--primary-color, #009688);
  color: #fff;
  font-weight: 700;
  font-size: 0.78em;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  vertical-align: middle;
  line-height: 1.6;
  margin: 0 3px;
}
.responsive-bottom-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   10b. RESULTS DASHBOARD & AI ADVISOR
   ========================================================================== */


.ai-advisor-card {
  background: var(--glass-bg, #fff);
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.08));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft, 0 10px 30px rgba(15, 118, 110, 0.12));
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}


.ai-avatar {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-base);
  font-weight: 700;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.ai-avatar--fallback {
  background: linear-gradient(135deg, var(--primary-color, #009688), var(--primary-light, #26a69a));
  color: #ffffff;
}

.ai-avatar--gemini {
  background: linear-gradient(135deg, #1a73e8, #9334e6);
  border: 1px solid rgba(26, 115, 232, 0.35);
  color: #ffffff;
}







.ai-subtitle {
  font-size: 0.9rem;
  color: rgba(31, 42, 46, 0.75);
}

.ai-refresh-btn {
  border: none;
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  color: var(--primary-color, #009688);
  border-radius: var(--radius-md);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ai-refresh-btn:hover {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.2);
  transform: rotate(-10deg);
}


.ai-chip {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.08);
  color: var(--primary-color, #009688);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}


.ai-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: rgba(31, 42, 46, 0.8);
}


.ai-spinner {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-round);
  border: 2px solid rgba(var(--primary-color-rgb, 0, 150, 136), 0.25);
  border-top-color: var(--primary-color, #009688);
  animation: ai-spin 0.9s linear infinite;
}


@keyframes ai-spin {
  to { transform: rotate(360deg); }
}


.ai-tip-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}





.ai-tip-priority {
  background: rgba(233, 30, 99, 0.12);
  color: #c2185b;
}

.ai-tip-priority[data-priority="high"] {
  background: rgba(244, 67, 54, 0.15);
  color: #b71c1c;
}

.ai-tip-priority[data-priority="medium"] {
  background: rgba(255, 193, 7, 0.2);
  color: #ff8f00;
}

.ai-tip-priority[data-priority="low"] {
  background: rgba(33, 150, 243, 0.15);
  color: #1565c0;
}

.ai-tip-saving {
  background: rgba(var(--primary-color-rgb, 0, 150, 136), 0.14);
  color: var(--primary-color, #009688);
}

.ai-tip-description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(31, 42, 46, 0.85);
}

body.dark-mode .ai-advisor-card {
  background: rgba(18, 24, 27, 0.95);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

body.dark-mode .ai-tip-card {
  background: rgba(33, 40, 45, 0.95);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

body.dark-mode .ai-subtitle,
body.dark-mode .ai-tip-description,
body.dark-mode .ai-status {
  color: rgba(255, 255, 255, 0.75);
}


.results-kpi-strip {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 20px 16px;
  position: relative;
}

/* Remove separator line since we now have wrapper */
.results-kpi-strip::after {
  display: none;
}

/* KPI rows */

/* First row for important KPIs (Cost, CO2, Pareto) */

/* Ensure primary row KPI tiles have same width as secondary */

/* Second row for detailed metrics */

/* Third row for financial metrics */
.results-kpi-strip .kpi {
    min-width: 140px; /* slightly smaller to avoid edge clipping */
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s var(--easing-spring), box-shadow 0.18s var(--easing-spring), background 0.3s;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    will-change: transform;
  }
  .results-kpi-strip .kpi:hover {
    transform: scale(1.01) translateY(-0.5px); /* gentler hover to prevent clipping */
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb, 0, 150, 136),0.12), var(--shadow-soft);
  }
  .results-kpi-strip .kpi .kpi-desc {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
    opacity: 0.85;
    transition: opacity 0.2s;
  }
  .results-kpi-strip .kpi .kpi-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--primary-color);
  }
  .results-kpi-strip .kpi .kpi-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: inherit;
    margin-bottom: 2px;
    transition: color 0.3s, font-size 0.3s;
  }
  .results-kpi-strip .kpi .kpi-value.kpi-dual {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
  }
  .results-kpi-strip .kpi .kpi-dual-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--font-size-base);
    flex-wrap: wrap;
  }
  .results-kpi-strip .kpi .kpi-dual-label {
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 0.01em;
  }
  .results-kpi-strip .kpi .kpi-dual-value {
    font-weight: 700;
    text-align: right;
    flex: 1 1 auto;
  }
  .results-kpi-strip .kpi .kpi-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(0,0,0,0.1);
    border-radius: var(--radius-xs);
    margin-top: 6px;
    overflow: hidden;
  }
  .results-kpi-strip .kpi .kpi-progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 1.2s ease-out;
    border-radius: var(--radius-xs);
  }
  .results-kpi-strip .kpi .kpi-progress-meta {
    font-size: 0.78rem;
    opacity: 0.7;
    text-align: right;
    margin-top: 2px;
  }

  /* KPI legend */
  .results-kpi-strip .kpi-legend {
    border-top: 1px dashed rgba(0,0,0,0.08);
    padding-top: 6px;
    margin-left: 2px;
  }
  .results-kpi-strip .kpi .kpi-hint {
    position: absolute;
    right: 6px;
    top: 6px;
    font-size: 12px;
    opacity: 0.45;
    pointer-events: none;
  }
  .results-kpi-strip .kpi[data-type="heat"] .kpi-label { color: var(--chart-heating, #ff7043); }
  .results-kpi-strip .kpi[data-type="heat"] .kpi-progress-fill { background: var(--chart-heating, #ff7043); }
  .results-kpi-strip .kpi[data-type="cool"] .kpi-label { color: var(--chart-cooling, #29b6f6); }
  .results-kpi-strip .kpi[data-type="cool"] .kpi-progress-fill { background: var(--chart-cooling, #29b6f6); }
  .results-kpi-strip .kpi[data-type="vent"] .kpi-label { color: var(--chart-costVentilation, #388e3c); }
  .results-kpi-strip .kpi[data-type="vent"] .kpi-progress-fill { background: var(--chart-costVentilation, #388e3c); }
  .results-kpi-strip .kpi[data-type="net"] .kpi-label { color: var(--chart-balance, #ffa726); }
  .results-kpi-strip .kpi[data-type="net"] .kpi-progress-fill { background: var(--chart-balance, #ffa726); }
  .results-kpi-strip .kpi[data-type="peak"] .kpi-label { color: #ab47bc; }
  .results-kpi-strip .kpi[data-type="peak"] .kpi-progress-fill { background: #ab47bc; }
  .results-kpi-strip .kpi[data-type="pareto"] .kpi-label { color: #e91e63; }
  .results-kpi-strip .kpi[data-type="pareto"] .kpi-progress-fill { background: linear-gradient(90deg, var(--chart-heating, #ff7043) 0%, var(--chart-cooling, #29b6f6) 100%); }
  .results-kpi-strip .kpi[data-type="peak-tmy"] .kpi-label { color: #ab47bc; }
  .results-kpi-strip .kpi[data-type="peak-tmy"] .kpi-progress-fill { background: linear-gradient(90deg, var(--chart-heating, #ff7043) 0%, var(--chart-cooling, #29b6f6) 100%); }
  .results-kpi-strip .kpi[data-type="peak-design"] .kpi-label { color: #7e57c2; }
  .results-kpi-strip .kpi[data-type="peak-design"] .kpi-progress-fill { background: linear-gradient(90deg, var(--chart-heating, #ff7043) 0%, var(--chart-cooling, #29b6f6) 100%); }
  .results-kpi-strip .kpi[data-type="cost"] .kpi-label,
  .results-kpi-strip .kpi[data-type="pareto"] .kpi-label,
  .results-kpi-strip .kpi[data-type="peak-tmy"] .kpi-label,
  .results-kpi-strip .kpi[data-type="peak-design"] .kpi-label { color: var(--primary-color, #009688); }
  .results-kpi-strip .kpi[data-type="cost"] .kpi-progress-fill,
  .results-kpi-strip .kpi[data-type="pareto"] .kpi-progress-fill,
  .results-kpi-strip .kpi[data-type="peak-tmy"] .kpi-progress-fill,
  .results-kpi-strip .kpi[data-type="peak-design"] .kpi-progress-fill { background: var(--primary-color, #009688); }

  @media screen and (max-width: 1080px) {
    .kpi-row {
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .kpi-row-primary {
      grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    }
  }

  @media screen and (max-width: 720px) {
    .kpi-row {
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    .results-kpi-strip .kpi {
      min-width: 135px;
    }
  }

  @media screen and (max-width: 600px) {
    .kpi-row {
      display: flex;
      flex-wrap: nowrap;
      overflow-x: auto;
      padding-bottom: 6px;
      -webkit-overflow-scrolling: touch;
      gap: 10px;
    }
    .kpi-row::-webkit-scrollbar {
      height: 6px;
    }
    .kpi-row::-webkit-scrollbar-thumb {
      background: rgba(0,0,0,0.25);
      border-radius: var(--radius-xs);
    }
    .kpi-row .kpi {
      flex: 0 0 210px;
    }
  }
  .results-kpi-strip .kpi[data-type="co2"] .kpi-label { color: #8d6e63; }
  .results-kpi-strip .kpi[data-type="co2"] .kpi-progress-fill { background: #8d6e63; }
.result-tabs {
  list-style: none;
  display: flex;
  gap: 8px;
  row-gap: 8px;
  padding: 0;
  margin: 6px 0 14px 0;
  overflow-x: visible;
  flex-wrap: wrap;
}

.result-tab {
  padding: 8px 12px;
  border-radius: var(--radius-xl);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  color: var(--primary-dark, #004d40);
  font-weight: 600;
  white-space: nowrap;
}

/* ENERGY: stack charts one under another */
/* HUMIDITY: full-width charts stacked vertically */
#res-tab-humidity .result-grid {
  grid-template-columns: 1fr !important;
  gap: 16px;
}

/* Ensure humidity charts are always in single column */
#res-tab-humidity .chart-panel {
  width: 100% !important;
  max-width: 100% !important;
}

/* ENERGY: ensure charts appear instantly (no CSS transitions/animations) */
#res-tab-energy .chart-panel { transition: none !important; animation: none !important; }

/* Separator between action buttons and results tabs */
.results-separator { border: none; border-top: 1px solid var(--glass-border); margin: 12px 0 16px; }

body.dark-mode .result-tab { background: rgba(255,255,255,0.08); color: #fff; }
/* Lightweight modal for KPI details */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-toast);
}

/* User Preferences Styles */
.preferences-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}

.preferences-category {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 16px;
}

.preferences-category:last-child {
  border-bottom: none;
}

.preferences-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.preferences-category-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
}

body.dark-mode .preferences-category-title {
  color: var(--primary-light);
}

.preferences-reset-btn {
  font-size: var(--font-size-sm);
  padding: 4px 12px;
  height: auto;
  line-height: 1.5;
}

.preferences-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.preferences-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.preferences-checkbox-item {
  display: flex;
  align-items: center;
}

.preferences-intro {
  color: var(--text-muted);
  font-size: var(--font-size-md);
  margin-bottom: 16px;
  line-height: 1.5;
}

body.dark-mode .preferences-intro {
  color: rgba(255, 255, 255, 0.7);
}

/* User Account Modal Size */
#userAccountModal {
  max-width: 90vw !important;
  width: 90% !important;
  max-height: 90vh !important;
  height: 90vh !important;
}

/* Modal Tabs Styles */
#userAccountModal .tabs {
  background-color: transparent !important;
  border-bottom: 1px solid var(--gray-300);
  margin-bottom: 20px;
  overflow-x: auto;
}

body.dark-mode #userAccountModal .tabs {
  border-bottom-color: var(--gray-800);
}

#userAccountModal .tabs .tab a {
  color: var(--primary-color, #009688) !important;
  transition: color 0.3s ease;
}

#userAccountModal .tabs .tab a:hover {
  color: var(--primary-dark, #00796b) !important;
  background-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.1) !important;
}

#userAccountModal .tabs .tab a:focus,
#userAccountModal .tabs .tab a.active {
  color: var(--primary-color, #009688) !important;
  font-weight: 600;
  background-color: transparent !important;
}

#userAccountModal .tabs .indicator {
  background-color: var(--primary-color, #009688) !important;
  height: 3px;
}

body.dark-mode #userAccountModal .tabs .tab a {
  color: var(--primary-light, #26a69a) !important;
}

body.dark-mode #userAccountModal .tabs .tab a:hover {
  color: var(--primary-light, #4db6ac) !important;
  background-color: rgba(var(--primary-color-rgb, 0, 150, 136), 0.1) !important;
}

body.dark-mode #userAccountModal .tabs .tab a:focus,
body.dark-mode #userAccountModal .tabs .tab a.active {
  color: var(--primary-light, #4db6ac) !important;
  background-color: transparent !important;
}

body.dark-mode #userAccountModal .tabs .indicator {
  background-color: var(--primary-light, #26a69a) !important;
}

/* Config Components */
.config-row-flex {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.config-input-info {
  display: flex;
  align-items: center;
}

.config-apply-btn {
  display: flex;
  margin-left: 8px;
}

/* ==========================================================================
   11. OVERLAYS & MODALS
   ========================================================================== */

/* Loading Overlay */


@media (prefers-color-scheme: dark) {
  #loadingOverlay .calc-anim {
    /* relies on var(--glass-bg) and --glass-border dark values */
    background: var(--glass-bg);
    border-color: var(--glass-border);
  }
}

#loadingOverlay .calc-anim-header {
  padding: 18px 22px 8px 22px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

@media (prefers-color-scheme: dark) {
  #loadingOverlay .calc-anim-header {
    border-bottom-color: rgba(255,255,255,0.06);
  }
}


#loadingOverlay .calc-anim-sub {
  margin-top: 2px;
  font-size: 0.92rem;
  color: rgba(0,0,0,0.56);
}

@media (prefers-color-scheme: dark) {
  #loadingOverlay .calc-anim-title { color: #e7f2f0; }
  #loadingOverlay .calc-anim-sub { color: rgba(255,255,255,0.68); }
}

#loadingOverlay .calc-anim-body {
  padding: 14px 18px 18px 18px;
}

.calc-steps {
  list-style: none;
  margin: 0 0 14px 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

@media (max-width: 560px) {
  .calc-steps { grid-template-columns: 1fr; }
}

.calc-step {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: rgba(0,0,0,0.035);
}

@media (prefers-color-scheme: dark) {
  .calc-step { background: rgba(255,255,255,0.05); }
}

.calc-step .label { font-size: 0.98rem; }
.calc-step .status { font-size: 0.88rem; color: var(--primary-color, #009688); }

.calc-step.pending .status::after { content: '...'; color: rgba(0,0,0,0.45); }
.calc-step.active {
  outline: 2px solid rgba(var(--primary-color-rgb, 0, 150, 136),0.2);
  background: rgba(var(--primary-color-rgb, 0, 150, 136),0.06);
}
.calc-step.done { opacity: 0.8; }
.calc-step.done .status::after { content: '✔'; color: #2e7d32; }

@keyframes pulseDots {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}


.calc-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-progress-row .calc-progress {
  flex: 1;
}

.calc-progress {
  position: relative;
  height: 12px;
  background: rgba(0,0,0,0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .calc-progress { background: rgba(255,255,255,0.12); }
}

.calc-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-light, #26a69a) 0%, var(--primary-color, #2bbbad) 50%, var(--primary-light, #26a69a) 100%);
  border-radius: inherit;
  transition: width 360ms ease;
}

.calc-progress-text {
  margin-top: 8px;
  text-align: right;
  font-weight: 600;
  color: var(--primary-dark, #00796b);
}

#loadingOverlay .calc-cancel {
  flex-shrink: 0;
  color: #777;
}

@media (prefers-color-scheme: dark) {
  #loadingOverlay .calc-cancel { color: #aaa; }
}

/* Lottie container and narrative text */
.calc-lottie {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
}
@media (max-width: 560px) { .calc-lottie { height: 140px; } }

#loadingOverlay .calc-narrative {
  margin: 6px 0 10px 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--gray-900) !important;
  text-align: center;
}
body.dark-mode #loadingOverlay .calc-narrative { color: #f1fbf9 !important; }

/* Ensure progress text is readable inside loading overlay in light mode */
#loadingOverlay .calc-progress-text { color: var(--gray-900) !important; }

@keyframes pulseSoft {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}
.calc-narrative.pulsing { animation: pulseSoft 1200ms ease-in-out infinite; }

/* Tighter spacing in Configuration fieldsets */
#operationConfigurationFieldset,
#systemConfigurationFieldset,
#configurationFieldset {
  padding-top: 4px;
}

#operationConfigurationFieldset legend,
#systemConfigurationFieldset legend,
#configurationFieldset legend {
  margin-bottom: 4px;
}

.operation-config-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 16px;
  margin-bottom: 16px;
}

.operation-config-content .config-option {
  width: 100%;
}

#systemConfigurationOptionsContainer > *,
#configurationOptionsContainer > * {
  margin-top: 4px;
}

#systemConfigurationOptionsContainer > *:first-child,
#configurationOptionsContainer > *:first-child {
  margin-top: 0px;
}


/* ==========================================================================
   12. FIXED POSITION ELEMENTS
   ========================================================================== */

/* Dark Mode Toggle */


/* User Account Panel Styles */


.projects-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.projects-header h6 {
  margin: 0;
  color: var(--primary-dark);
  font-weight: 600;
}

.no-projects-msg {
  padding: 24px;
  text-align: center;
  color: #666;
  background: var(--light-gray);
  border-radius: var(--radius-md);
  margin: 16px 0;
}

#projectsTable {
  margin-top: 12px;
}

#projectsTable thead th {
  background: var(--primary-color);
  color: #fff;
  font-weight: 600;
  padding: 12px 8px;
}

#projectsTable tbody tr {
  border-bottom: 1px solid var(--gray-300);
}





body.dark-mode .no-projects-msg {
  background: var(--dark-surface);
  color: var(--border-color);
}


body.dark-mode #projectsTable tbody tr {
  border-bottom-color: #444;
}

body.dark-mode #projectsTable tbody tr:hover {
  background: rgba(255,255,255,0.05);
}


/* Contact Icons */



/* ==========================================================================
   13. GOOGLE TRANSLATE OVERRIDES
   ========================================================================== */

/* Removed legacy Google Translate and languageSelect styles */
/* Language dropdown styles */
.lang-arrow { transition: transform .25s ease; display:inline-block; }
.lang-list { margin:0; padding:4px 0; list-style:none; background:#ffffff; border:1px solid var(--primary-color, #009688); border-radius:var(--radius-sm); display:none; flex-direction:column; max-height:260px; overflow-y:auto; box-shadow:var(--shadow-md); }
.lang-list.open { display:flex; animation:fadeDown .18s ease; }
@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width:600px){ .lang-current { font-size:0.9em; } .lang-list button { font-size:0.85em; } }

/* -------------------------------------------------------------
  Modal layering override: ensure modals sit above hamburger popup
  ------------------------------------------------------------- */
/* Keep menu popup under modals */

/* Center the Close button in modal footers */
/* Center only the text inside the CLOSE button, not the entire footer */

/* Glass effect for Materialize toast notifications */
.toast {
  background: var(--glass-bg) !important;
  color: #000 !important;
  backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg) !important;
}
body.dark-mode .toast {
  background: var(--glass-bg) !important;
  color: var(--white) !important;
  border-color: var(--glass-border) !important;
}

/* Base modal surface - make more opaque (less transparent) */
.modal .modal-content {
  /* reduce transparency: switch to solid-ish surface while preserving glass look */
  background: rgba(255,255,255,0.92) !important;
  backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: #111;
  /* allow vertical scroll within viewport */
  max-height: calc(90vh - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.dark-mode .modal .modal-content {
  background: rgba(35,39,43,0.92) !important;
  color: #fff;
}

/* Modal wrapper: keep outer wrapper but avoid dimming the underlying page */
.modal {
  border-radius: var(--radius-lg) !important;
  overflow: hidden !important;
  background: transparent !important;
  box-shadow: var(--shadow-xl);
}

/* Info-icon popups: make them nearly opaque like main modals (less transparent) */
#optionInfoModal .modal-content,
#buildingModelInfoModal .modal-content,
#configCodeInfoModal .modal-content {
  background: rgba(255,255,255,0.94) !important; /* much less transparent */
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--glass-border) !important;
  backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  /* make sure long info text is scrollable */
  max-height: calc(90vh - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.dark-mode #optionInfoModal .modal-content,
body.dark-mode #buildingModelInfoModal .modal-content,
body.dark-mode #configCodeInfoModal .modal-content {
  background: rgba(35,39,43,0.94) !important;
  border-color: var(--glass-border) !important;
}

/* Main modals: more opaque so they don't feel see-through */
#infoModal .modal-content,
#contactModal .modal-content,
#licenseModal .modal-content,
#reportModal .modal-content,
#importConfigModal .modal-content {
  background: rgba(255,255,255,0.92) !important;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--glass-border) !important;
  backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  max-height: calc(90vh - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.dark-mode #infoModal .modal-content,
body.dark-mode #contactModal .modal-content,
body.dark-mode #licenseModal .modal-content,
body.dark-mode #reportModal .modal-content,
body.dark-mode #importConfigModal .modal-content {
  background: rgba(35,39,43,0.92) !important;
}

/* Ensure REPORT modal action buttons remain visible on mobile */
#reportModal .modal-footer {
  background: rgba(255,255,255,0.98);
}
body.dark-mode #reportModal .modal-footer {
  background: rgba(18,18,18,0.98);
}

/* Glassy tooltips (Materialize) used by title="..." attributes */
.material-tooltip {
  background: rgba(255,255,255,0.92) !important;
  color: #111 !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  backdrop-filter: blur(calc(var(--glass-blur) - 4px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 4px));
}
body.dark-mode .material-tooltip {
  background: rgba(35,39,43,0.92) !important;
  color: var(--gray-300) !important;
  border-color: var(--glass-border) !important;
}


/* ==========================================================================
   14. DARK MODE STYLES - MOVED TO css/themes/dark.css
   ========================================================================== */

/* ==========================================================================
   15. PRINT STYLES - MOVED TO css/print.css
   ========================================================================== */


/* ==========================================================================
   16. RESPONSIVE DESIGN - MOVED TO css/responsive.css
   ========================================================================== */

/* ==========================================================================
   17. PROJECT MANAGER PANEL - MOVED TO css/components/projects.css
   ========================================================================== */


/* ==========================================================================
   18. DEVICE CATALOG MODAL - MOVED TO css/components/device-catalog.css
   ========================================================================== */
