/* ============================================================
   JANEK WEBCHAT — PREMIUM DARK DESIGN
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- DESIGN TOKENS --- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --bg-glass-hover: rgba(255, 255, 255, 0.10);

    --text-primary: #e8e8ed;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;

    --accent-primary: #7c5cfc;
    --accent-secondary: #5b8def;
    --accent-glow: rgba(124, 92, 252, 0.25);
    --accent-gradient: linear-gradient(135deg, #7c5cfc 0%, #5b8def 50%, #43e5a0 100%);

    --success: #43e5a0;
    --danger: #ff5c72;
    --warning: #ffb347;
    --info: #5b8def;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(124, 92, 252, 0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* --- ANIMATED BACKGROUND --- */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(124, 92, 252, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(91, 141, 239, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(67, 229, 160, 0.04) 0%, transparent 50%);
    animation: bgShift 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes bgShift {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(-2%, 1%) rotate(1deg);
    }

    66% {
        transform: translate(1%, -1%) rotate(-0.5deg);
    }
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   LAYOUT
   ============================================================ */

.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-glow);
}

.header-info h1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 6px;
}

.header-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-active);
}

/* ============================================================
   SCREENS MANAGEMENT
   ============================================================ */

.screen {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

/* ============================================================
   WELCOME SCREEN
   ============================================================ */

.welcome-screen {
    padding: 24px 20px;
    overflow-y: auto;
}

.welcome-hero {
    text-align: center;
    padding: 40px 0 32px;
}

.welcome-emoji {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.welcome-hero h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-hero p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

.how-it-works {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 24px 0 32px;
}

.step-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    transition: all var(--transition-normal);
}

.step-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-active);
    transform: translateY(-2px);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-pill);
    background: var(--accent-gradient);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.step-card p {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.scenarios-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    padding-left: 4px;
}

/* ============================================================
   SCENARIO CARDS
   ============================================================ */

.scenarios-grid {
    display: grid;
    gap: 10px;
}

.scenario-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.scenario-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    transform: translateX(8px);
    box-shadow: var(--shadow-xl);
}

.scenario-icon-box {
    font-size: 1.8rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    position: relative;
    z-index: 1;
}

.scenario-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.scenario-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.scenario-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.scenario-chevron,
.scenario-play-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
    opacity: 0.5;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
}

.scenario-card:hover .scenario-chevron,
.scenario-card:hover .scenario-play-icon {
    color: var(--accent-primary);
    opacity: 1;
    transform: scale(1.2);
}

/* Category Header Styles */
.category-header {
    grid-column: 1 / -1;
    margin-bottom: 20px;
}

.btn-back-pill {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all var(--transition-fast);
    outline: none;
}

.btn-back-pill:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-active);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.category-icon {
    font-size: 2.5rem;
}

.category-text h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-text p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.sub-scenario {
    border-left: 4px solid var(--border-subtle);
}

.sub-scenario:hover {
    border-left-color: var(--accent-primary);
}

.scenario-card:hover .scenario-arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

/* ============================================================
   CUSTOM SCENARIO INPUT
   ============================================================ */

.custom-input-container {
    padding: 24px 20px;
    display: none;
}

.custom-input-container.active {
    display: block;
}

.custom-input-container h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.custom-input-container p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.custom-examples {
    margin-bottom: 20px;
}

.custom-examples li {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 6px;
    list-style: none;
    padding-left: 16px;
    position: relative;
}

.custom-examples li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.custom-textarea {
    width: 100%;
    min-height: 100px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color var(--transition-fast);
    outline: none;
}

.custom-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.custom-submit-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.btn-primary {
    flex: 1;
    padding: 12px 20px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    padding: 12px 20px;
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============================================================
   BRIEFING SCREEN  
   ============================================================ */

.briefing-screen {
    padding: 24px 20px;
    overflow-y: auto;
}

.briefing-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.briefing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
}

.briefing-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}

.briefing-text {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.briefing-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.meta-badge .emoji {
    font-size: 0.9rem;
}

.briefing-start-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: -0.01em;
}

.briefing-start-btn:hover {
    opacity: 0.92;
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* ============================================================
   CHAT SCREEN
   ============================================================ */

.chat-screen {
    flex-direction: column;
}

.chat-status-bar {
    padding: 10px 20px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-status-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-bot-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-turn-counter {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 3px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-pill);
}

.peek-goal-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.peek-goal-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.chat-status-right {
    display: flex;
    gap: 6px;
}

.chat-action-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-action-btn:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
    background: var(--bg-glass);
}

.chat-action-btn.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* --- MESSAGES --- */

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

.message {
    max-width: 82%;
    animation: messageIn 0.3s var(--transition-smooth);
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.88rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-bottom-right-radius: 4px;
    color: white;
}

.message-sender {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    padding-left: 2px;
}

.message.user .message-sender {
    text-align: right;
    padding-right: 2px;
}

/* HTML formatting inside bubbles */
.message-bubble b,
.message-bubble strong {
    font-weight: 700;
    color: inherit;
}

.message-bubble i,
.message-bubble em {
    font-style: italic;
    opacity: 0.85;
}

/* --- TYPING INDICATOR --- */

.typing-indicator {
    align-self: flex-start;
    display: none;
    padding: 4px 0;
}

.typing-indicator.active {
    display: block;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 4px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* --- SYSTEM MESSAGES --- */

.message.system {
    align-self: center;
    max-width: 90%;
}

.message.system .message-bubble {
    background: transparent;
    border: 1px dashed var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-align: center;
    border-radius: var(--radius-md);
}

/* --- HINT MESSAGE --- */
.message.hint {
    align-self: center;
    max-width: 88%;
}

.message.hint .message-bubble {
    background: rgba(255, 179, 71, 0.08);
    border: 1px solid rgba(255, 179, 71, 0.2);
    color: var(--warning);
    font-size: 0.84rem;
    border-radius: var(--radius-md);
}

/* --- DEBRIEF --- */

.message.debrief {
    align-self: stretch;
    max-width: 100%;
}

.message.debrief .message-bubble {
    background: var(--bg-glass);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.7;
}

/* --- CHAT INPUT --- */

.chat-input-area {
    padding: 12px 16px 16px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.chat-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: border-color var(--transition-fast);
    line-height: 1.4;
}

.chat-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

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

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-glow);
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   DEBRIEF / END SCREEN
   ============================================================ */

.end-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 0 20px 20px;
    flex-shrink: 0;
}

.end-actions .btn-primary,
.end-actions .btn-secondary {
    flex: 1;
}

/* ============================================================
   MODAL (Stats, Bug, Feedback)
   ============================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 90%;
    max-width: 440px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--transition-smooth);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.88rem;
}

.modal-stat-row:last-child {
    border-bottom: none;
}

.modal-stat-label {
    color: var(--text-secondary);
}

.modal-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.modal textarea {
    width: 100%;
    min-height: 80px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    resize: vertical;
    outline: none;
    margin-bottom: 12px;
}

.modal textarea:focus {
    border-color: var(--accent-primary);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.modal-actions button {
    flex: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
    .how-it-works {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-actions {
        gap: 4px;
    }

    .header-btn {
        padding: 6px 8px;
        font-size: 0.7rem;
    }

    .message {
        max-width: 88%;
    }

    .briefing-card {
        padding: 20px 18px;
    }

    .briefing-meta {
        gap: 8px;
    }
}

@media (max-width: 380px) {
    .how-it-works {
        grid-template-columns: 1fr 1fr;
    }

    .header-btn span.btn-text {
        display: none;
    }
}

/* ============================================================
   GOAL OVERLAY
   ============================================================ */

.goal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.goal-overlay.active {
    display: flex;
}

.goal-content {
    background: var(--bg-glass);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 50px var(--accent-glow);
    animation: scaleUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.goal-label {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--accent-primary);
    letter-spacing: 0.2em;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.goal-description-text {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.goal-confirm-btn {
    width: 100%;
    padding: 20px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.goal-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 92, 252, 0.3);
}

.goal-confirm-btn:active {
    transform: translateY(0);
}

@media (max-width: 600px) {
    .goal-content {
        padding: 30px 20px;
    }

    .goal-description-text {
        font-size: 1.25rem;
    }
}

/* ============================================================
   TRUST BAR
   ============================================================ */

.trust-container {
    padding: 12px 20px;
    background: rgba(15, 15, 25, 0.4);
    border-bottom: 1px solid var(--border-subtle);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.trust-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.trust-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.trust-value {
    font-size: 0.82rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trust-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.trust-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff4b2b, #ff416c, #f7bb97, #adfbda, #00f2fe);
    background-size: 400% 100%;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px rgba(124, 92, 252, 0.3);
}