/**
 * TEUI 4.012 Styles - Updated Dec 16 , 2025
 *
 * Bootstrap 5.1.3 compatibility: Check Bootstrap influence for conflicting styles
 *
 * INPUT STYLING:
 * - Borderless design with blue user inputs, black calculated values
 * - No borders/box-shadows on inputs; subtle hover/focus backgrounds only
 * - Preserve table row borders; avoid inline style overrides
 */

:root {
  /* Layout dimensions */
  --key-values-height: 0px;
  --header-height: 60px;
  --tab-height: 36px;
  --tab-spacer-height: 15px; /* Fixed spacer height */

  /* Colors */
  --primary-text: #212529;
  --secondary-text: #5f6368;
  --header-bg: #212529;
  --header-text: #ffffff;
  --border-color: #dee2e6;
  --hover-bg: #f8f9fa;
  --table-header-bg: #f1f3f4;
  --user-input-color: #0d6efd;
  --user-input-color-rgb: 13, 110, 253;
  --calculated-value-color: #202124;
  --derived-value-color: #202124;
  --reference-value-color: #8b0000;
  --reference-value-color-rgb: 139, 0, 0;
  --target-value-color: #1a73e8;
  --actual-value-color: #202124;
  --link-color: #0d6efd;
  --tab-active-bg: #495057;
  --tab-active-border: #0d6efd;

  /* Sizes and spacings */
  --section-spacing: 12px;
  --cell-padding: 4px 8px;
  --header-cell-padding: 6px 8px;
  --border-radius: 8px;

  /* Font sizes */
  --base-font-size: 0.85rem;
  --small-font-size: 0.8em;
  --smaller-font-size: 0.75em; /* Adjusted this for header rows */
  --header-font-size: 0.85rem;
  --key-values-font-size: 1.3rem;
}

/* =============== Base Element Styling =============== */

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: var(--base-font-size);
  line-height: 1.5;
  color: var(--primary-text);
  margin: 0;
  padding: 0;
}

.logo {
  height: var(--header-height);
}

/* =============== Layout Framework =============== */

/* App wrapper structure */
#app-wrapper {
  position: relative;
  width: 100%;
  margin-top: 0;
  min-height: 100vh; /* Take at least full viewport height */
  /* Ensure clean separation from header elements */
  padding-top: 0;
  border-top: 0;
}

/* Main container structure */
#calculator-container {
  position: relative;
  width: 100%;
  margin-top: 0;
  min-height: 500px;
}

/* Section spacer to maintain proper distance between tabs and content */
.section-spacer {
  display: none;
  height: 0;
}

/* In horizontal layout, add fixed spacing below tabs with scroll barrier */
.horizontal-layout .section-spacer {
  display: block;
  height: 10px;
  min-height: 10px;
  max-height: 10px;
  width: 100%;
  background: transparent;
  margin: 0;
  padding: 0;
  /* Make it a scroll barrier */
  scroll-margin-top: calc(var(--key-values-height) + var(--tab-height));
  position: relative;
  z-index: 108;
}

/* Print-only elements (hidden on screen, shown in print) */
.print-only {
  display: none;
}

/* Tab spacer - setting to zero height in horizontal layout */
.tab-spacer {
  height: 0;
  display: none;
  background-color: transparent;
  position: static;
}

/* Key values positioning */
#keyValues {
  position: sticky;
  top: 0;
  z-index: 110;
  margin-bottom: 0;
  background-color: #fff;
  box-shadow: none; /* Remove shadow which can cause line */
  border-bottom: none; /* Remove border which can cause line */
}

/* Tab container - attach directly to Key Values with no gap */
.tab-container {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  background-color: var(--header-bg);
  border: 2px solid var(--header-bg);
  border-top: none;
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  position: sticky;
  top: var(--key-values-height); /* Stick exactly at the bottom of Key Values */
  z-index: 109;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  margin-top: 0;
  margin-bottom: 0;
  height: var(--tab-height);
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

.tab-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Prevent active sections from getting too close to tabs */
.horizontal-layout .section.active:not(#keyValues) {
  position: relative;
  margin-top: 0; /* Reset margin */
}

/* =============== Section Styling =============== */

.section {
  margin-bottom: var(--section-spacing);
  border: 2px solid var(--header-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.section-header {
  background-color: var(--header-bg);
  color: white;
  padding: 6px 12px;
  font-weight: 500;
  font-size: var(--header-font-size);
  display: flex;
  align-items: center;
  user-select: none;
  cursor: pointer;
}

.section-icon {
  margin-right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section-content {
  transition:
    max-height 0.3s ease-out,
    opacity 0.2s ease-out;
  max-height: 2000px;
  opacity: 1;
  overflow: hidden;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar for webkit browsers */
.section-content::-webkit-scrollbar {
  display: none;
}

/* =============== Data Tables =============== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--base-font-size);
  table-layout: auto; /* Changed from fixed to auto */
}

/* Table cells with no wrapping */
.data-table td,
.data-table th {
  padding: var(--cell-padding);
  text-align: left; /* Default alignment */
  border-bottom: 1px solid #eeeeee;
  line-height: 1.2;
  white-space: nowrap; /* Prevent wrapping */
  overflow: hidden; /* Changed from visible */
  text-overflow: ellipsis; /* Added */
}

/* Table cell styling moved to line ~845 to avoid duplication */

/* Right-align numeric columns (D-M) */
.data-table td.col-d,
.data-table td.col-f,
.data-table td.col-h,
.data-table td.col-j,
.data-table td.col-k,
.data-table td.col-l {
  text-align: right;
}

/* Force specific text columns (Units, secondary labels) to left-align */
.data-table
  td.col-e:not(:has(.calculated-value)):not(:has(.derived-value)):not(
    .user-input
  ):not(.number-input-cell),
.data-table
  td.col-g:not(:has(.calculated-value)):not(:has(.derived-value)):not(
    .user-input
  ):not(.number-input-cell),
.data-table
  td.col-i:not(:has(.calculated-value)):not(:has(.derived-value)):not(
    .user-input
  ):not(.number-input-cell),
.data-table
  td.col-m:not(:has(.calculated-value)):not(:has(.derived-value)):not(
    .user-input
  ):not(.number-input-cell) {
  text-align: left; /* Only apply left-align if the cell doesn't contain a calculated/derived/input value */
}

/* Ensure Calculated/Derived/User Input values are RIGHT-aligned, overriding column defaults */
.data-table td.col-e.calculated-value,
.data-table td.col-g.calculated-value,
.data-table td.col-i.calculated-value,
.data-table td.col-m.calculated-value,
.data-table td.col-e .calculated-value, /* Target inner elements too */
.data-table td.col-g .calculated-value,
.data-table td.col-i .calculated-value,
.data-table td.col-m .calculated-value,
.data-table td.col-e.derived-value,
.data-table td.col-g.derived-value,
.data-table td.col-i.derived-value,
.data-table td.col-m.derived-value,
.data-table td.col-e .derived-value,
.data-table td.col-g .derived-value,
.data-table td.col-i .derived-value,
.data-table td.col-m .derived-value,
.data-table td.col-e.user-input,
.data-table td.col-g.user-input,
.data-table td.col-i.user-input,
.data-table td.col-m.user-input,
.data-table td.col-e .user-input,
.data-table td.col-g .user-input,
.data-table td.col-i .user-input,
.data-table td.col-m .user-input,
.data-table td.col-e.number-input-cell,
.data-table td.col-g.number-input-cell,
.data-table td.col-i.number-input-cell,
.data-table td.col-m.number-input-cell {
  text-align: right !important;
}

/* Calculated/Derived values styling (keep base style) */
.calculated-value {
  font-weight: 500;
  color: var(--calculated-value-color);
  /* text-align is now handled by the more specific rule above */
}

.derived-value {
  font-weight: 500;
  color: var(--derived-value-color);
  /* text-align is now handled by the more specific rule above */
}

/* Style for fields awaiting measurement/input */
.PendingValue {
  font-style: italic;
  color: #888888; /* Light grey */
}

/* =============== Layout Toggle and Navigation =============== */

/* Toggle buttons for layout modes */
#layout-toggle {
  margin-bottom: 15px;
}

/* Tab styling */
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 12px;
  color: #fff;
  background-color: transparent;
  border: none;
  border-right: 1px solid #444;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
  height: var(--tab-height);
  min-width: 80px;
}

.tab i {
  margin-right: 4px;
  font-size: 0.9em;
}

.tab.icon-only {
  min-width: 40px;
  padding: 8px 8px;
  justify-content: center;
}

.tab.icon-only i {
  margin-right: 0;
  font-size: 1.1em;
}

/* Button sizing fixes */
#expand-collapse-all,
.layout-toggle-btn {
  font-size: 20px;
  line-height: 1;
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab:hover {
  background-color: var(--tab-active-bg);
}

.tab.active {
  background-color: var(--tab-active-bg);
  border-bottom: 4px solid var(--tab-active-border) !important;
}

/* Layout toggle button in Key Values header */
.layout-toggle-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 10px;
}

.layout-toggle-btn:hover {
  color: #f1f1f1;
}

/* Expand/Collapse controls */
.expand-collapse-all {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 6px 10px;
  background-color: #f1f3f4;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
}

.expand-collapse-all:hover {
  background-color: #e8eaed;
}

.expand-collapse-all .toggle-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 4px 0 4px;
  border-color: var(--primary-text) transparent transparent transparent;
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.expand-collapse-all.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

/* Section toggle icon */
.section-header .toggle-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 4px 0 4px;
  border-color: white transparent transparent transparent;
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.section-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

/* Collapsible section content */
.section-header.collapsed + .section-content {
  max-height: 0 !important;
  opacity: 0 !important;
  overflow: hidden;
  padding: 0;
  margin: 0;
  border: none;
}

/* =============== Layout Modes =============== */

/* Horizontal (tabbed) layout */
.horizontal-layout #keyValues {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}

.horizontal-layout .tab-container {
  display: flex !important;
}

.horizontal-layout .expand-collapse-all {
  display: none;
}

.horizontal-layout .section:not(#keyValues):not(.active) {
  display: none;
}

.horizontal-layout .section.active:not(#keyValues) {
  display: block;
  margin-top: 0;
  padding-top: 0;
  align-self: flex-start;
}

/* Vertical layout */
.vertical-layout .tab-container {
  display: none !important;
}

.vertical-layout .section {
  display: block;
}

.vertical-layout #keyValues {
  margin-bottom: var(--section-spacing) !important;
  border-bottom-left-radius: var(--border-radius) !important;
  border-bottom-right-radius: var(--border-radius) !important;
  border-bottom: 2px solid var(--header-bg) !important;
}

/* =============== Component Styling =============== */

/* Dropdowns */
/* Force removal of borders/outlines on dropdowns and their containers */
.form-select,
select.form-select,
select.form-control,
select,
option,
.data-table td.dropdown-cell, /* Target the cell itself */
.data-table td select.form-select {
  /* Font consistency */
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-family: sans-serif; /* Fallback */

  /* Restore forcing removal of border and outline */
  border: none !important; /* Restored rule */
  outline: none !important;
  box-shadow: none;
  /* Keep dropdowns transparent, they don't need hover bg */
  background-color: transparent;

  /* Ensure consistent size and appearance */
  font-size: inherit; /* Inherit from parent cell */
  color: var(--user-input-color); /* Blue color for select */
  font-weight: 500;
}

/* Restore Bootstrap's default for dropdown-menu and dropdown-item */
.dropdown-menu,
.dropdown-item {
  background-color: #fff !important;
}

/* Apply to select elements within table cells */
.data-table select.form-select {
  width: 100%;
  min-width: 140px; /* Ensure minimum width for content */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #ced4da !important; /* Restore Bootstrap border */
  border-radius: 0.25rem !important; /* Bootstrap default radius */
  padding: 0.375rem 2.25rem 0.375rem 0.75rem !important; /* Bootstrap default padding */
  background-color: #fff !important; /* Ensure white background */
  /* Ensure the select sits properly in the cell */
  margin: 2px 0; /* Small margin to prevent border touching table lines */
  height: calc(100% - 4px); /* Account for margins */
}

/* Ensure dropdown cells have minimum width */
[data-dropdown-id],
.dropdown-cell {
  min-width: 140px;
  padding: 2px 8px !important; /* Adjust cell padding to accommodate select borders */
}

/* Handle dropdowns spanning columns */
td[colspan="2"] .form-select {
  min-width: 180px;
}

/* Sliders */
[data-type="percentage"],
[data-type="coefficient"],
[data-type="year_slider"] {
  cursor: pointer;
  color: var(--user-input-color);
  font-weight: 500;
}

/* =============== Print Styling =============== */
/* Consolidated into comprehensive REPORT2 print styles at end of file (line 2425+) */

/* =============== Responsive Adjustments =============== */

@media (max-width: 992px) {
  .tab {
    padding: 8px 10px;
    min-width: 70px;
  }

  .tab-text-full {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Adjust column behavior at medium size */
  .data-table {
    width: 100%;
  }

  /* Allow description text to wrap only at medium size if absolutely necessary */
  .description-cell,
  .data-table td:nth-child(6),
  .data-table td:nth-child(7) {
    white-space: normal;
  }

  /* Prioritize showing description column */
  .data-table col.col-c {
    min-width: 200px;
  }

  /* Also prioritize F and G at medium sizes */
  .data-table col.col-f,
  .data-table col.col-g {
    min-width: 100px;
  }

  .data-table col.col-d,
  .data-table col.col-e,
  .data-table col.col-h,
  .data-table col.col-i,
  .data-table col.col-j,
  .data-table col.col-k,
  .data-table col.col-l,
  .data-table col.col-m,
  .data-table col.col-o {
    width: 80px; /* Further reduce value columns at medium size */
    min-width: 60px;
  }
}

@media (max-width: 768px) {
  :root {
    --key-values-font-size: 1.1rem;
    --base-font-size: 0.8rem;
    --header-font-size: 0.9rem;
  }

  .tab {
    min-width: 60px;
    padding: 8px 6px;
  }

  .tab-text-full {
    display: none;
  }

  .tab-text-short {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Ensure ID and description columns stay visible */
  .data-table col.col-b {
    min-width: 60px;
  }

  .data-table col.col-c {
    min-width: 160px;
  }

  .tab {
    padding: 8px 4px;
    min-width: 60px;
    font-size: 0.8em;
  }
}

@media (max-width: 576px) {
  .tab {
    min-width: 40px;
    padding: 8px 8px;
    justify-content: center;
  }

  .tab .tab-text {
    display: none;
  }

  .tab i {
    margin-right: 0;
    font-size: 1.1em;
  }
}

/* Section Controls and Excel Loader Styles */
.section-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.excel-loader {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.excel-loader button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.excel-loader button i {
  font-size: 0.9em;
}

#excelStatus {
  font-size: 0.875rem;
  font-weight: 500;
}

.status-error {
  color: #dc3545;
}
.status-success {
  color: #198754;
}
.status-info {
  color: #0dcaf0;
}
.status-warning {
  color: #ffc107;
}

/* Weather Data Modal Styles */
.weather-data-pre {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 0.25rem;
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Fix for column width constraints */
.max-width-150 {
  max-width: 150px !important;
  width: auto !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
}

/* Column spanning for end-of-row text */
.span3 {
  grid-column: span 3;
  width: auto !important;
  min-width: 200px;
}

/* Allow text to wrap within span cells */
.span3.white-space-normal {
  white-space: normal !important;
}

/* Text truncation with ellipsis - can be used independently */
.truncate-text {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Tooltip functionality - now independent from truncation */
.tooltip-cell {
  position: relative;
  cursor: help;
}

.tooltip-cell:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 100;
  background: #fff;
  border: 1px solid #ddd;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  white-space: normal;
  max-width: 250px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Ensure calculated values using reference-value class are properly styled */
[data-field-id^="m_7"] {
  color: var(--reference-value-color);
  font-weight: bold;
}

/* Preserve table row borders */
.data-table tr {
  border-bottom: 1px solid #eeeeee !important;
}

.data-table td {
  padding: var(--cell-padding);
  text-align: left;
  border-bottom: 1px solid #eeeeee; /* Keep bottom border - removed important */
  border-left: none; /* Removed important */
  border-right: none; /* Removed important */
  border-top: none; /* Removed important */
  line-height: 1.2;
  white-space: nowrap; /* Prevent wrapping */
  overflow: hidden; /* Ensure this is hidden */
  text-overflow: ellipsis; /* Ensure this is set */
}

/* Browser-specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  /* Safari and Chrome specific fixes */
  [contenteditable="true"],
  .editable,
  select.form-select {
    -webkit-appearance: none; /* stylelint-disable-line property-no-vendor-prefix */
    border: 0;
    outline: none;
  }
}

/* Remove completely the prevent-auto-centering class */
/* .prevent-auto-centering { */
/*   display: none !important; */
/* } */

/* Duplicate .tab-container rule removed - already defined above at line 152 */

/* Basic horizontal layout styling */
.horizontal-layout {
  display: block;
  scroll-padding-top: calc(var(--key-values-height) + var(--tab-height));
  overflow-y: auto;
  padding-bottom: 50px;
}

/* Hide default number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none; /* stylelint-disable-line property-no-vendor-prefix */
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield; /* stylelint-disable-line property-no-vendor-prefix */ /* Firefox */
}

/* Optional: Adjust padding if needed after removing spinners */
/* 
input[type=number].form-control {
    padding-right: 0.75rem; 
}
*/

/* --- Global focus style for editable TDs and number inputs --- */

/* Apply focus style to editable table cells when editing */
.data-table td.editable.editing,
.data-table td.user-input.editing,
.data-table td:has([contenteditable="true"].editing),
.data-table td:has(input[type="number"]:focus) {
  /* Apply to TD when child input is focused */
  box-shadow: 0 0 0 0.15rem rgba(0, 123, 255, 0.25); /* Smaller blue glow on the TD */
  border-radius: 0.25rem; /* Rounded corners */
  outline: none; /* Remove default dotted outline */
}

/* --- End Global focus style --- */

/* --- Add back subtle hover background for editable cells --- */
.data-table td.editable:hover,
.data-table td.user-input:hover,
.data-table td:has(input[type="number"]:hover),
.data-table td:has([contenteditable="true"]:hover) {
  background-color: rgba(
    66,
    133,
    244,
    0.08
  ) !important; /* Re-added !important */
  cursor: pointer; /* Indicate interactivity */
}
/* --- End Hover Style --- */

/* --- Style input elements --- */

/* Base style for user-input class (text color) */
.user-input {
  font-weight: 500;
  color: var(--user-input-color); /* Removed !important */
  border: none !important;
  outline: none !important;
  background-color: transparent !important; /* Ensure no background */
}

/* Force blue color on focused number inputs */
.data-table td input[type="number"].user-input:focus {
  color: var(--user-input-color) !important; /* Force color on focus */
  /* Keep other focus styles minimal or handled by TD focus */
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  background-color: transparent !important;
}

/* Remove all the recent numeric input styling we added */
.data-table td input[type="number"].form-control,
.data-table td input[type="number"].user-input {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  padding: 0.375rem 0.75rem !important;
  /* Remove spinners */
  -webkit-appearance: none !important;
  -moz-appearance: textfield !important;
  appearance: none !important;
}

/* Remove spinner buttons in Webkit browsers */
.data-table td input[type="number"]::-webkit-outer-spin-button,
.data-table td input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* Ensure the cell itself doesn't interfere */
.data-table td.number-input-cell {
  padding: 2px 8px !important;
  background: transparent !important;
  border: none !important;
}

/* Keep the blue color for user input */
.data-table td input[type="number"].user-input {
  color: var(--user-input-color) !important;
  font-weight: 500 !important;
}

/* Removed conflicting alignment rule - now handled by universal rules */

/* Apply section-subheader styling to all cells in a row with section-subheader class */
.data-table tr td.section-subheader,
.data-table tr:has(td.section-subheader) td {
  background-color: #eaeaea; /* Light grey background - removed !important */
  color: #333; /* Darker text - removed !important */
  font-size: var(
    --smaller-font-size
  ); /* Use smaller font - removed !important */
  font-weight: 600; /* Bold - removed !important */
  padding: 3px 6px; /* Tighter padding - removed !important */
  border-bottom: 1px solid #d0d0d0; /* Separator line - removed !important */
  /* text-align: center; - REMOVED: Let column classes define alignment */
  white-space: pre-line; /* Allow wrapping on explicit newlines */
}

/* Ensure empty cells in section-subheader rows maintain styling */
.data-table tr:has(td.section-subheader) td:empty {
  background-color: #eaeaea; /* Ensure empty cells also get background - removed !important */
}

/* Removed conflicting alignment rule - now handled by universal rules */

/* Removed conflicting Section 02 alignment rules - now handled by universal rules */

/* Make the dropdown styling more specific */
.data-table td select.form-select,
.data-table td select.form-control,
table.data-table select.form-select {
  width: 100%;
  min-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #ced4da !important;
  border-radius: 0.25rem !important;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem !important;
  background-color: #fff !important;
  margin: 2px 0;
  height: calc(100% - 4px);
  /* Remove native appearance */
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  /* Add Bootstrap-style background arrow */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 16px 12px !important;
}

/* Add hover effect */
.data-table td select.form-select:hover,
.data-table td select.form-control:hover,
table.data-table select.form-select:hover {
  border-color: #86b7fe !important;
}

/* Ensure the cell itself doesn't interfere */
.data-table td.dropdown-cell {
  padding: 2px 8px !important;
  background: transparent !important;
  border: none !important;
}

/* Set Values button styling - matches dropdown appearance */
.data-table #setValuesBtn {
  width: 100%;
  min-width: 100px;
  border: 1px solid #ced4da !important; /* Match dropdown border color */
  border-radius: 0.25rem !important;
  padding: 0.375rem 0.75rem !important;
  background-color: #fff !important;
  color: var(--user-input-color) !important; /* Blue text like dropdowns */
  font-weight: 500 !important; /* Match dropdown font weight */
  font-size: inherit;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  transition: all 0.2s ease;
  cursor: pointer;
  margin: 2px 0;
  height: calc(100% - 4px);
}

/* Set Values button hover - warning red */
.data-table #setValuesBtn:hover {
  border-color: #dc3545 !important; /* Red border on hover */
  color: #dc3545 !important; /* Red text on hover */
  background-color: #fff !important;
}

/* Ensure button cell has proper padding */
.data-table td.button-cell {
  padding: 2px 8px !important;
  background: transparent !important;
  border: none !important;
}

/* --- Utility Classes --- */
/* Removed conflicting alignment utility classes - now handled by universal rules */

/* Style for disabled/non-applicable input fields */
.disabled-input {
  color: #6c757d !important; /* Bootstrap's secondary text color (grey) */
  font-style: italic !important;
  cursor: default !important;
  background-color: transparent !important; /* Ensure no background interferes */
}
/* --- End Utility Classes --- */

/* Removed conflicting text-left-indicator - now handled by universal rules */

/* --- Section 11 Visual Indicators --- */

/* Base style for indicator cells */
.loss-indicator,
.gain-indicator {
  position: relative;
}

/* Dot styles using pseudo-elements */
.loss-indicator::before,
.gain-indicator::before {
  content: "";
  position: absolute;
  left: 6px; /* Nudge dot slightly right */
  top: 50%;
  transform: translateY(-50%);
  width: 10px; /* Increased dot size */
  height: 10px; /* Increased dot size */
  border-radius: 50%;
  display: inline-block;
}

/* Apply padding only when text is left aligned AND indicator is present */
.text-left-indicator.loss-indicator,
.text-left-indicator.gain-indicator {
  padding-left: 20px; /* Space for dot + small gap */
}

/* Heat Loss Indicator Colors (Loss High = Red)*/
.loss-high::before {
  background-color: #dc3545; /* Red */
}
.loss-medium::before {
  background-color: #ffc107; /* Yellow */
}
.loss-low::before {
  background-color: #28a745; /* Green */
}

/* Heat Gain Indicator Colors (Gain High = Green) */
.gain-high::before {
  background-color: #28a745; /* Green */
}
.gain-medium::before {
  background-color: #ffc107; /* Yellow */
}
.gain-low::before {
  background-color: #dc3545; /* Red */
}

/* Text Color for Air vs Ground Facing % (Column H) */
.text-air-facing {
  color: #b0e0e6; /* Powder Blue */
}

.text-ground-facing {
  color: #8b4513; /* Brown (SaddleBrown) */
}

/* Style for bolding text in total rows */
.total-row-text {
  font-weight: 600; /* Semi-bold */
}


/* ======================================
   SECTION 16 - SANKEY DIAGRAM STYLES
   ====================================== */

/* Basic Sankey Element Styles (ported and scoped/simplified) */
#sankeySection16Container .node {
  stroke: #000;
  stroke-width: 1px;
  cursor: pointer;
}

#sankeySection16Container .link {
  fill: none;
  stroke-opacity: 0.7;
  cursor: pointer;
}

#sankeySection16Container .link:hover {
  stroke-opacity: 0.9;
}

#sankeySection16Container .node-label {
  font-size: 12px; /* Corresponds to --font-size-sm */
  fill: black;
  pointer-events: none;
  font-weight: 500;
  font-family: Arial, sans-serif; /* Ensure a common font */
}

/* Tooltip for Section 16 Sankey */
#sankeySection16Tooltip {
  display: none;
  position: fixed !important;
  z-index: 10000;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  max-width: 350px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  pointer-events: none;
}

#sankeySection16Tooltip .tooltip-title {
  font-weight: bold;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

#sankeySection16Svg .node,
#sankeySection16FullscreenSvg .node {
  stroke: #000;
  stroke-width: 1px;
  fill-opacity: 1 !important;
}

#sankeySection16Svg .link,
#sankeySection16FullscreenSvg .link {
  fill: none;
  stroke-width: 1px; /* Fallback minimum width */
  stroke-opacity: 0.6;
  transition: stroke-opacity 0.3s;
}

#sankeySection16Svg text,
#sankeySection16FullscreenSvg text {
  font-size: 12px;
  pointer-events: none;
}

/* Controls styling */
#s16ControlsContainer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}

#s16WidthToggleContainer {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Fullscreen styles */
#s16FullscreenContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
  display: none;
}

/* Ensure specific buttons in the main header do not wrap text */
#selectExcelBtn,
#debugExcelBtn,
#showWeatherDataBtn {
  white-space: nowrap;
}

/* Optional: If all buttons in that controls-container need it */
/* .controls-container .btn {
    white-space: nowrap;
} */

/* ======================================
   SECTION 17 - DEPENDENCY GRAPH STYLES
   ====================================== */

.dependency-graph-controls-wrapper,
.dependency-graph-info-wrapper {
  /* Wrappers for placement above the SVG */
  padding-left: 1rem; /* Align with section content padding */
  padding-right: 1rem;
  background-color: #f8f9fa; /* Add light background for fullscreen contrast */
  border-radius: 0.25rem; /* Optional rounding */
}

.dependency-graph-controls {
  /* Styles for the filter/button container */
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background-color: #f8f9fa; /* Light background */
  padding: 10px;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.dependency-graph-controls .form-control-sm,
.dependency-graph-controls .form-select-sm,
.dependency-graph-controls .btn-sm {
  font-size: 0.875rem; /* Match Bootstrap small size */
}

/* Activation Button - styled to fit in controls row */
#s17ActivateBtn {
  flex-shrink: 0;
  margin-right: 10px;
  min-width: 120px; /* Ensure button doesn't collapse */
}

/* Search Container */
.dependency-graph-search-container {
  flex: 0 1 250px; /* Narrower to make room for activation button */
  min-width: 150px;
}

.dependency-graph-search-container .form-control {
  width: 100%;
}

/* Disabled controls styling - make them look inactive but visible */
.dependency-graph-controls input:disabled,
.dependency-graph-controls select:disabled,
.dependency-graph-controls button:disabled:not(#s17ActivateBtn) {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Group Filter Container */
.dependency-graph-group-filter {
  flex: 1;
  min-width: 200px;
}

.dependency-graph-group-filter .form-select {
  width: 100%;
}

/* Layout Buttons Container */
.dependency-graph-layout-container {
  display: flex;
  gap: 5px;
  align-items: center;
}

.layout-button.active {
  background-color: #0d6efd; /* Bootstrap primary blue */
  color: white;
  border-color: #0d6efd;
}

/* Fullscreen Button */
.dependency-graph-fullscreen-button {
  margin-left: auto;
}

.dependency-graph-controls .dependency-info-panel {
  font-size: 0.9rem;
  /* Removed max-height and overflow-y to allow full content display */
  padding: 12px;
  margin-bottom: 10px;
  border-left: 3px solid #0d6efd;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Display controlled by JS - no CSS default to avoid conflicts */
  min-height: 50px;
  background-color: #e2e3e5;
}

.dependency-info-panel .info-title {
  color: #0d6efd; /* Blue title for emphasis */
  margin-bottom: 0.5rem; /* Space after title */
}

.dependency-info-panel .info-value {
  margin-bottom: 0.25rem;
}

.dependency-info-panel .info-dependencies {
  margin-bottom: 0.25rem;
}

.dependency-info-panel .info-dependents {
  margin-bottom: 0;
}

.dependency-info-panel strong {
  font-weight: 600; /* Slightly heavier weight for better visibility */
}

.dependency-graph-svg-wrapper {
  /* Container for the SVG element */
  overflow: hidden; /* Hide scrollbars caused by D3 layout */
  /* Keep initial border */
  border: 1px solid #dee2e6;
  border-radius: 6px; /* Rounded corners */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow */
  background-color: #ffffff; /* Ensure white background */
  position: relative; /* For tooltip positioning */
}

.dependency-graph-svg-wrapper svg {
  display: block; /* Remove extra space below SVG */
  width: 100%; /* Make SVG fill wrapper width */
  height: 100%; /* Make SVG fill wrapper height */
}

/* Graph element styles */
.link {
  stroke: #999;
  stroke-opacity: 0.6;
  stroke-width: 1.5px;
  transition:
    stroke 0.3s,
    stroke-opacity 0.3s,
    stroke-width 0.3s;
}

.node circle {
  stroke: #fff;
  stroke-width: 2px;
  transition:
    r 0.3s,
    stroke-width 0.3s,
    filter 0.3s;
  filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.2));
}

/* Architectural layer styling - colored borders matching legend */
.node circle.arch-foundation,
.node circle.arch-coordination,
.node circle.arch-application {
  stroke-width: 4px;
  filter: drop-shadow(0px 0px 16px rgba(0, 0, 0, 0.8));
}

.node circle.arch-foundation {
  stroke: #2e7d32; /* Dark green for Foundation */
}

.node circle.arch-coordination {
  stroke: #1565c0; /* Dark blue for Coordination */
}

.node circle.arch-application {
  stroke: #c62828; /* Dark red for Application */
}

.node-background {
  fill: white;
  opacity: 0;
  transition: opacity 0.3s;
}

.node text {
  font-size: 12px;
  font-weight: 500;
  fill: #333;
  pointer-events: none; /* Ensure circle is clickable */
  text-shadow:
    0 0 3px white,
    0 0 3px white,
    0 0 3px white,
    0 0 3px white;
  transition: font-size 0.3s;
}

/* Custom tooltip style */
.node title {
  font-size: 14px;
  font-weight: bold;
}

/* Styles for highlighted nodes/links */
.node.highlight circle {
  stroke: #333;
  stroke-width: 3px;
  filter: drop-shadow(0px 3px 5px rgba(0, 0, 0, 0.3));
}

.link.highlight-source {
  stroke: #cc0000; /* Red for outgoing */
  stroke-opacity: 0.9;
  stroke-width: 2px;
}

.link.highlight-target {
  stroke: #0077cc; /* Blue for incoming */
  stroke-opacity: 0.9;
  stroke-width: 2px;
}

/* Style wrapper AND SVG in fullscreen */
.dependency-graph-svg-wrapper:fullscreen,
.dependency-graph-svg-wrapper:-webkit-full-screen,
.dependency-graph-svg-wrapper:-moz-full-screen {
  background-color: white; /* White background in fullscreen */
  width: 100%; /* Fill available width */
  height: 100%; /* Fill available height */
  border: none; /* Ensure no border */
  padding: 0; /* No padding - fill entire screen */
}

.dependency-graph-svg-wrapper:fullscreen svg,
.dependency-graph-svg-wrapper:-webkit-full-screen svg,
.dependency-graph-svg-wrapper:-moz-full-screen svg {
  /* SVG fills entire screen */
  width: 100%;
  height: 100%;
}

/* Enhancement for text in fullscreen */
.dependency-graph-svg-wrapper:fullscreen .node text,
.dependency-graph-svg-wrapper:-webkit-full-screen .node text,
.dependency-graph-svg-wrapper:-moz-full-screen .node text {
  font-size: 14px; /* Larger text in fullscreen */
  font-weight: 600; /* Bolder text in fullscreen */
  fill: #000; /* Black text for better contrast */
}

/* Make nodes more visible in fullscreen */
.dependency-graph-svg-wrapper:fullscreen .node circle:not(.node-background),
.dependency-graph-svg-wrapper:-webkit-full-screen
  .node
  circle:not(.node-background),
.dependency-graph-svg-wrapper:-moz-full-screen
  .node
  circle:not(.node-background) {
  filter: drop-shadow(
    0px 3px 5px rgba(0, 0, 0, 0.3)
  ); /* Stronger shadow in fullscreen */
  stroke-width: 2.5px; /* Thicker border in fullscreen */
}

/* Make links more visible in fullscreen */
.dependency-graph-svg-wrapper:fullscreen .link,
.dependency-graph-svg-wrapper:-webkit-full-screen .link,
.dependency-graph-svg-wrapper:-moz-full-screen .link {
  stroke-width: 2px; /* Thicker links in fullscreen */
  stroke-opacity: 0.7; /* More opaque links in fullscreen */
}

/* ==========================================================================
   Reference Model Toggle Styles
   ========================================================================== */

.reference-model-toggle {
  /* Rely on Bootstrap classes (e.g., btn-danger, btn-primary) for background/border */
  color: white !important; /* Ensure white text (overrides Bootstrap potentially) */
  margin-right: 0.5rem; /* Space before disclaimer button */
}

/* Reference Mode Body Class Styles - CHANGED TO viewing-reference-inputs */
body.viewing-reference-inputs .section {
  border-color: var(--reference-value-color) !important; /* Use #8B0000 */
}

body.viewing-reference-inputs .section-header {
  background-color: var(--reference-value-color) !important; /* Use #8B0000 */
  color: white !important;
  border: 1px solid var(--reference-value-color); /* Match border to bg */
}

/* Style section subheaders (unit rows) in reference mode - CHANGED TO viewing-reference-inputs */
body.viewing-reference-inputs .data-table tr td.section-subheader,
body.viewing-reference-inputs .data-table tr:has(td.section-subheader) td {
  background-color: rgba(
    var(--reference-value-color-rgb),
    0.5
  ) !important; /* 50% opacity of #8B0000 */
  color: #ffffff !important; /* White text for contrast */
  border-bottom-color: rgba(
    var(--reference-value-color-rgb),
    0.7
  ) !important; /* Darker, semi-transparent border */
}
body.viewing-reference-inputs
  .data-table
  tr:has(td.section-subheader)
  td:empty {
  background-color: rgba(
    var(--reference-value-color-rgb),
    0.5
  ) !important; /* Ensure empty cells match */
}

/* Example: Style locked fields in reference mode - CHANGED TO viewing-reference-inputs */
/* This .reference-locked class might be from the old system, review if still used/needed */
body.viewing-reference-inputs .reference-locked {
  color: var(--reference-value-color) !important; /* Red text #8B0000 */
  font-weight: bold !important;
  font-style: italic !important;
  background-color: transparent !important;
  cursor: default !important;
  pointer-events: none !important;
  /* Visually disable contenteditable */
  -webkit-user-modify: read-only !important;
  -moz-user-modify: read-only !important;
  /* user-modify removed - deprecated property no longer needed */
}

/* Ensure user-input fields retain their blue color ONLY IF NOT locked - CHANGED TO viewing-reference-inputs */
/* This also relates to the old .reference-locked style */
body.viewing-reference-inputs .user-input:not(.reference-locked) {
  color: var(--user-input-color) !important;
  font-weight: 500 !important;
  font-style: normal !important;
  cursor: text !important;
  pointer-events: auto !important;
  -webkit-user-modify: read-write !important;
  -moz-user-modify: read-write !important;
  /* user-modify removed - deprecated property no longer needed */
}

/* Style tab container in reference mode - CHANGED TO viewing-reference-inputs */
body.viewing-reference-inputs .tab-container {
  background-color: var(--reference-value-color) !important;
  border-color: var(--reference-value-color) !important;
}

/* Style tabs in reference mode - CHANGED TO viewing-reference-inputs */
body.viewing-reference-inputs .tab {
  border-right-color: rgba(
    255,
    255,
    255,
    0.3
  ); /* Lighter border between tabs */
}

/* Style tab hover in reference mode - CHANGED TO viewing-reference-inputs */
body.viewing-reference-inputs .tab:hover {
  background-color: rgba(
    255,
    255,
    255,
    0.15
  ); /* Slightly lighter transparent white */
}

/* Style active tab in reference mode - CHANGED TO viewing-reference-inputs */
body.viewing-reference-inputs .tab.active {
  background-color: rgba(
    255,
    255,
    255,
    0.15
  ) !important; /* Match hover background */
  border-bottom: 4px solid var(--tab-active-border) !important; /* Explicitly set 4px blue border */
}

/* Style Key Values table borders in reference mode - CHANGED TO viewing-reference-inputs */
body.viewing-reference-inputs #keyValues .key-values-table {
  border-color: var(--reference-value-color) !important;
}
body.viewing-reference-inputs #keyValues .key-values-table tr {
  border-bottom-color: var(--reference-value-color) !important;
}

/* MODIFIED STYLE for locked reference input display cells/elements */
/* This applies when viewing cached reference inputs */
body.viewing-reference-inputs .reference-input-display-locked {
  /* This rule primarily handles the background fill for PARENT elements like <td> */
  background-color: rgba(
    var(--reference-value-color-rgb),
    0.1
  ) !important; /* Subtle 10% red overlay */
  /* Apply text styles here too, in case the class is on a non-input element that contains text */
  color: var(--reference-value-color) !important;
  font-weight: bold !important;
  font-style: italic !important;
  cursor: default !important;
}

/* --- START SUPER TARGETED OVERRIDES FOR INPUTS --- */

/* Rule for ANY element that has BOTH .user-input AND .reference-input-display-locked */
body.viewing-reference-inputs .user-input.reference-input-display-locked {
  color: var(--reference-value-color) !important;
  font-weight: bold !important;
  font-style: italic !important;
  background-color: rgba(
    var(--reference-value-color-rgb),
    0.1
  ) !important; /* Ensure fill is also on the input */
  opacity: 0.95 !important; /* Slightly less dim to see text better */
  -webkit-text-fill-color: var(--reference-value-color) !important;
  pointer-events: none !important; /* Ensure it's not interactive */
  cursor: default !important;
}

/* Specific for input[type="number"] elements that have BOTH classes */
body.viewing-reference-inputs
  input[type="number"].user-input.reference-input-display-locked {
  color: var(--reference-value-color) !important;
  font-weight: bold !important;
  font-style: italic !important;
  background-color: rgba(
    var(--reference-value-color-rgb),
    0.1
  ) !important; /* Ensure fill is also on the input */
  opacity: 0.95 !important;
  -webkit-text-fill-color: var(--reference-value-color) !important;
  pointer-events: none !important;
  cursor: default !important;
}

/* If an input is a child of .reference-input-display-locked AND is a .user-input */
body.viewing-reference-inputs .reference-input-display-locked .user-input {
  color: var(--reference-value-color) !important;
  font-weight: bold !important;
  font-style: italic !important;
  background-color: rgba(
    var(--reference-value-color-rgb),
    0.1
  ) !important; /* Ensure fill is also on the input */
  opacity: 0.95 !important;
  -webkit-text-fill-color: var(--reference-value-color) !important;
  pointer-events: none !important;
  cursor: default !important;
}

/* Fallback for general child inputs/selects/textareas if they DON'T have .user-input */
/* but are still meant to be locked and styled for reference display */
body.viewing-reference-inputs .reference-input-display-locked input,
body.viewing-reference-inputs .reference-input-display-locked select,
body.viewing-reference-inputs .reference-input-display-locked textarea {
  color: var(--reference-value-color) !important;
  font-weight: bold !important;
  font-style: italic !important;
  background-color: rgba(var(--reference-value-color-rgb), 0.1) !important;
  opacity: 0.95;
  pointer-events: none !important;
  cursor: default !important;
}
/* --- END SUPER TARGETED OVERRIDES FOR INPUTS --- */

/* Empty ruleset removed - no specific select styling needed */

/* Fallback style (grey) - keep this for cases where the class might be applied without the body class */
/* This can be removed if .reference-input-display-locked is ONLY ever used with the body class */
.reference-input-display-locked:not(body.viewing-reference-inputs *) {
  /* More specific to avoid conflict */
  background-color: #f0f0f0;
  color: #555;
  cursor: default;
  font-style: italic;
  pointer-events: none;
}
.reference-input-display-locked:not(body.viewing-reference-inputs *) input,
.reference-input-display-locked:not(body.viewing-reference-inputs *) select,
.reference-input-display-locked:not(body.viewing-reference-inputs *) textarea {
  background-color: #f0f0f0;
  color: #555;
  font-style: italic;
  opacity: 0.9;
}

/* --- Mirror Highlight Styles (2025-11-27) --- */
/* Neon yellow highlighting for fields copied during mirror operations */
/* Only applies in Reference mode to show which fields were mirrored */

.mirror-highlight {
  background-color: #ffff00 !important; /* Bright neon yellow */
  transition: background-color 0.3s ease-out;
  box-shadow: 0 0 8px rgba(255, 255, 0, 0.6) !important; /* Subtle glow effect */
}

/* Ensure highlight works on inputs */
input.mirror-highlight,
select.mirror-highlight,
textarea.mirror-highlight {
  background-color: #ffff00 !important;
  -webkit-text-fill-color: #000 !important; /* Ensure text is readable */
  color: #000 !important;
}

/* Fade-out animation when highlight is removed */
.mirror-highlight-fade-out {
  background-color: transparent !important;
  box-shadow: none !important;
  transition: all 0.5s ease-out;
}

/* Dependency Graph Floating Controls in Fullscreen Mode */
.dependency-graph-floating-controls,
.dependency-graph-floating-info {
  position: absolute;
  background: rgba(255, 255, 255, 0.98);
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  transition: all 0.3s ease;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.dependency-graph-floating-controls {
  top: 20px;
  right: 20px;
  max-width: 600px;
}

.dependency-graph-floating-controls .dependency-graph-controls {
  margin-bottom: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.dependency-graph-floating-controls input,
.dependency-graph-floating-controls select {
  border: 1px solid #dee2e6 !important;
  background-color: #fff !important;
  padding: 6px 12px !important;
}

.dependency-graph-floating-info {
  top: 20px;
  left: 20px;
  max-width: 350px;
  /* Removed max-height and overflow-y to allow palette to expand to full content height */
  z-index: 10000; /* Ensure it's above everything else */
}

.dependency-graph-floating-info .dependency-info-panel {
  margin-bottom: 0;
  border-left: 3px solid #0d6efd;
  padding-left: 12px;
  background-color: transparent; /* Transparent background in fullscreen, not gray */
}

.dependency-graph-floating-info .info-title {
  color: #0d6efd;
  font-size: 16px;
  margin-bottom: 10px;
  font-weight: 600;
}

.dependency-graph-floating-info .info-value,
.dependency-graph-floating-info .info-dependencies,
.dependency-graph-floating-info .info-dependents {
  margin-bottom: 12px;
  line-height: 1.5;
}

.dependency-graph-floating-info .info-note {
  border-top: 1px solid #eee;
  padding-top: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: #666;
}

/* Color legend styling */
.dependency-graph-legend {
  position: absolute;
  bottom: 40px; /* Raised by 10px to prevent bottom clipping */
  right: 50px; /* Increased right margin to prevent text clipping */
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 36px 12px 36px; /* Balanced padding */
  border-radius: 8px;
  /* Removed box-shadow for frameless appearance */
  max-width: 390px; /* Increased by 10px more to prevent text clipping */
  max-height: calc(
    100% - 80px
  ); /* Ensure legend never exceeds container height minus margins */
  overflow-y: auto; /* Allow scrolling if content is too tall */
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  z-index: 100;
  transition: opacity 0.2s ease-in-out;
  display: none; /* Hidden by default, shown via JS */
}

.dependency-graph-legend-title {
  font-weight: bold;
  margin-bottom: 8px;
  padding-bottom: 4px;
  font-size: 14px;
}

.dependency-graph-legend-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.dependency-graph-legend-item {
  display: flex;
  align-items: center;
}

.dependency-graph-legend-color-box {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 3px;
}

.dependency-graph-legend-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dependency-graph-legend-arch-title {
  font-weight: bold;
  margin-top: 12px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-top: 1px solid #ccc;
  padding-top: 8px;
}

.dependency-graph-legend-arch-item {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  font-size: 11px;
}

.dependency-graph-legend-arch-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #f0f0f0;
  margin-right: 8px;
  flex-shrink: 0;
}

.dependency-graph-legend-arch-label {
  font-weight: 500;
}

/* Legacy selectors for backward compatibility */
.dependency-graph-legend > div:first-child {
  font-weight: bold;
  margin-bottom: 10px;
  /* Removed border-bottom for frameless appearance */
  padding-bottom: 5px;
  font-size: 14px;
}

/* Make the legend items grid nicer */
.dependency-graph-legend > div:last-child {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

/* Fullscreen specific enhancements for the legend */
.dependency-graph-svg-wrapper:fullscreen .dependency-graph-legend,
.dependency-graph-svg-wrapper:-webkit-full-screen .dependency-graph-legend,
.dependency-graph-svg-wrapper:-moz-full-screen .dependency-graph-legend {
  background: rgba(255, 255, 255, 0.95);
  padding: 15px 40px; /* Increased horizontal padding for fullscreen mode (20px + 20px) */
  font-size: 14px;
  right: 60px; /* Increased right margin for fullscreen mode */
  max-width: 400px; /* Slightly wider for fullscreen */
  /* Removed box-shadow for frameless appearance */
}

.dependency-graph-svg-wrapper:fullscreen
  .dependency-graph-legend
  > div:first-child,
.dependency-graph-svg-wrapper:-webkit-full-screen
  .dependency-graph-legend
  > div:first-child,
.dependency-graph-svg-wrapper:-moz-full-screen
  .dependency-graph-legend
  > div:first-child {
  font-size: 16px;
}

/* Special styling for influential nodes (stronger glow in fullscreen) */
.dependency-graph-svg-wrapper:fullscreen
  .node
  circle[style*="drop-shadow(0px 0px"],
.dependency-graph-svg-wrapper:-webkit-full-screen
  .node
  circle[style*="drop-shadow(0px 0px"],
.dependency-graph-svg-wrapper:-moz-full-screen
  .node
  circle[style*="drop-shadow(0px 0px"] {
  filter: drop-shadow(
    0px 0px 20px rgba(255, 82, 82, 1)
  ) !important; /* Even stronger glow in fullscreen */
}

/* ======================================
   Parallel Coordinates Styles (Section 18)
   ====================================== */

.parallel-coordinates-controls-wrapper,
.parallel-coordinates-info-wrapper {
  /* Wrappers for placement above the SVG - match S17 styling */
  padding-left: 1rem;
  padding-right: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.25rem;
}

.parallel-coordinates-controls {
  /* Styles for the control button container - match S17 styling */
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background-color: #f8f9fa;
  padding: 10px;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  margin-bottom: 10px;
}

.parallel-coordinates-controls .btn-sm {
  font-size: 0.875rem;
}

/* Activation Button - styled to fit in controls row */
#s18ActivateBtn {
  flex-shrink: 0;
  margin-right: 10px;
  min-width: 160px; /* Slightly wider for "Activate Optimization View" */
}

/* Disabled controls styling - make them look inactive but visible */
.parallel-coordinates-controls button:disabled:not(#s18ActivateBtn) {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Layout Buttons Container - push to right with fullscreen at far right */
.parallel-coordinates-controls > div:last-child {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-left: auto;
}

/* Parallel Coordinates Container - match S17 initial compact height */
.parallel-coordinates-container {
  min-height: 150px;
}

/* Parallel Coordinates Container - activated state (650px for graph + 9 table rows: Header, Capital Budget, Ref Cost, Target Cost, Savings, Simple ROI) */
.parallel-coordinates-container.activated {
  height: 650px;
  padding-bottom: 10px;
}

/* Parallel Coordinates Data Table Wrapper */
.pc-data-table {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 0; /* No margin - use container padding instead */
}

/* Parallel Coordinates Table - inside wrapper */
.pc-data-table table {
  font-size: 11px;
  margin-bottom: 0; /* Remove Bootstrap default margin */
  table-layout: fixed; /* Equal width columns for alignment with graph axes */
  width: 100%;
}

/* Parallel Coordinates Table Cells - Target color */
.pc-data-table table td.pc-target-cell {
  color: #0d6efd; /* Bootstrap primary blue */
}

/* Parallel Coordinates Table Cells - Reference color */
.pc-data-table table td.pc-reference-cell {
  color: #dc3545; /* Bootstrap danger red */
}

/* Parallel Coordinates Table - Row Labels */
.pc-data-table .pc-row-label {
  width: 60px;
  text-align: left;
  padding-left: 5px;
  padding-right: 5px;
  font-weight: 600;
  white-space: nowrap;
  font-size: 10px;
}

/* Parallel Coordinates - Interactive Node Styles */
.pc-editable-node {
  cursor: grab;
  transition: filter 0.2s ease;
}

.pc-editable-node:hover {
  filter: drop-shadow(0 0 4px rgba(13, 110, 253, 0.8)); /* Blue glow on hover */
}

.pc-dragging {
  cursor: grabbing !important;
  opacity: 0.7;
  filter: drop-shadow(
    0 0 6px rgba(13, 110, 253, 1)
  ); /* Stronger glow while dragging */
}

/* Parallel Coordinates - Capital Budget Input Fields */
.pc-capital-input {
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 11px;
  background: #fff;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.pc-capital-input:hover {
  border-color: #adb5bd;
}

.pc-capital-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Parallel Coordinates - Super Buttons (Optimization Actions) */
.pc-btn-decarbonize {
  font-weight: 500;
}

.pc-btn-optimize {
  background-color: #20c997;
  color: white;
  border-color: #20c997;
  font-weight: 500;
}

.pc-btn-super-optimize {
  background-color: #ff8c00;
  color: white;
  border-color: #ff8c00;
  font-weight: 500;
}

.pc-btn-passivhaus {
  background-color: #ffc107;
  color: #dc3545;
  border-color: #ffc107;
  font-weight: 500;
}

/* Parallel Coordinates - Feedback Console */
#s18-feedback-console {
  color: #0dcaf0;
  font-size: 0.8rem;
  font-family: monospace;
  margin-left: 10px;
}

/* WOMBAT - Feedback Console (same styling as S18) */
#s19-feedback-console {
  color: #0dcaf0;
  font-size: 0.8rem;
  font-family: monospace;
  margin-left: 10px;
}

/* Parallel Coordinates - Legend Containers */
.pc-legend-container {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-left: 20px;
  margin-right: 20px;
  padding-left: 20px;
  border-left: 1px solid #dee2e6;
}

.pc-line-legend {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pc-node-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-left: 15px;
  border-left: 1px solid #dee2e6;
}

/* Parallel Coordinates - Settings Modal */
.pc-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pc-modal-dialog {
  background: white;
  border-radius: 8px;
  padding: 20px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.pc-modal-header {
  margin: 0 0 15px 0;
  font-weight: 600;
}

.pc-modal-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.pc-modal-select {
  margin-bottom: 20px;
}

.pc-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Parallel Coordinates - Loading Placeholder */
.teui-loading-placeholder {
  padding: 40px 20px;
  text-align: center;
  background: #f9f9f9;
  border-radius: 4px;
  color: #666;
}

/* WOMBAT - Aspect Ratio Slider */
.aspect-ratio-slider input[type="range"] {
  min-width: 100px;
}

/* Parallel Coordinates - Fullscreen Mode */
#parallelCoordinates.pc-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background: white !important;
  overflow: auto !important;
}

/* ======================================
   SECTION 19 - WOMBAT CONTROLS
   ====================================== */

/* WOMBAT Controls - Match S18 pattern */
.wombat-controls-wrapper {
  padding-left: 1rem;
  padding-right: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.25rem;
}

.wombat-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background-color: #f8f9fa;
  padding: 10px;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  margin-bottom: 10px;
}

.wombat-controls .btn-sm {
  font-size: 0.875rem;
}

/* Activation Button */
#wombat-activate-btn {
  flex-shrink: 0;
  margin-right: 10px;
  min-width: 160px;
}

/* Disabled controls styling */
.wombat-controls button:disabled:not(#wombat-activate-btn) {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Control buttons - push to right with fullscreen at far right */
.wombat-controls > div:last-child {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-left: auto;
}

/* WOMBAT - Fullscreen Mode (matches S18 pattern) */
#wombat.wombat-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background: white !important;
  overflow: auto !important;
}

/* WOMBAT SVG Container and Canvas Dimensions */
.wombat-svg-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
}

#wombat-svg {
  width: 900px;
  height: 600px;
  max-width: 100%;
}

/* =============== CONTENT ALIGNMENT: CLEAN UNIVERSAL RULES =============== */
/* ROOT CAUSE FIX: Simple rules without aggressive overrides */

/* UNIVERSAL RULE 1: ALL NUMERIC CONTENT → RIGHT ALIGNED */
.data-table input[type="number"],
.data-table [contenteditable]:not([data-type="text"]),
.data-table .calculated-value,
.data-table .derived-value,
.data-table .numeric-field {
  text-align: right;
  font-family: var(--font-mono);
}

/* UNIVERSAL RULE 2: ALL TEXT CONTENT → LEFT ALIGNED */
.data-table select,
.data-table [data-type="text"],
.data-table .section-subheader,
.data-table .text-left {
  text-align: left !important;
}

/* UNIVERSAL RULE 3: SLIDERS → CENTER ALIGNED (Visual Balance) */
.data-table [data-type="percentage"],
.data-table [data-type="coefficient"],
.data-table [data-type="year_slider"],
.data-table .slider-container {
  text-align: center;
}

/* UNIVERSAL BACKUP: Ensure ALL calculated/derived values are right-aligned */
.calculated-value,
.derived-value {
  text-align: right !important;
}

/* END CLEAN RULES - Proper CSS cascade without conflicts */

/* =============== GLOBAL PASS/FAIL INDICATORS =============== */
/* Standard checkmark/warning styles used across all sections */
/*
 * Vertical alignment note (Nov 9, 2025):
 * Added vertical-align: middle to improve centering in table cells,
 * particularly for rows with dropdowns (which are taller).
 * Minimal improvement observed - checkmarks still appear slightly raised.
 * TODO: Investigate if removing/adjusting padding would improve centering.
 * For now, deferred for future investigation.
 */
/* Column N: Compliance indicators - prevent vertical expansion in tall rows */
.data-table td.col-n {
  vertical-align: middle;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Column O: Surface temperature with condensation risk indicators - add right padding
   NOTE: Use .data-table td.col-[letter] to target padding/styling for any column in any section */
.data-table td.col-o {
  padding-right: 12px;
}

.checkmark {
  color: #28a745;
}
.warning {
  color: #dc3545;
}
.yellow-checkmark {
  color: #ffc107; /* Yellow/Amber - awareness indicator, not failure */
}

/* =============== ELEGANT USER INPUT BEHAVIOR (OBC Matrix Pattern) =============== */
/* EXACT COPY from working OBC Matrix styles */

/* Default/placeholder text styling - muted grey */
.data-table td[contenteditable="true"].user-input:not(.user-modified),
.data-table td input[type="number"].user-input:not(.user-modified),
.data-table td.editable[contenteditable="true"]:not(.user-modified),
.data-table td .user-input[contenteditable="true"]:not(.user-modified) {
  color: #6c757d !important; /* Muted grey for default/placeholder text */
  font-style: italic !important; /* Subtle italic to indicate placeholder nature */
}

/* User-modified text styling - blue and confident */
.data-table td[contenteditable="true"].user-input.user-modified,
.data-table td input[type="number"].user-input.user-modified,
.data-table td.editable[contenteditable="true"].user-modified,
.data-table td .user-input[contenteditable="true"].user-modified {
  color: var(--user-input-color) !important; /* Blue for user-entered values */
  font-style: normal !important; /* Remove italic for user values */
  font-weight: 600 !important; /* Slightly bolder to show confidence */
}

/* Temporary editing intent styling - blue while actively editing (before commit) */
.data-table td[contenteditable="true"].user-input.editing-intent,
.data-table td input[type="number"].user-input.editing-intent,
.data-table td.editable[contenteditable="true"].editing-intent,
.data-table td .user-input[contenteditable="true"].editing-intent {
  color: var(--user-input-color) !important; /* Blue while editing */
  font-style: normal !important; /* Remove italic while editing */
  font-weight: 600 !important; /* Bold while editing */
}

/* Base user input styling - minimal and clean */
.data-table td[contenteditable="true"].user-input,
.data-table td input[type="number"].user-input,
.data-table td.editable[contenteditable="true"],
.data-table td .user-input[contenteditable="true"] {
  border: none !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  outline: none !important;
}

/* CRITICAL: Preserve table row dividers - don't override parent td border-bottom */
.data-table td:has([contenteditable="true"].user-input),
.data-table td:has(input[type="number"].user-input),
.data-table td.user-input[contenteditable="true"] {
  /* Keep the table's natural row border */
  border-bottom: 1px solid #eeeeee !important;
}

/* Hover state - very subtle background hint */
.data-table td[contenteditable="true"].user-input:hover,
.data-table td input[type="number"].user-input:hover,
.data-table td.editable[contenteditable="true"]:hover,
.data-table td .user-input[contenteditable="true"]:hover {
  background-color: rgba(13, 110, 253, 0.03) !important;
}

/* Enhanced border for hover state on parent cell */
.data-table td:has([contenteditable="true"].user-input:hover),
.data-table td:has(input[type="number"].user-input:hover),
.data-table td:has(.editable[contenteditable="true"]:hover),
.data-table td.user-input[contenteditable="true"]:hover {
  border-bottom-color: rgba(13, 110, 253, 0.4) !important;
}

/* Focus state - subtle background */
.data-table td[contenteditable="true"].user-input:focus,
.data-table td input[type="number"].user-input:focus,
.data-table td.editable[contenteditable="true"]:focus,
.data-table td .user-input[contenteditable="true"]:focus {
  background-color: rgba(13, 110, 253, 0.05) !important;
}

/* Enhanced border for focus state on parent cell */
.data-table td:has([contenteditable="true"].user-input:focus),
.data-table td:has(input[type="number"].user-input:focus),
.data-table td:has(.editable[contenteditable="true"]:focus),
.data-table td.user-input[contenteditable="true"]:focus {
  border-bottom-color: #0d6efd !important;
}

/* Override conflicting cell hover styles */
.data-table td:has([contenteditable="true"].user-input):hover,
.data-table td:has(input[type="number"].user-input):hover,
.data-table td:has(.user-input[contenteditable="true"]):hover {
  background-color: transparent !important;
}

/* =============== END ELEGANT USER INPUT BEHAVIOR =============== */

/* =============== DEV ENVIRONMENT INDICATOR =============== */
/* Red border for dev environment (applied via JavaScript) */
body.dev-environment {
  border: 5px solid red !important;
  box-sizing: border-box;
  min-height: 100vh;
}
/* =============== END DEV ENVIRONMENT INDICATOR =============== */

/* =============== PRINT STYLES (REPORT2 APPROACH) =============== */
/**
 * Browser native print styles for high-quality PDF export
 * Triggered by: Print Report (PDF) menu item → window.print()
 * See: docs/development/EXPORT-REPORT2.md for implementation details
 */

@media print {
  /* Page setup - minimal margins for maximum usable width */
  @page {
    size: landscape;
    margin: 0.25in; /* Reduced from 0.5in to maximize content space */
  }

  /* CRITICAL FIX: Allow horizontal overflow to prevent content clipping */
  .section {
    display: block !important; /* Ensure sections are visible */
    overflow: visible !important;
    border: none !important; /* Remove borders for cleaner print */
    page-break-inside: avoid; /* Try to keep sections together */
  }

  .section-content {
    overflow: visible !important;
    max-height: none !important; /* Remove height restrictions */
    opacity: 1 !important; /* Ensure full visibility */
  }

  /* Restore Section 01 (Key Values) border to emphasize summary block */
  #keyValues {
    position: static; /* Reset positioning for print layout */
    border: 2px solid var(--header-bg) !important;
    border-radius: var(--border-radius) !important;
  }

  /* Hide all UI elements and controls */
  header,
  nav,
  .navbar,
  .toolbar,
  #header,
  .reference-toggle,
  .help-button,
  .btn,
  button,
  #help-button,
  #reference-toggle,
  #tilt-button,
  #import-export-dropdown,
  #obc-matrix-btn,
  .dropdown,
  .dropdown-menu,
  .tab-container,
  .tab-spacer,
  .layout-toggle-btn,
  .expand-collapse-all,
  #layout-toggle {
    display: none !important;
  }

  /* Reset body for print */
  body {
    background: white !important;
    margin: 0;
    padding: 0;
  }

  /* Remove dev environment border */
  body.dev-environment {
    border: none !important;
  }

  /* Section containers - prevent page breaks inside */
  .section-container {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 1in;
  }

  /* Section headers */
  .section-header {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Tables - prevent breaks inside rows */
  table {
    page-break-inside: auto;
    break-inside: auto;
  }

  thead {
    display: table-header-group; /* Repeat headers on each page */
  }

  tbody tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Preserve graphics sections (S16-18) with full color */
  .graphics-section,
  .graphics-section canvas,
  .graphics-section svg,
  #section16,
  #section17,
  #section18 {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Remove unnecessary backgrounds for cleaner print */
  .section-container:not(.graphics-section) {
    background: white !important;
  }

  /* Preserve ALL meaningful colors - they convey important information */
  /* Blue = user inputs, Red = reference values, Green = actual values, etc. */
  /* Color is data, not decoration! */
  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Ensure body background is white, but preserve all text/element colors */
  body {
    background: white !important;
  }

  /* Links should be underlined in print */
  a {
    text-decoration: underline;
  }

  /* Page breaks between major sections */
  #section01,
  #section02,
  #section16,
  #section17,
  #section18 {
    page-break-before: always;
    break-before: page;
  }

  /* First section shouldn't force page break */
  #section01:first-child {
    page-break-before: auto;
    break-before: auto;
  }

  /* REFINEMENT 1: Remove borders from Section 1 key-values-table for consistency */
  #keyValues .key-values-table,
  #keyValues table {
    border: none !important;
  }

  /* REFINEMENT 2: Center Sankey diagram and use full available width */
  #section16 .section-content,
  #sankeySection16Container {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #section16 svg {
    max-width: 100% !important;
    height: auto !important;
  }

  /* REFINEMENT 3: Completely hide collapsed sections (don't print empty frames) */
  .section-header.collapsed {
    display: none !important;
  }

  .section-header.collapsed + .section-content {
    display: none !important;
  }

  /* DISCLAIMER PAGE: Show print-only disclaimer after sections */
  #print-disclaimer-page {
    display: block !important;
    page-break-before: always; /* Start on new page after sections */
    /* No page-break-after - allow footer to follow on same page if it fits */
    padding: 0.75in 0.5in;
    max-width: 100%;
  }

  .disclaimer-content h2 {
    font-size: 20pt;
    font-weight: bold;
    margin-bottom: 0.5em;
    text-align: center;
    color: #000;
  }

  .disclaimer-content h3 {
    font-size: 14pt;
    font-weight: bold;
    margin-top: 1em;
    margin-bottom: 0.5em;
    color: #000;
  }

  .disclaimer-content .disclaimer-date {
    font-size: 9pt;
    font-style: italic;
    text-align: center;
    margin-bottom: 1em;
    color: #666;
  }

  .disclaimer-content p {
    font-size: 10pt;
    line-height: 1.6;
    margin-bottom: 0.8em;
    color: #000;
    text-align: justify;
  }

  .disclaimer-content .disclaimer-text {
    font-size: 10pt;
    line-height: 1.6;
    margin-bottom: 1em;
  }

  .disclaimer-content hr {
    margin: 1.2em 0;
    border: none;
    border-top: 2px solid #ccc;
  }

  .disclaimer-content a {
    color: #0066cc;
    text-decoration: underline;
  }
}
/* =============== END PRINT STYLES =============== */
