/* The work-type review is a quantity allocation workspace, from portion to source. */
#job-type-detail-dialog[data-view="job"]:has(.job-portion-layout) { width: min(1760px, calc(100vw - 32px)); }
#job-type-detail-dialog[data-view="job"] .job-assignment-detail.job-portion-layout { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.job-portion-layout .job-assignment-side { padding: 22px 20px; }
.job-portion-layout .job-split-heading h2 { font-size: 24px; line-height: 1.18; }
.job-portion-layout .job-split-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.job-portion-layout .job-split-meta > span { font-size: 10px; }
.job-portion-layout .job-assignment-intro p { line-height: 1.45; }
.job-portion-layout .job-assignment-intro [role="status"] { color: var(--muted); font-size: 11px; font-weight: 400; }
.portion-summary-metrics { display: grid; margin: 0; border-top: 1px solid var(--line); }
.portion-summary-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.portion-summary-metrics dt { color: var(--muted); font-size: 12px; }
.portion-summary-metrics dd { margin: 0; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.job-portion-layout .job-actuals-column { padding: 22px 20px; }
.portion-information { display: grid; gap: 18px; min-width: 0; }
.portion-information > header { display: block; margin: 0; }
.portion-information h3 { margin: 0 0 7px; font-size: 18px; line-height: 1.25; }
.portion-information header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.portion-info-group { min-width: 0; display: grid; gap: 12px; padding: 12px 0 0; margin: 0; border: 0; border-top: 1px solid var(--line); }
.portion-info-group legend { padding: 0 8px 0 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.portion-information label { min-width: 0; display: grid; gap: 6px; color: var(--ink-2); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.job-actuals-column #job-actuals-editor .portion-information .dialog-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 12px; }
.portion-information :is(input:not([type="checkbox"]), select, textarea) { width: 100%; min-width: 0; padding: 9px 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; font: 13px/1.4 var(--font-sans); }
.portion-information :is(input:not([type="checkbox"]), select) { height: 40px; }
.portion-information .portion-labour-only { display: flex; align-items: start; gap: 8px; line-height: 1.45; }
.portion-labour-only input { width: 16px; height: 16px; margin: 1px 0 0; flex: none; accent-color: var(--copper); }
.portion-information #actual-save-message { margin: 0; font-size: 12px; line-height: 1.45; }
.portion-information [data-save-job-actuals] { width: 100%; white-space: normal; font-size: 12px; }
.job-portion-used, .job-portion-layout .job-full-parts { min-width: 0; min-height: 0; position: relative; display: grid; align-content: start; gap: 14px; padding: 22px 14px; overflow-y: auto; overscroll-behavior: contain; }
.job-portion-used { padding-right: 22px; }
.job-portion-used::after { position: absolute; top: 22px; bottom: 22px; right: 0; width: 1px; background: rgba(255,255,255,.45); content: ""; pointer-events: none; }
.portion-column-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin: 0; }
.portion-column-heading > div { min-width: 0; }
.portion-column-heading h3 { margin: 0; color: #fff; font: 650 18px/1.25 var(--font-sans); }
.portion-column-heading h3 > span { margin-left: 4px; color: rgba(255,255,255,.8); font-size: 13px; font-weight: 500; }
.portion-column-heading p, .full-parts-instruction { margin: 6px 0 0; color: rgba(255,255,255,.9); font-size: 12px; line-height: 1.45; }
.portion-add-button { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 10px; min-height: 34px; font-size: 11px; }
.portion-add-button svg { width: 14px; height: 14px; }
.portion-drop-zone { min-width: 0; min-height: 180px; border: 1px dashed rgba(255,255,255,.6); border-radius: 10px; transition: border-color .15s, background .15s; }
.portion-drop-zone.has-parts { border: 1px solid transparent; border-radius: 0; }
.portion-drop-zone.is-drag-over { border: 2px dashed #efba90; background: rgba(185,93,44,.15); }
.portion-empty { display: grid; justify-items: center; gap: 9px; padding: 28px 18px; color: #fff; text-align: center; }
.portion-empty > svg { width: 28px; height: 28px; color: rgba(255,255,255,.8); }
.portion-empty h4 { margin: 0; font-size: 14px; }
.portion-empty p { margin: 0; color: rgba(255,255,255,.88); font-size: 12px; line-height: 1.5; }
.portion-empty .link-button { margin-top: 4px; color: #fff; }
.portion-used-list, .full-job-parts-list { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.portion-part-card, .full-job-part-card { display: grid; align-content: start; gap: 9px; min-width: 0; padding: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.full-job-part-card { transition: border-color .15s, box-shadow .15s; }
.full-job-part-card[draggable="true"] { cursor: grab; user-select: none; }
.full-job-part-card[draggable="true"]:active { cursor: grabbing; }
.full-job-part-card:hover, .full-job-part-card:focus-within { border-color: var(--copper); }
.full-job-part-card.is-used { background: #fff3e8; border-color: var(--copper); box-shadow: inset 3px 0 var(--copper); }
.full-job-part-card.is-dragging { opacity: .45; }
.portion-card-title { min-width: 0; display: flex; align-items: start; gap: 5px; }
.portion-card-title > strong { min-width: 0; flex: 1; font-size: 12px; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.part-card-actions { display: flex; flex: none; gap: 1px; margin: -4px -5px 0 0; }
.part-action-icon { width: 26px; height: 26px; display: inline-grid; place-items: center; flex: none; margin: 0; padding: 4px; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--muted); cursor: pointer; }
.part-action-icon svg { width: 16px; height: 16px; }
.part-action-icon:hover { color: var(--copper); }
.part-action-icon.is-destructive:hover { color: #a42e25; }
.part-action-icon:focus-visible, .part-use-button:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.part-action-icon:disabled { opacity: .45; cursor: wait; }
.part-drag-handle { flex: none; margin-left: -5px; color: #96999c; }
.part-drag-handle svg { width: 14px; height: 21px; }
.portion-card-meta { min-width: 0; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.portion-quantity-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.portion-quantity-row label { min-width: 0; flex: 1; display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.portion-quantity-row input { width: min(100%, 96px); height: 38px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink); font: 13px var(--font-sans); }
.portion-quantity-row input:focus-visible { outline: 2px solid var(--copper); outline-offset: 1px; }
.portion-quantity-row > div { display: grid; gap: 6px; text-align: right; }
.portion-quantity-row > div > span, .full-part-values span { color: var(--muted); font-size: 10px; }
.portion-quantity-row strong { padding-bottom: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.full-part-values { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.full-part-values > div { display: grid; gap: 5px; }
.full-part-values strong { font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.part-used-label { margin: 0; padding-top: 8px; border-top: 1px solid #dfb08b; color: var(--copper-dark); font-size: 11px; font-weight: 650; }
.part-use-button { display: flex; align-items: center; justify-content: start; gap: 7px; justify-self: start; min-height: 28px; padding: 2px 0; color: var(--copper-dark); border: 0; background: transparent; font: 600 12px var(--font-sans); cursor: pointer; }
.part-use-button svg { width: 16px; height: 16px; }
.part-use-button:disabled { color: var(--muted); cursor: default; }
.part-other-uses { padding-top: 7px; border-top: 1px solid var(--line); }
.portion-part-warning { margin: 0; color: #8c4115; font-size: 11px; line-height: 1.45; }
.portion-parts-total { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.4); color: #fff; font-size: 12px; line-height: 1.5; }
.portion-parts-total > strong { text-align: right; font-variant-numeric: tabular-nums; }
.portion-workspace-status, .portion-workspace-error { margin: 0; color: #fff; font-size: 12px; line-height: 1.5; }
.portion-workspace-status:empty { display: none; }
.portion-workspace-status.is-error, .portion-workspace-error { padding: 10px; color: #fff; background: #773b25; border-radius: 5px; }
.job-full-parts .source-job-metrics { padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.job-full-parts .source-job-metrics > div { padding-block: 12px; }
.job-full-parts .source-job-metrics dt { font-size: 9px; line-height: 1.45; }
.job-full-parts .source-job-metrics dd { white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
.full-job-quoted-work { color: #fff; font-size: 12px; line-height: 1.5; }
.full-job-quoted-work > summary { cursor: pointer; font-weight: 650; }
.full-job-quoted-work > p { color: rgba(255,255,255,.85); }
.full-job-quoted-work article { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.3); }
.full-job-quoted-work article p { grid-column: 1/-1; margin: 0; color: rgba(255,255,255,.85); }
.portion-mobile-jump { display: none; }
.job-part-edit-dialog { width: min(540px, calc(100vw - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; border-radius: 12px; }
.job-part-edit-dialog > header { position: sticky; top: 0; z-index: 2; margin: 0; padding: 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.job-part-edit-dialog h2 { font: 600 24px/1.2 var(--font-serif); }
.job-part-edit-dialog header .eyebrow { margin-bottom: 6px; }
.job-part-edit-dialog header .plain-icon-button { width: 24px; height: 24px; flex: none; padding: 0; border: 0; background: transparent; color: var(--muted); box-shadow: none; font-size: 24px; }
.job-part-edit-dialog form { padding: 0; }
.job-part-editor-body { display: grid; gap: 16px; padding: 22px; }
.job-part-editor-body > p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.job-part-editor-body .dialog-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
.job-part-editor-body label { min-width: 0; color: var(--ink-2); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.job-part-editor-body input { font: 13px var(--font-sans); }
.job-part-editor-body label small { color: var(--muted); font-size: 11px; font-weight: 400; }
.job-part-editor-body .part-editor-checkbox { display: flex; align-items: center; gap: 8px; }
.job-part-editor-body .part-editor-checkbox input { width: 16px; height: 16px; padding: 0; }
.job-part-edit-dialog footer { position: sticky; bottom: 0; z-index: 2; margin: 0; padding: 16px 22px; background: var(--surface); border-top: 1px solid var(--line); }
.job-part-editor-body .part-editor-duplicate:empty, .job-part-editor-body [role="status"]:empty { display: none; }
.job-part-editor-body .part-editor-duplicate { color: #865619; }
@media (max-width:1199px) {
  #job-type-detail-dialog[data-view="job"] > .job-type-detail-body { overflow-y: auto; }
  #job-type-detail-dialog[data-view="job"] .job-assignment-detail.job-portion-layout { grid-template-columns: repeat(2,minmax(0,1fr)); height: auto; gap: 20px 12px; }
  .job-portion-layout .job-assignment-side, .job-portion-layout .job-actuals-column, .job-portion-used, .job-portion-layout .job-full-parts { max-height: none; min-height: 0; overflow: visible; }
  .portion-mobile-jump { display: inline-block; justify-self: start; color: #fff; font-size: 12px; }
}
@media (max-width:760px) {
  #job-type-detail-dialog[data-view="job"] .job-assignment-detail.job-portion-layout { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .job-portion-layout .job-assignment-side, .job-portion-layout .job-actuals-column { padding: 20px 18px; }
  .job-portion-used, .job-portion-layout .job-full-parts { padding: 12px 8px; }
  .job-portion-used::after { display: none; }
  .job-part-edit-dialog footer { flex-wrap: wrap; }
}
@media (prefers-reduced-motion:reduce) {
  .full-job-part-card, .portion-drop-zone { transition: none; }
}
