/* Dashboard presentation refinements approved in the October Figma review.
   Existing HTML IDs, handlers, fetch requests, data and permissions stay intact. */
body.yma-dashboard-ui {
  --card-radius: 16px;
  --card-shadow: none;
  --card-shadow-lift: 0 4px 16px rgb(0 0 0 / 5%);
  --yma-rail-width: 96px;
  --yma-rail-toggle: #85a7ff;
  --yma-selection-bg: var(--yma-blue);
  --yma-selection-ink: #1a1a1a;
  --yma-selection-border: var(--yma-blue);
  --yma-selection-mark-ink: #fff;
  font-size: 14px;
  background: var(--yma-paper);
  line-height: 1.45;
}
body.yma-dashboard-ui.workspace-rail-unrolled { --yma-rail-width: 224px; }
body.yma-dashboard-ui.has-workspace-rail { padding-left: var(--yma-rail-width); }
.yma-dashboard-ui :is(main, section, article, header, aside, form, div) { min-width: 0; }
.yma-dashboard-ui :is(.hero, .finance-hero, .soe-hero, .personal-hero, .utm-hero, .bd-hero, .sales-qa-hero) {
  background: var(--yma-paper);
  box-shadow: none;
  border: 0;
  min-height: 0;
  overflow: visible;
}
.yma-dashboard-ui .hero::before,
.yma-dashboard-ui .finance-hero::before,
.yma-dashboard-ui .soe-hero::before,
.yma-dashboard-ui .hero-copy::after,
.yma-dashboard-ui :is(.hero-gradient, .personal-hero-glow) { display: none; }
.yma-dashboard-ui :is(.hero, .personal-hero) { padding: 32px 0 24px; }
.yma-dashboard-ui :is(.finance-hero, .soe-hero, .utm-hero, .bd-hero, .sales-qa-hero) { padding: 32px 32px 24px; }
.yma-dashboard-ui :is(.hero-inner, .section, .personal-wrap) { width: calc(100% - 64px); max-width: none; margin-inline: auto; }
.yma-dashboard-ui :is(.hero-inner, .hero-copy, .personal-hero-copy, .layer-hero-copy) { padding: 0; margin: 0; }
.yma-dashboard-ui .hero-inner { margin-inline: auto; }
.yma-dashboard-ui :is(.hero-copy h1, .personal-hero-copy h1, .finance-hero h1, .soe-hero h1, .layer-hero-copy h1, .utm-hero-copy h1, .bd-hero h1, .sales-qa-hero-copy h1) {
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  max-width: none;
}
.yma-dashboard-ui :is(.hero-subtitle, .personal-hero-copy > div > p:last-child, .finance-hero > p, .layer-hero-copy p:not(.eyebrow), .utm-hero-copy > p:last-child, .bd-hero p, .sales-qa-hero-copy p) { font-size: 14px; line-height: 1.5; margin: 0; color: var(--yma-ink-muted); }
.yma-dashboard-ui :is(.hero-copy, .personal-hero-copy, .utm-hero-copy) > .eyebrow,
.yma-dashboard-ui .personal-hero-copy > div > .eyebrow { display: none; }
.yma-dashboard-ui :is(h2, .utm-card-heading h2, .section-heading h2, .layer-crm-cockpit-head h2) {
  font-family: var(--font-body, Geist, sans-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
body.yma-dashboard-ui.has-workspace-rail :is(.hero-topbar, .finance-topbar, .soe-topbar, .utm-hero-top, .personal-topbar) { display: none; }
.yma-dashboard-ui :is(.hero-topbar, .finance-topbar, .soe-topbar, .utm-hero-top, .personal-topbar) { margin-bottom: 24px; }
.yma-dashboard-ui :is(.card, .finance-card, .utm-card, .layer-crm-action-panel, .layer-crm-task-panel, .layer-crm-pipeline-health, .layer-crm-prospect-upload, .layer-crm-company-dedup, .layer-crm-activity-report) { border-radius: 16px; box-shadow: none; border: 1px solid var(--yma-line); background: var(--card); }
.yma-dashboard-ui :is(.finance-card, .utm-card, .personal-panel, .personal-priority) { padding: 20px; }
.yma-dashboard-ui :is(.primary-btn, .ghost-btn, .marketing-view-tab, .layer-scope-toggle button, .analytics-period-toggle button, .period-chip, .personal-refresh) { min-height: 40px; padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; line-height: 20px; }
.yma-dashboard-ui :is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid #879be8; outline-offset: 3px; }
.yma-dashboard-ui :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select) { min-height: 44px; border-radius: 12px; font-size: 14px; }
.yma-dashboard-ui :is(input[type=checkbox], input[type=radio]) { flex-shrink: 0; }
.yma-dashboard-ui button:disabled { opacity: .5; cursor: not-allowed; }

/* Action controls follow the existing Yma pill design. Navigation, scope
   switches, table sorters and the approved CRM profile keep their own styles. */
body.yma-dashboard-ui {
  --yma-action-height: 40px;
  --yma-row-action-height: 36px;
  --yma-action-danger: #b91c1c;
}
html[data-theme=dark] body.yma-dashboard-ui { --yma-action-danger: #fca5a5; }
.yma-dashboard-ui :is(
  .primary-btn, .ghost-btn, .secondary-btn, .danger-btn, .personal-refresh,
  .payroll-row-btn, .scorecard-more, .scorecard-detail-close,
  .scorecard-delete-column, .scorecard-delete-task, .bd-open-profile,
  .sales-learn-reset, .row-actions button, .budget-month-pill button,
  .finance-card button:not(.period-btn, .report-group-field, .report-analyser-text-btn,
    .report-merchant-chip, .report-merchant-result, .payroll-name-link),
  .status-modal-actions button
):where(:not(.workspace-rail button, .layer-profile-panel button, .yma-select-menu button)) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--yma-action-height);
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--yma-line);
  border-radius: 999px;
  background: var(--card);
  color: var(--black);
  font: 500 13px/18px var(--font-body, Geist, sans-serif);
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  box-shadow: none;
  transform: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.yma-dashboard-ui :is(.primary-btn, #budgetSaveBtn, #payrollSaveBtn,
  #reportAnalyserRunBtn, #catUpsertBtn, #authModalSubmitBtn, .deel-attr-save,
  .pr-plan-save-btn):where(:not(.workspace-rail button, .layer-profile-panel button)) {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.yma-dashboard-ui :where(.danger-btn, #budgetDeleteMonthBtn,
  .budget-month-pill [data-act=delete], .payroll-delete-btn, .payroll-manual-del-btn,
  .pr-plan-delete-draft-btn, .pr-manual-delete-btn, .scorecard-delete-column,
  .scorecard-delete-task, .row-actions .danger) {
  color: var(--yma-action-danger) !important;
  background: var(--card) !important;
  border-color: var(--yma-action-danger);
}
.yma-dashboard-ui :is(.primary-btn, .ghost-btn, .personal-refresh,
  .payroll-row-btn, .scorecard-more, .scorecard-detail-close, .bd-open-profile,
  .sales-learn-reset, .row-actions button, .budget-month-pill button,
  .finance-card button, .status-modal-actions button):hover {
  transform: none;
  box-shadow: none;
}
.yma-dashboard-ui :is(.ghost-btn, .personal-refresh, .scorecard-more,
  .scorecard-detail-close, .bd-open-profile, .sales-learn-reset,
  .budget-month-pill button, .row-actions button):hover:enabled {
  background: var(--gray-100);
}
.yma-dashboard-ui :is(.payroll-row-btn, .scorecard-more, .scorecard-detail-close,
  .scorecard-delete-column, .bd-open-profile, .sales-learn-reset,
  .budget-month-pill button, .row-actions button, .ledger-delete-btn) {
  --yma-action-height: var(--yma-row-action-height);
  padding: 6px 10px;
}
.yma-dashboard-ui :is(.primary-btn, .ghost-btn, .secondary-btn, .danger-btn,
  .personal-refresh, .payroll-row-btn, .row-actions button,
  .budget-month-pill button, .finance-card button, .status-modal-actions button):disabled:not(.is-action-busy, .is-action-success) {
  opacity: 1;
  background: var(--gray-100) !important;
  color: var(--yma-ink-muted) !important;
  border-color: var(--yma-line);
  cursor: not-allowed;
}
.yma-dashboard-ui :is(.payroll-head-actions, .status-modal-actions, .payroll-report-controls) {
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
}
.yma-dashboard-ui .finance-card { container: finance-panel / inline-size; }
.yma-dashboard-ui #budgetView .payroll-head { flex-direction: column; align-items: stretch; gap: 12px; }
.yma-dashboard-ui #budgetView .payroll-head h2 { margin: 0; }
.yma-dashboard-ui #budgetView .payroll-head-actions > button { flex: 0 0 auto; }
.yma-dashboard-ui .budget-month-label { flex: 0 0 140px; font-size: 11px; line-height: 16px; white-space: nowrap; }
.yma-dashboard-ui #budgetMonthSelect { width: 100%; min-width: 0; padding-left: 12px; }
.yma-dashboard-ui .budget-month-pill { gap: 8px; padding: 4px 8px; }
.yma-dashboard-ui .layer-task-create {
  width: var(--yma-row-action-height);
  height: var(--yma-row-action-height);
  min-width: var(--yma-row-action-height);
  min-height: var(--yma-row-action-height);
  padding: 0;
  border: 1px solid var(--yma-line);
  background: var(--card);
  color: var(--black);
  box-shadow: none;
}
.yma-dashboard-ui .bd-scope-toggle > button {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  box-shadow: none;
}
.yma-dashboard-ui .bd-sort-heading { min-height: 36px; }
@container finance-panel (max-width: 420px) {
  .yma-dashboard-ui #budgetView .payroll-head-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    width: 100%;
  }
  .yma-dashboard-ui #budgetView .payroll-head-actions > button {
    min-width: 0;
    width: 100%;
    min-height: 54px;
    padding: 8px;
  }
  .yma-dashboard-ui #budgetView :is(#budgetPrevBtn, #budgetNextBtn) { min-height: 44px; }
  .yma-dashboard-ui #budgetPrevBtn { grid-column: 1; grid-row: 1; }
  .yma-dashboard-ui .budget-month-label { grid-column: 2 / span 2; grid-row: 1; }
  .yma-dashboard-ui #budgetNextBtn { grid-column: 4; grid-row: 1; }
  .yma-dashboard-ui #budgetNewMonthBtn { grid-column: 1 / span 2; grid-row: 2; }
  .yma-dashboard-ui #budgetDeleteMonthBtn { grid-column: 3 / span 2; grid-row: 2; }
  .yma-dashboard-ui #budgetCopyNextBtn { grid-column: 1 / span 2; grid-row: 3; }
  .yma-dashboard-ui #budgetSaveBtn { grid-column: 3 / span 2; grid-row: 3; }
}
@container finance-panel (min-width: 360px) and (max-width: 420px) {
  .yma-dashboard-ui #budgetView .payroll-head-actions > button { min-height: 44px; }
}
@media (max-width: 760px) {
  body.yma-dashboard-ui { --yma-action-height: 44px; --yma-row-action-height: 44px; }
  .yma-dashboard-ui :is(.bd-scope-toggle > button, .bd-sort-heading,
    .period-btn, .marketing-view-tab, .layer-scope-toggle button,
    .analytics-period-toggle button, .period-chip) { min-height: 44px; }
}

/* Shared rail: use its existing state, labels, icons and UI handlers. */
.yma-dashboard-ui .workspace-rail { width: var(--yma-rail-width); box-sizing: border-box; padding: 16px 12px; box-shadow: none; gap: 12px; }
.yma-dashboard-ui.workspace-rail-unrolled .workspace-rail { padding: 16px; }
.yma-dashboard-ui .workspace-rail-brand { min-height: 64px; padding-right: 0; }
.yma-dashboard-ui .workspace-rail-logo { width: 52px; }
.yma-dashboard-ui.workspace-rail-unrolled .workspace-rail-logo { width: 84px; }
.yma-dashboard-ui .workspace-rail-role { margin-top: 8px; font-size: 12px; }
.yma-dashboard-ui .workspace-rail-toggle {
  position: absolute; top: 50%; right: -26px; width: 34px; height: 150px;
  min-height: 0; margin: 0; padding: 4px; border: 0; border-radius: 999px;
  background: var(--yma-rail-toggle); color: #17191c;
  font-size: 10px; font-weight: 800; letter-spacing: .18em; line-height: 1.45;
  writing-mode: vertical-rl; text-orientation: upright; transform: translateY(-50%);
  box-shadow: 0 14px 30px rgb(54 92 210 / .2);
}
.yma-dashboard-ui .workspace-rail-toggle:hover { background: #9bb7ff; transform: translateY(-50%); }
.yma-dashboard-ui .workspace-rail-toggle::after { content: none; }
.yma-dashboard-ui:not(.workspace-rail-unrolled) .workspace-rail-brand { min-height: 64px; padding-right: 0; }
.yma-dashboard-ui .workspace-rail-list { padding: 4px 0; gap: 4px; }
.yma-dashboard-ui .workspace-rail-item { min-height: 56px; padding: 7px 4px; border-radius: 12px; border-color: transparent; }
.yma-dashboard-ui.workspace-rail-unrolled .workspace-rail-item { min-height: 44px; padding: 10px 12px; gap: 12px; }
.yma-dashboard-ui .workspace-rail-label { font-size: 14px; font-weight: 500; }
.yma-dashboard-ui .workspace-rail-mini { font-size: 10px; }
.yma-dashboard-ui .workspace-rail-submenu { gap: 4px; margin: 0; }
.yma-dashboard-ui .workspace-rail-subitem { padding: 7px 12px; min-height: 32px; border-radius: 12px; border-color: transparent; }
.yma-dashboard-ui .workspace-rail-subitem-label { font-size: 12px; line-height: 18px; }
body.yma-dashboard-ui .workspace-rail .workspace-rail-subitem-active { background: var(--workspace-rail-active); color: var(--workspace-rail-active-ink); border-color: var(--workspace-rail-active); }
.yma-dashboard-ui .workspace-rail-theme { margin-top: auto; padding-top: 4px; }
.yma-dashboard-ui .workspace-rail-session { margin: 0; }
.yma-dashboard-ui .workspace-rail-logout { min-height: 40px; margin: 0; }
body.yma-dashboard-ui.has-workspace-rail :is(.workspace-startup-loading-overlay, .workspace-data-loading-overlay, .layer-view-loading-overlay) { left: var(--yma-rail-width); }

/* Main launch cards preserve their destinations and role visibility. */
.yma-dashboard-ui .main-launch-hub { margin-top: 24px; }
.yma-dashboard-ui .main-launch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; }
.yma-dashboard-ui .main-launch-card { min-height: 172px; padding: 20px; border: 0; box-shadow: none; }
.yma-dashboard-ui .main-launch-card h3 { font: 600 20px/28px Geist, sans-serif; letter-spacing: -.01em; margin: 0 0 8px; }
.yma-dashboard-ui .main-launch-card p { max-width: none; margin: 0 0 8px; color: var(--yma-ink-muted); font-size: 14px; line-height: 20px; }
.yma-dashboard-ui .main-launch-action { display: inline; padding: 0; border: 0; background: none; box-shadow: none; font-size: 14px; font-weight: 500; }
.yma-dashboard-ui .main-launch-action::after { content: ' →'; }
.yma-dashboard-ui .main-launch-icon { display: none; }
.yma-dashboard-ui .main-launch-card[data-menu-key=personal], .yma-dashboard-ui .main-launch-card[data-menu-key=admin] { background: var(--yma-blue); }
.yma-dashboard-ui .main-launch-card[data-menu-key=finance], .yma-dashboard-ui .main-launch-card[data-menu-key=operating-map] { background: var(--yma-mint); }
.yma-dashboard-ui .main-launch-card[data-menu-key=layer-analytics], .yma-dashboard-ui .main-launch-card[data-menu-key=marketing] { background: var(--yma-lilac); }
.yma-dashboard-ui .main-launch-card[data-menu-key=tasks], .yma-dashboard-ui .main-launch-card[data-menu-key=market-intelligence] { background: var(--yma-peach); }

/* Personal: keep all live lists and definitions. */
.yma-dashboard-ui .personal-hero-copy { align-items: start; gap: 24px; }
.yma-dashboard-ui .personal-date-card { min-width: 170px; padding: 0; border: 0; background: none; box-shadow: none; gap: 4px; }
.yma-dashboard-ui .personal-date-card strong { font-size: 14px; font-weight: 500; }
.yma-dashboard-ui .personal-date-card .personal-refresh { margin-top: 4px; }
.yma-dashboard-ui .personal-metrics { margin-top: 24px; gap: 16px; }
.yma-dashboard-ui .personal-metric { min-height: 132px; gap: 8px; border-radius: 16px; padding: 16px; box-shadow: none; backdrop-filter: none; }
.yma-dashboard-ui .personal-metric strong { font-size: 32px; line-height: 40px; }
.yma-dashboard-ui .personal-metric:nth-child(1) { background: var(--yma-blue); }
.yma-dashboard-ui .personal-metric:nth-child(2) { background: var(--yma-mint); }
.yma-dashboard-ui .personal-metric:nth-child(3) { background: var(--yma-lilac); }
.yma-dashboard-ui .personal-content { padding-top: 0; gap: 24px; }
.yma-dashboard-ui .personal-grid { gap: 24px; }
.yma-dashboard-ui .personal-empty { min-height: 0; padding: 16px; text-align: left; }
.yma-dashboard-ui .personal-priority-list:has(> .personal-empty:only-child) { grid-template-columns: minmax(0, 1fr); }

/* CRM: size from the usable workspace, never from the viewport. */
.yma-dashboard-ui .layer-crm-cockpit { background: var(--yma-paper); padding: 0; border: 0; box-shadow: none; }
.yma-dashboard-ui .layer-crm-cockpit-section { margin-top: 0; }
.yma-dashboard-ui .layer-crm-management-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.yma-dashboard-ui .layer-crm-management-metrics article { padding: 16px; min-height: 132px; border-radius: 16px; box-shadow: none; }
.yma-dashboard-ui .layer-crm-management-metrics strong { font-size: 32px; line-height: 40px; }
.yma-dashboard-ui .layer-crm-management-metrics article:nth-child(3n+1) { background: var(--yma-blue); }
.yma-dashboard-ui .layer-crm-management-metrics article:nth-child(3n+2) { background: var(--card); }
.yma-dashboard-ui .layer-crm-management-metrics article:nth-child(3n) { background: var(--yma-mint); }
.yma-dashboard-ui :is(.layer-provider-table-shell, .layer-contact-directory-table-wrap, .finance-table-wrap, .ledger-table-wrap, .bd-table-wrap, .scorecard-board-wrap) { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.yma-dashboard-ui .layer-client-funnel-board { max-width: 100%; overflow-x: auto; align-items: start; }
.yma-dashboard-ui :is(.layer-client-funnel-column, .scorecard-column) { border-radius: 16px; padding: 16px; background: var(--gray-100); }
.yma-dashboard-ui .layer-profile-panel { position: fixed; right: 0; left: auto; top: 0; bottom: 0; width: min(960px, calc(100vw - var(--yma-rail-width))); max-width: calc(100vw - var(--yma-rail-width)); max-height: 100dvh; overflow-y: auto; border-radius: 16px 0 0 16px; }
.yma-dashboard-ui :is(.layer-profile-panel h2, .layer-provider-hero-card strong) { overflow-wrap: anywhere; }

/* Marketing: retain custom fields and the real generated URLs and analytics. */
.yma-dashboard-ui .utm-page { width: calc(100% - 64px); max-width: none; padding: 32px 0 64px; }
.yma-dashboard-ui .utm-hero { padding: 0 0 24px; border-radius: 0; }
.yma-dashboard-ui .utm-hero-copy { max-width: none; }
.yma-dashboard-ui .marketing-view-tabs { margin: 0 0 24px; padding: 2px 0 4px; gap: 8px; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; background: none; box-shadow: none; border: 0; border-radius: 0; }
.yma-dashboard-ui .marketing-view-tab { flex: 0 0 auto; white-space: nowrap; border: 1px solid var(--yma-line); background: var(--card); color: var(--black); transform: none; }
.yma-dashboard-ui .marketing-view-tab:hover { transform: none; }
.yma-dashboard-ui .marketing-view-tab.is-active { background: var(--black); color: var(--white); border-color: var(--black); }
.yma-dashboard-ui .utm-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px; margin-top: 0; align-items: start; }
.yma-dashboard-ui .utm-card-heading { margin-bottom: 12px; }
.yma-dashboard-ui .utm-card-heading h2 { margin: 0; }
.yma-dashboard-ui .utm-form { gap: 16px; }
.yma-dashboard-ui .utm-form :is(input, select) { min-height: 44px; }
.yma-dashboard-ui .utm-output-box textarea { font: 14px/20px Geist, sans-serif; }
.yma-dashboard-ui .utm-output { background: var(--yma-blue); }
.yma-dashboard-ui .utm-guide { display: none; }
.yma-dashboard-ui .analytics-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.yma-dashboard-ui .analytics-summary-card { min-width: 0; padding: 16px; border-radius: 16px; box-shadow: none; }
.yma-dashboard-ui .analytics-summary-card strong { font: 500 32px/40px Geist, sans-serif; }
.yma-dashboard-ui .analytics-summary-card span { letter-spacing: 0; text-transform: none; font-weight: 500; }
.yma-dashboard-ui .analytics-summary-card:nth-child(1) { background: var(--yma-blue); }
.yma-dashboard-ui .analytics-summary-card:nth-child(2) { background: var(--card); }
.yma-dashboard-ui .analytics-summary-card:nth-child(3) { background: var(--yma-mint); }
.yma-dashboard-ui .analytics-summary-card:nth-child(4) { background: var(--yma-lilac); }
.yma-dashboard-ui :is(.analytics-channel-grid, .analytics-links-wrap, .analytics-table-wrap) { min-width: 0; max-width: 100%; }

/* Finance and boards retain all control and record rows. */
.yma-dashboard-ui .finance-shell { width: 100%; max-width: none; padding: 0 32px 64px; }
.yma-dashboard-ui .finance-hero { padding-inline: 0; }
.yma-dashboard-ui .finance-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
.yma-dashboard-ui :is(.finance-main, .finance-layout, .analysis-groups) { min-width: 0; }
.yma-dashboard-ui .finance-card { margin-bottom: 24px; }
.yma-dashboard-ui .finance-card h2 { margin: 0 0 12px; }
.yma-dashboard-ui .group-card { padding: 16px; border-radius: 12px; box-shadow: none; }
.yma-dashboard-ui .scorecard-board { grid-auto-columns: 340px; }
.yma-dashboard-ui .scorecard-column { min-width: 0; width: 100%; box-shadow: none; }
.yma-dashboard-ui .scorecard-task { border-radius: 12px; padding: 12px; box-shadow: none; }
.yma-dashboard-ui .scorecard-detail:not(.active) { display: none; }
.yma-dashboard-ui .sales-coach-panel { container: sales-panel / inline-size; }
@container sales-panel (max-width: 1132px) {
  .yma-dashboard-ui .sales-learn-layout { grid-template-columns: 230px minmax(0, 1fr); }
  .yma-dashboard-ui .sales-learn-cheatsheet { position: static; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .yma-dashboard-ui .sales-learn-cheatsheet > :is(.eyebrow, .sales-learn-boundary) { grid-column: 1 / -1; }
}
@container sales-panel (max-width: 720px) {
  .yma-dashboard-ui .sales-learn-layout { grid-template-columns: minmax(0, 1fr); }
  .yma-dashboard-ui :is(.sales-learn-index, .sales-learn-cheatsheet) { position: static; }
  .yma-dashboard-ui .sales-learn-module-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .yma-dashboard-ui .sales-learn-module { grid-template-columns: minmax(0, 1fr); justify-items: center; min-height: 52px; text-align: center; }
  .yma-dashboard-ui .sales-learn-module > span:last-child { display: none; }
}
@container sales-panel (max-width: 560px) {
  .yma-dashboard-ui .sales-learn-cheatsheet { grid-template-columns: minmax(0, 1fr); }
}
.yma-dashboard-ui .scorecard-column-head h3 { font: 600 20px/28px Geist, sans-serif; }
.yma-dashboard-ui .soe-workspace { gap: 24px; align-items: start; }
.yma-dashboard-ui :is(.soe-left, .soe-main, .soe-right) { padding: 20px; }
.yma-dashboard-ui .market-intel-panel { padding-top: 0; }
.yma-dashboard-ui .market-intel-head h1 { font-size: 32px; line-height: 40px; }
.yma-dashboard-ui :is(.bd-shell, .sales-qa-shell) { max-width: none; }
.yma-dashboard-ui :is(.bd-panel, .sales-learn-stage, .sales-learn-index, .sales-learn-cheatsheet) { border-radius: 16px; box-shadow: none; }

/* Shared numeric contract: never split or ellipsize amounts, counts or periods.
   Tables use their content width; overflow belongs to the local wrapper.
   Include direct table parents so newly rendered reports inherit the rule. */
.yma-dashboard-ui :is(div, section, article):has(> table),
.yma-dashboard-ui .yma-data-scroll,
.yma-dashboard-ui :is(.layer-provider-table-shell, .layer-contact-directory-table-wrap,
  .finance-table-wrap, .ledger-table-wrap, .payroll-report-wrap, .status-modal-table-wrap,
  .analytics-table-wrap, .lead-table-wrap, .bd-partner-table-wrap,
  .sales-constructor-table-shell, .layer-sales-calculator-deals) {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
body.yma-dashboard-ui table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
body.yma-dashboard-ui table :is(th, td),
body.yma-dashboard-ui table :is(th, td)[class] {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}
.yma-dashboard-ui :is(#compareTable, #expenseTable, #techSummaryTable,
  #budgetTable, #pnlTable, #cashTable, #balanceTable) .finance-table :is(th, td):not(:first-child) {
  min-width: 96px;
}
/* Metric values can scroll independently while labels and help text wrap. */
.yma-dashboard-ui :is(.personal-metric, .layer-crm-management-metrics,
  .layer-client-funnel-metrics, .layer-sales-calculator-metrics,
  .layer-crm-activity-report-metrics, .layer-crm-pipeline-health,
  .layer-upload-health-metrics, .layer-overview-metric, .layer-kpi,
  .layer-provider-reference-card, .layer-provider-hero-card, .layer-model-card,
  .analytics-summary-card, .analytics-comparison-grid, .calendar-summary-card,
  .lead-metrics-grid, .lead-channel-grid, .bd-metric, .report-analyser-kpi,
  .sales-constructor-kpi, .sales-learn-price-card, .sales-qa-summary-row,
  .metric-value, .budget-month-pill) strong,
.yma-dashboard-ui .layer-sales-scenario-result > div > strong,
.yma-dashboard-ui .layer-crm-activity-report-breakdown > div > strong,
.yma-dashboard-ui :is(.yma-number, .group-card-meta, .eff-col-label, .eff-col-total,
  .stat-value, .layer-funnel-step-value, .layer-rating-value, .finance-ingest-status-pct,
  .personal-date-card > strong, #analyticsWindowLabel, .layer-contact-person-main > p,
  .layer-profile-ops-main > div:last-child > strong, .layer-profile-next-step small,
  .analytics-automated-count,
  .layer-provider-pagination-total,
  #users-count, .mcp-health-counts strong) {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  text-overflow: clip;
  overflow-x: auto;
  font-variant-numeric: tabular-nums;
  overscroll-behavior-inline: contain;
}
.yma-dashboard-ui :is(.scorecard-count, .layer-contact-surface-count) {
  display: inline-flex;
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.yma-dashboard-ui .group-card-total {
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.yma-dashboard-ui .group-card-head { overflow-x: auto; }
.yma-dashboard-ui .layer-sales-deal-row > span:nth-child(n+2):nth-child(-n+4),
.yma-dashboard-ui .sales-constructor-row > :nth-child(n+3) {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  overflow-x: auto;
  font-variant-numeric: tabular-nums;
}

/* CRM profile quality pass: adapt to the panel, including either rail state. */
.yma-dashboard-ui .layer-profile-panel { container: crm-profile / inline-size; padding: 16px; background: var(--card); scroll-padding-block: 0 190px; }
.yma-dashboard-ui #provider-crm-event-summary { scroll-margin-block: 80px 180px; }
.yma-dashboard-ui #layer-crm-task-modal { padding: 16px; z-index: 1200; }
.yma-dashboard-ui .layer-crm-task-modal-card { box-sizing: border-box; max-width: 100%; max-height: calc(100dvh - 60px); }
.yma-dashboard-ui #layer-crm-task-close { min-height: 44px; }
.yma-dashboard-ui .layer-crm-task-modal-card :is(.primary-btn, .ghost-btn) { min-height: 44px; }
.yma-dashboard-ui .layer-profile-panel .layer-provider-head {
  position: relative; min-height: 0; align-items: flex-start; gap: 12px;
  padding-bottom: 12px; margin-bottom: 8px; box-shadow: none;
}
.yma-dashboard-ui .layer-profile-panel .layer-provider-head > div:first-child {
  flex: 1 1 320px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 8px;
}
.yma-dashboard-ui .layer-profile-panel .layer-provider-head h3 {
  grid-column: 1; grid-row: 1; margin: 0; font: 500 12px/18px Geist, sans-serif; color: var(--yma-ink-muted);
}
.yma-dashboard-ui #layer-provider-detail-summary, .yma-dashboard-ui .layer-profile-head-title { display: contents; }
.yma-dashboard-ui .layer-profile-head-title strong { grid-column: 1 / -1; grid-row: 2; overflow: visible; font: 600 20px/26px Geist, sans-serif; overflow-wrap: anywhere; }
.yma-dashboard-ui .layer-profile-head-title .layer-sales-priority-pill {
  grid-column: 2; grid-row: 1; justify-self: start; padding: 2px 7px;
  font-size: 10px; line-height: 14px; white-space: nowrap;
}
.yma-dashboard-ui .layer-profile-head-meta { grid-column: 1 / -1; grid-row: 3; gap: 4px; margin: 0; }
.yma-dashboard-ui .layer-profile-head-actions { flex-direction: row; gap: 6px; align-items: center; margin-top: 0; padding-right: 52px; }
.yma-dashboard-ui .layer-profile-head-actions button {
  min-height: 44px; padding: 8px 12px; font-size: 12px; line-height: 18px; box-shadow: none;
}
.yma-dashboard-ui #layer-provider-modal-close { position: absolute; top: 0; right: 0; width: 44px; min-width: 44px; height: 44px; padding: 0; }
.yma-dashboard-ui .layer-profile-bookmarks {
  display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; overscroll-behavior-inline: contain;
  top: 0; margin: 0 0 12px; padding: 4px 0; background: var(--card); scrollbar-width: thin;
}
body.yma-dashboard-ui .layer-profile-bookmarks {
  z-index: 5; isolation: isolate; background: var(--card);
  box-shadow: 0 -8px 0 8px var(--card), 0 1px 0 var(--yma-line);
  backdrop-filter: none;
}
.yma-dashboard-ui .layer-profile-bookmark {
  flex: 0 0 auto; min-height: 44px; padding: 10px 14px; white-space: nowrap; font-size: 13px;
}
.yma-dashboard-ui .layer-profile-panel [data-provider-tab-panel] { scroll-margin-top: 80px; }
.yma-dashboard-ui .layer-profile-ops-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 8px; padding: 6px 10px; margin-top: 12px; border-radius: 12px;
  background: var(--card); box-shadow: 0 -4px 14px rgb(0 0 0 / 5%); backdrop-filter: none;
}
.yma-dashboard-ui .layer-profile-ops-main {
  grid-template-columns: auto minmax(76px, .65fr) minmax(180px, 1.4fr) max-content;
  align-items: center; gap: 10px;
}
.yma-dashboard-ui .layer-profile-ops-main > .chip { width: fit-content; padding: 6px 8px; font-size: 10px; line-height: 14px; }
.yma-dashboard-ui .layer-profile-ops-main strong,
.yma-dashboard-ui .layer-profile-next-step small { overflow: visible; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.yma-dashboard-ui .layer-profile-ops-main > div > span { font-size: 10px; line-height: 12px; }
.yma-dashboard-ui .layer-profile-ops-main strong { font-size: 12px; line-height: 16px; }
.yma-dashboard-ui .layer-profile-next-step {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px;
  align-items: baseline; padding: 2px 6px; border-radius: 8px;
}
.yma-dashboard-ui .layer-profile-next-step strong { font-size: 12px; line-height: 16px; }
.yma-dashboard-ui .layer-profile-next-step small { grid-column: 2; font-size: 11px; line-height: 14px; }
.yma-dashboard-ui .layer-profile-ops-actions { align-self: center; justify-content: flex-end; gap: 8px; }
.yma-dashboard-ui .layer-profile-ops-actions button { min-height: 44px; padding: 8px 14px; font-size: 13px; line-height: 18px; box-shadow: none; }
@container crm-profile (max-width: 740px) {
  .yma-dashboard-ui .layer-profile-ops-bar { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .yma-dashboard-ui .layer-profile-ops-main { grid-template-columns: auto minmax(100px, .7fr) minmax(210px, 1.5fr) minmax(70px, .5fr); }
  .yma-dashboard-ui .layer-profile-head-actions { justify-content: flex-start; }
}
@container crm-profile (max-width: 560px) {
  .yma-dashboard-ui .layer-profile-panel .layer-provider-head { flex-direction: column; gap: 8px; }
  .yma-dashboard-ui .layer-profile-panel .layer-provider-head > div:first-child { flex: 0 1 auto; width: 100%; padding-right: 52px; }
  .yma-dashboard-ui .layer-profile-head-title { align-items: flex-start; }
  .yma-dashboard-ui .layer-profile-head-title .chip { padding: 3px 7px; font-size: 10px; }
  .yma-dashboard-ui .layer-profile-head-actions { width: 100%; flex-wrap: wrap; gap: 4px; padding-right: 0; }
  .yma-dashboard-ui .layer-profile-head-actions button { padding-inline: 8px; font-size: 11px; }
  .yma-dashboard-ui #layer-provider-modal-close { margin-left: auto; }
  .yma-dashboard-ui .layer-profile-ops-bar { padding: 6px 8px; gap: 6px; }
  .yma-dashboard-ui .layer-profile-ops-main { grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; }
  .yma-dashboard-ui .layer-profile-ops-main > .chip { max-width: 108px; white-space: normal; }
  .yma-dashboard-ui .layer-profile-ops-main > div:last-child { grid-column: 3; grid-row: 1; }
  .yma-dashboard-ui .layer-profile-ops-main > .layer-profile-next-step { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: baseline; }
  .yma-dashboard-ui .layer-profile-next-step small { grid-column: 2; }
  .yma-dashboard-ui .layer-profile-ops-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yma-dashboard-ui :is(.layer-contact-person-list, .layer-contact-grid) { grid-template-columns: minmax(0, 1fr); }
  .yma-dashboard-ui .layer-contact-person-card { width: 100%; flex-direction: column; padding: 12px; gap: 8px; }
  .yma-dashboard-ui .layer-contact-person-main { width: 100%; }
  .yma-dashboard-ui .layer-contact-card-actions { width: 100%; justify-content: flex-end; }
  .yma-dashboard-ui .layer-contact-card-actions button { min-height: 44px; font-size: 12px; padding: 8px 12px; }
}
.yma-dashboard-ui .layer-contact-person-card .layer-contact-role-pill {
  flex: 0 0 auto; white-space: nowrap; font-size: 10px; line-height: 14px; letter-spacing: 0;
}

@media (max-width: 1200px) {
  .yma-dashboard-ui .main-launch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yma-dashboard-ui .analytics-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yma-dashboard-ui .layer-crm-management-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yma-dashboard-ui .personal-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yma-dashboard-ui .utm-layout { grid-template-columns: minmax(0, 1fr); }
  .yma-dashboard-ui .layer-crm-cockpit-head { flex-direction: column; align-items: stretch; }
  .yma-dashboard-ui .layer-crm-cockpit-head .layer-scope-toggle { max-width: 100%; width: fit-content; flex-wrap: wrap; }
  .yma-dashboard-ui .layer-company-manual-merge { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body.yma-dashboard-ui.has-workspace-rail { --yma-rail-width: 0px; padding-left: 0; padding-bottom: 80px; }
  .yma-dashboard-ui :is(.hero, .personal-hero) { padding: 16px 0 24px; }
  .yma-dashboard-ui :is(.finance-hero, .soe-hero, .bd-hero, .sales-qa-hero) { padding: 16px 16px 24px; }
  .yma-dashboard-ui :is(.hero-inner, .section, .personal-wrap, .utm-page) { width: calc(100% - 32px); }
  .yma-dashboard-ui .utm-page { padding-top: 16px; }
  body.yma-dashboard-ui.has-workspace-rail .marketing-view-tabs { position: static; inline-size: 100%; block-size: auto; overflow-x: auto; clip-path: none; }
  .yma-dashboard-ui .finance-shell { padding: 0 16px 64px; }
  .yma-dashboard-ui .finance-hero { padding-inline: 0; }
  .yma-dashboard-ui :is(.hero-copy h1, .personal-hero-copy h1, .finance-hero h1, .soe-hero h1, .layer-hero-copy h1, .utm-hero-copy h1, .bd-hero h1, .sales-qa-hero-copy h1) { font-size: 26px; line-height: 34px; }
  body.yma-dashboard-ui.has-workspace-rail :is(.hero-topbar, .finance-topbar, .soe-topbar, .utm-hero-top, .personal-topbar) { display: flex; margin-bottom: 24px; }
  .yma-dashboard-ui :is(.hero-logo, .utm-logo) { width: 84px; }
  .yma-dashboard-ui .personal-hero-copy { grid-template-columns: 1fr; gap: 16px; }
  .yma-dashboard-ui .personal-date-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; }
  .yma-dashboard-ui .personal-date-card .personal-refresh { margin: 0 0 0 auto; }
  .yma-dashboard-ui .personal-grid, .yma-dashboard-ui .main-launch-grid { grid-template-columns: minmax(0, 1fr); }
  .yma-dashboard-ui :is(.personal-metrics, .analytics-summary-grid, .layer-crm-management-metrics) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .yma-dashboard-ui .personal-metric { padding: 12px; }
  .yma-dashboard-ui .workspace-rail { inset: auto 0 0; width: 100%; height: 64px; padding: 6px 12px; box-sizing: border-box; border-top: 1px solid var(--yma-line); }
  .yma-dashboard-ui.workspace-rail-unrolled .workspace-rail { padding: 6px 12px; }
  .yma-dashboard-ui :is(.workspace-rail-brand, .workspace-rail-toggle, .workspace-rail-theme, .workspace-rail-session, .workspace-rail-logout) { display: none; }
  .yma-dashboard-ui .workspace-rail-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 0; gap: 8px; }
  .yma-dashboard-ui .workspace-rail-item, .yma-dashboard-ui.workspace-rail-unrolled .workspace-rail-item { flex: 0 0 76px; min-height: 52px; padding: 6px; display: flex; flex-direction: row; gap: 2px; border-radius: 12px; justify-content: center; }
  .yma-dashboard-ui .workspace-rail-item:hover { transform: none; }
  .yma-dashboard-ui .workspace-rail-icon { width: 20px; height: 20px; flex-shrink: 0; }
  .yma-dashboard-ui .workspace-rail-mini { margin: 0; font-size: 10px; }
  .yma-dashboard-ui .workspace-rail-label { display: none; }
  .yma-dashboard-ui .layer-profile-panel { width: 100%; max-width: 100%; bottom: 64px; max-height: calc(100dvh - 64px); border-radius: 0; }
  .yma-dashboard-ui .layer-crm-command-head { flex-direction: column; align-items: stretch; }
  .yma-dashboard-ui :is(.layer-crm-prospect-upload-controls, .layer-crm-activity-report-filters) { grid-template-columns: minmax(0, 1fr); }
  .yma-dashboard-ui .layer-crm-prospect-upload-controls > .layer-form-wide { grid-column: auto; }
  .yma-dashboard-ui .layer-company-manual-merge { grid-template-columns: minmax(0, 1fr); }
  .yma-dashboard-ui .scorecard-board { grid-auto-columns: 300px; }
  .yma-dashboard-ui .layer-crm-company-dedup .layer-inline-actions label { min-width: 0; width: 100%; }
  .yma-dashboard-ui :is(.soe-workspace, .utm-channel-grid, .utm-two-col) { grid-template-columns: minmax(0, 1fr); }
}

/* Landscape uses the available workspace, including either rail state. */
.yma-dashboard-ui .utm-page { container: utm-workspace / inline-size; }
@container utm-workspace (min-width: 600px) {
  .yma-dashboard-ui #generatorView:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; align-items: start; }
  .yma-dashboard-ui .utm-layout { display: contents; }
  .yma-dashboard-ui .utm-form { grid-column: 1; grid-row: 1; }
  .yma-dashboard-ui .utm-output-card { grid-column: 2; grid-row: 1; position: static; padding: 16px; }
  .yma-dashboard-ui .utm-shortener { margin-top: 12px; padding: 12px; gap: 8px; }
  .yma-dashboard-ui .utm-short-description { font-size: 13px; line-height: 18px; }
  .yma-dashboard-ui .utm-summary { gap: 0; margin-top: 12px; }
  .yma-dashboard-ui .utm-summary div { grid-template-columns: 100px minmax(0, 1fr); gap: 6px; padding: 6px 0; }
  .yma-dashboard-ui .utm-summary dt { font-size: 10px; line-height: 14px; }
  .yma-dashboard-ui .utm-summary dd { font-size: 12px; line-height: 16px; }
  .yma-dashboard-ui .utm-summary div:nth-child(3) dd { white-space: nowrap; overflow-x: auto; font-variant-numeric: tabular-nums; }
  .yma-dashboard-ui .utm-output-box textarea { min-height: 112px; height: 112px; }
}

/* Native closed controls retain their state and change handlers. The presentation
   adapter supplies a bounded listbox for the expanded state. */
body.yma-dashboard-ui select:not([multiple]) {
  min-width: 0; max-width: 100%; box-sizing: border-box; appearance: none;
  padding-right: 36px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}
.yma-select-menu {
  position: fixed; z-index: 13000; box-sizing: border-box; padding: 4px;
  overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  background: var(--card); color: var(--black); border: 1px solid var(--yma-line);
  border-radius: 12px; box-shadow: 0 8px 28px rgb(0 0 0 / 16%);
}
.yma-select-menu .yma-select-option {
  display: block; width: 100%; box-sizing: border-box; min-height: 44px;
  padding: 10px 12px; border: 0; border-radius: 8px; background: transparent;
  color: inherit; font: 400 14px/20px var(--font-body, Geist, sans-serif);
  text-align: left; white-space: normal; overflow-wrap: anywhere; cursor: pointer;
}
.yma-select-option[aria-selected=true] { font-weight: 600; }
.yma-select-menu .yma-select-option.is-active { background: var(--yma-selection-bg); color: var(--yma-selection-ink); }
.yma-select-menu .yma-select-option.is-numeric { white-space: nowrap; overflow-wrap: normal; overflow-x: auto; font-variant-numeric: tabular-nums; }
.yma-select-menu .yma-select-group { padding: 8px 12px; font-size: 12px; color: var(--yma-ink-muted); }

/* Companies: one filter entry point, original controls and handlers retained. */
.yma-dashboard-ui #workspace-toggle-metrics,
.yma-dashboard-ui #workspace-clear-filters[hidden] { display: none !important; }
.yma-dashboard-ui .layer-filter-popover-wrap { display: flex; align-items: center; gap: 8px; }
.yma-dashboard-ui #workspace-filter-toggle { min-width: 80px; }
.yma-dashboard-ui .layer-crm-filter-actions .layer-list-search-filter { max-width: none; }
.yma-dashboard-ui .yma-company-list-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.yma-dashboard-ui #workspace-clear-filters {
  width: var(--yma-action-height); min-width: var(--yma-action-height);
  height: var(--yma-action-height); padding: 0; font-size: 22px; line-height: 1;
}
.yma-dashboard-ui #workspace-filter-popover {
  position: fixed; right: auto; z-index: 900; box-sizing: border-box;
  padding: 16px; border-radius: 16px; background: var(--card);
  border: 1px solid var(--border); box-shadow: 0 12px 32px rgb(0 0 0 / .12);
  overflow: hidden; flex-direction: column; gap: 12px;
}
.yma-dashboard-ui #workspace-filter-popover:not(.hidden) { display: flex; }
.yma-dashboard-ui .yma-company-filter-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.yma-dashboard-ui .yma-company-filter-heading { margin: 0 0 12px; font-size: 14px; line-height: 20px; font-weight: 600; }
.yma-dashboard-ui .yma-company-quick-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.yma-dashboard-ui #workspace-filter-popover .yma-company-quick-filters button { display: flex; justify-content: flex-start; gap: 8px; text-align: left; min-width: 0; }
.yma-dashboard-ui .yma-company-quick-filters button::before { content: ''; flex: 0 0 14px; width: 14px; height: 14px; border: 1px solid var(--gray-400); border-radius: 3px; }
.yma-dashboard-ui .yma-company-quick-filters button[aria-pressed="true"] { background: var(--yma-selection-bg); color: var(--yma-selection-ink); border-color: var(--yma-selection-border); }
.yma-dashboard-ui .yma-company-quick-filters button[aria-pressed="true"]::before { content: '✓'; background: var(--yma-selection-ink); border-color: var(--yma-selection-ink); color: var(--yma-selection-mark-ink); font-size: 12px; line-height: 13px; text-align: center; }
.yma-dashboard-ui #workspace-filter-popover .layer-filter-popover-actions { flex: 0 0 auto; margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }
@media (max-width: 760px) {
  .yma-dashboard-ui .layer-crm-filter-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
  .yma-dashboard-ui .layer-crm-filter-actions .layer-list-primary-filter { min-width: 0; max-width: 100%; }
  .yma-dashboard-ui .layer-crm-filter-actions .layer-list-search-filter { grid-column: 1 / -1; flex: initial; }
  .yma-dashboard-ui .layer-crm-filter-actions :is(#workspace-partner-source-wrap, #workspace-partner-name-wrap) { grid-column: 1 / -1; width: 100%; }
  .yma-dashboard-ui .layer-filter-popover-wrap { flex-direction: row; justify-content: flex-start; }
  .yma-dashboard-ui #workspace-filter-toggle { width: auto; }
  .yma-dashboard-ui .yma-company-quick-filters { grid-template-columns: 1fr; }
  .yma-dashboard-ui #workspace-filter-popover .layer-filter-popover-actions button { width: 100%; }
}
@media (max-width: 360px) {
  .yma-dashboard-ui .layer-crm-filter-actions { grid-template-columns: minmax(0, 1fr); }
}

/* Care Suite's violet dark palette, including older Partners surfaces. */
html[data-theme="dark"] body.yma-dashboard-ui {
  --yma-selection-bg: #302448;
  --yma-selection-ink: #dce4ff;
  --yma-selection-border: #9db8ff;
  --yma-selection-mark-ink: #110c1d;
}
html[data-theme="dark"] .yma-select-menu .yma-select-option:is(.is-active, [aria-selected="true"], :hover:enabled) {
  background: var(--yma-selection-bg);
  color: var(--yma-selection-ink);
}
html[data-theme="dark"] .yma-select-menu .yma-select-option[aria-selected="true"] {
  box-shadow: inset 3px 0 0 var(--yma-selection-border);
}
html[data-theme="dark"] .workspace-rail {
  --workspace-rail-fg: #eee7fb;
  --workspace-rail-muted: #b9b0cd;
  --workspace-rail-active: var(--yma-active);
  --workspace-rail-active-ink: var(--white);
}
html[data-theme="dark"] body.yma-dashboard-ui :is(.bd-timeline-item, .bd-record, .bd-profile-panel, .bd-inline-opportunity, .bd-scope-toggle, .bd-owner-filter) {
  background: var(--yma-surface-strong);
}
html[data-theme="dark"] body.yma-dashboard-ui :is(.bd-card-type, .bd-mention-results button:hover, .bd-mention-results button.is-active) {
  background: var(--yma-lilac);
  color: var(--yma-accent-soft);
}
html[data-theme="dark"] body.yma-dashboard-ui :is(.card, .finance-card, .utm-card, .layer-crm-action-panel, .layer-crm-task-panel) {
  border-color: var(--yma-line-soft);
  background-color: var(--card);
}
html[data-theme="dark"] body.yma-dashboard-ui .layer-crm-cockpit { background: var(--yma-paper); }
html[data-theme="dark"] body.yma-dashboard-ui :is(input, select, textarea):focus-visible {
  outline-color: var(--yma-accent-soft);
}

/* Login: full-frame introduction above the form, beside it in landscape. */
.yma-dashboard-ui .login-screen {
  width: 100%;
  min-height: 100svh;
  padding: 24px 20px;
}
.yma-dashboard-ui .login-layout {
  display: grid;
  width: min(100%, 470px);
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.yma-dashboard-ui .login-media {
  position: relative;
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 20px;
  background: #05030d;
}
.yma-dashboard-ui :is(.login-media-poster, .login-reveal) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.yma-dashboard-ui .login-reveal-control {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(238, 231, 251, .3);
  border-radius: 999px;
  background: rgba(17, 12, 29, .88);
  color: #f5f1ff;
  font: 500 12px/1 var(--font-ui);
  cursor: pointer;
}
.yma-dashboard-ui .login-reveal-control[hidden] { display: none; }
.yma-dashboard-ui .login-reveal-control:focus-visible { outline: 2px solid #bca5ff; outline-offset: 3px; }
.yma-dashboard-ui .login-card {
  width: 100%;
  min-width: 0;
  padding: 28px;
  border-radius: 20px;
  box-shadow: none;
}
.yma-dashboard-ui .login-brand { gap: 12px; margin-bottom: 24px; }
.yma-dashboard-ui .login-logo { width: 104px; }
.yma-dashboard-ui .login-copy h1 { font-size: clamp(28px, 3vw, 36px); line-height: 1.12; }
.yma-dashboard-ui .login-copy p { font-size: 14px; line-height: 1.5; }
.yma-dashboard-ui .login-form { margin-top: 24px; gap: 16px; }
.yma-dashboard-ui .login-form input { min-height: 48px; font-size: 16px; }
.yma-dashboard-ui #login-form .primary-btn { min-height: 48px; }
.yma-dashboard-ui .login-hint { font-size: 12px; line-height: 1.5; }
.yma-dashboard-ui .login-error:empty { display: none; }
html[data-theme="dark"] .yma-dashboard-ui #login-form .primary-btn {
  background: var(--yma-accent);
  color: #fff;
  border-color: var(--yma-accent);
}
html[data-theme="dark"] .yma-dashboard-ui #login-form .primary-btn:hover { background: #4d27ad; border-color: #4d27ad; }
@media (min-width: 560px) and (orientation: landscape) {
  .yma-dashboard-ui .login-layout {
    width: min(100%, 1180px);
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
    gap: clamp(20px, 4vw, 48px);
  }
  .yma-dashboard-ui .login-card { max-width: 470px; justify-self: end; }
}
@media (max-width: 380px) {
  .yma-dashboard-ui .login-screen { padding: 16px 12px; }
  .yma-dashboard-ui .login-card { padding: 20px; }
  .yma-dashboard-ui .login-brand { gap: 8px; }
  .yma-dashboard-ui .login-logo { width: 84px; }
  .yma-dashboard-ui .login-brand-actions .eyebrow { font-size: 10px; }
}
@media (min-width: 560px) and (max-height: 560px) and (orientation: landscape) {
  .yma-dashboard-ui .login-screen { padding: 16px 20px; }
  .yma-dashboard-ui .login-layout { align-items: start; }
  .yma-dashboard-ui .login-media { position: sticky; top: 16px; }
  .yma-dashboard-ui .login-card { padding: 16px; }
  .yma-dashboard-ui .login-logo { width: 64px; }
  .yma-dashboard-ui .login-brand { margin-bottom: 12px; }
  .yma-dashboard-ui .login-brand-actions .eyebrow,
  .yma-dashboard-ui .login-copy p { display: none; }
  .yma-dashboard-ui .login-copy h1 { font-size: 24px; margin-bottom: 0; }
  .yma-dashboard-ui .login-form { margin-top: 16px; gap: 12px; }
  .yma-dashboard-ui .login-form label { grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 8px; }
  .yma-dashboard-ui .login-form input { min-height: 44px; padding: 10px 12px; }
  .yma-dashboard-ui #login-form .primary-btn { min-height: 44px; }
  .yma-dashboard-ui .login-hint { margin: 0; font-size: 11px; }
}
.yma-dashboard-ui .workspace-account-footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: auto; }
.yma-dashboard-ui .workspace-account-footer .workspace-rail-session { flex: 1; min-width: 0; }
.yma-dashboard-ui .workspace-account-signout { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--workspace-rail-muted); border-radius: 8px; background: transparent; color: var(--workspace-rail-fg); cursor: pointer; }
.yma-dashboard-ui .workspace-account-signout:hover { background: rgb(255 255 255 / 12%); }
@media (max-width: 760px) { .yma-dashboard-ui .workspace-account-footer { display: none; } }
@media (max-width: 760px) {
  body.yma-dashboard-ui { --yma-mobile-bar-height: calc(76px + env(safe-area-inset-bottom)); }
  .yma-dashboard-ui .workspace-rail,
  .yma-dashboard-ui.workspace-rail-unrolled .workspace-rail {
    height: var(--yma-mobile-bar-height); padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
    background: #171122; border-top: 2px solid #796390;
    box-shadow: 0 -6px 20px rgb(0 0 0 / 22%);
  }
  .yma-dashboard-ui .workspace-rail-item,
  .yma-dashboard-ui.workspace-rail-unrolled .workspace-rail-item {
    flex: 0 0 76px; min-height: 56px; flex-direction: column; gap: 3px; padding: 4px 6px;
  }
  .yma-dashboard-ui .workspace-rail-icon { width: 22px; height: 22px; }
  .yma-dashboard-ui .workspace-rail-mini { max-width: 64px; font-size: 11px; line-height: 16px; color: #e5ddec; }
  .yma-dashboard-ui .workspace-rail-item-active .workspace-rail-mini { color: var(--workspace-rail-active-ink); }
  .yma-dashboard-ui .workspace-mobile-submenu { bottom: calc(var(--yma-mobile-bar-height) + 8px); }
  body.yma-dashboard-ui.has-workspace-rail { padding-bottom: calc(var(--yma-mobile-bar-height) + 16px); }
  body.yma-dashboard-ui.has-workspace-rail.crm-entry-list-visible { padding-bottom: calc(var(--yma-mobile-bar-height) + 88px); }
  .yma-dashboard-ui .workspace-mobile-subitem { text-decoration: none; }
}
@font-face { font-family: "Forma DJR Banner"; src: url('./assets/fonts/FormaDJRBanner-Medium.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
/* Search suggestions share readable dark surfaces, including modal pickers. */
html[data-theme="dark"] body.yma-dashboard-ui :is(.layer-crm-task-provider-results, .layer-import-business-results, .bd-search-results, .bd-mention-results, .lead-resolve-results, .report-analyser-merchant-results) {
  background: #241b35; color: #f4effb; border-color: #655179;
}
html[data-theme="dark"] body.yma-dashboard-ui :is(.layer-crm-task-provider-results, .layer-import-business-results, .bd-search-results, .bd-mention-results, .lead-resolve-results, .report-analyser-merchant-results) button {
  background: #241b35; color: #f4effb; border-color: #655179;
}
html[data-theme="dark"] body.yma-dashboard-ui :is(.layer-crm-task-provider-results, .layer-import-business-results, .bd-search-results, .bd-mention-results, .lead-resolve-results, .report-analyser-merchant-results) :is(small, .layer-form-hint) { color: #d1c4e3; }
html[data-theme="dark"] body.yma-dashboard-ui :is(.layer-crm-task-provider-results, .layer-import-business-results, .bd-search-results, .bd-mention-results, .lead-resolve-results, .report-analyser-merchant-results) button:is(:hover, :focus-visible, .is-active, .is-selected) {
  background: #49345f; color: #fff;
}
/* Shared KPI typography: labels and tabular detail retain the UI face. */
body.yma-dashboard-ui :is(.personal-metric, .layer-crm-management-metrics,
  .layer-client-funnel-metrics, .layer-sales-calculator-metrics,
  .layer-crm-activity-report-metrics, .layer-crm-pipeline-health,
  .layer-upload-health-metrics, .layer-overview-metric, .layer-kpi,
  .analytics-summary-card, .analytics-comparison-grid, .calendar-summary-card,
  .lead-metrics-grid, .lead-channel-grid, .bd-metric, .report-analyser-kpi,
  .sales-constructor-kpi, .metric-value, .kpi) strong,
body.yma-dashboard-ui :is(.stat-value, .metric-value, .kpi-value, .yma-number),
body.yma-dashboard-ui .layer-sales-scenario-result > div > strong {
  font-family: "Forma DJR Banner", var(--font-ui);
  font-weight: 500;
  letter-spacing: 0;
}
.dashboard-section-masthead { display: none; }
body.yma-dashboard-ui .dashboard-header-intro { display: none; }
body.yma-dashboard-ui .dashboard-section-hero:not(.layer-hero) { margin-bottom: 20px; }
body.yma-dashboard-ui .dashboard-section-hero:not(.layer-hero) .dashboard-original-title { margin-bottom: 16px; }
body.yma-dashboard-ui .dashboard-section-hero :is(.bd-hero-actions, .finance-controls) { margin-top: 16px; }
body.yma-dashboard-ui .dashboard-section-hero + .marketing-view-tabs { margin-top: 0; margin-bottom: 24px; border: 1px solid var(--yma-line); border-radius: 999px; padding: 4px; gap: 4px; }
body.yma-dashboard-ui .marketing-view-tabs .marketing-view-tab { border-radius: 999px; flex-shrink: 0; }
body.yma-dashboard-ui .dashboard-section-hero h1 { font-family: "Forma DJR Banner", var(--font-ui); font-weight: 500; letter-spacing: 0; }
@media (max-width: 760px) {
  body.yma-dashboard-ui .dashboard-section-hero { padding: 12px 16px; }
  body.yma-dashboard-ui .dashboard-header-title-group { display: none; }
  body.yma-dashboard-ui .dashboard-section-hero :is(.balanced-scorecard-head, .market-intel-head) { gap: 16px; }
  body.yma-dashboard-ui .dashboard-section-hero :is(.bd-hero-actions, .finance-controls) { margin-top: 0; }
  body.yma-dashboard-ui .dashboard-section-hero:not(:has(.finance-controls, .personal-date-card, .bd-hero-actions, .balanced-scorecard-panel, .market-intel-panel, .sales-qa-hero-route, .main-launch-hub, button, select, input)) .dashboard-section-masthead { margin-bottom: 0; }
  body.yma-dashboard-ui .dashboard-section-masthead { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 32px; margin-bottom: 12px; }
  body.yma-dashboard-ui .dashboard-section-masthead .hero-logo { display: block; width: 56px; height: auto; }
  body.yma-dashboard-ui .dashboard-section-masthead > span { text-align: right; font: 500 24px/30px "Forma DJR Banner", var(--font-ui); letter-spacing: 0; overflow-wrap: anywhere; }
  body.yma-dashboard-ui .dashboard-section-hero :is(.dashboard-original-title, .dashboard-original-logo) { display: none; }
  body.yma-dashboard-ui .dashboard-section-hero :is(.hero-topbar, .personal-topbar, .finance-topbar, .soe-topbar, .utm-hero-top) { display: none; }
  body.yma-dashboard-ui .dashboard-section-hero :is(.hero-inner, .personal-wrap) { width: 100%; }
  body.yma-dashboard-ui .layer-hero .dashboard-section-masthead { margin-bottom: 0; }
  body.yma-dashboard-ui .settings-page > header.dashboard-section-hero { display: block; }
  body.yma-dashboard-ui .roi-heading.dashboard-section-hero { display: block; }
}
