/* Modal chrome, progress state, toast. */

.modal-scrim {
  position: fixed; inset: 0; z-index: 200;
  background: var(--scrim);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-scrim[hidden] { display: none; }

.modal {
  width: 520px; max-width: 100%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(16, 16, 16, .16);
  display: flex; flex-direction: column;
  animation: modal-in var(--motion) var(--ease);
  max-height: calc(100vh - 48px);
}
.modal[data-width="440"] { width: 440px; }
.modal[data-width="560"] { width: 560px; }
.modal[data-width="620"] { width: 620px; }
@keyframes modal-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

.modal-header {
  flex: none;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 0;
}
.modal-eyebrow { font: 600 10px/14px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.modal-title { font: 600 16px/22px var(--font-sans); color: var(--fg1); margin: 2px 0 0; }
.modal-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 20px 0; max-height: 60vh; }
.modal-note { font-size: 12px; color: var(--fg3); }
.modal-footer { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 18px 20px; }
.modal-footer .btn { height: 32px; }

.kpi-row { display: flex; gap: 10px; margin: 14px 0; }
.kpi-tile { flex: 1 1 0; border: 1px solid var(--c-border); border-radius: 4px; padding: 10px 12px; }
/* min-height reserves room for a label that wraps to 2 lines (e.g. "STILL
   UNRESOLVED" in a 4-tile row) so kpi-value still lines up across every
   tile regardless of how many lines its own label took. */
.kpi-label { display: block; font: 600 10px/14px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--fg3); min-height: 28px; }
.kpi-value { display: block; font: 700 20px/24px var(--font-sans); color: var(--fg1); font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi-value.warn { color: var(--warning); }

.review-ack-block { margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--warning-border); border-radius: 6px; background: var(--warning-bg); }
.review-ack-block .conflict-warning { margin-bottom: 8px; }

.conflict-resolver { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--c-border); }
.conflict-warning { color: var(--warning); font-weight: 600; margin-bottom: 10px; }
.conflict-bulk-row { display: flex; gap: 8px; margin-bottom: 10px; }
.conflict-list { display: flex; flex-direction: column; gap: 10px; max-height: 240px; overflow-y: auto; }
.conflict-row {
  border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px;
  background: var(--c-raised);
}
.conflict-os { font: 600 12px/16px var(--font-sans); color: var(--fg1); margin-bottom: 8px; }
.conflict-option {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--fg2); padding: 4px 0; cursor: pointer;
}
.conflict-option input { flex: none; }

.add-tab-panel { margin: 12px 0; }
.drop-zone {
  border: 1px dashed var(--c-border-strong); border-radius: 8px;
  padding: 24px; text-align: center; color: var(--fg3); font-size: 12px;
}
.column-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.add-explainer { margin-top: 14px; padding: 12px; background: var(--c-raised); border-radius: 4px; }
.add-explainer-title { font: 600 12px/16px var(--font-sans); color: var(--fg1); margin-bottom: 6px; }
.add-explainer ol { margin: 0; padding-left: 18px; font-size: 11px; color: var(--fg3); }

.mono-textarea {
  width: 100%; min-height: 120px; border-radius: 8px;
  border: 1px solid var(--c-border-strong); background: var(--c-surface);
  padding: 10px; font: 11px/18px var(--font-mono); color: var(--fg2);
  resize: vertical;
}

/* Progress state replaces modal body content while a job runs. */
.progress-track { height: 6px; border-radius: 44px; background: var(--c-sunken); overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; background: var(--brand); width: 0%; transition: width 300ms linear; }
.progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--fg3); margin-bottom: 10px; }
.progress-meta .pct { font-variant-numeric: tabular-nums; }
.progress-log {
  max-height: 150px; overflow-y: auto;
  background: var(--c-sunken); border: 1px solid var(--c-border); border-radius: 8px;
  padding: 8px 10px; font: 11px/17px var(--font-mono); color: var(--fg2);
}
.progress-log div { white-space: pre-wrap; word-break: break-word; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 300;
  display: flex; align-items: center; gap: 8px;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px;
  box-shadow: var(--pop); padding: 10px 14px;
  animation: toast-in 220ms var(--ease);
}
.toast[hidden] { display: none; }
.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success-dot); flex: none; }
.toast-message { font-size: 12px; color: var(--fg1); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
