/* Collection surfaces share alignment, not a fixed card height.
   Workspace tokens remain in workspace.css. Project/job cards are unchanged. */
.document-reuse-action { min-height:44px; white-space:nowrap; }
.document-reuse-action--compact { padding-inline:8px; font-size:13px; }
.document-card-controls .document-card-primary-actions > .document-reuse-action--compact { padding-inline:8px; font-size:13px; min-height:44px; }
.document-reuse-label-short { display:none; }
@media(max-width:760px) {
  .document-reuse-action--compact .document-reuse-label-full { display:none; }
  .document-reuse-action--compact .document-reuse-label-short { display:inline; }
}
.workspace-resume-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; padding:10px 14px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.workspace-resume-project { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; flex:1 1 320px; min-width:0; min-height:44px; padding:4px; border:0; background:transparent; color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.workspace-resume-project strong { font-size:15px; overflow-wrap:anywhere; }
.workspace-resume-label { color:var(--muted); font-size:13px; }
.workspace-resume-jumps { display:flex; gap:6px; flex-shrink:0; }
.workspace-resume-jumps .text-button { min-height:44px; padding:8px; font-size:13px; }
.workspace-resume-project:hover strong { color:var(--brand); }
.workspace-resume-project:active { background:var(--bg); }
.workspace-resume-project:focus-visible { outline:3px solid var(--brand); outline-offset:3px; border-radius:6px; }
.workspace-first-step { margin:0 0 12px; color:var(--muted); font-size:14px; line-height:1.8; }
#workspaceAttention, #workspaceRecent { scroll-margin-top:90px; }
/* Main section headings live inside the same white panel surface. */
#workspace .feature-directory-group.feature-directory-create { padding:16px 20px; border:1px solid var(--line); border-radius:10px; background:var(--panel); gap:12px; }
#workspace .feature-directory-create > :is(h2,h3) { margin:0; }
#workspace .feature-directory-create > .workspace-first-step { grid-column:1/-1; margin:0; }
#workspace .feature-directory-create .home-action { box-shadow:none; }
#workspace .workspace-management-disclosure > summary { padding-inline:20px; }
#workspace .workspace-management-disclosure > summary > strong { color:var(--ink); font-size:var(--workspace-section-heading-size); font-weight:var(--workspace-heading-weight); line-height:var(--workspace-section-heading-leading); }
@media(max-width:760px) {
  #workspace .feature-directory-group.feature-directory-create { padding:12px 16px; }
  #workspace .workspace-management-disclosure > summary { padding-inline:16px; }
}
/* Daily work is one white surface; counts stay compact when there is no list. */
.workspace-work-panel { min-width:0; border:1px solid var(--line); border-radius:10px; background:var(--panel); container-type:inline-size; container-name:home-work; }
.workspace-work-panel > .workspace-drafts { min-width:0; padding:16px 20px; }
.workspace-work-panel > .workspace-drafts-empty { min-height:56px; padding:12px 20px; }
.workspace-work-panel .workspace-drafts-heading { justify-content:space-between; margin-bottom:8px; }
.workspace-work-panel .workspace-drafts-heading h2 { margin:0; }
.workspace-work-panel .workspace-drafts-empty .workspace-drafts-heading { width:100%; margin:0; }
.workspace-work-panel .workspace-draft-count { font-variant-numeric:tabular-nums; }
.workspace-work-panel .draft-resume-row { min-height:64px; margin:0; padding:12px 0; border:0; border-top:1px solid var(--line); border-radius:0; background:transparent; }
.workspace-work-panel .draft-resume-row:hover { background:var(--bg); }
.workspace-work-panel .workspace-drafts > details { border-top:1px solid var(--line); }
.workspace-work-panel .workspace-drafts > details > summary { min-height:44px; padding-block:10px; cursor:pointer; font-size:14px; }
.workspace-attention { display:grid; gap:12px; min-width:0; padding:16px 20px; }
.workspace-drafts + .workspace-attention { border-top:1px solid var(--line); }
.workspace-attention > .workspace-section-heading { min-height:44px; padding:0; }
.workspace-attention .workspace-section-heading h2 { margin:0; }
.workspace-attention .workspace-section-heading > button { flex-shrink:0; min-height:44px; padding:6px 0; font-size:14px; white-space:nowrap; }
.workspace-attention .workspace-board-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; min-width:0; border:1px solid var(--line); border-radius:6px; }
.workspace-attention .workspace-board-filters:has(> button:nth-child(2):last-child) { grid-template-columns:repeat(2,minmax(0,1fr)); }
.workspace-attention .workspace-board-filters > button { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; min-height:56px; padding:10px 14px; border:0; border-radius:0; background:transparent; color:var(--muted); font-size:14px; line-height:1.5; cursor:pointer; }
.workspace-attention .workspace-board-filters > button + button { border-left:1px solid var(--line); }
.workspace-attention .workspace-board-filters > button:hover { background:var(--bg); color:var(--ink); }
.workspace-attention .workspace-board-filters > button[aria-pressed="true"] { color:var(--brand-dark); background:var(--panel-strong); box-shadow:inset 0 -2px 0 var(--brand); font-weight:600; }
.workspace-attention .workspace-board-filters > button:focus-visible { outline-offset:-3px; }
.workspace-attention .board-filter-count { display:inline-flex; align-items:baseline; justify-content:flex-end; gap:3px; flex:0 0 auto; width:auto; height:auto; min-width:24px; border-radius:0; background:transparent; font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
.workspace-attention .board-filter-count > small { font-size:12px; font-weight:400; }
.workspace-attention .workspace-board { grid-template-columns:minmax(0,1fr); gap:0; }
.workspace-attention .workspace-board > .workspace-board-empty,
.workspace-attention .workspace-board-column:not(.board-current),
.workspace-attention .workspace-board:not(:has(> .workspace-board-column.board-current)) { display:none; }
.workspace-attention .workspace-board-column.workspace-overview-row { padding:8px 0 0; border:0; border-radius:0; background:transparent; }
.workspace-attention .workspace-board-head > span { display:none; }
.workspace-attention .workspace-board-column .workspace-board-head { grid-template-columns:minmax(0,1fr); }
.workspace-attention .workspace-board-head small { text-wrap:balance; }
.workspace-attention .collection-load-error { margin:0; }

/* Recent records share one ledger-like panel instead of three large cards. */
.workspace-recent { display:block; min-width:0; border:1px solid var(--line); border-radius:10px; background:var(--panel); container-type:inline-size; container-name:home-recent; }
.workspace-recent > .workspace-recent-group { grid-template-columns:160px minmax(0,1fr) auto; align-items:center; gap:12px 16px; padding:12px 20px; border:0; border-radius:0; background:transparent; }
.workspace-recent > .workspace-recent-group + .workspace-recent-group { border-top:1px solid var(--line); }
.workspace-recent .workspace-recent-heading { display:contents; }
.workspace-recent .workspace-recent-heading > h2 { grid-column:1; grid-row:1; }
.workspace-recent .workspace-recent-heading > :is(button,.workspace-recent-links) { grid-column:3; grid-row:1; }
.workspace-recent .workspace-recent-links { justify-content:flex-end; gap:0 12px; }
.workspace-recent .workspace-recent-items { grid-column:2; grid-row:1; }
.workspace-recent .workspace-recent-items > .mini-row { min-height:60px; padding:6px 12px; }
.workspace-recent .workspace-recent-items > .mini-row > strong { font-size:15px; }
.workspace-recent .workspace-recent-items > .mini-row > span { font-size:13px; }
.workspace-recent .workspace-recent-items > .mini-row > time { font-size:12px; }
.workspace-recent .workspace-recent-items > .empty-note { padding:4px 12px; font-size:14px; }
@container home-work (max-width:720px) {
  .workspace-attention .workspace-board-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .workspace-attention .workspace-board-filters > button:nth-child(odd) { border-left:0; }
  .workspace-attention .workspace-board-filters > button:nth-child(n+3) { border-top:1px solid var(--line); }
}
@container home-recent (max-width:900px) {
  .workspace-recent > .workspace-recent-group { grid-template-columns:minmax(0,1fr); gap:4px; }
  .workspace-recent .workspace-recent-heading { display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:0 12px; padding:0; border:0; }
  .workspace-recent .workspace-recent-items { grid-column:1; grid-row:2; }
  .workspace-recent .workspace-recent-items > .mini-row:first-child { border-left:0; padding-left:0; }
  .workspace-recent .workspace-recent-items > .empty-note { padding:2px 0; border:0; }
}
@media(max-width:760px) {
  .workspace-work-panel > .workspace-drafts { padding:12px 16px; }
  .workspace-work-panel > .workspace-drafts-empty { min-height:52px; }
  .workspace-attention { padding:12px 16px; }
  .workspace-attention .workspace-board-filters > button { min-height:52px; padding-inline:10px; }
  .workspace-recent > .workspace-recent-group { padding:12px 16px; }
}
/* Home entry roles: primary creation cards, compact destinations, supporting
   links, and existing record names keep distinct, shared treatments. */
#workspace {
  --home-entry-label-size:16px;
  --home-entry-label-weight:600;
  --home-link-size:14px;
  --home-record-name-size:15px;
}
#workspace .workspace-home-link {
  display:inline-flex; align-items:center; justify-content:center; gap:4px;
  min-width:0; min-height:44px; max-width:100%; padding:6px 8px;
  border-radius:6px; color:var(--brand-dark); font-size:var(--home-link-size);
  font-weight:var(--home-entry-label-weight); line-height:1.5;
}
#workspace .workspace-home-link > [aria-hidden="true"] { flex:none; width:16px; text-align:center; }
#workspace .workspace-home-link:hover { background:var(--bg); text-decoration:underline; text-underline-offset:3px; }
#workspace .workspace-home-link:active { background:var(--panel-strong); }
#workspace .workspace-home-link:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
#workspace .workspace-resume-jumps { flex-wrap:wrap; max-width:100%; }
#workspace .workspace-recent-links { margin-inline-start:auto; }
#workspaceManagement .home-action {
  grid-template-columns:24px minmax(0,1fr); align-items:center; gap:12px;
  min-height:64px;
}
#workspaceManagement .home-action > svg { width:24px; height:24px; margin:0; }
#workspaceManagement .home-action strong {
  font-size:var(--home-entry-label-size); font-weight:var(--home-entry-label-weight); line-height:1.5;
}
#workspace :is(.workspace-task-row > .mini-row, .workspace-recent-items > .mini-row, .draft-resume-row, .workspace-resume-project) strong {
  font-size:var(--home-record-name-size); font-weight:700; line-height:1.5;
}
#workspace .workspace-management-disclosure > summary {
  display:grid; grid-template-columns:auto minmax(0,1fr) 16px;
  align-items:center; gap:8px 12px; list-style:none; border-radius:inherit;
}
#workspace .workspace-management-disclosure > summary::-webkit-details-marker { display:none; }
#workspace .workspace-management-disclosure > summary::marker { content:""; }
#workspace .workspace-management-disclosure > summary > span { min-width:0; margin:0; }
#workspace .workspace-management-chevron { display:block; width:16px; height:16px; color:var(--brand-dark); }
#workspace .workspace-management-disclosure[open] > summary > .workspace-management-chevron { transform:rotate(90deg); }
#workspace .workspace-management-disclosure > summary:hover { background:var(--bg); }
#workspace .workspace-management-disclosure > summary:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
@media(max-width:760px) {
  #workspace .workspace-management-disclosure > summary { grid-template-columns:minmax(0,1fr) 16px; }
  #workspace .workspace-management-disclosure > summary > strong { grid-column:1; grid-row:1; }
  #workspace .workspace-management-disclosure > summary > span { grid-column:1; grid-row:2; }
  #workspace .workspace-management-disclosure > summary > .workspace-management-chevron { grid-column:2; grid-row:1 / 3; }
}
@media(max-width:600px) {
  #workspace .workspace-recent .workspace-recent-items > .mini-row { padding:12px 0; }
}
@media(max-width:359px) {
  #workspaceManagement :is(.feature-directory-manage, .feature-directory-finance) .home-action {
    grid-template-columns:minmax(0,1fr); align-content:start; justify-items:start; gap:6px;
  }
}

/* Section headings share one scale; object names, card titles and diagram
   labels retain their own roles and existing sizes. */
#workspace :is(.feature-directory-create > h2, .feature-directory-create > h3, .workspace-drafts-heading > h2, .workspace-section-heading > h2, .workspace-recent-heading > h2),
#projectsView .customer-projects-shell .collection-toolbar > h2,
#projectDetailView .project-detail-shell > .section-block:not(.project-context-header) > .section-title h2,
#projectJobsPanel .project-job-detail-head h3,
#projectJobsPanel .project-progress-choice > h3,
#projectJobsPanel .project-progress-empty > h3,
#documentsView .document-center-heading h2 {
  font-size:var(--workspace-section-heading-size);
  font-weight:var(--workspace-heading-weight);
  line-height:var(--workspace-section-heading-leading);
}
#workspace :is(.feature-directory-create > h2, .feature-directory-create > h3, .workspace-drafts-heading > h2, .workspace-section-heading > h2, .workspace-recent-heading > h2) { color:var(--ink); }
@media(max-width:760px) {
  .workspace-resume-bar { flex-wrap:wrap; gap:0 10px; padding:8px 12px; }
  .workspace-resume-project { flex-basis:100%; grid-template-columns:minmax(0,1fr) auto; gap:2px 8px; }
  .workspace-resume-label { grid-column:1/-1; }
  .workspace-resume-jumps { flex:1 1 100%; min-width:0; flex-wrap:wrap; margin-left:0; }
}
.document-center-shell { display:grid; gap:16px; }
.document-center-heading.section-block { padding:var(--workspace-panel-padding); border:1px solid var(--line); border-radius:var(--workspace-panel-radius); background:var(--panel); box-shadow:none; }
.document-center-heading .section-title { display:flex; flex-direction:row; margin:0; gap:12px 16px; }
.document-center-heading .section-title > div:first-child { flex:1 1 auto; min-width:0; }
.document-center-heading .section-actions { display:flex; flex:0 0 auto; grid-template-columns:none; margin:0; }
.document-center-heading .section-actions > button { width:auto; min-height:44px; padding:10px 14px; white-space:nowrap; }
.document-center-heading p:not(.eyebrow) { max-width:64ch; margin:6px 0 0; font-size:14px; line-height:1.7; color:var(--muted); }
.document-center-list-section.section-block { padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.collection-filter-panel { padding:16px; border:1px solid var(--line); border-radius:8px; background:var(--panel); }
.collection-filter-panel .document-status-shortcuts { gap:6px; margin:0 0 14px; }
.collection-filter-panel .document-status-shortcuts > button { min-height:44px; padding:8px 12px; font-size:14px; line-height:1.5; white-space:nowrap; }
.collection-filter-panel .document-center-filters { margin:0; gap:12px; }
.collection-filter-panel .document-center-result-head { margin-top:10px; padding-top:10px; border-top:1px solid var(--line); border-bottom:0; min-height:0; font-size:13px; }
.collection-filter-panel .document-center-filters label > span { font-size:13px; line-height:1.5; font-weight:600; }
.document-center-list { padding-top:12px; gap:10px; container-type:inline-size; container-name:document-list; }
.document-center-card { grid-template-columns:minmax(0,1fr) minmax(340px,370px); grid-template-areas:'head meta' 'main controls'; gap:6px 20px; padding:14px 16px; }
.document-card-head { gap:6px 10px; }
.document-card-head > .document-status-summary { margin-left:auto; }
.document-card-main { gap:2px; }
.document-card-main h3 { font-size:16px; line-height:1.55; text-wrap:initial; }
.document-card-main p { margin:2px 0 0; line-height:1.6; }
.document-card-context { display:flex; flex-wrap:wrap; align-items:center; gap:0 12px; min-width:0; }
.document-card-context > p { flex:0 1 auto; min-width:0; max-width:100%; margin:0; }
.document-card-main .open-project { padding-block:4px; }
.document-card-meta { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:baseline; gap:6px 18px; padding:0; }
.document-card-meta > div { gap:4px; }
.document-card-meta dd { white-space:nowrap; font-variant-numeric:tabular-nums; }
.document-card-controls { padding-top:2px; justify-content:flex-end; align-self:end; }
.document-card-primary-actions { flex:0 1 auto; gap:6px; }
.document-card-controls > .document-card-more { flex:0 0 auto; }
.document-report-card-main h3 { text-wrap:initial; }
.document-report-card-meta { align-content:center; }
.document-report-card-actions { align-items:center; }
.customer-directory-panel > .section-title { display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; margin-bottom:12px; }
.customer-directory-panel > .section-title > div:first-child { flex:1 1 auto; min-width:0; }
.customer-directory-panel > .section-title > .back-button { flex:0 0 auto; margin:0; font-size:13px; white-space:nowrap; }
.customer-directory-panel > .back-button { margin-bottom:8px; }
.customer-directory-panel .section-title h2 { color:var(--ink); font-size:var(--workspace-section-heading-size); font-weight:var(--workspace-heading-weight); line-height:var(--workspace-section-heading-leading); }
.customer-directory-panel .customer-form-disclosure { margin:12px 0 16px; }
.customer-directory-panel .customer-form-trigger { min-height:44px; padding-block:10px; font-size:14px; }
.customer-directory-panel .directory-search { margin:0 0 12px; }
.customer-action-row { align-items:center; padding-block:14px; }
.customer-action-row .row-main { gap:4px; }
.customer-record-meta { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 12px; min-width:0; color:var(--muted); font-size:14px; line-height:1.65; }
.customer-record-meta > span { min-width:0; overflow-wrap:anywhere; }
.customer-action-row .row-main > small { margin-top:2px; color:var(--muted); font-size:13px; line-height:1.65; }
.customer-action-row > .list-action-toolbar { flex-wrap:nowrap; gap:6px; }
.customer-action-row > .list-action-toolbar > .row-more-actions { flex:0 0 auto; }
@media (min-width:761px) and (max-width:1050px) {
 .customer-action-row > .list-action-toolbar { flex-wrap:wrap; }
}
@media (max-width:760px) {
 .main > .topbar { grid-template-columns:minmax(0,1fr); gap:8px 12px; margin-bottom:16px; min-height:44px; align-items:center; }
 .main > .topbar > .topbar-title:not(.visually-hidden) { grid-column:1; grid-row:1; align-self:center; margin:0; font-size:20px; line-height:1.5; }
 .main > .topbar > .topbar-actions { grid-column:2; grid-row:1; gap:6px; justify-self:end; }
 .topbar-actions > .workspace-help-button { width:44px; height:44px; min-width:44px; min-height:44px; border-radius:8px; }
 .main:has(> #workspace.active) > .topbar { display:none; }
 .document-center-shell { gap:12px; }
 .document-center-heading .section-title { flex-wrap:nowrap; align-items:center; gap:10px; }
 .document-center-heading .section-title > div:first-child { flex:1 1 auto; }
 .document-center-heading .section-actions { width:auto; }
 .document-center-heading .section-actions > button { padding-inline:12px; font-size:14px; }
 .document-center-heading .section-actions > button > svg { width:20px; height:20px; flex:0 0 20px; }
 .collection-filter-panel { padding:14px; }
 .collection-filter-panel .document-status-shortcuts { display:flex; flex-wrap:wrap; margin-bottom:12px; gap:6px; }
 .collection-filter-panel .document-status-shortcuts > button { padding-inline:10px; }
 .collection-filter-panel .document-center-filters { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; }
 .collection-filter-panel .document-search-field { grid-column:1 / -1; }
 .collection-filter-panel .document-search-field > span { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
 .collection-filter-panel .document-center-filters input,
 .collection-filter-panel .document-center-filters select { min-height:44px; font-size:16px; padding-block:10px; }
 .document-center-card { grid-template-columns:minmax(0,1fr); grid-template-areas:'head' 'main' 'meta' 'controls'; gap:6px; padding:12px 14px; }
 .document-card-main h3 { font-size:15px; }
 .document-card-main p, .document-card-main p .text-button { font-size:14px; }
 .document-card-meta { justify-content:flex-start; gap:4px 16px; padding:0; }
 .document-card-meta dt { font-size:12px; }
 .document-card-meta dd { font-size:14px; }
 .document-card-controls { width:100%; justify-content:flex-start; padding-top:8px; gap:6px; }
 .document-card-controls > .document-card-primary-actions { display:flex; flex-wrap:wrap; gap:6px; }
 .document-card-controls > .document-card-primary-actions > button { width:auto; flex:0 0 auto; min-height:44px; padding-inline:10px; font-size:14px; }
 .document-card-controls > .document-card-primary-actions > .document-pdf-action { width:44px; padding:10px; }
 .document-card-controls > .document-card-more { margin-left:auto; }
 .document-report-card { gap:6px; padding:12px 14px; }
 .document-report-card-main h3 { font-size:15px; }
 .document-report-card-meta { gap:4px 16px; }
 .document-report-card-actions { padding-top:8px; }
 .customer-directory-panel { padding:16px; }
 .customer-directory-panel .customer-action-row { gap:8px; padding-block:14px; }
 .customer-action-row > .list-action-toolbar { gap:6px; }
 .customer-action-row > .list-action-toolbar > button { flex:0 0 auto; width:auto; padding-inline:12px; font-size:14px; }
 .customer-action-row > .list-action-toolbar > .row-more-actions { margin-left:auto; }
 .customer-record-meta > span:first-child { flex-basis:100%; }
}
/* Sidebar expansion changes usable width without changing viewport width. */
@container document-list (max-width:759px) {
 .document-center-card { grid-template-columns:minmax(0,1fr); grid-template-areas:'head' 'main' 'meta' 'controls'; }
 .document-card-meta { justify-content:flex-start; }
 .document-card-controls { grid-column:auto; width:100%; justify-content:flex-start; padding-top:8px; border-top:1px solid var(--line); }
 .document-card-controls > .document-card-more { margin-left:auto; }
}

/* The trigger stays in the first row; the same card grows below it. */
.row-more-actions { position:relative; overflow:visible; }
:is(.row-actions, .list-action-toolbar, .record-actions-compact, .document-actions-compact, .document-card-controls) > .row-more-actions { flex:0 0 auto; width:max-content; align-self:flex-start; }
.row-more-actions > .row-more-menu { display:none; }
.row-more-actions > summary:has(> svg)::after,
.row-more-actions[open] > summary:has(> svg)::after { content:none; }
:is(.row-actions, .list-action-toolbar, .record-actions-compact, .document-actions-compact, .document-card-controls, .section-actions):has(> .row-more-actions) { align-items:flex-start; align-content:start; flex-wrap:wrap; }
:is(.data-row, .premium-check-item):has(.row-more-actions) { align-items:start; }
.section-title:has(.row-more-actions) { align-items:flex-start; }
.document-card-controls:has(> .row-more-actions) { align-self:start; }
.sales-table tr:has(.row-more-actions) > td { vertical-align:top; }
.row-more-inline-menu {
 /* Expanded actions must not change the intrinsic width of their first row. */
 contain:inline-size;
 position:static; inset:auto; z-index:auto; transform:none;
 display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px;
 grid-column:1 / -1; flex:1 0 100%; min-width:0; width:100%; max-width:100%;
 margin:0; padding:10px 0 0; border:0; border-top:1px solid var(--line);
 border-radius:0; background:transparent; box-shadow:none; overflow:visible; max-height:none;
}
.row-more-inline-menu[hidden] { display:none; }
.row-more-inline-menu > button { min-width:44px; min-height:44px; width:auto; max-width:100%; padding:8px 12px; font-size:14px; line-height:1.5; white-space:normal; overflow-wrap:anywhere; }
.document-center-card:has(> .row-more-inline-menu) { grid-template-areas:'head meta' 'main controls' 'more more'; }
.document-center-card > .row-more-inline-menu { grid-area:more; }
@media(max-width:760px) {
 .document-center-card:has(> .row-more-inline-menu) { grid-template-areas:'head' 'main' 'meta' 'controls' 'more'; }
}
@container document-list (max-width:759px) {
 .document-center-card:has(> .row-more-inline-menu) { grid-template-areas:'head' 'main' 'meta' 'controls' 'more'; }
}

@media(max-width:760px) {
 .row-more-actions > summary:has(> svg) { width:44px; height:44px; min-width:44px; padding:10px; justify-content:center; }
 .row-more-actions > summary:has(> svg) > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
 #businessDocumentForm .report-field-grid,
 #businessDocumentForm .report-field-grid > label { min-width:0; max-width:100%; }
 #projectsView .section-title > [data-show-project-form] { width:100%; align-self:stretch; min-height:48px; }
}

/* Local draft list remains available after retiring cross-device handoff. */
.workspace-drafts > details { margin-top:8px; }
.workspace-drafts > details > summary { min-height:44px; cursor:pointer; align-content:center; }
.draft-resume-row { min-width:0; }

/* Search stays visible; occasional collection conditions use one disclosure. */
.collection-filter-panel .document-center-filters { grid-template-columns:minmax(0,1fr) auto; align-items:start; }
.collection-filter-panel .document-search-field { grid-column:1; }
.document-advanced-filters { min-width:0; padding-top:20px; }
.document-advanced-filters > summary { min-height:48px; padding:10px 12px; border:1px solid var(--line); border-radius:6px; color:var(--brand-dark); font-size:14px; font-weight:600; cursor:pointer; white-space:nowrap; }
.document-filter-count { display:inline-flex; align-items:center; justify-content:center; min-width:22px; margin-left:6px; padding:0 5px; border-radius:4px; background:var(--panel-strong); font-size:12px; }
.document-advanced-filters[open] { grid-column:1/-1; padding-top:0; }
.document-advanced-filters[open] > summary { width:max-content; }
.document-advanced-filter-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding-top:12px; }
.document-active-filters { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; color:var(--ink); font-size:13px; }
.document-active-filters > span { padding:4px 8px; border:1px solid var(--line); border-radius:4px; background:var(--bg); }

/* Keep the current value visible while occasional document options stay folded. */
.editor-options-disclosure > summary { min-height:44px; }
.editor-options-disclosure > summary > strong { color:var(--ink); }
.editor-options-edit { float:right; margin-left:8px; color:var(--brand-dark); font-weight:700; }
.editor-options-values { display:block; min-width:0; margin-top:2px; overflow-wrap:anywhere; }
.editor-options-disclosure .report-field-grid { margin-top:8px; }
.photo-time-details { margin:0; }
.photo-time-details > summary { min-height:44px; padding-inline:0; }
.photo-time-details .photo-taken-at-field { margin:0; }
.photo-time-notice { display:block; margin:0 0 8px; color:var(--muted); font-size:13px; line-height:1.5; }

/* Keep dates and money intact while title columns absorb long text. */
.invoice-payment-table .row-more-actions > summary:has(> svg) { width:44px; height:44px; min-width:44px; padding:10px; justify-content:center; }
.invoice-payment-table .row-more-actions > summary:has(> svg) > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media(min-width:1181px) {
  .invoice-payment-table { table-layout:fixed; }
  .invoice-payment-table th:nth-child(1),
  .invoice-payment-table th:nth-child(2) { width:auto; }
  .invoice-payment-table th:nth-child(3) { width:116px; }
  .invoice-payment-table th:nth-child(4) { width:112px; }
  .invoice-payment-table th:nth-child(5) { width:142px; }
  .invoice-payment-table th:nth-child(6) { width:244px; }
  .invoice-payment-table :is(.payment-due,.payment-amount) { white-space:nowrap; overflow-wrap:normal; font-variant-numeric:tabular-nums; }
  .invoice-payment-table .payment-due time { white-space:nowrap; }
  .invoice-payment-table .sales-row-actions { gap:6px; }
  .invoice-payment-table .sales-row-actions > .toggle-business-paid { padding-inline:8px; white-space:nowrap; }
}
@media(max-width:1180px) {
  .invoice-payment-table tr { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:'identity identity' 'context context' 'amount due' 'status status' 'actions actions'; gap:6px 12px; padding:14px; background:var(--panel); }
  .invoice-payment-table td { display:block; width:auto; min-width:0; min-height:0; padding:0; border:0; line-height:1.6; }
  .invoice-payment-table td::before { display:none; }
  .invoice-payment-table .payment-invoice-identity { grid-area:identity; }
  .invoice-payment-table .payment-invoice-identity > strong { font-size:15px; line-height:1.55; }
  .invoice-payment-table .payment-invoice-identity > small { margin:2px 0 0; font-size:13px; }
  .invoice-payment-table .payment-context { grid-area:context; }
  .invoice-payment-table .payment-context > strong { font-size:14px; font-weight:500; color:var(--muted); }
  .invoice-payment-table .payment-context > .payment-context-repeated { display:none; }
  .invoice-payment-table .payment-context > small { margin:0; font-size:14px; }
  .invoice-payment-table .payment-amount { grid-area:amount; display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 8px; margin-top:4px; font-size:16px; white-space:nowrap; font-variant-numeric:tabular-nums; }
  .invoice-payment-table .payment-due { grid-area:due; display:flex; align-items:baseline; justify-content:flex-end; flex-wrap:wrap; gap:4px 8px; margin-top:4px; white-space:nowrap; font-variant-numeric:tabular-nums; }
  .invoice-payment-table :is(.payment-amount,.payment-due)::before { display:inline; font-size:12px; font-weight:500; }
  .invoice-payment-table .payment-status { grid-area:status; }
  .invoice-payment-table .payment-status .collection-status { font-size:12px; }
  .invoice-payment-table .payment-actions-cell { grid-area:actions; padding-top:4px; }
  .invoice-payment-table .sales-row-actions.record-actions-compact { display:flex; flex-wrap:wrap; width:100%; align-items:flex-start; gap:6px; }
  .invoice-payment-table .sales-row-actions > .row-more-actions { margin-left:auto; }
  .invoice-payment-table .sales-row-actions > button { min-height:44px; padding-inline:10px; font-size:14px; }
  .invoice-payment-table .sales-row-actions > .document-pdf-action { width:44px; padding:10px; }
}
@media(max-width:760px) {
  .sales-priority-section:has(.invoice-payment-table) { padding:0; border:0; background:transparent; }
  .sales-priority-section:has(.invoice-payment-table) > .sales-section-head { padding:0 0 12px; }
  .invoice-payment-table .sales-row-actions { gap:4px; }
  .invoice-payment-table .sales-row-actions > .toggle-business-paid { padding-inline:4px; white-space:nowrap; }
  .collection-filter-panel .document-center-filters { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .document-advanced-filters { padding-top:0; }
  .document-advanced-filters > summary { min-height:44px; padding:10px; }
  .document-advanced-filter-fields { gap:10px; }
}

/* Project editing has its own reading surface; the list returns on save/cancel. */
#projectsView :is(.project-editor-panel, .project-list-panel)[hidden] { display:none; }
#projectsView .project-editor-panel { width:100%; max-width:960px; justify-self:start; scroll-margin-top:90px; }
#projectsView .project-editor-heading { flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
#projectsView .project-editor-heading h2 { margin:0; font-size:var(--workspace-section-heading-size); font-weight:var(--workspace-heading-weight); line-height:var(--workspace-section-heading-leading); }
#projectsView .project-editor-heading > button { min-height:44px; padding:6px 8px; font-size:14px; }
#projectsView .project-editor-form { grid-template-columns:minmax(0,1fr); gap:20px; margin:0; }
#projectsView .project-editor-form label { min-width:0; }
#projectsView .project-editor-form :is(input:not([type="radio"]):not([type="checkbox"]),select) { min-width:0; max-width:100%; width:100%; box-sizing:border-box; }
#projectsView .project-editor-basics { display:grid; grid-template-columns:minmax(0,1fr) minmax(140px,220px); align-items:start; gap:16px; min-width:0; }
#projectsView .project-editor-form .workspace-quick-customer { padding-top:16px; }
#projectsView .project-editor-form .workspace-quick-customer legend { font-size:14px; font-weight:700; }
#projectsView .project-editor-form .choice-tabs { width:fit-content; max-width:100%; flex-wrap:wrap; }
#projectsView .project-editor-form .choice-tabs label { display:flex; min-height:44px; align-items:center; padding:8px 12px; font-size:14px; }
#projectsView .project-editor-form [data-project-form-status] { margin:0; }
#projectsView .project-editor-form [data-project-form-status]:empty { display:none; }
#projectsView .project-editor-actions { display:flex; flex-wrap:wrap; gap:8px; margin:0; }
#projectsView .project-editor-actions > button { min-height:44px; }
#projectsView .project-editor-danger { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px 20px; margin-top:4px; padding-top:16px; border-top:1px solid var(--line); }
#projectsView .project-editor-danger strong { color:var(--ink); font-size:14px; font-weight:600; }
#projectsView .project-editor-danger p { margin:4px 0 0; color:var(--muted); font-size:13px; line-height:1.6; }
#projectsView .project-editor-danger > button { min-height:44px; }
@media(max-width:760px) {
  #projectsView .project-editor-basics { grid-template-columns:minmax(0,1fr); gap:16px; }
  #projectsView .project-editor-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  #projectsView .project-editor-actions > button { width:100%; min-width:0; padding-inline:8px; }
}

/* Customer → project: keep one visible work unit and reuse existing rows. */
.customer-project-context { display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; margin-bottom:16px; }
.customer-project-context > .back-button { flex-basis:100%; margin:0; }
.customer-project-identity { display:flex; align-items:center; gap:12px; flex:1 1 auto; min-width:0; }
.customer-project-identity > svg { width:32px; height:32px; flex:0 0 32px; color:var(--brand); }
.customer-project-identity h2 { margin:0; font-size:20px; line-height:1.5; overflow-wrap:anywhere; }
.customer-project-identity p { margin:4px 0 0; color:var(--muted); font-size:14px; }
.customer-projects-shell .collection-toolbar { margin-bottom:12px; }
.customer-projects-shell .collection-toolbar h2 { margin:0; }
.customer-action-row [data-open-customer-projects] { display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.customer-action-row [data-open-customer-projects] > svg { width:16px; height:16px; flex:0 0 16px; }
.project-detail-shell > .project-context-header { padding-bottom:18px; }
.project-customer-breadcrumb { margin-bottom:10px; }
.project-customer-breadcrumb .back-button { margin:0; font-size:14px; }
.project-context-header > .section-title { margin-bottom:0; gap:12px 20px; }
.project-context-header .section-title h2 { margin:0; font-size:21px; line-height:1.5; overflow-wrap:anywhere; }
.project-context-header .section-title p { margin:6px 0 0; color:var(--muted); font-size:14px; }
.project-detail-shell > .project-tabs { display:flex; flex-wrap:nowrap; gap:8px; padding-block:12px; }
.project-detail-shell > .project-tabs > button { flex:0 1 auto; min-height:44px; font-size:14px; white-space:nowrap; }
.project-materials .line-list > .data-row:first-child { border-top:0; }
@media(max-width:760px) {
 .customer-action-row > .list-action-toolbar { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px; align-items:start; gap:6px; }
 .customer-action-row > .list-action-toolbar > button { width:100%; min-width:0; padding-inline:8px; white-space:nowrap; }
 .customer-action-row > .list-action-toolbar:not(:has(> .row-more-actions)) { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .customer-action-row > .list-action-toolbar:has(> button:only-child) { grid-template-columns:minmax(0,1fr); }
 .customer-project-context { gap:8px 12px; }
 .customer-project-identity h2 { font-size:18px; }
 .customer-project-context > .text-button:last-child { margin-left:auto; font-size:13px; }
 .customer-projects-shell .collection-toolbar { flex-wrap:wrap; }
 .customer-projects-shell .collection-toolbar > button { flex:1 1 100%; width:100%; }
 .project-context-header .section-title h2 { font-size:18px; }
 .project-context-header .section-actions { display:flex; align-items:flex-start; gap:8px; width:100%; }
 .project-context-header .section-actions > .primary-button { flex:1; min-width:0; }
 .project-context-header .section-actions > .row-more-actions { flex:0 0 44px; }
 .project-context-header .section-actions > .row-more-actions > summary { width:44px; min-height:44px; justify-content:center; padding:10px; }
 .project-context-header .section-actions > .row-more-actions > summary > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
 .project-detail-shell > .project-tabs { gap:4px; }
 .project-detail-shell > .project-tabs > button { flex:1 1 0; min-width:0; padding-inline:6px; font-size:13px; }
}
