/* ─── Variables & Reset ─────────────────────────────────────────────────────── */
:root {
  --primary: #1a5c8f;
  --primary-dark: #0f3a5c;
  --accent: #f59e0b;
  --accent-dark: #d48a0c;
  --success: #16a34a;
  --danger: #dc2626;
  --purple: #7c3aed;
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --text: #1a202c;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 7px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─────────────────────────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  padding: 16px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.header-inner { max-width: 1400px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 2rem; }
.logo-text { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; }
.tagline { color: rgba(255,255,255,0.7); font-size: 0.85rem; margin-top: 2px; }

/* ─── Tab Navigation ─────────────────────────────────────────────────────────── */
.tab-nav {
  background: var(--card-bg);
  border-bottom: 2px solid var(--border);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 14px 22px;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
  background: rgba(26,92,143,0.04);
}

/* ─── Main Content ───────────────────────────────────────────────────────────── */
main { flex: 1; max-width: 1400px; width: 100%; margin: 0 auto; padding: 20px 16px; }

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

/* ─── System Diagram Tab ─────────────────────────────────────────────────────── */
.diagram-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

.diagram-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.diagram-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.legend-item {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  color: white;
}
.legend-item.dc-pos { background: #ef4444; }
.legend-item.dc-neg { background: #374151; }
.legend-item.ac-wire { background: #2563eb; }
.legend-item.optional-wire { background: #9ca3af; color: white; border: 1px dashed #6b7280; }

.svg-wrapper {
  width: 100%;
  overflow-x: auto;
}
#system-diagram {
  width: 100%;
  min-width: 640px;
  height: auto;
  display: block;
}

.diagram-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 10px;
  font-style: italic;
}

/* Detail Panel */
.detail-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 78vh;
  overflow-y: auto;
  position: sticky;
  top: 60px;
}

.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}
.detail-icon { font-size: 2.5rem; }
.detail-placeholder p { font-size: 0.9rem; line-height: 1.5; }

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.detail-icon-lg { font-size: 2.2rem; flex-shrink: 0; }
.detail-header h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 2px; }
.detail-short { font-size: 0.85rem; color: var(--text-muted); }

.detail-body { padding: 16px 20px; }
.detail-body h3 { font-size: 0.95rem; font-weight: 700; margin: 18px 0 8px; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-desc { font-size: 0.88rem; color: #374151; line-height: 1.65; }

.type-cards { display: flex; flex-direction: column; gap: 12px; }
.type-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.82rem;
}
.type-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.type-header strong { font-size: 0.9rem; }
.type-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-weight: 600;
}
.type-stat { margin: 2px 0; font-size: 0.8rem; color: var(--text-muted); }
.type-stat strong { color: var(--text); }
.type-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.type-cols ul { padding-left: 16px; color: #374151; }
.type-cols li { margin-bottom: 2px; }
.type-label { font-size: 0.73rem; font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.type-label.pros { color: var(--success); }
.type-label.cons { color: var(--danger); }
.type-bestfor { margin-top: 6px; font-style: italic; color: #1e40af; }
.type-brands { margin-top: 4px; color: var(--text-muted); font-size: 0.78rem; }

.sizing-steps { padding-left: 20px; font-size: 0.85rem; color: #374151; }
.sizing-steps li { margin-bottom: 5px; }

.wiring-block { background: #f8fafc; border-radius: var(--radius-sm); padding: 12px; }
.wire-note { font-size: 0.83rem; color: #374151; margin-bottom: 5px; }

.tips-list { list-style: none; padding: 0; }
.tips-list li { font-size: 0.83rem; color: #374151; padding: 4px 0; }
.warnings-list { list-style: none; padding: 0; background: #fff5f5; border-radius: var(--radius-sm); padding: 10px 12px; }
.warnings-list li { font-size: 0.83rem; color: #991b1b; padding: 4px 0; border-bottom: 1px solid #fee2e2; }
.warnings-list li:last-child { border-bottom: none; }

/* ─── Components Tab ─────────────────────────────────────────────────────────── */
.components-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.comp-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
}
.comp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.comp-card-icon { font-size: 2.5rem; margin-bottom: 10px; }
.comp-card h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 6px; }
.comp-card p { font-size: 0.85rem; color: var(--text-muted); flex: 1; }
.comp-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.type-count { font-size: 0.78rem; color: var(--text-muted); background: var(--bg); padding: 2px 8px; border-radius: 20px; }
.comp-card-cta { font-size: 0.82rem; font-weight: 700; color: var(--primary); }

/* ─── Wire Sizing Tab ────────────────────────────────────────────────────────── */
.wiring-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

.wire-calc, .wire-reference {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.wire-calc h2, .wire-reference h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.calc-intro { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 18px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; }
.form-group input, .form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: white;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
}
.inline-inputs { display: flex; gap: 8px; }
.inline-inputs input { flex: 1; }
.inline-inputs select { flex: 1; }

.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-dark); }

.wire-result { margin-top: 16px; }
.wire-result-box {
  background: #f0fdf4;
  border: 2px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.result-headline { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.result-awg { font-size: 2rem; font-weight: 900; color: var(--success); }
.result-why { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.rstat { background: white; border-radius: 6px; padding: 8px 10px; }
.rstat span { display: block; font-size: 0.73rem; color: var(--text-muted); margin-bottom: 2px; }
.rstat strong { font-size: 0.9rem; }
.result-note { font-size: 0.83rem; color: #374151; padding: 8px 0; }
.result-note.secondary { color: var(--text-muted); font-style: italic; }
.calc-error { background: #fff5f5; border: 1px solid #fca5a5; border-radius: var(--radius-sm); padding: 12px; color: var(--danger); font-size: 0.85rem; }

.wire-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; margin-bottom: 20px; }
.wire-table th { background: var(--primary); color: white; padding: 10px 12px; text-align: left; font-size: 0.8rem; }
.wire-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.wire-table tr:hover td { background: #f8fafc; }

.wire-tips { background: #fffbeb; border-radius: var(--radius-sm); padding: 16px; border: 1px solid #fde68a; }
.wire-tips h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; color: #92400e; }
.wire-tips ul { list-style: none; padding: 0; }
.wire-tips ul li { font-size: 0.83rem; color: #78350f; padding: 4px 0; border-bottom: 1px solid #fde68a; }
.wire-tips ul li:last-child { border-bottom: none; }

/* ─── Load Calculator Tab ────────────────────────────────────────────────────── */
.load-calc-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.load-inputs {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.load-inputs h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.load-inputs > p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }

.system-voltage-selector { margin-bottom: 18px; }
.system-voltage-selector label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.btn-group { display: flex; gap: 8px; }
.volt-btn, .batt-btn {
  padding: 7px 18px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.volt-btn.active, .batt-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.appliance-category h3 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }

.appliance-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}
.app-toggle { display: flex; align-items: center; gap: 7px; cursor: pointer; flex: 1; min-width: 180px; }
.app-toggle input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.app-name { font-size: 0.85rem; }
.ac-tag { font-size: 0.7rem; background: #dbeafe; color: #1d4ed8; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.app-inputs { display: flex; gap: 8px; }
.app-field { display: flex; flex-direction: column; gap: 2px; }
.app-field span { font-size: 0.7rem; color: var(--text-muted); }
.app-field input { width: 72px; padding: 5px 7px; border: 1.5px solid var(--border); border-radius: 5px; font-size: 0.83rem; }
.app-field-qty input { width: 50px; border-color: var(--primary); color: var(--primary); font-weight: 700; }
.app-field-qty span { color: var(--primary); font-weight: 600; }
.app-note { width: 100%; font-size: 0.73rem; color: var(--text-muted); font-style: italic; padding-left: 24px; }

.custom-appliance { margin-top: 20px; border-top: 2px dashed var(--border); padding-top: 16px; }
.custom-appliance h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; }
.custom-form { display: flex; flex-wrap: wrap; gap: 8px; }
.custom-form input { flex: 1; min-width: 90px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 0.85rem; }
.custom-form input#custom-qty { flex: 0 0 60px; min-width: 60px; border-color: var(--primary); color: var(--primary); font-weight: 700; }

.btn-secondary {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--accent-dark); }
.remove-btn { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1.1rem; padding: 0 4px; }

/* Load Results */
.load-results {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  position: sticky;
  top: 60px;
}
.load-results h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 14px; }

.results-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.result-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.result-card.highlight { background: #eff6ff; border: 1px solid #bfdbfe; grid-column: span 2; }
.result-label { display: block; font-size: 0.73rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 3px; }
.result-value { display: block; font-size: 1.1rem; font-weight: 900; color: var(--primary); }
.result-note { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.battery-type-selector { margin-top: 16px; }
.battery-type-selector h3 { font-size: 0.85rem; font-weight: 700; margin-bottom: 7px; }

.sun-hours-input { margin-top: 16px; }
.sun-hours-input label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.sun-hours-input input[type="range"] { width: 100%; accent-color: var(--accent); margin-bottom: 4px; }
.sun-hours-guide { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-muted); }

.load-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-top: 14px; }
.load-table th { background: var(--primary); color: white; padding: 8px 10px; text-align: left; font-size: 0.76rem; }
.load-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.load-table .total-row td { font-weight: 700; background: #f0fdf4; }
.load-table .adjusted-row td { color: var(--text-muted); font-style: italic; background: #f8f9fa; }

.pct-bar-wrap { display: flex; align-items: center; gap: 6px; }
.pct-bar { height: 8px; background: var(--primary); border-radius: 4px; min-width: 2px; max-width: 80px; }
.pct-bar-wrap span { font-size: 0.75rem; color: var(--text-muted); min-width: 28px; }
.no-loads { color: var(--text-muted); text-align: center; padding: 20px; font-size: 0.85rem; }

/* ─── FAQ Tab ────────────────────────────────────────────────────────────────── */
.faq-container { max-width: 860px; margin: 0 auto; }
.faq-section { margin-bottom: 28px; }
.faq-section h2 { font-size: 1.15rem; font-weight: 800; color: var(--primary); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); }

.faq-item { background: var(--card-bg); border-radius: var(--radius-sm); box-shadow: var(--shadow); margin-bottom: 6px; overflow: hidden; }
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  transition: background 0.15s;
}
.faq-q:hover { background: var(--bg); }
.faq-q.open { color: var(--primary); background: #eff6ff; }
.faq-chevron { font-size: 1rem; flex-shrink: 0; color: var(--text-muted); }
.faq-a-inner { padding: 0 18px 16px; font-size: 0.87rem; color: #374151; line-height: 1.7; }
.faq-a-inner strong { color: var(--text); }
.faq-a-inner em { color: var(--text-muted); }

/* ─── Installation Checklist Tab ────────────────────────────────────────────── */
.checklist-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 24px;
  margin-bottom: 20px;
}
.checklist-progress-wrap { flex: 1; }
.checklist-progress-labels { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.progress-title { font-size: 0.9rem; font-weight: 700; }
.progress-count { font-size: 0.82rem; color: var(--text-muted); }
.checklist-progress-bar { height: 12px; background: var(--border); border-radius: 6px; overflow: hidden; }
.checklist-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: 6px; transition: width 0.4s ease; }
.progress-pct { font-size: 1.4rem; font-weight: 900; color: var(--primary); margin-top: 4px; }

.reset-btn {
  padding: 8px 16px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.reset-btn:hover { border-color: var(--danger); color: var(--danger); }

.phase-list { display: flex; flex-direction: column; gap: 10px; max-width: 900px; margin: 0 auto; }

.phase-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-left: 4px solid var(--border);
  transition: border-color 0.2s;
}
.phase-card.phase-inprogress { border-left-color: var(--accent); }
.phase-card.phase-complete { border-left-color: var(--success); }

.phase-header {
  width: 100%;
  background: none;
  border: none;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  gap: 12px;
  text-align: left;
  transition: background 0.15s;
}
.phase-header:hover { background: var(--bg); }
.phase-header-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.phase-header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.phase-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.phase-complete .phase-num::after { content: ''; }

.phase-icon { font-size: 1.3rem; flex-shrink: 0; }
.phase-title-block { min-width: 0; }
.phase-title { display: block; font-size: 0.95rem; font-weight: 700; }
.phase-sub { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.phase-complete .phase-sub { color: var(--success); font-weight: 600; }

.phase-mini-bar { width: 80px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.phase-mini-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.phase-chevron { font-size: 0.85rem; color: var(--text-muted); }

.phase-body { padding: 0 20px 20px; }
.gate-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.83rem;
  color: #92400e;
  margin-bottom: 12px;
}
.phase-intro { font-size: 0.85rem; color: var(--text-muted); font-style: italic; margin-bottom: 14px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); }

.checklist-items { display: flex; flex-direction: column; gap: 6px; }

.checklist-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: background 0.15s, border-color 0.15s;
}
.checklist-item.item-done { background: #f0fdf4; border-color: #bbf7d0; }
.checklist-item.item-safety { border-left: 3px solid var(--danger); background: #fff5f5; }
.checklist-item.item-safety.item-done { background: #f0fdf4; border-left-color: var(--success); }

.item-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.item-checkbox { display: none; }
.item-check-icon {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--success);
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
  background: white;
}
.item-done .item-check-icon { background: var(--success); border-color: var(--success); color: white; }
.item-text { font-size: 0.88rem; line-height: 1.5; flex: 1; }
.item-done .item-text { color: var(--text-muted); text-decoration: line-through; }

.item-warning { font-size: 0.8rem; color: #991b1b; background: #fff5f5; border-radius: 5px; padding: 6px 10px; margin-top: 6px; margin-left: 30px; }
.item-tip { font-size: 0.78rem; color: #374151; background: #f0f9ff; border-radius: 5px; padding: 6px 10px; margin-top: 5px; margin-left: 30px; }

/* ─── Seasonal Planner Tab ───────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 14px; }

/* Controls row */
.planner-controls.card { margin-bottom: 16px; }
.planner-control-row { display: flex; gap: 16px; flex-wrap: wrap; }
.planner-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 180px; }
.planner-field label { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); }
.planner-field select,
.planner-field input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: white;
  width: 100%;
}
.planner-field select:focus,
.planner-field input:focus { outline: none; border-color: var(--primary); }
.tilt-hint {
  margin-top: 12px;
  font-size: 0.83rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.tilt-hint strong { color: var(--text); }

/* Chart */
.chart-card h2 { margin-bottom: 8px; }
.chart-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chart-header h2 { margin: 0; }
.chart-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.cl-item {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  color: #1e293b;
}
.svg-chart-wrap { width: 100%; overflow-x: auto; }
#psh-chart { width: 100%; min-width: 500px; display: block; }

.chart-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.chart-stat {
  flex: 1;
  min-width: 120px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
}
.chart-stat span { display: block; font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 3px; }
.chart-stat strong { display: block; font-size: 1rem; font-weight: 800; }
.chart-stat.best strong { color: var(--success); }
.chart-stat.worst strong { color: var(--danger); }

/* Output table */
.table-intro { font-size: 0.83rem; color: var(--text-muted); margin-bottom: 14px; }
.output-table-wrap { overflow-x: auto; }
.output-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.output-table thead th { background: var(--primary); color: white; padding: 9px 12px; text-align: left; font-size: 0.78rem; white-space: nowrap; }
.output-table tbody td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.output-table tfoot td { padding: 9px 12px; font-weight: 700; background: #f0fdf4; border-top: 2px solid var(--border); }
.output-table tbody tr:hover td { background: #f8fafc; }
.surplus-cell { white-space: nowrap; }
.surplus-badge { display: inline-block; padding: 2px 7px; border-radius: 12px; font-weight: 700; font-size: 0.78rem; margin-right: 4px; background: #e2e8f0; }
.surplus-cell.surplus .surplus-badge { background: #bbf7d0; color: #166534; }
.surplus-cell.nearbreak .surplus-badge { background: #fef9c3; color: #854d0e; }
.surplus-cell.deficit .surplus-badge { background: #fecaca; color: #991b1b; }
.surplus-cell.surplus { color: #166534; }
.surplus-cell.nearbreak { color: #854d0e; }
.surplus-cell.deficit { color: #991b1b; }

/* Tilt advisor */
.tilt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tilt-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
  border: 1px solid var(--border);
}
.tilt-angle { font-size: 2.2rem; font-weight: 900; color: var(--primary); line-height: 1; }
.winter-tilt .tilt-angle { color: #1d4ed8; }
.summer-tilt .tilt-angle { color: #b45309; }
.fixed-tilt { color: var(--primary) !important; }
.gain-angle { color: var(--success) !important; }
.tilt-label { font-size: 0.82rem; font-weight: 700; margin: 6px 0 4px; }
.tilt-note { font-size: 0.75rem; color: var(--text-muted); line-height: 1.45; }

/* Season tabs */
.season-tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.season-tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: white;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.season-tab-btn:hover { border-color: var(--sd, var(--primary)); color: var(--sd, var(--primary)); }
.season-tab-btn.active { background: var(--sc, var(--bg)); border-color: var(--sd, var(--primary)); color: var(--sd, var(--primary)); }

.season-detail-card { padding: 18px; background: var(--bg); border-radius: var(--radius-sm); }
.season-detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.season-big-icon { font-size: 2.5rem; }
.season-detail-header h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 2px; }
.season-months { font-size: 0.8rem; color: var(--text-muted); }
.season-overview { font-size: 0.88rem; color: #374151; line-height: 1.6; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.season-detail-card h4 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 8px; }
.season-expect { padding-left: 18px; font-size: 0.85rem; color: #374151; }
.season-expect li { margin-bottom: 5px; }
.season-tips { display: flex; flex-direction: column; gap: 8px; }
.season-tip { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: #374151; background: white; border-radius: var(--radius-sm); padding: 9px 12px; }
.tip-icon { font-size: 1.1rem; flex-shrink: 0; }
.season-warnings { margin-top: 14px; }
.season-warn { font-size: 0.83rem; color: #991b1b; background: #fff5f5; border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 6px; }

/* Monthly maintenance */
.maintenance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.maint-month { background: var(--bg); border-radius: var(--radius-sm); padding: 14px; }
.maint-month-header { margin-bottom: 10px; }
.maint-month-name { font-size: 0.9rem; font-weight: 800; }
.maint-tasks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.maint-task { display: flex; gap: 8px; align-items: flex-start; font-size: 0.79rem; color: #374151; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.priority-high .priority-dot { background: #dc2626; }
.priority-medium .priority-dot { background: #f59e0b; }
.priority-low .priority-dot { background: #16a34a; }

/* ─── Troubleshooting Tab ────────────────────────────────────────────────────── */

/* Quick checks */
.quick-checks-card h2 { margin-bottom: 12px; }
.quick-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.qc {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.85rem;
  color: #374151;
  border-left: 3px solid var(--accent);
}
.qc strong { color: var(--text); }

/* Search & filter */
.ts-controls { display: flex; flex-direction: column; gap: 14px; }
.ts-search-input {
  width: 100%;
  padding: 11px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: border-color 0.15s;
}
.ts-search-input:focus { outline: none; border-color: var(--primary); }

.cat-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-btn {
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: white;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.cat-btn.cat-emergency { border-color: #fca5a5; color: var(--danger); }
.cat-btn.cat-emergency.active { background: var(--danger); border-color: var(--danger); color: white; }

/* Problem cards */
.problem-card { padding: 0; overflow: hidden; margin-bottom: 10px; }
.problem-emergency { border-left: 4px solid var(--danger) !important; }

.no-results { color: var(--text-muted); text-align: center; padding: 30px; font-size: 0.9rem; }

.problem-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.problem-header:hover { background: var(--bg); }

.prob-header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.prob-symptom { font-size: 0.92rem; font-weight: 600; }
.prob-chevron { color: var(--text-muted); flex-shrink: 0; }

/* Severity badges */
.sev-badge { font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 12px; white-space: nowrap; flex-shrink: 0; }
.sev-low      { background: #dcfce7; color: #166534; }
.sev-med      { background: #fef9c3; color: #854d0e; }
.sev-high     { background: #fee2e2; color: #991b1b; }
.sev-emergency{ background: var(--danger); color: white; }

/* Problem body */
.problem-body { padding: 0 20px 20px; border-top: 1px solid var(--border); }
.emergency-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #991b1b;
  font-weight: 700;
  font-size: 0.88rem;
  margin: 14px 0 10px;
}
.prob-desc { font-size: 0.87rem; color: var(--text-muted); margin: 12px 0 18px; font-style: italic; }
.problem-body h3 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.4px; margin-bottom: 12px; }

/* Causes */
.causes-list { display: flex; flex-direction: column; gap: 10px; }
.cause-item { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }

.cause-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
}
.cause-num {
  width: 24px; height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cause-title-block { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cause-title { font-size: 0.88rem; font-weight: 700; }

/* Probability badges */
.cause-prob { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.cause-prob.prob-very-common { background: #fef9c3; color: #854d0e; }
.cause-prob.prob-common      { background: #e0f2fe; color: #075985; }
.cause-prob.prob-less-common { background: #f1f5f9; color: #475569; }
.cause-prob.prob-most-common { background: #fef9c3; color: #854d0e; }
.cause-prob.prob-rare        { background: #f8fafc; color: #94a3b8; }
.cause-prob.prob-all-cases   { background: #fee2e2; color: #991b1b; }

.cause-detail { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.cause-section { font-size: 0.84rem; color: #374151; }
.cause-label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.cause-section p { margin: 0; line-height: 1.6; }
.cause-warning {
  font-size: 0.82rem;
  color: #991b1b;
  background: #fff5f5;
  border-radius: 5px;
  padding: 8px 11px;
}

/* Voltage reference */
.vr-note { font-size: 0.83rem; color: var(--text-muted); margin-bottom: 16px; }
.vr-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.vr-tables h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; }
.vr-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.vr-table th { background: var(--primary); color: white; padding: 8px 12px; text-align: left; font-size: 0.78rem; }
.vr-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); }
.vr-table tr.v-full   td { background: #f0fdf4; }
.vr-table tr.v-good   td { background: #f7fef9; }
.vr-table tr.v-ok     td { background: #fffbeb; }
.vr-table tr.v-low    td { background: #fff7ed; }
.vr-table tr.v-warn   td { background: #fff1f2; color: #9f1239; font-weight: 600; }
.vr-table tr.v-danger td { background: #fef2f2; color: #991b1b; font-weight: 700; }

/* ─── System Builder Sandbox ─────────────────────────────────────────────────── */

.sb-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
  align-items: start;
}

/* Picker sidebar */
.sb-picker {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.sb-picker h2 { font-size: 1.05rem; color: var(--primary); margin-bottom: 4px; }
.sb-intro { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 14px; line-height: 1.4; }

.sb-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.sb-section-title { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }

.sb-lbl { display: block; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 3px; }

.sb-sel {
  width: 100%;
  padding: 7px 9px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  background: var(--bg);
  color: var(--text);
}
.sb-sel:focus { outline: none; border-color: var(--primary); background: white; }

.sb-num {
  width: 100%;
  padding: 7px 9px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}
.sb-num:focus { outline: none; border-color: var(--primary); background: white; }

.sb-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

.sb-pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-pill {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: white;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.sb-pill.active { background: var(--primary); border-color: var(--primary); color: white; }

.sb-check { display: flex; align-items: center; gap: 7px; font-size: 0.86rem; cursor: pointer; }
.sb-check input { accent-color: var(--primary); width: 15px; height: 15px; }

.sb-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; font-style: italic; }

.sb-warn {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.8rem;
  color: #991b1b;
  margin-top: 8px;
  line-height: 1.4;
}

/* Results column */
.sb-results { display: flex; flex-direction: column; gap: 18px; }

.sb-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.sb-card h2 { font-size: 1.05rem; color: var(--primary); margin-bottom: 14px; }

/* Diagram card */
.sb-diagram-card { padding-bottom: 14px; }
.sb-card-hdr { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.sb-card-hdr h2 { margin-bottom: 0; }
.sb-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; font-weight: 600; }
.sb-leg.red  { color: #e53e3e; }
.sb-leg.dark { color: #2d3748; }
.sb-leg.blue { color: #2563eb; }
.sb-leg.fuse { color: #f59e0b; }

.sb-svg-wrap {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  min-height: 260px;
}
.sb-svg-wrap svg { width: 100%; height: auto; display: block; }

/* Specs table */
.sb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin-bottom: 14px;
}
.sb-table th {
  background: var(--bg);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}
.sb-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sb-table tr:last-child td { border-bottom: none; }
.sb-main-row td { background: #fef2f2; font-size: 0.84rem; }
.sb-main-row td strong { color: #dc2626; }

.sb-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.sb-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Installation steps */
.sb-phase { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; }
.sb-phase-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg);
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  gap: 10px;
  transition: background 0.12s;
}
.sb-phase-btn:hover { background: #e8edf2; }
.sb-phase-btn.open { background: white; }
.sb-chev { font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }

.sb-phase-body { display: none; padding: 14px 16px; border-top: 1px solid var(--border); background: white; }
.sb-phase-body.open { display: block; }

.sb-ol { padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.sb-ol li { font-size: 0.86rem; line-height: 1.5; }

/* ─── Shopping Checklist Tab ─────────────────────────────────────────────────── */

.shop-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

/* Config panel */
.shop-config {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  position: sticky;
  top: 12px;
}
.shop-config h2 { font-size: 1.1rem; margin-bottom: 4px; color: var(--primary); }
.shop-config-intro { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 16px; }

.shop-field { margin-bottom: 14px; }
.shop-field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.shop-field input[type="number"],
.shop-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
}
.shop-field input:focus,
.shop-field select:focus { outline: none; border-color: var(--primary); background: white; }

.shop-btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
.shop-volt-btn,
.shop-batt-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: white;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.shop-volt-btn.active,
.shop-batt-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.shop-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.shop-prefill-btn {
  width: 100%;
  padding: 9px;
  margin-top: 6px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.shop-prefill-btn:hover { background: var(--accent-dark); }

/* Summary card */
.shop-summary {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.shop-summary-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.shop-stat { display: flex; flex-direction: column; }
.shop-stat-label { font-size: 0.75rem; opacity: 0.75; }
.shop-stat-value { font-size: 1.4rem; font-weight: 800; }
.shop-summary-actions { display: flex; gap: 8px; }
.shop-action-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.shop-action-btn:hover { opacity: 0.85; }
.shop-action-btn.print { background: white; color: var(--primary); }
.shop-action-btn.clear { background: rgba(255,255,255,0.15); color: white; }

/* Category cards */
.shop-cat {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.shop-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1.5px solid transparent;
  transition: background 0.12s;
}
.shop-cat-header:hover { background: var(--bg); }
.shop-cat-header.open { border-bottom-color: var(--border); }
.shop-cat-icon { font-size: 1.25rem; }
.shop-cat-title { font-weight: 700; font-size: 0.97rem; flex: 1; }
.shop-cat-meta { font-size: 0.78rem; color: var(--text-muted); }
.shop-cat-chevron { font-size: 0.85rem; color: var(--text-muted); transition: transform 0.2s; }
.shop-cat-header.open .shop-cat-chevron { transform: rotate(180deg); }
.shop-cat-body { display: none; padding: 10px 0; }
.shop-cat-body.open { display: block; }

/* Item rows */
.shop-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.shop-item:last-child { border-bottom: none; }
.shop-item:hover { background: var(--bg); }
.shop-item.checked { opacity: 0.5; }
.shop-item input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.shop-item-main {}
.shop-item-name { font-weight: 600; font-size: 0.9rem; }
.shop-item.checked .shop-item-name { text-decoration: line-through; }
.shop-item-spec { font-size: 0.8rem; color: var(--text-muted); margin-top: 1px; }
.shop-item-why { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; font-style: italic; }
.shop-item-search { font-size: 0.72rem; color: var(--primary); margin-top: 3px; }
.shop-item-right { text-align: right; white-space: nowrap; }
.shop-item-qty { font-weight: 700; font-size: 0.9rem; }
.shop-item-cost { font-size: 0.78rem; color: var(--success); margin-top: 2px; }

/* Print styles */
@media print {
  header, nav, .shop-config, .shop-summary-actions, footer { display: none !important; }
  .shop-layout { grid-template-columns: 1fr; }
  .shop-cat-body { display: block !important; }
  .tab-content { display: block !important; }
  .tab-content:not(#tab-shopping) { display: none !important; }
}

/* ─── Responsive additions ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .tilt-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .tilt-grid { grid-template-columns: 1fr 1fr; }
  .chart-summary { gap: 8px; }
  .chart-stat { min-width: 90px; }
  .vr-tables { grid-template-columns: 1fr; }
  .quick-checks { grid-template-columns: 1fr; }
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 14px 20px;
  font-size: 0.8rem;
  margin-top: auto;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .diagram-layout { grid-template-columns: 1fr; }
  .detail-panel { position: static; max-height: none; }
  .wiring-layout { grid-template-columns: 1fr; }
  .load-calc-layout { grid-template-columns: 1fr; }
  .load-results { position: static; }
  .shop-layout { grid-template-columns: 1fr; }
  .shop-config { position: static; }
  .sb-layout { grid-template-columns: 1fr; }
  .sb-picker { position: static; max-height: none; }
}

@media (max-width: 700px) {
  .results-summary { grid-template-columns: 1fr 1fr; }
  .result-card.highlight { grid-column: span 2; }
  .type-cols { grid-template-columns: 1fr; }
  main { padding: 12px 10px; }
  .comp-card { padding: 16px; }
}
