/* The tools over the review list, as the approved prototype draws them (A2.html .rvbar .rvib .rvbulk .rvchip .btree .bth .bitem
   .eyeb .fixb .plist .pli details.skipd .costline): the bar, the chips, «إجراء جماعي» and the preview of a bulk action. Every
   value is a token (tokens/). The owner's spacing rule: parts a gap apart, a coloured box never touches the text near it, no
   clutter. The prototype's soft brand fill is the brand colour mixed into the surface, so both schemes follow the tokens. */
.pfrag {
  display: contents;
}

.rvbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-row);
  border-bottom: 1px solid var(--app-line);
  background-color: var(--app-surface);
}

/* «إجراء جماعي» and the fix buttons of its sheet: the soft brand button */
.rvbulk,
.fixb {
  min-height: 44px;
  padding-inline: var(--spacing-row);
  border: 1px solid var(--app-btn);
  border-radius: var(--radius-thumb);
  background-color: color-mix(in srgb, var(--app-btn) 14%, var(--app-surface));
  color: var(--app-btn);
  font-family: inherit;
  font-size: var(--font-size-title);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.rvbulk {
  flex: 1;
  min-width: 0;
}

/* the active filters: a chip each, a gap from the bar and from the list */
.rvchips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  padding: var(--spacing-gap) var(--spacing-row) 0;
}

.rvchip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding-inline-start: var(--spacing-row);
  border: 1px solid var(--app-btn);
  border-radius: var(--radius-pill);
  background-color: color-mix(in srgb, var(--app-btn) 14%, var(--app-surface));
  color: var(--app-btn);
  font-size: var(--font-size-meta);
  font-weight: 700;
}

.rvchipx {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-block: calc(-1 * var(--spacing-sm));
  margin-inline-end: calc(-1 * var(--spacing-sm));
  border: 0;
  border-radius: var(--radius-pill);
  background-color: transparent;
  color: inherit;
  cursor: pointer;
}

.rvchipx svg {
  width: 12px;
  height: 12px;
}

/* every drawn icon of the tools: a stroke, round ends */
.rvbar svg,
.selbar svg,
.rtools svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the bottom sheets over the list: the body scrolls and the buttons stay under it (the prototype's sticky .sacts) */
.rsheet.rtools {
  overflow: hidden;
}

.rsheet.rtools > .pbody {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--spacing-gap);
  min-height: 0;
  overflow-y: auto;
}

.rsheet.rtools > [data-part="button"] {
  flex: none;
}

/* a line in these sheets sits in the sheet's own margin, not the screens' window margin */
.rtools .oneline {
  margin: 0;
}

/* «إجراء جماعي»: the folders, the groups and the issues */
.btree {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--radius-lg);
}

.btree > details {
  border-top: 1px solid var(--app-line-strong);
}

.btree > details:first-child {
  border-top: 0;
}

.btree summary {
  list-style: none;
  cursor: pointer;
}

.btree summary::-webkit-details-marker {
  display: none;
}

.bth {
  display: flex;
  align-items: center;
  gap: var(--spacing-row);
  min-height: 56px;
  padding-block: var(--spacing-xs);
  padding-inline: var(--spacing-md) var(--spacing-sm);
  background-color: var(--app-surface);
  color: var(--app-ink);
}

.bth .bt {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-sm);
  font-weight: 800;
}

.bth .chev {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--app-ink-soft);
}

.bth .chev svg {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg); /* the drawn chevron points left; folded, a folder points down, open it points up */
}

details[open] > .bth .chev svg {
  transform: rotate(90deg);
}

.bsub > summary.bth {
  min-height: 48px;
  padding-inline-start: var(--spacing-lg);
  border-top: 1px solid var(--app-line);
  background-color: var(--app-raise);
}

.bitem {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: var(--spacing-gap) var(--spacing-md);
  padding-inline-start: var(--spacing-lg);
  border-top: 1px solid var(--app-line);
  background-color: var(--app-surface);
}

.bitem .bi-t {
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.bitem .bi-d {
  font-size: var(--font-size-meta);
  line-height: 1.5;
  color: var(--app-ink-soft);
}

.bitem .bi-a {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--spacing-sm);
}

.bitem .bi-a:empty {
  display: none;
}

.bhint {
  padding: 0 var(--spacing-md) var(--spacing-gap);
}

.eyeb svg {
  width: 19px;
  height: 19px;
}

.fixb {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* the small count in a pill: on a fix button, and on the bar's filter */
.fixb .fxn,
.rvib .cnt {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: var(--spacing-xs);
  border-radius: var(--radius-pill);
  background-color: var(--app-btn);
  color: var(--app-btn-ink);
  font-size: var(--font-size-badge);
  font-weight: 800;
}

.fixb:disabled,
.eyeb:disabled {
  opacity: 0.4;
  cursor: default;
}

/* the preview: the products as a list a gap below the sentence, the skipped folded, the cost a plain line */
.rtools .plist {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--radius-md);
}

.rtools .pli {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-height: 52px;
  padding: var(--spacing-sm) var(--spacing-row);
  border-top: 1px solid var(--app-line);
}

.rtools .pli:first-child {
  border-top: 0;
}

.rtools .pli .pt {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--spacing-xs);
  min-width: 0;
}

.rtools .pli .pt b {
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.rtools .pli .pt small {
  font-size: var(--font-size-meta);
  line-height: 1.5;
  color: var(--app-ink-soft);
}

.rtools .pli .pt .to {
  color: var(--app-btn);
  font-weight: 700;
}

.rtools details.skipd {
  border: 1px dashed var(--app-line-strong);
  border-radius: var(--radius-lg);
}

.rtools details.skipd > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--spacing-md);
  color: var(--app-ink-soft);
  font-size: var(--font-size-sm);
  font-weight: 700;
  cursor: pointer;
}

.rtools details.skipd .plist {
  border: 0;
  border-top: 1px dashed var(--app-line-strong);
  border-radius: 0;
}

.rtools .costline {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--app-ink-soft);
}

/* a parameter of an action (the point to return to and its reason): the form's own look, a gap apart */
.rtools .pform {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-gap);
}

.rtools .field > textarea {
  min-height: 96px;
  padding-block: var(--spacing-sm);
  resize: vertical;
}

/* the selection bar takes the place of the bar over the list and stays at the top (the prototype's .selbar) */
.selbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-height: 60px;
  padding: var(--spacing-sm) var(--spacing-row);
  background-color: color-mix(in srgb, var(--app-btn) 18%, var(--app-surface));
  color: var(--app-ink);
}

.selbar b {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-body);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.selbar b .lbar {
  width: 50%;
}

.selbar .sbx {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--app-ink) 30%, transparent);
  border-radius: var(--radius-thumb);
  background-color: transparent;
  color: inherit;
  cursor: pointer;
}

.selbar .sbx svg {
  width: 18px;
  height: 18px;
}

.selbar [data-part="more"] svg {
  stroke-width: 3.5; /* the three dots are points: a round stroke wide enough to read as dots */
}

/* the primary action is the shared .mbtn (styles/sheet.css) at the bar's size */
.selbar .sbp {
  width: auto;
  min-height: 44px;
  padding-inline: var(--spacing-md);
  white-space: nowrap;
}

/* the box that ticks every product of the view: empty, partly ticked (a dash) or all */
.selbar .sball {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--app-ink) 55%, transparent);
  border-radius: var(--radius-md);
  background-color: transparent;
  color: inherit;
  cursor: pointer;
}

.selbar .sball.on {
  border-color: var(--app-btn);
  background-color: var(--app-btn);
  color: var(--app-btn-ink);
}

.selbar .sball i {
  display: block;
  width: 12px;
  height: 2px;
  border-radius: var(--radius-sm);
  background-color: currentColor;
  opacity: 0.8;
}

.selbar .sball svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}

/* ⋯: the actions on the ticked products by group, each with how many it applies to, under the bar */
.pmenu {
  position: sticky;
  inset-block-start: 60px;
  z-index: 8;
  margin: var(--spacing-sm) var(--spacing-row) 0;
  overflow: hidden;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--radius-lg);
  background-color: var(--app-surface);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--app-ink) 18%, transparent);
}

.pmenu .pmh {
  padding: var(--spacing-gap) var(--spacing-md) var(--spacing-xs);
  font-size: var(--font-size-meta);
  font-weight: 800;
  color: var(--app-muted);
}

/* a row that is a button (⋯'s actions, the filter's choices): bare, a line of text with its count or box at the end */
.pmenu button,
.rtools .flr > .flp {
  display: flex;
  align-items: center;
  gap: var(--spacing-gap);
  min-width: 0;
  padding-inline: var(--spacing-md);
  border: 0;
  background-color: transparent;
  color: var(--app-ink);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}

.pmenu button {
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  border-top: 1px solid var(--app-line);
}

.pmenu .pmh + button {
  border-top: 0;
}

.pmenu button .n {
  font-size: var(--font-size-meta);
  color: var(--app-ink-soft);
  white-space: nowrap;
}

.pmenu button.danger {
  color: var(--app-danger);
}

/* «فلترة المراجعة» and the page size: folded sections of tick rows (the prototype's .fsec .fl .flr .flp .fck .unf .flsub) */
.rtools [aria-busy="true"] {
  opacity: 0.6;
}

.rtools details.fsec > summary {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-height: 44px;
  font-size: var(--font-size-sm);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.rtools details.fsec > summary::-webkit-details-marker {
  display: none;
}

.rtools details.fsec > summary .ft {
  flex: none;
}

.rtools details.fsec > summary .fv {
  flex: 1;
  min-width: 0;
  margin-inline-start: var(--spacing-sm);
  font-size: var(--font-size-meta);
  font-weight: 700;
  color: var(--app-ink-soft);
  text-align: end;
}

.rtools details.fsec > summary .chev {
  display: grid;
  flex: none;
  place-items: center;
  color: var(--app-ink-soft);
}

.rtools details.fsec > summary .chev svg {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}

.rtools details.fsec[open] > summary {
  margin-bottom: var(--spacing-gap);
  border-bottom: 1px solid var(--app-line-strong);
}

.rtools details.fsec[open] > summary .chev svg {
  transform: rotate(90deg);
}

.rtools details.fsec + details.fsec {
  margin-top: var(--spacing-gap);
  border-top: 1px solid var(--app-line-strong);
}

.rtools .fl {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--radius-thumb);
}

.rtools .flr {
  display: flex;
  align-items: center;
  min-height: 48px;
  border-top: 1px solid var(--app-line);
  background-color: var(--app-surface);
}

.rtools .flr:first-child {
  border-top: 0;
}

.rtools .flr > .flp {
  flex: 1;
  min-height: 48px;
  padding-inline-end: var(--spacing-sm);
}

.rtools .fck {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--app-line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--app-surface);
}

.rtools .fck.on {
  border-color: var(--app-btn);
  background-color: var(--app-btn);
  color: var(--app-btn-ink);
}

.rtools .fck.part {
  border-color: var(--app-btn);
}

.rtools .fck svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.rtools .fck.part i {
  display: block;
  width: 10px;
  height: 2px;
  border-radius: var(--radius-sm);
  background-color: var(--app-btn);
}

.rtools .unf {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-inline-start: 1px solid var(--app-line);
  background-color: transparent;
  color: var(--app-ink-soft);
  cursor: pointer;
}

.rtools .unf svg {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}

.rtools .unf.on svg {
  transform: rotate(90deg);
}

.rtools .flsub,
.rtools .flsub .flr {
  background-color: var(--app-raise);
}

.rtools .flsub .flr > .flp {
  padding-inline-start: var(--spacing-xl);
  font-weight: 600;
}

/* the bar's other controls: the filter with its count, the page size, the fold control (the prototype's .rvib) */
.rvib,
.eyeb {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--radius-thumb);
  background-color: var(--app-surface);
  color: var(--app-ink-soft);
  font-family: inherit;
  cursor: pointer;
}

.rvib svg {
  width: 20px;
  height: 20px;
}

.rvib.on {
  border-color: var(--app-btn);
  background-color: color-mix(in srgb, var(--app-btn) 14%, var(--app-surface));
  color: var(--app-btn);
}

.rvib .cnt {
  position: absolute;
  inset-block-start: calc(-1 * var(--spacing-xs) - 2px);
  inset-inline-end: calc(-1 * var(--spacing-xs) - 2px);
  font-variant-numeric: tabular-nums;
}

.rvib .pg {
  font-size: var(--font-size-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* «لا منتجات بهذا الفلتر»: the line, the filters named, and the way back, a gap apart */
.rvempty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-gap);
  padding: var(--spacing-xl) var(--spacing-window);
  border-block: 1px solid var(--app-line-strong);
  background-color: var(--app-surface);
  color: var(--app-ink);
  text-align: center;
}

.rvempty .rvei {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background-color: var(--app-raise);
  color: var(--app-muted);
}

.rvempty .rvei svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.rvempty b {
  font-size: var(--font-size-body);
  font-weight: 800;
}

.rvempty .rves {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  color: var(--app-muted);
}

.rvempty .mbtn {
  width: auto;
  margin-top: var(--spacing-sm);
  padding-inline: var(--spacing-window);
}

/* ↑: after one screen of scrolling, at the foot of the screen */
.totop {
  position: fixed;
  inset-inline-start: var(--spacing-md);
  inset-block-end: var(--spacing-xl);
  z-index: 9;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--app-line-strong);
  border-radius: var(--radius-pill);
  background-color: var(--app-surface);
  color: var(--app-ink);
  box-shadow: 0 4px 8px color-mix(in srgb, var(--app-ink) 25%, transparent);
  cursor: pointer;
}

.totop[hidden] {
  display: none;
}

.totop svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
