/**
 * AIVOXAI One V2.6A.4
 * 统一电脑端与手机端布局，避免固定输入层遮挡任务内容。
 */

:root {
    --app-bg: #f7f8fc;
    --surface: #ffffff;
    --surface-soft: #f2f4fb;
    --surface-accent: #f1efff;
    --text-main: #202839;
    --text-secondary: #748096;
    --border-color: #e4e7ef;
    --brand: #6d5dfc;
    --brand-strong: #5847df;
    --brand-soft: #eeebff;
    --success: #16865f;
    --warning: #b46b08;
    --danger: #c33d56;
    --shadow-sm: 0 8px 24px rgba(31, 38, 55, 0.06);
    --shadow-md: 0 20px 55px rgba(31, 38, 55, 0.12);
    --header-height: 64px;
    --sidebar-width: 252px;
    --content-width: 1040px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    min-width: 320px;
    overflow: hidden;
    background: var(--app-bg);
    color: var(--text-main);
    font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    color: inherit;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
    text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(109, 93, 252, 0.26);
    outline-offset: 2px;
}

.hidden {
    display: none !important;
}

.aivox-app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    position: relative;
    z-index: 40;
    width: 100%;
    height: var(--header-height);
    flex: 0 0 var(--header-height);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 28px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: transparent;
    font-size: 25px;
}

.mobile-menu-button:hover {
    background: var(--surface-soft);
}

.brand-area,
.header-actions {
    display: flex;
    align-items: center;
}

.header-actions {
    gap: 9px;
    margin-left: auto;
}

.brand-area {
    gap: 12px;
}

.brand-avatar {
    width: 38px;
    height: 38px;
    border: 2px solid #d8d3ff;
    border-radius: 50%;
    object-fit: cover;
}

.brand-name {
    font-size: 18px;
    font-weight: 720;
    letter-spacing: -0.01em;
}

.language-control {
    height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 8px 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface);
    color: #4d586c;
}

.language-icon {
    font-size: 15px;
}

.language-selector {
    width: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
}

.language-control:focus-within {
    border-color: #c8c1ff;
    box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.12);
}

.account-summary,
.membership-badge,
.license-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface);
    color: #4d586c;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.account-summary {
    padding: 0 11px;
}

.membership-badge {
    min-height: 28px;
    padding: 0 10px;
    background: #f2f4f8;
    color: var(--text-secondary);
    font-size: 11px;
}

.membership-badge.active {
    border-color: #bfe5d7;
    background: #eaf8f2;
    color: var(--success);
}

.license-control {
    position: relative;
}

.license-button {
    padding: 0 13px;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.license-button.required {
    border-color: #f0c5cd;
    background: #fff4f6;
    color: var(--danger);
}

.license-button.protected {
    border-color: #bfe5d7;
    background: #eaf8f2;
    color: var(--success);
}

.license-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--danger);
}

.license-button.protected .license-dot {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(22, 134, 95, 0.1);
}

.license-panel {
    position: absolute;
    z-index: 120;
    top: calc(100% + 10px);
    right: 0;
    width: min(320px, calc(100vw - 24px));
    padding: 17px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.license-panel[hidden] {
    display: none;
}

.license-panel > strong {
    display: block;
    margin-bottom: 7px;
    font-size: 15px;
}

.license-help {
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.license-panel dl {
    display: grid;
    gap: 9px;
}

.license-panel dl > div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--border-color);
}

.license-panel dt {
    color: var(--text-secondary);
    font-size: 11px;
}

.license-panel dd {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.app-layout {
    width: 100%;
    min-height: 0;
    flex: 1;
    display: flex;
    overflow: hidden;
}

.sidebar {
    z-index: 30;
    width: var(--sidebar-width);
    height: 100%;
    flex: 0 0 var(--sidebar-width);
    overflow-y: auto;
    padding: 20px 14px;
    border-right: 1px solid var(--border-color);
    background: var(--surface);
}

.sidebar-account-card {
    display: none;
    min-height: 70px;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background: var(--surface-soft);
}

.sidebar-customer-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e4e7ef;
    color: #526078;
    font-size: 16px;
    font-weight: 800;
}

.sidebar-customer-avatar.active {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.sidebar-customer-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.sidebar-customer-copy strong,
.sidebar-customer-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-customer-copy strong {
    color: var(--text-main);
    font-size: 14px;
}

.sidebar-customer-copy span {
    color: var(--text-secondary);
    font-size: 12px;
}

.sidebar-customer-copy span.active {
    color: var(--success);
    font-weight: 700;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-item {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    border-radius: 12px;
    color: #4d586c;
    font-size: 14px;
    transition: color 0.18s ease, background 0.18s ease;
}

.sidebar-item:hover {
    color: var(--text-main);
    background: var(--surface-soft);
}

.sidebar-item.active {
    color: var(--brand-strong);
    background: var(--brand-soft);
    font-weight: 700;
}

.menu-icon {
    width: 24px;
    flex: 0 0 24px;
    text-align: center;
    font-size: 17px;
}

.menu-badge {
    margin-left: auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: #f0f1f5;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sidebar-backdrop {
    display: none;
}

.main-workspace {
    min-width: 0;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 24px clamp(18px, 3vw, 40px) 14px;
}

.workspace-container {
    min-width: 0;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.workspace {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.task-header {
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0 18px;
}

.task-title {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    font-size: 18px;
    font-weight: 720;
}

.task-title-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-title-copy strong {
    overflow: hidden;
    color: var(--text-primary);
    font: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-display-id {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 560;
    letter-spacing: 0.04em;
}

.pin-icon {
    flex: 0 0 auto;
}

.task-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    box-shadow: 0 2px 12px rgba(31, 38, 55, 0.035);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9aa6ba;
}

.task-status.created,
.task-status.understanding,
.task-status.ready,
.task-status.planning,
.task-status.processing,
.task-status.executing {
    color: var(--brand-strong);
    background: var(--brand-soft);
}

.task-status.created .status-dot,
.task-status.understanding .status-dot,
.task-status.ready .status-dot,
.task-status.planning .status-dot,
.task-status.processing .status-dot,
.task-status.executing .status-dot {
    background: var(--brand);
    box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.11);
}

.task-status.needs-input {
    color: var(--warning);
    background: #fff7e7;
}

.task-status.needs-input .status-dot {
    background: var(--warning);
}

.task-status.completed {
    color: var(--success);
    background: #eaf8f2;
}

.task-status.completed .status-dot {
    background: var(--success);
}

.task-status.failed {
    color: var(--danger);
    background: #fff0f3;
}

.task-status.failed .status-dot {
    background: var(--danger);
}

.task-status.blocked,
.task-status.capability-pending {
    color: var(--warning);
    background: #fff7e7;
}

.task-status.blocked .status-dot,
.task-status.capability-pending .status-dot {
    background: var(--warning);
}

.ai-task-window {
    min-width: 0;
    min-height: 0;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 2px 8px 24px;
}

.task-stream {
    width: min(100%, 960px);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

.welcome-state {
    width: 100%;
    min-height: min(54vh, 500px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 12px;
    text-align: center;
}

.ai-main-avatar {
    width: 84px;
    height: 84px;
    margin-bottom: 16px;
    border: 3px solid #d8d3ff;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(109, 93, 252, 0.12);
}

.welcome-state h1 {
    margin-bottom: 10px;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.welcome-state p {
    max-width: 590px;
    color: #384256;
    font-size: clamp(15px, 1.6vw, 17px);
    line-height: 1.52;
}

.task-examples {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.example-task {
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: var(--surface-soft);
    color: #4e5a70;
    font-size: 13px;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.example-task:hover {
    border-color: #d8d3ff;
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.welcome-status {
    margin-top: 14px;
    color: var(--text-secondary);
    font-size: 13px;
}

.task-item {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 2px 0 20px;
}

.task-card {
    width: 100%;
    padding: 18px 19px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 6px 22px rgba(31, 38, 55, 0.035);
}

.user-task-card {
    border-color: #e6e8ee;
    background: #fafbfe;
}

.user-task-card.document-message-card {
    border-color: #d9dff0;
    background: #f8faff;
}

.ai-response-card,
.ai-action-card {
    border-color: #ddd8ff;
    background: #f8f7ff;
}

.result-card {
    border-color: #bfe5d7;
    background: #f5fcf9;
}

.task-error-card {
    border-color: #efc4cc;
    background: #fff8f9;
}

.task-blocked-card {
    border-color: #ead8b8;
    background: #fffaf0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    color: #313b4e;
    font-size: 13px;
    font-weight: 760;
    letter-spacing: 0.01em;
}

.user-task-content,
.understanding-content,
.processing-content,
.result-content,
.task-blocked-content,
.task-error-content {
    color: #333d50;
    font-size: 15px;
    line-height: 1.68;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.user-document-summary {
    display: grid;
    gap: 11px;
}

.user-document-title {
    color: #293449;
    font-size: 16px;
    line-height: 1.5;
}

.user-document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    color: var(--text-secondary);
    font-size: 12px;
}

.user-document-meta strong {
    color: #4c5870;
}

.user-document-preview {
    display: -webkit-box;
    overflow: hidden;
    color: #4b566b;
    font-size: 14px;
    line-height: 1.62;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.message-expand-button {
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand-strong);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.message-expand-button:hover {
    text-decoration: underline;
}

.user-task-content.document-full-content {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #dfe4f2;
    max-height: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.65;
}

.document-message-card.is-expanded .user-document-preview {
    display: none;
}

.task-error-details > strong {
    display: block;
    margin-bottom: 5px;
    color: #894454;
    font-size: 12px;
}

.processing-step-list {
    display: grid;
    gap: 8px;
    margin-top: 15px;
}

.processing-step {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-secondary);
    font-size: 13px;
}

.processing-step-marker {
    display: inline-grid;
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    place-items: center;
    border: 1px solid #d6d9e3;
    border-radius: 50%;
    background: #fff;
    font-size: 12px;
    font-weight: 800;
}

.processing-step.active {
    color: var(--brand-strong);
    font-weight: 700;
}

.processing-step.active .processing-step-marker {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.processing-step.completed {
    color: #27745c;
}

.processing-step.completed .processing-step-marker {
    border-color: #a8dbc9;
    background: #eaf9f3;
    color: #27745c;
}

.history-panel {
    width: min(920px, calc(100% - 48px));
    margin: 22px auto 130px;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 12px 38px rgba(31, 38, 55, 0.07);
}

.feature-panel {
    width: min(920px, calc(100% - 48px));
    margin: 22px auto 130px;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 12px 38px rgba(31, 38, 55, 0.07);
}

.feature-panel-content,
.feature-list,
.feature-detail,
.translation-form,
.more-menu {
    display: grid;
    gap: 12px;
}

.feature-panel-notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f3f0ff;
    color: var(--brand-strong);
}

.feature-panel-notice.error {
    background: #fff0f0;
    color: #a33131;
}

.feature-card {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fafbfe;
    color: var(--text-primary);
    text-align: start;
}

button.feature-card {
    cursor: pointer;
}

button.feature-card:hover {
    border-color: #cbc5ff;
}

.feature-card strong,
.feature-card small {
    display: block;
}

.feature-card small,
.feature-empty,
.feature-meta {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.feature-action {
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--brand);
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.feature-action.secondary {
    background: #fff;
    color: var(--brand-strong);
}

.translation-form textarea,
.translation-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-primary);
    font: inherit;
}

.translation-form textarea {
    min-height: 160px;
    resize: vertical;
}

.feature-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.history-panel-header h2 {
    margin: 2px 0 0;
    color: var(--text-primary);
    font-size: 24px;
}

.history-eyebrow,
.history-task-id {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.history-close-button,
.history-task-button {
    min-height: 36px;
    padding: 8px 13px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
}

.history-close-button:hover,
.history-task-button:hover {
    border-color: #cbc5ff;
    color: var(--brand-strong);
}

.history-loading,
.history-empty {
    padding: 34px 12px;
    color: var(--text-secondary);
    text-align: center;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fafbfe;
}

.history-task-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.history-task-title {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-task-meta {
    color: var(--text-secondary);
    font-size: 12px;
}

.history-task-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.history-task-button.primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.missing-information {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #ead8b8;
}

.missing-information > strong {
    display: block;
    margin-bottom: 7px;
    color: var(--warning);
    font-size: 12px;
}

.missing-information-list {
    color: #55472f;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.card-time {
    display: block;
    margin-top: 9px;
    color: var(--text-secondary);
    font-size: 11px;
}

.interaction-actions,
.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 15px;
}

.interaction-button,
.result-button {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.interaction-button:hover,
.result-button:hover {
    background: var(--brand-strong);
}

.interaction-button.secondary {
    background: #eceef3;
    color: #536078;
}

.loading-animation {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.loading-animation span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    animation: loadingPulse 1.1s infinite ease-in-out;
}

.loading-animation span:nth-child(2) {
    animation-delay: 0.14s;
}

.loading-animation span:nth-child(3) {
    animation-delay: 0.28s;
}

.ai-action-card.complete {
    border-color: #c8e7da;
    background: #f5fcf9;
}

.ai-action-card.complete .loading-animation {
    display: none;
}

.ai-action-card.complete .processing-content {
    color: var(--success);
}

@keyframes loadingPulse {
    0%,
    100% {
        opacity: 0.28;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.result-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.result-renderer {
    min-width: 0;
}

.result-media {
    width: 100%;
    max-height: min(60vh, 620px);
    display: block;
    border-radius: 13px;
    background: #eef0f5;
    object-fit: contain;
}

.result-audio {
    width: 100%;
}

.result-data {
    max-width: 100%;
    overflow: auto;
    padding: 14px;
    border-radius: 12px;
    background: #202638;
    color: #f6f7fb;
    font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
}

.result-file-summary {
    display: grid;
    gap: 7px;
    padding: 14px;
    border: 1px solid #c9ded6;
    border-radius: 12px;
    background: var(--surface);
}

.result-file-summary p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.content-action-button {
    border: 1px solid #cfd5e1;
    background: var(--surface);
    color: #49566d;
}

.content-action-button:hover {
    border-color: #c5befb;
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.content-action-button.speaking {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.result-file-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid #c9ded6;
    border-radius: 10px;
    background: var(--surface);
    color: var(--success);
    font-size: 13px;
    font-weight: 700;
}

.input-area {
    width: min(100%, var(--content-width));
    flex: 0 0 auto;
    margin: 0 auto;
    padding-top: 8px;
    background: linear-gradient(to bottom, rgba(247, 248, 252, 0), var(--app-bg) 16%);
}

.ability-bar {
    width: 100%;
    min-width: 0;
    padding: 3px 0 8px;
}

.ability-scroll {
    width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
}

.ability-track {
    width: max-content;
    display: flex;
    animation: abilityMarquee 42s linear infinite;
    will-change: transform;
}

.ability-group {
    display: flex;
    gap: 9px;
    padding: 1px 9px 4px 0;
}

.ability-scroll.is-paused .ability-track {
    animation-play-state: paused;
}

@keyframes abilityMarquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.ability-button {
    min-height: 36px;
    flex: 0 0 auto;
    padding: 8px 13px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface);
    color: #536078;
    font-size: 13px;
    white-space: nowrap;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ability-button:hover {
    border-color: #cbc4ff;
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.task-input-container {
    position: relative;
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.task-input-container:focus-within {
    border-color: #c8c1ff;
    box-shadow: 0 8px 28px rgba(109, 93, 252, 0.1);
}

.task-input {
    min-width: 80px;
    height: 44px;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 15px;
}

.task-input::placeholder {
    color: #9aa5b8;
}

.camera-button,
.upload-button,
.voice-input-button,
.keyboard-button,
.more-button,
.send-task-button {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-soft);
    font-size: 18px;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.camera-button:hover,
.upload-button:hover,
.voice-input-button:hover,
.keyboard-button:hover,
.more-button:hover {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.camera-menu {
    position: absolute;
    z-index: 80;
    bottom: calc(100% + 10px);
    left: 0;
    width: min(250px, calc(100vw - 28px));
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.camera-menu.open {
    display: flex;
}

.camera-menu button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: transparent;
    color: #3f4a5f;
    text-align: left;
}

.camera-menu button:hover,
.camera-menu button:focus-visible {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.send-task-button {
    background: var(--brand);
    color: #fff;
}

.send-task-button:hover:not(:disabled) {
    background: var(--brand-strong);
    transform: translateY(-1px);
}

.send-task-button:disabled {
    opacity: 0.38;
}

.keyboard-button,
.mobile-voice-panel,
.mobile-only {
    display: none;
}

.desktop-only {
    display: inline-flex;
}

.mobile-voice-panel {
    min-width: 0;
    height: 44px;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 13px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 14px;
    font-weight: 700;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.voice-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}

.voice-hint {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
}

.mobile-voice-panel.recording {
    background: #e9f8f2;
    color: var(--success);
    transform: scale(0.99);
}

.mobile-voice-panel.cancel {
    background: #fff0f3;
    color: var(--danger);
}

.mobile-voice-panel.processing {
    background: var(--brand-soft);
    color: var(--brand-strong);
    pointer-events: none;
}

.task-input-container.voice-mode .task-input,
.task-input-container.voice-mode .voice-input-button,
.task-input-container.voice-mode .send-task-button,
.task-input-container.voice-mode .camera-button,
.task-input-container.voice-mode .upload-button,
.task-input-container.voice-mode .more-button {
    display: none !important;
}

.task-input-container.voice-mode .mobile-voice-panel,
.task-input-container.voice-mode .keyboard-button {
    display: inline-flex;
}

.selected-files {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 0;
    padding: 0 4px;
}

.selected-files:not(:empty) {
    padding-top: 8px;
}

.selected-file {
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface);
    color: #58657b;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toast {
    position: fixed;
    z-index: 200;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    max-width: min(90vw, 520px);
    padding: 11px 18px;
    border-radius: 12px;
    background: #202638;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow-md);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.communication-workspace {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.communication-header {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.communication-header h1,
.conversation-list-header h2,
.conversation-detail-header h2,
.context-card h2 {
    margin: 0;
    color: var(--text-primary);
}

.communication-header h1 {
    margin-top: 2px;
    font-size: 24px;
}

.communication-eyebrow,
.conversation-channel {
    color: var(--brand-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.communication-workspace-picker,
.conversation-filters,
.inbox-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.communication-workspace-picker select,
.conversation-filters select,
.inbox-controls select {
    min-height: 38px;
    min-width: 0;
    padding: 7px 30px 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-primary);
    font: inherit;
}

.communication-notice,
.communication-loading,
.communication-empty,
.conversation-list-loading,
.conversation-list-empty,
.conversation-detail-placeholder,
.conversation-detail-loading,
.conversation-detail-unavailable {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--text-secondary);
    font-size: 13px;
}

.communication-notice.error,
.conversation-detail-unavailable {
    background: #fff0f3;
    color: var(--danger);
}

.communication-empty,
.conversation-detail-placeholder {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.communication-shell {
    min-width: 0;
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.5fr) minmax(250px, 0.8fr);
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 12px 38px rgba(31, 38, 55, 0.06);
}

.conversation-list-panel,
.conversation-detail-panel,
.conversation-context-panel {
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.conversation-list-panel,
.conversation-context-panel {
    padding: 16px;
    background: #fbfbfd;
}

.conversation-list-panel {
    border-right: 1px solid var(--border-color);
}

.conversation-context-panel {
    border-left: 1px solid var(--border-color);
}

.conversation-list-header,
.conversation-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.conversation-list-header h2,
.conversation-detail-header h2 {
    margin-top: 3px;
    font-size: 18px;
}

.conversation-refresh-state {
    min-height: 16px;
    color: var(--text-secondary);
    font-size: 10px;
}

.conversation-scope-panel {
    display: grid;
    gap: 7px;
    margin: 14px 0 8px;
}

.conversation-scope-all,
.conversation-provider-scope,
.conversation-account-scope {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    text-align: left;
}

.conversation-scope-all {
    min-height: 38px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
}

.conversation-provider-group {
    display: grid;
    gap: 4px;
}

.conversation-provider-scope {
    min-height: 32px;
    padding: 6px 9px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.conversation-account-list {
    display: grid;
    gap: 3px;
    padding-left: 7px;
}

.conversation-account-scope {
    min-height: 40px;
    display: grid;
    gap: 2px;
    padding: 7px 9px 7px 12px;
}

.conversation-account-name {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-account-runtime {
    color: var(--text-secondary);
    font-size: 10px;
}

.conversation-scope-all:hover,
.conversation-provider-scope:hover,
.conversation-account-scope:hover,
.conversation-scope-all.active,
.conversation-provider-scope.active,
.conversation-account-scope.active {
    border-color: #cfc9ff;
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.conversation-filters {
    align-items: stretch;
    flex-direction: column;
    margin: 14px 0;
}

.conversation-filters label:not(.unread-filter) {
    display: grid;
    gap: 5px;
}

.conversation-filters select {
    width: 100%;
}

.unread-filter {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 650;
}

.conversation-list {
    display: grid;
    gap: 8px;
}

.conversation-list-item {
    width: 100%;
    display: grid;
    gap: 7px;
    padding: 13px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    text-align: left;
}

.conversation-list-item:hover,
.conversation-list-item.active {
    border-color: #bdb5ff;
    background: var(--brand-soft);
}

.conversation-list-item-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.conversation-list-item-heading strong {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-unread-count {
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.conversation-list-item-meta,
.timeline-message-meta {
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.45;
}

.conversation-detail-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 18px;
}

.conversation-detail {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.conversation-mode-badge {
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 10px;
    font-weight: 800;
}

.message-timeline {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    overflow: auto;
}

.timeline-message {
    max-width: min(82%, 620px);
    display: grid;
    align-self: flex-start;
    gap: 7px;
    padding: 11px 13px;
    border: 1px solid var(--border-color);
    border-radius: 14px 14px 14px 4px;
    background: #fff;
}

.timeline-message.outbound {
    align-self: flex-end;
    border-color: #d9d4ff;
    border-radius: 14px 14px 4px 14px;
    background: var(--brand-soft);
}

.timeline-message-content {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.message-timeline-empty {
    margin: auto;
    color: var(--text-secondary);
    font-size: 13px;
}

.conversation-composer { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.conversation-composer h3, .conversation-composer-state { margin: 0; }
.conversation-composer textarea { min-height: 82px; resize: vertical; }
.conversation-composer-actions { display: flex; gap: 8px; justify-content: flex-end; }
.conversation-composer-state { color: var(--text-secondary); font-size: 12px; }

.conversation-context-panel {
    display: grid;
    align-content: start;
    gap: 10px;
}

.context-card {
    padding: 13px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
}

.context-card h2 {
    margin-bottom: 11px;
    font-size: 13px;
}

.context-card dl {
    display: grid;
    grid-template-columns: minmax(82px, auto) minmax(0, 1fr);
    gap: 7px 10px;
    margin: 0;
    font-size: 11px;
}

.context-card dt {
    color: var(--text-secondary);
}

.context-card dd {
    margin: 0;
    color: var(--text-primary);
    font-weight: 650;
    overflow-wrap: anywhere;
}

.inbox-controls {
    display: grid;
    gap: 10px;
}

.assignment-summary {
    margin: -2px 0 2px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.4;
}

.inbox-controls label {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
}

.inbox-controls select {
    width: 100%;
}

.context-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.context-action-row button,
.conversation-mobile-back {
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: #fff;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 750;
}

.context-action-row button:hover {
    border-color: #bdb5ff;
    color: var(--brand-strong);
}

.conversation-mobile-back {
    display: none;
    align-self: flex-start;
    margin-bottom: 10px;
}

html[dir="rtl"] .conversation-list-panel {
    border-right: 0;
    border-left: 1px solid var(--border-color);
}

html[dir="rtl"] .conversation-context-panel {
    border-right: 1px solid var(--border-color);
    border-left: 0;
}

html[dir="rtl"] .conversation-list-item {
    text-align: right;
}

@media (max-width: 1200px) {
    .communication-header {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .communication-header h1 {
        font-size: 20px;
    }

    .communication-workspace-picker {
        justify-content: space-between;
    }

    .communication-workspace-picker select {
        flex: 1;
    }

    .communication-shell {
        display: block;
        border-radius: 14px;
    }

    .conversation-list-panel,
    .conversation-detail-panel,
    .conversation-context-panel {
        height: 100%;
        border: 0;
    }

    .conversation-detail-panel,
    .conversation-context-panel {
        display: none;
    }

    .communication-shell.mobile-detail-open {
        overflow: auto;
    }

    .communication-shell.mobile-detail-open .conversation-list-panel {
        display: none;
    }

    .communication-shell.mobile-detail-open .conversation-detail-panel {
        height: auto;
        min-height: 320px;
        display: flex;
    }

    .communication-shell.mobile-detail-open .conversation-context-panel {
        height: auto;
        min-height: 0;
        display: grid;
        padding-top: 0;
    }

    .conversation-mobile-back {
        display: inline-flex;
    }

    .message-timeline {
        max-height: 54vh;
        overflow: auto;
    }
}

/* Account & Network Management business workspace */
.account-network-workspace {
    padding: 28px;
    background: #f5f7fb;
}

.account-network-header {
    max-width: 1440px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto 18px;
}

.account-network-header h1 {
    margin: 3px 0 8px;
    color: var(--text-primary);
    font-size: 28px;
}

.account-network-header p {
    max-width: 700px;
    margin: 0;
    color: var(--text-secondary);
}

.account-network-header-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.account-network-add,
.account-network-secondary,
.account-business-actions button,
.account-business-binding-control button {
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid #dfe3ec;
    border-radius: 10px;
    background: #fff;
    color: #38445a;
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.account-network-add,
.account-business-binding-control button {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.account-network-summary {
    max-width: 1440px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0 auto 16px;
}

.account-network-summary article {
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid #e3e7ef;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(34, 43, 62, 0.04);
}

.account-network-summary span {
    color: var(--text-secondary);
    font-size: 12px;
}

.account-network-summary strong {
    color: #263247;
    font-size: 28px;
}

.account-network-summary .risk strong {
    color: #b14949;
}

.account-network-business-copy {
    max-width: 1440px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 auto 16px;
}

.account-network-business-copy p {
    margin: 0;
    padding: 11px 12px;
    border-radius: 11px;
    background: #eef2f8;
    color: #68758a;
    font-size: 11px;
    line-height: 1.5;
}

.account-network-business-copy strong {
    display: block;
    margin-bottom: 3px;
    color: #38465c;
}

.account-network-main-grid {
    max-width: 1440px;
    display: grid;
    grid-template-columns: minmax(250px, .8fr) minmax(360px, 1.25fr) minmax(280px, .9fr);
    gap: 16px;
    margin: 0 auto;
}

.account-network-column,
.account-create-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid #e3e7ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(34, 43, 62, 0.04);
}

.account-create-panel {
    max-width: 1440px;
    margin: 0 auto 16px;
}

.account-create-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.account-create-form label {
    min-width: 0;
    display: grid;
    gap: 6px;
    color: #526078;
    font-size: 11px;
    font-weight: 700;
}

.account-create-form input,
.account-create-form select,
.account-business-binding-control select {
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #dfe3ec;
    border-radius: 10px;
    background: #fff;
    color: #344158;
    font: inherit;
}

.account-create-form small {
    color: #7a8597;
    font-weight: 400;
}

.account-business-list,
.account-business-configuration,
.account-business-risk {
    display: grid;
    gap: 10px;
}

.account-business-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5e8ef;
    border-radius: 12px;
    background: #fafbfe;
    color: #344158;
    text-align: left;
    cursor: pointer;
}

.account-business-row.active {
    border-color: #bbb2ff;
    background: #f3f1ff;
}

.account-business-row > span:first-child {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.account-business-row strong,
.account-business-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-business-row small,
.account-business-row > span:last-child {
    color: #778397;
    font-size: 10px;
}

.account-business-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.account-business-status-grid .network-profile-meta-row {
    padding: 11px;
    border: 1px solid #e8ebf1;
    border-radius: 10px;
    background: #fafbfe;
}

.account-business-binding-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0;
    border: 0;
}

.account-business-binding-control button {
    margin: 0;
}

.account-business-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.account-business-risk > strong {
    color: #344158;
    font-size: 16px;
}

.account-business-risk > p {
    margin: 0;
    padding: 13px;
    border-radius: 11px;
    background: #fff5f3;
    color: #8a4540;
    font-size: 12px;
    line-height: 1.55;
}

.account-network-advanced {
    max-width: 1440px;
    margin: 18px auto 80px;
    border: 1px solid #e2e6ee;
    border-radius: 14px;
    background: #fff;
}

.account-network-advanced > summary {
    display: flex;
    justify-content: space-between;
    padding: 15px 17px;
    color: #435068;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    list-style: none;
}

.account-network-advanced:not([open]) > :not(summary) {
    display: none;
}

.account-network-advanced[open] {
    padding-bottom: 18px;
}

.account-network-advanced[open] > summary span {
    transform: rotate(180deg);
}

.advanced-technical-warning {
    margin: 0 18px 16px;
    padding: 10px 12px;
    border-radius: 9px;
    background: #f3f5f9;
    color: #68758a;
    font-size: 11px;
}

.account-network-advanced .network-profile-panel {
    box-shadow: none;
}

@media (max-width: 1100px) {
    .account-network-main-grid { grid-template-columns: 1fr 1fr; }
    .account-risk-column { grid-column: 1 / -1; }
    .account-network-business-copy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .account-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .account-network-workspace { padding: 18px; }
    .account-network-header,
    .account-network-header-actions { flex-direction: column; width: 100%; }
    .account-network-summary,
    .account-network-business-copy,
    .account-network-main-grid,
    .account-create-form { grid-template-columns: 1fr; }
    .account-risk-column { grid-column: auto; }
}

/* Arabic interface: true right-to-left layout while the marquee stays stable. */
html[dir="rtl"] body {
    direction: rtl;
    font-family: Tahoma, Arial, Inter, sans-serif;
}

html[dir="rtl"] .sidebar {
    border-right: 0;
    border-left: 1px solid var(--border-color);
}

html[dir="rtl"] .menu-badge {
    margin-right: auto;
    margin-left: 0;
}

html[dir="rtl"] .language-selector {
    direction: ltr;
}

html[dir="rtl"] .license-panel {
    right: auto;
    left: 0;
}

html[dir="rtl"] .task-input,
html[dir="rtl"] .camera-menu button,
html[dir="rtl"] .task-copy,
html[dir="rtl"] .result-content,
html[dir="rtl"] .interaction-content,
html[dir="rtl"] .task-error-content {
    text-align: right;
}

html[dir="rtl"] .camera-menu {
    right: 0;
    left: auto;
}

html[dir="rtl"] .voice-copy {
    align-items: flex-end;
    text-align: right;
}

html[dir="rtl"] .result-file-link {
    align-self: flex-end;
}

html[dir="rtl"] .ability-track {
    direction: ltr;
}

html[dir="rtl"] .ability-button {
    direction: rtl;
}

html[dir="rtl"] .send-task-button span {
    display: inline-block;
    transform: scaleX(-1);
}

@media (max-width: 900px) {
    :root {
        --header-height: 64px;
    }

    .top-header {
        padding: 0 12px;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .brand-area {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .brand-avatar {
        width: 34px;
        height: 34px;
    }

    .brand-name {
        display: none;
    }

    .header-actions {
        gap: 5px;
    }

    .account-summary {
        width: 38px;
        min-height: 38px;
        justify-content: center;
        padding: 0;
    }

    .account-summary span:last-child,
    .membership-badge {
        display: none;
    }

    .license-button {
        min-height: 38px;
        padding: 0 10px;
        font-size: 11px;
    }

    .language-control {
        width: 52px;
        padding: 0 5px;
    }

    .language-icon {
        display: none;
    }

    .language-selector {
        width: 40px;
        text-align: center;
    }

    .sidebar {
        position: fixed;
        top: var(--header-height);
        bottom: 0;
        left: 0;
        height: auto;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: var(--shadow-md);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    html[dir="rtl"] .sidebar {
        right: 0;
        left: auto;
        transform: translateX(105%);
    }

    html[dir="rtl"] .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-account-card {
        display: flex;
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 25;
        inset: var(--header-height) 0 0 0;
        display: block;
        background: rgba(25, 31, 43, 0.28);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }

    .sidebar-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    .main-workspace {
        width: 100%;
        padding: 13px 12px max(10px, env(safe-area-inset-bottom));
    }

    .task-header {
        padding: 1px 2px 12px;
    }

    .task-title {
        font-size: 17px;
    }

    .task-status {
        padding: 6px 10px;
        font-size: 12px;
    }

    .ai-task-window {
        padding: 0 2px 14px;
        scrollbar-gutter: auto;
    }

    .welcome-state {
        min-height: 0;
        justify-content: flex-start;
        padding: clamp(22px, 6vh, 48px) 4px 26px;
    }

    .ai-main-avatar {
        width: 74px;
        height: 74px;
        margin-bottom: 13px;
    }

    .welcome-state h1 {
        margin-bottom: 9px;
        font-size: 27px;
    }

    .welcome-state p {
        max-width: 560px;
        font-size: 15px;
    }

    .task-examples {
        width: 100%;
        flex-direction: column;
        gap: 8px;
        margin-top: 17px;
    }

    .example-task {
        width: 100%;
        min-height: 44px;
    }

    .task-item {
        gap: 11px;
        padding-bottom: 14px;
    }

    .task-card {
        padding: 15px;
        border-radius: 14px;
    }

    .history-panel {
        width: 100%;
        margin: 0 0 24px;
        padding: 16px;
        border-radius: 16px;
    }

    .feature-panel {
        width: 100%;
        margin: 0 0 24px;
        padding: 16px;
        border-radius: 16px;
    }

    .history-panel-header,
    .history-task-row {
        align-items: stretch;
        flex-direction: column;
    }

    .history-task-actions {
        width: 100%;
    }

    .history-task-button {
        flex: 1;
    }

    .input-area {
        padding-top: 5px;
    }

    .ability-bar {
        padding-bottom: 6px;
    }

    .ability-scroll {
        margin: 0 -12px;
        width: calc(100% + 24px);
        padding: 0 12px;
        scrollbar-width: none;
    }

    .ability-scroll::-webkit-scrollbar {
        display: none;
    }

    .task-input-container {
        min-height: 62px;
        padding: 8px 9px;
        border-radius: 20px;
    }

    .task-input {
        font-size: 16px;
    }

    .camera-button,
    .upload-button,
    .voice-input-button,
    .keyboard-button,
    .more-button,
    .send-task-button {
        width: 43px;
        height: 43px;
        flex-basis: 43px;
    }

    .mobile-only {
        display: inline-flex;
    }

    .desktop-only {
        display: none;
    }

    .task-input-container.is-typing .camera-button,
    .task-input-container.is-typing .voice-input-button,
    .task-input-container.is-typing .more-button {
        display: none !important;
    }

    .task-input-container.is-typing .send-task-button {
        display: inline-flex;
    }

    .task-input-container:not(.is-typing):not(.voice-mode) .send-task-button {
        display: none;
    }

    .interaction-actions,
    .result-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .interaction-button,
    .result-button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .top-header {
        padding: 0 10px;
    }

    .brand-area {
        gap: 8px;
    }

    .brand-name {
        font-size: 14px;
    }

    .account-summary {
        display: none;
    }

    .license-button {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
        justify-content: center;
        padding: 0;
    }

    .license-button #licenseButtonText {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .license-panel {
        position: fixed;
        top: calc(var(--header-height) + 8px);
        right: 10px;
        left: auto;
    }

    html[dir="rtl"] .license-panel {
        right: auto;
        left: 10px;
    }

    .main-workspace {
        padding-right: 10px;
        padding-left: 10px;
    }

    .task-status {
        gap: 6px;
    }

    .welcome-state {
        padding-top: 20px;
    }

    .welcome-state p {
        max-width: 340px;
    }

    .ability-scroll {
        margin-right: -10px;
        margin-left: -10px;
        width: calc(100% + 20px);
        padding-right: 10px;
        padding-left: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* P0-E1 Network Profile Manager */
.network-settings{width:100%;height:100%;overflow:auto;padding:26px;box-sizing:border-box;background:#f7f7fb}
.network-settings-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin:0 auto 22px;max-width:1180px}
.network-settings-header h1{margin:3px 0 8px;font-size:28px;line-height:1.15}
.network-settings-header p{margin:0;max-width:720px;color:#666}
.network-settings-kicker{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.network-workspace-picker{display:flex;flex-direction:column;gap:7px;min-width:230px;font-size:12px;font-weight:700}
.network-workspace-picker select,.network-profile-form input,.network-profile-form select{width:100%;box-sizing:border-box;border:1px solid #ddddea;border-radius:10px;background:#fff;padding:10px 12px;font:inherit}
.network-settings-notice{max-width:1180px;margin:0 auto 16px;padding:11px 13px;border:1px solid #d9d5ef;border-radius:10px;background:#f3f0ff}
.network-settings-notice.error{border-color:#e5c7c7;background:#fff5f5}
.network-settings-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr);gap:20px;max-width:1180px;margin:0 auto}
.network-profile-panel{background:#fff;border:1px solid #e6e5ee;border-radius:16px;padding:18px;min-width:0}
.network-panel-heading{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:16px}
.network-panel-heading h2{margin:0 0 5px;font-size:18px}
.network-panel-heading p{margin:0;color:#777;font-size:13px}
.network-profile-count{display:inline-flex;min-width:30px;height:30px;align-items:center;justify-content:center;border-radius:999px;background:#f0edf9;font-weight:700}
.network-profile-list{display:grid;gap:12px}
.network-profile-card{border:1px solid #e8e7ef;border-radius:13px;padding:14px;background:#fff}
.network-profile-card-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.network-profile-card-copy{display:flex;flex-direction:column;gap:4px;min-width:0}
.network-profile-card-title{font-size:15px;overflow-wrap:anywhere}
.network-profile-mode{font-size:11px;color:#6f6788;font-weight:700;letter-spacing:.03em}
.network-profile-status{font-size:11px;font-weight:700;padding:5px 8px;border-radius:999px;background:#eef7ef}
.network-profile-status.disabled{background:#f1f1f3;color:#777}
.network-profile-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 14px;margin-top:13px}
.network-profile-meta-row{display:flex;flex-direction:column;gap:2px;min-width:0}
.network-profile-meta-row span{font-size:11px;color:#777}
.network-profile-meta-row strong{font-size:12px;overflow-wrap:anywhere}
.network-profile-toggle,.network-profile-submit{margin-top:14px;border:0;border-radius:10px;padding:9px 13px;font-weight:700;cursor:pointer}
.network-profile-toggle{background:#f0edf9}
.network-profile-submit{width:100%;background:#5b3fa3;color:#fff}
.network-profile-toggle:disabled,.network-profile-submit:disabled{opacity:.55;cursor:not-allowed}
.network-profile-form{display:grid;gap:13px}
.network-profile-form label{display:grid;gap:6px;font-size:12px;font-weight:700}
.network-profile-form small{font-weight:400;color:#777;line-height:1.35}
.network-enabled-field{grid-template-columns:auto 1fr!important;align-items:center}
.network-enabled-field input{width:auto}
.network-profile-loading,.network-profile-empty{padding:22px 8px;text-align:center;color:#777}
@media(max-width:900px){.network-settings{padding:18px}.network-settings-header{flex-direction:column}.network-workspace-picker{width:100%}.network-settings-grid{grid-template-columns:1fr}.network-profile-meta{grid-template-columns:1fr}}

.network-account-binding-panel{max-width:1144px;margin:20px auto 0}
.network-binding-list{display:grid;gap:12px}
.network-binding-card{border:1px solid #e8e7ef;border-radius:13px;padding:14px;background:#fff}
.network-binding-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;margin-top:14px}
.network-binding-network-select{width:100%;box-sizing:border-box;border:1px solid #ddddea;border-radius:10px;background:#fff;padding:9px 11px;font:inherit}
.network-binding-submit{border:0;border-radius:10px;padding:10px 13px;background:#5b3fa3;color:#fff;font-weight:700;cursor:pointer;white-space:nowrap}
.network-binding-submit:disabled,.network-binding-network-select:disabled{opacity:.55;cursor:not-allowed}
.network-binding-note{margin:9px 0 0;color:#777;font-size:11px;line-height:1.4}
@media(max-width:700px){.network-binding-controls{grid-template-columns:1fr}.network-binding-submit{width:100%}}

.account-pool-panel{max-width:1144px;margin:20px auto 0}
.account-pool-create-form{display:grid;grid-template-columns:minmax(220px,1fr) minmax(180px,.5fr) minmax(260px,1fr) auto;gap:12px;align-items:end;margin-bottom:18px;padding:14px;border:1px solid #e8e7ef;border-radius:13px;background:#faf9fd}
.account-pool-create-form label{display:grid;gap:6px;font-size:12px;font-weight:700}
.account-pool-create-form input,.account-pool-create-form select,.account-pool-add-member input,.account-pool-add-member select,.account-pool-capacities input{width:100%;box-sizing:border-box;border:1px solid #ddddea;border-radius:9px;background:#fff;padding:9px 10px;font:inherit}
.account-pool-policy-note{display:flex;flex-direction:column;gap:3px;padding:9px 11px;border-radius:10px;background:#f0edf9;font-size:11px;line-height:1.35}
.account-pool-policy-note strong{font-size:12px}.account-pool-create-submit{width:auto;margin:0;white-space:nowrap}
.account-pool-list{display:grid;gap:14px}.account-pool-card{border:1px solid #e3e1ec;border-radius:14px;padding:15px;background:#fff}
.account-pool-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.account-pool-actions button,.account-pool-member-actions button,.account-pool-add-submit{border:0;border-radius:9px;padding:8px 11px;background:#f0edf9;font-weight:700;cursor:pointer}
.account-pool-upgrade,.account-pool-add-submit{background:#5b3fa3!important;color:#fff}.account-pool-actions button:disabled,.account-pool-member-actions button:disabled,.account-pool-add-submit:disabled{opacity:.55;cursor:not-allowed}
.account-pool-members{display:grid;gap:10px;margin-top:14px}.account-pool-member{border:1px solid #eceaf2;border-radius:11px;padding:12px;background:#fcfcfe}
.account-pool-member-header{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.account-pool-member-identity{display:flex;flex-direction:column;gap:3px;min-width:0}
.account-pool-member-identity strong{font-size:13px;overflow-wrap:anywhere}.account-pool-member-identity span{font-size:10px;color:#777;overflow-wrap:anywhere}
.account-pool-readiness{font-size:10px;font-weight:700;padding:5px 7px;border-radius:999px;background:#eef7ef;white-space:nowrap}.account-pool-readiness.blocked{background:#fff0f0;color:#9c3737}.account-pool-readiness.legacy{background:#f1f1f3;color:#777}
.account-pool-reasons{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.account-pool-reasons span{font-size:9px;padding:4px 6px;border-radius:7px;background:#fff2f2;color:#8c3838}
.account-pool-capacities{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:10px}.account-pool-capacities label{display:grid;gap:4px;font-size:10px;color:#666}
.account-pool-member-actions{display:flex;gap:8px;margin-top:10px}.account-pool-add-member{display:grid;grid-template-columns:minmax(210px,1.5fr) repeat(4,minmax(92px,.5fr)) auto;gap:8px;align-items:center;margin-top:13px;padding-top:13px;border-top:1px solid #eceaf2}
@media(max-width:1000px){.account-pool-create-form{grid-template-columns:1fr 1fr}.account-pool-create-submit{width:100%}.account-pool-add-member{grid-template-columns:1fr 1fr 1fr}.account-pool-add-submit{width:100%}}
@media(max-width:700px){.account-pool-create-form,.account-pool-capacities,.account-pool-add-member{grid-template-columns:1fr}.account-pool-member-header{flex-direction:column}.account-pool-member-actions{flex-direction:column}.account-pool-member-actions button{width:100%}}

.account-health-panel{max-width:1144px;margin:20px auto 0}
.account-health-heading{align-items:center}.account-health-refresh{border:0;border-radius:9px;padding:9px 12px;background:#5b3fa3;color:#fff;font-weight:700;cursor:pointer}
.account-health-refresh:disabled{opacity:.55;cursor:not-allowed}
.account-health-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:14px 0 18px}
.account-health-summary>div{border:1px solid #e8e6ef;border-radius:11px;padding:10px 12px;background:#faf9fd;display:flex;justify-content:space-between;gap:10px;align-items:center}
.account-health-summary span{font-size:10px;color:#777}.account-health-summary strong{font-size:16px}
.account-health-list{display:grid;gap:12px}.account-health-card{border:1px solid #e4e2ec;border-radius:13px;padding:14px;background:#fff}
.account-health-card-header{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.account-health-card-copy{display:flex;flex-direction:column;gap:3px;min-width:0}
.account-health-card-title{font-size:13px;overflow-wrap:anywhere}.account-health-card-sub{font-size:10px;color:#777;overflow-wrap:anywhere}
.account-health-badges{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.account-health-badges span{font-size:9px;font-weight:700;padding:5px 7px;border-radius:999px;background:#f1f1f3}
.account-health-lifecycle.online,.account-health-quarantine.clear{background:#eef7ef;color:#276a35}.account-health-lifecycle.attention,.account-health-quarantine.quarantined{background:#fff0f0;color:#943636}.account-health-quarantine.verifying{background:#fff7e8;color:#8b641d}
.account-health-meta{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:12px}.account-health-meta .network-profile-meta-row{border:1px solid #efedf4;border-radius:9px;padding:8px;background:#fcfbfe}
.account-health-components{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:10px}.account-health-component{border:1px solid #e6eee7;border-radius:9px;padding:8px;background:#f7fbf7;display:flex;justify-content:space-between;gap:8px;align-items:center}
.account-health-component span{font-size:10px;color:#666}.account-health-component strong{font-size:10px}.account-health-component.blocked{border-color:#f0dcdc;background:#fff6f6;color:#923939}
.account-health-reasons{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}.account-health-reasons span{font-size:9px;padding:4px 6px;border-radius:7px;background:#fff2f2;color:#8d3939}
.account-health-recovery-note,.account-health-footnote{font-size:10px;color:#6f6c76;line-height:1.45;margin:10px 0 0}.account-health-recovery-note{font-weight:700;color:#8b641d}
@media(max-width:1000px){.account-health-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.account-health-meta{grid-template-columns:repeat(2,minmax(0,1fr))}.account-health-components{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.account-health-summary,.account-health-meta,.account-health-components{grid-template-columns:1fr}.account-health-card-header{flex-direction:column}.account-health-badges{justify-content:flex-start}.account-health-refresh{width:100%}}


/* Sidebar navigation refinement */
.sidebar {
    display: flex;
    flex-direction: column;
    padding: 16px 12px 14px;
    scrollbar-width: thin;
    scrollbar-color: #d9dce5 transparent;
}

@media (min-width: 901px) {
    .sidebar {
        border-right-color: #202c42;
        background: #101a2d;
        color: #dce5f3;
        scrollbar-color: #3c4960 transparent;
    }

    .sidebar-item {
        color: #afbdd2;
    }

    .sidebar-item:hover {
        background: #19263d;
        color: #fff;
    }

    .sidebar-item.active {
        background: #233451;
        color: #fff;
    }

    .sidebar-item.active::before {
        background: #72a8ff;
    }

    .sidebar .menu-icon {
        border-color: #2b3b56;
        background: #17243a;
        color: #b9c9df;
    }

    .sidebar-item:hover .menu-icon,
    .sidebar-item.active .menu-icon {
        border-color: #4f6d98;
        background: #243854;
        color: #fff;
    }

    .sidebar-nav-secondary {
        border-top-color: #2b3b56;
    }
}

.main-workspace {
    background: #f4f6fa;
}

.feature-panel.business-dashboard {
    width: min(1440px, calc(100% - 48px));
    padding: 22px;
    border-color: #e2e7ef;
    box-shadow: 0 16px 45px rgba(20, 32, 52, 0.07);
}

.business-home-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.business-home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 312px;
    gap: 18px;
    align-items: start;
}

.business-home-main,
.business-right-rail {
    min-width: 0;
    display: grid;
    gap: 16px;
}

.business-workspace-picker {
    justify-self: end;
    min-width: 220px;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
}

.business-kpi-grid,
.business-capability-grid,
.business-dashboard-columns {
    display: grid;
    gap: 14px;
}

.business-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.business-kpi-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.business-kpi-card,
.business-dashboard-section,
.business-rail-panel {
    padding: 18px;
    border: 1px solid #e2e7ef;
    border-radius: 16px;
    background: #fff;
}

.business-kpi-card {
    min-height: 104px;
    box-shadow: 0 5px 16px rgba(25, 42, 68, 0.035);
}

.business-kpi-label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.business-kpi-value {
    display: block;
    margin-top: 8px;
    color: #18243a;
    font-size: 30px;
    line-height: 1;
}

.business-quick-actions,
.feature-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.business-capability-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.business-capability-card {
    min-height: 154px;
    padding: 20px;
    border: 1px solid #e2e7ef;
    border-radius: 16px;
    background: #fff;
    color: var(--text-primary);
    text-align: start;
    cursor: pointer;
}

.business-capability-card:hover {
    border-color: #b9c8df;
    box-shadow: 0 8px 22px rgba(25, 42, 68, 0.07);
}

.business-capability-card strong,
.business-capability-card small {
    display: block;
}

.business-capability-card strong {
    margin-top: 16px;
    color: #17243a;
    font-size: 15px;
}

.business-card-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eef4ff;
    color: #3769a8;
    font-size: 19px;
}

.business-capability-card small {
    margin-top: 9px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.business-dashboard-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.business-dashboard-section h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.business-rail-panel {
    min-height: 176px;
    padding: 16px;
    box-shadow: 0 5px 16px rgba(25, 42, 68, 0.035);
}

.business-rail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.business-rail-heading h3 {
    margin: 0;
    color: #17243a;
    font-size: 14px;
}

.business-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #4d6f9d;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.business-activity-list {
    display: grid;
    gap: 8px;
}

.business-activity-row {
    padding: 10px 0;
    border-bottom: 1px solid #edf0f5;
}

.business-activity-row:last-child {
    border-bottom: 0;
}

.business-activity-row strong,
.business-activity-row small {
    display: block;
}

.business-activity-row small {
    margin-top: 4px;
    color: var(--text-secondary);
}

.business-empty {
    border: 1px dashed #d8dee8;
    border-radius: 12px;
    background: #fafbfd;
}

@media (max-width: 900px) {
    .business-home-layout {
        grid-template-columns: 1fr;
    }

    .business-right-rail {
        grid-template-columns: 1fr;
    }

    .business-capability-grid,
    .business-kpi-grid,
    .business-kpi-grid.four,
    .business-dashboard-columns {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 901px) and (max-width: 1220px) {
    .business-home-layout {
        grid-template-columns: minmax(0, 1fr) 270px;
    }

    .business-capability-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.header-business-context {
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: 18px;
    padding-left: 18px;
    border-left: 1px solid #e3e7ee;
}

.header-business-context strong {
    color: #17243a;
    font-size: 13px;
}

.header-business-context span {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 10px;
}

.header-search-area {
    min-width: 220px;
    max-width: 620px;
    height: 40px;
    flex: 1 1 460px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 24px;
    padding: 0 13px;
    border: 1px solid #dfe4ec;
    border-radius: 11px;
    background: #f6f8fb;
    color: #7b8799;
}

.header-search-icon {
    flex: 0 0 auto;
    font-size: 20px;
    line-height: 1;
}

.header-search-input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #526074;
    font: inherit;
    font-size: 13px;
}

.header-search-input::placeholder {
    color: #8a95a5;
    opacity: 1;
}

.header-shell-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e1e5ec;
    border-radius: 10px;
    background: #fff;
    color: #59677b;
    font-size: 15px;
    font-weight: 750;
}

.header-new-task {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    border: 0;
    border-radius: 10px;
    background: #274f86;
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}

@media (max-width: 900px) {
    .header-business-context,
    .header-search-area,
    .header-shell-icon,
    .header-new-task span:last-child {
        display: none;
    }
}

/* P0 Business Dashboard Visual Polish FIX-03 */
.feature-panel.business-dashboard {
    --business-space-xs: 6px;
    --business-space-sm: 10px;
    --business-space-md: 14px;
    --business-space-lg: 18px;
    --business-radius-sm: 10px;
    --business-radius-md: 14px;
    --business-radius-lg: 18px;
    --business-border: #e3e8f0;
    --business-heading: #14233a;
    --business-muted: #6f7c90;
    --business-accent: #2f66ad;
    --business-accent-soft: #edf4fd;
    --business-card-shadow: 0 8px 24px rgba(23, 42, 70, 0.055);
    width: min(1460px, calc(100% - 32px));
    margin-top: 12px;
    padding: 20px;
    border-color: var(--business-border);
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(20, 38, 64, 0.075);
}

.feature-panel.business-dashboard > .history-panel-header {
    min-height: 44px;
    align-items: center;
    margin-bottom: 0;
    padding: 0 2px;
}

.feature-panel.business-dashboard > .history-panel-header h2 {
    margin-top: 1px;
    color: var(--business-heading);
    font-size: 23px;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.feature-panel.business-dashboard > .history-panel-header .history-eyebrow {
    color: #7b8798;
    font-size: 10px;
    letter-spacing: 0.09em;
}

.feature-panel.business-dashboard .feature-panel-content {
    gap: var(--business-space-md);
}

.feature-panel.business-dashboard .business-home-toolbar {
    position: relative;
    z-index: 2;
    min-height: 40px;
    margin: -44px 0 14px;
    padding-left: min(42%, 430px);
}

.feature-panel.business-dashboard .business-home-toolbar .feature-action,
.feature-panel.business-dashboard .business-workspace-picker {
    min-height: 38px;
    border-radius: var(--business-radius-sm);
}

.feature-panel.business-dashboard .business-home-toolbar .feature-action {
    border-color: #285b9d;
    background: #285b9d;
    box-shadow: 0 5px 14px rgba(40, 91, 157, 0.16);
}

.feature-panel.business-dashboard .business-home-layout {
    grid-template-columns: minmax(0, 1fr) 304px;
    gap: 20px;
}

.feature-panel.business-dashboard .business-home-main {
    gap: var(--business-space-lg);
}

.feature-panel.business-dashboard .business-right-rail {
    gap: var(--business-space-md);
}

.feature-panel.business-dashboard .business-kpi-grid,
.feature-panel.business-dashboard .business-capability-grid {
    gap: var(--business-space-md);
}

.feature-panel.business-dashboard .business-kpi-card {
    position: relative;
    min-height: 112px;
    overflow: hidden;
    padding: 18px 18px 16px;
    border-color: var(--business-border);
    border-radius: var(--business-radius-md);
    box-shadow: var(--business-card-shadow);
}

.feature-panel.business-dashboard .business-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #4b7fbd;
}

.feature-panel.business-dashboard .business-kpi-card::after {
    position: absolute;
    top: 15px;
    right: 16px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--business-accent-soft);
    color: var(--business-accent);
    font-size: 15px;
    font-weight: 800;
}

.feature-panel.business-dashboard .business-kpi-card:nth-child(1)::after { content: "↙"; }
.feature-panel.business-dashboard .business-kpi-card:nth-child(2)::after { content: "↩"; }
.feature-panel.business-dashboard .business-kpi-card:nth-child(3)::after { content: "+"; }
.feature-panel.business-dashboard .business-kpi-card:nth-child(4)::after { content: "✓"; }

.feature-panel.business-dashboard .business-kpi-label {
    max-width: calc(100% - 38px);
    color: var(--business-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.feature-panel.business-dashboard .business-kpi-value {
    margin-top: 12px;
    color: var(--business-heading);
    font-size: 32px;
    font-weight: 780;
    letter-spacing: -0.035em;
}

.feature-panel.business-dashboard .business-kpi-card small {
    display: block;
    margin-top: 8px;
    color: #8a95a5;
    font-size: 10px;
}

.feature-panel.business-dashboard .business-capability-card {
    min-height: 164px;
    padding: 20px;
    border-color: var(--business-border);
    border-radius: var(--business-radius-lg);
    box-shadow: 0 5px 18px rgba(23, 42, 70, 0.035);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.feature-panel.business-dashboard .business-capability-card:hover {
    transform: translateY(-2px);
    border-color: #b8c8dc;
    box-shadow: 0 12px 28px rgba(23, 42, 70, 0.09);
}

.feature-panel.business-dashboard .business-capability-card:focus-visible {
    outline-color: rgba(47, 102, 173, 0.32);
}

.feature-panel.business-dashboard .business-card-icon {
    width: 44px;
    height: 44px;
    border: 1px solid #dce8f7;
    border-radius: 13px;
    background: var(--business-accent-soft);
    color: var(--business-accent);
    font-size: 19px;
}

.feature-panel.business-dashboard .business-capability-card:nth-child(2n) .business-card-icon {
    border-color: #d9ebe8;
    background: #eef8f6;
    color: #28796f;
}

.feature-panel.business-dashboard .business-capability-card:nth-child(3n) .business-card-icon {
    border-color: #ebe4d5;
    background: #faf6ec;
    color: #8a6827;
}

.feature-panel.business-dashboard .business-capability-card strong {
    margin-top: 16px;
    color: var(--business-heading);
    font-size: 16px;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.feature-panel.business-dashboard .business-capability-card small {
    margin-top: 8px;
    color: var(--business-muted);
    font-size: 12px;
    line-height: 1.55;
}

.feature-panel.business-dashboard .business-rail-panel {
    min-height: 154px;
    padding: 17px;
    border-color: var(--business-border);
    border-radius: var(--business-radius-md);
    box-shadow: var(--business-card-shadow);
}

.feature-panel.business-dashboard .business-rail-heading {
    margin-bottom: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid #edf1f6;
}

.feature-panel.business-dashboard .business-rail-heading h3 {
    color: var(--business-heading);
    font-size: 14px;
    line-height: 1.25;
}

.feature-panel.business-dashboard .business-link-button {
    color: #55769f;
    font-size: 10px;
}

.feature-panel.business-dashboard .business-activity-list {
    gap: 0;
}

.feature-panel.business-dashboard .business-activity-row {
    padding: 9px 2px;
}

.feature-panel.business-dashboard .business-activity-row strong {
    color: #26354b;
    font-size: 12px;
    line-height: 1.35;
}

.feature-panel.business-dashboard .business-activity-row small {
    color: #7d8999;
    font-size: 10px;
    line-height: 1.45;
}

.feature-panel.business-dashboard .business-empty {
    min-height: 86px;
    display: grid;
    place-items: center;
    margin-top: 0;
    padding: 18px 14px;
    border-color: #dfe5ed;
    border-radius: var(--business-radius-sm);
    background: #f8fafc;
    color: #8490a1;
    text-align: center;
}

.top-header .account-summary,
.top-header .membership-badge {
    border-color: transparent;
    background: #f7f8fa;
    color: #778295;
    font-weight: 650;
}

.top-header .license-button.required {
    border-color: #eadfe2;
    background: #fbf8f9;
    color: #8c747b;
    font-weight: 650;
}

.top-header .license-button.required .license-dot {
    width: 6px;
    height: 6px;
    flex-basis: 6px;
    background: #b9959e;
}

@media (min-width: 901px) and (max-width: 1220px) {
    .feature-panel.business-dashboard .business-home-layout {
        grid-template-columns: minmax(0, 1fr) 274px;
    }
}

@media (max-width: 900px) {
    .feature-panel.business-dashboard {
        width: min(calc(100% - 20px), 760px);
        margin-top: 10px;
        padding: 16px;
    }

    .feature-panel.business-dashboard .business-home-toolbar {
        min-height: 0;
        margin: 10px 0 4px;
        padding-left: 0;
    }

    .feature-panel.business-dashboard .business-home-layout {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    .header-business-context,
    .language-control,
    .membership-badge {
        display: none;
    }

    .header-search-area {
        margin: 0 14px;
    }
}

.sidebar-nav {
    min-height: 0;
    flex: 1;
    gap: 0;
}

.sidebar-nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav-secondary {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.sidebar-item {
    position: relative;
    min-height: 44px;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 620;
}

.sidebar-item::before {
    position: absolute;
    top: 50%;
    left: -12px;
    width: 3px;
    height: 20px;
    border-radius: 999px;
    background: transparent;
    content: "";
    transform: translateY(-50%);
    transition: background 0.18s ease;
}

.sidebar-item.active::before {
    background: var(--brand);
}

.sidebar-label {
    min-width: 0;
    flex: 1;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.menu-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eceef4;
    border-radius: 9px;
    background: #f7f8fb;
    color: #59657a;
    font-size: 15px;
    line-height: 1;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.sidebar-item:hover .menu-icon {
    border-color: #ddd9fb;
    background: #f3f1ff;
    color: var(--brand-strong);
}

.sidebar-item.active .menu-icon {
    border-color: #d5cffd;
    background: #fff;
    color: var(--brand-strong);
}

.sidebar-item-new-task:not(.active) .menu-icon {
    border-color: #ddd9fb;
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.menu-badge {
    flex: 0 0 auto;
    margin-left: 4px;
    padding: 3px 6px;
    font-size: 9px;
    letter-spacing: 0;
    text-transform: none;
}

html[dir="rtl"] .sidebar-item::before {
    right: -12px;
    left: auto;
}

html[dir="rtl"] .menu-badge {
    margin-right: 4px;
    margin-left: 0;
}

@media (max-width: 900px) {
    .sidebar {
        width: min(286px, calc(100vw - 48px));
        flex-basis: auto;
        padding: 16px 12px max(16px, env(safe-area-inset-bottom));
    }

    .sidebar-nav-secondary {
        margin-top: 18px;
    }
}


/* P0 Multi-account Communication Workspace */
.communication-shell {
    grid-template-columns: 132px minmax(250px, 0.72fr) minmax(330px, 1.6fr) minmax(230px, 0.72fr);
}

.conversation-account-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
    background: #f7f8fb;
}

.conversation-account-panel-header {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 12px 10px 8px;
}

.conversation-account-panel-header .communication-eyebrow {
    min-width: 0;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-account-count,
.conversation-provider-count {
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px var(--border-color);
}

.conversation-account-panel .conversation-scope-panel {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0 8px 10px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.conversation-account-panel .conversation-scope-all {
    min-height: 42px;
    flex: 0 0 auto;
    padding: 7px 8px;
    border-color: var(--border-color);
    background: #fff;
    text-align: center;
    font-size: 10px;
    line-height: 1.2;
}

.conversation-account-groups {
    display: grid;
    gap: 10px;
}

.conversation-provider-group {
    display: grid;
    gap: 5px;
}

.conversation-provider-scope {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 4px 5px;
    border-radius: 8px;
}

.conversation-provider-label {
    min-width: 0;
    overflow: hidden;
    font-size: 9px;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-provider-count {
    min-width: 18px;
    height: 18px;
    font-size: 8px;
}

.conversation-account-panel .conversation-account-list {
    display: grid;
    gap: 5px;
    padding: 0;
}

.conversation-account-panel .conversation-account-scope {
    min-height: 56px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 6px;
    border-color: transparent;
    border-radius: 10px;
}

.conversation-account-avatar {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e4e6ee;
    border-radius: 10px;
    background: #fff;
    color: var(--brand-strong);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.conversation-account-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.conversation-account-panel .conversation-account-name {
    font-size: 10px;
    line-height: 1.2;
}

.conversation-account-panel .conversation-account-runtime {
    position: relative;
    padding-left: 9px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-account-panel .conversation-account-runtime::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #a8afbf;
    content: "";
    transform: translateY(-50%);
}

.conversation-account-scope[data-runtime="online"] .conversation-account-runtime::before,
.conversation-account-scope[data-runtime="connected"] .conversation-account-runtime::before,
.conversation-account-scope[data-runtime="ready"] .conversation-account-runtime::before,
.conversation-account-scope[data-runtime="active"] .conversation-account-runtime::before {
    background: #29a36a;
}

.conversation-account-scope[data-runtime="error"] .conversation-account-runtime::before,
.conversation-account-scope[data-runtime="blocked"] .conversation-account-runtime::before,
.conversation-account-scope[data-runtime="offline"] .conversation-account-runtime::before,
.conversation-account-scope[data-runtime="disconnected"] .conversation-account-runtime::before {
    background: #d94a61;
}

.conversation-account-panel .conversation-account-scope:hover,
.conversation-account-panel .conversation-account-scope.active {
    border-color: #cfc9ff;
    background: #fff;
    box-shadow: 0 7px 18px rgba(65, 58, 126, 0.08);
}

.conversation-account-panel .conversation-account-scope.active .conversation-account-avatar {
    border-color: #bdb5ff;
    background: var(--brand-soft);
}

.conversation-list-panel {
    padding: 14px;
}

.conversation-list-panel .conversation-filters {
    margin: 10px 0 12px;
}

.conversation-context-panel {
    padding: 14px;
}

html[dir="rtl"] .conversation-account-panel {
    border-right: 0;
    border-left: 1px solid var(--border-color);
}

html[dir="rtl"] .conversation-account-panel .conversation-account-runtime {
    padding-right: 9px;
    padding-left: 0;
}

html[dir="rtl"] .conversation-account-panel .conversation-account-runtime::before {
    right: 0;
    left: auto;
}

@media (max-width: 1200px) {
    .communication-shell {
        display: block;
    }

    .conversation-account-panel {
        height: auto;
        max-height: 190px;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .conversation-account-panel-header {
        min-height: 42px;
        padding: 8px 12px 4px;
    }

    .conversation-account-panel .conversation-scope-panel {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 8px;
        padding: 4px 10px 10px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .conversation-account-panel .conversation-scope-all {
        width: 96px;
        flex: 0 0 96px;
    }

    .conversation-account-groups {
        display: flex;
        gap: 8px;
    }

    .conversation-provider-group {
        min-width: 214px;
        grid-template-columns: 72px minmax(0, 1fr);
        align-items: stretch;
    }

    .conversation-provider-scope {
        align-self: stretch;
    }

    .conversation-account-panel .conversation-account-list {
        display: flex;
        gap: 5px;
    }

    .conversation-account-panel .conversation-account-scope {
        width: 128px;
        flex: 0 0 128px;
    }

    .communication-shell.mobile-detail-open .conversation-account-panel {
        display: none;
    }

    html[dir="rtl"] .conversation-account-panel {
        border-left: 0;
    }
}


/* P0 Multi-account UX refinement: simple by default, advanced on demand */
.communication-shell {
    grid-template-columns: 168px minmax(300px, 340px) minmax(460px, 1fr);
}

.communication-shell.context-open {
    grid-template-columns: 168px minmax(300px, 330px) minmax(420px, 1fr) minmax(260px, 300px);
}

.conversation-account-panel-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.conversation-account-toggle {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1;
}

.conversation-account-toggle:hover,
.conversation-context-toggle:hover {
    border-color: #bdb5ff;
    color: var(--brand-strong);
}

.conversation-account-search-wrap {
    flex: 0 0 auto;
    padding: 0 8px 8px;
}

.conversation-account-search {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: #fff;
    color: var(--text-primary);
    font: inherit;
    font-size: 10px;
    outline: none;
}

.conversation-account-search:focus {
    border-color: #bdb5ff;
    box-shadow: 0 0 0 3px rgba(124, 105, 255, 0.08);
}

.conversation-detail-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.conversation-context-toggle {
    min-height: 30px;
    padding: 6px 9px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 750;
}

.communication-shell:not(.context-open) .conversation-context-panel {
    display: none;
}

.communication-shell.account-rail-collapsed {
    grid-template-columns: 64px minmax(250px, 0.72fr) minmax(400px, 1.8fr);
}

.communication-shell.account-rail-collapsed.context-open {
    grid-template-columns: 64px minmax(250px, 0.72fr) minmax(360px, 1.55fr) minmax(230px, 0.72fr);
}

.communication-shell.account-rail-collapsed .conversation-account-panel-header {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 10px 5px 6px;
}

.communication-shell.account-rail-collapsed .conversation-account-panel-header .communication-eyebrow,
.communication-shell.account-rail-collapsed .conversation-account-count,
.communication-shell.account-rail-collapsed .conversation-account-search-wrap,
.communication-shell.account-rail-collapsed .conversation-provider-label,
.communication-shell.account-rail-collapsed .conversation-provider-count,
.communication-shell.account-rail-collapsed .conversation-account-copy {
    display: none;
}

.communication-shell.account-rail-collapsed .conversation-account-panel .conversation-scope-panel {
    padding: 0 5px 8px;
}

.communication-shell.account-rail-collapsed .conversation-account-panel .conversation-scope-all {
    width: 46px;
    min-height: 42px;
    padding: 5px 3px;
    overflow: hidden;
    font-size: 0;
}

.communication-shell.account-rail-collapsed .conversation-account-panel .conversation-scope-all::after {
    content: "◎";
    font-size: 17px;
    font-weight: 750;
}

.communication-shell.account-rail-collapsed .conversation-provider-scope {
    width: 46px;
    min-height: 22px;
    justify-content: center;
    padding: 3px;
}

.communication-shell.account-rail-collapsed .conversation-provider-scope::after {
    color: var(--text-secondary);
    content: attr(data-short-provider);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.communication-shell.account-rail-collapsed .conversation-account-panel .conversation-account-scope {
    width: 46px;
    min-height: 46px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 5px;
}

.communication-shell.account-rail-collapsed .conversation-account-avatar {
    width: 32px;
    height: 32px;
}

.conversation-account-scope[data-runtime="healthy"] .conversation-account-runtime::before {
    background: #29a36a;
}

.conversation-account-scope[data-runtime="login_required"] .conversation-account-runtime::before {
    background: #d49b24;
}

.conversation-account-scope[data-runtime="attention"] .conversation-account-runtime::before {
    background: #d94a61;
}

.conversation-account-scope[data-runtime="unknown"] .conversation-account-runtime::before {
    background: #a8afbf;
}

@media (min-width: 1201px) {
    .communication-shell.has-many-accounts:not(.account-rail-collapsed) .conversation-account-panel {
        width: auto;
    }
}

@media (max-width: 1200px) {
    .communication-shell,
    .communication-shell.context-open,
    .communication-shell.account-rail-collapsed,
    .communication-shell.account-rail-collapsed.context-open {
        display: block;
    }

    .conversation-account-toggle {
        display: none;
    }

    .conversation-account-search-wrap {
        padding: 0 10px 6px;
    }

    .communication-shell:not(.mobile-detail-open) .conversation-context-panel {
        display: none;
    }

    .communication-shell.mobile-detail-open.context-open .conversation-context-panel {
        display: grid;
    }

    .communication-shell.mobile-detail-open:not(.context-open) .conversation-context-panel {
        display: none;
    }
}


/* V2.1 communication polish from production browser review */
body.communication-focus .sidebar {
    width: 76px;
    flex-basis: 76px;
    padding: 16px 9px 14px;
}

body.communication-focus .sidebar-item {
    min-height: 44px;
    justify-content: center;
    padding: 7px;
}

body.communication-focus .sidebar-label,
body.communication-focus .menu-badge {
    display: none;
}

body.communication-focus .sidebar-item::before {
    left: -9px;
}

body.communication-focus .menu-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
}

html[dir="rtl"] body.communication-focus .sidebar-item::before {
    right: -9px;
    left: auto;
}

.conversation-account-panel .conversation-account-name {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.conversation-account-panel .conversation-account-scope {
    min-height: 60px;
}

.conversation-composer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 -8px 24px rgba(31, 38, 55, 0.04);
    backdrop-filter: blur(8px);
}

.conversation-composer h3 {
    font-size: 15px;
}

.conversation-composer label {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}

.conversation-composer textarea {
    min-height: 72px;
    max-height: 180px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    color: var(--text-primary);
    font: inherit;
    line-height: 1.5;
    outline: none;
}

.conversation-composer textarea:focus {
    border-color: #bdb5ff;
    box-shadow: 0 0 0 3px rgba(124, 105, 255, 0.08);
}

.conversation-composer-actions button {
    min-height: 36px;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-primary);
    font-weight: 750;
}

#conversationPrepareReply {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

#conversationPrepareReply:hover:not(:disabled) {
    filter: brightness(0.97);
}

#conversationPrepareReply:disabled {
    opacity: 0.5;
}

@media (max-width: 1200px) {
    body.communication-focus .sidebar {
        width: min(286px, calc(100vw - 48px));
        flex-basis: auto;
    }

    body.communication-focus .sidebar-label,
    body.communication-focus .menu-badge {
        display: initial;
    }

    body.communication-focus .sidebar-item {
        justify-content: flex-start;
    }
}

/* P0 Business Dashboard Visual System FIX-04 */
@media (min-width: 901px) {
    :root {
        --header-height: 72px;
    }

    .top-header {
        padding: 0 26px;
        border-bottom-color: #e6eaf0;
        background: rgba(255, 255, 255, 0.97);
    }

    .top-header .brand-area {
        display: none;
    }

    .header-business-context {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }

    .header-search-area {
        max-width: 760px;
        height: 44px;
        flex-basis: 560px;
        margin: 0 auto;
        border-color: #dce3ec;
        border-radius: 13px;
        background: #f6f8fb;
        box-shadow: inset 0 1px 2px rgba(22, 39, 64, 0.025);
    }

    .header-actions {
        gap: 6px;
        margin-left: 18px;
        padding: 4px 5px;
        border: 1px solid #e7ebf1;
        border-radius: 14px;
        background: #fafbfd;
    }

    .header-shell-icon,
    .language-control {
        border-color: transparent;
        background: transparent;
    }

    .sidebar {
        padding: 14px 12px 12px;
        border-right-color: #1e2d45;
        background: #0d192b;
        box-shadow: 10px 0 28px rgba(12, 25, 44, 0.06);
    }

    .sidebar-brand {
        min-height: 58px;
        display: flex;
        align-items: center;
        gap: 11px;
        margin-bottom: 16px;
        padding: 7px 9px 13px;
        border-bottom: 1px solid #26364e;
    }

    .sidebar-brand-avatar {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        border: 1px solid #3c5476;
        border-radius: 11px;
        object-fit: cover;
    }

    .sidebar-brand-copy {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .sidebar-brand-copy strong {
        color: #f7faff;
        font-size: 15px;
        letter-spacing: 0.04em;
    }

    .sidebar-brand-copy small {
        overflow: hidden;
        color: #8497b2;
        font-size: 9px;
        letter-spacing: 0.04em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-nav {
        gap: 8px;
    }

    .sidebar-nav-primary {
        gap: 6px;
    }

    .sidebar-item {
        min-height: 46px;
        padding: 8px 10px;
        border-radius: 12px;
        color: #a9b9cf;
    }

    .sidebar .menu-icon {
        width: 31px;
        height: 31px;
        flex: 0 0 31px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #2a3a53;
        border-radius: 9px;
        background: #142239;
        font-size: 15px;
    }

    .sidebar-item.active {
        background: #1d3455;
        box-shadow: inset 0 0 0 1px rgba(112, 162, 226, 0.15), 0 6px 16px rgba(4, 14, 29, 0.16);
    }

    .sidebar-item.active .menu-icon {
        border-color: #4776ad;
        background: #285384;
    }

    .sidebar-nav-secondary {
        margin-top: auto;
        padding-top: 12px;
        border-top-color: #26364e;
    }

    .sidebar-account-card {
        min-height: 62px;
        display: flex;
        margin: 12px 0 0;
        padding: 10px;
        border-color: #293b55;
        border-radius: 13px;
        background: #132238;
    }

    .sidebar-customer-avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        background: #263a57;
        color: #dce8f8;
        font-size: 13px;
    }

    .sidebar-customer-copy strong {
        color: #e8eff9;
        font-size: 12px;
    }

    .sidebar-customer-copy span {
        color: #8497b2;
        font-size: 10px;
    }
}

.feature-panel.business-dashboard {
    --business-page-gutter: clamp(18px, 2vw, 30px);
    --business-card-radius: 18px;
    --business-card-border: #e5eaf1;
    --business-card-shadow: 0 10px 26px rgba(19, 42, 72, 0.06);
    --business-primary: #2c64aa;
    --business-success: #238264;
    --business-warning: #a97928;
    --business-error: #b55461;
    --business-neutral: #748196;
    width: min(1500px, calc(100% - 28px));
    margin-top: 16px;
    padding: var(--business-page-gutter);
    background: #f9fafc;
}

.feature-panel.business-dashboard > .history-panel-header {
    min-height: 68px;
    align-items: flex-start;
    padding: 0 3px;
}

.feature-panel.business-dashboard > .history-panel-header h2 {
    margin-top: 4px;
    font-size: clamp(24px, 2vw, 29px);
    font-weight: 780;
}

.feature-panel.business-dashboard > .history-panel-header .history-eyebrow {
    color: #7d899a;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: none;
}

.feature-panel-subtitle {
    margin-top: 7px;
    color: #6f7c8f;
    font-size: 12px;
    line-height: 1.45;
}

.feature-panel.business-dashboard .business-home-toolbar {
    min-height: 44px;
    margin: -68px 0 20px;
    padding-left: min(52%, 620px);
}

.feature-panel.business-dashboard .business-home-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 22px;
}

.feature-panel.business-dashboard .business-kpi-grid,
.feature-panel.business-dashboard .business-capability-grid {
    gap: 16px;
}

.feature-panel.business-dashboard .business-kpi-card {
    min-height: 118px;
    padding: 19px 19px 17px;
    border-color: var(--business-card-border);
    border-radius: 16px;
    box-shadow: var(--business-card-shadow);
}

.feature-panel.business-dashboard .business-kpi-card:nth-child(2)::before { background: var(--business-warning); }
.feature-panel.business-dashboard .business-kpi-card:nth-child(3)::before { background: var(--business-success); }
.feature-panel.business-dashboard .business-kpi-card:nth-child(4)::before { background: var(--business-primary); }

.feature-panel.business-dashboard .business-capability-card {
    position: relative;
    min-height: 178px;
    padding: 22px 22px 50px;
    border-color: var(--business-card-border);
    border-radius: var(--business-card-radius);
    background: #fff;
    box-shadow: var(--business-card-shadow);
}

.feature-panel.business-dashboard .business-capability-card::after {
    content: "→";
    position: absolute;
    right: 20px;
    bottom: 17px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #f1f5fa;
    color: #52749c;
    font-size: 14px;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.feature-panel.business-dashboard .business-capability-card:hover::after {
    transform: translateX(2px);
    background: #e8f1fc;
    color: var(--business-primary);
}

.feature-panel.business-dashboard .business-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 20px;
}

.feature-panel.business-dashboard .business-capability-card strong {
    font-size: 17px;
}

.feature-panel.business-dashboard .business-right-rail {
    gap: 15px;
}

.feature-panel.business-dashboard .business-rail-panel {
    min-height: 156px;
    padding: 18px;
    border-color: var(--business-card-border);
    border-radius: 16px;
    box-shadow: var(--business-card-shadow);
}

.business-row-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.business-status-pill {
    max-width: 110px;
    overflow: hidden;
    padding: 3px 7px;
    border-radius: 999px;
    background: #edf5f2;
    color: #347461;
    font-size: 9px;
    font-weight: 760;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-row-context {
    min-width: 0;
    overflow: hidden;
    color: #7c899a;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-row-time {
    margin-left: auto;
    color: #99a3b0;
    font-size: 9px;
    white-space: nowrap;
}

.feature-panel.business-dashboard .business-empty {
    min-height: 74px;
    padding: 14px 12px;
    border-style: solid;
    border-color: #edf0f4;
    background: #fafbfd;
}

@media (min-width: 901px) and (max-width: 1240px) {
    .feature-panel.business-dashboard .business-home-layout {
        grid-template-columns: minmax(0, 1fr) 276px;
        gap: 16px;
    }

    .feature-panel.business-dashboard .business-kpi-grid.four,
    .feature-panel.business-dashboard .business-capability-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .sidebar-brand {
        display: none;
    }

    .feature-panel.business-dashboard > .history-panel-header {
        min-height: auto;
    }

    .feature-panel.business-dashboard .business-home-toolbar {
        margin: 12px 0 6px;
        padding-left: 0;
    }

    .business-row-meta {
        flex-wrap: wrap;
    }

    .business-row-time {
        width: 100%;
        margin-left: 0;
    }
}

/* P0 Business Dashboard Visual Parity FIX-05: presentation only. */
.business-ui-icon, .business-ui-icon svg { display: inline-flex; width: 24px; height: 24px; flex-shrink: 0; }
.header-search-icon svg, .header-shell-icon svg, .header-user-avatar svg,
.menu-icon svg, .sidebar-workspace-icon svg { width: 24px; height: 24px; }
.language-icon svg { display: block; width: 19px; height: 19px; }
.header-user-avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #e9effa; color: #3b609b; }
.business-hero-actions, .sidebar-workspace-card, .sidebar-brand-mark { display: none; }

@media (min-width: 901px) {
    .business-toolbar-workspace-picker { display: none; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) {
        --sidebar-width: clamp(252px, 15.7vw, 300px);
        --header-height: 76px;
    }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .top-header {
        width: calc(100% - var(--sidebar-width));
        margin-left: var(--sidebar-width);
        padding: 0 32px;
        background: #fff;
        border-bottom: 1px solid #edf1f7;
        box-shadow: 0 2px 12px rgba(29, 48, 83, 0.025);
    }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .header-business-context { display: none; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .header-search-area {
        min-width: 180px; max-width: 620px; flex: 1; height: 46px;
        margin: 0 auto 0 0; padding: 0 16px; gap: 12px; border: 0; border-radius: 14px;
        background: #edf4ff; box-shadow: none; color: #536891;
    }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .header-search-input { font-size: 15px; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .header-actions {
        flex: 0 0 auto; gap: 16px; margin-left: 28px; padding: 0;
        border: 0; border-radius: 0; background: none;
    }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .header-shell-icon { width: 36px; height: 40px; color: #14213e; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .header-user-avatar { width: 40px; height: 40px; border: 3px solid #edf3fc; background: #dae7fb; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .language-control { gap: 5px; color: #637598; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .account-summary {
        max-width: 160px; gap: 9px; padding: 0 0 0 9px; background: none; color: #21314c; font-size: 14px;
    }
    body:has(#featurePanel.business-dashboard:not(.hidden)) #accountName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .membership-badge { display: none; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .license-button { width: 30px; min-width: 30px; padding: 8px; border-color: transparent; background: none; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) #licenseButtonText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar {
        position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); height: 100dvh;
        padding: 22px 16px 28px; border: 0;
        background: radial-gradient(ellipse at 0 85%, #1d4081 0, transparent 28%), linear-gradient(165deg, #132e5e, #11264e 60%, #18386d);
        box-shadow: inset -1px 0 rgba(255,255,255,.05); z-index: 45;
    }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-brand {
        min-height: 64px; padding: 0 8px 16px; margin-bottom: 20px; gap: 10px; border: 0;
    }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-brand-avatar { display: none; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-brand-mark { display: block; width: 36px; height: 40px; flex: 0 0 36px; color: #fff; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-brand-copy strong { font-size: 22px; font-weight: 750; letter-spacing: -.035em; white-space: nowrap; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-brand-copy small { font-size: 11px; color: #b1c4e7; letter-spacing: 0; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-nav { flex: 0 0 auto; gap: 0; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-nav-primary { gap: 9px; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-item { min-height: 54px; padding: 10px 12px; gap: 16px; border-radius: 12px; font-size: 16px; color: #e0e9fa; font-weight: 550; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar .menu-icon { width: 34px; height: 34px; flex-basis: 34px; border: 0; background: transparent; color: currentColor; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-item.active { color: #fff; background: linear-gradient(115deg, #3b83ff, #2e60f4); font-weight: 700; box-shadow: 0 5px 16px rgba(13, 56, 191, .28), inset 0 1px rgba(255,255,255,.18); }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-item.active::before { display: none; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-item:hover:not(.active) { background: #20365b; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-nav-secondary { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(177,198,234,.16); }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-account-card { display: none; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-workspace-card {
        display: flex; align-items: center; gap: 12px; min-height: 78px; margin-top: auto;
        padding: 13px 12px; border: 1px solid #304e7d; border-radius: 14px; background: #203e6e;
    }
    .sidebar-workspace-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 44px; border-radius: 10px; background: #2c4c7d; color: #d4e2fa; }
    .sidebar-workspace-copy { min-width: 0; flex: 1; display: grid; gap: 6px; }
    .sidebar-workspace-copy small { color: #b4c7e6; font-size: 12px; }
    .sidebar-workspace-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f1f5ff; font-size: 13px; font-weight: 600; }
    .sidebar-workspace-copy .business-workspace-picker { width: 100%; min-width: 0; padding: 3px 0; border: 0; border-radius: 0; background: #203e6e; color: #fff; font-size: 13px; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .main-workspace { margin-left: var(--sidebar-width); padding: 20px 24px 20px 32px; background: #f2f8ff; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .workspace-container { overflow-y: auto; }
}

.feature-panel.business-dashboard {
    --business-heading: #101c35; --business-muted: #62779c;
    --business-card-border: #eaf2fc; --business-card-radius: 14px;
    --business-card-shadow: 0 4px 16px rgba(53, 113, 184, .055);
    --business-rail-width: clamp(320px, 23.7vw, 420px);
    display: grid; grid-template-columns: minmax(0, 1fr) var(--business-rail-width);
    grid-template-rows: auto 1fr; column-gap: 28px; row-gap: 18px;
    align-items: start; width: 100%; max-width: none; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.feature-panel.business-dashboard > .history-panel-header { grid-column: 1; grid-row: 1; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 18px; align-content: center; min-height: 90px; margin: 0; padding: 4px 0; }
.feature-panel.business-dashboard .feature-panel-heading { display: contents; }
.feature-panel.business-dashboard .history-panel-header h2 { grid-column: 1; grid-row: 1; margin: 0; font-size: clamp(30px, 2.1vw, 38px); font-weight: 760; line-height: 1.25; letter-spacing: -.03em; color: #0b1530; overflow-wrap: anywhere; }
.feature-panel.business-dashboard .history-panel-header .history-eyebrow { grid-column: 2; grid-row: 1; align-self: center; max-width: 240px; color: #627aa4; font-size: 13px; line-height: 1.5; letter-spacing: 0; text-transform: none; text-align: end; }
.feature-panel.business-dashboard .feature-panel-subtitle { grid-column: 1; grid-row: 2; max-width: none; margin: 0; font-size: 16px; line-height: 1.55; color: #526e99; }
.feature-panel.business-dashboard .business-hero-actions { display: flex; grid-column: 2; grid-row: 2; align-self: center; justify-self: end; min-width: 0; }
.feature-panel.business-dashboard .business-home-toolbar { min-height: 0; margin: 0; padding: 0; }
.feature-panel.business-dashboard .business-home-toolbar .feature-action { min-height: 28px; padding: 3px 0; border: 0; border-radius: 6px; background: transparent; color: #517dc1; font-size: 12px; box-shadow: none; }
.feature-panel.business-dashboard #featurePanelContent, .feature-panel.business-dashboard .business-home-layout { display: contents; }
.feature-panel.business-dashboard .feature-panel-notice, .feature-panel.business-dashboard #featurePanelContent > .business-empty { grid-column: 1 / -1; }
.feature-panel.business-dashboard .business-home-main { grid-column: 1; grid-row: 2; gap: 20px; align-content: start; }
.feature-panel.business-dashboard .business-right-rail { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; gap: 18px; grid-template-rows: minmax(220px,1fr) minmax(264px,1.12fr) minmax(220px,1fr); }
.feature-panel.business-dashboard .business-kpi-grid.four { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.feature-panel.business-dashboard .business-kpi-card { min-width: 0; min-height: 128px; display: flex; align-items: center; gap: 15px; padding: 18px 16px; border: 1px solid var(--business-card-border); border-radius: var(--business-card-radius); box-shadow: var(--business-card-shadow); }
.feature-panel.business-dashboard .business-kpi-card::before, .feature-panel.business-dashboard .business-kpi-card:nth-child(n)::after { content: none; }
.business-kpi-icon { display: flex; flex: 0 0 clamp(48px,3.8vw,64px); width: clamp(48px,3.8vw,64px); height: clamp(54px,4vw,66px); align-items: center; justify-content: center; border-radius: 19px; background: #edf5ff; color: #246dff; }
.business-kpi-icon .business-ui-icon, .business-kpi-icon svg { width: 34px; height: 34px; }
.business-kpi-card:nth-child(2) .business-kpi-icon { color: #ed5b6a; background: #fff1f3; }
.business-kpi-card:nth-child(3) .business-kpi-icon { color: #4384f3; background: #eff6ff; }
.business-kpi-card:nth-child(4) .business-kpi-icon { color: #13a47f; background: #eafaf4; }
.business-kpi-copy { min-width: 0; }
.feature-panel.business-dashboard .business-kpi-label { max-width: none; min-height: 0; font-size: 14px; font-weight: 500; line-height: 1.35; color: #4f6793; letter-spacing: 0; overflow-wrap: anywhere; }
.feature-panel.business-dashboard .business-kpi-value { margin-top: 5px; font-size: 36px; font-weight: 750; line-height: 1.1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.feature-panel.business-dashboard .business-kpi-card small { margin-top: 8px; color: #7e91b0; font-size: 11px; line-height: 1.3; }
.feature-panel.business-dashboard .business-capability-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; grid-auto-rows: 1fr; }
.feature-panel.business-dashboard .business-capability-card { --module-accent: #216aff; --module-soft: #e8f2ff; min-width: 0; min-height: clamp(252px, calc((100dvh - 388px) / 2), 332px); display: flex; flex-direction: column; align-items: flex-start; padding: 20px; border: 1px solid var(--business-card-border); border-radius: var(--business-card-radius); box-shadow: var(--business-card-shadow); background: #fff; }
.feature-panel.business-dashboard .business-capability-card::after { content: none; }
.feature-panel.business-dashboard .business-module-agent, .feature-panel.business-dashboard .business-module-analysis { --module-accent: #6241f4; --module-soft: #efecff; }
.feature-panel.business-dashboard .business-module-customers { --module-accent: #f68332; --module-soft: #fff1e8; }
.feature-panel.business-dashboard .business-module-followup { --module-accent: #0daf7d; --module-soft: #e6faf1; }
.feature-panel.business-dashboard .business-card-visual { display: flex; flex: 0 0 auto; align-items: end; gap: 12px; width: 100%; }
.feature-panel.business-dashboard .business-card-icon { width: 80px; height: 80px; flex: 0 0 80px; border: 0; border-radius: 20px; color: var(--module-accent); background: var(--module-soft); }
.feature-panel.business-dashboard .business-capability-card:nth-child(n) .business-card-icon { color: var(--module-accent); background: var(--module-soft); border: 0; }
.business-card-icon .business-ui-icon, .business-card-icon svg { width: 44px; height: 44px; }
/* Abstract color fields are decoration, never a chart or a data trend. */
.feature-panel.business-dashboard .business-card-art { flex: 1; height: 70px; border-radius: 45px 38px 12px 12px; background: radial-gradient(ellipse at 75% 95%, var(--module-soft), transparent 72%); opacity: .75; }
.feature-panel.business-dashboard .business-capability-card strong { margin-top: 12px; font-size: 21px; font-weight: 750; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.feature-panel.business-dashboard .business-capability-card small { margin: 7px 0 12px; font-size: 14px; line-height: 1.55; color: var(--business-muted); }
.business-card-cta { display: inline-flex; flex: 0 0 auto; align-self: flex-end; align-items: center; justify-content: center; gap: 8px; max-width: 100%; margin-top: auto; padding: 8px 14px; border: 1px solid #d8e7ff; border-radius: 999px; background: #fafdff; color: #2165ed; font-size: 13px; font-weight: 650; line-height: 1.3; box-shadow: 0 2px 4px rgba(34,98,209,.04); }
.business-card-cta .business-ui-icon, .business-card-cta svg { width: 15px; height: 15px; }
.feature-panel.business-dashboard .business-capability-card:hover { border-color: #b9cdfb; background: #fcfdff; box-shadow: 0 12px 28px rgba(47,84,151,.09); transform: translateY(-3px); }
.business-capability-card:hover .business-card-cta, .business-capability-card:focus-visible .business-card-cta { border-color: #3269ed; background: #3269ed; color: #fff; }
.feature-panel.business-dashboard .business-rail-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--business-card-border); border-radius: var(--business-card-radius); box-shadow: var(--business-card-shadow); }
.feature-panel.business-dashboard .business-rail-heading { gap: 10px; margin-bottom: 8px; padding-bottom: 10px; border-bottom-color: #f0f5fc; }
.feature-panel.business-dashboard .business-rail-heading h3 { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 19px; font-weight: 750; line-height: 1.35; letter-spacing: -.025em; }
.business-rail-heading h3 .business-ui-icon { color: #2671ff; width: 24px; height: 24px; }
.feature-panel.business-dashboard .business-rail-customers h3 .business-ui-icon { color: #0aaf80; }
.feature-panel.business-dashboard .business-link-button { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 12px; color: #2670ed; font-weight: 600; }
.business-link-button .business-ui-icon, .business-link-button svg { width: 12px; height: 12px; }
.feature-panel.business-dashboard .business-activity-list { min-height: 0; max-height: 300px; overflow-y: auto; align-content: start; gap: 0; scrollbar-width: thin; scrollbar-color: #dbe6f6 transparent; }
.feature-panel.business-dashboard .business-activity-row { padding: 11px 0; border-bottom: 1px solid #eff4fc; }
.feature-panel.business-dashboard .business-activity-row:last-child { border-bottom: 0; }
.feature-panel.business-dashboard .business-activity-row strong { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; font-weight: 550; }
.business-row-meta { gap: 7px; margin-top: 7px; }
.business-status-pill { padding: 5px 9px; max-width: 130px; font-size: 12px; font-weight: 600; border-radius: 9px; background: #edf3ff; color: #487be2; }
.business-status-pill.success { color: #16856b; background: #e9f8f1; }
.business-status-pill.warning { color: #b78029; background: #fff5e6; }
.business-status-pill.error { color: #c45664; background: #fff0f2; }
.business-row-time { font-size: 12px; color: #7188ad; font-variant-numeric: tabular-nums; }
.feature-panel.business-dashboard .business-activity-row .business-row-context { margin-top: 0; font-size: 11px; }
.business-activity-metric { display: flex; align-items: center; gap: 11px; min-height: 36px; font-size: 14px; color: #415b82; }
.business-activity-metric > .business-ui-icon { width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 10px; background: #f0f5ff; color: #4c83ee; }
.business-activity-metric svg { width: 17px; height: 17px; }
.business-activity-metric strong { margin-left: auto; color: #15233f; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.feature-panel.business-dashboard .business-activity-clock > .business-ui-icon { background: #fff3e9; color: #fa852c; }
.feature-panel.business-dashboard .business-activity-customers > .business-ui-icon { background: #e8faf3; color: #00ad7d; }
.feature-panel.business-dashboard .business-activity-error > .business-ui-icon { background: #fff0f3; color: #f25875; }
.feature-panel.business-dashboard .business-task-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; min-height: 44px; padding-inline-start: 24px; }
.feature-panel.business-dashboard .business-task-row::before { content: ""; position: absolute; inset-inline-start: 4px; top: 20px; width: 8px; height: 8px; border-radius: 50%; background: #377bff; box-shadow: 0 0 0 5px #edf4ff; }
.feature-panel.business-dashboard .business-task-row:has(.success)::before { background: #00af82; box-shadow: 0 0 0 5px #e8faf3; }
.feature-panel.business-dashboard .business-task-row:has(.warning)::before { background: #fb990b; box-shadow: 0 0 0 5px #fff6e9; }
.feature-panel.business-dashboard .business-task-row:has(.error)::before { background: #eb5a78; box-shadow: 0 0 0 5px #fff0f3; }
.feature-panel.business-dashboard .business-task-row .business-row-meta { flex-wrap: nowrap; margin: 0; gap: 12px; }
.feature-panel.business-dashboard .business-task-row .business-row-time { width: auto; margin: 0; }
.feature-panel.business-dashboard .business-customer-row { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 12px; }
.feature-panel.business-dashboard .business-customer-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #dce8ff; color: #3168d5; font-size: 18px; }
.feature-panel.business-dashboard .business-customer-row:nth-child(2n) .business-customer-avatar { background: #e4edf6; color: #536f99; }
.feature-panel.business-dashboard .business-customer-copy { min-width: 0; }
.feature-panel.business-dashboard .business-customer-copy .business-row-meta { flex-wrap: wrap; gap: 3px 7px; margin-top: 4px; }
.feature-panel.business-dashboard .business-customer-copy .business-row-time { margin: 0; font-size: 11px; }
.feature-panel.business-dashboard .business-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 140px; padding: 18px 12px; border: 0; border-radius: 12px; background: radial-gradient(ellipse at 50% 30%, #f3f8ff, #fff 75%); }
.business-empty > .business-ui-icon { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 11px; border: 1px solid #e6edf8; border-radius: 15px; background: #f1f5fc; color: #8ea8cc; }
.business-empty strong { color: #627da6; font-size: 14px; line-height: 1.5; font-weight: 600; }
.business-empty small { max-width: 240px; color: #8196b5; font-size: 12px; line-height: 1.6; }
.feature-panel.business-dashboard .business-rail-customers .business-empty > .business-ui-icon { color: #39aa89; background: #effbf6; border-color: #e0f4eb; }

@media (min-width: 1241px) and (max-width: 1500px) {
    body:has(#featurePanel.business-dashboard:not(.hidden)) .main-workspace { padding-inline: 24px 20px; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .header-actions { gap: 10px; margin-left: 20px; }
    .feature-panel.business-dashboard { column-gap: 20px; }
    .feature-panel.business-dashboard .business-kpi-grid.four { gap: 12px; }
    .feature-panel.business-dashboard .business-kpi-card { gap: 10px; padding: 15px 12px; }
    .feature-panel.business-dashboard .business-kpi-label { font-size: 13px; }
    .feature-panel.business-dashboard .business-kpi-value { font-size: 33px; }
    .feature-panel.business-dashboard .business-capability-card { padding: 18px; }
    .feature-panel.business-dashboard .business-card-icon { width: 72px; height: 72px; flex-basis: 72px; }
    .feature-panel.business-dashboard .business-capability-card strong { font-size: 19px; }
    .feature-panel.business-dashboard .business-capability-card small { font-size: 13px; }
    .feature-panel.business-dashboard .business-rail-heading h3 { font-size: 17px; }
}

@media (min-width: 901px) and (max-width: 1240px) {
    .feature-panel.business-dashboard { --business-rail-width: 290px; column-gap: 18px; }
    .feature-panel.business-dashboard .business-kpi-grid.four, .feature-panel.business-dashboard .business-capability-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .feature-panel.business-dashboard .history-panel-header .history-eyebrow { grid-column: 1; grid-row: 2; }
    .feature-panel.business-dashboard .feature-panel-subtitle { grid-row: 3; }
    .feature-panel.business-dashboard .business-hero-actions { grid-column: 2; grid-row: 3; }
    .feature-panel.business-dashboard .business-task-row { grid-template-columns: minmax(0,1fr); gap: 5px; }
    .feature-panel.business-dashboard .business-customer-row { grid-template-columns: 32px minmax(0,1fr); gap: 8px; }
    .feature-panel.business-dashboard .business-customer-avatar { width: 32px; height: 32px; }
    .feature-panel.business-dashboard .business-customer-row > .business-status-pill { grid-column: 2; justify-self: start; }
}
@media (max-width: 900px) {
    .feature-panel.business-dashboard { display: block; padding: 16px; }
    .feature-panel.business-dashboard .business-home-main, .feature-panel.business-dashboard .business-right-rail { display: grid; margin-top: 18px; }
    .feature-panel.business-dashboard .business-right-rail { grid-template-rows: auto; }
    .feature-panel.business-dashboard .business-kpi-grid.four, .feature-panel.business-dashboard .business-capability-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .feature-panel.business-dashboard > .history-panel-header { grid-template-columns: 1fr; }
    .feature-panel.business-dashboard .history-panel-header .history-eyebrow { grid-column: 1; grid-row: 2; }
    .feature-panel.business-dashboard .feature-panel-subtitle { grid-row: 3; max-width: none; }
    .feature-panel.business-dashboard .history-panel-header .history-eyebrow { max-width: none; text-align: start; }
    .feature-panel.business-dashboard .business-hero-actions { grid-column: 1; grid-row: 4; justify-self: stretch; margin-top: 8px; }
    .feature-panel.business-dashboard .business-home-toolbar { flex-wrap: wrap; width: 100%; }
}
@media (max-width: 540px) {
    .feature-panel.business-dashboard .business-kpi-grid.four, .feature-panel.business-dashboard .business-capability-grid { grid-template-columns: 1fr; }
    .feature-panel.business-dashboard .business-capability-card { min-height: 244px; }
}
@media (min-width: 901px) {
    html[dir="rtl"] body:has(#featurePanel.business-dashboard:not(.hidden)) .top-header { margin-left: 0; margin-right: var(--sidebar-width); }
    html[dir="rtl"] body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar { left: auto; right: 0; }
    html[dir="rtl"] body:has(#featurePanel.business-dashboard:not(.hidden)) .main-workspace { margin-left: 0; margin-right: var(--sidebar-width); padding-inline: 32px 24px; }
}
@media (prefers-reduced-motion: reduce) { .feature-panel.business-dashboard .business-capability-card { transition: none; } }

/* P0 Unified Conversation Workspace final — scoped to the communication page. */
body.communication-focus { --cw-ink: #14213a; --cw-muted: #70809b; --cw-line: #e6ebf4; --cw-blue: #365cff; --cw-soft: #eef3ff; }
body.communication-focus .main-workspace { padding: 20px 18px 16px; background: #f4f7fc; }
#communicationWorkspace { color: var(--cw-ink); gap: 14px; }
#communicationWorkspace *, #communicationWorkspace *::before, #communicationWorkspace *::after { box-sizing: border-box; }
#communicationWorkspace button, #communicationWorkspace input, #communicationWorkspace select, #communicationWorkspace textarea { font-family: inherit; }
#communicationWorkspace button { cursor: pointer; }
#communicationWorkspace button:disabled { cursor: not-allowed; opacity: .52; }
#communicationWorkspace :is(button,input,select,textarea):focus-visible { outline: 3px solid #9aafff; outline-offset: 2px; }
#communicationWorkspace .communication-header { align-items: center; gap: 14px; }
#communicationWorkspace .communication-header > div:first-child { flex: 1; min-width: 0; }
#communicationWorkspace .communication-header h1 { font-size: 27px; letter-spacing: -.6px; line-height: 1.3; }
#communicationWorkspace .communication-eyebrow { color: var(--cw-blue); letter-spacing: .02em; font-size: 12px; }
#communicationWorkspace .cw-subtitle { color: var(--cw-muted); font-size: 13px; margin: 4px 0 0; line-height: 1.5; }
#communicationWorkspace .communication-workspace-picker select { max-width: 200px; }
#communicationWorkspace .cw-icon-button { width: 34px; height: 34px; flex-shrink: 0; border: 1px solid var(--cw-line); border-radius: 10px; background: white; color: var(--cw-muted); font-size: 22px; }
#communicationWorkspace .communication-shell { gap: 0; border: 1px solid var(--cw-line); border-radius: 18px; background: white; box-shadow: 0 6px 24px #233d6808; }
#communicationWorkspace :is(.conversation-account-panel,.conversation-list-panel,.conversation-detail-panel,.conversation-context-panel) { min-width: 0; min-height: 0; background: #fff; padding: 0; }
#communicationWorkspace :is(.conversation-account-panel,.conversation-list-panel) { border: 0; border-inline-end: 1px solid var(--cw-line); }
#communicationWorkspace .conversation-account-panel { display: flex; flex-direction: column; overflow: auto; background: linear-gradient(180deg,#fcfdff,#f7faff); }
#communicationWorkspace .conversation-account-panel-header { padding: 18px 12px 10px; gap: 5px; }
#communicationWorkspace .conversation-account-panel-header .communication-eyebrow { color: var(--cw-ink); font-size: 14px; letter-spacing: 0; }
#communicationWorkspace .conversation-account-count { margin-inline-start: auto; }
#communicationWorkspace .conversation-account-toggle { min-width: 24px; height: 26px; padding: 0; }
#communicationWorkspace .cw-add-account { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 10px 12px; padding: 9px 4px; border: 1px solid #dce5ff; border-radius: 9px; background: #fff; color: var(--cw-blue); font-size: 12px; font-weight: 650; }
#communicationWorkspace .cw-add-account:hover { background: var(--cw-soft); }
#communicationWorkspace .conversation-scope-panel { display: block; padding: 0 7px 12px; border: 0; margin: 0; }
#communicationWorkspace .conversation-scope-all { width: 100%; min-height: 36px; border: 0; border-radius: 8px; padding: 8px; text-align: start; font-size: 12px; background: transparent; }
#communicationWorkspace .conversation-scope-all.active { color: var(--cw-blue); background: var(--cw-soft); }
#communicationWorkspace .conversation-account-groups { gap: 12px; padding-top: 12px; }
#communicationWorkspace .conversation-provider-scope { width: 100%; display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px; border: 0; background: transparent; border-radius: 8px; color: var(--cw-ink); text-align: start; }
#communicationWorkspace .conversation-provider-scope svg { width: 22px; height: 22px; flex-shrink: 0; }
#communicationWorkspace .conversation-provider-label { font-size: 12px; font-weight: 750; }
#communicationWorkspace .conversation-provider-count { background: transparent; min-width: 12px; padding: 0; font-size: 10px; color: var(--cw-muted); }
#communicationWorkspace .cw-account-unread { margin-inline-start: auto; display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 4px; font-size: 10px; color: #365cff; background: #e7edff; border-radius: 10px; flex-shrink: 0; }
#communicationWorkspace .cw-account-unread.zero { background: #f0f3f8; color: #8895ab; }
#communicationWorkspace .conversation-account-list { display: grid; gap: 4px; margin: 3px 0 0; }
#communicationWorkspace .conversation-account-scope { width: 100%; min-height: 57px; display: flex; align-items: center; gap: 7px; padding: 8px 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: start; }
#communicationWorkspace .conversation-account-scope.active, #communicationWorkspace .conversation-provider-scope.active { background: #eaf0ff; border-color: #dae4ff; }
#communicationWorkspace .conversation-account-avatar { width: 28px; height: 30px; flex: 0 0 28px; border-radius: 8px; background: #fff; color: #5272bb; }
#communicationWorkspace .conversation-account-avatar svg { width: 20px; height: 20px; }
#communicationWorkspace [data-cw-provider="whatsapp"] { color: #00a76c; }
#communicationWorkspace [data-cw-provider="messenger"] { color: #7360ee; }
#communicationWorkspace [data-cw-provider="email"] { color: #3864ed; }
#communicationWorkspace .conversation-account-name { font-size: 11px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
#communicationWorkspace .conversation-account-runtime { font-size: 10px; color: var(--cw-muted); line-height: 1.5; }
#communicationWorkspace .cw-no-account { margin: 3px 7px 9px; color: var(--cw-muted); font-size: 11px; line-height: 1.5; }
#communicationWorkspace .cw-account-management { margin: auto 10px 14px; padding: 11px 5px; border: 1px solid var(--cw-line); border-radius: 10px; background: #fff; font-size: 11px; color: var(--cw-muted); }
#communicationWorkspace .conversation-list-panel { display: flex; flex-direction: column; overflow: hidden; }
#communicationWorkspace .conversation-list-header { padding: 16px 14px 10px; }
#communicationWorkspace .conversation-list-header h2 { font-size: 17px; }
#communicationWorkspace .conversation-list-header .communication-eyebrow { display: none; }
#communicationWorkspace .conversation-refresh-state { font-size: 10px; color: var(--cw-muted); }
#communicationWorkspace .cw-filter-tabs { display: flex; gap: 3px; padding: 0 10px 10px; }
#communicationWorkspace .cw-filter-tabs button { flex: 1; min-height: 31px; min-width: 0; padding: 5px 3px; font-size: 10px; white-space: nowrap; border: 0; border-radius: 8px; color: #6e7b93; background: #f5f7fb; }
#communicationWorkspace .cw-filter-tabs button.active { background: #eaf0ff; color: var(--cw-blue); font-weight: 750; }
#communicationWorkspace .cw-filter-tabs button span:empty { display: none; }
#communicationWorkspace .cw-list-search { margin: 0 12px 12px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--cw-line); border-radius: 9px; background: #f6f8fc; padding: 0 9px; color: #8390a9; }
#communicationWorkspace .cw-list-search > span { font-size: 23px; }
#communicationWorkspace .cw-list-search input { width: 100%; min-width: 0; height: 35px; padding: 0; border: 0; background: transparent; color: var(--cw-ink); font-size: 11px; }
#communicationWorkspace .conversation-list { display: block; flex: 1; min-height: 0; overflow: auto; padding: 0 7px; }
#communicationWorkspace .conversation-list-item { width: 100%; display: flex; gap: 10px; align-items: flex-start; padding: 16px 8px; min-height: 104px; border: 1px solid transparent; border-bottom-color: #eef1f7; border-radius: 0; background: #fff; text-align: start; }
#communicationWorkspace .conversation-list-item.active { background: #eaf0ff; border-radius: 11px; border-color: #e3ebff; }
#communicationWorkspace .conversation-list-item:hover:not(.active) { background: #f8faff; border-radius: 11px; }
#communicationWorkspace .cw-list-avatar, #communicationWorkspace .cw-customer-avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: linear-gradient(135deg,#dce8ff,#bacef2); color: #3864ad; font-size: 18px; font-weight: 650; }
#communicationWorkspace .cw-avatar-channel { position: absolute; width: 17px; height: 17px; inset: auto -3px -2px auto; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff; border: 1px solid #f0f3f9; }
#communicationWorkspace .cw-avatar-channel svg { width: 13px; height: 13px; }
#communicationWorkspace .cw-list-copy { flex: 1; min-width: 0; display: grid; gap: 6px; }
#communicationWorkspace .conversation-list-item-heading { display: flex; align-items: baseline; gap: 7px; }
#communicationWorkspace .conversation-list-item-heading strong { min-width: 0; font-size: 12px; color: var(--cw-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#communicationWorkspace .cw-list-time { margin-inline-start: auto; flex-shrink: 0; color: #7787a1; font-size: 10px; font-weight: 400; }
#communicationWorkspace .cw-preview-line { display: flex; align-items: center; gap: 5px; }
#communicationWorkspace .cw-message-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 1.45; color: #7383a0; }
#communicationWorkspace .conversation-unread-count { min-width: 18px; height: 18px; padding: 2px 5px; font-size: 10px; border-radius: 12px; background: var(--cw-blue); color: white; }
#communicationWorkspace .cw-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
#communicationWorkspace .cw-tag { padding: 3px 5px; font-size: 10px; line-height: 1.3; border: 1px solid #e2e8f6; border-radius: 6px; color: #6d7a96; background: #f4f6fb; }
#communicationWorkspace .cw-tag[data-status="resolved"], #communicationWorkspace .cw-tag[data-status="closed"] { color: #218b66; background: #edf9f3; border-color: #e0f0e6; }
#communicationWorkspace .cw-tag.priority { color: #ab7033; background: #fff5e9; }
#communicationWorkspace .cw-account-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: #8390a7; }
#communicationWorkspace .cw-list-footer { padding: 11px; display: grid; gap: 8px; color: #8592a9; font-size: 10px; text-align: center; border-top: 1px solid var(--cw-line); }
#communicationWorkspace .cw-list-footer button { border: 1px solid var(--cw-line); background: #fff; color: var(--cw-blue); padding: 8px; border-radius: 8px; font-size: 11px; }
#communicationWorkspace .conversation-list-empty { display: grid; gap: 8px; margin: 12px; padding: 24px 14px; text-align: center; background: #f8faff; line-height: 1.7; }
#communicationWorkspace .cw-list-warning { margin: 0 12px 8px; font-size: 10px; color: #946727; line-height: 1.5; }
#communicationWorkspace .conversation-detail-panel { display: flex; flex-direction: column; position: relative; background: #fbfcff; overflow: hidden; }
#communicationWorkspace .conversation-detail-placeholder { flex: 1; background: transparent; color: var(--cw-muted); padding: 30px; gap: 12px; }
#communicationWorkspace .conversation-detail-placeholder strong { color: #273b5b; font-size: 19px; }
#communicationWorkspace .conversation-detail-loading { position: absolute; z-index: 2; inset: 12px 12px auto; text-align: center; }
#communicationWorkspace .conversation-detail-unavailable { margin: 20px; display: grid; gap: 12px; }
#communicationWorkspace .conversation-detail { min-height: 0; }
#communicationWorkspace .conversation-detail-header { flex: 0 0 auto; padding: 16px 18px; gap: 10px; border-bottom: 1px solid var(--cw-line); background: #fff; flex-wrap: wrap; }
#communicationWorkspace .cw-chat-heading { min-width: 0; flex: 1; }
#communicationWorkspace .conversation-detail-header h2 { font-size: 16px; margin: 0 0 4px; overflow-wrap: anywhere; line-height: 1.3; }
#communicationWorkspace .conversation-channel { font-size: 10px; letter-spacing: 0; }
#communicationWorkspace .cw-chat-account { display: inline; margin-inline-start: 6px; font-size: 10px; color: var(--cw-muted); overflow-wrap: anywhere; }
#communicationWorkspace .conversation-detail-actions { gap: 6px; flex-wrap: wrap; }
#communicationWorkspace .conversation-mode-badge { padding: 5px 6px; font-size: 9px; color: #5373b0; background: #f0f4fc; }
#communicationWorkspace .conversation-operation-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 9px; border: 1px solid #d8e2f2; border-radius: 999px; background: #f6f8fc; color: #52627a; font-size: 10px; font-weight: 700; white-space: nowrap; }
#communicationWorkspace .conversation-operation-badge[data-state="AI_PROCESSING"] { border-color: #bed2ff; background: #edf4ff; color: #245bd8; }
#communicationWorkspace .conversation-operation-badge[data-state="WAITING_HUMAN_APPROVAL"] { border-color: #f2d49b; background: #fff8e9; color: #9a6100; }
#communicationWorkspace .conversation-operation-badge[data-state="FOLLOWUP_SCHEDULED"] { border-color: #cabef8; background: #f5f1ff; color: #6540bd; }
#communicationWorkspace .conversation-operation-badge[data-state="COMPLETED"] { border-color: #afe0ca; background: #ecfbf4; color: #08774d; }
#communicationWorkspace .conversation-operation-badge[data-state="FAILED"] { border-color: #f2b8bf; background: #fff0f2; color: #b42337; }
#communicationWorkspace :is(.cw-primary,.cw-secondary,.cw-checkout-link) { min-height: 34px; padding: 8px 11px; border-radius: 9px; font-size: 11px; font-weight: 650; line-height: 1.4; }
#communicationWorkspace .cw-primary { border: 1px solid var(--cw-blue); background: var(--cw-blue); color: #fff; box-shadow: 0 3px 8px #365cff16; }
#communicationWorkspace .cw-secondary { border: 1px solid #dfe6f3; background: #fff; color: #4264bd; }
#communicationWorkspace .cw-checkout-link { display: flex; width: calc(100% - 28px); margin: 10px 14px 18px; align-items: center; justify-content: space-between; color: #365cff; border: 1px solid #dce5ff; background: #f5f8ff; }
#communicationWorkspace .message-timeline { gap: 13px; margin: 0; padding: 18px; scrollbar-gutter: stable; }
#communicationWorkspace .cw-day-divider { align-self: center; color: #8090a8; font-size: 10px; padding: 5px 12px; border-radius: 20px; background: #f0f3f9; margin: 2px 0 7px; }
#communicationWorkspace .timeline-message { max-width: min(88%,620px); padding: 12px 14px 9px; border-color: #e5ebf5; border-radius: 13px 13px 13px 4px; box-shadow: 0 2px 8px #28426503; }
#communicationWorkspace .timeline-message.outbound { background: #e9f0ff; border-color: #d8e4ff; border-radius: 13px 13px 4px 13px; }
#communicationWorkspace .timeline-message-content { font-size: 13px; line-height: 1.65; }
#communicationWorkspace .timeline-message-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; color: #8090a8; font-size: 9px; line-height: 1.4; }
#communicationWorkspace .timeline-message-meta > span:first-child { margin-inline-end: auto; }
#communicationWorkspace .cw-chat-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; color: #8b97ad; font-size: 10px; }
#communicationWorkspace .cw-assistant-link { border: 1px solid #d8e3ff; background: #fff; border-radius: 20px; padding: 8px 12px; font-size: 11px; color: var(--cw-blue); }
#communicationWorkspace .conversation-composer { position: relative; flex: 0 0 auto; display: grid; gap: 6px; margin: 0 12px 12px; padding: 12px; border: 1px solid #e1e8f4; border-radius: 16px; background: #fff; box-shadow: 0 4px 16px #253d6705; }
#communicationWorkspace .cw-composer-heading { display: flex; align-items: center; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid #edf1f8; }
#communicationWorkspace .cw-composer-heading h3 { font-size: 12px; color: var(--cw-blue); }
#communicationWorkspace .cw-composer-heading span { margin-inline-start: auto; font-size: 10px; color: #8b97ad; }
#communicationWorkspace .conversation-composer textarea { width: 100%; min-height: 72px; max-height: 180px; height: 80px; resize: vertical; border: 0; border-radius: 0; background: #fff; color: var(--cw-ink); padding: 8px 2px; font-size: 13px; line-height: 1.5; box-shadow: none; }
#communicationWorkspace .conversation-composer textarea::placeholder { font-size: 11px; color: #8a96ac; }
#communicationWorkspace .conversation-composer-state { font-size: 11px; }
#communicationWorkspace .conversation-composer-state:empty { display: none; }
#communicationWorkspace .cw-composer-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#communicationWorkspace .cw-media-controls { display: flex; gap: 2px; }
#communicationWorkspace .cw-media-controls button { width: 28px; height: 30px; padding: 5px; border: 0; border-radius: 6px; background: #f7f9fc; color: #8795b0; }
#communicationWorkspace .cw-media-controls svg { width: 18px; height: 18px; }
#communicationWorkspace .cw-translation { padding: 7px 6px; border: 1px solid var(--cw-line); border-radius: 8px; background: #fff; color: #7d8ba6; font-size: 10px; }
#communicationWorkspace .conversation-composer-actions { margin-inline-start: auto; }
#communicationWorkspace #conversationPrepareReply { min-height: 36px; padding: 8px 16px; border-radius: 9px; background: var(--cw-blue); border-color: var(--cw-blue); font-size: 12px; }
#communicationWorkspace .cw-capability-note { margin: 2px 0 0; color: #929db0; font-size: 9px; line-height: 1.5; }
#communicationWorkspace .conversation-context-panel { border: 0; border-inline-start: 1px solid var(--cw-line); overflow: auto; }
#communicationWorkspace .cw-context-tabs { position: sticky; top: 0; z-index: 2; display: flex; border-bottom: 1px solid var(--cw-line); background: #fff; }
#communicationWorkspace .cw-context-tabs button { flex: 1; min-width: 0; min-height: 50px; padding: 10px 3px; border: 0; border-bottom: 2px solid transparent; background: #fff; color: #7b88a1; font-size: 11px; font-weight: 650; }
#communicationWorkspace .cw-context-tabs button[aria-selected="true"] { color: var(--cw-blue); border-bottom-color: var(--cw-blue); }
#communicationWorkspace .cw-context-empty { display: grid; justify-items: center; gap: 12px; padding: 72px 18px; text-align: center; font-size: 13px; color: #73839e; line-height: 1.6; }
#communicationWorkspace .cw-context-empty p { margin: 0; font-size: 12px; }
#communicationWorkspace .cw-empty-symbol { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 18px; background: #f0f4fc; font-size: 32px; color: #8196b8; }
#communicationWorkspace .context-card { padding: 19px 16px; margin: 0; border: 0; border-bottom: 1px solid #edf1f6; border-radius: 0; background: #fff; }
#communicationWorkspace .context-card h2 { margin: 0 0 10px; font-size: 13px; font-weight: 750; }
#communicationWorkspace .context-card p { font-size: 11px; line-height: 1.75; margin: 8px 0 12px; }
#communicationWorkspace .context-card dl { display: grid; grid-template-columns: minmax(75px,.8fr) minmax(0,1fr); column-gap: 10px; row-gap: 9px; margin: 12px 0; }
#communicationWorkspace .context-card :is(dt,dd) { margin: 0; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
#communicationWorkspace .context-card dt { color: #8490a6; }
#communicationWorkspace .context-card dd { color: #455672; }
#communicationWorkspace .cw-profile-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
#communicationWorkspace .cw-profile-heading > div { min-width: 0; }
#communicationWorkspace .cw-profile-heading h2 { font-size: 16px; overflow-wrap: anywhere; }
#communicationWorkspace .cw-profile-heading .cw-customer-avatar { width: 48px; height: 48px; flex-basis: 48px; font-size: 22px; }
#communicationWorkspace .cw-muted { color: var(--cw-muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
#communicationWorkspace .cw-ai-card { background: linear-gradient(145deg,#f7f9ff,#fff); }
#communicationWorkspace .cw-ai-symbol { display: inline-block; color: #6275e9; font-size: 28px; margin-bottom: 10px; }
#communicationWorkspace .cw-ai-card small { display: block; color: #8390a8; font-size: 10px; margin-top: 8px; }
#communicationWorkspace .inbox-controls label { display: grid; grid-template-columns: minmax(72px,.7fr) minmax(0,1fr); gap: 8px; margin-top: 10px; font-size: 11px; }
#communicationWorkspace .inbox-controls select { width: 100%; padding-inline: 7px; min-height: 34px; font-size: 11px; }
#communicationWorkspace .context-action-row { gap: 6px; margin-top: 10px; }
#communicationWorkspace .context-action-row button { min-height: 34px; border: 1px solid #dee6f5; border-radius: 8px; background: #f6f9ff; color: #4669bf; font-size: 11px; }
#communicationWorkspace .assignment-summary { font-size: 11px; color: var(--cw-muted); }
#communicationWorkspace .cw-future-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#communicationWorkspace .cw-future-grid > * { min-width: 0; padding: 10px 7px; border: 1px solid #e7ecf5; background: #f8faff; border-radius: 9px; color: #8390a7; font-size: 11px; line-height: 1.5; }
#communicationWorkspace .cw-future-grid small { display: block; font-size: 9px; }
#communicationWorkspace .cw-future-grid button { color: #4b6dc2; text-align: start; }
#communicationWorkspace .cw-checkout-card { display: grid; gap: 9px; background: #fffcf7; }
#communicationWorkspace .cw-checkout-card p { color: #96876d; }
#communicationWorkspace .cw-checkout-card .cw-empty-symbol { background: #fff4e4; color: #b99250; }
#communicationWorkspace .cw-checkout-card h2 { margin: 7px 0 0; }
#communicationWorkspace .hidden { display: none !important; }
@media (min-width: 1201px) {
    body.communication-focus { --sidebar-width: 184px; --header-height: 66px; }
    body.communication-focus .sidebar { width: var(--sidebar-width); flex-basis: var(--sidebar-width); padding: 18px 10px; background: #101c2f; }
    body.communication-focus .sidebar-label { display: initial; font-size: 12px; }
    body.communication-focus .sidebar-brand { gap: 8px; margin-bottom: 22px; }
    body.communication-focus .sidebar-brand-copy { display: grid; }
    body.communication-focus .sidebar-brand-copy strong { font-size: 17px; }
    body.communication-focus .sidebar-brand-copy small { font-size: 9px; }
    body.communication-focus .sidebar-brand-avatar { width: 32px; height: 32px; }
    body.communication-focus .sidebar-item { padding: 9px 8px; min-height: 46px; justify-content: flex-start; gap: 8px; }
    body.communication-focus .sidebar-item.active { background: #233756; border-radius: 9px; }
    body.communication-focus .sidebar .menu-icon { width: 28px; height: 28px; flex-basis: 28px; background: transparent; border: 0; }
    body.communication-focus .header-search-area { height: 42px; max-width: 680px; }
    #communicationWorkspace .communication-shell, #communicationWorkspace .communication-shell.context-open { display: grid; grid-template-columns: 170px minmax(244px,280px) minmax(330px,1fr) 294px; }
    #communicationWorkspace .communication-shell.account-rail-collapsed, #communicationWorkspace .communication-shell.account-rail-collapsed.context-open { grid-template-columns: 66px minmax(244px,280px) minmax(330px,1fr) 294px; }
    #communicationWorkspace .communication-shell.account-rail-collapsed :is(.cw-add-account,.cw-account-management,.cw-no-account,.cw-account-unread,.conversation-provider-scope > svg) { display: none; }
    #communicationWorkspace .communication-shell.account-rail-collapsed .conversation-account-scope { justify-content: center; }
    #communicationWorkspace .conversation-context-toggle, #communicationWorkspace .conversation-mobile-back { display: none; }
}
@media (min-width: 1201px) and (max-width: 1500px) {
    body.communication-focus { --sidebar-width: 160px; }
    body.communication-focus .main-workspace { padding: 16px 12px 12px; }
    body.communication-focus .sidebar-brand-copy strong { font-size: 14px; }
    body.communication-focus .sidebar-brand-copy small { font-size: 8px; }
    #communicationWorkspace .communication-shell, #communicationWorkspace .communication-shell.context-open { grid-template-columns: 150px minmax(224px,245px) minmax(305px,1fr) 260px; }
    #communicationWorkspace .communication-shell.account-rail-collapsed, #communicationWorkspace .communication-shell.account-rail-collapsed.context-open { grid-template-columns: 60px minmax(224px,245px) minmax(305px,1fr) 260px; }
    #communicationWorkspace .conversation-detail-header { padding: 12px; }
    #communicationWorkspace .conversation-detail-actions { width: 100%; justify-content: flex-end; }
    #communicationWorkspace .message-timeline { padding: 14px; }
    #communicationWorkspace .context-card { padding: 16px 12px; }
}
@media (min-width: 761px) and (max-width: 1200px) {
    #communicationWorkspace .communication-shell, #communicationWorkspace .communication-shell.context-open { display: grid; grid-template-columns: 136px 248px minmax(0,1fr); position: relative; }
    #communicationWorkspace .conversation-account-panel { display: flex; }
    #communicationWorkspace .conversation-context-panel { display: block; position: absolute; z-index: 5; inset: 0 0 0 auto; width: min(340px,90%); box-shadow: -10px 0 30px #263e6420; }
    #communicationWorkspace .conversation-list-panel { display: flex; }
    #communicationWorkspace .conversation-detail-panel { display: flex; }
    #communicationWorkspace .communication-shell.mobile-detail-open .conversation-account-panel { display: flex; }
    #communicationWorkspace .conversation-detail-actions { width: 100%; }
    #communicationWorkspace .conversation-mobile-back { display: none; }
    #communicationWorkspace .communication-shell:not(.context-open) .conversation-context-panel { display: none; }
}
@media (max-width: 760px) {
    #communicationWorkspace .communication-header h1 { font-size: 22px; }
    #communicationWorkspace .cw-subtitle { display: none; }
    #communicationWorkspace .communication-workspace-picker label { display: none; }
    #communicationWorkspace .communication-workspace-picker select { width: 115px; font-size: 11px; }
    #communicationWorkspace .communication-shell { display: flex; flex-direction: column; overflow: auto; }
    #communicationWorkspace .conversation-account-panel { flex: 0 0 auto; max-height: 220px; border-bottom: 1px solid var(--cw-line); }
    #communicationWorkspace .conversation-account-panel-header { padding: 10px; }
    #communicationWorkspace .cw-add-account { position: absolute; inset-inline-end: 40px; top: 10px; padding: 5px 9px; }
    #communicationWorkspace .conversation-account-panel { position: relative; }
    #communicationWorkspace .conversation-account-groups { display: flex; padding: 0; gap: 10px; overflow: auto; }
    #communicationWorkspace .conversation-provider-group { flex: 0 0 180px; }
    #communicationWorkspace .conversation-account-list { display: grid; }
    #communicationWorkspace .cw-account-management, #communicationWorkspace .cw-no-account { display: none; }
    #communicationWorkspace .conversation-list-panel { flex: 1; min-height: 260px; }
    #communicationWorkspace .conversation-detail-panel { display: none; }
    #communicationWorkspace .communication-shell.mobile-detail-open .conversation-account-panel, #communicationWorkspace .communication-shell.mobile-detail-open .conversation-list-panel { display: none; }
    #communicationWorkspace .communication-shell.mobile-detail-open .conversation-detail-panel { display: flex; flex: 1; min-height: 0; }
    #communicationWorkspace .conversation-mobile-back { display: block; align-self: flex-start; padding: 10px 14px; font-size: 12px; background: white; border: 0; color: var(--cw-blue); }
    #communicationWorkspace .communication-shell { position: relative; }
    #communicationWorkspace .conversation-context-panel { position: absolute; z-index: 4; inset: 38px 0 0 0; width: auto; background: #fff; }
    #communicationWorkspace .conversation-detail-header { padding: 10px 12px; }
    #communicationWorkspace .conversation-detail-actions { width: 100%; }
    #communicationWorkspace .communication-shell:not(.mobile-detail-open) .conversation-context-panel { display: none; }
    #communicationWorkspace .cw-chat-tools { padding-block: 5px; }
    #communicationWorkspace .conversation-composer textarea { height: 65px; min-height: 65px; }
    #communicationWorkspace .cw-capability-note { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { #communicationWorkspace * { scroll-behavior: auto; } }
#communicationWorkspace .cw-context-close { display: none; }
@media (max-width: 1200px) {
    #communicationWorkspace .cw-context-tabs .cw-context-close { display: block; flex: 0 0 32px; font-size: 23px; font-weight: 400; }
}

@media (min-width: 901px) and (max-width: 1200px) {
    body.communication-focus .sidebar { width: 64px; flex-basis: 64px; padding: 16px 8px; }
    body.communication-focus .sidebar-label, body.communication-focus .sidebar-brand-copy { display: none; }
}

/* AI reply drafts remain inside the existing customer context rail. */
.sales-draft-panel { min-width: 0; overflow-wrap: anywhere; }
.sales-draft-message-label { display: grid; gap: 7px; color: #60718e; font-size: 11px; }
.sales-draft-message-label select { width: 100%; min-width: 0; max-width: 100%; border: 1px solid #e0e7f2; border-radius: 8px; background: #f8faff; padding: 8px; color: #36445d; font: inherit; }
#salesDraftStatus { font-size: 12px; color: #596d8b; line-height: 1.6; }
#salesDraftText { border: 1px solid #dde5ff; border-radius: 10px; background: #edf3ff; padding: 12px; color: #172846; line-height: 1.7; white-space: pre-wrap; }
.sales-draft-pill { display: inline-block; border-radius: 7px; background: #fff4df; color: #875511; padding: 5px 8px; font-size: 11px; }
.sales-draft-panel small { display: block; font-size: 10px; color: #60718e; line-height: 1.6; }
.sales-draft-panel details { margin-top: 12px; border-top: 1px solid #e8edf5; padding-top: 9px; font-size: 11px; color: #566b88; }
.sales-draft-panel summary { cursor: pointer; color: #254ac6; font-weight: 600; }
.sales-draft-panel ul { padding-inline-start: 16px; font-size: 10px; line-height: 1.7; }
.sales-draft-panel li { margin-bottom: 8px; }
.sales-draft-panel blockquote { margin: 5px 0; padding-inline-start: 8px; border-inline-start: 2px solid #dce5f7; }
.sales-draft-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.sales-draft-actions button:disabled { opacity: .5; cursor: not-allowed; }

/* Business Dashboard single-view desktop density. Presentation only.
 * Keep all six actions and all three rail panels; long live lists retain
 * their existing local scroll areas. Never clip the workspace to fake fit.
 */
@media (min-width: 1241px) and (min-height: 760px) {
    body:has(#featurePanel.business-dashboard:not(.hidden)) {
        --sidebar-width: clamp(236px, 15.7vw, 280px);
        --header-height: 64px;
    }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .top-header {
        padding-inline: 24px;
    }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .header-search-area {
        height: 42px;
    }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .main-workspace {
        padding: 14px 20px 16px 24px;
    }
    html[dir="rtl"] body:has(#featurePanel.business-dashboard:not(.hidden)) .main-workspace {
        padding-inline: 24px 20px;
    }
    .feature-panel.business-dashboard {
        --business-rail-width: clamp(310px, 23vw, 390px);
        height: 100%;
        min-height: 0;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 12px 20px;
    }
    .feature-panel.business-dashboard > .history-panel-header {
        min-height: 64px;
        gap: 4px 12px;
        padding: 0;
    }
    .feature-panel.business-dashboard .history-panel-header h2 {
        font-size: clamp(26px, 1.9vw, 34px);
    }
    .feature-panel.business-dashboard .feature-panel-subtitle {
        font-size: 14px;
        line-height: 1.4;
    }
    .feature-panel.business-dashboard .business-home-main {
        min-height: 0;
        gap: 14px;
    }
    .feature-panel.business-dashboard .business-kpi-grid.four {
        gap: 12px;
    }
    .feature-panel.business-dashboard .business-kpi-card {
        min-height: 94px;
        gap: 10px;
        padding: 12px;
    }
    .feature-panel.business-dashboard .business-kpi-icon {
        width: 44px;
        height: 48px;
        flex-basis: 44px;
        border-radius: 14px;
    }
    .feature-panel.business-dashboard .business-kpi-icon .business-ui-icon,
    .feature-panel.business-dashboard .business-kpi-icon svg {
        width: 28px;
        height: 28px;
    }
    .feature-panel.business-dashboard .business-kpi-label { font-size: 13px; }
    .feature-panel.business-dashboard .business-kpi-value { margin-top: 3px; font-size: 30px; }
    .feature-panel.business-dashboard .business-kpi-card small { margin-top: 4px; }
    .feature-panel.business-dashboard .business-capability-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
    .feature-panel.business-dashboard .business-capability-card {
        min-height: clamp(220px, 25dvh, 260px);
        padding: 14px;
    }
    .feature-panel.business-dashboard .business-card-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        border-radius: 14px;
    }
    .feature-panel.business-dashboard .business-card-icon .business-ui-icon,
    .feature-panel.business-dashboard .business-card-icon svg { width: 30px; height: 30px; }
    .feature-panel.business-dashboard .business-card-art { height: 44px; }
    .feature-panel.business-dashboard .business-capability-card strong {
        margin-top: 10px;
        font-size: 19px;
    }
    .feature-panel.business-dashboard .business-capability-card small {
        margin: 6px 0 10px;
        font-size: 13px;
        line-height: 1.5;
    }
    .feature-panel.business-dashboard .business-card-cta { padding: 6px 11px; font-size: 12px; }
    .feature-panel.business-dashboard .business-right-rail {
        min-height: 0;
        height: 100%;
        gap: 12px;
        grid-template-rows: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr);
    }
    .feature-panel.business-dashboard .business-rail-panel { padding: 14px; }
    .feature-panel.business-dashboard .business-rail-heading {
        flex-shrink: 0;
        gap: 8px;
        margin-bottom: 6px;
        padding-bottom: 8px;
    }
    .feature-panel.business-dashboard .business-rail-heading h3 { gap: 7px; font-size: 17px; }
    .feature-panel.business-dashboard .business-activity-list {
        flex: 1 1 0;
        max-height: none;
        /* Preserve access to every existing row without growing the page. */
        overflow-y: auto;
        overflow-wrap: anywhere;
    }
    .feature-panel.business-dashboard .business-activity-row { padding-block: 7px; }
    .feature-panel.business-dashboard .business-row-meta { margin-top: 4px; gap: 4px 6px; }
    .feature-panel.business-dashboard .business-activity-metric { min-height: 28px; gap: 8px; font-size: 13px; }
    .feature-panel.business-dashboard .business-activity-metric > .business-ui-icon { width: 24px; height: 24px; }
    .feature-panel.business-dashboard .business-activity-metric strong { font-size: 16px; }
    .feature-panel.business-dashboard .business-status-pill { padding: 3px 6px; }
    .feature-panel.business-dashboard .business-task-row .business-row-meta { margin: 0; gap: 6px; }
    .feature-panel.business-dashboard .business-customer-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; }
    .feature-panel.business-dashboard .business-customer-avatar { width: 30px; height: 30px; font-size: 15px; }
    .feature-panel.business-dashboard .business-empty { min-height: 0; gap: 6px; padding: 8px; }
    .feature-panel.business-dashboard .business-empty > .business-ui-icon { width: 36px; height: 36px; padding: 8px; border-radius: 12px; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar { padding: 18px 14px; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-brand { min-height: 56px; margin-bottom: 14px; padding-bottom: 12px; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-nav-primary { gap: 6px; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-item { min-height: 48px; padding-block: 7px; }
    body:has(#featurePanel.business-dashboard:not(.hidden)) .sidebar-workspace-card { min-height: 68px; padding-block: 10px; }
    /* Loading, no-workspace and error notices keep natural document flow. */
    .feature-panel.business-dashboard:has(.feature-panel-notice:not(.hidden)),
    .feature-panel.business-dashboard:has(#featurePanelContent > .business-empty) { height: auto; }
}

@media (min-width: 1241px) and (max-width: 1399px) and (min-height: 760px) {
    .feature-panel.business-dashboard .business-kpi-card { padding: 10px; gap: 8px; }
    .feature-panel.business-dashboard .business-kpi-icon { width: 30px; height: 36px; flex-basis: 30px; border-radius: 10px; }
    .feature-panel.business-dashboard .business-kpi-icon .business-ui-icon,
    .feature-panel.business-dashboard .business-kpi-icon svg { width: 22px; height: 22px; }
    .feature-panel.business-dashboard .business-kpi-value { font-size: 26px; }
    .feature-panel.business-dashboard .business-capability-card { padding: 12px; }
}

/* Browser chrome can reduce a 900px display to a ~780px CSS viewport. */
@media (min-width: 1241px) and (min-height: 760px) and (max-height: 849px) {
    .feature-panel.business-dashboard .business-capability-card {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
        grid-template-rows: auto 1fr auto;
        gap: 6px 10px;
        min-height: 190px;
        padding: 12px;
        align-items: start;
    }
    .feature-panel.business-dashboard .business-card-visual { grid-column: 1; grid-row: 1; gap: 0; }
    .feature-panel.business-dashboard .business-card-icon { width: 40px; height: 40px; flex-basis: 40px; }
    .feature-panel.business-dashboard .business-capability-card strong { grid-column: 2; grid-row: 1; align-self: center; margin: 0; font-size: 17px; }
    .feature-panel.business-dashboard .business-capability-card small { grid-column: 1 / -1; grid-row: 2; margin: 0; }
    .feature-panel.business-dashboard .business-card-cta { grid-column: 1 / -1; grid-row: 3; justify-self: end; align-self: end; }
    .feature-panel.business-dashboard .business-right-rail { grid-template-rows: minmax(0, 1fr) minmax(0, 1.9fr) minmax(0, 1fr); }
    .feature-panel.business-dashboard .business-rail-panel { padding: 12px; }
    .feature-panel.business-dashboard .business-rail-heading h3 { font-size: 16px; }
    .feature-panel.business-dashboard .business-empty { gap: 4px; padding: 4px; }
    .feature-panel.business-dashboard .business-empty > .business-ui-icon { width: 28px; height: 28px; padding: 5px; }
    .feature-panel.business-dashboard .business-empty strong { font-size: 13px; line-height: 1.4; }
    .feature-panel.business-dashboard .business-empty small { line-height: 1.4; }

    .feature-panel.business-dashboard .business-rail-activity .business-activity-row { padding-block: 4px; }
    .feature-panel.business-dashboard .business-rail-activity .business-row-meta { margin-top: 2px; }
    .feature-panel.business-dashboard .business-activity-metric { min-height: 26px; }

}
