/* Transparent layout only: the individual buttons provide all surfaces. */
#projectPage .project-header-actions[hidden] { display:none; }
/* This is a staging container only; its original controls are moved into the dock. */
.po-detail-page .po-action-bar { display:none; }
.po-detail-page [data-po-back] { display:inline-flex; align-items:center; gap:7px; }
.po-detail-page [data-po-back] svg { width:17px; height:17px; flex-shrink:0; }
.po-floating-actions .project-floating-controls { gap:10px; flex-wrap:wrap; }
.po-floating-actions .project-floating-controls .project-floating-context { position:static; }
.po-floating-actions [data-po-selection-count] { font-size:12px; }
:is(#projectPage, .po-detail-page, #viewRoot) .project-floating-actions {
  flex:0 0 auto;
  min-height:126px;
  padding:32px 8px max(6px, env(safe-area-inset-bottom));
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  background:none;
  border:0;
  box-shadow:none;
}
.project-floating-context {
  display:flex; align-items:center; justify-content:center; gap:10px;
  max-width:100%; font-size:12px; color:var(--muted); min-height:20px;
}
.project-floating-controls { position:relative; display:flex; align-items:center; justify-content:center; min-height:32px; }
.project-floating-controls .project-floating-context { position:absolute; left:calc(100% + 10px); white-space:nowrap; }
.project-floating-context button {
  flex-shrink:0; border:0; padding:5px; background:none; color:var(--ink);
  font:inherit; text-decoration:underline; cursor:pointer;
}
.project-floating-context button[hidden] { display:none; }
.project-floating-choices { display:flex; justify-content:center; gap:12px; max-width:100%; }
:is(#projectPage, .po-detail-page, #viewRoot) .project-floating-choices .button {
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  min-height:48px; padding:12px 19px; border-radius:999px;
  background:var(--card); color:var(--ink); border:1px solid var(--line);
  box-shadow:0 5px 16px #0f172a1c; font-size:13px;
  transform:translateY(14px);
  transition:transform 220ms ease-in, background-color 160ms ease, border-color 160ms ease;
}
:is(#projectPage, .po-detail-page, #viewRoot) .project-floating-actions.is-open .project-floating-choices .button {
  transform:translateY(0);
  transition:transform 360ms cubic-bezier(.22,1,.36,1), background-color 160ms ease, border-color 160ms ease;
}
:is(#projectPage, .po-detail-page, #viewRoot) .project-floating-choices .button:not(:disabled):hover,
:is(#projectPage, .po-detail-page, #viewRoot) .project-floating-choices .button:not(:disabled):focus-visible { background:var(--yellow); border-color:var(--yellow); color:var(--navy); }
.project-floating-choices svg, .project-floating-handle svg { width:19px; height:19px; flex-shrink:0; }
.project-floating-handle {
  display:inline-flex; align-items:center; gap:7px; min-height:32px;
  padding:5px 14px; border-radius:999px; border:1px solid var(--line);
  background:var(--ink); color:white; box-shadow:0 3px 10px #0f172a1a;
  font:600 12px/20px Inter, system-ui, sans-serif; cursor:pointer;
}
.project-floating-context, .project-floating-choices {
  visibility:hidden; opacity:0; pointer-events:none;
  transition:opacity 220ms ease, visibility 0s linear 220ms;
}
.project-floating-actions.is-open .project-floating-context,
.project-floating-actions.is-open .project-floating-choices {
  visibility:visible; opacity:1; pointer-events:auto;
  transition:opacity 360ms ease, visibility 0s;
}
.project-floating-actions button:focus-visible { outline:3px solid #2476be; outline-offset:3px; }
@media (max-width:600px) {
  :is(#projectPage, .po-detail-page, #viewRoot) .project-floating-actions { padding-inline:0; }
  .project-floating-choices { gap:7px; width:100%; }
  :is(#projectPage, .po-detail-page, #viewRoot) .project-floating-choices .button { flex:1; flex-direction:column; gap:4px; padding:8px 6px; font-size:11px; border-radius:16px; }
  .project-floating-context { font-size:11px; }
}
@media (prefers-reduced-motion:reduce) {
  .project-floating-context, .project-floating-choices { transition:none !important; }
  :is(#projectPage, .po-detail-page, #viewRoot) .project-floating-choices .button { transition:none !important; transform:none !important; }
}

/* Float over the calendar, with no surface and no hit area over unused space. */
#viewRoot .calendar-floating-actions {
  position:fixed; z-index:9; margin:0; pointer-events:none;
  min-height:60px; padding:6px 8px; gap:0;
}
#viewRoot .calendar-floating-actions[hidden] { display:none; }
.has-floating-calendar-actions .installer-programme-board { padding-bottom:80px; }

/* Workspace actions share the floating button style and reserve their own bottom space. */
.main-content:has(#viewRoot:not([hidden]) > .workspace-bottom-layout) { display:flex; flex-direction:column; height:100dvh; min-height:480px; padding-bottom:12px; }
.main-content:has(#viewRoot:not([hidden]) > .workspace-bottom-layout) > .workspace-sticky-header { flex:0 0 auto; }
.main-content:has(#viewRoot:not([hidden]) > .workspace-bottom-layout) > .workspace-sticky-header::after { display:none; }
#viewRoot:not([hidden]):has(> .workspace-bottom-layout) { display:flex; flex:1 1 0; min-width:0; min-height:0; }
.workspace-bottom-layout { display:flex; flex-direction:column; flex:1 1 0; min-width:0; min-height:0; }
.workspace-bottom-content { flex:1 1 0; min-width:0; min-height:0; overflow:auto; scrollbar-gutter:stable; padding:10px 2px 12px; }
.workspace-bottom-content:focus-visible { outline:2px solid var(--navy); outline-offset:-2px; }
#viewRoot .workspace-bottom-action { min-height:68px; padding:8px 8px max(8px,env(safe-area-inset-bottom)); gap:0; }
#viewRoot .workspace-bottom-action[hidden] { display:none; }
#viewRoot .workspace-bottom-action .project-floating-choices { width:auto; flex-wrap:wrap; }
#viewRoot .workspace-bottom-action .button { width:auto; height:auto; flex:none; flex-direction:row; }
#viewRoot .workspace-bottom-action .button[hidden] { display:none; }
.workspace-heading-help { position:relative; }
.workspace-heading-help h3 { width:fit-content; cursor:help; }
.workspace-heading-help h3:focus-visible { outline:2px solid var(--navy); outline-offset:3px; }
.workspace-heading-help h3:not(.tooltip-dismissed):is(:hover,:focus) + .page-title-tooltip,
.workspace-heading-help:has(h3:not(.tooltip-dismissed)) .page-title-tooltip:hover { visibility:visible; opacity:1; }
.workspace-heading-help h3.tooltip-dismissed + .page-title-tooltip { visibility:hidden; opacity:0; }
:root .workspace-heading-help > .page-title-tooltip { margin:0; color:#fff; }

/* PO and Projects directories share title/input tracks and column sizing. */
:is(.po-directory .po-table, .project-review-directory-table) thead th { vertical-align:top; line-height:24px; }
:is(.po-directory .po-table, .project-review-directory-table) .po-column-filter {
  display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:24px 32px;
  gap:6px; margin:0; padding:0; font:inherit; color:inherit;
}
:is(.po-directory .po-table, .project-review-directory-table) .po-sort,
:is(.po-directory .po-table, .project-review-directory-table) .po-column-filter > span {
  display:flex; align-items:center; justify-content:flex-start;
  min-height:24px; margin:0; padding:0; line-height:24px;
}
:is(.po-directory .po-table, .project-review-directory-table) .po-column-filter > input {
  grid-row:2; align-self:stretch; height:32px; min-height:32px;
  margin:0; padding:6px 8px; line-height:18px; box-sizing:border-box;
}
:is(.po-directory .po-resizable-table, .project-review-directory-table.po-resizable-table) { table-layout:fixed; min-width:0; }
:is(.po-directory .po-resizable-table, .project-review-directory-table.po-resizable-table) th { position:relative; white-space:normal; }
:is(.po-directory .po-resizable-table, .project-review-directory-table.po-resizable-table) :is(th,td) { overflow:hidden; text-overflow:ellipsis; }
:is(.po-directory .po-resizable-table, .project-review-directory-table.po-resizable-table) .po-column-filter input { min-width:0; }
:is(.po-directory .po-resizable-table, .project-review-directory-table.po-resizable-table) .po-column-filter { grid-template-rows:var(--po-review-heading-height,24px) 32px; }
:is(.po-directory .po-resizable-table, .project-review-directory-table.po-resizable-table) .po-sort {
  display:grid; grid-template-columns:minmax(0,1fr) max-content;
  align-items:start; align-self:start; width:100%; max-width:100%;
  white-space:normal; line-height:14px; text-align:left;
}
:is(.po-directory .po-resizable-table, .project-review-directory-table.po-resizable-table) th .po-review-heading-text {
  display:block; align-self:start; min-height:0; min-width:0; max-width:100%;
  white-space:normal; overflow-wrap:anywhere; line-height:14px; overflow:visible;
}
:is(.po-directory .po-resizable-table, .project-review-directory-table.po-resizable-table) [data-po-sort-icon] { line-height:14px; }
.po-review-column-resizer {
  position:absolute; top:0; right:0; bottom:0; width:10px; z-index:3;
  cursor:col-resize; touch-action:none; user-select:none;
}
.po-review-column-resizer::after {
  content:""; position:absolute; top:8px; bottom:8px; right:3px;
  width:1px; background:#bac9d3;
}
.po-review-column-resizer:hover::after,
.po-review-column-resizer:focus-visible::after { background:var(--navy); }
.po-review-column-resizer:focus-visible { outline:1px solid var(--navy); outline-offset:-2px; }
.po-column-resizing, .po-column-resizing * { cursor:col-resize !important; user-select:none !important; }
/* Project detail copy and labelled controls, shared presentation. */
.project-contact-directory > header > :is([data-contact-new], [data-contact-link]) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.project-contact-directory > header > .button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}
.project-budget-toolbar .project-budget-checkbox {
  gap: 9px;
  padding: 8px 0;
}
.project-review-budget-help {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 72ch;
}
/* Compact Project editors retain readable labels and normal mobile targets. */
#projectDeliveryDetailsForm .delivery-information-heading { margin:8px 0 12px; }
#projectDeliveryDetailsForm :is(.delivery-fields, .field-grid),
#projectContactForm .field-grid { row-gap:10px; }
#projectDeliveryDetailsForm label:not(.checkbox-label),
#projectContactForm label:not(.checkbox-label) { gap:4px; }
#projectDeliveryDetailsForm input:not([type=checkbox]),
#projectContactForm input:not([type=checkbox]),
#projectContactForm select { min-height:36px; padding:7px 10px; }
#projectDeliveryDetailsForm .project-portal-editor { padding:10px 14px; margin-top:10px; }
#projectDeliveryDetailsForm .project-portal-editor > header { margin-bottom:8px; }
#projectDeliveryDetailsForm .project-portal-editor h3 { margin:0; }
#projectDeliveryDetailsForm .portal-password-actions { padding-top:16px; }
#projectDeliveryDetailsForm .modal-actions,
#projectContactForm .modal-actions { margin-top:12px; padding-top:0; }
#projectDeliveryDetailsForm button[type=submit] { display:inline-flex; align-items:center; gap:7px; }
#projectDeliveryDetailsForm button[type=submit] svg { width:17px; height:17px; flex:none; }
#projectContactForm .modal-heading { margin-bottom:12px; }
#projectContactForm textarea { min-height:70px; padding:7px 10px; }
#projectContactForm .contact-active-field { margin-top:10px; }
#projectContactForm .contact-job-title-field > label { margin-bottom:4px; }
#projectContactForm [data-contact-role-list-retry] { padding:4px 10px; min-height:28px; }
.project-more-fields {
  position:fixed; z-index:10; height:38px; display:flex; align-items:flex-end; justify-content:center;
  pointer-events:none; background:linear-gradient(transparent, var(--canvas) 65%);
}
.project-more-fields[hidden] { display:none; }
.project-more-fields button {
  pointer-events:auto; border:1px solid var(--line); border-radius:16px; background:var(--canvas);
  color:var(--ink); padding:5px 12px; font:inherit; font-size:12px; cursor:pointer;
}
.project-more-fields button:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
@media(max-width:760px), (pointer:coarse) {
  #projectDeliveryDetailsForm input:not([type=checkbox]),
  #projectContactForm input:not([type=checkbox]),
  #projectContactForm select { min-height:44px; }
  #projectDeliveryDetailsForm .portal-password-actions { padding-top:0; }
}
.project-contact-heading-tip { margin-left:8px; vertical-align:middle; }
.project-contact-heading-tip .form-help-tooltip-content { top:calc(100% + 8px); bottom:auto; }
/* Delivery creation refinements; QC/NCR attachment controls remain available. */
.delivery-create-modal #recordForm > .attachment-field { display:none; }
.delivery-create-modal .secondary-contact-picker { margin:12px 0; padding:10px 12px; font-size:11px; color:#5d6a7d; }
.delivery-create-modal .secondary-contact-picker legend { font-size:11px; font-weight:700; color:#5d6a7d; }
.delivery-create-modal .secondary-contact-picker :is(p, small, label),
.delivery-create-modal .secondary-contact-picker > div { font-size:11px; line-height:1.4; color:#5d6a7d; }
.delivery-create-modal .secondary-contact-picker p { margin:4px 0 8px; }
.delivery-create-modal .modal-heading { position:relative; }
.delivery-create-modal #modalIntro.form-help-tooltip-content {
  top:100%; bottom:auto; margin:6px 0 0; max-width:min(460px,75vw); pointer-events:auto;
  color:#fff; font-size:11px; font-weight:600;
}
.delivery-create-modal #modalTitle:hover + #modalIntro,
.delivery-create-modal #modalTitle:focus + #modalIntro,
.delivery-create-modal #modalIntro:hover { opacity:1; transform:translateY(0); visibility:visible; }
.delivery-create-modal #modalTitle:focus-visible { outline:2px solid var(--ink); outline-offset:3px; }
/* Freeze the Projects directory through its column headings and filters. */
.main-content:has(> #viewRoot:not([hidden]) #projectTable) {
  height:100dvh; min-height:520px; display:flex; flex-direction:column; padding-bottom:20px;
}
.main-content:has(> #viewRoot:not([hidden]) #projectTable) > .workspace-sticky-header { flex:0 0 auto; }
#viewRoot:not([hidden]):has(#projectTable) { display:flex; flex-direction:column; flex:1 1 0; min-height:0; min-width:0; }
#viewRoot:has(#projectTable) > .project-list-toolbar { flex:0 0 auto; }
#viewRoot:has(#projectTable) > .list-panel { display:flex; flex-direction:column; flex:1 1 0; min-height:0; min-width:0; }
#viewRoot:has(#projectTable) > .list-panel > .table-wrap {
  flex:1 1 0; min-height:0; overflow:auto; scrollbar-gutter:stable; overscroll-behavior:contain;
}
#viewRoot table:has(> tbody#projectTable) { border-collapse:separate; border-spacing:0; }
#viewRoot table:has(> tbody#projectTable) > thead { position:sticky; top:0; z-index:2; }
