@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
    --bg: #0f172a;
    --panel: #111827;
    --card: #1f2937;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --accent: #22d3ee;
    --accent-2: #a855f7;
    --border: #1f2937;
    --user: rgba(34, 211, 238, 0.12);
    --assistant: rgba(168, 85, 247, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #0b1224 0%, #0f172a 50%, #0b0f1f 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

a {
    color: var(--accent);
    text-decoration: underline;
}

a:hover {
    color: var(--accent-2);
}

.page {
    min-height: 100vh;
    padding: 28px 20px 40px;
    display: flex;
    justify-content: center;
}

.chat-shell {
    width: min(920px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(90deg, rgba(34,211,238,0.1), rgba(168,85,247,0.08)), var(--panel);
}

.chat-title {
    font-size: 20px;
    font-weight: 600;
}

.chat-subtitle {
    font-size: 13px;
    color: var(--muted);
}

.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-actions button {
    border: 1px solid var(--border);
    background: transparent;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text);
}

.chat-log {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 62vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.chat-log::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.msg {
    padding: 14px 16px;
    border-radius: 14px;
    line-height: 1.45;
    font-size: 14px;
    white-space: pre-wrap;
}

.msg.user {
    align-self: flex-end;
    background: var(--user);
    border: 1px solid var(--border);
}

.msg.assistant {
    align-self: flex-start;
    background: var(--assistant);
    border: 1px solid var(--border);
}

.msg.pending {
    opacity: 0.7;
    font-style: italic;
}

.media-list {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

.media-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.media-meta {
    font-size: 13px;
    color: var(--muted);
}

.media-video {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0b1224;
    max-height: 360px;
}

.media-video.short {
    max-height: 520px;
}

.media-footer {
    display: flex;
    justify-content: flex-end;
}

.composer {
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
    background: var(--panel);
}

.composer-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.composer textarea {
    resize: none;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
    min-height: 52px;
    min-width: 0;
    background: #0b1224;
    color: var(--text);
}

.composer-meta {
    font-size: 12px;
    color: var(--muted);
}

.composer button {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0f172a;
    border: none;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.composer button:hover {
    filter: brightness(1.05);
}

body.embed {
    background: transparent;
    overflow: hidden;
}

body.embed .page {
    padding: 0;
    min-height: auto;
    height: 100vh;
    overflow: hidden;
}

body.embed .chat-shell {
    width: 100%;
    border-radius: 12px;
    box-shadow: none;
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}

body.embed .chat-log {
    max-height: none;
    overflow-y: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

body.embed .chat-log::-webkit-scrollbar {
    width: 0px;
    height: 0px;
}

body.embed .media-video {
    max-height: 220px;
}

body.embed .media-video.short {
    max-height: 300px;
}

@media (max-width: 720px) {
    .chat-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .chat-log {
        max-height: 55vh;
    }
}
