:root {
    --workspace-bg: #ffffff;
    --workspace-sidebar: #f7f7f5;
    --workspace-surface: #ffffff;
    --workspace-surface-soft: #f4f4f2;
    --workspace-surface-hover: #ececea;
    --workspace-text: #202123;
    --workspace-text-strong: #111214;
    --workspace-muted: #6f706f;
    --workspace-subtle: #969792;
    --workspace-border: #e3e3df;
    --workspace-border-strong: #d2d2cd;
    --workspace-accent: #2563eb;
    --workspace-accent-soft: #eef4ff;
    --workspace-danger: #c93b36;
    --workspace-shadow-menu: 0 16px 42px rgba(24, 24, 22, .12), 0 2px 8px rgba(24, 24, 22, .06);
    --workspace-shadow-composer: 0 2px 12px rgba(24, 24, 22, .08);
    --workspace-sidebar-width: 248px;
    --workspace-sidebar-collapsed: 64px;
    --workspace-content-width: 780px;
    --workspace-radius-sm: 8px;
    --workspace-radius-input: 24px;
    --workspace-transition: 180ms ease;
}

body.workspace-v2:not(.tool-open) {
    margin: 0;
    overflow: hidden;
    background: var(--workspace-bg);
    color: var(--workspace-text);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.workspace-v2:not(.tool-open) > .navbar,
body.workspace-v2:not(.tool-open) > footer {
    display: none !important;
}

body.workspace-v2:not(.tool-open) #mainContent.container {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
}

body.workspace-v2:not(.tool-open) #homeView {
    min-height: 100dvh;
}

button,
textarea,
select,
input {
    font: inherit;
}

.ai-workspace {
    display: grid;
    grid-template-columns: var(--workspace-sidebar-width) minmax(0, 1fr);
    width: 100%;
    height: 100dvh;
    min-height: 620px;
    overflow: hidden;
    background: var(--workspace-bg);
    transition: grid-template-columns var(--workspace-transition);
}

.workspace-sidebar {
    position: relative;
    z-index: 30;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100dvh;
    overflow: hidden;
    padding: 12px 10px 10px;
    background: var(--workspace-sidebar);
    border-right: 1px solid var(--workspace-border);
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    gap: 8px;
    padding: 0 2px 8px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
    padding-left: 4px;
}

.sidebar-logo {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    object-fit: cover;
    border-radius: 7px;
}

.sidebar-brand > div {
    min-width: 0;
}

.sidebar-brand strong {
    display: block;
    overflow: hidden;
    color: var(--workspace-text-strong);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-brand span {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: var(--workspace-subtle);
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-collapse-btn,
.sidebar-settings-btn,
.topbar-icon-btn,
.mobile-sidebar-toggle {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    padding: 0;
    color: var(--workspace-muted);
    background: transparent;
    border: 0;
    border-radius: var(--workspace-radius-sm);
    cursor: pointer;
    transition: color var(--workspace-transition), background var(--workspace-transition);
}

.sidebar-collapse-btn:hover,
.sidebar-settings-btn:hover,
.topbar-icon-btn:hover,
.mobile-sidebar-toggle:hover {
    color: var(--workspace-text-strong);
    background: var(--workspace-surface-hover);
}

.sidebar-collapse-btn:focus-visible,
.sidebar-settings-btn:focus-visible,
.topbar-icon-btn:focus-visible,
.mobile-sidebar-toggle:focus-visible,
.workspace-nav-item:focus-visible,
.new-chat-btn:focus-visible,
.tool-library-card:focus-visible,
.omnibox button:focus-visible,
.action-pill:focus-visible {
    outline: 2px solid var(--workspace-accent);
    outline-offset: 2px;
}

.sidebar-collapse-btn i,
.sidebar-settings-btn i,
.topbar-icon-btn i,
.mobile-sidebar-toggle i {
    font-size: 20px;
}

.new-chat-btn {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    gap: 10px;
    margin: 4px 0 8px;
    padding: 7px 10px;
    color: var(--workspace-text-strong);
    text-align: left;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-border);
    border-radius: var(--workspace-radius-sm);
    box-shadow: 0 1px 2px rgba(24, 24, 22, .03);
    cursor: pointer;
    transition: border-color var(--workspace-transition), background var(--workspace-transition), box-shadow var(--workspace-transition);
}

.new-chat-btn:hover {
    background: #fbfbfa;
    border-color: var(--workspace-border-strong);
    box-shadow: 0 2px 7px rgba(24, 24, 22, .06);
}

.sidebar-action-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.sidebar-action-icon i {
    font-size: 18px;
}

.new-chat-btn strong {
    font-size: 14px;
    font-weight: 600;
}

.workspace-nav {
    display: grid;
    gap: 2px;
}

.workspace-nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 40px;
    gap: 10px;
    padding: 7px 10px;
    color: var(--workspace-muted);
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: var(--workspace-radius-sm);
    cursor: pointer;
    transition: color var(--workspace-transition), background var(--workspace-transition);
}

.workspace-nav-item:hover {
    color: var(--workspace-text-strong);
    background: var(--workspace-surface-hover);
}

.workspace-nav-item.is-active {
    color: var(--workspace-text-strong);
    background: #e9e9e6;
    font-weight: 600;
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.nav-icon i {
    font-size: 19px;
}

.nav-label {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-section.history-section {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    margin-top: 18px;
}

.sidebar-section-title {
    padding: 0 10px 7px;
    color: var(--workspace-subtle);
    font-size: 12px;
    font-weight: 500;
}

.chat-history-list {
    min-height: 0;
    overflow-x: visible;
    overflow-y: auto;
    padding: 0 1px 12px;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.chat-history-list:hover {
    scrollbar-color: #c9c9c4 transparent;
}

.history-empty {
    width: 100%;
    padding: 9px 10px;
    color: var(--workspace-subtle);
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: var(--workspace-radius-sm);
    cursor: pointer;
}

.history-item {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 38px;
    border-radius: var(--workspace-radius-sm);
}

.history-item:hover,
.history-item.is-active {
    background: var(--workspace-surface-hover);
}

.history-main {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
    gap: 6px;
    padding: 8px 4px 8px 10px;
    color: var(--workspace-muted);
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.history-item.is-active .history-main {
    color: var(--workspace-text-strong);
}

.history-title {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-time {
    flex: 0 0 auto;
    color: var(--workspace-subtle);
    font-size: 10px;
}

.history-pin {
    color: var(--workspace-subtle);
    font-size: 13px;
}

.history-more {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    margin-right: 2px;
    padding: 0;
    color: var(--workspace-muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    opacity: 0;
    cursor: pointer;
}

.history-item:hover .history-more,
.history-more:focus-visible,
.history-item:focus-within .history-more {
    opacity: 1;
}

.history-more:hover {
    background: #deded9;
}

.history-menu {
    position: fixed;
    z-index: 1200;
    width: 138px;
    padding: 5px;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-border);
    border-radius: var(--workspace-radius-sm);
    box-shadow: var(--workspace-shadow-menu);
}

.history-menu[hidden] {
    display: none !important;
}

.history-menu button {
    width: 100%;
    min-height: 34px;
    padding: 6px 9px;
    color: var(--workspace-text);
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.history-menu button:hover {
    background: var(--workspace-surface-soft);
}

.history-menu button:last-child {
    color: var(--workspace-danger);
}

.sidebar-user {
    display: flex;
    align-items: center;
    min-height: 50px;
    gap: 9px;
    padding: 6px 4px 0;
    border-top: 1px solid var(--workspace-border);
}

.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    background: #282a2d;
    border-radius: 50%;
}

.sidebar-user-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.sidebar-user-meta strong,
.sidebar-user-meta span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-meta strong {
    color: var(--workspace-text-strong);
    font-size: 13px;
    font-weight: 600;
}

.sidebar-user-meta span {
    margin-top: 2px;
    color: var(--workspace-subtle);
    font-size: 11px;
}

.sidebar-settings-btn {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
}

.chat-main {
    position: relative;
    display: flex;
    min-width: 0;
    height: 100dvh;
    flex-direction: column;
    overflow: hidden;
    background: var(--workspace-bg);
}

.chat-topbar {
    position: relative;
    z-index: 25;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 56px;
    padding: 0 16px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid transparent;
    backdrop-filter: blur(12px);
}

.workspace-view-title {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 4px;
    color: var(--workspace-text-strong);
    font-size: 14px;
    font-weight: 600;
}

.workspace-view-title span {
    max-width: min(52vw, 460px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-view-title button {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--workspace-subtle);
    background: transparent;
    border: 0;
    border-radius: 6px;
    opacity: 0;
    cursor: pointer;
    transition: opacity var(--workspace-transition), background var(--workspace-transition);
}

.workspace-view-title:hover button,
.workspace-view-title button:focus-visible {
    opacity: 1;
}

.workspace-view-title button:hover {
    background: var(--workspace-surface-soft);
}

.workspace-top-actions {
    grid-column: 3;
    justify-self: end;
    pointer-events: auto;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border: 1px solid transparent;
    pointer-events: auto;
}

.topbar-icon-btn:hover {
    border-color: var(--workspace-border);
    background: var(--workspace-surface);
}

.mobile-brand,
.mobile-sidebar-toggle {
    display: none;
}

.chat-scroll {
    position: relative;
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #d8d8d3 transparent;
}

.chat-view {
    width: min(100%, var(--workspace-content-width));
    min-height: 100%;
    margin: 0 auto;
    padding: 32px 20px 168px;
}

.chat-view[hidden],
.agent-hub-view[hidden] {
    display: none !important;
}

.chat-welcome {
    margin: clamp(94px, 18vh, 180px) auto 0;
    text-align: center;
    transition: opacity var(--workspace-transition), transform var(--workspace-transition);
}

.chat-welcome.is-hidden {
    display: none;
}

.chat-welcome h1 {
    display: block !important;
    margin: 0;
    color: var(--workspace-text-strong);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 580;
    line-height: 1.2;
    letter-spacing: 0;
}

body.workspace-v2:not(.tool-open) .chat-welcome h1 {
    font-size: clamp(28px, 2.7vw, 35px) !important;
    font-weight: 600 !important;
}

.chat-welcome p {
    margin: 12px 0 0;
    color: var(--workspace-muted);
    font-size: 15px;
    line-height: 1.6;
}

.chat-messages {
    display: grid;
    gap: 26px;
    width: 100%;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    width: 100%;
    gap: 0;
}

.chat-message > div:last-child {
    min-width: 0;
    max-width: 100%;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.user > div:last-child {
    max-width: min(78%, 620px);
}

.message-avatar {
    display: none;
}

.message-bubble {
    color: var(--workspace-text);
    font-size: 15px;
    line-height: 1.72;
    letter-spacing: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-message.user .message-bubble {
    padding: 10px 14px;
    background: var(--workspace-surface-soft);
    border-radius: 18px 18px 4px 18px;
}

.chat-message.assistant .message-bubble {
    padding: 0;
    background: transparent;
}

.message-bubble.is-thinking {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--workspace-muted);
}

.message-bubble.is-thinking::before {
    width: 7px;
    height: 7px;
    content: "";
    background: var(--workspace-accent);
    border-radius: 50%;
    animation: workspace-pulse 1.1s ease-in-out infinite;
}

@keyframes workspace-pulse {
    0%, 100% { opacity: .35; transform: scale(.82); }
    50% { opacity: 1; transform: scale(1); }
}

.message-meta {
    margin-top: 8px;
    color: var(--workspace-subtle);
    font-size: 11px;
}

.agent-call-badge,
.memory-captured-note {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 4px 7px;
    color: var(--workspace-muted);
    font-size: 11px;
    background: var(--workspace-surface-soft);
    border-radius: 6px;
}

.agent-call-badge i {
    color: #36845b;
    font-size: 13px;
}

.message-downloads {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.message-download-btn {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: min(100%, 520px);
    min-height: 56px;
    gap: 12px;
    padding: 10px 12px;
    color: var(--workspace-text);
    text-align: left;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-border);
    border-radius: var(--workspace-radius-sm);
    cursor: pointer;
    transition: border-color var(--workspace-transition), background var(--workspace-transition);
}

.message-download-btn:hover {
    background: #fbfbfa;
    border-color: var(--workspace-border-strong);
}

.message-download-btn span {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-download-btn small {
    max-width: 220px;
    overflow: hidden;
    color: var(--workspace-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-result-actions,
.web-search-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.message-secondary-action,
.web-search-sources a,
.web-search-sources span {
    padding: 6px 9px;
    color: var(--workspace-muted);
    font-size: 12px;
    text-decoration: none;
    background: var(--workspace-surface-soft);
    border: 0;
    border-radius: 6px;
}

.message-secondary-action {
    cursor: pointer;
}

.web-search-sources strong {
    width: 100%;
    color: var(--workspace-text);
    font-size: 12px;
}

.agent-hub-view {
    width: min(100%, 960px);
    min-height: 100%;
    margin: 0 auto;
    padding: 42px 28px 80px;
}

.agent-hub-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.agent-hub-head h2 {
    margin: 0;
    color: var(--workspace-text-strong);
    font-size: 28px;
    font-weight: 620;
    line-height: 1.25;
}

.agent-hub-head p {
    margin: 8px 0 0;
    color: var(--workspace-muted);
    font-size: 14px;
    line-height: 1.6;
}

.compact-btn {
    min-height: 38px;
    padding: 7px 12px;
    color: var(--workspace-text);
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-border);
    border-radius: var(--workspace-radius-sm);
    cursor: pointer;
}

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

.tool-library-card {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 20px;
    align-items: start;
    min-height: 132px;
    gap: 13px;
    padding: 18px;
    color: var(--workspace-text);
    text-align: left;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-border);
    border-radius: var(--workspace-radius-sm);
    cursor: pointer;
    transition: background var(--workspace-transition), border-color var(--workspace-transition), transform var(--workspace-transition);
}

.tool-library-card:hover {
    background: #fbfbfa;
    border-color: var(--workspace-border-strong);
    transform: translateY(-1px);
}

.tool-library-card.is-disabled {
    cursor: not-allowed;
    opacity: .55;
}

.tool-library-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--workspace-accent);
    background: var(--workspace-accent-soft);
    border-radius: var(--workspace-radius-sm);
}

.tool-library-icon i {
    font-size: 22px;
}

.tool-library-copy,
.tool-library-title {
    display: flex;
    min-width: 0;
}

.tool-library-copy {
    flex-direction: column;
}

.tool-library-title {
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tool-library-title strong {
    overflow: hidden;
    color: var(--workspace-text-strong);
    font-size: 15px;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-library-title small {
    flex: 0 0 auto;
    color: var(--workspace-subtle);
    font-size: 10px;
    font-weight: 500;
}

.tool-library-desc {
    display: -webkit-box;
    margin-top: 7px;
    overflow: hidden;
    color: var(--workspace-muted);
    font-size: 12px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tool-library-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 11px;
}

.tool-library-meta em {
    color: var(--workspace-subtle);
    font-size: 10px;
    font-style: normal;
}

.tool-library-arrow {
    align-self: center;
    color: var(--workspace-subtle);
    font-size: 17px;
}

.omnibox-shell {
    position: absolute;
    z-index: 24;
    top: 55%;
    left: 50%;
    width: min(calc(100% - 40px), var(--workspace-content-width));
    transform: translate(-50%, -50%);
    transition: top 220ms ease, bottom 220ms ease, transform 220ms ease;
}

.chat-main.has-messages .omnibox-shell {
    top: auto;
    bottom: 20px;
    transform: translateX(-50%);
}

.chat-main.is-agent-hub .omnibox-shell {
    display: none;
}

.omnibox {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    grid-template-rows: auto 42px;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding: 10px 10px 8px;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-border-strong);
    border-radius: var(--workspace-radius-input);
    box-shadow: var(--workspace-shadow-composer);
    transition: border-color var(--workspace-transition), box-shadow var(--workspace-transition);
}

.omnibox:focus-within {
    border-color: #bcbdb8;
    box-shadow: 0 3px 16px rgba(24, 24, 22, .10);
}

.omnibox textarea {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    min-height: 44px;
    max-height: 160px;
    padding: 7px 9px 8px;
    resize: none;
    overflow-y: auto;
    color: var(--workspace-text-strong);
    font-size: 15px;
    line-height: 1.55;
    background: transparent;
    border: 0;
    outline: 0;
}

.omnibox textarea::placeholder {
    color: var(--workspace-subtle);
}

.omnibox .attach-btn {
    grid-column: 1;
    grid-row: 2;
}

.input-model-switcher {
    position: relative;
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    justify-self: start;
}

.omnibox .web-search-toggle {
    grid-column: 3;
    grid-row: 2;
}

.omnibox .voice-btn {
    grid-column: 4;
    grid-row: 2;
}

.omnibox .send-btn {
    grid-column: 5;
    grid-row: 2;
}

.omnibox .icon-btn,
.omnibox .web-search-toggle,
.omnibox .send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    color: var(--workspace-muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: color var(--workspace-transition), background var(--workspace-transition), opacity var(--workspace-transition);
}

.omnibox .icon-btn:hover,
.omnibox .web-search-toggle:hover {
    color: var(--workspace-text-strong);
    background: var(--workspace-surface-soft);
}

.omnibox .icon-btn i,
.omnibox .web-search-toggle i,
.omnibox .send-btn i {
    font-size: 20px;
}

.omnibox .voice-btn i {
    font-size: 21px;
}

.omnibox .send-btn {
    color: #fff;
    background: #222325;
}

.omnibox .send-btn:hover {
    background: #050506;
}

.omnibox .send-btn:disabled {
    cursor: default;
    opacity: .35;
}

.web-search-toggle span {
    display: none;
}

.web-search-toggle[aria-pressed="true"] {
    color: var(--workspace-accent);
    background: var(--workspace-accent-soft);
}

.model-switcher {
    display: inline-flex;
    align-items: center;
    max-width: 220px;
    min-height: 38px;
    gap: 6px;
    padding: 0 9px;
    color: var(--workspace-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.model-switcher:hover {
    color: var(--workspace-text-strong);
    background: var(--workspace-surface-soft);
}

.model-switcher span {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-switcher b {
    color: var(--workspace-subtle);
    font-size: 11px;
    font-weight: 400;
}

.model-popover,
.agent-command-menu {
    position: absolute;
    z-index: 1300;
    bottom: calc(100% + 12px);
    left: 0;
    width: min(340px, calc(100vw - 28px));
    max-height: min(430px, 60vh);
    overflow-y: auto;
    padding: 6px;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-border);
    border-radius: 12px;
    box-shadow: var(--workspace-shadow-menu);
}

.model-popover[hidden],
.agent-command-menu[hidden] {
    display: none !important;
}

.model-option {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-height: 50px;
    gap: 9px;
    padding: 7px 8px;
    color: var(--workspace-text);
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.model-option:hover,
.model-option.is-selected {
    background: var(--workspace-surface-soft);
}

.model-option-icon,
.model-option > span:first-child {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: var(--workspace-muted);
    background: #ecece9;
    border-radius: 8px;
}

.model-option strong,
.model-option small {
    display: block;
}

.model-option strong {
    font-size: 13px;
    font-weight: 600;
}

.model-option small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--workspace-subtle);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
}

.attachment-chip {
    display: flex;
    align-items: center;
    max-width: 260px;
    min-height: 32px;
    gap: 6px;
    padding: 4px 5px 4px 9px;
    color: var(--workspace-muted);
    font-size: 11px;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-border);
    border-radius: 8px;
}

.attachment-chip span {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-chip button {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    padding: 0;
    color: var(--workspace-subtle);
    background: transparent;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
}

.attachment-chip button:hover {
    color: var(--workspace-text);
    background: var(--workspace-surface-soft);
}

.chat-agent-hint {
    margin-top: 8px;
    color: var(--workspace-subtle);
    font-size: 11px;
    text-align: center;
}

.action-pills {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

.action-pill {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    gap: 6px;
    padding: 7px 11px;
    color: var(--workspace-muted);
    font-size: 12px;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-border);
    border-radius: 18px;
    cursor: pointer;
    transition: color var(--workspace-transition), background var(--workspace-transition), border-color var(--workspace-transition);
}

.action-pill:hover {
    color: var(--workspace-text-strong);
    background: #fbfbfa;
    border-color: var(--workspace-border-strong);
}

.action-pill i {
    font-size: 15px;
}

.chat-main.has-messages .chat-agent-hint,
.chat-main.has-messages .action-pills {
    display: none;
}

.settings-model-entry {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 18px;
    align-items: center;
    width: 100%;
    min-height: 58px;
    gap: 10px;
    padding: 9px 10px;
    color: var(--workspace-text);
    text-align: left;
    background: transparent;
    border: 1px solid var(--workspace-border);
    border-radius: var(--workspace-radius-sm);
    cursor: pointer;
}

.settings-model-entry:hover {
    background: var(--workspace-surface-soft);
}

.settings-model-entry > i:first-child {
    font-size: 20px;
}

.settings-model-entry span,
.settings-model-entry strong,
.settings-model-entry small {
    display: block;
    min-width: 0;
}

.settings-model-entry strong {
    font-size: 13px;
}

.settings-model-entry small {
    margin-top: 3px;
    color: var(--workspace-subtle);
    font-size: 11px;
}

.settings-model-entry > i:last-child {
    color: var(--workspace-subtle);
}

.skill-run-panel,
.recent-deliverables,
.quality-mode-wrap,
.hub-kicker,
.agent-hub-section-title,
.floating-help {
    display: none !important;
}

body.sidebar-collapsed .ai-workspace {
    grid-template-columns: var(--workspace-sidebar-collapsed) minmax(0, 1fr);
}

body.sidebar-collapsed .workspace-sidebar {
    padding-inline: 8px;
}

body.sidebar-collapsed .sidebar-brand > div,
body.sidebar-collapsed .new-chat-btn > div,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-section-title,
body.sidebar-collapsed .chat-history-list,
body.sidebar-collapsed .sidebar-user-meta {
    display: none;
}

body.sidebar-collapsed .sidebar-top {
    justify-content: center;
    min-height: 42px;
    padding-inline: 0;
}

body.sidebar-collapsed .sidebar-brand {
    display: none;
}

body.sidebar-collapsed .sidebar-collapse-btn {
    position: static;
    inset: auto;
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    margin: 0;
    transform: none;
}

body.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

body.sidebar-collapsed .new-chat-btn,
body.sidebar-collapsed .workspace-nav-item {
    justify-content: center;
    padding-inline: 0;
}

body.sidebar-collapsed .sidebar-user {
    justify-content: center;
    flex-direction: column;
    padding-top: 8px;
}

body.sidebar-collapsed .sidebar-settings-btn {
    width: 40px;
    height: 40px;
}

body.workbench-density-compact .chat-message {
    font-size: 14px;
}

body.workbench-density-compact .chat-messages {
    gap: 18px;
}

body.workbench-theme-dark:not(.tool-open) {
    --workspace-bg: #1d1e20;
    --workspace-sidebar: #17181a;
    --workspace-surface: #242527;
    --workspace-surface-soft: #2b2c2f;
    --workspace-surface-hover: #303135;
    --workspace-text: #e7e7e5;
    --workspace-text-strong: #f8f8f6;
    --workspace-muted: #b2b2ad;
    --workspace-subtle: #858680;
    --workspace-border: #35363a;
    --workspace-border-strong: #4a4b4f;
    --workspace-accent-soft: #233659;
    --workspace-shadow-menu: 0 18px 48px rgba(0, 0, 0, .38);
    --workspace-shadow-composer: 0 2px 16px rgba(0, 0, 0, .28);
}

body.workbench-theme-dark .chat-topbar {
    background: rgba(29, 30, 32, .9);
}

body.workbench-theme-dark .new-chat-btn:hover,
body.workbench-theme-dark .tool-library-card:hover,
body.workbench-theme-dark .message-download-btn:hover,
body.workbench-theme-dark .action-pill:hover {
    background: #292a2d;
}

body.workbench-theme-dark .omnibox .send-btn {
    color: #17181a;
    background: #f1f1ef;
}

@media (max-width: 900px) {
    .ai-workspace,
    body.sidebar-collapsed .ai-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .workspace-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 310px);
        box-shadow: 16px 0 42px rgba(24, 24, 22, .14);
        transform: translateX(-102%);
        transition: transform 220ms ease;
    }

    body.sidebar-open .workspace-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open::after {
        position: fixed;
        z-index: 20;
        inset: 0;
        content: "";
        background: rgba(20, 20, 18, .34);
    }

    body.sidebar-collapsed .workspace-sidebar {
        padding: 12px 10px 10px;
    }

    body.sidebar-collapsed .sidebar-top {
        flex-direction: row;
    }

    body.sidebar-collapsed .sidebar-brand > div,
    body.sidebar-collapsed .new-chat-btn > div,
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .sidebar-section-title,
    body.sidebar-collapsed .chat-history-list,
    body.sidebar-collapsed .sidebar-user-meta {
        display: block;
    }

    body.sidebar-collapsed .new-chat-btn,
    body.sidebar-collapsed .workspace-nav-item {
        justify-content: flex-start;
        padding-inline: 10px;
    }

    body.sidebar-collapsed .sidebar-user {
        justify-content: flex-start;
        flex-direction: row;
    }

    .chat-topbar {
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        min-height: 54px;
        padding: 0 8px;
        border-bottom-color: var(--workspace-border);
    }

    .mobile-sidebar-toggle {
        position: fixed;
        z-index: 40;
        display: inline-grid;
        top: 7px;
        left: 8px;
        margin: 0;
    }

    .mobile-brand {
        display: inline-flex;
        grid-column: 2;
        align-items: center;
        justify-self: center;
        min-height: 40px;
        padding: 0 8px;
        color: var(--workspace-text-strong);
        font-size: 16px;
        font-weight: 650;
        background: transparent;
        border: 0;
    }

    .workspace-view-title {
        display: none;
        grid-column: 2;
        justify-self: center;
    }

    .workspace-view-title span {
        max-width: 52vw;
    }

    .workspace-view-title button {
        display: none;
    }

    .workspace-top-actions {
        grid-column: 3;
    }

    body.workspace-v2:not(.tool-open) .chat-topbar .workspace-top-actions {
        display: flex !important;
        position: absolute !important;
        top: 7px !important;
        right: 8px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.workspace-v2:not(.tool-open) .chat-topbar .topbar-icon-btn {
        display: grid !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .chat-view {
        padding: 20px 14px 154px;
    }

    .chat-welcome {
        margin-top: clamp(82px, 17vh, 150px);
    }

    .agent-hub-view {
        padding: 28px 18px 64px;
    }

    .tool-library-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 641px) {
    body.workspace-v2:not(.tool-open) .chat-main.is-empty-chat .omnibox-shell {
        top: 60% !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
    }
}

@media (max-width: 640px) {
    .ai-workspace {
        min-height: 100dvh;
    }

    .chat-main {
        height: 100dvh;
    }

    .chat-welcome {
        margin-top: 16vh;
        padding: 0 12px;
    }

    .chat-welcome h1 {
        font-size: 27px;
    }

    .chat-welcome p {
        max-width: 280px;
        margin: 9px auto 0;
        font-size: 14px;
    }

    .chat-message.user > div:last-child {
        max-width: 88%;
    }

    .message-bubble {
        font-size: 15px;
    }

    .omnibox-shell,
    .chat-main.has-messages .omnibox-shell {
        top: auto;
        bottom: max(36px, env(safe-area-inset-bottom));
        width: calc(100% - 20px);
        transform: translateX(-50%);
    }

    .omnibox {
        grid-template-columns: 40px minmax(72px, 1fr) 40px 40px 40px !important;
        grid-template-rows: auto 42px !important;
        padding: 8px 8px 7px;
        border-radius: 22px;
    }

    .omnibox textarea {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        min-height: 50px;
        padding: 7px 8px 9px;
        font-size: 16px;
    }

    .model-switcher {
        max-width: 136px;
        padding-inline: 5px;
    }

    .omnibox .attach-btn {
        display: flex !important;
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    .omnibox .input-model-switcher {
        display: flex !important;
        grid-column: 2 !important;
        grid-row: 2 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .omnibox .web-search-toggle {
        display: flex !important;
        grid-column: 3 !important;
        grid-row: 2 !important;
    }

    .omnibox .voice-btn {
        display: flex !important;
        grid-column: 4 !important;
        grid-row: 2 !important;
    }

    .omnibox .send-btn {
        display: flex !important;
        grid-column: 5 !important;
        grid-row: 2 !important;
    }

    .model-switcher span {
        font-size: 11px;
    }

    .omnibox .input-model-switcher .model-switcher {
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding-inline: 5px !important;
    }

    .chat-agent-hint,
    .action-pills {
        display: none;
    }

    .attachment-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .attachment-chip {
        flex: 0 0 auto;
        max-width: 220px;
    }

    .agent-hub-head {
        align-items: center;
        margin-bottom: 20px;
    }

    .agent-hub-head h2 {
        font-size: 23px;
    }

    .agent-hub-head p {
        max-width: 230px;
        font-size: 12px;
    }

    .tool-library-card {
        min-height: 118px;
        padding: 15px;
    }

    .message-download-btn {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
    }

    .message-download-btn small {
        max-width: 100%;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox-shell,
    body.workspace-v2:not(.tool-open) .chat-main.has-messages .omnibox-shell {
        top: auto !important;
        right: auto !important;
        bottom: max(36px, env(safe-area-inset-bottom)) !important;
        left: 50% !important;
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        transform: translateX(-50%) !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox {
        display: flex !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        column-gap: 4px !important;
        row-gap: 0 !important;
        padding: 8px 8px 7px !important;
        box-sizing: border-box !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox textarea {
        order: 1 !important;
        flex: 0 0 100% !important;
        width: 100% !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox .attach-btn,
    body.workspace-v2:not(.tool-open) .chat-main .omnibox .web-search-toggle,
    body.workspace-v2:not(.tool-open) .chat-main .omnibox .voice-btn,
    body.workspace-v2:not(.tool-open) .chat-main .omnibox .send-btn {
        display: flex !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox .attach-btn {
        order: 2 !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox .web-search-toggle {
        order: 4 !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox .voice-btn {
        order: 5 !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox .send-btn {
        order: 6 !important;
        justify-self: end !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox .input-model-switcher {
        display: flex !important;
        order: 3 !important;
        flex: 0 1 96px !important;
        margin-right: auto !important;
        width: 96px !important;
        min-width: 0 !important;
        max-width: 96px !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox .input-model-switcher .model-switcher {
        width: 96px !important;
        min-width: 0 !important;
        max-width: 96px !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .omnibox .input-model-switcher .model-popover {
        position: fixed !important;
        bottom: 84px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100vw - 32px) !important;
        max-width: 380px !important;
        max-height: 55vh !important;
        z-index: 10000 !important;
        background: var(--workspace-surface) !important;
        border: 1px solid var(--workspace-border-strong) !important;
        border-radius: 16px !important;
        box-shadow: 0 16px 48px rgba(0, 0, 0, .28) !important;
        padding: 8px !important;
        margin: 0 !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .chat-topbar .workspace-top-actions {
        display: flex !important;
        position: absolute !important;
        top: 7px !important;
        right: 8px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.workspace-v2:not(.tool-open) .chat-main .chat-topbar .topbar-icon-btn {
        display: grid !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 390px) {
    .omnibox {
        grid-template-columns: 38px minmax(0, 1fr) 38px 38px 38px;
    }

    .omnibox .icon-btn,
    .omnibox .web-search-toggle,
    .omnibox .send-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .model-switcher {
        max-width: 112px;
    }
}

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