/* wizard: the Configure wizard at /reports/:id/new (mockups 20–23, 60–65). Page layout only; components are
   Proto.ui's (the product tree is ui.checkboxTree, the week fields ui.weekPicker). */
.wz { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.wz .page-header { margin-bottom: 0; }
.wz-loading { display: grid; gap: 1rem; }
.wz .page-header h1 small { font-size: var(--text-sm); font-weight: 400; color: var(--muted-foreground); letter-spacing: 0; }
.wz h2 { margin-bottom: 0.5rem; }
.wz-count { margin-inline-start: auto; color: var(--muted-foreground); font-size: var(--text-label); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wz-hint { color: var(--muted-foreground); font-size: var(--text-label); }
.wz-step { display: grid; gap: 0.75rem; }
.wz-error-text { display: block; color: var(--destructive-text); font-size: var(--text-label); }
.wz-choices { display: grid; gap: 0.5rem; }
.wz .choice-card aside small { display: block; color: var(--muted-foreground); font-size: var(--text-label); }
/* A badge ("Default for this focus") goes under a title that leaves it no room in a narrow card. */
.wz .choice-card h3 { flex-wrap: wrap; }
.wz-columns { display: grid; grid-template-columns: minmax(0, 1fr) 27rem; gap: 1rem; align-items: start; }
.wz-columns > section { display: grid; gap: 0.75rem; min-width: 0; }
.wz-columns h2 { margin-bottom: -0.25rem; }

/* CFG-01: in a narrow main column the step's mark goes above its name, to leave the summary (shown whole by the
   stepper) the step's full width. */
@container main (width < 56rem) {
  .wz .stepper li { flex-direction: column; gap: 0.375rem; padding: 0.625rem 0.75rem; }
}

/* footer */
.wz-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.wz-footer-end { margin-inline-start: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.625rem; }
.wz-reason { display: inline-flex; align-items: center; gap: 0.375rem; margin-inline-end: 0.375rem; }
.wz-reason[data-error] { color: var(--destructive-text); }

/* Products: the picker (role switch, search, tree) beside the role cards */
.wz-products { display: grid; grid-template-columns: minmax(0, 1fr) 26rem; gap: 1rem; align-items: start; }
@container main (width < 56rem) { .wz-products { grid-template-columns: minmax(0, 1fr); } }
.wz-picker { border: 1px solid var(--border); border-radius: var(--radius-lg); min-width: 0; background: var(--card); }
.wz-picker-searching { min-height: 46rem; }
.wz-picker-head { display: grid; gap: 0.625rem; padding: 0.75rem; border-bottom: 1px solid var(--border); }
.wz-role-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; font-weight: 600; font-size: var(--text-label); }
.wz-adding-to { font-weight: 600; font-size: var(--text-label); }
.wz-search { display: block; }
.wz-search > [data-popover] { width: 100%; max-height: 38rem; padding: 0.25rem 0; gap: 0; }
.wz-results-head { display: flex; justify-content: space-between; gap: 1rem; padding: 0.375rem 0.75rem; color: var(--muted-foreground); font-size: var(--text-label); }
.wz-results-section { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem 0.25rem; border-top: 1px solid var(--border); }
.wz-results-section h3 { font-size: var(--text-label); font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.05em; }
.wz-result { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.375rem 0.75rem; }
.wz-result:hover, .wz-result:focus-within { background: var(--accent); }
.wz-result-marks { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.wz-result[data-conflict] { background: var(--destructive-surface); }
.wz-tree-head { display: flex; justify-content: space-between; padding: 0.375rem 0.875rem 0.375rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--muted-foreground); font-size: var(--text-label); font-weight: 600; }

/* role cards */
.wz-roles { display: grid; gap: 0.75rem; min-width: 0; }
.wz-role > section { display: grid; gap: 0.5rem; }
.wz-role-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.wz-role-total { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wz-role .card-action { display: flex; align-items: center; gap: 0.25rem; }
.wz-role .item > aside { gap: 0.5rem; }
/* CFG-07: an item's place in the hierarchy is shown whole, not clamped to two lines */
.wz-role .item p { display: block; overflow: visible; }
.wz-item-conflict { border-color: var(--destructive); background: var(--destructive-surface); }
.wz-hint-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.625rem; }
.wz-hint-row .wz-hint { flex: 1 1 12rem; }
.wz-add-group { display: flex; align-items: center; gap: 0.75rem; }

/* Stores */
.wz-facets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; align-items: start; }
.wz-facet { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.625rem 0.75rem; min-width: 0; background: var(--card); }
.wz-facet legend { float: left; width: 100%; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.25rem; font-weight: 600; }
.wz-facet legend small { font-weight: 400; color: var(--muted-foreground); font-size: var(--text-label); }
.wz-facet legend + * { clear: left; }
.wz-facet-value { display: flex; align-items: center; gap: 0.5rem; min-height: 1.75rem; }
.wz-facet-value[data-empty] label { color: var(--muted-foreground); }
.wz-mix-line { display: block; }
.wz-store-count { display: flex; align-items: center; justify-content: space-between; color: var(--muted-foreground); font-size: var(--text-label); }
.wz-store-list, .wz-scroll { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); max-height: 32rem; overflow-y: auto; }
.wz-store-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; padding: 0.375rem 0.75rem; background: var(--card); border-bottom: 1px solid var(--border); color: var(--muted-foreground); font-size: var(--text-label); font-weight: 600; }
.wz-store-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3125rem 0.75rem; border-bottom: 1px solid var(--border); }
.wz-store-row:last-child { border-bottom: 0; }
.wz-store-row > .text-muted-foreground { margin-inline-start: auto; white-space: nowrap; }

/* Time period: the Custom card holds the week fields, so it is a card around a choice card */
.wz-custom { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
.wz-custom[data-checked] { border-color: var(--selected-border); background: var(--selected); }
.wz-custom > .choice-card { border: 0; background: transparent; }
.wz-custom-body { display: grid; gap: 0.5rem; padding: 0 0.875rem 0.75rem 2.5rem; }
.wz-week-fields { display: flex; flex-wrap: wrap; gap: 0.875rem; }
.wz-notes { display: grid; gap: 0.375rem; margin-top: 0.625rem; font-size: var(--text-label); }
.wz-notes .lucide { color: var(--warning); }

/* Options */
.wz-options { display: grid; gap: 0.875rem; }
.wz-option-grid { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: 0.5rem; }
@container main (width < 56rem) { .wz-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wz-options .card > section { display: grid; gap: 0.5rem; }
.wz-number { display: flex; align-items: center; gap: 0.625rem; }
.wz-number .input { width: 8.75rem; font-variant-numeric: tabular-nums; }

/* Review */
.wz-run-name .input { width: 100%; }
#wz-review th[scope="row"] { width: 12rem; color: var(--muted-foreground); font-size: var(--text-label); font-weight: 600; vertical-align: top; }
#wz-review td { white-space: normal; vertical-align: top; }
#wz-review td.wz-edit { width: 5rem; text-align: end; padding-block: 0; }
#wz-review .wz-review-section th { background: var(--muted); color: var(--foreground); font-size: var(--text-label); text-transform: uppercase; letter-spacing: 0.04em; height: auto; }
#wz-review tr[data-conflict] > * { background: var(--destructive-surface); }
#wz-review tr[data-conflict] th { color: var(--destructive-text); }
#wz-warnings { display: grid; gap: 0.75rem; }
/* The check area takes the focus while it holds no control (after Try again). */
#wz-check:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-lg); }
.wz-step > .table-container { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }

/* Narrow main column (QUA-03): side columns stack. Last, so it overrides the column rules above. */
@container main (width < 56rem) { .wz-columns { grid-template-columns: minmax(0, 1fr); } }
@container main (width < 36rem) { .wz-facets { grid-template-columns: minmax(0, 1fr); } }
