﻿html, body {
    background: #f6f9ff;
    color: #111827;
    font-family: Inter, "Segoe UI", sans-serif;
    font-size: 14px;
}

html {
    min-width: 320px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(37, 99, 235, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, .055) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.glass-bar, .side-rail {
    border-color: #dbe5f3 !important;
    border-style: solid;
}

.glass-bar {
    border-bottom-width: 1px;
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    min-height: 56px;
}

.side-rail {
    border-right-width: 1px;
    overflow-x: hidden;
}

.drawer-collapsed .mud-nav-link-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.drawer-collapsed .drawer-footer {
    left: 10px;
    right: 10px;
    display: grid;
    place-items: center;
}

.shell-menu-button {
    margin-right: 4px;
}

.main-surface {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(248, 251, 255, .98) 0%, rgba(239, 246, 255, .94) 52%, rgba(246, 249, 255, .98) 100%);
}

.dt-app-shell {
    position: relative;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    grid-template-rows: 58px minmax(0, 1fr);
    color: #111827;
    transition: grid-template-columns .22s ease;
}

.dt-sidebar-collapsed {
    grid-template-columns: 78px minmax(0, 1fr);
}

.dt-app-topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid #dbe5f3;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
    z-index: 3;
}

.dt-app-sidebar {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    min-height: 0;
    padding: 14px 12px 86px;
    border-right: 1px solid #dbe5f3;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(16px);
    overflow: hidden;
}

.dt-app-main {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.dt-brand {
    display: inline-grid;
    grid-template-columns: 40px minmax(0, auto);
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #102033;
    text-decoration: none;
}

.dt-brand strong,
.dt-brand small {
    display: block;
    line-height: 1.1;
}

.dt-brand strong {
    font-size: 14px;
    font-weight: 750;
}

.dt-brand small {
    margin-top: 3px;
    color: #526174;
    font-size: 11px;
}

.dt-logo {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 12px;
    background: linear-gradient(135deg, #eef5ff 0%, #eef2ff 55%, #f5f3ff 100%);
    color: #4f46e5;
}

.dt-topbar-spacer {
    flex: 1 1 auto;
}

.dt-environment-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 999px;
    background: rgba(248, 251, 255, .88);
    color: #334155;
    font-size: 12px;
    font-weight: 650;
}

.dt-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

.dt-model-status {
    position: absolute;
    left: 50%;
    top: 50%;
    display: inline-flex;
    max-width: min(560px, 42vw);
    min-height: 36px;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid #dbe5f3;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #334155;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.dt-model-status-main,
.dt-model-status-detail {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dt-model-status-main {
    max-width: 260px;
    color: #111827;
    font-size: 12px;
    font-weight: 750;
}

.dt-model-status-detail {
    max-width: 230px;
    color: #64748b;
    font-size: 11px;
    font-weight: 650;
}

.dt-model-dot,
.dt-model-spinner {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 999px;
}

.dt-model-dot {
    background: #94a3b8;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, .12);
}

.dt-model-spinner {
    border: 2px solid rgba(37, 99, 235, .2);
    border-top-color: #2563eb;
    animation: dt-model-spin .75s linear infinite;
}

.dt-model-status-loading {
    border-color: rgba(37, 99, 235, .26);
    background: #f8fbff;
}

.dt-model-status-loaded .dt-model-dot {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

.dt-model-status-failed {
    border-color: rgba(220, 38, 38, .26);
    background: #fff7f7;
}

.dt-model-status-failed .dt-model-dot {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .12);
}

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

@media (max-width: 980px) {
    .dt-model-status {
        max-width: 34vw;
    }

    .dt-model-status-detail {
        display: none;
    }
}

.dt-icon-button,
.dt-logout-button,
.dt-nav-link {
    color: #475569;
    transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.dt-icon-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #dbe5f3;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
}

.dt-icon-button:hover,
.dt-logout-button:hover,
.dt-nav-link:hover {
    border-color: rgba(37, 99, 235, .28);
    background: #eef5ff;
    color: #1d4ed8;
}

.dt-svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dt-nav {
    display: grid;
    gap: 5px;
}

.dt-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.dt-nav-link.active {
    border-color: rgba(79, 70, 229, .22);
    background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(124, 58, 237, .12));
    color: #3730a3;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .08);
}

.dt-sidebar-footer {
    position: absolute;
    right: 12px;
    bottom: 14px;
    left: 12px;
}

.dt-logout-button {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    gap: 10px;
    padding: 0 11px;
    border: 1px solid #dbe5f3;
    border-radius: 10px;
    background: #ffffff;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.dt-sidebar-collapsed .dt-brand {
    grid-template-columns: 40px;
}

.dt-sidebar-collapsed .dt-brand span:last-child,
.dt-sidebar-collapsed .dt-nav-link span,
.dt-sidebar-collapsed .dt-logout-button span,
.dt-sidebar-collapsed .dt-environment-pill {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.dt-sidebar-collapsed .dt-nav-link,
.dt-sidebar-collapsed .dt-logout-button {
    justify-content: center;
    padding-inline: 0;
}

body:has(.chat-page) {
    overflow: hidden;
}

body:has(.chat-page) .glass-bar,
body:has(.chat-page) .dt-app-topbar {
    display: none;
}

body:has(.chat-page) .dt-app-shell {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    min-height: 100dvh;
}

body:has(.chat-page) .dt-app-sidebar {
    display: block;
    grid-column: 1;
    grid-row: 1;
    height: 100dvh;
    padding: 12px 10px 78px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 10px 0 28px rgba(15, 23, 42, .04);
}

body:has(.chat-page) .dt-app-main {
    grid-column: 2;
    grid-row: 1;
}

body:has(.chat-page) .dt-nav-link,
body:has(.chat-page) .dt-logout-button {
    justify-content: center;
    padding-inline: 0;
}

body:has(.chat-page) .dt-nav-link span,
body:has(.chat-page) .dt-logout-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

body:has(.chat-page) .mud-main-content {
    padding-top: 0 !important;
}

body:has(.chat-page) .mud-drawer {
    top: 0 !important;
    height: 100dvh !important;
}

.main-surface:has(.chat-page) {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

body:has(.chat-page) .dt-app-main {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.app-container {
    width: min(100%, 2400px);
    margin: 0 auto;
    padding: clamp(12px, 1vw, 24px) !important;
}

.app-container:has(.chat-page) {
    height: 100%;
    overflow: hidden;
}

.dt-page-transition {
    animation: dt-page-fade-in 180ms ease-out both;
}

.app-container:has(.chat-page) .dt-page-transition,
.dt-page-transition:has(.reception-demo),
.dt-page-transition:has(.login-page) {
    height: 100%;
    min-height: 0;
}

@keyframes dt-page-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dt-page-transition {
        animation: none;
    }
}

.page-shell {
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: clamp(12px, .8vw, 18px);
}

.title-glow {
    color: #102033;
    text-shadow: 0 0 18px rgba(37, 99, 235, .18);
}

.page-title {
    margin: 0 0 4px;
    font-size: clamp(24px, 1.8vw, 34px);
    font-weight: 800;
    letter-spacing: 0;
}

.page-subtitle {
    margin: 0;
    color: #526174;
    font-size: 14px;
}

.section-title {
    margin: 0 0 12px;
    color: #102033;
    font-size: 18px;
    font-weight: 760;
}

.panel, .metric-card, .chat-shell, .auth-card {
    background: rgba(255, 255, 255, .92) !important;
    border: 1px solid rgba(37, 99, 235, .14);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
}

.panel {
    padding: clamp(18px, 1.1vw, 30px);
}

.metric-card {
    padding: clamp(18px, 1vw, 28px);
    min-height: clamp(132px, 7vw, 190px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.metric-value {
    display: block;
    color: #102033;
    font-size: clamp(18px, 1.1vw, 24px);
    font-weight: 790;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-caption {
    color: #526174;
    font-size: 12px;
}

.dashboard-metrics .mud-grid-item {
    min-width: 0;
}

.dt-status-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
    text-transform: lowercase;
}

.dt-status-online {
    border: 1px solid rgba(22, 163, 74, .24);
    background: #dcfce7;
    color: #166534;
}

.dt-status-idle {
    border: 1px solid rgba(217, 119, 6, .24);
    background: #fffbeb;
    color: #92400e;
}

.dt-status-outline {
    background: rgba(255, 255, 255, .86);
}

.dt-progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e0f2fe;
}

.dt-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.path-panel {
    margin-top: 18px;
}

.dt-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dt-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.dt-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.dt-field span {
    color: #526174;
    font-size: 12px;
    font-weight: 750;
}

.dt-field input,
.dt-field select,
.dt-field textarea {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    border: 1px solid #cbd7e8;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    padding: 10px 12px;
    font: inherit;
    outline: none;
}

.dt-field textarea {
    min-height: 120px;
    resize: vertical;
}

.dt-field input:focus,
.dt-field select:focus,
.dt-field textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.dt-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.dt-button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.dt-button-primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
}

.dt-button-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.dt-button-secondary {
    border-color: #dbe5f3;
    background: #ffffff;
    color: #334155;
}

.dt-button-secondary:hover:not(:disabled) {
    border-color: rgba(37, 99, 235, .28);
    background: #eef5ff;
    color: #1d4ed8;
}

.dt-button-danger {
    border-color: rgba(220, 38, 38, .22);
    background: #dc2626;
    color: #ffffff;
}

.dt-button-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.dt-table-action {
    min-height: 30px;
    border: 1px solid #dbe5f3;
    border-radius: 7px;
    background: #ffffff;
    color: #2563eb;
    padding: 0 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.dt-table-action + .dt-table-action {
    margin-left: 6px;
}

.dt-table-action:hover {
    background: #eef5ff;
}

.dt-table-action.danger {
    color: #dc2626;
}

.dt-table-action.danger:hover {
    border-color: rgba(220, 38, 38, .25);
    background: #fef2f2;
}

.text-end {
    text-align: right !important;
}

.panel-copy {
    margin: 0 0 14px;
    color: #526174;
    line-height: 1.5;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.compact-actions {
    margin-top: 0;
}

.dt-alert {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
}

.dt-alert.info {
    border: 1px solid rgba(2, 132, 199, .22);
    background: #eff6ff;
    color: #075985;
}

.dt-file-picker input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px dashed #b9c8dc;
    border-radius: 8px;
    background: #f8fbff;
    padding: 12px;
    color: #334155;
}

.dt-inline-state {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #526174;
    font-weight: 700;
}

.dt-empty-cell {
    color: #64748b;
    text-align: center !important;
}

.admin-table-wrap.no-top-margin {
    margin-top: 0;
}

.skills-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 16px;
}

.skills-side {
    display: grid;
    align-content: start;
    gap: 16px;
}

.skills-table td:first-child strong,
.skills-table td:first-child small {
    display: block;
}

.dt-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 42px;
    height: 24px;
}

.dt-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dt-switch > span {
    position: relative;
    display: block;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cbd7e8;
    transition: background .16s ease;
}

.dt-switch > span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
    transition: transform .16s ease;
}

.dt-switch input:checked + span {
    background: #2563eb;
}

.dt-switch input:checked + span::after {
    transform: translateX(18px);
}

.skill-editor-panel {
    margin-top: 16px;
}

.skill-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 160px;
    gap: 12px;
}

.skill-description-field,
.skill-content-field {
    grid-column: 1 / -1;
}

.skill-description-field textarea {
    min-height: 78px;
}

.skill-markdown-editor {
    min-height: 440px !important;
    font-family: "Cascadia Code", "Consolas", monospace !important;
    font-size: 13px !important;
    line-height: 1.5;
}

.dt-checkbox-field {
    align-content: end;
}

.path-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
    gap: 12px;
    margin-top: 12px;
}

.path-grid div {
    min-width: 0;
    padding: 12px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #f8fbff;
}

.path-grid span {
    display: block;
    color: #526174;
    font-size: 12px;
    margin-bottom: 4px;
}

.path-grid strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #102033;
    font-size: 14px;
}

@media (max-width: 1180px) {
    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dt-two-column {
        grid-template-columns: 1fr;
    }

    .skills-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .dt-form-grid {
        grid-template-columns: 1fr;
    }

    .panel-head {
        flex-direction: column;
    }

    .skill-edit-grid {
        grid-template-columns: 1fr;
    }
}

.drawer-footer {
    position: absolute;
    bottom: 18px;
    left: 18px;
    right: 18px;
}

.dt-state-panel {
    display: grid;
    gap: 8px;
    max-width: 560px;
}

.dt-state-panel h1 {
    margin: 0;
    color: #102033;
    font-size: 20px;
    font-weight: 750;
}

.dt-state-panel p {
    margin: 0;
    color: #526174;
}

.dt-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 999px;
    animation: dt-spin .8s linear infinite;
}

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

@media (max-width: 860px) {
    .dt-app-shell {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .dt-brand span:last-child,
    .dt-environment-pill,
    .dt-nav-link span,
    .dt-logout-button span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .dt-nav-link,
    .dt-logout-button {
        justify-content: center;
        padding-inline: 0;
    }
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
    padding: 20px;
}

.auth-card {
    width: min(560px, calc(100vw - 32px));
    padding: clamp(28px, 2vw, 44px);
}

.auth-brand {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-bottom: 28px;
}

.auth-brand .mud-icon-root {
    width: 48px;
    height: 48px;
    padding: 10px;
    border-radius: 8px;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
}

.auth-label {
    display: block;
    color: #526174;
    font-size: 13px;
    margin-bottom: 8px;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd7e8;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    padding: 15px 14px;
    outline: none;
}

.auth-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

body:has(.llm-auth-shell) {
    overflow: hidden;
    background: #050816;
}

body:has(.llm-auth-shell)::before {
    display: none;
}

.llm-auth-shell {
    --llm-bg: #050816;
    --llm-cyan: #5ffcff;
    --llm-blue: #4498ff;
    --llm-violet: #9b5cff;
    --llm-pink: #ff4fd8;
    --llm-green: #79ffb2;
    --llm-text: #eaf7ff;
    --llm-muted: #85a5c8;
    --llm-radius: 28px;
    --llm-shadow: 0 30px 90px rgba(0, 0, 0, .55);
    position: relative;
    min-height: 100vh;
    color: var(--llm-text);
    background:
        radial-gradient(circle at 18% 18%, rgba(95, 252, 255, .19), transparent 28%),
        radial-gradient(circle at 78% 24%, rgba(155, 92, 255, .22), transparent 30%),
        radial-gradient(circle at 58% 82%, rgba(255, 79, 216, .15), transparent 35%),
        linear-gradient(120deg, #050816 0%, #071127 48%, #09051d 100%);
    overflow: hidden;
}

.llm-auth-shell::before {
    content: "";
    position: fixed;
    inset: -20%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(95, 252, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(95, 252, 255, .055) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at center, #000 0%, transparent 72%);
    animation: llm-grid-drift 18s linear infinite;
}

.llm-auth-network {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.llm-auth-noise,
.llm-auth-scanline {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.llm-auth-noise {
    z-index: 20;
    opacity: .075;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.llm-auth-scanline {
    z-index: 19;
    height: 18%;
    background: linear-gradient(to bottom, transparent, rgba(95, 252, 255, .08), transparent);
    transform: translateY(-130%);
    animation: llm-scan 4.8s ease-in-out infinite;
    filter: blur(2px);
}

.llm-auth-main {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    perspective: 1400px;
}

.llm-auth-stage {
    position: relative;
    width: min(1160px, 100%);
    min-height: min(720px, calc(100vh - 64px));
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    align-items: center;
    gap: 42px;
}

.llm-auth-hero {
    position: relative;
    min-height: 620px;
    display: grid;
    place-items: center;
    transform-style: preserve-3d;
    animation: llm-hero-in 1.15s cubic-bezier(.16, 1, .3, 1) both;
}

.llm-server-core {
    position: relative;
    width: min(520px, 86vw);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    transform-style: preserve-3d;
}

.llm-halo,
.llm-ring,
.llm-orbit,
.llm-pulse {
    position: absolute;
    border-radius: 50%;
    transform-style: preserve-3d;
}

.llm-halo {
    inset: 10%;
    background:
        conic-gradient(from 0deg, transparent, rgba(95, 252, 255, .8), transparent 22%, rgba(155, 92, 255, .8), transparent 58%, rgba(255, 79, 216, .7), transparent);
    filter: blur(14px);
    opacity: .78;
    animation: llm-rotate 10s linear infinite;
}

.llm-ring {
    border: 1px solid rgba(95, 252, 255, .25);
    box-shadow:
        0 0 24px rgba(95, 252, 255, .14),
        inset 0 0 34px rgba(68, 152, 255, .08);
}

.llm-ring-one {
    inset: 5%;
    border-left-color: rgba(255, 79, 216, .65);
    border-right-color: rgba(95, 252, 255, .65);
    animation: llm-tilt-a 9s linear infinite;
}

.llm-ring-two {
    inset: 14%;
    border-top-color: rgba(121, 255, 178, .55);
    border-bottom-color: rgba(155, 92, 255, .65);
    animation: llm-tilt-b 7.5s linear infinite reverse;
}

.llm-ring-three {
    inset: 24%;
    border-width: 2px;
    border-style: dashed;
    border-color: rgba(95, 252, 255, .42);
    animation: llm-rotate 14s linear infinite reverse;
}

.llm-orbit {
    inset: 0;
    animation: llm-rotate 8s linear infinite;
}

.llm-orbit::before,
.llm-orbit::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--llm-cyan);
    box-shadow: 0 0 22px var(--llm-cyan), 0 0 50px rgba(95, 252, 255, .6);
}

.llm-orbit::before {
    top: 17%;
    left: 18%;
}

.llm-orbit::after {
    right: 12%;
    bottom: 24%;
    background: var(--llm-pink);
    box-shadow: 0 0 22px var(--llm-pink), 0 0 50px rgba(255, 79, 216, .6);
}

.llm-pulse {
    inset: 21%;
    border: 1px solid rgba(95, 252, 255, .22);
    animation: llm-pulse 2.2s ease-out infinite;
}

.llm-core-chip {
    position: relative;
    width: 210px;
    height: 210px;
    display: grid;
    place-items: center;
    border-radius: 36px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .18), transparent 18%, rgba(95, 252, 255, .08) 48%, rgba(155, 92, 255, .16)),
        rgba(4, 14, 35, .82);
    border: 1px solid rgba(165, 231, 255, .32);
    box-shadow:
        0 0 0 1px rgba(95, 252, 255, .08),
        0 28px 70px rgba(0, 0, 0, .55),
        inset 0 0 30px rgba(95, 252, 255, .1),
        0 0 65px rgba(95, 252, 255, .22);
    transform: rotateX(58deg) rotateZ(45deg);
    animation: llm-chip-float 4s ease-in-out infinite;
}

.llm-core-chip::before,
.llm-core-chip::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 26px;
    border: 1px solid rgba(95, 252, 255, .2);
}

.llm-core-chip::after {
    inset: 56px;
    background: radial-gradient(circle, rgba(95, 252, 255, .9), rgba(68, 152, 255, .25) 35%, transparent 70%);
    filter: blur(3px);
    animation: llm-core-beat 1.6s ease-in-out infinite;
}

.llm-pin {
    position: absolute;
    width: 8px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(var(--llm-cyan), transparent);
    opacity: .64;
    box-shadow: 0 0 16px rgba(95, 252, 255, .42);
}

.llm-pin:nth-child(1) { top: -26px; left: 28px; }
.llm-pin:nth-child(2) { top: -26px; left: 64px; }
.llm-pin:nth-child(3) { top: -26px; left: 100px; }
.llm-pin:nth-child(4) { top: -26px; left: 136px; }
.llm-pin:nth-child(5) { top: -26px; left: 172px; }
.llm-pin:nth-child(6) { bottom: -26px; right: 28px; transform: rotate(180deg); }
.llm-pin:nth-child(7) { bottom: -26px; right: 64px; transform: rotate(180deg); }
.llm-pin:nth-child(8) { bottom: -26px; right: 100px; transform: rotate(180deg); }
.llm-pin:nth-child(9) { bottom: -26px; right: 136px; transform: rotate(180deg); }
.llm-pin:nth-child(10) { bottom: -26px; right: 172px; transform: rotate(180deg); }

.llm-status-panel {
    --llm-status-offset-x: 0;
    position: absolute;
    left: 20px;
    bottom: 28px;
    width: min(430px, 90vw);
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(4, 13, 31, .62);
    border: 1px solid rgba(95, 252, 255, .18);
    box-shadow: var(--llm-shadow), inset 0 0 34px rgba(95, 252, 255, .05);
    backdrop-filter: blur(18px);
    animation: llm-terminal-in 1.2s .55s cubic-bezier(.16, 1, .3, 1) both;
}

.llm-terminal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    color: var(--llm-muted);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.llm-lights {
    display: flex;
    gap: 7px;
}

.llm-lights span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--llm-cyan);
    box-shadow: 0 0 16px currentColor;
}

.llm-lights span:nth-child(2) { background: var(--llm-violet); }
.llm-lights span:nth-child(3) { background: var(--llm-green); }

.llm-boot-lines {
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 13px;
    line-height: 1.85;
    color: #bdefff;
}

.llm-boot-lines li {
    width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    animation: llm-type 900ms steps(54) forwards;
}

.llm-boot-lines li:nth-child(1) { animation-delay: .9s; }
.llm-boot-lines li:nth-child(2) { animation-delay: 1.28s; }
.llm-boot-lines li:nth-child(3) { animation-delay: 1.66s; }
.llm-boot-lines li:nth-child(4) { animation-delay: 2.04s; }
.llm-boot-lines li:nth-child(5) { animation-delay: 2.42s; }
.llm-boot-lines li:nth-child(6) { animation-delay: 2.8s; }

.llm-boot-lines span {
    color: var(--llm-cyan);
}

.llm-boot-lines strong {
    color: var(--llm-green);
    font-weight: 800;
}

.llm-boot-lines em {
    color: #ffd979;
    font-style: normal;
}

.llm-auth-card {
    position: relative;
    isolation: isolate;
    padding: 36px;
    border-radius: var(--llm-radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .12), transparent 21%),
        linear-gradient(180deg, rgba(13, 29, 62, .78), rgba(5, 12, 29, .7));
    border: 1px solid rgba(180, 233, 255, .22);
    box-shadow: var(--llm-shadow), inset 0 0 60px rgba(95, 252, 255, .06);
    backdrop-filter: blur(24px);
    overflow: hidden;
    opacity: 0;
    animation: llm-card-in 1.15s 2.8s cubic-bezier(.16, 1, .3, 1) forwards;
}

.llm-auth-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: -2;
    border-radius: inherit;
    background: conic-gradient(from var(--llm-angle), transparent, rgba(95, 252, 255, .75), transparent 28%, rgba(255, 79, 216, .5), transparent 55%, rgba(121, 255, 178, .38), transparent);
    animation: llm-border-spin 7s linear infinite;
    opacity: .7;
}

.llm-auth-card::after {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: -1;
    border-radius: calc(var(--llm-radius) - 1px);
    background: rgba(4, 10, 26, .86);
}

.llm-brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
}

.llm-logo {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, .95), rgba(95, 252, 255, .55) 21%, rgba(68, 152, 255, .18) 58%, rgba(155, 92, 255, .22));
    box-shadow: 0 0 28px rgba(95, 252, 255, .36);
}

.llm-logo svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, .5));
}

.llm-brand-title {
    margin: 0;
    color: #f4fbff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.llm-brand-subtitle {
    margin: 2px 0 0;
    color: var(--llm-muted);
    font-size: 13px;
}

.llm-headline {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: clamp(34px, 4vw, 56px);
    line-height: .98;
    letter-spacing: 0;
}

.llm-headline span {
    display: block;
    background: linear-gradient(90deg, #fff, var(--llm-cyan), var(--llm-violet), #fff);
    background-size: 260% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: llm-shimmer 4s linear infinite;
}

.llm-copy {
    margin: 0 0 30px;
    color: var(--llm-muted);
    font-size: 15px;
    line-height: 1.7;
    max-width: 460px;
}

.llm-login-form {
    display: grid;
    gap: 16px;
}

.llm-field {
    position: relative;
}

.llm-field label {
    display: block;
    margin: 0 0 8px;
    color: #b9d7ee;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.llm-field input {
    width: 100%;
    height: 56px;
    padding: 0 48px 0 18px;
    color: var(--llm-text);
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(153, 219, 255, .18);
    border-radius: 17px;
    outline: none;
    font-size: 15px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.llm-field input[readonly] {
    color: #c6e5ff;
}

.llm-field input:focus {
    border-color: rgba(95, 252, 255, .72);
    background: rgba(255, 255, 255, .085);
    box-shadow: 0 0 0 4px rgba(95, 252, 255, .09), 0 0 26px rgba(95, 252, 255, .15);
}

.llm-field svg {
    position: absolute;
    right: 17px;
    bottom: 16px;
    width: 22px;
    height: 22px;
    color: rgba(189, 239, 255, .75);
}

.llm-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 2px 0 8px;
    color: var(--llm-muted);
    font-size: 13px;
}

.llm-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.llm-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--llm-cyan);
}

.llm-connect {
    position: relative;
    height: 58px;
    border: 0;
    border-radius: 18px;
    color: #031020;
    background: linear-gradient(90deg, var(--llm-cyan), #88b9ff, var(--llm-violet));
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(95, 252, 255, .18);
}

.llm-connect::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-120%) skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
    animation: llm-button-sweep 3.4s ease-in-out infinite;
}

.llm-connect:active {
    transform: translateY(1px);
}

.llm-intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle, rgba(95, 252, 255, .18), transparent 32%),
        rgba(1, 5, 18, .8);
    animation: llm-overlay-out .9s 2.95s ease forwards;
    pointer-events: none;
}

.llm-intro-lockup {
    text-align: center;
    transform: translateY(8px);
    animation: llm-lockup-out .7s 2.72s ease forwards;
}

.llm-intro-mark {
    position: relative;
    width: 104px;
    height: 104px;
    margin: 0 auto 24px;
    display: grid;
    place-items: center;
    border-radius: 32px;
    background: rgba(95, 252, 255, .08);
    border: 1px solid rgba(95, 252, 255, .35);
    box-shadow: 0 0 56px rgba(95, 252, 255, .28), inset 0 0 30px rgba(95, 252, 255, .12);
}

.llm-intro-mark::before,
.llm-intro-mark::after {
    content: "";
    position: absolute;
    border-radius: inherit;
    border: 1px solid rgba(95, 252, 255, .28);
}

.llm-intro-mark::before {
    inset: -12px;
    animation: llm-mark-pulse 1.2s ease-out infinite;
}

.llm-intro-mark::after {
    inset: -25px;
    animation: llm-mark-pulse 1.2s .35s ease-out infinite;
}

.llm-intro-title {
    margin: 0;
    color: #ffffff;
    font-size: clamp(28px, 6vw, 72px);
    line-height: .9;
    letter-spacing: 0;
    text-transform: uppercase;
}

.llm-intro-title span {
    display: block;
    background: linear-gradient(90deg, #fff, var(--llm-cyan), var(--llm-violet), var(--llm-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.llm-intro-lockup p {
    margin: 18px 0 0;
    color: #a5d9ff;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 13px;
    letter-spacing: .24em;
    text-transform: uppercase;
    animation: llm-glitch-text 1.4s steps(2) infinite;
}

.llm-intro-progress {
    width: min(460px, 72vw);
    height: 4px;
    margin: 30px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
}

.llm-intro-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--llm-cyan), var(--llm-violet), var(--llm-pink));
    box-shadow: 0 0 22px rgba(95, 252, 255, .8);
    animation: llm-load 2.45s cubic-bezier(.16, 1, .3, 1) forwards;
}

@property --llm-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes llm-grid-drift {
    to { transform: translate3d(64px, 64px, 0); }
}

@keyframes llm-scan {
    0%, 16% { transform: translateY(-130%); opacity: 0; }
    30%, 65% { opacity: .8; }
    100% { transform: translateY(680%); opacity: 0; }
}

@keyframes llm-hero-in {
    from { opacity: 0; transform: translateY(42px) rotateX(16deg) scale(.95); filter: blur(12px); }
    to { opacity: 1; transform: translateY(0) rotateX(0deg) scale(1); filter: blur(0); }
}

@keyframes llm-terminal-in {
    from { opacity: 0; transform: translate(var(--llm-status-offset-x), 32px) scale(.96); filter: blur(8px); }
    to { opacity: 1; transform: translate(var(--llm-status-offset-x), 0) scale(1); filter: blur(0); }
}

@keyframes llm-card-in {
    from { opacity: 0; transform: translateX(56px) rotateY(-16deg) scale(.96); filter: blur(14px); }
    to { opacity: 1; transform: translateX(0) rotateY(0) scale(1); filter: blur(0); }
}

@keyframes llm-overlay-out {
    to { opacity: 0; visibility: hidden; }
}

@keyframes llm-lockup-out {
    to { opacity: 0; transform: translateY(-28px) scale(.96); filter: blur(8px); }
}

@keyframes llm-mark-pulse {
    from { transform: scale(.7); opacity: .85; }
    to { transform: scale(1.35); opacity: 0; }
}

@keyframes llm-load {
    0% { width: 0; }
    58% { width: 71%; }
    78% { width: 85%; }
    100% { width: 100%; }
}

@keyframes llm-glitch-text {
    0%, 100% { opacity: .85; transform: translateX(0); }
    15% { opacity: 1; transform: translateX(1px); }
    18% { transform: translateX(-1px); }
    20% { transform: translateX(0); }
}

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

@keyframes llm-tilt-a {
    to { transform: rotateX(65deg) rotateZ(360deg); }
}

@keyframes llm-tilt-b {
    to { transform: rotateY(62deg) rotateZ(360deg); }
}

@keyframes llm-pulse {
    from { transform: scale(.8); opacity: .72; }
    to { transform: scale(1.6); opacity: 0; }
}

@keyframes llm-chip-float {
    0%, 100% { translate: 0 0 0; }
    50% { translate: 0 -14px 0; }
}

@keyframes llm-core-beat {
    0%, 100% { opacity: .55; transform: scale(.92); }
    50% { opacity: 1; transform: scale(1.12); }
}

@keyframes llm-type {
    from { opacity: 1; width: 0; }
    to { opacity: 1; width: 100%; }
}

@keyframes llm-shimmer {
    to { background-position: 260% center; }
}

@keyframes llm-border-spin {
    to { --llm-angle: 360deg; }
}

@keyframes llm-button-sweep {
    0%, 48% { transform: translateX(-120%) skewX(-20deg); }
    72%, 100% { transform: translateX(130%) skewX(-20deg); }
}

@media (max-width: 980px) {
    body:has(.llm-auth-shell) {
        overflow: auto;
    }

    .llm-auth-shell {
        overflow: auto;
    }

    .llm-auth-stage {
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 18px;
    }

    .llm-auth-hero {
        min-height: 480px;
    }

    .llm-status-panel {
        --llm-status-offset-x: -50%;
        left: 50%;
    }
}

@media (max-width: 620px) {
    .llm-auth-main {
        padding: 18px;
    }

    .llm-auth-hero {
        min-height: 430px;
    }

    .llm-core-chip {
        width: 150px;
        height: 150px;
        border-radius: 28px;
    }

    .llm-status-panel {
        width: calc(100vw - 36px);
        padding: 14px;
    }

    .llm-boot-lines {
        font-size: 11px;
    }

    .llm-auth-card {
        padding: 24px;
    }

    .llm-meta-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .llm-auth-shell *,
    .llm-auth-shell *::before,
    .llm-auth-shell *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

/* Professional operator login */
body:has(.llm-auth-shell) {
    overflow: auto;
    background: #f8fbff;
}

.llm-auth-shell {
    --llm-bg: #f8fbff;
    --llm-surface: #ffffff;
    --llm-soft: #f4f8ff;
    --llm-border: #dbe5f1;
    --llm-border-soft: #e7eef8;
    --llm-text: #0f172a;
    --llm-muted: #64748b;
    --llm-muted-2: #94a3b8;
    --llm-primary: #0f5bd7;
    --llm-primary-hover: #0b4ab2;
    --llm-primary-soft: #eef5ff;
    --llm-success: #10b981;
    min-height: 100dvh;
    color: var(--llm-text);
    background:
        linear-gradient(rgba(15, 91, 215, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 91, 215, .045) 1px, transparent 1px),
        radial-gradient(circle at 16% 12%, rgba(15, 91, 215, .12), transparent 32%),
        radial-gradient(circle at 84% 18%, rgba(124, 58, 237, .10), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, var(--llm-bg) 54%, #f1f6fd 100%);
    background-size: 52px 52px, 52px 52px, auto, auto, auto;
    overflow: hidden;
}

.llm-auth-shell::before,
.llm-auth-network,
.llm-auth-noise,
.llm-auth-scanline,
.llm-intro-overlay,
.llm-server-core,
.llm-status-panel {
    display: none !important;
}

.llm-auth-main {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 46px);
    perspective: none;
}

.llm-auth-stage {
    width: min(1180px, 100%);
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
}

.llm-auth-hero {
    min-height: auto;
    display: grid;
    place-items: stretch;
    gap: 26px;
    animation: none;
}

.llm-auth-brand,
.llm-brand-row,
.llm-system-panel-head,
.llm-meta-row,
.llm-toggle,
.llm-secure-note {
    display: flex;
    align-items: center;
}

.llm-auth-brand {
    width: fit-content;
    gap: 13px;
    color: var(--llm-text);
    text-decoration: none;
}

.llm-auth-mark,
.llm-logo {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(15, 91, 215, .18);
    background: linear-gradient(135deg, #eef5ff 0%, #f8fbff 100%);
    color: var(--llm-primary);
    box-shadow: 0 12px 26px rgba(15, 91, 215, .10);
}

.llm-auth-mark {
    width: 50px;
    height: 50px;
    border-radius: 14px;
}

.llm-auth-mark svg,
.llm-logo svg {
    width: 28px;
    height: 28px;
    filter: none;
}

.llm-auth-brand strong,
.llm-auth-brand small {
    display: block;
    line-height: 1.15;
}

.llm-auth-brand strong {
    font-size: 17px;
    font-weight: 680;
}

.llm-auth-brand small {
    margin-top: 4px;
    color: var(--llm-muted);
    font-size: 12px;
    font-weight: 600;
}

.llm-hero-copy {
    max-width: 700px;
}

.llm-eyebrow {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 11px;
    border: 1px solid rgba(15, 91, 215, .18);
    border-radius: 999px;
    background: rgba(238, 245, 255, .82);
    color: var(--llm-primary);
    font-size: 12px;
    font-weight: 650;
}

.llm-hero-copy h1 {
    margin: 0;
    color: var(--llm-text);
    font-size: clamp(38px, 5vw, 64px);
    font-weight: 660;
    line-height: 1.02;
    letter-spacing: -.03em;
}

.llm-hero-copy p {
    max-width: 620px;
    margin: 18px 0 0;
    color: var(--llm-muted);
    font-size: 16px;
    line-height: 1.7;
}

.llm-system-panel,
.llm-auth-card {
    border: 1px solid var(--llm-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
    backdrop-filter: blur(14px);
}

.llm-system-panel {
    max-width: 680px;
    padding: 18px;
}

.llm-system-panel-head {
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--llm-border-soft);
}

.llm-system-panel-head span,
.llm-system-grid span {
    display: block;
    color: var(--llm-muted);
    font-size: 12px;
    font-weight: 650;
}

.llm-system-panel-head strong,
.llm-system-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--llm-text);
    font-size: 14px;
    font-weight: 680;
    line-height: 1.25;
}

.llm-state-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(16, 185, 129, .24);
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857 !important;
    font-weight: 680 !important;
}

.llm-state-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--llm-success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}

.llm-system-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.llm-system-grid div {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--llm-border-soft);
    border-radius: 12px;
    background: var(--llm-soft);
}

.llm-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.llm-trust-row span {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--llm-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    color: #334155;
    font-size: 12px;
    font-weight: 650;
}

.llm-auth-card {
    position: relative;
    isolation: auto;
    padding: clamp(28px, 3.6vw, 42px);
    overflow: hidden;
    opacity: 1;
    animation: none;
}

.llm-auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    display: block;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(238, 245, 255, .72), rgba(255, 255, 255, 0) 42%);
    opacity: 1;
    animation: none;
}

.llm-auth-card::after {
    display: none;
}

.llm-brand-row {
    gap: 13px;
    margin-bottom: 28px;
}

.llm-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.llm-brand-title {
    margin: 0;
    color: var(--llm-text);
    font-size: 14px;
    font-weight: 680;
    letter-spacing: 0;
    text-transform: none;
}

.llm-brand-subtitle {
    margin: 4px 0 0;
    color: var(--llm-muted);
    font-size: 12px;
}

.llm-headline {
    margin: 0 0 10px;
    color: var(--llm-text);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 660;
    line-height: 1.1;
    letter-spacing: -.02em;
}

.llm-headline span {
    display: inline;
    background: none;
    color: inherit;
    animation: none;
}

.llm-copy {
    max-width: 440px;
    margin: 0 0 28px;
    color: var(--llm-muted);
    font-size: 14px;
    line-height: 1.6;
}

.llm-login-form {
    display: grid;
    gap: 16px;
}

.llm-field {
    position: relative;
    display: grid;
    gap: 8px;
}

.llm-field label {
    margin: 0;
    color: #334155;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}

.llm-input-shell {
    position: relative;
}

.llm-field input {
    width: 100%;
    height: 48px;
    box-sizing: border-box;
    padding: 0 46px 0 14px;
    border: 1px solid #cbd7e8;
    border-radius: 12px;
    background: #ffffff;
    color: var(--llm-text);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.llm-field input::placeholder {
    color: var(--llm-muted-2);
}

.llm-field input:focus {
    border-color: var(--llm-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(15, 91, 215, .12);
}

.llm-field svg {
    position: absolute;
    right: 14px;
    bottom: 13px;
    width: 20px;
    height: 20px;
    color: var(--llm-muted-2);
}

.llm-meta-row {
    justify-content: space-between;
    gap: 14px;
    margin: 2px 0 6px;
    color: var(--llm-muted);
    font-size: 13px;
}

.llm-toggle {
    gap: 9px;
}

.llm-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--llm-primary);
}

.llm-connect {
    min-height: 46px;
    border: 1px solid var(--llm-primary);
    border-radius: 12px;
    background: var(--llm-primary);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 680;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(15, 91, 215, .18);
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.llm-connect::before {
    display: none;
}

.llm-connect:hover {
    border-color: var(--llm-primary-hover);
    background: var(--llm-primary-hover);
    box-shadow: 0 16px 32px rgba(15, 91, 215, .23);
}

.llm-connect:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(15, 91, 215, .16), 0 14px 28px rgba(15, 91, 215, .18);
}

.llm-connect:active {
    transform: translateY(1px);
}

.llm-secure-note {
    gap: 10px;
    margin-top: 22px;
    padding: 12px;
    border: 1px solid var(--llm-border-soft);
    border-radius: 12px;
    background: #f8fbff;
}

.llm-secure-note span {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--llm-success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}

.llm-secure-note p {
    margin: 0;
    color: var(--llm-muted);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 980px) {
    .llm-auth-shell {
        overflow: auto;
    }

    .llm-auth-stage {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .llm-auth-hero {
        max-width: 760px;
    }

    .llm-auth-card {
        width: min(100%, 560px);
    }
}

@media (max-width: 620px) {
    .llm-auth-main {
        padding: 18px;
    }

    .llm-hero-copy h1 {
        font-size: 34px;
    }

    .llm-system-grid {
        grid-template-columns: 1fr;
    }

    .llm-system-panel,
    .llm-auth-card {
        border-radius: 16px;
    }

    .llm-auth-card {
        padding: 24px;
    }

    .llm-meta-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

.chat-page {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-page .page-header {
    flex: 0 0 auto;
    min-height: 46px;
}

.chat-page .page-header .mud-typography-h4 {
    font-size: clamp(1.35rem, 1vw + 1rem, 1.75rem);
    line-height: 1.1;
}

.chat-header-actions,
.saved-chat-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    overflow: hidden;
}

.chat-shell.saved-rail-collapsed {
    grid-template-columns: 54px minmax(0, 1fr);
}

.saved-chat-rail {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 10px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: rgba(248, 251, 255, .78);
    overflow: hidden;
}

.saved-chat-rail.collapsed {
    align-items: center;
    padding: 8px;
}

.saved-chat-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dbe5f3;
}

.saved-chat-rail.collapsed .saved-chat-head {
    width: 100%;
    flex-direction: column;
    justify-content: flex-start;
    border-bottom: 0;
    padding-bottom: 0;
}

.saved-chat-head span {
    display: block;
    color: #102033;
    font-weight: 700;
}

.saved-chat-head small,
.saved-chat-item small {
    display: block;
    color: #526174;
    font-size: 12px;
}

.saved-chat-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-top: 8px;
}

.saved-chat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
    align-items: stretch;
    margin-bottom: 6px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.saved-chat-row.active {
    border-color: rgba(2, 132, 199, .35);
    background: #e0f2fe;
}

.saved-chat-item {
    min-width: 0;
    border: 0;
    background: transparent;
    color: #102033;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
}

.saved-chat-item:disabled {
    cursor: default;
}

.saved-chat-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    margin-bottom: 2px;
}

.saved-chat-empty {
    min-height: 120px;
    display: grid;
    place-items: center;
    color: #526174;
    border: 1px dashed #cbd7e8;
    border-radius: 8px;
}

.chat-conversation {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: rgba(248, 251, 255, .78);
}

.chat-message {
    margin-bottom: 12px;
    max-width: min(82%, 1180px);
    padding: 10px 12px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #ffffff;
}

.chat-message.user {
    margin-left: auto;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.chat-message.assistant {
    margin-right: auto;
}

.chat-message.assistant.busy {
    display: grid;
    gap: 10px;
    min-width: 230px;
    max-width: min(900px, 88%);
    background:
        radial-gradient(circle at 45% 40%, rgba(79, 216, 255, .08), transparent 58%),
        #ffffff;
}

.chat-busy-status {
    color: #475569;
    font-size: 12px;
    line-height: 1.4;
}

.chat-message span {
    display: block;
    color: #2563eb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 6px;
}

.chat-message.user span {
    color: #059669;
}

.streaming-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.55;
}

.chat-message.image {
    max-width: min(880px, 88%);
    padding: 8px;
    border-color: rgba(14, 165, 233, .22);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.chat-message.audio {
    max-width: min(620px, 84%);
    padding: 10px;
    border-color: rgba(99, 102, 241, .22);
    background:
        radial-gradient(circle at 20% 10%, rgba(79, 216, 255, .12), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.chat-message.image > span {
    margin: 2px 4px 8px;
}

.chat-message.audio > span {
    margin: 2px 4px 8px;
}

.llm-wait-loader {
    --size: 96px;
    --dot-size: 12px;
    position: relative;
    width: var(--size);
    height: var(--size);
    margin: 0 auto;
    background: transparent;
}

.llm-wait-loader::before,
.llm-wait-loader::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    border: 1px dashed rgba(120, 180, 255, .25);
    animation: llm-wait-rotate-ring 7s linear infinite;
}

.llm-wait-loader::after {
    inset: 34px;
    animation-duration: 4.5s;
    animation-direction: reverse;
    opacity: .7;
}

.llm-wait-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--dot-size);
    height: var(--dot-size);
    margin: calc(var(--dot-size) / -2);
    border-radius: 999px;
    background: var(--color);
    box-shadow:
        0 0 10px var(--color),
        0 0 24px var(--color);
    transform: rotate(var(--angle)) translateX(var(--distance));
    animation: llm-wait-orbit var(--speed) ease-in-out infinite;
    animation-delay: var(--delay);
}

.llm-wait-dot::before {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: inherit;
    background: radial-gradient(circle, var(--color), transparent 62%);
    opacity: .18;
    animation: llm-wait-pulse 1.8s ease-in-out infinite;
    animation-delay: var(--delay);
}

.llm-wait-dot::after {
    content: "";
    position: absolute;
    right: 50%;
    top: 50%;
    width: 44px;
    height: 3px;
    border-radius: 999px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent, var(--color));
    opacity: .42;
    filter: blur(.5px);
}

.llm-wait-dot-1 {
    --angle: 0deg;
    --distance: 40px;
    --speed: 2.8s;
    --delay: 0s;
    --color: #4fd8ff;
}

.llm-wait-dot-2 {
    --angle: 70deg;
    --distance: 32px;
    --speed: 3.3s;
    --delay: -.7s;
    --color: #8a7dff;
}

.llm-wait-dot-3 {
    --angle: 140deg;
    --distance: 42px;
    --speed: 2.5s;
    --delay: -1.2s;
    --color: #ff5fb7;
}

.llm-wait-dot-4 {
    --angle: 215deg;
    --distance: 28px;
    --speed: 3.8s;
    --delay: -1.8s;
    --color: #45ffad;
}

.llm-wait-dot-5 {
    --angle: 295deg;
    --distance: 46px;
    --speed: 3.1s;
    --delay: -2.4s;
    --color: #ffc247;
}

.llm-wait-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow:
        0 0 12px rgba(255, 255, 255, .9),
        0 0 34px rgba(90, 200, 255, .7);
    animation: llm-wait-core-breathe 1.4s ease-in-out infinite;
}

@keyframes llm-wait-orbit {
    0% {
        transform: rotate(var(--angle)) translateX(var(--distance)) scale(.82);
    }

    35% {
        transform: rotate(calc(var(--angle) + 130deg)) translateX(calc(var(--distance) * .66)) scale(1.18);
    }

    70% {
        transform: rotate(calc(var(--angle) + 260deg)) translateX(calc(var(--distance) * 1.05)) scale(.95);
    }

    100% {
        transform: rotate(calc(var(--angle) + 360deg)) translateX(var(--distance)) scale(.82);
    }
}

@keyframes llm-wait-rotate-ring {
    to {
        transform: rotate(360deg);
    }
}

@keyframes llm-wait-pulse {
    0%, 100% {
        transform: scale(.65);
        opacity: .12;
    }

    50% {
        transform: scale(1.25);
        opacity: .24;
    }
}

@keyframes llm-wait-core-breathe {
    0%, 100% {
        transform: scale(.75);
        opacity: .75;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.chat-image-response {
    display: grid;
    gap: 8px;
}

.chat-audio-response {
    display: grid;
    gap: 10px;
}

.chat-audio-player {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 8px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #102033 100%);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
}

.chat-audio-player .mud-icon-root {
    width: 34px;
    height: 34px;
    padding: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
}

.chat-audio-player audio,
.chat-audio-list audio {
    width: 100%;
    min-width: 0;
}

.harness-output {
    padding: 16px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: #f8fbff;
    white-space: pre-wrap;
    line-height: 1.55;
}

.harness-log {
    min-height: 260px;
    max-height: clamp(360px, 48vh, 820px);
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: #0f172a;
    color: #dbeafe;
    font-size: .82rem;
    line-height: 1.45;
}

.chat-audio-list {
    display: grid;
    gap: 8px;
}

.chat-image-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 8px;
    background: #0f172a;
    aspect-ratio: 16 / 9;
    max-height: min(58vh, 620px);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
}

.chat-image-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.chat-image-frame img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.chat-image-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 2px 0;
}

.chat-image-meta strong,
.chat-image-meta small {
    display: block;
}

.chat-image-meta strong {
    color: #102033;
    font-size: 14px;
    font-weight: 800;
}

.chat-image-meta small {
    margin-top: 3px;
    color: #526174;
    line-height: 1.35;
}

.chat-image-actions {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
}

.chat-image-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
}

.chat-image-strip a {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 8px;
    background: #0f172a;
    aspect-ratio: 1 / 1;
}

.chat-image-strip img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.chat-message p {
    white-space: pre-wrap;
    margin: 0;
    color: #111827;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.chat-empty {
    height: 100%;
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    color: #526174;
}

.chat-empty .mud-icon-root {
    font-size: 40px;
}

.chat-empty span {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chat-composer {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 112px;
    gap: 8px;
    align-items: stretch;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #ffffff;
}

.chat-input-wrap {
    position: relative;
    min-width: 0;
    display: grid;
    gap: 6px;
}

.mcp-shortcut-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 20;
    max-height: min(360px, 48vh);
    overflow: auto;
    padding: 6px;
    border: 1px solid #c9d8ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
}

.mcp-shortcut-option {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.mcp-shortcut-option:hover,
.mcp-shortcut-option.active {
    background: #eef6ff;
}

.mcp-shortcut-option span {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.mcp-shortcut-option small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mcp-selected-tool {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    max-width: 100%;
    gap: 6px;
    padding: 4px 5px 4px 9px;
    border: 1px solid #b8ddff;
    border-radius: 999px;
    background: #f0f8ff;
    color: #0f426c;
    font-size: 12px;
    font-weight: 800;
}

.mcp-selected-tool span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-composer .mud-input-control {
    margin: 0;
}

.chat-composer textarea {
    min-height: 44px !important;
    max-height: 92px;
    resize: none;
}

.chat-mic-slot {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    min-width: 42px;
}

.chat-recording-preview {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 24px minmax(160px, 260px) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #f8fbff;
}

.chat-recording-preview strong,
.chat-recording-preview small {
    display: block;
}

.chat-recording-preview strong {
    font-size: 12px;
    line-height: 1.2;
}

.chat-recording-preview small {
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
}

.chat-recording-preview audio {
    width: 100%;
    height: 34px;
}

.chat-actions {
    display: flex;
    gap: 8px;
    flex-direction: column;
    justify-content: stretch;
    width: 112px;
}

.chat-actions .mud-button-root {
    flex: 1 1 0;
    min-height: 36px;
}

.cursor {
    color: #2563eb;
    animation: blink 1s steps(2, start) infinite;
}

.svelte-shell {
    height: 620px;
    padding: 0;
    overflow: hidden;
}

.svelte-shell iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.models-page {
    max-width: 2200px;
    margin: 0 auto;
}

.models-header,
.models-runtime,
.models-panel-head,
.download-panel,
.model-name-row,
.catalog-item,
.catalog-meta,
.table-actions,
.models-header-actions {
    display: flex;
    align-items: center;
}

.models-header {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.models-header-actions {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.models-runtime {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(520px, auto);
    align-items: start;
    gap: 16px;
    padding: 18px 20px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(239, 248, 255, .92)) !important;
    border: 1px solid rgba(2, 132, 199, .18);
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
}

.models-runtime-main {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
}

.runtime-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
}

.runtime-copy {
    min-width: 0;
}

.runtime-copy .mud-typography-h6,
.model-name,
.path-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.models-runtime-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(104px, 1fr));
    gap: 8px;
    align-self: start;
}

.runtime-telemetry {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}

.hardware-card {
    min-width: 0;
    min-height: 92px;
    padding: 11px 14px;
    border: 1px solid #dbe5f3;
    border-radius: 9px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

.hardware-card-head,
.hardware-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hardware-card-head span,
.hardware-card-foot span {
    color: #526174;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.hardware-card-head strong,
.hardware-card-foot strong {
    color: #102033;
    font-size: 13px;
}

.hardware-name {
    margin-top: 5px;
    color: #102033;
    font-size: 12px;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hardware-meter {
    height: 7px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6eef8;
}

.hardware-meter span {
    display: block;
    min-width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width .24s ease;
}

.hardware-meter-secondary {
    height: 5px;
    margin-top: 6px;
}

.hardware-meter-secondary span {
    background: linear-gradient(90deg, #0891b2, #2563eb);
}

.hardware-card-foot {
    margin-top: 7px;
}

.hardware-card-foot-muted {
    margin-top: 5px;
}

.hardware-card-foot-muted span,
.hardware-card-foot-muted strong {
    color: #64748b;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
}

.runtime-stat {
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid #dbe5f3;
    border-radius: 9px;
    background: rgba(255, 255, 255, .72);
}

.runtime-stat span {
    display: block;
    margin-bottom: 4px;
    color: #526174;
    font-size: 11px;
    font-weight: 700;
}

.runtime-stat strong {
    color: #102033;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.models-panel {
    min-height: clamp(520px, calc(100vh - 340px), 1160px);
}

.models-tabs {
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(37, 99, 235, .12);
    border-radius: 8px;
    padding: 8px;
}

.models-tabs .mud-tabs-toolbar {
    background: transparent;
}

.models-tab-panel {
    padding-top: 14px;
}

.models-panel-head {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.models-panel-head.compact {
    min-height: 44px;
}

.models-search {
    width: min(420px, 100%);
}

.models-table .mud-table-cell {
    vertical-align: middle;
}

.model-name-row {
    gap: 10px;
    min-width: 0;
}

.model-name-row > div {
    min-width: 0;
}

.model-name {
    max-width: 740px;
    font-weight: 700 !important;
    color: #102033;
}

.path-text {
    display: block;
    max-width: 820px;
}

.table-actions {
    justify-content: flex-end;
    gap: 4px;
}

.catalog-panel {
    display: flex;
    flex-direction: column;
}

.catalog-list {
    display: grid;
    gap: 10px;
    overflow-y: auto;
    max-height: clamp(420px, calc(100vh - 430px), 980px);
    padding-right: 4px;
}

.catalog-item {
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: rgba(248, 251, 255, .78);
}

.catalog-item > div:first-child {
    min-width: 0;
}

.catalog-meta {
    gap: 8px;
    color: #526174;
    font-size: 12px;
    white-space: nowrap;
}

.download-panel {
    justify-content: space-between;
    gap: 18px;
}

.download-fields {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(180px, 260px) auto;
    gap: 12px;
    align-items: center;
}

.hf-search-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.catalog-section-label {
    color: #526174;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.repo-text {
    display: block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-defaults-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.model-defaults-row span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 7px;
    border: 1px solid #dbe5f3;
    border-radius: 999px;
    background: #f8fbff;
    color: #526174;
    font-size: 12px;
    line-height: 1;
}

.active-profile-indicator,
.model-profile-head,
.model-profile-meta {
    display: flex;
    align-items: center;
}

.active-profile-indicator {
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 8px;
    background: rgba(239, 248, 255, .82) !important;
    color: #0f4f8a;
}

.model-profile-dialog .mud-dialog-content {
    min-width: min(980px, calc(100vw - 48px));
}

.model-profile-head {
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.model-profile-head > div {
    min-width: 0;
}

.model-profile-head .mud-typography-caption {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-profile-meta {
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.model-profile-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid #dbe5f3;
    border-radius: 999px;
    background: #f8fbff;
    color: #526174;
    font-size: 12px;
    line-height: 1;
}

.model-profile-tabs {
    border: 1px solid rgba(37, 99, 235, .12);
    border-radius: 8px;
    padding: 8px;
}

.profile-console {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-console-head,
.profile-editor-head,
.profile-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.profile-list-panel,
.profile-editor-panel {
    border: 1px solid #dbe5f3;
    border-radius: 10px;
    background: rgba(255, 255, 255, .96) !important;
}

.profile-list-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.profile-editor-panel {
    min-width: 0;
    padding: 14px;
}

.profile-api-model-id {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 4px;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fbff;
}

.profile-api-model-id code {
    display: block;
    margin-top: 2px;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: .85rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.profile-list-item {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.profile-list-item:hover,
.profile-list-item.selected {
    border-color: rgba(37, 99, 235, .2);
    background: #f3f8ff;
}

.profile-list-item strong,
.profile-list-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-list-item small {
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
}

.profile-badges {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.profile-badges em {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eaf3ff;
    color: #0f5bd7;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.profile-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.profile-footer-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5edf6;
}

@media (max-width: 980px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

.download-progress-panel {
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .94) !important;
    border: 1px solid rgba(2, 132, 199, .18);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.download-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.model-load-progress-panel {
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(240, 253, 244, .95) !important;
    border: 1px solid rgba(22, 163, 74, .24);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.model-load-progress-copy {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.model-load-progress-copy .model-name {
    max-width: none;
}

.model-load-error-panel {
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(255, 247, 237, .96) !important;
    border: 1px solid rgba(220, 38, 38, .26);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(127, 29, 29, .08);
}

.model-load-error-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.model-load-error-title {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    color: #7f1d1d;
}

.model-load-error-title .mud-icon-root {
    color: #dc2626;
}

.model-load-error-title .mud-typography-body1 {
    font-weight: 800;
    color: #7f1d1d;
}

.model-load-error-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.model-load-error-grid div,
.model-load-error-detail,
.model-load-error-hints {
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(248, 113, 113, .18);
    border-radius: 8px;
    padding: 10px 12px;
}

.model-load-error-grid span,
.model-load-error-detail span,
.model-load-error-hints span {
    display: block;
    color: #9f1239;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.model-load-error-grid strong {
    display: block;
    margin-top: 2px;
    color: #111827;
}

.model-load-error-detail {
    margin-bottom: 12px;
}

.model-load-error-detail code {
    display: block;
    margin-top: 6px;
    color: #1f2937;
    white-space: pre-wrap;
    word-break: break-word;
}

.model-load-error-hints {
    margin-bottom: 12px;
}

.model-load-error-hints ul {
    margin: 8px 0 0;
    padding-left: 18px;
    color: #1f2937;
}

.model-load-error-logs {
    border: 1px solid rgba(248, 113, 113, .2);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
    padding: 10px 12px;
}

.model-load-error-logs summary {
    cursor: pointer;
    color: #7f1d1d;
    font-weight: 800;
}

.model-load-error-logs pre {
    max-height: 280px;
    overflow: auto;
    margin: 10px 0 0;
    padding: 12px;
    border-radius: 8px;
    background: #111827;
    color: #f8fafc;
    font-size: .78rem;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .model-load-error-head {
        flex-direction: column;
    }

    .model-load-error-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.code-needle-page {
    max-width: 2200px;
    margin: 0 auto;
}

.code-needle-controls {
    display: grid;
    gap: 14px;
}

.code-needle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.code-needle-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.code-needle-source {
    padding: 12px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #f8fbff;
    min-width: 0;
}

.code-needle-source span,
.code-needle-source small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.code-needle-source span {
    color: #102033;
    font-weight: 700;
}

.code-needle-source small {
    color: #526174;
}

.code-needle-results {
    min-height: clamp(620px, calc(100vh - 180px), 1320px);
}

.code-needle-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.code-needle-summary div {
    padding: 12px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #f8fbff;
}

.code-needle-summary span {
    display: block;
    color: #526174;
    font-size: 12px;
    margin-bottom: 4px;
}

.code-needle-summary strong {
    color: #102033;
}

.code-needle-targets {
    display: grid;
    gap: 12px;
    max-height: clamp(520px, calc(100vh - 340px), 1120px);
    overflow-y: auto;
    padding-right: 4px;
}

.code-needle-target {
    padding: 12px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #ffffff;
}

.code-needle-target.passed {
    border-color: #bbf7d0;
}

.code-needle-target.failed {
    border-color: #fecaca;
}

.code-needle-target-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.code-needle-diff {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.code-needle-diff > div {
    min-width: 0;
}

.code-needle-diff span {
    display: block;
    color: #526174;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.needle-line {
    margin: 0 0 3px;
    padding: 5px 7px;
    border-radius: 6px;
    overflow-x: auto;
    background: #f8fafc;
    color: #111827;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 12px;
    line-height: 1.35;
    white-space: pre;
}

.needle-line.matched {
    background: #e5e7eb;
}

.needle-line.missing {
    background: #fed7aa;
}

.needle-line.hallucinated {
    background: #fef08a;
}

.settings-panel {
    min-height: clamp(520px, calc(100vh - 190px), 1240px);
}

.settings-grid {
    padding-top: 14px;
}

.settings-tabs .mud-tabs-panels {
    padding-top: 12px;
}

.settings-prompt textarea {
    min-height: clamp(420px, calc(100vh - 330px), 980px) !important;
    font-family: Consolas, "Cascadia Mono", monospace;
    line-height: 1.45;
}

.settings-switch {
    display: flex;
    align-items: center;
    min-height: 76px;
}

.settings-help-text {
    display: block;
    max-width: 280px;
    margin-top: -4px;
    line-height: 1.25;
}

.api-grid .panel,
.api-test-panel {
    height: 100%;
}

.api-tabs-panel {
    min-height: clamp(620px, calc(100vh - 190px), 1280px);
}

.api-tabs .mud-tabs-panels {
    padding-top: 14px;
}

.api-table code {
    word-break: break-all;
}

.api-log-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.api-log-table code {
    font-size: 12px;
    word-break: break-word;
}

.api-log-message {
    min-width: min(520px, 38vw);
    white-space: normal;
    word-break: break-word;
}

.api-log-model {
    max-width: 260px;
    word-break: break-word;
}

.api-log-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 150px;
}

.api-log-stats span {
    border: 1px solid #dbe5f3;
    border-radius: 999px;
    background: #f8fbff;
    color: #526174;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 5px 7px;
    white-space: nowrap;
}

.mcp-header-actions,
.panel-title-row,
.mcp-server-head,
.mcp-card-actions,
.mcp-tool-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mcp-grid {
    align-items: stretch;
}

.mcp-panel {
    min-height: clamp(620px, calc(100vh - 190px), 1280px);
}

.mcp-server-list,
.mcp-tool-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    max-height: clamp(520px, calc(100vh - 290px), 1160px);
    overflow-y: auto;
    padding-right: 4px;
}

.mcp-server-card,
.mcp-tool-group,
.mcp-tool-row {
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
}

.mcp-tool-group {
    display: grid;
    gap: 10px;
}

.mcp-tool-row {
    background: #f8fbff;
}

.mcp-tool-row span,
.mcp-tool-row small,
.mcp-tool-row code {
    display: block;
}

.mcp-tool-row span {
    color: #102033;
    font-weight: 800;
}

.mcp-tool-row small {
    color: #526174;
    margin-top: 3px;
}

.mcp-tool-row code {
    margin-top: 8px;
    max-height: 140px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.mcp-pending-card {
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #f0f9ff;
    padding: 12px;
    margin-top: 10px;
}

.mcp-pending-card pre,
.chat-message.tool pre {
    margin: 8px 0;
    max-height: 240px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.agent-task-stack {
    display: grid;
    gap: 8px;
    margin: 8px 0;
}

.agent-task-card {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #c9d8ee;
    border-left: 4px solid #0284c7;
    border-radius: 8px;
    background: #f8fbff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.agent-task-card.complete {
    border-left-color: #059669;
}

.agent-task-card.error {
    border-left-color: #dc2626;
    background: #fff7f7;
}

.agent-task-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.agent-task-head strong,
.agent-task-head small {
    display: block;
}

.agent-task-head strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.25;
}

.agent-task-head small {
    margin-top: 2px;
    color: #526174;
    font-size: 11px;
}

.agent-task-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.agent-task-card p {
    margin: 0;
    color: #334155;
    font-size: 12px;
    line-height: 1.45;
}

.chat-message.tool {
    border-color: #c7d2fe;
    background: #eef2ff;
}

.chat-doc-card {
    display: grid;
    gap: 12px;
    max-width: min(920px, 100%);
}

.chat-doc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
}

.chat-doc-head strong {
    display: block;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.35;
}

.chat-doc-head small {
    display: block;
    margin-top: 4px;
    color: #2563eb;
    text-transform: none;
    letter-spacing: 0;
}

.chat-doc-summary {
    margin: 0;
    padding: 0 2px;
    color: #334155;
    line-height: 1.55;
}

.chat-doc-body {
    display: grid;
    gap: 10px;
    max-height: min(58vh, 720px);
    overflow: auto;
    padding-right: 4px;
}

.chat-doc-body p {
    margin: 0;
    color: #111827;
    line-height: 1.55;
    white-space: pre-wrap;
}

.chat-doc-body pre {
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: #0f172a;
    color: #e5eefc;
    overflow: auto;
    white-space: pre-wrap;
}

.admin-table-wrap {
    margin-top: 16px;
    overflow: auto;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5edf7;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: #526174;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: #f8fbff;
}

.admin-table tr.active td {
    background: #eff6ff;
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.permission-check {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 4px 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #f8fbff;
}

.permission-check input {
    grid-row: span 2;
}

.permission-check > input {
    grid-row: span 3;
}

.permission-check span {
    color: #111827;
    font-weight: 700;
}

.permission-check small {
    color: #526174;
}

.permission-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #526174;
    font-size: .78rem;
}

.permission-menu-toggle input {
    grid-row: auto;
}

.permission-menu-toggle span {
    color: #526174;
    font-size: .78rem;
    font-weight: 600;
}

.code-block {
    margin: 0;
    max-height: clamp(240px, 28vh, 680px);
    overflow: auto;
    padding: 14px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #0f172a;
    color: #e5eefc;
    white-space: pre-wrap;
}

.model-empty {
    min-height: 280px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: #526174;
    border: 1px dashed #cbd7e8;
    border-radius: 8px;
    background: rgba(248, 251, 255, .68);
    text-align: center;
}

.model-empty .mud-icon-root {
    color: #0284c7;
    font-size: 34px;
}

.model-empty.compact {
    min-height: 140px;
}

.tts-audio-player {
    display: block;
    width: min(100%, 760px);
    margin: 14px 0 8px;
}

.tts-output-row-player {
    width: min(100%, 420px);
    min-width: 260px;
}

/* Chat assistant workspace */
body:has(.chat-page) .mud-drawer {
    display: none !important;
}

body:has(.chat-page) .mud-main-content {
    margin-left: 0 !important;
    padding-top: 0 !important;
}

.app-container:has(.chat-page) {
    width: 100%;
    max-width: none;
    padding: 12px !important;
}

.chat-page {
    min-height: calc(100dvh - 24px);
    color: #172033;
}

.chat-page .chat-shell {
    height: calc(100dvh - 24px);
    min-height: 0;
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(198, 207, 225, .74);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(36, 48, 78, .12);
}

.chat-page .chat-shell.saved-rail-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
}

.chat-page .saved-chat-rail {
    min-width: 0;
    padding: 24px;
    gap: 16px;
    border: 0;
    border-right: 1px solid #e4e9f4;
    border-radius: 0;
    background: #fbfcff;
}

.chat-page .saved-chat-rail.collapsed {
    padding: 18px 12px;
    align-items: center;
}

.chat-page .saved-chat-head {
    padding: 0;
    border: 0;
}

.chat-page .saved-chat-rail.collapsed .saved-chat-head {
    gap: 10px;
}

.chat-brand-lockup,
.chat-session-title,
.chat-session-actions,
.chat-submit-row,
.chat-composer-hints,
.chat-composer-tabs,
.chat-server-meta {
    display: flex;
    align-items: center;
}

.chat-brand-lockup {
    min-width: 0;
    gap: 14px;
}

.chat-brand-lockup strong,
.chat-brand-lockup small,
.chat-server-card strong,
.chat-server-card small,
.chat-session-title strong,
.chat-session-title small {
    display: block;
}

.chat-brand-lockup strong,
.chat-session-title strong,
.chat-server-card strong {
    color: #172033;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
}

.chat-brand-lockup small,
.chat-session-title small,
.chat-server-card small {
    margin-top: 4px;
    color: #66738c;
    font-size: 12px;
    line-height: 1.25;
}

.chat-brand-icon,
.chat-session-icon,
.chat-server-icon,
.chat-empty-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.chat-brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #2f65ff 0%, #8257e6 100%);
    box-shadow: 0 16px 34px rgba(72, 88, 220, .26);
}

.chat-brand-icon .mud-icon-root {
    color: #ffffff;
    font-size: 28px;
}

.chat-page .chat-new-button.mud-button-root {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    text-transform: none;
    font-weight: 800;
    background: linear-gradient(135deg, #2f65ff 0%, #8355e8 100%);
    box-shadow: 0 14px 30px rgba(66, 82, 220, .22);
}

.saved-chat-search {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid #dde4f1;
    border-radius: 12px;
    background: #ffffff;
}

.saved-chat-search .mud-icon-root {
    color: #7a869d;
}

.saved-chat-search input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #172033;
    font-size: 14px;
}

.saved-chat-search input::placeholder {
    color: #98a3b6;
}

.saved-chat-search button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #7a869d;
    cursor: pointer;
}

.saved-chat-search button:hover {
    background: #eef3fb;
}

.saved-chat-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px;
}

.saved-chat-section-label span {
    color: #66738c;
    font-size: 12px;
    font-weight: 800;
}

.saved-chat-section-label small {
    color: #8b96aa;
    font-size: 11px;
}

.chat-page .saved-chat-list {
    padding-top: 0;
    scrollbar-width: thin;
}

.chat-page .saved-chat-row {
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.chat-page .saved-chat-row:hover {
    border-color: #e0e6f4;
    background: #ffffff;
}

.chat-page .saved-chat-row.active {
    border-color: #d9ddff;
    background: #f0f2ff;
    box-shadow: inset 0 0 0 1px rgba(91, 103, 238, .08);
}

.chat-page .saved-chat-item {
    min-height: 48px;
    padding: 10px 8px 10px 12px;
}

.chat-page .saved-chat-item span {
    margin-bottom: 4px;
    color: #26324a;
    font-size: 13px;
    font-weight: 800;
}

.chat-page .saved-chat-item small {
    overflow: hidden;
    color: #7a869d;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-page .saved-chat-empty {
    min-height: 150px;
    border-color: #dde4f1;
    border-radius: 12px;
    background: #ffffff;
    color: #7a869d;
}

.chat-server-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-top: auto;
    padding: 16px;
    border: 1px solid #e6dffb;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
}

.chat-server-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: #eef2ff;
    color: #3f5af7;
}

.chat-server-meta {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-server-meta span {
    max-width: 100%;
    overflow: hidden;
    padding: 6px 9px;
    border-radius: 999px;
    background: #ffffff;
    color: #59667f;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 6px 11px;
    border: 1px solid #dbe3f3;
    border-radius: 999px;
    background: #ffffff;
    color: #59667f;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.chat-status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #9ca8bb;
}

.chat-status-pill.online {
    border-color: rgba(34, 197, 94, .3);
    background: #f0fdf4;
    color: #166534;
}

.chat-status-pill.online::before {
    background: #22c55e;
}

.chat-status-pill.idle {
    border-color: rgba(245, 158, 11, .34);
    background: #fffbeb;
    color: #92400e;
}

.chat-status-pill.idle::before {
    background: #f59e0b;
}

.chat-page .chat-conversation {
    display: grid;
    grid-template-rows: 84px minmax(0, 1fr) auto;
    min-width: 0;
    background: #ffffff;
}

.chat-session-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
    padding: 0 28px;
    border-bottom: 1px solid #e6ebf4;
    background: rgba(255, 255, 255, .94);
}

.chat-session-title {
    min-width: 0;
    gap: 14px;
}

.chat-session-title > div:last-child {
    min-width: 0;
}

.chat-session-title strong {
    overflow: hidden;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-session-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f0f3f8;
    color: #53627a;
}

.chat-session-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 10px;
}

.chat-model-pill {
    min-height: 42px;
    max-width: min(360px, 34vw);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    padding: 0 14px;
    border: 1px solid #dde4f1;
    border-radius: 12px;
    background: #ffffff;
    color: #27334d;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-page .chat-log {
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    padding: 34px clamp(28px, 7vw, 104px) 28px;
    scrollbar-width: thin;
}

.chat-page .chat-message {
    position: relative;
    max-width: min(800px, 78%);
    margin-bottom: 26px;
    padding: 16px 20px;
    border: 1px solid #dfe5f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 14px 36px rgba(30, 42, 68, .07);
}

.chat-page .chat-message.assistant {
    margin-left: 68px;
    margin-right: auto;
}

.chat-page .chat-message.assistant::before {
    content: "";
    position: absolute;
    left: -68px;
    top: 0;
    width: 44px;
    height: 44px;
    border: 1px solid #dfe5f0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
    box-shadow: 0 10px 24px rgba(66, 82, 220, .12);
}

.chat-page .chat-message.user {
    margin-left: auto;
    margin-right: 0;
    border-color: #cdd7ff;
    background: linear-gradient(135deg, #eef2ff 0%, #f8f7ff 100%);
    box-shadow: 0 14px 36px rgba(78, 88, 220, .09);
}

.chat-page .chat-message.image,
.chat-page .chat-message.audio {
    max-width: min(860px, 86%);
}

.chat-page .chat-message span {
    margin-bottom: 8px;
    color: #56637a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.chat-page .chat-message.user span {
    color: #4b58da;
}

.chat-page .chat-message p,
.chat-page .streaming-text {
    color: #26324a;
    font-size: 15px;
    line-height: 1.65;
}

.chat-page .chat-message p strong {
    color: #172033;
}

.chat-page .chat-message.assistant.busy {
    min-width: 260px;
    background: #ffffff;
}

.chat-page .chat-empty {
    height: 100%;
    max-width: 460px;
    margin: 0 auto;
    text-align: center;
}

.chat-empty-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 2px;
    border: 1px solid #dfe5f0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
}

.chat-page .chat-empty strong {
    color: #172033;
    font-size: 18px;
    font-weight: 800;
}

.chat-page .chat-empty span {
    max-width: 360px;
    color: #66738c;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.5;
    text-transform: none;
}

.chat-page .chat-composer {
    width: min(1180px, calc(100% - 56px));
    margin: 0 auto 28px;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid #cdd7ff;
    border-radius: 16px;
    background: #ffffff;
    box-shadow:
        0 0 0 4px rgba(105, 92, 230, .08),
        0 16px 38px rgba(42, 54, 92, .12);
}

.chat-composer-tabs {
    gap: 8px;
    padding: 0 4px 8px;
    border-bottom: 1px solid #edf1f7;
}

.chat-composer-tabs span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 9px;
    color: #66738c;
    font-size: 12px;
    font-weight: 800;
}

.chat-composer-tabs span.active {
    background: #eef2ff;
    color: #3f5af7;
}

.chat-page .chat-input-wrap {
    padding: 10px 4px 4px;
    gap: 8px;
}

.chat-page .chat-composer .mud-input-control {
    margin: 0;
}

.chat-page .chat-composer .mud-input-control-input-container {
    margin: 0;
}

.chat-page .chat-composer .mud-input-outlined {
    background: transparent;
}

.chat-page .chat-composer .mud-input-outlined-border {
    border-color: transparent !important;
}

.chat-page .chat-composer textarea {
    min-height: 68px !important;
    max-height: 160px;
    padding: 0 !important;
    color: #26324a;
    font-size: 15px;
    line-height: 1.5;
}

.chat-page .chat-composer textarea::placeholder {
    color: #98a3b6;
}

.chat-composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 4px 2px;
}

.chat-composer-hints {
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.chat-composer-hints span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #f4f7fb;
    color: #66738c;
    font-size: 12px;
    font-weight: 700;
}

.chat-submit-row {
    flex: 0 0 auto;
    gap: 10px;
}

.chat-page .chat-mic-slot {
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chat-page .chat-actions {
    width: auto;
    flex-direction: row;
    gap: 8px;
}

.chat-page .chat-composer .chat-actions .mud-button-root {
    min-width: 132px;
    min-height: 44px;
    border-radius: 10px;
    text-transform: none;
    font-weight: 800;
    background: linear-gradient(135deg, #2f65ff 0%, #8355e8 100%);
}

.chat-page .mcp-pending-card .chat-actions {
    width: auto;
    flex-direction: row;
}

.chat-page .chat-recording-preview {
    margin-top: 10px;
    border-color: #dde4f1;
    border-radius: 12px;
    background: #f8faff;
}

@media (max-width: 1200px) {
    .chat-page .chat-shell {
        grid-template-columns: 360px minmax(0, 1fr);
    }

    .chat-page .chat-log {
        padding-inline: 28px;
    }

    .chat-model-pill {
        max-width: 260px;
    }
}

@media (max-width: 900px) {
    .app-container:has(.chat-page) {
        padding: 0 !important;
    }

    .chat-page,
    .chat-page .chat-shell {
        min-height: 100dvh;
    }

    .chat-page .chat-shell {
        height: 100dvh;
        grid-template-columns: 1fr;
        border: 0;
        border-radius: 0;
    }

    .chat-page .chat-shell.saved-rail-collapsed {
        grid-template-columns: 1fr;
    }

    .chat-page .saved-chat-rail {
        max-height: 250px;
        padding: 16px;
        border-right: 0;
        border-bottom: 1px solid #e4e9f4;
    }

    .chat-page .saved-chat-rail.collapsed {
        max-height: 70px;
        align-items: stretch;
    }

    .chat-page .saved-chat-rail.collapsed .saved-chat-head {
        flex-direction: row;
        justify-content: center;
    }

    .chat-server-card {
        display: none;
    }

    .chat-page .chat-conversation {
        min-height: 0;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .chat-session-bar {
        min-height: 74px;
        padding: 14px 16px;
        flex-wrap: wrap;
    }

    .chat-session-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .chat-model-pill {
        max-width: 100%;
    }

    .chat-page .chat-log {
        padding: 20px 16px;
    }

    .chat-page .chat-message,
    .chat-page .chat-message.image,
    .chat-page .chat-message.audio {
        max-width: 100%;
    }

    .chat-page .chat-message.assistant {
        margin-left: 0;
    }

    .chat-page .chat-message.assistant::before {
        display: none;
    }

    .chat-page .chat-composer {
        width: calc(100% - 24px);
        margin-bottom: 12px;
    }

    .chat-composer-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .chat-submit-row {
        justify-content: space-between;
    }

    .chat-page .chat-composer .chat-actions .mud-button-root {
        min-width: 118px;
    }
}

@keyframes blink {
    to { visibility: hidden; }
}

@media (max-width: 900px) {
    .app-container {
        padding: 16px !important;
    }

    .chat-page {
        height: 100%;
        min-height: 0;
    }

    .main-surface:has(.chat-page) {
        height: 100dvh;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .models-header,
    .models-runtime,
    .download-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .models-runtime {
        grid-template-columns: 1fr;
    }

    .models-header-actions {
        justify-content: flex-start;
    }

    .models-runtime-stats,
    .runtime-telemetry,
    .download-fields,
    .hf-search-box,
    .code-needle-grid,
    .code-needle-summary,
    .code-needle-diff {
        grid-template-columns: 1fr;
    }

    .models-panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .models-search {
        width: 100%;
    }

    .chat-shell {
        grid-template-columns: 1fr;
    }

    .chat-shell.saved-rail-collapsed {
        grid-template-columns: 1fr;
    }

    .saved-chat-rail {
        max-height: 220px;
    }

    .saved-chat-rail.collapsed {
        max-height: none;
    }

    .saved-chat-rail.collapsed .saved-chat-head {
        flex-direction: row;
    }

    .chat-composer {
        grid-template-columns: 1fr;
    }

    .chat-mic-slot {
        min-height: 44px;
    }

    .chat-recording-preview {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .chat-recording-preview audio {
        grid-column: 1 / -1;
    }

    .chat-message {
        max-width: 100%;
    }

    .chat-message.image {
        max-width: 100%;
    }

    .chat-image-meta {
        flex-direction: column;
    }

    .chat-actions {
        flex-direction: row;
        width: 100%;
    }

    .page-header .mud-button-root {
        width: 100%;
    }
}

@media (min-width: 1800px) {
    .dashboard-metrics {
        --mud-grid-spacing: 32px;
    }

    .chat-message p,
    .mud-table-root,
    .mud-input-control {
        font-size: 1.02rem;
    }
}

