/* Kodev Agent design system. Keep these tokens aligned with the IDE extension. */
:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #18191b;
  --panel: #1c1d1f;
  --text: #e0e0df;
  --muted: #a3a3a1;
  --faint: #858583;
  --surface: color-mix(in srgb, var(--text) 4%, var(--panel));
  --raised: color-mix(in srgb, var(--text) 7%, var(--panel));
  --hover: color-mix(in srgb, var(--text) 9%, var(--panel));
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --line-subtle: color-mix(in srgb, var(--text) 6%, transparent);
  --accent: #c1d6c9;
  --green: #a4c6ae;
  --red: #d39b96;
  --amber: #d5bd91;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --radius-control: 8px;
  --radius-surface: 16px;
  --radius-floating: 20px;
  --radius-composer: 26.5px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --surface-shadow: 0 0 0 1px var(--line-subtle), 0 2px 4px #00000008;
  --floating-shadow: 0 0 0 1px var(--line), 0 8px 32px #0003;
  --panel-raised: var(--raised);
  --panel-hover: var(--hover);
  --field: var(--bg);
  --line-soft: var(--line-subtle);
  --dim: var(--faint);
  --danger: var(--red);
  --success: var(--green);
  --radius: var(--radius-control);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
html { background: var(--panel); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { min-height: 100vh; min-height: 100dvh; color: var(--text); background: var(--panel); font: 13px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 7px 12px; border: 0; border-radius: var(--radius-control); background: transparent; cursor: pointer; line-height: 1.4; transition: color 140ms var(--ease), background-color 140ms var(--ease), border-color 140ms var(--ease), box-shadow 180ms var(--ease), opacity 140ms var(--ease), scale 140ms var(--ease); }
button:hover:not(:disabled) { background: var(--hover); }
/* Icon-only buttons: hover and press brighten the icon itself, never the button surface. */
:is(.icon-button, .account-dots, button[aria-label]:has(> :is(img, svg):only-child)):not(.send-button, .primary-action) :is(img, svg) { transition: filter 150ms var(--ease), opacity 150ms var(--ease), color 150ms var(--ease); }
:is(.icon-button, .account-dots, button[aria-label]:has(> :is(img, svg):only-child)):not(.send-button, .primary-action):is(:hover, :active):not(:disabled) { background: transparent; box-shadow: none; }
:is(.icon-button, .account-dots, button[aria-label]:has(> :is(img, svg):only-child)):not(.send-button, .primary-action):is(:hover, :focus-visible):not(:disabled) { color: var(--text); }
:is(.icon-button, .account-dots, button[aria-label]:has(> :is(img, svg):only-child)):not(.send-button, .primary-action):is(:hover, :focus-visible):not(:disabled) :is(img, svg) { filter: brightness(1.55); opacity: 1; }
button:active:not(:disabled) { scale: .96; }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, textarea, select { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); padding: 11px 12px; transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease); }
input:focus, textarea:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input { min-height: 44px; }
a { color: var(--accent); text-underline-offset: 3px; }
p, li { text-wrap: pretty; }
h1, h2, h3, h4 { font-weight: 600; text-wrap: balance; letter-spacing: -.02em; }
img, svg { flex-shrink: 0; vertical-align: middle; }
svg { stroke-linecap: round; stroke-linejoin: round; }
strong { font-weight: 600; }
small { font-size: 11px; }
code, pre { font-family: var(--mono); }
::selection { color: var(--text); background: color-mix(in srgb, var(--accent) 25%, var(--panel)); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.kairos-mark { display: inline-block; width: 24px; height: 24px; flex-shrink: 0; background: currentColor; mask: url('assets/KairosLogo.svg') center / contain no-repeat; }
.icon-button { flex-shrink: 0; width: 40px; height: 40px; padding: 0; color: var(--muted); }
.icon-button img, .icon-button svg { width: 18px; height: 18px; }
.primary-action, .submit-button, .branch-action-button.primary, .ultra-control-button.primary { background: var(--text); color: var(--panel); font-weight: 600; }
:is(.primary-action, .submit-button, .branch-action-button.primary, .ultra-control-button.primary):hover:not(:disabled) { background: color-mix(in srgb, var(--text) 88%, var(--panel)); }
.ghost-action, .branch-action-button { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-subtle); color: var(--text); font-size: 12px; }
.primary-action img, .ghost-action img { width: 16px; height: 16px; }
.primary-action img { filter: brightness(.2); }
.workspace-kicker, .section-label { color: var(--muted); font-size: 11px; font-weight: 500; }
.form-message, .app-message { color: var(--muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.form-message:empty, .app-message:empty { display: none; }
.form-message.error, .app-message.error { color: var(--red); }
.form-message.success, .app-message.success { color: var(--green); }

/* Account and repository setup */
.auth-brand { position: absolute; top: 24px; left: 28px; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--text); }
.brand-icon { width: 25px; height: 25px; object-fit: contain; }
.auth-shell, .onboarding-shell { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 100px 24px 80px; }
.form-panel { width: min(100%, 360px); }
.onboarding-panel { width: min(100%, 460px); }
.auth-emblem { margin-bottom: 28px; color: var(--muted); }
.auth-emblem .kairos-mark { width: 40px; height: 40px; }
.form-heading { margin-bottom: 30px; }
.form-heading h1 { font-size: 27px; line-height: 1.25; letter-spacing: -.85px; }
.form-heading p { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.auth-form { display: grid; gap: 18px; }
.auth-form label { display: grid; gap: 7px; font-size: 12px; color: var(--muted); }
.auth-form input { width: 100%; color: var(--text); }
.submit-button { width: 100%; margin-top: 4px; min-height: 44px; }
.auth-toggle { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.auth-toggle button { padding: 0 6px; color: var(--text); }
.auth-footer { position: absolute; bottom: 24px; left: 24px; right: 24px; text-align: center; color: var(--faint); font-size: 11px; }
.auth-footer a { color: var(--muted); text-decoration: none; }
.auth-footer a:hover { color: var(--text); }
.auth-footer span { margin: 0 6px; }
.setup-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 30px; color: var(--faint); font-size: 11px; }
.setup-progress i { width: 28px; height: 3px; background: var(--line); border-radius: 2px; }
.setup-progress i.complete { background: var(--accent); }
.setup-progress span { margin-left: 4px; }
.provider-grid { display: grid; gap: 12px; margin-bottom: 20px; }
.provider-card { display: flex; width: 100%; min-height: 88px; padding: 18px; gap: 16px; text-align: left; justify-content: flex-start; border-radius: var(--radius-surface); background: var(--surface); box-shadow: var(--surface-shadow); }
.provider-card > span:nth-child(2) { flex: 1; min-width: 0; }
.provider-card::after { content: '›'; color: var(--muted); font-size: 22px; }
.provider-mark { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; background: var(--raised); }
.provider-mark img { width: 21px; height: 21px; object-fit: contain; }
.provider-mark img[src$="Github.svg"] { filter: brightness(0) invert(.88); }
.provider-card strong, .provider-card small { display: block; }
.provider-card strong { font-size: 13px; font-weight: 500; }
.provider-card small { margin-top: 5px; color: var(--muted); line-height: 1.6; }
.setup-note { color: var(--faint); font-size: 11px; text-align: center; margin-top: 20px; }

/* Workbench shell and navigation */
.app-body { height: 100vh; height: 100dvh; overflow: hidden; }
.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100%; }
.app-sidebar { display: flex; flex-direction: column; min-height: 0; gap: 8px; padding: 8px 8px 6px; background: var(--bg); border-right: 1px solid var(--line-subtle); }
.app-brand { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 6px; font-weight: 600; }
.app-brand img { width: 23px; height: 23px; }
.app-brand .icon-button { margin-left: auto; }
.sidebar-nav { display: grid; gap: 1px; }
.sidebar-nav-button { justify-content: flex-start; gap: 8px; padding: 4px 8px; color: var(--muted); text-align: left; width: 100%; font-size: 12px; }
.sidebar-nav-button img { width: 17px; height: 17px; }
.sidebar-nav-button.active, .sidebar-nav-button[aria-current='page'] { color: var(--text); background: var(--raised); }
.project-nav, .chat-history-panel { display: flex; flex-direction: column; min-height: 0; gap: 1px; }
.project-nav { flex-shrink: 0; max-height: 32%; }
.chat-history-panel { flex: 1; }
#chat-archive-toggle { margin: 2px 8px 0; min-height: 22px; padding: 0 6px; align-self: flex-start; font-size: 10px; color: var(--faint); background: transparent; }
#chat-archive-toggle[hidden] { display: none; }
#chat-archive-toggle[aria-pressed="true"] { color: var(--text); }
.sidebar-section-heading { display: flex; align-items: center; justify-content: space-between; min-height: 24px; padding-left: 8px; color: var(--faint); font-size: 11px; }
.sidebar-list { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 1px; }
/* Apps / Repos switch: a compact icon toggle; one list at a time, following the open project. */
.sidebar-kind-heading { padding-right: 2px; }
.sidebar-segment { position: relative; display: inline-grid; grid-template-columns: 22px 22px; flex-shrink: 0; padding: 2px; background: transparent; }
.sidebar-segment::before { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 18px; border-radius: 5px; background: var(--raised); box-shadow: 0 0 0 1px var(--line-subtle), 0 1px 2px #0000001f; transition: translate 180ms var(--ease); }
.sidebar-segment[data-kind="repos"]::before { translate: 22px 0; }
.sidebar-segment .sidebar-segment-option { position: relative; z-index: 1; width: 22px; height: 18px; min-height: 0; padding: 0; border-radius: 5px; }
.sidebar-segment .sidebar-segment-option:is(:hover, :active):not(:disabled) { background: transparent; }
.sidebar-segment .sidebar-segment-option img { width: 12px; height: 12px; opacity: .55; filter: none; transition: opacity 150ms var(--ease); }
.sidebar-segment .sidebar-segment-option:is([aria-selected="true"], :hover, :focus-visible) img { opacity: 1; filter: none; }
.sidebar-segment .sidebar-segment-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sidebar-segment .sidebar-segment-option:active:not(:disabled) { scale: 1; }
/* Edge fades appear only where items are scrolled out of view. */
@property --fade-top { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --fade-bottom { syntax: "<length>"; inherits: false; initial-value: 0px; }
.sidebar-fade-list { --fade-top: 0px; --fade-bottom: 0px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%); transition: --fade-top 180ms var(--ease), --fade-bottom 180ms var(--ease); }
.sidebar-fade-list[data-fade-top] { --fade-top: 28px; }
.sidebar-fade-list[data-fade-bottom] { --fade-bottom: 28px; }
.sidebar-fade-list[hidden] { display: none; }
.sidebar-item { width: 100%; min-width: 0; text-align: left; justify-content: flex-start; padding: 4px 8px; gap: 8px; color: var(--muted); font-size: 12px; }
.sidebar-item img { width: 16px; height: 16px; opacity: .8; }
.sidebar-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-item.active { color: var(--text); background: var(--surface); }
.sidebar-empty { padding: 8px 10px; color: var(--faint); font-size: 11px; }
.sidebar-chat-item { display: flex; align-items: center; border-radius: var(--radius-control); min-width: 0; }
.sidebar-chat-copy { display: grid; flex: 1; min-width: 0; }
.sidebar-chat-item:hover, .sidebar-chat-item.active { background: var(--surface); }
.chat-title-button { flex: 1; min-width: 0; padding: 3px 8px; justify-content: flex-start; color: var(--muted); text-align: left; font-size: 12px; }
.chat-title-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-chat-item.active .chat-title-button { color: var(--text); }
.chat-delete-button, .chat-archive-button { width: 26px; min-height: 28px; padding: 0; opacity: 0; flex-shrink: 0; align-self: center; }
.sidebar-chat-item :is(.chat-title-button, .chat-delete-button, .chat-archive-button):is(:hover, :active), .sidebar-chat-item :is(.chat-delete-button, .chat-archive-button) { background: transparent; box-shadow: none; }
.chat-delete-button img, .chat-archive-button img { width: 14px; height: 14px; }
.sidebar-chat-item:hover :is(.chat-delete-button, .chat-archive-button), .sidebar-chat-item:focus-within :is(.chat-delete-button, .chat-archive-button) { opacity: 1; }
.sidebar-footer { position: relative; margin-top: auto; padding-top: 8px; }
.sidebar-docs-link { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 7px; padding: 6px 8px; border-radius: 8px; color: var(--muted); font-size: 12px; text-decoration: none; transition: color 140ms var(--ease), background-color 140ms var(--ease); }
.sidebar-docs-link:hover { color: var(--text); background: var(--hover); }
.sidebar-docs-link img { width: 17px; height: 17px; opacity: .75; }
.sidebar-docs-link span:last-child { margin-left: auto; font-size: 14px; }
.sidebar-account-pill { width: 100%; justify-content: flex-start; padding: 4px 6px; gap: 8px; text-align: left; }
.account-avatar { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--raised); color: var(--text); font-size: 10px; font-weight: 500; }
.account-info { display: grid; flex: 1; min-width: 0; gap: 1px; }
.account-name, .account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name { font-size: 12px; font-weight: 500; }
.account-email { color: var(--faint); font-size: 10px; }
.account-dots img { width: 18px; height: 18px; }
.account-popover { position: absolute; z-index: 30; left: 0; right: 0; bottom: calc(100% + 5px); padding: 6px; background: var(--raised); border-radius: var(--radius-surface); box-shadow: var(--floating-shadow); animation: surface-in 160ms var(--ease); }
.popover-item { width: 100%; justify-content: flex-start; padding: 8px 10px; font-size: 12px; }
.popover-icon { width: 17px; height: 17px; color: var(--muted); }
.popover-item.logout { color: var(--muted); border-top: 1px solid var(--line-subtle); margin-top: 4px; }
.mobile-menu-button, .sidebar-close, .sidebar-scrim { display: none; }

/* Projects use the same quiet rows as the extension's conversation history. */
.workspace-view { min-width: 0; min-height: 0; overflow: auto; background: var(--panel); }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 26px; border-bottom: 1px solid var(--line-subtle); }
.workspace-header h1 { font-size: 13px; font-weight: 500; letter-spacing: 0; }
.workspace-header .primary-action { min-height: 36px; font-size: 12px; }
.projects-content { width: min(100%, 900px); margin: 0 auto; padding: clamp(30px, 6vh, 68px) 36px; }
.projects-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.projects-heading h2 { font-size: 25px; line-height: 1.3; letter-spacing: -.65px; }
.projects-heading p { color: var(--muted); font-size: 12px; margin-top: 8px; }
.project-search { width: 210px; min-height: 38px; padding: 8px 12px; font-size: 12px; }
.project-grid { display: grid; gap: 5px; }
.project-group-heading { margin: 12px 8px 3px; color: var(--faint); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.project-group-heading:first-child { margin-top: 0; }
.project-card-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 0; padding-right: 6px; border-radius: 8px; transition: background-color 140ms var(--ease); }
.project-card-row.can-delete { grid-template-columns: minmax(0, 1fr) 40px; }
.project-card-row:has(.project-card:is(:hover, :focus-visible)) { background: var(--hover); }
.project-card-delete { display: grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0; color: var(--muted); opacity: .68; }
.project-card-delete:hover:not(:disabled), .project-card-delete:focus-visible { color: var(--red); background: transparent; opacity: 1; }
.project-card-delete-icon { width: 16px; height: 16px; background: currentColor; mask: url("assets/trash-2.svg") center / contain no-repeat; }
.project-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; width: 100%; min-width: 0; align-items: center; gap: 15px; padding: 11px 14px 11px 14px; text-align: left; border-radius: 8px; }
.project-card:hover:not(:disabled), .project-card:focus-visible { background: transparent; }
.project-card-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-subtle); }
.project-card-icon img { width: 18px; height: 18px; }
.project-card-copy { display: grid; min-width: 0; gap: 3px; }
.project-card-copy strong { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card-copy small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card-tags { display: flex; align-items: center; gap: 6px; }
.project-app-pill { color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 10%, var(--surface)) !important; }
.provider-pill { display: inline-flex; align-items: center; width: fit-content; padding: 3px 7px; border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 400; white-space: nowrap; }
.empty-state { display: grid; place-items: center; text-align: center; gap: 12px; padding: 64px 24px; color: var(--muted); }
.empty-state .kairos-mark { width: 40px; height: 40px; margin-bottom: 12px; opacity: .4; }
.empty-state strong { color: var(--text); font-size: 16px; }
.empty-state p { max-width: 320px; font-size: 12px; }

/* Conversation and floating composer */
.project-workspace { position: relative; display: grid; grid-template-rows: 56px minmax(0, 1fr); height: 100%; overflow: hidden; --composer-height: 120px; }
.project-topbar { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--line-subtle); }
.conversation-heading { display: flex; align-items: center; min-width: 0; gap: 10px; }
.conversation-heading > div { min-width: 0; }
.conversation-heading h1 { font-size: 13px; line-height: 1.6; font-weight: 600; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-heading .workspace-kicker { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.return-projects-button { width: 36px; flex-shrink: 0; padding: 0; color: var(--muted); }
.return-projects-button img { width: 17px; height: 17px; }
.project-context { display: flex; align-items: center; gap: 8px; min-width: 0; }
.load-earlier { display: block; width: 100%; margin: 0 0 16px; min-height: 32px; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 12px; background: transparent; box-shadow: inset 0 0 0 1px var(--line-subtle); }
.load-earlier:hover:not(:disabled) { color: var(--text); background: var(--surface); }
.load-earlier:active:not(:disabled) { scale: 1; }
.workspace-mode-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); }
.workspace-mode-tab { color: var(--muted); min-height: 32px; padding: 6px 9px; font-size: 11px; gap: 6px; }
.workspace-mode-tab.active { background: var(--raised); color: var(--text); }
.workspace-mode-count { font: 10px var(--mono); color: var(--faint); }
.workspace-mode-count[data-active='true'] { color: var(--green); }
.message-list, .agent-detail-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 28px max(24px, calc((100% - 736px) / 2)) 32px; }
.message-list { grid-row: 2; padding-bottom: calc(var(--composer-height) + 52px); scroll-padding-bottom: calc(var(--composer-height) + 36px); }
.message-list > *, .agent-detail-scroll > * { min-width: 0; }
.chat-empty { display: grid; place-items: center; align-content: center; min-height: 100%; text-align: center; gap: 18px; color: var(--faint); font-size: 12px; }
.chat-empty .kairos-mark { width: 48px; height: 48px; color: color-mix(in srgb, var(--muted) 28%, transparent); }
.chat-empty p { max-width: 330px; color: var(--faint); font-size: 12px; }
.message-row { margin-bottom: 28px; }
.message-row.message-entering { animation: message-in 200ms var(--ease); }
.message-row.user { width: fit-content; max-width: 86%; margin-left: auto; }
.message-row.user > .message-content { padding: 12px 16px; background: var(--raised); border-radius: 18px 18px 5px 18px; white-space: pre-wrap; }
.message-row.assistant { width: 100%; }
.message-content { font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p { margin: 0 0 14px; }
.message-content :is(h1,h2,h3,h4,h5,h6) { margin: 24px 0 10px; font-size: 1.08em; line-height: 1.4; }
.message-content h1 { font-size: 1.35em; }
.message-content h2 { font-size: 1.2em; }
.message-content :is(ul,ol) { padding-left: 22px; margin: 10px 0 16px; }
.message-content li { padding-left: 3px; margin: 5px 0; }
.message-content li > p { margin-bottom: 6px; }
.message-content :not(pre) > code { padding: 2px 5px; background: var(--surface); border-radius: 5px; font: .9em var(--mono); }
.message-content pre { margin: 16px 0; padding: 14px 16px; background: var(--bg); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-subtle); overflow-x: auto; font: 11px/1.8 var(--mono); }
.message-content pre code { white-space: pre; }
.message-content blockquote { border-left: 2px solid var(--line); padding: 2px 14px; margin: 16px 0; color: var(--muted); }
.message-content table { display: block; overflow: auto; border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 12px; }
.message-content :is(th,td) { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.message-content th { font-weight: 500; background: var(--surface); }
.message-content hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.composer-shell { position: absolute; z-index: 3; bottom: 18px; left: 24px; right: 24px; width: min(calc(100% - 48px), 736px); margin: 0 auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-composer); background: color-mix(in srgb, var(--raised) 84%, transparent); backdrop-filter: blur(18px) saturate(1.15); -webkit-backdrop-filter: blur(18px) saturate(1.15); box-shadow: inset 0 1px 0 var(--line-subtle), 0 6px 24px #0003; transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease); }
.composer-shell:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 8%, transparent), 0 6px 24px #0003; }
.composer-shell.drag-over { border-color: var(--accent); background: var(--raised); }
.composer-shell textarea { display: block; width: 100%; min-height: 48px; max-height: 132px; padding: 7px 9px; border: 0; border-radius: 8px; background: none; resize: none; font-size: 13px; line-height: 1.7; }
.composer-shell textarea:focus-visible { outline: 0; }
.composer-controls { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.composer-left-controls { display: flex; align-items: center; gap: 2px; min-width: 0; }
.composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; min-width: 0; }
.attachment-button { flex-shrink: 0; width: 40px; height: 40px; padding: 0; color: var(--muted); }
.attachment-button img { width: 18px; height: 18px; }
.ultra-code-toggle { color: var(--muted); font-size: 11px; gap: 6px; padding: 6px 8px; white-space: nowrap; }
.ultra-code-toggle img { width: 14px; height: 14px; }
.ultra-code-toggle.active { color: var(--accent); background: var(--surface); }
.model-picker { position: relative; min-width: 0; }
.model-trigger { gap: 6px; min-width: 0; max-width: 200px; padding: 6px 8px; color: var(--muted); font-size: 11px; }
#model-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-caret img { width: 12px; height: 12px; }
.model-menu { position: absolute; bottom: calc(100% + 12px); right: 0; width: 290px; max-width: calc(100vw - 32px); max-height: min(400px, 60vh); overflow: auto; padding: 6px; border-radius: var(--radius-surface); background: var(--raised); box-shadow: var(--floating-shadow); animation: surface-in 160ms var(--ease); }
.model-option { display: grid; width: 100%; justify-content: stretch; text-align: left; padding: 9px 10px; gap: 3px; }
.model-option span { font-size: 12px; }
.model-option small { color: var(--faint); font-size: 10px; overflow-wrap: anywhere; }
.model-option.active { background: var(--surface); }
.model-option.active span::after { content: '✓'; color: var(--accent); float: right; }
.send-button { position: relative; flex-shrink: 0; width: 34px; height: 34px; min-height: 34px; padding: 0; margin: 3px; border-radius: 50%; background: var(--text); color: var(--panel); }
.side-thread ol { margin: 0; padding: 0; list-style: none; }
.side-thread li + li { margin-top: 2px; }
.side-thread button { display: block; width: 100%; min-height: 0; padding: 6px 8px; border-radius: 8px; background: transparent; text-align: left; }
.side-thread button:active:not(:disabled) { scale: 1; }
.side-thread button:hover { background: var(--surface); }
.side-thread button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.side-thread-q { display: block; overflow: hidden; color: var(--text); font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.side-thread-a { display: -webkit-box; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.45; text-wrap: pretty; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.side-thread .is-failed .side-thread-q { color: var(--red); }
.send-button:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 85%, var(--panel)); }
.send-button:disabled { background: var(--hover); color: var(--muted); opacity: .6; }
.send-icon { display: grid; place-items: center; position: absolute; opacity: 1; scale: 1; filter: blur(0); transition: opacity 180ms var(--ease), scale 220ms var(--ease), filter 180ms var(--ease); }
.send-icon svg { width: 18px; height: 18px; }
.send-button .stop-icon { position: absolute; width: 13px; height: 13px; filter: brightness(.2) blur(4px); scale: .25; opacity: 0; transition: opacity 180ms var(--ease), scale 220ms var(--ease), filter 180ms var(--ease); }
.send-button.is-stopping .send-icon { opacity: 0; scale: .25; filter: blur(4px); }
.send-button.is-stopping .stop-icon { opacity: 1; scale: 1; filter: brightness(.2) blur(0); }
.send-button.is-stop-pending .stop-icon { opacity: 0; }
.send-button.is-stop-pending::after { content: ''; width: 16px; height: 16px; border: 1.5px solid var(--muted); border-top-color: var(--panel); border-radius: 50%; animation: spin .9s linear infinite; }
.jump-latest { position: absolute; z-index: 4; left: 50%; bottom: calc(var(--composer-height) + 30px); translate: -50% 0; min-height: 32px; padding: 5px 12px; border-radius: 20px; background: var(--raised); box-shadow: var(--floating-shadow); color: var(--muted); font-size: 11px; }
.attachment-preview { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; }
.attachment-item { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 230px; padding: 5px 8px; border-radius: 10px; background: var(--surface); box-shadow: var(--surface-shadow); }
.attachment-thumbnail { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; outline: 1px solid #ffffff1a; }
.attachment-file-icon { width: 20px; height: 20px; }
.attachment-info { display: grid; min-width: 0; }
.attachment-name { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-size { color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.attachment-remove { width: 32px; padding: 0; min-height: 32px; flex-shrink: 0; }
.attachment-remove img { width: 13px; height: 13px; }
.message-attachments { justify-content: flex-end; margin-bottom: 8px; }

/* Agent activity, plans and review */
.agent-event { display: flex; align-items: flex-start; gap: 9px; padding: 4px 0; margin: 6px 0; color: var(--muted); animation: status-in 180ms var(--ease); }
.agent-event.settled, .agent-working-update.settled { animation: none; }
.agent-event > div { flex: 1; min-width: 0; }
.agent-event-icon, .agent-working-update-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 18px; height: 22px; }
.agent-event-icon img, .agent-working-update-icon img { width: 16px; height: 16px; opacity: .8; }
.agent-event strong { font-size: 12px; line-height: 22px; font-weight: 400; overflow-wrap: anywhere; }
.agent-event small { display: block; color: var(--faint); font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.side-question .side-question-kicker { display: block; color: var(--faint); font-size: 10px; line-height: 1.4; }
.side-question strong { display: block; line-height: 1.45; color: var(--text); }
.side-question .side-question-answer { margin: 4px 0 0; color: var(--text); font-size: 12px; line-height: 1.55; text-wrap: pretty; white-space: pre-wrap; max-height: 240px; overflow: auto; }
.side-question .side-question-tools { display: block; margin-top: 4px; color: var(--faint); font-size: 10px; }
.agent-event em { margin-left: auto; white-space: nowrap; font: 10px/22px var(--mono); }
.agent-event b { font-weight: 400; color: var(--green); }
.agent-event i { font-style: normal; color: var(--red); }
.agent-event.error > .agent-event-icon, .agent-event.error strong { color: var(--red); }
.agent-event.running .agent-event-icon { animation: working-pulse 1.8s ease-in-out infinite; }
.agent-working-update { display: flex; align-items: flex-start; gap: 9px; margin: 20px 0; color: var(--muted); animation: status-in 180ms var(--ease); }
.agent-working-update > div { min-width: 0; }
.agent-working-update p { font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
.agent-working-update code { font: 11px var(--mono); background: var(--surface); padding: 2px 4px; border-radius: 4px; }
.agent-event-speaker, .agent-update-speaker { display: inline-block; color: var(--faint); font-size: 10px; font-weight: 400; margin: 0 0 3px 7px; }
.agent-update-speaker { margin-left: 0; }
.agent-event-initials { font: 8px var(--mono); }
.thinking-scribble { display: block; width: 13px; height: 13px; border: 1.5px solid var(--line); border-top-color: var(--muted); border-radius: 50%; animation: spin 1s linear infinite; }
.thinking-scribble-stroke { display: none; }
.agent-thinking-status { display: flex; align-items: center; min-height: 22px; margin: 6px 0; padding: 4px 0; color: var(--muted); overflow-anchor: none; }
.thinking-label { display: inline-block; font-size: 12px; line-height: 22px; font-weight: 400; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .thinking-label { color: transparent; background: linear-gradient(110deg, var(--muted) 35%, var(--text) 50%, var(--muted) 65%) 200% 0 / 250% 100%; background-clip: text; -webkit-background-clip: text; animation: thinking-shimmer 2s ease-in-out infinite; }
}
@keyframes thinking-shimmer { to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .thinking-label { animation: none; background: none; color: var(--muted); }
}
@media (forced-colors: active) { .thinking-label { color: CanvasText; } }
.agent-event-actions { margin-top: 5px; }
.agent-event-actions summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 11px; min-height: 32px; }
.agent-event-actions summary::-webkit-details-marker { display: none; }
.agent-event-actions-chevron { width: 10px; height: 10px; transition: rotate 180ms var(--ease); }
.agent-event-actions[open] .agent-event-actions-chevron { rotate: 90deg; }
.agent-event-actions-panel { display: none; }
.agent-event-actions[open] > .agent-event-actions-panel { display: block; }
.agent-event-actions ul { list-style: none; margin: 0; padding: 4px 0 4px 15px; border-left: 1px solid var(--line-subtle); }
.agent-event-actions li { padding: 4px 0; font-size: 11px; overflow-wrap: anywhere; }
.agent-event-diff { margin: 10px 0 14px; background: var(--bg); border-radius: 12px; overflow: hidden; box-shadow: var(--surface-shadow); }
.agent-diff-header { padding: 8px 12px; border-bottom: 1px solid var(--line-subtle); color: var(--muted); font: 10px var(--mono); overflow-wrap: anywhere; }
.agent-diff-scroll { max-height: 280px; overflow: auto; }
.agent-diff-line { display: grid; grid-template-columns: 46px 46px 18px minmax(max-content, 1fr); width: max-content; min-width: 100%; font: 11px/1.8 var(--mono); }
.agent-diff-number { color: var(--faint); text-align: right; padding: 0 7px; user-select: none; }
.agent-diff-marker { text-align: center; }
.agent-diff-line code { white-space: pre; padding-right: 12px; }
.agent-diff-line.add, .diff-line.add { background: color-mix(in srgb, var(--green) 10%, transparent); }
.agent-diff-line.del, .diff-line.del { background: color-mix(in srgb, var(--red) 10%, transparent); }
.agent-diff-line.add :is(.agent-diff-number,.agent-diff-marker), .diff-line.add { color: var(--green); }
.agent-diff-line.del :is(.agent-diff-number,.agent-diff-marker), .diff-line.del { color: var(--red); }
.agent-diff-line.hunk, .agent-diff-line.meta, .diff-line.meta { color: var(--faint); }
.agent-diff-truncated { padding: 8px 12px; color: var(--faint); font-size: 10px; }
.diff-line { display: block; }
.implementation-plan, .task-checklist { margin: 22px 0; padding: 16px; background: var(--surface); border-radius: var(--radius-surface); box-shadow: var(--surface-shadow); }
.implementation-plan.entering, .task-checklist.entering { animation: message-in 200ms var(--ease); }
.implementation-plan-main { display: flex; gap: 10px; align-items: flex-start; }
.implementation-plan-main > div { min-width: 0; }
.implementation-plan strong, .task-checklist-header strong { font-size: 12px; }
.implementation-plan-mark { width: 22px; height: 22px; display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.check-svg-mask { display: inline-block; width: 13px; height: 13px; background: currentColor; mask: url('assets/Check.svg') center / contain no-repeat; }
.implementation-plan-note, .task-checklist-note { margin-top: 5px; color: var(--muted); font-size: 11px; }
.implementation-plan small { display: block; color: var(--faint); font: 10px var(--mono); margin-top: 7px; overflow-wrap: anywhere; }
.implementation-plan-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding-top: 14px; }
.branch-action-button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
.task-checklist-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-checklist-count { font: 10px/22px var(--mono); color: var(--muted); white-space: nowrap; }
.task-checklist-items { list-style: none; padding: 0; margin-top: 12px; }
.task-checklist-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: 12px; color: var(--muted); }
.task-check-icon { display: grid; place-items: center; width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; font-size: 10px; }
.task-checklist-item.done .task-check-icon { border: 0; color: var(--green); }
.task-checklist-item.in_progress .task-check-icon { border-top-color: var(--accent); animation: spin 1.2s linear infinite; }
.task-checklist-item.in_progress { color: var(--text); }
.task-checklist-count.blocked, .task-checklist-item.blocked { color: var(--red); }
.branch-banner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 14px; margin-top: 24px; border-radius: 12px; background: var(--surface); box-shadow: var(--surface-shadow); }
.branch-banner-main { display: grid; min-width: 0; gap: 3px; }
.branch-banner-main > span { color: var(--faint); font-size: 10px; }
.branch-banner a { font: 11px var(--mono); overflow-wrap: anywhere; text-decoration: none; }
.branch-banner small { color: var(--faint); font-size: 10px; }
.branch-banner-actions { display: flex; gap: 6px; margin-left: auto; }
.run-report { display: grid; gap: 6px; padding: 12px 14px; margin: 18px 0 8px; border-radius: 12px; background: var(--surface); box-shadow: var(--surface-shadow); animation: surface-in 180ms var(--ease); }
.run-report-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.run-report-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text); }
.run-report-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--green); }
.run-report.failed .run-report-dot { background: var(--red); }
.run-report-outcome { color: var(--faint); font-size: 10px; white-space: nowrap; }
.run-report.failed .run-report-outcome { color: var(--red); }
.run-report-summary { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-wrap: pretty; overflow-wrap: anywhere; }
.run-report-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 11px; }
.run-report-links > span { color: var(--faint); }
.run-report-links a, .run-report-link { display: inline-flex; align-items: center; min-height: 32px; padding: 0; color: var(--text); background: none; font-size: 11px; text-decoration: none; border-radius: 4px; }
.run-report-links a:hover, .run-report-link:hover { color: var(--accent); background: none; }
.run-report-links a:focus-visible, .run-report-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.run-report-stats { margin: 0; color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.timeline-render-fallback { padding: 12px; margin: 14px 0; background: var(--surface); border-radius: 10px; }
.timeline-render-fallback strong { font-size: 12px; }
.timeline-render-fallback p { font-size: 12px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.message-row.ultra-agent-message { display: flex; align-items: flex-start; gap: 12px; }
.ultra-agent-avatar { display: grid; place-items: center; width: 28px; height: 28px; background: var(--surface); color: var(--muted); border-radius: 9px; font: 9px var(--mono); flex-shrink: 0; }
.ultra-agent-bubble { min-width: 0; flex: 1; }
.ultra-agent-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ultra-agent-header strong { font-size: 12px; font-weight: 500; }
.ultra-agent-header span { color: var(--faint); font-size: 10px; }

/* Shared dialogs, pickers, settings and skills */
.modal-backdrop, .ultra-operations-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: #0006; backdrop-filter: blur(5px); animation: fade-in 160ms var(--ease); }
.project-modal { width: min(100%, 520px); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; min-height: 0; padding: 22px; background: var(--panel); border-radius: var(--radius-floating); box-shadow: var(--floating-shadow), 0 24px 80px #0005; animation: surface-in 180ms var(--ease); overflow: auto; }
.project-delete-modal { width: min(100%, 430px); gap: 10px; }
.project-delete-modal .modal-header { margin-bottom: 2px; }
.project-delete-description { color: var(--muted); font-size: 12px; line-height: 1.5; }
.project-delete-label { color: var(--muted); font-size: 11px; font-weight: 600; margin-top: 5px; }
.project-delete-modal input[type="text"] { width: 100%; }
.project-delete-repo-option { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line-subtle); cursor: pointer; }
.project-delete-repo-option input { flex: 0 0 auto; width: 16px; height: 16px; min-height: 0; margin-top: 2px; accent-color: var(--accent); }
.project-delete-repo-option strong, .project-delete-repo-option small { display: block; font-size: 11px; }
.project-delete-repo-option small { color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.project-delete-repo-confirm-wrap { display: grid; gap: 7px; }
.project-delete-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.app-publish-modal { width: min(100%, 420px); }
.app-publish-modal form { display: grid; gap: 10px; }
.app-publish-modal form > label { color: var(--muted); font-size: 11px; font-weight: 600; }
.app-publish-domain { display: flex; align-items: center; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control); }
.app-publish-domain:focus-within { border-color: var(--accent); }
.app-publish-domain input { flex: 1; min-width: 0; border: 0; background: transparent; font-family: var(--mono); font-size: 12px; }
.app-publish-domain input:focus { outline: none; }
.app-publish-domain span { padding-right: 12px; color: var(--muted); font: 11px var(--mono); white-space: nowrap; }
.app-publish-modal .app-message { min-height: 16px; margin: 0; font-size: 11px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-shrink: 0; }
.modal-header h2 { font-size: 18px; line-height: 1.45; margin-top: 4px; }
.modal-header .icon-button { margin: -8px -8px 0 0; }
.repo-search { width: 100%; min-height: 40px; font-size: 12px; margin-bottom: 12px; flex-shrink: 0; }
.repo-list, .skills-list, .provider-settings-list { display: grid; gap: 4px; min-height: 0; overflow: auto; }
.repo-list { max-height: 420px; }
.project-mode-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; margin-bottom: 16px; padding: 10px 12px; background: var(--surface); border-radius: var(--radius-control); box-shadow: var(--surface-shadow); cursor: pointer; }
.project-mode-row span { min-width: 0; }
.project-mode-row strong, .project-mode-row small { display: block; }
.project-mode-row strong { font-size: 12px; }
.project-mode-row small { margin-top: 2px; color: var(--muted); }
.project-mode-row input { appearance: none; flex: 0 0 auto; position: relative; box-sizing: border-box; width: 36px; height: 20px; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); cursor: pointer; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.project-mode-row input::before { content: ""; position: absolute; top: 50%; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transform: translate(0, -50%); transition: transform 180ms var(--ease), background-color 160ms var(--ease); }
.project-mode-row:hover input:not(:checked) { border-color: color-mix(in srgb, var(--text) 24%, var(--line)); }
.project-mode-row:hover input:not(:checked)::before { background: var(--text); }
.project-mode-row input:checked { background: var(--accent); border-color: var(--accent); }
.project-mode-row input:checked::before { transform: translate(16px, -50%); background: var(--bg); }
.project-mode-row input:active::before { width: 16px; }
.project-mode-row input:checked:active::before { transform: translate(14px, -50%); }
.project-mode-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fullstack-create-form { display: grid; gap: 10px; }
.fullstack-create-form > label:not(.fullstack-visibility), .fullstack-field-label { color: var(--muted); font-size: 11px; font-weight: 600; }
.fullstack-create-form > input { width: 100%; }
.fullstack-provider-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fullstack-provider-list .provider-card { min-height: 62px; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-control); }
.fullstack-provider-list .provider-card::after { content: none; }
.fullstack-provider-list .provider-mark { width: 32px; height: 32px; border-radius: 6px; }
.fullstack-provider-list .provider-mark img { width: 19px; height: 19px; }
.fullstack-provider-list .provider-card strong { font-size: 12px; }
.fullstack-provider-list .provider-card small { margin-top: 1px; font-size: 10px; line-height: 1.3; }
.fullstack-provider-list .provider-card[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); }
.fullstack-provider-list .provider-card[aria-pressed="true"] small { color: var(--accent); }
.fullstack-visibility { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; cursor: pointer; }
.fullstack-visibility input { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); }
.fullstack-create-form .primary-action { margin-top: 4px; min-height: 42px; }
.repo-row { display: flex; width: 100%; align-items: center; justify-content: flex-start; gap: 12px; text-align: left; padding: 12px 8px; }
.repo-row > span:last-child { min-width: 0; }
.repo-row strong, .repo-row small { display: block; overflow-wrap: anywhere; }
.repo-row strong { font-weight: 500; font-size: 12px; }
.repo-row small { color: var(--muted); margin-top: 4px; }
.repo-empty { padding: 28px 12px; color: var(--muted); text-align: center; font-size: 12px; }
.app-message { margin-top: 12px; }
.provider-setting-row { display: flex; width: 100%; justify-content: flex-start; gap: 12px; text-align: left; padding: 12px; }
.provider-setting-row > span:nth-child(2) { flex: 1; min-width: 0; }
.provider-setting-row strong, .provider-setting-row small { display: block; }
.provider-setting-row strong { font-size: 12px; font-weight: 500; }
.provider-setting-row small { color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.provider-setting-row em { color: var(--muted); font-style: normal; font-size: 11px; }
.slack-settings-form { display: grid; gap: 6px; }
.slack-settings-form label { color: var(--faint); font-size: 11px; }
.slack-settings-form .repo-search { margin: 0; font-family: var(--mono); font-size: 11px; }
.slack-settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.slack-settings-actions button[hidden] { display: none; }
.credit-notice { position: fixed; z-index: 95; bottom: 24px; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px); padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--raised); box-shadow: var(--floating-shadow); font-size: 12px; animation: credit-notice-in 180ms var(--ease); }
@keyframes credit-notice-in { from { opacity: 0; translate: -50% 4px; } to { opacity: 1; translate: -50% 0; } }
.credit-notice-copy { flex: 1; min-width: 0; text-wrap: pretty; }
.credit-notice-copy strong { font-weight: 600; }
.credit-notice-copy span { color: var(--muted); }
.credit-notice .branch-action-button { flex-shrink: 0; min-height: 28px; padding: 0 10px; border-radius: var(--radius-control); }
.credit-notice-close { flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px; color: var(--muted); font-size: 14px; line-height: 1; }
.credit-notice-close:hover { color: var(--text); background: var(--hover); }
.project-modal.settings-modal { position: relative; display: grid; grid-template-columns: 176px minmax(0, 1fr); width: min(100%, 800px); height: min(620px, calc(100dvh - 48px)); padding: 0; overflow: hidden; }
.settings-nav { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 20px 8px 16px; background: var(--bg); }
.settings-nav h2 { padding: 0 10px; font-size: 14px; font-weight: 600; }
.settings-tabs { display: grid; gap: 2px; }
.settings-tabs button { justify-content: flex-start; min-height: 32px; padding: 0 10px; color: var(--muted); font-size: 12px; }
.settings-tabs button:hover { color: var(--text); background: var(--surface); }
.settings-tabs button[aria-selected="true"] { background: var(--raised); color: var(--text); font-weight: 500; }
.settings-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 32px; height: 32px; min-height: 32px; border-radius: 999px; }
.settings-content { min-height: 0; overflow: auto; padding: 22px 24px 28px; }
.settings-panel { display: grid; gap: 10px; animation: surface-in 200ms var(--ease); }
.settings-panel[hidden] { display: none; }
.settings-heading { display: grid; gap: 2px; margin-bottom: 6px; padding-right: 40px; }
.settings-heading h3 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.settings-heading p, .settings-section-hint { margin: 0; color: var(--muted); font-size: 12px; text-wrap: pretty; }
.settings-card { padding: 14px 16px; border-radius: 12px; background: var(--surface); box-shadow: var(--surface-shadow); }
.settings-section { display: grid; gap: 8px; margin-top: 18px; }
.settings-section-title { margin: 0; font-size: 12px; font-weight: 600; color: var(--text); }
.settings-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-section-head > div { display: grid; gap: 1px; }
.settings-modal .provider-settings-list { gap: 6px; overflow: visible; }
.settings-modal .provider-setting-row { gap: 12px; min-height: 52px; padding: 8px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--surface-shadow); }
.settings-modal .provider-setting-row:hover { background: var(--raised); }
.settings-modal .provider-setting-row em { padding: 3px 10px; border-radius: 999px; background: var(--raised); color: var(--text); }
.settings-modal .slack-settings-form { gap: 8px; }
.settings-modal .slack-settings-form label { color: var(--muted); font-size: 11px; }
.billing-root { display: grid; font-variant-numeric: tabular-nums; }
.billing-root > .app-message { margin-bottom: 10px; }
.billing-hero { display: grid; gap: 14px; padding: 16px 18px; border-radius: var(--radius-surface); background: var(--raised); box-shadow: var(--floating-shadow); }
.billing-hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.billing-figure { display: grid; gap: 0; }
.billing-figure span { color: var(--muted); font-size: 11px; }
.billing-figure strong { font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
.billing-pill { padding: 3px 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--surface-shadow); color: var(--text); font-size: 11px; white-space: nowrap; }
.billing-meter { height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.billing-meter span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 400ms var(--ease); }
.billing-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 16px; margin: 0; }
.billing-stats div { display: grid; gap: 0; min-width: 0; }
.billing-stats dt { color: var(--muted); font-size: 11px; }
.billing-stats dd { margin: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.billing-plan-row > div { display: grid; min-width: 0; }
.billing-plan-row strong { font-size: 13px; font-weight: 600; }
.billing-plan-row span { color: var(--muted); font-size: 12px; }
.billing-links { display: flex; flex-wrap: wrap; gap: 0 16px; }
.billing-links button { min-height: 24px; padding: 0; color: var(--muted); font-size: 11px; }
.billing-links button:hover:not(:disabled) { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.billing-buy { display: grid; gap: 10px; }
.billing-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.billing-presets button { min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 11px; }
.billing-presets button[aria-pressed="true"] { background: var(--text); color: var(--panel); font-weight: 600; }
.billing-buy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.billing-buy-row .repo-search { width: 88px; min-height: 34px; margin: 0; padding: 6px 10px; font-size: 12px; }
.billing-buy-total { flex: 1; min-width: 100px; color: var(--muted); font-size: 12px; }
.billing-buy-total strong { color: var(--text); font-weight: 600; }
.billing-usage { display: grid; gap: 16px; }
.billing-chart { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.billing-chart span { flex: 1; min-width: 3px; max-width: 22px; border-radius: 3px 3px 1px 1px; background: color-mix(in srgb, var(--accent) 45%, var(--panel)); transition: background-color 140ms var(--ease); }
.billing-chart span:hover { background: var(--accent); }
.billing-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.billing-table { display: grid; gap: 6px; align-content: start; }
.billing-table h4 { margin: 0; color: var(--faint); font-size: 11px; font-weight: 500; }
.billing-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; font-size: 12px; }
.billing-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-row-detail { grid-column: 1; color: var(--muted); font-size: 11px; white-space: nowrap; }
.billing-row-amount { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-weight: 500; }
.upgrade-page { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 44px 32px 40px; overflow: auto; background: var(--panel); animation: fade-in 160ms var(--ease); }
.upgrade-page h2 { font-size: 26px; font-weight: 500; line-height: 1.3; text-align: center; text-wrap: balance; }
.upgrade-close { position: fixed; top: 16px; right: 20px; color: var(--muted); }
.upgrade-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.upgrade-message { text-align: center; }
.upgrade-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: min(100%, 1080px); margin-top: 8px; }
.upgrade-card { display: flex; flex-direction: column; min-height: 520px; padding: 24px; border-radius: var(--radius-floating); box-shadow: inset 0 0 0 1px var(--line); }
.upgrade-card.recommended { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, var(--line)); }
.upgrade-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; }
.upgrade-card-head strong { font-size: 15px; font-weight: 600; }
.upgrade-badge { padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, var(--panel)); color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.upgrade-card h3 { margin-top: 24px; font-size: 24px; font-weight: 500; line-height: 1.25; }
.upgrade-blurb { min-height: 44px; margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; text-wrap: pretty; }
.upgrade-price { display: flex; align-items: flex-start; gap: 2px; margin: 18px 0 20px; font-variant-numeric: tabular-nums; }
.upgrade-price sup { margin-top: 5px; font-size: 13px; line-height: 1; }
.upgrade-price b { font-size: 36px; font-weight: 400; line-height: 1; }
.upgrade-price span { align-self: flex-end; margin: 0 0 3px 6px; color: var(--muted); font-size: 14px; }
.upgrade-action { width: 100%; min-height: 44px; border-radius: 999px; background: var(--text); color: var(--panel); font-size: 13px; font-weight: 600; }
.upgrade-action:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 88%, var(--panel)); }
.upgrade-action.primary { background: var(--accent); }
.upgrade-action.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, var(--panel)); }
.upgrade-action:disabled { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-weight: 500; opacity: 1; cursor: default; }
.upgrade-features { display: grid; gap: 14px; margin: 28px 0 0; padding: 0; list-style: none; font-size: 14px; }
.upgrade-features li { display: flex; align-items: flex-start; gap: 12px; }
.upgrade-features svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 3px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.upgrade-card.recommended .upgrade-features svg { stroke: var(--accent); }
.upgrade-term { position: relative; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; cursor: help; }
.upgrade-tip { position: absolute; z-index: 2; left: 50%; bottom: calc(100% + 10px); width: 280px; max-width: 70vw; translate: -50% 4px; padding: 10px 12px; border-radius: 12px; background: var(--raised); box-shadow: var(--floating-shadow); color: var(--text); font-size: 12px; line-height: 1.55; text-wrap: pretty; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 140ms var(--ease), translate 140ms var(--ease), visibility 140ms; }
.upgrade-term:is(:hover, :focus) .upgrade-tip { translate: -50% 0; opacity: 1; visibility: visible; }
.upgrade-note { max-width: 560px; margin: 0; color: var(--faint); font-size: 12px; text-align: center; text-wrap: pretty; }
@media (max-width: 900px) {
  .upgrade-page { padding: 56px 16px 32px; gap: 20px; }
  .upgrade-grid { grid-template-columns: minmax(0, 1fr); max-width: 440px; }
  .upgrade-card { min-height: 0; }
  .upgrade-blurb { min-height: 0; }
}
@media (max-width: 760px) {
  .project-modal.settings-modal { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - 24px); padding: 0; }
  .settings-nav { gap: 8px; padding: 14px 12px 8px; }
  .settings-nav h2 { padding: 0 4px; }
  .settings-tabs { display: flex; gap: 4px; overflow-x: auto; }
  .settings-tabs button { flex-shrink: 0; }
  .settings-content { padding: 16px 16px 24px; }
  .settings-heading { padding-right: 0; }
  .billing-tables { grid-template-columns: minmax(0, 1fr); }
  .billing-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#notification-message:empty { display: none; }
.skills-modal { width: min(100%, 580px); }
.skill-install-form { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 20px; }
.skill-install-form .repo-search { margin: 0; }
.skill-install-input { flex: 1; resize: vertical; min-height: 70px; max-height: 200px; }
.skill-install-form button { flex-shrink: 0; min-height: 40px; }
.skill-row { display: flex; gap: 14px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line-subtle); }
.skill-row > div { flex: 1; min-width: 0; }
.skill-row strong, .skill-row small { display: block; }
.skill-row strong { font-size: 12px; font-weight: 500; }
.skill-row small { margin-top: 4px; color: var(--muted); line-height: 1.65; overflow-wrap: anywhere; }
.skill-delete-button { color: var(--faint); font-size: 11px; padding: 5px 8px; }
.skill-delete-button:hover { color: var(--red); }
.plan-modal { width: min(100%, 740px); }
.plan-modal-content { overflow: auto; padding: 0 4px 6px; }
.plan-modal-content :is(h1,h2,h3,h4) { margin: 20px 0 10px; font-size: 16px; }
.plan-modal-content > :first-child { margin-top: 0; }
.plan-modal-content p, .plan-modal-content li { color: var(--muted); font-size: 12px; line-height: 1.8; }
.plan-modal-content p { margin-bottom: 12px; }
.plan-modal-content :is(ul,ol) { padding-left: 22px; margin: 10px 0; }
.plan-modal-content code { font: 11px var(--mono); background: var(--surface); border-radius: 4px; }
.plan-modal-content pre { overflow: auto; padding: 12px; margin: 12px 0; background: var(--bg); border-radius: 10px; }
.plan-modal-content pre code { background: none; }
.branch-setup-intro { color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.branch-setup-options { display: grid; gap: 10px; }
.branch-setup-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface); }
.branch-setup-option strong, .branch-setup-option small { display: block; }
.branch-setup-option strong { font-size: 12px; }
.branch-setup-option small { margin-top: 4px; color: var(--muted); }
.delete-confirm-popup { position: fixed; z-index: 80; width: 240px; max-width: calc(100vw - 24px); padding: 14px; border-radius: var(--radius-surface); background: var(--raised); box-shadow: var(--floating-shadow); animation: surface-in 160ms var(--ease); }
.delete-confirm-content p { font-size: 12px; }
.delete-confirm-detail { color: var(--muted); font: 10px var(--mono); overflow-wrap: anywhere; margin-top: 5px; }
.delete-confirm-detail:empty { display: none; }
.delete-confirm-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }
.ultra-message-modal { width: min(100%, 780px); }
.ultra-message-envelope { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 12px 0 16px; border-bottom: 1px solid var(--line-subtle); margin-bottom: 18px; }
.ultra-message-envelope > div { min-width: 0; }
.ultra-message-envelope dt { color: var(--faint); font-size: 10px; }
.ultra-message-envelope dd { color: var(--muted); font-size: 11px; margin-top: 3px; overflow-wrap: anywhere; }
.ultra-message-modal-content { overflow: auto; min-height: 0; }

/* Engineering room: the same surface tiers, density and typography as chat. */
.ultra-room-view { grid-row: 2; overflow: auto; min-height: 0; padding: 28px; }
.ultra-mission-control { width: min(100%, 1180px); margin: 0 auto; display: grid; gap: 18px; }
.ultra-mission-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 8px 0 4px; }
.ultra-mission-kicker, .ultra-section-label { display: block; color: var(--faint); font-size: 10px; margin-bottom: 5px; }
.ultra-mission-header h2 { font-size: 23px; letter-spacing: -.6px; }
.ultra-mission-header p { color: var(--muted); font-size: 12px; margin-top: 7px; max-width: 520px; }
.ultra-mission-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ultra-control-group { display: flex; gap: 5px; }
.ultra-control-button, .ultra-operations-toggle { min-height: 36px; padding: 7px 10px; font-size: 11px; background: var(--surface); }
.ultra-control-button.danger { color: var(--muted); }
.ultra-control-button.danger:hover:not(:disabled) { color: var(--red); }
.ultra-operations-count { color: var(--faint); font: 10px var(--mono); }
.ultra-run-state, .ultra-roster-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.ultra-run-state { padding: 5px 8px; border-radius: 6px; }
.ultra-run-state i, .ultra-roster-status i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
:is([data-run-status='running'],[data-run-status='cooling_down'],[data-agent-status='running']) i { background: var(--accent); animation: working-pulse 1.8s ease-in-out infinite; }
:is([data-run-status='completed'],[data-agent-status='done']) i { background: var(--green); }
:is([data-run-status='blocked'],[data-run-status='failed'],[data-agent-status='blocked'],[data-agent-status='failed']) i { background: var(--red); }
[data-run-status='paused'] i { background: var(--amber); }
.ultra-mission-metrics { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); padding: 16px 0; border-top: 1px solid var(--line-subtle); border-bottom: 1px solid var(--line-subtle); }
.ultra-metric { display: grid; gap: 5px; padding: 0 20px; border-right: 1px solid var(--line-subtle); }
.ultra-metric:first-child { padding-left: 0; }
.ultra-metric:last-child { border: 0; }
.ultra-metric span { color: var(--faint); font-size: 10px; }
.ultra-metric strong { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ultra-overview-grid, .ultra-evidence-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 16px; }
.ultra-mission-grid { display: grid; grid-template-columns: minmax(260px,.8fr) minmax(0,1.2fr); gap: 16px; }
.ultra-panel { min-width: 0; background: var(--surface); border-radius: var(--radius-surface); box-shadow: var(--surface-shadow); overflow: hidden; }
.ultra-panel > header { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-subtle); }
.ultra-panel h3 { font-size: 12px; letter-spacing: 0; font-weight: 500; }
.ultra-panel > header > span { color: var(--faint); font-size: 10px; text-align: right; }
.ultra-plan-reference { display: flex; flex-wrap: wrap; gap: 12px; padding: 14px 16px 0; }
.ultra-plan-reference p { min-width: 0; }
.ultra-plan-reference span { display: block; color: var(--faint); font-size: 10px; margin-bottom: 3px; }
.ultra-plan-reference code { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.ultra-plan-excerpt { padding: 14px 16px; font-size: 11px; color: var(--muted); line-height: 1.75; overflow-wrap: anywhere; white-space: pre-wrap; }
.ultra-budget-panel ul { list-style: none; padding: 6px 16px; }
.ultra-budget-panel li { display: grid; grid-template-columns: 1fr auto 70px; gap: 8px; padding: 7px 0; color: var(--muted); font-size: 11px; }
.ultra-budget-panel li strong { font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }
.ultra-budget-panel li small { text-align: right; color: var(--faint); font-size: 10px; }
.ultra-budget-panel [data-budget-state='exhausted'] { color: var(--red); }
.ultra-roster ul, .ultra-channel-stream { padding: 0; list-style: none; max-height: 390px; overflow: auto; }
.ultra-roster-row { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line-subtle); }
.ultra-roster-row:last-child { border: 0; }
.ultra-roster-monogram { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--raised); color: var(--muted); font: 9px var(--mono); flex-shrink: 0; }
.ultra-roster-identity { flex: 1; min-width: 0; }
.ultra-roster-identity strong, .ultra-roster-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ultra-roster-identity strong { font-size: 11px; font-weight: 500; }
.ultra-roster-identity small { color: var(--faint); font-size: 10px; margin-top: 3px; }
.ultra-channel-message { display: grid; width: 100%; padding: 14px 16px; text-align: left; justify-content: stretch; border-radius: 0; border-bottom: 1px solid var(--line-subtle); gap: 6px; }
.ultra-channel-message:last-child { border: 0; }
.ultra-channel-message-header { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--faint); font-size: 10px; }
.ultra-channel-message-header strong { font-weight: 500; color: var(--muted); }
.ultra-channel-message time { margin-left: auto; font-size: 9px; }
.ultra-channel-message-subject { font-size: 12px; color: var(--text); }
.ultra-channel-message-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 11px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.ultra-channel-message-affordance { color: var(--faint); font-size: 10px; margin-top: 3px; }
.ultra-panel-empty { padding: 20px 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.ultra-round-card { padding: 14px 16px; border-bottom: 1px solid var(--line-subtle); }
.ultra-round-card:last-child { border: 0; }
.ultra-round-card > header, .ultra-round-card > footer { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: var(--faint); }
.ultra-round-card > header strong { color: var(--muted); font-weight: 400; }
.ultra-round-card > p { margin: 10px 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.ultra-adaptive-decision { border-left: 2px solid var(--line); padding: 3px 10px; margin: 12px 0; color: var(--muted); font-size: 11px; }
.ultra-adaptive-decision > span { color: var(--text); font-size: 10px; }
.ultra-adaptive-decision > p { margin: 4px 0; }
.ultra-adaptive-decision > small { color: var(--faint); font-size: 10px; }
.ultra-adaptive-decision[data-decision-action='complete'] { border-color: var(--green); }
.ultra-adaptive-decision[data-decision-action='block'] { border-color: var(--red); }
.ultra-evidence-section { padding: 14px 16px; border-bottom: 1px solid var(--line-subtle); }
.ultra-evidence-section:last-child { border: 0; }
.ultra-evidence-section h4 { font-size: 10px; color: var(--faint); font-weight: 500; letter-spacing: 0; margin-bottom: 10px; }
.ultra-file-list, .ultra-gate-list, .ultra-risk-list { padding: 0; list-style: none; }
.ultra-file-list { display: flex; flex-wrap: wrap; gap: 5px; }
.ultra-file-list li:not(.ultra-panel-empty) { background: var(--raised); padding: 3px 6px; border-radius: 5px; }
.ultra-file-list code { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.ultra-gate-list li { display: flex; align-items: flex-start; gap: 10px; margin: 7px 0; }
.ultra-gate-list span { font-size: 10px; min-width: 40px; color: var(--faint); }
.ultra-gate-list p, .ultra-risk-list li { font-size: 11px; color: var(--muted); line-height: 1.7; }
.ultra-gate-list p strong, .ultra-risk-list strong { font-weight: 500; }
.ultra-risk-list li { margin: 5px 0; }
.ultra-gate-list :is([data-evidence-decision='pass'],[data-evidence-decision='approve']) span, .ultra-evidence-clear { color: var(--green); }
.ultra-gate-list :is([data-evidence-decision='fail'],[data-evidence-decision='failed'],[data-evidence-decision='blocked'],[data-evidence-decision='changes_requested']) span { color: var(--red); }
.ultra-final-summary > p { padding: 16px; color: var(--muted); font-size: 12px; line-height: 1.8; white-space: pre-wrap; }
.ultra-operations { width: min(100%, 720px); max-height: calc(100dvh - 48px); background: var(--panel); border-radius: var(--radius-floating); box-shadow: var(--floating-shadow); overflow: auto; padding: 20px; }
.ultra-operations > header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.ultra-operations > header > div { flex: 1; }
.ultra-operations h3 { font-size: 18px; }
.ultra-operations > header p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.ultra-operations > header > span { font-size: 10px; color: var(--faint); }
.ultra-operations-close { width: 36px; padding: 0; font-size: 22px; color: var(--muted); }
.ultra-operations ul { padding: 0; list-style: none; }
.ultra-operation-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-subtle); }
.ultra-operation-mark { width: 28px; height: 28px; display: grid; place-items: center; font: 9px var(--mono); background: var(--surface); border-radius: 8px; color: var(--muted); flex-shrink: 0; }
.ultra-operation-copy { flex: 1; min-width: 0; }
.ultra-operation-copy strong, .ultra-operation-copy small { display: block; }
.ultra-operation-copy strong { font-weight: 500; font-size: 12px; }
.ultra-operation-copy small { color: var(--faint); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
.ultra-operation-row time { font-size: 10px; color: var(--faint); }
.ultra-operation-row[data-operation-status='running'] .ultra-operation-mark { color: var(--accent); }
.ultra-operation-row[data-operation-status='error'] .ultra-operation-mark { color: var(--red); }

/* Loading, feedback and motion */
.loading-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); }
.loading-content, .repo-loading-container { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.repo-loading-container { padding: 30px; }
.loading-spinner, .spinner { width: 16px; height: 16px; border: 1.5px solid var(--line); border-top-color: var(--muted); border-radius: 50%; animation: spin 1s linear infinite; flex-shrink: 0; }
.toast-region { position: fixed; z-index: 90; bottom: 24px; left: 50%; translate: -50% 0; max-width: min(480px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--raised); box-shadow: var(--floating-shadow); font-size: 12px; animation: surface-in 180ms var(--ease); }
.toast-region[data-status='error'] { color: var(--red); }
@keyframes spin { to { rotate: 360deg; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes message-in { from { opacity: 0; translate: 0 7px; } to { opacity: 1; translate: 0 0; } }
@keyframes status-in { from { opacity: 0; translate: 0 3px; } to { opacity: 1; translate: 0 0; } }
@keyframes surface-in { from { opacity: 0; translate: 0 4px; scale: .98; } to { opacity: 1; translate: 0; scale: 1; } }
@keyframes working-pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 210px minmax(0,1fr); }
  .ultra-overview-grid, .ultra-evidence-grid, .ultra-mission-grid { grid-template-columns: 1fr; }
  .ultra-roster ul, .ultra-channel-stream { max-height: 340px; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: minmax(0,1fr); }
  .app-sidebar { position: fixed; z-index: 41; inset: 0 auto 0 0; width: min(280px, calc(100vw - 48px)); translate: -100% 0; visibility: hidden; transition: translate 200ms var(--ease), visibility 200ms; box-shadow: 16px 0 40px #0003; }
  body.sidebar-open .app-sidebar { translate: 0; visibility: visible; }
  .mobile-menu-button, .sidebar-close { display: inline-flex; }
  body.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 40; border: 0; border-radius: 0; background: #0007; padding: 0; }
  .workspace-header { padding: 8px 14px; min-height: 56px; gap: 10px; }
  .workspace-header h1 { margin-right: auto; }
  .projects-content { padding: 32px 20px; }
  .projects-heading { align-items: stretch; flex-direction: column; gap: 20px; margin-bottom: 20px; }
  .project-search { width: 100%; }
  .project-card { padding: 10px 10px 10px 5px; gap: 12px; grid-template-columns: 34px minmax(0,1fr) auto; }
  .project-topbar { padding: 7px 10px; flex-wrap: wrap; }
  .return-projects-button { display: none; }
  .conversation-heading { gap: 6px; flex: 1; }
  .project-context { gap: 4px; }
  .workspace-mode-switch { padding: 2px; }
  .workspace-mode-tab { font-size: 10px; padding: 5px 7px; }
  .message-list, .agent-detail-scroll { padding: 24px 18px 28px; }
  .message-list { padding-bottom: calc(var(--composer-height) + 38px); }
  .composer-shell { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100% - 24px); }
  .ultra-room-view { padding: 20px 14px; }
  .ultra-mission-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px 0; }
  .ultra-metric:nth-child(3) { border: 0; }
  .ultra-metric:nth-child(4) { padding-left: 0; }
  .ultra-metric { padding: 0 12px; }
  .ultra-metric strong { font-size: 11px; }
  .modal-backdrop, .ultra-operations-backdrop { padding: 12px; }
  .project-modal, .ultra-operations { max-height: calc(100dvh - 24px); padding: 18px; }
  .chat-delete-button, .chat-archive-button { opacity: .65; }
  .auth-brand { left: 24px; }
}
@media (max-width: 440px) {
  .fullstack-provider-list { grid-template-columns: 1fr; }
  .project-context .work-button { font-size: 0; width: 36px; padding: 0; }
  .project-context .work-button img { width: 17px; height: 17px; }
  .conversation-heading h1 { max-width: 145px; }
  .workspace-mode-tab { font-size: 9px; gap: 4px; padding: 5px; }
  .model-trigger { max-width: 128px; }
  .ultra-code-toggle { padding: 5px; }
  .branch-setup-option { flex-direction: column; align-items: stretch; }
  .ultra-roster-status { font-size: 9px; }
  .ultra-message-envelope { display: grid; gap: 10px; }
}
@supports not (backdrop-filter: blur(1px)) { .composer-shell { background: var(--raised); } }
@media (prefers-reduced-transparency: reduce) { .composer-shell { background: var(--raised); backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:active:not(:disabled) { scale: 1; }
}
@media (forced-colors: active) {
  .composer-shell, .project-modal, .ultra-panel, .provider-card, .model-menu { border: 1px solid CanvasText; }
  .kairos-mark { background: CanvasText; }
}

/* Shared compact conversation/navigation rhythm. */
.project-workspace { grid-template-rows: 48px minmax(0, 1fr); }
.project-topbar { min-height: 48px; }
@media (min-width: 1101px) { .app-shell { grid-template-columns: 218px minmax(0, 1fr); } }
.app-sidebar { gap: 8px; }
.sidebar-section-heading { min-height: 24px; }
.sidebar-nav-button, .sidebar-item, .chat-title-button { min-height: 28px; padding-block: 2px; border-radius: 6px; }
.chat-delete-button, .chat-archive-button { min-height: 28px; }
@media (pointer: coarse) { .sidebar-nav-button, .sidebar-item, .chat-title-button, .chat-delete-button, .chat-archive-button { min-height: 40px; } }

/* Search stays in place while the live model catalog scrolls. */
.model-menu { width: 330px; padding: 0; overflow: hidden; max-height: min(480px, 65vh); }
.model-search-row { padding: 9px; border-bottom: 1px solid var(--line-subtle); }
.model-search-row input { width: 100%; min-height: 32px; padding: 6px 9px; border: 1px solid var(--line-subtle); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; }
#model-options { overflow: auto; max-height: min(370px, calc(65vh - 100px)); padding: 4px; }
.model-group-label { display: flex; justify-content: space-between; padding: 10px 10px 5px; color: var(--muted); font-size: 10px; }
.model-group-label span { color: var(--faint); }
.model-option { padding: 8px 10px; }
.model-option small { font-size: 9px; }
.model-empty { padding: 20px 10px; color: var(--faint); font-size: 12px; }
.model-catalog-status { border-top: 1px solid var(--line-subtle); padding: 8px 12px; color: var(--faint); font-size: 10px; }

/* One compact, keyboard-accessible activity disclosure in both conversations. */
.tool-activity { margin: 6px 0 16px; min-width: 0; }
.tool-activity .tool-activity-toggle { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 4px 0; border: 0; border-radius: 0; background: transparent; color: var(--faint); text-align: left; justify-content: flex-start; font: inherit; font-size: 12px; line-height: 22px; box-shadow: none; }
.tool-activity .tool-activity-toggle:hover { background: transparent; color: var(--text); }
.tool-activity .tool-activity-toggle.error { color: var(--red); }
.tool-activity-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-icon { display: inline-block; width: 16px; height: 16px; flex: 0 0 16px; background: currentColor; mask: var(--activity-icon) center / contain no-repeat; -webkit-mask: var(--activity-icon) center / contain no-repeat; }
.tool-activity-reveal { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 220ms cubic-bezier(.22,1,.36,1), opacity 160ms ease; }
.tool-activity.expanded > .tool-activity-reveal { grid-template-rows: 1fr; opacity: 1; }
.tool-activity-clip { min-height: 0; overflow: hidden; }
.tool-activity-events { margin: 3px 0 5px 7px; padding-left: 18px; border-left: 1px solid var(--line-subtle); }
.tool-activity-events .agent-event { animation: none; }
.agent-working-update [data-commentary-text] { white-space: pre-wrap; }
@media (prefers-reduced-motion: reduce) { .tool-activity-reveal { transition: none; } }
@media (pointer: coarse) { .tool-activity .tool-activity-toggle { min-height: 40px; } }

.agent-tool-output { margin-top: 3px; }
.agent-tool-output > summary { cursor: pointer; padding: 5px 0; font-size: 11px; }
.agent-tool-output pre { max-height: 320px; overflow: auto; padding: 8px 10px; border-radius: 5px; background: var(--surface); color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.65 var(--mono); }
@media (pointer: coarse) { .agent-tool-output > summary { min-height: 40px; } }
.activity-research ul { list-style: none; margin: 0; padding: 4px 0; }
.activity-research li { padding: 3px 0; font-size: 11px; color: var(--faint); }

.session-status { padding: 8px 12px 0; color: var(--text-secondary, #8d929b); font-size: 12px; font-variant-numeric: tabular-nums; }

/* React islands (web/kairos-ui.jsx): gooey attach menu and liquid segmented switch. */
.kui-gooey-attach { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.kui-gooey-group { width: 40px; height: 40px; }
.kui-gooey-item { position: absolute; left: 3px; bottom: 3px; display: block !important; width: 34px; height: 34px; border-radius: 50%; line-height: 0; }
.kui-gooey-item-trigger { z-index: 2; }
.kui-gooey-option, .kui-gooey-trigger { display: grid; place-items: center; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--text); }
.kui-gooey-option:is(:hover, :active, :focus-visible):not(:disabled), .kui-gooey-trigger:is(:hover, :active):not(:disabled) { background: transparent; }
.kui-gooey-option img { width: 16px; height: 16px; opacity: .85; transition: opacity 150ms var(--ease); }
.kui-gooey-option:hover img { opacity: 1; filter: brightness(1.4); }
.kui-gooey-option { opacity: 1; transition: opacity 160ms var(--ease) 60ms; }
.kui-gooey-attach:not(.is-open) .kui-gooey-option { pointer-events: none; opacity: 0; transition-delay: 0ms; transition-duration: 90ms; }
.kui-gooey-plus { position: relative; width: 14px; height: 14px; transition: rotate 220ms var(--ease); }
.kui-gooey-plus::before, .kui-gooey-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.6px; border-radius: 2px; background: var(--muted); translate: -50% -50%; transition: background-color 150ms var(--ease); }
.kui-gooey-plus::after { rotate: 90deg; }
.kui-gooey-trigger:hover .kui-gooey-plus::before, .kui-gooey-trigger:hover .kui-gooey-plus::after, .kui-gooey-attach.is-open .kui-gooey-plus::before, .kui-gooey-attach.is-open .kui-gooey-plus::after { background: var(--text); }
.kui-gooey-attach.is-open .kui-gooey-plus { rotate: 45deg; }
.kui-gooey-trigger:focus-visible, .kui-gooey-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kui-switch { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: var(--kui-item-w); padding: 2px; background: transparent; }
.kui-switch-liquid { position: absolute !important; inset: 2px; pointer-events: none; }
.kui-switch-pill { position: absolute; top: 0; left: 0; width: var(--kui-item-w); height: var(--kui-item-h); border-radius: 5px; }
.kui-switch-option { position: relative; z-index: 1; gap: 6px; height: var(--kui-item-h); min-height: 0; padding: 0 8px; border-radius: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
.kui-switch.is-icon-only .kui-switch-option { padding: 0; }
.kui-switch-option:is(:hover, :active):not(:disabled) { background: transparent; color: var(--text); }
.kui-switch-option[aria-selected="true"] { color: var(--text); }
.kui-switch-option img { width: 12px; height: 12px; opacity: .55; transition: opacity 150ms var(--ease); }
.kui-switch-option:is([aria-selected="true"], :hover, :focus-visible) img { opacity: 1; filter: none; }
.kui-switch-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kui-switch-option:active:not(:disabled) { scale: 1; }
