:root {
    --bg: #f5f6fa;
    --surface: rgba(255, 255, 255, 0.72);
    --primary: #0071e3;
    --primary-dark: #0054ac;
    --text: #0f172a;
    --muted: #6c7383;
    --border: rgba(15, 23, 42, 0.1);
    --success: #12b16c;
    --danger: #e14c4c;
    --shadow: 0 25px 50px rgba(15, 23, 42, 0.08);
    font-family: "SF Pro Display", "SF Pro Text", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(0, 113, 227, 0.08), transparent 35%),
        radial-gradient(circle at 80% 0%, rgba(129, 212, 250, 0.15), transparent 30%);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(24px);
    background: rgba(255, 255, 255, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.brand:hover {
    opacity: 0.8;
    text-decoration: none;
}

.brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 600;
    font-size: 20px;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px);
}

.main-nav {
    display: flex;
    gap: 8px;
}

.main-nav a {
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 999px;
    transition: background 0.2s, color 0.2s;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
}

.balance-box {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-left: 1px solid rgba(15, 23, 42, 0.08);
    border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.balance-label {
    color: var(--muted);
    font-weight: 500;
}

.balance-value {
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: var(--text);
}

.balance-spent {
    color: var(--primary);
}

.balance-remaining {
    color: var(--success);
}

.balance-remaining.balance-low {
    color: var(--danger);
}

.balance-progress {
    width: 100%;
    height: 4px;
    background: rgba(15, 23, 42, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.balance-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.balance-percentage {
    font-size: 10px;
    color: var(--muted);
    text-align: right;
    margin-top: 2px;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    padding-left: 12px;
    border-left: 1px solid rgba(15, 23, 42, 0.08);
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
}

.link-button.danger {
    color: var(--danger);
}

.hero {
    padding: 32px 0;
    backdrop-filter: blur(30px);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.65));
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.hero--compact h1 {
    margin: 8px 0 0;
    font-size: 28px;
    font-weight: 600;
}

.breadcrumbs {
    font-size: 14px;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.page-content {
    padding: 32px 0 64px;
}

.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.message {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow);
}

.message-success {
    border-color: var(--success);
    color: var(--success);
}

.message-error {
    border-color: var(--danger);
    color: var(--danger);
}

.actions-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 113, 227, 0.25);
}

.button.primary:hover {
    background: var(--primary-dark);
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.table-wrapper {
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    overflow: hidden;
    box-shadow: var(--shadow);
    backdrop-filter: blur(30px);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    text-align: left;
}

.data-table th {
    background: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.data-table .actions {
    display: flex;
    gap: 8px;
}

.cost-display {
    font-weight: 600;
    color: var(--text);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.cost-hint {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.truncate {
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-success {
    background: rgba(18, 177, 108, 0.1);
    color: var(--success);
}

.status-failed {
    background: rgba(225, 76, 76, 0.1);
    color: var(--danger);
}

.status-processing {
    background: rgba(0, 113, 227, 0.12);
    color: var(--primary);
}

.status-pending {
    background: rgba(108, 115, 131, 0.12);
    color: var(--muted);
}

.card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(30px);
}

.card-header {
    border-bottom: 1px solid var(--border);
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.copy-button {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text);
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary);
    color: var(--primary);
}

.copy-button svg {
    display: block;
}

.card-body {
    padding: 24px 28px;
}

.meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 0 0 16px;
}

.meta dt {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.meta dd {
    margin: 0;
    font-weight: 600;
}

.response-block {
    background: #0a0a0a;
    color: #f5f5f7;
    padding: 18px;
    border-radius: 16px;
    overflow-x: auto;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    line-height: 1.6;
}

.response-block h1,
.response-block h2,
.response-block h3,
.response-block h4,
.response-block h5,
.response-block h6 {
    color: #f5f5f7;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.response-block h1 { font-size: 1.5em; }
.response-block h2 { font-size: 1.3em; }
.response-block h3 { font-size: 1.1em; }

.response-block p {
    margin: 0.8em 0;
}

.response-block strong,
.response-block b {
    color: #ffffff;
    font-weight: 600;
}

.response-block em,
.response-block i {
    font-style: italic;
}

.response-block ul,
.response-block ol {
    margin: 0.8em 0;
    padding-left: 1.5em;
}

.response-block li {
    margin: 0.4em 0;
}

.response-block code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.response-block pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
}

.response-block pre code {
    background: none;
    padding: 0;
}

.response-block table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.response-block table th,
.response-block table td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    text-align: left;
}

.response-block table th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.response-block a {
    color: #81d4fa;
    text-decoration: underline;
}

.response-block a:hover {
    color: #b3e5fc;
}

.response-text-hidden {
    display: none;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.file-meta {
    color: var(--muted);
    font-size: 12px;
}

.form-card textarea,
.form-card input,
.form-card select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    transition: border 0.2s, box-shadow 0.2s;
}

.auth-form {
    max-width: 420px;
    margin: 0 auto;
    padding: 32px 36px;
}

.request-form {
    max-width: 760px;
    margin: 0 auto;
    padding: 36px 40px;
}

.form-card textarea:focus,
.form-card input:focus,
.form-card select:focus {
    border-color: rgba(0, 113, 227, 0.5);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
    outline: none;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.field-errors {
    color: var(--danger);
    font-size: 13px;
    margin-top: 6px;
}

.help-text {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.empty-state {
    background: rgba(255, 255, 255, 0.85);
    padding: 48px;
    border-radius: 24px;
    border: 1px dashed rgba(15, 23, 42, 0.15);
    text-align: center;
    color: var(--muted);
    box-shadow: var(--shadow);
}

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(30px);
    background: rgba(255, 255, 255, 0.65);
    padding: 24px 0;
    font-size: 14px;
    color: var(--muted);
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        flex-wrap: wrap;
    }
    
    .balance-box {
        width: 100%;
        padding: 8px 0;
        border-left: none;
        border-right: none;
        border-top: 1px solid rgba(15, 23, 42, 0.08);
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        margin: 8px 0;
    }
    
    .balance-info {
        width: 100%;
        min-width: auto;
    }

    .data-table th:nth-child(3),
    .data-table td:nth-child(3) {
        display: none;
    }

    .actions-row {
        flex-direction: column;
    }

    .site-footer .container {
        flex-direction: column;
        gap: 8px;
    }
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 246, 250, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.preloader-content {
    text-align: center;
    padding: 40px;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.preloader-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 4px solid rgba(0, 113, 227, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.preloader-content p {
    margin: 0;
    color: var(--text);
    font-weight: 500;
    font-size: 16px;
}

/* Conversation Chat Interface */
.conversation-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    max-height: 800px;
    width: 100%;
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow);
    backdrop-filter: blur(30px);
    overflow: hidden;
}


.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.conversation-messages::-webkit-scrollbar {
    width: 8px;
}

.conversation-messages::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.05);
    border-radius: 4px;
}

.conversation-messages::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 4px;
}

.conversation-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.3);
}

.message-wrapper {
    display: flex;
    width: 100%;
}

.message-wrapper.message-user {
    justify-content: flex-end;
}

.message-wrapper.message-assistant {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 75%;
    position: relative;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message-user .message-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-assistant .message-bubble {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.message-content {
    margin-bottom: 4px;
}

.message-text {
    line-height: 1.5;
    white-space: pre-wrap;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 8px;
}

.message-actions {
    opacity: 0;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.message-bubble:hover .message-actions {
    opacity: 1;
}

.message-assistant .copy-button {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
}

.message-user .copy-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Technical Info */
.message-tech-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.tech-info-details {
    font-size: 12px;
}

.tech-info-summary {
    cursor: pointer;
    user-select: none;
    color: var(--muted);
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    display: inline-block;
}

.tech-info-summary:hover {
    background: rgba(15, 23, 42, 0.05);
    color: var(--primary);
}

.tech-info-summary::-webkit-details-marker {
    display: none;
}

.tech-info-summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 6px;
    font-size: 10px;
    transition: transform 0.2s;
    vertical-align: middle;
}

details[open] > .tech-info-summary::before {
    transform: rotate(90deg);
}

.tech-info-content {
    margin-top: 12px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.02);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.tech-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    gap: 12px;
}

.tech-info-label {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tech-info-value {
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: var(--text);
}

.tech-info-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.tech-info-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.tech-info-section strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.tech-info-json {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tech-info-json::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tech-info-json::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.tech-info-json::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.tech-info-json::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.conversation-input-container {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.85);
}

.conversation-form {
    width: 100%;
}

.input-wrapper {
    position: relative;
}

.input-group {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 8px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.input-group textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto;
}

.input-group textarea:focus {
    outline: none;
    box-shadow: none;
}

.input-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.file-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.2s;
    position: relative;
}

.file-button:hover {
    background: rgba(15, 23, 42, 0.08);
    color: var(--primary);
}

.file-button input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: none;
}

.send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.response-block {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    overflow-x: auto;
    box-shadow: none;
    line-height: 1.6;
}

.message-user .response-block {
    color: #fff;
}

.message-assistant .response-block {
    color: var(--text);
}

.message-assistant .response-block h1,
.message-assistant .response-block h2,
.message-assistant .response-block h3,
.message-assistant .response-block h4,
.message-assistant .response-block h5,
.message-assistant .response-block h6 {
    color: var(--text);
}

.message-user .response-block h1,
.message-user .response-block h2,
.message-user .response-block h3,
.message-user .response-block h4,
.message-user .response-block h5,
.message-user .response-block h6 {
    color: #fff;
}

.message-assistant .response-block code {
    background: rgba(15, 23, 42, 0.1);
    color: var(--text);
}

.message-user .response-block code {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.message-assistant .response-block pre {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid var(--border);
}

.message-user .response-block pre {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-assistant .response-block a {
    color: var(--primary);
}

.message-user .response-block a {
    color: #b3e5fc;
}

@media (max-width: 768px) {
    .conversation-container {
        height: calc(100vh - 160px);
        border-radius: 0;
        margin: -16px -24px;
        max-width: none;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .conversation-messages {
        padding: 16px;
    }
    
    .conversation-input-container {
        padding: 12px 16px;
    }
}

/* Message Images */
.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.message-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image-wrapper:hover {
    transform: scale(1.02);
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.message-user .message-image {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.message-assistant .message-image {
    border: 1px solid var(--border);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
    padding: 0;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Selected Files Preview */
.selected-files-preview {
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.file-item {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    position: relative;
    max-width: 120px;
}

.file-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.file-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon {
    font-size: 32px;
}

.file-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(225, 76, 76, 0.9);
    border: none;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.file-remove:hover {
    background: var(--danger);
}

.file-info {
    text-align: center;
}

.file-name {
    font-size: 11px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    margin-bottom: 2px;
}

.file-size {
    font-size: 10px;
    color: var(--muted);
}

.files-summary {
    width: 100%;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.05);
    border-radius: 8px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

.files-summary .warning {
    color: var(--warning, #f59e0b);
    font-weight: 600;
}

.selected-files-preview::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.selected-files-preview::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.05);
    border-radius: 3px;
}

.selected-files-preview::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 3px;
}

/* File Hint */
.file-hint {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
}

.file-button:hover + .file-hint,
.file-hint:hover {
    opacity: 1;
    visibility: visible;
}

.file-hint-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    font-size: 12px;
    color: var(--text);
}

.file-hint-content strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
}

.file-hint-content ul {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.file-hint-content li {
    margin-bottom: 4px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .file-hint {
        right: auto;
        left: 0;
    }
    
    .file-hint-content {
        max-width: 250px;
    }
}

