/* Shared approval-route composition; eligibility and saving stay in each module. */
html:root .crm-route-scroll { min-width:0;max-width:100%;overflow:auto;margin-top:16px;border:1px solid var(--border);border-radius:12px; }
html:root .production-table.crm-route-table { width:100%;table-layout:fixed;min-width:calc(var(--crm-route-columns,4) * 170px);margin:0;border:0; }
html:root .crm-route-table :is(th,td)[data-column] { width:calc(100% / var(--crm-route-columns,4));padding:12px 14px;text-align:center!important;white-space:normal;overflow-wrap:anywhere;vertical-align:middle; }
html:root .crm-route-table :is(th,td):first-child { position:static;min-width:0;max-width:none; }
html:root .crm-route-table th { background:var(--accent-soft);font-size:.8rem;font-weight:600; }
html:root .crm-route-table td { height:88px;font-size:.85rem; }
html:root .crm-route-table td>strong { display:block; }
html:root .crm-route-row-actions { display:flex;flex-wrap:wrap;gap:6px;justify-content:center;align-items:center;margin-top:8px; }
html:root .crm-route-row-actions:not(:has(button:not([hidden]))) { display:none; }
html:root .crm-route-row-actions button { min-height:32px;margin:0;padding:5px 9px;font-size:.75rem; }
html:root .crm-route-person { display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:8px;min-width:0; }
html:root .crm-route-person>.task-participant-label { position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
html:root .crm-route-person>.task-participant-selection { display:flex;justify-content:center;flex-wrap:wrap;gap:8px;min-width:0; }
html:root .crm-route-person>.task-participant-selection .task-person-empty { display:none; }
html:root .crm-route-person>.task-participant-selection .task-person-chip { width:auto;padding:0;border:0;border-radius:50%;background:transparent; }
html:root .crm-route-person>.task-participant-selection .task-person-chip-name { width:48px;height:48px;min-height:48px;padding:0;border:0;border-radius:50%;background:transparent; }
html:root .crm-route-person>.task-participant-selection .person-name-text { display:none; }
html:root .crm-route-person>.task-participant-selection .person-avatar { width:48px;height:48px;flex:none;font-size:1rem; }
html:root .crm-route-person>.task-participant-add { width:48px;height:48px;min-height:48px;flex:0 0 48px;padding:0;margin:0;border:1px solid transparent;border-radius:50%;background:transparent;box-shadow:none;color:var(--accent);font-size:32px;font-weight:300;line-height:1; }
html:root .crm-route-person :is(.task-participant-add,.task-person-chip-name):is(:hover,:focus-visible):not(:disabled) { background:var(--accent-soft); }
html:root .crm-route-person :is(.task-participant-add,.task-person-chip-name):focus-visible { outline:2px solid var(--accent);outline-offset:2px; }
html:root .crm-route-table select { width:100%;margin:0;min-width:0; }
html:root #invoice-route-dialog { --window-normal-width:1280px; }
html:root #invoice-route-dialog .crm-route-table { min-width:calc(var(--crm-route-columns,7) * 120px); }
@media(max-width:900px) {
  html:root .production-table.crm-route-table { min-width:0; }
  html:root #invoice-route-dialog .crm-route-table { min-width:0; }
  html:root .crm-route-table :is(th,td)[data-column] { width:auto; }
  html:root .crm-route-table tbody tr>td { display:block;height:auto;min-height:64px;padding:0;text-align:left!important; }
  html:root .crm-route-table tbody tr>td:first-child { grid-column:1/-1;text-align:center!important; }
  html:root .crm-route-person { justify-content:flex-start; }
  html:root .crm-route-person>.task-participant-selection { justify-content:flex-start; }
  html:root .crm-route-row-actions button { min-height:44px; }
}

/* A single control keeps multi-person stages compact at any roster size. */
html:root .crm-route-person>.task-participant-selection .crm-route-people-group { max-width:100%; }
html:root .crm-route-person>.task-participant-selection .crm-route-people-summary {
  display:flex; align-items:center; justify-content:center; width:auto; max-width:100%;
  height:48px; min-height:48px; padding:4px 0; border-radius:24px; gap:0;
}
html:root .crm-route-avatar-stack { display:flex; align-items:center; padding:0; }
html:root .crm-route-person>.task-participant-selection .crm-route-avatar-stack .person-avatar {
  position:relative; width:36px; height:36px; flex:0 0 36px; font-size:.85rem;
  border:2px solid var(--surface); box-sizing:border-box;
}
html:root .crm-route-avatar-stack .person-avatar+.person-avatar { margin-left:-14px; }
html:root .crm-route-more {
  position:relative; display:grid; place-items:center; flex:0 0 26px; width:26px; height:26px;
  margin-left:-8px; border:2px solid var(--surface); border-radius:50%;
  background:var(--accent-soft); color:var(--accent); font-size:.75rem; font-weight:650;
}
html:root .crm-route-person[data-people-multiple="true"] { flex-wrap:nowrap; gap:4px; }
html:root .crm-route-person[data-people-multiple="true"]>.task-participant-selection { flex-wrap:nowrap; }
html:root .crm-route-person[data-people-multiple="true"]>.task-participant-add {
  width:36px; height:40px; min-height:40px; flex:0 0 36px; font-size:27px;
}
@media(max-width:900px),(pointer:coarse) {
  html:root .crm-route-person[data-people-multiple="true"]>.task-participant-add { width:44px; height:44px; min-height:44px; flex-basis:44px; }
}
html:root .crm-route-person { min-height:48px; padding:0; }
html:root .crm-route-person>.task-participant-selection { padding:0; }

@media(max-width:420px) {
  html:root .crm-route-table tbody tr { grid-template-columns:minmax(0,1fr); }
}
