/* Classic homepage: task shortcuts and phone-first inventory controls.
   Keep these rules scoped so the iOS / ops themes retain their existing layouts. */
.home-inbound-reminder,
.inbound-overdue-help {
    display: none;
}

body[data-theme="classic"] #classicHomeDashboardCard .home-inbound-reminder:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid oklch(90% 0.055 75);
    border-radius: 10px;
    background: oklch(97% 0.025 75);
    color: oklch(43% 0.095 60);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
    box-shadow: none;
    cursor: pointer;
}

body[data-theme="classic"] .home-inbound-reminder-message {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

body[data-theme="classic"] .home-inbound-reminder-message svg {
    flex: none;
    width: 18px;
    height: 18px;
}

body[data-theme="classic"] .home-inbound-reminder-action {
    flex: none;
    white-space: nowrap;
}

body[data-theme="classic"] #classicHomeDashboardCard .home-inbound-reminder:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

@media (max-width: 360px) {
    body[data-theme="classic"] #classicHomeDashboardCard .home-inbound-reminder:not(.hidden) {
        padding-inline: 8px;
        gap: 6px;
        font-size: 12px;
    }
}

body[data-theme="classic"] #opsFollowListCard .inbound-overdue-help:not(.hidden) {
    display: block;
    margin: 0 0 12px;
    color: oklch(48% 0.12 55);
    font-size: 13px;
    line-height: 1.5;
}

body[data-theme="classic"] #classicHomeDashboardCard .classic-home-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

body[data-theme="classic"] #classicHomeDashboardCard .classic-home-metric {
    align-items: stretch;
    justify-content: flex-start;
    min-height: 84px;
    padding: 12px;
    gap: 8px;
    text-align: left;
    box-shadow: none;
    color: var(--classic-text);
}

body[data-theme="classic"] #classicHomeDashboardCard .classic-home-metric-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--classic-text-soft);
}

body[data-theme="classic"] #classicHomeDashboardCard .classic-home-metric-value {
    font-size: 26px;
    font-variant-numeric: tabular-nums;
}

body[data-theme="classic"] .home-metric-unit {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 400;
    color: var(--classic-text-soft);
}

body[data-theme="classic"] #classicHomeDashboardCard .classic-home-metric:disabled {
    opacity: 1;
    cursor: default;
}

body[data-theme="classic"] #classicHomeDashboardCard .classic-home-metric:disabled .is-abnormal {
    color: var(--classic-text-soft);
}

body[data-theme="classic"] #classicHomeDashboardCard .classic-home-metric:disabled .classic-home-metric-label > span {
    visibility: hidden;
}

.home-secondary-summary { display: none; }

body[data-theme="classic"] .home-secondary-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--classic-line);
    font-size: 13px;
    color: var(--classic-text-soft);
}

body[data-theme="classic"] .home-secondary-summary strong {
    color: var(--classic-text);
    font-variant-numeric: tabular-nums;
}

body[data-theme="classic"] #tab-chat > #homeTodayTickerCard.classic-today-ticker-card {
    padding: 12px;
    margin-top: -8px;
    min-height: 0;
    border: 1px solid var(--classic-line);
    border-radius: 12px;
    background: var(--classic-surface);
    box-shadow: none;
}

body[data-theme="classic"] #homeTodayTickerCard #todayTicker {
    display: block;
    min-height: 0;
}

body[data-theme="classic"] .home-check-people {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-top: 8px;
}

body[data-theme="classic"] #homeTodayTickerCard .today-ticker-badges {
    flex: 1 1 240px;
    flex-wrap: wrap;
    overflow: visible;
    white-space: normal;
    gap: 8px 20px;
}

body[data-theme="classic"] #homeTodayTickerCard .today-ticker-badge {
    max-width: 100%;
    gap: 8px;
    padding: 2px 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--classic-text);
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow-wrap: anywhere;
}

body[data-theme="classic"] #homeTodayTickerCard .today-ticker-badge > span:last-child {
    flex-shrink: 0;
    white-space: nowrap;
}

body[data-theme="classic"] #homeTodayTickerCard .today-ticker-badge strong {
    color: var(--classic-blue-strong);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

body[data-theme="classic"] .home-check-empty {
    display: block;
    padding: 8px 0;
    font-size: 13px;
    color: var(--classic-text-soft);
}

.home-confirm-selected-name { display: none; }

.followup-timing,
.followup-locked-footer { display: contents; }
.followup-transit-duration-brief,
.followup-lock-brief,
.followup-lock-more-explanation { display: none; }

/* Receipt exceptions stay red regardless of transit age or expanded detail mode. */
body[data-theme="classic"] #tab-chat #opsFollowListCard .followup-transit-card[data-home-abnormal="true"] {
    background: #fff1f2;
    border-color: #ef4444;
}

body[data-theme="classic"] #tab-chat .home-quick-input-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
}

body[data-theme="classic"] #tab-chat .home-quick-input-actions .primary { flex: 0 1 220px; }
body[data-theme="classic"] #tab-chat .home-quick-input-actions .secondary { flex: 0 0 64px; }
body[data-theme="classic"] #tab-chat .home-quick-input-actions > button { width: auto; min-height: 44px; }

body[data-theme="classic"] #tab-chat #opsQuickEntryCard {
    background: var(--classic-surface);
    box-shadow: var(--classic-shadow-sm);
}

.classic-home-inventory-tabs { display: none; }

/* Clip sideways overflow without creating an ancestor scroll container for the sticky menu. */
body[data-theme="classic"]:has(#tab-chat:not(.hidden)),
body[data-theme="classic"] #mainApp:has(> #tab-chat:not(.hidden)) { overflow-x: clip; }

body[data-theme="classic"] #tab-chat .home-inventory-inactive { display: none !important; }

body[data-theme="classic"] #classicHomeInventoryTabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
    order: 1;
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 20;
    border-radius: 12px;
    background: var(--classic-surface-soft);
}

body[data-theme="classic"] #classicHomeInventoryTabs button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 44px;
    padding: 8px 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: var(--classic-text-soft);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

body[data-theme="classic"] .home-inventory-tab-count {
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--classic-red-strong);
    color: var(--classic-surface);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 18px;
    text-align: center;
}

body[data-theme="classic"] .home-inventory-tab-count[hidden] { display: none; }

body[data-theme="classic"] #classicHomeInventoryTabs button[aria-selected="true"] {
    color: var(--classic-blue-strong);
    background: var(--classic-surface);
}

body[data-theme="classic"] #classicHomeInventoryTabs button:focus-visible {
    outline: 2px solid var(--classic-blue-strong);
    outline-offset: -2px;
}

body[data-theme="classic"] #opsDueListCard,
body[data-theme="classic"] #opsFollowListCard,
body[data-theme="classic"] #opsQuickEntryCard,
body[data-theme="classic"] #homeRecentLogsCard,
body[data-theme="classic"] #homeFollowupClassicHost [data-home-abnormal] {
    scroll-margin-top: calc(68px + env(safe-area-inset-top, 0px));
}

body[data-theme="classic"] #classicHomeDashboardCard button:focus-visible,
body[data-theme="classic"] #opsDueListCard:focus-visible > .inventory-section-header,
body[data-theme="classic"] #opsFollowListCard:focus-visible > .inventory-section-header,
body[data-theme="classic"] #homeFollowupClassicHost [data-home-abnormal]:focus-visible {
    outline: 2px solid var(--classic-blue-strong);
    outline-offset: 4px;
}

/* Section jumps should highlight the heading, not frame the entire long list. */
body[data-theme="classic"] #opsDueListCard:focus-visible,
body[data-theme="classic"] #opsFollowListCard:focus-visible { outline: none; }

/* Keep phone-sized touch targets when a handset is rotated to landscape. */
@media (max-width: 768px), (max-width: 1024px) and (max-height: 500px) {
    body[data-theme="classic"] .home-check-people {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    body[data-theme="classic"] #homeTodayTickerCard .today-ticker-badges {
        flex: 0 0 auto;
        width: 100%;
    }
    body[data-theme="classic"] #confirmArea .home-confirm-selected-name {
        display: block;
        overflow-wrap: anywhere;
        color: var(--classic-text-soft);
    }
    body[data-theme="classic"] #confirmArea .lookup-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body[data-theme="classic"] #confirmArea .lookup-quick-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }
    body[data-theme="classic"] #confirmArea .lookup-quick-row .primary {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 48px;
    }
    body[data-theme="classic"] #mainApp .tabs .tab-btn,
    body[data-theme="classic"] #myPresenceTodayRow .my-presence-inline-toggle {
        min-height: 44px;
    }
    body[data-theme="classic"] #tab-chat .home-quick-input-actions .primary { flex: 1; }
    body[data-theme="classic"] #tab-chat #opsQuickEntryCard .actions > button { min-height: 44px; }
    body[data-theme="classic"] #tab-chat #confirmArea > .actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    body[data-theme="classic"] #tab-chat #confirmArea > .actions > .primary {
        grid-column: 1 / -1;
        min-height: 48px;
    }
    body[data-theme="classic"] #tab-chat #opsQuickEntryCard :is(input, select, textarea) {
        min-width: 0;
        min-height: 44px;
        font-size: 16px;
    }
    body[data-theme="classic"] #mainApp > .notice-entry-card {
        padding: 0 12px;
        border-radius: 12px;
        box-shadow: none;
    }
    body[data-theme="classic"] .notice-entry-card .board-ticker-shell { min-height: 44px; }
    body[data-theme="classic"] .notice-entry-card .board-ticker-item {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.5;
    }
    body[data-theme="classic"] #todayScheduleList:has(.staff-wifi-home-summary > .today-schedule-empty) {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 4px 8px;
        min-height: 52px;
        background: var(--classic-surface);
        box-shadow: none;
    }
    body[data-theme="classic"] #todayScheduleList:has(.staff-wifi-home-summary > .today-schedule-empty) .staff-wifi-home-head {
        flex: 1;
        margin: 0;
        padding: 0;
        border: 0;
        min-width: 0;
    }
    body[data-theme="classic"] #todayScheduleList:has(.staff-wifi-home-summary > .today-schedule-empty) .staff-wifi-side-date { display: none; }
    body[data-theme="classic"] #todayScheduleList:has(.staff-wifi-home-summary > .today-schedule-empty) .staff-wifi-date-nav-group {
        position: static;
        transform: none;
        width: auto;
        max-width: none;
        gap: 0;
    }
    body[data-theme="classic"] #todayScheduleList:has(.staff-wifi-home-summary > .today-schedule-empty) .staff-wifi-home-toolbar { gap: 0; }
    body[data-theme="classic"] #todayScheduleList:has(.staff-wifi-home-summary > .today-schedule-empty) .staff-wifi-home-summary {
        flex: 0 0 auto;
        margin: 0;
        padding: 0;
        border: 0;
        background: none;
        box-shadow: none;
        font-size: 12px;
    }
    body[data-theme="classic"] #todayScheduleList .staff-wifi-date-btn,
    body[data-theme="classic"] #todayScheduleList .staff-wifi-date-title-wrap,
    body[data-theme="classic"] #todayScheduleList .staff-wifi-home-detail-btn,
    body[data-theme="classic"] .classic-header-logout {
        min-width: 44px;
        min-height: 44px;
        height: auto;
    }
    body[data-theme="classic"] #todayScheduleList .today-schedule-line-main:has(> .today-schedule-badge-wrap) {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    body[data-theme="classic"] #todayScheduleList .today-schedule-badge-wrap {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        overflow: visible;
        white-space: normal;
    }
    body[data-theme="classic"] #todayScheduleList .today-schedule-badge {
        min-width: 0;
        max-width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px;
        padding: 6px 8px;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.4;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    body[data-theme="classic"] #tab-chat #opsDueListCard:not(.due-detail-mode) #dueList,
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) #followupList {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }
    body[data-theme="classic"] #tab-chat #opsDueListCard:not(.due-detail-mode) .followup-status-card,
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-transit-card {
        padding: 8px 12px;
        border-radius: 12px;
        box-shadow: none;
    }
    body[data-theme="classic"] #tab-chat #opsDueListCard:not(.due-detail-mode) .followup-status-title-wrap .item-name,
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-transit-head .item-name {
        font-size: 16px;
        line-height: 1.4;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    body[data-theme="classic"] #tab-chat :is(.inventory-section-header--due, .inventory-section-header--inbound) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 4px 8px;
        margin-top: 8px;
        margin-bottom: 12px;
    }
    body[data-theme="classic"] #tab-chat :is(.inventory-section-header--due, .inventory-section-header--inbound) :is(.inventory-section-heading, .inventory-section-tools) {
        display: contents;
    }
    body[data-theme="classic"] #tab-chat :is(.inventory-section-header--due, .inventory-section-header--inbound) .inventory-section-heading::before {
        display: none;
    }
    body[data-theme="classic"] #tab-chat :is(.inventory-section-header--due, .inventory-section-header--inbound) .inventory-title-with-alert {
        grid-column: 1;
        grid-row: 1;
        gap: 8px;
        flex-wrap: wrap;
    }
    body[data-theme="classic"] #tab-chat :is(.inventory-section-header--due, .inventory-section-header--inbound) .inventory-section-title {
        font-size: 18px;
        font-weight: 700;
        line-height: 1.4;
    }
    body[data-theme="classic"] #tab-chat :is(.inventory-section-header--due, .inventory-section-header--inbound) .inventory-title-with-alert::before {
        content: "";
        flex: 0 0 4px;
        width: 4px;
        height: 18px;
        border-radius: 999px;
        background: var(--inventory-accent);
    }
    body[data-theme="classic"] #tab-chat :is(.inventory-section-header--due, .inventory-section-header--inbound) .inventory-section-alert-badge {
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        font-size: 12px;
        font-weight: 700;
    }
    /* One heading row on phones; the floating action handles filled inventory rows. */
    body[data-theme="classic"] #tab-chat :is(.inventory-section-header--due, .inventory-section-header--inbound) .inventory-section-desc,
    body[data-theme="classic"] #tab-chat #batchDueHint,
    body[data-theme="classic"] #tab-chat #batchSaveDueBtn {
        display: none;
    }
    body[data-theme="classic"] #floatingBulkInventorySave.is-visible:not([hidden]) {
        /* Keep the bulk action available in phone landscape, too. */
        display: block !important;
    }
    body[data-theme="classic"] #tab-chat .inventory-detail-toggle-btn {
        grid-column: 2;
        grid-row: 1;
        min-height: 44px;
        padding: 0 4px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        box-shadow: none;
        color: var(--classic-blue-strong);
        font-size: 13px;
        font-weight: 500;
    }
    body[data-theme="classic"] #tab-chat .inventory-detail-toggle-btn:hover {
        background: var(--classic-blue-soft);
    }
    body[data-theme="classic"] #tab-chat #opsDueListCard .due-input-with-unit,
    body[data-theme="classic"] #tab-chat #opsDueListCard.due-detail-mode .due-input-with-unit,
    body[data-theme="classic"] #tab-chat #opsFollowListCard .followup-input-with-unit,
    body[data-theme="classic"] #tab-chat #opsFollowListCard.followup-detail-mode .followup-input-with-unit { height: 48px; }
    body[data-theme="classic"] #tab-chat #opsDueListCard .due-input-with-unit input,
    body[data-theme="classic"] #tab-chat #opsDueListCard.due-detail-mode .due-input-with-unit input,
    body[data-theme="classic"] #tab-chat #opsFollowListCard .followup-input-with-unit input,
    body[data-theme="classic"] #tab-chat #opsFollowListCard.followup-detail-mode .followup-input-with-unit input,
    body[data-theme="classic"] #tab-chat #opsQuickEntryCard textarea { font-size: 16px; }
    body[data-theme="classic"] #tab-chat #opsFollowListCard .receipt-exception-fields :is(input, select) {
        min-width: 0;
        min-height: 44px;
        font-size: 16px;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard .receive-expiry-trigger,
    body[data-theme="classic"] .receive-expiry-dialog button {
        min-height: 44px;
    }
    body[data-theme="classic"] .receive-expiry-dialog-close {
        width: 44px;
        height: 44px;
    }
    body[data-theme="classic"] .receive-expiry-dialog :is(input, select) {
        min-width: 0;
        min-height: 44px;
        font-size: 16px;
    }
    body[data-theme="classic"] #tab-chat #opsDueListCard .due-input-with-unit:focus-within,
    body[data-theme="classic"] #tab-chat #opsFollowListCard .followup-input-with-unit:focus-within {
        outline: 2px solid var(--classic-blue-strong);
        outline-offset: 2px;
    }
    /* Scan the name and enter stock on the same row; long names can still wrap. */
    body[data-theme="classic"] #tab-chat #opsDueListCard:not(.due-detail-mode) .followup-status-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(152px, 1.25fr);
        align-items: center;
        gap: 12px;
    }
    body[data-theme="classic"] #tab-chat #opsDueListCard:not(.due-detail-mode) .followup-status-card .item-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 0;
    }
    body[data-theme="classic"] #tab-chat #opsDueListCard:not(.due-detail-mode) .followup-status-tag {
        align-self: flex-start;
        margin-top: 0;
        padding: 2px 6px;
        font-size: 11px;
    }
    body[data-theme="classic"] #tab-chat #opsDueListCard:not(.due-detail-mode) .quick-check-row {
        gap: 8px;
        margin-top: 0;
    }
    body[data-theme="classic"] #tab-chat #opsDueListCard:not(.due-detail-mode) .due-input-with-unit {
        height: 48px;
        border-radius: 8px;
    }
    body[data-theme="classic"] #tab-chat #opsDueListCard:not(.due-detail-mode) .quick-check-row .primary {
        min-width: 52px;
        height: 48px;
        min-height: 48px;
        padding: 0 8px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 8px;
        background: var(--classic-blue-strong);
        box-shadow: none;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-locked-footer {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 4px;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-locked-footer .followup-receive-locked-tip {
        flex: 1;
        margin-top: 0;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-locked-footer .followup-card-actions {
        flex: 0 0 auto;
        display: flex;
        margin-top: 0;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .compact-receive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 8px;
        margin-top: 8px;
    }
    /* Persistent labels share the control border, without a separate label row. */
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-receive-field {
        position: relative;
        min-width: 0;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-compact-field-label {
        display: block;
        position: absolute;
        inset: 4px 10px auto;
        margin: 0;
        font-size: 12px;
        line-height: 16px;
        font-weight: 400;
        color: var(--classic-text-soft);
        cursor: text;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-input-with-unit {
        height: 52px;
        border-radius: 8px;
        background: var(--classic-surface);
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-input-with-unit input {
        padding-top: 18px;
        line-height: 24px;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-input-unit {
        padding-top: 18px;
        font-weight: 400;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-transit-head {
        margin-bottom: 4px;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-transit-head .item-name {
        margin-bottom: 0;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-core-summary {
        margin-top: 0;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-timing {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0 8px;
        margin-top: 4px;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) :is(.followup-purchase-time-compact-line, .followup-transit-time-insight) {
        margin-top: 0;
        font-size: 12px;
        font-weight: 400;
        line-height: 1.5;
        white-space: normal;
        overflow: visible;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-purchase-time-compact-line {
        color: var(--classic-text-soft);
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) :is(.followup-transit-insight-full, .followup-lock-full) {
        display: none;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) :is(.followup-transit-duration-brief, .followup-lock-brief) {
        display: inline;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-lock-more-explanation {
        display: block;
        margin-bottom: 8px;
        color: var(--classic-red-strong);
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-receive-locked-tip {
        margin-top: 8px;
        padding: 0;
        border: 0;
        background: none;
        color: var(--classic-red-strong);
        font-size: 12px;
        line-height: 1.5;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard .followup-card-actions button,
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-card-actions-left .followup-more-toggle-btn,
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-card-actions-left .receipt-exception-toggle-btn,
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-card-actions > .primary {
        min-height: 44px;
        height: auto;
        padding: 8px 12px;
        font-size: 14px;
        line-height: 1.4;
        border-radius: 8px;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-card-actions {
        grid-template-columns: auto auto minmax(0, 1fr);
        gap: 8px;
        margin-top: 0;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-card-actions-left :is(.followup-more-toggle-btn, .receipt-exception-toggle-btn) {
        min-width: 52px;
        width: auto;
        padding-inline: 8px;
        border: 0;
        background: transparent;
        color: var(--classic-text-soft);
        box-shadow: none;
        font-weight: 500;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-card-actions-left button[aria-expanded="true"] {
        color: var(--classic-blue-strong);
        background: var(--classic-blue-soft);
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-card-actions > .primary {
        justify-self: end;
        width: auto;
        min-width: 104px;
        background: var(--classic-blue-strong);
        box-shadow: none;
        font-weight: 600;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-receive-label-short { display: none; }
    body[data-theme="classic"] #tab-chat #opsFollowListCard:not(.followup-detail-mode) .followup-receive-label-full { display: inline; }
    body[data-theme="classic"] #tab-chat #opsFollowListCard.followup-detail-mode .followup-card-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard.followup-detail-mode .followup-card-actions-left {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard.followup-detail-mode .followup-card-actions-left > button {
        flex: 1 1 auto;
        padding-inline: 8px;
        white-space: nowrap;
    }
    body[data-theme="classic"] #tab-chat #opsFollowListCard.followup-detail-mode .followup-card-actions > .primary {
        flex: 0 0 auto;
        width: 100%;
        min-height: 48px;
        white-space: nowrap;
    }
}

@media (max-width: 360px) {
    body[data-theme="classic"] #classicHomeInventoryTabs button {
        font-size: 12px;
        padding-inline: 2px;
    }
    body[data-theme="classic"] .classic-app-header .classic-header-version,
    body[data-theme="classic"] .classic-app-header .classic-home-day-type { display: none; }
    body[data-theme="classic"] .classic-app-header .title { font-size: 16px; }
    body[data-theme="classic"] .classic-app-header .header-actions { gap: 4px; }
}

/* Header utilities reuse the old logout slot; the account menu never takes layout space. */
.classic-header-actions { position: relative; }
#headerRefreshBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    width: 44px;
    height: 44px;
    text-indent: 0;
    border: 0;
    background: transparent;
    color: var(--classic-primary, #3566a6);
    cursor: pointer;
}
.header-refresh-icon { display: block; width: 22px; height: 22px; flex: none; }
#headerRefreshBtn:disabled { cursor: progress; opacity: .55; }
#headerRefreshBtn[aria-busy="true"] .header-refresh-icon { animation: header-refresh-spin 1s linear infinite; }
@keyframes header-refresh-spin { to { transform: rotate(360deg); } }
#loginUserInfo { position: relative; overflow: visible; margin: 0; font-family: inherit; cursor: pointer; }
#headerAccountName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Enlarge the tap target without changing the visible pill or pushing the device badge down. */
#loginUserInfo::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    min-width: 44px;
    min-height: 44px;
    transform: translate(-50%, -50%);
}
#loginUserInfo[aria-expanded="true"] { border-color: var(--classic-primary, #3566a6); }
.header-account-menu {
    position: absolute;
    z-index: 80;
    top: calc(100% + 10px);
    right: 0;
    box-sizing: border-box;
    width: 160px;
    padding: 8px;
    border: 1px solid var(--classic-line, #d7e1ed);
    border-radius: 12px;
    background: var(--classic-surface, #fff);
    box-shadow: 0 8px 24px rgb(26 46 72 / 14%);
}
.header-account-caption { display: block; padding: 4px 10px; font-size: 12px; color: var(--classic-text-soft, #60718a); }
.header-account-signout {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #a33131;
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}
.header-account-signout:hover { background: #fff1f1; }
#headerRefreshBtn:focus-visible, #loginUserInfo:focus-visible, .header-account-signout:focus-visible {
    outline: 2px solid var(--classic-primary, #3566a6);
    outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
    #headerRefreshBtn[aria-busy="true"] .header-refresh-icon { animation: none; }
}
