/* ─── Public trial workspace (/trial/) ─────────────────────────────────────
   Rides on style.css + cnc-components.css + reverse.css; this file only adds
   the trial-specific chrome: the branded header, the demo library rail and
   the contact modal. */

/* ── Header ── */
.trial-header {
    justify-content: space-between;
}

.trial-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    min-width: 0;
}

.trial-brand-logo {
    height: 34px;
    width: auto;
    flex: 0 0 auto;
}

.trial-brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.trial-brand-sub {
    font-size: 13px;
    color: var(--text-secondary);
    border-left: 1px solid var(--border-light);
    padding-left: 12px;
    white-space: nowrap;
}

.trial-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.trial-user {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 26vw;
}

.trial-run-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(167, 78, 158, 0.18);
    border: 1px solid rgba(167, 78, 158, 0.45);
    color: var(--primary-light);
    white-space: nowrap;
}

.trial-run-pill.is-used {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.trial-contact-link {
    white-space: nowrap;
}

/* ── Choose-a-part bucket ── */
.trial-block-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.trial-upload-block {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* The import status line only earns its row once it has something to say. */
#import-status:empty {
    display: none;
}

.trial-demo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trial-demo-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "play body" "badge badge";
    align-items: center;
    gap: 6px 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    font: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.trial-demo-card:hover {
    border-color: rgba(167, 78, 158, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(167, 78, 158, 0.15);
}

.trial-demo-play {
    grid-area: play;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-size: 15px;
    padding-left: 3px;   /* optically centre the triangle */
    flex: 0 0 auto;
}

.trial-demo-body {
    grid-area: body;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.trial-demo-title {
    font-size: 14px;
    font-weight: 700;
}

.trial-demo-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.trial-demo-stats {
    font-size: 11px;
    color: var(--text-dim, var(--text-secondary));
}

.trial-demo-badge {
    grid-area: badge;
    justify-self: start;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(167, 78, 158, 0.16);
    border: 1px solid rgba(167, 78, 158, 0.4);
    color: var(--primary-light);
}

/* ── Contact Rapid Fusion modal ── */
.trial-contact {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(4px);
}

.trial-contact.hidden {
    display: none;
}

.trial-contact-card {
    position: relative;
    width: min(440px, calc(100vw - 32px));
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.trial-contact-logo {
    height: 44px;
    width: auto;
}

.trial-contact-card h2 {
    font-size: 20px;
    border: none;
    padding: 0;
}

.trial-contact-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
}

.trial-contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.trial-contact-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

.trial-contact-close:hover {
    color: var(--text-primary);
}

/* ─── Phone layout (≤720px) ──────────────────────────────────────────────
   Rides the app's own phone system (style.css: one scrolling column, the
   step rail fixed under the header, viewer first at 42dvh). These rules
   adapt the trial-only chrome - header, demo cards, contact sheet - to a
   thumb-driven screen. */
@media (max-width: 720px) {
    /* Header: brand mark + the run pill; drop the wordy bits. */
    .trial-brand-sub,
    .trial-user {
        display: none;
    }

    .trial-brand-name {
        font-size: 15px;
    }

    .trial-brand-logo {
        height: 28px;
    }

    .trial-header-right {
        gap: 8px;
    }

    .trial-run-pill {
        font-size: 11px;
        padding: 4px 10px;
    }

    .trial-contact-link {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Demo cards: full-bleed tap targets. */
    .trial-demo-card {
        padding: 14px;
    }

    .trial-demo-play {
        width: 46px;
        height: 46px;
    }

    /* Upload row: stack; the file picker and button get full width. */
    .import-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .import-row .import-file {
        width: 100%;
    }

    /* Contact gate becomes a bottom sheet - reachable with a thumb, and
       reads as native. */
    .trial-contact {
        align-items: flex-end;
        padding: 0;
    }

    .trial-contact-card {
        width: 100%;
        max-width: none;
        border-radius: 18px 18px 0 0;
        padding: 26px 20px calc(26px + env(safe-area-inset-bottom, 0px));
    }

    .trial-contact-actions {
        width: 100%;
        flex-direction: column;
    }

    .trial-contact-actions .btn-primary,
    .trial-contact-actions .btn-measure,
    .trial-contact-actions a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* Contact label: full on desktop, short on the phone. */
.trial-contact-short { display: none; }

@media (max-width: 720px) {
    .trial-contact-long { display: none; }
    .trial-contact-short { display: inline; }
}

@media (max-width: 350px) {
    /* The logo carries the brand on the smallest screens. */
    .trial-brand-name { display: none; }
}
