/* Shared screen typography. PDF letterheads and print layouts use their own styles. */
@media screen {
    html body {
        --ink: #252b35;
        --muted: #657080;
        --line: #e2e6eb;
        --bg: #f7f8fa;
        --ui-font: Arial, "Helvetica Neue", "Nirmala UI", sans-serif;
        font-family: var(--ui-font);
        font-size: 14px;
        line-height: 1.45;
        color: var(--ink);
    }
    html body :is(button, input, select, textarea) { font-family: var(--ui-font); }
    html body h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.65px; font-weight: 600; }
    html body h2 { font-weight: 600; line-height: 1.4; letter-spacing: -.2px; }
    html body h3 { font-weight: 600; line-height: 1.45; letter-spacing: 0; }
    html body p { line-height: 1.55; }
    html body small { font-size: 12px; line-height: 1.45; }
    html body :is(.muted, .text-link, .link) { font-size: 13px; }
    html body :is(.eyebrow, .pw-eyebrow, .td-eyebrow, .wa-eyebrow, .storage-eyebrow, .leads-eyebrow) {
        font-size: 10px; line-height: 1.5; letter-spacing: 1.1px; font-weight: 600;
    }

    /* Navigation and page frame. */
    html body .sidebar { padding: 22px 14px 16px; }
    html body .sidebar .brand { padding-bottom: 20px; }
    html body .sidebar nav a { font-size: 13px; line-height: 1.4; padding: 9px 12px; gap: 10px; }
    html body .sidebar .dept-nav a { font-size: 12px; padding: 8px 12px; }
    html body .sidebar nav a.active { font-weight: 600; }
    html body .nav-label { font-size: 10px; letter-spacing: 1.2px; margin: 20px 12px 8px; }
    html body .sidebar-bottom { font-size: 12px; }
    html body .sidebar-bottom small { font-size: 11px; }
    html body .topbar { height: 68px; padding-inline: 28px; }
    html body :is(.breadcrumb, .profile-link) { font-size: 13px; }
    html body :is(.today, .profile-link small) { font-size: 12px; }
    html body .shell > main { padding: 26px 28px; }
    html body .shell > footer { padding: 14px 28px 22px; font-size: 11px; }
    html body .page-heading { margin-bottom: 20px; gap: 16px; }
    html body .page-heading h1 { font-size: 28px; margin-bottom: 7px; }
    html body .page-heading p { font-size: 14px; color: #657080; line-height: 1.5; }
    html body .actions { gap: 10px; }

    /* Shared controls: readable labels and consistent, compact sizing. */
    html body .button { font-size: 13px; font-weight: 500; min-height: 38px; padding: 8px 14px; border-radius: 6px; line-height: 20px; }
    html body .small-button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
    html body label { font-size: 13px; line-height: 1.45; color: #465164; margin-bottom: 14px; }
    html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=file]), select, textarea) {
        font-size: 14px; line-height: 20px; padding: 9px 11px; border-radius: 6px;
    }
    html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=file]), select) { min-height: 40px; }
    html body input[type=file] { font-size: 13px; }
    html body input::placeholder, html body textarea::placeholder { color: #7a8492; opacity: 1; }
    html body .form-card { padding: 22px; }
    html body .form-grid { column-gap: 20px; }
    html body .form-footer { padding-top: 16px; margin-top: 14px; gap: 10px; }
    html body :is(.settings-note, .alert) { font-size: 13px; line-height: 1.5; padding: 12px 16px; }
    html body .filters { padding: 14px 16px; gap: 10px; }
    html body .filters :is(input, select) { font-size: 13px; }
    html body .filters .check-row { margin: 0; }
    html body .module-tabs { padding: 12px 16px; gap: 6px; }
    html body .module-tabs a { font-size: 13px; padding: 8px 12px; }
    html body .task-view-tabs { margin-bottom: 16px; }
    html body .task-view-tabs a { font-size: 13px; padding: 8px 15px; }

    /* Data tables retain full text and their existing horizontal scroll. */
    html body table { font-size: 13px; line-height: 1.45; }
    html body th { font-size: 12px; font-weight: 600; letter-spacing: 0; color: #5f6877; padding: 11px 16px; background: #f8f9fb; }
    html body td { padding: 10px 16px; color: #465164; line-height: 1.45; }
    html body td:first-child { color: #252b35; }
    html body td small { font-size: 12px; margin-top: 3px; }
    html body .table-title { font-size: 14px; line-height: 1.4; font-weight: 600; }
    html body .person { font-size: 12px; line-height: 1.4; }
    html body .task-created { font-size: 12px !important; line-height: 1.4; }
    html body .task-created time { font-size: 11px; }
    html body .badge { font-size: 11px; line-height: 16px; padding: 3px 7px; }
    html body :is(.priority, .access-chip) { font-size: 11px; }
    html body :is(.task-result-count, .pagination) { font-size: 12px; }
    html body .task-result-count { padding: 10px 16px; }
    html body .pagination { padding: 12px 16px; }
    html body .pagination nav a { font-size: 13px; }

    /* Panels and the overview use the same spacing rhythm. */
    html body .card { border-radius: 10px; margin-bottom: 18px; }
    html body .card-heading { padding: 16px 18px; gap: 12px; }
    html body .card-heading h2 { font-size: 16px; }
    html body .card-heading p { font-size: 12px; }
    html body .card-body { padding: 18px; }
    html body .list-row { padding: 11px 0; gap: 12px; line-height: 1.45; }
    html body .list-row small { font-size: 12px; margin-top: 3px; }
    html body .overview-banner { padding: 20px 22px; margin-bottom: 20px; border-radius: 10px; }
    html body .overview-banner h2 { font-size: 21px; margin: 6px 0; }
    html body .overview-banner p { font-size: 13px; }
    html body .stats { gap: 14px; margin-bottom: 20px; }
    html body .stat { padding: 16px 18px; }
    html body .stat > div { font-size: 13px; }
    html body .stat strong { font-size: 28px; margin: 8px 0 4px; font-weight: 600; }
    html body .stat small { font-size: 12px; }
    html body .dashboard-grid { gap: 20px; margin-bottom: 20px; }
    html body .dashboard-grid > .card { margin-bottom: 0; }
    html body .department-grid { padding: 16px; gap: 10px; }
    html body .department-tile { padding: 13px; }
    html body .department-tile h3 { font-size: 13px; }
    html body .department-tile small { font-size: 11px; }
    html body .activity { margin-bottom: 16px; }
    html body .activity strong { font-size: 13px; }
    html body .activity p { font-size: 12px; line-height: 1.5; }
    html body .activity small { font-size: 11px; }
    html body .notice h3 { font-size: 14px; }
    html body .notice p { font-size: 13px; line-height: 1.55; }
    html body .notice small { font-size: 11px; }
    html body .empty p { font-size: 13px; }
    html body .empty strong { font-size: 15px; }

    /* Project, department and person tiles. Status colours stay on the tile. */
    html body :is(.project-grid, .project-children-grid, .project-category-grid, .work-entity-grid, .finance-tools, .hr-tools, .storage-links-grid) { gap: 16px; }
    html body :is(.project-tile, .project-category, .project-child-tile, .work-entity-card, .finance-tool, .hr-tool, .storage-link-card, .pw-tile, .bp-tile, .lead-tile) { padding: 20px; border-radius: 10px; }
    html body :is(.project-tile, .project-category, .project-child-tile, .finance-tool, .hr-tool, .storage-link-card, .pw-tile, .bp-tile, .lead-tile) :is(h2, h3) { font-size: 18px; line-height: 1.4; margin: 12px 0 8px; }
    html body :is(.project-tile, .project-category, .project-child-tile, .finance-tool, .hr-tool, .storage-link-card, .pw-tile, .bp-tile, .lead-tile) p { font-size: 13px; line-height: 1.5; min-height: 0; margin-bottom: 16px; }
    html body :is(.project-meta, .project-open, .project-category-open, .project-child-open, .project-event-meta, .project-change, .storage-link-meta) { font-size: 12px; line-height: 1.45; }
    html body .project-category-top { margin-bottom: 16px; }
    html body .project-open { margin-top: 16px; padding-top: 12px; }
    html body .project-category-number { font-size: 28px; font-weight: 600; }
    html body .project-events { padding: 20px; }
    html body .project-events li { padding-bottom: 22px; }
    html body .project-events p { font-size: 13px; line-height: 1.55; }
    html body .project-event-meta time { font-size: 11px; }
    html body .project-person-choice small { font-size: 12px; }
    html body .work-browse-nav { gap: 14px; margin-bottom: 20px; }
    html body .work-browse-tile { padding: 16px 18px; border-radius: 10px; gap: 12px; }
    html body .work-browse-tile strong { font-size: 16px; font-weight: 600; }
    html body .work-directory { padding: 20px; }
    html body .work-directory-heading { margin-bottom: 18px; }
    html body .work-entity-card h3 { font-size: 16px; margin-bottom: 6px; }
    html body .work-entity-description { min-height: 0; font-size: 13px; line-height: 1.5; }
    html body .work-entity-counts { padding-top: 12px; }
    html body .work-entity-counts strong { font-size: 20px; font-weight: 600; }

    /* Task boards, task detail and assignment forms. */
    html body :is(.my-task-stat, .work-group-stat) { padding: 16px 18px; border-radius: 10px; }
    html body :is(.my-task-stat, .work-group-stat) strong { font-size: 28px; font-weight: 600; }
    html body :is(.my-task-column header, .work-task-section > header) { padding: 16px 18px; }
    html body :is(.my-task-column, .work-task-section) h2 { font-size: 16px; }
    html body .my-task-item { padding: 13px 14px; margin: 10px; border-radius: 8px; }
    html body .my-task-item h3 { font-size: 14px; line-height: 1.45; margin: 8px 0; }
    html body :is(.my-task-item p, .work-task-project, .task-card-meta, .my-task-meta) { font-size: 12px; line-height: 1.45; }
    html body .work-task-item { padding: 14px 18px; }
    html body .work-task-item h3 { font-size: 14px; line-height: 1.45; margin: 8px 0; }
    html body .work-task-dates { margin-bottom: 10px; }
    html body :is(.work-task-dates small, .work-task-people .person small) { font-size: 11px; }
    html body .task-card { padding: 13px; margin-bottom: 10px; }
    html body .task-card-title { font-size: 14px; line-height: 1.45; margin: 7px 0 5px; }
    html body .task-card > small { font-size: 12px; margin-bottom: 12px; }
    html body :is(.td-summary, .td-section, .td-workflow) { padding: 18px 20px; }
    html body .td-heading h1 { font-size: 28px; }
    html body :is(.td-brief, .td-event-body) { font-size: 14px; line-height: 1.6; }
    html body .td-meta small:not(.task-created) { font-size: 11px; letter-spacing: 0; }
    html body .td-meta strong { font-size: 14px; line-height: 1.5; }
    html body .td-event { padding-block: 12px; }
    html body .td-event-head strong { font-size: 13px; }
    html body .td-event time { font-size: 11px; }
    html body .td-event-action { font-size: 13px; }
    html body .task-form .form-grid { gap: 16px 20px; }
    html body .task-form .form-grid > label { margin-bottom: 0; }
    html body .task-project-trigger { font-size: 14px; padding: 9px 11px; min-height: 40px; }
    html body .task-assignment-mode { padding: 16px; }
    html body :is(.task-mode-options strong, .task-assignment-mode legend, .task-attachments > summary) { font-size: 13px; }
    html body .task-mode-options small { font-size: 12px; }
    html body :is(.task-zone, .viewer-timezone) { font-size: 12px; }
    html body .viewer-timezone p { font-size: 11px; line-height: 1.45; }

    /* Calendar cells and workflow steps need smaller, readable metadata. */
    html body :is(.calendar-weekday, .content-calendar-weekday) { font-size: 12px; padding-block: 10px; }
    html body :is(.calendar-entry, .content-calendar-entry) { font-size: 12px; line-height: 1.4; }
    html body :is(.calendar-entry small, .content-calendar-owner, .content-calendar-project, .content-calendar-status) { font-size: 11px; line-height: 1.4; }
    html body :is(.pw-panel, .pw-entry, .cw-plan, .mail-draft-card) { border-radius: 10px; padding: 20px; }
    html body :is(.pw-step, .cw-flow-step) { border-radius: 8px; }
    html body :is(.pw-step, .cw-flow-step) small { font-size: 11px; line-height: 1.4; }
    html body :is(.pw-stage-brief, .pw-note, .cw-details) { font-size: 14px; line-height: 1.55; }
    html body :is(.bp-stat, .wa-metric) { border-radius: 10px; padding: 18px; }
    html body :is(.bp-stat small, .mail-draft-email, .lead-meta, .lead-contact, .lead-footnote) { font-size: 12px; line-height: 1.45; }
    html body .bp-summary-table :is(th, td) { padding: 10px 14px; }
    html body .total-row { font-size: 14px; }
    html body .total-row.grand { font-size: 18px; }

    /* Chat text keeps authored bold, colour, links and code formatting. */
    html body :is(.chat-message-body, .chat-editor) { font-family: var(--ui-font); font-size: 14px; line-height: 1.5; }
    html body .chat-compose-hints { font-size: 11px; line-height: 1.4; }
    html body .wa-app { font-family: var(--ui-font); }
    html body .wa-app h1 { font-size: 28px; }
    html body .wa-panel { padding: 20px; border-radius: 10px; margin-bottom: 20px; }
    html body .wa-panel-heading { margin-bottom: 16px; }
    html body .wa-table th { font-size: 12px; letter-spacing: 0; text-transform: none; padding: 10px 14px; }
    html body .wa-table td { padding: 10px 14px; }
    html body .wa-conversation { padding: 12px 14px; }
    html body .wa-conversation strong { font-size: 14px; }
    html body .wa-conversation small { font-size: 12px; }
    html body .wa-message > div { font-size: 14px; line-height: 1.5; }
    html body .wa-message small { font-size: 11px; }
    html body .hv-header { padding: 16px 24px; }
    html body .hv-identity h1 { font-size: 22px; }
    html body .hv-bubble { font-size: 14px; line-height: 1.6; padding: 15px 18px; }
    html body .hv-plan dl { font-size: 13px; }
    html body .hv-composer textarea { font-size: 14px; line-height: 1.5; padding: 12px; }
    html body .login-form label { font-size: 13px; }
    html body .login-form input { font-size: 14px; }
    html body .login-help { font-size: 13px; line-height: 1.5; }
    html body .login-note { font-size: 12px; }
    html body .login-story h1 { font-size: clamp(36px, 4vw, 56px); line-height: 1.15; letter-spacing: -1.5px; }
}

@media screen and (max-width: 1200px) {
    html body .shell > main { padding: 22px; }
    html body .topbar { padding-inline: 22px; }
    html body .department-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 760px) {
    html body .shell > main { padding: 20px 14px; }
    html body .shell > footer { padding-inline: 14px; }
    html body .topbar { height: 62px; padding-inline: 14px; }
    html body .page-heading h1, html body .td-heading h1, html body .wa-app h1 { font-size: 25px; }
    html body .page-heading { gap: 14px; }
    html body :is(.card-body, .form-card, .work-directory) { padding: 16px; }
    html body :is(.card-heading, .overview-banner, .td-summary, .td-section, .td-workflow) { padding: 16px; }
    html body .button { min-height: 42px; white-space: normal; }
    html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=file]), select) { min-height: 42px; }
    html body .task-view-tabs a { padding: 9px 12px; }
    html body .department-grid { padding: 12px; }
    html body .department-tile { padding: 11px; }
    html body .department-tile h3 { font-size: 12px; }
    html body :is(.project-tile, .project-category, .project-child-tile, .work-entity-card, .finance-tool, .hr-tool) { padding: 16px; }
    html body .work-browse-tile { padding: 12px 8px; }
    html body .work-browse-tile strong { font-size: 14px; }
    html body :is(.my-task-stat, .work-group-stat) { padding: 13px; }
    html body :is(.my-task-stat, .work-group-stat) strong { font-size: 25px; }
    html body .hv-header { padding: 14px; }
    html body .hv-identity h1 { font-size: 19px; }
}
