/* ==========================================================================
   Data cleaning page (data-cleaning.html). Loaded after site.css.
   Role tokens from site.css only. Strip colours keep their meaning:
   red = needs you, yellow = medium, grey = low or done, mint = your yes.
   ========================================================================== */

:root {
  /* the ranked rows on the hero strip: a mini tile, strip and fold */
  --dc-rank-strip: 10px;
  --dc-rank-fold: 4px;
}

/* ---------- 1. Hero: one tile, then the rest of the inbox ranked by € ---------- */
@media (min-width: 1040px) {
  .slab--clean { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
}
.dc-inbox { display: grid; gap: 10px; }
.dc-station .tile { min-height: 150px; }
.dc-ranks { display: grid; gap: 8px; margin: 0; }
:where(.dc-rank) {
  --strip: var(--prio-low-strip);
  --fold: var(--prio-low-fold);
  --p-text: var(--prio-low-text);
}
.dc-rank {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px calc(var(--dc-rank-strip) + 12px) 9px 12px;
  border-radius: 10px;
  background: var(--tile-face);
  color: var(--text-primary);
  box-shadow: inset calc(var(--dc-rank-strip) * -1) 0 0 var(--strip), inset calc((var(--dc-rank-strip) + var(--dc-rank-fold)) * -1) 0 0 var(--fold);
}
.dc-rank__n {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 750;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.dc-rank__what { display: grid; min-width: 0; line-height: 1.2; }
.dc-rank__fig { font-size: 0.875rem; font-weight: 500; }
.dc-rank__fig b {
  margin-right: 4px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  font-stretch: 110%;
  letter-spacing: -0.03em;
  color: var(--p-text);
  font-variant-numeric: tabular-nums;
}
.dc-rank__cat { overflow: hidden; font-size: 0.8125rem; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 3. What it checks: five tiles, the fill rate one wide ---------- */
.dc-checks { display: grid; gap: 24px 28px; grid-template-columns: minmax(0, 1fr); }
.dc-checks > li { display: grid; }
@media (min-width: 720px) {
  .dc-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dc-checks__wide { grid-column: 1 / -1; }
}
@media (min-width: 1120px) {
  .dc-checks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dc-checks__wide { grid-column: span 2; }
}
.dc-check .tile__card { gap: 12px; }
.dc-check__title {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 1.875rem);
  line-height: 1.05;
  font-weight: 800;
  font-stretch: 104%;
  letter-spacing: -0.025em;
}
.dc-check__rule { max-width: 44ch; font-size: 1.0625rem; line-height: 1.45; }
.dc-check__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.dc-check__foot .icon { color: var(--text-primary); }
.dc-check__eg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.9375rem;
}
.dc-check__eg-k { font-size: 0.8125rem; font-weight: 650; color: var(--text-secondary); }
.dc-check__eg strong { color: var(--prio-high-text); font-weight: 750; }

/* ---------- 4. Fill rate in three steps, then the build flow ---------- */
.dc-fill { display: grid; gap: 10px; margin: 8px 0 0; }
.dc-fill__bar { display: block; width: 100%; height: 14px; overflow: visible; }
.dc-fill__done { fill: var(--brand-solid); }
.dc-fill__gap { fill: var(--surface-card); stroke: var(--prio-high-strip); stroke-width: 1.5; stroke-dasharray: 3 2; }
.dc-fill__key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.875rem; color: var(--text-secondary); }
.dc-fill__key span { display: inline-flex; align-items: center; gap: 8px; }
.dc-key { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.dc-key--done { background: var(--brand-solid); }
.dc-key--gap { background: var(--surface-card); border: 1.5px dashed var(--prio-high-strip); }
.dc-build { display: grid; gap: 14px; margin-top: clamp(36px, 5vw, 56px); }
.dc-build__h { max-width: 62ch; color: var(--text-secondary); }
.dc-build__h strong { color: var(--text-primary); }

/* ---------- shared by the three page mocks ---------- */
.dc-merge .frame__body,
.dc-notify .frame__body,
.dc-lesson .frame__body,
.dc-report .frame__body { display: grid; gap: 16px; padding-bottom: 20px; }
.dc-merge .frame__meta,
.dc-notify .frame__meta,
.dc-lesson .frame__meta,
.dc-report .frame__meta { margin-bottom: 0; }

/* ---------- 6. Guided merges ---------- */
.dc-pair { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); align-items: center; gap: 8px; }
.dc-rec {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-tile);
  background: var(--surface-card);
}
.dc-rec strong { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 750; letter-spacing: -0.01em; line-height: 1.2; }
.dc-rec span { font-size: 0.875rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.dc-rec .dc-rec__k { font-size: 0.75rem; font-weight: 700; color: var(--text-primary); }
.dc-rec .dc-rec__meta { margin-top: 4px; font-size: 0.8125rem; }
.dc-pair__join {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--chip-surface);
  color: var(--chip-text);
}
.dc-pair__join .icon { width: 18px; height: 18px; }
@media (max-width: 479px) {
  .dc-pair { grid-template-columns: minmax(0, 1fr); }
  .dc-pair__join { justify-self: center; transform: rotate(90deg); }
}
.dc-keep { display: grid; }
.dc-keep__h { padding-bottom: 6px; font-family: var(--font-display); font-size: 0.9375rem; font-weight: 750; }
.dc-keep__row {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.9375rem;
}
.dc-keep__row legend, .dc-keep__k {
  float: left;
  width: 9.5rem;
  padding: 8px 12px 0 0;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--text-secondary);
}
.dc-keep__row--fixed { display: flex; flex-wrap: wrap; align-items: baseline; }
.dc-keep__row--fixed .dc-keep__k { float: none; padding-top: 0; }
.dc-keep__row--fixed span:last-child { flex: 1 1 12rem; font-weight: 600; }
.dc-keep__row small { margin-left: 6px; font-size: 0.8125rem; font-weight: 400; color: var(--text-secondary); }
.dc-keep .pick__chips { gap: 6px; }
.dc-keep .vpick span { min-height: 34px; padding: 4px 12px; font-size: 0.875rem; overflow-wrap: anywhere; }
@media (max-width: 559px) {
  .dc-keep__row legend { float: none; width: auto; padding: 0 0 8px; }
  .dc-keep__row--fixed .dc-keep__k { flex-basis: 100%; padding-bottom: 2px; }
}
.dc-log { margin: 0; }
.dc-log[hidden] { display: none; }

/* ---------- 7. Notify the owner ---------- */
.dc-only { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.dc-only li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 9px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--text-secondary);
}
.dc-only .icon { width: 16px; height: 16px; }
.dc-only .dc-only__yes { border-style: solid; border-color: var(--text-yes); color: var(--text-yes); font-weight: 650; }
.dc-notify .tile--row { box-shadow: none; }
.dc-task {
  --strip-w: 12px;
  display: grid;
  gap: 14px;
  padding: 16px calc(var(--strip-w) + 22px) 16px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-tile);
  background: var(--surface-card);
  box-shadow: inset calc(var(--strip-w) * -1) 0 0 var(--yes-strip), inset calc(var(--strip-w) * -1 - 4px) 0 0 var(--yes-fold);
}
.dc-task:focus-visible { outline-offset: 3px; }
.dc-task__head { display: flex; align-items: flex-start; gap: 12px; }
.dc-task__head > div { display: grid; gap: 2px; min-width: 0; }
.dc-task__chip {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--yes-solid);
  color: var(--text-on-yes);
}
.dc-task__chip .icon { width: 18px; height: 18px; }
.dc-task__k { font-size: 0.8125rem; font-weight: 650; color: var(--text-yes); }
.dc-task__head strong { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 750; letter-spacing: -0.01em; line-height: 1.25; }
.dc-task__meta { display: grid; gap: 6px; margin: 0; font-size: 0.875rem; }
.dc-task__meta div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 10px; }
.dc-task__meta dt { color: var(--text-secondary); }
.dc-task__meta dd { margin: 0; font-weight: 600; }

/* ---------- 8. Learning loop and reports ---------- */
.dc-twin { display: grid; gap: 48px; }
@media (min-width: 1024px) { .dc-twin { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; } }
.dc-twin__col { display: grid; gap: 18px; align-content: start; min-width: 0; }
.dc-twin__text { display: grid; gap: 4px; }
.dc-twin__h { font-family: var(--font-display); font-size: 1.375rem; font-weight: 800; font-stretch: 104%; letter-spacing: -0.02em; line-height: 1.15; }
.dc-twin__text p { font-size: 1rem; color: var(--text-secondary); }

.dc-diff { display: grid; gap: 6px; }
.dc-diff p {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-card);
  font-size: 0.9375rem;
}
.dc-diff__k { flex: none; width: 3.25rem; font-size: 0.8125rem; font-weight: 700; color: var(--text-secondary); }
.dc-diff__old { color: var(--text-secondary); }
.dc-diff__new {
  border-color: color-mix(in srgb, var(--prio-medium-strip) 55%, var(--surface-card));
  background: color-mix(in srgb, var(--prio-medium-strip) 12%, var(--surface-card));
  font-weight: 600;
  transition: background-color var(--dur-base) var(--ease-ui), border-color var(--dur-base) var(--ease-ui);
}
.dc-lesson.is-applied .dc-diff__new { border-color: var(--border-subtle); background: var(--surface-card); }
.dc-lesson.is-applied .dc-diff__old { text-decoration: line-through; }
.dc-test {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-card);
  font-size: 0.9375rem;
}
.dc-test strong { font-weight: 700; }
.dc-test__out { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 650; color: var(--text-yes); }

.dc-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.875rem; color: var(--text-secondary); }
.dc-legend span { display: inline-flex; align-items: center; gap: 8px; }
.dc-legend__sw { width: 14px; height: 10px; overflow: visible; }
.dc-trend { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.dc-trend th, .dc-trend td { padding: 9px 0; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: middle; }
.dc-trend thead th { padding-top: 0; font-size: 0.8125rem; font-weight: 650; color: var(--text-secondary); border-bottom-color: var(--border-strong); }
.dc-trend tbody th { width: 38%; padding-right: 12px; font-weight: 600; }
.dc-trend td { width: 31%; }
.dc-trend td + td { padding-left: 16px; }
.dc-trend tfoot th, .dc-trend tfoot td { border-bottom: 0; font-weight: 750; }
.dc-trend tfoot td { padding-left: 0; }
.dc-trend tfoot td + td { padding-left: 16px; }
.dc-cell { display: grid; grid-template-columns: minmax(0, 1fr) 2.25ch; align-items: center; gap: 8px; }
.dc-cell .tnum { text-align: right; font-weight: 650; }
.dc-bar { display: block; width: 100%; height: 10px; overflow: visible; }
.dc-bar--new { fill: var(--brand-solid); }
.dc-bar--done { fill: url(#icp-hatch); stroke: var(--brand-solid); stroke-width: 1; }
@media (max-width: 479px) {
  .dc-trend { font-size: 0.875rem; }
  .dc-trend tbody th { width: 34%; }
  .dc-trend td + td, .dc-trend tfoot td + td { padding-left: 10px; }
}
.dc-report__sum { font-size: 0.9375rem; font-weight: 600; }

#learning .frame-note { margin-top: 20px; }

/* ---------- motion: the hero rows slide in from the strip in rank order;
   a created task rises once. Static under reduced motion. ---------- */
@media (prefers-reduced-motion: no-preference) {
  .dc-rank.load { animation-name: from-strip; }
  .load[data-d="8"] { animation-delay: 600ms; }
  .load[data-d="9"] { animation-delay: 680ms; }
  .dc-task:not([hidden]), .dc-log:not([hidden]) > li, #dc-merge-audit:not([hidden]) {
    animation: rise var(--dur-reveal) var(--ease-enter) both;
  }
}
