:root {
    --transition-speed: 0.2s;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- THEME: GLASS (Based on Glass.md) --- */
body.theme-glass {
    --bg-main: #050505; 
    --bg-modal: #121212;
    --bg-surface: #1e1e1e;
    --bg-input: #121212;
    
    --brand-color: #6d5dfc;
    --brand-color-hover: #5b4ee0;
    --brand-glow: rgba(109, 93, 252, 0.3);
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --border-color: #27272a;
    --divider-color: #3f3f46;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    
    --radius-modal: 28px;
    --radius-button: 14px;
    --radius-input: 12px;
    --radius-card: 16px;
    
    --blur-modal: 0px; /* Solid based on JSON, but we can add subtle blur if needed */
}

/* --- THEME: LINEAR (Solid Slate Premium) --- */
body.theme-linear {
    --bg-main: #0b0e14; 
    --bg-modal: #151921;
    --bg-surface: #272a34;
    --bg-input: #0b0e14;
    
    --brand-color: #6366f1;
    --brand-color-hover: #4f46e5;
    --brand-glow: rgba(99, 102, 241, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #272a34;
    --divider-color: #1f222b;
    --overlay-bg: rgba(0, 0, 0, 0.8);
    
    --radius-modal: 20px;
    --radius-button: 12px;
    --radius-input: 10px;
    --radius-card: 16px;
    
    --blur-modal: 8px;
}

/* --- THEME: APPLE (White Clean) --- */
body.theme-apple {
    --bg-main: #F2F2F7; 
    --bg-modal: rgba(255, 255, 255, 0.7);
    --bg-surface: #FFFFFF;
    --bg-input: #FFFFFF;
    
    --brand-color: #007AFF;
    --brand-color-hover: #0062cc;
    --brand-glow: rgba(0, 122, 255, 0.2);
    
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-muted: #86868B;
    
    --border-color: rgba(0, 0, 0, 0.05);
    --divider-color: rgba(0, 0, 0, 0.1);
    --overlay-bg: rgba(242, 242, 247, 0.8);
    
    --radius-modal: 24px;
    --radius-button: 12px;
    --radius-input: 12px;
    --radius-card: 20px;
    
    --blur-modal: 20px;
}

body.theme-apple .powered-by a {
    background: #FFFFFF !important;
    color: #1D1D1F !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

body.theme-apple .powered-by a:hover {
    background: #F5F5F7 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #000000 !important;
}

body.theme-apple .icon-btn,
body.theme-apple .language-switcher {
    background: rgba(255, 255, 255, 0.7) !important;
    color: #1D1D1F !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.theme-apple .icon-btn:hover {
    background: #FFFFFF !important;
    color: #007AFF !important;
}

body.theme-apple .lang-btn:not(.active):hover {
    color: #000000 !important;
}

body.theme-apple .action-btn.small:hover {
    background: rgba(0, 122, 255, 0.1) !important;
    color: #007AFF !important;
    border-color: rgba(0, 122, 255, 0.2) !important;
}

body.theme-apple .admin-panel h2 {
    color: #1D1D1F !important;
}

body.theme-apple .admin-panel {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1) !important;
}

body.theme-apple .segmented-control {
    background: rgba(118, 118, 128, 0.12) !important;
    padding: 2px !important;
}

body.theme-apple .tab-btn.active {
    background: #FFFFFF !important;
    color: #1D1D1F !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

body.theme-apple .setting-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #86868B !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
}

body.theme-apple .save-btn {
    background: var(--brand-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.2) !important;
}

body.theme-apple .input-container {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.theme-apple .answer-card {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04) !important;
}

body.theme-apple .language-switcher {
    background: rgba(118, 118, 128, 0.12) !important;
    border: none !important;
}

body.theme-apple .lang-btn.active {
    background: #FFFFFF !important;
    color: #1D1D1F !important;
}

body.theme-apple .suggestion-chip {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #1D1D1F;
    font-weight: 500;
}

body.theme-apple .suggestion-chip:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.theme-apple .send-btn {
    border-radius: 100px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.input-container, .answer-card, .admin-panel, .floating-btn, .suggestion-chip, .icon-btn, .language-switcher {
    transition: all 0.4s var(--ease-out);
}

h1, h2, h3, .welcome-title, #adminPanelTitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h2, #adminPanelTitle { font-size: 20px; }

/* MINIMIZED STATE */
body.minimized .container {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9) translateY(50px);
}

body.minimized .header-tools {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

body.minimized .floating-btn {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Ambient Background */
.background-gradient {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 50% 0%, var(--bg-modal) 0%, var(--bg-main) 85%);
    z-index: -1;
    pointer-events: none;
}

/* Floating Button */
.floating-btn {
    position: fixed;
    bottom: 30px; right: 30px;
    width: 56px; height: 56px;
    background: var(--brand-color);
    color: white;
    border-radius: var(--radius-button);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px var(--brand-glow);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s var(--ease-out);
    transform: scale(0) translateY(20px);
    opacity: 0;
    pointer-events: none;
    border: none;
}

.floating-btn:hover {
    transform: scale(1.05) translateY(-4px);
    background: var(--brand-color-hover);
}

.container {
    width: 100%;
    max-width: 680px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: relative;
    transition: all 0.5s var(--ease-out);
}

/* Header Tools */
.header-tools {
    position: fixed;
    top: 24px; right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1100;
}

.language-switcher {
    display: flex;
    background: var(--bg-modal);
    border-radius: 12px;
    padding: 3px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 9px;
    transition: 0.2s;
}

.lang-btn.active { background: var(--bg-surface); color: white; }

.icon-btn {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 38px; height: 38px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.icon-btn:hover { background: var(--bg-surface); color: white; }

/* Title Area */
.title-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2rem;
    width: 100%;
}

.title-area h1 { font-size: 24px; font-weight: 600; text-align: center; }

/* Input Container */
.input-container {
    width: 100%;
    background: var(--bg-modal);
    backdrop-filter: blur(var(--blur-modal));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s var(--ease-out);
}

.input-container:focus-within {
    border-color: var(--brand-color);
    background: var(--bg-surface);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    resize: none;
    outline: none;
    max-height: 150px;
    padding: 0;
    text-align: center;
}

textarea::placeholder { color: var(--text-muted); opacity: 0.8; }

.send-btn {
    background: var(--brand-color);
    border: none;
    border-radius: 10px;
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    opacity: 0.5;
    pointer-events: none;
    transition: 0.2s;
}

.send-btn.active { opacity: 1; pointer-events: auto; }

.clear-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: 0.2s;
}

.clear-btn svg {
    width: 20px;
    height: 20px;
}

/* Suggestions */
.suggestions {
    display: flex;
    gap: 8px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.suggestion-chip {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
}

.suggestion-chip:hover {
    background: var(--bg-surface);
    border-color: var(--divider-color);
    color: white;
}

/* Answer Card */
.answer-card {
    background: var(--bg-modal);
    backdrop-filter: blur(var(--blur-modal));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative; /* Base for absolute copy button */
}

.answer-content { line-height: 1.8; font-size: 15px; color: var(--text-primary); }

.answer-footer {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#copyBtn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    transition: all 0.2s var(--ease-out);
}

#copyBtn:hover {
    border-color: var(--divider-color);
    color: white;
    background: var(--brand-color);
}

/* ADMIN PANEL STYLES */
.admin-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-panel {
    background: var(--bg-modal);
    backdrop-filter: blur(var(--blur-modal));
    -webkit-backdrop-filter: blur(var(--blur-modal));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-modal);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: panelSlideUp 0.6s var(--ease-out);
}

body.theme-glass .admin-panel {
    background: rgba(18, 18, 18, 0.7) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#confirmationModal .admin-panel {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#confirmationModal .admin-header-compact,
#confirmationModal .admin-footer {
    border: none !important;
    background: transparent !important;
}

@keyframes panelSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.admin-header-compact {
    padding: 32px 32px 16px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-bottom: 1px solid var(--divider-color);
}

#confirmationModal .admin-header-compact {
    border: none;
}

.header-top { display: flex; justify-content: space-between; align-items: center; }

.icon-close-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center; justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.icon-close-btn:hover { background: #2c2c2e; color: white; }

.user-badge { color: var(--text-muted); font-size: 12px; margin-top: -8px; }

.segmented-control {
    display: flex;
    background: var(--bg-main);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    margin-top: 12px;
}

.tab-btn {
    flex: 1; height: 34px;
    border-radius: 10px;
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active { background: var(--bg-surface); color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }

.admin-main { padding: 0 32px; max-height: 60vh; overflow-y: auto; }
.tab-content { display: none; padding: 24px 0; }
.tab-content.active { display: block; }

.admin-content { padding: 8px 0 32px 0; display: flex; flex-direction: column; gap: 24px; }
.setting-group { display: flex; flex-direction: column; gap: 10px; }
.setting-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.admin-select {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: var(--radius-input);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
    width: 100%;
}

.admin-select:focus { border-color: var(--brand-color); }

/* Drop Zone Modern Glassmorphism */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--brand-color);
    background: rgba(109, 93, 252, 0.05);
    box-shadow: 0 0 20px rgba(109, 93, 252, 0.1);
    transform: translateY(-2px);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-zone-content svg {
    color: var(--brand-color);
    transition: transform 0.3s var(--ease-out);
}

.drop-zone:hover svg {
    transform: scale(1.1) translateY(-5px);
}

.drop-zone-content p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 240px;
    line-height: 1.5;
}

/* File info when uploaded */
.file-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(34, 197, 94, 0.1);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid rgba(34, 197, 94, 0.2);
    animation: slideUp 0.3s var(--ease-out);
}

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

.file-name {
    font-size: 14px;
    font-weight: 600;
    color: #4ade80;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-file-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}

.remove-file-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

body.theme-apple .admin-footer,
body.theme-apple .auth-footer {
    background: rgba(0, 0, 0, 0.03) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.admin-footer {
    padding: 24px 32px 32px 32px;
    border-top: 1px solid var(--divider-color);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

#confirmationModal .admin-footer {
    flex-direction: row;
    gap: 12px;
}

#confirmationModal .admin-footer button {
    flex: 1;
    height: 46px; /* Explicit equal height */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-danger {
    background: #f43f5e !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25) !important;
}

.btn-danger:hover {
    background: #e11d48 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(225, 29, 72, 0.3) !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 12px 24px;
    height: 46px; /* Match btn-danger height */
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Auth Extra Actions */
.auth-extra-actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
    width: 100%;
}

.auth-extra-actions .action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.2s var(--ease-out);
    white-space: nowrap;
}

.auth-extra-actions .action-btn:hover {
    color: var(--brand-color);
    background: rgba(255, 255, 255, 0.05);
}

.save-btn {
    width: 100%;
    background: var(--brand-color);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-button);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--brand-glow);
    transition: all 0.3s var(--ease-out);
}

.save-btn:hover { background: var(--brand-color-hover); transform: translateY(-1px); }

.logs-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    justify-content: flex-start;
}

.action-btn.small {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.action-btn.small:hover { 
    border-color: var(--divider-color); 
    color: white; 
    background: rgba(255, 255, 255, 0.05);
}

.action-btn.danger { 
    color: #f43f5e; 
    border-color: rgba(244, 63, 94, 0.2) !important;
}

.action-btn.danger:hover {
    background: rgba(244, 63, 94, 0.1) !important;
    border-color: rgba(244, 63, 94, 0.4) !important;
    color: #fb7185;
}

/* Main Footer */
.main-footer {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 100;
    background: linear-gradient(to top, var(--bg-main) 40%, transparent 100%);
    pointer-events: none;
}

.main-footer > * { pointer-events: auto; }

.powered-by a {
    display: inline-block;
    padding: 8px 20px;
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: 0.2s;
}

.powered-by a:hover { border-color: rgba(255, 255, 255, 0.2); color: white; transform: translateY(-1px); }

.creator-footer a { color: inherit; text-decoration: none; font-size: 12px; opacity: 0.6; transition: 0.2s; }
.creator-footer a:hover { opacity: 1; color: white; }

/* Creator Popup */
.creator-popup {
    position: fixed;
    bottom: 40px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-modal);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 40px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--ease-out);
    z-index: 9999;
}

.creator-popup.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.creator-popup a { color: var(--accent-color); text-decoration: none; font-weight: 600; margin-left: 4px; }

/* Toast */
.toast {
    position: fixed;
    top: 24px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center; gap: 10px;
    opacity: 0; transition: 0.3s;
    z-index: 10000;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Utilities */
.hidden { display: none !important; }
.force-hidden { display: none !important; }

/* File Info */
.file-info {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    background: rgba(109, 93, 252, 0.05);
    padding: 10px 16px; border-radius: 12px;
    border: 1px solid rgba(109, 93, 252, 0.15);
    margin-top: 12px;
}
.file-name { color: var(--accent-color); font-size: 13px; font-weight: 500; }

.log-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 18px; margin-bottom: 12px;
}
.log-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.log-answer { color: var(--text-secondary); font-size: 13px; line-height: 1.5; margin-top: 4px; }

/* Toggle & Switch Styles */
.toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.switch { 
    position: relative; 
    width: 40px; 
    height: 22px; 
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider { 
    position: absolute; 
    cursor: pointer; 
    top: 0; left: 0; right: 0; bottom: 0; 
    background-color: var(--bg-surface);
    border-radius: 34px; 
    transition: 0.3s; 
    border: 1px solid var(--border-color);
}

.slider:before { 
    position: absolute; 
    content: ""; 
    height: 16px; 
    width: 16px; 
    left: 2px; 
    bottom: 2px; 
    background-color: white; 
    border-radius: 50%; 
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked + .slider { 
    background-color: var(--brand-color);
    border-color: var(--brand-color);
}

input:checked + .slider:before { 
    transform: translateX(18px); 
}

/* Subdomain Input */
.subdomain-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

#authSubdomain {
    width: 100%;
    padding-right: 125px !important;
}

.subdomain-suffix {
    position: absolute;
    right: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    font-weight: 500;
}

/* Onboarding Flow */
.onboarding-steps { 
    display: flex; 
    flex-direction: column; 
    padding: 16px 8px;
    gap: 8px;
}

.onboarding-step { 
    display: flex; 
    gap: 24px; 
    padding: 24px 16px; 
    position: relative;
    border-radius: 20px;
    transition: all 0.3s var(--ease-out);
}

.onboarding-step:hover {
    background: rgba(255, 255, 255, 0.02);
}

.onboarding-step:not(:last-child)::before {
    content: ""; position: absolute;
    left: 41px; top: 76px; bottom: -12px;
    width: 2px; background: linear-gradient(to bottom, var(--brand-color), transparent);
    opacity: 0.3;
}

.step-icon-wrapper {
    width: 52px; height: 52px;
    background: var(--bg-surface);
    color: var(--brand-color);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; 
    z-index: 2; 
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s var(--ease-out);
}

.onboarding-step:hover .step-icon-wrapper {
    transform: scale(1.1) rotate(-5deg);
    border-color: var(--brand-color);
    box-shadow: 0 0 20px var(--brand-glow);
    background: var(--brand-color);
    color: white;
}

.step-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.step-text { 
    font-size: 1.05rem; 
    font-weight: 600; 
    color: var(--text-primary);
    line-height: 1.4; 
}

.step-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Welcome Banner */
.welcome-banner {
    width: 100%;
    max-width: 680px;
    background: var(--bg-modal);
    backdrop-filter: blur(var(--blur-modal));
    -webkit-backdrop-filter: blur(var(--blur-modal));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-modal);
    padding: 40px;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: slideInDown 0.6s var(--ease-out);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

body.theme-glass .welcome-banner {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(30px);
    border-color: rgba(255, 255, 255, 0.1);
}

body.theme-apple .welcome-banner {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.welcome-title span {
    color: var(--brand-color);
}

.todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s var(--ease-out);
}

body.theme-apple .todo-item {
    background: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.05);
}

.todo-item:hover {
    border-color: var(--brand-color);
    transform: translateX(4px);
}

.todo-item.done {
    opacity: 0.6;
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.1);
}

.todo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-color);
    flex-shrink: 0;
}

.todo-item.done .todo-icon {
    color: #10b981;
}

.todo-text {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.todo-item.done .todo-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

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

.welcome-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.welcome-btn.primary {
    background: var(--brand-color);
    color: white;
    box-shadow: 0 4px 12px var(--brand-glow);
}

.welcome-btn.primary:hover {
    background: var(--brand-color-hover);
    transform: translateY(-2px);
}

.welcome-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.welcome-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Spinner */
.processing-loader { display: flex; justify-content: center; align-items: center; }
.spinner { width: 32px; height: 32px; border: 2px solid rgba(255, 255, 255, 0.1); border-radius: 50%; border-top-color: var(--brand-color); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
body.has-results .container { justify-content: flex-start; padding-top: 4rem; }
.results-area { width: 100%; margin-top: 1rem; opacity: 0; transform: translateY(20px); transition: all 0.4s var(--ease-out); pointer-events: none; }
body.has-results .results-area { opacity: 1; transform: translateY(0); pointer-events: auto; }
