/* SBA compact density — load LAST, after styles.css and report-charts.css.
   Screen density and accessible interactions: preserve grid flow, direction, disclosure state,
   centered dialog bounds/single body scroller and server-owned print/PDF layouts. */
@media screen {
  :root {
    --compact-space-1: 4px;
    --compact-space-2: 8px;
    --compact-space-3: 12px;
    --compact-space-4: 16px;
    --compact-space-5: 20px;
    --compact-panel: var(--compact-space-4);
    --compact-gap: var(--compact-space-3);
    --compact-control: 44px;
    --compact-text: 14px;
    --compact-heading: clamp(30px, 2.6vw, 34px);
    --app-dialog-gutter: clamp(12px, 2vw, 24px);
    --app-dialog-padding: var(--compact-panel);
    /* Functional orange is independent of SBA's decorative/event brand token. */
    --functional-orange: #a95712;
    /* Also passes the darkest 14% event-color/white hover tint, not just white. */
    --muted: #58606b;
  }
  body { font-size: var(--compact-text); }
  /* Semantic page headings remain available to assistive technology. */
  .sr-only {
    position: absolute; inline-size: 1px; block-size: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%);
    white-space: nowrap; border: 0;
  }

  /* Naturally sized sticky masthead; utility controls remain in normal flow. */
  .sidebar, body.ltr .sidebar { padding: 6px clamp(12px, 2vw, 28px); gap: 6px 12px; }
  .sidebar .brand { gap: 3px; }
  .sidebar .brand-mark { width: 110px; height: 46px; }
  .sidebar .brand-copy .department-title { color: var(--functional-orange); line-height: 1.4; }
  .sidebar .nav-list { gap: var(--compact-space-1); }
  .sidebar .nav-button { min-height: var(--compact-control); padding: 7px 8px 9px; gap: 5px; line-height: 1.45; }
  .main-area, body.ltr .main-area { padding: 18px clamp(16px, 2.8vw, 40px) 32px; }
  .topbar { margin-bottom: var(--compact-space-3); padding-bottom: var(--compact-space-2); gap: 8px 12px; } .top-actions { gap: var(--compact-space-2); }
  .account-summary { padding: 4px 8px; gap: 6px; } .account-summary b, .account-summary small { line-height: 1.45; }
  .role-test-controls { padding: 4px 6px; gap: 6px; }
  .top-actions .role-menu-trigger { padding: 6px 10px; font-size: 14px; line-height: 1.45; }
  .role-menu-option { min-height: var(--compact-control); padding-block: 8px; }
  .role-menu-option b { font-size: 14px; }
  .role-test-warning, .role-test-status { margin-bottom: 12px; padding: 8px 12px; line-height: 1.5; }

  /* One heading rhythm, including the more-specific restored upload styles. */
  .page-heading, .invitations-dashboard .page-heading, .upload-layout > .page-heading {
    min-height: 0; margin-bottom: var(--compact-space-4); padding-top: 12px; gap: 10px 16px;
  }
  .page-heading h1, .sba-dashboard .page-heading h1, .upload-layout > .page-heading h1 {
    font-size: var(--compact-heading); line-height: 1.4;
  }
  .page-heading p, .upload-layout > .page-heading p { margin-top: 4px; font-size: 14px; line-height: 1.5; }
  .sba-dashboard .page-heading { margin: 16px 0; }
  .invitation-actions { padding-top: 0; }
  .section-heading, .upcoming-section-heading { margin-bottom: 8px; gap: 8px 12px; }
  .section-heading h2, .email-settings-card h2, .users-intro h2, .member-add-card h2,
  .request-section-heading h2, .office-sent-list > h2, .admin-mail-head h2 { font-size: 18px; line-height: 1.4; }
  .upcoming-section-heading h2, .event-lifecycle-heading h2 { font-size: 22px; line-height: 1.4; }

  /* 44px is a floor, never a fixed cap: long translations may grow/wrap. */
  .primary-button, .secondary-button, .decline-button, .delete-letter-button,
  .invitation-actions .primary-button, .invitation-actions .secondary-button,
  .member-action .secondary-button, .member-create-form .primary-button,
  .schedule-editor-head .secondary-button, .email-settings-form .secondary-button,
  .archive-popup-actions .primary-button, .archive-popup-actions .secondary-button,
  .role-test-controls .secondary-button, .myrequests-tabs [role="tab"] {
    min-height: var(--compact-control); padding: 8px 12px; font-size: 14px; line-height: 1.45;
  }
  .primary-button, .lang-button, .pagination-page.active, .reminder-role-badge {
    background: var(--functional-orange); color: #fff;
  }
  .lang-button, .pagination-page.active { border-color: var(--functional-orange); }
  .primary-button:hover, .lang-button:hover { background: var(--teal-950); color: #fff; }
  .lang-button:hover { border-color: var(--teal-950); }
  .secondary-button, .secondary-button:hover { color: var(--ink); background: #fff; }
  /* Low-specificity functional text does not replace existing dark context colors. */
  .open-button, .text-button, .map-link, .tab.active, .eyebrow, .decision-kicker,
  .workspace-decision, .vip-attendee-chip, .agenda-date, .dashboard-card p,
  .stat .stat-note, .brand-copy span { color: var(--functional-orange); }
  .text-button, .open-button, .text-action { font-size: 13px; line-height: 1.5; }
  .button-row, .decision-actions, .confirmation-actions, .contact-modal-actions,
  .task-record-actions, .report-filter-actions, .reminder-actions { gap: var(--compact-space-2); }
  :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.file-input) {
    min-block-size: var(--compact-control); padding: 8px 10px; font-size: var(--compact-text); line-height: 1.4;
  }
  .filter-control.search input { padding-inline-start: 33px; }
  .field textarea, .reason-dialog textarea { min-height: 96px; }
  .form-grid, .document-grid, .contact-form-fields, .contact-grid { gap: var(--compact-gap); }
  .field, .contact-form-fields label, .contact-grid label, .report-filters label,
  .member-create-form label, .member-controls label, .contacts-browser .contacts-insight-filters > label { gap: 4px; }
  .field label, .contact-form-fields label, .contact-grid label, .report-filters label,
  .member-create-form label, .member-controls label { font-size: 13px; line-height: 1.5; }
  .form-submit { margin-top: var(--compact-space-3); }
  .document-editor, .schedule-editor, .vip-attendee-field { padding: var(--compact-space-3); }
  .schedule-rows { margin-top: 8px; gap: 8px; }
  .schedule-row { padding-top: 8px; gap: 8px; }
  /* Same upload treatment for event review and office-only sender. */
  .upload-card, .upload-layout .upload-card { padding: var(--compact-panel); }
  .upload-zone, .upload-layout .upload-zone { min-height: 180px; padding: 16px; }
  .upload-layout .upload-zone .upload-glyph { inline-size: 44px; block-size: 44px; flex-basis: 44px; margin-bottom: 8px; font-size: 22px; }
  .upload-zone strong { font-size: 15px; line-height: 1.5; }
  .upload-zone > span:not(.upload-glyph) { font-size: 13px; line-height: 1.5; }
  .upload-layout .divider { margin: 12px 0; }
  .upload-layout .manual-trigger { padding: 8px 12px; font-size: 14px; }
  .upload-layout .manual-form.open:not([hidden]):not([inert]) { margin-top: 16px; }
  .file-name, .extraction-card { margin-top: 8px; padding: 8px 10px; }
  .upload-layout > .button-row { margin-bottom: 8px; }

  /* Full banner artwork is contained, not cropped to gain density. */
  .sba-dashboard .sba-studio-banner { min-height: 168px; }
  .sba-dashboard .sba-studio-banner img { height: 168px; min-height: 0; object-fit: contain; }
  /* Wide screens use the artwork's own ratio: no burgundy side gutters and
     no stretched or cropped lettering. Narrow-screen sizing stays unchanged. */
  @media (min-width: 1000px) {
    .sba-dashboard .sba-studio-banner img { height: auto; }
  }
  .studio-date { padding: 4px 8px; line-height: 1.45; }
  .stat-row, .invitations-dashboard .stat-row { margin-bottom: 12px; gap: var(--compact-gap); }
  .stat, .invitations-dashboard .stat { min-height: 76px; padding: 10px 12px; }
  .stat span { font-size: 12px; line-height: 1.45; }
  .stat strong, .invitations-dashboard .stat strong { margin-top: 2px; font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
  .stat .stat-note { margin-top: 3px; font-size: 11px; }
  .sba-metric-grid, .upcoming-dashboard-grid, .dashboard-summary { gap: var(--compact-gap); }
  .sba-metric-card { min-height: 124px; padding: 12px; gap: 4px 10px; }
  .metric-icon { width: 44px; height: 44px; font-size: 22px; }
  .metric-copy { gap: 2px; }
  .metric-copy b { font-size: 15px; line-height: 1.4; }
  .metric-copy strong { font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
  .metric-copy small { font-size: 12px; line-height: 1.4; }
  .dashboard-card { min-height: 96px; padding: 12px; gap: 10px; }
  .upcoming-dashboard-section { margin-top: var(--compact-space-5); }
  .dashboard-event-card { min-height: 148px; }
  .dashboard-event-date { padding: 12px 6px; }
  .dashboard-event-date strong { font-size: 36px; line-height: 1; }
  .dashboard-event-date span { margin-top: 4px; }
  .dashboard-event-copy { padding: 12px; }
  .dashboard-event-copy h3 { font-size: 16px; line-height: 1.45; margin-bottom: 6px; }
  .dashboard-event-copy p { font-size: 13px; line-height: 1.5; }
  .dashboard-event-copy .text-action { padding-top: 4px; }
  /* Shared ledgers, lifecycle, incoming letters and sent receipts. */
  .filters, .invitations-dashboard .filters, .dashboard-popup-table .filters { padding: 12px; gap: 8px; }
  .tabs, .invitations-dashboard .tabs, .dashboard-popup-table .tabs { padding-inline: 12px; }
  .tab { padding: 8px 10px; font-size: 13px; line-height: 1.5; }
  .invite-table th, .contact-table th, .invitations-dashboard .invite-table th { padding: 8px 12px; }
  .invite-table th, .contact-table th { color: #5d646f; }
  .invite-table td, .contact-table td { padding: 8px 12px; font-size: 14px; line-height: 1.5; }
  .workspace-list, .task-list { gap: var(--compact-gap); }
  .workspace-invitation, .ongoing-events-list .workspace-invitation { padding-block: 12px; padding-inline-end: 12px; gap: 10px; }
  .workspace-invitation h3 { margin: 6px 0 3px; font-size: 16px; line-height: 1.45; }
  .workspace-invitation p, .workspace-meta { font-size: 14px; line-height: 1.5; }
  .workspace-meta { margin-top: 6px; gap: 4px 10px; }
  .workspace-intro, .role-gate, .decision-queue, .team-reminder-note { padding: 10px 12px; margin-bottom: 12px; }
  .event-lifecycle-section, .event-lifecycle-section + .event-lifecycle-section { margin-top: 20px; }
  .event-lifecycle-heading { margin-bottom: 10px; padding-bottom: 8px; gap: 8px 12px; }
  .in-progress-events .eyebrow { color: var(--functional-orange); }
  .expiry-review-events { padding-top: 16px; }
  .completed-events { padding: var(--compact-panel); }
  .myrequests-tabs { margin-bottom: 12px; padding-bottom: 8px; gap: 8px; }
  .myrequests-list, .office-sent-list { padding: var(--compact-panel); }
  .request-section-heading { padding: 12px 16px 8px; }
  .request-section-heading p { margin-top: 4px; line-height: 1.5; }
  .assigned-tasks-page, .office-sent-list { margin-top: 16px; }
  .assigned-task-record, .office-letter-record, .office-sent-record { padding: 12px; }
  .office-sent-list > h2 { margin-bottom: 12px; }
  .office-sent-record + .office-sent-record { margin-top: 8px; }
  .assigned-task-record h3 { margin: 8px 0 4px; }
  .task-meta { margin-block: 4px; font-size: 14px; line-height: 1.5; }
  .task-refusal { margin-block: 8px; padding: 8px 10px; line-height: 1.5; }
  .task-record-actions { margin-top: 8px; }
  .record-pagination, .myrequests-page .record-pagination { margin-top: 12px; padding: 8px 12px; gap: 8px; }
  .pagination-summary { color: var(--muted); }
  .empty { padding: 24px 16px; }
  .empty-card, .dashboard-popup-empty { padding: 12px; font-size: 14px; line-height: 1.5; }
  .team-loading { min-height: 40vh; gap: 8px; }
  /* Organization/person values stay legible; selected-option containment stays. */
  .contacts-card, .contact-form, .archive-browser { padding: var(--compact-panel); }
  .contacts-layout, .contacts-list { gap: var(--compact-gap); }
  .contacts-list { margin-top: 12px; }
  .contacts-browser .contacts-insight-filters { gap: 10px; }
  .contacts-insight-filters select { color: var(--ink); background: #fff; }
  .contact-record { padding: 12px; }
  .contact-record h2 { font-size: 16px; line-height: 1.45; }
  .contact-record p, .contact-record-meta { font-size: 14px; line-height: 1.5; }
  .contact-record-meta { margin-top: 8px; gap: 4px; }
  .contact-record-meta > span { gap: 4px 8px; line-height: 1.5; }
  .contact-record-meta b { color: var(--muted); font-size: 12px; }
  .contact-count { font-size: 18px; }
  .contact-count-hint { margin: 8px 0 12px; font-size: 13px; }
  .contact-people { gap: 12px; }
  .contact-person-data + .contact-person-data { padding-top: 12px; }
  .contact-person-data h3 { margin-top: 8px; font-size: 14px; }
  .contact-person-data .contact-record-actions { margin-top: 6px; }
  .contact-record-actions .text-button { padding: 8px 10px; font-size: 13px; line-height: 1.5; }
  .contact-record-footer { margin-top: 8px; padding-top: 8px; font-size: 12px; }
  .selected-organization-count { padding: 8px 12px; line-height: 1.5; }
  .contact-linked-letters { margin-block: 8px; padding: 8px 12px; }
  .contact-linked-letters .related-records, .related-records { margin-top: 12px; padding-top: 8px; }
  .related-invitation { padding-block: 8px; gap: 4px 8px; }
  .related-invitation strong { line-height: 1.5; }
  .contact-detail-actions { margin-top: 8px; }
  /* Archive categories/list: retain their existing responsive columns. */
  .archive-category-grid, .archive-grid { gap: 12px; margin-top: 12px; }
  .archive-category-card { min-height: 116px; padding: 12px; gap: 8px; }
  .archive-category-card b { font-size: 16px; line-height: 1.45; }
  .archive-category-card small { font-size: 13px; line-height: 1.5; }
  .archive-card { padding: 12px; }
  .archive-card h3 { margin-top: 8px; }
  .archive-list, .archive-popup-list { gap: 8px; margin-top: 12px; }
  .archive-popup-list, .dashboard-popup-list { padding-top: 8px; }
  .archive-entry { padding-block: 10px; gap: 10px; }
  .archive-entry p, .archive-popup-entry p { font-size: 14px; line-height: 1.5; }
  .archive-popup-entry { padding: 12px; }
  .archive-popup-entry h3 { margin-top: 6px; }
  .archive-popup-actions { margin-top: 8px; }
  .archive-popup-filters { padding-top: 8px; gap: 8px; }
  .archive-date-range { gap: 8px; padding-bottom: 8px; }
  /* Reports are bar-series, not 200px-tall individual SVG bars. */
  .report-filters { padding: var(--compact-panel); gap: 10px; margin-bottom: 12px; }
  .report-scope-guidance, .report-scope { font-size: 14px; line-height: 1.5; margin-block: 8px 12px; }
  .report-metadata { padding-block: 8px; gap: 8px 16px; font-size: 12px; }
  .report-charts { margin-block: 16px; }
  .report-charts .report-charts__heading h2 { font-size: 18px; line-height: 1.4; }
  .report-charts .report-charts__note { margin-block: 8px 12px; font-size: 14px; line-height: 1.5; }
  .report-charts .report-charts__grid { gap: 12px; }
  .report-charts .report-charts__panel { padding: 12px; border-radius: 16px; }
  .report-charts .report-charts__panel h3 { margin-bottom: 8px; line-height: 1.45; }
  .report-charts .report-charts__series { min-height: 200px; align-content: start; gap: 8px; }
  .report-charts .report-charts__label { font-size: 14px; line-height: 1.5; }
  .report-charts .report-charts__empty { padding: 12px; line-height: 1.5; }
  /* Members and multi-role choices retain every 44px selectable row. */
  .users-intro, .member-add-card { padding: var(--compact-panel); margin-bottom: 12px; }
  .member-add-card, .member-record { gap: 12px; }
  .member-record { padding: 12px 16px; }
  .member-identity h2 { font-size: 14px; line-height: 1.45; }
  .member-identity p, .member-meta b { font-size: 13px; line-height: 1.5; }
  .member-meta span, .member-action small { color: var(--muted); font-size: 12px; line-height: 1.5; }
  .member-identity p, .member-create-form label small { color: var(--muted); }
  .member-role-group { padding: 8px 10px; }
  .member-role-options, .member-create-form .member-role-options { gap: 4px 8px; }
  .member-role-options .member-role-choice { min-height: 44px; font-size: 13px; line-height: 1.45; padding: 4px; }
  .member-role-group > small { color: var(--muted); margin-top: 4px; font-size: 12px; }
  .access-requests-panel, .admin-mail-panel { margin-top: 16px; }
  .access-requests-panel { padding: var(--compact-panel); } .access-requests-list { gap: 12px; }
  .access-request-record { padding-block: 12px; gap: 12px; }
  .admin-mail-head { padding: 12px 16px 0; }
  .mail-configuration, .mail-sender { margin: 8px 16px 12px; }
  /* Dialog geometry/focus/scroll is owned by the existing shared contract. */
  .app-dialog > .app-dialog-header,
  .app-dialog > :is(.drawer-head, .dashboard-popup-head, .contact-modal-head, .reminder-modal-head) { padding: var(--app-dialog-padding); gap: 12px; }
  .app-dialog-header :is(h1, h2, h3),
  .app-dialog :is(.drawer-head, .dashboard-popup-head, .contact-modal-head, .reminder-modal-head) h2 { font-size: clamp(20px, 1.8vw, 23px); line-height: 1.4; }
  .app-dialog-header p { margin-top: 4px; line-height: 1.5; }
  .app-dialog > .app-dialog-body { padding: var(--app-dialog-padding); }
  .app-dialog > .app-dialog-footer { padding: 10px var(--app-dialog-padding); gap: 8px; }
  .app-dialog-body > h2 { margin: 0 0 8px; font-size: 21px; line-height: 1.4; }
  .detail-list, .contact-detail-list { margin-top: 12px; gap: 8px; }
  .detail { padding-block: 8px; gap: 4px 12px; line-height: 1.55; }
  .detail-list > .detail, .contact-detail-list > div { padding: 10px; gap: 4px; }
  .detail > .detail-value, .contact-detail-list b { font-size: 14px; line-height: 1.55; }
  .contact-detail-list span { line-height: 1.5; }
  .decision-panel, .reminder-panel, .event-reminder-panel, .task-panel,
  .invitation-history { margin-top: 12px; padding: 12px; }
  .invitation-audit { margin-top: 12px; padding: 4px 12px; }
  .decision-panel p, .reminder-panel p, .event-reminder-panel p { line-height: 1.5; }
  .decision-panel h3, .reminder-panel h3, .task-panel h3 { margin-block: 4px 8px; font-size: 16px; }
  .app-dialog .confirmation-check { margin-top: 12px; padding: 8px 10px; line-height: 1.5; }
  .dashboard-popup-record { padding: 10px 12px; gap: 8px; }
  .dashboard-popup-record-copy strong, .dashboard-popup-record-copy small { line-height: 1.5; }
  .calendar-detail-sessions li { margin-bottom: 8px; }
  .reminder-section, .email-settings-card { padding: var(--compact-panel); gap: 12px; }
  .reminder-layout { gap: 12px; }
  .reminder-card { padding-block: 10px; gap: 10px; }
  /* No fixed row heights, seven columns unchanged; busy days grow naturally. */
  .calendar-page .calendar-toolbar { min-block-size: 56px; margin-bottom: 12px; padding: 4px 10px; gap: 8px 12px; }
  .calendar-page .calendar-mode-switch { padding: 2px; }
  .calendar-page .calendar-mode-switch button { padding: 8px 12px; }
  .calendar-board-title, .calendar-page .month-board .calendar-board-title { min-block-size: 76px; padding: 10px 16px; }
  .calendar-board-title h2, .calendar-page .month-board .calendar-board-title h2 { font-size: 24px; line-height: 1.3; }
  .calendar-board-title span, .calendar-page .month-board .calendar-board-title span { margin-top: 4px; font-size: 14px; line-height: 1.5; }
  .calendar-page .month-calendar-scroll .month-calendar-grid { min-height: 0; }
  .calendar-page .month-calendar-scroll .month-calendar-cell { min-height: 120px; padding: 8px; }
  .calendar-page .month-calendar-scroll .month-calendar-weekdays span { padding-block: 8px; }
  .month-calendar-scroll .month-cell-events { margin-top: 4px; gap: 6px; }
  .calendar-page .month-calendar-scroll .calendar-schedule-event, .week-events .calendar-schedule-event { min-height: 52px; padding: 7px 8px; gap: 6px; }
  .calendar-page .month-calendar-scroll .calendar-schedule-event strong,
  .calendar-page .month-calendar-scroll .calendar-schedule-event small,
  .week-events .calendar-schedule-event strong, .week-events .calendar-schedule-event small { font-size: 12px; line-height: 1.5; }
  .week-day-column { min-height: 300px; }
  .week-day-column header { padding: 10px; }
  .week-events { padding: 8px; gap: 6px; }
  .daily-schedule-header { padding: 8px 12px; }
  .daily-event-row { min-height: 64px; padding: 8px 12px; gap: 8px; }
  .daily-event-title strong { font-size: 15px; }
  .calendar-page .calendar-board-title span, .week-events p, .calendar-no-events,
  .day-slot time, .daily-event-time small, .week-events .calendar-schedule-event small { color: var(--muted); }
  @media (max-width: 1024px) {
    .sidebar .brand-mark { width: 100px; height: 42px; }
    .main-area, body.ltr .main-area { padding-top: 16px; }
  }
  @media (max-width: 768px) {
    :root { --compact-panel: 14px; --compact-gap: 10px; --compact-heading: clamp(25px, 4vw, 28px); }
    .main-area, body.ltr .main-area { padding: 14px 16px 28px; }
    :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.file-input) { font-size: 16px; }
    .workspace-invitation, .ongoing-events-list .workspace-invitation { padding-block: 12px; padding-inline-end: 12px; gap: 8px 10px; }
    .office-letter-record, .office-sent-record { padding: 12px; }
    .daily-event-row { padding: 12px; gap: 8px; }
  }
  @media (max-width: 620px) {
    .sidebar .brand { gap: 8px; }
    .sidebar .brand-mark { width: 90px; height: 38px; }
    .sidebar .nav-button { min-height: 44px; padding: 4px 3px 6px; gap: 2px; font-size: 11px; }
    .main-area, body.ltr .main-area { padding: 12px 12px 24px; }
    .page-heading, .upload-layout > .page-heading { margin-bottom: 12px; }
    .topbar { margin-bottom: 12px; padding-bottom: 8px; }
    .upload-zone, .upload-layout .upload-zone { min-height: 168px; padding: 14px 12px; }
    .sba-dashboard .sba-studio-banner { min-height: 150px; } .sba-dashboard .sba-studio-banner img { height: 150px; }
    .request-section-heading { padding: 12px 14px 6px; }
    .calendar-page .calendar-toolbar { padding: 8px; }
    .calendar-page .month-board .calendar-board-title h2 { font-size: 22px; }
    .app-dialog > .app-dialog-footer { padding-block: 8px; }
  }
  @media (max-height: 500px) and (min-width: 621px) {
    :root { --app-dialog-gutter: 10px; --app-dialog-padding: 12px; }
    .sidebar .brand { gap: 0; }
    .sidebar .brand-mark { width: 90px; height: 36px; }
    .sidebar .nav-button { padding: 6px 4px; gap: 4px; }
    .app-dialog > .app-dialog-header { padding-block: 10px; }
    .app-dialog > .app-dialog-footer { padding-block: 8px; }
  }
}

/* Government-facing calendar finish: restrained chrome, real 44px hit areas,
   no native beveled date/more buttons, full event names remain readable. */
@media screen {
  .calendar-page { --calendar-grid-line: #e0e3e7; }
  .calendar-page .calendar-board { border-color: var(--calendar-grid-line); border-radius: 12px; box-shadow: 0 3px 14px rgba(24, 32, 43, .035); }
  .calendar-page .calendar-toolbar { border-color: var(--calendar-grid-line); border-radius: 12px; box-shadow: 0 2px 10px rgba(24, 32, 43, .025); }
  .calendar-page .calendar-board-title { background: #fff; border-bottom-color: var(--calendar-grid-line); }
  .calendar-page .month-calendar-scroll .month-calendar-weekdays { background: #f7f8fa; }
  .calendar-page .month-calendar-scroll .month-calendar-weekdays span { color: #545e6b; font-weight: 700; padding-block: 9px; }
  .calendar-page .month-calendar-scroll .month-calendar-cell { background: #fff; }
  .calendar-page .month-calendar-scroll .month-calendar-cell.other-month { background: #fafbfc; }
  .calendar-page .month-calendar-scroll .month-calendar-cell.today { background: #fffaf5; }
  .calendar-page .month-calendar-scroll .month-day-number,
  .calendar-page .month-calendar-scroll button.month-day-number {
    appearance: none; display: inline-flex; align-items: center; justify-content: flex-start;
    border: 0; background: transparent; box-shadow: none; color: #4d5866;
    min-inline-size: 44px; min-block-size: 44px; inline-size: auto; block-size: auto;
    max-inline-size: 100%; margin: 0; padding: 5px 8px; border-radius: 7px;
    font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1.5;
    text-align: start; white-space: normal;
  }
  .calendar-page .month-calendar-scroll .other-month .month-day-number { color: #6b717a; }
  .calendar-page .month-calendar-scroll .month-calendar-cell.today > .month-day-number { background: #7c1735; color: #fff; }
  .calendar-page .month-calendar-scroll .month-calendar-cell:not(.today) > button.month-day-number:hover { color: #8a4d12; background: #f6f1e9; }
  .calendar-page .month-calendar-scroll .calendar-schedule-event {
    border: 1px solid #e3e7eb; border-inline-start: 3px solid var(--event-color);
    border-radius: 7px; background: color-mix(in srgb, var(--event-color) 4%, white);
    box-shadow: none; gap: 5px; padding: 7px 8px;
  }
  .calendar-page .month-calendar-scroll .calendar-schedule-event:hover { border-color: var(--event-color); background: color-mix(in srgb, var(--event-color) 8%, white); }
  .calendar-page .month-calendar-scroll .calendar-schedule-event strong { font-weight: 700; line-height: 1.5; }
  .calendar-page .month-calendar-scroll .calendar-schedule-event small { color: #576271; font-size: 12px; line-height: 1.5; }
  .calendar-page .month-calendar-scroll .calendar-more {
    appearance: none; display: inline-flex; justify-content: center; align-items: center;
    min-block-size: 44px; min-inline-size: 44px; max-inline-size: 100%; width: 100%;
    padding: 6px 10px; border: 1px dashed #d3c6b7; border-radius: 7px;
    background: #fcfaf7; box-shadow: none; color: #875017;
    font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1.5;
    direction: ltr; unicode-bidi: isolate;
  }
  .calendar-page .month-calendar-scroll .calendar-more:hover { border-color: #b97022; background: #faf3e9; }
}

@media screen {
  .workspace-invitation > .secondary-button,
  .reminder-actions .primary-button, .reminder-actions .secondary-button,
  .mail-table .secondary-button { min-height: 44px; padding: 8px 12px; font-size: 14px; line-height: 1.45; }
  .reminder-section .section-heading h2 { font-size: 18px; line-height: 1.4; }
  .ongoing-events-list .workspace-invitation h3 { font-size: 16px; line-height: 1.45; }
}

@media screen and (max-width: 620px) {
  .calendar-page .calendar-nav { grid-template-columns: 44px minmax(0, 1fr) 44px auto; gap: 6px; }
  .calendar-page .calendar-nav .calendar-today { grid-column: 4; grid-row: 1; justify-self: end; min-height: 44px; padding-inline: 8px; font-size: 13px; }
  .calendar-page .calendar-nav .calendar-arrow { grid-row: 1; }
  .calendar-page .calendar-nav strong { grid-column: 2; grid-row: 1; }
  .calendar-page .calendar-toolbar { row-gap: 8px; }
}

/* Final screen-only interaction policy: no calendar/page gesture suppression,
   no print changes, no truncation, and no animation of layout/paint properties. */
@media screen {
  /* Preserve entered line breaks, collapse hanging layout spaces that extend
     mixed RTL/LTR runs beyond the value column in Firefox. Data is unchanged. */
  .detail > b { white-space: pre-line; unicode-bidi: plaintext; padding-inline: 6px; }
  .workspace-returned-task { white-space: pre-line; unicode-bidi: plaintext; padding-inline: 6px; }

  /* Native actions only; the passive other-month date span is not a button. */
  button, a[href], summary, .upload-zone {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(169, 87, 18, .22);
  }
  .myrequests-tabs [role="tab"]:focus-visible { outline-color: var(--app-focus-ring); }
  @media (forced-colors: active) {
    .myrequests-tabs [role="tab"]:focus-visible { outline-color: Highlight; }
  }
  /* The inert Clear action remains a retained keyboard focus target. */
  #clear-archive-dates { min-inline-size: 44px; min-block-size: 44px; }

  /* Supersede legacy implicit-all, top, background, color and shadow transitions.
     Hover colors/borders/shadows still change immediately as visible feedback. */
  .skip-link, .nav-button, .nav-button::after, .icon-button, .lang-button,
  .upload-zone, .vip-attendee-field, .invite-table tbody tr,
  .calendar-today, .calendar-arrow, .calendar-mode-switch button,
  .calendar-print, .calendar-pdf, .pagination-nav, .pagination-page { transition: none; }
  .primary-button, .secondary-button { transition: transform .16s ease; }
  .manual-form { transition: opacity .24s ease; }
  .sba-metric-card { transition: transform .2s ease; }
  .dashboard-popup-record, .contact-expand-toggle,
  .archive-category-card, .delete-letter-button { transition: transform .18s ease; }
  .role-menu-list { transition: opacity .16s ease, transform .16s ease; }

  /* Explicit selected text fixes the more-specific masthead's neutral override. */
  .sidebar .nav-button.active { color: var(--functional-orange); }
  .icon-button:hover, .contact-expand-toggle:hover { color: var(--functional-orange); }
  .related-invitation:hover strong, .text-action:hover { color: var(--teal-950); }
  @media (hover: hover) {
    .sidebar .nav-button:not(:disabled):hover { background: var(--teal-50); }
    .sidebar .nav-button:not(.active):not(:disabled):hover { color: var(--functional-orange); }
    .tab:not(:disabled):hover { background: var(--teal-100); }
    .tab:not(.active):not(:disabled):hover { color: var(--ink); }
    .myrequests-tabs [role="tab"]:not([aria-selected="true"]):not(:disabled):hover {
      border-color: var(--functional-orange); background: var(--teal-50); color: var(--ink);
    }
    .calendar-mode-switch button:not(.active):not([aria-pressed="true"]):not(:disabled):hover {
      border-color: #a7afb9; background: #e8e9ec; color: var(--ink);
    }
    .pagination-page:not(.active):hover, .pagination-nav:not(:disabled):hover {
      color: var(--functional-orange);
    }
  }
}

/* Approved desktop density, 9 November 2026: borrow a65e624 spacing only.
   Touch/mobile, tablet widths and short landscape keep the existing Compact UI.
   Do not reset the shared dialogs, visibility, data, print, motion or focus rules. */
@media screen and (min-width: 1025px) and (min-height: 501px) and (hover: hover) and (pointer: fine) {
  :root {
    --compact-panel: 24px;
    --compact-gap: 18px;
    --app-dialog-padding: clamp(20px, 2.4vw, 28px);
  }
  .main-area, body.ltr .main-area { padding: 24px clamp(16px, 3.5vw, 52px) 48px; }
  .topbar { margin-bottom: 20px; padding-bottom: 12px; gap: 12px 18px; }
  .page-heading, .invitations-dashboard .page-heading, .upload-layout > .page-heading {
    margin-bottom: 24px; padding-top: 17px; gap: 16px 22px;
  }
  .sba-dashboard .page-heading { margin: 30px 0 22px; }
  .section-heading, .upcoming-section-heading { margin-bottom: 14px; gap: 12px 18px; }
  .field, .contact-form-fields label, .contact-grid label, .report-filters label,
  .member-create-form label, .member-controls label { gap: 6px; }
  .button-row, .decision-actions, .confirmation-actions, .contact-modal-actions,
  .task-record-actions, .report-filter-actions, .reminder-actions { gap: 12px; }
  .form-submit { margin-top: 20px; }
  .document-editor, .schedule-editor, .vip-attendee-field { padding: 18px; }
  .schedule-rows { margin-top: 14px; gap: 12px; }
  .schedule-row { padding-top: 12px; gap: 12px; }

  .upload-card, .upload-layout .upload-card { padding: 24px; }
  .upload-zone, .upload-layout .upload-zone { min-height: 250px; padding: 28px; }
  .upload-layout .divider { margin: 18px 0; }
  .upload-layout .manual-form.open:not([hidden]):not([inert]) { margin-top: 22px; }
  .file-name, .extraction-card { margin-top: 12px; padding: 12px; }

  .stat-row, .invitations-dashboard .stat-row { margin-bottom: 20px; }
  .sba-metric-card { min-height: 172px; padding: 21px 21px 18px; gap: 5px 15px; }
  .metric-icon { width: 58px; height: 58px; font-size: 25px; }
  .metric-copy b { font-size: 17px; }
  .metric-copy strong { font-size: 45px; }
  .dashboard-card { padding: 18px; gap: 14px; }
  .upcoming-dashboard-section { margin-top: 28px; }
  .dashboard-event-date { padding: 16px 10px; }
  .dashboard-event-copy { padding: 18px; }
  .filters, .invitations-dashboard .filters, .dashboard-popup-table .filters { padding: 18px; gap: 12px; }
  .invite-table th, .contact-table th, .invitations-dashboard .invite-table th { padding: 12px 16px; }
  .invite-table td, .contact-table td { padding: 12px 16px; }
  .workspace-invitation, .ongoing-events-list .workspace-invitation {
    padding-block: 17px; padding-inline-end: 18px; gap: 16px;
  }
  .workspace-invitation h3 { margin: 9px 0 4px; }
  .event-lifecycle-section, .event-lifecycle-section + .event-lifecycle-section { margin-top: 28px; }
  .event-lifecycle-heading { margin-bottom: 16px; padding-bottom: 12px; }
  .assigned-task-record, .office-letter-record, .office-sent-record { padding: 18px; }
  .request-section-heading { padding: 18px 24px 12px; }
  .record-pagination, .myrequests-page .record-pagination { margin-top: 18px; padding: 12px 16px; }

  .contacts-list { margin-top: 18px; }
  .contacts-browser .contacts-insight-filters { gap: 14px; }
  .contact-record { padding: 16px; }
  .contact-record-meta { margin-top: 13px; gap: 6px; }
  .contact-record-meta > span { gap: 6px 10px; }
  .contact-record-footer { margin-top: 14px; padding-top: 10px; }
  .archive-category-grid, .archive-grid { gap: 18px; margin-top: 18px; }
  .archive-category-card, .archive-card, .archive-popup-entry { padding: 18px; }
  .archive-list, .archive-popup-list { gap: 12px; }
  .report-filters { gap: 16px; margin-bottom: 20px; }
  .report-charts .report-charts__grid { gap: 18px; }
  .report-charts .report-charts__panel { padding: 18px; }
  .member-record { padding: 18px 24px; }

  .app-dialog > .app-dialog-footer { padding: 16px var(--app-dialog-padding); gap: 12px; }
  .detail-list, .contact-detail-list { margin-top: 18px; gap: 12px; }
  .detail-list > .detail, .contact-detail-list > div { padding: 14px; gap: 6px; }
  .decision-panel, .reminder-panel, .event-reminder-panel, .task-panel,
  .invitation-history { margin-top: 18px; padding: 18px; }

  /* The interface aligns the value column; the value keeps its own bidi model.
     Physical alignment here is intentionally tied to html, not a value's dir. */
  html[dir="rtl"] :is(.contact-record-meta bdi, .contact-person-data bdi,
      .detail > b, .detail > .detail-value, .contact-detail-list b) { text-align: right; }
  html[dir="ltr"] :is(.contact-record-meta bdi, .contact-person-data bdi,
      .detail > b, .detail > .detail-value, .contact-detail-list b) { text-align: left; }

  .calendar-page .calendar-toolbar {
    grid-template-columns: minmax(0, 1fr) auto; min-block-size: 64px;
    padding: 10px 12px; gap: 12px 18px; margin-bottom: 20px;
    border-radius: 14px; box-shadow: 0 5px 16px rgba(38, 20, 28, .035);
  }
  .calendar-page .calendar-export-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .calendar-page .calendar-board { border-radius: 16px; }
  .calendar-board-title, .calendar-page .month-board .calendar-board-title {
    min-block-size: 113px; padding: 30px 30px 20px;
  }
  .calendar-board-title h2, .calendar-page .month-board .calendar-board-title h2 { font-size: 30px; }
  .calendar-board-title span, .calendar-page .month-board .calendar-board-title span { margin-top: 6px; }
  .calendar-page .month-calendar-scroll .month-calendar-cell { min-height: 170px; padding: 12px; }
  .month-calendar-scroll .month-cell-events { margin-top: 8px; gap: 8px; }
  .calendar-page .month-calendar-scroll .calendar-schedule-event {
    min-height: 57px; padding: 10px 9px; gap: 8px; border-radius: 9px;
    background: color-mix(in srgb, var(--event-color) 8%, white);
  }
  .calendar-page .month-calendar-scroll .month-calendar-cell.today { background: #fff8f9; }
  .calendar-page .month-calendar-scroll .month-calendar-cell.today > .month-day-number { background: #1f2836; }
  .week-events { padding: 12px; gap: 10px; }
  .daily-event-row { padding: 12px 16px; gap: 12px; }
}
