:root {
    --bg: #212121;
    --sidebar-bg: #171717;
    --panel: #212121;
    --panel-2: #2a2a2a;
    --panel-3: #303030;
    --border: #343434;
    --text: #ececec;
    --muted: #a1a1aa;
    --accent: #10a37f;
    --accent-hover: #0e8f70;
    --user-bubble: #2f2f2f;
    --assistant-bubble: #262626;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
}

body {
    min-height: 100vh;
}

button, input {
    font: inherit;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    width: 320px;
    min-width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 8px 10px;
}

.new-chat-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.new-chat-btn:hover {
    background: var(--panel-2);
    border-color: #454545;
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 2px;
}

.conversation-item {
    width: 100%;
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.04s ease;
}

.conversation-item:hover {
    background: var(--panel-2);
    border-color: var(--border);
}

.conversation-item.active {
    background: var(--panel-3);
    border-color: #4a4a4a;
}

.conversation-item:active {
    transform: translateY(1px);
}

.conversation-item-title {
    font-weight: 600;
    font-size: 0.96rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.chat-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--panel);
}

.chat-header {
    display: flex;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    background: rgba(33, 33, 33, 0.95);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.chat-header-left {
    min-width: 0;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 9px 15px;
    border-radius: 999px;

    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;

    text-decoration: none;

    color: #e8e8e8;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(6px);
    transition: all 0.18s ease;
}

/* hover */
.topbar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

/* active */
.topbar-link:active {
    transform: translateY(0px) scale(0.98);
}

.topbar-link.logout {
    color: #ffd6d6;
    background: rgba(190, 52, 52, 0.14);
    border-color: rgba(255, 96, 96, 0.34);
    box-shadow: inset 0 0 0 1px rgba(255, 110, 110, 0.06);
}

.topbar-link.logout:hover {
    background: rgba(220, 68, 68, 0.20);
    border-color: rgba(255, 120, 120, 0.55);
    color: #fff1f1;
}

.user-badge {
    font-size: 0.85rem;
    color: #aaa;
    margin-right: 6px;
}

.topbar-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    opacity: 0.9;
}

.mode-dropdown-wrap.compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex: 0 0 auto;
}

.mode-dropdown-icon {
    font-size: 0.9rem;
    color: var(--muted);
    opacity: 0.9;
    line-height: 1;
}

.mode-dropdown.compact {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    padding-right: 6px;
    min-width: 92px;
    height: 100%;
    cursor: pointer;
}

.docs-toolbar {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.docs-upload-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.docs-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2a2a2a;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
}

.doc-name {
    font-size: 0.88rem;
    color: var(--text);
}

.doc-delete-btn {
    border: none;
    background: transparent;
    color: #ffb4b4;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.docs-empty {
    color: var(--muted);
    font-size: 0.9rem;
}

.chat-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.chat-subtitle {
    font-size: 0.86rem;
    color: var(--muted);
    margin-top: 4px;
}


.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 28px 24px 160px;
    scroll-behavior: smooth;
}

.messages {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.message-row {
    display: flex;
    width: 100%;
}

.message-row.user {
    justify-content: flex-end;
}

.message-row.assistant {
    justify-content: flex-start;
}

.message-card {
    max-width: min(92%, 1200px);
    border-radius: 18px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    line-height: 1.5;
}

.user-card {
    background: #303030;
    max-width: min(72%, 900px);
}

.assistant-card {
    background: #262626;
}

.message-author {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 8px;
}

.message-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 1rem;
    line-height: 1.6;
}

.chat-input-wrap {
    position: sticky;
    bottom: 0;
    padding: 16px 20px 18px;
    background:
        linear-gradient(to top, rgba(33,33,33,1) 60%, rgba(33,33,33,0.92) 80%, rgba(33,33,33,0));
}


.chat-form {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #2b2b2b;
    border: 1px solid #3a3a3a;
    border-radius: 28px;
    padding: 12px 14px 12px 18px;
    box-shadow: var(--shadow);
}


.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    outline: none;
    font-size: 1rem;
    line-height: 1.45;
    resize: none;
    overflow-y: auto;
    min-height: 28px;
    max-height: 180px;
    font-family: inherit;
}

.chat-input::placeholder {
    color: #8c8c94;
}

.send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: background 0.15s ease, transform 0.04s ease;
}

.send-btn:hover {
    background: var(--accent-hover);
}

.send-btn:active {
    transform: translateY(1px);
}

.chat-hint {
    max-width: 860px;
    margin: 8px auto 0;
    text-align: center;
    font-size: 0.76rem;
    color: var(--muted);
}

.empty-chat {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-chat-card {
    width: 100%;
    max-width: 720px;
    background: #262626;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 38px 32px;
    text-align: center;
    box-shadow: var(--shadow);
}

.empty-chat-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.6rem;
}

.empty-chat-card p,
.empty-state {
    color: var(--muted);
}

@media (max-width: 900px) {
    .sidebar {
        width: 220px;
    }

    .message-card {
        max-width: 95%;
    }
}

@media (max-width: 720px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        position: relative;
        height: auto;
        max-height: 300px;
    }

    .chat-window {
        padding: 20px 12px 130px;
    }

    .chat-input-wrap {
        padding: 12px;
    }

    .chat-form {
        padding-left: 14px;
    }
}

.typing-indicator {
    max-width: 980px;
    margin: 10px auto 0;
    color: #9ca3af;
    font-size: 0.88rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-align: left;
}

.typing-indicator.visible {
    opacity: 1;
}
.message-row {
    animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-input:disabled {
    opacity: 0.8;
}

.landing-shell,
.auth-shell,
.profile-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.landing-card,
.auth-card,
.profile-card {
    width: 100%;
    max-width: 520px;
    background: #262626;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.landing-card h1,
.auth-card h1,
.profile-card h1 {
    margin-top: 0;
}

.landing-actions,
.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.auth-form input {
    background: #2b2b2b;
    border: 1px solid #3a3a3a;
    color: var(--text);
    border-radius: 14px;
    padding: 14px 16px;
    font: inherit;
}

.auth-form button,
.primary-link,
.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 600;
}

.auth-form button,
.primary-link {
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
}

.secondary-link {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.auth-error {
    background: rgba(255, 90, 90, 0.12);
    border: 1px solid rgba(255, 90, 90, 0.25);
    color: #ffb4b4;
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: 14px;
}

.auth-link-row {
    margin-top: 18px;
    color: var(--muted);
}

.profile-row {
    margin-top: 12px;
    color: var(--text);
}.mode-select {
    border: 1px solid #3a3a3a;
    background: #232323;
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
    min-width: 130px;
}

/* =========================
   DOCS PANEL
========================= */

.docs-panel-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px 16px;
}

.docs-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.docs-panel-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
}

.docs-panel-subtitle {
    font-size: 0.84rem;
    color: var(--muted);
    margin-top: 4px;
}

.docs-clear-btn {
    border: 1px solid rgba(255, 90, 90, 0.25);
    background: rgba(255, 90, 90, 0.08);
    color: #ffb4b4;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.docs-clear-btn:hover {
    background: rgba(255, 90, 90, 0.14);
    border-color: rgba(255, 90, 90, 0.45);
}

.docs-upload-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.upload-file-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #262626;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    min-height: 48px;
}

.upload-file-input {
    display: none;
}

.upload-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #303030;
    border: 1px solid #444;
    color: var(--text);
    border-radius: 10px;
    padding: 9px 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.upload-file-button:hover {
    background: #383838;
    border-color: #555;
}

.upload-file-name {
    color: var(--muted);
    font-size: 0.92rem;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-doc-btn {
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.upload-doc-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.docs-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2a2a2a;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    max-width: 100%;
}

.doc-chip-icon {
    opacity: 0.9;
}

.doc-name {
    font-size: 0.9rem;
    color: var(--text);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-delete-form {
    display: inline-flex;
}

.doc-delete-btn {
    border: none;
    background: transparent;
    color: #ffb4b4;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
}

.doc-delete-btn:hover {
    color: #ffd0d0;
}

.docs-empty-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px dashed #444;
    background: rgba(255,255,255,0.015);
}

.docs-empty-icon {
    font-size: 1.1rem;
}

.docs-empty-title {
    font-weight: 600;
    color: var(--text);
}

.docs-empty-text {
    color: var(--muted);
    font-size: 0.88rem;
}

/* =========================
   MODE SWITCHER
========================= */

.mode-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px;
    background: #232323;
    border: 1px solid #3a3a3a;
    border-radius: 16px;
}

.mode-pill {
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    border-radius: 12px;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.18s ease;
}

.mode-pill:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text);
}

.mode-pill.active {
    background: #303030;
    border-color: #4a4a4a;
    color: white;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.mode-pill.consensus.active {
    background: rgba(16, 163, 127, 0.18);
    border-color: rgba(16, 163, 127, 0.4);
    color: #dffaf2;
}

/* =========================
   CONSENSUS PROGRESS
========================= */

.consensus-progress {
    max-width: 980px;
    margin: 10px auto 0;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
}

.consensus-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.consensus-progress-title {
    font-weight: 700;
    color: var(--text);
}

.consensus-progress-stage {
    color: var(--muted);
    font-size: 0.9rem;
}

.consensus-progress-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.consensus-step {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #262626;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--muted);
    transition: all 0.2s ease;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #555;
    flex: 0 0 auto;
}

.consensus-step.active {
    border-color: rgba(16, 163, 127, 0.45);
    color: var(--text);
    background: rgba(16, 163, 127, 0.08);
}

.consensus-step.active .step-dot {
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(16, 163, 127, 0.12);
}

.consensus-step.done {
    border-color: rgba(16, 163, 127, 0.3);
    color: #d8f7ee;
}

.consensus-step.done .step-dot {
    background: #62d8b4;
}

@media (max-width: 900px) {
    .consensus-progress-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .upload-file-name {
        max-width: 180px;
    }

    .mode-switcher {
        width: 100%;
        justify-content: flex-start;
    }

    .consensus-progress-steps {
        grid-template-columns: 1fr;
    }
}

/* =========================
   DOCS DRAWER
========================= */

.docs-drawer.hidden {
    display: none;
}

.docs-drawer {
    position: fixed;
    inset: 0;
    z-index: 50;
}

.docs-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
}

.docs-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(460px, 92vw);
    background: #1c1c1c;
    border-left: 1px solid var(--border);
    box-shadow: -20px 0 40px rgba(0,0,0,0.35);
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.docs-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.drawer-close-btn {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* =========================
   MODE DROPDOWN
========================= */

.mode-dropdown-wrap {
    flex: 0 0 auto;
}

.mode-dropdown {
    appearance: none;
    border: 1px solid #3a3a3a;
    background: #232323;
    color: var(--text);
    border-radius: 999px;
    padding: 12px 42px 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    min-width: 150px;
    cursor: pointer;
}

.mode-dropdown option {
    background: #2a2a2a;
    color: #ececec;
}

/* Выделение кнопок действий */
.message-action-btn {
    background: rgba(16, 163, 127, 0.15);
    border: 1px solid rgba(16, 163, 127, 0.4);
    color: #10a37f;
    transition: all 0.2s ease;
}

.message-action-btn:hover {
    background: rgba(16, 163, 127, 0.25);
    border-color: rgba(16, 163, 127, 0.6);
    transform: translateY(-1px);
}

/* Mode selector выделение */
.mode-dropdown-wrap.compact {
    background: rgba(16, 163, 127, 0.08);
    border: 1px solid rgba(16, 163, 127, 0.3);
}

.mode-dropdown-icon {
    color: #10a37f;
}

/* Кнопка загрузки изображения */
.chat-image-upload-btn {
    background: rgba(16, 163, 127, 0.08);
    border: 1px solid rgba(16, 163, 127, 0.3);
    color: #10a37f;
    transition: all 0.2s ease;
}

.chat-image-upload-btn:hover {
    background: rgba(16, 163, 127, 0.15);
    border-color: rgba(16, 163, 127, 0.5);
}

/* =========================
   MESSAGE ACTIONS
========================= */

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.message-action-btn {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: var(--muted);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

.message-action-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

/* =========================
   EDIT MODAL
========================= */

.edit-modal.hidden {
    display: none;
}

.edit-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.edit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}

.edit-modal-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(720px, 92vw);
    transform: translate(-50%, -50%);
    background: #1f1f1f;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

.edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edit-modal-title {
    font-weight: 700;
    font-size: 1rem;
}

.edit-message-textarea {
    min-height: 180px;
    border: 1px solid var(--border);
    background: #262626;
    color: var(--text);
    border-radius: 14px;
    padding: 14px;
    resize: vertical;
    font: inherit;
    outline: none;
}

.edit-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.feedback-btn.active {
    background: rgba(16, 163, 127, 0.18);
    border-color: rgba(16, 163, 127, 0.45);
    color: #dffaf2;
}

.feedback-btn:hover {
    transform: translateY(-1px);
}

.chat-image-input {
    display: none;
}

.chat-image-upload-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid #3a3a3a;
    background: #232323;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.chat-image-upload-btn:hover {
    background: #2d2d2d;
}

.chat-image-preview {
    max-width: 980px;
    margin: 10px auto 0;
    position: relative;
    width: fit-content;
}

.chat-image-preview.hidden {
    display: none;
}

.chat-image-preview-img {
    max-width: 220px;
    max-height: 160px;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: block;
}

.chat-image-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    cursor: pointer;
}

.message-image-wrap {
    margin-top: 12px;
}

.message-image {
    max-width: min(100%, 420px);
    max-height: 360px;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: block;
}

.conversation-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.conversation-row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.conversation-row:hover .conversation-row-actions {
    opacity: 1;
}

.conversation-mini-btn {
    width: 26px;
    height: 26px;
    font-size: 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.conversation-mini-btn:hover {
    background: var(--panel-2);
    color: var(--text);
}

.conversation-mini-btn.danger:hover {
    color: #ffb4b4;
    border-color: rgba(255, 80, 80, 0.4);
}

/* Compact image chip for chat input */
.chat-image-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 220px;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    flex: 0 0 auto;
}

.chat-image-chip.hidden {
    display: none;
}

.chat-image-chip-img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: block;
}

.chat-image-chip-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chat-image-chip-name {
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.chat-image-chip-remove {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    flex: 0 0 auto;
}

.chat-image-chip-remove:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.message-image-wrap {
    margin-top: 12px;
}

.message-image {
    max-width: min(100%, 300px);
    max-height: 240px;
    border-radius: 14px;
    border: 1px solid var(--border);
    display: block;
}

/* Attunement Control Panel Styles */
.attunement-drawer {
    position: fixed;
    right: 0;
    top: 0;
    width: 380px;
    height: 100vh;
    background: #1c1c1c;
    border-left: 1px solid var(--border);
    z-index: 100;
    padding: 20px;
    overflow-y: auto;
    box-shadow: -20px 0 40px rgba(0,0,0,0.35);
}

.attunement-drawer.hidden {
    display: none;
}

.attunement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.attunement-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.attunement-legend {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.axis-control {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}

.axis-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.axis-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #ff6b6b, #444, #10a37f);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.axis-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--text);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--accent);
}

.axis-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--text);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--accent);
}

.axis-anchors {
    margin-top: 8px;
    color: #666;
    font-size: 0.8rem;
}

.flavor-analyzer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.flavor-analyzer h4 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    font-weight: 600;
}

#flavor-input {
    width: 100%;
    padding: 12px;
    background: #262626;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 10px;
}

#flavor-input:focus {
    outline: none;
    border-color: var(--accent);
}

.analyze-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.analyze-btn:hover {
    background: var(--accent-hover);
}

.flavor-result {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

.flavor-result.hidden {
    display: none;
}

.vector-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.vector-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.vector-bar .bar-label {
    width: 100px;
    color: var(--muted);
}

.vector-bar .bar {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.vector-bar .fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.vector-bar .fill.negative {
    background: #ff6b6b;
}

.vector-bar .bar-value {
    width: 40px;
    text-align: right;
    color: var(--text);
    font-weight: 600;
}

.interpretation {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 163, 127, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 0.9rem;
    z-index: 1000;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
/* =========================
   PROMPT PACK SELECTOR
========================= */

.prompt-pack-selector {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.pack-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px !important;
    border-radius: 999px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--muted) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: all 0.18s ease;
}

.pack-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text) !important;
}

.pack-btn.active {
    background: rgba(16, 163, 127, 0.15) !important;
    border-color: rgba(16, 163, 127, 0.4) !important;
    color: #10a37f !important;
}

.pack-btn .topbar-link-icon {
    font-size: 1rem;
}

/* Precision Mode Button */
.precision-btn {
    position: relative;
    gap: 6px;
}

.precision-btn .precision-indicator {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--muted);
    margin-left: 4px;
}

.precision-btn.active .precision-indicator {
    background: #10a37f;
    color: #fff;
}

.precision-btn.active {
    background: rgba(16, 163, 127, 0.15) !important;
    border-color: rgba(16, 163, 127, 0.4) !important;
    color: #10a37f !important;
}

/* =========================
   PROVIDER STATUS BAR
========================= */

.provider-status-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.provider-status-bar:hover {
    background: linear-gradient(135deg, var(--panel-3), var(--panel-2));
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-icon {
    font-size: 0.9rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    position: relative;
    display: none; /* Hide dot, use emoji instead */
}

.status-text {
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

/* Provider Status Tooltip */
.provider-status-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0;
    min-width: 280px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    z-index: 100;
    overflow: hidden;
    animation: tooltip-appear 0.2s ease;
}

@keyframes tooltip-appear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.provider-status-tooltip.hidden {
    display: none;
}

.tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.tooltip-refresh {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    opacity: 0.7;
}

.tooltip-refresh:hover {
    background: rgba(255,255,255,0.1);
    opacity: 1;
    transform: rotate(180deg);
}

#provider-status-list {
    padding: 12px 16px;
    max-height: 300px;
    overflow-y: auto;
}

.provider-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.provider-item:last-child {
    border-bottom: none;
}

.provider-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.provider-icon {
    font-size: 1.1rem;
}

.provider-name {
    font-weight: 500;
    color: var(--text);
    text-transform: capitalize;
    font-size: 0.9rem;
}

.provider-details {
    font-size: 0.75rem;
    color: var(--muted);
    padding: 0 0 12px 28px;
    margin-top: -6px;
}

.provider-status {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 500;
    white-space: nowrap;
}

.provider-status.ok {
    background: rgba(16, 163, 127, 0.15);
    color: #10a37f;
    border: 1px solid rgba(16, 163, 127, 0.3);
}

.provider-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tooltip-footer {
    padding: 10px 16px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

/* =========================
   TYPING INDICATOR
========================= */

.typing-indicator {
    display: none;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    color: var(--muted);
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border);
    border-radius: 16px;
    margin: 12px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: indicator-appear 0.3s ease;
}

@keyframes indicator-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.typing-indicator.visible {
    display: flex;
}

.typing-animation {
    display: flex;
    gap: 5px;
    align-items: center;
    height: 20px;
}

.typing-animation span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4);
}

.typing-animation span:nth-child(1) { animation-delay: -0.32s; }
.typing-animation span:nth-child(2) { animation-delay: -0.16s; }
.typing-animation span:nth-child(3) { animation-delay: 0s; }

@keyframes typing-bounce {
    0%, 80%, 100% { 
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

.typing-text {
    font-weight: 500;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, var(--muted), var(--text), var(--muted));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: typing-shimmer 2s infinite linear;
}

@keyframes typing-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* =========================
   UPLOAD PROGRESS
========================= */

.upload-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border);
    border-radius: 999px;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: progress-appear 0.3s ease;
}

@keyframes progress-appear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.upload-progress-container.hidden {
    display: none;
}

.upload-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--panel-3);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 3px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.3);
    position: relative;
    overflow: hidden;
}

.upload-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shimmer 1.5s infinite;
}

@keyframes progress-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.upload-progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    min-width: 40px;
    text-align: right;
}

/* =========================
   HISTO PANEL
========================= */

.histo-drawer.hidden {
    display: none;
}

.histo-drawer {
    position: fixed;
    inset: 0;
    z-index: 50;
}

.histo-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
}

.histo-panel-content {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 92vw);
    background: #1c1c1c;
    border-left: 1px solid var(--border);
    box-shadow: -20px 0 40px rgba(0,0,0,0.35);
    overflow-y: auto;
}

.histo-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.histo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.histo-icon {
    font-size: 1.3rem;
    margin-right: 8px;
}

.histo-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.histo-close {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.histo-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.histo-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.histo-section label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.histo-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.histo-btn {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

.histo-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.histo-btn.selected {
    background: rgba(16, 163, 127, 0.15);
    border-color: rgba(16, 163, 127, 0.4);
    color: #10a37f;
}

.histo-quality {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.histo-quality-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

.histo-quality-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.histo-quality-btn .badge {
    font-size: 1rem;
}

.histo-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: #262626;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.histo-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.histo-save-btn {
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.histo-save-btn:hover {
    background: var(--accent-hover);
}

.histo-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.histo-reset {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid rgba(255, 90, 90, 0.3);
    color: #ffb4b4;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.histo-reset:hover {
    background: rgba(255, 90, 90, 0.1);
}

.histo-panel-btn.hidden {
    display: none !important;
}

/* Histo Panel Button in Header */
#histo-panel-btn {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    color: #c4b5fd !important;
}

#histo-panel-btn:hover {
    background: rgba(139, 92, 246, 0.25) !important;
}

/* =========================
   MULTI-IMAGE SUPPORT
========================= */

.chat-images-container {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(to top, rgba(43, 43, 43, 0.95), rgba(43, 43, 43, 0));
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
}

.chat-images-container.hidden {
    display: none;
}

.chat-image-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 200px;
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    flex: 0 0 auto;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-image-chip-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
}

.chat-image-chip-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.chat-image-chip-name {
    font-size: 0.78rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.chat-image-chip-count {
    font-size: 0.7rem;
    color: var(--muted);
}

.chat-image-chip-remove {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 90, 90, 0.2);
    color: #ffb4b4;
    cursor: pointer;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.chat-image-chip-remove:hover {
    background: rgba(255, 90, 90, 0.4);
    color: white;
}

/* Multi-image gallery in messages */
.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.message-image-wrap {
    flex: 0 0 auto;
    position: relative;
}

.message-image {
    max-width: min(100%, 280px);
    max-height: 200px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.message-image:hover {
    transform: scale(1.02);
}

.message-image-multi {
    max-width: 140px;
    max-height: 140px;
}

/* Image counter badge */
.image-counter {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Lightbox for image preview */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.image-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
