@media (min-width: 1400px) {
  .report-preview-layout { grid-template-columns: 250px minmax(0,1fr) 326px; }
  .report-tools-rail { width: auto; }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .report-preview-layout { grid-template-columns: 232px minmax(0,1fr); }
  .preview-page { padding-bottom: 112px; }
  .mobile-report-actions, .mobile-tool-sheet { left: 244px; }
}

@media (max-width: 1199.98px) {
  .report-row { grid-template-columns: minmax(260px, 1.5fr) minmax(100px,.7fr) 100px 30px; }
  .report-row .updated-time { display: none; }
  .report-list.grid-view .updated-time { display: block; }
  .report-preview-layout { grid-template-columns: 220px minmax(0,1fr); }
  .preview-page { padding-bottom: 112px; }
  .mobile-report-actions, .mobile-tool-sheet { left: 232px; }
  .modal-open .toast-container { bottom: calc(106px + env(safe-area-inset-bottom)) !important; }
}

@media (max-width: 991.98px) {
  .main-content { margin-left: 0; }
  .topbar { padding: 0 24px; }
  .dashboard { padding: 28px 24px; }
  .content-grid > div:last-child { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
  .content-grid > div:last-child .panel, .content-grid > div:last-child .support-card { margin: 0; }
  .activity-panel { grid-row: span 2; }
  .report-grid-two { grid-template-columns: 1fr; }
  .scenario-layout { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .topbar { min-height: 64px; padding: 0 16px; }
  .dashboard { padding: 24px 16px 32px; }
  .welcome-row { align-items: flex-start; flex-direction: column; }
  .welcome-actions { width: 100%; }
  .welcome-actions .btn { flex: 1; }
  .stat-card { min-height: 108px; padding: 13px; }
  .stat-card-primary { gap: 10px; }
  .content-grid > div:last-child { display: block; }
  .content-grid > div:last-child .panel, .content-grid > div:last-child .support-card { margin-bottom: 16px; }
  .report-row { grid-template-columns: minmax(0,1fr) 90px 25px; min-height: 72px; padding: 10px 14px; }
  .report-row .report-client, .report-row .updated-time { display: none; }
  .report-tools, .report-tabs, .panel-header, .panel-footer { padding-right: 14px; padding-left: 14px; }
  .report-list.grid-view { grid-template-columns: 1fr; padding: 14px; }
  .report-list.grid-view .report-client { display: block; }
  .report-list.grid-view .updated-time { display: block; }
  .preview-header { gap: 8px; }
  .preview-file-heading { display: none; }
  .preview-actions .btn-soft span, .preview-actions .btn-primary span { display: none !important; }
  .preview-actions .btn-close { display: none; }
  .report-preview-layout { display: block; }
  .preview-page { height: calc(100vh - 72px); height: calc(100dvh - 72px); padding: 24px 20px 100px; }
  .report-hero { grid-template-columns: 1fr; }
  .conviction-score { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 12px; }
  .score-ring { width: 58px; height: 58px; margin: 0; border-width: 6px; }
  .score-ring strong { font-size: 18px; }
  .score-ring small { margin: 17px 0 0 20px; }
  .market-driver-grid { grid-template-columns: 1fr; }
  .mobile-report-actions { left: 12px; grid-template-columns: repeat(4,1fr); }
  .mobile-report-actions button { gap: 5px; padding-right: 6px; padding-left: 6px; }
  .mobile-tool-sheet { left: 12px; }
  .service-options { grid-template-columns: 1fr; }
  .service-options span { min-height: auto; }
  .service-options span > i { margin-bottom: 8px; }
  body.client-mode .content-grid { margin-top: 16px; }
  body.client-mode .client-access-banner { align-items: flex-start; padding: 20px; flex-wrap: wrap; }
  body.client-mode .client-access-copy { flex-basis: calc(100% - 74px); }
  body.client-mode .client-report-progress { width: 120px; }
  .client-library-order { width: 100%; justify-content: space-between; }
  .client-report-open { grid-template-columns: 74px minmax(0,1fr); gap: 13px; padding: 18px 16px; }
  .client-report-open .report-thumbnail { width: 72px; height: 54px; flex-basis: 72px; }
  .client-report-cta { display: none; }
  .client-report-copy > strong { font-size: 14px; }
  .client-report-summary { display: -webkit-box; overflow: hidden; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .report-section-footer { margin-top: 24px; padding-top: 16px; }
  .report-next-section { min-height: 84px; grid-template-columns: 40px minmax(0,1fr) auto; gap: 12px; padding: 13px 14px; }
  .next-section-number { width: 38px; height: 38px; }
  .next-section-copy > strong { font-size: 14px; }
  .next-section-copy > span { font-size: 9px; }
}

@media (max-width: 575.98px) {
  .stat-card-primary { grid-template-columns: 31px minmax(0,1fr); }
  .stat-card-primary .trend { display: none; }
  .welcome-actions { flex-direction: column; }
  .client-access-banner { align-items: flex-start; padding: 15px; flex-wrap: wrap; }
  .client-access-copy { flex-basis: calc(100% - 60px); }
  .client-report-progress { width: calc(100% - 120px); margin-left: 0; }
  .client-access-banner .btn-light { margin-left: auto; }
  .report-header { align-items: flex-start; }
  .report-tools { align-items: stretch; flex-direction: column; }
  .filter-button { width: 100%; justify-content: center; }
  .report-tabs { gap: 16px; }
  .report-tabs button { min-height: 36px; }
  .report-row { grid-template-columns: minmax(0,1fr) 26px; gap: 9px; }
  .report-row .row-menu { width: 38px; height: 38px; }
  .report-row .access-badge { display: none; }
  .report-list.grid-view .access-badge { display: inline-flex; }
  .preview-header { height: 66px; padding: 9px 11px; }
  .preview-header .report-back-button, .preview-header .icon-button { width: 40px; height: 40px; }
  .preview-actions .btn-close { display: none; }
  .report-preview-layout { height: calc(100vh - 66px); height: calc(100dvh - 66px); }
  .preview-page { height: calc(100vh - 66px); height: calc(100dvh - 66px); }
  .preview-page h3 { font-size: 21px; }
  .preview-brand > small { display: none; }
  .preview-metrics { grid-template-columns: 1fr; }
  .preview-metrics > button { border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-metrics > button:last-child { border-bottom: 0; }
  .meridian-take { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: flex-start; }
  .meridian-take > span { grid-row: 1 / span 2; }
  .ask-about-button { grid-column: 2; margin-left: 0; justify-self: start; }
  .section-number { display: none; }
  .chart-control-header { flex-direction: column; }
  .chart-metric-switch { width: 100%; }
  .chart-metric-switch button { flex: 1; }
  .interactive-market-chart { height: 195px; margin-left: 37px; }
  .market-bars { gap: 5px; }
  .market-bars button span { font-size: 5px; }
  .submarket-row { grid-template-columns: 1fr .65fr .65fr; }
  .submarket-row > span:last-child { display: none; }
  .comp-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  .comp-filter { overflow-x: auto; }
  .comp-filter button { flex: 1; white-space: nowrap; }
  .comp-map { height: 230px; }
  .map-detail { right: 9px; bottom: 9px; width: 165px; }
  .comp-table th:nth-child(2), .comp-table td:nth-child(2), .comp-table th:nth-child(3), .comp-table td:nth-child(3), .comp-table th:nth-child(5), .comp-table td:nth-child(5) { display: none; }
  .comp-table th, .comp-table td { padding-right: 9px; padding-left: 9px; }
  .comp-table th:last-child, .comp-table td:last-child { text-align: right; }
  .scenario-result-grid { grid-template-columns: 1fr; }
  .scenario-control input[type="range"] { min-height: 28px; margin: 3px 0 0; }
  .scenario-presets { width: 100%; }
  .scenario-presets button { min-height: 34px; flex: 1; }
  .client-access-banner .btn-light { min-height: 40px; }
  .sensitivity-grid { grid-template-columns: 52px repeat(4,1fr); padding: 0 10px; }
  .sensitivity-grid > * { min-height: 27px; font-size: 6px; }
  .modal-body, .modal-header, .modal-footer { padding-right: 18px; padding-left: 18px; }
  .response-time { display: none; }
  body.client-mode .client-access-copy { flex-basis: calc(100% - 64px); }
  body.client-mode .client-access-icon { width: 44px; height: 44px; font-size: 19px; }
  body.client-mode .client-access-copy > strong { font-size: 16px; }
  body.client-mode .client-access-copy > small { font-size: 10px; }
  body.client-mode .client-report-progress { width: calc(100% - 126px); }
  .client-featured-meta { gap: 7px 11px; margin-top: 10px; }
  .client-access-copy .client-featured-meta span { font-size: 8px; }
  .client-report-eyeline { flex-wrap: wrap; }
  .client-report-summary { display: none; }
  .report-next-section { grid-template-columns: 38px minmax(0,1fr) 38px; gap: 10px; padding: 12px; }
  .next-section-action > span { display: none; }
  .next-section-action > i { width: 38px; height: 38px; }
  .next-section-copy > span { display: -webkit-box; overflow: hidden; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
}

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

/* Keep the RFP report workspace intentional at legacy breakpoints. */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .chartmaster-report-layout { grid-template-columns: 220px minmax(600px,1fr) 250px; }
  .chartmaster-report-layout .print-rail { display: flex; }
}
@media (max-width: 1199.98px) {
  .chartmaster-report-layout { grid-template-columns: 220px minmax(0,1fr); }
  .chartmaster-report-layout .print-rail { display: none; }
}
@media (max-width: 767.98px) {
  .chartmaster-report-layout { display: block; }
}

.mobile-report-page-picker { display: none; }
@media (max-width: 767.98px) {
  .mobile-report-page-picker.active { position: fixed; z-index: 1070; top: 74px; right: 12px; left: 12px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: var(--panel); box-shadow: 0 8px 24px rgba(25,56,52,.14); }
  .mobile-report-page-picker span { color: #7b8986; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-report-page-picker select { min-width: 0; flex: 1; padding: 6px 8px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: var(--panel); font-size: 10px; }
  .chartmaster-report-layout .report-canvas { padding-top: 62px; }
}

/* Mobile usability pass: compact chrome, simple libraries, and a readable report canvas. */
body.client-mode .workspace-side-column,
body.client-mode #playbooks { display: none !important; }
body.client-mode .client-library-column { width: 100%; }
body.client-mode .welcome-actions { display: none; }

.mobile-report-next { display: none; }

@media (max-width: 991.98px) {
  .mobile-nav { padding-bottom: env(safe-area-inset-bottom); }
  .mobile-nav .offcanvas-body { padding: 8px 16px 18px; }
  .mobile-nav .sidebar-nav .nav-link { min-height: 48px; }
  .mobile-nav .role-switch { min-height: 52px; }
}

@media (max-width: 767.98px) {
  body { font-size: 15px; }
  .topbar { min-height: 60px; padding: 0 12px; }
  .topbar > .icon-button { width: 42px; height: 42px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .icon-button { width: 42px; height: 42px; }
  .profile-button { min-width: 42px; min-height: 42px; justify-content: center; padding: 0; }
  .profile-avatar { width: 38px; height: 38px; }

  .dashboard { padding: 20px 14px calc(30px + env(safe-area-inset-bottom)); }
  .welcome-row { gap: 16px; margin-bottom: 20px; }
  .dashboard .eyebrow { margin-bottom: 6px; font-size: 10px; line-height: 1.35; }
  h1 { font-size: clamp(28px, 8.5vw, 34px); line-height: 1.08; }
  .dashboard .welcome-subtitle { margin-top: 9px; font-size: 14px; line-height: 1.5; }
  .welcome-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .welcome-actions .btn { min-height: 44px; padding: 9px 10px; font-size: 11px; line-height: 1.25; white-space: normal; }
  .welcome-actions .btn-primary { grid-column: 1 / -1; }

  .stat-grid { --bs-gutter-x: 10px; --bs-gutter-y: 10px; }
  .stat-card { min-height: 82px; padding: 11px; }
  .stat-card-primary { grid-template-columns: 32px minmax(0,1fr); gap: 9px; }
  .stat-card-primary .trend,
  .stat-foot { display: none; }
  .dashboard .stat-value > small { font-size: 10px; }
  .dashboard .stat-number { font-size: 25px; }

  .content-grid { --bs-gutter-y: 14px; margin-top: 14px; }
  .content-grid > div:last-child .activity-panel,
  .content-grid > div:last-child .support-card { display: none; }
  .panel { border-radius: 13px; }
  .panel-header { align-items: flex-start; gap: 12px; padding: 17px 14px 12px; }
  .dashboard .panel-header h2 { font-size: 19px; }
  .dashboard .panel-header p { margin-top: 4px; font-size: 12px; }
  .view-toggle { display: none !important; }

  .report-tools { display: grid; grid-template-columns: minmax(0,1fr) 44px; align-items: center; gap: 8px; padding: 4px 14px 12px; }
  .report-search { height: 44px; padding: 0 12px; }
  .dashboard .report-search input { font-size: 16px; }
  .report-tools > .dropdown { width: 44px; }
  .filter-button { width: 44px; height: 44px; justify-content: center; padding: 0; font-size: 16px; }
  .filter-button span { display: none; }
  .filter-menu { width: min(250px, calc(100vw - 28px)); }
  body.client-mode .report-tools { display: block; }

  .report-tabs { gap: 20px; padding: 0 14px; scrollbar-width: none; }
  .report-tabs::-webkit-scrollbar { display: none; }
  .report-tabs button { min-height: 42px; padding-bottom: 9px; font-size: 12px; }
  .report-list { min-height: 0; }
  .report-row { grid-template-columns: minmax(0,1fr) 42px; gap: 8px; min-height: 78px; padding: 10px 10px 10px 14px; }
  .report-main { gap: 11px; }
  .report-thumbnail { width: 76px; height: 57px; flex-basis: 76px; border-radius: 8px; }
  .dashboard .report-copy strong { font-size: 14px; }
  .dashboard .report-copy small { margin-top: 3px; font-size: 11px; }
  .report-row .report-client,
  .report-row .access-badge,
  .report-row .updated-time { display: none; }
  .report-row .row-menu { width: 42px; height: 42px; }
  .panel-footer { min-height: 48px; padding: 12px 14px; }
  .panel-footer .btn-link { display: none; }

  body.client-mode .welcome-row { margin-bottom: 15px; }
  body.client-mode .client-access-banner { display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: start; gap: 11px; margin-bottom: 14px; padding: 14px; border-radius: 14px; }
  body.client-mode .client-access-icon { width: 44px; height: 44px; border-radius: 11px; font-size: 19px; }
  body.client-mode .client-access-copy { min-width: 0; flex-basis: auto; }
  body.client-mode .client-access-copy > span:first-child { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  body.client-mode .client-access-copy > strong { margin-top: 4px; font-size: 16px; line-height: 1.25; }
  body.client-mode .client-access-copy > small { display: none; }
  body.client-mode .client-featured-meta { gap: 7px 12px; margin-top: 9px; }
  body.client-mode .client-featured-meta span:first-child { display: none; }
  body.client-mode .client-access-copy .client-featured-meta span { font-size: 9px; }
  body.client-mode .client-access-banner .btn-light { width: 100%; min-height: 44px; grid-column: 1 / -1; justify-content: center; margin: 0; }
  .client-library-order { width: auto; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 9px; }
  body.client-mode .report-header { align-items: flex-start; }
  body.client-mode .report-tools { padding-top: 2px; }
  body.client-mode .client-library-row { border-left-width: 3px; }
  .client-report-open { grid-template-columns: 76px minmax(0,1fr); gap: 12px; padding: 13px 14px; }
  .client-report-open .report-thumbnail { width: 76px; height: 57px; flex-basis: 76px; }
  .client-report-eyeline { min-height: 18px; margin-bottom: 3px; gap: 6px; font-size: 9px; }
  .latest-report-badge,
  .client-review-badge { padding: 2px 5px; font-size: 9px; }
  .client-report-copy > strong { font-size: 15px; line-height: 1.25; white-space: normal; }
  .client-report-copy > small { margin-top: 3px; font-size: 11px; }
  .client-report-summary { display: none; }
  .client-report-cta { display: none; }

  .management-section { margin-top: 30px; }
  .section-title-row { gap: 14px; margin-bottom: 12px; }
  .section-title-row h2 { font-size: 21px; }
  .section-title-row > div > p:last-child { font-size: 13px; line-height: 1.5; }
  .section-title-row > .btn-primary { width: 100%; min-height: 44px; }
  .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .table-responsive { overflow: visible; }
  .management-table,
  .management-table tbody { display: block; width: 100%; }
  .management-table thead { display: none; }
  .management-table tbody { display: grid; gap: 10px; }
  .management-table tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 3px 14px rgba(32,33,36,.035); }
  .management-table td { display: flex; min-width: 0; padding: 8px 0; color: var(--ink); border: 0; font-size: 13px; white-space: normal; }
  .management-table td:first-child { grid-column: 1 / -1; padding-top: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .management-table td:last-child { grid-column: 1 / -1; align-items: flex-end; justify-content: flex-end; padding-bottom: 0; }
  .management-table td[data-label] { flex-direction: column; gap: 3px; }
  .management-table td[data-label]::before { color: #7e8a88; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; content: attr(data-label); }
  .table-identity { min-width: 0; gap: 10px; }
  .table-identity > span { width: 40px; height: 40px; font-size: 10px; }
  .table-identity strong { overflow-wrap: anywhere; font-size: 14px; }
  .table-identity small { overflow-wrap: anywhere; font-size: 11px; }
  .management-table .status-pill { font-size: 11px; }
  .management-table .btn-soft { min-height: 38px; }
  body[data-role="broker"] #roster td[data-label="Broker"] { display: none; }

  .modal-dialog:not(.report-workspace-dialog) { display: flex; min-height: 100%; align-items: flex-end; margin: 0; }
  .modal-dialog:not(.report-workspace-dialog) .modal-content { max-height: 92dvh; overflow: hidden; border-radius: 18px 18px 0 0; }
  .modal-dialog:not(.report-workspace-dialog) .modal-body { overflow-y: auto; }
  .modal-dialog:not(.report-workspace-dialog) .modal-footer { padding-bottom: calc(18px + env(safe-area-inset-bottom)); background: var(--panel); }
  .modal-title { font-size: 24px; }
  .modal-header p { font-size: 13px; line-height: 1.5; }
  .role-option { min-height: 68px; padding: 11px; }
  .role-option strong { font-size: 14px; }
  .role-option small { font-size: 11px; }
  .entitlement-row { min-height: 58px; padding: 11px 12px; }
  .entitlement-row strong { font-size: 13px; }
  .entitlement-row small { font-size: 11px; }
  .secure-callout { align-items: flex-start; flex-wrap: wrap; }
  .secure-callout .btn { margin-left: 31px; }
  .toast-container { right: 0 !important; left: 0 !important; padding: 12px !important; }
  .toast-container .toast { width: 100%; }

  .preview-header { height: 64px; min-height: 64px; padding: 10px 12px; }
  .preview-header .report-back-button,
  .preview-actions .btn { width: 42px; height: 42px; min-height: 42px; padding: 0; }
  .preview-actions .btn-close { display: none; }
  .report-preview-layout { height: calc(100vh - 64px); height: calc(100dvh - 64px); }
  .mobile-report-page-picker.active { top: 72px; right: 10px; left: 10px; gap: 9px; min-height: 48px; padding: 6px 8px 6px 11px; border-radius: 11px; }
  .mobile-report-page-picker span { font-size: 9px; white-space: nowrap; }
  .mobile-report-page-picker select { min-height: 38px; padding: 6px 30px 6px 9px; font-size: 14px; }
  .chartmaster-report-layout .report-canvas { height: calc(100vh - 64px); height: calc(100dvh - 64px); overflow-x: hidden; overflow-y: auto; padding: 68px 10px calc(28px + env(safe-area-inset-bottom)); }
  .report-filter-bar { position: relative; top: auto; display: grid; max-width: none; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 10px; padding: 10px; }
  .report-filter-bar > div { min-width: 0; }
  .report-filter-bar label { font-size: 10px; }
  .report-filter-bar select { width: 100%; min-height: 44px; padding-left: 9px; font-size: 14px; }
  .report-filter-bar > span { display: none; }
  .report-paper { width: 100%; min-width: 0; min-height: 0; aspect-ratio: auto; border-radius: 12px; }
  .paper-header { height: auto; min-height: 88px; padding: 18px 16px; }
  .paper-header span { font-size: 10px; }
  .paper-header strong,
  .paper-period strong { font-size: 17px; }
  .paper-header small { font-size: 11px; }
  .paper-content { min-height: 0; padding: 20px 14px 16px; }
  .paper-hero > p { font-size: 10px; }
  .paper-hero h3 { font-size: clamp(23px,7vw,28px); line-height: 1.18; }
  .paper-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-top: 16px; }
  .paper-metrics > div { min-width: 0; padding: 10px 8px; }
  .paper-metrics span,
  .paper-metrics small { font-size: 10px; line-height: 1.3; }
  .paper-metrics strong { margin: 4px 0; font-size: clamp(20px,5.5vw,24px); }
  .market-chart { min-height: 255px; margin-top: 16px; padding: 14px 10px 10px; }
  .chart-title-row { gap: 8px; flex-direction: column; }
  .chart-title-row strong { font-size: 14px; }
  .chart-title-row small,
  .chart-legend { font-size: 10px; }
  .bar-chart { height: 170px; gap: 8px; padding-right: 4px; padding-left: 4px; }
  .bar-labels { font-size: 9px; }
  .paper-content footer { gap: 5px; margin-top: 13px; font-size: 9px; line-height: 1.4; flex-direction: column; }
  .mobile-report-next { display: flex; width: 100%; min-height: 68px; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 13px 15px; color: var(--ink); border: 1px solid #e4b6bc; border-radius: 12px; background: var(--panel); text-align: left; box-shadow: 0 5px 16px rgba(74,0,9,.06); }
  .mobile-report-next[hidden] { display: none !important; }
  .mobile-report-next > span { display: flex; min-width: 0; flex-direction: column; }
  .mobile-report-next small { color: var(--brand); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
  .mobile-report-next strong { margin-top: 3px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-report-next > i { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; color: #fff; border-radius: 10px; background: var(--brand); }
}

@media (max-width: 575.98px) {
  .topbar-actions > .position-relative { display: none; }
  .dashboard { padding-right: 12px; padding-left: 12px; }
  .welcome-actions { display: grid; flex-direction: initial; }
  .client-library-order > span:first-child { display: none; }
  .report-header { align-items: flex-start; }
  .report-tools { align-items: center; flex-direction: initial; }
  .filter-button { width: 44px; }
  .report-tabs { gap: 17px; }
  .paper-period { padding-left: 8px; }
  .paper-header strong,
  .paper-period strong { font-size: 18px; }
}

html[data-theme="dark"] .management-table tbody tr,
html[data-theme="dark"] .mobile-report-next { background: var(--panel); }
html[data-theme="dark"] .mobile-report-next { border-color: #64323a; box-shadow: 0 7px 18px rgba(0,0,0,.2); }

html[data-theme="dark"] .market-access-card,
html[data-theme="dark"] .access-assignment-panel { border-color: var(--line); background: var(--panel); }
html[data-theme="dark"] .access-report-picker,
html[data-theme="dark"] .access-panel-heading,
html[data-theme="dark"] .market-connection-summary { border-color: var(--line); background: #171717; }
html[data-theme="dark"] .market-broker-chips span,
html[data-theme="dark"] .effective-access-chips span { color: #d4d4d4; border-color: #3b3b3b; background: #202020; }
html[data-theme="dark"] .access-target-row { border-color: #303030; }
html[data-theme="dark"] .access-target-row:hover { background: #1b1b1b; }
html[data-theme="dark"] .access-target-row:has(input:checked) { background: #32181c; }
html[data-theme="dark"] .access-target-icon { color: #c9c9c9; background: #292929; }
html[data-theme="dark"] .effective-access { border-color: #4b3034; background: #24191b; }

@media (max-width: 767.98px) {
  .market-access-grid,
  .access-assignment-grid { grid-template-columns: 1fr; }
  .table-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
  .table-search { width: 100%; min-width: 0; grid-column: 1 / -1; }
  .table-controls > select { width: 100%; min-width: 0; font-size: 12px; }
  .table-pagination { margin-top: 10px; padding: 10px 4px; border: 0; background: transparent; }
  .table-pagination > div { gap: 6px; }
  .table-pagination button { width: 42px; height: 42px; }
  .table-empty-row { display: block !important; }
  .table-empty-row td { display: block !important; height: auto; grid-column: 1 / -1 !important; padding: 34px 14px !important; text-align: center; }
  .market-access-card { padding: 15px; }
  .market-access-heading { grid-template-columns: 38px minmax(0,1fr) auto; gap: 9px; }
  .market-pin { width: 38px; height: 38px; }
  .market-access-heading strong { font-size: 14px; }
  .market-access-heading small { font-size: 10px; }
  .market-broker-chips { margin-top: 12px; }
  .access-modal-body { padding: 14px; }
  .access-report-picker { grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; padding: 11px; }
  .access-report-picker > span { padding: 0; font-size: 11px; white-space: normal; }
  .access-assignment-grid { gap: 12px; }
  .access-panel-heading { padding: 12px; }
  .access-target-list { max-height: none; }
  .access-target-row { min-height: 64px; padding: 10px 12px; }
  .access-target-row strong { font-size: 13px; }
  .access-target-row small { font-size: 10px; }
  .effective-access { align-items: stretch; flex-direction: column; }
  .effective-access-chips { justify-content: flex-start; }
  #entitlementModal .modal-footer,
  #marketModal .modal-footer { display: grid; grid-template-columns: 1fr 1.35fr; }
  #entitlementModal .modal-footer .btn,
  #marketModal .modal-footer .btn { width: 100%; min-height: 46px; }
}

html[data-theme="dark"] .table-search,
html[data-theme="dark"] .table-controls > select,
html[data-theme="dark"] .table-pagination button { color: #dedede; border-color: #3a3a3a; background-color: #1a1a1a; }
html[data-theme="dark"] .table-search input { color: #f1f1f1; }
html[data-theme="dark"] .table-pagination button:not(:disabled):hover { color: #fff; border-color: #8c3f49; background: #32181c; }

