.matrix-page .page-intro p{max-width:760px}.matrix-tabs{margin-bottom:16px}.matrix-bulk{display:flex;align-items:center;gap:16px;padding:12px;background:#f0f8f5;border-radius:8px;margin:12px 0}.matrix-bulk label{display:flex;align-items:center;gap:8px}.matrix-person{display:flex;align-items:center;gap:10px;min-width:180px}.matrix-person img{width:40px;height:40px;object-fit:cover;border-radius:50%}.matrix-page td small,.matrix-person small{display:block;color:#7b9392;margin-top:5px}.matrix-progress{padding:14px 16px;margin:16px 0;border-radius:8px;background:#e8f6ef;display:flex;gap:12px;align-items:center;justify-content:space-between}.matrix-error{padding:16px;color:#b63823;background:#fff1ef;border-radius:8px}.matrix-waterfall{columns:4 240px;column-gap:16px;padding-top:16px}.matrix-work{break-inside:avoid;margin-bottom:16px;border:1px solid #dce8e5;border-radius:10px;overflow:hidden;background:white}.matrix-work>a{display:block}.matrix-work>a img{display:block;width:100%;height:auto;max-height:340px;object-fit:cover}.matrix-work>div{padding:14px}.matrix-work strong{display:block;font-size:14px;line-height:1.6;overflow-wrap:anywhere}.matrix-work small{display:block;color:#78918e;margin-top:8px}.matrix-work span{display:block;margin-top:10px;font-size:12px;color:#78918e}.matrix-work details{margin-top:12px;border-top:1px solid #e1ebe7;padding-top:10px}.matrix-work summary{cursor:pointer;color:#198e70}.matrix-work p{white-space:pre-wrap;overflow-wrap:anywhere}.matrix-no-cover{padding:70px 20px;text-align:center;background:#f2f7f5;color:#78918e}.matrix-dialog{width:min(560px,90vw);max-height:90vh;border:1px solid #dce8e5;border-radius:12px;padding:0;box-shadow:0 16px 60px #0003}.matrix-dialog::backdrop{background:#142b2955}.matrix-dialog label{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}.matrix-dialog .dialog-body{padding:20px}.matrix-dialog input,.matrix-dialog textarea{width:100%}.matrix-dialog [data-matrix-form-error]{color:#b63823}.matrix-page .button-row{flex-wrap:wrap}.matrix-page table{min-width:760px}.matrix-page .resource-search{display:flex;gap:8px;flex-wrap:wrap}.matrix-page .resource-search input{flex:1;min-width:200px}.matrix-dialog .dialog-header,.matrix-dialog .dialog-footer{padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e1ebe7}.matrix-dialog .dialog-footer{border-bottom:0;border-top:1px solid #e1ebe7;justify-content:flex-end;gap:8px}
.matrix-bulk{flex-wrap:wrap}.matrix-bulk label{flex:0 0 auto;flex-direction:row;white-space:nowrap;margin:0;cursor:pointer}.matrix-bulk label input[type="checkbox"]{display:inline-block;flex:0 0 16px;width:16px;height:16px;min-height:16px;padding:0;margin:0;accent-color:var(--brand,#198e70)}.matrix-bulk>span{flex:0 0 auto;white-space:nowrap}
.matrix-page .matrix-actions{justify-content:flex-end}

.matrix-page .matrix-account-table{table-layout:fixed;min-width:1270px;width:100%}
.matrix-account-table th,.matrix-account-table td{white-space:nowrap;vertical-align:middle}
.matrix-account-table tbody tr{height:96px}
.matrix-account-table td{height:96px;box-sizing:border-box;padding-top:10px;padding-bottom:10px;overflow:hidden;text-overflow:ellipsis}
.matrix-page .matrix-account-table th.matrix-selection{width:48px}
.matrix-page .matrix-account-table th.matrix-employee{width:90px}
.matrix-page .matrix-account-table th.matrix-account{width:280px}
.matrix-page .matrix-account-table th.matrix-phone{width:125px}
.matrix-page .matrix-account-table th.matrix-count{width:65px}
.matrix-page .matrix-account-table th.matrix-recency{width:145px}
.matrix-page .matrix-account-table th.matrix-sync-time{width:165px}
.matrix-page .matrix-account-table th.matrix-operation{width:auto}
.matrix-account-table .matrix-person{min-width:0;min-height:74px;height:auto;overflow:visible}
.matrix-account-table .matrix-person>div{min-width:0;overflow:hidden}
.matrix-account-table .matrix-person strong,.matrix-account-table .matrix-person small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:18px}
.matrix-account-table .matrix-person img{flex:0 0 40px}
.matrix-account-table input[type="checkbox"]{width:16px;height:16px;min-height:16px;padding:0;margin:0;accent-color:var(--brand,#198e70)}
.matrix-account-buttons{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;height:34px}
.matrix-account-buttons button{display:inline-flex;align-items:center;justify-content:center;gap:4px;flex:0 0 auto;min-height:32px;padding:6px 8px;white-space:nowrap}
.matrix-account-buttons svg{width:15px;height:15px;flex:0 0 15px}

.workspace main:has(.matrix-page){max-width:none;width:100%;margin:0;padding:10px 16px 20px}
.matrix-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:10px;min-height:34px}
.matrix-toolbar .matrix-tabs{margin:0;flex:0 0 auto}
.matrix-toolbar .matrix-toolbar-actions{margin:0 0 0 auto;flex:0 0 auto;gap:6px}
.matrix-toolbar .matrix-status{margin:0;min-width:0;flex:1;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.matrix-toolbar .matrix-progress{padding:4px 8px;margin:0;gap:8px;min-width:0;flex:1;font-size:12px;line-height:1.5;flex-wrap:wrap}
.matrix-toolbar button{min-height:32px;padding-top:5px;padding-bottom:5px}
@media(max-width:760px){.matrix-toolbar{gap:8px}.matrix-toolbar .matrix-status,.matrix-toolbar .matrix-progress{order:3;flex-basis:100%}}

.matrix-page>.card{padding:16px}
.matrix-page .matrix-account-table th,.matrix-page .matrix-account-table td{padding-left:12px;padding-right:12px}
.matrix-page .matrix-account-table th.matrix-operation{text-align:left}
@media(max-width:700px){.workspace main:has(.matrix-page){padding-left:10px;padding-right:10px}.matrix-page>.card{padding:12px}}

.matrix-page .matrix-account-table th.matrix-phone-owner{width:130px}

.matrix-page .resource-search{max-width:none;width:100%;flex-wrap:nowrap;align-items:center;gap:8px;margin-bottom:12px}
.matrix-page .resource-search input{flex:0 1 300px;min-width:160px;width:300px}
.matrix-page .resource-search select{flex:0 1 240px;width:240px;min-width:140px}
.matrix-page .resource-search button{flex:0 0 auto;white-space:nowrap}
.matrix-waterfall{columns:auto 200px;column-gap:14px;padding-top:12px}
.matrix-work{border-radius:8px;margin-bottom:14px;box-shadow:none}
.matrix-work>a img{max-height:320px;object-fit:cover}
.matrix-work>div{padding:10px}
.matrix-work strong{font-size:13px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.matrix-work small{font-size:11px;line-height:1.5;margin-top:5px}
.matrix-work span{font-size:11px;margin-top:6px}
.matrix-work details{margin-top:8px;padding-top:8px;font-size:12px}
.matrix-dashboard{padding:12px 0 14px;border-bottom:1px solid #e1ebe7;margin-bottom:2px}
.matrix-datebar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.matrix-datebar>strong{font-size:13px}.matrix-datebar>small{color:#78918e;font-size:11px;margin-left:auto}
.matrix-periods{display:flex;gap:4px}.matrix-periods button{min-height:30px;padding:4px 9px;font-size:12px;border:0;background:#f1f6f4}.matrix-periods button.selected{background:#e3f2ea;color:#198e70}
.matrix-datebar form{display:flex;align-items:center;gap:6px;margin:0}.matrix-datebar input{width:140px;min-width:0;padding:5px 7px;min-height:30px;font-size:12px}.matrix-datebar form button{min-height:30px;padding:5px 9px}
.matrix-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.matrix-stat-grid>div{padding:10px 14px;background:#f3f8f6;border-radius:7px}.matrix-stat-grid span{font-size:12px;color:#78918e}.matrix-stat-grid strong{display:block;font-size:24px;line-height:1.4;margin-top:2px}
.matrix-stat-note{font-size:11px;color:#78918e;margin:8px 0 0}
@media(max-width:640px){.matrix-page .resource-search{overflow-x:auto}.matrix-page .resource-search input{min-width:140px}.matrix-page .resource-search select{min-width:120px}.matrix-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.matrix-waterfall{columns:2;column-gap:10px}}

.matrix-phone-summary{display:flex;align-items:center;gap:10px;margin:0 0 12px;font-size:12px;color:#78918e}.matrix-phone-summary button{min-height:28px;padding:3px 8px}

/* True masonry positioning; no column balancing or card splitting. */
.masonry-ready{position:relative;display:block;columns:auto;column-count:auto;column-width:auto;padding-top:0}
.masonry-ready>.matrix-work,.masonry-ready>.recommendation-card{position:absolute;margin:0;box-sizing:border-box}

/* Equal-size work cards, with aligned covers and rows. */
.uniform-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px;columns:auto;align-items:stretch;padding-top:12px}
.uniform-cards>.matrix-work,.uniform-cards>.recommendation-card{position:relative;width:auto;height:430px;margin:0;display:flex;flex-direction:column;min-width:0;overflow:hidden}
.uniform-cards .matrix-work>a,.uniform-cards .recommendation-cover{display:block;height:260px;min-height:260px;flex:0 0 260px;background:#f2f7f5;overflow:hidden}
.uniform-cards .matrix-work>a img,.uniform-cards .recommendation-cover img{display:block;width:100%;height:260px;max-height:260px;object-fit:cover}
.uniform-cards .matrix-work>div,.uniform-cards .recommendation-card-body{flex:1;min-height:0;overflow:auto;padding:10px}
.uniform-cards .matrix-work strong,.uniform-cards .recommendation-card-body>strong{min-height:39px;max-height:39px;font-size:13px;line-height:19.5px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.uniform-cards .matrix-work details strong{min-height:0;max-height:none}
.uniform-cards .matrix-no-cover,.uniform-cards .recommendation-cover>span{height:260px;display:grid;place-items:center;padding:20px;box-sizing:border-box}
.uniform-cards .matrix-work details p{margin-top:8px}
@media(max-width:640px){.uniform-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;columns:auto}}
 .matrix-grant-people{display:grid;gap:10px;max-height:340px;overflow:auto;padding:8px 0}.matrix-grant-people label{display:flex;align-items:center;gap:8px}.matrix-grant-people input{width:auto;flex:none}

.matrix-dialog.matrix-grants-dialog{width:min(560px,calc(100vw - 32px));font-size:14px;color:var(--text,#243b33)}
.matrix-grants-dialog .dialog-header,.matrix-grants-dialog .dialog-footer{padding:14px 20px}.matrix-grants-dialog .dialog-header h2{margin:0;font-size:18px}.matrix-grants-dialog .dialog-body{padding:16px 20px;max-height:calc(88vh - 132px);overflow:auto}
.matrix-grants-dialog .matrix-grant-recipient{margin:0 0 12px;gap:6px;font-size:13px}.matrix-grants-dialog select{width:100%;min-height:36px}
.matrix-grants-dialog .matrix-grant-note{padding:10px 12px;border-radius:8px;background:#f0f8f5;color:#657b70;font-size:12px;line-height:1.6;margin-bottom:16px}
.matrix-grants-dialog fieldset{min-width:0;margin:0;padding:0;border:0}.matrix-grants-dialog legend{padding:0;margin-bottom:10px;font-weight:600;font-size:14px}.matrix-grants-dialog legend small{font-size:12px;font-weight:400;color:#788e82;margin-left:6px}
.matrix-grants-dialog input[data-grants-search]{width:100%;min-height:36px;margin-bottom:10px;padding:7px 10px}
.matrix-grants-dialog .matrix-grant-people{display:block;max-height:300px;overflow-y:auto;padding:0;border:1px solid #dce8e5;border-radius:8px}
.matrix-dialog.matrix-grants-dialog label.matrix-grant-row{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:10px;height:44px;min-height:44px;padding:0 12px;margin:0;text-align:left;font-weight:400;border-bottom:1px solid #edf2ef;cursor:pointer}
.matrix-grants-dialog .matrix-grant-row:last-child{border-bottom:0}.matrix-grants-dialog .matrix-grant-row:hover{background:#f6faf8}.matrix-grants-dialog .matrix-grant-row:has(input:checked){background:#edf8f2}
.matrix-dialog.matrix-grants-dialog .matrix-grant-row input[type=checkbox]{width:16px;height:16px;min-height:16px;flex:0 0 16px;margin:0;padding:0;accent-color:var(--brand,#229c69)}
.matrix-grants-dialog .matrix-grant-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:14px}.matrix-grants-dialog .matrix-grant-phone{color:#788e82;font-size:13px;white-space:nowrap}
.matrix-grants-dialog .matrix-grant-row[hidden],.matrix-grants-dialog .matrix-grant-empty[hidden]{display:none}.matrix-grants-dialog .matrix-grant-empty{text-align:center;padding:24px 0;color:#788e82;font-size:13px}.matrix-grants-dialog .matrix-grant-revoke{margin:10px 0 0;font-size:12px}.matrix-grants-dialog [data-grants-error]{color:#b63823;font-size:12px}.matrix-grants-dialog [data-grants-count]{margin-right:auto;font-size:13px;color:#788e82}
 .matrix-page .resource-search select[name="ownerKey"]{flex:0 1 180px;width:180px;min-width:120px}

.matrix-page .matrix-account-scroll{overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;min-height:120px;height:calc(100dvh - 300px)}
.matrix-account-scroll .matrix-account-table thead th{position:sticky;top:0;z-index:2;background:#f5f9f7;box-shadow:0 1px 0 #dce8e5}

.matrix-profile-heading{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.matrix-profile-heading a{font-size:12px;white-space:nowrap}.matrix-profile-metrics{display:flex;gap:10px;flex-wrap:wrap}.matrix-profile-stale{font-size:11px;color:#8a7860}

.matrix-account-table .matrix-person small.matrix-profile-metrics{display:flex;white-space:normal;overflow:visible;font-size:11px;gap:6px}.matrix-account-table .matrix-person .matrix-profile-heading{gap:8px}.matrix-account-table .matrix-person .matrix-profile-heading strong{max-width:100%}.matrix-account-table .matrix-person small.matrix-profile-stale{white-space:normal;line-height:15px;font-size:10px}

.matrix-profile-metrics span{white-space:nowrap}
