/* Six public stages; legacy audit action stays available internally only. */
.workflow .flow-step[data-stage="audit"]{display:none!important}
.workflow{grid-template-columns:repeat(6,minmax(0,1fr))!important}
.crm-company-context{border:1px solid var(--premium-line);border-radius:12px;background:var(--premium-paper);margin-bottom:18px;overflow:hidden;color:var(--premium-ink)}
.crm-company-context>summary{display:flex;align-items:center;gap:14px;padding:14px 18px;background:var(--premium-soft);list-style:none;cursor:pointer}
.crm-company-context>summary::-webkit-details-marker{display:none}
.crm-company-context[open]>summary{border-bottom:1px solid var(--premium-line)}
.crm-company-context>summary:hover{background:color-mix(in srgb,var(--premium-soft) 88%,var(--cc-blue))}
.crm-company-context>summary:focus-visible{outline:2px solid var(--cc-blue);outline-offset:-3px}
.company-disclosure-label{margin-left:auto;flex:none;font-size:var(--fs-md,13.5px);color:var(--cc-blue)}
.crm-company-context[open] .when-closed,.crm-company-context:not([open]) .when-open{display:none}
.crm-company-context h3{font-family:inherit;font-size:var(--fs-xl,17px);font-weight:var(--fw-s,600);line-height:1.4;margin:0}
.crm-company-context dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 24px;padding:18px;margin:0}
.crm-company-context dl>div{min-width:0}
.crm-company-context dt{font-size:var(--fs-md,13.5px);line-height:1.4;color:var(--premium-muted);margin-bottom:5px}
.crm-company-context dd{font-size:var(--fs-lg,14px);line-height:1.5;font-weight:var(--fw-s,600);overflow-wrap:anywhere;margin:0;white-space:pre-wrap}
.prep-company>.card-head,.prep-company>.card-body{display:none!important}
.prep-company>.crm-company-context{border:0;margin:0}
.stage-view[data-view="sales"] .sales-memory{display:none!important}
#callMode .crm-company-context dl{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 18px}
@media(max-width:900px){.crm-company-context dl,#callMode .crm-company-context dl{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:500px){.crm-company-context dl,#callMode .crm-company-context dl{grid-template-columns:1fr}}
/* Editing stays inside the existing company disclosure, without resetting a call. */
.crm-company-context>summary h3{flex:1;min-width:0}
.crm-company-context>summary .company-edit-trigger{flex:none;margin-left:auto;font-size:var(--fs-md,13.5px);padding:6px 10px;min-height:32px}
.crm-company-editor{padding:14px 16px}
.company-edit-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px}
.company-edit-fields label{display:grid;gap:6px;font-size:var(--fs-md,13.5px);color:var(--muted)}
.company-edit-fields input{box-sizing:border-box;min-width:0;width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface2);color:var(--text);font:inherit}
.crm-company-editor footer{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.crm-company-editor [role=alert]{color:var(--red);font-size:var(--fs-md,13.5px);margin:8px 0 0}
.crm-company-editor .company-save{background:var(--crm-confirm-bg);color:var(--crm-confirm-ink);border-color:var(--crm-confirm-line)}
@media(max-width:600px){.company-edit-fields{grid-template-columns:1fr}}

/* Compact only the company brief from the audit; keep its original fields and disclosure. */
html body [data-view="review"]>.crm-company-context{margin-bottom:10px;border-radius:9px}
html body [data-view="review"]>.crm-company-context>summary{padding:8px 12px;gap:9px}
html body [data-view="review"]>.crm-company-context>summary h3{--crm-type-body:var(--fs-lg,14px);font-size:var(--fs-lg,14px)!important;line-height:1.3!important}
html body [data-view="review"]>.crm-company-context>dl{padding:12px;gap:10px 16px}
html body [data-view="review"]>.crm-company-context dt{--crm-type-body:var(--fs-xs,11.5px);font-size:var(--fs-xs,11.5px)!important;line-height:1.3!important;margin-bottom:3px}
html body [data-view="review"]>.crm-company-context dd{--crm-type-body:var(--fs-md,13.5px);font-size:var(--fs-md,13.5px)!important;line-height:1.4!important}
html body [data-view="review"]>.crm-company-context>summary .company-edit-trigger{--crm-type-body:var(--fs-sm,12.5px);font-size:var(--fs-sm,12.5px)!important;min-height:28px;padding:4px 8px}

/* Shared identity: isolate the old display:contents/two-column heading rules. */
html body :is(#workspaceScroll,#ownLeadView [data-own-identity],#officeWorkspace .ops-card,#newFirmWorkspace .nf-detail,#activeClientsWorkspace .ac-card)>.client-header.crm-client-identity{display:block!important;padding:12px 16px!important;border:1px solid var(--wa-line,var(--border));border-radius:10px;background:var(--wa-panel,var(--surface));margin-bottom:12px;container-type:inline-size}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity>.client-summary{display:block!important;width:100%;min-width:0}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .client-summary-line{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;gap:10px 20px;align-items:start!important}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity :is(#clientName,.crm-identity-title){display:grid!important;gap:6px;margin:0!important;min-width:0;grid-column:1;grid-row:1;align-self:start}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-person-name{display:block!important;--crm-type-body:var(--fs-2xl,22px);font-size:var(--fs-2xl,22px)!important;font-weight:var(--fw-s,600);line-height:1.25!important;overflow-wrap:anywhere}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-company-name{display:block!important;--crm-type-body:var(--fs-md,13.5px);font-size:var(--fs-md,13.5px)!important;color:var(--wa-muted,var(--muted));font-weight:var(--fw-s,600);line-height:1.4!important;overflow-wrap:anywhere}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity [data-header-edit]{grid-column:4;grid-row:1;justify-self:end;align-self:start;min-height:30px;padding:5px 12px;font-size:var(--fs-sm,12.5px);--crm-type-body:var(--fs-sm,12.5px);margin:0}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .client-contact{grid-column:2;grid-row:1;display:flex!important;align-items:start!important;align-self:start;justify-content:flex-start!important;gap:8px 20px!important;flex-wrap:wrap;min-width:0;margin:0!important;padding:0!important}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-identity-contact{display:grid!important;gap:3px;min-width:0;max-width:100%}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-identity-contact small,html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-facts dt{--crm-type-body:var(--fs-xs,11.5px);font-size:var(--fs-xs,11.5px)!important;font-weight:var(--fw-n,400);color:var(--wa-muted,var(--muted));line-height:1.3!important;margin:0}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity :is(#clientPhone,#clientEmail,.crm-contact-value){--crm-type-body:var(--fs-lg,14px);font-size:var(--fs-lg,14px)!important;font-weight:var(--fw-s,600);line-height:1.4!important;overflow-wrap:anywhere;color:var(--wa-ink,var(--text));white-space:normal!important}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-company-line{display:flex!important;align-items:center;gap:7px 12px;flex-wrap:wrap;min-width:0}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-company-name{--crm-type-body:var(--fs-lg,14px);font-size:var(--fs-lg,14px)!important;font-weight:var(--fw-s,600);color:var(--wa-ink,var(--text))}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-legal-form{--crm-type-body:var(--fs-xs,11.5px);font-size:var(--fs-xs,11.5px)!important;font-weight:var(--fw-s,600);line-height:20px!important;padding:0 8px;border:1px solid var(--wa-line,var(--border));border-radius:999px;color:var(--wa-muted,var(--muted));white-space:nowrap}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-primary-industry{--crm-type-body:var(--fs-sm,12.5px);font-size:var(--fs-sm,12.5px)!important;font-weight:var(--fw-n,400);line-height:1.35!important;color:var(--wa-muted,var(--muted));overflow-wrap:anywhere}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-facts{display:flex!important;align-items:center;flex-wrap:wrap;gap:7px 0;padding:10px 0 0;margin:10px 0 0;border-top:1px solid var(--wa-line,var(--border))}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-facts>div{min-width:0;display:flex;align-items:baseline;gap:7px;padding:0 14px;border-right:1px solid var(--wa-line,var(--border))}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-facts>div:first-child{padding-left:0}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-facts>div:last-child{border-right:0}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-facts dd{--crm-type-body:var(--fs-sm,12.5px);font-size:var(--fs-sm,12.5px)!important;line-height:1.4!important;font-weight:var(--fw-s,600);margin:0;overflow-wrap:anywhere;white-space:normal}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-facts #clientWebsite{color:var(--wa-muted,var(--muted));font-size:inherit;text-decoration:none}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-facts #clientWebsite[href]:hover{text-decoration:underline;color:var(--wa-ink,var(--text))}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .client-status-line,html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity #clientStage{display:none!important}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-appointment{align-items:center!important;color:var(--amber,#E5A83D)}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-appointment :is(dt,#clientTime){--crm-type-body:var(--fs-sm,12.5px);--crm-type-heading:var(--fs-sm,12.5px);font-size:var(--fs-sm,12.5px)!important;font-weight:var(--fw-s,600);line-height:1.4!important;color:var(--amber,#E5A83D)!important;letter-spacing:normal;text-transform:none}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-appointment .icon{width:15px;height:15px;display:block}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-appointment:has(dd:empty),html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-appointment:has(#clientTime:empty){display:none!important}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity #phoneClientCard,html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity [hidden]{display:none!important}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity:has(.crm-company-editor) :is(.client-contact,.crm-header-facts,[data-header-edit]){display:none!important}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-company-editor{padding:16px 0 0}
html body .crm-company-editor textarea{box-sizing:border-box;min-width:0;width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface2);color:var(--text);font:inherit;resize:vertical}
html body .crm-company-editor label:has([name=reason]){grid-column:1/-1}
@container(max-width:780px){
 html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .client-summary-line{grid-template-columns:minmax(0,1fr) auto;gap:12px}
 html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity [data-header-edit]{grid-column:2}
 html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .client-contact{grid-column:1/-1;grid-row:2}
 html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-facts{gap:8px 0}
}

@container(min-width:781px){html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .client-contact{max-width:470px}}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-header-appointment .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

/* Compact shared inline identity editor: four fields across at desktop width. */
html body .crm-company-editor .company-edit-fields{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 12px}
html body .crm-company-editor .company-edit-fields label{gap:4px;font-size:var(--fs-sm,12.5px)}
html body .crm-company-editor .company-edit-fields :is(input,textarea){padding:6px 9px;font-size:var(--fs-md,13.5px);line-height:1.35;border-radius:6px}
html body .crm-company-editor footer{margin-top:10px;gap:8px}
html body .crm-company-editor [role=alert]:empty{display:none}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-company-editor{padding:10px 0 0}
@media(max-width:850px){html body .crm-company-editor .company-edit-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){html body .crm-company-editor .company-edit-fields{grid-template-columns:1fr}}

/* ASSIGNMENT158: existing contract allocation, shared by sales and office headers. */
html body .crm-assigned-accounting{display:flex;gap:8px 18px;flex-wrap:wrap;min-width:0;max-width:400px;color:var(--wa-ink,var(--text))}
html body .crm-assigned-accounting>span{display:grid;gap:3px;min-width:0;max-width:220px}
html body .crm-assigned-accounting small{font-size:var(--fs-xs,11.5px)!important;--crm-type-body:var(--fs-xs,11.5px);font-weight:var(--fw-n,400);color:var(--wa-muted,var(--muted));line-height:1.3}
html body .crm-assigned-accounting strong{font-size:var(--fs-lg,14px)!important;--crm-type-body:var(--fs-lg,14px);font-weight:var(--fw-s,600);line-height:1.4;overflow-wrap:anywhere}
html body #callMode .crm-assigned-accounting{margin:8px 0;gap:7px;flex-direction:column}
html body #newFirmWorkspace .fw-hero .crm-assigned-accounting{margin-left:auto}
html body .crm-client-identity .client-contact:has(.crm-assigned-accounting){max-width:560px}
/* 07.10 (audyt): z blokiem Księgowość/Księgowy telefon i e-mail zostają linijkę pod nazwiskiem (nie wskakują na wysokość nazwiska) */
@container(min-width:781px){html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .client-contact:has(.crm-assigned-accounting){align-self:start!important;margin-top:31px!important}}
@media(max-width:900px){html body .crm-client-identity .client-contact:has(.crm-assigned-accounting){max-width:320px}html body #newFirmWorkspace .fw-hero .crm-assigned-accounting{margin-left:0}}

html body .crm-client-identity .client-summary-line>.er-header-link{grid-area:1/3}

/* 06.10 (Dawid 16:09): telefon i e-mail klienta tuż przy nazwie klienta (nie po prawej stronie belki), bez napisów „Telefon” / „E-mail” */
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .crm-identity-contact small{display:none!important}
@container(min-width:781px){html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .client-summary-line{grid-template-columns:minmax(0,max-content) minmax(0,1fr) auto!important}
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .client-summary-line:has(.er-in-name){grid-template-columns:minmax(0,max-content) minmax(0,1fr) auto auto!important}
/* 06.10 (Dawid 16:19): telefon i e-mail linijkę niżej — na wysokości firmy, nie imienia i nazwiska */
html body :is(#workspaceScroll,#ownLeadView,#officeWorkspace,#newFirmWorkspace,#activeClientsWorkspace) .crm-client-identity .client-contact{align-self:end!important}}
