* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #0F172A;
  color: #E2E8F0;
  min-height: 100vh;
}

/* Header */
#header {
  background: #1E293B;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #334155;
}
#header h1 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #F8FAFC;
}
#option-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
.option-card {
  flex: 1;
  border: 2px solid;
  border-radius: 8px;
  padding: 10px;
  background: #0F172A;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.option-label {
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 3px 12px;
  border-radius: 4px;
}
.option-cost {
  display: flex;
  align-items: center;
  gap: 4px;
}
.option-cost input {
  width: 100px;
  background: #1E293B;
  border: 1px solid #475569;
  color: #E2E8F0;
  padding: 4px 8px;
  border-radius: 4px;
  text-align: right;
  font-size: 14px;
}
.cost-label { font-size: 12px; color: #94A3B8; }
.option-total { font-size: 20px; font-weight: 700; }

/* Progress */
.progress-track {
  height: 6px;
  background: #334155;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3B82F6, #10B981);
  transition: width 0.3s;
}
.progress-text {
  font-size: 12px;
  color: #94A3B8;
  display: block;
  margin-top: 4px;
}

/* Toolbar */
#toolbar {
  background: #1E293B;
  padding: 8px 24px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #334155;
  position: sticky;
  top: 120px;
  z-index: 99;
  flex-wrap: wrap;
}
#toolbar button, #toolbar select {
  background: #334155;
  color: #E2E8F0;
  border: 1px solid #475569;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
#toolbar button:hover { background: #475569; }

/* Categories */
#categories-container { padding: 16px 24px; }
.category {
  background: #1E293B;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.category-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  gap: 8px;
  background: #1E293B;
}
.category-header:hover { background: #253348; }
.category-toggle { font-size: 12px; color: #94A3B8; width: 16px; }
.category-name { font-weight: 600; font-size: 15px; flex: 1; }
.category-subtotals { display: flex; gap: 12px; font-size: 13px; }
.subtotal { font-variant-numeric: tabular-nums; }
.category-actions { display: flex; gap: 4px; }
.category-actions button {
  background: none;
  border: none;
  color: #64748B;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}
.category-actions button:hover { color: #E2E8F0; background: #334155; }

.category-body { padding: 0 16px 12px; }
.category-body.collapsed { display: none; }

/* Criteria Table */
.criteria-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.criteria-table th {
  text-align: center;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid #334155;
}
.criteria-table th.col-name { text-align: left; }
.col-name { width: 40%; padding: 8px 4px; line-height: 1.4; }
.criterion-desc {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 2px;
  line-height: 1.3;
}
.col-score { width: 16%; text-align: center; padding: 6px 2px; }
.col-actions { width: 12%; text-align: right; padding: 6px 4px; }

.criterion-row { border-bottom: 1px solid #1a2332; }
.criterion-row:hover { background: #253348; }
.criterion-row .col-actions button {
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  visibility: hidden;
}
.criterion-row:hover .col-actions button { visibility: visible; }
.criterion-row .col-actions button:hover { color: #E2E8F0; background: #334155; }

/* Score Buttons */
.score-input-wrap {
  display: flex;
  gap: 2px;
  justify-content: center;
}
.score-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #475569;
  border-radius: 4px;
  background: #0F172A;
  color: #94A3B8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-btn:hover {
  border-color: #94A3B8;
  color: #E2E8F0;
  transform: scale(1.1);
}
.score-btn.active {
  border-color: transparent;
  transform: scale(1.1);
}

/* Add bars */
.add-criterion-bar {
  display: flex;
  gap: 6px;
  padding: 8px 0 4px;
}
.add-criterion-bar input {
  flex: 1;
  background: #0F172A;
  border: 1px dashed #475569;
  color: #E2E8F0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}
.add-criterion-bar button {
  background: #334155;
  color: #10B981;
  border: 1px solid #475569;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
}
.add-criterion-bar button:hover { background: #475569; }

#add-category-bar {
  display: flex;
  gap: 8px;
  padding: 12px 24px 24px;
}
#add-category-bar input {
  flex: 1;
  background: #1E293B;
  border: 1px dashed #475569;
  color: #E2E8F0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}
#add-category-bar button {
  background: #10B981;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
#add-category-bar button:hover { background: #059669; }

/* Footer */
#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1E293B;
  border-top: 1px solid #334155;
  padding: 10px 24px;
  z-index: 100;
}
#footer-scores {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 16px;
}
.footer-item { font-variant-numeric: tabular-nums; }
.footer-item.leader { font-size: 18px; text-decoration: underline; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-content {
  background: #1E293B;
  border-radius: 12px;
  padding: 24px;
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 24px;
  cursor: pointer;
}
.modal-close:hover { color: #E2E8F0; }
.modal-content h2 { margin: 16px 0 12px; color: #F8FAFC; font-size: 18px; }
.modal-content h2:first-child { margin-top: 0; }
.modal-content h3 { margin: 12px 0 8px; font-size: 16px; }

/* Summary bars */
.summary-bars { display: flex; flex-direction: column; gap: 8px; }
.summary-bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 120px; font-weight: 600; font-size: 14px; text-align: right; }
.bar-track {
  flex: 1;
  background: #334155;
  border-radius: 4px;
  height: 28px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  min-width: fit-content;
  border-radius: 4px;
  transition: width 0.3s;
}
.bar-info { font-size: 13px; color: #94A3B8; width: 80px; }

/* Summary table */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 8px 0;
}
.summary-table th, .summary-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #334155;
  text-align: center;
}
.summary-table th { font-size: 13px; font-weight: 600; }
.summary-table td:first-child { text-align: left; }

/* Pro/Con */
.pro-con { display: flex; gap: 16px; }
.pro, .con { flex: 1; }
.pro ul, .con ul { list-style: none; padding: 0; }
.pro li, .con li {
  padding: 4px 0;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.score-badge {
  padding: 2px 8px;
  border-radius: 4px;
  color: white;
  font-size: 12px;
  font-weight: 700;
}

/* Bottom spacing for fixed footer */
main { padding-bottom: 60px; }
