/* ==========================================================================
   CoolCaCa - Design System & Modern Light Pale-Blue Theme Stylesheet
   Refined bright, soft, pale-blue aesthetic with pristine typography & cards
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Pale Soft Sky Blue & Bright Theme Colors */
  --bg-base: #F1F6FB;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FBFE;
  --bg-input: #F8FAFD;

  --border-subtle: #E2EDF6;
  --border-light: #CFE2F2;
  --border-focus: #0284C7;

  --text-main: #0F172A;
  --text-muted: #334155;
  --text-dim: #64748B;

  /* Accent Color Tokens */
  --ac-cyan: #0284C7;
  --ac-cyan-glow: rgba(2, 132, 199, 0.18);
  --ac-blue: #0369A1;

  --fan-purple: #7C3AED;
  --fan-purple-glow: rgba(124, 58, 237, 0.18);
  --fan-pink: #8B5CF6;

  --heat-orange: #EA580C;
  --heat-red: #DC2626;
  --heat-amber: #D97706;

  --target-green: #059669;
  --target-green-glow: rgba(5, 150, 105, 0.18);

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 16px 40px -8px rgba(15, 23, 42, 0.10);
  --shadow-cyan: 0 4px 20px rgba(2, 132, 199, 0.16);
  --shadow-purple: 0 4px 20px rgba(124, 58, 237, 0.16);

  /* Typography */
  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.55;
  background-image: 
    radial-gradient(circle at 12% 10%, rgba(56, 189, 248, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 88% 18%, rgba(147, 197, 253, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(224, 242, 254, 0.65) 0%, transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: #CBDCEB;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* App Container - Responsive & Fluid */
.app-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 28px 48px;
  box-sizing: border-box;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.22);
  border: 2px solid #BAE6FD;
  background: #FFFFFF;
  padding: 0;
  flex-shrink: 0;
}

.brand-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #0F172A 20%, #0284C7 70%, #2563EB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  word-break: keep-all;
  line-height: 1.25;
}

.brand-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: keep-all;
  line-height: 1.4;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-header:hover {
  color: var(--ac-blue);
  background: #F0F7FF;
  border-color: var(--ac-cyan);
  transform: translateY(-1px);
}

.btn-header svg {
  width: 16px;
  height: 16px;
}

/* Quick Presets Dropdown Toolbar */
.presets-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  background: var(--bg-card);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.presets-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ac-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.presets-label svg {
  color: var(--ac-cyan);
  filter: drop-shadow(0 0 4px rgba(2, 132, 199, 0.3));
}

.preset-dropdown-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.preset-select-wrapper {
  position: relative;
  flex: 1;
  min-width: 220px;
}

/* Custom Dropdown Trigger Button matching Mother pane body size (0.80rem) */
.preset-custom-btn {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.80rem; /* Exact Mother pane body font size */
  font-weight: 600;
  padding: 8px 36px 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  text-align: left;
  min-height: 38px;
  position: relative;
}

.preset-custom-btn:hover {
  border-color: var(--ac-cyan);
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.15);
  background: #FFFFFF;
}

.preset-custom-btn.active {
  border-color: var(--ac-cyan);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
  background: #FFFFFF;
}

.preset-custom-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  color: var(--text-main);
  font-size: 0.80rem; /* Mother pane body font size */
}

.preset-custom-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  width: 16px;
  height: 16px;
  color: var(--ac-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.preset-custom-btn.active .preset-custom-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Custom Dropdown List matching Mother pane body size and light theme */
.custom-dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: dropdownSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cdd-group-header {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ac-blue);
  background: #F0F7FF;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}
.cdd-group-header:first-child {
  border-top: none;
  border-radius: 9px 9px 0 0;
}

.cdd-group-header.presets-header {
  color: #475569;
  background: #F8FAFC;
}

.cdd-item {
  padding: 8px 12px;
  font-size: 0.80rem; /* Mother pane body size! */
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1.35;
}

.cdd-item:last-child {
  border-bottom: none;
}

.cdd-item:hover {
  background: #F0F9FF;
  color: var(--ac-blue);
}

.cdd-item.selected {
  background: #E0F2FE;
  color: #0284C7;
  font-weight: 700;
}

.cdd-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  font-size: 0.80rem; /* Mother pane body size! */
}

.cdd-item-check {
  font-size: 0.80rem;
  color: #0284C7;
  font-weight: 800;
  opacity: 0;
  flex-shrink: 0;
}

.cdd-item.selected .cdd-item-check {
  opacity: 1;
}

.cdd-empty-hint {
  padding: 10px 12px;
  font-size: 0.76rem;
  color: var(--text-dim);
  text-align: center;
}

/* Fallback hidden select font-size */
.preset-select,
.preset-select-hidden,
.preset-select option,
.preset-select optgroup {
  font-size: 0.80rem !important;
  font-family: var(--font-sans) !important;
}

.preset-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: #E0F2FE;
  border: 1px solid #BAE6FD;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ac-blue);
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.preset-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ac-cyan);
  box-shadow: 0 0 6px var(--ac-cyan);
}

.preset-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-preset-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-tool-save {
  background: #E0F2FE;
  color: #0284C7;
  border-color: #BAE6FD;
}
.btn-tool-save:hover {
  background: #0284C7;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
  transform: translateY(-1px);
}

.btn-tool-search {
  background: #F1F5F9;
  color: #334155;
  border-color: #CBD5E1;
}
.btn-tool-search:hover {
  background: #334155;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(51, 65, 85, 0.25);
  transform: translateY(-1px);
}

/* Main Layout - SPA View Switching */
.main-layout {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.page-view {
  width: 100%;
  box-sizing: border-box;
  animation: fadeInView 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

#view-inputs {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

#view-results {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.inputs-panel, .results-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Pristine Elevated Cards */
.card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
  flex-wrap: wrap;
}

.card-title .title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.card-title svg {
  width: 20px;
  height: 20px;
  color: var(--ac-blue);
  flex-shrink: 0;
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #E0F2FE;
  color: var(--ac-blue);
  border: 1px solid #BAE6FD;
  font-family: var(--font-mono);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Input Fields & Groups */
.input-group {
  margin-bottom: 16px;
}

.input-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.input-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-subtext {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dimension-grid > .input-with-unit {
  min-width: 0;
  width: 100%;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.slider-val-unit {
  flex-shrink: 0;
}

.slider-val-unit.power-unit {
  width: 130px;
}

.slider-val-unit.temp-unit {
  width: 105px;
}

.input-with-unit input,
.input-with-unit select,
.custom-input {
  width: 100%;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 9px 34px 9px 12px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.input-with-unit input:focus,
.custom-input:focus {
  border-color: var(--ac-cyan);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  background: #FFFFFF;
}

.unit-suffix {
  position: absolute;
  right: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  pointer-events: none;
}

/* Mini stat pill container */
.mini-stat-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  background: #F1F6FB;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.mini-stat-item {
  text-align: center;
}

.mini-stat-val {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ac-cyan);
}

.mini-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Sliders */
.slider-container {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.slider-container input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 6px;
  border-radius: 3px;
  background: #E2EDF6;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ac-cyan);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
  transition: transform 0.1s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-val-box {
  min-width: 68px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  background: #F1F6FB;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

/* Equipment Preset Fast-Add Buttons */
.equip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.equip-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: #FFF7ED;
  color: #C2410C;
  border: 1px solid #FFEDD5;
  cursor: pointer;
  transition: all 0.15s ease;
}

.equip-chip:hover {
  background: #FFEDD5;
  border-color: #FDBA74;
  transform: translateY(-1px);
}

/* Ambient Outdoor Temperature Fast-Select Chips */
.ambient-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ambient-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #DBEAFE;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ambient-chip:hover {
  background: #DBEAFE;
  border-color: #93C5FD;
  transform: translateY(-1px);
}

.ambient-chip[data-temp="60"] {
  background: #FFF1F2;
  color: #BE123C;
  border-color: #FECDD3;
}

.ambient-chip[data-temp="60"]:hover {
  background: #FFE4E6;
  border-color: #FDA4AF;
}

/* ==========================================================================
   Ultra-Compact Smartphone Optimized Input Cards (0-Scroll Fit)
   ========================================================================== */
.card-compact {
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.card-compact:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.card-compact .card-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 8px;
  gap: 6px;
}

.card-compact .card-title svg {
  width: 17px;
  height: 17px;
}

.title-right-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-card-tip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0369A1;
  background: #E0F2FE;
  border: 1px solid #BAE6FD;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.btn-card-tip:hover {
  background: #BAE6FD;
  color: #0284C7;
  transform: translateY(-1px);
}

/* 1. Dimension Row Compact (W x D x H inline) */
.dimension-row-compact {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
}

.dimension-row-compact .dim-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dim-col-lbl {
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
}

.dimension-row-compact .dim-cross {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  padding-bottom: 7px;
  flex-shrink: 0;
  user-select: none;
}

.dimension-row-compact .input-with-unit input {
  padding: 6px 20px 6px 6px;
  font-size: 0.85rem;
  height: 34px;
  text-align: center;
}

.dimension-row-compact .unit-suffix {
  right: 6px;
  font-size: 0.72rem;
}

/* 2. Slider Row Compact (Range + Number box inline) */
.slider-row-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.slider-row-compact input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 6px;
  border-radius: 3px;
  background: #E2EDF6;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider-row-compact input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ac-cyan);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
  transition: transform 0.1s ease;
}

.slider-row-compact input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-row-compact .power-unit {
  width: 95px;
  flex-shrink: 0;
}

.slider-row-compact .power-unit input {
  padding: 6px 22px 6px 6px;
  font-size: 0.85rem;
  height: 34px;
  text-align: right;
}

.slider-row-compact .power-unit .unit-suffix {
  right: 7px;
  font-size: 0.72rem;
}

/* 3. Temperature Compact List */
.temp-compact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.temp-row-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.temp-lbl-compact {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 82px;
  flex-shrink: 0;
  white-space: nowrap;
}

.temp-row-compact input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 6px;
  border-radius: 3px;
  background: #E2EDF6;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.temp-row-compact input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ac-cyan);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
  transition: transform 0.1s ease;
}

.temp-row-compact input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

#slider-target-temp::-webkit-slider-thumb {
  background: var(--target-green);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.4);
}

#slider-ambient-temp::-webkit-slider-thumb {
  background: var(--heat-orange);
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.4);
}

.temp-row-compact .temp-unit {
  width: 78px;
  flex-shrink: 0;
}

.temp-row-compact .temp-unit input {
  padding: 6px 20px 6px 6px;
  font-size: 0.84rem;
  height: 32px;
  text-align: right;
}

.temp-row-compact .temp-unit .unit-suffix {
  right: 6px;
  font-size: 0.72rem;
}

/* Primary Calculation Action Button (Popup Trigger) */
.calc-action-bar-wrap {
  margin: 10px 0 14px;
  width: 100%;
}

.btn-open-report {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #0284C7 0%, #2563EB 60%, #4F46E5 100%);
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.btn-open-report:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(2, 132, 199, 0.45);
}

.btn-open-report:active {
  transform: translateY(0);
}

.bor-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bor-text-wrap {
  flex: 1;
  min-width: 0;
}

.bor-main-text {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.bor-sub-text {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.9);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bor-chevron {
  font-size: 1.1rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-open-report:hover .bor-chevron {
  transform: translateX(4px);
}

/* Accordion for Advanced settings */
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 8px 0;
  user-select: none;
}

.accordion-header .acc-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-header svg.chevron {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.accordion-header.active svg.chevron {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
}

.accordion-body.open {
  display: block;
}

/* ==========================================================================
   Right Panel: Dashboard & Results
   ========================================================================== */

/* Feasibility Banner */
.feasibility-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.feasibility-banner.feasible {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
}

.feasibility-banner.infeasible {
  background: #FEF2F2;
  border: 1px solid #FECACA;
}

.feasibility-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feasible .feasibility-icon {
  background: #D1FAE5;
  color: #059669;
}

.infeasible .feasibility-icon {
  background: #FEE2E2;
  color: #DC2626;
}

.feasibility-icon svg {
  width: 24px;
  height: 24px;
}

.feasibility-content h3 {
  font-size: 1.0rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.feasible .feasibility-content h3 {
  color: #065F46;
}

.infeasible .feasibility-content h3 {
  color: #991B1B;
}

.feasibility-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Sizing Output Spec Cards (Dual Grid) */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .specs-grid {
    grid-template-columns: 1fr;
  }
}

.spec-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.spec-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}

.spec-card.ac-card {
  border-top: 3px solid #0284C7;
}
.spec-card.ac-card:hover {
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.16);
}

.spec-card.fan-card {
  border-top: 3px solid #7C3AED;
}
.spec-card.fan-card:hover {
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.16);
}

.spec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
  flex-wrap: wrap;
}

.spec-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.spec-header svg {
  width: 22px;
  height: 22px;
}

.ac-card .spec-header svg {
  color: #0284C7;
}
.fan-card .spec-header svg {
  color: #7C3AED;
}

.spec-title-group h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.hero-capacity {
  margin-bottom: 18px;
}

.hero-val-unit {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hero-number {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
}

.ac-card .hero-number {
  color: #0284C7;
  text-shadow: none;
}

.fan-card .hero-number {
  color: #7C3AED;
  text-shadow: none;
}

.hero-unit {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sub-capacity-row {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.sub-capacity-item strong {
  color: var(--text-muted);
}

/* Detail Spec Box */
.hardware-box {
  background: #F8FAFD;
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-subtle);
}

.hw-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #EDF3F9;
  font-size: 0.85rem;
}

.hw-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hw-label {
  color: var(--text-dim);
  font-weight: 500;
}

.hw-value {
  color: var(--text-main);
  font-weight: 700;
  text-align: right;
}

.hw-value.highlight {
  color: #0284C7;
}

.fan-card .hw-value.highlight {
  color: #7C3AED;
}

/* ==========================================================================
   Simulation & Visualizer Section
   ========================================================================== */

.sim-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.sim-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
}

.sim-title svg {
  width: 20px;
  height: 20px;
  color: var(--ac-cyan);
}

.sim-tabs {
  display: flex;
  background: #EEF4FA;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.sim-tab {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sim-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

.sim-tab.active {
  background: #FFFFFF;
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.sim-tab[data-mode="ac"].active {
  background: #E0F2FE;
  color: #0284C7;
}

.sim-tab[data-mode="fan"].active {
  background: #F3E8FF;
  color: #7C3AED;
}

.sim-tab[data-mode="none"].active {
  background: #FEE2E2;
  color: #DC2626;
}

/* View Type Group (Ambient vs Time) */
.view-type-group {
  display: flex;
  background: #EEF4FA;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.view-type-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-type-btn:hover {
  color: var(--text-main);
}

.view-type-btn.active {
  background: #FFFFFF;
  color: #0284C7;
  border-color: #BAE6FD;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.12);
}

/* Canvas & Visualizer Container */
.visualizer-wrapper {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  margin-bottom: 18px;
  align-items: stretch;
}

@media (max-width: 1000px) {
  .visualizer-wrapper {
    grid-template-columns: 1fr;
  }
}

.canvas-box {
  position: relative;
  height: 280px;
  background: #F0F6FC;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.canvas-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-box {
  position: relative;
  height: 280px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 14px;
}

.chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Scrubber Bar */
.scrubber-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #F8FAFD;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.scrubber-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
}

.scrubber-slider {
  flex: 1;
  min-width: 0;
}

.scrubber-time-badge {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ac-cyan);
  min-width: 65px;
  text-align: right;
}

/* Real-time Transient Summary Bar */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 768px) {
  .metrics-strip {
    grid-template-columns: 1fr 1fr;
  }
}

.metric-strip-card {
  background: #F8FAFD;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
}

.metric-strip-lbl {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.metric-strip-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.metric-strip-val.ac-color {
  color: #0284C7;
}
.metric-strip-val.fan-color {
  color: #7C3AED;
}
.metric-strip-val.danger-color {
  color: #DC2626;
}

/* ==========================================================================
   Engineering Comparison Table
   ========================================================================== */

.comparison-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.table-responsive {
  overflow-x: auto;
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.comp-table th {
  padding: 12px 16px;
  background: #F1F6FB;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
}

.comp-table th.col-ac {
  color: #0284C7;
}

.comp-table th.col-fan {
  color: #7C3AED;
}

.comp-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #EDF3F9;
  color: var(--text-main);
  vertical-align: top;
}

.comp-table tr:hover td {
  background: #F8FBFE;
}

.tag-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.tag-badge.best {
  background: #D1FAE5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.tag-badge.warn {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}

/* ==========================================================================
   Modal Dialog
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  max-width: 780px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal-window {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: #F1F6FB;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.modal-body h3 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin: 18px 0 8px;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.formula-block {
  background: #F1F6FB;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid #0284C7;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-main);
  margin: 8px 0 14px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid #38BDF8;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   PDF Report & Export Button Styles
   ========================================================================== */
.btn-header.btn-pdf-primary {
  color: #FFFFFF;
  background: linear-gradient(135deg, #EF4444 0%, #EA580C 100%);
  border: none;
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.28);
  font-weight: 700;
}

.btn-header.btn-pdf-primary:hover {
  background: linear-gradient(135deg, #DC2626 0%, #C2410C 100%);
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.4);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.pdf-badge {
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  margin-right: 2px;
}

/* Results Action Bar with Quick PDF Button */
.results-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 12px;
  padding: 0 2px;
  flex-wrap: wrap;
  gap: 10px;
}

.results-action-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pdf-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 9999px;
  color: #DC2626;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.1);
}

.btn-pdf-pill:hover {
  background: #FEE2E2;
  border-color: #F87171;
  color: #B91C1C;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
  transform: translateY(-1px);
}

/* Dedicated PDF Preview Modal */
.modal-pdf-window {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 1060px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pdf-preview-frame-container {
  flex: 1;
  overflow-y: auto;
  background: #EBF2F8;
  padding: 24px 16px;
  display: flex;
  justify-content: center;
}

.pdf-preview-paper {
  background: #FFFFFF;
  width: 100%;
  max-width: 860px;
  min-height: 700px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  border-radius: 4px;
  border: 1px solid #DCE8F4;
  color: #0F172A;
  padding: 24px 30px;
}

/* ==========================================================================
   Tip Modal (#modal-tip) Styles
   ========================================================================== */
.modal-tip-window {
  max-width: 580px;
  width: 95%;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
}

.tip-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: #FFFFFF;
}

.modal-tip-body,
#tip-modal-body,
.tip-modal-body {
  padding: 24px 28px !important;
  max-height: 65vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.tip-pane {
  display: none;
}

.tip-pane.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.tip-pane-head {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 10px 0;
  letter-spacing: -0.01em;
}

.tip-pane-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 14px 0;
  line-height: 1.45;
}

.tip-expl-box {
  background: #F8FAFD;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.80rem;
  line-height: 1.6;
  color: var(--text-main);
}

.tip-expl-box p {
  margin: 0 0 8px 0;
}
.tip-expl-box p:last-child {
  margin-bottom: 0;
}

.tip-modal-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  background: #FFFFFF;
}

.btn-tip-done,
.btn-tip-done-action {
  padding: 9px 22px;
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: var(--ac-blue);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tip-done:hover,
.btn-tip-done-action:hover {
  background: var(--ac-cyan);
}

/* ==========================================================================
   Results Page Screen Transition Navigation Styles (Top & Bottom Return Bars)
   ========================================================================== */
.results-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
}

.results-nav-top {
  position: sticky;
  top: 8px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.10);
  transition: all 0.2s ease;
}

.results-nav-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-top: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.btn-return-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  font-family: inherit;
}

.btn-return-home:hover {
  background: linear-gradient(135deg, #0369A1 0%, #075985 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(2, 132, 199, 0.35);
}

.btn-return-home:active {
  transform: translateY(0);
}

.btn-return-home-lg {
  width: 100%;
  max-width: 500px;
  justify-content: center;
  padding: 14px 24px;
  font-size: 1.02rem;
  font-weight: 800;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.32);
}

.btn-return-home-lg:hover {
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.42);
}

.results-nav-meta {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.results-nav-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.22);
  border-radius: 20px;
  font-size: 0.80rem;
  font-weight: 600;
  color: #0369A1;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
}

.results-nav-actions, .results-bottom-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-res-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.btn-res-save {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn-res-save:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
  transform: translateY(-1px);
}

.btn-res-pdf {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-res-pdf:hover {
  background: #FCA5A5;
  color: #991B1B;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .results-nav-top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    top: 4px;
  }
  .btn-return-home {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
    font-size: 0.90rem;
  }
  .results-nav-meta {
    justify-content: flex-start;
  }
  .results-nav-badge {
    width: 100%;
    justify-content: center;
    font-size: 0.76rem;
    padding: 5px 10px;
  }
  .results-nav-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .results-nav-actions .btn-res-action {
    justify-content: center;
    padding: 8px;
  }
  .results-bottom-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 500px;
  }
  .results-bottom-actions .btn-res-action {
    justify-content: center;
    padding: 10px;
  }
}

/* ==========================================================================
   💾 Save Condition Modal (#modal-save-condition) Styles
   ========================================================================== */
.modal-save-window {
  max-width: 520px;
  width: 95%;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
}

.modal-save-body {
  padding: 18px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.save-preview-card {
  background: #F8FAFD;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
}

.spc-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ac-blue);
  margin-bottom: 10px;
}

.spc-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.spc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
}

.spc-lbl {
  color: var(--text-dim);
  flex-shrink: 0;
  font-weight: 600;
}

.spc-val {
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
  word-break: keep-all;
}

.spc-badge-res {
  display: inline-block;
  background: #E0F2FE;
  color: #0369A1;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.76rem;
}

.save-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.save-form-lbl {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.save-form-lbl .lbl-req {
  color: #DC2626;
}

.save-input-text {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.86rem;
  color: var(--text-main);
  background: #FFFFFF;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.save-input-text:focus {
  outline: none;
  border-color: var(--ac-cyan);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.save-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle);
  background: #F8FAFD;
}

.btn-save-cancel {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-save-cancel:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

.btn-save-confirm {
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
  transition: all 0.2s ease;
}
.btn-save-confirm:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ==========================================================================
   🔍 Search Conditions Modal (#modal-search-conditions) Styles
   ========================================================================== */
.modal-search-window {
  max-width: 680px;
  width: 95%;
  max-height: 88vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
}

.modal-search-header-panel {
  padding: 14px 20px;
  background: #F8FAFD;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 8px 14px;
  transition: all 0.2s ease;
}

.search-input-wrap:focus-within {
  border-color: var(--ac-cyan);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.search-input-wrap svg {
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.88rem;
  color: var(--text-main);
  background: transparent;
}

.btn-clear-search {
  background: #E2E8F0;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #475569;
  cursor: pointer;
}

.search-filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.search-pill {
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.search-pill.active {
  background: #E0F2FE;
  border-color: #7DD3FC;
  color: #0284C7;
}

.modal-search-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: 52vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-card {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.search-card:hover {
  border-color: #BAE6FD;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
  transform: translateY(-1px);
}

.search-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sc-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sc-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.sc-tag.user-saved {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.sc-tag.preset {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

.search-card-params {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
  background: #F8FAFD;
  padding: 7px 10px;
  border-radius: 6px;
}

.search-card-params span strong {
  color: var(--text-main);
}

.search-card-memo {
  font-size: 0.72rem;
  color: #64748B;
  font-style: italic;
  padding: 0 2px;
}

.search-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.search-card-res-preview {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0284C7;
}

.sc-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-scenario-load {
  padding: 6px 14px;
  border-radius: 6px;
  background: #0284C7;
  color: #FFFFFF;
  border: none;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-scenario-load:hover {
  background: #0369A1;
}

.btn-scenario-del {
  padding: 6px 8px;
  border-radius: 6px;
  background: transparent;
  color: #94A3B8;
  border: 1px solid #E2E8F0;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-scenario-del:hover {
  background: #FEE2E2;
  color: #DC2626;
  border-color: #FECACA;
}

.search-no-results {
  text-align: center;
  padding: 30px 20px;
  color: #94A3B8;
  font-size: 0.84rem;
}

.search-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  background: #F8FAFD;
}

.search-footer-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
}



/* ==========================================================================
   Responsive Design System: Mobile & Tablet Dynamic Optimization
   ========================================================================== */

/* 1. Large Tablet & Small Laptop (1025px ~ 1280px) */
@media (max-width: 1280px) {
  .app-container {
    max-width: 100%;
    padding: 20px 24px 44px;
  }
  .main-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .inputs-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .specs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* 2. Standard Tablet Landscape & Portrait (769px ~ 1024px, e.g. iPad, Galaxy Tab) */
@media (max-width: 1024px) {
  .app-container {
    padding: 16px 20px 36px;
  }
  .app-header {
    margin-bottom: 18px;
    padding-bottom: 16px;
    gap: 12px;
  }
  .brand-text h1 {
    font-size: 1.3rem;
  }
  .inputs-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .visualizer-wrapper {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .canvas-box {
    height: 260px;
  }
  .chart-box {
    height: 280px;
  }
  .metrics-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }
  .scrubber-panel {
    padding: 10px 14px;
    gap: 12px;
  }
}

/* 3. Small Tablet & Phablet Portrait (641px ~ 768px, e.g. iPad mini portrait, Fold inner) */
@media (max-width: 768px) {
  .app-container {
    padding: 14px 14px 32px;
  }
  .brand-text h1 {
    font-size: 1.2rem;
  }
  .inputs-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "space temps"
      "equip advanced";
    gap: 12px;
    align-items: start;
  }
  #card-space {
    grid-area: space;
  }
  #card-equipment {
    grid-area: equip;
  }
  #card-temps {
    grid-area: temps;
  }
  #card-advanced {
    grid-area: advanced;
  }
  .specs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .metrics-strip {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .sim-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .sim-header > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .view-type-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .view-type-btn {
    text-align: center;
    justify-content: center;
  }
  .sim-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
  .sim-tab {
    text-align: center;
    justify-content: center;
    padding: 6px 3px;
    font-size: 0.76rem;
  }
}

/* 4. Smartphone Screens (<= 640px, e.g. iPhone 14/15/16, Galaxy S21/S24, 390~430px) */
@media (max-width: 640px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
  }
  .app-container {
    padding: 12px 10px 32px;
    width: 100%;
    max-width: 100%;
  }
  .main-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    max-width: 100%;
  }
  .inputs-panel {
    display: flex;
    flex-direction: column;
    grid-template-areas: none;
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }
  #card-space, #card-equipment, #card-temps, #card-advanced {
    grid-area: auto;
    width: 100%;
    max-width: 100%;
  }
  .results-panel {
    width: 100%;
    max-width: 100%;
  }

  /* Header */
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  .brand-wrapper {
    gap: 10px;
    width: 100%;
    align-items: center;
  }
  .brand-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
  }
  .brand-icon-box svg {
    width: 22px;
    height: 22px;
  }
  .brand-text {
    flex: 1;
    min-width: 0;
  }
  .brand-text h1 {
    font-size: clamp(1.02rem, 4.2vw, 1.22rem);
    line-height: 1.25;
    word-break: keep-all;
    overflow-wrap: break-word;
  }
  .brand-text p {
    font-size: 0.73rem;
    line-height: 1.35;
    margin-top: 2px;
  }
  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 8px;
  }
  .btn-header {
    width: 100%;
    justify-content: center;
    padding: 8px 8px;
    font-size: 0.76rem;
    border-radius: 8px;
  }
  .btn-header svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
  .pdf-badge {
    font-size: 0.62rem;
    padding: 1px 4px;
  }

  /* Presets Dropdown on Mobile */
  .presets-toolbar {
    padding: 10px 12px;
    margin-bottom: 12px;
    gap: 8px;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
    overflow-x: visible;
  }
  .presets-label {
    font-size: 0.78rem;
    gap: 5px;
  }
  .preset-dropdown-container {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }
  .preset-select-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .preset-select,
  .preset-custom-btn {
    font-size: 0.80rem !important;
    padding: 7px 32px 7px 10px;
    min-height: 34px;
  }
  .preset-custom-text {
    font-size: 0.80rem !important;
  }
  .cdd-item {
    font-size: 0.80rem !important;
    padding: 7px 10px;
  }
  .preset-status-tag {
    align-self: flex-start;
    font-size: 0.72rem;
    padding: 3px 8px;
  }

  /* Cards */
  .card, .spec-card, .sim-section, .comparison-card {
    padding: 14px 12px;
    margin-bottom: 12px;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .card-title {
    font-size: 0.92rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
  }
  .card-title .title-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
  }
  .card-title .title-left span {
    font-size: 0.88rem;
    word-break: keep-all;
  }
  .card-title svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  .badge-tag {
    font-size: 0.68rem;
    padding: 2px 6px;
    flex-shrink: 0;
    border-radius: 5px;
  }

  /* Labels & Input Subtexts */
  .input-label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 6px;
  }
  .input-label {
    font-size: 0.82rem;
  }
  .input-subtext {
    font-size: 0.69rem;
    color: var(--text-dim);
  }

  /* Dimension 3-Input Grid (W, D, H) */
  .dimension-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    max-width: 100%;
  }
  .dimension-grid > .input-with-unit {
    min-width: 0;
    width: 100%;
  }
  .dimension-grid .input-with-unit input {
    padding: 8px 20px 8px 6px;
    font-size: 0.85rem;
    border-radius: 6px;
    text-align: left;
    width: 100%;
    min-width: 0;
  }
  .dimension-grid .unit-suffix {
    right: 5px;
    font-size: 0.72rem;
  }

  /* Mini stat bar */
  .mini-stat-bar {
    padding: 8px 6px;
    gap: 4px;
    border-radius: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
  }
  .mini-stat-val {
    font-size: 0.82rem;
  }
  .mini-stat-lbl {
    font-size: 0.63rem;
    line-height: 1.2;
  }

  /* Sliders & Inputs */
  .slider-container {
    gap: 8px;
    width: 100%;
    max-width: 100%;
  }
  .slider-container input[type="range"] {
    min-width: 0;
    flex: 1;
  }
  .slider-val-unit.power-unit {
    width: 86px !important;
    flex-shrink: 0;
  }
  .slider-val-unit.temp-unit {
    width: 76px !important;
    flex-shrink: 0;
  }
  .slider-val-unit input {
    padding: 6px 20px 6px 6px !important;
    font-size: 0.84rem !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .slider-val-unit .unit-suffix {
    right: 5px !important;
    font-size: 0.72rem !important;
  }
  .slider-val-box {
    min-width: 48px;
    font-size: 0.8rem;
    padding: 4px 6px;
    flex-shrink: 0;
  }

  /* Fast Click Chips */
  .equip-chips, .ambient-chips {
    gap: 5px;
    margin-top: 6px;
  }
  .equip-chip, .ambient-chip {
    font-size: 0.7rem;
    padding: 4px 7px;
    border-radius: 5px;
    line-height: 1.25;
  }

  /* Feasibility Banner */
  .feasibility-banner {
    padding: 12px 10px;
    gap: 10px;
    margin-bottom: 12px;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
  }
  .feasibility-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }
  .feasibility-icon svg {
    width: 18px;
    height: 18px;
  }
  .feasibility-content h3 {
    font-size: 0.86rem;
  }
  .feasibility-content p {
    font-size: 0.73rem;
    line-height: 1.35;
  }

  /* Results Action Bar */
  .results-action-bar {
    margin: 12px 0 10px;
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  .results-action-title {
    font-size: 0.86rem;
  }
  .btn-pdf-pill {
    padding: 7px 12px;
    font-size: 0.76rem;
    width: 100%;
    justify-content: center;
  }

  /* Dual Sizing Output Cards (AC vs Fan) */
  .specs-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }
  .spec-title-group h2 {
    font-size: 0.98rem;
  }
  .hero-number {
    font-size: 2.05rem;
  }
  .hero-unit {
    font-size: 0.88rem;
  }
  .sub-capacity-row {
    font-size: 0.72rem;
    gap: 6px;
    flex-wrap: wrap;
  }
  .hardware-box {
    padding: 10px 8px;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
  }
  .hw-row {
    font-size: 0.76rem;
    padding: 4px 0;
  }

  /* Dynamic Simulation Section */
  .sim-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }
  .sim-title {
    font-size: 0.9rem;
    line-height: 1.3;
  }
  .sim-title svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }
  .sim-title span {
    min-width: 0;
    word-break: keep-all;
  }
  .sim-header > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .view-type-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
  }
  .view-type-btn {
    font-size: 0.71rem;
    padding: 5px 2px;
    text-align: center;
    justify-content: center;
  }
  .sim-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 3px;
  }
  .sim-tab {
    font-size: 0.68rem;
    padding: 5px 2px;
    text-align: center;
    justify-content: center;
  }
  .visualizer-wrapper {
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }
  .canvas-box {
    height: 195px;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
  }
  .chart-box {
    height: 230px;
    padding: 8px 4px;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
  }
  .scrubber-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    gap: 6px;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
  }
  .scrubber-label {
    font-size: 0.72rem;
  }
  .scrubber-time-badge {
    font-size: 0.8rem;
    min-width: 50px;
    text-align: right;
  }
  .scrubber-slider {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .metrics-strip {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
  }
  .metric-strip-card {
    padding: 8px 6px;
    border-radius: 6px;
  }
  .metric-strip-lbl {
    font-size: 0.66rem;
    line-height: 1.25;
  }
  .metric-strip-val {
    font-size: 0.9rem;
  }

  /* Comparison Table */
  .comparison-card {
    padding: 14px 10px;
  }
  .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .comp-table {
    min-width: 320px;
    font-size: 0.74rem;
  }
  .comp-table th, .comp-table td {
    padding: 8px 6px;
  }

  /* Modals */
  .modal-window {
    width: 95%;
    max-height: 90vh;
    padding: 0;
  }
  .modal-tip-window,
  .modal-report-window,
  .modal-save-window,
  .modal-search-window {
    width: 96%;
    max-height: 92vh;
    padding: 0 !important;
  }
  .modal-tip-body,
  #tip-modal-body,
  .tip-modal-body {
    padding: 18px 20px !important;
  }
  .modal-save-body {
    padding: 14px 16px;
    gap: 10px;
  }
  .modal-search-body {
    padding: 12px 14px;
    max-height: 50vh;
  }
  .modal-report-content {
    padding: 12px 14px 14px;
    gap: 10px;
  }
  .modal-spec-grid {
    gap: 8px;
  }
  .modal-spec-card {
    padding: 10px;
  }
  .msc-number {
    font-size: 1.4rem;
  }
  .msc-unit {
    font-size: 0.75rem;
  }
  .modal-report-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .btn-rep-action {
    padding: 9px 6px;
    font-size: 0.74rem;
  }
  .modal-pdf-window {
    width: 98%;
    max-height: 94vh;
  }
  .pdf-preview-paper {
    padding: 16px 10px;
    font-size: 0.78rem;
  }

  /* Ultra-Compact Smartphone Zero-Scroll Cards */
  .card-compact {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
  }
  .card-compact .card-title {
    font-size: 0.84rem;
    margin-bottom: 6px;
  }
  .dimension-row-compact .input-with-unit input {
    height: 32px;
    padding: 5px 18px 5px 4px;
    font-size: 0.82rem;
  }
  .slider-row-compact .power-unit input {
    height: 32px;
    font-size: 0.82rem;
    padding: 5px 20px 5px 6px;
  }
  .temp-row-compact .temp-unit input {
    height: 30px;
    font-size: 0.80rem;
    padding: 5px 18px 5px 4px;
  }
  .calc-action-bar-wrap {
    margin: 8px 0 10px;
  }
  .btn-open-report {
    padding: 10px 14px;
  }
  .bor-main-text {
    font-size: 0.88rem;
  }
  .bor-sub-text {
    font-size: 0.70rem;
  }
}

/* 5. Extra Compact Mobile (< 380px, e.g. 360px Galaxy A/S series, Fold cover) */
@media (max-width: 380px) {
  .app-container {
    padding: 8px 6px 24px;
  }
  .brand-text h1 {
    font-size: 1.0rem;
  }
  .header-actions {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .dimension-grid {
    gap: 4px;
  }
  .dimension-grid .input-with-unit input {
    padding: 7px 18px 7px 5px;
    font-size: 0.8rem;
  }
  .dimension-grid .unit-suffix {
    right: 4px;
    font-size: 0.68rem;
  }
  .slider-val-unit.power-unit {
    width: 78px !important;
  }
  .slider-val-unit.temp-unit {
    width: 70px !important;
  }
  .slider-val-unit input {
    padding: 6px 18px 6px 5px !important;
    font-size: 0.78rem !important;
  }
  .hero-number {
    font-size: 1.8rem;
  }
  .hero-unit {
    font-size: 0.82rem;
  }
  .sim-tab {
    font-size: 0.64rem;
    padding: 5px 1px;
  }
  .view-type-btn {
    font-size: 0.66rem;
    padding: 5px 2px;
  }
}

/* Print Styles */
@media print {
  body {
    background: #FFFFFF !important;
    color: #111827 !important;
  }
  .app-container {
    padding: 0 !important;
  }
  .presets-toolbar,
  .header-actions,
  .sim-tabs,
  .scrubber-panel,
  .modal-backdrop,
  .results-action-bar {
    display: none !important;
  }
  .card, .spec-card, .sim-section, .comparison-card {
    background: #FFFFFF !important;
    border: 1px solid #E5E7EB !important;
    box-shadow: none !important;
    color: #111827 !important;
  }
  .hero-number {
    text-shadow: none !important;
  }
}


