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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #000000;
    min-height: 100vh;
    height: 100vh;
    color: #ffffff;
    overflow: hidden;
}

/* Hide scrollbars globally */
* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

*::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Title Bar Styles */
.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 32px;
    background: #000000;
    color: #ffffff;
    -webkit-app-region: drag;
    user-select: none;
    border-bottom: 1px solid #1a1a1a;
    padding: 0 8px;
}

.title-bar-left {
    display: flex;
    align-items: center;
    -webkit-app-region: no-drag;
    min-width: 120px;
}

.title-bar-logo {
    height: 18px;
    width: 18px;
    margin-left: 4px;
    margin-right: 4px;
    flex-shrink: 0;
}

.menu-items {
    display: flex;
    gap: 4px;
    padding-left: 8px;
}

.menu-item-wrapper {
    position: relative;
}

.menu-item {
    font-size: 13px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.15s ease;
    display: block;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 2px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    min-width: 250px;
    padding: 4px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: slideDown 0.15s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-option {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    transition: background-color 0.15s ease;
}

.menu-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-shortcut {
    font-size: 11px;
    color: #888;
    margin-left: 20px;
}

.menu-separator {
    height: 1px;
    background: #333;
    margin: 4px 8px;
}

.title-bar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.app-title {
    font-size: 12px;
    color: #999;
}

.title-bar-right {
    display: flex;
    -webkit-app-region: no-drag;
    align-items: center;
}

.title-bar-button {
    width: 46px;
    height: 32px;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.title-bar-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.title-bar-button.close:hover {
    background: #e81123;
}

.title-bar-button:active {
    background: rgba(255, 255, 255, 0.2);
}

.title-bar-button.close:active {
    background: #c50e1f;
}

.title-bar-logo.center-logo {
    margin: 0;
    height: 14px;
    width: 14px;
    opacity: 0.9;
}

.title-help-wrapper .help-dropdown {
    right: 0;
    left: auto;
    min-width: 230px;
}

.title-bar-button.help.active {
    background: rgba(255, 255, 255, 0.12);
}

body > * {
    -webkit-app-region: no-drag;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 20px;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 15px;
    padding: 15px 20px 10px 20px;
    flex-shrink: 0;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

main {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
    flex-shrink: 1;
    min-height: 0;
}

.card:hover {
    transform: translateY(-2px);
    border-color: #444;
}

.card h2 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.card h3 {
    color: #cccccc;
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.card p {
    line-height: 1.4;
    color: #aaaaaa;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.card ul {
    list-style-position: inside;
    color: #aaaaaa;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Marketplace Section */
.marketplace-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    height: 100%;
    width: 100%;
    background: radial-gradient(ellipse at 50% 0%, rgba(50, 50, 50, 0.3) 0%, transparent 60%);
}

.marketplace-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(255, 200, 50, 0.15) 0%, rgba(255, 150, 50, 0.1) 100%);
    border: 1px solid rgba(255, 200, 50, 0.3);
    border-radius: 20px;
    margin-bottom: 16px;
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 200, 50, 0);
    }
    50% {
        box-shadow: 0 0 20px 2px rgba(255, 200, 50, 0.15);
    }
}

.badge-icon {
    font-size: 0.75rem;
    color: #ffc832;
    animation: iconSpin 4s linear infinite;
}

@keyframes iconSpin {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
}

.badge-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffc832;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.marketplace-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    text-align: center;
    letter-spacing: -0.02em;
}

.marketplace-subtitle {
    font-size: 0.9rem;
    color: #888;
    margin: 0 0 28px 0;
    text-align: center;
}

.apps-gallery-container {
    width: 100%;
    max-width: 600px;
    overflow: hidden;
    position: relative;
    padding: 8px 0;
}

.apps-gallery-container::before,
.apps-gallery-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

.apps-gallery-container::before {
    left: 0;
    background: linear-gradient(to right, #000000, transparent);
}

.apps-gallery-container::after {
    right: 0;
    background: linear-gradient(to left, #000000, transparent);
}

.apps-gallery {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    width: max-content;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.apps-gallery.dragging {
    cursor: grabbing;
}

.apps-gallery.dragging .gallery-app-item {
    pointer-events: none;
}

.gallery-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    min-width: 72px;
}

.gallery-app-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.gallery-app-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.25s ease;
}

.gallery-app-item:hover .gallery-app-icon {
    transform: scale(1.1);
}

.gallery-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-app-name {
    font-size: 0.65rem;
    color: #999;
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 64px;
    transition: color 0.2s ease;
}

.gallery-app-item:hover .gallery-app-name {
    color: #fff;
}

/* Marketplace iframe */
.marketplace-iframe {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: none;
    background: #000000;
}

.external-content-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #000;
}

.external-content-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #111;
    border-bottom: 1px solid #222;
    gap: 12px;
}

.external-content-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.external-content-back-btn:hover {
    color: #fff;
    background: #222;
}

/* Disable iframe pointer events during resize to prevent event capture */
body[style*="cursor: col-resize"] .marketplace-iframe,
body[style*="cursor: row-resize"] .marketplace-iframe {
    pointer-events: none;
}

.marketplace-iframe.loading {
    opacity: 0;
}

/* Marketplace Loading State */
.marketplace-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: #888;
    gap: 16px;
}

.marketplace-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #333;
    border-top-color: #ffc832;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.marketplace-loading p {
    font-size: 0.9rem;
    margin: 0;
}

/* Marketplace Offline State */
.marketplace-offline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    padding: 40px;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(50, 50, 50, 0.3) 0%, transparent 60%);
}

.offline-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.8;
}

.marketplace-offline h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.offline-message {
    font-size: 0.9rem;
    color: #888;
    margin: 0 0 24px 0;
    max-width: 300px;
    line-height: 1.5;
}

.offline-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.offline-btn {
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.offline-btn.primary {
    background: #ffc832;
    color: #000000;
}

.offline-btn.primary:hover {
    background: #e6b800;
    transform: translateY(-2px);
}

.offline-btn.secondary {
    background: transparent;
    border: 1px solid #333;
    color: #888;
}

.offline-btn.secondary:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #555;
}

.status-section {
    margin: 10px 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    margin-top: 8px;
    color: #ffffff;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffc107;
    animation: pulse 2s infinite;
}

.status-indicator.connected .status-dot {
    background: #4caf50;
}

.status-indicator.error .status-dot {
    background: #f44336;
    animation: none;
}

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

.action-section {
    margin-top: 10px;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
    background: #f0f0f0;
}

.btn-primary:active {
    transform: translateY(0);
}

.response-box {
    margin-top: 8px;
    padding: 10px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-left: 4px solid #ffffff;
    border-radius: 4px;
    min-height: 40px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #ffffff;
    display: none;
}

.response-box.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

footer {
    text-align: center;
    color: white;
    margin-top: 15px;
    padding: 10px;
    opacity: 0.8;
    flex-shrink: 0;
    font-size: 0.9rem;
}

/* App Layout */
.app-layout {
    display: flex;
    height: calc(100vh - 32px - 28px); /* 32px title bar + 28px status bar */
    overflow: hidden;
}

/* Main Content Container - holds main content and logs vertically */
.main-content-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-width: 400px;
}

.main-content {
    flex: 1;
    overflow: hidden;
    transition: margin-left 0.3s ease;
}

.main-content.with-chat {
    flex: 1;
}

.main-content.with-model-manager {
    flex: 1;
}

.main-content.full-width {
    width: 100%;
}

/* Resizable Divider */
.resizable-divider {
    width: 4px;
    background: transparent;
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    transition: background-color 0.2s ease;
}

.resizable-divider:hover {
    background: rgba(255, 255, 255, 0.1);
}

.resizable-divider:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Model Manager Styles */
.model-manager {
    background: #0a0a0a;
    border-right: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    flex-grow: 0;
}

.model-manager.experience-mode {
    background: #090909;
}

.left-panel-shell {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.left-panel-mode-rail {
    width: 40px;
    border-right: 1px solid #1a1a1a;
    background: linear-gradient(180deg, #090909 0%, #070707 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    flex-shrink: 0;
    position: relative;
}

.left-panel-mode-rail-spacer {
    margin-top: auto;
}

.left-panel-mode-btn {
    width: 100%;
    height: 28px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
}

.left-panel-mode-btn:hover {
    color: #b9b9b9;
    background: rgba(255, 255, 255, 0.035);
}

.left-panel-mode-btn.active {
    color: #f2f2f2;
    background: rgba(255, 255, 255, 0.045);
}

.left-panel-mode-btn.active::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    border-radius: 2px;
    background: rgba(250, 204, 21, 0.9);
}

.left-panel-mode-btn:focus-visible {
    outline: 2px solid rgba(250, 204, 21, 0.55);
    outline-offset: 1px;
}

.left-panel-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    min-height: 0;
    height: 100%;
    position: relative;
    --mm-stack-gap: 8px;
    --mm-section-pad-x: 8px;
    --mm-section-pad-y: 8px;
}

.left-panel-main .loaded-model-section,
.left-panel-main .model-manager-content,
.left-panel-main .model-manager-footer {
    transition: opacity 0.14s ease, filter 0.14s ease;
}

.left-panel-main.filter-menu-open .loaded-model-section,
.left-panel-main.filter-menu-open .model-manager-content,
.left-panel-main.filter-menu-open .model-manager-footer {
    opacity: 0.48;
    filter: saturate(0.72) brightness(0.9);
    pointer-events: none;
}

.model-manager-header {
    padding: 12px 15px;
    border-bottom: none;
    background: #0a0a0a;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.model-manager-header.experience-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    gap: 4px;
}

.experience-subtitle {
    font-size: 0.75rem;
    color: #b8b8b8;
    letter-spacing: 0.18px;
}

.left-panel-header-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.left-panel-filter-btn {
    border: 1px solid #2a2a2a;
    background: #111;
    color: #777;
    font-size: 0.62rem;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.15s ease, color 0.15s ease;
}

.left-panel-filter-btn:hover {
    color: #aaa;
    border-color: #3a3a3a;
}

.left-panel-filter-drawer {
    border-bottom: none;
    background: #0a0a0a;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--mm-stack-gap);
}

.left-panel-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.left-panel-filter-select {
    background: #111;
    border: 1px solid #2a2a2a;
    color: #ccc;
    font-size: 0.66rem;
    border-radius: 4px;
    padding: 4px 6px;
    min-width: 110px;
}

.model-manager-header h3 {
    margin: 0;
    font-size: 0.75rem;
    color: #747474;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.organization-toggle {
    display: flex;
    gap: 4px;
    background: #0a0a0a;
    border-radius: 6px;
    padding: 3px;
}

.toggle-button {
    flex: 1;
    padding: 5px 8px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.toggle-button:hover {
    color: #888;
    background: rgba(255, 255, 255, 0.05);
}

.toggle-button.active {
    background: #1a1a1a;
    color: #fff;
}

.toggle-button:focus {
    outline: none;
}

.model-search {
    width: 100%;
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.model-search .model-search-input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.left-panel-inline-filter-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #757575;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.left-panel-inline-filter-btn:hover {
    color: #bcbcbc;
    background: rgba(255, 255, 255, 0.06);
}

.left-panel-inline-filter-btn.active {
    color: #f1f1f1;
    background: rgba(255, 255, 255, 0.16);
}

.left-panel-filter-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 170px;
    padding: 7px 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    background: rgba(10, 10, 10, 0.96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.38), 0 14px 28px rgba(0, 0, 0, 0.46);
    z-index: 40;
    animation: filter-popover-in 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes filter-popover-in {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.model-filter-popover {
    display: grid;
    gap: 10px;
    min-width: 220px;
}

.marketplace-filter-list {
    display: grid;
    gap: 3px;
}

.marketplace-filter-option {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    color: #c2c2c2;
    text-align: left;
    border-radius: 4px;
    font-size: 0.68rem;
    padding: 6px 7px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.marketplace-filter-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f2f2f2;
}

.marketplace-filter-option.active {
    border-color: rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.075);
    color: #ffffff;
}

.model-filter-popover .organization-toggle {
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.model-filter-popover .toggle-button {
    font-size: 0.63rem;
    padding: 5px 7px;
}

.model-filter-popover .toggle-switch-label {
    justify-content: space-between;
    gap: 10px;
}

.model-filter-popover .toggle-label-text {
    color: #7e7e7e;
    letter-spacing: 0.3px;
}

.model-search-input {
    width: 100%;
    padding: 8px 12px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    outline: none;
}

.model-search-input::placeholder {
    color: #666;
}

.model-search-input:focus {
    border-color: #333;
    background: #0f0f0f;
}

.model-search-input:hover {
    border-color: #2a2a2a;
}

/* Loaded Model Section */
.loaded-model-section {
    padding: 12px 15px;
    background: #0d0d0d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.loaded-model-section.widget {
    margin: var(--mm-stack-gap) 0 0;
    padding: var(--mm-section-pad-y) var(--mm-section-pad-x);
    border-radius: 0;
    border: none;
    background: #0a0a0a;
    flex-shrink: 0;
}

.available-models-section.widget {
    margin: var(--mm-stack-gap) 0 0;
    padding: var(--mm-section-pad-y) var(--mm-section-pad-x) 6px;
    border-radius: 0;
    border: none;
    background: #0a0a0a;
}

.hf-search-section.widget {
    margin: var(--mm-stack-gap) 0 0;
    padding: var(--mm-section-pad-y) var(--mm-section-pad-x) 6px;
    border-radius: 0;
    border: none;
    background: #0a0a0a;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.hf-search-spinner {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-top-color: #888;
    border-radius: 50%;
    animation: hf-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

.hf-search-message {
    font-size: 0.68rem;
    color: #555;
    padding: 4px 0;
}

.hf-model-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 4px 8px 4px 12px;
    border-left: 2px solid transparent;
    transition: background-color 0.15s ease;
}

.hf-model-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: #444;
}

.hf-model-left {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 70%;
    min-width: 0;
    overflow: hidden;
}

.hf-model-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex: 0 0 30%;
}

.hf-model-name {
    font-size: 0.65rem;
    color: #d0d0d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.hf-model-meta {
    font-size: 0.6rem;
    color: #555;
    flex-shrink: 0;
    white-space: nowrap;
}

.hf-model-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.hf-model-item:hover .hf-model-actions {
    opacity: 1;
}

.hf-backend-badge {
    font-size: 0.58rem;
    color: #888;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    padding: 1px 5px;
    letter-spacing: 0.2px;
    flex-shrink: 0;
}

.hf-quant-select {
    font-size: 0.62rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: #aaa;
    padding: 1px 4px;
    cursor: pointer;
    max-width: 90px;
}

.hf-quant-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
}

.hf-model-size {
    font-size: 0.62rem;
    color: #555;
    flex-shrink: 0;
}

.hf-unsupported {
    font-size: 0.62rem;
    color: #444;
    font-style: italic;
}

.available-models-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.loaded-model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.loaded-model-count-pill {
    font-size: 0.57rem;
    color: #a9a9a9;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.loaded-model-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    padding-bottom: 0;
}

.loaded-model-empty {
    color: #666;
    font-size: 0.68rem;
}

.loaded-model-label {
    font-size: 0.55rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.loaded-model-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    border-radius: 5px;
    padding: 2px 2px 2px 1px;
    transition: background-color 0.15s ease;
}

.loaded-model-info:hover {
    background: rgba(255, 255, 255, 0.03);
}

.loaded-experience-group {
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.015);
    border-radius: 7px;
}

.loaded-experience-group:hover {
    background: rgba(255, 255, 255, 0.03);
}

.model-manager.experience-mode .loaded-model-section {
    margin-top: 10px;
}

.model-manager.experience-mode .loaded-experience-group {
    border-color: rgba(200, 171, 106, 0.22);
    background: linear-gradient(130deg, rgba(200, 171, 106, 0.08), rgba(255, 255, 255, 0.01));
}

.model-manager.experience-mode .loaded-experience-group:hover {
    background: linear-gradient(130deg, rgba(200, 171, 106, 0.11), rgba(255, 255, 255, 0.02));
}

.loaded-experience-details {
    grid-template-columns: 12px minmax(0, 1fr);
}

.loaded-experience-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.loaded-experience-components {
    font-size: 0.62rem;
    color: #8f8f8f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loaded-model-details {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding-left: 8px;
}

.loaded-model-indicator {
    color: #4ade80;
    font-size: 0.8rem;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 2px #4ade80);
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 4px #4ade80);
    }
}

.loaded-model-name {
    font-size: 0.78rem;
    color: #fff;
    font-weight: 550;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-model-eject-button svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.downloaded-filter {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 15px;
    background: #0a0a0a;
}

.toggle-switch-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.toggle-label-text {
    font-size: 0.55rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.toggle-switch {
    position: relative;
    width: 24px;
    height: 12px;
}

.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: #333;
    transition: 0.3s;
    border-radius: 12px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 8px;
    width: 8px;
    left: 2px;
    bottom: 2px;
    background-color: #666;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #555;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(12px);
    background-color: #ffffff;
}

.toggle-switch:hover .toggle-slider {
    background-color: #3a3a3a;
}

.toggle-switch input:checked:hover + .toggle-slider {
    background-color: #666;
}

.model-manager-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--mm-stack-gap) 0 8px;
}

.model-category {
    margin-bottom: 4px;
}

.model-category-header {
    display: flex;
    align-items: center;
    padding: 4px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 0.7rem;
    color: #ccc;
    transition: background-color 0.15s ease;
}

.model-category-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.experience-category-header {
    background: transparent;
    border-left: 1px solid rgba(207, 162, 76, 0.18);
}

.experience-category-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.category-label-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.category-subtitle {
    font-size: 0.6rem;
    color: #9d9d9d;
    letter-spacing: 0.2px;
    margin-top: 1px;
    text-transform: none;
}

.model-category-header.static {
    cursor: default;
}

.model-category-header.static:hover {
    background: transparent;
}

.model-context-menu {
    position: absolute;
    background: #0a0a0a;
}
.model-context-menu > ul {
    list-style-type: none;
}

.model-context-menu-item {
    padding: 10px;
    cursor: pointer;
    border: 2px solid #0a0a0a;
}

.model-context-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-top-color: #666;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.model-options-content {
    padding: 12px 16px 24px 24px;
    overflow-y: scroll;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    max-height: calc(80vh - 140px);
    /* Override global scrollbar hiding */
    scrollbar-width: thin;
    scrollbar-color: #555 #252525;
    -ms-overflow-style: auto;
}

.model-options-category-header {
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
}

.model-options-category-header a {
    color: inherit;
    text-decoration: none;
}

.model-options-category-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #aaa;
    letter-spacing: 0.5px;
}

.model-options-category-header h5 {
    margin-top: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #aaa;
    letter-spacing: 0.5px;
}

.model-options-field-label {
    text-transform: uppercase;
}

.model-options-field-value {
    text-transform: none;
}

.model-options-category-header .model-options-checkpoint-link {
    color: #75abd7;
    text-decoration: none;
    cursor: pointer;
}

.model-options-category-header .model-options-checkpoint-link:hover {
    color: #96c5e9;
    text-decoration: none;
}

.model-options-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.model-options-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-chevron {
    font-size: 0.56rem;
    margin-right: 6px;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    line-height: 1;
    transform: translateX(-4px);
    color: #f2f2f2;
}

.category-chevron.expanded {
    transform: translateX(-4px) rotate(90deg);
}

.category-label {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.category-count {
    margin-left: 4px;
    color: #7a7a7a;
    font-size: 0.65rem;
}

.model-list {
    padding-left: 4px;
}

.model-item {
    --catalog-status-indicator-width: 10px;
    padding: 2px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-left: 2px solid transparent;
    min-height: 24px;
}

.model-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: #666;
}

.model-family-group {
    margin: 0;
}

.model-family-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 13px;
    cursor: pointer;
    user-select: none;
}

.model-family-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.family-chevron {
    font-size: 0.56rem;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    line-height: 1;
    color: #f2f2f2;
    flex-shrink: 0;
}

.family-chevron.expanded {
    transform: rotate(90deg);
}

.model-family-members-list {
    padding-left: 6px;
}

.model-family-member-row {
    padding-left: 28px;
}

.model-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    overflow: hidden;
    min-height: 18px;
}

.model-actions {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
    align-items: center;
    flex-shrink: 0;
}

.model-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: #575757;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s ease;
    padding: 0;
}

.model-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #bfbfbf;
}

.model-action-btn.download-btn:hover {
    color: #4CAF50;
}

.model-action-btn.update-btn:hover {
    color: #ffb74d;
}

.model-action-btn.load-btn:hover {
    color: #2196F3;
}

.model-action-btn.unload-btn:hover {
    color: #FF9800;
}

.model-action-btn.delete-btn:hover {
    color: #F44336;
}

.model-info-left {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.model-name {
    font-size: 0.74rem;
    color: #fff;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    display: block;
    cursor: default;
    min-width: 0;
    white-space: nowrap;
}

.family-model-name {
    font-weight: 560;
    color: #f1f1f1;
}

.model-status-indicator {
    font-size: 0.72rem;
    line-height: 1;
    flex-shrink: 0;
    justify-self: center;
}

.model-catalog-item .model-status-indicator {
    width: var(--catalog-status-indicator-width);
    text-align: center;
}

/* Model is currently loaded (green) */
.model-status-indicator.loaded {
    color: #4CAF50;
    filter: drop-shadow(0 0 2px rgba(74, 222, 128, 0.65));
}

/* Model is available locally but not loaded (white) */
.model-status-indicator.available {
    color: #ffffff;
}

/* Model is not downloaded (gray) */
.model-status-indicator.not-downloaded {
    color: #444;
}

.model-status-indicator.update-required {
    color: #ffb74d;
    filter: drop-shadow(0 0 2px rgba(255, 183, 77, 0.5));
}

.model-status-indicator.unsupported {
    color: #f44336;
}

/* Model is loading (pulsing animation) */
.model-status-indicator.loading {
    color: #4CAF50;
    animation: pulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 2px rgba(74, 222, 128, 0.65));
}

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

.model-size {
    font-size: 0.6rem;
    color: #565656;
    flex-shrink: 0;
    white-space: nowrap;
}

.model-label {
    opacity: 0.82;
}

.model-catalog-item .model-actions {
    justify-content: flex-end;
}

.model-catalog-item .model-info-left {
    width: auto;
}

.model-labels {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
    margin-left: auto;
    padding-right: 2px;
}

.model-label {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    cursor: help;
}

.model-label.label-reasoning {
    background: #6495ED;
}

.model-label.label-coding {
    background: #48BB78;
}

.model-label.label-vision {
    background: #9F7AEA;
}

.model-label.label-hot {
    background: #F56565;
}

.model-label.label-embeddings {
    background: #ED8936;
}

.model-label.label-reranking {
    background: #D69E2E;
}

.model-label.label-tool-calling {
    background: #38B2AC;
}

.model-label.label-custom {
    background: #FAD02C;
}

.model-label.label-experience {
    width: 7px;
    height: 7px;
    border-radius: 1px;
    transform: rotate(45deg);
    background: #e2b757;
    box-shadow: 0 0 2px rgba(226, 183, 87, 0.45);
}

.model-manager-footer {
    border-top: 1px solid #1a1a1a;
    background: #000000;
    flex-shrink: 0;
    padding: 12px 15px;
}

.left-panel-empty-state {
    color: #777;
    font-size: 0.72rem;
    padding: 12px 14px;
}

.left-panel-row-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 0 8px;
}

.left-panel-row-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-left: 2px solid transparent;
    border-radius: 6px;
}

.left-panel-row-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-left-color: #666;
}

.left-panel-row-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.left-panel-row-text {
    min-width: 0;
    flex: 1;
}

.left-panel-row-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #f0f0f0;
    font-size: 0.8rem;
    line-height: 1.3;
    font-weight: 500;
}

.left-panel-row-meta {
    color: #9a9a9a;
    font-size: 0.69rem;
    line-height: 1.45;
    margin-top: 3px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.left-panel-row-badge {
    border: 1px solid #3a3a3a;
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 0.55rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.25px;
}

.left-panel-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-top: 1px;
}

.left-panel-app-icon-wrap {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
}

.left-panel-app-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.left-panel-app-fallback {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 1px solid #2a2a2a;
    background: #151515;
    color: #888;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 600;
}

.marketplace-app-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.045);
    background: rgba(255, 255, 255, 0.012);
    border-left: 2px solid transparent;
}

.marketplace-app-card:hover {
    border-color: rgba(255, 255, 255, 0.06);
    border-left-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.016);
}

.marketplace-app-main {
    align-items: flex-start;
    gap: 10px;
}

.marketplace-app-content {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.marketplace-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.marketplace-app-title {
    line-height: 1.25;
    min-width: 0;
}

.marketplace-app-description {
    white-space: normal;
    overflow: visible;
    margin-top: 0;
    line-height: 1.45;
}

.marketplace-app-categories {
    color: #8b8b8b;
    font-size: 0.6rem;
    line-height: 1.2;
    letter-spacing: 0.35px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.marketplace-app-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding-top: 0;
    border-top: none;
}

.left-panel-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid #303030;
    border-radius: 4px;
    background: #101010;
    color: #bdbdbd;
    cursor: pointer;
    font-size: 0.62rem;
    line-height: 1;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.left-panel-link-btn:hover {
    color: #f2f2f2;
    border-color: #444;
    background: #181818;
}

.left-panel-link-btn.primary {
    border-color: #444;
    color: #efefef;
    background: rgba(255, 255, 255, 0.08);
}

.left-panel-link-btn.primary:hover {
    color: #ffffff;
    border-color: #5a5a5a;
    background: rgba(255, 255, 255, 0.15);
}

.backend-row-item {
    padding-top: 2px;
    padding-bottom: 2px;
}

.backend-row-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: normal;
}

.backend-row-head {
    display: flex;
    align-items: baseline;
    gap: 9px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.backend-name {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 0.74rem;
    line-height: 1.2;
    white-space: nowrap;
    min-width: max-content;
    flex-shrink: 0;
}

.backend-name .model-status-indicator {
    transform: translateY(-0.5px);
}

.backend-inline-meta {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
}

.backend-status-message {
    margin-left: 14px;
    color: #777;
    font-size: 0.62rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.backend-inline-meta .backend-version,
.backend-inline-meta .backend-size {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Backend setup banner in Model Manager (install/upgrade prompt) */
.backend-setup-banner {
    margin: 2px 0 4px;
    border-left-color: rgba(255, 183, 77, 0.45);
}

.backend-setup-actions {
    display: inline-flex;
}

.backend-meta-separator {
    color: #525252;
    font-size: 0.6rem;
}

.add-model-buttons-container {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  height: max-content;
  box-sizing: border-box;
  gap: 6px;
}

.add-model-button {
    width: 100%;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #888;
    font-size: 0.65rem;
    font-weight: 400;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.add-model-button:hover {
    background: #1a1a1a;
    border-color: #3a3a3a;
    color: #aaa;
}

.add-model-button:focus {
    outline: none;
    border-color: #3a3a3a;
}

.add-model-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.7rem;
    color: #ccc;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label-secondary {
    font-size: 0.65rem;
    color: #999;
    font-weight: 400;
    margin-top: 8px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-icon {
    font-size: 0.6rem;
    color: #666;
    cursor: help;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.input-with-prefix:focus-within {
    border-color: #4a4a4a;
    background: #1f1f1f;
}

.input-prefix {
    padding: 6px 0 6px 8px;
    color: #888;
    font-size: 0.7rem;
    user-select: none;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    right: 8px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0.6;
}

.form-input {
    padding: 6px 8px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #fff;
    font-size: 0.7rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 100%;
}

.form-input.with-prefix {
    border: none;
    background: transparent;
    flex: 1;
    padding: 6px 8px 6px 0;
}

.form-input.with-prefix:focus {
    outline: none;
    background: transparent;
}

.form-input:focus {
    outline: none;
    border-color: #4a4a4a;
    background: #1f1f1f;
}

.form-input::placeholder, .form-combobox::placeholder {
    color: #666;
}

.form-input:disabled, .form-combobox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #1a1a1a;
}

input::-webkit-calendar-picker-indicator {
  opacity: 0;
}

.form-combobox-container {
  position: relative;
  width: 100%;
  height: max-content;
}

.form-combobox {
  padding: 6px 8px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #ccc;
  font-size: 0.7rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  box-sizing: border-box;
  outline: none;
}

.combobox-input-selected {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
    color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.combobox-default {
  opacity: .65;
}

.form-combobox:-webkit-autofill,
.form-combobox:-webkit-autofill:hover,
.form-combobox:-webkit-autofill:focus {
  -webkit-transition-delay: 9999s;
  transition-delay: 9999s;
}

.form-combobox:focus {
  outline: none;
  border-color: #4a4a4a;
  background: #1f1f1f;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: #fff;
}

.form-datalist {
  position: absolute;
  left: 0;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 6px;
  z-index: 10200;
  display: flex;
  list-style: none;
  font-size: .7rem;
  backdrop-filter: blur(10px);
  width: 100%;
  height: fit-content;
  min-height: 30px;
  max-height: 134px;
  padding: 6px;
  box-sizing: border-box;
  cursor: pointer;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

.form-datalist-top {
  bottom: 32px;
  flex-direction: column-reverse;
}

.form-datalist-bottom {
  top: 32px;
  flex-direction: column;
}

.form-datalist::-webkit-scrollbar {
    width: 4px;
}

.form-datalist::-webkit-scrollbar-track {
    background: transparent;
}

.form-datalist::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.form-datalist-option {
    padding: 4px 8px;
    font-size: 0.75rem;
    color: #ccc;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 22px;
}

.form-datalist-option:hover {
    background: #2a2a2a;
    color: #fff;
}

.form-datalist-option.selected {
    color: #fff;
    background: #2e2e2e;
}

.form-datalist-option.highlighted {
    background: #2a2a2a;
    color: #fff;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.form-select:focus {
    border-color: #4a4a4a;
}

.form-select option {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 8px;
}

.form-subsection {
    margin-top: 8px;
    padding-left: 8px;
}

.form-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-top: 12px;
    padding-left: 8px;
}

.checkbox-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: #ccc;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #4a4a4a;
}

.checkbox-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.checkbox-label:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-label span {
    user-select: none;
}

.checkbox-desc {
    margin: 0;
    padding-left: 22px;
    font-size: 0.62rem;
    color: #666;
    line-height: 1.4;
}

.checkbox-desc code {
    font-family: monospace;
    font-size: 0.6rem;
    color: #888;
    background: #1e1e1e;
    padding: 1px 3px;
    border-radius: 3px;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.install-button {
    flex: 1;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #888;
    font-size: 0.65rem;
    font-weight: 400;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.install-button:hover {
    background: #1a1a1a;
    border-color: #3a3a3a;
    color: #aaa;
}

.install-button:focus {
    outline: none;
    border-color: #3a3a3a;
}

.install-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #2a2a2a;
    color: #555;
}

.install-button:disabled:hover {
    background: transparent;
    border-color: #2a2a2a;
    color: #555;
}

.cancel-button {
    flex: 1;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #777;
    font-size: 0.65rem;
    font-weight: 400;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cancel-button:hover {
    background: #1a1a1a;
    border-color: #3a3a3a;
    color: #999;
}

.cancel-button:focus {
    outline: none;
    border-color: #3a3a3a;
}

.cancel-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cancel-button:disabled:hover {
    background: transparent;
    border-color: #2a2a2a;
    color: #777;
}

/* Chat Window Styles */
.chat-window {
    background: #0a0a0a;
    border-left: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 0 1 auto;
    position: relative;
    contain: layout;
    min-width: 290px;
}

/* When chat has explicit width (center panel visible), keep fixed basis but allow shrink */
.chat-window[style*="width"] {
    flex: 0 1 auto;
    max-width: 100%;
}

/* When chat has no explicit width (center panel hidden), take any remaining space */
.chat-window:not([style*="width"]) {
    flex: 1 1 auto;
}

.experience-topbar {
    position: absolute;
    left: 22px;
    right: 22px;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding-top: 12px;
    pointer-events: auto;
}

.experience-topbar-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    pointer-events: auto;
    position: relative;
    max-width: calc(100% - 34px);
}

.experience-model-name {
    font-size: 0.82rem;
    color: #a7a7a7;
    font-weight: 500;
    letter-spacing: 0.1px;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

.experience-topbar-left .model-action-btn {
    pointer-events: none;
    border-radius: 999px;
    color: #8f8f8f;
    opacity: 0;
    visibility: hidden;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    transition: opacity 0.14s ease, visibility 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.chat-window-experience-mode .experience-topbar:hover .model-action-btn,
.chat-window-experience-mode .experience-topbar:focus-within .model-action-btn {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.experience-topbar-left .model-action-btn:hover:not(:disabled) {
    color: #ff9800;
    background: rgba(255, 255, 255, 0.06);
}

.experience-topbar-left .model-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.experience-refresh-button {
    border: none;
    background: transparent;
    color: #8a8a8a;
    padding: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: color 0.14s ease, transform 0.14s ease;
}

.experience-refresh-button:hover:not(:disabled) {
    color: #c1c1c1;
}

.experience-refresh-button:active:not(:disabled) {
    transform: scale(0.94);
}

.experience-refresh-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-header {
    padding: 12px 15px;
    border-bottom: 1px solid #1a1a1a;
    background: #000000;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.add-model-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.add-model-modal {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    width: 440px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.chat-window-experience .chat-header {
    background: linear-gradient(90deg, rgba(207, 162, 76, 0.08), rgba(0, 0, 0, 0.96) 40%);
    border-bottom-color: rgba(207, 162, 76, 0.2);
}

.chat-experience-badge {
    margin-left: auto;
    margin-right: 8px;
    font-size: 0.55rem;
    letter-spacing: 0.45px;
    text-transform: uppercase;
    color: #c8ab6a;
    border: 1px solid rgba(200, 171, 106, 0.28);
    background: rgba(200, 171, 106, 0.07);
    border-radius: 999px;
    padding: 3px 7px;
}

.chat-header h3 {
    margin: 0;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.new-chat-button {
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #888;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.new-chat-button:hover:not(:disabled) {
    background: #1a1a1a;
    border-color: #3a3a3a;
    color: #aaa;
}

.new-chat-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.model-selector-custom {
    position: relative;
    flex-shrink: 0;
    max-width: 180px;
}

.model-selector-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid #333;
    border-radius: 6px;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 3px 8px;
    max-width: 180px;
    width: 100%;
    text-align: left;
    transition: border-color 0.15s, color 0.15s;
}

.model-selector-trigger:hover {
    border-color: #555;
    color: #aaa;
}

.model-selector-trigger:focus {
    outline: none;
    border-color: #666;
    color: #fff;
}

.model-selector-trigger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.model-selector-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-selector-chevron {
    flex-shrink: 0;
    color: currentColor;
}

.model-selector-dropdown {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 6px;
    z-index: 100;
    padding: 3px 3px 0;
    display: flex;
    flex-direction: column;
}

.model-selector-list {
    max-height: calc(8 * 30px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

.model-selector-list::-webkit-scrollbar {
    width: 4px;
}

.model-selector-list::-webkit-scrollbar-track {
    background: transparent;
}

.model-selector-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.model-selector-empty {
    padding: 6px 8px;
    font-size: 0.72rem;
    color: #555;
}

.model-selector-search-bar {
    padding: 4px 2px 4px;
    border-top: 1px solid #2a2a2a;
    margin-top: 2px;
}

.model-selector-search {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ccc;
    font-size: 0.72rem;
    padding: 2px 6px;
    box-sizing: border-box;
}

.model-selector-search::placeholder {
    color: #444;
}

.model-selector-option {
    padding: 4px 8px;
    font-size: 0.75rem;
    color: #ccc;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 22px;
}

.model-selector-option:hover {
    background: #2a2a2a;
    color: #fff;
}

.model-selector-option.selected {
    color: #fff;
    background: #2e2e2e;
}

.model-selector-option.highlighted {
    background: #2a2a2a;
    color: #fff;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    contain: layout style;
    gap: 12px;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

.chat-empty-logo {
    width: 60px;
    height: 60px;
    opacity: 0.3;
    filter: grayscale(100%);
}

.chat-empty-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #666;
    margin: 0;
}

.chat-message {
    max-width: 90%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 0.9rem;
    position: relative;
}

.user-message {
    align-self: flex-end;
    background: transparent;
    border: 1px solid #555;
    border-radius: 12px;
    padding: 10px 14px;
    color: #ffffff;
}

.assistant-message {
    align-self: flex-start;
    color: #cccccc;
    padding: 4px 0;
}

.message-play-button-container {
    position: absolute;
    bottom: -8px;
    right: -8px;
    z-index: 22;
}

.message-play-button {
    background-color: #ffffff;
    border: none;
    border-radius: 6px;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.message-play-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.chat-input-container {
    padding: 12px 15px;
    border-top: 1px solid #1a1a1a;
    background: #000000;
    flex-shrink: 0;
}

.chat-input-voice-selector {
  padding: 8px 0;
  box-sizing: border-box;
}

.chat-input-wrapper {
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 10px 8px 12px;
    transition: border-color 0.2s ease;
    gap: 8px;
}

.chat-input-wrapper:focus-within {
    border-color: #555;
}

/* LLM view: soften the input area into the chat background */
.chat-window-llm .chat-input-container {
    padding: 20px 15px 14px;
    border-top: none;
    background: linear-gradient(
        180deg,
        rgba(10, 10, 10, 0) 0%,
        rgba(8, 8, 8, 0.72) 45%,
        #000000 100%
    );
}

.chat-window-llm .chat-input-wrapper {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid #2a2a2a;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.chat-window-llm .chat-input-wrapper:focus-within {
    border-color: #4a4a4a;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.chat-window-llm.chat-window-experience .chat-input-wrapper {
    border-color: rgba(200, 171, 106, 0.26);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(200, 171, 106, 0.08);
}

.chat-window-llm.chat-window-experience .chat-input-wrapper:focus-within {
    border-color: rgba(220, 187, 113, 0.42);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(220, 187, 113, 0.14);
}

.chat-window-experience-mode.chat-window-llm {
    /* Experience tokens: tweak these first for layout tuning */
    --experience-content-gutter: 16px;
    --experience-topbar-height: 62px;
    --experience-bottom-gradient-height: 240px;
    --experience-composer-width: min(920px, 66.666%);
    --experience-composer-height: auto;
    --experience-composer-radius: 8px;
    --experience-composer-side-padding: 10px;
    --experience-composer-left-padding: 16px;
    --experience-composer-send-reserved-space: 52px;
    --experience-composer-action-inset: 10px;
    --experience-composer-action-size: 30px;
    --experience-composer-media-action-size: 34px;
    --experience-composer-text-base-inset: 56px;
    --experience-composer-text-offset-x: -10px; /* Input text shift */
    --experience-placeholder-offset-x: 0px; /* Input hint (placeholder) shift */
    --experience-empty-message-max-width: 900px;
    position: relative;
    overflow: hidden;
}

/* Experience: composer shell */
.chat-window-experience-mode.chat-window-llm .chat-input-wrapper {
    width: var(--experience-composer-width);
    min-height: var(--experience-composer-height);
    border-radius: var(--experience-composer-radius);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    background: rgba(28, 28, 28, 0.86);
    padding: var(--experience-composer-side-padding) var(--experience-composer-send-reserved-space) var(--experience-composer-side-padding) var(--experience-composer-left-padding);
    position: relative;
    gap: 0;
    justify-content: center;
}

/* Experience: bottom vignette */
.chat-window-experience-mode.chat-window-llm::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--experience-bottom-gradient-height);
    background: linear-gradient(
        180deg,
        rgba(10, 10, 10, 0) 0%,
        rgba(8, 8, 8, 0.72) 45%,
        #000000 100%
    );
    pointer-events: none;
    z-index: 1;
}

.chat-window-experience-mode.chat-window-llm .chat-input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

/* Experience: content + composer regions */
.chat-window-experience-mode .chat-messages {
    padding-top: var(--experience-topbar-height);
    position: relative;
    z-index: 2;
}

.chat-window-experience-mode .chat-input-container {
    padding-top: 8px;
    padding-bottom: 14px;
    display: flex;
    justify-content: center;
    background: transparent;
    position: relative;
    z-index: 2;
}

.chat-window-experience-mode .chat-controls {
    position: absolute;
    left: var(--experience-composer-action-inset);
    right: var(--experience-composer-action-inset);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    justify-content: flex-end;
    /* Let textarea receive clicks through the overlay row. */
    pointer-events: none;
}

.chat-window-experience-mode .chat-controls-left {
    display: flex;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: auto;
}

.chat-window-experience-mode .chat-send-button,
.chat-window-experience-mode .chat-stop-button {
    pointer-events: auto;
    width: var(--experience-composer-action-size);
    height: var(--experience-composer-action-size);
    min-width: var(--experience-composer-action-size);
    min-height: var(--experience-composer-action-size);
    border-radius: 999px;
}

.chat-window-experience-mode .chat-mic-button {
    pointer-events: auto;
}

.chat-window-experience-mode .image-upload-button {
    width: var(--experience-composer-media-action-size);
    height: var(--experience-composer-media-action-size);
    min-width: var(--experience-composer-media-action-size);
    min-height: var(--experience-composer-media-action-size);
    border-radius: 999px;
    color: #9a9a9a;
}

.chat-window-experience-mode .image-upload-button svg {
    width: 22px;
    height: 22px;
}

.chat-window-experience-mode .chat-input {
    min-height: 22px;
    max-height: 180px;
    line-height: 1.4;
    padding: 0 0 0 calc(var(--experience-composer-text-base-inset) + var(--experience-composer-text-offset-x));
    display: block;
}

.chat-window-experience-mode .chat-input::placeholder {
    text-indent: var(--experience-placeholder-offset-x);
}

/* Experience: empty-state center message */
.experience-empty-message {
    font-size: clamp(1.2rem, 2.3vw, 1.7rem);
    color: #cfcfcf;
    font-weight: 500;
    text-align: center;
    margin-top: clamp(14vh, 17vh, 21vh);
    width: min(var(--experience-composer-width), calc(100% - (var(--experience-content-gutter) * 2)));
    max-width: var(--experience-empty-message-max-width);
    align-self: center;
    padding: 0 var(--experience-content-gutter);
    letter-spacing: 0.01em;
    line-height: 1.25;
}

.llm-chat-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.llm-chat-panel.experience-empty-chat {
    justify-content: center;
    padding-bottom: 9vh;
}

.llm-chat-panel.experience-empty-chat .chat-messages {
    flex: 0 0 auto;
    overflow: visible;
    padding-top: 0;
    padding-bottom: 16px;
}

.llm-chat-panel.experience-empty-chat .chat-empty-state {
    height: auto;
}

.llm-chat-panel.experience-empty-chat .chat-input-container {
    padding-top: 0;
    padding-bottom: 0;
}

.llm-chat-panel:not(.experience-empty-chat) .chat-input-container {
    padding-bottom: 12px;
}

.chat-input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    color: #ffffff;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    min-height: 24px;
    max-height: 200px;
    line-height: 1.4;
    overflow-y: hidden;
    box-sizing: border-box;
}

.chat-input:focus {
    outline: none;
}

.chat-input::placeholder {
    color: #666;
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.chat-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.chat-send-button {
    background: #ffffff;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000000;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-button:hover:not(:disabled) {
    background: #f0f0f0;
    transform: scale(1.05);
}

.chat-send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.chat-send-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.chat-mic-button {
    background: transparent;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #8e8e8e;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-mic-button:hover:not(:disabled):not(.recording) {
    border-color: #575757;
    color: #d0d0d0;
    background: rgba(255, 255, 255, 0.04);
}

.chat-mic-button.recording {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.chat-mic-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Chat Stop Button */
.chat-stop-button {
    background: #ffffff;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000000;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-window-experience-mode .chat-mic-button {
    width: var(--experience-composer-action-size);
    height: var(--experience-composer-action-size);
    min-width: var(--experience-composer-action-size);
    min-height: var(--experience-composer-action-size);
    border-radius: 999px;
}

.chat-stop-button:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.chat-stop-button:active {
    transform: scale(0.95);
}

/* Image Upload Button */
.image-upload-button {
    background: transparent;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #888;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.image-upload-button:hover:not(:disabled) {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.image-upload-button:active:not(:disabled) {
    transform: scale(0.95);
}

.image-upload-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Image Preview Container */
.image-preview-container {
    display: flex;
    gap: 8px;
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    border: 1px solid #333;
}

.image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove-button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.image-remove-button:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Message Images */
.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin: 8px 0;
    display: block;
    object-fit: contain;
}

.message-content-array {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 8px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #666;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Model Loading Indicator */
.model-loading-indicator {
    display: flex;
    align-items: center;
    padding: 6px 0;
    animation: modelLoadingFadeIn 0.2s ease-out;
}

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

.model-loading-text {
    font-size: 0.8rem;
    font-weight: 500;
    background: linear-gradient(
        90deg,
        #555 0%,
        #555 35%,
        #fff 50%,
        #555 65%,
        #555 100%
    );
    background-size: 300% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: modelLoadingSweep 1.5s ease-in-out infinite;
}

@keyframes modelLoadingSweep {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: 0% 0;
    }
}

/* Edit Message Styles */
.user-message.editable:hover {
    border-color: #888;
    background: rgba(255, 255, 255, 0.02);
}

.user-message.editing {
    padding: 10px 14px;
}

.edit-message-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-image-preview-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.edit-message-content {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.edit-message-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-message-input {
    background: transparent;
    border: none;
    padding: 0;
    color: #ffffff;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    min-height: 20px;
    line-height: 1.5;
    overflow: hidden;
    min-width: 100px;
    width: auto;
    field-sizing: content;
}

.edit-message-input:focus {
    outline: none;
}

.edit-send-button {
    background: #ffffff;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000000;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.edit-send-button:hover:not(:disabled) {
    background: #f0f0f0;
    transform: scale(1.05);
}

.edit-send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.edit-send-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Gray out messages below the edited one */
.chat-message.grayed-out {
    opacity: 0.3;
    pointer-events: none;
}

/* Thinking Section Styles */
.thinking-section {
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.thinking-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thinking-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.thinking-toggle svg {
    flex-shrink: 0;
}

.thinking-content {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    line-height: 1.6;
}

.thinking-content .markdown-content {
    opacity: 0.9;
}

.thinking-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.thinking-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
}

/* Markdown Styles */
.chat-message .markdown-content > *:first-child {
    margin-top: 0;
}

.chat-message .markdown-content > *:last-child {
    margin-bottom: 0;
}

.chat-message p,
.markdown-content p {
    margin: 0.5em 0;
}

.chat-message p:first-child,
.markdown-content p:first-child {
    margin-top: 0;
}

.chat-message p:last-child,
.markdown-content p:last-child {
    margin-bottom: 0;
}

/* Headers */
.chat-message h1,
.chat-message h2,
.chat-message h3,
.chat-message h4,
.chat-message h5,
.chat-message h6,
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin: 1em 0 0.5em 0;
    font-weight: 600;
    line-height: 1.25;
    color: #ffffff;
}

.chat-message h1:first-child,
.chat-message h2:first-child,
.chat-message h3:first-child,
.chat-message h4:first-child,
.chat-message h5:first-child,
.chat-message h6:first-child,
.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child,
.markdown-content h4:first-child,
.markdown-content h5:first-child,
.markdown-content h6:first-child {
    margin-top: 0;
}

.chat-message h1,
.markdown-content h1 { font-size: 1.5em; border-bottom: 1px solid #333; padding-bottom: 0.3em; }
.chat-message h2,
.markdown-content h2 { font-size: 1.3em; border-bottom: 1px solid #333; padding-bottom: 0.3em; }
.chat-message h3,
.markdown-content h3 { font-size: 1.1em; }
.chat-message h4,
.markdown-content h4 { font-size: 1em; }
.chat-message h5,
.markdown-content h5 { font-size: 0.9em; }
.chat-message h6,
.markdown-content h6 { font-size: 0.85em; color: #aaa; }

/* Code blocks */
.chat-message pre,
.markdown-content pre {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 0.8em 0;
}

.chat-message pre:first-child,
.markdown-content pre:first-child {
    margin-top: 0;
}

.chat-message pre:last-child,
.markdown-content pre:last-child {
    margin-bottom: 0;
}

.chat-message pre code,
.markdown-content pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 0.85em;
    line-height: 1.5;
    color: #e0e0e0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Code block wrapper with copy button */
.code-block-wrapper {
    position: relative;
    margin: 0.8em 0;
}

.code-block-wrapper pre {
    margin: 0;
    display: flex;
    align-items: center;
    padding-right: 3rem;
    min-height: 60px;
}

.code-copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 3px;
    cursor: pointer;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    z-index: 100;
    min-width: 44px;
    min-height: 44px;
}

.code-copy-button:hover {
    background: #3a3a3a;
    color: #fff;
}

.code-copy-button.copied {
    color: #4caf50;
    border-color: #4caf50;
}

/* Inline code */
.chat-message code.inline-code,
.chat-message :not(pre) > code,
.markdown-content :not(pre) > code {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.85em;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #ff6b6b;
}

/* Lists */
.chat-message ul,
.chat-message ol,
.markdown-content ul,
.markdown-content ol {
    margin: 0.5em 0;
    padding-left: 2em;
}

.chat-message ul,
.markdown-content ul {
    list-style-type: disc;
}

.chat-message ol,
.markdown-content ol {
    list-style-type: decimal;
}

.chat-message li,
.markdown-content li {
    margin: 0.25em 0;
}

.chat-message li > p,
.markdown-content li > p {
    margin: 0.25em 0;
}

.chat-message ul ul,
.chat-message ol ul,
.markdown-content ul ul,
.markdown-content ol ul {
    list-style-type: circle;
}

.chat-message ul ul ul,
.chat-message ol ul ul,
.chat-message ol ol ul,
.markdown-content ul ul ul,
.markdown-content ol ul ul,
.markdown-content ol ol ul {
    list-style-type: square;
}

/* Blockquotes */
.chat-message blockquote,
.markdown-content blockquote {
    border-left: 4px solid #555;
    padding-left: 1em;
    margin: 0.8em 0;
    color: #aaa;
    font-style: italic;
}

.chat-message blockquote p,
.markdown-content blockquote p {
    margin: 0.5em 0;
}

/* Links */
.chat-message a,
.markdown-content a {
    color: #4a9eff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.chat-message a:hover,
.markdown-content a:hover {
    border-bottom-color: #4a9eff;
}

/* Emphasis */
.chat-message strong,
.markdown-content strong {
    font-weight: 600;
    color: #ffffff;
}

.chat-message em,
.markdown-content em {
    font-style: italic;
}

/* Horizontal rules */
.chat-message hr,
.markdown-content hr {
    border: none;
    border-top: 1px solid #333;
    margin: 1.5em 0;
}

/* Tables */
.chat-message table,
.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.8em 0;
    font-size: 0.9em;
}

.chat-message table thead,
.markdown-content table thead {
    background: #1a1a1a;
}

.chat-message table th,
.chat-message table td,
.markdown-content table th,
.markdown-content table td {
    border: 1px solid #333;
    padding: 8px 12px;
    text-align: left;
}

.chat-message table th,
.markdown-content table th {
    font-weight: 600;
    color: #ffffff;
}

.chat-message table tr:nth-child(even),
.markdown-content table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Task lists */
.chat-message input[type="checkbox"],
.markdown-content input[type="checkbox"] {
    margin-right: 0.5em;
}

/* Images */
.chat-message img,
.markdown-content img {
    max-width: 100%;
    border-radius: 4px;
    margin: 0.5em 0;
}

/* KaTeX Math Rendering - Prevent layout shifts */
.markdown-content {
    position: relative;
    contain: layout;
}

.chat-message .katex,
.markdown-content .katex {
    font-size: 1.05em;
    max-width: 100%;
}

/* Inline math - strict containment */
.chat-message .katex-inline,
.markdown-content .katex-inline,
.chat-message span.katex,
.markdown-content span.katex {
    display: inline-block !important;
    vertical-align: middle;
    max-width: 100%;
    position: relative;
}

/* Display/block math - strict containment */
.chat-message .katex-display,
.markdown-content .katex-display {
    display: block !important;
    margin: 0.8em 0;
    text-align: center;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
}

/* Prevent any layout shifts from KaTeX internals */
.chat-message .katex-html,
.markdown-content .katex-html {
    display: inline-block;
    white-space: nowrap;
    position: relative;
}

/* Ensure KaTeX display math stays inline */
.chat-message .katex-display > .katex,
.markdown-content .katex-display > .katex {
    display: inline-block !important;
    text-align: initial;
}

/* Prevent negative margins or absolute positioning issues */
.chat-message .katex *,
.markdown-content .katex * {
    position: static;
}

.chat-message .katex .katex-html *,
.markdown-content .katex .katex-html * {
    position: relative;
}

/* Strikethrough */
.chat-message del,
.markdown-content del {
    text-decoration: line-through;
    color: #888;
}

/* Syntax Highlighting for Code Blocks */
.chat-message .hljs,
.markdown-content .hljs {
    display: block;
    overflow-x: auto;
    background: transparent;
    color: #e0e0e0;
}

.chat-message .hljs-comment,
.chat-message .hljs-quote,
.markdown-content .hljs-comment,
.markdown-content .hljs-quote {
    color: #7c7c7c;
    font-style: italic;
}

.chat-message .hljs-keyword,
.chat-message .hljs-selector-tag,
.chat-message .hljs-literal,
.chat-message .hljs-type,
.markdown-content .hljs-keyword,
.markdown-content .hljs-selector-tag,
.markdown-content .hljs-literal,
.markdown-content .hljs-type {
    color: #c792ea;
}

.chat-message .hljs-number,
.chat-message .hljs-selector-id,
.markdown-content .hljs-number,
.markdown-content .hljs-selector-id {
    color: #f78c6c;
}

.chat-message .hljs-string,
.chat-message .hljs-selector-attr,
.chat-message .hljs-selector-pseudo,
.chat-message .hljs-template-tag,
.chat-message .hljs-template-variable,
.markdown-content .hljs-string,
.markdown-content .hljs-selector-attr,
.markdown-content .hljs-selector-pseudo,
.markdown-content .hljs-template-tag,
.markdown-content .hljs-template-variable {
    color: #c3e88d;
}

.chat-message .hljs-attribute,
.chat-message .hljs-variable,
.markdown-content .hljs-attribute,
.markdown-content .hljs-variable {
    color: #82aaff;
}

.chat-message .hljs-built_in,
.chat-message .hljs-class .hljs-title,
.chat-message .hljs-title.class_,
.chat-message .hljs-title.function_,
.markdown-content .hljs-built_in,
.markdown-content .hljs-class .hljs-title,
.markdown-content .hljs-title.class_,
.markdown-content .hljs-title.function_ {
    color: #82aaff;
}

.chat-message .hljs-attr,
.chat-message .hljs-property,
.markdown-content .hljs-attr,
.markdown-content .hljs-property {
    color: #c792ea;
}

.chat-message .hljs-regexp,
.chat-message .hljs-link,
.markdown-content .hljs-regexp,
.markdown-content .hljs-link {
    color: #f07178;
}

.chat-message .hljs-symbol,
.chat-message .hljs-bullet,
.markdown-content .hljs-symbol,
.markdown-content .hljs-bullet {
    color: #89ddff;
}

.chat-message .hljs-meta,
.markdown-content .hljs-meta {
    color: #ffcb6b;
}

.chat-message .hljs-tag,
.markdown-content .hljs-tag {
    color: #f07178;
}

.chat-message .hljs-name,
.markdown-content .hljs-name {
    color: #f07178;
}

.chat-message .hljs-section,
.markdown-content .hljs-section {
    color: #82aaff;
}

.chat-message .hljs-emphasis,
.markdown-content .hljs-emphasis {
    font-style: italic;
}

.chat-message .hljs-strong,
.markdown-content .hljs-strong {
    font-weight: bold;
}

.chat-message .hljs-deletion,
.markdown-content .hljs-deletion {
    background: rgba(255, 0, 0, 0.15);
}

.chat-message .hljs-addition,
.markdown-content .hljs-addition {
    background: rgba(0, 255, 0, 0.15);
}

/* Horizontal Resizable Divider */
.resizable-divider.horizontal {
    width: 100%;
    height: 4px;
    background: transparent;
    cursor: row-resize;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.resizable-divider.horizontal:hover {
    background: rgba(255, 255, 255, 0.1);
}

.resizable-divider.horizontal:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Logs Window Styles */
.logs-window {
    background: #0a0a0a;
    border-top: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    /* When logs is the only child, it should take all available space */
    flex-grow: 1;
}

.logs-header {
    padding: 12px 15px;
    border-bottom: 1px solid #1a1a1a;
    background: #000000;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logs-header h3 {
    margin: 0;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logs-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.connection-status {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.status-connecting {
    color: #ffa500;
    background: rgba(255, 165, 0, 0.1);
}

.status-connected {
    color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.status-error {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.status-disconnected {
    color: #888;
    background: rgba(136, 136, 136, 0.1);
}

.logs-control-btn {
    font-size: 0.7rem;
    padding: 4px 10px;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logs-control-btn:hover {
    background: #2a2a2a;
    border-color: #555;
}

.logs-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    font-family: 'Courier New', monospace;
}

/* Scrollbar for logs-content - hidden by default, visible on hover */
.logs-content::-webkit-scrollbar {
    width: 7px;
    display: block;
}

.logs-content::-webkit-scrollbar-track {
    background: transparent;
}

.logs-content::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background 0.2s ease;
}

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

.logs-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar support */
.logs-content {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.logs-content:hover {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.logs-text {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #cccccc;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-line {
    padding: 2px 0;
    border-left: 2px solid transparent;
    padding-left: 8px;
}

.log-line:hover {
    background: rgba(255, 255, 255, 0.02);
    border-left-color: #555;
}

.logs-placeholder {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
}

.logs-error {
    color: #ff4444;
    font-size: 0.9rem;
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 8px;
    margin: 20px;
}

/* Settings Modal Styles */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.settings-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.settings-panel .settings-content {
    max-height: none;
    padding: 6px 0 8px;
    gap: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.settings-panel .settings-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.settings-panel .settings-footer {
    padding: 12px 16px;
    border-top: 1px solid #1a1a1a;
    background: #000000;
}

.settings-categories {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-category-content {
    padding: 4px 12px 8px;
}

.settings-panel .settings-section-container {
    gap: 8px;
}

.settings-panel .settings-section {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.015);
    padding: 10px 10px 11px;
}

.settings-panel .settings-section-default {
    opacity: 0.9;
}

.settings-panel .settings-label-row {
    gap: 10px;
}

.settings-panel .settings-description {
    color: #848484;
}

.settings-panel .settings-field-reset {
    color: #7f7f7f;
}

.settings-panel .settings-field-reset:hover:not(:disabled) {
    color: #d8d8d8;
}

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

.settings-modal {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.2s ease;
}

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

.settings-header {
    padding: 20px 24px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.settings-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.settings-close-button {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.settings-close-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.settings-content {
    padding: 24px;
    padding-right: 16px;
    overflow-y: scroll;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
    max-height: calc(80vh - 140px);
    /* Override global scrollbar hiding */
    scrollbar-width: thin;
    scrollbar-color: #555 #252525;
    -ms-overflow-style: auto;
}

/* Custom scrollbar for settings content */
.settings-content::-webkit-scrollbar {
    width: 10px;
    display: block !important;
}

.settings-content::-webkit-scrollbar-track {
    background: #252525;
    border-radius: 5px;
    margin: 4px 0;
}

.settings-content::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
    border: 2px solid #252525;
}

.settings-content::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.settings-tabs-wrapper {
  min-height: 450px;
  height: max-content;
}

.settings-tab-controls {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin: 0;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #333;
  box-sizing: border-box;
}

.settings-tab-control {
  min-width: 120px;
  padding-bottom: 8px;
  background-color: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-sizing: border-box;
}

.settings-tab-control.active {
    color: #fff;
    border-bottom: 1px solid #fff;
}

.settings-tab-content {
  padding: 15px 5px 0 5px;
  box-sizing: border-box;
}

.settings-category-header {
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
    margin-bottom: 8px;
}

.settings-category-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-section-container {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-label-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.settings-label-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
}

.settings-description {
    font-size: 0.7rem;
    color: #888;
    line-height: 1.4;
}

.settings-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.settings-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.settings-slider.slider-auto {
    opacity: 0.65;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-slider::-webkit-slider-thumb:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.settings-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.settings-slider::-moz-range-thumb:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.settings-number-input, .settings-text-input {
    width: 60px;
    padding: 5px 8px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.75rem;
    text-align: center;
    transition: all 0.2s ease;
}

.settings-number-input:focus, .settings-text-input:focus {
    outline: none;
    border-color: #555;
    background: #1a1a1a;
}

.settings-text-input {
    width: 100%;
    text-align: left;
}

.settings-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.settings-checkbox {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #ffffff;
    flex-shrink: 0;
}

.settings-checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-section-default {
    opacity: 0.65;
}

.settings-loading {
    padding: 48px 24px;
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
}

.settings-footer {
    padding: 20px 24px;
    border-top: 1px solid #333;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.settings-reset-button {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.settings-reset-button:hover {
    background: #1a1a1a;
    border-color: #555;
    color: #fff;
}

.settings-save-button {
    padding: 8px 20px;
    background: #ffffff;
    border: none;
    color: #000000;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.settings-save-button:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

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

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

.settings-field-reset {
    border: none;
    background: none;
    color: #888;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.settings-field-reset:hover:not(:disabled) {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.settings-field-reset:disabled {
    opacity: 0.4;
    cursor: default;
}

.settings-link-button {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    background: #0a0a0a;
    border: 1px solid #2f2f2f;
    border-radius: 6px;
    color: #d6d6d6;
    font-size: 0.72rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.settings-link-button:hover {
    border-color: #4a4a4a;
    color: #ffffff;
    background: #121212;
}

.settings-help-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-help-about {
    background: #101010;
    border: 1px solid #2d2d2d;
    border-radius: 6px;
    padding: 8px 10px;
}

.settings-help-about-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.settings-help-about-key {
    font-size: 0.66rem;
    color: #9a9a9a;
    text-transform: uppercase;
    letter-spacing: 0.45px;
}

.settings-help-about-value {
    font-size: 0.72rem;
    color: #ececec;
}

.settings-help-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-help-shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.72rem;
    color: #cdcdcd;
}

.settings-help-shortcut-row code {
    font-size: 0.66rem;
    color: #a8a8a8;
    background: #101010;
    border: 1px solid #2a2a2a;
    border-radius: 5px;
    padding: 2px 6px;
}

/* About Popover */
.about-popover {
    position: fixed;
    top: 48px;
    right: 20px;
    width: 320px;
    background: #111111;
    border: 1px solid #272727;
    border-radius: 14px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.8);
    padding: 18px 20px 20px;
    z-index: 1200;
    animation: aboutPopIn 0.18s ease;
    -webkit-app-region: no-drag;
}

@keyframes aboutPopIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.about-popover-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.about-popover-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.about-popover-subtitle {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: #a0a0a0;
}

.about-popover-close {
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #888888;
    padding: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.about-popover-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.about-popover-body {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
}

.about-popover-version {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #ffffff;
}

.about-popover-version span:first-child {
    letter-spacing: 0.08em;
    font-size: 0.65rem;
    color: #9f9f9f;
    text-transform: uppercase;
}

.about-popover-info-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 10px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.75rem;
}

.about-popover-info-label {
    letter-spacing: 0.08em;
    font-size: 0.65rem;
    color: #9f9f9f;
    text-transform: uppercase;
}

.about-popover-info-value {
    color: #ffffff;
    word-break: break-word;
    line-height: 1.3;
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10001;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.85rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    cursor: pointer;
    animation: toastSlideIn 0.2s ease;
    max-width: 360px;
    min-width: 280px;
}

.toast-exit {
    animation: toastSlideOut 0.2s ease forwards;
}

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

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

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Toast Types */
.toast-error {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, #1a1a1a 0%, #1f1517 100%);
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, #1a1a1a 0%, #151f17 100%);
}

.toast-success .toast-icon {
    color: #22c55e;
}

.toast-warning {
    border-color: rgba(234, 179, 8, 0.4);
    background: linear-gradient(135deg, #1a1a1a 0%, #1f1d15 100%);
}

.toast-warning .toast-icon {
    color: #eab308;
}

.toast-info {
    border-color: rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #1a1a1a 0%, #151a1f 100%);
}

.toast-info .toast-icon {
    color: #3b82f6;
}

/* Confirmation Dialog Styles */
.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeIn 0.15s ease;
}

.confirm-dialog {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.15s ease;
}

.confirm-dialog-title {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.confirm-dialog-message {
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    color: #aaa;
    line-height: 1.5;
}

.confirm-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-dialog-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.confirm-dialog-btn-cancel {
    background: transparent;
    border: 1px solid #333;
    color: #888;
}

.confirm-dialog-btn-cancel:hover {
    background: #252525;
    border-color: #444;
    color: #fff;
}

.confirm-dialog-btn-confirm {
    background: #ffffff;
    border: none;
    color: #000000;
}

.confirm-dialog-btn-confirm:hover {
    background: #f0f0f0;
}

.confirm-dialog-btn-danger {
    background: #ef4444;
    border: none;
    color: #ffffff;
}

.confirm-dialog-btn-danger:hover {
    background: #dc2626;
}

/* Download Manager Styles */
.download-manager-overlay {
    position: fixed;
    top: 32px;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 20px;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.download-manager-panel {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 500px;
    max-height: calc(100vh - 84px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.download-manager-header {
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    gap: 12px;
}

.download-manager-header h3 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #aaa;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.download-manager-stats {
    display: flex;
    gap: 12px;
    flex: 1;
    font-size: 0.7rem;
    color: #666;
}

.download-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.download-manager-close {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
    flex-shrink: 0;
}

.download-manager-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.download-manager-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    /* Override global scrollbar hiding */
    scrollbar-width: thin;
    scrollbar-color: #555 #252525;
    -ms-overflow-style: auto;
}

/* Custom scrollbar for download manager content */
.download-manager-content::-webkit-scrollbar {
    width: 10px;
    display: block !important;
}

.download-manager-content::-webkit-scrollbar-track {
    background: #252525;
    border-radius: 5px;
    margin: 4px 0;
}

.download-manager-content::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
    border: 2px solid #252525;
}

.download-manager-content::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.download-manager-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    color: #666;
    gap: 12px;
}

.download-manager-empty svg {
    opacity: 0.3;
    margin-bottom: 8px;
}

.download-manager-empty p {
    font-size: 0.9rem;
    font-weight: 500;
    color: #888;
}

.download-manager-empty-hint {
    font-size: 0.75rem;
    color: #555;
    text-align: center;
    max-width: 300px;
}

.download-list {
    display: flex;
    flex-direction: column;
}

.download-item {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.2s ease;
}

.download-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.download-item.completed {
    opacity: 0.6;
}

.download-item.error {
    background: rgba(239, 68, 68, 0.05);
}

.download-item.cancelled {
    opacity: 0.5;
}

.download-item.deleting {
    opacity: 0.6;
    background: rgba(251, 191, 36, 0.05);
}

.download-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.download-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.download-expand-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}

.download-expand-btn:hover {
    color: #999;
    background: rgba(255, 255, 255, 0.05);
}

.download-item-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.download-model-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-file-info {
    font-size: 0.7rem;
    color: #666;
}

.download-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.download-speed,
.download-eta,
.download-deleting-text {
    font-size: 0.7rem;
    color: #888;
    white-space: nowrap;
}

.download-deleting-text {
    color: #f59e0b;
    font-style: italic;
}

.download-action-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.download-action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #999;
}

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

.download-action-btn.cancel-btn:hover {
    color: #ef4444;
}

.download-action-btn.remove-btn:hover {
    color: #666;
}

.download-progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.download-progress-bar {
    flex: 1;
    height: 4px;
    background: #2a2a2a;
    border-radius: 2px;
    overflow: hidden;
}

.download-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66bb6a);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.download-progress-text {
    font-size: 0.7rem;
    color: #888;
    min-width: 35px;
    text-align: right;
}

.download-item-details {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.download-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
}

.download-detail-label {
    color: #666;
}

.download-detail-value {
    color: #aaa;
    word-break: break-all;
    text-align: right;
    max-width: 60%;
}

.download-manager-footer {
    padding: 12px 20px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.clear-completed-btn {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.clear-completed-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    border-color: #555;
}

/* Download button active state in title bar */
.title-bar-button.downloads.active {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.title-bar-button.downloads.active:hover {
    background: rgba(76, 175, 80, 0.25);
}

/* Embedding Model Styles  */
.embedding-history-item {
    margin-bottom: 16px;
}

.embedding-user-input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.embedding-input-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.embedding-input-text {
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.4;
}

.embedding-empty-state,
.reranking-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.embedding-description,
.reranking-description {
    color: #888;
    font-size: 0.75rem;
    margin-top: 8px;
}

.embedding-result {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 10px 12px;
}

.embedding-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.embedding-result-header h4 {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.embedding-dimensions-badge {
    font-size: 0.65rem;
    font-weight: 500;
    color: #888;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.embedding-vector {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.embedding-vector pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    color: #aaa;
    line-height: 1.3;
}

.embedding-preview pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    color: #aaa;
    line-height: 1.3;
}

.embedding-toggle-button {
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #888;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 8px;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.embedding-toggle-button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #333;
    color: #ccc;
}

.embedding-stats {
    display: flex;
    gap: 12px;
    justify-content: space-around;
    padding-top: 8px;
    border-top: 1px solid #1a1a1a;
}

.embedding-stats span {
    font-size: 0.65rem;
    color: #888;
    font-family: 'Courier New', monospace;
}

/* Reranking Model Styles */
.reranking-history-item {
    margin-bottom: 16px;
}

.reranking-user-input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.reranking-input-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.reranking-input-text {
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.4;
}

.reranking-result-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 10px 12px;
}

.reranking-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.reranking-result-header h4 {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.reranking-count-badge {
    font-size: 0.65rem;
    font-weight: 500;
    color: #888;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.reranking-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reranking-query-section,
.reranking-documents-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reranking-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.reranking-query {
    resize: vertical;
}

.reranking-documents {
    resize: vertical;
}

.reranking-result {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reranked-document {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 6px 8px;
    transition: all 0.15s ease;
}

.reranked-document:hover {
    border-color: #333;
    background: rgba(255, 255, 255, 0.04);
}

.reranked-rank {
    font-weight: 600;
    font-size: 0.65rem;
    color: #888;
    min-width: 18px;
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
}

.reranked-score {
    font-size: 0.65rem;
    color: #4ade80;
    font-weight: 600;
    min-width: 40px;
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
}

.reranked-document-text {
    font-size: 0.75rem;
    color: #ccc;
    line-height: 1.3;
    flex: 1;
}

/* Small typing indicator for buttons */
.typing-indicator.small {
    display: flex;
    gap: 3px;
    align-items: center;
}

.typing-indicator.small span {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    animation: typing 1s infinite;
}

.typing-indicator.small span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator.small span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator.small span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Transcription Model Styles */
.transcription-history-item {
    margin-bottom: 16px;
}

.transcription-file-info {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.transcription-label {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #aaa;
}

.transcription-result-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 10px 12px;
}

.transcription-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.transcription-result-header h4 {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.transcription-result {
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.transcription-file-display {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.transcription-file-info-display {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.transcription-file-info-display .file-name {
    color: #fff;
    font-size: 0.85rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transcription-placeholder {
    color: #666;
    font-size: 0.85rem;
}

.file-size-indicator {
    font-size: 0.75rem;
    color: #888;
    font-family: 'Courier New', monospace;
    flex-shrink: 0;
}

.audio-file-button {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    border-radius: 4px;
}

.audio-file-button:hover:not(:disabled) {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.audio-file-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Image Generation */
.image-generation-item {
    margin-bottom: 24px;
    padding: 16px;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
}

.image-prompt-display {
    margin-bottom: 12px;
    color: #888;
    font-size: 14px;
}

.prompt-label {
    font-weight: 600;
    margin-right: 8px;
    color: #666;
}

.prompt-text {
    color: #aaa;
}

.generated-images-row {
    display: flex;
    gap: 16px;
}

.generated-images-row.side-by-side {
    flex-direction: row;
    align-items: stretch;
}

.generated-images-row.side-by-side .generated-image-column {
    flex: 1;
    min-width: 0;
}

.generated-image-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.image-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.image-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.generated-image {
    max-width: 100%;
    max-height: 512px;
    border-radius: 8px;
    display: block;
}

.save-image-button {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.2s;
    white-space: nowrap;
}

.save-image-button:hover {
    background: rgba(0, 0, 0, 0.9);
}

.upscale-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    align-self: stretch;
    min-height: 200px;
    background: #111;
    border: 1px dashed #444;
    border-radius: 8px;
    color: #888;
    font-size: 13px;
}

.image-generating-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    color: #888;
}

.generating-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top-color: #888;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Image Settings Panel */
.image-settings-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    padding: 12px 16px;
    background: #0f0f0f;
    border-bottom: 1px solid #333;
}

.image-setting {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.image-setting label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.image-setting input,
.image-setting select {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    padding: 6px 8px;
    font-size: 13px;
    width: 80px;
}

.image-setting input:focus,
.image-setting select:focus {
    outline: none;
    border-color: #555;
}

.image-setting input:disabled,
.image-setting select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.image-setting input[type="number"] {
    -moz-appearance: textfield;
}

.image-setting input[type="number"]::-webkit-outer-spin-button,
.image-setting input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Image Action Buttons (below generated images) */
.image-action-buttons {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* Image Reference Upload */
.image-reference-preview {
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.image-reference-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #333;
}

.image-reference-dropzone {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px dashed #444;
    border-radius: 8px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    margin-bottom: 8px;
}

.image-reference-dropzone:hover {
    border-color: #666;
    color: #ccc;
}

/* ========================================
   Streaming Transcription Styles
   ======================================== */

/* Mic Button */
.mic-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid #333;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mic-button:hover:not(:disabled):not(.recording) {
    border-color: #555;
    color: #ccc;
}

.mic-button.recording {
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
    color: #f44336;
    animation: mic-pulse 1.5s ease-in-out infinite;
}

.mic-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* Live Recording Status */
.live-status {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #888;
}

.live-status .status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.live-status .dot.connected { background-color: #4caf50; }
.live-status .dot.connecting { background-color: #ff9800; }
.live-status .dot.speaking { background-color: #2196f3; }

.live-status .level-meter {
    height: 6px;
    background-color: #121212;
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
    max-width: 160px;
    flex: 1;
}

.live-status .level-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.08s ease-out;
}

/* Transcription Error */
.transcription-error {
    padding: 8px 12px;
    margin: 0 16px 8px;
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 4px;
    color: #f44336;
    font-size: 13px;
}

/* Status Bar Styles */
.status-bar {
    display: flex;
    align-items: center;
    height: 28px;
    background: #000000;
    border-top: 1px solid #1a1a1a;
    padding: 0 12px;
    gap: 20px;
    flex-shrink: 0;
    font-size: 12px;
    user-select: none;
}

.status-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-bar-label {
    color: #555;
    font-size: 11px;
}

.status-bar-label-short {
    display: none;
}

.status-bar-value {
    color: #888;
    font-variant-numeric: tabular-nums;
}

/* Connection status indicator styles */
.connection-indicator {
    font-size: 11px;
    line-height: 1;
    margin-right: 2px;
}

.connection-indicator.connection-connected {
    color: #4ade80; /* Green */
}

.connection-indicator.connection-connecting {
    color: #fbbf24; /* Yellow */
    animation: pulse 2s ease-in-out infinite;
}

.connection-indicator.connection-disconnected {
    color: #ef4444; /* Red */
}

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

.status-bar-connection {
    border-right: 1px solid #1a1a1a;
    padding-right: 20px;
}

@media (max-width: 1000px) {
    .status-bar {
        gap: 10px;
        padding: 0 8px;
    }

    .status-bar-item {
        gap: 4px;
    }

    .status-bar-connection {
        padding-right: 10px;
    }

    .status-bar-label-long {
        display: none;
    }

    .status-bar-label-short {
        display: inline;
    }
}

.launcher-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 11px;
    width: 100%;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    color: inherit;
    font: inherit;
}

.launcher-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-1px);
}

.launcher-card:focus-visible {
    outline: 2px solid rgba(250, 204, 21, 0.6);
    outline-offset: 1px;
}

.launcher-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.launcher-card-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.67);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 600;
}

.launcher-card-badge {
    font-size: 0.66rem;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.02);
    line-height: 1.2;
    white-space: nowrap;
}

.launcher-card-title {
    margin: 8px 0 4px;
    font-size: clamp(0.82rem, 1.5vw, 0.94rem);
    color: #f8f8f8;
    letter-spacing: 0.005em;
    font-weight: 600;
}

.launcher-card-description {
    margin: 0;
    font-size: clamp(0.68rem, 1.15vw, 0.75rem);
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.52);
    min-height: 2.2em;
}

.launcher-card-action {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(250, 204, 21, 0.85);
    font-size: 0.73rem;
    font-weight: 600;
}

.launcher-card svg {
    flex-shrink: 0;
}

.logo-wall {
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.logo-wall-label {
    display: inline-block;
    margin-bottom: 7px;
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.46);
    font-weight: 600;
}

.pinned-apps-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(6px, 1.1vw, 8px);
}

.pinned-app-item {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    border: none;
    border-radius: 0;
    min-height: clamp(26px, 4.3vw, 30px);
    padding: 0;
    cursor: default;
}

.pinned-app-item.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.pinned-app-item.empty {
    display: none;
}

.pinned-app-icon {
    width: clamp(22px, 3.2vw, 25px);
    height: clamp(22px, 3.2vw, 25px);
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: none;
    filter: saturate(0.88);
    opacity: 0.9;
}

.pinned-app-icon-skeleton {
    width: clamp(22px, 3.2vw, 25px);
    height: clamp(22px, 3.2vw, 25px);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}

.pinned-app-icon-empty {
    width: clamp(22px, 3.2vw, 25px);
    height: clamp(22px, 3.2vw, 25px);
    border-radius: 6px;
    background: transparent;
}

/* Title bar submenu styles reused outside center panel */
.menu-option.has-submenu {
    position: relative;
    display: flex;
    align-items: center;
}

.menu-option.has-submenu .submenu-arrow {
    margin-left: auto;
    color: #666;
    flex-shrink: 0;
}

.menu-option.has-submenu .menu-submenu {
    display: none;
}

.menu-option.has-submenu:hover .menu-submenu {
    display: block;
}

.menu-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 2px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    min-width: 180px;
    padding: 4px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    animation: slideRight 0.15s ease;
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.menu-option.new-model-submenu-option {
    font-size: 11.5px;
    padding: 7px 14px;
    white-space: nowrap;
}

.menu-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Backend Manager Preview (CenterPanelMenu card) */
.backend-manager-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 0;
    pointer-events: none;
}

.backend-preview-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.42);
    font-weight: 600;
}

.backend-preview-summary {
    margin: 0;
    color: rgba(255, 255, 255, 0.58);
    font-size: clamp(0.65rem, 1.1vw, 0.72rem);
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
}

@container (max-width: 760px) {
    .pinned-apps-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}


/* Backend Manager Component */
.backend-manager {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 10px 12px 12px;
    container-type: inline-size;
    background:
        radial-gradient(110% 65% at 50% 0%, rgba(252, 204, 21, 0.02) 0%, rgba(252, 204, 21, 0) 60%),
        linear-gradient(180deg, rgba(10, 10, 13, 0.84) 0%, rgba(7, 7, 10, 0.9) 100%);
}

.backend-manager-header {
    margin-bottom: 8px;
    padding: 2px 2px 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.backend-manager-header-top {
    display: flex;
    align-items: center;
    gap: 9px;
}

.backend-manager-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.04);
    color: #9e9e9e;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.backend-manager-back-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.2);
}

.backend-manager-header h3 {
    margin: 0;
    font-size: 0.82rem;
    color: #a8a8a8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.backend-manager-header p {
    font-size: 0.73rem;
    color: #858585;
    margin: 0;
}

.backend-manager-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
    grid-auto-rows: min-content;
}

.backend-manager-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
    font-size: 0.85rem;
}

.backend-recipe-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.01);
    height: 100%;
}

@container (max-width: 500px) {
    .backend-manager-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .backend-recipe-section {
        height: auto;
    }
}

.backend-recipe-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 2px 0 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.backend-recipe-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #d0d0d0;
    margin: 0;
    flex-shrink: 0;
}

.backend-recipe-desc {
    font-size: 0.67rem;
    color: #777;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.backend-cards {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.backend-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.013);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 7px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.backend-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.085);
}

.backend-card.installed {
    border-color: rgba(255, 255, 255, 0.08);
}

.backend-card-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.backend-card-title-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    line-height: 1.2;
}

.backend-card-name {
    font-weight: 600;
    color: #e3e3e3;
}

.backend-card-separator {
    color: #4f4f4f;
    font-size: 0.6rem;
}

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

.backend-status-dot.installed {
    background: #ffffff;
}

.backend-status-dot.not-installed {
    background: #444;
}

.backend-card-desc {
    display: none;
}

.backend-version {
    color: #6e6e6e;
    font-size: 0.6rem;
    line-height: 1.2;
}

.backend-version-link {
    color: #75abd7;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.6rem;
    line-height: 1.2;
    padding: 0;
    border: none;
    background: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.backend-version-link:hover {
    color: #96c5e9;
    text-decoration: none;
}

.backend-size {
    color: #626262;
    font-size: 0.6rem;
    line-height: 1.2;
}

.backend-card-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.backend-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    background: transparent;
    border: 1px solid transparent;
    color: #999;
}

.backend-action-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.12);
}

.backend-action-btn.install {
    color: #6ba3d6;
}

.backend-action-btn.install:hover {
    background: rgba(94, 147, 192, 0.16);
    color: #8bc0ed;
}

.backend-action-btn.uninstall:hover {
    background: rgba(244, 67, 54, 0.12);
    color: #f44336;
}

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

.backend-install-spinner {
    width: 10px;
    height: 10px;
    border: 2px solid rgba(107, 163, 214, 0.3);
    border-top-color: #6ba3d6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.image-timing {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}
