/* Athos Gran: opaque working surfaces; stone only in decorative areas. */
html[data-theme=dark],html[data-theme=dark] body:not(.profiles-entry){--canvas:#f2f3ef;--surface:#fff;--ink:#202d26;--muted:#536158;--border:#d4dbd5;--forest:#173f34;--green:#205544;--lime:#e6eee7;--orange:#865115;--op-raised:#edf1ec;--op-text:#202d26;--op-muted:#536158;--text-primary:#202d26;--text-secondary:#536158;color-scheme:light}
html[data-theme=dark] body:not(.profiles-entry){background:#f2f3ef;background-image:none;background-blend-mode:normal;color:var(--text-primary)}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace,.workspace main){background:transparent;color:var(--text-primary);min-width:0}

/* Nero Marquina stays behind the logo, away from navigation labels. */
html[data-theme=dark] body .sidebar{background:#151d19;color:#e2e9e3;border-right:1px solid #35443a;box-shadow:none}
html[data-theme=dark] body .sidebar .brand.athos-brand{background:linear-gradient(#10171455,#10171455),url('/nero-marquina-detail.png') center/cover;border-radius:10px}
html[data-theme=dark] body .sidebar .nav-item{color:#d4dfd6;box-shadow:none}
html[data-theme=dark] body .sidebar .nav-item:hover{background:#26382c;color:#fff}
html[data-theme=dark] body .sidebar .nav-item.active{background:#e4eee5;color:#173f34;box-shadow:inset 3px 0 #9db6a3}
html[data-theme=dark] body .sidebar :is(.nav-label,.sidebar-signature span){color:#b2c0b5}
html[data-theme=dark] body .sidebar :is(.sidebar-signature strong,.sidebar-bottom strong){color:#e0e7df}
html[data-theme=dark] body .sidebar :is(.sidebar-bottom small,.signout){color:#bdccc0}
html[data-theme=dark] body .sidebar-note{background:#202e25;border-color:#405044}
html[data-theme=dark] body .sidebar-note :is(strong,p){color:#d1ded2}
html[data-theme=dark] body .topbar{background:#fff;border-color:var(--border);backdrop-filter:none}
html[data-theme=dark] body .topbar :is(a,span,strong,.icon-button){color:#3e5045}
html[data-theme=dark] body .current-user-avatar{background:#e4ede5;color:#244c38}
html[data-theme=dark] body :is(.shared-badge,.live-badge,.top-avatar){background:#edf2eb;color:#345740;border-color:#c5d5c7}
html[data-theme=dark] body :is(.shared-badge,.live-badge) i{background:#2b634a}
html[data-theme=dark] body .public-visit-label{background:#e8eee7;color:#314b3b;border-color:#cbd7cc}
html[data-theme=dark] body .public-visit-label :is(a,span){color:#314b3b}

/* Reset legacy dark-theme typography within the light workspace and dialogs. */
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog){color:var(--text-primary)}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :where(*){color:var(--text-secondary)}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(h1,h2,h3,h4,h5,h6,strong,b,th,legend){color:var(--text-primary)}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.eyebrow,.heading-dot,.section-icon,.mini-icon,.metric-icon){color:#38604b}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.section-icon,.mini-icon,.metric-icon){background:#edf2eb}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.subtitle,.quiet-label,.page-footer,.context-line,.subtle,.field-help,.required-note,.modal-footnote,.op-help){color:#536158}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.customer-name,.client-name,.deal-amount,.kpi-value,.stat-value,.table-value,.material-quantity,.op-title,.event-title){color:#202d26}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.text-button,.text-link,.quiet-link,.back-link,.expand-body,.deal-open,.deal-move,.profile-edit,.load-more,.member-button,.panel-bottom-link,.subtle-link){color:#205544}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) a:hover{color:#163e2f;text-decoration-color:currentColor}

/* All working cards are opaque, including previously dark nested components. */
html[data-theme=dark] body:not(.profiles-entry) :is(.card,.customer-panel,.management-card,.management-kpi,.pipeline-stat,.pipeline-workspace,.op-board,.op-metrics,.op-metric,.metric,.kpi,.home-metric,.premium-panel,.profile-card,.access-card,.material-list,.conversation-list,.conversation-detail,.timeline-card,.contact-card,.relationship-card,.assistant-main,.client-panel,.result-panel,.context-card,.draft-card,.assistant-welcome,.conversion-panel,.preview-card,.help-card){background:#fff;background-image:none;color:#202d26;border-color:#d4dbd5;box-shadow:0 3px 14px #172d2110}
html[data-theme=dark] body:not(.profiles-entry) :is(.card,.management-kpi,.pipeline-stat,.home-metric):hover{border-color:#a7b8aa}
html[data-theme=dark] body:not(.profiles-entry) :is(.home-metric.marble,.management-kpi:first-child,.op-metric:first-child,.profile-hero,.marble){background:#eef3eb;background-image:none;color:#202d26;border-color:#c4d3c5}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.home-metric,.management-kpi,.op-metric,.profile-hero,.preview-card) :where(span,strong,p,small,h2){color:var(--text-primary)}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.home-metric,.management-kpi,.op-metric,.profile-hero,.preview-card) :where(small,p){color:var(--text-secondary)}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.preview-avatar,.hero-avatar,.mini-avatar,.selected-avatar,.member-avatar,.owner-avatar,.profile-avatar,.event-icon,.chat-avatar,.author-dot){background:#e6eee6;color:#294f3a;border-color:#cad8cb}
html[data-theme=dark] body:not(.profiles-entry) :is(.profile-card,.access-card,.material-list,.premium-panel) :is(header,footer,.profile-edit,.profile-managed){border-color:#d4dbd5}

/* Slim stone details: no photograph or veining behind text or form fields. */
html[data-theme=dark] body:not(.profiles-entry) :is(.overview,.home-heading,.op-heading){position:relative;padding:28px 24px 24px;overflow:hidden;background:#fff;border:1px solid #d4dbd5;border-radius:12px;gap:20px}
html[data-theme=dark] body:not(.profiles-entry) :is(.overview,.home-heading,.op-heading)::before{content:'';position:absolute;inset:0 0 auto;height:7px;background:#d7c9b2 url('/patagonia-detail.png') center 48%/cover;pointer-events:none}
html[data-theme=dark] body.pipeline-page .overview::before{background:#173f34 url('/verde-guatemala.jpg') center/cover}
html[data-theme=dark] body.production-page :is(.overview,.op-heading)::before{background:#171a18 url('/nero-marquina-detail.png') center/cover}
html[data-theme=dark] body:not(.profiles-entry) .overview :is(h1,.subtitle,.eyebrow){color:var(--text-primary)}
html[data-theme=dark] body:not(.profiles-entry) .overview :is(.subtitle,.eyebrow){color:var(--text-secondary)}

/* Fields, controls and dialogs use the same contrast rules as the workspace. */
html[data-theme=dark] body:not(.profiles-entry) :is(input,select,textarea){background-color:#fff;color:#202d26;border-color:#84948a;color-scheme:light;accent-color:#205544}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(input,select,textarea){background-color:#fff;color:#202d26;border-color:#84948a}
html[data-theme=dark] body:not(.profiles-entry) :is(input,textarea)::placeholder{color:#5c6c61;opacity:1}
html[data-theme=dark] body:not(.profiles-entry) :is(.search-control,.pipeline-search,.type-option,.view-switch,.chart-switch,.form-actions,.modal-header,.modal-actions,.dialog-footer,.op-dialog-actions,.directory-tools select,.board-filters select){background:#f0f3ee;color:#3c4e41;border-color:#c5d1c7}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.field>span,.field label,label,summary,.type-option strong){color:#31483a}
html[data-theme=dark] body:not(.profiles-entry) :is(.type-option:has(input:checked),.filter-chip.active,.view-switch button.selected,.chart-switch button.selected,.alert-chip.active){background:#e0ecdf;border-color:#6d8b73;color:#1d4a32}
html[data-theme=dark] body:not(.profiles-entry) .radio-indicator{background:#fff;border-color:#6d8b73}
html[data-theme=dark] body:not(.profiles-entry) .type-option input:checked~.radio-indicator{background:#205544;border-color:#205544}
html[data-theme=dark] body:not(.profiles-entry) dialog{background:#fff;color:#202d26;border-color:#a5b6aa;box-shadow:0 24px 80px #14291f40}
html[data-theme=dark] body:not(.profiles-entry) dialog::backdrop{background:#16271dd9;backdrop-filter:blur(3px)}
html[data-theme=dark] body:not(.profiles-entry) :is(.photo-close,.op-close,.dialog-close,.icon-button){color:#3d5545}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.primary-button,.op-primary,.premium-primary,.profile-dark-button){--text-primary:#fff;--text-secondary:#fff;background:#205544;color:#fff;border-color:#205544;box-shadow:none}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.primary-button,.op-primary,.premium-primary,.profile-dark-button):hover{background:#173f34;color:#fff;border-color:#173f34}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.primary-button,.op-primary,.premium-primary,.profile-dark-button) :where(span,strong,small,svg){color:inherit}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.secondary-button,.op-secondary,.photo-file-label){background:#fff;color:#205544;border-color:#798d7e;box-shadow:none}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.secondary-button,.op-secondary,.photo-file-label):hover{background:#edf3ec;color:#173f34;border-color:#62816a}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.secondary-button,.op-secondary,.photo-file-label) :where(span,svg){color:inherit}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) button:disabled{background-color:#e5ebe5;color:#526356;border-color:#becbbf;opacity:1;cursor:not-allowed}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) button:disabled :where(span,svg){color:inherit}
html[data-theme=dark] body :is(a,button,input,select,textarea,canvas,summary):focus-visible{outline:2px solid #205544!important;outline-offset:4px}
html[data-theme=dark] body .sidebar :is(a,button):focus-visible{outline-color:#e3cd97!important}

/* Tables, Kanban cards, conversation history and empty states. */
html[data-theme=dark] body:not(.profiles-entry) :is(th,.customer-table th,.management-table th,.board-toolbar,.board-footer,.conversation-list-header,.conversation-detail-header,.chat-heading,.day-heading span){background:#f0f3ee;color:#44564a;border-color:#ccd6cd}
html[data-theme=dark] body:not(.profiles-entry) :is(td,.customer-table td,.management-table td,.card-heading,.directory-heading,.form-heading,.management-card-heading,.premium-panel-heading,.op-footer,.home-chart-caption){border-color:#d8dfd8}
html[data-theme=dark] body:not(.profiles-entry) :is(.stage-column,.op-column,.op-detail-stage,.op-advisor-status,.op-advisor-suggestions article){background:#edf1ec;color:#202d26;border-color:#cbd6cc;box-shadow:none}
html[data-theme=dark] body:not(.profiles-entry) :is(.deal-card,.op-card,.stage-empty,.chat-message,.chat-message:nth-child(even),.signal-card,.source-detail){background:#fff;color:#202d26;border-color:#c4d1c7;box-shadow:0 2px 6px #172d2108}
html[data-theme=dark] body:not(.profiles-entry) :is(.deal-card,.op-card):hover{border-color:#749680;box-shadow:0 3px 10px #172d2112}
html[data-theme=dark] body.pipeline-page .stage-title-line h2{background:#fff;color:#263f30;border:1px solid #c1cec4;border-left:4px solid var(--stage-color);padding:5px 8px}
html[data-theme=dark] body.pipeline-page .stage-counter{background:transparent;color:#445a4b}
html[data-theme=dark] body.pipeline-page .stage-summary{background:#e3eae2;color:#3d5244;border-color:#cbd6cc}
html[data-theme=dark] body:not(.profiles-entry) :is(.stage-column.drop-target,.op-column.drop-target){background:#deebdd;outline-color:#457e5a}
html[data-theme=dark] body:not(.profiles-entry) :is(.kanban,.op-kanban){scrollbar-color:#819a87 #edf1ec}
html[data-theme=dark] body:not(.profiles-entry) :is(.client-row,.conversation-row){background:#fff;color:#202d26;border-color:#d8e0d9}
html[data-theme=dark] body:not(.profiles-entry) :is(.client-row:hover,.client-row.selected,.conversation-row:hover,.conversation-row.selected,.picker-client:hover,.home-activity:hover,.alert-row:hover){background:#eaf2e7;color:#202d26;border-color:#9fb8a2}
html[data-theme=dark] body:not(.profiles-entry) :is(.empty-state,.premium-empty,.material-empty,.op-empty,.stage-empty,.conversation-empty,.list-empty,.no-analysis){color:#536158}
html[data-theme=dark] body:not(.profiles-entry) :is(.empty-state,.premium-empty,.no-analysis) strong{color:#202d26}
html[data-theme=dark] body:not(.profiles-entry) :is(.timeline-entry::before,.day-heading::after,.preview-divider,.progress-track){background:#cad7cb}
html[data-theme=dark] body:not(.profiles-entry) :is(.timeline-entry,.event-result,.op-history li,.home-activity,.home-alert,.alert-row,.conversation-pagination,.messages-toolbar,.result-tabs){border-color:#d5dfd6}

/* Semantic statuses retain color, paired with readable text and opaque fills. */
html[data-theme=dark] body:not(.profiles-entry) :is(.connection-banner,.assistant-banner,.customer-hero,.setup-notice,.setup-security,.setup-note,.setup-number,.connection-tag,.mode-pill,.quiet-badge,.event-type,.customer-type,.filter-chip,.alert-chip,.source-button,.panel-tip,.metric-explanation,.pipeline-note,.banner,.message,.legacy-note,.goal-status,.allocation-preview,.goal-form-help,.team-goal-field,.access-notice,.access-option,.photo-file-label,.op-advisor-label,.tab-count,.signal-tag,.draft-heading span,.forecast-total .estimate-tag){background:#edf3eb;color:#345740;border-color:#c7d6c8;box-shadow:none}
html[data-theme=dark] body:not(.profiles-entry) :is(.assistant-mark,.connection-mark,.welcome-symbol,.empty-orbit,.home-alert>span,.trend,.notice-icon){background:#e5eee3;color:#28573c;border-color:#cad9ca;box-shadow:none}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.profile-success,.success-message,.setup-number.ready,.row-status,.chat-customer){--text-secondary:#225a3b;--text-primary:#19492f;background:#e4f0e5;color:#225a3b;border-color:#b5ceb7}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.goal-status.behind,.month-alert,.gaps,.row-status.pending,.reason-tags span,.link-warning,.op-priority,.trend.negative,.deal-date.overdue,.material-alerts,.notice.amber .notice-icon){--text-primary:#734817;--text-secondary:#734817;background:#fcf1dd;color:#734817;border-color:#d4b986}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.op-late,.is-project-late,.field-error,.field small[id$="-error"]){color:#942e2b}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.message.error,.banner.error,.op-message.error,.premium-error,.material-message.error,.access-status.error,#request-error,.profile-error){--text-primary:#8c2927;--text-secondary:#8c2927;background:#fff0ed;color:#8c2927;border-color:#d5978d}
html[data-theme=dark] body:not(.profiles-entry) :is(input,textarea,select)[aria-invalid=true]{background:#fff4f1;border-color:#ad4f43;color:#642723}
html[data-theme=dark] body:not(.profiles-entry) :is(.access-status,.material-message,.material-notice,.material-details,.material-notes,.access-version,.material-meta,.photo-hint,.crop-zoom-label){color:#536158}
html[data-theme=dark] body:not(.profiles-entry) .result-tabs button[aria-selected=true]{color:#205544;border-color:#205544}

/* SVG charts need their own readable labels and strokes. */
html[data-theme=dark] body:not(.profiles-entry) :is(.axis,.chart-label,.home-chart text){fill:#536158}
html[data-theme=dark] body:not(.profiles-entry) .chart-gridline{stroke:#d5dfd6}
html[data-theme=dark] body:not(.profiles-entry) :is(.chart-line,.ring-value){stroke:#205544}
html[data-theme=dark] body:not(.profiles-entry) .chart-goal{stroke:#85602e}
html[data-theme=dark] body:not(.profiles-entry) .chart-point{fill:#205544;stroke:#fff}
html[data-theme=dark] body:not(.profiles-entry) :is(.premium-track,.team-progress,.stage-track,.forecast-split){background:#e2eae0}
html[data-theme=dark] body:not(.profiles-entry) :is(.premium-track i,.team-progress i,.stage-track i,.forecast-split .actual,.actual-dot){background:#2d644a}
html[data-theme=dark] body:not(.profiles-entry) :is(.forecast-split .weighted,.target-dot){background:#98743e}
html[data-theme=dark] body:not(.profiles-entry) .conversion-track{background:#edf1ec}
html[data-theme=dark] body:not(.profiles-entry) .conversion-fill{background:#c7dac4;opacity:1}
html[data-theme=dark] body:not(.profiles-entry) .conversion-track>span{color:#253d2b}
html[data-theme=dark] body:not(.profiles-entry) .management-goal-ring .ring-base{stroke:#dce5da}
html[data-theme=dark] body:not(.profiles-entry) :is(.toast,.op-toast,.pipeline-toast,.client-toast,.chart-tooltip){--text-primary:#fff;--text-secondary:#e2ece4;background:#173f34;color:#fff;border-color:#173f34}
html[data-theme=dark] body:not(.profiles-entry) :is(.toast,.op-toast,.pipeline-toast,.client-toast,.chart-tooltip) :where(span,strong,small,p){color:inherit}
/* Small supporting text and transient controls must remain legible as well. */
html[data-theme=dark] body:not(.profiles-entry) .quiet-label{color:#536158!important}
html[data-theme=dark] body:not(.profiles-entry) :is(.premium-arrow:hover,.icon-button:hover,.stage-counter){background:#e6eee5;color:#205544}
html[data-theme=dark] body:not(.profiles-entry) .notification-popover{--text-primary:#202d26;--text-secondary:#536158;background:#fff;color:#202d26;border-color:#c4d1c7;box-shadow:0 12px 36px #172d2126}
html[data-theme=dark] body:not(.profiles-entry) .notification-popover :where(*){color:var(--text-secondary)}
html[data-theme=dark] body:not(.profiles-entry) .notification-popover :is(h2,h3,strong,.notice-title){color:#202d26}
html[data-theme=dark] body:not(.profiles-entry) :is(.notice.blue .notice-icon,.status-prop){background:#edf1f8;color:#344c73}
html[data-theme=dark] body:not(.profiles-entry) :is(.notice.green .notice-icon,.status-orc,.count-badge){background:#e4f0e5;color:#225a3b}
html[data-theme=dark] body:not(.profiles-entry) :is(.alert-symbol,.count-badge.amber,.status-neg){background:#fcf1dd;color:#734817}
html[data-theme=dark] body:not(.profiles-entry) .status-new{background:#edf1ec;color:#44564a}
html[data-theme=dark] body:not(.profiles-entry) :is(.workspace main,dialog) :is(.op-primary,.op-secondary):hover{filter:none}
html[data-theme=dark] body:not(.profiles-entry) :is(.op-stage-shortcuts span,.op-board[aria-busy=true]){opacity:1}
.material-nav-badge{margin-left:auto;min-width:22px;padding:2px 6px;border-radius:10px;background:#e1c58e;color:#30250e;font-size:11px;font-weight:700;text-align:center}
.sidebar .nav-item.active .material-nav-badge{background:#234c37;color:#fff}
html body [hidden]{display:none!important}
.crop-avatar{width:220px!important;height:220px!important;overflow:hidden;border-radius:50%}.crop-avatar canvas{display:block;width:220px;height:220px;touch-action:none;cursor:grab}.crop-avatar canvas:active{cursor:grabbing}.photo-zoom-label{display:grid;gap:10px;margin:18px 0;color:#405447;font-size:14px}.photo-zoom-label input{width:100%}
@media(max-width:760px){html[data-theme=dark] body:not(.profiles-entry) :is(.overview,.home-heading,.op-heading){padding:24px 18px 20px;border-radius:10px}html[data-theme=dark] body .sidebar .brand.athos-brand{background:none}html[data-theme=dark] body .public-visit-label{font-size:12px;line-height:1.65}}
