@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: #111118;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-strong: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-2: rgba(255, 255, 255, 0.12);
    --border-glass-3: rgba(255, 255, 255, 0.18);

    --text-primary: #f0f0f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-faint: #52525b;

    --accent: #f97316;
    --accent-2: #fb923c;
    --accent-glow: rgba(249, 115, 22, 0.25);
    --accent-glow-soft: rgba(249, 115, 22, 0.10);
    --accent-dark: #ea580c;

    --user-bubble-1: #f97316;
    --user-bubble-2: #f59e0b;
    --bot-bubble-bg: rgba(255, 255, 255, 0.04);
    --bot-bubble-border: rgba(255, 255, 255, 0.08);

    --success: #22c55e;
    --error: #ef4444;

    --shadow-sm: 0 1px 3px 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);
    --shadow-glow-soft: 0 0 60px var(--accent-glow-soft);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    --blur: 20px;
    --blur-strong: 40px;

    --t-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --t-med: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

/* ── Animated mesh background ──────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(249, 115, 22, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 90%, rgba(139, 92, 246, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 50% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 60%);
    animation: meshShift 20s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes meshShift {
    0% {
        opacity: 1;
        transform: scale(1) translate(0, 0);
    }

    33% {
        opacity: 0.8;
        transform: scale(1.05) translate(-2%, 3%);
    }

    66% {
        opacity: 1;
        transform: scale(0.98) translate(2%, -2%);
    }

    100% {
        opacity: 0.9;
        transform: scale(1.02) translate(-1%, 1%);
    }
}

/* Noise texture overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ── Custom scrollbar ──────────────────────────────────── */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

*::-webkit-scrollbar {
    width: 5px;
}

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

*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 99px;
}

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

/* ── Layout shell ──────────────────────────────────────── */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ────────────────────────────────────────────── */
.branded-header {
    text-align: center;
    padding: 1rem 0 2rem;
    animation: fadeSlideDown 0.6s var(--t-med) both;
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-18px);
    }

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

.branded-header h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.branded-header .accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.branded-header .tagline {
    margin: 0.75rem auto 0;
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 520px;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* ── Capability pills ──────────────────────────────────── */
.brand-pills {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.brand-pills span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: all var(--t-fast);
    cursor: default;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.brand-pills span:hover {
    background: var(--bg-glass-strong);
    border-color: var(--border-glass-2);
    color: var(--text-primary);
}

/* ── Login card ────────────────────────────────────────── */
.login-container {
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur-strong));
    -webkit-backdrop-filter: blur(var(--blur-strong));
    padding: 3rem 3.25rem;
    max-width: 540px;
    margin: 1rem auto 0;
    text-align: center;
    animation: fadeSlideUp 0.5s var(--t-med) both;
    animation-delay: 0.15s;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.login-container .login-icon {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    display: block;
    line-height: 1;
    filter: grayscale(0.3);
}

.login-container h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.6rem;
}

.login-container .login-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 1.75rem;
}

.login-steps {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.5rem 1.2rem 1.75rem;
    text-align: left;
    margin-bottom: 2rem;
}

.login-steps ol {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.7;
    margin: 0;
    padding-left: 1.1rem;
}

.login-steps li {
    margin-bottom: 0.45rem;
}

.login-steps li:last-child {
    margin-bottom: 0;
}

.login-steps a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(249, 115, 22, 0.3);
    transition: all var(--t-fast);
}

.login-steps a:hover {
    color: var(--accent-2);
    border-bottom-color: var(--accent-2);
}

.login-steps strong {
    color: var(--text-primary);
}

/* Token input error */
.token-error {
    color: var(--error);
    font-size: 0.82rem;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--t-fast);
    min-height: 1.2em;
}

.token-error code {
    background: rgba(239, 68, 68, 0.12);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9em;
}

.token-error.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Chat container ────────────────────────────────────── */
.chatbot-container {
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur-strong));
    -webkit-backdrop-filter: blur(var(--blur-strong));
    overflow: hidden;
    animation: fadeSlideUp 0.5s var(--t-med) both;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative; /* required for drop overlay */
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    gap: 0.5rem;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.chat-header-title .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Welcome message ───────────────────────────────────── */
.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem;
    text-align: center;
    animation: fadeIn 0.6s ease both;
    animation-delay: 0.2s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.welcome-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: wave 2s ease-in-out 1;
}

@keyframes wave {

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

    15% {
        transform: rotate(14deg);
    }

    30% {
        transform: rotate(-8deg);
    }

    45% {
        transform: rotate(14deg);
    }

    60% {
        transform: rotate(-4deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

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

.welcome-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 400px;
    margin-bottom: 1.5rem;
}

.welcome-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.welcome-suggestions button {
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-glass-2);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: all var(--t-fast);
    letter-spacing: -0.005em;
}

.welcome-suggestions button:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glass-3);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ── Disconnect / secondary buttons ────────────────────── */
button.secondary {
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    transition: all var(--t-fast);
    cursor: pointer;
    letter-spacing: -0.005em;
}

button.secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glass-2);
    color: var(--text-primary);
}

button.secondary.danger:hover {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

/* ── Message bubbles ───────────────────────────────────── */
.message-row {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: messageIn 0.3s var(--t-med) both;
}

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

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

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

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

.message-row.status-row {
    align-self: center;
    max-width: 100%;
}

.message-row.user-row .message {
    background: linear-gradient(135deg, var(--user-bubble-1) 0%, var(--user-bubble-2) 100%);
    color: #fff;
    border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
    border: none;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.2);
    padding: 0.75rem 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.55;
    letter-spacing: -0.005em;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-row.bot-row .message {
    background: var(--bot-bubble-bg);
    color: var(--text-primary);
    border: 1px solid var(--bot-bubble-border);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    line-height: 1.7;
    letter-spacing: -0.005em;
    word-break: break-word;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.message-row.status-row .message {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    font-style: normal;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Bot message prose (markdown) */
.message-row.bot-row .message p {
    margin: 0 0 0.6em;
}

.message-row.bot-row .message p:last-child {
    margin-bottom: 0;
}

.message-row.bot-row .message strong {
    color: var(--text-primary);
    font-weight: 600;
}

.message-row.bot-row .message em {
    color: var(--text-secondary);
    font-style: italic;
}

.message-row.bot-row .message a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(249, 115, 22, 0.3);
    transition: all var(--t-fast);
}

.message-row.bot-row .message a:hover {
    color: var(--accent-2);
    border-bottom-color: var(--accent-2);
}

.message-row.bot-row .message code {
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent-2);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.85em;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.message-row.bot-row .message pre {
    background: rgba(0, 0, 0, 0.4);
    color: #e5e7eb;
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow-x: auto;
    margin: 0.6em 0;
    font-size: 0.82em;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.message-row.bot-row .message pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.message-row.bot-row .message ul,
.message-row.bot-row .message ol {
    padding-left: 1.3rem;
    margin: 0.4em 0;
}

.message-row.bot-row .message li {
    margin-bottom: 0.25em;
}

.message-row.bot-row .message hr {
    border: none;
    border-top: 1px solid var(--border-glass);
    margin: 0.8em 0;
}

/* ── Typing indicator ──────────────────────────────────── */
.typing-indicator {
    display: none;
    align-self: flex-start;
    padding: 0.75rem 1rem;
    margin: 0 1.25rem 0.5rem;
    background: var(--bot-bubble-bg);
    border: 1px solid var(--bot-bubble-border);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
    animation: messageIn 0.3s var(--t-med) both;
}

.typing-indicator.visible {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.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;
    }
}

/* ── Input area ────────────────────────────────────────── */
.input-area {
    border-top: 1px solid var(--border-glass);
    padding: 0.75rem;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
}

textarea {
    flex: 1;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: -0.005em;
    border: none;
    outline: none;
    resize: none;
    min-height: 24px;
    max-height: 150px;
    padding: 10px 12px;
    background: var(--bg-glass-strong);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

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

textarea::placeholder {
    color: var(--text-faint);
}

/* ── Buttons ───────────────────────────────────────────── */
button.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.25);
    transition: all var(--t-fast);
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    width: 100%;
    position: relative;
    overflow: hidden;
}

button.primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--t-fast);
}

button.primary:hover {
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35);
    transform: translateY(-1px);
}

button.primary:hover::before {
    opacity: 1;
}

button.primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 6px rgba(249, 115, 22, 0.2);
}

button.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Send / upload icon buttons */
.icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all var(--t-fast);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

.icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}

.icon-button:active {
    transform: translateY(0);
}

.icon-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.icon-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.upload-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast);
    flex-shrink: 0;
    font-size: 0;
}

.upload-button:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glass-2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.upload-button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Notion token input ────────────────────────────────── */
input[type="password"] {
    font-family: 'Inter', sans-serif;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass-2);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    width: 100%;
    padding: 0.8rem 1rem;
    box-sizing: border-box;
    outline: none;
}

input[type="password"]::placeholder {
    color: var(--text-faint);
}

input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow-soft);
}

/* ── File preview ──────────────────────────────────────── */
.file-preview {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0 0.75rem 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.file-preview:empty {
    display: none;
}

.file-preview-item {
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-glass);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    animation: fadeSlideUp 0.2s ease both;
    font-size: 0.8rem;
}

.file-preview-item .file-icon {
    font-size: 0.9rem;
}

.file-preview-item .file-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-item .file-size {
    color: var(--text-faint);
    font-size: 0.72rem;
    flex-shrink: 0;
}

.file-preview-item button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0;
    margin-left: 0.15rem;
    transition: color var(--t-fast);
    line-height: 1;
}

.file-preview-item button:hover {
    color: var(--error);
}

/* ── Drag and drop overlay ─────────────────────────────── */
.drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(249, 115, 22, 0.06);
    border: 2px dashed var(--accent);
    border-radius: var(--radius-2xl);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.drop-overlay.visible {
    display: flex;
}

.drop-overlay-text {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    background: rgba(249, 115, 22, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

/* ── Connecting animation ──────────────────────────────── */
.connecting-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.connecting-spinner .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 680px) {
    .app-container {
        padding: 1rem 0.75rem;
    }

    .login-container {
        padding: 2rem 1.5rem;
    }

    .branded-header h1 {
        font-size: 3rem;
    }

    .chatbot-container {
        border-radius: var(--radius-xl);
    }

    .message-row {
        max-width: 90%;
    }

    .welcome-suggestions {
        flex-direction: column;
    }

    .welcome-suggestions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0.5rem;
    }

    .login-container {
        padding: 1.5rem 1.25rem;
        margin: 0.5rem auto 0;
    }

    .branded-header {
        padding: 0.5rem 0 1rem;
    }

    .chat-header {
        padding: 0.75rem 1rem;
    }

    .chat-history {
        padding: 1rem 0.75rem;
    }

    .input-area {
        padding: 0.5rem;
    }
}

/* ── Utility ───────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}