:root {
    --ecc-primary: #253F8E;
    --ecc-medium: #43568f;
    --ecc-light: #f0f4fc;
    --ecc-hover: #6275af;
    --ecc-dark: #0a1a49;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--ecc-light);
}

a, .btn-link {
    color: var(--ecc-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--ecc-primary);
    border-color: var(--ecc-primary);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--ecc-hover);
    border-color: var(--ecc-hover);
}

.btn-eccelerators-light {
    color: #fff;
    background-color: #43568f;
    border-color: transparent;
}

.btn-eccelerators-light:hover,
.btn-eccelerators-light:focus {
    color: #ddd;
    background-color: #6275af;
    border-color: transparent;
}

.bg-eccelerators-dark {
    background-color: var(--ecc-primary) !important;
}

.bg-eccelerators {
    background-color: var(--ecc-medium) !important;
}

.bg-eccelerators-light {
    background-color: var(--ecc-light) !important;
}

.text-eccelerators-dark {
    color: var(--ecc-dark) !important;
}

.navbar.bg-eccelerators-dark {
    min-height: 64px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar.bg-eccelerators-dark .nav-link {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s;
}

.navbar.bg-eccelerators-dark .nav-link:hover,
.navbar.bg-eccelerators-dark .nav-link.active {
    color: #fff;
    background-color: var(--ecc-hover);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--ecc-hover);
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.form-signin {
    max-width: 450px;
    padding: 1rem;
}

.form-signin .form-floating:focus-within {
    z-index: 2;
}

.form-signin .form-floating:has(input[type="email"]) {
    margin-bottom: -1px;
}

.form-signin input[type="email"] {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

.form-signin .form-floating:has(input[type="password"]) {
    margin-bottom: 10px;
}

.form-signin input[type="password"] {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* App Layout — Sidebar + Main */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 250px;
    min-width: 250px;
    height: 100vh;
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--ecc-primary);
    color: #d7d7d7;
    transition: width 0.2s ease, min-width 0.2s ease;
    overflow: hidden;
}

.sidebar-collapsed {
    width: 56px;
    min-width: 56px;
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar-collapsed .sidebar-section {
    padding: 0 0.4rem;
}

.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.6rem;
}

.sidebar-collapsed .sidebar-link svg {
    width: 22px;
    height: 22px;
}

.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    cursor: ew-resize;
    z-index: 20;
}

.sidebar-resize-handle::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0);
    transition: background 0.15s;
}

.sidebar-resize-handle:hover::after {
    background: rgba(255,255,255,0.25);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    min-height: 3.5rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    overflow: hidden;
}

.sidebar-brand img {
    width: 150px;
    height: auto;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.sidebar-account {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.sidebar-account-name {
    color: rgba(255,255,255,0.55);
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.25rem 0.75rem 0;
}

.sidebar-version {
    color: rgba(255,255,255,0.28);
    font-size: 0.65rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.15rem 0.75rem 0;
}

.admin-view-switch {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.65rem;
    margin: 0.35rem 0.35rem 0.5rem;
    border: 1px dashed rgba(248, 113, 113, 0.85);
    border-radius: 8px;
    color: rgba(254, 226, 226, 0.95);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.admin-view-switch input {
    accent-color: #ef4444;
}

.sidebar-collapsed .sidebar-account {
    padding: 0.5rem 0.4rem;
}

.sidebar-collapsed .sidebar-logout {
    justify-content: center;
    padding: 0.6rem;
}

.sidebar-section {
    padding: 0 0.75rem;
    margin-bottom: 0.25rem;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4);
    padding: 0.5rem 0.75rem 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: #d7d7d7;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.12s, color 0.12s;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.25);
    color: white;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 0.5rem 0.75rem;
}

.sidebar-sessions {
    padding: 0 0.75rem;
}

.sidebar-session {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    color: #d7d7d7;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    overflow: hidden;
    transition: background 0.12s;
}

.sidebar-session:hover {
    color: white;
}

.sidebar-session-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar-session-dot.processing {
    animation: stepperPulse 1.5s infinite;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.sidebar-session-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-session-row {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: background 0.12s;
}

.sidebar-session-row:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar-session-row.active {
    background: rgba(255,255,255,0.18);
}

.sidebar-session-row .sidebar-session {
    flex: 1;
    min-width: 0;
}

.sidebar-session-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #d7d7d7;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}

.sidebar-session-row:hover .sidebar-session-menu-btn,
.sidebar-session-row.active .sidebar-session-menu-btn {
    display: block;
}

.sidebar-session-menu-btn:hover {
    color: white;
}

.sidebar-session-menu {
    position: absolute;
    top: 100%;
    right: 0.5rem;
    z-index: 100;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    min-width: 120px;
    padding: 0.25rem;
}

.sidebar-session-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: none;
    background: none;
    color: #d7d7d7;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
}

.sidebar-session-menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-session-menu-item.danger {
    color: #f87171;
}

.sidebar-session-menu-item.danger:hover {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
}

.sidebar-session-menu-separator {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0.25rem 0.4rem;
}

.sidebar-session-rename-input {
    flex: 1;
    min-width: 0;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--ecc-primary);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.8rem;
    outline: none;
}

.status-running { background: #3b82f6; }
.status-waiting { background: #eab308; }
.status-completed { background: #22c55e; }
.status-failed { background: #ef4444; }
.status-created { background: #6b7280; }
.status-cancelled { background: #4b5563; }
.status-chat { background: #a78bfa; }

@media (prefers-reduced-motion: reduce) {
    .sidebar-session-dot.processing {
        animation: none;
    }
}

/* Session Page */
.session-page {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f7f7f8;
}

.session-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    overflow-x: auto;
}

.stepper-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.stepper-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

.stepper-done .stepper-dot {
    border-color: #22c55e;
    background: #22c55e;
    color: #fff;
}

.stepper-current .stepper-dot {
    border-color: var(--ecc-primary);
    background: #fff;
}

.stepper-stopped .stepper-dot {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.stepper-dot-stopped {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.stepper-dot-active {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ecc-primary);
    animation: stepperPulse 1.5s infinite;
}

@keyframes stepperPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.stepper-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: #6b7280;
}

.stepper-current .stepper-label {
    color: var(--ecc-primary);
    font-weight: 600;
}

.stepper-done .stepper-label {
    color: #22c55e;
}

.stepper-line {
    width: 24px;
    height: 2px;
    background: #d1d5db;
    margin: 0 0.3rem;
    flex-shrink: 0;
}

.stepper-line-done {
    background: #22c55e;
}

/* Session scroll & thread */
.session-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.session-thread {
    max-width: 768px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.session-scroll-latest-anchor {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 80;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transform: translate(-50%, -58%);
}

.session-scroll-latest-btn {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(37, 63, 142, 0.28);
    border-radius: 50%;
    background: #fff;
    color: var(--ecc-primary);
    box-shadow: 0 12px 32px rgba(17, 24, 39, 0.18), 0 0 0 4px rgba(255, 255, 255, 0.72);
    cursor: pointer;
    pointer-events: auto;
    animation: scrollLatestIn 0.16s ease-out;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.session-scroll-latest-btn:hover {
    border-color: var(--ecc-primary);
    background: #f8f7ff;
    box-shadow: 0 14px 32px rgba(42, 35, 92, 0.18);
    transform: translateY(-1px);
}

.session-scroll-latest-btn:focus-visible {
    outline: 2px solid var(--ecc-primary);
    outline-offset: 3px;
}

@keyframes scrollLatestIn {
    from {
        opacity: 0;
        transform: translateY(0.35rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .session-scroll-latest-btn {
        animation: none;
        transition: none;
    }
}

@media (max-width: 700px) {
    .session-scroll-latest-anchor {
        transform: translate(-50%, -52%);
    }

    .session-scroll-latest-btn {
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* File & command blocks */
.session-file-block {
    margin: 0.5rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.session-file-block summary {
    padding: 0.5rem 0.75rem;
    padding-right: 2.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    background: #fafafa;
}

.session-file-block summary::-webkit-details-marker {
    display: none;
}

.session-file-block summary::marker {
    content: "";
}

.session-file-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    color: #6b7280;
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.16s ease, color 0.16s ease;
}

.session-file-block[open] .session-file-arrow {
    color: var(--ecc-primary);
    transform: rotate(90deg);
}

.chat-math-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.08rem;
    padding: 0.02rem 0.18rem;
    border-radius: 4px;
    background: #f8fafc;
    color: #111827;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.35;
    white-space: nowrap;
}

.chat-math-inline sub,
.chat-math-inline sup {
    font-size: 0.7em;
    line-height: 1;
}

.session-file-block summary:hover {
    background: #f0f0f5;
}

.session-file-copy {
    position: absolute;
    top: 0.38rem;
    right: 0.55rem;
    z-index: 2;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.session-file-copy:hover,
.session-file-copy:focus-visible {
    background: #e8eefc;
    color: var(--ecc-primary);
    outline: none;
}

.session-file-copy:active {
    transform: translateY(1px);
}

.session-file-copy.copied {
    background: #dcfce7;
    color: #047857;
}

.session-file-copy-icon {
    flex: 0 0 auto;
}

.session-file-copy-icon-done,
.session-file-copy.copied .session-file-copy-icon-copy {
    display: none;
}

.session-file-copy.copied .session-file-copy-icon-done {
    display: block;
}

.session-iteration-block {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.session-iteration-block.iteration-running {
    border-color: #bfdbfe;
}

.session-iteration-block.iteration-success {
    border-color: #bbf7d0;
}

.session-iteration-block.iteration-fail {
    border-color: #fecaca;
}

.session-iteration-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 700;
}

.session-iteration-subtitle {
    margin-top: 0.7rem;
    margin-bottom: 0.35rem;
    color: #6b7280;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.session-iteration-block .session-cmd-block {
    margin: 0.45rem 0;
    background: #fff;
}

.session-cmd-placeholder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.45rem 0;
    padding: 0.5rem 0.75rem;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #9ca3af;
    font-size: 0.85rem;
}

.session-cmd-placeholder.session-stage-active,
.session-cmd-placeholder.session-stage-current {
    border-color: #f59e0b;
    background: #fffbeb;
}

.session-cmd-placeholder.session-stage-active code,
.session-cmd-placeholder.session-stage-current code {
    color: #78350f;
}

.session-stage-iteration {
    margin-left: auto;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.session-cmd-block {
    margin: 0.5rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.session-cmd-block summary {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    background: #fafafa;
}

.session-cmd-block summary::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.session-cmd-block[open] summary::before {
    transform: rotate(45deg);
}

.session-cmd-block.cmd-success summary {
    border-left: 3px solid #22c55e;
}

.session-cmd-block.cmd-fail summary {
    border-left: 3px solid #ef4444;
}

.session-cmd-block.cmd-running summary {
    border-left: 3px solid #3b82f6;
}

.session-cmd-block.cmd-stopped summary {
    border-left: 3px solid #f59e0b;
}

.session-cmd-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: auto;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-fail {
    background: #fee2e2;
    color: #991b1b;
}

.badge-running {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-stopped {
    background: #fef3c7;
    color: #92400e;
}

.badge-pending {
    background: #f3f4f6;
    color: #6b7280;
}

.session-code-block {
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 0.78rem;
    background: #1e1e2e;
    color: #cdd6f4;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    cursor: grab;
}

.session-stderr {
    color: #fbbf24;
}

.session-output-waiting {
    color: #94a3b8;
    font-style: italic;
}

/* Issues */
.session-issues {
    list-style: none;
    padding: 0;
    margin: 0;
}

.session-issues li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.85rem;
}

.issue-resolved {
    color: #6b7280;
    text-decoration: line-through;
}

.issue-open {
    color: #ef4444;
}

.session-issues-progress {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.55rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.8rem;
    font-weight: 600;
}

.session-issues-dots {
    padding: 0;
}

.session-issues-dots .chat-dot {
    width: 6px;
    height: 6px;
    background: #2563eb;
}

/* Review checklist */
.review-checklist {
    margin: 0.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.review-table thead th {
    background: #f9fafb;
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-weight: 600;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
}

.review-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
}

.review-table tbody tr:last-child {
    border-bottom: none;
}

.review-table td {
    padding: 0.4rem 0.6rem;
    vertical-align: middle;
}

.review-icon {
    width: 24px;
    text-align: center;
    font-weight: 700;
}

.review-pass .review-icon {
    color: #16a34a;
}

.review-fail .review-icon {
    color: #dc2626;
}

.review-fail td {
    background: #fef2f2;
}

.review-details {
    color: #6b7280;
    font-size: 0.78rem;
}

.review-productivity-row td {
    background: #f9fafb;
}

.review-productivity-title {
    color: #374151;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.review-productivity-title span {
    color: #9ca3af;
    font-weight: 500;
    margin-left: 0.25rem;
}

.review-productivity-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.4rem 0.75rem;
}

.review-productivity-metrics div {
    display: flex;
    flex-direction: column;
}

.review-productivity-metrics span {
    color: #6b7280;
    font-size: 0.72rem;
}

.review-productivity-metrics strong {
    color: #111827;
    font-size: 0.85rem;
}

.review-productivity-note {
    color: #6b7280;
    font-size: 0.72rem;
    margin-top: 0.4rem;
}

.review-files {
    margin-top: 0.75rem;
}

.review-files,
.review-vhdl {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fbfdff;
}

.review-files-title {
    color: #374151;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.review-vhdl-empty,
.review-vhdl-more {
    color: #6b7280;
    font-size: 0.78rem;
}

.review-vhdl-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.45rem 0.75rem;
    margin-bottom: 0.65rem;
}

.review-vhdl-metrics div {
    display: flex;
    flex-direction: column;
    padding: 0.55rem 0.65rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.review-vhdl-metrics span {
    color: #6b7280;
    font-size: 0.72rem;
}

.review-vhdl-metrics strong {
    color: #111827;
    font-size: 0.92rem;
}

.review-vhdl-browser {
    display: grid;
    gap: 0.35rem;
}

.review-vhdl-library {
    margin-top: 0.65rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.review-vhdl-library > summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 600;
}

.review-vhdl-library > summary::-webkit-details-marker {
    display: none;
}

.review-vhdl-library > summary::marker {
    content: "";
}

.review-vhdl-library > summary small {
    color: #6b7280;
    font-size: 0.74rem;
    font-weight: 400;
    margin-left: auto;
}

.review-vhdl-library[open] > summary .session-file-arrow {
    color: var(--ecc-primary);
    transform: rotate(90deg);
}

.review-vhdl-library-list {
    display: grid;
    gap: 0.35rem;
    padding: 0 0.65rem 0.65rem;
}

.review-vhdl .session-code-block {
    max-height: 24rem;
    overflow: auto;
}

.review-summary {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.review-ready {
    color: #16a34a;
    font-weight: 500;
}

.review-not-ready {
    color: #dc2626;
    font-weight: 500;
}

/* Banners */
.session-success-banner {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #dcfce7;
    color: #166534;
    border-radius: 8px;
    font-weight: 500;
}

.session-error-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.85rem;
    border-top: 1px solid #fca5a5;
}

.session-error-banner button {
    background: none;
    border: none;
    color: #991b1b;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.25rem;
}

/* Inline action buttons (in chat stream) */
.chat-inline-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.chat-lab-handoff {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.chat-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    text-decoration: none;
    color: #374151;
}

.chat-inline-btn:hover {
    background: #f3f4f6;
}

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

.chat-inline-approve {
    border-color: #22c55e;
    color: #166534;
}

.chat-inline-approve:hover:not(:disabled) {
    background: #22c55e;
    color: #fff;
}

.chat-inline-reject {
    border-color: #ef4444;
    color: #991b1b;
}

.chat-inline-reject:hover:not(:disabled) {
    background: #ef4444;
    color: #fff;
}

.chat-inline-fix {
    border-color: #eab308;
    color: #92400e;
}

.chat-inline-fix:hover:not(:disabled) {
    background: #eab308;
    color: #fff;
}

.chat-inline-retry {
    border-color: var(--ecc-primary);
    color: var(--ecc-primary);
}

.chat-inline-retry:hover:not(:disabled) {
    background: var(--ecc-primary);
    color: #fff;
}

.chat-inline-secondary {
    border-color: #6b7280;
    color: #6b7280;
}

.chat-inline-secondary:hover {
    background: #6b7280;
    color: #fff;
}

.session-proposal-card {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
}

.session-proposal-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.35rem;
}

.session-proposal-instruction {
    font-size: 0.84rem;
    line-height: 1.45;
    color: #4b5563;
    white-space: pre-wrap;
}

.session-proposal-actions {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
}

.session-proposal-status {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: #6b7280;
}

.session-input-box {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid #d9d9e3;
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: border-color 0.15s;
}

.session-input-box:focus-within {
    border-color: var(--ecc-primary);
}

.session-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.88rem;
    background: transparent;
    padding: 0.25rem 0.5rem;
}

.session-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.session-meta-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.session-meta-model {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.session-meta-description {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6b7280;
}

/* Chat Page — ChatGPT / Open WebUI style */
.chat-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    background: #f7f7f8;
}

.chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b6b7b;
    text-align: center;
    padding: 2rem;
}

.chat-empty-icon {
    color: var(--ecc-primary);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.chat-empty h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d2d3a;
    margin-bottom: 0.5rem;
}

.chat-empty p {
    max-width: 425px;
    font-size: 0.92rem;
    color: #8e8ea0;
}

.overview-panel {
    align-items: stretch;
    justify-content: flex-start;
    width: min(100%, 820px);
    min-height: 100%;
    height: auto;
    margin: 0 auto;
    padding-top: clamp(4rem, 12vh, 7rem);
    padding-bottom: 3rem;
}

.overview-panel-wide {
    width: min(100%, 920px);
}

.overview-panel-narrow {
    width: min(100%, 820px);
}

.overview-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    text-align: left;
}

.overview-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 2.75rem;
    margin-bottom: 1rem;
    padding: 0 0.85rem;
    color: #8e8ea0;
    background: #fff;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
}

.overview-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #2d2d3a;
    font-size: 0.92rem;
}

.overview-search input::placeholder {
    color: #9ca3af;
}

.overview-search:focus-within {
    border-color: rgba(41, 65, 145, 0.45);
    box-shadow: 0 0 0 3px rgba(41, 65, 145, 0.08);
}

.overview-list {
    display: grid;
    gap: 0.75rem;
}

.overview-empty {
    min-height: 22rem;
    height: auto;
    padding: 3rem 1rem;
}

.labs-empty {
    justify-content: flex-start;
    padding-top: clamp(4rem, 12vh, 8rem);
}

.labs-research-icon svg {
    display: block;
}

.labs-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    width: min(100%, 760px);
    margin-top: 1.35rem;
}

.labs-chatbox {
    width: min(100%, 768px);
    margin-top: 1.45rem;
}

.labs-chat-input-box {
    height: auto;
    min-height: 15rem;
    border-radius: 18px;
    background: #fff;
}

.labs-chat-input-box .chat-input-body {
    min-height: 11.25rem;
    align-items: stretch;
    padding: 0.25rem 1rem 0.15rem;
}

.labs-chat-textarea {
    min-height: 10.75rem;
    font-size: 1rem;
    line-height: 1.5;
    padding-top: 0.85rem;
}

.labs-chat-send-btn {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 12px;
}

.labs-chat-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0.65rem 0.65rem 1rem;
}

.labs-chat-controls {
    justify-content: flex-start;
    margin-top: 0;
    min-width: 0;
}

.labs-model-select {
    max-width: 220px;
    min-height: 2.3rem;
    font-size: 0.9rem;
}

.labs-thinking-toggle {
    font-size: 0.92rem;
    white-space: nowrap;
}

.labs-thinking-toggle input {
    width: 1rem;
    height: 1rem;
}

@media (max-width: 640px) {
    .labs-chat-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .labs-chat-controls {
        flex-wrap: wrap;
        gap: 0.65rem;
    }

    .labs-chat-send-btn {
        align-self: flex-end;
    }
}

.labs-action-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 5rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    background: #fff;
    color: #2d2d3a;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.labs-action-card:hover,
.labs-action-card:focus-visible {
    border-color: var(--ecc-primary);
    background: #f0f2fa;
    transform: translateY(-1px);
    outline: none;
}

.labs-action-icon {
    display: flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    color: var(--ecc-primary);
}

.labs-action-icon svg {
    width: 34px;
    height: 34px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.labs-action-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.2rem;
}

.labs-action-copy strong {
    font-size: 0.94rem;
    font-weight: 700;
    color: #2d2d3a;
}

.labs-action-copy small {
    font-size: 0.78rem;
    line-height: 1.35;
    color: #8e8ea0;
}

@media (max-width: 760px) {
    .labs-action-grid {
        grid-template-columns: 1fr;
    }
}

.chat-examples {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    width: min(100%, 720px);
}

.chat-example-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: #f7f7f8;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #4a4a5a;
    cursor: pointer;
    justify-content: flex-start;
    min-height: 2.75rem;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}

.chat-example-btn:hover {
    border-color: var(--ecc-primary);
    background: #f0f2fa;
    color: var(--ecc-primary);
}

.chat-example-icon {
    font-size: 0.9rem;
    color: var(--ecc-primary);
    opacity: 0.7;
}

.chat-thread {
    max-width: 768px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Message row */
.chat-msg {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 0;
}

.chat-msg + .chat-msg {
    border-top: 1px solid #e5e5e5;
}

.chat-msg-avatar {
    flex-shrink: 0;
    padding-top: 2px;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.chat-avatar-user {
    background: var(--ecc-primary);
    color: #fff;
}

.chat-avatar-ai {
    background: #10a37f;
    color: #fff;
}

.chat-msg-body {
    flex: 1;
    min-width: 0;
}

.chat-msg-role {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d2d3a;
    margin-bottom: 0.35rem;
}

.chat-msg-role-detail {
    margin-left: 0.4rem;
    font-weight: 400;
    color: #6b7280;
}

/* Thinking section */
.chat-thinking {
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.chat-thinking summary {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #6b6b7b;
    cursor: pointer;
    user-select: none;
    background: #fafafa;
    list-style: none;
}

.chat-thinking summary::-webkit-details-marker {
    display: none;
}

.chat-thinking summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.6em;
    transition: transform 0.15s;
}

.chat-thinking[open] summary::before {
    transform: rotate(90deg);
}

.chat-thinking-icon {
    margin-right: 0.25rem;
}

.chat-thinking summary:hover {
    background: #f0f0f5;
}

.chat-thinking-body {
    padding: 0.75rem;
    font-size: 0.78rem;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #555;
    border-top: 1px solid #e5e7eb;
    line-height: 1.5;
}

/* Message content (markdown) */
.chat-msg-content {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #1e1e2e;
    word-break: break-word;
}

.chat-msg-content p {
    margin-bottom: 0.75rem;
}

.chat-msg-content p:last-child {
    margin-bottom: 0;
}

.chat-msg-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    cursor: grab;
    font-size: 0.82rem;
    margin: 0.75rem 0;
    line-height: 1.6;
}

.chat-msg-content code {
    background: #e8e8ed;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
}

.chat-msg-content pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

.admin-only {
    border: 1px dashed rgba(239, 68, 68, 0.85);
    border-radius: 8px;
    padding: 0.35rem;
}

.admin-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.admin-thinking-group {
    margin-top: 0.75rem;
}

.admin-thinking-group .session-iteration-subtitle {
    margin-top: 0;
}

.session-raw-plan {
    margin: 0.35rem 0 0.75rem;
}

.session-raw-plan summary {
    color: #555;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 500;
    user-select: none;
}

.session-raw-plan summary:hover {
    color: #222;
}

.chat-msg-content ul, .chat-msg-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.chat-msg-content li {
    margin-bottom: 0.25rem;
}

.chat-msg-content h1, .chat-msg-content h2,
.chat-msg-content h3, .chat-msg-content h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d2d3a;
}

.chat-msg-content h1 { font-size: 1.3rem; }
.chat-msg-content h2 { font-size: 1.15rem; }
.chat-msg-content h3 { font-size: 1.05rem; }
.chat-msg-content h4 { font-size: 0.95rem; }

.chat-msg-content blockquote {
    border-left: 3px solid var(--ecc-primary);
    margin: 0.75rem 0;
    padding: 0.5rem 1rem;
    background: #f9f9fb;
    color: #555;
}

.chat-msg-content table {
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.chat-msg-content th, .chat-msg-content td {
    border: 1px solid #ddd;
    padding: 0.4rem 0.75rem;
}

.chat-msg-content th {
    background: #f0f0f5;
    font-weight: 600;
}

/* Loading dots */
.chat-msg-loading {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.chat-dot {
    width: 8px;
    height: 8px;
    background: #8e8ea0;
    border-radius: 50%;
    animation: chatDotPulse 1.4s infinite ease-in-out both;
}

.chat-dot:nth-child(2) { animation-delay: 0.16s; }
.chat-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes chatDotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input area */
.chat-input-area {
    background: transparent;
    padding: 1rem 1rem 1.25rem;
}

.chat-input-wrapper {
    position: relative;
    max-width: 768px;
    margin: 0 auto;
}

.chat-input-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.context-meter {
    flex: 0 1 15rem;
    min-width: 10rem;
    max-width: 16rem;
}

.context-meter-track {
    position: relative;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.context-meter-fill {
    display: block;
    height: 100%;
    min-width: 0.25rem;
    border-radius: inherit;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.context-meter-low {
    background: #22c55e;
}

.context-meter-medium {
    background: #3b82f6;
}

.context-meter-high {
    background: #f59e0b;
}

.context-meter-critical {
    background: #ef4444;
}

@media (max-width: 640px) {
    .session-meta {
        align-items: stretch;
        flex-direction: column;
        gap: 0.45rem;
    }

    .context-meter {
        flex: none;
        width: 100%;
        max-width: none;
        min-width: 0;
    }
}

.chat-model-select {
    width: auto;
    max-width: 220px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.chat-model-tier-control {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.chat-model-tier-description {
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.3;
}

.chat-select-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #555;
    font-size: 0.8rem;
}

.chat-select-label span {
    font-weight: 500;
}

.chat-thinking-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.chat-thinking-toggle input {
    accent-color: var(--ecc-primary);
}

@media (max-width: 640px) {
    .chat-input-controls {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
    }

    .chat-model-tier-control {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.3rem;
    }
}

.chat-input-box {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d9d9e3;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
    height: 120px;
    min-height: 42px;
}

.chat-input-box:focus-within {
    border-color: var(--ecc-primary);
    box-shadow: 0 2px 12px rgba(37,63,142,0.1);
}

.chat-input-resize-handle {
    height: 6px;
    cursor: ns-resize;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-input-resize-handle::after {
    content: '';
    width: 32px;
    height: 3px;
    background: #d1d5db;
    border-radius: 2px;
}

.chat-input-resize-handle:hover::after {
    background: #9ca3af;
}

.chat-input-body {
    display: flex;
    align-items: flex-end;
    gap: 0;
    padding: 0.25rem 0.75rem 0.5rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chat-textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 0.92rem;
    line-height: 1.5;
    background: transparent;
    max-height: none;
    min-height: 0;
    height: 100%;
    padding: 0.25rem 0;
    overflow-y: auto;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--ecc-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, opacity 0.15s;
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--ecc-dark);
}

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

.labs-chat-input-box {
    height: auto;
    min-height: 6.5rem;
}

.labs-chat-input-box .chat-input-body {
    flex: 1 1 auto;
    min-height: 6.75rem;
}

.labs-chat-footer {
    flex-shrink: 0;
}
}
