/* Shared action hierarchy and delivery semantics; loaded after page styles.
 * Color-only !important rules intentionally override legacy page-specific
 * primary/hover rules, including mobile controls. Sizes and behavior stay local.
 * Provider logos/social buttons retain their required brand colors.
 */
:root {
    --delivery-received-ink: #475569;
    --delivery-received-bg: #f1f5f9;
    --delivery-picked-up-ink: #1d4ed8;
    --delivery-picked-up-bg: #eff6ff;
    --delivery-moving-ink: #9a3412;
    --delivery-moving-bg: #fff1e6;
    --delivery-completed-ink: #166534;
    --delivery-completed-bg: #ecfdf3;
    --delivery-returned-ink: #b91c1c;
    --delivery-returned-bg: #fef2f2;
}

/* Signup is the primary action. Home feature demos retain their original
 * illustration palette; danger actions keep their own styling. */
body .button:where(:not(.danger):not(.is-danger)),
body .preview-toolbar-button,
body .calendar-delivery-alert[data-calendar-shop-orders]:not(.danger),
body .shipment-recipient-modal .shipment-recipient-choice__product .shipment-recipient-fill-button--mobile {
    background: #fff !important;
    border-color: var(--line) !important;
    color: var(--ink) !important;
}

body .button:not(.danger):not(.is-danger):not(:where(.button--signup, [href$="/signup.php"], [href*="/signup.php?"])):not(:disabled):hover,
body .preview-toolbar-button:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
}

body .button[aria-current="page"],
body .button.is-active {
    background: #f1f5f9 !important;
    border-color: #64748b !important;
}

body .button.button--signup,
body a.button[href$="/signup.php"],
body a.button[href*="/signup.php?"],
body a.button[href$="/signup.php"]:hover,
body a.button[href*="/signup.php?"]:hover,
body .button.button--signup:not(:disabled):hover {
    background: #ffb400 !important;
    border-color: #ffb400 !important;
    color: #000b25 !important;
}

body .button:not(.danger):not(.is-danger):disabled {
    background: #f3f4f6 !important;
    border-color: var(--line) !important;
    color: #9aa3af !important;
}

/* Desktop calendar: collected orders are the entry point for shipment booking.
 * Keep the navy background unchanged on hover; feedback is handled by the arrow. */
@media (min-width: 901px) {
    body .page-calendar .calendar-delivery-alert[data-calendar-shop-orders]:not(.danger) {
        background: #000b25 !important;
        border-color: #000b25 !important;
        color: #fff !important;
    }

    body .page-calendar .calendar-delivery-alert[data-calendar-shop-orders]:not(.danger):is(:hover, :focus-visible) {
        background: #000b25 !important;
        border-color: #000b25 !important;
    }

    body .page-calendar .calendar-delivery-alert[data-calendar-shop-orders].danger {
        background: #991b1b !important;
        border-color: #991b1b !important;
        color: #fff !important;
    }
}

body .button:focus-visible,
body .home-card-button:focus-visible,
body .preview-toolbar-button:focus-visible {
    outline: 2px solid #64748b;
    outline-offset: 3px;
    box-shadow: none !important;
}

/* Ordinary utility links use surrounding text color, also on dark headers. */
body :is(.account-link-inline, .onboarding-step__link, .notice-help-card__link,
    .guide-detail-links a, .shipment-usage-strip__plan > a) {
    color: inherit;
    text-underline-offset: 3px;
}
body :is(.account-link-inline, .onboarding-step__link, .notice-help-card__link,
    .guide-detail-links a, .shipment-usage-strip__plan > a):hover {
    color: inherit;
    text-decoration: underline;
}
body .notice-help-card__link span { color: inherit; }
body .notice-help-card__link:hover { border-color: #94a3b8; }

/* Non-delivery selection and inquiry states do not use the signup accent. */
body .preview-filter-chip.is-active,
body .preview-shipment-type > span.is-active,
body .preview-feature-nav button.is-active {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: var(--ink);
}
.page-inquiry .inquiry-item__details > summary:hover,
.page-inquiry .inquiry-item__details[open] > summary {
    background: #f8fafc;
    box-shadow: inset 3px 0 #64748b;
}
.page-inquiry .inquiry-item__reply { border-left-color: #64748b; }

/* Assign semantic tokens to existing server and dynamically rendered chips. */
:is(.calendar-pill.received, .calendar-day-counts .received,
    .preview-status.is-ready,
    [data-delivery-status="received"], .status-pill.is-received,
    .dashboard-status-grid .status-ready) {
    --delivery-ink: var(--delivery-received-ink);
    --delivery-bg: var(--delivery-received-bg);
}
:is(.calendar-pill.picked-up, .calendar-day-counts .picked-up,
    .preview-status.is-picked-up, [data-delivery-status="picked_up"],
    .status-pill.is-picked-up) {
    --delivery-ink: var(--delivery-picked-up-ink);
    --delivery-bg: var(--delivery-picked-up-bg);
}
:is(.calendar-pill.moving, .calendar-day-counts .moving,
    .preview-status.is-moving,
    [data-delivery-status="moving"], .status-pill.is-moving,
    .dashboard-status-grid .status-moving) {
    --delivery-ink: var(--delivery-moving-ink);
    --delivery-bg: var(--delivery-moving-bg);
}
:is(.calendar-pill.completed, .calendar-day-counts .completed,
    .preview-status.is-complete,
    [data-delivery-status="completed"], .status-pill.is-success,
    .dashboard-status-grid .status-completed) {
    --delivery-ink: var(--delivery-completed-ink);
    --delivery-bg: var(--delivery-completed-bg);
}
:is(.calendar-pill.returned, .calendar-pill.held,
    [data-delivery-status="returned"], [data-delivery-status="held"],
    .status-pill.is-returned, .status-pill.is-warning,
    .manage-row-state.is-warning) {
    --delivery-ink: var(--delivery-returned-ink);
    --delivery-bg: var(--delivery-returned-bg);
}

body :is(.calendar-pill, .calendar-day-counts > em,
    .preview-status, [data-delivery-status],
    .status-pill, .manage-row-state.is-warning,
    .dashboard-status-grid .status-ready,
    .dashboard-status-grid .status-moving,
    .dashboard-status-grid .status-completed) {
    color: var(--delivery-ink, var(--delivery-received-ink)) !important;
    background: var(--delivery-bg, var(--delivery-received-bg)) !important;
    border-color: var(--delivery-bg, var(--delivery-received-bg)) !important;
}

body :is(.status-pill, [data-delivery-status]) {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

body .dashboard-page [data-dashboard-panel="manage"] .dashboard-status-card {
    --status-accent: var(--delivery-ink);
    border-left-color: var(--delivery-ink) !important;
}

.home-hero .hero-free-note strong { color: inherit; }
