/* ============================================================
   Phony.ai — Dark Minimal UI
   Linear / Vercel aesthetic
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
    /* Background layers */
    --bg:           #080808;
    --surface:      #111111;
    --surface-2:    #181818;
    --surface-3:    #1f1f1f;

    /* Borders */
    --border:       rgba(255,255,255,0.07);
    --border-mid:   rgba(255,255,255,0.11);
    --border-hi:    rgba(255,255,255,0.18);

    /* Accent — violet */
    --accent:       #7c3aed;
    --accent-mid:   #8b5cf6;
    --accent-glow:  rgba(124, 58, 237, 0.25);
    --accent-subtle:rgba(124, 58, 237, 0.10);

    /* Text */
    --text:         #f1f1f1;
    --text-2:       rgba(241,241,241,0.65);
    --text-3:       rgba(241,241,241,0.35);

    /* Status */
    --green:        #22c55e;
    --green-glow:   rgba(34,197,94,0.25);
    --red:          #ef4444;
    --red-glow:     rgba(239,68,68,0.2);

    /* Misc */
    --radius-sm:    6px;
    --radius:       10px;
    --radius-lg:    14px;
    --radius-xl:    20px;
    --shadow:       0 0 0 1px var(--border), 0 8px 32px rgba(0,0,0,0.5);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Logo */
    --logo-filter:  invert(1) brightness(0.9);

    /* User message text */
    --user-msg-text: #fff;
}

/* ---------- Light mode ---------- */
[data-theme="light"] {
    --bg:           #f5f5f7;
    --surface:      #ffffff;
    --surface-2:    #f0f0f2;
    --surface-3:    #e8e8ec;

    --border:       rgba(0,0,0,0.06);
    --border-mid:   rgba(0,0,0,0.10);
    --border-hi:    rgba(0,0,0,0.16);

    --accent:       #7c3aed;
    --accent-mid:   #6d28d9;
    --accent-glow:  rgba(124, 58, 237, 0.15);
    --accent-subtle:rgba(124, 58, 237, 0.08);

    --text:         #1a1a1a;
    --text-2:       rgba(26,26,26,0.60);
    --text-3:       rgba(26,26,26,0.35);

    --green:        #16a34a;
    --green-glow:   rgba(22,163,74,0.15);
    --red:          #dc2626;
    --red-glow:     rgba(220,38,38,0.12);

    --shadow:       0 0 0 1px var(--border), 0 8px 32px rgba(0,0,0,0.08);

    --logo-filter:  none;
    --user-msg-text: #fff;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth theme transitions on key elements */
.app-header, .chat-section, .history-section, .call-panel, .app-footer,
.input-wrap, #user-input, .message, .result-box, .history-toggle,
.btn, .sid-input, .typing-dots, .theme-toggle {
    transition: background-color 0.3s ease, border-color 0.3s ease, 
                color 0.3s ease, box-shadow 0.3s ease;
}

/* ---------- Header ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 20px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 680px;
    justify-content: center;
    position: relative;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
    position: relative;
}

.logo-wordmark {
    height: 90px;
    width: auto;
    filter: var(--logo-filter);
    transition: filter 0.3s ease;
}

@media (max-width: 600px) {
    .logo-wordmark { height: 64px; }
}

.header-badge {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-mid);
    background: var(--accent-subtle);
    border: 1px solid rgba(139,92,246,0.25);
    padding: 1px 5px;
    border-radius: 4px;
    position: absolute;
    top: -2px;
    right: -36px;
}

.header-tagline {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-3);
    letter-spacing: 0.04em;
}

/* Theme toggle */
.theme-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
    background: var(--surface-3);
    border-color: var(--border-hi);
    color: var(--text);
}

.theme-toggle svg { transition: transform 0.3s ease; }
.theme-toggle:hover svg { transform: rotate(15deg); }

/* Dark mode: show sun icon (to switch to light) */
/* Light mode: show moon icon (to switch to dark) */
.icon-moon { display: none; }
.icon-sun { display: block; }

[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Light mode header backdrop */
[data-theme="light"] .app-header {
    background: var(--bg);
}

/* ---------- Hero Section ---------- */
.hero {
    width: 100%;
    padding: 60px 24px 48px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: radial-gradient(ellipse 80% 60% at 50% -20%, var(--accent-glow), transparent);
}

.hero-inner {
    max-width: 640px;
    margin: 0 auto;
}

.hero-headline {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 16px;
}

.hero-accent {
    background: linear-gradient(135deg, var(--accent-mid), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .hero-accent {
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-2);
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto 28px;
}

.hero-cta {
    display: inline-block;
    padding: 12px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 0 20px var(--accent-glow);
}

.hero-cta:hover {
    transform: translateY(-1px);
    background: var(--accent-mid);
    box-shadow: 0 0 30px var(--accent-glow);
}

.hero-proof {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 32px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat strong {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.hero-stat span {
    font-size: 0.75rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-stat-sep {
    width: 1px;
    height: 28px;
    background: var(--border-mid);
}

/* Hero hidden state (after CTA click) */
.hero.collapsed {
    display: none;
}

@media (max-width: 600px) {
    .hero {
        padding: 40px 20px 32px;
    }
    .hero-headline {
        font-size: 1.7rem;
    }
    .hero-sub {
        font-size: 0.95rem;
    }
    .hero-proof {
        gap: 14px;
    }
    .hero-stat strong {
        font-size: 1rem;
    }
}

/* Light mode chat shadow */
[data-theme="light"] .chat-section {
    box-shadow: 0 0 0 1px var(--border), 0 20px 60px rgba(0,0,0,0.08);
}

/* Light mode send button disabled */
[data-theme="light"] #send-button:disabled {
    background: var(--surface-3);
    color: var(--text-3);
}

/* Light mode end call */
[data-theme="light"] .btn-end-call {
    border-color: rgba(220,38,38,0.3);
    background: rgba(220,38,38,0.06);
}

[data-theme="light"] .btn-end-call:hover {
    background: rgba(220,38,38,0.12);
    border-color: rgba(220,38,38,0.5);
}

/* ---------- Main layout ---------- */
.app-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 24px 16px 48px;
}

.app-layout {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Live Call Panel ---------- */
.call-panel {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(34,197,94,0.25);
    background: linear-gradient(135deg, rgba(34,197,94,0.05) 0%, transparent 80%);
    overflow: hidden;
    animation: slide-in 0.35s cubic-bezier(0.22,1,0.36,1);
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.call-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(34,197,94,0.15);
}

.live-indicator {
    position: relative;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.live-dot {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--green);
}

.live-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--green);
    animation: live-pulse 2s ease-out infinite;
}

@keyframes live-pulse {
    0%   { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3.5); opacity: 0; }
}

.live-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--green);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.call-sid-badge {
    flex: 1;
    font-size: 11px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

.call-sid-badge code {
    color: var(--text-3);
    font-family: inherit;
    font-size: inherit;
    background: none;
}

.btn-end-call {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: var(--radius-sm);
    background: rgba(239,68,68,0.1);
    color: var(--red);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-end-call:hover {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.6);
}

.btn-end-call:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.live-transcript {
    max-height: 200px;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
}

.live-transcript::-webkit-scrollbar { width: 3px; }
.live-transcript::-webkit-scrollbar-track { background: transparent; }
.live-transcript::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }

.transcript-placeholder {
    font-size: 13px;
    color: var(--text-3);
    font-style: italic;
}

.live-transcript p {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-2);
}

.live-transcript strong {
    color: var(--accent-mid);
    font-weight: 500;
}

/* ---------- Chat Section ---------- */
.chat-section {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 0 1px var(--border), 0 20px 60px rgba(0,0,0,0.6);
}

#chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#chat-messages {
    flex: 1;
    min-height: 380px;
    max-height: 520px;
    overflow-y: auto;
    padding: 24px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

#chat-messages::-webkit-scrollbar { width: 3px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }

/* ---------- Messages ---------- */
.message {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
    animation: msg-in 0.2s cubic-bezier(0.22,1,0.36,1);
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.user-message {
    align-self: flex-end;
    background: var(--accent);
    color: var(--user-msg-text);
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.bot-message {
    align-self: flex-start;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.system-message {
    align-self: center;
    background: transparent;
    border: 1px dashed var(--border-mid);
    border-radius: 8px;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 450;
    padding: 5px 12px;
    max-width: 88%;
    text-align: center;
}

/* ---------- Typing indicator ---------- */
.typing-indicator {
    padding: 6px 20px 10px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    border-bottom-left-radius: 3px;
    padding: 9px 13px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-3);
    animation: dot-bounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.30s; }

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

/* ---------- Input area ---------- */
#user-input-container {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 12px;
    padding: 4px 4px 4px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap:focus-within {
    border-color: rgba(124,58,237,0.5);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#user-input {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    outline: none;
    min-width: 0;
}

#user-input::placeholder { color: var(--text-3); }

#user-input:disabled { opacity: 0.5; }

#send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

#send-button:hover {
    background: var(--accent-mid);
    box-shadow: 0 0 16px var(--accent-glow);
}

#send-button:active { transform: scale(0.92); }

#send-button:disabled {
    background: var(--surface-3);
    color: var(--text-3);
    cursor: not-allowed;
    box-shadow: none;
}

.input-hint {
    font-size: 11px;
    color: var(--text-3);
    padding: 0 2px;
}

.input-hint kbd {
    display: inline-block;
    font-family: inherit;
    font-size: 10px;
    background: var(--surface-3);
    border: 1px solid var(--border-hi);
    border-radius: 3px;
    padding: 0px 4px;
    margin: 0 1px;
    color: var(--text-3);
    line-height: 1.6;
}

/* ---------- Inline Places (in chat) ---------- */

.places-message {
    max-width: 100% !important;
}

.places-text {
    margin-bottom: 10px;
    line-height: 1.5;
}

.inline-map {
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.map-num-marker {
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    width: 26px !important;
    height: 26px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.inline-place-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inline-place-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    cursor: pointer;
    transition: all 0.15s;
}

.inline-place-card:hover {
    border-color: var(--accent-mid);
    background: var(--surface-3);
}

.place-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.place-card-info {
    flex: 1;
    min-width: 0;
}

.place-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.place-card-addr {
    font-size: 11px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.place-card-meta {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}

/* ---------- SMS Banner ---------- */

.sms-banner {
    text-align: center;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-2);
    background: var(--bg-2);
    border-bottom: 1px solid var(--border-mid);
}

.sms-number {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.sms-number:hover {
    text-decoration: underline;
}

/* ---------- Empty State / Example Prompts ---------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
}

.empty-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 16px;
}

.example-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 420px;
}

.example-btn {
    background: var(--bg-2);
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.example-btn:hover {
    background: var(--surface);
    border-color: var(--accent-mid);
    color: var(--text);
}

/* ---------- Terms Modal ---------- */

.terms-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.terms-modal {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    padding: 32px;
    text-align: center;
}

.terms-logo {
    height: 48px;
    filter: var(--logo-filter);
    margin-bottom: 16px;
}

.terms-modal h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.terms-content {
    text-align: left;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 20px;
}

.terms-content p { margin-bottom: 8px; }

.terms-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.terms-content li {
    margin-bottom: 6px;
}

.terms-note {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 12px;
}

.terms-accept-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.terms-accept-btn:hover { background: var(--accent-mid); }

/* ---------- History Section ---------- */
.history-section {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

.history-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px;
    background: transparent;
    border: none;
    color: var(--text-3);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s;
}

.history-toggle:hover { color: var(--text-2); }

.toggle-chevron {
    transition: transform 0.25s cubic-bezier(0.22,1,0.36,1);
    flex-shrink: 0;
}

.history-toggle.open .toggle-chevron { transform: rotate(180deg); }

.history-body {
    /* display managed by JS — defaults to none on init */
    border-top: 1px solid var(--border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.history-body.visible {
    opacity: 1;
    transform: translateY(0);
}

.history-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sid-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.sid-input::placeholder { color: var(--text-3); font-family: var(--font); }

.sid-input:focus {
    border-color: rgba(124,58,237,0.4);
}

.btn {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
    border: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
    background: var(--surface-3);
    color: var(--text-2);
    border: 1px solid var(--border-mid);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--border-hi);
    color: var(--text);
}

/* ---------- Result boxes ---------- */
.result-box {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    overflow: hidden;
    animation: msg-in 0.2s ease;
}

.result-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.result-label svg { flex-shrink: 0; opacity: 0.7; }

.result-content {
    padding: 14px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-2);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-content p { margin: 0; }
.result-content strong { color: var(--accent-mid); font-weight: 500; }

.result-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

/* ---------- Footer ---------- */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-3);
    background: var(--bg);
}

.footer-power { color: var(--text-3); }
.footer-sep { opacity: 0.3; }
.footer-copy { color: var(--text-3); }

.footer-link {
    color: var(--text-3);
    text-decoration: none;
    border-bottom: 1px dotted var(--border-hi);
    transition: color 0.2s;
}

.footer-link:hover { color: var(--text-2); }

/* ---------- Scrollbar (global) ---------- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .app-main { padding: 12px 8px 32px; }

    .app-layout { gap: 12px; }

    #chat-messages { min-height: 300px; max-height: 55dvh; }

    .message { max-width: 90%; font-size: 0.9rem; }

    .empty-title { font-size: 0.9rem; }
    .example-prompts { gap: 6px; }
    .example-btn { font-size: 0.8rem; padding: 8px 12px; }

    .input-wrap { border-radius: var(--radius); }
    #user-input { font-size: 16px; padding: 14px 52px 14px 14px; } /* 16px prevents iOS zoom */
    #send-button { width: 38px; height: 38px; right: 6px; }
    .input-hint { display: none; } /* hide "Press Enter" on mobile */

    .chat-section { border-radius: var(--radius); padding: 12px; }

    .history-inputs { flex-direction: column; align-items: stretch; }
    .history-inputs .btn { width: 100%; text-align: center; min-height: 44px; }
    .sid-input { min-height: 44px; }

    .call-panel-header { flex-wrap: wrap; gap: 8px; }

    .live-transcript { max-height: 200px; font-size: 0.82rem; }

    /* Map on mobile */
    .map-container { height: 200px !important; border-radius: var(--radius) !important; }
    .place-card { padding: 10px !important; }
    .place-name { font-size: 0.85rem !important; }

    .app-footer { padding: 12px 16px; font-size: 10px; flex-wrap: wrap; justify-content: center; }

    .terms-modal { margin: 16px; padding: 24px 20px; max-height: 90dvh; }
    .terms-logo { height: 48px; }
}


/* ── Call status live updates ── */
.call-status-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-style: italic;
}

.status-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── Share call button ── */
.share-call-message {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.share-call-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius);
    color: var(--accent-mid);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: border-color 0.15s, background 0.15s;
}

.share-call-btn:hover {
    background: var(--surface-3);
    border-color: var(--accent);
}
