#workloadView { min-width: 0; container-type: inline-size; }
body:has(#workloadView.active) .topbar { flex-wrap: wrap; }
body:has(#workloadView.active) .topbar .global-search { min-width: 0; }
#workloadView .workload-layout { display: grid; gap: 0; min-width: 0; }
#workloadView .workload-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 12px 0 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
#workloadView .workload-toolbar label { display: grid; gap: 5px; min-width: 120px; flex: 1 1 125px; color: var(--muted); font-size: 12px; }
#workloadView .workload-toolbar .workload-person-search { flex: 1.5 1 160px; }
#workloadView .workload-toolbar input, #workloadView .workload-toolbar select { width: 100%; min-width: 0; min-height: 32px; }
#workloadApplyButton { order: 2; min-height: 32px; }
#workloadView .workload-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; padding: 18px 0; }
.wp-metric { padding: 0 18px; border-right: 1px solid var(--line); min-width: 0; }
.wp-metric:first-child { padding-left: 0; }
.wp-metric:last-child { border-right: 0; }
.wp-metric span, .wp-metric strong, .wp-metric small { display: block; }
.wp-metric span { font-size: 12px; color: var(--muted); }
.wp-metric strong { font-size: 26px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.wp-metric small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.wp-danger { color: var(--red); }
:root[data-theme="dark"] #workloadView { --red: #f58c9d; --green: #5cc5b4; --amber: #edc479; }
#workloadView .workload-board { display: block; min-width: 0; position: relative; }
.wp-icon { display: inline-block; flex: 0 0 16px; width: 16px; height: 16px; background: currentColor; mask: var(--wp-icon) center / contain no-repeat; }
.wp-icon-down { transform: rotate(90deg); }
.wp-viewbar, .wp-gridtools, .wp-actions, .wp-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.wp-viewbar { margin-bottom: 18px; }
.wp-actions { justify-content: flex-start; gap: 6px; }
#workloadView button { letter-spacing: 0; }
.wp-actions > button, .wp-detail header > button, .wp-detail-tickets article > button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; min-width: 32px; padding: 6px 9px; font-size: 12px; }
.wp-actions > button:not(.primary-button), .wp-detail header > button, .wp-detail-tickets article > button, [data-wp-undo] { border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--panel); cursor: pointer; }
#workloadView button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#workloadView button:hover { filter: brightness(1.07); }
.wp-actions > button > span:not(.wp-icon) { font-size: 11px; border-left: 1px solid var(--line); padding-left: 8px; }
.wp-segmented { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-soft); }
.wp-segmented button { border: 0; background: transparent; color: var(--muted); padding: 6px 10px; border-radius: 3px; min-height: 28px; font-size: 12px; white-space: nowrap; }
.wp-segmented button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px #0001; }
.wp-gridtools { margin-bottom: 12px; }
.wp-gridtools > div:first-child { display: grid; gap: 3px; }
.wp-gridtools strong { font-size: 14px; }
.wp-gridtools > div > span { font-size: 11px; color: var(--muted); }
.wp-grid-scroll { overflow: auto; max-height: 65vh; max-width: 100%; border: 1px solid var(--line); border-radius: 6px; scrollbar-width: auto; scrollbar-color: var(--line-strong) var(--panel-soft); }
#workloadView .wp-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.wp-person-col { width: 220px; }
.wp-period-col { width: 140px; }
.wp-total-col { width: 125px; }
#workloadView .wp-grid th, #workloadView .wp-grid td { padding: 9px; border: 0; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; background: var(--panel); }
#workloadView .wp-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-soft); color: var(--muted); height: 52px; font-size: 11px; font-weight: 600; }
#workloadView .wp-grid tr > :first-child { position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--line); }
#workloadView .wp-grid thead tr > :first-child { z-index: 3; }
.wp-grid th small, .wp-range small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); padding-top: 3px; }
.wp-grid th > span { color: var(--muted); margin-left: 5px; }
.wp-grid .wp-person { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 2px; border: 0; background: none; color: var(--text); text-align: left; }
.wp-person > span:last-child { min-width: 0; }
.wp-person strong { display: block; white-space: normal; overflow-wrap: anywhere; font-size: 12px; }
.wp-person small { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.wp-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: color-mix(in srgb,var(--accent) 12%,var(--panel)); color: var(--accent); font-size: 11px; }
#workloadView .wp-capacity { display: grid; align-content: center; gap: 5px; min-height: 69px; width: 100%; padding: 9px; background: var(--panel-soft); border: 1px solid transparent; border-radius: 5px; text-align: left; color: var(--text); font-variant-numeric: tabular-nums; }
.wp-capacity strong { font-size: 12px; white-space: nowrap; }
.wp-capacity strong span { font-weight: 400; color: var(--muted); }
.wp-capacity small { font-size: 10px; white-space: normal; }
#workloadView .wp-capacity.over { background: color-mix(in srgb,var(--red) 12%,var(--panel)); color: var(--red); }
#workloadView .wp-capacity.near { background: color-mix(in srgb,var(--amber) 11%,var(--panel)); }
#workloadView .wp-capacity.selected, #workloadView .wp-capacity:hover { border-color: var(--accent); }
.wp-load-track { display: block; width: 100%; height: 3px; background: color-mix(in srgb,var(--muted) 15%,transparent); border-radius: 1px; overflow: hidden; }
.wp-load-track i { display: block; height: 100%; background: var(--accent); }
.wp-load-track { display: flex; }
.wp-load-track i { flex-shrink: 0; }
.wp-capacity.over .wp-load-track i { background: var(--red); }
.wp-capacity.near .wp-load-track i { background: var(--amber); }
.wp-capacity.available .wp-load-track i { background: var(--green); }
.wp-range strong { font-size: 15px; }
#workloadView .wp-task-row td, #workloadView .wp-task-row th { background: var(--panel-soft); padding-top: 7px; padding-bottom: 7px; }
.wp-ticket-link { display: grid; gap: 4px; padding: 0; color: var(--text); border: 0; background: none; text-align: left; white-space: normal; max-width: 100%; line-height: 1.4; }
.wp-ticket-link b { color: var(--accent); font-size: 10px; }
.wp-ticket-link span { font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.wp-task-row .wp-ticket-link { padding-left: 23px; }
.wp-task-bar { display: block; width: 100%; padding: 5px 8px; border: 0; border-left: 3px solid var(--accent); border-radius: 3px; color: var(--text); background: color-mix(in srgb,var(--accent) 13%,var(--panel)); text-align: left; font-size: 11px; }
.wp-task-color-1 { border-left-color: var(--green); background: color-mix(in srgb,var(--green) 12%,var(--panel)); }
.wp-task-color-2 { border-left-color: var(--amber); background: color-mix(in srgb,var(--amber) 12%,var(--panel)); }
.wp-dash { color: var(--muted); }
.wp-footer { padding: 12px 0; color: var(--muted); font-size: 11px; }
.wp-definitions { padding: 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.wp-definitions summary { cursor: pointer; width: fit-content; }
.wp-definitions p { line-height: 1.7; max-width: 90ch; }
.wp-detail { position: relative; border-top: 2px solid var(--accent); margin-top: 14px; padding: 18px 0; background: var(--bg); outline-offset: 4px; }
.wp-detail header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.wp-detail h3 { margin: 5px 0; font-size: 17px; overflow-wrap: anywhere; }
.wp-detail header small, .wp-detail article small { color: var(--muted); font-size: 11px; }
.wp-detail-totals { display: flex; gap: 22px; flex-wrap: wrap; padding: 18px 0; font-size: 11px; color: var(--muted); }
.wp-detail-totals strong { display: block; font-size: 20px; color: var(--text); margin-bottom: 4px; }
.wp-detail-totals .wp-danger strong { color: var(--red); }
.wp-detail-tickets { border-top: 1px solid var(--line); }
.wp-detail-tickets article { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wp-detail-tickets article > div { min-width: 0; display: grid; gap: 5px; }
.wp-detail-tickets article > button { flex-shrink: 0; }
.wp-context-note { font-size: 12px; color: var(--muted); }
.wp-edit-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; max-width: 600px; padding-top: 16px; }
.wp-edit-form h4, .wp-edit-form p, .wp-edit-form output, .wp-edit-form .wp-actions { grid-column: 1 / -1; margin: 0; }
.wp-edit-form p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.wp-edit-form label { display: grid; gap: 6px; font-size: 12px; }
.wp-edit-form input, .wp-edit-form select { min-width: 0; width: 100%; }
.wp-edit-preview { padding: 10px 12px; background: var(--panel); border-left: 3px solid var(--accent); font-size: 12px; line-height: 1.5; }
.wp-discard { padding: 14px; margin-bottom: 16px; border: 1px solid var(--amber); border-radius: 6px; background: var(--panel); display: grid; gap: 12px; font-size: 13px; }
#workloadView .workload-alerts { border: 0; padding: 12px 0; border-radius: 0; background: none; }
#workloadView .workload-alerts summary { cursor: pointer; font-size: 12px; }
#workloadView .workload-alert-heading { padding-top: 15px; }
.wp-empty { padding: 24px !important; color: var(--muted); font-size: 12px; }
.wp-grid .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media(max-width: 800px) {
  body[data-density]:has(#workloadView.active), body[data-density].sidebar-collapsed:has(#workloadView.active):has(.shortcut-rail.collapsed) { grid-template-columns: minmax(0,1fr); }
  body[data-density]:has(#workloadView.active) .sidebar, body[data-density]:has(#workloadView.active) .shortcut-rail { min-width: 0; width: 100%; height: auto; min-height: 0; position: static; }
  body[data-density]:has(#workloadView.active) .app-shell { padding: 12px; min-width: 0; }
  body[data-density]:has(#workloadView.active) .topbar-primary, body[data-density]:has(#workloadView.active) .header-search { min-width: 0; width: 100%; }
  body[data-density]:has(#workloadView.active) .header-search-main { min-width: 0; }
  #workloadView .workload-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 0; }
  .wp-metric:nth-child(3) { padding-left: 0; }
  .wp-metric:nth-child(2) { border-right: 0; }
  .wp-person-col { width: 175px; }
  .wp-person .wp-avatar { display: none; }
  .wp-grid-scroll { max-height: 60vh; }
}
@container (max-width: 650px) { #workloadView .workload-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 0; } .wp-metric:nth-child(3) { padding-left: 0; } }
@media(prefers-reduced-motion: no-preference) { .wp-capacity { transition: background-color 120ms,border-color 120ms; } }

.wp-scopebar { --wp-scope-control-height: 32px; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 24px; margin-bottom: 14px; }
body[data-density="comfortable"] .wp-scopebar { --wp-scope-control-height: 54px; }
.wp-scopebar > label:not(.wp-toggle) { display: grid; gap: 5px; color: var(--muted); font-size: 11px; flex: 0 1 230px; min-width: 0; }
#workloadView .wp-scopebar select { width: 100%; min-width: 0; height: var(--wp-scope-control-height); min-height: var(--wp-scope-control-height); padding-block: 0; }
.wp-toggle { display: inline-flex; align-items: center; min-height: var(--wp-scope-control-height); gap: 9px; font-size: 12px; color: var(--text); cursor: pointer; }
#workloadView .wp-toggle input { appearance: none; position: relative; box-sizing: border-box; flex: 0 0 36px; width: 36px; min-width: 36px; max-width: 36px; height: 20px; min-height: 20px; max-height: 20px; margin: 0; padding: 0; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel-soft); cursor: pointer; }
#workloadView .wp-toggle input::before { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
#workloadView .wp-toggle input:checked { background: var(--accent); border-color: var(--accent); }
#workloadView .wp-toggle input:checked::before { transform: translateX(16px); background: white; }
#workloadView .wp-toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; box-shadow: none; }
@media(prefers-reduced-motion: no-preference) { #workloadView .wp-toggle input::before { transition: transform 120ms ease; } }
.wp-basis-label { font-size: 12px; color: var(--muted); }
.wp-workspace { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; align-items: start; min-width: 0; }
.wp-workspace > .wp-detail { min-width: 0; }
.wp-trend-col { width: 90px; }
.wp-sparkline { width: 100%; height: 44px; display: block; color: var(--blue, var(--accent)); }
#workloadView .wp-capacity { background: transparent; }
#workloadView .wp-capacity.available { color: var(--text); }
.wp-capacity.available .wp-load-track i { background: var(--blue, var(--accent)); }
.wp-load-track { height: 5px; }
#workloadView .wp-hatched { background: repeating-linear-gradient(135deg,color-mix(in srgb,var(--muted) 65%,transparent) 0 2px,color-mix(in srgb,var(--muted) 12%,var(--panel)) 2px 5px); }
.wp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.wp-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.wp-swatch { width: 12px; height: 12px; border-radius: 2px; background: var(--blue, var(--accent)); display: inline-block; }
.wp-over-swatch { background: var(--red); }
.wp-line-swatch { width: 20px; border-top: 1px dashed var(--muted); }
.wp-conflict { color: var(--red); }
.wp-other-row th { color: var(--muted); font-size: 11px; font-weight: 500; }
#workloadView .wp-bubble-cell { justify-items: center; text-align: center; min-height: 110px; gap: 4px; background: none; }
#workloadView .wp-capacity.wp-bubble-cell.over, #workloadView .wp-capacity.wp-bubble-cell.near { background: none; }
.wp-bubble { width: 64px; height: 64px; display: grid; place-items: center; position: relative; border-radius: 50%; color: var(--blue, var(--accent)); }
.wp-bubble::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: color-mix(in srgb,currentColor 13%,var(--panel)); }
.wp-bubble strong { position: relative; z-index: 1; color: var(--text); font-size: 13px; }
.wp-bubble svg { position: absolute; inset: 0; width: 64px; height: 64px; transform: rotate(-90deg); }
.wp-bubble circle { fill: none; stroke-width: 2.5; }
.wp-bubble-track { stroke: var(--line); }
.wp-bubble-value { stroke: currentColor; }
.wp-bubble.at-capacity { color: var(--accent); }
.wp-bubble-cell.over .wp-bubble { color: var(--red); }
.wp-bubble-cell.over .wp-bubble strong { color: var(--red); }
.wp-bubble.wp-unavailable { color: var(--muted); }
.wp-bubble-cell.over .wp-bubble.wp-unavailable { color: var(--red); }
.wp-bubble.wp-unavailable .wp-bubble-track { stroke-dasharray: 3 3; }
#workloadView .wp-grid .wp-timeline-td { padding: 0; }
.wp-timeline { width: 100%; min-width: 0; height: 96px; position: relative; }
.wp-timeline > svg { width: 100%; height: 96px; display: block; position: absolute; inset: 0; }
.wp-timeline-fill { fill: color-mix(in srgb,var(--blue, var(--accent)) 14%,transparent); }
.wp-svg-hatch { stroke: var(--muted); stroke-opacity: .55; stroke-width: 1; }
.wp-plan-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 11px; color: var(--muted); }
.wp-availability-note { display: inline-flex; align-items: center; gap: 4px; }
.wp-availability-note .wp-icon { width: 12px; height: 12px; }
.wp-booking-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 20px; }
.wp-booking-form h4, .wp-booking-form .wp-actions, .wp-booking-form output, .wp-booking-list, .wp-span { grid-column: 1 / -1; }
.wp-booking-form h4 { font-size: 14px; margin: 0; }
.wp-booking-form label { display: grid; gap: 5px; font-size: 11px; }
.wp-booking-form input, .wp-booking-form select { width: 100%; min-width: 0; min-height: 32px; }
.wp-booking-list, .wp-availability-list { max-height: 190px; overflow: auto; }
.wp-booking-list > div, .wp-availability-list > div { display: flex; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.wp-booking-list span, .wp-availability-list span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wp-booking-list strong, .wp-availability-list strong { display: block; margin: 3px 0; }
.wp-booking-list button, .wp-availability-list button { font-size: 10px; padding: 4px 6px; }
.wp-booking-form fieldset { border: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; }
.wp-booking-form fieldset[hidden] { display: none; }
.wp-booking-form fieldset label { display: flex; align-items: center; gap: 4px; }
.wp-booking-form fieldset input { width: 14px; min-height: 14px; }
.wp-detail[aria-label="Availability"] > .wp-detail-tickets { display: none; }
.wp-task-bar[draggable="true"] { cursor: grab; }
#workloadView [data-wp-cell].wp-drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.wp-timeline-line { fill: none; stroke: var(--blue, var(--accent)); stroke-width: 1.5; }
.wp-capacity-line { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.wp-load-point { fill: var(--blue, var(--accent)); }
.wp-over-point { fill: var(--red); }
.wp-timeline-points { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--wp-periods),minmax(0,1fr)); }
#workloadView .wp-timeline-points button { border: 1px solid transparent; border-right-color: var(--line); border-radius: 0; background: none; color: var(--text); padding: 7px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; min-width: 0; position: relative; }
#workloadView .wp-timeline-points button.wp-danger { color: var(--red); }
.wp-timeline-points strong { font-size: 11px; }
.wp-timeline-points small { font-size: 10px; color: var(--muted); }
#workloadView .wp-timeline-points button[aria-pressed="true"], #workloadView .wp-timeline-points button:hover { border-color: var(--accent); background: color-mix(in srgb,var(--accent) 5%,transparent); }
.wp-timeline-conflict { position: absolute; right: 7px; top: 36px; font-size: 12px; font-weight: 700; }
.wp-detail-heading { font-size: 12px; margin: 20px 0 10px; }
.wp-detail-split { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 8px 0 16px; color: var(--muted); font-size: 11px; }
.wp-daily { padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wp-daily summary { cursor: pointer; font-size: 12px; font-weight: 600; }
.wp-daily-scroll { max-height: 176px; overflow: auto; margin-top: 12px; }
.wp-daily-row { display: grid; grid-template-columns: 48px minmax(20px,1fr) 76px; align-items: center; gap: 10px; padding: 5px 1px; font-size: 10px; }
.wp-daily-row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.wp-daily-track { height: 10px; position: relative; background: var(--panel-soft); }
.wp-daily-track i { height: 100%; display: block; background: var(--blue, var(--accent)); }
.wp-daily-row.wp-danger .wp-daily-track i { background: var(--red); }
.wp-daily-track b { position: absolute; top: -2px; height: 14px; border-left: 1px dashed var(--muted); }
.wp-range-context { display: grid; gap: 6px; padding: 16px 0; font-size: 12px; }
.wp-range-context small { color: var(--muted); line-height: 1.5; font-size: 11px; }
@container (min-width: 1050px) {
  .wp-workspace.has-detail { grid-template-columns: minmax(0,1fr) 320px; gap: 20px; }
  .wp-workspace.has-detail > .wp-detail { margin-top: 0; padding: 14px 0 12px 18px; border-top: 0; border-left: 1px solid var(--line); max-height: 65vh; overflow: auto; scrollbar-gutter: stable; }
  .wp-workspace.has-detail .wp-detail-totals { gap: 12px; }
  .wp-workspace.has-detail .wp-detail-totals strong { font-size: 18px; }
}
