/* Global demand FAB + modal — visible on every page */

.dm-fab {
    position: fixed;
    right: max(0.85rem, env(safe-area-inset-right, 0px));
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(22, 163, 74, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.has-confidence-nav .dm-fab {
    bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
}

/* Laptop/desktop: top nav only — sit in the corner, clear of Junior chip */
@media (min-width: 992px) {
    .dm-fab,
    body.has-confidence-nav .dm-fab {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    body.today-os-page .dm-fab,
    body.today-os-page.has-confidence-nav .dm-fab {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .dm-fab,
    body.has-confidence-nav .dm-fab,
    body.today-os-page .dm-fab,
    body.today-os-page.has-confidence-nav .dm-fab {
        bottom: 1.75rem;
        right: 2rem;
    }
}

/* Agent chat — FAB overlaps the send button; hide on all agent surfaces */
body.assistant-layer-page .dm-fab,
body.agent-pwa-mode .dm-fab {
    display: none !important;
}

.dm-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(22, 163, 74, 0.42);
    color: #fff;
}

.dm-fab i {
    font-size: 0.85rem;
}

.dm-fab__label {
    letter-spacing: 0.02em;
}

@media (max-width: 480px) {
    .dm-fab__label {
        display: none;
    }
    .dm-fab {
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

/* Modal sheet — aligned with Confidence Nav List/More chrome */
.dm-sheet {
    position: fixed;
    inset: 0;
    z-index: 10550;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.dm-sheet.is-open {
    pointer-events: auto;
}

.dm-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dm-sheet.is-open .dm-sheet__backdrop {
    opacity: 1;
}

.dm-sheet__panel {
    position: relative;
    width: 100%;
    max-width: 32rem;
    max-height: min(88vh, 680px);
    overflow: auto;
    background:
        linear-gradient(180deg, rgba(246, 139, 30, 0.07) 0%, rgba(255, 255, 255, 0) 4.5rem),
        #fff;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 36px rgba(15, 23, 42, 0.18);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
}

.dm-sheet.is-open .dm-sheet__panel {
    transform: translateY(0);
}

@media (min-width: 640px) {
    .dm-sheet {
        align-items: center;
        padding: 1rem;
    }
    .dm-sheet__panel {
        border-radius: 18px;
        max-height: 90vh;
    }
    .dm-sheet__handle {
        display: none;
    }
}

.dm-sheet__handle {
    width: 2.25rem;
    height: 0.28rem;
    margin: 0.55rem auto 0.15rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.14);
}

.dm-sheet__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 1.1rem 0.75rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.dm-sheet__heading {
    flex: 1;
    min-width: 0;
}

.dm-sheet__heading .um-page-eyebrow {
    margin-bottom: 0.2rem;
}

.dm-sheet__title {
    margin: 0;
    font-family: var(--unimart-font-display, inherit);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--um-navy, #2c3e50);
}

.dm-sheet__sub {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--um-gray-600, #6b7280);
}

.dm-sheet__close {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-top: 0.15rem;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--um-navy, #2c3e50);
    cursor: pointer;
    transition: background 0.15s ease;
}

.dm-sheet__close:hover {
    background: rgba(15, 23, 42, 0.1);
}

.dm-sheet__close:focus-visible {
    outline: 2px solid var(--unimart-orange, #f68b1e);
    outline-offset: 2px;
}

.dm-sheet__body {
    padding: 0.9rem 1.1rem 1.25rem;
}

body.demand-modal-open {
    overflow: hidden;
}

/* Form */
.dm-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.dm-optional {
    font-weight: 500;
    color: #94a3b8;
    font-size: 0.68rem;
}

.dm-form__group {
    margin-bottom: 0.75rem;
}

.dm-form__group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #2c3e50;
}

.dm-form__optional {
    font-weight: 500;
    color: var(--gray, #94a3b8);
}

.dm-form__input,
.dm-form__select,
.dm-form__textarea {
    width: 100%;
    min-height: 2.65rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--unimart-border, #e2e8f0);
    border-radius: 12px;
    font-size: 0.88rem;
    color: #2c3e50;
    background: #fff;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.dm-form__input:focus-visible,
.dm-form__select:focus-visible,
.dm-form__textarea:focus-visible {
    outline: none;
    border-color: rgba(246, 139, 30, 0.55);
    box-shadow: 0 0 0 3px rgba(246, 139, 30, 0.15);
}

.dm-form__textarea {
    resize: vertical;
    min-height: 3.5rem;
}

.dm-form__row {
    display: flex;
    gap: 0.65rem;
}

.dm-form__group--half {
    flex: 1;
    min-width: 0;
}

.dm-form__hint {
    margin: 0.35rem 0 0.75rem;
    font-size: 0.68rem;
    color: var(--gray, #64748b);
}

.dm-form__hint--error {
    color: #9b2c2c;
}

.dm-form__section-label {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0.15rem;
}
.dm-form__opt {
    font-weight: 500;
    color: var(--gray, #64748b);
    font-size: 0.78rem;
}

.dm-form__check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.35rem 0 0.85rem;
    font-size: 0.82rem;
    color: var(--secondary, #1e293b);
    font-weight: 500;
}

.dm-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.95rem;
    border-radius: 10px;
    border: 0;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.dm-btn--primary {
    background: linear-gradient(135deg, var(--unimart-orange, #f68b1e) 0%, #e96703 100%);
    color: #fff;
}

.dm-btn--ghost {
    background: transparent;
    color: var(--gray, #64748b);
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.dm-form__hint i {
    color: #22c55e;
    margin-right: 0.2rem;
}

.dm-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 2.85rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 12px;
    background: var(--unimart-orange, #f68b1e);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.12s ease;
}

.dm-form__submit:hover {
    background: #e96703;
    color: #fff;
}

.dm-form__submit:focus-visible {
    outline: 2px solid var(--unimart-orange, #f68b1e);
    outline-offset: 2px;
}

.dm-form__submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

.dm-form__submit--link:hover {
    color: #fff;
    text-decoration: none;
}

.dm-form__error {
    margin: 0.5rem 0 0;
    font-size: 0.72rem;
    color: var(--danger, #dc3545);
}

.dm-form__hint {
    margin: 0.55rem 0 0;
    font-size: 0.7rem;
    line-height: 1.4;
    color: var(--gray, #64748b);
}

.dm-opt {
    font-weight: 400;
    color: var(--gray, #64748b);
    font-size: 0.85em;
}

.om-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.om-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
}

.om-chip:has(input:checked) {
    border-color: rgba(246, 139, 30, 0.55);
    background: rgba(246, 139, 30, 0.12);
    color: #c2410c;
}

.om-chip input {
    margin: 0;
}

.om-poster-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.om-poster-btn {
    flex: 1 1 8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.6rem;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    border: 1px solid #0f172a;
    background: #0f172a;
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.om-poster-btn--ghost {
    background: #fff;
    color: #0f172a;
    border-color: #cbd5e1;
}

.om-poster-btn:active {
    transform: translateY(1px);
}

.om-poster-preview {
    margin-top: 0.55rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #0f172a;
    aspect-ratio: 16 / 9;
}

.om-poster-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dm-form__file {
    padding: 0.45rem 0;
}

.dm-form__label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.dm-guest__lead {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #2c3e50;
}

.dm-guest__browse {
    display: block;
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray, #64748b);
}

/* List modal action opens demand / opportunity sheets */
.cn-list-action[data-open-demand-modal],
.cn-list-action[data-open-opportunity-modal],
.cn-list-action[data-open-business-modal],
.cn-list-action[data-open-business-room-modal],
.cn-list-action[data-open-service-modal] {
    cursor: pointer;
}
