/* Difference-in-Differences — tool-local styles.
   Teaching structure: .act-narrative, .concept-card, .callout-box, .chart-explainer, .interpretation-aid */

.act-narrative {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--app-text, #1f2a37);
  margin: 0 0 1rem;
}
.act-narrative.small {
  font-size: 0.9rem;
  color: var(--app-muted, #5f6b7a);
}

.act-num {
  display: inline-block;
  background: var(--app-accent, #2a7de1);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  margin-right: 0.6rem;
  vertical-align: middle;
}

/* ── Concept Cards ── */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}
.concept-card {
  background: var(--app-bg, #f5f7fb);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--app-accent, #2a7de1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.concept-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--app-text, #1f2a37);
}
.concept-card p {
  margin: 0 0 0.5rem;
  font-size: 0.93rem;
  line-height: 1.55;
}
.concept-card__detail {
  color: var(--app-muted, #5f6b7a);
}

/* ── Callout Boxes ── */
.callout-box {
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
  border-left: 4px solid;
}
.callout-box h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}
.callout-box p, .callout-box li {
  font-size: 0.94rem;
  line-height: 1.6;
}
.callout-box ol {
  margin: 0.5rem 0 0.75rem 1.2rem;
}
.callout-amber {
  background: #fffbeb;
  border-left-color: #f59e0b;
}
.callout-blue {
  background: #eff6ff;
  border-left-color: #2563eb;
}
.callout-purple {
  background: #faf5ff;
  border-left-color: #9333ea;
}

/* ── Chart Explainer & Interpretation Aid ── */
.chart-explainer {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--app-text, #1f2a37);
  background: var(--app-bg, #f8fafc);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 0 0 0.85rem;
  border: 1px solid #e2e8f0;
}

.chart-note {
  font-size: 0.9rem;
  color: var(--app-muted, #5f6b7a);
  margin: 0.6rem 0 0;
  line-height: 1.5;
}

/* ── Mode Switcher ── */
.mode-toggle-group {
  display: flex;
  background: #e2e8f0;
  padding: 0.25rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  max-width: 480px;
}
.mode-btn {
  flex: 1;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.mode-btn.is-active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ── Quick 2x2 Mode Layout ── */
.quick-2x2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.25rem 0;
}
.quick-group-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
}
.quick-group-box.test-box {
  border-top: 4px solid #2563eb;
}
.quick-group-box.ctrl-box {
  border-top: 4px solid #64748b;
}
.quick-group-box h4 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  color: #1e293b;
}
.input-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.input-row label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
}
.input-row input {
  width: 120px;
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  text-align: right;
  font-family: inherit;
}

/* ── 2x2 Table Visual ── */
.table-2x2-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
}
.table-2x2 {
  width: 100%;
  max-width: 600px;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0 auto;
}
.table-2x2 th, .table-2x2 td {
  padding: 0.75rem 1rem;
  text-align: right;
  border: 1px solid #e2e8f0;
}
.table-2x2 th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
}
.table-2x2 th:first-child, .table-2x2 td:first-child {
  text-align: left;
}
.table-2x2 .highlight-row {
  background: #eff6ff;
  font-weight: 700;
}
.table-2x2 .did-cell {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 1.1rem;
  font-weight: 800;
}

/* ── Dropzone & Upload ── */
.dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 1rem 0;
}
.dropzone:hover, .dropzone.is-dragover {
  border-color: #2563eb;
  background: #eff6ff;
}
.dropzone p {
  margin: 0;
  font-size: 0.95rem;
  color: #475569;
}

/* ── Step 2 Column Mapping & Settings ── */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.role-item label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.4rem;
}
.role-item select, .role-item input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #ffffff;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

/* ── Visual Output Tabs ── */
.view-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.view-tab {
  padding: 0.65rem 1.15rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  margin-bottom: -2px;
}
.view-tab:hover {
  color: #1e293b;
}
.view-tab.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.chart-wrapper {
  min-height: 440px;
  width: 100%;
  background: #ffffff;
  border-radius: 8px;
}

/* ── Metric Headline Chips ── */
.metric-headline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.metric-headline__item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.metric-headline__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.35rem;
}
.metric-headline__value {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
}
.metric-headline__sub {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* ── Check the Assumption Card (B12) ── */
.assumption-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.assumption-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}
.assumption-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.1rem;
}
.assumption-item h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #1e293b;
}
.assumption-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}
.status--pass {
  background: #dcfce7;
  color: #166534;
}
.status--warn {
  background: #fef9c3;
  color: #854d0e;
}
.status--fail {
  background: #fee2e2;
  color: #991b1b;
}

.toggle-pair {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.toggle-btn {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}
.toggle-btn.is-selected {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* ── Reveal the Truth Card ── */
.truth-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-left: 5px solid #6366f1;
}
.truth-card h3 {
  margin: 0 0 0.5rem;
  color: #1e1b4b;
}
.truth-content {
  margin-top: 1rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.truth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.truth-stat {
  padding: 0.75rem;
  background: #f1f5f9;
  border-radius: 6px;
  text-align: center;
}
.truth-stat__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}
.truth-stat__value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 0.25rem;
}

/* ── Exploratory Questions ── */
.exploratory-questions {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
}
.exploratory-questions h3 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  color: #1e293b;
}
.exploratory-questions ul {
  margin: 0;
  padding-left: 1.35rem;
}
.exploratory-questions li {
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #334155;
}

/* ── Responsive Adjustments ── */
@media (max-width: 768px) {
  .roles-grid {
    grid-template-columns: 1fr;
  }
  .quick-2x2-grid {
    grid-template-columns: 1fr;
  }
  .settings-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Scenario Controls Input & Download Button ── */
.scenario-controls__input {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.scenario-controls__input select {
  flex: 1;
  min-width: 240px;
}

/* ── Dataset Status Chip ── */
.dataset-chip {
  display: inline-block;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

/* ── Scenario Var Table & Tags ── */
.scenario-var-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.5rem 0 1rem;
}
.scenario-var-table tr {
  border-bottom: 1px solid #e5e7eb;
}
.scenario-var-table tr:last-child {
  border-bottom: none;
}
.scenario-var-table td {
  padding: 0.45rem 0.5rem 0.45rem 0;
  vertical-align: middle;
}
.scenario-var-table td:first-child {
  width: 150px;
}
.var-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.var-tag.outcome { background: #dcfce7; color: #166534; }
.var-tag.predictor { background: #dbeafe; color: #1e40af; }
.var-tag.categorical { background: #f3e8ff; color: #6b21a8; }
.var-tag.binary { background: #fef3c7; color: #92400e; }
.var-tag.time { background: #ccfbf1; color: #115e59; }

/* ── Dropzone Specifics ── */
.dropzone-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.35rem 0;
}
.dropzone-note {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 0.75rem 0;
}
.template-buttons {
  margin-top: 0.75rem;
}

/* ── Chart Action Bars ── */
.chart-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.chart-actions button {
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
}

/* ── Seed Control & Mount ── */
.seed-mount-wrap {
  margin: 1rem 0 0.5rem;
}

/* ── Guidance Box ── */
.guidance-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border-left: 4px solid var(--app-accent, #2a7de1);
  border-radius: 6px;
  font-size: 0.88rem;
  color: #334155;
}
