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

:root {
    --primary-color: #eaf0fb;
    --overlay-opacity: 0.3;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* ============ LOGIN PAGE ============ */
.login-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('/resource/desktop-wallpaper-medical-health-medical.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, var(--overlay-opacity));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1;
}

.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.login-logo {
    max-width: 500px;
    max-height: 120px;
    margin-bottom: 20px;
    object-fit: contain;
}

.login-card h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #333;
    font-weight: 700;
}

.login-subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 40px;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e4ff;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: #f8f9ff;
}

.form-group input:focus {
    outline: none;
    border-color: #7DC5DF;
    background: white;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #7DC5DF 0%, #39A3C0 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(125, 197, 223, 0.4);
}

.login-error {
    margin-top: 15px;
    padding: 12px;
    background: #ffe0e0;
    color: #d32f2f;
    border-radius: 8px;
    font-size: 0.9em;
    text-align: center;
}

/* ============ MAIN APPLICATION ============ */
#mainApp {
    min-height: 100vh;
    background-image: url('/resource/desktop-wallpaper-medical-health-medical.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
    transition: background-image 0.5s ease-in-out;
}

#mainApp.specialty-dermatology {
    background-image: url('/resource/desktop-wallpaper-medical-health-medical.jpg');
}

#mainApp.specialty-radiology {
    background-image: url('/resource/scan.jpg');
}

#mainApp.specialty-pathology {
    background-image: url('/resource/colorful-3d-illustration-of-the-biochemical-process-of-lipid-synthesis-ai-generated-free-photo.jpg');
}

#mainApp::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 0;
    transition: background 0.5s ease-in-out;
}

#mainApp.specialty-dermatology::before {
    background: rgba(255, 255, 255, var(--overlay-opacity));
}

#mainApp.specialty-radiology::before {
    background: rgba(255, 255, 255, 0.5);
}

#mainApp.specialty-pathology::before {
    background: rgba(255, 255, 255, 0.3);
}

#mainApp > * {
    position: relative;
    z-index: 1;
}

/* Banner */
.app-banner {
    background: var(--primary-color);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-left: 15px; /* Same as sidebar nav padding */
    padding-right: 15px;
}

.banner-title-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 0;
}

.banner-logo {
    max-width: 230px;
    max-height: 200px;
    object-fit: contain;
}

.banner-title {
    font-size: 1.8em;
    color: #333;
    font-weight: 700;
    margin: 0;
}

.banner-buttons {
    display: flex;
    gap: 15px;
}

.banner-btn {
    padding: 10px 25px;
    background: white;
    border: 2px solid #d0d9e8;
    border-radius: 8px;
    color: #333;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-btn:hover {
    background: #7DC5DF;
    color: white;
    border-color: #7DC5DF;
    transform: translateY(-2px);
}

.banner-btn.active {
    background: linear-gradient(135deg, #7DC5DF 0%, #39A3C0 100%);
    color: white;
    border-color: #7DC5DF;
    box-shadow: 0 2px 8px rgba(125, 197, 223, 0.4);
}

.banner-btn.active:hover {
    background: linear-gradient(135deg, #6BB5CF 0%, #2A93B0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(125, 197, 223, 0.5);
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* ============ IMAGE PREVIEW SIDE PANEL ============ */
.image-preview-panel {
    display: none;
    flex-direction: row;
    width: 300px;
    min-width: 150px;
    max-width: 50vw;
    flex-shrink: 0;
    position: relative;
    background: #f4f7fb;
    border-left: 1px solid #d0daea;
    overflow: hidden;
    transition: width 0.15s ease;
}

.image-preview-panel.panel-visible {
    display: flex;
}

.panel-resize-handle {
    width: 6px;
    flex-shrink: 0;
    cursor: col-resize;
    background: transparent;
    transition: background 0.2s;
    align-self: stretch;
    z-index: 10;
}

.panel-resize-handle:hover,
.panel-resize-handle.dragging {
    background: rgba(125, 197, 223, 0.5);
}

.panel-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px 14px;
    border-bottom: 1px solid #d0daea;
    background: #eaf0fb;
    flex-shrink: 0;
}

.panel-header span {
    font-size: 0.95em;
    font-weight: 600;
    color: #3a4a6b;
    letter-spacing: 0.02em;
}

.panel-close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.panel-close-btn:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
}

.panel-image-container {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid #dde4f0;
    border-radius: 8px;
    padding: 10px;
}

.panel-thumb {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.panel-thumb-placeholder {
    width: 100%;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #eef2fa;
    border-radius: 6px;
    color: #8a9bbf;
    font-size: 0.8em;
    gap: 8px;
}

.panel-thumb-placeholder svg {
    opacity: 0.5;
}

.panel-thumb-label {
    font-size: 0.78em;
    color: #666;
    text-align: center;
    word-break: break-all;
    width: 100%;
    line-height: 1.4;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--primary-color);
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 15px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #333;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
}

.sidebar-btn:hover {
    background: rgba(125, 197, 223, 0.1);
    color: #7DC5DF;
}

.sidebar-btn.active {
    background: rgba(125, 197, 223, 0.2);
    color: #7DC5DF;
    font-weight: 600;
}

.sidebar-btn span:first-child {
    font-size: 1.2em;
}

.logout-btn {
    margin-top: auto;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    padding-top: 20px;
    margin-top: 20px;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}

.content-page {
    animation: fadeIn 0.3s ease;
}

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

/* Sliding animations for specialty transitions */

.content-container.slide-out-left {
    animation: slideOutLeft 0.4s ease-in-out forwards;
}

.content-container.slide-out-right {
    animation: slideOutRight 0.4s ease-in-out forwards;
}

.content-container.slide-in-left {
    animation: slideInLeft 0.4s ease-in-out forwards;
}

.content-container.slide-in-right {
    animation: slideInRight 0.4s ease-in-out forwards;
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page-title {
    font-size: 2em;
    color: #333;
    margin-bottom: 30px;
    font-weight: 700;
}

.placeholder-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    color: #666;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Upload Section */
.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 3px dashed #7DC5DF;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.upload-area:hover {
    border-color: #39A3C0;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #39A3C0;
    background: #f0f2ff;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    color: #7DC5DF;
    margin-bottom: 20px;
}

.upload-area h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.upload-area p {
    color: #666;
    margin-bottom: 5px;
}

.file-types {
    font-size: 0.9em;
    color: #999;
    margin-top: 10px;
}

.browse-btn {
    margin-top: 20px;
    padding: 12px 30px;
    background: #7DC5DF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s ease;
    pointer-events: all;
}

.browse-btn:hover {
    background: #39A3C0;
}

.file-info {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    border: 2px solid #e0e4ff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.file-preview-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-preview-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid #e0e4ff;
    position: relative;
}

.file-preview-item .preview-image {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: contain;
    background: white;
    padding: 8px;
    border: 1px solid #e0e4ff;
    flex-shrink: 0;
}

.file-preview-item .file-details {
    flex: 1;
}

.file-preview-item .file-details h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1em;
}

.file-preview-item .file-details p {
    color: #666;
    margin-bottom: 4px;
    font-size: 0.85em;
}

.remove-file-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.remove-file-btn:hover {
    background: #cc0000;
}

/* Legacy support for single file preview */
.file-preview {
    display: flex;
    gap: 20px;
    align-items: center;
}

.file-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    object-fit: contain;
    background: white;
    padding: 10px;
    border: 2px solid #e0e4ff;
}

.file-details h4 {
    color: #333;
    margin-bottom: 10px;
}

.file-details p {
    color: #666;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.prompt-section {
    margin-top: 30px;
}

.prompt-section label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.prompt-section textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e4ff;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: white;
}

.prompt-section textarea:focus {
    outline: none;
    border-color: #7DC5DF;
}

.actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.btn {
    padding: 15px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #7DC5DF 0%, #39A3C0 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(125, 197, 223, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* ============ VOICE INPUT SECTION ============ */
.voice-input-section {
    margin-bottom: 20px;
    text-align: center;
}

.btn-voice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #7DC5DF 0%, #39A3C0 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
}

.btn-voice:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(125, 197, 223, 0.4);
}

.btn-voice:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-voice.recording {
    background: linear-gradient(135deg, #5ab4d0 0%, #2a8ba0 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

.voice-icon-container {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-icon {
    width: 24px;
    height: 24px;
}

.recording-circle {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.pulse-ring-delay {
    animation-delay: 0.5s;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.voice-status {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Real-time TTS Toggle */
.realtime-tts-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    border: 2px solid #e0e4ff;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #7DC5DF 0%, #39A3C0 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    user-select: none;
}

/* ============ REPORT PLAYBACK BUTTON ============ */
.btn-play-report {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
}

.btn-play-report:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-play-report:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.play-icon {
    width: 20px;
    height: 20px;
}

.results-section {
    margin-top: 40px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    border: 2px solid #e0e4ff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.results-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.report-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.history-section {
    margin-top: 30px;
    background: white;
    border-radius: 15px;
    border: 2px solid #e0e4ff;
    padding: 25px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.history-section h3 {
    font-size: 1.6em;
    color: #333;
    margin-bottom: 10px;
}

.history-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.history-placeholder {
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    color: #666;
    font-size: 0.95em;
}

.history-record-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-record-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border: 1px solid #e0e4ff;
    border-radius: 12px;
    background: #fdfdff;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.history-record-item:hover {
    box-shadow: 0 6px 20px rgba(125, 197, 223, 0.2);
    transform: translateY(-2px);
}

.history-record-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-record-name {
    font-size: 1.05em;
    font-weight: 600;
    color: #2c3e50;
    word-break: break-all;
}

.history-record-meta {
    font-size: 0.9em;
    color: #6b7280;
}

.history-download-btn {
    padding: 10px 24px;
    font-size: 0.95em;
}

.history-download-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.status-info {
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #666;
}

.loading {
    text-align: center;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Loader animation */
.loader {
    --s: 25px;
    --g: 5px;
    width: calc(3*(1.353*var(--s) + var(--g)));
    display: grid;
    justify-items: end;
    aspect-ratio: 3;
    overflow: hidden;
    --_m: linear-gradient(90deg,#0000,#000 15px calc(100% - 15px),#0000);
    -webkit-mask: var(--_m);
    mask: var(--_m);
}

.loader:before { 
    content: "";
    width: 200%;
    background:
        linear-gradient(90deg,#ff1818 50%,#0000 0),
        conic-gradient(from -90deg at var(--s) calc(0.353*var(--s)),
            #fff 135deg,#666 0 270deg,#aaa 0); 
    background-blend-mode: multiply;
    --_m:
        linear-gradient(to bottom right,
            #0000 calc(0.25*var(--s)),#000 0 calc(100% - calc(0.25*var(--s)) - 1.414*var(--g)),#0000 0),
        conic-gradient(from -90deg at right var(--g) bottom var(--g),#000 90deg,#0000 0);
    -webkit-mask: var(--_m);
    mask: var(--_m);
    background-size: calc(100%/3) 100%, calc(100%/6) 100%;
    -webkit-mask-size: calc(100%/6) 100%;
    mask-size: calc(100%/6) 100%;
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
    animation: l10 1s infinite linear;
}

@keyframes l10 {
    to {transform:translate(calc(100%/3))}
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(128, 128, 128, 0.5);
    z-index: 9999;
    display: none;
    pointer-events: auto;
}

.loading-overlay.active {
    display: block;
}

/* Loading container */
.loading-container {
    position: fixed;
    top: 0%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    margin: 0;
}

.loading-container.active {
    display: flex;
}

.loading-container p {
    margin: 0;
    color: #333;
    font-size: 1.1em;
    font-weight: 500;
}

.analysis-result {
    background: #f8f9ff;
    padding: 30px;
    border-radius: 10px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.app-footer {
    background: var(--primary-color);
    padding: 20px;
    text-align: center;
    color: #666;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.device-info {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        gap: 15px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .banner-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 10px 0;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 10px;
    }

    .sidebar-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .main-content {
        padding: 20px;
    }

    .file-preview {
        flex-direction: column;
        text-align: center;
    }

    .file-preview-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .file-preview-item .preview-image {
        max-width: 100%;
        margin-bottom: 10px;
    }

    .file-preview-item .remove-file-btn {
        position: static;
        margin-top: 10px;
    }

    .image-preview-panel.panel-visible {
        width: 100% !important;
        max-width: 100%;
        border-left: none;
        border-top: 1px solid #d0daea;
        flex-direction: column;
    }

    .panel-resize-handle {
        display: none;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .login-card {
        padding: 40px 30px;
    }
}

/* ============ STREAMING INDICATORS ============ */
.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #4CAF50;
    animation: blink 1s infinite;
    margin-left: 2px;
    vertical-align: middle;
}

@keyframes blink {
    0%, 49% { 
        opacity: 1; 
    }
    50%, 100% { 
        opacity: 0; 
    }
}

.streaming-status {
    color: #4CAF50;
    font-style: italic;
    font-weight: 500;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.6; 
    }
}

/* ============ IMAGE LIGHTBOX MODAL ============ */
.lightbox-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.78);
    z-index: 99999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lightboxFadeIn 0.18s ease;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox-box {
    display: flex;
    flex-direction: column;
    background: #1a1e2a;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    width: 85vw;
    height: 85vh;
    overflow: hidden;
    animation: lightboxSlideIn 0.2s ease;
}

@keyframes lightboxSlideIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.lightbox-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #12151f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #dde4f0;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s;
    flex-shrink: 0;
}

.lightbox-btn:hover {
    background: rgba(125, 197, 223, 0.25);
    color: #7dc5df;
    border-color: #7dc5df;
}

.lightbox-close-btn {
    margin-left: auto;
    font-size: 22px;
    width: 36px;
    height: 36px;
}

.lightbox-close-btn:hover {
    background: rgba(220, 53, 69, 0.25);
    color: #ff6b7a;
    border-color: #ff6b7a;
}

.lightbox-image-wrapper {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    position: relative;
}

.lightbox-image-wrapper.is-panning {
    cursor: grabbing;
}

.lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    transform-origin: center center;
    transition: transform 0.08s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* ============================================================================
   问诊 & 报告聊天 — Light theme (matches existing app)
   Primary: #7DC5DF  |  Hover: #39A3C0  |  Shadow: #d0daea  |  Border: #e0e4ff
   ============================================================================ */

/* ── Conversation Section ──────────────────────────────────────────────────── */
.conversation-section {
    margin-top: 28px;
    background: white;
    border: 2px solid #e0e4ff;
    border-radius: 15px;
    box-shadow: 0 4px 15px #d0daea;
    overflow: hidden;
}

.conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid #e0e4ff;
    background: #f8f9ff;
}

.conversation-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

.conversation-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Force-report button */
.btn-force-report {
    padding: 8px 16px;
    border-radius: 8px;
    border: 2px solid #7DC5DF;
    background: white;
    color: #39A3C0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn-force-report:hover {
    background: #7DC5DF;
    color: white;
    transform: translateY(-1px);
}

.btn-force-report:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* ── Chat messages ─────────────────────────────────────────────────────────── */
.conversation-messages {
    padding: 18px 22px;
    max-height: 460px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fafbff;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.chat-user {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    line-height: 1.65;
    font-size: 0.9rem;
    word-break: break-word;
}

.chat-user .chat-bubble {
    background: linear-gradient(135deg, #7DC5DF 0%, #39A3C0 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(125, 197, 223, 0.35);
}

.chat-assistant .chat-bubble {
    background: white;
    border: 1px solid #e0e4ff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(208, 218, 234, 0.5);
}

/* ── Differential diagnosis badges ────────────────────────────────────────── */
.diff-dx-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding: 0 2px;
}

.diff-dx-badge {
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid;
}

.diff-dx-badge.prob-high {
    background: #fff0f0;
    border-color: #f5a0a0;
    color: #c0392b;
}

.diff-dx-badge.prob-medium {
    background: #fffbeb;
    border-color: #f6d860;
    color: #b7791f;
}

.diff-dx-badge.prob-low {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

/* ── SOAP thought-trace collapsible ───────────────────────────────────────── */
.thought-trace-details {
    margin-top: 7px;
    font-size: 0.8rem;
}

.thought-trace-details summary {
    cursor: pointer;
    color: #7DC5DF;
    user-select: none;
    padding: 2px 0;
    list-style: none;
    font-weight: 600;
}

.thought-trace-details summary::-webkit-details-marker { display: none; }
.thought-trace-details summary::before { content: "▶  "; font-size: 0.65rem; }
.thought-trace-details[open] summary::before { content: "▼  "; }

.thought-trace-content {
    margin-top: 6px;
    padding: 10px 14px;
    background: #f8f9ff;
    border: 1px solid #e0e4ff;
    border-radius: 8px;
    font-size: 0.78rem;
    color: #666;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.55;
}

/* ── Conversation input area ───────────────────────────────────────────────── */
.conversation-input-area {
    display: flex;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid #e0e4ff;
    background: #f8f9ff;
    align-items: flex-end;
}

.conversation-input {
    flex: 1;
    background: white;
    border: 2px solid #e0e4ff;
    border-radius: 10px;
    color: #333;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.conversation-input:focus {
    outline: none;
    border-color: #7DC5DF;
}

.conversation-input::placeholder {
    color: #aab4cc;
}

.btn-send {
    padding: 10px 22px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7DC5DF 0%, #39A3C0 100%);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
    align-self: flex-end;
    box-shadow: 0 2px 8px rgba(125, 197, 223, 0.4);
}

.btn-send:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(57, 163, 192, 0.4);
}

.btn-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Conversation status bar ───────────────────────────────────────────────── */
.conversation-status {
    padding: 8px 22px;
    font-size: 0.82rem;
    font-weight: 500;
    border-top: 1px solid #e0e4ff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-loading {
    color: #39A3C0;
    background: #f0f8fc;
}

.status-error {
    color: #c0392b;
    background: #fff5f5;
}

.status-complete {
    color: #27ae60;
    background: #f0fdf4;
}

.status-emergency {
    color: #c0392b;
    background: #fff0f0;
    font-weight: 700;
    animation: pulse-emergency 1s ease-in-out infinite alternate;
}

@keyframes pulse-emergency {
    from { opacity: 0.7; }
    to   { opacity: 1;   }
}

/* ── 报告聊天 section ──────────────────────────────────────────────────────── */
.report-chat-section {
    margin-top: 32px;
    background: white;
    border: 2px solid #7DC5DF;
    border-radius: 15px;
    box-shadow: 0 4px 15px #d0daea;
    overflow: hidden;
}

.report-chat-header {
    padding: 16px 22px 10px;
    background: #f0f8fc;
    border-bottom: 1px solid #e0e4ff;
}

.report-chat-header h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: #39A3C0;
}

.report-chat-description {
    margin: 0;
    font-size: 0.82rem;
    color: #666;
}

.report-display {
    margin: 16px 22px;
    padding: 16px 18px;
    background: #f8f9ff;
    border: 1px solid #e0e4ff;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #333;
    line-height: 1.7;
    max-height: 360px;
    overflow-y: auto;
}

/* ── Scrollbar polish ──────────────────────────────────────────────────────── */
.conversation-messages::-webkit-scrollbar,
.thought-trace-content::-webkit-scrollbar,
.report-display::-webkit-scrollbar {
    width: 5px;
}

.conversation-messages::-webkit-scrollbar-track,
.thought-trace-content::-webkit-scrollbar-track,
.report-display::-webkit-scrollbar-track {
    background: #f0f2ff;
    border-radius: 3px;
}

.conversation-messages::-webkit-scrollbar-thumb,
.thought-trace-content::-webkit-scrollbar-thumb,
.report-display::-webkit-scrollbar-thumb {
    background: #c0d4e8;
    border-radius: 3px;
}

.conversation-messages::-webkit-scrollbar-thumb:hover,
.report-display::-webkit-scrollbar-thumb:hover {
    background: #7DC5DF;
}

/* ── Inline mic button (inside conversation-input-area) ───────────────────── */
.btn-mic {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid #e0e4ff;
    background: white;
    color: #7DC5DF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.1s;
    align-self: flex-end;
}

.btn-mic:hover {
    border-color: #7DC5DF;
    background: #f0f8fc;
    transform: translateY(-1px);
}

.btn-mic.recording {
    border-color: #e74c3c;
    background: #fff0f0;
    color: #e74c3c;
    animation: mic-pulse 1s ease-in-out infinite alternate;
}

@keyframes mic-pulse {
    from { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.3); }
    to   { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
}

/* ── 朗读 button on AI bubbles ────────────────────────────────────────────── */
.btn-speak-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #e0e4ff;
    background: white;
    color: #7DC5DF;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    align-self: flex-start;
}

.btn-speak-bubble:hover {
    background: #7DC5DF;
    border-color: #7DC5DF;
    color: white;
}

/* ── Compact TTS toggle inside conversation header ────────────────────────── */
.conv-tts-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-switch-sm {
    width: 36px;
    height: 20px;
}

.toggle-switch-sm .toggle-slider {
    border-radius: 20px;
}

.toggle-switch-sm .toggle-slider::before {
    width: 14px;
    height: 14px;
    left: 3px;
    bottom: 3px;
}

.toggle-switch-sm input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.toggle-label-sm {
    font-size: 0.78rem;
    color: #666;
    white-space: nowrap;
    font-weight: 500;
}

/* ── report-chat-header-row: header title + toggle on same line ───────────── */
.report-chat-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.report-chat-header-row h3 {
    margin: 0;
}

/* ============================================================================
   配置 PAGE
   ============================================================================ */

/* ── Accordion card ─────────────────────────────────────────────────────────── */
.config-card {
    background: white;
    border: 2px solid #e0e4ff;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    margin-bottom: 18px;
    overflow: hidden;
}

.config-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    background: #f8f9ff;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e0e4ff;
    transition: background 0.2s;
}

.config-card-header:hover {
    background: #edf2ff;
}

.config-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 0.01em;
}

.config-card-chevron {
    display: inline-block;
    font-size: 0.8rem;
    color: #7DC5DF;
    transition: transform 0.25s ease;
}

.config-card.collapsed .config-card-chevron {
    transform: rotate(-90deg);
}

.config-card-body {
    padding: 22px 24px;
    max-height: 3000px;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease;
}

.config-card.collapsed .config-card-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* ── Two-column grid ────────────────────────────────────────────────────────── */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 28px;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-field-full {
    grid-column: 1 / -1;
}

/* ── Label ──────────────────────────────────────────────────────────────────── */
.config-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #444;
}

/* ── Input / Select ─────────────────────────────────────────────────────────── */
.config-input,
.config-select {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #e0e4ff;
    border-radius: 9px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #333;
    background: #fafbff;
    transition: border-color 0.2s, background 0.2s;
    appearance: auto;
}

.config-input:focus,
.config-select:focus {
    outline: none;
    border-color: #7DC5DF;
    background: white;
}

.config-input[type="number"] {
    max-width: 180px;
}

/* ── Input + unit select (e.g. "1 GB") ──────────────────────────────────────── */
.config-input-with-unit {
    display: flex;
    gap: 8px;
    align-items: center;
}

.config-input-with-unit .config-input {
    flex: 1;
    min-width: 0;
    max-width: unset;
}

.config-unit-select {
    width: auto;
    padding: 9px 10px;
    border: 2px solid #e0e4ff;
    border-radius: 9px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #333;
    background: #fafbff;
    transition: border-color 0.2s;
    appearance: auto;
    flex-shrink: 0;
}

.config-unit-select:focus {
    outline: none;
    border-color: #7DC5DF;
}

/* ── Toggle row ─────────────────────────────────────────────────────────────── */
.config-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
}

/* ── Radio group ────────────────────────────────────────────────────────────── */
.config-radio-group {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    height: 40px;
}

.config-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: #444;
    cursor: pointer;
}

.config-radio input[type="radio"] {
    accent-color: #7DC5DF;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* ── Slider row ─────────────────────────────────────────────────────────────── */
.config-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.config-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #d0daea;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

.config-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7DC5DF, #39A3C0);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(57, 163, 192, 0.4);
    transition: transform 0.15s;
}

.config-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.config-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #7DC5DF, #39A3C0);
    cursor: pointer;
}

.config-slider-value {
    min-width: 42px;
    text-align: right;
    font-size: 0.88rem;
    font-weight: 700;
    color: #39A3C0;
    font-variant-numeric: tabular-nums;
}

/* ── Status grid ────────────────────────────────────────────────────────────── */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9ff;
    border: 1px solid #e0e4ff;
    border-radius: 10px;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green {
    background: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

.dot-yellow {
    background: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
    animation: status-pulse 1.8s ease-in-out infinite;
}

.dot-red {
    background: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.status-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
}

.status-value {
    font-size: 0.78rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── GPU bar ────────────────────────────────────────────────────────────────── */
.gpu-bar-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gpu-bar-track {
    flex: 1;
    height: 10px;
    background: #e0e4ff;
    border-radius: 5px;
    overflow: hidden;
}

.gpu-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7DC5DF, #39A3C0);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.gpu-bar-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #39A3C0;
    white-space: nowrap;
}

/* ── Save row ───────────────────────────────────────────────────────────────── */
.config-save-row {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-bottom: 10px;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
    .config-field-full {
        grid-column: 1;
    }
    .status-grid {
        grid-template-columns: 1fr;
    }
    .config-save-row {
        flex-direction: column;
    }
    .config-save-row .btn {
        width: 100%;
    }
}

/* V5: Thinking bubble animation */
.thinking-bubble { min-height: 40px; }
.thinking-dots span { animation: thinkingBlink 1.4s infinite both; font-size: 1.5em; line-height: 1; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinkingBlink { 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } }
