/* TorqFix homepage demo — REAL answer embed (2026-06-22 v2) */

#liveDemo {
    max-width: 720px;
    margin: 0 auto;
}

.ld-shell {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    flex-direction: column;
    /* LOCKED HEIGHT — window does NOT resize as user scrolls inside */
    height: 580px;
}

/* Fake browser topbar */
.ld-fake-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.ld-fake-topbar .ld-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ld-fake-topbar .ld-r { background: #fb6259; }
.ld-fake-topbar .ld-y { background: #fbbe2e; }
.ld-fake-topbar .ld-g { background: #28c83f; }
.ld-fake-topbar .ld-url {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-dim);
    padding: 4px 14px;
    background: var(--bg-0);
    border-radius: 6px;
    border: 1px solid var(--line);
}

/* "Real production response" badge bar */
.ld-badge-bar {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(16,185,129,.02));
    border-bottom: 1px solid rgba(16,185,129,.18);
    text-align: center;
    flex-shrink: 0;
}
.ld-badge {
    font-size: 11.5px;
    font-weight: 600;
    color: #10b981;
    letter-spacing: .3px;
}

/* Scrollable body — locked area within shell */
.ld-body.ld-scroll {
    padding: 18px 16px;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bg-0);
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}
.ld-body.ld-scroll::-webkit-scrollbar { width: 7px; }
.ld-body.ld-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.ld-body.ld-scroll::-webkit-scrollbar-track { background: transparent; }

.ld-msg { display: flex; gap: 10px; align-items: flex-start; }
.ld-msg.ld-user { flex-direction: row-reverse; }
.ld-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    background: var(--bg-3);
    border: 1px solid var(--line);
}
.ld-bot-avatar { background: linear-gradient(135deg, var(--acc), var(--acc-hot)); border: 0; }

.ld-bubble {
    background: var(--bg-1);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink);
    max-width: 80%;
}
.ld-user-bubble {
    background: var(--acc-soft);
    border-color: var(--line-accent);
    border-bottom-right-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12.5px;
}
.ld-bot-bubble {
    border-bottom-left-radius: 4px;
    max-width: 100%;
    flex: 1;
}

/* REAL answer rendering — inject production HTML directly */
.ld-answer-real {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.ld-answer-real h1, .ld-answer-real h2, .ld-answer-real h3 {
    margin: 14px 0 6px;
    color: var(--acc);
    font-weight: 700;
}
.ld-answer-real h3 { font-size: 14px; }
.ld-answer-real strong { color: var(--ink); font-weight: 700; }
/* Drawings inside the embedded production HTML */
.ld-answer-real .chat-draw-inline {
    max-width: 100% !important;
    margin: 10px 0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    padding: 6px !important;
    display: block !important;
}
.ld-answer-real .chat-draw-inline img {
    max-width: 100%;
    height: auto;
    max-height: 260px;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* Scroll hint — animated arrow pointing down */
.ld-scroll-hint {
    text-align: center;
    padding: 6px;
    background: var(--bg-2);
    color: var(--ink-dim);
    font-size: 11px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
    animation: ldNudge 2.4s ease-in-out infinite;
}
@keyframes ldNudge {
    0%, 100% { background: var(--bg-2); }
    50%      { background: var(--acc-soft); color: var(--acc); }
}

/* Bottom CTA bar — converts viewers */
.ld-cta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--acc-soft), transparent);
    border-top: 1px solid var(--line-accent);
    flex-shrink: 0;
}
.ld-cta-text {
    font-size: 12.5px;
    color: var(--ink);
    font-weight: 500;
}
.ld-cta-btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--acc);
    color: var(--acc-fg);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12.5px;
    transition: transform .15s ease, box-shadow .15s ease;
    flex-shrink: 0;
}
.ld-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59,130,246,.25);
}

@media (max-width: 600px) {
    .ld-shell { height: 520px; }
    .ld-body.ld-scroll { padding: 14px 12px; gap: 12px; }
    .ld-bubble { font-size: 12px; padding: 9px 11px; max-width: 86%; }
    .ld-answer-real { font-size: 12px; }
    .ld-cta-bar { flex-wrap: wrap; gap: 8px; }
    .ld-cta-text { font-size: 11.5px; }
    .ld-cta-btn { font-size: 12px; padding: 7px 12px; }
    .ld-fake-topbar { padding: 9px 12px; }
}
