:root {
  --template-placeholder-border: 1px dashed #cbd5e1;
}

/* ===== Feature Checkboxes ===== */
.feature-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: background-color 0.15s ease;
  font-size: 0.9rem;
  color: #374151;
}

.checkbox-option:hover {
  background-color: #f3f4f6;
}

.checkbox-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.checkbox-option span {
  -webkit-user-select: none;
  user-select: none;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.85rem;
}

/* ===== Feature Grid Layout ===== */
.kmeans-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.kmeans-feature-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kmeans-feature-grid h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
}

.kmeans-feature-grid .hint {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
}

.kmeans-feature-grid label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

.kmeans-feature-grid select,
.kmeans-feature-grid input[type="number"] {
  margin-bottom: 0.75rem;
}

.kmeans-feature-grid .input-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kmeans-feature-grid .input-inline input {
  flex: 1;
  min-width: 60px;
}

.kmeans-feature-grid .inline-separator {
  color: #6b7280;
  font-size: 0.85rem;
}

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

.chart-placeholder {
  min-height: 280px;
  border: var(--template-placeholder-border);
  border-radius: 12px;
  background: repeating-linear-gradient(
    45deg,
    rgba(226, 232, 240, 0.4),
    rgba(226, 232, 240, 0.4) 12px,
    rgba(203, 213, 225, 0.4) 12px,
    rgba(203, 213, 225, 0.4) 24px
  );
}

.summary-table-card {
  margin-top: 1.5rem;
}

.summary-table td,
.summary-table th {
  text-align: left;
}

.upload-block {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.upload-block .upload-status {
  margin-top: 0.5rem;
}

.visual-output-settings details[open] {
  border: var(--template-placeholder-border);
  border-radius: 12px;
  padding: 1rem;
}

/* ===== Scenario Description Styling ===== */
.scenario-description {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    border-left: 4px solid #1d4ed8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.scenario-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.scenario-icon {
    font-size: 1.5rem;
}

.scenario-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    flex-grow: 1;
}

.scenario-badge {
    background: #1d4ed8;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.scenario-intro {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.scenario-variables h5,
.scenario-context h5,
.scenario-insights h5,
.scenario-questions h5 {
    color: #2c3e50;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scenario-var-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.scenario-var-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.scenario-var-table td:first-child {
    width: 160px;
    white-space: nowrap;
}

.var-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

.var-tag.outcome {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.var-tag.predictor {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.var-tag.binary {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.var-tag.categorical {
    background: #e2d9f3;
    color: #5a3d7a;
    border: 1px solid #d4c4e8;
}

.var-tag.time {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.context-item {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.context-item strong {
    display: block;
    color: #6c757d;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.context-item span {
    color: #2c3e50;
    font-weight: 600;
}

.scenario-insights ul,
.scenario-questions ol {
    margin: 0;
    padding-left: 1.25rem;
    color: #495057;
}

.scenario-insights li,
.scenario-questions li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.scenario-tip {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    color: #004085;
    font-size: 0.9rem;
}

.scenario-questions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

/* ===== View Toggle (MDS-style) ===== */
.map-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  gap: 0.25rem;
  background: #f5f7fb;
  padding: 0.25rem;
  border-radius: 8px;
}

.view-button {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: #475569;
}

.view-button:hover {
  background: rgba(42, 125, 225, 0.1);
}

.view-button.active {
  background: #2a7de1;
  color: white;
}

.z-axis-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.z-axis-inline label {
  color: #64748b;
  font-weight: 500;
  margin: 0;
}

.z-axis-inline select {
  padding: 0.35rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.85rem;
  background: white;
  min-width: 140px;
}

.projection-note {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #92400e;
}

.axis-settings {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.axis-select-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.axis-select-group label {
  font-size: 0.8rem;
  color: #64748b;
}

.axis-select-group select {
  min-width: 140px;
}
