/* Service workspaces use the available width; auth forms retain their own widths. */
.main {min-width:0;}
.main > .content {width:100%;max-width:none;margin-inline:0;box-sizing:border-box;padding-inline:24px;container-type:inline-size;container-name:workspace;}
.workspace > main {width:100%;max-width:none;box-sizing:border-box;padding-inline:24px;}
.content .table-wrap {min-width:0;max-width:100%;}
.content .mobile-record-table {width:100%!important;min-width:0!important;table-layout:fixed;white-space:normal;}
.content .mobile-record-table th,.content .mobile-record-table td {min-width:0!important;white-space:normal;overflow-wrap:anywhere;vertical-align:top;line-height:1.6;}
.content .mobile-record-table td .sub,.content .mobile-record-table td .text-btn,.content .mobile-record-table td .badge {white-space:normal;overflow-wrap:anywhere;max-width:100%;}
.content .mobile-record-table td .actions {display:flex;flex-wrap:wrap;gap:6px;}
.content .mobile-record-table td .btn {max-width:100%;min-width:0;white-space:normal;margin:3px 3px 3px 0;}
.content .mobile-record-table td input:not([type=checkbox]):not([type=radio]),.content .mobile-record-table td select {min-width:0!important;max-width:100%;box-sizing:border-box;}
.content .mobile-record-table td img {max-width:100%;object-fit:contain;}
.content .search-bar,.content .heading,.content .heading-actions {flex-wrap:wrap;}
.content .search-bar {align-items:end;gap:10px;}
.content .search-bar input,.content .search-bar select {min-width:0;max-width:100%;}
.content .search-bar > input {flex:2 1 240px;}
.content .search-bar > select {flex:1 1 170px;}
.content .search-bar > .btn {flex:0 0 auto;}
@media(max-width:640px){.main > .content,.workspace > main {padding-inline:12px;}}

/* A narrow workspace (including a laptop beside the sidebar) stacks long rows. */
@media(min-width:641px){
@container workspace (max-width:1000px){
 table.mobile-record-table{display:block!important;width:100%!important;min-width:0!important;table-layout:auto!important;white-space:normal;font-size:14px;border:0}
 .mobile-record-table>colgroup{display:none}
 .mobile-record-table>thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .mobile-record-table.mobile-has-header-controls>thead{position:static;width:auto;height:auto;clip-path:none;white-space:normal;margin-bottom:10px}
 .mobile-record-table.mobile-has-header-controls>thead>tr{display:flex;flex-wrap:wrap;gap:8px}
 .mobile-record-table.mobile-has-header-controls>thead>tr>th:not(.mobile-header-control){display:none}
 .mobile-record-table.mobile-has-header-controls>thead>tr>.mobile-header-control{display:flex;align-items:center;gap:8px;min-height:44px;border-radius:8px;padding:8px 12px}
 .mobile-record-table .mobile-header-control input[type=checkbox]{width:22px;height:22px}
 .mobile-record-table>tbody{display:grid!important;gap:12px;width:100%}
 .mobile-record-table>tbody+tbody{margin-top:12px}
 .mobile-record-table>tbody>tr{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 12px;width:auto!important;min-width:0!important;padding:8px 12px;border:1px solid var(--line,#e1e8f1);border-radius:12px;background:var(--card,#fff);box-sizing:border-box}
 .mobile-record-table>tbody>tr>td,.mobile-record-table>tbody>tr>th{display:block!important;width:auto!important;min-width:0!important;max-width:100%!important;padding:10px 0!important;border-bottom:1px solid #edf1f5;text-align:left!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;box-sizing:border-box;background:transparent}
 .mobile-record-table>tbody>tr>.mobile-cell-wide{grid-column:1/-1}
 .mobile-record-table>tbody>tr>td::before{content:attr(data-mobile-label);display:block;font-size:11px;font-weight:600;color:#65748b;line-height:1.4;margin-bottom:6px}
 .mobile-record-table>tbody>tr>td[data-mobile-label=""]::before{display:none}
 .mobile-record-table td .sub,.mobile-record-table td small,.mobile-record-table td p,.mobile-record-table td .text-btn{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;max-width:100%;overflow-wrap:anywhere}
 .mobile-record-table td .btn,.mobile-record-table td button{min-height:40px;white-space:normal;max-width:100%;margin:3px 5px 3px 0}
 .mobile-record-table td input:not([type=checkbox]):not([type=radio]),.mobile-record-table td select,.mobile-record-table td textarea{width:100%!important;min-width:0!important;max-width:100%;font-size:16px;box-sizing:border-box}
 .mobile-record-table td input[type=checkbox]{width:22px;height:22px}
 .mobile-record-table td details{min-width:0!important;width:100%}
 .mobile-record-table td summary{padding:10px 0;min-height:40px;box-sizing:border-box}
 .mobile-record-table td img{max-width:100%;object-fit:contain}
 .mobile-record-table>tfoot{display:block}
 .mobile-record-table>tfoot>tr{display:flex;flex-wrap:wrap;gap:8px}

}
}

/* Give addresses and contacts room without pushing actions off-screen. */
.content .partner-request-table th:nth-child(1){width:12%}
.content .partner-request-table th:nth-child(2){width:10%}
.content .partner-request-table th:nth-child(3){width:22%}
.content .partner-request-table th:nth-child(4){width:9%}
.content .partner-request-table th:nth-child(5){width:17%}
.content .partner-request-table th:nth-child(6){width:8%}
.content .partner-request-table th:nth-child(7){width:11%}
.content .partner-request-table th:nth-child(8){width:11%}
.content .mobile-record-table td {word-break:normal;}
@media(min-width:641px){
 @container workspace (max-width:1000px){
  .mobile-record-table.mobile-has-header-controls>thead>tr>.mobile-header-control {width:auto!important;}
 }
}

/* Distinct workflow states; text remains visible alongside color. */
.badge.as-status-matching {background:#fff4d6;color:#854d0e;border:1px solid #f2d18a;font-weight:700;}
.badge.as-status-hq-closed {background:#f1e8ff;color:#6b21a8;border:1px solid #d8b4fe;font-weight:700;}
.badge.as-status-assigned {background:#dff5ee;color:#065f46;border:1px solid #9edac5;font-weight:700;}
