/* ============================================================
   SCHEMA DRIFT — the before/after diagram
   Page-scoped: loaded only by /schema-drift.html. Prefix .dr-.
   Real HTML text, not an image, so it stays selectable,
   translatable and readable with CSS disabled.
   ============================================================ */

.dr-demo { padding: 0 0 var(--space-9); }

.dr-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}
.dr-flow--now { margin-top: 20px; }
@media (max-width: 820px) {
  .dr-flow { grid-template-columns: 1fr; gap: 12px; }
  .dr-flow--now { margin-top: 28px; }
}

/* --- a table card ------------------------------------------------------- */
.dr-card {
  margin: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.dr-card--changed { border-color: var(--color-teal-500); }

.dr-card__cap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-soft);
  border-bottom: 1px solid var(--color-border-light);
}
.dr-card__when {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}
.dr-card__when--now {
  color: var(--color-teal-900);
  border-color: var(--color-teal-500);
  background: var(--color-teal-50);
}

/* --- column rows -------------------------------------------------------- */
.dr-cols { margin: 0; padding: 6px 0; list-style: none; }
.dr-cols li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  font-size: 14px;
}
.dr-col__n {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-primary);
}
.dr-col__t {
  font-size: 12px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}
.dr-cols .dr-col--new { background: var(--color-teal-50); }
.dr-cols .dr-col--new .dr-col__n { color: var(--color-teal-900); font-weight: 600; }
.dr-col__tag {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-teal-600);
}

/* --- connector between the two cards ------------------------------------ */
.dr-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.dr-arrow__line {
  position: relative;
  width: 72px;
  height: 2px;
  background: var(--color-border);
}
.dr-arrow__line::after {
  content: "";
  position: absolute;
  right: -1px; top: 50%;
  width: 7px; height: 7px;
  border-top: 2px solid var(--color-border);
  border-right: 2px solid var(--color-border);
  transform: translateY(-50%) rotate(45deg);
}
.dr-arrow__label { font-size: 12px; color: var(--color-text-tertiary); }

.dr-arrow--now .dr-arrow__line { background: var(--color-teal-600); }
.dr-arrow--now .dr-arrow__line::after {
  border-top-color: var(--color-teal-600);
  border-right-color: var(--color-teal-600);
}
.dr-arrow__ddl code {
  display: inline-block;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  background: var(--color-teal-50);
  border: 1px solid var(--color-teal-500);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--color-teal-900);
  text-align: center;
}
/* Stacked layout: the connector turns to point downward. */
@media (max-width: 820px) {
  .dr-arrow { flex-direction: row; min-width: 0; justify-content: center; }
  .dr-arrow__line { width: 2px; height: 28px; }
  .dr-arrow__line::after { right: 50%; top: auto; bottom: -1px; transform: translateX(50%) rotate(135deg); }
}

.dr-demo__note {
  margin: 28px 0 0;
  font-size: 15px;
  color: var(--color-text-secondary);
  max-width: 62ch;
}

/* ============================================================
   DATA QUALITY — the three-stage pipeline strip
   Shares this stylesheet with the drift diagram; both pages
   load it and nothing else does.
   ============================================================ */
.dq-pipe {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: dq;
}
@media (max-width: 860px) { .dq-pipe { grid-template-columns: 1fr; } }

.dq-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 22px 22px 24px;
  background: var(--color-bg-soft);
  border-radius: var(--radius-xl);
}
/* Chevron between stages, pointing the direction the data moves. */
.dq-stage + .dq-stage::before {
  content: "";
  position: absolute;
  left: -13px; top: 50%;
  width: 10px; height: 10px;
  border-top: 2px solid var(--color-teal-500);
  border-right: 2px solid var(--color-teal-500);
  transform: translateY(-50%) rotate(45deg);
}
@media (max-width: 860px) {
  .dq-stage + .dq-stage::before { left: 50%; top: -13px; transform: translateX(-50%) rotate(135deg); }
}
.dq-stage--mid { background: var(--color-teal-50); }

.dq-stage__k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-teal-900);
}
.dq-stage__h { font-size: 17px; font-weight: 700; color: var(--color-text-primary); }
.dq-stage__d { font-size: 14px; color: var(--color-text-secondary); }
.dq-note { color: var(--color-text-tertiary); }
