/* Polishing and polisher pay: the open run, inspection per polisher, owed rework, the operations library and the pay-mode choices.
   The older pol-* rules (team cards, lists, week grid) stay in app.css; the part's traveler builder is in traveler.css. */

/* The pieces line of a step: the segmented bar and its words side by side, wrapping under each other on a phone. */
.pol-qty { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; font-size: 12px; line-height: 1.35; color: var(--text-2); margin-bottom: 2px; }
.pol-qty .qbar { width: 180px; flex: none; }
.pol-up { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }

/* The caller's open run (and an inspector's claim): a tinted panel that stands out from the step's facts above it. */
.pol-run { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--primary); border-left-width: 3px; border-radius: var(--radius); background: var(--primary-soft); }
.pol-run-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; margin-bottom: 10px; } .pol-run-head .muted { font-size: 13px; }
.pol-run > .pol-run-head:last-child { margin-bottom: 0; }
.pol-run .form-grid { margin-top: 4px; }

/* Inspection: one block per polisher whose pieces wait, each with passed pieces and its reject lines. */
.pol-src { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px 12px; margin: 0 0 12px; min-width: 0; background: var(--surface); }
.pol-src legend { padding: 0 6px; margin-left: -6px; font-size: 14px; } .pol-src legend .muted { font-size: 13px; font-weight: 400; }
.pol-rej-rows { display: grid; gap: 6px; margin-top: 8px; } .pol-rej-rows:empty { display: none; }
.pol-rej { display: flex; gap: 6px; align-items: center; min-width: 0; } .pol-rej input[data-qty] { width: 84px; } .pol-rej select[data-disp] { flex: 0 1 170px; min-width: 0; }

/* Pay mode choices (person options): one radio per mode with what it means. */
.pol-modes { display: grid; gap: 6px; } .pol-modes label { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 400; color: var(--text); }
.pol-modes label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); } .pol-modes input { margin-top: 2px; } .pol-modes .help { display: block; }

/* Assign: one row per polisher with an optional quantity. */
.pol-who { display: flex; gap: 6px; align-items: center; } .pol-who select { flex: 1 1 auto; min-width: 0; } .pol-who input { width: 120px; flex: none; }

/* The run screen: the pieces box and its Start (or Complete) button side by side, the help under them. */
.pol-go { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 12px; } .pol-go .field { flex: 0 1 200px; } .pol-go .btn { height: 48px; font-size: 15px; padding: 0 18px; }
.pol-go-help { margin: 4px 0 0; font-size: 12px; color: var(--text-3); }

/* Operations tab: the board column picker above the library, an operation's instructions under its name, the More part of its form. */
.pol-area .field { max-width: 460px; margin: 0; }
.pol-op-notes { white-space: pre-wrap; max-width: 520px; overflow-wrap: anywhere; }
.pol-op-more { margin-top: 12px; } .pol-op-more > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); min-height: 32px; display: flex; align-items: center; }
.pol-op-more .chips .chip { min-height: 32px; }

/* Rework you owe: the count on the Polishing menu entry and the My work tab, the card on My work, the person page's list and the step's
   rework history. The count reads as a warning (pieces to redo), not as unread mail. */
.nav-count.pol-count { background: var(--warn); color: var(--surface); }
.tab-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 9px; background: var(--warn); color: var(--surface); font: 600 11px/18px var(--font); font-style: normal; text-align: center; vertical-align: 1px; }
.pol-owe-help { margin: 0 0 8px; }
.pol-owe-acts { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pol-hist { margin: 10px 0 0; padding: 8px 0 0 0; list-style: none; border-top: 1px solid var(--border); font-size: 12px; line-height: 1.45; color: var(--text-2); display: grid; gap: 2px; }
.pol-hist li { overflow-wrap: anywhere; }
/* A person no longer active is on the Team tab only while they owe rework: greyed, with the badge saying why. */
.pol-card.gone { border-style: dashed; } .pol-card.gone .pol-card-head a { color: var(--text-2); }
/* Four facts on a team card (the fourth is Rework owed): two by two, four across once the card is wide enough. */
.pol-card { container-type: inline-size; }
.pol-facts.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
@container (min-width: 380px) { .pol-facts.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Settings: the role checkboxes of the polisher settings. */
.role-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; }

@media (max-width: 600px) {
  .pol-qty .qbar { width: 100%; }
  .pol-rej { flex-wrap: wrap; } .pol-rej select[data-reason] { flex: 1 1 100%; } .pol-rej select[data-disp] { flex: 1 1 auto; }
  .pol-go { flex-wrap: nowrap; } .pol-go .field { flex: 1 1 auto; } .pol-go .btn { flex: none; }
  .pol-who input { width: 96px; }
}
