:root {
    --bg: #050816;
    --bg-card: #0f172a;
    --border-subtle: #1f2937;
    --accent: #22c55e;
    --accent-soft: rgba(34, 197, 94, 0.16);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --danger: #ef4444;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
    color: var(--text-main);
}

.app-shell {
    min-height: 100vh;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 12px 4px 8px;
}

.app-header h1 {
    margin: 0;
    font-size: 32px;
    letter-spacing: 0.08em;
}

.app-header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.app-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* Cards */

.card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 18px 18px 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(18px);
}

.card h2 {
    margin-top: 0;
    font-size: 18px;
}

.hint {
    margin: 4px 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Buttons */

.btn {
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: #1e293b;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.16s ease, transform 0.08s ease, box-shadow 0.16s ease;
}

.btn.primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #022c22;
    box-shadow: 0 8px 16px rgba(34, 197, 94, 0.45);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.7);
}

.btn.primary:hover {
    box-shadow: 0 10px 22px rgba(34, 197, 94, 0.6);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.audio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.email-field {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.email-field input {
    background: #020617;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 13px;
}

.email-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.status-text {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Recording */

.recording-status {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--danger);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--danger);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
}

/* Chat */

.chat-window {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: radial-gradient(circle at top left, #020617, #020617 40%, #000 100%);
    padding: 12px;
    height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-bubble {
    max-width: 80%;
    padding: 8px 10px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.3;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-bubble.bot {
    align-self: flex-start;
    background: #0b1220;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--accent);
    color: #022c22;
    border-bottom-right-radius: 4px;
}

.chat-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: -2px;
    padding: 0 2px;
}

.chat-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.chat-form input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: #020617;
    color: var(--text-main);
    padding: 8px 12px;
    font-size: 14px;
}

.chat-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

/* Briefing */

.briefing-output {
    background: #020617;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 12px;
    max-height: 380px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.result-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

/* Helpers */

.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .app-shell {
        padding: 12px 10px 24px;
    }

    .card {
        padding: 14px 12px 12px;
    }

    .chat-window {
        height: 280px;
    }
}
