.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);
}
/* ==========================================================================
   CLIMATHIC ENERGYCALC - MAIN STYLESHEET
   ========================================================================== */

/* ==========================================================================
   1. BASE STYLES & VARIABLES
   ========================================================================== */

:root {
  /* Base accents (still used for borders, focus rings, etc.) */
  --primary-color: #009688; /* legacy teal used as accent-color */
  --primary-dark: #0a2a43;  /* deep navy for gradient start */
  --primary-light: #26a69a; /* teal for gradient end */
  /* Gradient tokens */
  --grad-navy: #0a2a43;
  --grad-turquoise: #009688; /* current teal hue */
  --primary-gradient: linear-gradient(135deg, var(--grad-navy) 0%, var(--grad-turquoise) 100%);
  --dark-bg: #181c1f;
  --dark-surface: #23272b;
  --surface: #ffffff;
  --appbar-height: 64px;
  --tabs-height: 52px;
  /* Glass tokens */
  --glass-bg: rgba(255,255,255,0.7);
  /* Teal-tinted glass for primary bars */
  --glass-primary: rgba(0,150,136,0.78); /* legacy, not used for bars now */
  --glass-primary-border: rgba(0,150,136,0.28);
  --glass-border: rgba(0,0,0,0.06);
  --glass-blur: 10px;
  /* Banner backgrounds (slight transparency) */
  /* These are superseded by gradient for header area, kept as fallback */
  --appbar-bg: rgba(10,42,67,0.92);
  --tabs-bg: rgba(10,42,67,0.92);
  --white: #fff;
  --light-gray: #f5f5f5;
  --border-color: #ccc;
  --dark-border: #444;
  --text-dark: #555;
  --transition: 0.3s ease;
  --easing-spring: cubic-bezier(.17,.67,.34,1.25);
  --focus-ring: 0 0 0 3px rgba(10,42,67,0.35);
  --shadow-soft: 0 2px 6px rgba(0,0,0,0.12),0 1px 2px rgba(0,0,0,0.08);
  --shadow-press: 0 1px 3px rgba(0,0,0,0.18),0 1px 2px rgba(0,0,0,0.12);
  /* Spacing scale */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
}
/* Form controls accent to match theme */
input[type="checkbox"], input[type="radio"], input[type="range"], select, option {
  accent-color: var(--primary-color);
}

/* Dark mode variable overrides */
body.dark-mode {
  --surface: var(--dark-surface);
  --border-color: var(--dark-border);
  --text-dark: #dddddd;
  --glass-bg: rgba(35,39,43,0.35);
  --glass-primary: rgba(10,42,67,0.5);
  --glass-primary-border: rgba(10,42,67,0.28);
  /* Dark banners should be dark, not teal */
  --appbar-bg: rgba(35,39,43,0.92);
  --tabs-bg: rgba(35,39,43,0.92);
  --glass-border: rgba(255,255,255,0.12);
  background: var(--dark-bg);
  color: #e0e0e0;
}

/* ================= MICROINTERACTIONS & ANIMATIONS ================= */
/* Base transitions */
button, .btn, .start-button, .nav-tab, .lang-item, .select-wrapper input.select-dropdown, fieldset, .card, .modal, .dropdown-content li>a {
  transition: background-color .35s var(--easing-spring), color .35s var(--easing-spring), box-shadow .4s var(--easing-spring), transform .45s var(--easing-spring);
}

/* Subtle scale on actionable elements */
.btn:not(.disabled):hover, .start-button:not(.disabled):hover, .nav-tab:hover, .lang-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.btn:active, .start-button:active, .nav-tab:active, .lang-item:active {
  transform: translateY(0) scale(.97);
  box-shadow: var(--shadow-press);
}

/* Focus ring */
.btn:focus-visible, .start-button:focus-visible, .nav-tab:focus-visible, .lang-item:focus-visible, select:focus-visible, input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Tabs active indicator animation */
.nav-tab {
  position: relative;
  overflow: hidden;
}
.nav-tab.active::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg,var(--primary-light),var(--primary-dark));
  animation: tabUnderline .6s var(--easing-spring);
  border-radius: 3px 3px 0 0;
}
@keyframes tabUnderline { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Fade/slide for tab content */
.tab-content { opacity: 0; transform: translateY(10px); transition: opacity .45s var(--easing-spring), transform .55s var(--easing-spring); }
.tab-content.active { opacity: 1; transform: translateY(0); }

/* Pulse highlight utility */
.pulse-once { animation: pulseOnce 1.2s ease-out forwards; }
@keyframes pulseOnce { 0% { box-shadow: 0 0 0 0 rgba(0,150,136,0.55); } 70% { box-shadow: 0 0 0 14px rgba(0,150,136,0); } 100% { box-shadow: none; } }

/* Ripple container (JS will inject .ripple-span) */
.btn, .start-button { position: relative; overflow: hidden; }
.ripple-span { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,0.5); animation: ripple .6s linear; pointer-events: none; mix-blend-mode: screen; }
@keyframes ripple { to { transform: scale(8); opacity: 0; } }

/* Language dropdown interactions (if present) */
.lang-item-active { animation: pulseOnce 1.2s ease-out; }

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tab-content { opacity: 1 !important; transform: none !important; }
}

/* --- Menu popup spacing standardization --- */
.menu-popup .menu-language-title {
  display: block;
  margin-top: 10px !important;   /* uniform smaller spacing above label */
  margin-bottom: 6px !important; /* uniform spacing between label and dropdown */
}
.menu-popup .lang-dropdown {
  margin-top: 0 !important;
  margin-bottom: 10px !important; /* uniform spacing after dropdown */
}
/* First headings in menu sections can have a slightly larger top margin */
.menu-popup .menu-popup-card > .menu-language-title:first-of-type {
  margin-top: 14px !important;
}

/* Subtle hover for fieldsets */
fieldset:hover { box-shadow: 0 2px 4px rgba(0,0,0,0.08); }

body {
  font-family: "Inter", "Roboto", ui-sans-serif, -apple-system, Segoe UI, system-ui, Arial, sans-serif;
  background: var(--light-gray);
  margin: 0;
  padding: 0;
  min-width: 500px;
}

/* ==========================================================================
   Utility layout helpers
   ========================================================================== */

.stack-xs > * + * { margin-top: var(--space-xxs); }
.stack-sm > * + * { margin-top: var(--space-xs); }
.stack-md > * + * { margin-top: var(--space-sm); }
.stack-lg > * + * { margin-top: var(--space-lg); }

.inline-control,
.config-option {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
}

.inline-control.tight { gap: var(--space-xxs); }
.inline-control.relaxed { gap: var(--space-sm); }

.inline-control .info-icon,
.config-option .info-icon {
  margin-left: var(--space-xxs);
}

.ml-none { margin-left: 0 !important; }
.ml-xs { margin-left: var(--space-xs) !important; }
.ml-sm { margin-left: var(--space-sm) !important; }
.ml-md { margin-left: var(--space-md) !important; }
.ml-lg { margin-left: var(--space-lg) !important; }
.ml-xl { margin-left: var(--space-xl) !important; }
.ml-xxl { margin-left: var(--space-xxl) !important; }

.mt-xxs { margin-top: var(--space-xxs) !important; }
.mt-none { margin-top: 0 !important; }
.mt-xs { margin-top: var(--space-xs) !important; }
.mt-sm { margin-top: var(--space-sm) !important; }
.mt-md { margin-top: var(--space-md) !important; }
.mt-lg { margin-top: var(--space-lg) !important; }
.mt-xl { margin-top: var(--space-xl) !important; }
.mt-xxl { margin-top: var(--space-xxl) !important; }

.mb-xxs { margin-bottom: var(--space-xxs) !important; }
.mb-none { margin-bottom: 0 !important; }
.mb-xs { margin-bottom: var(--space-xs) !important; }
.mb-sm { margin-bottom: var(--space-sm) !important; }
.mb-md { margin-bottom: var(--space-md) !important; }
.mb-lg { margin-bottom: var(--space-lg) !important; }
.mb-xl { margin-bottom: var(--space-xl) !important; }
.mb-xxl { margin-bottom: var(--space-xxl) !important; }

.pr-none { padding-right: 0 !important; }
.pr-xs { padding-right: var(--space-xs) !important; }
.pr-sm { padding-right: var(--space-sm) !important; }
.pr-md { padding-right: var(--space-md) !important; }
.pr-lg { padding-right: var(--space-lg) !important; }
.pr-xl { padding-right: var(--space-xl) !important; }

.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.is-hidden { 
  display: none !important; 
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

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

.min-w-60 { min-width: 60px !important; }
.min-w-120 { min-width: 120px !important; }
.min-w-140 { min-width: 140px !important; }

.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }

.top-xs { top: var(--space-xs) !important; }
.top-sm { top: var(--space-sm) !important; }
.left-xs { left: var(--space-xs) !important; }
.left-lg { left: var(--space-lg) !important; }

.z-high { z-index: 5 !important; }

.cursor-pointer { cursor: pointer !important; }

.fw-bold { font-weight: 700 !important; }

.text-muted { color: var(--text-dark) !important; }

.text-primary { color: var(--primary-color) !important; }

.fw-normal { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; }

.chip { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; background: rgba(0,0,0,0.06); color: inherit; margin: 4px 0 8px 0; }
.chip .dot { width:8px; height:8px; border-radius:50%; background: var(--primary-color); display:inline-block; }

.block-section {
  padding-left: var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
}

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

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

/* Banner & Header */
.full-width-banner {
  width: 100%;
}

.banner,
.results-banner {
  background: var(--primary-color);
  width: 100%;
  box-sizing: border-box;
  color: var(--white);
  display: flex;
  align-items: center;
  position: relative;
}

.banner {
  padding: 10px;
}

.results-banner {
  padding: 0 32px;
  font-size: 1.5rem;
  min-height: 84.7px;
  border-radius: 0;
  margin-bottom: 20px;
  overflow-x: hidden;
  justify-content: space-between;
}

.banner-logo {
  display: flex;
  align-items: center;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.banner-buttons {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  /* Lowered to allow modals to overlay while still above page content */
  z-index: 1200 !important;
  pointer-events: auto;
}

.banner-buttons .btn {
  margin-left: 8px;
}

/* KPI meta (active hours) */
.kpi-meta { font-size: 0.85em; opacity: 0.75; margin-top: 2px; }

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

/* Preserve table layout on mobile: no stacking or display:block tricks */
table.styled.summary-table { table-layout: auto; width: 100%; }
table.styled.summary-table th, table.styled.summary-table td { white-space: nowrap; }

/* 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: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

fieldset legend {
  font-weight: 600;
  margin-bottom: 16px;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  padding: 4px 16px;
  border-radius: 999px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 0 1px var(--border-color) inset;
  text-align: center;
}

/* Input Fields */
.input-field label {
  font-size: 14px;
  margin: 0;
}

/* Buttons: gradient + glass effect */
.btn, .start-button,
button#welcomeStartBtn,
button#calculate,
button#generateReportBtn,
button#downloadConfigCodeBtn,
button#importConfigBtn,
button#nextTab,
button#prevTab {
  border-radius: 12px !important;
  background: var(--primary-gradient) !important;
  color: #fff !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18) !important;
  backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 2px));
}
.btn:hover, .start-button:hover,
button#welcomeStartBtn:hover,
button#calculate:hover,
button#generateReportBtn:hover,
button#downloadConfigCodeBtn:hover,
button#importConfigBtn:hover,
button#nextTab:hover,
button#prevTab:hover {
  filter: brightness(1.04);
}
.btn:active, .start-button:active,
button#welcomeStartBtn:active,
button#calculate:active,
button#generateReportBtn:active,
button#downloadConfigCodeBtn:active,
button#importConfigBtn:active,
button#nextTab:active,
button#prevTab:active { filter: brightness(0.97); }

/* 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, .sheen-loop {
  position: relative;
  overflow: hidden; /* contain the sheen stripe */
}
.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,
#reportBtnTop,
#reportBtnResults,
#pdfBtn,
#calculateBtn,
#configBtn {
  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,
#calculateBtn:hover,
#configBtn:hover { background: var(--primary-dark) !important; }
.start-button:active,
#reportBtn:active,
#reportBtnResults:active,
#pdfBtn:active,
#calculateBtn:active,
#configBtn:active { filter: brightness(0.97); }

/* 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; }
.app-bar .banner-buttons { position: static !important; transform: none !important; display: flex; align-items: center; gap: 12px; }

/* Ensure person icon and hamburger are the same size and aligned */
.app-bar .user-account-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 { width: 24px; height: 24px; }

.menu-dropdown { position: relative; }

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

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

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

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

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

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

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xxs);
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-xxs);
}

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

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

.menu-toggle:hover .menu-toggle-line,
.menu-toggle:focus-visible .menu-toggle-line {
  background: #e0f2f1;
}

/* 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;
}

body.dark-mode .menu-toggle:hover .menu-toggle-line,
body.dark-mode .menu-toggle:focus-visible .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: 3500;
  width: 280px;
  max-width: calc(100vw - var(--space-lg));
}

.menu-popup-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  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(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(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;
  /* Lower the × a bit to avoid overlapping the first link */
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  font-size: 2em;
  color: #888;
  cursor: pointer;
  line-height: 1;
}

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: #bbb;
}

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: 0 4px 18px rgba(0,0,0,0.08); }
.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; }
.app-bar { -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); border-bottom: 1px solid var(--glass-border); }
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: #e0f2f1 !important; }
body.dark-mode .lang-list { background: var(--dark-surface) !important; border-color: var(--primary-color) !important; }
body.dark-mode .lang-list button { color: #e0e0e0 !important; }
body.dark-mode .lang-list button:hover { background: rgba(77,208,225,0.12) !important; }

.input-field select + label {
  margin: 0;
}

/* Uniform label styling */
.input-field > label,
.input-field .select-wrapper + label {
  font-size: 15px !important;
  line-height: 1.2 !important;
  top: -6px !important;
}

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

fieldset .input-field .select-wrapper input.select-dropdown {
  height: 2.4rem !important;
  line-height: 2.4rem !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: #e0e0e0 !important;
}
body.dark-mode .dropdown-content li > a, 
body.dark-mode .dropdown-content li > span {
  color: #e0e0e0 !important;
}
body.dark-mode .dropdown-content { background: var(--dark-surface) !important; }

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

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

/* Global dropdown overlay behavior */
.dropdown-content {
  max-height: 60vh !important;
  overflow-y: auto !important;
  z-index: 3500 !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;
}

#singleSlopeOptions .select-wrapper + label {
  top: -6px !important;
}

/* ==========================================================================
   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: 2.4rem;
  line-height: 2.4rem;
  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;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

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

#singleSlopeControlsContainer .heating-type-inline select {
  min-width: 120px;
}

#singleSlopeControlsContainer .heating-type-inline .select-wrapper {
  margin: 0 !important;
}

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

#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: 8px;
  position: relative;
  overflow: hidden;
  background: #e0e0e0;
  min-height: 330px;
  height: 48vh;
  max-height: 90vh;
}

#map {
  width: 100%;
  height: 100%;
}

#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: 18px;
  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: 4000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 2px));
  text-align: center;
}

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

.tab-navigation {
  background: var(--tabs-bg);
  margin: 0 0 20px 0;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Sticky tab bar below app bar with glass effect */
.tab-navigation {
  position: sticky;
  top: calc(var(--appbar-height));
  z-index: 3000; /* below app-bar but above content */
  background: var(--primary-gradient) !important;
  backdrop-filter: blur(calc(var(--glass-blur) - 1px));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 1px));
  border-bottom: 1px solid var(--glass-border);
}

/* 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: 4000; /* 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: 0 6px 24px rgba(0,0,0,0.08);
  }

  /* 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 {
    padding-top: calc(var(--appbar-height) + var(--tabs-height) + 8px) !important;
  }

  /* ensure nav tabs remain horizontally scrollable on small screens */
  .nav-tabs { overflow-x: auto; }
}
body.dark-mode .tab-navigation { background: var(--tabs-bg) !important; }

.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 {
  flex: 1;
  min-width: 120px;
  text-align: center;
  flex-shrink: 0;
}

.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:last-child a {
  border-right: none;
}

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

.nav-tab.active a {
  background: var(--white);
  color: var(--primary-color);
  font-weight: 600;
}

/* Tab Content */
.tab-content {
  display: none;
  min-height: 400px;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
  display: block;
}

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

/* 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 #e0e0e0;
  gap: 16px;
}

.tab-navigation-buttons .btn {
  min-width: 120px;
  font-weight: 600;
  text-transform: uppercase;
}

.tab-navigation-buttons .btn-back {
  background: #757575 !important;
}

.tab-navigation-buttons .btn-back:hover {
  background: #616161 !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 */
#results .collapsible-input-params { display: none; }

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

.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;
  align-items: center;
  justify-content: center;
  padding-left: 20px;
  min-width: 0;
  max-height: 450px;
  overflow: hidden;
}

.main-graphic {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  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;
}

/* Building canvas surface styling: keep area fully transparent (no frame, no shadow) */
#buildingModel {
  background: transparent;
}

.start-left-column h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 2rem;
  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(0,150,136,0.05);
  border: 2px solid rgba(0,150,136,0.15);
  border-radius: 12px;
  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: 0.95rem;
  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(0,150,136,0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  max-width: 100%;
  overflow: hidden;
}

.mode-option:hover {
  border-color: var(--primary-color);
  background: rgba(0,150,136,0.03);
  box-shadow: 0 2px 8px rgba(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(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: 1.2rem !important;
  border-radius: 25px !important;
  box-shadow: 0 4px 8px rgba(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(0,150,136,0.4) !important;
  transform: translateY(-2px);
}

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

table.styled {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 20px;
  background: var(--white);
  border-collapse: collapse;
}

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

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

.chart-panel {
  background: var(--white);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.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);
}

.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: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  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;
}

.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
   ========================================================================== */

/* Building Model */
#buildingModel {
  width: 100%;
}

/* Transparent container for building model with optional shimmer overlay */
#buildingModelContainer {
  position: relative;
  width: 100%;
  z-index: 0;
}

.building-model-label,
.building-model-info {
  top: 5px;
}

.building-model-label {
  left: 5px;
}

.building-model-info {
  left: 150px;
}

#buildingModelShimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  /* Default off; JS will toggle .active when BUILDING tab is visible */
  opacity: 0;
  transition: opacity 300ms ease;
  background: linear-gradient(115deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0) 35%,
    rgba(255,255,255,0.22) 48%,
    rgba(255,255,255,0.38) 52%,
    rgba(255,255,255,0.18) 56%,
    rgba(255,255,255,0) 70%,
    rgba(255,255,255,0) 100%
  );
  background-size: 200% 200%;
}

#buildingModelShimmer.active {
  opacity: 0.8;
  animation: buildingShimmer 2.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  #buildingModelShimmer.active { animation: none; opacity: 0.25; }
}

@keyframes buildingShimmer {
  0% { background-position: 120% 0%; }
  50% { background-position: -20% 100%; }
  100% { background-position: 120% 0%; }
}

/* Ensure canvas background is transparent so it matches page background (useful for dark mode) */
#buildingModel {
  background: transparent !important;
}

/* Info Icon */
.info-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  border: 1px solid #999;
  border-radius: 50%;
  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: bold !important;
  color: var(--primary-color) !important;
}

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

/* Responsive Bottom Buttons */
.responsive-bottom-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

/* =====================
   Results Dashboard
   ===================== */
.results-kpi-strip {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 16px 32px 16px; /* increased bottom padding for more space above separator */
  margin: 0 12px;
  position: relative;
}

/* Add separator line below KPI strip */
.results-kpi-strip::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--glass-border);
  margin-bottom: 12px;
}

/* KPI rows */
.kpi-row {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  justify-content: flex-start; /* align all rows to the left */
}

/* First row for important KPIs (Cost, CO2) */
.kpi-row-primary {
  justify-content: flex-start; /* align to left */
}

/* Second row for detailed metrics */
.kpi-row-secondary {
  justify-content: flex-start;
}
.results-kpi-strip .kpi {
    min-width: 132px; /* slightly smaller to avoid edge clipping */
    padding: 8px 10px;
    border-radius: 8px;
    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(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: 1.2rem;
    font-weight: 700;
    color: inherit;
    margin-bottom: 2px;
    transition: color 0.3s, font-size 0.3s;
  }
  .results-kpi-strip .kpi .kpi-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    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: 2px;
  }
  .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: #ff7043; }
  .results-kpi-strip .kpi[data-type="heat"] .kpi-progress-fill { background: #ff7043; }
  .results-kpi-strip .kpi[data-type="cool"] .kpi-label { color: #29b6f6; }
  .results-kpi-strip .kpi[data-type="cool"] .kpi-progress-fill { background: #29b6f6; }
  .results-kpi-strip .kpi[data-type="vent"] .kpi-label { color: #388e3c; }
  .results-kpi-strip .kpi[data-type="vent"] .kpi-progress-fill { background: #388e3c; }
  .results-kpi-strip .kpi[data-type="net"] .kpi-label { color: #ffa726; }
  .results-kpi-strip .kpi[data-type="net"] .kpi-progress-fill { background: #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="cost"] .kpi-label { color: #009688; }
  .results-kpi-strip .kpi[data-type="cost"] .kpi-progress-fill { background: #009688; }
  .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:16px; cursor:pointer; background: rgba(255,255,255,0.7); color:#004d40; font-weight:600; white-space:nowrap; }
.result-tab.active { background:#009688; color:#fff; }
.result-tab-content { display:none; }
.result-tab-content.active { display:block; }
.result-grid { display:grid; grid-template-columns: 1fr; gap: 12px; }
/* ENERGY: stack charts one under another */
#res-tab-energy .result-grid { grid-template-columns: 1fr !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: #e0f2f1; }
body.dark-mode .result-tab.active { background: #009688; 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: 10000;
}
.modal-backdrop.active { display: flex; }
.modal-sheet {
  background: var(--surface);
  color: var(--text-dark);
  border-radius: 12px;
  width: min(680px, 92vw);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
}
.modal-header { padding: 12px 16px; border-bottom: 1px solid var(--glass-border); font-weight: 700; }
.modal-body { padding: 12px 16px; }
.modal-footer { padding: 10px 16px; border-top: 1px solid var(--glass-border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { appearance: none; border: 1px solid var(--glass-border); background: var(--white); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
body.dark-mode .modal-sheet { background: var(--dark-surface); color: #e0f2f1; }

/* 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: 0.85rem;
  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: 0.95rem;
  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 #e0e0e0;
  margin-bottom: 20px;
  overflow-x: auto;
}

body.dark-mode #userAccountModal .tabs {
  border-bottom-color: #424242;
}

#userAccountModal .tabs .tab a {
  color: #009688 !important;
  transition: color 0.3s ease;
}

#userAccountModal .tabs .tab a:hover {
  color: #00796b !important;
  background-color: rgba(0, 150, 136, 0.1) !important;
}

#userAccountModal .tabs .tab a:focus,
#userAccountModal .tabs .tab a.active {
  color: #009688 !important;
  font-weight: 600;
  background-color: transparent !important;
}

#userAccountModal .tabs .indicator {
  background-color: #009688 !important;
  height: 3px;
}

body.dark-mode #userAccountModal .tabs .tab a {
  color: #26a69a !important;
}

body.dark-mode #userAccountModal .tabs .tab a:hover {
  color: #4db6ac !important;
  background-color: rgba(38, 166, 154, 0.1) !important;
}

body.dark-mode #userAccountModal .tabs .tab a:focus,
body.dark-mode #userAccountModal .tabs .tab a.active {
  color: #4db6ac !important;
  background-color: transparent !important;
}

body.dark-mode #userAccountModal .tabs .indicator {
  background-color: #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 */
#loadingOverlay {
  position: fixed;
  inset: 0;
  /* Full-screen glass background (day/night aware) */
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  display: none;
  z-index: 10000;
  text-align: left;
}

#loadingOverlay .calc-anim {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  /* Glass card */
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@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-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-color, #0e1a18);
}

#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: 12px;
  background: rgba(0,0,0,0.035);
}

@media (prefers-color-scheme: dark) {
  .calc-step { background: rgba(255,255,255,0.05); }
}

.calc-step .icon { font-size: 18px; filter: saturate(1.2); }
.calc-step .label { font-size: 0.98rem; }
.calc-step .status { font-size: 0.88rem; color: #009688; }

.calc-step.pending .status::after { content: '…'; color: rgba(0,0,0,0.45); }
.calc-step.active {
  outline: 2px solid rgba(0,150,136,0.2);
  background: rgba(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-step.active .status::after {
  content: '• • •';
  letter-spacing: 2px;
  animation: pulseDots 1100ms ease-in-out infinite;
  color: #009688;
}

.calc-progress {
  position: relative;
  height: 12px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  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, #26a69a 0%, #2bbbad 50%, #26a69a 100%);
  border-radius: inherit;
  transition: width 360ms ease;
}

.calc-progress-text {
  margin-top: 8px;
  text-align: right;
  font-weight: 600;
  color: #00796b; /* deeper teal for better contrast */
}

#loadingOverlay .calc-cancel {
  position: absolute;
  right: 8px;
  bottom: 8px;
  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: #00796b !important; /* darker turquoise for light mode visibility */
  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: #00796b !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 */
#darkModeToggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  background: var(--dark-surface);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: pointer;
  font-size: 1.7em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

#darkModeToggle:hover {
  background: var(--primary-color);
  color: var(--white);
}

/* User Account Panel Styles */
.user-state-container.is-hidden {
  display: none;
}

.projects-section {
  margin-top: 16px;
}

.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: #f5f5f5;
  border-radius: 8px;
  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 #e0e0e0;
}

#projectsTable tbody tr:hover {
  background: #f5f5f5;
}

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

.project-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-actions .btn-small {
  margin: 0;
  padding: 4px 12px;
  font-size: 0.8rem;
  line-height: 1.4;
}

body.dark-mode .no-projects-msg {
  background: var(--dark-surface);
  color: #ccc;
}

body.dark-mode #projectsTable thead th {
  background: var(--primary-dark);
}

body.dark-mode #projectsTable tbody tr {
  border-bottom-color: #444;
}

body.dark-mode #projectsTable tbody tr:hover {
  background: rgba(255,255,255,0.05);
}

body.dark-mode .projects-header h6 {
  color: var(--primary-color);
}

/* Contact Icons */
#contactIcons {
  position: fixed;
  bottom: 80px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 99999;
}

#contactIcons a {
  background: var(--white);
  color: var(--dark-surface);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7em;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 0;
  text-decoration: none;
  outline: none;
}

#contactIcons a:hover {
  background: var(--primary-color);
  color: var(--white);
}

/* ==========================================================================
   13. GOOGLE TRANSLATE OVERRIDES
   ========================================================================== */

/* Removed legacy Google Translate and languageSelect styles */
/* Language dropdown styles */
.lang-dropdown-wrapper {
  padding: var(--space-xs) var(--space-xl) var(--space-lg) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.lang-dropdown { position:relative; display:flex; flex-direction:column; gap: var(--space-xxs); }
.lang-current { display:flex; align-items:center; justify-content:space-between; background:#e0f2f1; border:1px solid #009688; color:#00695c; padding:8px 12px; border-radius:6px; cursor:pointer; font-weight:600; }
.lang-current span.code { font-weight:700; letter-spacing:0.5px; }
.lang-arrow { transition: transform .25s ease; display:inline-block; }
.lang-list { margin:0; padding:4px 0; list-style:none; background:#ffffff; border:1px solid #009688; border-radius:6px; display:none; flex-direction:column; max-height:260px; overflow-y:auto; box-shadow:0 4px 10px rgba(0,0,0,0.12); }
.lang-list.open { display:flex; animation:fadeDown .18s ease; }
.lang-list li { margin:0; padding:0; }
.lang-list button { width:100%; background:none; border:none; text-align:left; padding:8px 14px; font-size:0.95em; color:#004d40; cursor:pointer; display:flex; justify-content:space-between; align-items:center; }
.lang-list button:hover { background:#e0f2f1; }
.lang-badge { font-size:0.7em; background:#009688; color:#fff; padding:2px 6px; border-radius:10px; }
.lang-item-active { font-weight:600; color:#009688; }
@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
  ------------------------------------------------------------- */
.modal { z-index: 5000 !important; }
#modalOverlayFix .modal { z-index: 5000 !important; }
.modal-overlay { z-index: 4000 !important; }
/* Prevent overlay from dimming the page: make it transparent while still intercepting clicks */
.modal-overlay {
  background: transparent !important;
  opacity: 1 !important;
}
/* Keep menu popup under modals */
.menu-popup { z-index: 3500 !important; }

/* Center the Close button in modal footers */
/* Center only the text inside the CLOSE button, not the entire footer */
.modal .modal-footer .btn,
.modal .modal-footer .btn-flat {
  display: inline-flex;           /* allow centering */
  align-items: center;            /* vertical center */
  justify-content: center;        /* horizontal center */
  text-align: center !important;  /* text centering */
  line-height: 1.1 !important;    /* prevent baseline offset */
  min-height: 36px;               /* typical Materialize height */
  padding-top: 0;                 /* avoid text shifting */
  padding-bottom: 0;              /* avoid text shifting */
}

/* 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: 0 6px 20px rgba(0,0,0,0.18) !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: 12px;
  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: #e0f2f1;
}

/* Modal wrapper: keep outer wrapper but avoid dimming the underlying page */
.modal {
  border-radius: 14px !important;
  overflow: hidden !important;
  background: transparent !important;
  box-shadow: 0 10px 36px rgba(0,0,0,0.20);
}

/* 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: 14px !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: 14px !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.modal-fixed-footer {
  max-height: 90vh; /* keep within viewport */
}
#reportModal.modal.modal-fixed-footer .modal-content {
  max-height: calc(90vh - 96px); /* reserve space for footer */
  overflow-y: auto;
}
#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: 8px !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.14) !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: #e0e0e0 !important;
  border-color: var(--glass-border) !important;
}

/* ==========================================================================
   14. DARK MODE STYLES
   ========================================================================== */

body.dark-mode {
  background: var(--dark-bg) !important;
  color: #e0e0e0 !important;
}

body.dark-mode .full-width-banner,
body.dark-mode .results-banner,
body.dark-mode .banner {
  background: var(--dark-surface) !important;
  color: var(--white) !important;
}

body.dark-mode .banner-title {
  color: var(--white) !important;
}

body.dark-mode .banner-logo img {
  filter: brightness(0.9) invert(0.02);
}

body.dark-mode .banner-buttons .btn,
body.dark-mode .banner-buttons a.btn {
  background: var(--dark-surface) !important;
  color: var(--white) !important;
}

body.dark-mode .container {
  background: var(--dark-bg) !important;
  color: #e0e0e0 !important;
}

body.dark-mode fieldset {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
}

body.dark-mode fieldset legend {
  background: var(--dark-surface) !important;
  color: var(--white) !important;
  border-color: var(--dark-border) !important;
}

body.dark-mode .input-field label,
body.dark-mode .input-field select + label {
  color: #b0b0b0 !important;
}

body.dark-mode .input-field input,
body.dark-mode .input-field select,
body.dark-mode .input-field textarea {
  background: var(--dark-surface) !important;
  color: var(--white) !important;
  border-color: var(--dark-border) !important;
}

body.dark-mode table.styled {
  background: var(--dark-surface) !important;
  color: #e0e0e0 !important;
  border-color: var(--dark-border) !important;
}

body.dark-mode table.styled caption,
body.dark-mode table.styled thead th,
body.dark-mode .chart-header {
  background: var(--dark-surface) !important;
  color: var(--white) !important;
}

body.dark-mode table.styled td, 
body.dark-mode table.styled th {
  border-color: var(--dark-border) !important;
}

body.dark-mode #map-container {
  background: var(--dark-surface) !important;
}

body.dark-mode #location-notification {
  background: var(--glass-bg) !important;
  color: var(--white) !important;
  border-color: var(--glass-border) !important;
}

body.dark-mode .modal-content {
  background: var(--dark-surface) !important;
  color: #e0f2f1 !important;
}

body.dark-mode .modal-footer {
  background: var(--dark-bg) !important;
  color: #e0f2f1 !important;
}

body.dark-mode .waves-effect.waves-light.btn,
body.dark-mode .btn,
body.dark-mode .waves-effect.waves-green.btn-flat {
  background: var(--primary-color) !important;
  color: var(--white) !important;
}

body.dark-mode .info-icon {
  border-color: #888 !important;
  color: #bbb !important;
  background: var(--dark-surface) !important;
}

body.dark-mode .chart-panel {
  background: var(--dark-surface) !important;
  color: #e0e0e0 !important;
}

body.dark-mode .preloader-wrapper.active .spinner-layer.spinner-blue-only .circle {
  border-color: #4dd0e1 !important;
}

body.dark-mode .collapsible-header {
  background: var(--dark-surface) !important;
  color: var(--white) !important;
}

body.dark-mode .collapsible-body {
  background: var(--dark-bg) !important;
  color: #e0e0e0 !important;
}

/* Dark mode for application mode selection */
body.dark-mode .start-mode-selection {
  background: rgba(0,150,136,0.12);
  border-color: rgba(0,150,136,0.3);
}

body.dark-mode .mode-option {
  background: var(--dark-surface);
  border-color: rgba(0,150,136,0.25);
}

body.dark-mode .mode-option:hover {
  background: rgba(0,150,136,0.15);
  border-color: var(--primary-light);
}

body.dark-mode .mode-option:has(input[type="checkbox"]:checked) {
  background: rgba(0,150,136,0.18);
  border-color: var(--primary-light);
}

body.dark-mode .mode-option strong {
  color: #e0f2f1;
}

body.dark-mode .mode-option small {
  color: #b2dfdb;
}

/* Dark mode preset values */
body.dark-mode .preset-value input,
body.dark-mode .preset-value select,
body.dark-mode .preset-value .select-dropdown,
body.dark-mode #buildingType,
body.dark-mode #buildingSize,
body.dark-mode #buildingType + .select-dropdown,
body.dark-mode #buildingSize + .select-dropdown {
  color: var(--primary-light) !important;
}

body.dark-mode .preset-note {
  color: var(--primary-light) !important;
}

/* Dark mode tab navigation */
body.dark-mode .tab-navigation {
  background: var(--dark-surface) !important;
}

body.dark-mode .nav-tab a {
  background: rgba(255,255,255,0.05) !important;
  color: #e0e0e0 !important;
  border-color: rgba(255,255,255,0.1) !important;
}

body.dark-mode .nav-tab a:hover {
  background: rgba(255,255,255,0.1) !important;
}

body.dark-mode .nav-tab.active a {
  background: var(--primary-color) !important;
  color: var(--white) !important;
}

body.dark-mode .start-section {
  background: var(--dark-surface) !important;
  color: #e0e0e0 !important;
}

body.dark-mode .start-section h2 {
  color: var(--primary-light) !important;
}

body.dark-mode .start-section p {
  color: #b0b0b0 !important;
}

body.dark-mode .tab-navigation-buttons {
  border-top-color: var(--dark-border);
}

body.dark-mode .tab-navigation-buttons .btn-back {
  background: #616161 !important;
}

body.dark-mode .tab-navigation-buttons .btn-back:hover {
  background: #757575 !important;
}

body.dark-mode #darkModeToggle {
  background: var(--white);
  color: var(--dark-surface);
}

body.dark-mode #contactIcons a {
  background: var(--dark-surface) !important;
  color: var(--white) !important;
}

body.dark-mode #contactIcons a:hover {
  background: var(--primary-color) !important;
  color: var(--white) !important;
}

/* Dark mode special containers */
body.dark-mode .temp-special-options,
body.dark-mode #advancedUExternalContainer,
body.dark-mode #configurationOptionsContainer,
body.dark-mode #singleSlopeControlsContainer,
body.dark-mode #singleSlopeExternalContainer {
  border-bottom: none; /* remove dashed in dark mode as well */
}

body.dark-mode .temp-special-options {
  border-bottom: 1px dashed rgba(255,255,255,0.25);
}

body.dark-mode table.styled.summary-table tr {
  border-bottom: 1px dashed rgba(255,255,255,0.25);
}

/* ==========================================================================
   15. PRINT STYLES
   ========================================================================== */

@media print {
  table.styled {
    page-break-inside: avoid;
    border-collapse: collapse;
    width: 100%;
    font-size: 11px;
    margin-bottom: 15px;
  }
  
  table.styled caption {
    background: var(--primary-color) !important;
    color: var(--white) !important;
    padding: 6px 10px;
    font-weight: bold;
    font-size: 12px;
    text-align: left;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    page-break-after: avoid;
  }
  
  table.styled thead th {
    background: var(--primary-color) !important;
    color: var(--white) !important;
    font-weight: bold;
    padding: 6px 8px;
    font-size: 11px;
    text-align: center;
    border: 1px solid #ddd;
    page-break-after: avoid;
  }
  
  table.styled tbody td {
    padding: 5px 8px;
    border: 1px solid #ddd;
    font-size: 10px;
    text-align: center;
  }
  
  table.styled tbody td:first-child {
    text-align: left;
    font-weight: bold;
  }
  
  /* Savings table total row styling for PDF */
  table.styled tbody tr[style*="border-top: 2px solid #009688"] {
    border-top: 2px solid var(--primary-color) !important;
    background-color: #f0f8f8 !important;
    font-weight: bold !important;
  }
  
  table.styled tbody tr[style*="border-top: 2px solid #009688"] td {
    background-color: #f0f8f8 !important;
    font-weight: bold !important;
    border-top: 2px solid var(--primary-color) !important;
  }
  
  /* Ensure PDF charts and tables don't break across pages */
  .pdf-section {
    page-break-inside: avoid;
    margin-bottom: 20px;
  }
  
  .chart-panel {
    page-break-inside: avoid;
    margin-bottom: 15px;
  }
  
  /* Monthly table splits for PDF landscape sections */
  .pdf-monthly-table {
    font-size: 9px !important;
    width: 100%;
    border-collapse: collapse;
  }
  
  .pdf-monthly-table th,
  .pdf-monthly-table td {
    padding: 3px 5px !important;
    border: 1px solid #ddd;
    font-size: 8px !important;
  }
  
  .pdf-monthly-table caption {
    font-size: 11px !important;
    padding: 4px 6px !important;
  }
}

/* ==========================================================================
   16. RESPONSIVE DESIGN - MOBILE FIRST
   ========================================================================== */

/* Tablet responsive */
@media (max-width: 900px) {
  #map-container {
    min-height: 210px;
    height: 33vh;
    max-height: 48vh;
  }
  
  .options-checkboxes > div {
    flex: 1 1 100%;
    min-width: 180px;
    max-width: 100%;
  }

  .results-checkboxes-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  
  .start-layout {
    gap: 30px;
    min-height: 450px;
  }
  
  .start-right-column {
    max-height: 350px;
  }
  
  .start-left-column h2 {
    font-size: 2rem;
  }
  
  .start-left-column p {
    font-size: 1rem;
  }
  
  .start-buttons-row {
    gap: 20px;
    margin-top: 25px;
  }
}

/* Tablet to small desktop */
@media (max-width: 768px) {
  .container {
    max-width: 100vw;
    padding: 6px;
  }
  
  #contactIcons {
    display: none !important;
  }
  
  .nav-tabs {
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .nav-tab {
    min-width: 100px;
    flex-shrink: 0;
  }
  
  .nav-tab a {
    padding: 10px 12px;
    font-size: 0.9rem;
    border-right: 1px solid rgba(255,255,255,0.2) !important;
    border-bottom: none !important;
  }
  
  .nav-tab:last-child a {
    border-right: none !important;
    border-bottom: none !important;
  }
  
  .tab-navigation {
    margin-bottom: 20px !important;
  }
  
  /* Start section mobile */
  .start-layout {
    flex-direction: column;
    gap: 20px;
    min-height: auto;
  }
  
  .start-left-column {
    padding-right: 0;
    text-align: center;
    flex: 1 1 100%;
    max-width: 100%;
  }
  
  .start-right-column {
    display: none !important;
  }
  
  .start-left-column h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 16px;
  }
  
  .start-left-column p {
    text-align: left;
    font-size: 0.95rem;
    margin-bottom: 20px;
    max-width: none;
  }
  
  .start-buttons-row {
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
  }
}

/* Mobile screens */
@media (max-width: 600px) {
  /* Layout adjustments */
  #map-container {
    min-height: 135px;
    height: 24vh;
    max-height: 33vh;
  }
  
  #location-notification {
    left: 50% !important;
    transform: translateX(-50%) !important;
    min-width: 80vw !important;
    font-size: 12px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    bottom: 24px !important;
    border-radius: 16px !important;
  }
  
  /* Tab navigation mobile */
  .tab-navigation {
    margin-bottom: 20px;
  }

  .nav-tab {
    min-width: 50px;
    flex: 1;
  }
  
  .nav-tab a {
    padding: 8px 4px;
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 50px;
    box-sizing: border-box;
  }
  
  .nav-tab a span.tab-text {
    display: none;
  }
  
  .nav-tab a::before {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0) invert(1);
  }
  
  .nav-tab[data-tab="start"] a::before { background-image: url('/static/tab-start.svg'); }
  .nav-tab[data-tab="climate"] a::before { background-image: url('/static/tab-climate.svg'); }
  .nav-tab[data-tab="building"] a::before { background-image: url('/static/tab-building.svg'); }
  .nav-tab[data-tab="operation"] a::before { background-image: url('/static/tab-operation.svg'); }
  .nav-tab[data-tab="system"] a::before { background-image: url('/static/tab-system.svg'); }
  .nav-tab[data-tab="results"] a::before { background-image: url('/static/tab-results.svg'); }
  
  .nav-tab.active a::before {
    filter: brightness(0) saturate(100%) invert(45%) sepia(95%) saturate(478%) hue-rotate(134deg) brightness(96%) contrast(101%);
  }
  
  /* Mobile label fixes */
  .input-field > label,
  .input-field .select-wrapper + label {
    font-size: 15px !important;
    top: -6px !important;
    white-space: normal !important;
    line-height: 1.2 !important;
    max-width: 100% !important;
  }
  
  .input-field input[type="text"],
  .input-field input[type="number"],
  .input-field textarea,
  .input-field .select-wrapper input.select-dropdown {
    margin-top: 6px !important;
  }
  
  .input-field.has-wrapped-label input[type="text"],
  .input-field.has-wrapped-label input[type="number"],
  .input-field.has-wrapped-label textarea,
  .input-field.has-wrapped-label .select-wrapper input.select-dropdown {
    margin-top: 16px !important;
  }
  
  .input-field:not(.has-wrapped-label) .select-wrapper + label {
    top: -10px !important;
  }
  
  .input-field.has-wrapped-label .select-wrapper + label {
    top: -18px !important;
    font-size: 13px !important;
  }
  
  #singleSlopeOptions .select-wrapper input.select-dropdown {
    margin-top: 10px !important;
  }
  
  /* Layout containers mobile */
  .temp-special-options {
    gap: 8px 24px;
  }
  
  .options-checkboxes {
    flex-direction: column;
    gap: var(--space-sm);
  }

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

  .results-checkboxes {
    gap: var(--space-sm);
  }

  .results-checkboxes-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .results-checkbox-group {
    padding: var(--space-xs);
  }

  .options-checkboxes label,
  .results-checkboxes label {
    font-size: 1em;
    white-space: normal;
    word-break: break-word;
  }
  
  .config-row-flex {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .config-apply-btn {
    margin-top: 8px;
  }
  
  .responsive-bottom-buttons {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px 0 !important;
  }
  
  .responsive-bottom-buttons button,
  .responsive-bottom-buttons input[type="text"] {
    margin-right: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .tab-navigation-buttons {
    flex-direction: row;
    gap: 12px;
  }
  
  .tab-navigation-buttons .btn {
    flex: 1;
    min-width: auto;
  }
  
  /* Container responsive sections */
  #singleSlopeControlsContainer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px 0;
  }
  
  #singleSlopeControlsContainer .heating-type-inline {
    white-space: normal;
    align-items: flex-start;
  }
  
  /* Summary table mobile: keep columns in a single row and enable horizontal scroll */
  .summary-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.styled.summary-table { table-layout: auto; min-width: 720px; font-size: 12px; }
  table.styled.summary-table tr { display: table-row; border-bottom: 1px dashed var(--border-color); }
  table.styled.summary-table td, table.styled.summary-table th { display: table-cell; white-space: nowrap; width: auto !important; box-sizing: border-box; }
  
  /* Fixed elements mobile */
  #contactIcons,
  #darkModeToggle {
    left: 8px !important;
    width: 40px !important;
    height: 40px !important;
  }
  
  #contactIcons a {
    width: 40px !important;
    height: 40px !important;
  }
  
  #loadingOverlay .spinner .progress-text {
    font-size: 18px !important;
  }
  
  /* Full width mobile fixes */
  html, body {
    min-width: 100vw !important;
    width: 100vw !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .container {
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 4px 4px 12px !important;
    margin: 0 !important;
    /* ensure content starts right below fixed headers */
    padding-top: calc(var(--appbar-height) + var(--tabs-height) + 8px) !important;
  }
  
  #map-container, #map {
    min-width: 100vw !important;
    width: 100vw !important;
    left: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 12px !important;
  }
  
  .full-width-banner,
  .results-banner,
  .banner {
    width: 100vw !important;
    min-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 12px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  .banner-title {
    font-size: 1.1rem !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100vw !important;
    min-width: 100vw !important;
  }
  
  .banner-logo {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  .banner-buttons {
    right: 8px !important;
  }
  
  fieldset {
    padding: 4px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 12px !important;
  }
  
  fieldset legend {
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 13px !important;
  }
  
  .input-field label,
  .input-field select + label {
    font-size: 13px !important;
  }
  
  table.styled {
    font-size: 12px !important;
    min-width: 600px !important;
    width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 12px !important;
  }
  
  .chart-panel {
    border-radius: 12px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100vw !important;
    min-width: 100vw !important;
    overflow-x: auto !important;
  }
  
  .chart-header {
    font-size: 1em !important;
    padding: 4px 6px !important;
  }
  
  #buildingModel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Prevent Building Dimensions fieldset from overflowing on mobile */
  #tab-building fieldset {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  #singleSlopeControlsContainer,
  #detailedWindowFields,
  #detailedDoorFields {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto;
  }

  
  
  .menu-popup {
    /* Keep popup aligned to the right on mobile */
    width: auto !important;
    min-width: 0 !important;
    left: auto !important;
    right: 12px !important;
  }
  
  .menu-popup-card {
    min-width: 240px !important;
    width: auto !important;
    max-width: min(360px, calc(100vw - 24px)) !important;
    border-radius: 12px !important;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .menu-popup { 
    width: auto; 
    min-width: 0; 
  }
  
  .menu-popup-card { 
    min-width: 220px; 
    width: auto; 
    max-width: calc(100vw - 24px);
  }
  
  .nav-tab {
    min-width: 40px;
  }
  
  .nav-tab a {
    padding: 6px 2px;
    height: 44px;
  }
  
  .nav-tab a::before {
    width: 16px;
    height: 16px;
  }
}

/* Medium responsive sections */
@media (max-width: 780px) {
  .temp-special-options {
    gap: 8px 24px;
  }
}

@media (max-width: 700px) {
  .responsive-bottom-buttons {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px 0 !important;
  }
  
  .responsive-bottom-buttons button,
  .responsive-bottom-buttons input[type="text"] {
    margin-right: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 560px) {
  #advancedUExternalContainer,
  #configurationOptionsContainer,
  #singleSlopeControlsContainer,
  #singleSlopeExternalContainer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px 0;
  }
  
  #configurationOptionsContainer > *,
  .temp-special-options > * {
    white-space: normal;
  }
  
  .temp-special-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px 0;
  }
  
  .temp-special-options .heating-type-inline {
    white-space: normal;
    align-items: flex-start;
  }
  
  .config-row-flex {
    flex-direction: column;
    align-items: stretch;
  }
  
  .config-input-info {
    width: 100%;
    margin-bottom: 8px;
  }
  
  .config-apply-btn {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  
  #applyConfigBtn {
    width: 100%;
  }
}

/* RESULTS TAB SPECIFIC STYLES */
#tab-results #results .results-banner {
  display: none !important;
}

/* Results table headers should be bold on a white (or dark) background, not gradient */
#results table.styled thead th,
#results table.styled thead td {
  background: #ffffff !important;
  color: #0a2a43 !important; /* deep navy for readability */
  font-weight: 700 !important;
  border-bottom: 1px solid var(--glass-border) !important;
}

/* Dark mode variant for results table headers */
body.dark-mode #results table.styled thead th,
body.dark-mode #results table.styled thead td {
  background: var(--dark-surface) !important;
  color: #e7f2f0 !important;
  border-bottom: 1px solid var(--glass-border) !important;
}

/* Responsive advanced U-value layout */
/* Wrapper provides internal padding so selects don't touch side edges */
.responsive-u-values { padding:16px 20px 12px 20px; margin-top:12px; }
/* Ensure nice separation when it first appears (override inline display:none later) */
.responsive-u-values.appearing { animation:fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px);} to { opacity:1; transform:translateY(0);} }
.responsive-u-values .u-values-grid { display:grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap:16px 36px; }
@media (min-width: 620px){ .responsive-u-values .u-values-grid { grid-template-columns: repeat(2, minmax(260px,1fr)); } }
@media (max-width: 619px){ .responsive-u-values .u-values-grid { grid-template-columns: 1fr; } }
hr.dashed-sep { border:none; border-top:1px dashed #bbb; }
/* Paragraph spacing utility for separation above elements */
.para-gap-top { margin-top:18px !important; }
/* --- Cost badges (auto vs edited) --- */
.cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78em;
  line-height: 1.6;
  vertical-align: middle;
  user-select: none;
  color: #fff;
}
.cost-badge.auto { background: #009688; }
.cost-badge.edited { background: #ff9800; }

.cost-restore {
  display: inline-block;
  cursor: pointer;
  color: #fff;
  opacity: 0.92;
  margin-left: 2px;
  font-weight: 700;
}
.cost-restore:hover { opacity: 1; }

/* Mini source hint next to the pill badges (AUTO/EDITED) */
.cost-source-hint {
  display: inline-flex;
  align-items: center;
  font-size: 0.85em;
  color: #607d8b;
  margin-left: 8px;
}
body.dark-mode .cost-source-hint {
  color: #b0bec5;
}

/* ==========================================================================
   PROJECT MANAGER PANEL
   ========================================================================== */

.projects-section {
  margin-top: 16px;
}

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.projects-header h6 {
  margin: 0;
  color: var(--primary-color);
}

.projects-toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding-right: 8px;
  align-items: center;
}

.projects-toolbar input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.projects-toolbar select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-width: 200px;
  background-color: white;
  cursor: pointer;
}

body.dark-mode .projects-toolbar input[type="text"],
body.dark-mode .projects-toolbar select {
  background-color: var(--dark-surface);
  border-color: rgba(255,255,255,0.2);
  color: white;
}

#projectsTable {
  margin-top: 16px;
}

#projectsTable td {
  vertical-align: middle;
}

#projectsTable td.actions-cell {
  white-space: nowrap;
}

#projectsTable .btn-action {
  margin: 2px;
  padding: 6px 10px;
  height: 32px;
  line-height: 20px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#projectsTable .btn-action svg {
  display: block;
}

/* Edit Project Modal Spacing */
#editProjectModal .input-field {
  margin-top: 32px;
  margin-bottom: 12px;
}

#editProjectModal .input-field:first-child {
  margin-top: 20px;
}

#editProjectModal .input-field label {
  top: -20px;
}

