.ws-workspace {
  --ws-gap: 12px;
  --ws-muted-text: #94a3b8;
  display: flex;
  min-height: min(72vh, 760px);
  flex-direction: column;
  gap: var(--ws-gap);
  min-width: 0;
}
.ws-workspace .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ws-office-notifications{position:relative;z-index:1200}
.ws-office-notifications__toggle{display:flex;align-items:center;gap:8px;min-height:34px;padding:6px 10px;border:1px solid var(--line,#334155);border-radius:8px;background:var(--panel,#111827);color:var(--text,#f8fafc);font:inherit;cursor:pointer}
.ws-office-notifications__toggle [data-ws-office-count]{min-width:20px;padding:1px 6px;border-radius:999px;background:#dc2626;color:#fff;font-size:12px;font-weight:700;text-align:center}
.ws-office-notifications__panel{position:absolute;right:0;top:calc(100% + 8px);width:min(460px,calc(100vw - 20px));max-height:min(620px,calc(100vh - 70px));overflow:auto;padding:12px;border:1px solid #334155;border-radius:12px;background:#0f172a;color:#e5e7eb;box-shadow:0 18px 50px rgba(0,0,0,.42)}
.ws-office-notifications__title,.ws-office-notice__heading,.ws-office-notice__actions{display:flex;align-items:center;justify-content:space-between;gap:12px}
.ws-office-notifications__title{padding:2px 2px 10px;font-size:15px}
.ws-office-notifications__title span,.ws-office-notice__heading span{color:#fbbf24;font-size:12px}
.ws-office-notifications__list{display:grid;gap:10px}
.ws-office-notice{display:grid;gap:7px;padding:12px;border:1px solid #334155;border-left:3px solid #3b82f6;border-radius:9px;background:#111827}
.ws-office-notice p{margin:0;color:#cbd5e1;font-size:13px;line-height:1.4}
.ws-office-notice__instruction{font-weight:650}
.ws-office-notice__instruction--warning{color:#fbbf24!important}
.ws-office-notice__instruction--positive{color:#86efac!important}
.ws-office-notice__actions{justify-content:flex-start;margin-top:2px}
.ws-office-notice__actions .btn{min-height:32px;padding:5px 10px;border:1px solid #52627c;border-radius:7px;background:#162238;color:#f8fafc;font:inherit;font-size:12px;font-weight:650;cursor:pointer}
.ws-office-notice__actions .btn:hover,.ws-office-notice__actions .btn:focus-visible{border-color:#60a5fa;background:#1d3150;outline:none}
.ws-office-notifications__empty{padding:18px 10px;color:#cbd5e1;text-align:center}
.ws-import-journey{display:grid;gap:10px;padding:12px;border:1px solid var(--line,#334155);border-radius:10px;background:color-mix(in srgb,var(--panel,#0f172a) 94%,transparent)}
.ws-import-journey__heading,.ws-import-journey__actions{display:flex;align-items:center;justify-content:space-between;gap:12px}
.ws-import-journey__heading>div{display:grid;gap:2px}
.ws-import-journey__heading>div>span,.ws-import-journey>p{color:var(--ws-muted-text,#94a3b8);font-size:12px}
.ws-import-journey>p{margin:0}
.ws-import-journey__actions{justify-content:flex-end}
@media (max-width:720px){
  .ws-office-notifications__toggle{font-size:0;padding:6px 8px}
  .ws-office-notifications__toggle::before{content:'Queries';font-size:12px}
  .ws-office-notifications__toggle [data-ws-office-count]{font-size:11px}
  .ws-office-notifications__panel{position:fixed;top:54px;right:10px;left:10px;width:auto;max-height:calc(100vh - 66px)}
}

.ws-context-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel, #0f172a) 92%, transparent);
}

.ws-context-item { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.ws-context-label { color: var(--ws-muted-text, #94a3b8); font-size: 12px; line-height: 17px; }
.ws-context-value { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.ws-context-item select, .ws-toolbar select, .ws-toolbar input { min-height: 38px; }

.ws-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.ws-toolbar label { display: flex; min-width: 150px; flex-direction: column; gap: 3px; font-size: 12px; }

.ws-query-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.ws-query-filter-menu,
.ws-query-actions-menu { display: contents; }
.ws-query-filter-menu > summary,
.ws-query-actions-menu > summary { display: none; }
.ws-query-filter-fields,
.ws-query-action-choices { display: flex !important; flex-wrap: wrap; gap: 8px; align-items: end; }
.ws-query-filter-fields > label { display: flex; min-width: 150px; flex-direction: column; gap: 3px; font-size: 12px; }

.ws-notice {
  display: flex;
  gap: 6px;
  flex-direction: column;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 9px;
}
.ws-notice--danger { border-left-color: #ef4444; }
.ws-notice--warning { border-left-color: #f59e0b; }
.ws-notice--positive { border-left-color: #22c55e; }
.ws-notice--info { border-left-color: #38bdf8; }

.ws-scroll { position: relative; min-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.ws-grid, .ws-inner-grid { width: 100%; border-collapse: separate; border-spacing: 0; }
.ws-grid thead th, .ws-inner-grid thead th { position: sticky; z-index: 3; top: 0; background: var(--panel, #0f172a); }
.ws-grid th:first-child, .ws-grid td:first-child { padding-left: 12px; }
.ws-grid th:last-child, .ws-grid td:last-child { padding-right: 12px; }
.ws-import-grid th:first-child { width: 26%; }
.ws-import-filename {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.ws-history-grid th:last-child { width: 40%; }
.ws-history-detail {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.ws-grid th button[data-ws-sort] { all: unset; display: inline-flex; min-height: 44px; cursor: pointer; font: inherit; align-items: center; }
/* The generic modal button rule is loaded later; source-table headings remain flat labels. */
#modal.ctms-modern-modal .ws-grid th button:is([data-ws-sort], [data-wsr-sort], [data-wsc-sort]) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
#modal.ctms-modern-modal .ws-grid th button:is([data-ws-sort], [data-wsr-sort], [data-wsc-sort]):hover {
  border: 0;
  background: transparent;
  color: #a9cbff;
  box-shadow: none;
}
#modal.ctms-modern-modal .ws-grid th button:is([data-ws-sort], [data-wsr-sort], [data-wsc-sort]):focus-visible {
  outline: 2px solid #7aa7ff;
  outline-offset: 3px;
  border-radius: 2px;
}
.ws-grid thead th:has(input[type="checkbox"]), .ws-inner-grid thead th:has(input[type="checkbox"]) { z-index: 6; left: 0; width: 48px; min-width: 48px; text-align: center; }
.ws-actions { white-space: nowrap; }
.ws-actions .btn { margin: 2px 4px 2px 0; }
#modal .ws-actions .btn.ws-protected-review-ready:not(:disabled) {
  background: #166534;
  border-color: #22c55e;
  color: #fff;
}
#modal .ws-actions .btn.ws-protected-review-ready:not(:disabled):hover { background: #14532d; }
#modal .ws-actions .btn.ws-protected-review-ready:focus-visible {
  outline: 2px solid #86efac;
  outline-offset: 3px;
}
.ws-protected-grid td.ws-actions { white-space: normal; }
.ws-protected-grid td.ws-actions .btn {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  box-sizing: border-box;
  margin: 2px 0;
}
.ws-protected-grid .ws-action-hint { width: 100%; }
.ws-source-finalise-grid th:last-child { width: 162px; }
.ws-source-finalise-grid td.ws-actions > .btn {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 2px 0;
  padding: 6px 8px;
  white-space: normal;
  overflow-wrap: break-word;
}
.ws-action-hint { display: inline-flex; max-width: 100%; align-items: center; }
.ws-source-ids { display: block; margin-top: 3px; color: var(--ws-muted-text, #94a3b8); font-size: 11px; line-height: 1.3; }
.ws-empty { padding: 32px 12px !important; text-align: center; color: var(--ws-muted-text, #94a3b8); }

.ws-sticky-footer {
  position: sticky;
  z-index: 5;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel, #0f172a);
}
.ws-sticky-footer > div { display: flex; gap: 8px; }

.ws-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.ws-status--positive { border-color: #15803d; color: #86efac; }
.ws-status--danger { border-color: #b91c1c; color: #fca5a5; }
.ws-status--warning { border-color: #b45309; color: #fcd34d; }
.ws-status--info { border-color: #0369a1; color: #7dd3fc; }
.ws-status-sub { display: block; margin-top: 3px; font-size: 12px; }
.ws-status-sub--danger { color: #fca5a5; }
.ws-status-sub--warning { color: #fcd34d; }

.ws-tick { color: #4ade80; font-size: 18px; font-weight: 800; }
.ws-blank { display: inline-block; width: 18px; height: 18px; }
.ws-expand { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.ws-expanded > td { padding: 8px 12px 14px 54px !important; background: color-mix(in srgb, var(--panel, #0f172a) 80%, transparent); }
.ws-inner-scroll { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.ws-checklist-scroll { max-height: min(64vh, 640px); overflow: auto; overscroll-behavior: contain; }
.ws-checklist-items { max-height: 360px; overflow: auto; overscroll-behavior: contain; }
.ws-checklist-stage { display: block; color: var(--muted, #94a3b8); font-size: 12px; }
.ws-checklist-link, .ws-checklist-expand { border: 0; background: none; color: var(--accent, #67e8f9); padding: 3px 0; cursor: pointer; text-align: left; }
.ws-checklist-link { display: block; text-decoration: underline; }
.ws-checklist-expand { font-weight: 600; }
@media (max-width: 720px) {
  .ws-checklist-scroll { max-height: 70vh; }
  .ws-checklist-items { max-height: 360px; overflow: auto; }
  .ws-checklist-grid > tbody > tr:not(.ws-expanded) { display: grid; grid-template-columns: 1fr 1fr; padding: 10px; border-bottom: 1px solid var(--line); }
  .ws-checklist-grid > tbody > tr:not(.ws-expanded) > td:first-child { grid-column: 1 / -1; }
  .ws-checklist-grid > tbody > tr:not(.ws-expanded) > td { min-width: 0; }
  .ws-checklist-grid > tbody > tr:not(.ws-expanded) > td:nth-child(4)::before { content: 'Checked'; display: block; }
  .ws-checklist-grid > tbody > tr:not(.ws-expanded) > td:nth-child(5)::before { content: 'Completed'; display: block; }
}
.ws-shift-row td:nth-child(2) span { display: block; color: var(--ws-muted-text, #94a3b8); font-size: 12px; }
.ws-grid input[type="checkbox"], .ws-confirm input[type="checkbox"] { width: 20px; height: 20px; min-width: 20px; accent-color: var(--accent, #3b82f6); }
.ws-grid th:has(input[type="checkbox"]), .ws-grid td:has(input[type="checkbox"]) { width: 48px; text-align: center; }
.ws-selection-summary, .ws-source-summary { padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--panel, #0f172a) 84%, transparent); }
.ws-inner-tabs { display: flex; gap: 6px; }
.ws-attention {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; border: 1px solid rgba(228,175,74,.48);
  border-left: 4px solid #e4af4a; border-radius: 10px;
  background: linear-gradient(110deg,rgba(228,175,74,.12),rgba(228,175,74,.035));
}
.ws-attention__heading { display: grid; gap: 3px; }
.ws-attention__heading > strong { font-size: 14px; }
.ws-attention__heading > span, .ws-attention > span { color: var(--ws-muted-text,#94a3b8); font-size: 12px; }
.ws-attention__links { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-attention__link {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px;
  padding: 8px 12px; border: 1px solid rgba(228,175,74,.42); border-radius: 8px;
  background: var(--panel,#0f172a); color: inherit; font: inherit; font-size: 13px; cursor: pointer;
}
.ws-attention__link > strong { min-width: 20px; padding: 2px 6px; border-radius: 5px; background: rgba(228,175,74,.16); text-align: center; }
.ws-attention__link:is(:hover,:focus-visible) { border-color: #e4af4a; outline: 2px solid rgba(228,175,74,.4); outline-offset: 2px; }
.ws-attention__link:disabled { opacity: .6; cursor: wait; }
.ws-attention--clear { border-color: var(--line,#334155); border-left-color: #58bd8a; background: rgba(31,148,94,.055); }
.ws-attention--unavailable { background: transparent; }
@media (max-width:720px) {
  .ws-attention { align-items: stretch; padding: 12px; }
  .ws-attention__links { width: 100%; }
  .ws-attention__link { flex: 1 1 170px; justify-content: space-between; }
}
.ws-inner-tabs .ws-tab-empty:not([aria-selected="true"]) { opacity: .55; }
.ws-inner-tabs button { min-height: 40px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.ws-inner-tabs button[aria-selected="true"] { border-color: var(--accent, #3b82f6); background: color-mix(in srgb, var(--accent, #3b82f6) 15%, transparent); }
.ws-confirm { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.ws-loading { display: grid; flex: 1; place-items: center; min-height: 300px; color: var(--ws-muted-text, #94a3b8); }

.ws-rate-warnings {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, #b45309 55%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, #b45309 7%, var(--panel, #0f172a));
}
.ws-rate-warning-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ws-rate-warning-heading h3, .ws-rate-warning-heading p { margin: 0; }
.ws-rate-warning-heading > div { display: grid; gap: 3px; }
.ws-rate-warning-heading p, .ws-rate-warnings > p, .ws-muted-action { color: var(--ws-muted-text, #94a3b8); }
.ws-rate-warning-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ws-rate-warning-grid th:first-child,
.ws-rate-warning-grid td:first-child { position: sticky; z-index: 2; left: 0; background: var(--panel, #0f172a); }
.ws-rate-warning-grid th:first-child { z-index: 3; }
.ws-rate-warning-drilldown > td { padding: 8px 12px 12px !important; background: color-mix(in srgb, var(--panel, #0f172a) 80%, transparent); }
.ws-issue-count { display: inline-block; margin-right: 8px; color: #fcd34d; font-weight: 700; }
.ws-charge-detail-row > td { padding: 8px 12px 12px !important; background: color-mix(in srgb, #b45309 6%, var(--panel, #0f172a)); }
.ws-charge-detail { display: grid; gap: 10px; border-left: 3px solid #b45309; padding: 8px 12px; }
.ws-charge-detail > div:first-child { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.ws-charge-detail > div:first-child span, .ws-charge-detail dt, .ws-charge-detail p { color: var(--ws-muted-text, #94a3b8); }
.ws-charge-detail dl { display: grid; grid-template-columns: repeat(5, minmax(105px, 1fr)); gap: 8px; margin: 0; }
.ws-charge-detail dl > div { display: grid; gap: 2px; }
.ws-charge-detail dt { font-size: 11px; }
.ws-charge-detail dd { margin: 0; font-weight: 700; }
.ws-charge-detail p { margin: 0; font-size: 12px; }
.ws-charge-accept-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: flex-end; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; }
.ws-charge-accept-controls > span { margin-right: auto; color: var(--ws-muted-text, #94a3b8); }
.ws-charge-accept-controls label { display: inline-flex; gap: 7px; align-items: center; }
.ws-charge-accept-controls input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent, #3b82f6); }
@media (max-width: 720px) { .ws-charge-detail dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ws-charge-accept-controls > .btn { width: 100%; } }

.ws-mobile-sort { display: none; }

.ws-tracker {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ws-tracker-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.ws-tracker-heading h3 { margin: 0; font-size: 15px; }
.ws-tracker-heading > div:first-child { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.ws-tracker-heading > div:first-child > span { overflow: hidden; color: var(--ws-muted-text, #94a3b8); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ws-tracker-controls { display: flex; align-items: center; gap: 12px; }
.ws-tracker-week { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ws-muted-text, #94a3b8); white-space: nowrap; }
.ws-tracker-week select { width: auto; min-width: 170px; max-width: 230px; height: 32px; padding: 4px 28px 4px 9px; font-size: 12px; color: var(--text, #e2e8f0); background: var(--panel, #0f172a); border: 1px solid var(--line); border-radius: 7px; }

.ws-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}
.ws-child > h3, .ws-child > p { margin: 0; }
.ws-child-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel, #0f172a) 88%, transparent);
}
.ws-child-context > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.ws-child-context span { color: var(--ws-muted-text, #94a3b8); font-size: 12px; }
.ws-child-context strong { overflow-wrap: anywhere; }
.ws-child-fields { display: grid; gap: 10px; }
.ws-child-fields label, .ws-child-fieldset label { display: grid; gap: 4px; }
.ws-child-fields input, .ws-child-fields select, .ws-child-fields textarea,
.ws-child-fieldset input, .ws-child-fieldset select { width: 100%; min-height: 40px; }
.ws-child-fields textarea { min-height: 84px; resize: vertical; }
.ws-child-tablist { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.ws-child-tablist [role="tab"] { min-height: 40px; white-space: nowrap; }
.ws-child-tablist [role="tab"][aria-selected="true"] { border-color: var(--accent); color: var(--accent); }
.ws-child-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.ws-child-fieldset legend { padding: 0 5px; font-weight: 700; }
.ws-child-scroll { max-width: 100%; max-height: min(48vh, 500px); overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.ws-child-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ws-child-table thead th { position: sticky; z-index: 2; top: 0; background: var(--panel, #0f172a); }
.ws-child-actions {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 0 0;
  background: var(--panel, #0f172a);
}
.ws-file-button { position: relative; width: fit-content; cursor: pointer; }
.ws-child-actions .btn:disabled { opacity: .55; cursor: not-allowed; }
.ws-batch-preview__list { display: grid; gap: 8px; padding: 8px; }
.ws-batch-report { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.ws-batch-report__select { display: flex; align-items: flex-start; gap: 9px; min-width: 0; font-weight: 650; }
.ws-batch-report__select input { flex: none; margin-top: 3px; }
.ws-batch-report__file { min-width: 0; overflow-wrap: anywhere; }
.ws-batch-report__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 16px; margin: 7px 0 0 24px; }
.ws-batch-report__facts > span { color: var(--ws-muted-text, #94a3b8); font-size: 12px; }
.ws-batch-report__facts strong { color: var(--text, #e5edf5); font-weight: 650; }
.ws-batch-report__issue { margin: 7px 0 0 24px; color: var(--ws-warning-text, #fbbf24); font-size: 12px; }

.weekly-source-settings-fields { display: grid; gap: 10px; }
.weekly-source-setting-row {
  display: grid;
  grid-template-columns: minmax(170px, .85fr) minmax(220px, 1.15fr);
  gap: 12px;
  align-items: center;
}
.weekly-source-setting-row > span:last-child { display: flex; gap: 8px; align-items: center; min-width: 0; }
.weekly-source-setting-row input,
.weekly-source-setting-row select { width: 100%; min-width: 0; }
.weekly-source-setting-check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; }
.weekly-source-setting-check input { margin-top: 2px; }
.weekly-source-global-settings { grid-column: 1 / -1; display: grid; gap: 12px; padding: 14px; }
.weekly-source-rule-settings { grid-column: 1 / -1; display: grid; gap: 12px; padding: 14px; min-width: 0; }
.weekly-source-group-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.3fr) minmax(110px, .75fr) minmax(110px, .75fr) minmax(110px, .7fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.weekly-source-group-row label { display: grid; gap: 4px; min-width: 0; }
.weekly-source-group-row input,
.weekly-source-group-row select { width: 100%; min-width: 0; }

@media (max-width: 720px) {
  .ws-workspace { min-height: 76vh; }
  .ws-context-bar { grid-template-columns: 1fr 1fr; }
  .ws-toolbar { align-items: stretch; flex-direction: column; }
  .ws-toolbar label, .ws-toolbar button { width: 100%; }
  .ws-scroll, .ws-inner-scroll, .ws-child-scroll { min-width: 0; max-width: 100%; }
  .ws-grid { min-width: 760px; }
  .ws-mobile-sort {
    position: sticky;
    z-index: 4;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel, #0f172a);
  }
  .ws-mobile-sort label { display: grid; gap: 3px; min-width: 0; font-size: 12px; }
  .ws-mobile-sort select { width: 100%; min-width: 0; min-height: 40px; }
  .ws-expanded > td { padding-left: 12px !important; }
  .ws-sticky-footer { align-items: stretch; flex-direction: column; }
  .ws-sticky-footer > div { display: grid; grid-template-columns: 1fr; }
  .ws-actions { white-space: normal; }
  .ws-actions .btn { width: 100%; }
  .ws-tracker-heading { align-items: flex-start; flex-direction: column; }
  .ws-tracker-controls { width: 100%; flex-wrap: wrap; justify-content: space-between; }
  .ws-tracker-week select { min-width: 0; max-width: min(230px, 65vw); }
  .ws-child-context { grid-template-columns: 1fr; }
  .ws-child-fieldset { grid-template-columns: 1fr; }
  .ws-child-table { min-width: 680px; }
  .ws-child-actions { display: grid; grid-template-columns: 1fr; }
  .ws-child-actions .btn { width: 100%; }
  .ws-rate-warning-heading, .ws-rate-warning-actions { align-items: stretch; flex-direction: column; }
  .ws-rate-warning-actions .btn { width: 100%; }
  .weekly-source-setting-row,
  .weekly-source-group-row { grid-template-columns: 1fr; }

}

/* Query results become compact cards before a tablet is narrow enough to
   squeeze or horizontally pan a desktop table. The checkbox at the left of
   the heading remains the single select-all/clear-all control. */
@media (max-width: 1500px) {
  .ws-query-controls { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .ws-query-filter-menu,
  .ws-query-actions-menu { display: block; }
  .ws-query-filter-menu > summary,
  .ws-query-actions-menu > summary {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    list-style: none;
    cursor: pointer;
  }
  .ws-query-filter-menu > summary::-webkit-details-marker,
  .ws-query-actions-menu > summary::-webkit-details-marker { display: none; }
  .ws-query-actions-menu > summary[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
  .ws-query-filter-fields,
  .ws-query-action-choices { display: none !important; }
  .ws-query-filter-menu[open] > .ws-query-filter-fields,
  .ws-query-actions-menu[open] > .ws-query-action-choices {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel, #0f172a);
  }
  .ws-query-filter-fields > label,
  .ws-query-filter-fields > button,
  .ws-query-action-choices > button { width: 100%; }
  .ws-workspace[data-ws-tab="queries"] .ws-selection-summary,
  .ws-workspace[data-ws-tab="queries"] .ws-sticky-footer { display: none; }

  .ws-mobile-sort {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel, #0f172a);
  }
  .ws-mobile-sort label { display: grid; gap: 3px; min-width: 0; font-size: 12px; }
  .ws-mobile-sort select { width: 100%; min-width: 0; min-height: 40px; }
  .ws-sticky-footer { position: static; }
  .ws-query-scroll { overflow-x: hidden; border: 0; }
  .ws-query-grid,
  .ws-query-shift-grid,
  #modal .ws-query-grid,
  #modal .ws-query-shift-grid { display: block; min-width: 0; border: 0; }
  .ws-query-grid > thead,
  .ws-query-grid > tbody,
  .ws-query-shift-grid > thead,
  .ws-query-shift-grid > tbody { display: block; }
  .ws-query-grid > thead { position: sticky; z-index: 6; top: 0; }
  .ws-query-grid > thead > tr,
  .ws-query-shift-grid > thead > tr {
    display: flex;
    min-height: 44px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel, #0f172a);
  }
  .ws-query-grid > thead > tr > th,
  .ws-query-shift-grid > thead > tr > th { display: none; }
  .ws-query-grid > thead > tr > th:first-child,
  .ws-query-shift-grid > thead > tr > th:first-child {
    position: static;
    display: flex;
    width: auto;
    min-width: 0;
    gap: 9px;
    align-items: center;
    padding: 8px 12px;
    text-align: left;
  }
  .ws-query-grid > thead > tr > th:first-child::after { content: "Select all query groups"; font-weight: 650; }
  .ws-query-shift-grid > thead > tr > th:first-child::after { content: "Select all shifts in this group"; font-weight: 650; }

  .ws-query-grid > tbody > tr[data-ws-group-key] {
    display: grid;
    grid-template-columns: 36px 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "select expand candidate issues"
      "select expand client status"
      "asked asked manager age"
      "actions actions actions actions";
    gap: 5px 8px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--panel, #0f172a) 92%, transparent);
  }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td { display: block; width: auto; min-width: 0; padding: 0; border: 0; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(1) { grid-area: select; align-self: start; padding-top: 8px; text-align: left; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(2) { grid-area: expand; align-self: start; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(3) { grid-area: candidate; align-self: end; font-weight: 750; overflow-wrap: anywhere; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(4) { grid-area: client; color: var(--ws-muted-text, #94a3b8); overflow-wrap: anywhere; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(5) { grid-area: issues; align-self: end; font-weight: 750; text-align: right; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(5)::after { content: " issue(s)"; color: var(--ws-muted-text, #94a3b8); font-size: 11px; font-weight: 500; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(6) { grid-area: asked; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(7) { grid-area: manager; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(6)::before,
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(7)::before {
    display: inline;
    margin-right: 5px;
    color: var(--ws-muted-text, #94a3b8);
    font-size: 11px;
  }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(6)::before { content: "Candidate"; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(7)::before { content: "Manager"; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(8) { grid-area: status; justify-self: end; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(9) { grid-area: age; color: var(--ws-muted-text, #94a3b8); font-size: 12px; text-align: right; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(10) { grid-area: actions; padding-top: 4px; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(10),
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(8) {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 0;
    white-space: normal;
  }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(10) .btn,
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(8) .btn {
    width: auto;
    margin: 0;
  }
  .ws-query-grid .ws-expand { min-width: 40px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; }

  .ws-query-grid > tbody > .ws-expanded { display: block; margin: 6px 0 12px; }
  .ws-query-grid > tbody > .ws-expanded > td { display: block; width: auto; padding: 0 !important; border: 0; }
  .ws-query-grid .ws-inner-scroll { max-height: none; overflow: visible; border: 0; }
  .ws-query-shift-grid > tbody > .ws-shift-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "select date role"
      "candidate candidate candidate"
      "system system system"
      "issue issue status"
      "actions actions actions";
    gap: 7px 9px;
    margin-top: 7px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: color-mix(in srgb, var(--panel, #0f172a) 86%, transparent);
  }
  .ws-query-shift-grid > tbody > .ws-shift-row > td { display: block; width: auto; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(1) { grid-area: select; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(2) { grid-area: date; font-weight: 700; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(3) { grid-area: role; text-align: right; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(4) { grid-area: candidate; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(5) { grid-area: system; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(6) { grid-area: issue; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(7) { grid-area: status; justify-self: end; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(8) { grid-area: actions; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(4)::before,
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(5)::before,
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(6)::before {
    display: block;
    margin-bottom: 2px;
    color: var(--ws-muted-text, #94a3b8);
    font-size: 11px;
  }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(4)::before { content: "Candidate hours"; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(5)::before { content: "System hours"; }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(6)::before { content: "Issue"; }

  .ws-rate-warnings { padding: 10px; }
  .ws-rate-warning-grid--selectable { display: block; min-width: 0; }
  .ws-rate-warning-grid--selectable > thead, .ws-rate-warning-grid--selectable > tbody { display: block; }
  .ws-rate-warning-grid--selectable > thead > tr { display: flex; min-height: 44px; align-items: center; border: 1px solid var(--line); border-radius: 9px; }
  .ws-rate-warning-grid--selectable > thead th { display: none; }
  .ws-rate-warning-grid--selectable > thead th:first-child { display: flex; align-items: center; width: auto; min-width: 0; padding: 8px 12px; }
  .ws-rate-warning-grid--selectable > thead th:first-child::after { content: "Select visible rate warnings"; margin-left: 9px; font-weight: 650; }
  .ws-rate-warning-grid--selectable > tbody > tr[data-ws-rate-warning-row] {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-areas: "select candidate charge" "select day warning" "action action action";
    gap: 7px 9px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: color-mix(in srgb, var(--panel, #0f172a) 88%, transparent);
  }
  .ws-rate-warning-grid--selectable > tbody > tr[data-ws-rate-warning-row] > td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
  .ws-rate-warning-grid--selectable > tbody > tr[data-ws-rate-warning-row] > td:nth-child(1) { grid-area: select; position: static; padding-top: 5px; }
  .ws-rate-warning-grid--selectable > tbody > tr[data-ws-rate-warning-row] > td:nth-child(2) { grid-area: candidate; font-weight: 700; }
  .ws-rate-warning-grid--selectable > tbody > tr[data-ws-rate-warning-row] > td:nth-child(3) { grid-area: day; color: var(--ws-muted-text, #94a3b8); }
  .ws-rate-warning-grid--selectable > tbody > tr[data-ws-rate-warning-row] > td:nth-child(4) { grid-area: charge; text-align: right; white-space: nowrap; }
  .ws-rate-warning-grid--selectable > tbody > tr[data-ws-rate-warning-row] > td:nth-child(5) { grid-area: warning; }
  .ws-rate-warning-grid--selectable > tbody > tr[data-ws-rate-warning-row] > td:nth-child(6) { grid-area: action; }
  .ws-rate-warning-drilldown { display: block; margin: 6px 0 12px; }
  .ws-rate-warning-drilldown > td { display: block; padding: 0 !important; border: 0; }
}

@media (min-width: 700px) and (max-width: 1500px) {
  .ws-query-filter-menu[open] > .ws-query-filter-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ws-query-actions-menu[open] > .ws-query-action-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-query-filter-fields > .ws-mobile-sort { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .ws-context-bar { grid-template-columns: 1fr; }
  .ws-mobile-sort { position: static; grid-template-columns: 1fr; }
  .ws-query-grid > tbody > tr[data-ws-group-key] {
    grid-template-columns: 34px 40px minmax(0, 1fr);
    grid-template-areas:
      "select expand candidate"
      "select expand client"
      "issues issues status"
      "asked asked asked"
      "manager manager age"
      "actions actions actions";
  }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(5) { justify-self: start; text-align: left; }
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(8),
  .ws-query-grid > tbody > tr[data-ws-group-key] > td:nth-child(9) { justify-self: end; }
  .ws-query-shift-grid > tbody > .ws-shift-row {
    grid-template-columns: 30px minmax(0, 1fr);
    grid-template-areas:
      "select date"
      "select role"
      "candidate candidate"
      "system system"
      "issue issue"
      "status status"
      "actions actions";
  }
  .ws-query-shift-grid > tbody > .ws-shift-row > td:nth-child(3) { text-align: left; }
}
.ws-invoice-source-details {
  display: grid;
  gap: 2px;
  min-width: 0;
  max-width: 220px;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Combined source-only lists: do not affect the signed-roster table contract. */
.ws-workspace:has([data-wsr-table], [data-wsc-table]) > .ws-toolbar:first-child {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel, #0f172a); gap: 12px;
}
.ws-workspace:has([data-wsr-table], [data-wsc-table]) > .ws-toolbar:first-child > label {
  flex: 0 1 230px; gap: 6px; color: var(--ws-muted-text, #94a3b8);
}
@media (max-width:720px) {
  /* Desktop width basis must not become a 230px label HEIGHT when the
     existing mobile toolbar changes to a column. Keep attention reachable. */
  .ws-workspace:has([data-wsr-table], [data-wsc-table]) > .ws-toolbar:first-child > label {
    flex: 0 0 auto; min-width: 0;
  }
}
.ws-workspace:has([data-wsc-table]) > .ws-notice {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px;
  border-left-width: 1px; padding: 12px 14px;
}
.ws-workspace:has([data-wsc-table]) > .ws-notice > :is(strong, span) { grid-column: 1; }
.ws-workspace:has([data-wsc-table]) > .ws-notice > .btn {
  grid-column: 2; grid-row: auto; justify-self: end; max-width: 100%; white-space: normal;
}
#modal.ctms-modern-modal .ws-workspace .ws-inner-tabs { flex-wrap: wrap; gap: 8px; }
#modal.ctms-modern-modal .ws-workspace .ws-inner-tabs button[aria-selected="true"] {
  border-color: #777bec; background: #252d56; color: #fff;
}
.ws-workspace:has([data-wsc-table]) > details > summary { cursor: pointer; padding: 6px 0; font-weight: 600; }
:is([data-wsr-table], [data-wsc-table]) { min-width: 0; max-width: 100%; }
.ws-workspace > :is([data-wsr-table], [data-wsc-table]) { min-height: 200px; }
#modal.ctms-modern-modal .ws-grid th button:is([data-wsr-sort], [data-wsc-sort]) {
  text-transform: uppercase; font-size: 11px; letter-spacing: .025em;
}
:is([data-wsr-table], [data-wsc-table]) > table { width: 100%; min-width: 0; table-layout: fixed; }
#modal :is([data-wsr-table], [data-wsc-table]) table.grid { min-width: 0; }
:is([data-wsr-table], [data-wsc-table]) :is(th, td) { min-width: 0; overflow-wrap: anywhere; vertical-align: top; }
:is([data-wsr-table], [data-wsc-table]) td.ws-actions { white-space: normal; }
:is([data-wsr-table], [data-wsc-table]) td.ws-actions > .btn { display: block; width: 100%; margin: 0 0 6px; white-space: normal; }
#modal.ctms-modern-modal :is([data-wsr-table], [data-wsc-table]) > table > tbody > tr > td { padding-top: 7px; padding-bottom: 7px; vertical-align: middle; }
#modal.ctms-modern-modal :is([data-wsr-table], [data-wsc-table]) td.ws-actions > .btn { min-height: 30px; padding: 5px 9px; margin-bottom: 4px; font-size: 12px; }
#modal.ctms-modern-modal :is([data-wsr-table], [data-wsc-table]) td.ws-actions > .btn:last-child { margin-bottom: 0; }
[data-wsr-table] .ws-query-expansion > td { padding-top: 4px; padding-bottom: 4px; }
[data-wsr-table] .ws-query-expansion summary { cursor: pointer; padding: 4px 0; }
[data-wsr-table] .ws-query-shifts { width: 100%; table-layout: fixed; margin-top: 8px; }
[data-wsr-table] .ws-query-shifts :is(th, td) { padding: 8px 10px; vertical-align: middle; }
[data-wsr-table] .ws-query-problem { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.3; }
[data-wsr-table] .ws-query-problem strong { font-weight: 650; }
[data-wsr-table] .ws-query-problem small { color: var(--ws-muted-text, #94a3b8); font-size: 11px; }
[data-wsr-table] .ws-query-reason { overflow-wrap: anywhere; cursor: help; }
[data-wsr-table] .ws-query-reason:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
/* Status is authoritative, including even rows and hovered rows. The modal's
   generic zebra/hover backgrounds must not hide pay readiness. */
#modal.ctms-modern-modal :is([data-wsr-table], [data-wsc-table], .ws-office-checks) table.grid tr.ws-query-hold > td { background: rgba(180, 48, 64, .15); }
#modal.ctms-modern-modal :is([data-wsr-table], [data-wsc-table], .ws-office-checks) table.grid tr.ws-query-nonblocking > td { background: rgba(31, 148, 94, .13); }
:is([data-wsr-table], .ws-office-checks) tr.ws-query-hold > td:first-child { box-shadow: inset 3px 0 #d35a69; }
:is([data-wsr-table], .ws-office-checks) tr.ws-query-nonblocking > td:first-child { box-shadow: inset 3px 0 #58bd8a; }
.ws-charge-guidance { margin: 10px 0 0; color: var(--ws-muted-text, #b7c4d8); line-height: 1.45; }
[data-wsr-table] .ws-query-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
[data-wsr-table] .ws-query-contact-actions:empty { display: none; }
.ws-contact-policy, .ws-contact-review, .ws-contact-result { padding: 16px; margin: 12px 0; border: 1px solid #344b65; border-radius: 12px; background: #102037; }
.ws-contact-audiences { display: flex; gap: 8px; flex-wrap: wrap; }
.ws-contact-audiences [aria-pressed="true"] { border-color: #9994ff; background: #31375e; }
.ws-contact-policy p, .ws-contact-note { color: #b8c8db; font-size: 13px; }
.ws-contact-policy .ws-toolbar label { flex-direction: row; align-items: center; }
.ws-contact-policy input[type="checkbox"] { min-height: 0; }
.ws-contact-eligibility { display: block; margin-top: 6px; color: #b8c8db; font-size: 12px; max-width: 32ch; }
.ws-contact-eligibility--ready { color: #87ddba; }
.ws-contact-review ul, .ws-contact-result ul { padding-left: 20px; }
.ws-contact-review li, .ws-contact-result li { margin: 12px 0; overflow-wrap: anywhere; }
.ws-contact-review li > span, .ws-contact-result li > span { display: block; margin-top: 4px; color: #b8c8db; }
:is([data-wsr-table], [data-wsc-table]) .ws-status { border-radius: 6px; padding: 4px 7px; max-width: 100%; }
:is([data-wsr-table], [data-wsc-table]) .ws-status-sub { color: var(--ws-muted-text, #94a3b8); font-weight: 400; }
[data-wsr-table] th:has([data-wsr-sort="client"]), [data-wsc-table] th:has([data-wsc-sort="client"]) { width: 19%; }
[data-wsr-table] th:first-child:has(+ th [data-wsr-sort="client"]):not(:has(button)) { width: 64px; white-space: nowrap; }
[data-wsc-table] th:first-child { width: 64px; white-space: nowrap; }
:is([data-wsr-table], [data-wsc-table]) th:last-child { width: 170px; }
[data-wsc-table] th:has([data-wsc-sort="system_hours"]) { width: 20%; }
[data-wsc-table] td[data-label="Hours / break"] { overflow-wrap: normal; }
[data-protected-editor] .ws-child-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
[data-protected-editor] .ws-child-fields label:has([data-protected-field="contract_id"]) { grid-column: span 2; }
[data-protected-editor] .ws-child-fields label:has(textarea) { grid-column: 1 / -1; }
[data-protected-editor] .ws-child-context button { align-self: flex-start; margin-top: 6px; }
.ws-protected-history { border: 1px solid var(--line, #334155); border-radius: 10px; padding: 14px; min-width: 0; }
.ws-protected-history h3 { margin: 0 0 10px; font-size: 1rem; }
.ws-protected-history-scroll { max-height: 260px; overflow: auto; overscroll-behavior: contain; }
.ws-protected-history-scroll:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.ws-protected-history ol { list-style: none; padding: 0; margin: 0; }
.ws-protected-history li { padding: 12px 0; overflow-wrap: anywhere; }
.ws-protected-history li:first-child { padding-top: 0; }
.ws-protected-history li + li { border-top: 1px solid var(--line, #334155); }
.ws-protected-history-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.ws-protected-history-meta time, .ws-protected-history-facts { color: #b8c7dc; font-size: .875rem; }
.ws-protected-history .ws-protected-history-reason { margin: 8px 0; white-space: pre-wrap; }
:is([data-wsr-table], [data-wsc-table]) details > ul { padding-left: 20px; }
:is([data-wsr-table], [data-wsc-table]) details li { margin: 8px 0; }
:is([data-wsr-table], [data-wsc-table]) .ws-sort {
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  padding: 0; min-height: 0; text-align: left; color: inherit; font: inherit;
}
.ws-workspace:has([data-wsc-table]) > details > ul {
  list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px;
}
.ws-workspace:has([data-wsc-table]) > details > ul > li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 10px 12px; border: 1px solid var(--line, #334155); border-radius: 8px;
}
.ws-workspace:has([data-wsc-table]) > details > ul > li > label:first-child { flex: 1 1 300px; }
.ws-workspace:has([data-wsc-table]) > details > ul > li > .ws-confirm,
.ws-workspace:has([data-wsc-table]) > details > ul > li > p { flex-basis: 100%; }
.ws-workspace:has([data-wsc-table]) > details > .btn { margin: 0 8px 8px 0; }
@media (max-width: 900px) {
  #modal.ctms-modern-modal :is([data-wsr-table], [data-wsc-table]) td.ws-actions > .btn { min-height: 44px; }
  .ws-workspace:has([data-wsc-table]) > .ws-notice { display: flex; }
  .ws-workspace:has([data-wsc-table]) > .ws-notice > .btn { align-self: flex-start; }
  [data-protected-editor] .ws-child-fields { grid-template-columns: 1fr; }
  [data-protected-editor] .ws-child-fields label:has([data-protected-field="contract_id"]) { grid-column: auto; }
  :is([data-wsr-table], [data-wsc-table]) > table,
  :is([data-wsr-table], [data-wsc-table]) :is(thead, tbody) { display: block; }
  :is([data-wsr-table], [data-wsc-table]) thead > tr { display: flex; flex-wrap: wrap; }
  :is([data-wsr-table], [data-wsc-table]) th:not(:has(button)) { display: none; }
  :is([data-wsr-table], [data-wsc-table]) tbody > tr { display: grid; border-bottom: 1px solid var(--line); padding: 8px 0; }
  :is([data-wsr-table], [data-wsc-table]) tbody td { display: block; width: 100%; box-sizing: border-box; }
  :is([data-wsr-table], [data-wsc-table]) td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 11px; font-weight: 650; color: var(--ws-muted-text, #94a3b8); }
  .ws-workspace:has([data-wsr-table], [data-wsc-table]) .ws-toolbar > label { min-width: 0; flex: 1 1 160px; max-width: 100%; }
  .ws-workspace:has([data-wsr-table], [data-wsc-table]) .ws-toolbar select { width: 100%; min-width: 0; }
}

/* Policy WEEKLY_SOURCE_IMPORT_QUERY_POLICY_20260930_V2. Restrict shell
   sizing to this workspace; child modals keep their own existing dimensions. */
#modal:has(.ws-workspace) {
  width: min(1800px, calc(100vw - 48px)) !important;
  max-width: calc(100vw - 48px) !important;
}
@media (min-width: 1501px) {
  #modal .ws-query-grid { table-layout: fixed; min-width: 0; width: 100%; }
  #modal .ws-query-grid > thead > tr > th,
  #modal .ws-query-grid > tbody > tr[data-ws-group-key] > td {
    min-width: 0; width: auto; overflow-wrap: anywhere;
  }
  #modal .ws-query-grid > thead > tr > th:nth-child(-n+2) { width: 48px; }
  #modal .ws-query-grid > thead > tr > th:nth-child(5) { width: 65px; }
  #modal .ws-query-grid > thead > tr > th:nth-child(8) { width: 155px; }
  #modal .ws-query-grid > thead > tr > th:last-child { width: 160px; }
  #modal .ws-query-grid > tbody > tr[data-ws-group-key] > .ws-actions { white-space: normal; }
  #modal .ws-query-grid > tbody > tr[data-ws-group-key] > .ws-actions > .btn,
  #modal .ws-query-grid > tbody > tr[data-ws-group-key] > .ws-actions > .ws-action-hint {
    display: flex; width: 100%; margin: 4px 0; justify-content: center;
  }
  #modal .ws-query-grid .ws-actions .ws-action-hint .btn { width: 100%; margin: 0; }
  #modal .ws-query-grid .ws-status { white-space: nowrap; overflow-wrap: normal; }
}
@media (max-width: 720px) {
  .ws-source-invoice-lines,
  .ws-source-invoice-lines > tbody,
  .ws-source-invoice-lines > tbody > tr,
  .ws-source-invoice-lines > tbody > tr > td { min-width: 0 !important; }
  .ws-source-invoice-lines > thead { display: none; }
  .ws-source-invoice-lines > tbody { display: grid; gap: 10px; }
  .ws-source-invoice-lines > tbody > tr {
    display: grid;
    border: 1px solid var(--line, rgba(255,255,255,.16));
    border-radius: 10px;
    overflow: hidden;
  }
  .ws-source-invoice-lines > tbody > tr > td {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .ws-source-invoice-lines > tbody > tr > td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    opacity: .75;
  }
  .ws-invoice-source-details { max-width: none; }
}
