/* ============================================
   MILITARY FORCE CALCULATOR - STYLES
   ============================================ */

/* ============================================
   BASE STYLES & RESET
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f3f4f6;
  color: #1f2937;
  line-height: 1.5;
  padding: 1rem;
}

/* ============================================
   LAYOUT - CONTAINER & GRID
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.full-width {
  grid-column: 1 / -1;
}

/* ============================================
   RESPONSIVE ROW LAYOUTS
   ============================================ */
.inputs-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .inputs-row {
    grid-template-columns: 1fr 1fr;
  }
}

.results-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .results-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   NAVIGATION
   ============================================ */
.micras-tool-nav {
  background: #293241;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 40px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.85rem;
  gap: 0.5rem;
  position: relative;
  z-index: 9999;
  margin: -1rem -1rem 1rem -1rem;
}

.micras-tool-nav a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s;
}

.micras-tool-nav a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.micras-tool-nav .micras-tool-nav-sep {
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0.25rem;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  background: linear-gradient(to right, #1e293b, #334155);
  color: white;
  padding: 1.5rem;
  border-radius: 0.5rem 0.5rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: bold;
}

.header p {
  color: #cbd5e1;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.reset-btn {
  background: transparent;
  border: 1px solid #94a3b8;
  color: #cbd5e1;
  padding: 0.4rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.reset-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: #e2e8f0;
  color: white;
}

/* ============================================
   INTRO BOX
   ============================================ */
.intro-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.intro-box p {
  font-size: 0.9rem;
  color: #1e3a8a;
}

.intro-box strong {
  color: #1e3a8a;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 1rem;
  margin-bottom: 1rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
}

.section-help {
  font-size: 0.8rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: 0.25rem;
  border-left: 3px solid #d1d5db;
}

/* ============================================
   FORM INPUTS
   ============================================ */
.input-group {
  margin-bottom: 1rem;
}

.label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.input-group input[type="text"],
.input-group select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.input-group input[type="text"].input-error {
  border-color: #ef4444;
  background: #fef2f2;
}

.input-error-msg {
  color: #dc2626;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.input-group input[type="range"] {
  width: 100%;
  flex: 1;
}

.input-group .hint {
  font-size: 0.75rem;
  color: #4b5563;
  margin-top: 0.25rem;
}

/* Slider styles */
.slider-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slider-min, .slider-max {
  font-size: 0.75rem;
  color: #4b5563;
  white-space: nowrap;
}

.budget-direct-input {
  width: 4.5rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.85rem;
  text-align: center;
  margin-left: 0.25rem;
}

.slider-reference {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #f3f4f6;
  border-radius: 0.25rem;
  font-size: 0.7rem;
}

.reference-label {
  color: #374151;
  font-weight: 600;
}

.reference-item {
  color: #4b5563;
}

.reference-divider {
  color: #d1d5db;
}

/* Checkbox styles */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.checkbox-group input {
  width: 1rem;
  height: 1rem;
}

/* ============================================
   BRANCH SPLIT INPUTS
   ============================================ */
.branch-split-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.branch-split-row.four-branch {
  grid-template-columns: repeat(4, 1fr);
}

.branch-split-input label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #374151;
}

.branch-split-input input {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.branch-split-input input[readonly] {
  background: #f3f4f6;
  color: #4b5563;
  cursor: not-allowed;
}

/* Branch warning boxes */
.branch-warning-box {
  margin-top: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.branch-warning-box.warning-red {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.branch-warning-box.warning-yellow {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.branch-warning-box.warning-good {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* ============================================
   TOOLTIPS
   ============================================ */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #d1d5db;
  color: #374151;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  cursor: help;
  position: relative;
  border: none;
  padding: 0;
  font-family: inherit;
}

.tooltip-trigger:hover {
  background: #9ca3af;
  color: #1f2937;
}

.tooltip-trigger .tooltip-content {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: normal;
  width: 220px;
  text-align: left;
  z-index: 100;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.tooltip-trigger .tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
}

.tooltip-trigger:hover .tooltip-content,
.tooltip-trigger:focus .tooltip-content,
.tooltip-trigger:focus-within .tooltip-content {
  display: block;
}

/* Flipped tooltip when near top of viewport */
.tooltip-trigger .tooltip-content.tooltip-below {
  bottom: auto;
  top: 100%;
  margin-bottom: 0;
  margin-top: 0.5rem;
}

.tooltip-trigger .tooltip-content.tooltip-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #1f2937;
}

/* ============================================
   ACCORDION
   ============================================ */
.accordion-section {
  margin-bottom: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: white;
}

.accordion-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  text-align: left;
  gap: 0.5rem;
}

.accordion-header:hover {
  background: #f3f4f6;
}

.accordion-header .arrow {
  transition: transform 0.2s ease;
  font-size: 0.75rem;
}

.accordion-header.expanded .arrow {
  transform: rotate(90deg);
}

.accordion-content {
  display: none;
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
}

.accordion-content.expanded {
  display: block;
}

.custom-personnel-toggle {
  margin-bottom: 0.75rem;
}

/* Toggle panels: hidden by default, shown when .active is added via JS */
.toggle-panel {
  display: none;
}
.toggle-panel.active {
  display: block;
}

.custom-personnel-inputs {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.custom-personnel-inputs.active {
  display: grid;
}

@media (max-width: 600px) {
  .custom-personnel-inputs {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.badge-yellow {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ============================================
   RESULT ROWS
   ============================================ */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.875rem;
}

.result-row.indent {
  padding-left: 1rem;
  color: #4b5563;
}

.result-row.indent-2 {
  padding-left: 2rem;
  color: #4b5563;
  font-size: 0.8rem;
}

.result-row .value {
  font-weight: 500;
}

.result-row .label-with-tip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   WARNING BOXES
   ============================================ */
.warning-box {
  padding: 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.warning-yellow {
  background: #fefce8;
  color: #854d0e;
}

.warning-red {
  background: #fef2f2;
  color: #991b1b;
}

.warning-good {
  background: #f0fdf4;
  color: #166534;
}

.supplement-affordability {
  font-size: 0.85rem;
}

/* Range status indicators */
.range-in-range {
  color: #16a34a;
}

.range-out-of-range {
  color: #dc2626;
}

.range-conflict {
  color: #b45309;
  font-size: 0.75rem;
}

/* ============================================
   ASSESSMENT ROW
   ============================================ */
.assessment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.assessment-row .label {
  font-size: 1rem;
  font-weight: 500;
}

.comparator {
  font-size: 0.875rem;
  color: #4b5563;
}

.comparator strong {
  color: #1f2937;
}

/* ============================================
   BRANCH CARDS
   ============================================ */
.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}

.branch-grid.four-branch {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 767px) {
  .branch-grid {
    grid-template-columns: 1fr;
  }
  .branch-grid.four-branch {
    grid-template-columns: repeat(2, 1fr);
  }
}

.branch-card {
  padding: 0.75rem;
  border-radius: 0.375rem;
}

.branch-card .title {
  font-weight: 500;
  font-size: 0.875rem;
}

.branch-card .number {
  font-size: 1.25rem;
  font-weight: bold;
}

.branch-card .budget {
  font-size: 0.75rem;
}

.branch-card .personnel-label {
  font-size: 0.65rem;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Army branch */
.branch-card.army {
  background: #f0fdf4;
}

.branch-card.army .title { color: #166534; }
.branch-card.army .number { color: #14532d; }
.branch-card.army .budget { color: #16a34a; }

/* Navy branch */
.branch-card.navy {
  background: #eff6ff;
}

.branch-card.navy .title { color: #1e3a8a; }
.branch-card.navy .number { color: #1e3a8a; }
.branch-card.navy .budget { color: #1d4ed8; }

/* Air Force branch */
.branch-card.airforce {
  background: #f0f9ff;
}

.branch-card.airforce .title { color: #0369a1; }
.branch-card.airforce .number { color: #0c4a6e; }
.branch-card.airforce .budget { color: #0284c7; }

/* Space branch */
.branch-card.space {
  background: #faf5ff;
}

.branch-card.space .title { color: #581c87; }
.branch-card.space .number { color: #581c87; }
.branch-card.space .budget { color: #6d28d9; }

/* Space hidden utility */
.space-hidden {
  display: none !important;
}

/* ============================================
   EQUIPMENT CONTROLS
   ============================================ */
.equipment-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.btn-expand-all {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
}

.btn-expand-all:hover {
  background: #e5e7eb;
}

/* ============================================
   EQUIPMENT GRID & SECTIONS
   ============================================ */
.equipment-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .equipment-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .equipment-grid.four-branch {
    grid-template-columns: repeat(2, 1fr);
  }
}

.equipment-section h4 {
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.equipment-section.army h4 { color: #166534; }
.equipment-section.navy h4 { color: #1e3a8a; }
.equipment-section.airforce h4 { color: #0369a1; }
.equipment-section.space h4 { color: #581c87; }

/* ============================================
   EQUIPMENT TABLES
   ============================================ */
.equipment-table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
}

.equipment-table th {
  text-align: left;
  color: #374151;
  font-weight: 600;
  padding: 0.5rem 0.25rem;
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.equipment-table th .th-subtitle {
  display: block;
  font-weight: normal;
  font-size: 0.7rem;
  color: #4b5563;
}

.equipment-table td {
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.equipment-table .min-max {
  color: #4b5563;
}

.equipment-table .recommended {
  font-weight: 600;
  color: #1f2937;
}

.equipment-table .ratio {
  font-size: 0.7rem;
  color: #4b5563;
}

/* Expandable rows */
.equipment-table .expand-toggle {
  cursor: pointer;
  user-select: none;
  font-weight: 600;
}

.equipment-table .expand-toggle:hover {
  color: #2563eb;
}

.equipment-table .subtype-row {
  display: none;
}

.equipment-table .subtype-row.expanded {
  display: table-row;
}

.equipment-table .subtype-row td {
  padding: 0.25rem 0.25rem 0.25rem 1.5rem;
  font-size: 0.75rem;
  color: #4b5563;
  border-bottom: 1px solid #f3f4f6;
}

.equipment-table .subtype-row td:first-child {
  font-style: italic;
}

.equipment-table .subtype-cost {
  font-size: 0.65rem;
  color: #6b7280;
  margin-left: 0.25rem;
}

/* Equipment explainer boxes */
.equipment-explainer {
  font-size: 0.75rem;
  color: #4b5563;
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: 0.25rem;
  border-left: 3px solid;
}

.equipment-section.army .equipment-explainer { border-left-color: #86efac; }
.equipment-section.navy .equipment-explainer { border-left-color: #93c5fd; }
.equipment-section.airforce .equipment-explainer { border-left-color: #7dd3fc; }

/* Equipment note box */
.equipment-note {
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f0fdf4;
  border-radius: 0.375rem;
  border: 1px solid #bbf7d0;
}

.equipment-note strong {
  color: #166534;
}

/* ============================================
   HOW TO READ & STATUS EXPLAINER
   ============================================ */
.how-to-read {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.how-to-read-title {
  font-weight: 600;
  color: #854d0e;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.how-to-read p {
  font-size: 0.8rem;
  color: #713f12;
  margin: 0;
}

.status-explainer {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.status-explainer-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.green { background: #22c55e; }
.status-dot.yellow { background: #eab308; }
.status-dot.red { background: #ef4444; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  text-align: center;
  font-size: 0.8rem;
  color: #4b5563;
  padding: 1rem 0;
}

/* ============================================
   FOCUS INDICATORS (ACCESSIBILITY)
   ============================================ */
.reset-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.tooltip-trigger:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.accordion-header:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: -2px;
}

button:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

input[type="text"]:focus-visible,
input[type="range"]:focus-visible,
select:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.equipment-table .expand-toggle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #1f2937;
  color: white;
  padding: 0.5rem 1rem;
  z-index: 10000;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ============================================ */
/* Methodology Tables                           */
/* ============================================ */

#methodology table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.8rem;
  display: block;
  overflow-x: auto;
}

#methodology th {
  padding: 0.5rem;
  text-align: left;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
}

#methodology td {
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
}

#methodology p {
  margin: 0.5rem 0;
}

#methodology .methodology-note {
  font-size: 0.78rem;
  color: #6b7280;
}

#methodology .methodology-aside {
  font-size: 0.85rem;
}

#methodology ul {
  margin: 0.25rem 0 1rem 1.25rem;
  padding: 0;
}

#methodology ol {
  margin: 0.25rem 0 0.75rem 1.25rem;
  padding: 0;
}

#methodology h4 {
  margin: 1rem 0 0.5rem 0;
  color: #1f2937;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.25rem;
}

/* Layout utility classes */
.flex-row {
  display: flex;
  gap: 0.5rem;
}

.input-separator {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed #e5e7eb;
}

#methodology {
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}

#methodology > summary {
  cursor: pointer;
  text-align: center;
  font-size: 1rem;
}

#methodology > div {
  margin-top: 1rem;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #374151;
}

#methodology .methodology-disclaimer {
  margin: 1rem 0 0.5rem 0;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
}

.footer-credit {
  margin-top: 0.75rem;
  color: #6b7280;
}

.footer-credit a {
  color: #6366f1;
}

.version-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4f46e5;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}

.version-badge:hover {
  background: #e0e7ff;
}

.changelog-panel {
  margin-top: 0.75rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  text-align: left;
  max-height: 20rem;
  overflow-y: auto;
  font-size: 0.85rem;
  color: #374151;
}

.changelog-panel h3 {
  margin: 0 0 0.4rem 0;
  font-size: 0.9rem;
  color: #111827;
}

.changelog-panel h3:not(:first-child) {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.changelog-date {
  font-weight: 400;
  color: #9ca3af;
  font-size: 0.8rem;
}

.changelog-panel ul {
  margin: 0 0 0 1.25rem;
  padding: 0;
}

.changelog-panel li {
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

/* ============================================ */
/* Extracted Inline Styles                      */
/* ============================================ */

/* Branch split area */
.checkbox-group-mt {
  margin-top: 0.5rem;
}

.section-help-mb {
  margin-bottom: 0.5rem;
}

#branchSplitReference {
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.branch-split-total {
  margin-top: 0.375rem;
  font-size: 0.8rem;
}

/* Config summary panel */
#configSummary {
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: #4b5563;
  border-left: 3px solid #6366f1;
}

/* Accordion tooltip trigger auto-push */
.accordion-header .tooltip-trigger {
  margin-left: auto;
}

/* Custom personnel area */
.checkbox-group-mb {
  margin-bottom: 0.75rem;
}

#affordableMaxHint {
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.6rem;
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  border-radius: 0.25rem;
  font-size: 0.78rem;
  color: #1e40af;
}

/* Result row variants */
.result-row-separator {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

#recommendedRangeRow {
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.result-row-muted {
  color: #6b7280;
  font-size: 0.8rem;
}

.result-row-spaced {
  margin-top: 0.5rem;
}

/* Equipment validation panel */
.equipment-validation-wrapper {
  margin-bottom: 1rem;
}

#equipmentValidationInputs {
  margin-top: 0.75rem;
  padding: 1rem;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 0.5rem;
}

.equipment-validation-intro {
  font-size: 0.85rem;
  color: #854d0e;
  margin-bottom: 0.75rem;
}

.equipment-validation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.equipment-validation-grid .input-group {
  margin-bottom: 0;
}

.equipment-validation-grid label {
  font-size: 0.8rem;
}

#equipmentValidationResults {
  margin-top: 1rem;
}

/* Space GDP warning */
#spaceGdpWarning {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Equipment/supplement affordability */
#equipmentAffordability {
  margin-top: 1rem;
}

#supplementAffordability {
  margin-top: 0.75rem;
}

/* Intro box methodology link */
.intro-methodology-link {
  color: #6366f1;
}

/* ============================================
   COMPARE MODE
   ============================================ */
.compare-panel {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
  overflow: hidden;
}

.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(to right, #312e81, #4338ca);
  color: white;
}

.compare-header h3 {
  font-size: 1rem;
  margin: 0;
  color: white;
}

.compare-content {
  padding: 1rem;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.compare-table th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  background: #f3f4f6;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
  color: #374151;
}

.compare-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #f3f4f6;
}

.compare-table .compare-label {
  font-weight: 500;
  color: #374151;
  width: 30%;
}

.compare-table .compare-a,
.compare-table .compare-b {
  width: 30%;
  text-align: right;
}

.compare-table .compare-diff {
  width: 10%;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 500;
}

.compare-diff-positive { color: #16a34a; }
.compare-diff-negative { color: #dc2626; }
.compare-diff-neutral { color: #6b7280; }

.compare-table .compare-section-row td {
  font-weight: 600;
  color: #1f2937;
  padding-top: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
  background: #f9fafb;
}

.compare-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 0.2rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.compare-badge-green { background: #dcfce7; color: #166534; }
.compare-badge-yellow { background: #fef9c3; color: #854d0e; }
.compare-badge-red { background: #fee2e2; color: #991b1b; }

/* Active compare button state */
.compare-btn-active {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: #818cf8 !important;
  color: #c7d2fe !important;
}

.compare-hint {
  padding: 0.75rem 1rem;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ============================================
   MOBILE RESPONSIVE (below 768px)
   ============================================ */
@media (max-width: 767px) {
  /* Equipment tables: horizontal scroll on narrow screens */
  .equipment-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .equipment-table {
    min-width: 320px;
  }

  /* Branch cards: 1 column on mobile for 4-branch too */
  .branch-grid.four-branch {
    grid-template-columns: 1fr;
  }

  /* Compact header on mobile */
  .header h1 {
    font-size: 1.25rem;
  }

  .header-buttons .btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
  }

  /* Budget slider direct input stacks below on very small screens */
  .slider-container {
    flex-wrap: wrap;
  }

  .budget-direct-input {
    margin-top: 0.25rem;
  }

  /* Methodology tables scroll */
  .methodology-section table {
    display: block;
    overflow-x: auto;
  }

  /* Branch split inputs: tighter spacing */
  .branch-split-row {
    flex-wrap: wrap;
  }

  /* Compare panel: horizontal scroll on narrow screens */
  .compare-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .compare-table {
    min-width: 500px;
  }
}
