/* Unified request -> quote -> actual jobs -> discussion. No per-item progress cards. */
.portal-workflow{border:1px solid var(--border,#dce3e6);border-radius:8px}
.portal-workflow>summary{background:var(--card,#fff);padding:16px 18px}
.portal-workflow .workflow-summary-main{min-width:0}
.portal-workflow>summary strong{font-size:var(--dots-heading-size,17px);font-weight:700}
.portal-workflow .workflow-body{padding:0;gap:0}
.workflow-section{padding:18px;display:grid;gap:12px;min-width:0;border-top:1px solid var(--border,#dce3e6)}
.workflow-section:first-child{border-top:0}
.workflow-section>h3{margin:0;display:flex;gap:9px;align-items:center;font-size:var(--dots-heading-size,17px);font-family:var(--dots-heading-font,inherit);font-weight:700;line-height:1.4}
.workflow-section-number{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;border-radius:50%;font-size:12px;background:var(--muted,#eef2f4);color:var(--foreground,#253d4d)}
.workflow-record-heading{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:10px}
.workflow-record-heading>div{flex:1;min-width:180px}
.workflow-record-heading h4,.workflow-quote h4{margin:0;font-size:14px;font-weight:700;line-height:1.5;overflow-wrap:anywhere}
.workflow-job,.workflow-quote{display:grid;gap:12px;min-width:0;padding:14px;border:1px solid var(--border,#dce3e6);border-radius:7px;background:var(--card,#fff)}
.workflow-quote .portal-actions:empty{display:none}
.workflow-stages{display:flex;flex-wrap:wrap;gap:6px 12px;list-style:none;padding:0;margin:0}
.workflow-stages li{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--muted-foreground,#5e6974);padding:5px 0}
.workflow-stages .is-current{color:var(--foreground,#203f53);font-weight:700}
.workflow-stage-dot{width:8px;height:8px;border:1px solid currentColor;border-radius:50%;flex:0 0 auto}
.is-current .workflow-stage-dot{background:currentColor}
.workflow-hold{padding:10px;border-left:3px solid #b16c09;background:#fff4dc;color:#704508}
.workflow-attention{display:grid;gap:6px;margin-top:8px;min-width:0;max-width:100%;font-weight:400}
.workflow-flag{display:inline-block;width:fit-content;max-width:100%;border-radius:4px;padding:3px 7px;font-size:11px!important;font-weight:700;line-height:1.5;white-space:normal}
.workflow-flag-revision{background:#fff0d1;color:#754809;border:1px solid #e5c27e}
.workflow-flag-comment{background:#e7f0ff;color:#244d80;border:1px solid #bfcfe6}
.workflow-client-message{display:flex;flex-wrap:wrap;align-items:center;gap:5px 8px;min-width:0}
.workflow-message-excerpt{max-width:100%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;white-space:normal;font-size:12px;color:var(--foreground,#344553)}
.workflow-attention time{color:var(--muted-foreground,#64707a);font-size:11px;white-space:normal}
.portal-workflow .portal-status.status-revision{background:#fff0d1;color:#754809}
.portal-workflow .portal-status.status-on-hold{background:#fff0d1;color:#754809}
.portal-workflow .portal-request-table{max-width:100%}
:is(.client-portal,.staff-client-portal) .portal-comment-client{background:#f2f6fd;border-left:4px solid #416da0;color:#223e60}
:is(.client-portal,.staff-client-portal) .portal-comment-revision{background:#fff7e9;border-left:4px solid #b57c21;color:#67430c}
:is(.client-portal,.staff-client-portal) .portal-comment-agency{background:var(--card,#fff)}
:is(.client-portal,.staff-client-portal) .portal-discussion .portal-revision-note{border-left:4px solid #b57c21;padding:12px;background:#fff0d1;color:#754809}
.portal-discussion>.portal-discussion-heading{font-size:var(--dots-heading-size,17px);font-weight:700}
.workflow-discussion .portal-discussion{border-top:0;margin:0;padding:0}
.workflow-discussion .portal-discussion>h3{margin-top:0}
.portal-workflow .portal-request-actions{border-top:0;margin-top:4px;padding-top:4px}
@media(max-width:650px){
 .workflow-section{padding:14px;gap:10px}.workflow-job,.workflow-quote{padding:12px}
 .portal-workflow>summary{padding:14px;align-items:flex-start}.portal-workflow>summary .portal-status{white-space:normal}
 .workflow-record-heading>div{min-width:0;flex-basis:100%}.workflow-record-heading .portal-status{white-space:normal}
 .workflow-stages{gap:4px 12px}.workflow-attention time{width:100%}
}
@media print{
 .portal-workflow{overflow:visible}.workflow-section{break-inside:auto}.workflow-job{break-inside:avoid}
 .workflow-section button,.workflow-discussion form,.portal-request-actions{display:none!important}
 .workflow-message-excerpt{-webkit-line-clamp:unset}.workflow-stages{display:flex}
 .portal-workflow .portal-record-body{display:grid!important}
}

.workflow-scroll-hint{display:none}
@media(max-width:1000px){.workflow-scroll-hint{display:block}}

/* Original client navigation restored without changing grouped job cards. */
.client-portal .portal-home-overview{margin-bottom:20px}
.client-portal .portal-home-overview>p{margin:0 0 16px;color:var(--muted-foreground,#56615a)}
.client-portal .portal-home-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.client-portal .portal-home-shortcut{display:flex;flex-direction:column;gap:10px;width:100%;min-width:0;padding:20px;text-align:left;font:inherit;cursor:pointer;color:var(--foreground,#303530);background:var(--card,#fff)}
.client-portal .portal-home-shortcut>strong{display:flex;justify-content:space-between;gap:8px;font-size:16px}
.client-portal .portal-home-shortcut>strong>span{font-variant-numeric:tabular-nums}
.client-portal .portal-home-shortcut>small{font-size:13px;line-height:1.5;color:var(--muted-foreground,#56615a)}
.client-portal .portal-home-shortcut:focus-visible{outline:2px solid var(--primary,#4d7f22);outline-offset:3px}
@media(max-width:600px){.client-portal .portal-home-shortcuts{grid-template-columns:1fr}.client-portal .portal-home-shortcut{padding:16px}}
@media(max-width:500px){.client-portal .portal-header nav[aria-label="Client navigation"]>button{padding-inline:6px!important}}

/* One request conversation, shared by staff and client. */
.portal-chat{display:grid;gap:12px;min-width:0}
.portal-chat .portal-chat-toolbar{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;min-width:0}
.portal-chat .portal-chat-status{display:grid;gap:4px;min-width:150px;max-width:210px;width:auto;margin:0;font-size:12px;font-weight:600;flex:0 1 190px}
.portal-chat .portal-chat-status select{width:100%;min-width:0;min-height:34px;height:36px;padding:6px 28px 6px 10px;font:inherit;font-weight:500;margin:0}
.portal-chat .portal-chat-status-readonly{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 0;font-size:12px}
.portal-chat .portal-chat-status-readonly strong{border-radius:5px;background:var(--muted,#edf2f0);padding:5px 9px}
.portal-chat .portal-attachments-compact{display:grid;gap:8px;min-width:0;max-width:100%;flex:1 1 240px;margin:0;padding:0;border:0}
.portal-chat .portal-dropzone-compact{display:block;min-height:0;padding:0;border:0;background:transparent;text-align:left}
.portal-chat .portal-dropzone-compact>svg,.portal-chat .portal-dropzone-compact .portal-upload-limits{display:none}
.portal-chat .portal-dropzone-compact button{width:auto;min-height:36px;flex:0 0 auto;margin:0;white-space:normal}
.portal-chat .portal-upload-queue{margin:0;max-width:100%}
.portal-chat .portal-chat-sharing{margin:0;font-size:11px;color:var(--muted-foreground,#606a64);line-height:1.5}
.portal-chat .portal-chat-messages{display:flex;flex-direction:column;align-items:stretch;gap:14px;margin:0;padding:16px;list-style:none;border:1px solid var(--border,#dce3e6);border-radius:8px;background:var(--muted,#f5f7f6);min-width:0;max-height:480px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;outline-offset:3px}
.portal-chat .portal-chat-messages>.portal-comment{display:grid;gap:8px;flex:none;width:fit-content;max-width:86%;min-width:min(220px,85%);margin:0;padding:12px 14px;border:1px solid #d8e3ef;border-radius:12px 12px 12px 3px;box-shadow:none;overflow-wrap:anywhere;word-break:normal;background:#f5f9ff;color:#263c54}
.portal-chat .portal-chat-messages>.portal-comment-client{align-self:flex-start}
.portal-chat .portal-chat-messages>.portal-comment-agency{align-self:flex-end;border-color:#cdddc9;border-radius:12px 12px 3px 12px;background:#eef6eb;color:#243c28}
.portal-chat .portal-chat-messages>.portal-comment-revision{border:1px solid #deb971;border-left:4px solid #b57916;background:#fff6e6;color:#60440f}
.portal-chat .portal-comment-meta{display:flex;justify-content:space-between;align-items:flex-start;gap:8px 18px;flex-wrap:wrap;font-size:12px;line-height:1.5}
.portal-chat .portal-comment-meta strong{font-size:12px!important;font-weight:700!important}
.portal-chat .portal-comment-meta strong span{font-weight:400}
.portal-chat .portal-comment-meta time,.portal-chat .portal-chat-legacy .portal-comment-meta>span{font-size:10px;color:#5c6860;white-space:normal}
.portal-chat .portal-chat-messages p{margin:0;white-space:pre-wrap}
.portal-chat .portal-chat-empty{align-self:center;padding:12px 4px;text-align:center;font-size:12px;color:var(--muted-foreground,#606a64)}
.portal-chat .portal-chat-status-event{font-size:11px;padding-top:6px;border-top:1px solid #ccd7ca}
.portal-chat .portal-chat-composer{display:grid;gap:9px;margin:0;padding:0;border:0}
.portal-chat .portal-chat-composer>label{display:grid;gap:5px;font-size:12px;font-weight:600}
.portal-chat .portal-chat-composer textarea{width:100%;min-height:84px;max-height:300px;resize:vertical;font-family:inherit;font-size:var(--dots-font-size,13px);line-height:1.6;margin:0}
.portal-chat .portal-chat-send{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.portal-chat .portal-chat-send .portal-help{flex:1 1 180px;font-size:11px}
.portal-chat .portal-chat-send button{width:auto;flex:0 0 auto;margin:0}
.portal-chat .portal-chat-pending{padding:10px;border:1px solid var(--border,#dce3e6);border-radius:6px;min-width:0;background:var(--card,#fff)}
.portal-chat .portal-chat-pending>strong,.portal-chat .portal-chat-pending>small{font-size:11px}
.portal-chat .portal-files{margin:0;min-width:0}
.portal-chat .portal-files .attachment-file{min-width:0;max-width:100%;background:rgba(255,255,255,.65);border-radius:5px}
.portal-chat .portal-files .attachment-file-details{min-width:0;overflow-wrap:anywhere}
.portal-chat .portal-chat-conflict{font-size:12px;padding:10px;background:#fff5df;border:1px solid #daba81;border-radius:5px;color:#694a16}
.portal-chat .portal-chat-conflict button{font:inherit;text-decoration:underline;font-weight:700;margin:0 4px;padding:0;background:none;border:0;cursor:pointer}
.portal-chat .portal-chat-sent{font-size:12px;color:#2c6035;margin:0}
.portal-chat .portal-revision-history{min-width:0;max-width:100%;overflow:hidden}
.portal-chat .portal-revision-history>.portal-table-wrap,.portal-chat .portal-revision-history .portal-table-wrap{max-width:100%;overflow-x:auto}
@media(max-width:650px){
 .portal-chat .portal-chat-toolbar{gap:10px}
 .portal-chat .portal-attachments-compact{flex-basis:100%}
 .portal-chat .portal-chat-status{max-width:none;flex:1 1 100%;grid-template-columns:auto minmax(130px,1fr);align-items:center;gap:12px}
 .portal-chat .portal-chat-messages{padding:10px 8px;gap:12px;max-height:440px;scrollbar-gutter:auto}
 .portal-chat .portal-chat-messages>.portal-comment{max-width:94%;min-width:0;padding:10px}
 .portal-chat .portal-comment-meta{gap:4px;flex-direction:column}
 .portal-chat .portal-chat-send{justify-content:flex-end}
 .portal-chat .portal-chat-send .portal-help{flex-basis:100%}
 .portal-chat .portal-chat-send button{width:100%}
}
@media print{
 .portal-chat .portal-chat-toolbar,.portal-chat .portal-chat-sharing,.portal-chat .portal-chat-composer{display:none!important}
 .portal-chat .portal-chat-messages{max-height:none;overflow:visible;border:0;background:none;scrollbar-gutter:auto}
 .portal-chat .portal-chat-messages>.portal-comment{break-inside:avoid;box-shadow:none}
}

/* Required staff request agency; narrowly scoped, no portal menu changes. */
/* .81: controls are inside the client/request header, not a separate body row. */
.portal-request-card>.portal-request-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px 22px;padding:14px 18px;min-width:0;}
.portal-request-header>.portal-request-identity{flex:1 1 260px;min-width:0;}
.portal-request-identity>button.portal-request-toggle{display:flex;align-items:flex-start;gap:12px;width:100%;min-height:0!important;height:auto!important;padding:0;margin:0;border:0;border-radius:4px;background:transparent!important;color:inherit;box-shadow:none;font:inherit;text-align:left;cursor:pointer;white-space:normal;}
.portal-request-toggle:focus-visible{outline:2px solid var(--ring,#477b19);outline-offset:4px;}
.portal-request-toggle>.portal-request-identity-text{flex:1;min-width:0;}
.portal-request-toggle .portal-client-name{display:block;font-size:17px;font-weight:700;line-height:1.3;overflow-wrap:anywhere;}
.portal-request-toggle .portal-request-title{display:block;font-size:13px;font-weight:500;line-height:1.4;margin-top:3px;overflow-wrap:anywhere;}
.portal-request-toggle small{display:block;margin-top:4px;font-size:11px;font-weight:400;line-height:1.4;color:var(--muted-foreground,#637063);overflow-wrap:anywhere;}
.portal-request-toggle>.portal-request-chevron{flex:none;font:500 19px/1.3 sans-serif;color:#34516f;}
.portal-request-summary-meta{display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px;margin-top:6px;min-width:0;}
.portal-request-summary-meta>.portal-status{font-size:10px;line-height:1.4;padding:2px 7px;}
.portal-request-summary-meta .workflow-attention{margin:0;}
.portal-request-header>.portal-request-controls{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:4px 10px;flex:0 1 350px;width:350px;max-width:100%;min-width:0;margin:0 0 0 auto;padding:0;border:0;border-radius:0;background:transparent;align-self:flex-start;}
.portal-request-controls>label.portal-request-control{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;min-width:0;margin:0;font-size:11px;font-weight:600;line-height:1.25;}
.portal-request-controls .portal-required-mark{color:#a94420;}
.portal-request-controls>label>select{width:100%;max-width:100%;min-width:0;height:32px!important;min-height:32px!important;padding:4px 24px 4px 8px;margin:0;border-radius:5px;font:inherit;font-size:12px;font-weight:500;line-height:1.3;text-overflow:ellipsis;}
.portal-request-agency-required .portal-request-control:first-child>select{border-color:#bd8627;background:#fffaf0;}
.portal-request-controls>.portal-request-control-note{grid-column:1/-1;min-width:0;margin:0;font-size:10px;line-height:1.4;color:var(--muted-foreground,#637063);text-align:right;overflow-wrap:anywhere;}
.portal-request-controls>.portal-request-control-note.is-pending{color:#8c5a16;}
.portal-request-controls>.auth-error{grid-column:1/-1;margin:0;font-size:11px;overflow-wrap:anywhere;}
.portal-request-card>.portal-record-body[hidden]{display:none!important;}
.portal-record-body>.portal-request-contact{min-width:0;font-size:12px;overflow-wrap:anywhere;}
.portal-request-contact>small{display:block;font-size:11px;color:var(--muted-foreground,#637063);}
@media(max-width:760px){
 .portal-request-card>.portal-request-header{flex-wrap:wrap;gap:10px;}
 .portal-request-header>.portal-request-identity{flex-basis:100%;}
 .portal-request-header>.portal-request-controls{gap:4px 8px;}
 .portal-request-controls>label>select{height:38px!important;min-height:38px!important;}
}
@media(max-width:500px){.portal-request-card>.portal-request-header{padding:12px 14px;}.portal-request-toggle .portal-client-name{font-size:16px;}}
@media print{.portal-request-controls>.portal-request-control-note,.portal-request-chevron{display:none;}.portal-request-card>.portal-record-body[hidden]{display:grid!important;}}

/* One request-status indicator beside Refresh; keep the polling hooks intact. */
.staff-client-portal>.portal-tabs{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.staff-client-portal>.portal-tabs>.live-update-status{margin:0;flex:0 1 auto;}
@media(max-width:500px){.staff-client-portal>.portal-tabs{gap:6px;}.staff-client-portal>.portal-tabs>.live-update-status{font-size:10px;}}

/* .83: genuinely separate client reports. All surfaces follow saved appearance. */
.client-portal .portal-record-reports{display:grid;gap:14px;min-width:0}
.client-portal .portal-report-intro{margin:0;line-height:1.6;font-size:13px}
.client-portal .portal-report-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0;min-width:0}
.client-portal .portal-report-metrics>div{background:var(--card,#fff);color:var(--foreground);border:1px solid var(--border);padding:12px 14px;border-radius:6px;min-width:0}
.client-portal .portal-report-metrics dt{font-size:11px;line-height:1.4;margin:0;overflow-wrap:anywhere}
.client-portal .portal-report-metrics dd{font-size:23px;line-height:1.3;font-weight:700;margin:5px 0 0}
.client-portal .portal-report-toolbar{display:flex;align-items:flex-end;gap:10px 14px;flex-wrap:wrap;min-width:0}
.client-portal .portal-report-toolbar>label{display:grid;gap:4px;font-size:12px;min-width:0;flex:1 1 230px;margin:0}
.client-portal .portal-report-toolbar>label:nth-child(2){flex:0 1 215px}
.client-portal .portal-report-toolbar :is(input,select){height:36px!important;min-height:36px!important;width:100%;min-width:0;margin:0;border:1px solid var(--form-border,var(--border));border-radius:5px;background:var(--form-field-background,var(--card));color:var(--form-field-text,var(--foreground));padding:6px 10px;font:inherit}
.client-portal .portal-report-toolbar>span{font-size:12px;line-height:36px;white-space:nowrap}
.client-portal .portal-report-record{min-width:0;scroll-margin-top:130px}
.client-portal .portal-report-record>summary{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;min-width:0}
.client-portal .portal-report-record>summary>.workflow-summary-main{flex:1;display:grid;gap:5px;min-width:0}
.client-portal .portal-report-record>summary strong{white-space:normal;overflow-wrap:anywhere}
.client-portal .portal-report-record>summary small{white-space:normal;overflow-wrap:anywhere}
.client-portal .portal-report-summary-side{display:grid;gap:5px;justify-items:end;text-align:right;flex:0 1 210px;min-width:0}
.client-portal .portal-report-summary-side .portal-status{white-space:normal;max-width:100%;text-align:right}
.client-portal .portal-report-summary-side>b{font-size:15px}
.client-portal .portal-report-summary-side>small{font-size:10px}
.client-portal .portal-report-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 16px;margin:0}
.client-portal .portal-report-meta>div{min-width:0;padding:0 0 9px;border-bottom:1px solid var(--request-border-color,var(--border))}
.client-portal .portal-report-meta dt{font-size:11px;line-height:1.4;opacity:.85}
.client-portal .portal-report-meta dd{margin:4px 0 0;font-size:13px;line-height:1.5;font-weight:600;overflow-wrap:anywhere}
.client-portal .portal-report-context{min-width:0;max-width:100%}
.client-portal .portal-report-context>summary{font-size:13px;font-weight:600;padding:8px 0;cursor:pointer}
.client-portal .portal-report-links .portal-actions{flex-wrap:wrap}
.client-portal .portal-report-links .portal-actions:empty{display:none}
.client-portal :is(.portal-home-attention,.portal-home-recent){padding:16px;min-width:0}
.client-portal :is(.portal-home-attention,.portal-home-recent)>h2{font-size:var(--dots-heading-size,17px);font-weight:var(--dots-heading-weight,700);margin:0 0 10px}
.client-portal .portal-home-attention>button{width:100%;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;text-align:left;padding:10px;border:1px solid var(--border);border-radius:5px;background:var(--card);color:var(--foreground);margin:6px 0 0;font:inherit;cursor:pointer}
.client-portal .portal-home-attention>button>span{font-size:12px;font-weight:600;text-decoration:underline}
.client-portal .portal-home-recent ul{margin:0;padding:0;list-style:none}
.client-portal .portal-home-recent li+li{border-top:1px solid var(--border)}
.client-portal .portal-home-recent li>button{width:100%;display:flex;justify-content:space-between;align-items:flex-start;gap:12px;min-width:0;text-align:left;padding:12px 0;background:transparent;color:inherit;border:0;font:inherit;cursor:pointer}
.client-portal .portal-home-recent li>button>span:first-child{display:grid;gap:5px;min-width:0;flex:1}
.client-portal .portal-home-recent strong{font-size:13px;overflow-wrap:anywhere}
.client-portal .portal-home-recent small{font-size:11px;opacity:.85}
.client-portal .portal-home-recent .portal-status{max-width:45%;white-space:normal;font-size:10px}
@media(max-width:650px){
 .client-portal .portal-report-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .client-portal .portal-report-metrics>div{padding:10px}
 .client-portal .portal-report-meta{grid-template-columns:repeat(2,minmax(0,1fr))}
 .client-portal .portal-report-record>summary{flex-wrap:wrap}
 .client-portal .portal-report-record>summary>.workflow-summary-main{flex-basis:100%}
 .client-portal .portal-report-summary-side{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;flex-basis:100%;gap:6px 10px;text-align:left}
 .client-portal .portal-report-summary-side .portal-status{text-align:left}
 .client-portal .portal-report-toolbar>label:nth-child(2){flex:1 1 180px}
 .client-portal .portal-report-toolbar :is(input,select){height:40px!important;min-height:40px!important}
 .client-portal .portal-report-record{scroll-margin-top:170px}
}
@media print{
 .client-portal .portal-report-toolbar,.client-portal .portal-report-links .portal-actions{display:none!important}
 .client-portal .portal-report-meta{grid-template-columns:repeat(3,minmax(0,1fr))}
 .client-portal .portal-report-record{break-inside:auto}
}
.client-portal .portal-report-record>summary{position:relative;padding-right:36px}
.client-portal .portal-report-record>summary::after{position:absolute;right:12px;top:14px;margin:0}
