:root {
  color-scheme: dark;
  --bg: #000;
  --sidebar: #101010;
  --panel: #151515;
  --panel-2: #1d1d1d;
  --hover: #242424;
  --line: #303030;
  --text: #f4f4f4;
  --muted: #9d9d9d;
  --danger: #ff6b6b;
  --success: #71dda0;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.material-symbols-rounded { font-size: 20px; line-height: 1; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24; }

.app { width: 100vw; height: 100vh; display: flex; overflow: hidden; background: #000; }
.sidebar { width: 280px; min-width: 280px; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: #111; border-right: 1px solid #242424; transition: width .22s ease, min-width .22s ease; }
.sidebar.collapsed { width: 76px; min-width: 76px; }
.sidebar-header { min-height: 72px; padding: 0 18px; display: flex; align-items: center; gap: 12px; }
.brand-link { display: flex; align-items: center; min-width: 0; }
.sidebar-logo { width: 112px; max-height: 38px; object-fit: contain; }
.sidebar-logo.collapsed-logo { display: none; }
.sidebar-toggle { width: 36px; height: 36px; margin-left: auto; padding: 0; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: #aaa; }
.sidebar-toggle:hover { background: #202020; color: #fff; }
.sidebar-panel-glyph { position: relative; width: 17px; height: 16px; border: 1.7px solid #d8d8d8; border-radius: 5px; }
.sidebar-panel-glyph::before { content: ""; position: absolute; inset: 2px auto 2px 4px; width: 1.7px; border-radius: 999px; background: #d8d8d8; }
.sidebar-product-nav { padding: 4px 14px 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-product-link { width: 100%; min-height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 10px; border-radius: 999px; color: #d8d8d8; text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.sidebar-product-link:hover, .sidebar-product-link.active { background: #202020; color: #fff; }
.product-link-hidden { display: none !important; }
.sidebar-product-link .material-symbols-rounded { color: #aaa; font-size: 19px; }
.sidebar-product-link .sidebar-agent-icon { width: 20px; height: 20px; flex: 0 0 20px; object-fit: contain; border-radius: 5px; }
.sidebar-actions { padding: 8px 14px 14px; }
.new-chat { width: 100%; height: 44px; padding: 0 12px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; background: transparent; color: #f5f5f5; font-weight: 600; white-space: nowrap; }
.new-chat:hover { background: #202020; }
.new-chat .sidebar-action-icon { color: #eee; font-size: 20px; }
.sidebar-spacer { flex: 1; min-height: 10px; }
.product-history { flex: 1; min-height: 0; padding: 6px 14px 8px; display: flex; flex-direction: column; }
.history-label { padding: 6px 12px 8px; color: #777; font-size: 11px; font-weight: 650; }
.product-history-list { min-height: 0; overflow: auto; scrollbar-width: thin; }
.sidebar-chat-item { width: 100%; min-height: 36px; padding: 0 12px; display: block; overflow: hidden; border: 0; border-radius: 999px; background: transparent; color: #bbb; text-align: left; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-chat-item:hover, .sidebar-chat-item.active { background: #202020; color: #fff; }
.history-empty { padding: 8px 12px; color: #666; font-size: 11px; }
.sidebar.collapsed .product-history { display: none; }
.sidebar-footer { padding: 10px 14px 14px; border-top: 1px solid #242424; }
.user-btn { width: 100%; height: 48px; padding: 0 12px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; background: transparent; color: #fff; text-align: left; }
.user-btn:hover { background: #202020; }
.avatar { width: 28px; min-width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1px solid #3a3a3a; border-radius: 50%; background: #2a2a2a; color: #dcdcdc; }
.avatar .material-symbols-rounded { font-size: 18px; }
.account-copy { min-width: 0; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 13px; }
.account-copy small { margin-top: 2px; color: #888; font-size: 10px; }
.sidebar.collapsed .sidebar-logo.full-logo, .sidebar.collapsed .hide-collapsed { display: none; }
.sidebar.collapsed .sidebar-logo.collapsed-logo { display: block; width: 40px; max-height: 40px; }
.sidebar.collapsed .sidebar-header { position: relative; min-height: 72px; padding: 16px 18px; justify-content: center; }
.sidebar.collapsed .sidebar-logo.collapsed-logo, .sidebar.collapsed .sidebar-toggle { position: absolute; inset: 16px auto auto 18px; width: 40px; height: 40px; margin: 0; transition: opacity .15s ease; }
.sidebar.collapsed .sidebar-toggle { opacity: 0; pointer-events: none; }
.sidebar.collapsed:hover .sidebar-logo.collapsed-logo { opacity: 0; }
.sidebar.collapsed:hover .sidebar-toggle { opacity: 1; pointer-events: auto; }
.sidebar.collapsed .sidebar-product-link, .sidebar.collapsed .new-chat, .sidebar.collapsed .user-btn { width: 44px; padding: 0; margin-inline: auto; justify-content: center; }
.sidebar-backdrop { display: none; }
.icon-button { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--hover); color: var(--text); }

.product-main { flex: 1; min-width: 0; height: 100vh; display: flex; flex-direction: column; background: #000; }
.product-topbar { height: 64px; min-height: 64px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid transparent; background: #000; }
.mobile-menu-btn { display: none; }
.product-title { min-width: 0; }
.product-title h1 { margin: 0; font-size: 18px; letter-spacing: 0; }
.product-title p { margin: 3px 0 0; color: #888; font-size: 12px; }
.product-actions { display: flex; align-items: center; gap: 8px; }
.product-content { flex: 1; min-height: 0; padding: 18px 24px 24px; overflow: auto; background: #000; }
.status-banner { display: none; margin-bottom: 16px; padding: 11px 14px; border: 1px solid #3b3525; border-radius: 8px; background: #211e15; color: #d9c789; font-size: 13px; }
.status-banner.show { display: block; }

.button { min-height: 38px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--text); font-weight: 650; }
.button:hover { background: #292929; }
.button.primary { border-color: #eee; background: #eee; color: #090909; }
.button.primary:hover { background: #dcdcdc; }
.button.danger { color: #ff8b8b; }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button.small { min-height: 32px; padding: 0 11px; font-size: 12px; }

.field, .select, .text-area { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #111; color: var(--text); outline: none; }
.field, .select { height: 40px; padding: 0 12px; }
.text-area { min-height: 110px; padding: 11px 12px; resize: vertical; line-height: 1.5; }
.field:focus, .select:focus, .text-area:focus { border-color: #777; }
.field-label { display: block; margin: 0 0 7px; color: #d6d6d6; font-size: 12px; font-weight: 700; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.panel h2, .panel h3 { margin: 0; letter-spacing: 0; }
.panel h2 { font-size: 16px; }
.panel h3 { font-size: 14px; }
.panel-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.metric { font-size: 28px; font-weight: 750; }

.product-workbench { height: calc(100vh - 108px); min-height: 560px; display: grid; grid-template-columns: 230px minmax(330px, 1fr) minmax(300px, .8fr); gap: 10px; }
.workbench-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.column-head { min-height: 48px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.column-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.item-list { flex: 1; min-height: 0; padding: 8px; overflow: auto; }
.list-button { width: 100%; min-height: 38px; padding: 7px 9px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 7px; background: transparent; color: #d7d7d7; text-align: left; }
.list-button:hover, .list-button.active { background: var(--hover); color: #fff; }
.list-button span:not(.material-symbols-rounded) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-button .material-symbols-rounded { flex: none; color: var(--muted); font-size: 18px; }
.list-meta { margin-left: auto; color: var(--muted); font-size: 11px; }
.empty-state { padding: 28px 14px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.5; }
.editor-toolbar { min-height: 44px; padding: 6px 10px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.code-editor { flex: 1; min-height: 0; width: 100%; padding: 16px; border: 0; resize: none; outline: 0; background: #0b0b0b; color: #e8e8e8; font: 13px/1.65 "Cascadia Code", Consolas, monospace; tab-size: 2; }
.preview-frame { flex: 1; min-height: 280px; width: 100%; border: 0; background: #fff; }
.tab-row { min-height: 42px; padding: 5px 8px; display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab-button { min-height: 31px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.tab-button:hover, .tab-button.active { background: var(--hover); color: #fff; }
.tab-view { display: none; flex: 1; min-height: 0; }
.tab-view.active { display: flex; flex-direction: column; }
.chat-feed, .activity-feed { flex: 1; min-height: 0; padding: 12px; overflow: auto; }
.chat-message { max-width: 92%; margin: 0 0 9px; padding: 9px 11px; border-radius: 8px; background: #202020; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.chat-message.user { margin-left: auto; background: #2b2b2b; }
.chat-message.error { color: #ffabab; }
.chat-composer { padding: 10px; border-top: 1px solid var(--line); }
.chat-composer .text-area { min-height: 76px; }
.chat-composer-row { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.model-label { color: var(--muted); font-size: 11px; }
.change-list { padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.split-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; min-height: calc(100vh - 108px); }
.detail-stack { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.section-head { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.source-list, .run-list, .deployment-list { display: flex; flex-direction: column; gap: 7px; }
.source-item, .run-item, .deployment-item { padding: 11px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: #191919; }
.source-item-main { min-width: 0; flex: 1; }
.source-item strong, .source-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-item span, .run-item span, .deployment-item span { color: var(--muted); font-size: 11px; }
.pill { min-height: 25px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 999px; background: #292929; color: #cfcfcf; font-size: 11px; font-weight: 700; }
.pill.online, .pill.success { color: var(--success); }
.pill.error { color: #ff9e9e; }
.agent-chat-home, .agent-chat-view { height: calc(100vh - 106px); min-height: 460px; }
.agent-chat-home { display: grid; place-items: center; }
.agent-chat-center { width: min(760px, 100%); transform: translateY(-7vh); }
.agent-chat-center h2 { margin: 0 0 25px; color: #f4f4f4; text-align: center; font-size: 27px; font-weight: 560; letter-spacing: 0; }
.agent-chat-view { display: flex; flex-direction: column; }
.agent-chat-feed { flex: 1; min-height: 0; overflow: auto; padding: 26px 0 34px; scrollbar-width: thin; }
.agent-chat-message { width: 100%; padding: 12px 20px; }
.agent-chat-message-inner { width: min(760px, 100%); margin: 0 auto; display: flex; align-items: flex-start; gap: 12px; }
.agent-chat-message.user .agent-chat-message-inner { justify-content: flex-end; }
.agent-chat-copy { max-width: min(680px, 88%); color: #ededed; font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-chat-message.user .agent-chat-copy { padding: 10px 15px; border-radius: 18px; background: #202020; }
.agent-chat-message.error .agent-chat-copy { color: #ff9f9f; }
.agent-chat-avatar { width: 27px; height: 27px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #171717; }
.agent-chat-avatar img { width: 23px; height: 23px; object-fit: contain; }
.agent-chat-bottom { flex: none; padding: 8px 20px 18px; background: linear-gradient(180deg, rgba(0,0,0,0), #000 24%); }
.agent-chat-composer { width: min(760px, 100%); min-height: 106px; margin: 0 auto; padding: 14px 12px 10px; border-radius: 24px; background: #1c1c1c; }
.agent-chat-composer textarea { width: 100%; max-height: 180px; min-height: 37px; padding: 3px 6px; border: 0; outline: 0; resize: none; background: transparent; color: #f2f2f2; font-family: inherit; font-size: 14px; line-height: 1.5; }
.agent-chat-composer textarea::placeholder { color: #8a8a8a; }
.agent-chat-composer-row { min-height: 36px; display: flex; align-items: center; justify-content: space-between; }
.agent-chat-composer-row .icon-button { width: 34px; height: 34px; }
.agent-chat-send { background: #fff; color: #050505; }
.agent-chat-send:hover { background: #ddd; color: #050505; }
.agent-chat-send:disabled { background: #343434; color: #747474; cursor: default; }
.agent-chat-thinking { min-height: 28px; display: flex; align-items: center; gap: 4px; }
.agent-chat-thinking i { width: 5px; height: 5px; border-radius: 50%; background: #888; animation: agentThinking 1.1s infinite ease-in-out; }
.agent-chat-thinking i:nth-child(2) { animation-delay: .15s; }
.agent-chat-thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes agentThinking { 0%, 70%, 100% { opacity: .28; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
.agent-inline-progress { width: min(680px, 88%); padding: 13px 14px; border-radius: 16px; background: #171717; }
.agent-inline-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.agent-inline-head strong { font-size: 13px; }
.agent-inline-progress > a { display: block; margin-top: 8px; overflow: hidden; color: #aaa; font-size: 11px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.agent-inline-progress > p { margin: 8px 0 0; color: #aaa; font-size: 12px; line-height: 1.45; }
.agent-inline-progress > img, .agent-inline-result-image { display: block; width: 100%; max-height: 360px; margin-top: 12px; border-radius: 10px; object-fit: contain; object-position: top; background: #fff; }
.agent-inline-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.agent-result-extras .agent-chat-message-inner > div { min-width: 0; max-width: min(680px, 88%); }
.agent-result-extras .agent-sources { padding: 10px 0 0; }
.agent-mode-row { min-height: 42px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.segmented-control { width: max-content; padding: 4px; display: flex; gap: 3px; border-radius: 999px; background: #141414; }
.agent-model { color: #888; font-size: 12px; }
.agent-layout { height: calc(100vh - 106px); min-height: 580px; display: grid; grid-template-columns: 190px minmax(320px, 1fr) 300px; gap: 10px; }
.agent-browser-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #242424; border-radius: 8px; background: #0b0b0b; }
.agent-browser-bar { min-height: 46px; padding: 0 10px 0 14px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid #242424; background: #111; }
.agent-browser-bar > .material-symbols-rounded { color: #888; font-size: 18px; }
.agent-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #aaa; font-size: 12px; }
.browser-stage { flex: 1; min-height: 360px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #080808; color: var(--muted); text-align: center; }
.browser-stage.has-screenshot { align-items: flex-start; background: #fff; }
.browser-stage img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: top center; }
.browser-empty { max-width: 320px; padding: 30px; }
.browser-empty .material-symbols-rounded { display: block; margin: 0 auto 12px; color: #aaa; font-size: 36px; }
.browser-empty strong { display: block; color: #eee; font-size: 15px; }
.browser-empty p { margin: 8px 0 0; color: #777; font-size: 12px; line-height: 1.5; }
.agent-task-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #242424; border-radius: 8px; background: #111; }
.agent-prompt-box { margin: 10px; padding: 9px 9px 7px; border-radius: 20px; background: #1b1b1b; }
.agent-prompt-box .text-area { min-height: 96px; padding: 5px 7px; border: 0; background: transparent; resize: none; }
.agent-prompt-box .text-area:focus { border: 0; }
.agent-start-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agent-depth { height: 32px; padding: 0 8px; border: 0; border-radius: 999px; outline: 0; background: transparent; color: #999; font-size: 11px; }
.agent-depth:hover { background: #252525; color: #fff; }
.agent-send { flex: none; width: 34px; height: 34px; background: #fff; color: #000; }
.agent-send:hover { background: #ddd; color: #000; }
.agent-controls { padding: 0 10px 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; border-bottom: 1px solid #242424; }
.agent-controls .button { min-width: 0; padding: 0 7px; }
.agent-controls .material-symbols-rounded { font-size: 17px; }
.agent-confirm { margin: 0 10px 10px; padding: 12px; border: 1px solid #514424; border-radius: 8px; background: #211d12; }
.agent-confirm strong { font-size: 12px; }
.agent-confirm p { margin: 5px 0 10px; color: #baa96f; font-size: 11px; line-height: 1.4; }
.agent-activity-head { min-height: 40px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; color: #ddd; font-size: 12px; }
.agent-activity-head span { color: #777; }
.agent-activity-item { padding: 9px 5px; display: flex; gap: 9px; border-bottom: 1px solid #202020; }
.agent-activity-icon { flex: none; margin-top: 1px; color: #888; font-size: 17px; }
.agent-activity-item div { min-width: 0; }
.agent-activity-item strong, .agent-activity-item span { display: block; overflow: hidden; text-overflow: ellipsis; }
.agent-activity-item strong { color: #ddd; font-size: 12px; font-weight: 550; white-space: normal; line-height: 1.4; }
.agent-activity-item span { margin-top: 3px; color: #666; font-size: 10px; }
.agent-result { max-height: 42%; overflow: auto; border-top: 1px solid #242424; background: #111; }
.agent-result-copy { padding: 14px; color: #e7e7e7; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-sources { padding: 0 12px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.agent-source { max-width: 220px; min-height: 30px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: #202020; color: #ccc; text-decoration: none; font-size: 11px; }
.agent-source:hover { background: #2a2a2a; color: #fff; }
.agent-source .material-symbols-rounded { font-size: 15px; }
.agent-source span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-computer-empty { min-height: calc(100vh - 150px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.agent-computer-empty > .material-symbols-rounded { color: #aaa; font-size: 38px; }
.agent-computer-empty h2 { margin: 14px 0 7px; font-size: 20px; }
.agent-computer-empty p { max-width: 450px; margin: 0 0 18px; color: #888; font-size: 13px; line-height: 1.55; }
.pill.status-running, .pill.status-starting { color: #8dd3ff; }
.pill.status-paused { color: #f0ca76; }
.pill.status-failed, .pill.status-stopped { color: #ff9292; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 40; max-width: 360px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; background: #232323; color: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.35); font-size: 13px; }
.toast.error { color: #ffadad; }

@media (max-width: 1100px) {
  .product-workbench { grid-template-columns: 210px minmax(300px, 1fr); height: auto; }
  .product-workbench > :last-child { grid-column: 1 / -1; min-height: 430px; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-layout { grid-template-columns: 190px minmax(360px, 1fr); height: auto; }
  .agent-task-panel { grid-column: 1 / -1; min-height: 440px; }
}

@media (max-width: 900px) {
  .mobile-top-new-chat-btn { display: inline-flex; }
  .app { display: block; overflow: auto; }
  .sidebar, .sidebar.collapsed { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(86vw, 300px); min-width: min(86vw, 300px); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 16px 0 42px rgba(0,0,0,.45); }
  .product-app.nav-open .sidebar { transform: translateX(0); }
  .product-app.nav-open .sidebar-backdrop { position: fixed; inset: 0; z-index: 55; display: block; width: 100%; height: 100%; border: 0; background: rgba(0,0,0,.58); }
  .sidebar.collapsed .sidebar-header { min-height: 72px; padding: 0 18px; justify-content: flex-start; }
  .sidebar.collapsed .sidebar-logo.full-logo { display: block; width: 112px; }
  .sidebar.collapsed .sidebar-logo.collapsed-logo { display: none; }
  .sidebar.collapsed .sidebar-toggle { position: static; width: 36px; height: 36px; margin-left: auto; opacity: 1; pointer-events: auto; }
  .sidebar.collapsed .hide-collapsed { display: inline; }
  .sidebar.collapsed .sidebar-product-link, .sidebar.collapsed .new-chat, .sidebar.collapsed .user-btn { width: 100%; padding: 0 12px; margin: 0; justify-content: flex-start; }
  .product-main { min-height: 100vh; height: auto; }
  .product-topbar { height: auto; min-height: 62px; padding: 11px 14px; }
  .mobile-menu-btn { display: inline-flex; }
  .product-title p { display: none; }
  .product-content { padding: 12px; }
  .product-workbench, .split-layout, .agent-layout { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .product-workbench .workbench-column { min-height: 330px; }
  .product-workbench > :first-child { min-height: 220px; }
  .agent-layout > .workbench-column { min-height: 210px; }
  .agent-browser-panel { min-height: 520px; }
  .agent-task-panel { min-height: 480px; }
  .agent-chat-home, .agent-chat-view { height: calc(100vh - 86px); min-height: 520px; }
  .agent-chat-center { transform: none; }
  .agent-chat-center h2 { font-size: 22px; }
  .agent-chat-message { padding-inline: 4px; }
  .agent-chat-bottom { padding-inline: 0; }
  .agent-model { display: none; }
  .agent-mode-row { justify-content: flex-start; }
  .dashboard-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .product-actions .button span:not(.material-symbols-rounded) { display: none; }
  .product-actions .button { width: 38px; padding: 0; }
}

html[data-theme="light"] { color-scheme: light; --bg:#fff; --sidebar:#f5f5f5; --panel:#fff; --panel-2:#efefef; --hover:#e8e8e8; --line:#dedede; --text:#111; --muted:#686868; }
html[data-theme="light"] .app, html[data-theme="light"] .product-main, html[data-theme="light"] .product-topbar, html[data-theme="light"] .product-content { background:#fff; }
html[data-theme="light"] .sidebar { background:#f6f6f6; border-right-color:#e2e2e2; }
html[data-theme="light"] .sidebar-product-link, html[data-theme="light"] .new-chat, html[data-theme="light"] .user-btn { color:#111; }
html[data-theme="light"] .sidebar-product-link:hover, html[data-theme="light"] .sidebar-product-link.active, html[data-theme="light"] .new-chat:hover, html[data-theme="light"] .user-btn:hover { background:#ececec; color:#000; }
html[data-theme="light"] .sidebar-footer { border-top-color:#e2e2e2; }
html[data-theme="light"] .agent-browser-panel, html[data-theme="light"] .agent-task-panel, html[data-theme="light"] .agent-browser-bar, html[data-theme="light"] .agent-result { background:#fff; border-color:#dedede; }
html[data-theme="light"] .segmented-control, html[data-theme="light"] .agent-prompt-box { background:#f1f1f1; }
html[data-theme="light"] .agent-chat-center h2, html[data-theme="light"] .agent-chat-copy { color:#111; }
html[data-theme="light"] .agent-chat-composer { background:#f1f1f1; }
html[data-theme="light"] .agent-chat-composer textarea { color:#111; }
html[data-theme="light"] .agent-chat-message.user .agent-chat-copy { background:#ececec; }
html[data-theme="light"] .agent-inline-progress { background:#f2f2f2; }
html[data-theme="light"] .agent-chat-bottom { background:linear-gradient(180deg, rgba(255,255,255,0), #fff 24%); }
html[data-theme="light"] .agent-depth { color:#555; }
html[data-theme="light"] .browser-empty strong, html[data-theme="light"] .agent-result-copy, html[data-theme="light"] .agent-activity-item strong { color:#111; }
html[data-theme="light"] .agent-send { background:#111; color:#fff; }
html[data-theme="light"] .code-editor, html[data-theme="light"] .browser-stage { background:#f8f8f8; color:#111; }
html[data-theme="light"] .field, html[data-theme="light"] .select, html[data-theme="light"] .text-area { background:#fff; }
html[data-theme="light"] .source-item, html[data-theme="light"] .run-item, html[data-theme="light"] .deployment-item { background:#fafafa; }
html[data-theme="light"] .button.primary { background:#111; border-color:#111; color:#fff; }

/* Shared Kyro chat shell */
.sidebar-search-btn {
  width: 36px;
  height: 36px;
  margin-left: auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #a0a0a0;
}
.sidebar-search-btn:hover { background: #202020; color: #f5f5f5; }
.sidebar.collapsed .sidebar-search-btn { display: none; }
.sidebar-actions { padding: 4px 14px 14px; }
.sidebar-actions .new-chat + .new-chat { margin-top: 8px; }
.chat-search-bar {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 0 14px 10px;
  padding: 8px 12px;
  border: 1px solid #343434;
  border-radius: 999px;
  background: #171717;
  color: #a0a0a0;
}
.chat-search-bar.open { display: flex; }
.chat-search-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #f5f5f5; font-size: 13px; }
.chat-search-bar input::placeholder { color: #7d7d7d; }
.chat-search-bar button { padding: 0; display: flex; border: 0; background: transparent; color: #a0a0a0; }
.chat-search-bar button:hover { color: #f5f5f5; }
.chat-search-bar .material-symbols-rounded { font-size: 17px; }
.sidebar.collapsed .chat-search-bar { display: none; }
.product-history { flex: 1 1 auto; min-height: 0; padding: 0; display: flex; flex-direction: column; }
.history-label { padding: 18px 22px 8px; color: #7d7d7d; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.product-history-list { flex: 1 1 auto; min-height: 0; padding: 0 10px 4px; overflow-y: auto; scrollbar-width: none; }
.product-history-list::-webkit-scrollbar { display: none; }
.sidebar-chat-item { min-height: 38px; padding: 0 12px; border-radius: 999px; color: #d6d6d6; font-size: 14px; }
.sidebar-chat-item:hover, .sidebar-chat-item.active { background: #1b1b1b; }
.sidebar-footer { margin-top: auto; }
.user-btn { height: 44px; }
.mobile-top-new-chat-btn { display: none; }
.icon-pill-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #303030;
  border-radius: 999px;
  background: transparent;
  color: #f5f5f5;
}
.icon-pill-btn:hover { background: #202020; }
.product-upgrade-pill {
  min-height: 38px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f3f3f3;
  color: #090909;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.product-upgrade-pill:hover { background: #fff; }

.product-main { background: #0b0b0b; }
.product-topbar {
  height: 64px;
  min-height: 64px;
  padding: 0 18px;
  position: relative;
  justify-content: flex-end;
  border-bottom: 1px solid transparent;
  background: #0b0b0b;
}
.product-page-title {
  position: absolute;
  left: 24px;
  top: 50%;
  max-width: 30vw;
  margin: 0;
  overflow: hidden;
  transform: translateY(-50%);
  color: #f5f5f5;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-content { flex: 1; min-height: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; background: #0b0b0b; }
#productView { flex: 1; min-height: 0; display: flex; }
#productView > .content-area { width: 100%; }
.status-banner { position: fixed; top: 76px; left: 50%; z-index: 30; max-width: min(560px, 90vw); margin: 0; transform: translateX(-50%); }
.content-area { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #0b0b0b; }
.content-area.welcome-mode { justify-content: center; }
.content-area.welcome-mode .chat-window { flex: 0 0 auto; overflow: visible; padding-bottom: 0; }
.chat-window { flex: 1; min-height: 0; overflow-y: auto; padding: 52px max(22px, 18vw) 24px; scrollbar-width: thin; }
.welcome { text-align: center; }
.welcome-text { margin: 0; color: #fff; font-size: 26px; font-weight: 500; letter-spacing: 0; }
.message { margin-bottom: 28px; display: flex; flex-direction: column; align-items: flex-start; }
.message.user { align-items: flex-end; }
.message.ai { align-items: flex-start; }
.message .bubble { max-width: 760px; color: #f0f0f0; font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.message.ai .bubble { width: 100%; max-width: 760px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.message.user .bubble { padding: 12px 18px; border: 1px solid #303030; border-radius: 24px; background: #1a1a1a; }
.message.error .bubble { color: #ff9f9f; }
.input-area { flex: 0 0 auto; padding: 12px max(22px, 18vw) 24px; background: #0b0b0b; }
.input-shell {
  position: relative;
  width: min(100%, 720px);
  min-height: 86px;
  margin: 0 auto;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  border: 0;
  border-radius: 24px;
  outline: 0;
  background: #141414;
  box-shadow: none;
}
.input-shell:focus-within { border: 0; outline: 0; box-shadow: none; }
.input-shell textarea {
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  max-height: 150px;
  padding: 5px 7px 7px;
  overflow-y: auto;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}
.input-shell textarea::placeholder { color: #888; }
.composer-toolbar { width: 100%; min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-toolbar-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.input-shell .input-icon-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #c8c8c8;
}
.input-shell .input-icon-btn:hover:not(:disabled) { background: #242424; color: #fff; }
.input-shell .input-icon-btn:disabled { cursor: default; }
.input-shell .input-icon-btn.primary,
.input-shell .input-icon-btn.primary:disabled { background: #2a2a2a; color: #777; opacity: 1; }
.input-shell .input-icon-btn.send-ready { background: #fff; color: #000; }
.model-selector { position: relative; }
.input-shell .top-btn {
  height: 34px;
  min-width: 0;
  max-width: 170px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #f5f5f5;
  font-size: 13px;
  font-weight: 500;
}
.input-shell .top-btn:hover:not(:disabled) { background: #202020; }
.input-shell .top-btn .material-symbols-rounded { font-size: 18px; }
.product-model-label { cursor: default; }
.model-menu-popover {
  position: absolute;
  right: 0;
  bottom: 42px;
  z-index: 1000;
  min-width: 260px;
  display: none;
  overflow: hidden;
  border: 1px solid #343434;
  border-radius: 18px;
  background: #161616;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.model-menu-popover.open { display: flex; flex-direction: column; }
.model-option { padding: 12px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 0; border-bottom: 1px solid #232323; background: none; color: #fff; text-align: left; }
.model-option:last-child { border-bottom: 0; }
.model-option:hover { background: #212121; }
.model-option.active { background: #242424; }
.model-option-name { font-size: 14px; font-weight: 600; }
.model-option-desc { color: #999; font-size: 12px; }
.footer-note { margin-top: 10px; color: #777; text-align: center; font-size: 12px; }
.agent-chat-thinking { min-height: 28px; }
.agent-inline-progress { width: min(680px, 100%); }
.result-extras .agent-sources { padding: 10px 0 0; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.72);
}
.modal-backdrop.open { display: flex; }
.product-settings-modal {
  position: relative;
  width: min(620px, 94vw);
  max-height: min(86vh, 720px);
  padding: 24px;
  overflow-y: auto;
  border: 1px solid #303030;
  border-radius: 28px;
  background: #111;
  color: #f5f5f5;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.product-settings-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #999;
}
.product-settings-close:hover { background: #202020; color: #fff; }
.product-settings-close .material-symbols-rounded { font-size: 22px; }
.product-settings-modal h2 { margin: 0 0 16px; font-size: 22px; letter-spacing: 0; }
.settings-shell { min-height: 320px; display: flex; gap: 18px; }
.settings-nav { width: 160px; min-width: 160px; padding-right: 14px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid #242424; }
.settings-nav-item { padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 12px; background: transparent; color: #a0a0a0; font-size: 14px; font-weight: 600; text-align: left; }
.settings-nav-item:hover { background: #1b1b1b; color: #f5f5f5; }
.settings-nav-item.active { background: #1f1f1f; color: #fff; }
.settings-nav-item .material-symbols-rounded { font-size: 19px; }
.settings-content { flex: 1; min-width: 0; }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.settings-label { margin: 14px 0 6px; display: block; color: #999; font-size: 12px; }
.settings-label:first-child { margin-top: 0; }
.name-input, .readonly-field { width: 100%; min-height: 44px; padding: 11px 14px; border: 1px solid #343434; border-radius: 999px; background: #0b0b0b; color: #f5f5f5; outline: 0; font-size: 14px; }
.readonly-field { overflow: hidden; color: #d6d6d6; text-overflow: ellipsis; white-space: nowrap; }
.memory-textarea { width: 100%; min-height: 132px; padding: 12px 14px; resize: vertical; border: 1px solid #343434; border-radius: 8px; outline: 0; background: #0b0b0b; color: #f5f5f5; font-size: 14px; line-height: 1.5; }
.memory-textarea:focus, .name-input:focus { border-color: #777; }
.setting-row { margin: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setting-row.settings-stack { margin: 0; flex-direction: column; align-items: stretch; gap: 10px; }
.setting-row small { margin-top: 4px; display: block; color: #888; line-height: 1.4; }
.secondary-action-btn { width: 100%; height: 44px; margin-top: 10px; border: 1px solid #343434; border-radius: 999px; background: #181818; color: #f5f5f5; font-weight: 600; }
.secondary-action-btn:hover { background: #202020; }
.product-settings-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.product-billing-support {
  width: max-content;
  margin: 14px auto 0;
  padding: 8px 12px;
  display: block;
  border-radius: 999px;
  color: #999;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.product-billing-support:hover { background: #202020; color: #fff; }
.pwa-install-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.settings-status { min-height: 14px; margin-top: 8px; color: #8fd18f; font-size: 12px; }
.settings-status.error { color: #ff8080; }
.nemigo-code-box { display: flex; gap: 8px; }
.nemigo-code-box .readonly-field { flex: 1; min-width: 0; }
.nemigo-copy-btn { width: 82px; border: 1px solid #343434; border-radius: 999px; background: #181818; color: #f5f5f5; font-weight: 600; }
.nemigo-copy-btn:disabled { opacity: .45; cursor: default; }
.modal-actions { margin-top: 18px; display: flex; gap: 10px; }
.modal-actions button { flex: 1; height: 42px; border: 1px solid #343434; border-radius: 999px; background: #181818; color: #fff; }
.modal-actions button:hover { background: #202020; }
.modal-actions .primary { border: 0; background: #fff; color: #000; }
.modal-actions .primary:hover { background: #e5e5e5; }
.product-subscription-head { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid #2c2c2c; }
.product-subscription-head div { display: grid; gap: 4px; }
.product-subscription-head strong { font-size: 18px; }
.product-subscription-head span { color: #999; font-size: 12px; text-transform: capitalize; }
.product-plan-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid #2c2c2c; }
.product-plan-row > div { display: grid; grid-template-columns: auto 1fr; gap: 4px 9px; align-items: baseline; }
.product-plan-row strong { font-size: 15px; }
.product-plan-row span { color: #aaa; font-size: 12px; }
.product-plan-row small { grid-column: 1 / -1; color: #888; line-height: 1.4; }
.subscription-plan-action { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: #f3f3f3; color: #090909; font-size: 13px; font-weight: 750; }
.subscription-plan-action:hover:not(:disabled) { background: #fff; }
.subscription-plan-action:disabled { opacity: .45; cursor: default; }
.product-upgrade-view { min-height: calc(100vh - 82px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.product-upgrade-view > .material-symbols-rounded { margin-bottom: 16px; color: #888; font-size: 30px; }
.product-upgrade-view h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: 0; }
.product-upgrade-view p { max-width: 430px; margin: 0 0 22px; color: #999; font-size: 14px; line-height: 1.5; }

html[data-theme="light"] .product-main,
html[data-theme="light"] .product-topbar,
html[data-theme="light"] .product-content,
html[data-theme="light"] .content-area,
html[data-theme="light"] .chat-window,
html[data-theme="light"] .input-area { background: #fff; }
html[data-theme="light"] .sidebar-logo.full-logo { padding: 0; border-radius: 0; background: transparent; }
html[data-theme="light"] .sidebar-search-btn { color: #777; }
html[data-theme="light"] .product-upgrade-pill { background: #111; color: #fff; }
html[data-theme="light"] .product-upgrade-pill:hover { background: #000; }
html[data-theme="light"] .product-settings-close { color: #777; }
html[data-theme="light"] .product-settings-close:hover,
html[data-theme="light"] .product-billing-support:hover { background: #eee; color: #111; }
html[data-theme="light"] .sidebar-search-btn:hover { background: #f0f0f0; color: #111; }
html[data-theme="light"] .chat-search-bar { border-color: #dcdcdc; background: #f5f5f5; color: #777; }
html[data-theme="light"] .chat-search-bar input { color: #111; }
html[data-theme="light"] .chat-search-bar input::placeholder { color: #999; }
html[data-theme="light"] .chat-search-bar button { color: #777; }
html[data-theme="light"] .product-page-title,
html[data-theme="light"] .welcome-text,
html[data-theme="light"] .message .bubble { color: #111; }
html[data-theme="light"] .message.user .bubble { border-color: #e1e1e1; background: #f1f1f1; }
html[data-theme="light"] .input-shell { background: #f5f5f5; }
html[data-theme="light"] .input-shell textarea { color: #111; }
html[data-theme="light"] .input-shell .input-icon-btn { color: #555; }
html[data-theme="light"] .input-shell .input-icon-btn:hover:not(:disabled) { background: #e6e6e6; color: #111; }
html[data-theme="light"] .input-shell .input-icon-btn.primary:disabled { background: #dedede; color: #999; }
html[data-theme="light"] .input-shell .input-icon-btn.send-ready { background: #111; color: #fff; }
html[data-theme="light"] .input-shell .top-btn { color: #111; }
html[data-theme="light"] .input-shell .top-btn:hover:not(:disabled) { background: #e6e6e6; }
html[data-theme="light"] .model-menu-popover { border-color: #dcdcdc; background: #fff; box-shadow: 0 18px 40px rgba(0,0,0,.12); }
html[data-theme="light"] .model-option { border-bottom-color: #ececec; color: #111; }
html[data-theme="light"] .model-option:hover,
html[data-theme="light"] .model-option.active { background: #f0f0f0; }
html[data-theme="light"] .model-option-desc { color: #888; }

@media (max-width: 900px) {
  html, body { overflow: hidden; }
  .app { display: block; overflow: hidden; }
  .product-main { height: 100vh; min-height: 100vh; }
  .product-topbar { height: 64px; min-height: 64px; padding: 0 12px; justify-content: flex-start; }
  .product-page-title { display: none; }
  .product-actions { margin-left: auto; }
  .mobile-top-new-chat-btn { display: inline-flex; }
  .product-content { padding: 0; }
  .chat-window { padding: 30px 16px 18px; }
  .welcome-text { font-size: 22px; }
  .input-area { padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
  .input-shell { min-height: 84px; padding: 9px 9px 7px; border-radius: 22px; }
  .input-shell textarea { width: 100%; padding: 5px 7px 7px; font-size: 16px; }
  .input-shell .top-btn { max-width: 150px; padding: 0 6px; }
  .product-app.nav-open .sidebar { transform: translateX(0); }
  .product-app.nav-open .sidebar-backdrop { display: block; }
  .sidebar.collapsed .sidebar-search-btn { display: flex; }
  .product-settings-modal { width: min(94vw, 620px); max-height: 90vh; padding: 18px; border-radius: 24px; }
  .settings-shell { min-height: 0; flex-direction: column; gap: 14px; }
  .settings-nav { width: 100%; min-width: 0; padding: 0 0 10px; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid #242424; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav-item { flex: 0 0 auto; border-radius: 999px; }
  .product-plan-row { grid-template-columns: 1fr; }
  .subscription-plan-action { width: 100%; }
}

/* Kyro Agents uses a fully black app canvas. */
body[data-product="agents"],
body[data-product="agents"] .app,
body[data-product="agents"] .sidebar,
body[data-product="agents"] .product-main,
body[data-product="agents"] .product-topbar,
body[data-product="agents"] .product-content,
body[data-product="agents"] .content-area,
body[data-product="agents"] .chat-window,
body[data-product="agents"] .input-area {
  background: #000 !important;
}

body[data-product="agents"] .input-shell {
  background: #202020 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
