/* Chatevator — chat page: messages scroll, presets + text box stay at the bottom */
.chatevator-page {
    --gold: #FAB519;
    --gold-soft: #fff4d6;
    --ink: #0f0f10;
    --muted: #8a8a8f;
    --line: #ececef;
    --bubble: #f3f3f5;

    margin: 0;
    background:
        radial-gradient(circle at 50% -10%, rgba(250, 181, 25, 0.18), transparent 55%),
        #f4f4f6;
    font-family: 'DM Sans', sans-serif;
    color: var(--ink);
}

.chatevator-page .pannel {
    display: flex;
    flex-direction: column;
    max-width: 720px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    padding: 0;
    background: #fff;
    box-sizing: border-box;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.06);
}

/* logo on the left, "Chatevator" + status on the right */
.chatevator-page .chat-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    padding-top: calc(14px + env(safe-area-inset-top));
    background: linear-gradient(180deg, #151515, #000);
    color: var(--gold);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    z-index: 1;
}

/* thin gold glow under the header */
.chatevator-page .chat-top::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.6;
}

.chatevator-page .chat-home img {
    display: block;
    height: 28px;
}

/* "Chatevator" with a small online status under it, right-aligned */
.chatevator-page .chat-title {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.15;
}

.chatevator-page .chat-top h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* the Skyline arrows after "Chatevator", same yellow as the word */
.chatevator-page .chat-top h1 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* cut from the logo (Asset 4), so it's the exact same mark */
.chatevator-page .chat-arrows {
    display: block;
    width: auto;
    height: 13px;
    flex-shrink: 0;
}

.chatevator-page .chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 500;
    color: #a6a6ab;
}

/* green "online" dot with a soft pulse */
.chatevator-page .chat-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3ddc84;
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
    animation: chat-online 2s infinite;
}

@keyframes chat-online {
    70% {
        box-shadow: 0 0 0 6px rgba(61, 220, 132, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(61, 220, 132, 0);
    }
}

.chatevator-page .chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 16px;
    scroll-behavior: smooth;
}

.chatevator-page .chat-msg {
    position: relative;
    max-width: 80%;
    padding: 11px 15px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    animation: chat-in 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* bot bubbles get a small logo avatar on the left */
.chatevator-page .chat-msg.from-bot {
    align-self: flex-start;
    margin-left: 38px;
    background: var(--bubble);
    color: var(--ink);
    border-bottom-left-radius: 6px;
}

.chatevator-page .chat-msg.from-bot::before {
    content: '';
    position: absolute;
    left: -38px;
    bottom: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    /* the ↓∿↑ arrows from the Skyline logo (same drawing as the header's) */
    background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='90 168 290 140'%3E%3Cg fill='none' stroke='%23FAB519' stroke-width='30' stroke-linejoin='round'%3E%3Cpolyline points='108,222 170,284 232,222 248,238 300,186 362,248'/%3E%3Cline x1='170' y1='176' x2='170' y2='270'/%3E%3Cline x1='300' y1='200' x2='300' y2='296'/%3E%3C/g%3E%3C/svg%3E") center / 64% auto no-repeat;
    box-shadow: 0 0 0 2px var(--gold-soft);
}

/* only the last bubble in a run of bot messages shows the avatar */
.chatevator-page .chat-msg.from-bot:has(+ .from-bot)::before {
    visibility: hidden;
}

.chatevator-page .chat-msg.from-me {
    align-self: flex-end;
    background: linear-gradient(135deg, #ffc93c, var(--gold));
    color: #000;
    font-weight: 500;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 14px rgba(250, 181, 25, 0.3);
}

/* "typing…" — three dots bouncing one after another */
.chatevator-page .chat-typing {
    display: inline-flex;
    gap: 4px;
    padding: 5px 2px;
}

.chatevator-page .chat-typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9a9aa0;
    animation: chat-typing 1.2s infinite ease-in-out;
}

.chatevator-page .chat-typing i:nth-child(2) {
    animation-delay: 0.15s;
}

.chatevator-page .chat-typing i:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes chat-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* new messages slide up into place */
@keyframes chat-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
}

/* "Which job?" choices */
.chatevator-page .chat-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.chatevator-page .chat-choices button {
    padding: 7px 14px;
    border: 1px solid #e3c779;
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.chatevator-page .chat-choices button:hover:not(:disabled) {
    background: var(--gold-soft);
    border-color: var(--gold);
    transform: translateY(-1px);
}

.chatevator-page .chat-choices button:disabled {
    opacity: 0.45;
    cursor: default;
}

.chatevator-page .chat-choices button.picked {
    opacity: 1;
    background: var(--gold);
    border-color: var(--gold);
}

/* Plan files — small cards with a PDF badge */
.chatevator-page .chat-files {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

/* "Steel – Rev 2" link, file name under it */
.chatevator-page .chat-files li {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 9px 12px 9px 52px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.chatevator-page .chat-files li::before {
    content: 'PDF';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gold-soft);
    color: #a06d00;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.chatevator-page .chat-files li:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.chatevator-page .chat-files a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

/* the whole card is clickable */
.chatevator-page .chat-files a::after {
    content: '';
    position: absolute;
    inset: 0;
}

.chatevator-page .chat-file-name {
    color: var(--muted);
    font-size: 12px;
}

/* the drawing that's open in the viewer */
.chatevator-page .chat-files li.open {
    border-color: var(--gold);
    background: var(--gold-soft);
}

/* Photos / videos — square thumbnails, 3 across; videos get a ▶ */
.chatevator-page .chat-media {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.chatevator-page .chat-media-item {
    position: relative;
    display: block;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f2f2;
    border: 1px solid var(--line);
}

.chatevator-page .chat-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chatevator-page .chat-media-item.video::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36px;
    height: 36px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpolygon points='9 7 18 12 9 17'/%3E%3C/svg%3E")
        center / 22px no-repeat;
}

.chatevator-page .chat-media-item:hover {
    border-color: var(--gold);
}

/* Small Material parts — a card each: picture, name, category */
.chatevator-page .chat-parts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.chatevator-page .chat-parts li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 8px 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.chatevator-page .chat-part-pic {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #f2f2f2;
    overflow: hidden;
}

.chatevator-page .chat-part-pic img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chatevator-page .chat-part-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chatevator-page .chat-part-text strong {
    color: var(--ink);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.chatevator-page .chat-part-meta {
    color: var(--muted);
    font-size: 12px;
}

.chatevator-page .chat-order-link {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 14px;
    border: 1px solid #e3c779;
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.chatevator-page .chat-order-link:hover {
    background: var(--gold-soft);
    border-color: var(--gold);
}

/* A drawing open on top of the chat (the app's PDF viewer, esi-view.html) */
.chatevator-page .chat-viewer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* the "Plans open here" placeholder only shows in the computer layout */
.chatevator-page .chat-side-empty {
    display: none;
}

/* Computer: chat on the left, the open plan fills the right */
@media (min-width: 1000px) {
    .chatevator-page {
        display: flex;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .chatevator-page .pannel {
        flex: 0 0 420px;
        max-width: none;
        margin: 0;
        border-right: 1px solid var(--line);
        box-shadow: 6px 0 30px rgba(0, 0, 0, 0.05);
        z-index: 1;
    }

    .chatevator-page .chat-side {
        flex: 1;
        display: flex;
        min-width: 0;
    }

    .chatevator-page .chat-side .chat-viewer {
        position: static;
        flex: 1;
        height: auto;
    }

    .chatevator-page .chat-side:not(.has-plan) .chat-side-empty {
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        text-align: center;
        color: var(--muted);
    }

    .chatevator-page .chat-side-empty h2 {
        margin: 12px 0 0;
        font-size: 20px;
        color: var(--ink);
    }

    .chatevator-page .chat-side-empty p {
        margin: 0;
        font-size: 15px;
    }

    /* the same black arrows badge as the bot's avatar, bigger */
    .chatevator-page .chat-side-icon {
        width: 72px;
        height: 72px;
        border-radius: 22px;
        background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='90 168 290 140'%3E%3Cg fill='none' stroke='%23FAB519' stroke-width='30' stroke-linejoin='round'%3E%3Cpolyline points='108,222 170,284 232,222 248,238 300,186 362,248'/%3E%3Cline x1='170' y1='176' x2='170' y2='270'/%3E%3Cline x1='300' y1='200' x2='300' y2='296'/%3E%3C/g%3E%3C/svg%3E") center / 60% auto no-repeat;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
}

/* Quick prompts above the text box */
.chatevator-page .chat-suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 10px;
}

.chatevator-page .chat-suggest[hidden] {
    display: none;
}

.chatevator-page .chat-suggest button {
    flex-shrink: 0;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.chatevator-page .chat-suggest button:hover {
    border-color: var(--gold);
    background: var(--gold-soft);
}

/* Text box — one rounded bar with the send button inside */
.chatevator-page .chat-input {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 12px;
    margin-bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 6px 6px 6px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.chatevator-page .chat-input:focus-within {
    border-color: var(--gold);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08), 0 0 0 4px rgba(250, 181, 25, 0.18);
}

.chatevator-page .chat-input input {
    flex: 1;
    min-width: 0;
    padding: 8px 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 16px; /* 16px stops iPhones zooming in while typing */
    color: var(--ink);
}

.chatevator-page .chat-input input:focus {
    outline: none;
}

.chatevator-page .chat-input input::-webkit-search-cancel-button {
    display: none;
}

.chatevator-page .chat-input button {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #000;
    color: var(--gold);
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.chatevator-page .chat-input button svg {
    width: 20px;
    height: 20px;
}

.chatevator-page .chat-input button:hover:not(:disabled) {
    transform: scale(1.06);
}

.chatevator-page .chat-input :disabled {
    opacity: 0.5;
    cursor: default;
}


/* the date line where a new day starts in the chat: "Nov 19, 2026" */
.chatevator-page .chat-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
}
.chatevator-page .chat-divider::before,
.chatevator-page .chat-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #e3e3e3;
}

/* "Turn off AI" under "Online · Plans assistant" */
.chatevator-page .chat-ai-off {
    margin-top: 4px;
    padding: 0;
    border: none;
    background: none;
    color: #a6a6ab;
    font: inherit;
    font-size: 11px;
    text-decoration: underline;
    cursor: pointer;
}
.chatevator-page .chat-ai-off[hidden] {
    display: none;
}
.chatevator-page .chat-ai-off:hover {
    color: var(--gold);
}

/* AI off: "Turn on AI features" in the bot's bubble */
.chatevator-page .chat-ai-on {
    display: block;
    margin-top: 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 999px;
    background: #000;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* the consent popup's text */
.ai-consent {
    text-align: left;
    font-size: 14px;
    line-height: 1.45;
    color: #333;
}
.ai-consent p {
    margin: 0 0 10px;
}
.ai-consent ul {
    margin: 0 0 10px;
    padding-left: 18px;
}
.ai-consent li {
    margin-bottom: 4px;
}
