/* Claude PHP — Beige theme (light) */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #ffffff;
    --bg-2: #f7fbf3;
    --bg-3: #edf6e7;
    --surface: #ffffff;
    --surface-soft: #f8fcf5;
    --border: #e3eadc;
    --border-strong: #cfe0c2;
    --text: #07142e;
    --text-soft: #4a5568;
    --text-muted: #7a8794;
    --accent: #68b82f;
    --accent-hover: #5aa728;
    --accent-soft: #edf8e8;
    --user-bubble: #eef8e8;
    --shadow-sm: 0 1px 2px rgba(46, 38, 26, 0.06);
    --shadow-md: 0 4px 16px rgba(46, 38, 26, 0.08);
    --radius: 14px;
    --radius-lg: 18px;
    --radius-pill: 999px;
    --serif: 'Source Serif 4', 'Iowan Old Style', 'Apple Garamond', Georgia, serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* CRITICAL: ensure 'hidden' attribute always wins over flex/grid/inline-block */
[hidden] { display: none !important; }
body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-soft); color: var(--text); }

.muted { color: var(--text-muted); font-weight: 400; }

/* ===== AUTH ===== */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(104, 184, 47, 0.10), transparent 50%),
        radial-gradient(circle at 85% 80%, rgba(104, 184, 47, 0.07), transparent 50%),
        var(--bg);
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-md);
}
.auth-logo {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-mark {
    color: var(--accent);
    font-size: 1.1em;
}
.auth-title {
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 500;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
.auth-sub { color: var(--text-soft); margin: 0 0 28px; font-size: 15px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-soft); font-weight: 500; }
.auth-form input {
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--bg);
    font-size: 15px;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-primary {
    background: var(--text);
    color: var(--bg);
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 15px;
    margin-top: 6px;
    transition: background 0.15s ease, transform 0.05s ease;
}
.btn-primary:hover { background: var(--accent); }
.btn-primary:active { transform: scale(0.99); }
.auth-foot { text-align: center; margin: 24px 0 0; color: var(--text-soft); font-size: 14px; }
.alert {
    background: #fdecec;
    border: 1px solid #f5c2c2;
    color: #8a2a2a;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ===== APP SHELL ===== */
.app-body {
    background: var(--bg-2);
    height: 100vh; /* fallback */
    height: 100dvh; /* dynamic viewport - perjashton browser chrome ne mobile */
    overflow: hidden;
}
/* Admin pages: lejo scroll vertikal (overflow:hidden i app-body s'duhet te aplikohet ketu) */
.app-body:has(.admin-shell) {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}
.app-shell {
    display: flex;
    height: 100vh; /* fallback */
    height: 100dvh;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: var(--bg-3);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.2s ease;
    flex-shrink: 0;
}
.sidebar.collapsed { margin-left: -260px; }
.sidebar-top {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--bg-2); color: var(--text); }

.new-chat {
    margin: 4px 12px 12px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.new-chat:hover { background: var(--surface-soft); border-color: var(--accent); }

.conv-section { flex: 1; overflow-y: auto; padding: 8px 8px 12px; }
.conv-label {
    padding: 8px 8px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.conv-list { display: flex; flex-direction: column; gap: 2px; }
.conv-empty { padding: 12px; color: var(--text-muted); font-size: 13px; }

.conv-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-soft);
    transition: background 0.12s ease, color 0.12s ease;
    position: relative;
}
.conv-item:hover { background: var(--bg-2); color: var(--text); }
.conv-item.active { background: var(--surface); color: var(--text); font-weight: 500; }
.conv-item .conv-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.conv-item .conv-del {
    opacity: 0;
    transition: opacity 0.12s ease;
    color: var(--text-muted);
}
.conv-item:hover .conv-del, .conv-item.active .conv-del { opacity: 1; }
.conv-item .conv-del:hover { color: #5aa728; }

.sidebar-foot {
    padding: 12px;
    border-top: 1px solid var(--border);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 10px;
}
.user-chip:hover { background: var(--bg-2); }
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-name {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-email {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* MAIN */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

.topbar {
    height: 56px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid transparent;
}
.topbar-menu { display: none; }
/* Ne desktop, shfaq hamburger-in kur sidebar-i eshte i mbyllur */
body.sidebar-collapsed .topbar-menu { display: inline-flex; }

/* MODEL PICKER */
.model-picker { position: relative; }
.model-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--bg-2);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.model-btn:hover { background: var(--bg-3); border-color: var(--border); }

/* Versioni MINI brenda composer-it (claude.ai style) */
.model-picker-mini { position: relative; }
.model-btn-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    font-weight: 500;
    font-size: 13px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}
.model-btn-mini:hover { background: var(--bg-2); color: var(--text); }
.model-btn-mini svg { opacity: 0.7; flex-shrink: 0; }

.model-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 50;
}
/* Variant qe shfaqet PER LART (per model picker brenda composer-it) */
.model-menu.model-menu-up {
    top: auto;
    bottom: calc(100% + 8px);
    left: auto;
    right: 0;
    box-shadow: 0 -4px 24px rgba(46, 38, 26, 0.12), 0 0 0 1px var(--border);
}
.model-menu-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 10px 12px 6px;
    font-weight: 600;
}
.model-option {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    transition: background 0.12s ease;
}
.model-option:hover { background: var(--bg-2); }
.model-option .mo-name { font-weight: 600; font-size: 14px; }
.model-option .mo-desc { font-size: 12px; color: var(--text-muted); }
.model-option .mo-check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    opacity: 0;
    font-weight: 600;
}
.model-option.selected .mo-check { opacity: 1; }
.model-option.selected .mo-name { color: var(--accent); }

/* CHAT AREA */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome {
    margin: auto;
    text-align: center;
    padding: 24px;
    max-width: 720px;
    width: 100%;
    animation: fadeIn 0.4s ease;
}
.welcome-mark {
    font-size: 42px;
    color: var(--accent);
    margin-bottom: 16px;
    line-height: 1;
}
.welcome-title {
    font-family: var(--serif);
    font-size: 36px;
    font-weight: 500;
    margin: 0;
    letter-spacing: -0.01em;
}

/* Welcome state: chat-area i centruar vertikalisht (greeting + composer + chips si bllok i njejt) */
body.welcome-state .chat-area {
    justify-content: center;
    padding-bottom: 0;
}
body.welcome-state .messages,
body.welcome-state .conv-toolbar { display: none !important; }

/* Mobile fix: kur tastiera virtuale shfaqet, composer mund te bjere poshte
   Sigurohu qe composer eshte gjithmone i dukshem ne fund te ekranit */
@media (max-width: 768px) {
    body.welcome-state .chat-area {
        flex: 1 1 auto;
        min-height: 0;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    body.welcome-state .welcome {
        margin: auto 0;
    }
    .composer-wrap {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        background: var(--bg);
        z-index: 5;
    }
}

/* Action chips poshte composer-it (claude.ai style) */
.welcome-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 760px;
    margin: 10px auto 0;
    padding: 0 12px;
}
.welcome-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13.5px;
    color: var(--text-soft);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
.welcome-action:hover {
    background: var(--surface-soft);
    border-color: var(--accent);
    color: var(--text);
}
.welcome-action:active { transform: scale(0.97); }
.welcome-action svg { color: var(--accent); flex-shrink: 0; }

/* Popup me 5 nen-opsione (claude.ai style) */
.welcome-popup {
    width: 100%;
    max-width: 760px;
    margin: 10px auto 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(46, 38, 26, 0.06);
    overflow: hidden;
    animation: wpFadeIn 0.18s ease;
}
@keyframes wpFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.wp-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border);
}
.wp-icon {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    flex-shrink: 0;
}
.wp-title {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-soft);
    flex: 1;
}
.wp-close {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.wp-close:hover { background: var(--bg-2); color: var(--text); }

.wp-list {
    display: flex;
    flex-direction: column;
    padding: 6px;
}
.wp-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.12s ease;
}
.wp-option:hover { background: var(--bg-2); }
.wp-option:active { background: var(--surface-soft); }

.messages {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 16px 24px 32px;
}

.msg { display: flex; flex-direction: column; gap: 6px; animation: slideUp 0.25s ease; }
.msg.user { align-items: flex-end; }
.msg.assistant { align-items: flex-start; }

.msg-bubble {
    max-width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 15.5px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.msg.user .msg-bubble {
    background: var(--user-bubble);
    color: var(--text);
    border-bottom-right-radius: 4px;
    max-width: 80%;
}
.msg.assistant .msg-bubble {
    background: transparent;
    color: var(--text);
    padding: 8px 0;
}
.msg.assistant .msg-bubble p { margin: 0 0 12px; }
.msg.assistant .msg-bubble p:last-child { margin-bottom: 0; }
.msg.assistant .msg-bubble code {
    background: var(--bg-3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
    font-size: 0.9em;
}
.msg.assistant .msg-bubble pre {
    background: #0b1324;
    color: #f3ead8;
    padding: 14px 16px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.55;
    margin: 8px 0;
}
.msg.assistant .msg-bubble pre code { background: transparent; padding: 0; }

.typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 8px 0;
}
.typing span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: blink 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

/* COMPOSER */
.composer-wrap {
    padding: 12px 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.composer {
    width: 100%;
    position: relative;
    max-width: 760px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    padding: 10px 12px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.composer-input {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: var(--text);
    font-size: 15.5px;
    line-height: 1.55;
    padding: 8px 6px;
    min-height: 24px;
    max-height: 200px;
}
.composer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 0;
}
.composer-hint { font-size: 11px; color: var(--text-muted); }
.send-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--text);
    color: var(--bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.06s ease, opacity 0.15s ease;
}
.send-btn:hover { background: var(--accent); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.footer-fine {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 8px;
    max-width: 760px;
}

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* SCROLLBAR */
.chat-area::-webkit-scrollbar, .conv-section::-webkit-scrollbar { width: 8px; }
.chat-area::-webkit-scrollbar-thumb, .conv-section::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.chat-area::-webkit-scrollbar-thumb:hover, .conv-section::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== v2 ADDITIONS ===== */

.search-box {
    margin: 0 12px 8px;
    padding: 7px 10px;
    background: #ffffff;
    border: 1px solid transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.search-box:focus-within { border-color: var(--accent); background: var(--surface); }
.search-box input {flex: 1;border: none;outline: none;/* background: transparent; */font-size: 13px;/* color: var(--text); */}
.search-box input::placeholder { color: var(--text-muted); }

.upgrade-banner {
    display: block;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, #d4775a 100%);
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.upgrade-banner:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.upgrade-banner .ub-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.upgrade-banner .ub-sub { font-size: 11px; opacity: 0.9; }

.pill-pro {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    vertical-align: middle;
}
.pill-free {
    display: inline-block;
    background: var(--border-strong);
    color: var(--text-soft);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.pro-tag {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    margin-left: 4px;
}

.usage-pill {
    padding: 6px 12px;
    background: var(--bg-2);
    border-radius: var(--radius-pill);
    font-size: 12px;
    color: var(--text-soft);
    font-weight: 500;
}
.usage-pill.pro { color: var(--accent); }

.model-option.locked { opacity: 0.7; }
.model-option.locked:hover { background: var(--bg-2); }

/* Composer attachments */
/* ===== ATTACHMENTS NE INPUT AREA ===== */
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 6px 8px; }
.attach-list:empty { display: none; }

.attach-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    padding: 6px 28px 6px 8px;
    border-radius: 12px;
    font-size: 12.5px;
    color: var(--text-soft);
    max-width: 240px;
}
.attach-chip.is-image {
    padding: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-3);
}
.attach-chip.uploading { opacity: 0.85; }

.attach-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.attach-icon { font-size: 16px; flex-shrink: 0; }
.attach-meta { min-width: 0; line-height: 1.2; }
.attach-name {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.attach-sub {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.attach-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background 0.12s ease;
}
.attach-remove:hover { background: rgba(0,0,0,0.75); }
.attach-chip:not(.is-image) .attach-remove { background: var(--text-muted); }
.attach-chip:not(.is-image) .attach-remove:hover { background: #5aa728; }

/* Spinner overlay per upload ne progres */
.attach-spinner {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}
.spinner-ring {
    width: 22px; height: 22px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* Popup menu i attach-it (claude.ai style) */
.attach-trigger { position: relative; }
.attach-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 32px rgba(46, 38, 26, 0.18);
    padding: 6px;
    min-width: 240px;
    z-index: 60;
    animation: ppFadeUp 0.14s ease;
}
.am-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: background 0.12s ease;
}
.am-item:hover { background: var(--bg-2); }
.am-item svg { color: var(--text-soft); flex-shrink: 0; }
.am-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.am-title { font-size: 13.5px; font-weight: 500; }
.am-sub { font-size: 11px; color: var(--text-muted); }

/* Attachments brenda nje mesazhi user (ne bubble) */
.msg-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.msg-attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.06);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text-soft);
}
.msg-attach-thumb {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
    border: 1px solid var(--border);
    background: var(--bg-2);
    max-width: 320px;
    transition: transform 0.1s ease;
}
.msg-attach-thumb:hover { transform: scale(1.01); }
.msg-attach-thumb img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
}
@media (max-width: 768px) {
    .msg-attach-thumb { max-width: 220px; }
    .msg-attach-thumb img { max-height: 220px; }
    .attach-menu { min-width: 220px; }
}
.msg-attachments:last-child { margin-bottom: 0; }
.msg-text { white-space: pre-wrap; word-wrap: break-word; }

/* Conversation toolbar */
.conv-toolbar {
    width: 100%;
    max-width: 760px;
    padding: 0 24px 8px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-soft);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tool-btn:hover { background: var(--surface-soft); color: var(--text); border-color: var(--accent); }

/* Upgrade Modal */
.modal[hidden] { display: none !important; }
.modal {
    position: fixed; inset: 0;
    background: rgba(45, 42, 38, 0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease;
}
.modal-card {
    width: 92%; max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-card.modal-wide { max-width: 560px; text-align: left; padding: 28px 24px; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-title { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0 0 6px; }
.modal-sub { color: var(--text-soft); font-size: 14px; margin: 0 0 18px; }

/* Memories Modal */
.mem-add-row {
    display: flex; gap: 8px;
    margin-bottom: 14px;
}
.mem-add-row input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    font-size: 14px;
    color: var(--text);
}
.mem-add-row input:focus { outline: none; border-color: var(--accent); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.mem-list {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}
.mem-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s ease;
}
.mem-row:last-child { border-bottom: none; }
.mem-row:hover { background: var(--bg-2); }
.mem-content {
    flex: 1;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--text);
    word-wrap: break-word;
}
.mem-del {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.12s ease, color 0.12s ease;
}
.mem-del:hover { background: rgba(179, 85, 58, 0.1); color: #5aa728; }
.mem-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13.5px;
}
.mem-foot {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--text-muted);
}
.btn-text-danger {
    background: transparent;
    border: none;
    color: #5aa728;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12.5px;
    transition: background 0.12s ease;
}
.btn-text-danger:hover { background: rgba(179, 85, 58, 0.1); }

/* Personality Modal */
.pers-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
}
.pers-opt { cursor: pointer; }
.pers-opt input { display: none; }
.pers-card {
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    transition: all 0.15s ease;
}
.pers-opt:hover .pers-card { border-color: var(--text-muted); }
.pers-opt input:checked + .pers-card {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.pers-icon { font-size: 22px; margin-bottom: 6px; }
.pers-name { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.pers-desc { font-size: 12px; color: var(--text-soft); line-height: 1.35; }

.pers-custom { margin-bottom: 14px; }
.pers-custom label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.pers-custom textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    font-size: 13.5px;
    color: var(--text);
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}
.pers-custom textarea:focus { outline: none; border-color: var(--accent); }

.pers-foot { display: flex; justify-content: flex-end; }

@media (max-width: 560px) {
    .pers-options { grid-template-columns: 1fr; }
    .modal-card.modal-wide { padding: 24px 18px; }
}

/* Pricing page */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}
.plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.plan-card.pro { border-color: var(--accent); border-width: 2px; }
.plan-badge {
    position: absolute;
    top: -10px; left: 50%; transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.plan-name { font-family: var(--serif); font-size: 24px; font-weight: 500; margin-bottom: 4px; }
.plan-price { font-size: 38px; font-weight: 600; margin: 12px 0 20px; }
.plan-price span { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.plan-features { list-style: none; padding: 0; margin: 0 0 24px; }
.plan-features li { padding: 7px 0; font-size: 14px; color: var(--text-soft); }
.plan-features li strong { color: var(--text); }

@media (max-width: 640px) { .pricing-grid { grid-template-columns: 1fr; } }

/* Account page */
.account-box { background: var(--bg-2); border-radius: 12px; padding: 8px 16px; margin-top: 16px; }
.acc-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.acc-row:last-child { border-bottom: none; }
.acc-row span { color: var(--text-soft); }

.msg-error { color: #5aa728; padding: 8px 12px; background: #fdecec; border: 1px solid #f5c2c2; border-radius: 8px; font-size: 13px; }

/* ===== v2.5: Profile Popup + Dark Mode + Settings ===== */

/* Dark theme override */
html[data-theme="dark"] {
    --bg: #1f1c18;
    --bg-2: #0b1324;
    --bg-3: #2f2a23;
    --surface: #0b1324;
    --surface-soft: #2f2a23;
    --border: #3a342b;
    --border-strong: #4a4338;
    --text: #f3ead8;
    --text-soft: #c8bfae;
    --text-muted: #7a8794;
    --user-bubble: #3a342b;
}
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] {
        --bg: #1f1c18;
        --bg-2: #0b1324;
        --bg-3: #2f2a23;
        --surface: #0b1324;
        --surface-soft: #2f2a23;
        --border: #3a342b;
        --border-strong: #4a4338;
        --text: #f3ead8;
        --text-soft: #c8bfae;
        --text-muted: #7a8794;
        --user-bubble: #3a342b;
    }
}

/* Font override */
html[data-font="sans"], html[data-font="sans"] body { --serif: 'Inter', sans-serif; }
html[data-font="system"], html[data-font="system"] body { --serif: system-ui, sans-serif; --sans: system-ui, sans-serif; }

/* User chip wrap (popup parent) */
.user-chip-wrap { position: relative; }
.user-chip {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.user-chip:hover { background: var(--bg-2); border-color: var(--border); }

/* Profile popup */
.profile-popup {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(46, 38, 26, 0.18);
    padding: 6px;
    z-index: 50;
    animation: ppFadeUp 0.16s ease;
}
@keyframes ppFadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.profile-popup .pp-email {
    padding: 10px 12px 8px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-popup .pp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-soft);
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s ease, color 0.1s ease;
}
.profile-popup .pp-item:hover { background: var(--bg-2); color: var(--text); }
.profile-popup .pp-item.pp-danger:hover { color: #5aa728; }
.profile-popup .pp-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Settings page */
.settings-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
}
.settings-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.settings-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 28px;
    margin: 0;
    letter-spacing: -0.01em;
}
.settings-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
}
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav a {
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.12s ease, color 0.12s ease;
}
.settings-nav a:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.settings-nav a.active { background: var(--bg-3); color: var(--text); font-weight: 500; }
.settings-main { min-width: 0; }

.section-h {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 12px;
    letter-spacing: -0.005em;
}
.settings-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.settings-form label { display: flex; flex-direction: column; gap: 4px; }
.settings-form .lbl { font-size: 12px; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.settings-form input {
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}
.settings-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.settings-form input:disabled { background: var(--bg-2); color: var(--text-muted); }
.hint { font-size: 12px; color: var(--text-muted); }

.kv-list { background: var(--bg-2); border-radius: 12px; padding: 4px 16px; }
.kv { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--text-soft); }

.theme-grid, .font-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.font-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.theme-card, .font-card {
    padding: 12px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.06s ease;
}
.theme-card:hover, .font-card:hover { transform: translateY(-2px); }
.theme-card.active, .font-card.active { border-color: var(--accent); }
.theme-preview {
    height: 80px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}
.theme-preview.light { background: #ffffff; }
.theme-preview.dark { background: #0b1324; }
.theme-preview.auto { background: linear-gradient(90deg, #ffffff 50%, #0b1324 50%); }
.theme-name, .font-name { font-size: 13px; color: var(--text-soft); margin-top: 4px; }

@media (max-width: 720px) {
    .settings-body { grid-template-columns: 1fr; }
    .settings-nav { flex-direction: row; overflow-x: auto; }
    .settings-form .form-row { grid-template-columns: 1fr; }
}

/* ===== v2.6: Admin Panel ===== */
.admin-shell { display: flex; min-height: 100vh; background: var(--bg); height: auto !important; overflow: auto !important; }
/* Sigurohu qe scroll punon edhe pa :has() */
body:has(.admin-shell), html:has(.admin-shell) { height: auto !important; overflow: auto !important; }
.admin-sidebar {
    width: 240px;
    background: var(--bg-3);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.admin-brand { font-family: var(--serif); font-size: 18px; font-weight: 600; padding: 8px 10px 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.12s ease, color 0.12s ease;
}
.admin-nav a:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.admin-nav a.active { background: var(--surface); color: var(--accent); font-weight: 600; }

.admin-main { flex: 1; min-width: 0; overflow-x: hidden; }
.admin-header { padding: 18px 28px; border-bottom: 1px solid var(--border); background: var(--bg); }
.admin-h1 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 0; letter-spacing: -0.01em; }
.admin-content { padding: 24px 28px; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.stat-card.stat-pro { border-color: var(--accent); }
.stat-card.stat-mrr { background: linear-gradient(135deg, var(--accent) 0%, #d4775a 100%); color: #fff; }
.stat-card.stat-mrr .stat-label, .stat-card.stat-mrr .stat-sub { color: rgba(255,255,255,0.85); }
.stat-card.stat-warn { border-color: #d49b22; background: #fef6e0; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.stat-value { font-family: var(--serif); font-size: 32px; font-weight: 600; margin: 6px 0 4px; letter-spacing: -0.02em; }
.stat-sub { font-size: 12px; color: var(--text-muted); }

/* Admin row & cards */
.admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.card-h { font-family: var(--serif); font-size: 16px; font-weight: 500; margin: 0 0 14px; }

/* Bar chart */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding: 8px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar { width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 4px; transition: opacity 0.15s ease; }
.bar:hover { opacity: 0.8; }
.bar-label { font-size: 10px; color: var(--text-muted); text-align: center; }
.bar-val { font-size: 11px; font-weight: 600; color: var(--text-soft); }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; background: var(--bg-2); }
.admin-table tr:hover { background: var(--bg-2); }
.admin-table select { padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); font-size: 12px; }

/* Search bar */
.admin-search { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-search input { flex: 1; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--bg); font-size: 14px; }
.admin-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.status-active { color: #2a6a3a; font-weight: 600; font-size: 11px; text-transform: uppercase; }
.status-suspended { color: #5aa728; font-weight: 600; font-size: 11px; text-transform: uppercase; }
.status-deleted { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.pill-cat { background: var(--bg-3); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; }

@media (max-width: 768px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 12px; }
    .admin-nav { flex-direction: row; flex: 1; }
    .admin-row { grid-template-columns: 1fr; }
    .admin-content { padding: 16px; }
}

/* ===== v2.7: Code Blocks me Download ===== */
.code-block {
    background: #0b1324;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
    border: 1px solid #3a342b;
}
.code-block pre {
    background: transparent !important;
    margin: 0;
    border-radius: 0;
    padding: 14px 16px;
    color: #f3ead8;
    font-size: 13px;
    line-height: 1.55;
    overflow-x: auto;
    font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
.code-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1f1c18;
    padding: 8px 14px;
    border-bottom: 1px solid #3a342b;
}
.code-fname {
    display: flex;
    align-items: center;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    color: #c8bfae;
    min-width: 0;
    overflow: hidden;
}
.code-fpath {
    color: #8a8270;
    font-size: 11.5px;
}
.code-fname-base {
    color: #f3ead8;
    font-weight: 500;
}
.code-dl {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid #4a4338;
    color: #c8bfae;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.code-dl:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ============================================================
   FILE CARDS (claude.ai exact style — kompakt, horizontal)
   ============================================================ */
.file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 8px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s ease, border-color 0.12s ease;
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
}
.file-card:hover {
    background: var(--bg-2);
    border-color: var(--border-strong);
}
.file-card:active { transform: scale(0.995); }
.fc-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
}
.fc-icon svg {
    width: 22px;
    height: 22px;
}
.fc-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.fc-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
.fc-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ZIP card - njejt si file-card por me theks te lehte accent */
.file-card.zip-card {
    border-color: var(--border-strong);
    margin-bottom: 12px;
}
.file-card.zip-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.file-card.zip-card .fc-icon {
    color: var(--accent);
}

/* ============================================================
   FILE PREVIEW MODAL (claude.ai style — X majtas, 3 pika djathtas)
   ============================================================ */
.file-preview-modal { padding: 20px; align-items: stretch; }
.file-preview-card {
    width: 100%;
    max-width: 920px;
    height: 90vh;
    max-height: 90vh;
    margin: auto;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    overflow: hidden;
}
.fp-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
}
.fp-close-btn,
.fp-dots-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s ease;
}
.fp-close-btn:hover,
.fp-dots-btn:hover { background: var(--bg-2); }
.fp-title-center {
    flex: 1;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
}
.fp-menu-wrap { position: relative; flex-shrink: 0; }
.fp-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(46, 38, 26, 0.15);
    padding: 4px;
    z-index: 10;
    animation: fpMenuFade 0.12s ease;
}
@keyframes fpMenuFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.fp-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: background 0.1s ease;
}
.fp-menu-item:hover { background: var(--bg-2); }
.fp-menu-item svg { color: var(--text-soft); flex-shrink: 0; }
.fp-menu-item span { flex: 1; }

.fp-body {
    flex: 1;
    overflow: auto;
    margin: 0;
    padding: 20px !important;
    background: #ffffff !important;
    border-radius: 0 !important;
    font-size: 13px;
    color: var(--text);
}
html[data-theme="dark"] .fp-body {
    background: #1a1815 !important;
    color: #e8e0cc;
}

/* Mini toast */
.mini-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}
.mini-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .file-card {
        padding: 11px 14px;
        gap: 11px;
        border-radius: 12px;
        max-width: 100%;
    }
    .fc-icon { width: 26px; height: 26px; }
    .fc-icon svg { width: 20px; height: 20px; }
    .fc-name { font-size: 13.5px; }
    .fc-meta { font-size: 11.5px; }
    .file-preview-modal { padding: 0; }
    .file-preview-card {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .fp-title-center { font-size: 14px; }
    .fp-body { padding: 14px !important; font-size: 12px; }
}

/* Banner ZIP per projekte me shume fajlle */
.code-zipbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 4px 0 14px;
    padding: 12px 14px;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 12px;
}
.zipbar-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.zipbar-info svg { color: var(--accent); flex-shrink: 0; }
.zipbar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.zipbar-sub {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 1px;
}
.code-zip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}
.code-zip-btn:hover { background: var(--accent-hover); }
.code-zip-btn:active { transform: scale(0.98); }
.code-zip-btn:disabled { opacity: 0.7; cursor: not-allowed; }

@media (max-width: 768px) {
    .code-zipbar { padding: 10px 12px; gap: 8px; }
    .zipbar-title { font-size: 13px; }
    .zipbar-sub { font-size: 11px; }
    .code-zip-btn { padding: 7px 12px; font-size: 12.5px; }
    .code-zip-btn span { display: none; } /* fshih tekstin "Po krijohet" ne mobile */
}

/* SIDEBAR BACKDROP (mobile only) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* RESPONSIVE - MOBILE (<=768px) */
@media (max-width: 768px) {
    /* SIDEBAR (vetem behavior, jo strukture e re) */
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100%;
        width: 280px;
        max-width: 85vw;
        z-index: 100;
        box-shadow: var(--shadow-md);
        margin-left: -300px;
        transition: margin-left 0.25s ease;
    }
    .sidebar.collapsed { margin-left: -300px; }
    .sidebar.open { margin-left: 0; }

    /* Backdrop aktiv vetem ne mobile kur sidebar-i eshte hapur */
    .sidebar-backdrop { display: block; }
    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    /* Bllokoje scroll-in e body-t kur sidebar-i eshte hapur */
    body.has-sidebar-open { overflow: hidden; }

    /* TOPBAR me compact ne mobile */
    .topbar {
        height: 52px;
        padding: 0 12px;
        gap: 8px;
    }
    .topbar-menu { display: inline-flex; }
    .model-btn { padding: 7px 10px; font-size: 13px; }
    .model-btn-mini { padding: 5px 8px; font-size: 12px; }
    .model-btn-mini #modelLabel { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
    /* Ne mobile, dropdown-i UP duhet te rrije brenda viewport-it */
    .model-menu.model-menu-up {
        width: auto !important;
        left: 8px !important;
        right: 8px !important;
        max-width: none !important;
        max-height: 60vh;
        overflow-y: auto;
        bottom: calc(100% + 8px);
    }
    /* Per keto raste, parent-i duhet te kete position static qe right/left te llogariten ndaj composer-it */
    .composer .model-picker-mini { position: static; }
    .usage-pill {
        font-size: 11px;
        padding: 5px 10px;
    }

    /* WELCOME me kompakt */
    .welcome { padding: 16px 16px; }
    .welcome-mark { font-size: 36px; margin-bottom: 10px; }
    .welcome-title { font-size: 26px; }
    /* Ne mobile fshehim chips-at (Kod, Shkruaj, etj.) — hapesire me e paster */
    .welcome-actions { display: none !important; }
    .welcome-popup { display: none !important; }

    /* CHAT AREA & MESSAGES - me pak padding anash */
    .chat-area { padding: 12px 0; }
    .messages {
        padding: 8px 12px 16px;
        gap: 18px;
    }
    .msg-bubble { font-size: 15px; padding: 10px 14px; }
    .msg.user .msg-bubble { max-width: 88%; }
    .msg.assistant .msg-bubble pre { font-size: 12px; padding: 12px; }

    /* COMPOSER - me kompakt + safe-area per iPhone */
    .composer-wrap {
        padding: 6px 10px max(10px, env(safe-area-inset-bottom));
    }
    .composer { padding: 8px 10px; border-radius: 16px; }
    .composer-input {
        font-size: 16px; /* 16px parandalon zoom-in te iOS Safari kur fokuson */
        padding: 6px 4px;
    }
    .composer-foot { padding: 2px 2px 0; }
    .composer-hint { display: none; } /* Enter hint nuk eshte i nevojshem ne mobile */
    .send-btn { width: 32px; height: 32px; }

    .footer-fine {
        font-size: 10px;
        margin-top: 4px;
        padding: 0 8px;
    }

    /* CONV TOOLBAR (PDF/Rigjenero) */
    .conv-toolbar { padding: 0 12px 8px; }
}

/* Telefonat shume te vegjel (<=380px) */
@media (max-width: 380px) {
    .topbar { padding: 0 8px; gap: 6px; }
    .model-btn { padding: 6px 8px; font-size: 12.5px; }
    .usage-pill { font-size: 10.5px; padding: 4px 8px; }
    .welcome-title { font-size: 23px; }
    .messages { padding-left: 10px; padding-right: 10px; }
    .composer-wrap { padding-left: 8px; padding-right: 8px; }
}

/* ============================================================
   SUPER AI v2.9 — Voice, Stop, Edit, Copy, Mermaid, KaTeX, Drag&Drop
   ============================================================ */

/* Mic button (voice input) */
.mic-btn {
    width: 36px; height: 36px;
    background: transparent;
    color: var(--text-soft);
    border-radius: 50%;
    transition: background 0.15s ease, color 0.15s ease;
}
.mic-btn:hover { background: var(--bg-2); color: var(--text); }
.mic-btn.recording {
    background: rgba(220, 80, 80, 0.15);
    color: #d65555;
    animation: micPulse 1.4s ease-in-out infinite;
}
@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(214, 85, 85, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(214, 85, 85, 0); }
}

/* Stop button (gjate streaming) */
.stop-btn {
    background: var(--text) !important;
    animation: stopPulse 1.6s ease-in-out infinite;
}
.stop-btn:hover { background: #444 !important; }
@keyframes stopPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* Stopped indicator ne fund te mesazhit */
.msg-stopped {
    margin-top: 10px;
    padding: 6px 10px;
    background: var(--bg-2);
    border-left: 3px solid var(--text-muted);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Edit button per user mesazhe */
.msg.user { position: relative; }
.msg-edit-btn {
    position: absolute;
    top: 4px;
    right: -32px;
    width: 26px; height: 26px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.msg.user:hover .msg-edit-btn { opacity: 1; }
.msg-edit-btn:hover { background: var(--bg-2); color: var(--text); border-color: var(--border); }
@media (max-width: 768px) {
    .msg-edit-btn { right: 4px; opacity: 1; }
}

/* Edit banner mbi composer */
.edit-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 0 12px 6px;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 10px;
    font-size: 12.5px;
    color: var(--text);
}
.edit-banner svg { color: var(--accent); flex-shrink: 0; }
.edit-banner span { flex: 1; }
.edit-banner-cancel {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.edit-banner-cancel:hover { background: var(--accent); color: #fff; }

/* Toolbar nën cdo mesazh assistant (Kopjo + Vazhdo) */
.msg.assistant { position: relative; }
.msg-toolbar {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    margin-left: -4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.msg.assistant:hover .msg-toolbar,
.msg.assistant:focus-within .msg-toolbar { opacity: 1; }
@media (max-width: 768px) {
    .msg-toolbar { opacity: 1; }
}
.msg-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11.5px;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.msg-tool-btn:hover { background: var(--bg-2); border-color: var(--border); color: var(--text); }
.msg-tool-btn.copied { color: #2d8a4f; border-color: #2d8a4f33; }

/* Copy button brenda code-head */
.code-actions { display: inline-flex; gap: 4px; align-items: center; flex-shrink: 0; }
.code-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    background: transparent;
    border: 1px solid #4a4338;
    color: #c8bfae;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.code-copy:hover { background: #4a4338; color: #fff; }
.code-copy.copied { color: #4caf50; border-color: #4caf50; }

/* Drag & Drop overlay */
.composer.dragging {
    border-color: var(--accent) !important;
    background: var(--accent-soft) !important;
    box-shadow: 0 0 0 2px var(--accent);
}
.composer.dragging::before {
    content: "📎 Lësho fajllin këtu";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 500;
    font-size: 14px;
    pointer-events: none;
    z-index: 5;
    background: rgba(255,255,255,0.85);
    border-radius: inherit;
}

/* Mermaid diagrams */
.mermaid-wrap {
    margin: 12px 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
    text-align: center;
}
.mermaid { display: inline-block; min-width: 100%; }

/* KaTeX (math) - ngjyrë theksuar dhe overflow scroll */
.katex { font-size: 1.05em !important; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* Prism overrides per code blocks */
.code-block pre[class*="language-"] {
    margin: 0;
    background: #2a261d !important;
    padding: 14px 16px !important;
    font-size: 12.5px;
    border-radius: 0 0 10px 10px;
    overflow-x: auto;
}
.code-block code[class*="language-"] {
    background: transparent !important;
    text-shadow: none !important;
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace !important;
}

/* Shortcuts modal */
.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.sc-row:last-child { border-bottom: none; }
.sc-row span { flex: 1; color: var(--text); }
.sc-row kbd {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-family: ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--text);
    min-width: 22px;
    justify-content: center;
}

/* Stop btn ne mobile */
@media (max-width: 768px) {
    .mic-btn { width: 32px; height: 32px; }
    .stop-btn { width: 32px !important; height: 32px !important; }
    .msg-toolbar { margin-top: 2px; }
}

/* Dark theme override per mermaid wrap */
html[data-theme="dark"] .mermaid-wrap {
    background: var(--bg-2);
}

/* ============================================================
   USAGE PAGE (claude.ai/usage style)
   ============================================================ */
.usage-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 20px 80px;
    min-height: 100vh;
    background: var(--bg);
}
.usage-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0 32px;
    position: relative;
}
.usage-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text);
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.12s ease;
}
.usage-back:hover { background: var(--bg-2); }
.usage-title {
    flex: 1;
    text-align: center;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 22px;
    margin: 0;
    margin-right: 40px;
}
.usage-section { margin-bottom: 28px; }
.us-heading {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--text);
}
.us-sub {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-soft);
    margin: 0 0 8px;
}
.us-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-2);
    border-radius: 3px;
    overflow: hidden;
}
.us-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.us-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 14px;
}
.us-pct { color: var(--text); font-weight: 500; }
.us-reset { color: var(--text-soft); }
.us-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}
.usage-plan-card {
    margin-top: 32px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.upc-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.upc-info {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 14px;
    line-height: 1.5;
}
.upc-upgrade {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    padding: 10px 18px;
    font-size: 14px;
}
@media (max-width: 768px) {
    .usage-page { padding: 12px 16px 60px; }
    .usage-title { font-size: 20px; }
    .us-heading { font-size: 16px; }
}

/* ============================================================
   PRICING PAGE V2 (3 plane si claude.ai)
   ============================================================ */
.pricing-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px 80px;
    min-height: 100vh;
}
.pricing-head {
    display: flex;
    align-items: center;
    padding: 16px 0 8px;
}
.pricing-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    color: var(--text);
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.12s ease;
}
.pricing-back:hover { background: var(--bg-2); }
.pricing-title {
    flex: 1;
    text-align: center;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 26px;
    margin: 0;
}
.pricing-sub {
    text-align: center;
    color: var(--text-soft);
    font-size: 15px;
    margin: 0 0 32px;
}
.pricing-grid-v2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.plan-card-v2 {
    position: relative;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 18px;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.plan-card-v2:hover {
    border-color: var(--border-strong);
}
.plan-card-v2.plan-popular {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(104, 184, 47, 0.10);
}
.plan-card-v2.plan-current {
    border-color: #2d8a4f;
    background: linear-gradient(180deg, rgba(45, 138, 79, 0.04), var(--surface));
}
.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.plan-badge-current {
    background: #2d8a4f;
}
.plan-name {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 500;
    margin: 0 0 8px;
    color: var(--text);
}
.plan-price {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
}
.plan-currency {
    font-size: 18px;
    color: var(--text-soft);
    margin-right: 2px;
}
.plan-amount {
    font-size: 38px;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
}
.plan-period {
    font-size: 14px;
    color: var(--text-soft);
    margin-left: 6px;
}
.plan-desc {
    font-size: 13.5px;
    color: var(--text-soft);
    margin: 0 0 18px;
    line-height: 1.4;
    min-height: 40px;
}
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}
.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text);
    padding: 6px 0;
    line-height: 1.4;
}
.plan-features svg {
    color: #2d8a4f;
    flex-shrink: 0;
    margin-top: 3px;
}
.plan-model-tag {
    display: inline-block;
    padding: 1px 6px;
    background: var(--bg-2);
    border-radius: 4px;
    font-size: 12px;
    margin: 0 2px;
}
.plan-cta {
    display: block;
    width: 100%;
    padding: 11px 16px;
    text-align: center;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.05s ease;
}
.plan-cta:hover { background: var(--accent-hover); }
.plan-cta:active { transform: scale(0.98); }
.plan-cta-secondary {
    background: var(--bg-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.plan-cta-secondary:hover { background: var(--surface-soft); }
.plan-cta-current {
    background: #2d8a4f !important;
    color: #fff !important;
    cursor: default !important;
    opacity: 0.85;
}
.pricing-foot {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 24px;
}

/* Pay method buttons */
.pay-method-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 500;
    text-align: left;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.pay-method-btn:hover {
    border-color: var(--accent);
    background: var(--bg-2);
}
.pay-method-btn svg { flex-shrink: 0; }
.pay-method-btn span { flex: 1; }

@media (max-width: 768px) {
    .pricing-grid-v2 { grid-template-columns: 1fr; }
    .pricing-page { padding: 12px 16px 60px; }
    .pricing-title { font-size: 22px; }
    .plan-card-v2 { padding: 24px 20px 20px; }
}

/* =============================================================
   v3.1: PROJECTS, REFERRALS, COMPARE, STATS, PROMPTS, API KEYS
   ============================================================= */

/* Header per faqet e reja (te ngjashem me usage/pricing) */
.projects-page, .compare-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px 80px;
    min-height: 100vh;
    background: var(--bg);
}
.proj-head, .compare-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.proj-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    color: var(--text);
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.12s ease;
}
.proj-back:hover { background: var(--bg-2); }
.proj-title {
    flex: 1;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 24px;
    margin: 0;
}
.proj-sub {
    color: var(--text-soft);
    font-size: 14.5px;
    margin: 0 0 24px;
}
.proj-new {
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
}
.proj-new:hover { background: var(--accent-hover); }
.proj-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-soft);
}
.proj-empty h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 8px 0; }
.proj-empty p { margin: 8px 0 20px; max-width: 360px; margin-left: auto; margin-right: auto; }

.proj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.proj-card {
    display: block;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.12s ease, transform 0.12s ease;
}
.proj-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.proj-card-icon {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 22px;
    margin-bottom: 12px;
}
.proj-card-name { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.proj-card-desc { font-size: 13px; color: var(--text-soft); margin: 0 0 12px; line-height: 1.4; min-height: 32px; }
.proj-card-meta { font-size: 12px; color: var(--text-muted); }

.proj-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 768px) { .proj-detail-grid { grid-template-columns: 1fr; } }

.proj-card-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}
.proj-card-box h3 {
    font-family: var(--serif);
    font-weight: 500;
    margin: 0 0 8px;
    font-size: 17px;
}
.proj-help {
    font-size: 13px;
    color: var(--text-soft);
    margin: 0 0 12px;
    line-height: 1.4;
}
.proj-card-box textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    font-family: inherit;
    font-size: 13.5px;
    box-sizing: border-box;
}
.kb-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}
.kb-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-2);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}
.kb-list li > span:first-child { flex: 1; }
.kb-meta { color: var(--text-muted); font-size: 11.5px; }
.kb-del {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}
.kb-del:hover { background: rgba(179, 85, 58, 0.1); color: #5aa728; }

.proj-conv-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.proj-conv-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
}
.proj-conv-list li:last-child { border-bottom: none; }
.proj-conv-list a { color: var(--text); text-decoration: none; }
.proj-conv-list a:hover { color: var(--accent); }

/* REFERRALS */
.ref-link-box {
    max-width: 720px;
    margin: 0 auto 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}
.ref-link-box label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 8px; }
.ref-input-wrap {
    display: flex;
    gap: 8px;
}
.ref-input-wrap input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: ui-monospace, monospace;
    background: var(--bg-2);
}
.ref-share {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.ref-share-btn {
    padding: 8px 14px;
    background: var(--bg-2);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.12s ease;
}
.ref-share-btn:hover { background: var(--surface-soft); }
.ref-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    max-width: 920px;
    margin: 0 auto;
}

/* COMPARE */
.compare-input-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.compare-input-row textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    resize: vertical;
}
.compare-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.compare-controls select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    font-size: 13.5px;
}
.compare-controls .btn-primary { margin-left: auto; }
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 768px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.compare-col-head {
    background: var(--bg-2);
    padding: 10px 14px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.compare-col-body {
    padding: 14px;
    font-size: 14px;
    line-height: 1.55;
    min-height: 200px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* PROMPTS */
.cat-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.cat-btn {
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.12s ease;
}
.cat-btn:hover { border-color: var(--accent); }
.cat-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.prompt-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}
.prompt-cat {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-2);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-soft);
    text-transform: uppercase;
    margin-bottom: 8px;
    align-self: flex-start;
}
.prompt-title { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.prompt-body {
    flex: 1;
    background: var(--bg-2);
    padding: 10px;
    border-radius: 6px;
    font-size: 12.5px;
    margin: 0 0 12px;
    white-space: pre-wrap;
    color: var(--text-soft);
    max-height: 120px;
    overflow: hidden;
}
.prompt-actions { display: flex; gap: 8px; }
.prompt-actions button { flex: 1; padding: 8px 12px; font-size: 13px; }
.btn-secondary {
    background: var(--bg-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}
.btn-secondary:hover { background: var(--surface-soft); }

/* STATS / ACHIEVEMENTS */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.achievement-card {
    background: linear-gradient(135deg, var(--surface), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.ach-icon { font-size: 32px; margin-bottom: 6px; }
.ach-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.ach-desc { font-size: 12px; color: var(--text-soft); line-height: 1.3; }


/* v3.8 Background Builder UI */
.builder-activity{padding:2px 0 8px 0;margin:4px 0;color:var(--text,#111827);max-width:760px}.activity-kicker{display:flex;align-items:center;gap:9px;color:var(--text-soft,#6b7280);font-size:14px;margin:2px 0 14px}.activity-step{border:0;margin:0 0 10px 0;padding:0}.activity-step summary{list-style:none;display:inline-flex;align-items:center;gap:10px;color:var(--text-soft,#6b7280);font-size:14px;cursor:pointer}.activity-step summary::-webkit-details-marker{display:none}.activity-chevron{font-size:18px;line-height:1;color:var(--text-muted,#9ca3af)}.activity-detail{margin:8px 0 14px 28px;color:var(--text-soft,#6b7280);font-size:13px;line-height:1.9}.activity-spin{width:14px;height:14px;border-radius:50%;border:2px solid rgba(104,184,47,.22);border-top-color:#68b82f;display:inline-block;animation:activitySpin .85s linear infinite;flex:0 0 auto}.activity-spin.done{animation:none;border-color:#68b82f;background:#68b82f;box-shadow:inset 0 0 0 3px #fff}.builder-progress{height:9px;border-radius:99px;background:rgba(15,23,42,.10);overflow:hidden;margin:12px 0 10px}.builder-progress.thin{height:4px;max-width:280px;margin-left:28px}.builder-progress span{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#68b82f,#7ac943);transition:width .35s ease}.builder-complete{border:1px solid rgba(104,184,47,.24);background:#fff;border-radius:14px;padding:16px;margin:4px 0;color:var(--text,#111827)}.builder-complete-title{font-weight:800;font-size:16px;margin-bottom:6px}.builder-complete-sub{font-size:13px;opacity:.78;margin-bottom:12px}.builder-download{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 14px;border-radius:12px;background:#68b82f;color:#fff!important;text-decoration:none;font-weight:800;font-size:13px}.builder-summary{margin-top:12px}.builder-summary .file-card,.builder-summary .code-block,.builder-summary .zip-card{display:none!important}@keyframes activitySpin{to{transform:rotate(360deg)}}


/* ===== v3.9.2 clean green admin/mobile/logo patch ===== */
.brand-logo-img{height:30px;width:auto;max-width:160px;object-fit:contain;border-radius:6px}.brand-logo-text{font-weight:800;color:var(--text);letter-spacing:-.02em}.brand,.admin-brand-link{gap:8px}.logo-mark{display:none!important}
.admin-shell{background:#f7fbf3}.admin-sidebar{background:#fff;border-right:1px solid var(--border);box-shadow:0 12px 40px rgba(7,20,46,.05)}.admin-brand{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);padding:8px 8px 14px;margin-bottom:12px}.admin-brand-link{display:flex;align-items:center;text-decoration:none;color:var(--text)}.admin-brand-link:hover{text-decoration:none}.admin-nav{gap:4px}.admin-nav a{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid transparent;color:var(--text-soft);font-weight:600}.admin-nav a:hover{background:#f7fbf3;border-color:var(--border);color:var(--text)}.admin-nav a.active{background:var(--accent-soft);border-color:var(--border-strong);color:var(--accent)}.admin-header{background:#fff}.admin-content{background:#f7fbf3}.stat-card,.admin-card{background:#fff;border-color:var(--border);box-shadow:0 1px 2px rgba(7,20,46,.04)}.stat-card.stat-mrr{background:linear-gradient(135deg,#68b82f 0%,#4f9f22 100%)}
.admin-menu-toggle,.admin-close,.admin-overlay{display:none}.admin-menu-toggle{position:fixed;left:12px;top:12px;z-index:80;width:42px;height:42px;border-radius:12px;background:#fff;border:1px solid var(--border);box-shadow:0 8px 22px rgba(7,20,46,.10);font-size:20px}.admin-close{width:36px;height:36px;border-radius:10px;border:1px solid var(--border);background:#fff;font-size:22px;color:var(--text-soft)}.admin-overlay{position:fixed;inset:0;background:rgba(7,20,46,.36);z-index:70}
@media (max-width:768px){.admin-shell{display:block}.admin-menu-toggle{display:flex;align-items:center;justify-content:center}.admin-sidebar{position:fixed;top:0;left:0;bottom:0;width:284px!important;max-width:86vw;z-index:90;transform:translateX(-105%);transition:transform .2s ease;overflow-y:auto;padding:18px 12px;display:flex!important;flex-direction:column!important}.admin-nav{flex-direction:column!important}.admin-nav a{min-height:44px;white-space:nowrap}.admin-main{min-height:100vh}.admin-header{padding:18px 20px 18px 64px}.admin-content{padding:18px 3px!important}.stats-grid{grid-template-columns:1fr!important;gap:10px}.stat-card,.admin-card{border-radius:16px}.admin-row{grid-template-columns:1fr!important;gap:12px}.admin-table{display:block;overflow-x:auto;white-space:nowrap}.admin-menu-open .admin-sidebar{transform:translateX(0)}.admin-menu-open .admin-overlay{display:block}.admin-menu-open .admin-close{display:inline-flex;align-items:center;justify-content:center}}


/* ===== v3.9.3 polished green/white UI, responsive logo, real image cards, unified plans ===== */
body { background: #ffffff; }
.site-logo-img,
.brand-logo-img,
.admin-brand-link .brand-logo-img {
    height: clamp(28px, 4.5vw, 42px) !important;
    width: auto !important;
    max-width: min(190px, 54vw) !important;
    object-fit: contain !important;
    display: block !important;
    border-radius: 8px !important;
}
.admin-brand-link .brand-logo-img { max-height: 48px !important; }
.brand-logo-text, .site-logo-text { line-height: 1.1; }
.admin-brand-link .brand-logo-text { font-size: clamp(16px, 2vw, 20px) !important; }
.logo-mark, .logo-icon { display: none !important; }

/* Keep green as accent only, not full-page paint */
.navbar, .admin-header, .admin-sidebar, .surface, .auth-card, .feature-card, .case-card, .plan-card, .admin-card, .stat-card { background: #ffffff; }
.features, .pricing-section, .admin-shell, .admin-content { background: #f7fbf3; }
.hero, .use-cases, .footer { background: #ffffff; }
.section-title h2, .feature-card h3, .case-card h4, .plan-price, .admin-h1 { color: #07142e; }
.feature-card p, .case-card p, .section-title p, .plan-tagline { color: #4a5568; }

/* Real photo cards for use cases */
.case-photo-card { padding: 0 !important; overflow: hidden; border-left: 1px solid var(--border) !important; }
.case-photo-card h4 { padding: 0 22px; margin: 18px 0 6px; }
.case-photo-card p { padding: 0 22px 22px; margin: 0; }
.case-photo { height: 142px; width: 100%; background-size: cover; background-position: center; border-bottom: 1px solid var(--border); }
.case-icon { display: none !important; }
.case-photo-1 { background-image: url('https://images.unsplash.com/photo-1515879218367-8466d910aaa4?auto=format&fit=crop&w=900&q=80'); }
.case-photo-2 { background-image: url('https://images.unsplash.com/photo-1455390582262-044cdead277a?auto=format&fit=crop&w=900&q=80'); }
.case-photo-3 { background-image: url('https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?auto=format&fit=crop&w=900&q=80'); }
.case-photo-4 { background-image: url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=900&q=80'); }
.case-photo-5 { background-image: url('https://images.unsplash.com/photo-1552664730-d307ca884978?auto=format&fit=crop&w=900&q=80'); }
.case-photo-6 { background-image: url('https://images.unsplash.com/photo-1516321497487-e288fb19713f?auto=format&fit=crop&w=900&q=80'); }
.case-photo-7 { background-image: url('https://images.unsplash.com/photo-1499750310107-5fef28a66643?auto=format&fit=crop&w=900&q=80'); }
.case-photo-8 { background-image: url('https://images.unsplash.com/photo-1555949963-aa79dcee981c?auto=format&fit=crop&w=900&q=80'); }

/* Cleaner plan consistency */
.pricing-grid-dynamic { align-items: stretch; }
.plan-card { display: flex; flex-direction: column; }
.plan-card .plan-cta { margin-top: auto; }
.plan-max .plan-name { color: #07142e; }
.plan-max { border-color: rgba(104,184,47,.32); }
.plan-card.featured { background: #ffffff; }
.plan-features { margin-top: 0; }

/* Mobile: almost full width, 3px side padding as requested */
@media (max-width: 768px) {
    .container { max-width: none !important; width: 100% !important; padding-left: 3px !important; padding-right: 3px !important; }
    .features, .use-cases, .pricing-section { padding-left: 3px !important; padding-right: 3px !important; }
    .features-grid, .cases-grid, .pricing-grid { grid-template-columns: 1fr !important; gap: 10px !important; width: 100% !important; }
    .feature-card, .case-card, .plan-card { width: 100% !important; border-radius: 14px !important; }
    .feature-photo, .case-photo { height: 160px; }
    .nav-inner { padding-left: 10px !important; padding-right: 10px !important; }
    .site-logo-img { max-width: 150px !important; }
    .admin-brand-link .brand-logo-img { max-width: 170px !important; max-height: 44px !important; }
}

/* PATCH v3.9.4 — compact Claude-like activity spacing */
.builder-activity{padding:0 0 4px 0!important;margin:2px 0!important;max-width:760px!important;}
.activity-kicker{margin:0 0 4px!important;gap:8px!important;font-size:14px!important;}
.activity-step{margin:0 0 4px 0!important;padding:0!important;}
.activity-step summary{gap:8px!important;min-height:24px!important;line-height:1.25!important;}
.activity-detail{margin:2px 0 4px 22px!important;line-height:1.35!important;font-size:13px!important;}
.builder-progress.thin{height:4px!important;max-width:260px!important;margin:6px 0 4px 22px!important;}
@media (max-width:768px){
  .builder-activity{margin-top:0!important;}
  .activity-step{margin-bottom:4px!important;}
  .activity-detail{margin-top:2px!important;margin-bottom:4px!important;}
  .builder-complete{padding:14px!important;margin:2px 0!important;}
}


/* ============================================================
   HOTFIX — Compact builder/progress activity log
   Purpose: remove large vertical gaps while AI is working.
   Upload this file over assets/css/style.css.
   ============================================================ */

.builder-activity,
.msg.assistant .builder-activity {
    width: 100% !important;
    max-width: 760px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    color: var(--text, #07142e) !important;
}

/* Remove big empty green/skeleton blocks inside the activity area */
.builder-activity > div:empty,
.builder-activity > p:empty,
.builder-activity > section:empty,
.builder-activity > article:empty,
.builder-activity .activity-detail:empty,
.builder-activity .activity-placeholder:empty,
.builder-activity .skeleton:empty,
.builder-activity .loading-placeholder:empty {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Main "Working" row */
.activity-kicker,
.builder-activity .activity-kicker {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 20px !important;
    line-height: 1.25 !important;
    font-size: 14px !important;
    color: var(--text-soft, #4a5568) !important;
}

/* Each expandable activity row */
.activity-step,
.builder-activity .activity-step,
.builder-activity details.activity-step {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

/* Summary line, Claude-like compact row */
.activity-step summary,
.builder-activity .activity-step summary {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-height: 20px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.25 !important;
    font-size: 14px !important;
    color: var(--text-soft, #4a5568) !important;
    list-style: none !important;
    cursor: pointer !important;
}

.activity-step summary::-webkit-details-marker,
.builder-activity .activity-step summary::-webkit-details-marker {
    display: none !important;
}

/* Details under an opened step */
.activity-detail,
.builder-activity .activity-detail {
    margin: 2px 0 2px 22px !important;
    padding: 0 !important;
    min-height: 0 !important;
    line-height: 1.28 !important;
    font-size: 13px !important;
    color: var(--text-soft, #4a5568) !important;
}

/* Spinner and chevron stay small */
.activity-spin,
.builder-activity .activity-spin {
    width: 12px !important;
    height: 12px !important;
    border-width: 2px !important;
    flex: 0 0 12px !important;
}

.activity-chevron,
.builder-activity .activity-chevron {
    font-size: 15px !important;
    line-height: 1 !important;
    margin-left: 1px !important;
}

/* Progress bar directly under active row */
.builder-progress,
.builder-activity .builder-progress {
    height: 4px !important;
    width: 100% !important;
    max-width: 220px !important;
    margin: 3px 0 2px 22px !important;
    padding: 0 !important;
    border-radius: 999px !important;
}

.builder-progress.thin,
.builder-activity .builder-progress.thin {
    height: 4px !important;
    max-width: 220px !important;
    margin: 3px 0 2px 22px !important;
}

/* Prevent assistant bubble from adding extra space around builder UI */
.msg.assistant:has(.builder-activity) {
    gap: 0 !important;
}

.msg.assistant:has(.builder-activity) .msg-bubble {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.35 !important;
}

/* Compact message spacing only while activity is rendered */
.messages:has(.builder-activity) {
    gap: 8px !important;
}

/* Mobile: even tighter, because screen height is limited */
@media (max-width: 768px) {
    .builder-activity,
    .msg.assistant .builder-activity {
        gap: 4px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .activity-kicker,
    .builder-activity .activity-kicker,
    .activity-step summary,
    .builder-activity .activity-step summary {
        min-height: 19px !important;
        font-size: 13.5px !important;
        line-height: 1.22 !important;
    }

    .activity-detail,
    .builder-activity .activity-detail {
        margin: 1px 0 1px 20px !important;
        font-size: 12.5px !important;
        line-height: 1.22 !important;
    }

    .builder-progress,
    .builder-progress.thin,
    .builder-activity .builder-progress,
    .builder-activity .builder-progress.thin {
        max-width: 180px !important;
        height: 4px !important;
        margin: 3px 0 1px 20px !important;
    }

    .messages:has(.builder-activity) {
        gap: 6px !important;
    }
}

/* v4 activity UI: ChatGPT-like status list, no project progress bar */
.builder-activity{padding:4px 0!important;margin:2px 0!important;max-width:760px!important}
.builder-activity .activity-kicker,.builder-activity .builder-progress,.builder-activity .activity-detail,.builder-activity .activity-chevron{display:none!important}
.builder-activity .activity-step{display:block!important;margin:0!important;padding:0!important;border:0!important}
.builder-activity .activity-step summary{display:flex!important;align-items:center!important;gap:10px!important;padding:8px 0!important;min-height:0!important;list-style:none!important;color:var(--text-soft,#6b7280)!important;font-size:15px!important;font-weight:500!important;cursor:default!important}
.builder-activity .activity-step summary::-webkit-details-marker{display:none!important}
.builder-activity .activity-step .activity-spin{width:20px!important;height:20px!important;border-width:2px!important;flex:0 0 20px!important}
.builder-activity .activity-step .activity-spin.done{background:#68b82f!important;border-color:#68b82f!important;box-shadow:inset 0 0 0 4px #fff!important}
.msg.assistant:has(.builder-activity) .msg-bubble{padding-top:4px!important;padding-bottom:4px!important}

/* Live chat thinking + token streaming */
.builder-activity.chat-activity .activity-kicker{display:flex!important;align-items:center!important;gap:9px!important;color:var(--text-soft,#6b7280)!important;font-size:14px!important;font-weight:600!important;padding:7px 2px!important}
.builder-activity.chat-activity .activity-spin{display:inline-block!important;width:16px!important;height:16px!important;border:2px solid rgba(104,184,47,.25)!important;border-top-color:#68b82f!important;border-radius:50%!important;animation:activitySpin .8s linear infinite!important}
.stream-cursor{display:inline-block;width:2px;height:1.05em;background:currentColor;margin-left:2px;vertical-align:-2px;opacity:.75;animation:streamBlink .8s steps(1,end) infinite}
@keyframes streamBlink{0%,45%{opacity:.8}46%,100%{opacity:.15}}

/* NO-FILE-CARDS-IN-CHAT: ChatGPT-like project activity */
.msg.assistant .file-card,.msg.assistant .zip-card,.builder-summary .file-card,.builder-summary .zip-card,.builder-summary .code-block{display:none!important}

/* SMALL-ZIP-RESULT */
.msg.assistant .builder-complete{border:0!important;background:transparent!important;border-radius:0!important;padding:0!important;margin:8px 0 4px!important;box-shadow:none!important}.msg.assistant .builder-complete-title{font-size:16px!important;font-weight:600!important;margin:0 0 4px!important}.msg.assistant .builder-complete-sub{font-size:14px!important;margin:0 0 8px!important;color:var(--text-soft,#6b7280)!important}.msg.assistant .builder-download{display:inline!important;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;color:var(--text,#111827)!important;text-decoration:underline!important;font-size:15px!important;font-weight:500!important;box-shadow:none!important}

/* PERSISTENT-HISTORY-ZIP */
.history-builder-zip{margin-top:10px}
.history-builder-zip .builder-download{display:inline!important}

/* COMPACT-LEGACY-ZIP-LINK */
.msg-toolbar .msg-project-zip-btn{background:transparent!important;border:0!important;box-shadow:none!important;color:var(--text,#111827)!important;padding:4px 0!important;margin-left:4px!important;font-weight:500!important;text-decoration:underline!important;text-underline-offset:3px!important}
.msg-toolbar .msg-project-zip-btn:hover{background:transparent!important;text-decoration-thickness:2px!important}
.msg-toolbar .msg-project-zip-btn svg{display:none!important}

/* ZIP-ALWAYS-VISIBLE */
.msg-toolbar:has(.msg-project-zip-btn){opacity:1!important}
.msg-toolbar .msg-project-zip-btn{opacity:1!important;visibility:visible!important;color:#111827!important}

/* GPT v7: scrollable model picker on desktop and mobile */
.model-menu.model-menu-up { max-height: min(68vh, 640px) !important; overflow-y: auto !important; overscroll-behavior: contain; scrollbar-width: thin; }
@media (max-width: 600px) {.model-menu.model-menu-up { max-height: min(58vh, 500px) !important; }}
