/* Shared console controls: readable narrow screens and reachable modal actions. */
.routing-policy-form{padding:24px;max-width:720px;max-height:85dvh;overflow:auto}
.routing-policy-form footer{position:sticky;bottom:-24px;background:white;padding:16px 0;display:flex;justify-content:flex-end;gap:12px}
.routing-policy-form td small{display:block;color:#68707c;margin-top:6px}
.routing-policy-form input[type=number]{width:110px}
.routing-policy-form input[readonly]{background:#f3f5f8;color:#475467}
#routingPolicyError{color:#b42318}
.invoice-extra{white-space:normal;max-width:320px}
.invoice-extra summary{display:inline-flex;cursor:pointer;list-style:none;color:#1769bb;min-height:32px;align-items:center}
.invoice-extra summary::before{content:'▸';margin-right:6px}
.invoice-extra[open] summary::before{content:'▾'}
.invoice-extra small{display:block;overflow-wrap:anywhere;line-height:1.6}
.table-wrap{max-width:100%;overflow-x:auto}
.table-wrap th,.table-wrap .price,.table-wrap .mono{word-break:normal}
.card-h .hint,.card-head .hint{flex-shrink:0}
.modal{max-height:92dvh;max-width:calc(100vw - 24px)}
.modal-h{flex-shrink:0}
@media(max-width:700px){.routing-policy-form{padding:16px}.routing-policy-form footer{bottom:-16px}.pricing-filterbar select{max-width:100%}.card-h,.card-head{flex-wrap:wrap;gap:10px}}
tr[data-page-hidden]{display:none!important}
.list-pager{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:14px 18px;flex-wrap:wrap}
.list-sort{border:0;background:transparent;color:inherit;font:inherit;text-align:inherit;cursor:pointer;padding:4px;white-space:nowrap}
.list-sort:focus-visible{outline:2px solid #1670d2;outline-offset:2px}
#orderFilters,.ops-filterbar,.customer-filterbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ops-filterbar>input,.ops-filterbar>select{width:auto;min-width:140px;flex:1 1 140px}
#ordProvider{white-space:normal;overflow-wrap:anywhere;line-height:1.5}
#personalCustomerResultCount{white-space:nowrap;flex-shrink:0}
#mdl-admin-reconciliation .modal{width:min(1000px,calc(100vw - 24px))}
#mdl-admin-reconciliation table{min-width:620px}
.return-public{margin:10px 8px!important;border:1px solid #b7d7f8!important;background:#eaf4ff!important;color:#075bb7!important;font-weight:650!important;justify-content:center}
#tbAdminBadge[data-redundant-role]{display:none!important}
#soPresetList{display:flex;flex-direction:column;gap:10px}
#soPresetList select,#soPresetList input{width:100%}
.organization-row-secondary{display:flex;flex-wrap:wrap;gap:8px}

#routingPolicyDialog,#enterpriseModelManagerDialog{border:1px solid #e1e5eb;border-radius:18px;padding:0;max-width:calc(100vw - 24px);box-shadow:0 20px 60px #10203026}
#routingPolicyDialog::backdrop,#enterpriseModelManagerDialog::backdrop{background:#15223866}
#routingPolicyDialog th,#routingPolicyDialog td,#enterpriseModelManagerDialog th,#enterpriseModelManagerDialog td{display:table-cell!important}
#routingPolicyDialog table{min-width:0;width:100%}
#routingPolicyDialog td{white-space:normal;padding:12px 6px}
#routingPolicyDialog td:last-child{min-width:110px}
#routingPolicyDialog input[type=number]{width:82px}
.date-display{display:inline-flex;align-items:center;position:relative;min-width:148px;height:38px;flex:0 0 148px;background:var(--surface,#fff);border:1px solid var(--line,#d6dce4);border-radius:8px}
.date-display>input[type=date]{position:absolute!important;inset:0;width:100%!important;height:100%;opacity:0;cursor:pointer;margin:0!important;z-index:1}
.date-display-label{padding:0 10px;font-variant-numeric:tabular-nums;pointer-events:none;white-space:nowrap}
.date-display::after{content:'▦';margin-left:auto;margin-right:10px;pointer-events:none;color:#68707c}
.date-display:focus-within{outline:2px solid #1670d2;outline-offset:2px}
.date-display.date-disabled{opacity:.5}
.wechat-identity-choices{display:flex;flex-direction:column;gap:12px;margin:16px 0}
#wechatIdentityDialog{border:1px solid #d6dce4;border-radius:16px;max-width:calc(100vw - 24px)}
#rcRows td:nth-child(7),#mdl-routecost th:nth-child(7){display:none!important}

/* Keep pagination compact instead of inheriting full-width form controls. */
.list-pager>select{width:auto;min-width:76px;flex:0 0 auto}
/* Keep model actions on one line; the column hugs its content so the table
   fits the card without a desktop horizontal scrollbar. */
.org-model-table td:last-child{white-space:nowrap}
/* Prices may wrap, but at most two-per-line: three stacked chips would blow
   the row-height budget the browser tests assert (<110px). */
#appShell .org-workspace .org-model-table .contract-prices{min-width:170px}

.org-model-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;white-space:nowrap}
.org-model-actions select{flex:none;margin-right:0!important}

.table-empty{text-align:left!important;white-space:normal!important}
.table-empty-message{display:block;position:sticky;left:26px;width:max-content;max-width:min(100%,480px,calc(100vw - 100px));overflow-wrap:anywhere}
@supports(width:1cqw){.table-wrap:has(.table-empty-message){container-type:inline-size}.table-empty-message{max-width:min(100%,480px,calc(100cqw - 52px))}}
/* Key editor: fixed actions, compact fields and an independently scrollable model list. */
#tokenEditDialog{width:min(600px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid #dce3ed;border-radius:16px;overflow:hidden;box-shadow:0 24px 80px #18304e33}
#tokenEditDialog::backdrop{background:#182a4466}
#tokenEditDialog .token-edit-form{display:flex;flex-direction:column;height:min(740px,calc(100dvh - 26px));max-height:calc(100dvh - 26px);padding:0;margin:0}
#tokenEditDialog .token-edit-form:has(#tokenEditModelSection[hidden]){height:auto}
#tokenEditDialog .token-edit-header{display:flex;justify-content:space-between;flex:none;gap:16px;padding:20px 24px 16px;border-bottom:1px solid #e8edf3;min-height:0}
#tokenEditDialog .token-edit-header h2{font-size:20px;line-height:1.3;margin:0 0 6px;color:#1c2d45}
#tokenEditDialog .token-edit-header p{font-size:12px;line-height:1.5;margin:0}
#tokenEditDialog .token-edit-close{font-size:24px;line-height:28px;width:32px;height:32px;flex:none;color:#718096;align-self:flex-start}
#tokenEditDialog .token-edit-body{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;margin:0;padding:18px 24px;border:0;overflow:auto;gap:16px}
#tokenEditDialog .token-edit-fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;flex:none}
#tokenEditDialog .form-group{display:flex;flex-direction:column;gap:7px;flex:none;margin:0;padding:0;min-width:0}
#tokenEditDialog .form-group>label{font-size:12px;font-weight:600;color:#445570;line-height:1.5;margin:0}
#tokenEditDialog .token-edit-body input:not([type=checkbox]),#tokenEditDialog .token-edit-body select{width:100%;min-height:38px;font-size:13px;border:1px solid #d9e1ec;border-radius:8px;padding:8px 11px}
#tokenEditDialog .token-expiry-controls{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
#tokenEditDialog .token-expiry-controls select{flex:1;min-width:160px}
#tokenEditDialog .token-edit-help{font-size:12px;line-height:1.6;color:#718096;margin:0}
#tokenEditDialog #tokenEditModelSection{display:flex;flex-direction:column;flex:1;min-height:140px}
#tokenEditDialog #tokenEditModelSection[hidden]{display:none!important}
#tokenEditDialog .token-model-tools{display:flex;flex:none;gap:12px;align-items:center;margin-bottom:8px}
#tokenEditDialog .token-model-tools input{min-width:0;flex:1}
#tokenEditDialog .token-model-tools>span{white-space:nowrap;font-size:12px;color:#6c7b90}
#tokenEditDialog #tokenEditModels{flex:1;min-height:0;max-height:none;overflow:auto;border:1px solid #e2e8f1;border-radius:10px;padding:4px}
#tokenEditDialog #tokenEditModels .token-model-option{display:flex;align-items:center;gap:10px;padding:10px;margin:0;border-radius:6px;cursor:pointer;min-height:42px;font-size:13px;line-height:1.5}
#tokenEditDialog #tokenEditModels .token-model-option:hover{background:#f3f7fc}
#tokenEditDialog #tokenEditModels .token-model-option[hidden]{display:none!important}
#tokenEditDialog #tokenEditModels input[type=checkbox]{width:16px;height:16px;min-width:16px;min-height:16px;max-width:16px;max-height:16px;padding:0;flex:0 0 16px;margin:0;accent-color:#0877e8}
#tokenEditDialog #tokenEditModels .token-model-option>span{min-width:0;overflow-wrap:anywhere}
#tokenEditDialog #tokenEditModels small{display:block;font-size:11px;color:#8793a6;margin-top:2px}
#tokenEditDialog .token-edit-footer{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex:none;padding:14px 24px;border-top:1px solid #e8edf3;background:#fff}
#tokenEditDialog .token-edit-footer>span{margin-right:auto;font-size:11px;color:#8693a6}
#tokenEditDialog .token-edit-footer .btn{min-width:80px;min-height:38px;border-radius:8px;font-size:13px}
#tokenEditError{font-size:12px;line-height:1.6;color:#b42318;margin:0}
@media(max-width:600px){#tokenEditDialog .token-edit-header{padding:18px}#tokenEditDialog .token-edit-body{padding:16px 18px}#tokenEditDialog .token-edit-footer{padding:14px 18px}#tokenEditDialog .token-edit-footer>span{display:none}#tokenEditDialog .token-edit-footer .btn{flex:1}#tokenEditDialog .token-edit-fields-grid{gap:12px}#tokenEditDialog .token-expiry-controls select{min-width:0}}
@media(max-width:360px){#tokenEditDialog .token-edit-fields-grid{grid-template-columns:1fr}}

#tokenEditFields:disabled .date-display{opacity:.55}
