/* Scoped account surfaces. Product state colours and form behaviour stay with
   their existing components; these rules supply the shared workspace chrome. */
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org, .cw3-pbi) {
    --cw3-bg: var(--cw-surface-canvas);
    --cw3-panel: var(--cw-surface-panel);
    --cw3-panel-2: var(--cw-surface-raised);
    --cw3-line: var(--cw-border-subtle);
    --cw3-line-2: var(--cw-border-control);
    --cw3-text: var(--cw-text-primary);
    --cw3-text-2: var(--cw-text-secondary);
    --cw3-text-3: var(--cw-text-secondary);
    --cw3-display: var(--cw-font-family);
    --cw3-mono: var(--cw-font-family);
    min-height: calc(100dvh - var(--cw-shell-topbar-height, 60px));
    background: var(--cw-surface-canvas);
    color: var(--cw-text-primary);
    font: 400 var(--cw-body-size)/1.5 var(--cw-font-family);
}
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org, .cw3-pbi) :is(.cw3-profile-bg, .cw3-org-bg, .cw3-pbi-grid, .cw3-disc-dots, .cw3-pulse-dot, .cw3-pbi-signal) { display: none; }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org, .cw3-pbi) .cw3-mono { font-family: var(--cw-font-family); letter-spacing: 0; }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org, .cw3-pbi) :is(button, a, input, select, summary):focus-visible { outline: 2px solid var(--cw-focus-ring); outline-offset: 2px; }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-shell, .cw3-org-shell) { max-width: none; padding-inline: clamp(16px, 2.5vw, 36px); gap: 16px; }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-hero-card, .cw3-org-hero-card, .cw3-profile-card, .cw3-org-card) {
    background: var(--cw-surface-panel);
    border-color: var(--cw-border-subtle);
    border-radius: var(--cw-radius-panel);
    box-shadow: none;
}
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-card-head, .cw3-org-card-head) { background: var(--cw-surface-raised); border-color: var(--cw-border-subtle); }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-avatar, .cw3-org-avatar) {
    background: var(--cw-selection-background);
    border-color: var(--cw-border-subtle);
    color: var(--cw-text-link);
    box-shadow: none;
}
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-eyebrow, .cw3-org-eyebrow) { padding: 0; border: 0; border-radius: 0; background: none; }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-headline, .cw3-org-headline) {
    color: var(--cw-text-primary);
    font: 600 clamp(24px, 2.5vw, 28px)/1.25 var(--cw-font-family);
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-headline-num { color: var(--cw-text-primary); background: none; -webkit-text-fill-color: currentColor; }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-card-tag, .cw3-org-card-tag, .cw3-profile-eyebrow, .cw3-org-eyebrow) {
    color: var(--cw-text-secondary);
    font: 600 12px/1.4 var(--cw-font-family);
    letter-spacing: 0;
    text-transform: none;
}
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) .cw3-btn { min-height: 44px; padding: 10px 16px; border-radius: var(--cw-radius-control); font: 600 14px/1.4 var(--cw-font-family); box-shadow: none; }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) .cw3-btn--primary,
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) .cw3-btn--primary:hover:not(:disabled) { background: var(--cw-action-background); border-color: var(--cw-action-background); color: var(--cw-action-text); box-shadow: none; }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) .cw3-btn--primary:hover:not(:disabled) { background: var(--cw-action-hover); border-color: var(--cw-action-hover); }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-tab.is-active, .cw3-org-tab.is-active) { background: var(--cw-selection-background); border-color: var(--cw-action-background); color: var(--cw-text-link); }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-notice, .cw3-org-notice, .cw3-profile-info-strip) { background: var(--cw-surface-raised); border-color: var(--cw-border-subtle); border-radius: var(--cw-radius-control); }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-notice--danger, .cw3-org-notice--warn) { border-color: currentColor; }
.cw3[data-cw-system].cw3-org .cw3-org-pill { background: var(--cw-selection-background); border-color: var(--cw-border-subtle); color: var(--cw-text-link); letter-spacing: 0; }
.cw3[data-cw-system].cw3-org .cw3-org-stat-num--accent { color: var(--cw-text-link); }
.cw3[data-cw-system].cw3-org .cw3-org-seat-bar-fill { background: var(--cw-action-background); box-shadow: none; }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(input, select, textarea) { background-color: var(--cw-surface-raised); color: var(--cw-text-primary); border-color: var(--cw-border-control); border-radius: var(--cw-radius-control); font-family: var(--cw-font-family); }
.cw3[data-cw-system].cw3-profile .cw3-profile-card-body .mud-input-outlined-border { border-color: var(--cw-border-control) !important; }
.cw3[data-cw-system].cw3-profile .cw3-profile-card-body--row .mud-input-control-input-container { background: var(--cw-surface-raised); border-radius: var(--cw-radius-control); }
.cw3[data-cw-system]:is(.cw3-profile, .cw3-org) :is(.cw3-profile-table-wrap, .cw3-org-table-wrap) { overflow-x: auto; }

/* Profile settings: a readable form column on wide workspaces, with the same
   hierarchy and control rhythm on every tab. */
.cw3[data-cw-system].cw3-profile .cw3-profile-shell {
    width: 100%;
    max-width: 1280px;
    gap: 20px;
    padding-block: 16px 48px;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-hero-card {
    padding: 24px 28px;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-hero-meta { gap: 3px; }
.cw3[data-cw-system].cw3-profile .cw3-profile-email {
    color: var(--cw-text-secondary);
    font-size: 13px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-settings-layout {
    grid-template-columns: 208px minmax(0, 1fr);
    gap: clamp(24px, 3vw, 40px);
    margin-top: 4px;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-tabs {
    top: 24px;
    padding: 8px;
    gap: 2px;
    background: transparent;
    border: 0;
    border-radius: 0;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-tabs-group {
    margin: 20px 10px 7px;
    color: var(--cw-text-secondary);
    font: 600 11px/1.4 var(--cw-font-family);
    letter-spacing: 0;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-tabs-group:first-child { margin-top: 4px; }
.cw3[data-cw-system].cw3-profile .cw3-profile-tab {
    min-height: 42px;
    padding: 10px 13px;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 0 var(--cw-radius-control) var(--cw-radius-control) 0;
    color: var(--cw-text-secondary);
    font: 500 14px/1.4 var(--cw-font-family);
}
.cw3[data-cw-system].cw3-profile .cw3-profile-tab:hover { background: var(--cw-surface-raised); color: var(--cw-text-primary); }
.cw3[data-cw-system].cw3-profile .cw3-profile-tab.is-active {
    background: var(--cw-selection-background);
    border-left-color: var(--cw-action-background);
    color: var(--cw-text-link);
    font-weight: 650;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-tab-panel { gap: 20px; }
.cw3[data-cw-system].cw3-profile .cw3-profile-card-head {
    padding: 22px 26px 18px;
    gap: 5px;
    background: var(--cw-surface-panel);
}
.cw3[data-cw-system].cw3-profile .cw3-profile-card-tag {
    margin: 0;
    color: var(--cw-text-primary);
    font: 650 18px/1.35 var(--cw-font-family);
    letter-spacing: -.015em;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-card-sub {
    color: var(--cw-text-secondary);
    font: 400 13px/1.5 var(--cw-font-family);
}
.cw3[data-cw-system].cw3-profile .cw3-profile-card-body {
    padding: 24px 26px 28px;
    gap: 16px;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-card-body--flush {
    padding: 0;
    overflow-x: auto;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-card-body--row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 20px;
    align-items: start;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-card-body--row > * { width: 100%; min-width: 0; }
.cw3[data-cw-system].cw3-profile .cw3-profile-card-body--row .cw3-profile-language-field { max-width: 440px; }
.cw3[data-cw-system].cw3-profile .cw3-profile-card-body--row .mud-input-control { width: 100%; }
.cw3[data-cw-system].cw3-profile .cw3-profile-mud .mud-input-outlined { min-height: 48px; }
.cw3[data-cw-system].cw3-profile .cw3-profile-mud .mud-input-slot,
.cw3[data-cw-system].cw3-profile .cw3-profile-mud input { font-size: 14px; }
.cw3[data-cw-system].cw3-profile .cw3-profile-mud .mud-input-label { font-size: 13px; }
.cw3[data-cw-system].cw3-profile .cw3-profile-language-hint {
    margin: 8px 2px 0;
    color: var(--cw-text-secondary);
    font: 400 12px/1.5 var(--cw-font-family);
}
.cw3[data-cw-system].cw3-profile .cw3-profile-pref {
    padding: 14px 0 16px;
    border-bottom: 1px solid var(--cw-border-subtle);
}
.cw3[data-cw-system].cw3-profile .cw3-profile-pref-hint {
    margin: 2px 0 0 52px;
    color: var(--cw-text-secondary);
    font-size: 12px;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-pref--danger {
    margin-top: 6px;
    padding: 16px;
    background: var(--cw-feedback-error-surface);
    border: 1px solid var(--cw-feedback-error);
}
.cw3[data-cw-system].cw3-profile .cw3-profile-notice,
.cw3[data-cw-system].cw3-profile .cw3-profile-info-strip { font-size: 13px; line-height: 1.5; }
.cw3[data-cw-system].cw3-profile .cw3-profile-card--danger { border-color: var(--cw-feedback-error); }
.cw3[data-cw-system].cw3-profile .cw3-profile-card--danger .cw3-profile-card-tag { color: var(--cw-feedback-error); }
.cw3[data-cw-system].cw3-profile .cw3-profile-aiusage-breakdown { max-width: 620px; }
.cw3[data-cw-system].cw3-profile .cw3-profile-aiusage-row {
    padding: 11px 0;
    border-bottom: 1px solid var(--cw-border-subtle);
    font-size: 13px;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-quota-bar { background: var(--cw-surface-raised); }
.cw3[data-cw-system].cw3-profile .cw3-profile-quota-bar-fill { background: var(--cw-action-background); box-shadow: none; }
.cw3[data-cw-system].cw3-profile .cw3-profile-table { min-width: 560px; }
.cw3[data-cw-system].cw3-profile .cw3-profile-table thead th {
    background: var(--cw-surface-raised);
    color: var(--cw-text-secondary);
    font: 600 12px/1.4 var(--cw-font-family);
    letter-spacing: 0;
    white-space: nowrap;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-table tbody td {
    border-bottom: 1px solid var(--cw-border-subtle);
    font-size: 13px;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-table tbody tr:hover td { background: var(--cw-surface-raised); }
.cw3[data-cw-system].cw3-profile .cw3-profile-table-meta { color: var(--cw-text-secondary); }
.cw3[data-cw-system].cw3-profile .cw3-profile-status {
    padding: 4px 10px;
    border-color: var(--cw-border-subtle);
    background: var(--cw-surface-raised);
    font: 600 12px/1.3 var(--cw-font-family);
    letter-spacing: 0;
}
.cw3[data-cw-system].cw3-profile .cw3-profile-status--active { background: var(--cw-feedback-success-surface); color: var(--cw-feedback-success); }
.cw3[data-cw-system].cw3-profile .cw3-profile-status--warn { background: var(--cw-feedback-warning-surface); color: var(--cw-feedback-warning); }
.cw3[data-cw-system].cw3-profile .cw3-profile-status--off { background: var(--cw-feedback-error-surface); color: var(--cw-feedback-error); }
.cw3[data-cw-system].cw3-profile .cw3-profile-status--trial { background: var(--cw-selection-background); color: var(--cw-text-link); }
.cw3[data-cw-system].cw3-profile .cw3-profile-api-actions { justify-content: flex-start; }
.cw3[data-cw-system].cw3-profile .cw3-profile-code { overflow-wrap: anywhere; }
.cw3[data-cw-system].cw3-profile .cw-np-row { padding: 16px 0; }
.cw3[data-cw-system].cw3-profile .cw-np-row-title { font-weight: 600; }
.cw3[data-cw-system].cw3-profile .cw-np-row-hint { color: var(--cw-text-secondary); }

@media (max-width: 920px) {
    .cw3[data-cw-system].cw3-profile .cw3-profile-settings-layout { grid-template-columns: 176px minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 720px) {
    .cw3[data-cw-system].cw3-profile .cw3-profile-shell { padding-block: 8px 32px; }
    .cw3[data-cw-system].cw3-profile .cw3-profile-settings-layout { display: block; }
    .cw3[data-cw-system].cw3-profile .cw3-profile-tabs {
        display: flex;
        flex-direction: row;
        gap: 4px;
        margin-bottom: 16px;
        padding: 4px 0 9px;
        overflow-x: auto;
        border-bottom: 1px solid var(--cw-border-subtle);
        white-space: nowrap;
    }
    .cw3[data-cw-system].cw3-profile .cw3-profile-tabs-group { display: none; }
    .cw3[data-cw-system].cw3-profile .cw3-profile-tab {
        width: auto;
        min-height: 40px;
        flex: 0 0 auto;
        padding: 9px 12px;
        border: 0;
        border-bottom: 2px solid transparent;
        border-radius: var(--cw-radius-control) var(--cw-radius-control) 0 0;
    }
    .cw3[data-cw-system].cw3-profile .cw3-profile-tab.is-active { border-bottom-color: var(--cw-action-background); }
    .cw3[data-cw-system].cw3-profile .cw3-profile-card-head { padding: 18px 18px 16px; }
    .cw3[data-cw-system].cw3-profile .cw3-profile-card-body { padding: 20px 18px; }
    .cw3[data-cw-system].cw3-profile .cw3-profile-card-body--flush { padding: 0; }
    .cw3[data-cw-system].cw3-profile .cw3-profile-card-body--row { grid-template-columns: 1fr; gap: 20px; }
}

/* Power BI keeps its existing install/download steps and warning content. */
.cw3[data-cw-system].cw3-pbi { --pbi-ink: var(--cw-text-primary); --pbi-muted: var(--cw-text-secondary); --pbi-line: var(--cw-border-subtle); --pbi-teal: var(--cw-text-link); --pbi-panel: var(--cw-surface-panel); overflow: visible; }
/* Day: the warning amber and the callout copy were tuned for the dark page. */
.cw3[data-cw-system][data-theme="day"].cw3-pbi { --pbi-warn: var(--cw-feedback-warning); }
.cw3[data-cw-system][data-theme="day"].cw3-pbi :is(.cw3-pbi-callout, .cw3-pbi-gateway) p { color: var(--cw-text-secondary); }
.cw3[data-cw-system][data-theme="day"].cw3-pbi :is(.cw3-pbi-artifact, .cw3-pbi-download):hover { background: var(--cw-surface-raised); }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-shell { width: 100%; max-width: none; padding: 24px clamp(16px, 2.5vw, 36px) 64px; }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-hero { min-height: 0; padding: 8px 0 24px; gap: 24px; }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-hero h1 { color: var(--cw-text-primary); font: 600 clamp(24px, 2.5vw, 28px)/1.25 var(--cw-font-family); letter-spacing: -.025em; }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-eyebrow { font: 600 12px/1.4 var(--cw-font-family); letter-spacing: 0; }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-mark { display: none; }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-rail::before { background: var(--cw-border-control); }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-step-no { background: var(--cw-surface-raised); border-color: var(--cw-border-control); color: var(--cw-text-link); font: 600 14px/1 var(--cw-font-family); }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-card { background: var(--cw-surface-panel); border-color: var(--cw-border-subtle); border-radius: var(--cw-radius-panel); box-shadow: none; }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-card h2 { color: var(--cw-text-primary); font: 600 20px/1.3 var(--cw-font-family); }
.cw3[data-cw-system].cw3-pbi :is(.cw3-pbi-artifact, .cw3-pbi-download, .cw3-pbi-path, .cw3-pbi-refresh-grid article) { background: var(--cw-surface-raised); border-color: var(--cw-border-subtle); border-radius: var(--cw-radius-control); }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-btn { min-height: 44px; background: var(--cw-action-background); color: var(--cw-action-text); border-radius: var(--cw-radius-control); font: 600 14px/1.4 var(--cw-font-family); }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-artifact-icon { background: var(--cw-action-background); color: var(--cw-action-text); }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-instructions li { color: var(--cw-text-secondary); }
.cw3[data-cw-system].cw3-pbi .cw3-pbi-path code { color: var(--cw-text-primary); font-family: var(--cw-font-mono); }

@media (max-width: 720px) {
    .cw3[data-cw-system].cw3-profile .cw3-profile-hero-left,
    .cw3[data-cw-system].cw3-org .cw3-org-hero-left { flex: 0 1 auto; }
    .cw3[data-cw-system].cw3-pbi .cw3-pbi-card { padding: 18px; }
    .cw3[data-cw-system].cw3-mcpact .cw3-mcpact-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px; }
    .cw3[data-cw-system].cw3-mcpact .cw3-mcpact-source { grid-column: 1; grid-row: 1; justify-self: start; }
    .cw3[data-cw-system].cw3-mcpact .cw3-mcpact-outcome { grid-column: 2; grid-row: 1; }
    .cw3[data-cw-system].cw3-mcpact .cw3-mcpact-main { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
    .cw3[data-cw-system]:is(.cw3-profile, .cw3-org, .cw3-pbi) * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
