/* TL-12 declutter sorter. Loaded only where [wt_tool id="declutter-sorter"] renders.
 * Isolation contract (wt-tools.css): every selector starts .wt-, no Bootstrap names, no !important. */

.wt-dc-add { margin: 18px 0 0; display: flex; flex-direction: column; gap: 6px; }
.wt-dc-matches { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wt-dc-match {
  min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--wg-blue); border-radius: var(--wg-radius-s);
  background: #fff; color: var(--wg-blue); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; text-align: left;
}
.wt-dc-match:hover { background: var(--wg-blue); color: #fff; }
.wt-dc-summary-link { display: flex; align-items: center; min-height: 44px; color: var(--wg-blue); font-weight: 600; cursor: pointer; }
.wt-dc-custom, .wt-dc-settings { margin: 6px 0 0; }
.wt-dc-threshold { max-width: 340px; }
/* r2 Minor 8: the size select needs the room to show its whole option (it truncated to "Bulky (a chair, a b" in the
 * three-column row): the name takes its own line, then size and a two-digit quantity side by side. */
@media (min-width: 620px) {
  .wt-dc .wt-dc-crow { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
  .wt-dc .wt-dc-crow > .wt-field:first-child { grid-column: 1 / -1; }
  /* Same for the top row: "Whichever is cheaper" was cut to "Whichever is chec" at 1024-1440. Site on its own line
   * (with the remembered-store offer under it), then floor and weeks. */
  .wt-dc .wt-dc-toprow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
  .wt-dc .wt-dc-toprow > .wt-field:first-child { grid-column: 1 / -1; }
}
/* Rule 14: "Show prices for {store}" for a remembered store; shown or left hidden before first paint, never by the module. */
.wt-dc-remember { margin: 6px 0 0; }
.wt-dc-remember .wg-arrowlink { display: inline-flex; align-items: center; min-height: 44px; }

.wt-dc-cards { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.wt-dc-card { border: 1px solid var(--wg-line); border-radius: var(--wg-radius-s); background: #fff; scroll-margin-bottom: 90px; }
.wt-dc-sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 14px; cursor: pointer; list-style: none; }
.wt-dc-sum::-webkit-details-marker { display: none; }
.wt-dc-sum::after { content: "▾"; color: var(--wg-mute); }
.wt-dc-det:not([open]) .wt-dc-sum::after { content: "▸"; }
.wt-dc-name { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.wt-dc-verdict { flex: 0 0 auto; padding: 2px 10px; border-radius: 999px; background: var(--wg-grey); font-size: 13.5px; font-weight: 600; }
.wt-dc-verdict[data-list="keep"] { background: #E6F4F1; color: var(--wg-teal-d); }
.wt-dc-verdict[data-list="store"] { background: var(--wg-band); color: var(--wg-blue); }
.wt-dc-verdict[data-list="sell"], .wt-dc-verdict[data-list="give"] { background: var(--wg-amber); color: var(--wg-ink); }
/* r2 Major 3: #C53326 on #FBE4E0 was 4.45:1 (WCAG 1.4.3 needs 4.5:1); #B42E22 is 5.15:1. */
.wt-dc-verdict[data-list="cannot"] { background: #FBE4E0; color: #B42E22; }
.wt-dc-body { padding: 4px 14px 14px; border-top: 1px solid var(--wg-line); }
.wt-dc-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-top: 10px; }
@media (min-width: 620px) { .wt-dc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wt-dc-grid .wt-error:empty { display: none; }
.wt-dc-check { justify-content: flex-end; }
.wt-dc-checkl { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 500; cursor: pointer; }
.wt-dc-checkl input { width: 22px; height: 22px; flex: 0 0 auto; }
.wt-dc-override { margin: 14px 0 0; }
.wt-dc-override .wt-label { display: block; margin: 0 0 6px; }
.wt-dc-ovb { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.wt-dc-ov {
  min-height: 44px; padding: 6px 4px; border: 1.5px solid var(--wg-line); border-radius: var(--wg-radius-s);
  background: #fff; color: var(--wg-blue); font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer;
}
.wt-dc-ov[aria-pressed="true"] { background: var(--wg-blue); border-color: var(--wg-blue); color: #fff; }
.wt-dc-cardact { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 10px 0 0; }
.wt-dc-rm { color: var(--wg-coral-text); }

/* result */
.wt-dc-counts { margin: 0 0 12px; font-size: 17px; font-weight: 600; color: var(--wg-ink); }
.wt-dc-box { margin: 0 0 14px; padding: 14px; border-radius: var(--wg-radius-s); background: var(--wg-band); }
.wt-dc-box p { margin: 0 0 8px; }
.wt-dc-boxh { font-weight: 600; color: var(--wg-blue); }
.wt-dc-cost { font-size: 18px; font-weight: 600; }
.wt-dc-bills { margin: 0 0 8px; }
.wt-dc-bills summary { min-height: 44px; display: flex; align-items: center; color: var(--wg-blue); font-weight: 600; cursor: pointer; }
.wt-dc-billl { margin: 0 0 6px; padding-left: 1.2em; font-size: 14px; }
.wt-dc-terms { margin: 8px 0 0; padding-left: 1.1em; color: var(--wg-mute); font-size: 13.5px; }
.wt-dc-list { margin: 0 0 14px; }
.wt-dc-listh { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--wg-blue); font-size: 17px; font-weight: 600; }
.wt-dc-n { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; background: var(--wg-grey); color: var(--wg-ink); font-size: 13px; }
.wt-dc-rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--wg-line); }
.wt-dc-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--wg-line); }
.wt-dc-rowname { font-weight: 600; overflow-wrap: anywhere; }
.wt-dc-reason { font-size: 14.5px; }
.wt-dc-note { color: var(--wg-mute); font-size: 13.5px; }
.wt-dc-routes { margin: 8px 0 0; padding-left: 1.1em; font-size: 14px; }
.wt-dc-routes li { margin: 0 0 4px; }
.wt-tag.wt-tag--you { background: var(--wg-blue); }
.wt-dc-rubric th[scope="row"] { font-weight: 500; }

@media (prefers-reduced-motion: no-preference) { .wt-dc-verdict { transition: background-color .15s ease; } }

/* r1 Minor 8: the theme's fixed header (#headernav) is 136 px tall once scrolled at 1000-1440 px, and the shared
 * .wt-result top of 96 px slid "Your lists" under it. Sit 16 px below it, and keep the whole panel reachable when it is
 * taller than the viewport by letting it scroll inside itself. */
@media (min-width: 1000px) {
  .wt-tool--declutter-sorter .wt-result { top: 152px; max-height: calc(100vh - 168px); overflow-y: auto; overscroll-behavior: contain; }
}

/* Returning visitor (rule 13): shown before first paint by the inline script, never inserted later. */
.wt-dc-back { margin: 0 0 14px; }
.wt-dc-back .wt-line { margin: 0 0 8px; }
.wt-dc-back .wt-actions { margin: 0; }

/* r3: the category select's long hint sits under it; keep it compact. */
.wt-dc-grid .wt-field:has([data-q="category"]) .wt-hint { font-size: 13px; }
@media (min-width: 620px) { .wt-dc-grid .wt-field:has([data-q="category"]) { grid-column: 1 / -1; } }

/* ---------- UX round (UX-STANDARD.md, reviews/ux/tl12-ux.md) ---------- */
/* "Add something" first; the store block below the cards, shown once something is on the Store list. */
.wt-dc-add { margin-top: 4px; }
.wt-dc-where { margin: 18px 0 0; padding: 14px; border: 1px solid var(--wg-line); border-radius: var(--wg-radius-s); background: var(--wg-band); }
.wt-dc-whereh { margin: 0 0 2px; color: var(--wg-blue); font-size: 17px; font-weight: 600; }
.wt-dc-where > .wt-hint { margin: 0 0 10px; }
.wt-dc-where .wt-error:empty { display: none; }
.wt-dc-toprow .wt-field > .wt-hint { margin: 4px 0 0; }
/* Search: a can't-store line, then matches */
.wt-dc-cant { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--wg-radius-s); background: #FBE4E0; }
.wt-dc-cantl { color: #B42E22; font-weight: 600; }
.wt-dc-cant .wt-dc-match { align-self: flex-start; }
.wt-dc-match:focus-visible { background: var(--wg-blue); color: #fff; }
.wt-dc-nomatch { flex: 1 1 100%; margin: 0; }
.wt-dc-cform { margin: 0; }
/* Card: "Same answers" first and full width; three questions; the rest behind "More detail" */
.wt-dc-same { width: 100%; margin: 10px 0 0; justify-content: center; }
.wt-dc-more { margin: 12px 0 0; border-top: 1px dashed var(--wg-line); }
.wt-dc-more > summary, .wt-dc-what > summary { display: flex; align-items: center; min-height: 44px; color: var(--wg-blue); font-weight: 600; cursor: pointer; }
.wt-dc-what { margin: 2px 0 0; }
.wt-dc-what > summary { font-size: 14.5px; font-weight: 500; }
.wt-dc-what .wt-hint { font-size: 13px; margin: 0 0 4px; }
@media (min-width: 620px) { .wt-dc-grid .wt-dc-catf { grid-column: 1 / -1; } }
/* Pills: not sorted yet (outline), first guess (dashed, with "?") */
.wt-dc-verdict[data-list="unsorted"] { background: #fff; color: var(--wg-mute); border: 1px solid var(--wg-line); font-weight: 500; }
.wt-dc-verdict[data-guess] { background: #fff; border: 1.5px dashed currentColor; }
/* Result */
.wt-dc-unsorted { margin: 0 0 12px; color: var(--wg-ink); font-size: 15px; }
.wt-dc-fig { margin: 0 0 6px; }
.wt-dc-acts { margin: 10px 0 4px; }
.wt-dc-next { margin: 6px 0 4px; }
.wt-dc-next .wg-arrowlink, .wt-dc-pick { display: inline-flex; align-items: center; min-height: 44px; }
.wt-dc-undo { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-weight: 600; }
