/* Organization-scoped application chrome. Status, document and media colors keep their meaning. */
html:root {
 --rx-background:var(--org-background);--rx-surface:#fff;--rx-surface-subtle:var(--org-subtle);--rx-text:var(--org-text);--rx-ink:var(--org-text);--rx-muted:var(--org-muted);--rx-border:var(--org-border);
 --rx-navy-950:var(--org-sidebar);--rx-navy-900:var(--org-sidebar_hover);--rx-navy-700:var(--org-muted);--rx-gold:var(--org-accent);--rx-gold-soft:var(--org-selected);--rx-accent:var(--org-accent);--rx-focus:var(--org-accent);--rx-selected:var(--org-selected);
 --v4-background:var(--org-background);--v4-surface:#fff;--v4-surface-low:var(--org-subtle);--v4-surface-container:var(--org-selected);--v4-surface-high:var(--org-selected);--v4-text:var(--org-text);--v4-muted:var(--org-muted);--v4-outline:var(--org-border);
 --v4-navy:var(--org-sidebar);--v4-navy-soft:var(--org-sidebar_hover);--v4-gold:var(--org-accent);--v4-gold-soft:var(--org-selected);--v4-gold-pale:var(--org-selected);
 --tenant-primary:var(--org-sidebar);--tenant-accent:var(--org-accent);--primary:var(--org-accent);--accent:var(--org-accent);--ink:var(--org-text);--muted:var(--org-muted);--line:var(--org-border);--surface:#fff;--canvas:var(--org-background);
}
html body {background:var(--org-background);color:var(--org-text)}
.unified-shell .v4-sidebar{background:var(--org-sidebar);color:#fff}
.unified-shell .v4-sidebar :is(.nav-link,.v4-nav-group>summary){color:var(--org-sidebar_text)}
.unified-shell .v4-sidebar .nav-link.active{background:var(--org-selected);color:var(--org-selected_text);border-color:var(--org-accent)}
.unified-shell .v4-sidebar .nav-link:hover:not(.active){background:var(--org-sidebar_hover);color:#fff}
.unified-shell .v4-sidebar :is(.brand-mark,.v4-tenant-badge){background:var(--org-selected);color:var(--org-selected_text)}
.unified-shell .v4-topbar{background:#fff;color:var(--org-text);border-color:var(--org-border)}
.unified-shell :is(.topbar-search,.v4-settings-card){border-color:var(--org-border)}
.unified-shell .global-ai-trigger,.unified-shell .v4-btn-primary,.unified-shell .btn-primary{background:var(--org-accent);color:#fff;border-color:var(--org-accent)}
.unified-shell :is(.v4-bottom-nav,.v4-mobile-header){background:#fff;border-color:var(--org-border)}
.unified-shell .v4-bottom-nav a.active{color:var(--org-accent)}
html .rx-app-shell .rx-button-primary,.rx-command-dialog .rx-button-primary{color:#fff}
html .rx-app-shell:not(.rx-shell-light) .rx-sidebar :is(small,.rx-nav-section-label){color:var(--org-sidebar_muted)}
html .rx-app-shell:not(.rx-shell-light) .rx-assistant-entry{color:#fff}
html .rx-app-shell:not(.rx-shell-light) .rx-assistant-entry small{color:#fff}
html .rx-app-shell .rx-button-secondary{background:var(--rx-surface);color:var(--org-text)}
html .rx-app-shell:not(.rx-shell-light) .rx-brand small{color:var(--org-sidebar_text)}
html .rx-app-shell .rx-badge-neutral{background:var(--org-subtle);color:var(--org-text)}
html .rx-app-shell :is(input,textarea,select){accent-color:var(--org-accent)}
html .rx-app-shell :focus-visible,.unified-shell :focus-visible{outline-color:var(--org-accent)}

/* The legacy view uses the same short, one-scroll navigation and palette as React. */
.unified-shell .v4-sidebar { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; }
.unified-shell .v4-sidebar > * { flex-shrink: 0; }
.unified-shell .v4-sidebar .nav-groups { flex: none; height: auto; max-height: none; min-height: auto; overflow: visible; padding-block: 12px 20px; }
.unified-shell .v4-sidebar .nav-link { min-height: 48px; padding: 10px 12px; gap: 12px; font-size: 15px; line-height: 1.7; border-radius: 8px; }
.unified-shell .v4-sidebar .nav-section-label { margin-block: 16px 8px; color: var(--org-sidebar_muted); }
.unified-shell .v4-sidebar .workspace-nav-arrow { margin-inline-start: auto; font-size: 20px; }
.unified-shell .v4-sidebar .sidebar-user { margin-block-start: auto; }
.unified-shell .v4-settings-page { max-width: 1120px; margin-inline: auto; }
.unified-shell .v4-settings-head h1 { margin: 4px 0 8px; font-size: 26px; line-height: 1.6; font-weight: 700; color: var(--org-text); }
.unified-shell .v4-settings-page .v4-settings-card h2 { font-size: 19px; line-height: 1.7; margin: 0 0 4px; font-weight: 600; }
.unified-shell .v4-settings-page :is(p, .v4-field > span) { font-size: 15px; line-height: 1.9; }
.unified-shell .v4-settings-page .v4-settings-card { padding: 24px; border-radius: 16px; box-shadow: 0 2px 5px rgb(0 0 0 / 2%); }
.unified-shell .v4-settings-save-note { color: var(--org-muted); font-size: 14px; }
@media(max-width:700px) {
 .unified-shell .v4-settings-page .v4-settings-card { padding: 18px 16px; }
 .unified-shell .v4-settings-page :is(p, .v4-field > span) { font-size: 16px; }
 .unified-shell .v4-settings-head { align-items: flex-start; }
}

.unified-shell .v4-settings-section-title > span:first-child { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--org-subtle); color: var(--org-accent); }
.unified-shell .v4-settings-section-title > span:first-child svg { width: 20px; height: 20px; }
.unified-shell .v4-settings-head .v4-eyebrow { background: var(--org-subtle); color: var(--org-muted); }

.unified-shell .v4-bottom-nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }

/* A switch is 40x24; its whole label remains the touch target. Generic input sizing must not stretch it. */
.unified-shell .v4-toggle-row { min-height: 64px; align-items: center; gap: 16px; background: var(--org-subtle); }
.unified-shell .v4-toggle-row > span { flex: 1; min-width: 0; }
.unified-shell .v4-toggle-row b { font-size: 15px; line-height: 1.8; }
.unified-shell .v4-toggle-row small { font-size: 14px; line-height: 1.8; color: var(--org-muted); }
.unified-shell .v4-toggle-row input[type=checkbox] { width: 40px; min-width: 40px; height: 24px; min-height: 24px; flex: 0 0 40px; margin: 0; padding: 0; border-radius: 999px; background: #c6d0cc; }
.unified-shell .v4-toggle-row input[type=checkbox]::after { width: 16px; height: 16px; top: 4px; left: 4px; transition: transform 160ms; }
.unified-shell .v4-toggle-row input[type=checkbox]:checked { background: var(--org-accent); }
.unified-shell .v4-toggle-row input[type=checkbox]:checked::after { transform: translateX(16px); }
.unified-shell .v4-toggle-row input[type=checkbox]:focus-visible { outline: 2px solid var(--org-accent); outline-offset: 3px; }
@media(max-width:700px) { .unified-shell .v4-toggle-row b { font-size: 16px; } .unified-shell .v4-toggle-row small { font-size: 15px; } }
@media(prefers-reduced-motion:reduce) { .unified-shell .v4-toggle-row input[type=checkbox]::after { transition: none; } }

/* Shared responsive toolbar; business panels retain their own layout. */
.unified-shell .lead-legacy-toolbar { display:flex; position:sticky; top:0; z-index:45; min-height:64px; height:auto; padding:8px 24px; gap:16px; border:0; border-bottom:1px solid var(--org-border); background:#fff; box-shadow:none; backdrop-filter:none; }
.lead-legacy-toolbar .lead-toolbar-heading { display:flex; align-items:center; gap:8px; min-width:0; flex:1; }
.lead-legacy-toolbar .v4-shell-title { min-width:0; gap:2px; }
.lead-legacy-toolbar .v4-shell-title > span { font-size:13px; line-height:1.6; font-weight:500; color:var(--org-muted); }
.lead-legacy-toolbar .v4-shell-title > strong { font-size:20px; line-height:1.6; font-weight:600; white-space:normal; overflow-wrap:anywhere; color:var(--org-text); }
.lead-legacy-toolbar .shell-toolbar-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex:none; min-width:0; }
.lead-legacy-toolbar :is(.icon-button,.shell-help,.topbar-search,.global-ai-trigger) { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-width:48px; min-height:48px; width:auto; height:auto; margin:0; padding:10px 12px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--org-text); box-shadow:none; font-size:14px; font-weight:500; line-height:1.6; cursor:pointer; }
.lead-legacy-toolbar :is(.icon-button,.shell-help,.topbar-search):hover { background:var(--org-subtle); }
.lead-legacy-toolbar .icon { width:20px; height:20px; flex:none; }
.lead-legacy-toolbar .topbar-search { border-color:var(--org-border); color:var(--org-muted); }
.lead-legacy-toolbar .topbar-search kbd { padding:2px 5px; border:1px solid var(--org-border); border-radius:4px; background:#fff; color:var(--org-muted); font-size:12px; }
.lead-legacy-toolbar .global-ai-trigger { background:var(--org-accent); border-color:var(--org-accent); color:#fff; }
.lead-legacy-toolbar .global-ai-trigger:hover { filter:brightness(.94); }
.lead-legacy-toolbar .lead-toolbar-menu { display:none; }
.lead-legacy-toolbar :focus-visible { outline:2px solid var(--org-accent); outline-offset:2px; }
@media(max-width:1280px) { .lead-legacy-toolbar .topbar-search :is(span,kbd),.lead-legacy-toolbar .shell-help span { display:none; } .lead-legacy-toolbar .topbar-search { border-color:transparent; } }
@media(max-width:1024px) { .unified-shell .lead-legacy-toolbar { padding-inline:16px; } .lead-legacy-toolbar .lead-toolbar-menu { display:inline-flex; } }
@media(max-width:700px) {
 .unified-shell .lead-legacy-toolbar { flex-wrap:wrap; gap:4px; padding:8px 12px; }
 .lead-legacy-toolbar .lead-toolbar-heading { flex-basis:100%; }
 .lead-legacy-toolbar .v4-shell-title > strong { font-size:18px; }
 .lead-legacy-toolbar .v4-shell-title > span { display:none; }
 .lead-legacy-toolbar .shell-toolbar-actions { flex:1; justify-content:space-between; flex-wrap:nowrap; }
 .lead-legacy-toolbar .global-ai-trigger span { display:inline; }
 .lead-legacy-toolbar :is(.topbar-search,.global-ai-trigger) { font-size:13px; }
}
@media(max-width:360px) { .lead-legacy-toolbar .global-ai-trigger span { display:none; } }
