.portal-shell { grid-template-columns: clamp(202px,17vw,236px) minmax(0,1fr); }
.portal-shell .sidebar { display: flex; flex-direction: column; padding: 16px 12px 14px; }
.portal-shell .brand { flex: 0 0 auto; padding-bottom: 16px; }
.portal-shell .nav-list { min-height: 0; gap: 4px; overflow: auto; }
.portal-shell .nav-item { min-height: 42px; gap: 11px; padding: 0 12px; border-radius: 8px; color: #47515f; font-size: 14px; font-weight: 550; }
.portal-shell .nav-item.is-active { color: #115da6; background: #e2eefc; font-weight: 650; }
.portal-shell .nav-item:focus-visible { outline-offset: -2px; }
.portal-shell .nav-item svg { width: 20px; height: 20px; padding: 0; flex-shrink: 0; color: inherit; box-shadow: none; }
.portal-shell .sidebar-contact { min-height: 42px; padding: 8px 12px; border-radius: 9px; background: #0969c9; color: #fff; font-size: 13px; font-weight: 650; white-space: nowrap; }
.portal-shell .sidebar-contact:hover { background: #0759ac; color: #fff; }
.portal-shell .sidebar-contact svg { stroke-width: 1.75; }
.portal-header { justify-content: space-between; gap: 16px; }
.portal-content { overflow: auto; }
.portal-content > div { height: 100%; }
.portal-panel > [data-list] { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.portal-table td { overflow-wrap: anywhere; }
.portal-table td:last-child { text-align: center; }
.portal-table td .portal-text-button { margin: 0 6px; white-space: nowrap; }
.portal-text-button.is-danger { color: #ff3b30; }
.portal-status { color: #989eaa; }
.portal-status.is-online { color: #29944b; }
.portal-task-account { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #edf0f4; align-items: center; }
[data-accounts] { max-height: 200px; overflow: auto; margin-top: 8px; }
.portal-panel { display: flex; flex-direction: column; height: 100%; min-height: 430px; min-width: 0; overflow: hidden; border: 1px solid rgba(60,60,67,.10); border-radius: 18px; background: var(--apple-panel); box-shadow: 0 7px 24px rgba(36,47,71,.045); }
.portal-panel .user-toolbar { flex-shrink: 0; }
.portal-panel .user-toolbar-actions { margin-left: auto; }
.portal-field.portal-sip-import textarea,
.portal-field.portal-sip-export textarea { grid-column: 1 / -1; width: 100%; min-height: 220px; font-family: "SFMono-Regular", Consolas, monospace; line-height: 1.8; }
.portal-sip-import-guide { margin-left: 0 !important; }
.portal-sip-toolbar { flex-wrap: wrap; gap: 12px; }
.portal-sip-toolbar .user-toolbar-actions { align-items: center; min-width: 0; }
.portal-sip-selected { color: #505b6c; font-size: 12px; font-weight: 550; white-space: nowrap; }
.portal-sip-state { display: inline-block; padding: 3px 8px; border-radius: 999px; color: #505b6c; background: #edf0f4; font-size: 12px; font-weight: 600; white-space: nowrap; }
.portal-sip-state.is-online { color: #206640; background: #e8f5ec; }
.portal-transfer-actions { display: flex; align-items: center; gap: 8px; margin-left: 6px; padding-left: 14px; border-left: 1px solid #e4e7ed; }
.portal-transfer-actions button { white-space: nowrap; }
.portal-sip-scope { margin: 0 0 12px; color: #8b929f; font-size: 12px; overflow-wrap: anywhere; }
.portal-table-area { flex: 1; position: relative; overflow: auto; min-height: 280px; }
.portal-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.portal-table th { position: sticky; top: 0; z-index: 1; height: 42px; padding: 0 14px; font-size: 12px; font-weight: 600; color: #797b82; text-align: left; white-space: nowrap; background: #f7f8fa; border-bottom: 1px solid var(--apple-line); }
.portal-table th:last-child { text-align: center; }
.portal-table .portal-check { width: 48px; padding: 0 16px; }
.portal-table td { height: 54px; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--apple-line); }
.portal-empty { min-height: 230px; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: #a0a5af; }
.portal-empty svg { width: 42px; height: 42px; color: #c6cbd5; margin-bottom: 5px; stroke-width: 1.1; }
.portal-empty strong { color: #8d929d; font-size: 13px; font-weight: 500; }
.portal-empty span { font-size: 12px; color: #b0b4bd; }
.portal-pagination { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #edf0f4; padding: 12px 18px; min-height: 54px; font-size: 11px; color: #969ba5; }
.portal-pagination > div { display: flex; align-items: center; gap: 14px; }
.portal-pagination button { padding: 6px 10px; border: 0; border-radius: 7px; background: #f3f4f7; color: #9297a2; font-size: 11px; }
.portal-call-header { flex-shrink: 0; display: grid; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--apple-line); }
.portal-call-toolbar { display: grid; grid-template-columns: minmax(160px, 310px) 1fr; align-items: center; gap: 10px; }
.portal-call-toolbar .user-search { width: 100%; min-width: 0; height: 38px; }
.portal-call-filters { display: grid; grid-template-columns: minmax(126px, 168px) repeat(2, minmax(100px, max-content)); justify-content: end; gap: 8px; }
.portal-call-categories { display: grid; grid-template-columns: repeat(5, minmax(max-content, 1fr)); gap: 3px; width: min(100%, 440px); padding: 3px; border-radius: 11px; background: #eff1f5; }
.portal-call-categories button { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 34px; padding: 4px 5px; border: 0; border-radius: 8px; background: transparent; color: #424b59; font: inherit; font-size: 13px; font-weight: 550; white-space: nowrap; cursor: pointer; }
.portal-calls-panel [data-tone="neutral"] { --call-tone: #545f6e; --call-tint: #edf0f4; }
.portal-calls-panel [data-tone="positive"] { --call-tone: #206640; --call-tint: #e8f5ec; }
.portal-calls-panel [data-tone="attention"] { --call-tone: #855416; --call-tint: #fcf2df; }
.portal-calls-panel [data-tone="active"] { --call-tone: #205e9c; --call-tint: #eaf3ff; }
.portal-calls-panel [data-tone="failed"] { --call-tone: #a13639; --call-tint: #f9eded; }
.portal-call-categories button:not([data-call-category=""])::before { content: ""; flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--call-tone); }
.portal-call-categories button:hover { background: rgba(255,255,255,.65); }
.portal-call-categories button[aria-pressed="true"] { background: #fff; color: var(--call-tone); font-weight: 650; box-shadow: 0 1px 4px rgba(31,42,59,.13); }
.portal-call-categories button[data-call-category=""][aria-pressed="true"] { color: #145590; }
.portal-call-categories button:focus-visible, .portal-call-action button:focus-visible { outline: 2px solid #257dc6; outline-offset: 2px; }
.portal-call-table th:nth-child(1) { width: 20%; }
.portal-call-table th:nth-child(2) { width: 19%; }
.portal-call-table th:nth-child(3) { width: 13%; }
.portal-call-table th:nth-child(4) { width: 14%; }
.portal-call-table th:nth-child(5) { width: 11%; }
.portal-call-table th:nth-child(6) { width: 16%; }
.portal-call-table th:nth-child(7) { width: 7%; }
.portal-call-credits { font-variant-numeric: tabular-nums; }
.portal-call-table td { height: 60px; padding-block: 9px; }
.portal-call-table tbody tr:hover { background: #fafbfd; }
.portal-call-party strong { display: block; color: #242b36; font-size: 13px; font-weight: 650; }
.portal-call-table td small { display: block; margin-top: 3px; color: #606b7b; font-size: 11px; line-height: 1.35; }
.portal-call-time, .portal-call-duration, .portal-call-party strong { font-variant-numeric: tabular-nums; }
.portal-call-tag { display: inline-block; min-width: max-content; padding: 3px 8px; border-radius: 999px; background: var(--call-tint); color: var(--call-tone); font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.portal-call-action .portal-text-button { min-height: 32px; padding-inline: 6px; border-radius: 8px; }

@media (max-width: 960px) {
  .portal-call-header { padding-inline: 10px; }
  .portal-call-categories button { gap: 4px; min-height: 38px; padding-inline: 2px; font-size: 12px; }
  .portal-call-categories button:not([data-call-category=""])::before { flex-basis: 5px; height: 5px; }
  .portal-call-rows { background: #f4f6fa; padding: 0 10px; }
  .portal-table.portal-call-table, .portal-call-table tbody { display: block; min-width: 0; }
  .portal-call-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .portal-call-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "party intent" "name name" "result action" "credits action" "time action"; gap: 4px 10px; margin: 8px 0; padding: 10px; border: 1px solid var(--apple-line); border-radius: 12px; background: #fff; }
  .portal-call-table td { min-width: 0; height: auto; padding: 0; border: 0; }
  .portal-call-party { grid-area: party; }
  .portal-call-credits { grid-area: credits; color: #606b7b; font-size: 12px; }
  .portal-call-name { grid-area: name; color: #495363; }
  .portal-call-intent-cell { grid-area: intent; text-align: right; }
  .portal-call-result { grid-area: result; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .portal-call-table td.portal-call-time { grid-area: time; display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; color: #606b7b; font-size: 11px; }
  .portal-call-table td.portal-call-result small, .portal-call-table td.portal-call-time small { margin: 0; }
  .portal-call-action { grid-area: action; align-self: center; }
  .portal-call-table td.portal-call-action .portal-text-button { margin: 0; background: #eef5ff; padding-inline: 12px; }
}
.portal-modal { padding: 24px; }
.portal-modal .user-modal-dialog { width: min(480px,calc(100vw - 40px)); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; border-radius: 24px; }
.portal-modal .portal-dialog-wide { width: min(720px,calc(100vw - 40px)); }
.portal-modal .portal-confirm-dialog { width: min(360px,calc(100vw - 40px)); }
.portal-confirm-dialog .portal-dialog-body { padding: 26px 24px 20px; text-align: center; }
.portal-confirm-dialog h2 { margin: 0 0 10px; color: #272d38; font-size: 18px; font-weight: 600; }
.portal-confirm-copy { margin: 0; color: #8b929f; font-size: 13px; line-height: 1.6; }
.portal-confirm-actions { display: flex; gap: 10px; margin-top: 24px; }
.portal-confirm-actions button { flex: 1; min-height: 42px; border: 0; border-radius: 11px; background: #f0f2f6; color: #505762; font: inherit; font-size: 13px; cursor: pointer; }
.portal-confirm-actions button.is-danger { background: #ff3b30; color: white; }
.portal-confirm-actions button:disabled { opacity: .5; cursor: default; }
.portal-confirm-dialog .portal-form-error { text-align: left; }
.portal-sip-history-toolbar { display: flex; align-items: center; justify-content: flex-end; align-self: flex-end; gap: 8px; }
.portal-sip-history-toolbar .apple-date-trigger { min-width: 135px; }
.portal-modal .user-modal-dialog:has(.portal-sip-history-window) { width: min(680px,calc(100vw - 40px)); height: min(660px,calc(100dvh - 48px)); }
.portal-modal .user-modal-dialog:has(.portal-sip-history-window) > .portal-dialog-close-only { display: flex; justify-content: space-between; min-height: 68px; padding: 20px 24px 12px; border: 0; background: transparent; }
.portal-modal .user-modal-dialog:has(.portal-sip-history-window) > .portal-dialog-close-only h2 { text-align: left; font-size: 21px; font-weight: 650; }
.portal-modal .user-modal-dialog:has(.portal-sip-history-window) .portal-dialog-close { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border-radius: 50%; background: #f2f3f6; color: #85878e; }
.portal-modal .user-modal-dialog:has(.portal-sip-history-window) .portal-dialog-close svg { width: 16px; height: 16px; }
.portal-modal .user-modal-dialog:has(.portal-sip-history-window) .portal-dialog-close:focus-visible { outline: 2px solid #007aff; outline-offset: 3px; }
.portal-modal .portal-dialog-body:has(.portal-sip-history-window) { display: flex; flex: 1; overflow: hidden; padding: 0 24px 24px; }
.portal-sip-history-window { display: flex; flex-direction: column; flex: 1; gap: 16px; min-width: 0; min-height: 0; }
.portal-sip-history-table { flex: 1; overflow: auto; min-height: 0; border: 1px solid var(--apple-line); border-radius: 13px; scrollbar-width: thin; }
.portal-sip-history-table .portal-table { min-width: 480px; }
.portal-sip-history-table .portal-table th { height: 40px; padding: 0 8px; font-size: 12px; font-weight: 500; }
.portal-sip-history-table .portal-table td { height: 54px; padding: 10px 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.portal-sip-history-table .portal-table th:last-child,
.portal-sip-history-table .portal-table td:last-child { text-align: right; padding-right: 12px; }
.portal-sip-history-table td small { display: block; margin-top: 3px; color: #a0a5af; font-size: 11px; }
.portal-sip-call-result { display: inline-flex; align-items: center; gap: 6px; color: #d9342b; white-space: nowrap; }
.portal-sip-call-result::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.portal-sip-call-result[data-tone="connected"] { color: #248a3d; }
.portal-sip-call-result[data-tone="waiting"] { color: #d58a14; }
.portal-sip-history-state { flex-shrink: 0; margin: 0; color: #a0a5af; text-align: center; font-size: 12px; }
.portal-sip-history-window > [data-history-retry] { flex-shrink: 0; align-self: center; }
.portal-sip-history-footer { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 2px; }
.portal-sip-history-footer .portal-pagination { justify-content: flex-start; flex-wrap: wrap; gap: 8px 14px; min-height: 0; padding: 0; border: 0; }
.portal-sip-history-footer .portal-pagination > div { gap: 8px; }
.portal-sip-history-footer .portal-pagination button { padding: 5px 8px; }
.portal-sip-summary { display: flex; gap: 16px; min-width: 0; margin-left: auto; color: #797b82; font-size: 12px; }
.portal-sip-summary > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.portal-sip-summary > div + div { border-left: 1px solid var(--apple-line); padding-left: 16px; }
.portal-sip-summary span { white-space: nowrap; }
.portal-sip-summary strong { color: #17181b; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-modal .user-modal-dialog > header { flex-shrink: 0; }
.portal-dialog-body { padding: 18px 20px 20px; overflow: auto; min-height: 0; }
.portal-field { display: grid !important; grid-template-columns: minmax(0,1fr); align-items: start; gap: 7px; margin: 0 0 14px; padding: 0; border: 0; font-size: 13px; color: #55575e; }
.portal-task-file-info > [data-recording-name] { display: block; overflow-wrap: anywhere; }
.portal-voice-status { font-size: 13px; color: #55575e; overflow-wrap: anywhere; }
.portal-field:last-of-type { border-bottom: 0; }
.portal-field:has(textarea) { align-items: start; }
.portal-field:has(textarea) > span { padding-top: 0; }
.portal-field input,
.portal-field textarea,
.portal-account-select input[type="search"] { width: 100%; min-width: 0; border: 1px solid rgba(60,60,67,.14); border-radius: 12px; padding: 10px 12px; background: #f6f7f9; color: #17181b; font: inherit; outline: none; box-sizing: border-box; }
.portal-field input { min-height: 42px; }
.portal-field textarea { resize: vertical; line-height: 1.65; min-height: 75px; }
.portal-field input:focus,
.portal-field textarea:focus,
.portal-account-select input[type="search"]:focus { border-color: #84b9f5; box-shadow: 0 0 0 3px #007aff0c; background: #fff; }
.portal-field input::placeholder,
.portal-field textarea::placeholder,
.portal-account-select input[type="search"]::placeholder { color: #a4a9b3; }
.portal-field .apple-control-wrap { width: 100%; }
.portal-field .apple-control-trigger { width: 100%; min-height: 42px; }
.portal-field-note { margin: 6px 0 10px; color: #85878e; font-size: 12px; line-height: 1.6; }
.portal-form-error { margin: 14px 0 0; font-size: 12px; color: #b17b30; line-height: 1.5; }
.portal-scope { margin: 0 0 12px; padding: 11px 13px; border-radius: 10px; background: #f3f6fc; color: #778297; font-size: 12px; }
.portal-text-button { padding: 3px 0; border: 0; background: none; color: #007aff; font-size: 12px; cursor: pointer; }
.portal-number-count { margin: 5px 0 0; font-size: 11px; color: #85878e; }
.portal-number-count.is-error { color: #d18a35; }
.portal-account-select { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 16px; font-size: 13px; padding: 13px 0; border-bottom: 1px solid #eef0f4; }
.portal-account-select > span { padding-top: 11px; }
.portal-small-empty { padding: 18px 12px; border: 1px solid #e7eaf0; border-radius: 10px; margin-top: 8px; text-align: center; color: #a3a9b3; font-size: 12px; }
.portal-task-form, .portal-task-group { display: grid; min-width: 0; }
.portal-task-form { gap: 16px; }
.portal-task-group { gap: 10px; }
.portal-task-group + .portal-task-group { padding-top: 14px; border-top: 1px solid var(--apple-line); }
.portal-task-group h3 { margin: 0; color: #242630; font-size: 14px; font-weight: 650; }
.portal-task-form .portal-field { min-width: 0; margin: 0; gap: 5px; }
.portal-task-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 10px 14px; }
.portal-task-ai-settings { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 10px 14px; min-width: 0; }
[data-voice-fields] > .portal-voice-preview-status { grid-column: 1 / -1; }
.portal-task-upload { align-items: end; }
.portal-task-switch, .portal-task-switches, .portal-task-heading { display: flex; align-items: center; }
.portal-task-switch { gap: 8px; min-height: 30px; color: #55575e; font-size: 13px; }
.portal-task-switch input[type=checkbox] { appearance: none; position: relative; width: 42px; min-width: 42px; height: 26px; border: 0; border-radius: 15px; margin: 0; padding: 0; background: #a5a8af; cursor: pointer; }
.portal-task-switch input[type=checkbox]:checked { background: #17834c; }
.portal-task-switch input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; }
.portal-task-switch input[type=checkbox]:checked::after { margin: 0; border: 0; transform: translateX(16px); }
.portal-task-switch input:focus-visible { outline: 3px solid #5b9de8; outline-offset: 2px; }
.portal-task-switches { gap: 20px; flex-wrap: wrap; }
.portal-task-heading { justify-content: space-between; flex-wrap: wrap; gap: 2px 16px; }
.portal-task-chat { display: flex; align-items: end; gap: 12px; }
.portal-task-chat .portal-field { flex: 1; }
.portal-task-chat button { min-height: 42px; padding: 0 10px; }
.portal-task-form [data-notify-status] { margin-bottom: 0; }
.portal-task-voice { min-width: 0; }
.portal-voice-preview-status { margin: 6px 0 0; color: #85878e; font-size: 11px; line-height: 1.5; }
.portal-task-form .portal-account-select { display: grid; grid-template-columns: minmax(0,1fr); padding: 0; border: 0; gap: 7px; }
.portal-task-form .portal-account-select > span { padding: 0; color: #55575e; }
.portal-segmented { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: rgba(118,118,128,.10); }
.portal-segmented button { flex: 1; min-height: 34px; border: 0; border-radius: 8px; background: transparent; color: #797b82; font-size: 13px; cursor: pointer; }
.portal-segmented button[aria-pressed="true"] { color: #17181b; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.10); }
.portal-task-account-count { margin: 6px 0 0; color: #797b82; font-size: 11px; }
.portal-task-account-tools { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.portal-task-account-tools input { flex: 1; min-width: 0; height: 35px; font-size: 12px; }
.portal-task-account-tools button { flex: 0 0 auto; min-height: 32px; padding: 0 10px; border: 0; border-radius: 9px; background: rgba(118,118,128,.09); color: #0a84ff; font-size: 12px; cursor: pointer; }
.portal-task-form [data-accounts] { max-height: 154px; border: 1px solid var(--apple-line); border-radius: 12px; }
.portal-task-account { cursor: pointer; margin: 0; color: #41434a; font-size: 13px; }
.portal-task-account input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; padding: 0; border-radius: 4px; }
.portal-task-account small { margin-left: auto; font-size: 11px; }
.portal-task-file-field { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; min-height: 64px; padding: 12px; border-radius: 13px; background: rgba(118,118,128,.07); }
.portal-task-form .portal-task-file-field { display: flex !important; margin: 0; }
.portal-task-file-field > div { min-width: 0; }
.portal-task-file-info { flex: 1; }
.portal-task-file-info .portal-number-count { margin: 0; color: #41434a; font-size: 13px; font-weight: 600; line-height: 1.5; }
.portal-task-file-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 4px; color: #85878e; font-size: 11px; overflow-wrap: anywhere; }
.portal-task-file-details > span { min-width: 0; overflow-wrap: anywhere; }
.portal-task-file-details small { margin: 0; font-size: inherit; }
.portal-task-file-field label,
.portal-task-file-field strong { font-size: 13px; font-weight: 600; }
.portal-task-file-field small { display: block; color: #85878e; font-size: 11px; }
.portal-file-picker { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 36px; max-width: 100%; padding: 0 13px; overflow: hidden; border-radius: 10px; background: rgba(10,132,255,.10); color: #0a84ff; cursor: pointer; }
.portal-file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.portal-file-picker:focus-within { outline: 3px solid rgba(10,132,255,.24); outline-offset: 2px; }
.portal-task-progress { grid-column: 1 / -1; flex: 1 0 100%; margin: 0; font-size: 11px; color: #797b82; overflow-wrap: anywhere; }
.portal-task-file-field .is-error { color: #e9382f; }
/* Tasks share column alignment on desktop and stack their metadata on a phone. */
.portal-task-toolbar { flex-shrink: 0; display: grid; grid-template-columns: minmax(130px, 310px) 1fr auto; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--apple-line); }
.portal-task-toolbar .user-search { width: 100%; min-width: 0; height: 38px; }
.portal-task-toolbar .apple-select-wrap { justify-self: end; }
.portal-task-toolbar .user-create { min-height: 38px; white-space: nowrap; }
.portal-task-grid { flex: 1; min-height: 0; overflow: auto; }
.portal-task-table th:nth-child(2) { width: 18%; }
.portal-task-table th:nth-child(3) { width: 26%; }
.portal-task-table th:nth-child(4) { width: 13%; }
.portal-task-table th:last-child { width: 120px; text-align: right; }
.portal-task-table td { height: 62px; }
.portal-task-card:hover { background: #fafbfd; }
.portal-task-card h2 { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.portal-task-card small { display: block; margin-top: 4px; color: #606b7b; font-size: 11px; }
.portal-task-card .portal-form-error { margin: 4px 0 0; }
.task-counts { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; }
.task-attempts, .task-interest, .task-lines, .task-status time { font-variant-numeric: tabular-nums; }
.task-attempts { color: #606b7b; white-space: nowrap; }
.task-attempts strong { color: #242b36; font-weight: 650; }
.task-interest { color: #606b7b; font-size: 11px; white-space: nowrap; }
.task-interest.has-interest { color: #206640; font-weight: 650; }
.task-progress progress { display: block; width: 100%; height: 4px; margin-top: 6px; appearance: none; border: 0; border-radius: 99px; color: #2b80d5; background: #edf0f4; overflow: hidden; }
.task-progress progress::-webkit-progress-bar { background: #edf0f4; }
.task-progress progress::-webkit-progress-value { border-radius: 99px; background: currentColor; }
.task-progress progress::-moz-progress-bar { border-radius: 99px; background: currentColor; }
.portal-task-actions { display: flex; justify-content: flex-end; gap: 6px; }
.portal-task-actions button { min-height: 32px; padding: 4px 8px; background: transparent; color: #56606e; border: 0; border-radius: 8px; cursor: pointer; font: inherit; font-size: 12px; white-space: nowrap; }
.portal-task-actions [data-action], .portal-task-actions [data-start] { background: #edf4fe; color: #175a9a; }
.portal-task-actions button:hover, .portal-task-actions button[aria-expanded="true"] { background: #e8eef6; }
.portal-task-actions button:focus-visible { outline: 2px solid #257dc6; outline-offset: 2px; }
.portal-task-actions button:disabled { opacity: .6; cursor: default; }
.portal-task-card [data-task-state] { display: inline-block; padding: 3px 8px; border-radius: 999px; color: #505b6c; background: #edf0f4; font-size: 11px; font-weight: 600; white-space: nowrap; }
.portal-task-card [data-task-state="running"] { color: #205e9c; background: #eaf3ff; }
.portal-task-card [data-task-state="queued"], .portal-task-card [data-task-state="paused"] { color: #855416; background: #fcf2df; }
.portal-task-card [data-task-state="completed"] { color: #206640; background: #e8f5ec; }
.portal-task-card [data-task-state="failed"] { color: #a13639; background: #f9eded; }
.template-segments { flex: 0 0 auto; }
.template-segments button { padding-inline: 13px; white-space: nowrap; }
.template-rows { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 0 18px; list-style: none; }
.template-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 2px; }
.template-row + .template-row { border-top: 1px solid var(--apple-line); }
.template-summary { min-width: 0; }
.template-summary h2 { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.template-summary p { margin: 4px 0 0; color: #6b6d73; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.template-row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.template-row-actions button { min-height: 34px; padding: 4px 8px; border-radius: 8px; white-space: nowrap; }
.template-row-actions [data-template-menu] { color: #56606e; }
.template-row-actions button:hover, .template-row-actions button[aria-expanded="true"] { background: #edf0f4; }
.template-row-actions button:focus-visible { outline: 2px solid #257dc6; outline-offset: 2px; }
.portal-modal .user-modal-dialog:has(.portal-template-editor) { width: min(640px, calc(100vw - 24px)); }
.portal-template-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 32%); gap: 12px; }
.portal-template-editor textarea[name="content"] { min-height: 160px; }
@media (max-width: 480px) {
  .portal-template-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 620px) {
  .portal-sip-toolbar .user-toolbar-actions { width: 100%; column-gap: 6px; }
  .portal-sip-selected { flex: 1 1 100%; }
  .portal-transfer-actions { margin-left: 0; padding-left: 8px; }
  .portal-sip-panel .portal-table-area { padding: 0 10px; background: #f4f6fa; }
  .portal-sip-panel .portal-table, .portal-sip-panel tbody, .portal-sip-panel thead { display: block; min-width: 0; }
  .portal-sip-panel thead { position: sticky; top: 0; z-index: 1; background: #f4f6fa; }
  .portal-sip-panel thead tr { display: flex; align-items: center; gap: 6px; padding: 8px 12px; }
  .portal-sip-panel thead tr::after { content: "全选本页"; color: #505b6c; font-size: 12px; }
  .portal-sip-panel thead th:not(.portal-check) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .portal-sip-panel tbody tr { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "check account status" ". host history" ". template history"; align-items: center; gap: 5px 6px; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--apple-line); border-radius: 12px; background: #fff; }
  .portal-sip-panel .portal-table th.portal-check, .portal-sip-panel .portal-table td { position: static; width: auto; height: auto; padding: 0; border: 0; background: transparent; }
  .portal-sip-panel td:nth-child(1) { grid-area: check; }
  .portal-sip-panel td:nth-child(2) { grid-area: account; font-weight: 650; }
  .portal-sip-panel td:nth-child(3) { grid-area: host; color: #606b7b; font-size: 11px; }
  .portal-sip-panel td:nth-child(4) { grid-area: status; text-align: right; }
  .portal-sip-panel td:nth-child(5) { grid-area: template; color: #606b7b; font-size: 11px; }
  .portal-sip-panel td:nth-child(6) { grid-area: history; }
  .portal-sip-panel td .portal-text-button { min-height: 34px; margin: 0; padding-inline: 8px; border-radius: 8px; background: #edf4fe; }
  .template-toolbar .user-search { order: 3; flex: 0 0 100%; max-width: none; }
  .template-rows { padding-inline: 12px; }
  .template-row { gap: 8px; }
}
/* 05. 平板与手机：横向导航、独立内容滚动、单列表单。 */
@media (max-width:1100px) {
.portal-table { min-width: 620px; }
}
@media (max-width: 850px) {
  .portal-call-toolbar { grid-template-columns: minmax(0, 1fr); }
  .portal-call-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width:760px) {
.portal-shell { width: 100%; height: 100dvh; margin: 0; border: 0; border-radius: 0; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
.portal-shell .sidebar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; row-gap: 8px; position: relative; padding: max(10px,env(safe-area-inset-top)) 12px 8px; border-right: 0; border-bottom: 1px solid var(--apple-line); }
.portal-shell .brand { grid-row: 1; grid-column: 1; padding: 0 2px; min-height: 36px; }
.portal-shell .brand strong { font-size: 17px; }
.portal-shell .brand small { display: none; }
.portal-shell .brand img { width: 32px; height: 32px; }
.portal-shell .nav-list { grid-row: 2; grid-column: 1 / -1; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px; }
.portal-shell .nav-item { min-width: 0; justify-content: center; min-height: 47px; padding: 4px 0; flex-direction: column; gap: 3px; font-size: 11px; white-space: nowrap; }
.portal-shell .nav-item svg { width: 19px; height: 19px; }
.portal-shell .sidebar-contact { grid-row: 1; grid-column: 2; min-height: 36px; margin: 0; padding: 5px 9px; gap: 5px; font-size: 12px; }
.portal-shell .sidebar-contact svg { width: 15px; height: 15px; }
.portal-content { padding: 14px; }
.portal-header { padding: 0 18px; }
.portal-panel .user-toolbar { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 12px; gap: 10px; }
.portal-panel .user-search { width: 100%; }
.portal-panel .user-toolbar-actions { margin-left: auto; }
.portal-pagination { padding: 12px; }
.portal-pagination > div { gap: 8px; }
.portal-call-filters { gap: 6px; }
.portal-call-filters .apple-control-trigger { gap: 4px; padding-inline: 6px; font-size: 12px; }
}
@media (max-width:520px) {
.portal-header { min-height: 58px; }
.portal-content { padding: 12px; }
.portal-panel { min-height: 420px; }
.portal-pagination button { padding: 5px 7px; }
.portal-modal { padding: 12px; align-items: center; }
.portal-modal .user-modal-dialog,
.portal-modal .portal-dialog-wide { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 21px; }
.portal-modal .portal-confirm-dialog { width: min(360px,calc(100vw - 24px)); }
.portal-dialog-body { padding: 16px; }
.portal-modal .user-modal-dialog:has(.portal-sip-history-window) > .portal-dialog-close-only { padding: 16px 18px 10px; }
.portal-modal .user-modal-dialog:has(.portal-sip-history-window) .portal-dialog-close { flex-basis: 36px; width: 36px; height: 36px; }
.portal-modal .portal-dialog-body:has(.portal-sip-history-window) { padding: 0 18px 18px; }
.portal-sip-history-footer .portal-pagination { width: 100%; justify-content: space-between; }
.portal-sip-summary { width: 100%; }
.portal-sip-summary > div { flex: 1; flex-direction: column; gap: 4px; }
.portal-field,
.portal-account-select { grid-template-columns: minmax(0,1fr); gap: 7px; font-size: 13px; }
.portal-field input,
.portal-field .apple-control-trigger { min-height: 42px; }
.portal-field-note,
.portal-number-count { margin-left: 0; }
.portal-task-pair { gap: 8px 10px; }
.portal-task-ai-settings { grid-template-columns: minmax(0,1fr); gap: 8px; }
.portal-task-upload { grid-template-columns: minmax(0,1fr); }
.portal-task-switches { gap: 12px; }

}
.portal-modal .user-modal-dialog:has(.portal-call-detail) { width: min(560px, calc(100vw - 24px)); }
.portal-modal .user-modal-dialog:has(.portal-call-detail) > .portal-dialog-close-only { min-height: 58px; padding: 14px 22px; }
.portal-dialog-body:has(.portal-call-detail) { padding: 0 22px 16px; overscroll-behavior: contain; }
.portal-call-overview { padding: 15px 0 12px; }
.portal-call-overview-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.portal-call-identity { min-width: 0; }
.portal-call-identity h3 { margin: 0; font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.portal-call-identity span { display: block; margin-top: 3px; color: #676d79; font-size: 12px; font-variant-numeric: tabular-nums; }
.portal-call-intent { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #f1f3f7; color: #505b6c; font-size: 12px; font-weight: 600; white-space: nowrap; }
.portal-call-intent[data-intent="yes"] { background: #e6f5eb; color: #226b41; }
.portal-call-intent[data-intent="unknown"] { background: #fcf2df; color: #855416; }
.portal-call-intent[data-intent="pending"] { background: #eaf3ff; color: #205e9c; }
.portal-call-evidence { margin-top: 7px; color: #4b5361; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.portal-call-evidence summary { width: fit-content; min-height: 28px; padding: 4px 2px; color: #265c94; cursor: pointer; }
.portal-call-evidence div { padding: 4px 0 3px 10px; border-left: 2px solid var(--apple-line); }
.portal-call-evidence p { margin: 0 0 6px; }
.portal-call-evidence p:last-child { margin-bottom: 0; }
.portal-call-evidence-source { color: #676d79; font-size: 11px; }
.portal-call-recording { padding: 9px 0 11px; border-top: 1px solid var(--apple-line); }
.portal-call-recording h3 { margin: 0 0 5px; color: #4b5361; font-size: 12px; font-weight: 600; }
.portal-call-recording audio { display: block; width: 100%; height: 34px; }
.portal-recording-state { margin: 3px 0 0; color: #676d79; font-size: 12px; line-height: 1.5; }
.portal-transcript-heading { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; min-height: 42px; border-block: 1px solid var(--apple-line); background: #fff; }
.portal-transcript-heading h3 { margin: 0; font-size: 14px; }
.portal-transcript-heading button { min-height: 32px; padding: 4px 10px; border-radius: 8px; }
.portal-transcript-heading button[aria-pressed="true"] { background: #ebf3ff; color: #075eb1; }
.portal-transcript-turn { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--apple-line); }
.portal-transcript-turn:last-child { border-bottom: 0; }
.portal-transcript-turn h4 { margin: 3px 0 0; color: #535d6c; font-size: 12px; font-weight: 650; }
.portal-transcript-message + .portal-transcript-message { margin-top: 8px; }
.portal-transcript-message p { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.portal-transcript-message .portal-transcript-original { margin-top: 2px; color: #616a79; font-size: 12px; }
.portal-conversation > .portal-field-note { margin: 10px 0; }

@media (max-width: 600px) {
  .portal-modal .user-modal-dialog:has(.portal-call-detail) > .portal-dialog-close-only { padding: 12px 16px; }
  .portal-dialog-body:has(.portal-call-detail) { padding-inline: 16px; }
  .portal-transcript-turn { grid-template-columns: 34px minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .portal-task-grid { padding: 0 10px; background: #f4f6fa; }
  .portal-table.portal-task-table, .portal-task-table tbody { display: block; min-width: 0; }
  .portal-task-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .portal-task-table .portal-task-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; margin: 8px 0; padding: 12px; border: 1px solid var(--apple-line); border-radius: 12px; background: #fff; }
  .portal-task-card td { min-width: 0; height: auto; padding: 0; border: 0; }
  .task-name { grid-area: 1 / 1; }
  .task-status { grid-area: 1 / 2; text-align: right; }
  .task-progress { grid-area: 2 / 1 / 3 / -1; }
  .task-attempts::before { content: "已拨 "; }
  .task-lines { grid-area: 3 / 1; align-self: center; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; color: #606b7b; font-size: 11px; }
  .task-lines small { margin-top: 0; }
  .task-operations { grid-area: 3 / 2; }
}

@media (max-width: 520px) {
  .portal-task-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px; }
  .portal-task-toolbar .user-search { grid-column: 1 / -1; }
  .portal-task-toolbar .apple-select-wrap { justify-self: start; }
}
