@layer reset, theme, layout, components, prose, responsive;
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; min-height: 100%; }
  body, button, input, textarea, select { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; font-size: 14px; }
  button, input, textarea, select { color: inherit; }
  button, select, summary { cursor: pointer; }
  button { border: 0; background: none; }
  input, textarea, select { font: inherit; }
  a { color: inherit; }
  button:disabled, select:disabled { cursor: default; opacity: .45; }
  [hidden] { display: none !important; }
  svg { display: block; flex-shrink: 0; }
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
  ::selection { background: var(--selection); }
}
@layer theme {
  :root { color-scheme: dark; --bg: #1e1e1e; --side: var(--bg); --raised: #242424; --hover: #2e2e2e; --selected: #263448; --text: #f0f2f6; --muted: #b9bec5; --subtle: #a7adb5; --line: #ffffff12; --edge: #ffffff20; --input: #292929; --bubble: #262626; --accent: #8bbbff; --accent-secondary: #94dfef; --button: #8bbbff; --button-text: #0d1928; --focus: #94dfef; --selection: #548dd466; --danger: #ff9c97; --pending: #c2a8ed; --online: #83caa5; --scrim: #000b; --shadow: 0 20px 80px #0006; --bevel-light: #292929; --bevel-dark: #0d0d0d; --scroll-track: #181818; --scroll-thumb: #6f6f6f; --scroll-thumb-hover: #999; --bevel: inset 1px 1px 0 var(--bevel-light), inset -1px -1px 0 var(--bevel-dark); }
  :root[data-theme="light"] { color-scheme: light; --bg: #fff; --side: #f7f7f6; --raised: #fff; --hover: #ededeb; --selected: #e8e8e6; --text: #232323; --muted: #666; --subtle: #858585; --line: #0000000c; --edge: #0000001a; --input: #f5f5f4; --bubble: #f0f0ef; --button: #242424; --button-text: #fff; --focus: #6055b1; --selection: #c4bdf580; --danger: #b2312e; --pending: #7952b0; --online: #2d7c50; --scrim: #0005; --shadow: 0 18px 70px #0002; }
  @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]):not([data-theme="light"]) { color-scheme: light; --bg: #fff; --side: #f7f7f6; --raised: #fff; --hover: #ededeb; --selected: #e8e8e6; --text: #232323; --muted: #666; --subtle: #858585; --line: #0000000c; --edge: #0000001a; --input: #f5f5f4; --bubble: #f0f0ef; --button: #242424; --button-text: #fff; --focus: #6055b1; --selection: #c4bdf580; --danger: #b2312e; --pending: #7952b0; --online: #2d7c50; --scrim: #0005; --shadow: 0 18px 70px #0002; } }
  body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.5; }
  :root { --side: #181818; --raised: #272727; --bubble: #2b2b2b; --text: #eeeeee; --muted: #a6a6aa; --subtle: #85858b; --edge: #ffffff1a; --line: #ffffff0d; --bevel: none; --bevel-light: var(--edge); --bevel-dark: var(--line); --reading-width: 920px; }
  :root[data-theme="light"] { --side: var(--bg); --accent: #2868aa; --accent-secondary: #177183; --button: #2868aa; --button-text: #fff; --focus: #287c92; --bevel-light: #fff; --bevel-dark: #00000024; --scroll-track: #e5e5e5; --scroll-thumb: #919191; --scroll-thumb-hover: #707070; }
  @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]):not([data-theme="light"]) { --side: var(--bg); --accent: #2868aa; --accent-secondary: #177183; --button: #2868aa; --button-text: #fff; --focus: #287c92; --bevel-light: #fff; --bevel-dark: #00000024; --scroll-track: #e5e5e5; --scroll-thumb: #919191; --scroll-thumb-hover: #707070; } }
}
@layer layout {
  .app-shell { overflow: hidden; }
  .workspace { --sidebar-width: 250px; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100dvh; min-height: 260px; }
  .sidebar { --sidebar-gutter: 8px; grid-column: 1; grid-row: 2; display: flex; flex-direction: column; background: var(--side); min-width: 0; min-height: 0; padding: 12px var(--sidebar-gutter); border-right: 1px solid var(--line); }
  .taskspace-bar { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; min-height: 52px; padding: 8px 16px; background: var(--side); border-bottom: 1px solid var(--line); }
  .brand-copy { display: flex; align-items: baseline; gap: 12px; }
  .brand-name { color: var(--text); font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
  .brand-subtitle { font-size: 10px; font-weight: 400; color: var(--subtle); letter-spacing: .025em; }
  .taskspace-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
  .brand { display: flex; align-items: center; gap: 7px; font-weight: 600; text-decoration: none; white-space: nowrap; font-size: 15px; }
  /* Original Gaia website mark, preserved as CSS rather than a new graphic. */
  .brand-mark { position: relative; display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; margin: 3px; transform: rotate(45deg); border: 1px solid #6ca8ff; border-radius: 5px; background: linear-gradient(135deg, #2e4670, #261d4a); box-shadow: 0 0 14px #5f8cff55, inset 0 0 8px #7ccfff33; }
  .brand-mark::before, .brand-mark::after, .brand-mark i { content: ''; position: absolute; background: #a7cbff; box-shadow: 0 0 6px #8ab4f8; }
  .brand-mark::before { width: 2px; height: 13px; }
  .brand-mark::after { width: 13px; height: 2px; }
  .brand-mark i { width: 5px; height: 5px; border-radius: 2px; background: #d8e7ff; }
  .primary-nav { display: flex; flex-shrink: 0; align-items: center; gap: 4px; margin-inline: calc(-1 * var(--sidebar-gutter)); padding-inline: var(--sidebar-gutter); padding-bottom: 10px; box-shadow: inset 0 -1px 0 var(--bevel-dark), 0 1px 0 var(--bevel-light); }
  /* Reserve a real rail, including when the list is short. Never fade it on idle. */
  .sidebar-content { overflow-x: hidden; overflow-y: scroll; flex: 1; min-height: 0; margin-block: 6px 2px; padding-right: 4px; scrollbar-gutter: stable; scrollbar-width: auto; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
  @supports selector(::-webkit-scrollbar) { .sidebar-content { scrollbar-color: auto; } }
  .sidebar-content::-webkit-scrollbar { width: 12px; height: 12px; }
  .sidebar-content::-webkit-scrollbar-track, .sidebar-content::-webkit-scrollbar-corner { background: var(--scroll-track); box-shadow: none; }
  .sidebar-content::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border: 2px solid var(--scroll-track); border-radius: 4px; min-height: 24px; min-width: 24px; }
  .sidebar-content::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
  .sidebar-content::-webkit-scrollbar-button { display: none; }
  .sidebar-bottom { padding-top: 12px; margin-top: 8px; margin-inline: calc(-1 * var(--sidebar-gutter)); padding-inline: var(--sidebar-gutter); border-top: 1px solid var(--bevel-dark); box-shadow: inset 0 1px 0 var(--bevel-light); }
  /* Leave the outer right bevel intact without moving the inner controls. */
  .primary-nav, .sidebar-bottom { margin-inline-end: calc(1px - var(--sidebar-gutter)); padding-inline-end: calc(var(--sidebar-gutter) - 1px); }
  .main-pane { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; background: var(--bg); }
  /* Paint the pane frame above opaque children, including the composer dock. */
  .main-pane::after { content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none; box-shadow: var(--bevel); }
  .chat-header { display: flex; align-items: center; min-height: 64px; padding: 12px 24px; gap: 12px; flex-shrink: 0; border-bottom: 1px solid var(--line); }
  .chat-heading { flex: 1; min-width: 0; overflow: hidden; }
  .chat-heading h1 { font-weight: 500; font-size: 15px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-heading p { color: var(--muted); font-size: 11px; margin: 2px 0 0; white-space: nowrap; }
  .chat-heading p:empty { display: none; }
  .chat-context-line { display: flex; align-items: baseline; min-width: 0; gap: 8px; }
  .chat-context-line p { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .header-activity { display: inline-flex; align-items: center; flex-shrink: 0; gap: 4px; color: var(--accent); font-size: 10px; }
  .header-activity i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
  .header-activity.status-unknown { color: var(--muted); }
  .header-actions { display: flex; gap: 8px; align-items: center; }
  .conversation-find { display: flex; align-items: center; flex-shrink: 0; gap: 4px; padding: 5px 16px; background: var(--raised); border-bottom: 1px solid var(--bevel-dark); }
  #find-input { flex: 1; min-width: 0; border: 1px solid var(--edge); border-radius: 6px; padding: 5px 8px; background: var(--input); }
  .find-result { color: var(--muted); font-size: 11px; white-space: nowrap; }
  #find-prev svg { transform: rotate(-90deg); } #find-next svg { transform: rotate(90deg); }
  .conversation-find .icon-button { width: 28px; height: 28px; padding: 6px; }
  .message.find-match { outline: 1px solid var(--edge); outline-offset: 5px; }
  .message.find-current { outline-color: var(--accent); }
  .conversation-scroll { flex: 1; min-height: 0; margin-top: 6px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; scroll-padding-top: 12px; scroll-padding-bottom: 20px; }
  .conversation { width: 100%; max-width: var(--reading-width); margin: 0 auto; padding: 32px 28px 40px; min-height: 100%; position: relative; display: flex; flex-direction: column; }
  .messages { display: flex; flex-direction: column; gap: 24px; }
  .composer-dock { flex-shrink: 0; position: relative; width: 100%; max-width: var(--reading-width); padding: 12px 28px max(16px, env(safe-area-inset-bottom)); margin: 0 auto; background: var(--bg); }
  .composer { background: var(--input); border: 1px solid var(--edge); border-radius: 24px; padding: 12px 12px 10px; position: relative; box-shadow: 0 6px 24px #0000000a; transition: border-color .15s; }
  .composer:focus-within { border-color: color-mix(in srgb, var(--muted), transparent 45%); }
  #prompt { display: block; width: 100%; min-height: 44px; max-height: min(230px, 28dvh); background: transparent; border: 0; resize: none; outline: 0; padding: 3px 7px 10px; line-height: 1.6; font-size: 15px; overflow-y: auto; }
  #prompt::placeholder { color: var(--muted); }
  .composer-bottom { display: flex; gap: 3px; align-items: center; }
  .prompt-controls { display: flex; flex: 1; min-width: 0; align-items: center; gap: 3px; flex-wrap: wrap; }
  .composer-feedback { min-height: 24px; padding: 5px 14px 0; color: var(--muted); font-size: 11px; }
  .composer-feedback.error, .field-error, .danger-text { color: var(--danger); }
  .composer-overlay { position: absolute; inset: 0; border-radius: inherit; background: color-mix(in srgb, var(--input), transparent 4%); display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 20px; }
  .field-error:empty { display: none; }
  .composer-overlay .field-error { margin: 8px 0 0; font-size: 12px; }
  .composer-overlay #overlay-label { margin-top: 7px; font-size: 12px; color: var(--muted); }
  .composer-overlay #overlay-label:empty { display: none; }
  .composer-overlay strong { font-weight: 600; }
  .empty-chat { display: flex; flex: 1; align-items: center; justify-content: center; flex-direction: column; padding: 30px 0 12vh; gap: 13px; text-align: center; }
  .empty-symbol { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 2px; }
  .empty-symbol .brand-mark { transform: rotate(45deg) scale(1.65); }
  .empty-chat h2 { font-size: clamp(23px, 3vw, 30px); font-weight: 500; letter-spacing: -.8px; margin: 0 0 6px; }
  .project-choice { display: flex; align-items: center; gap: 8px; border: 1px solid var(--edge); border-radius: 20px; padding: 7px 11px; color: var(--muted); font-size: 12px; }
  .project-choice svg { width: 15px; height: 15px; }
  .workspace.collapsed { grid-template-columns: 64px minmax(0, 1fr); }
  .collapsed .sidebar { --sidebar-gutter: 10px; }
  .collapsed .sidebar-label, .collapsed .sidebar-content, .collapsed .sidebar .connection-dot { display: none; }
  .collapsed .primary-nav { flex: 1; display: flex; flex-direction: column; }
  .collapsed .nav-action { justify-content: center; padding: 11px; }
}
@layer components {
  .composer { border-radius: 28px; }
  .prompt-controls .setting-select { display: none; }
  .composer-control { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 10px; border-radius: 12px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s; }
  .composer-control:hover:not(:disabled) { background: var(--hover); }
  .composer-control:disabled { opacity: .55; }
  .composer-access { margin-right: auto; color: var(--muted); }
  .composer-access svg { width: 19px; height: 19px; }
  .composer-access.full-access { color: #ed9a5d; }
  .composer-model { margin-left: auto; }
  .composer-model [data-icon="chevron"] svg { width: 13px; height: 13px; transform: rotate(90deg); color: var(--muted); }
  #composer-effort-label { color: var(--pending); font-weight: 400; }
  #composer-effort-label:empty { display: none; }
  .context-menu.composer-popover { width: 360px; min-width: min(280px,calc(100vw - 16px)); max-width: min(420px,calc(100vw - 16px)); max-height: min(70vh,620px); overflow-y: auto; padding: 8px; border: 1px solid var(--edge); border-radius: 18px; background: var(--raised); box-shadow: var(--shadow); }
  .control-menu-heading { padding: 10px 12px 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
  .context-menu.composer-popover > .button { min-height: 40px; border-radius: 10px; padding: 9px 12px; font-size: 14px; color: var(--text); }
  .context-menu.composer-popover > .button[aria-checked="true"] { background: var(--hover); }
  .context-menu.composer-popover > .full-access-option { color: #ed9a5d; }
  .context-menu.composer-popover .control-menu-option { display: grid; grid-template-columns: 22px 1fr 18px; column-gap: 12px; text-align: left; }
  .control-menu-option > svg:not(.menu-check) { grid-row: span 2; align-self: center; }
  .control-menu-option > small { grid-column: 2; white-space: normal; font-size: 12px; line-height: 1.45; color: var(--muted); font-weight: 400; }
  .composer-popover .menu-check { margin-left: auto; flex-shrink: 0; }
  .control-menu-option > .menu-check { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  @media (max-width: 620px) { .composer-control { font-size: 12px; padding: 5px 6px; gap: 5px; } .composer-access { max-width: 43%; overflow: hidden; } .composer-access > span { overflow: hidden; text-overflow: ellipsis; } .composer-model { max-width: 100%; } }
  .view-switch { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--edge); border-radius: 9px; background: var(--input); }
  .view-switch button { min-width: 63px; padding: 4px 9px; border-radius: 6px; color: var(--muted); font-size: 12px; line-height: 20px; }
  .view-switch button[aria-pressed="true"] { color: var(--text); background: var(--selected); box-shadow: inset 0 0 0 1px var(--accent); }
  .view-switch button:hover { color: var(--text); }
  .topbar-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 4px 5px; border-radius: 6px; font-size: 11px; color: var(--muted); text-decoration: none; white-space: nowrap; }
  .topbar-button:hover { color: var(--text); background: var(--hover); }
  .topbar-button svg { width: 16px; height: 16px; }
  .topbar-button .connection-dot { margin: 0; flex-shrink: 0; }
  .topbar-logout { display: flex; margin: 0; }
  .usage-label { color: var(--subtle); text-transform: uppercase; letter-spacing: .06em; font-size: 9px; }
  .usage-track { width: 36px; height: 5px; border-radius: 5px; overflow: hidden; background: var(--hover); }
  #usage-fill { display: block; width: 0; height: 100%; background: var(--online); }
  .usage-indicator.warning #usage-fill { background: #c5a266; }
  .usage-indicator.danger #usage-fill { background: var(--danger); }
  .usage-indicator.stale { color: var(--subtle); }
  .chatgpt-settings { color: var(--muted); font-size: 11px; white-space: nowrap; }
  .draft-recovery { margin: 0 7px 4px; color: var(--muted); font-size: 11px; }
  .saved-draft { padding: 10px 0; border-bottom: 1px solid var(--edge); }
  .saved-draft:last-child { border-bottom: 0; }
  .draft-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow-y: auto; }
  .icon-button { width: 36px; height: 36px; padding: 8px; display: inline-flex; justify-content: center; align-items: center; border-radius: 9px; flex-shrink: 0; color: var(--muted); }
  .icon-button:hover, .button:hover, .text-button:hover, .project-choice:hover { background: var(--hover); color: var(--text); }
  .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 500; }
  .primary-button { background: var(--button); color: var(--button-text); }
  .primary-button:hover { background: var(--button); color: var(--button-text); opacity: .85; }
  .outline-button { border: 1px solid var(--edge); }
  .text-button { color: var(--muted); font-size: 12px; padding: 6px 9px; border-radius: 7px; }
  .nav-action { display: flex; align-items: center; width: 100%; gap: 7px; border-radius: 8px; padding: 10px 4px; text-align: left; font-size: 13px; white-space: nowrap; }
  .nav-action:hover { background: var(--hover); }
  .nav-action kbd { margin-left: auto; font: inherit; font-size: 10px; color: var(--subtle); }
  .sidebar-search { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; padding-inline: 8px; background: var(--input); border: 1px solid var(--edge); border-radius: 8px; }
  .sidebar-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
  .sidebar-search-glyph { display: flex; color: var(--muted); }
  .sidebar-search-glyph svg { width: 15px; height: 15px; }
  #sidebar-search { flex: 1; min-width: 0; width: 0; height: 28px; border: 0; background: transparent; padding: 3px 0; font-size: 12px; line-height: 18px; outline: 0; }
  #sidebar-search::placeholder { color: var(--muted); }
  #sidebar-toggle, #new-chat { width: 30px; height: 34px; padding: 7px 5px; flex-shrink: 0; }
  #search-chats { display: none; }
  .collapsed .sidebar-search { display: contents; }
  .collapsed #sidebar-search, .collapsed .sidebar-search-glyph { display: none; }
  .collapsed #sidebar-toggle, .collapsed #new-chat, .collapsed #search-chats { display: flex; width: 44px; height: 44px; padding: 11px; margin: 0; }
  .section-label { display: flex; align-items: center; margin: 4px 4px 8px; color: var(--muted); font-size: 11px; font-weight: 500; }
  .sidebar-section { margin-bottom: 22px; min-width: 0; width: 100%; }
  .sidebar-section:not(:last-child) { padding-bottom: 12px; margin-bottom: 10px; box-shadow: inset 0 -1px 0 var(--bevel-dark), 0 1px 0 var(--bevel-light); }
  .task-row, .project-row { display: flex; align-items: center; border-radius: 8px; position: relative; width: 100%; min-width: 0; }
  .task-row:hover, .project-row:hover { background: var(--hover); }
  .task-row.selected { background: var(--selected); box-shadow: inset 3px 0 0 var(--accent); }
  .task-row, .project-row { margin: 0 0 4px; }
  .task-link { flex: 1; display: flex; align-items: center; min-width: 0; padding: 6px 8px 6px 9px; gap: 4px; text-align: left; font-size: 13px; line-height: 19px; text-decoration: none; }
  .task-link span { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .task-link .task-indicator { flex-shrink: 0; width: 5px; height: 5px; margin-inline: 3px; border-radius: 50%; background: var(--online); }
  .project-group { --project-arrow-size: 10px; }
  .project-toggle { flex: 1; display: flex; align-items: center; justify-content: flex-start; gap: 2px; min-width: 0; padding: 6px 0; text-align: left; font-size: 13px; }
  .project-toggle > svg:first-child { width: var(--project-arrow-size); height: var(--project-arrow-size); transition: transform .15s; }
  .project-toggle[aria-expanded="true"] > svg:first-child { transform: rotate(90deg); }
  .project-toggle > svg:nth-child(2) { width: 16px; height: 16px; color: var(--muted); }
  .project-toggle[aria-expanded="true"] > svg:nth-child(2) { color: var(--accent); }
  .project-label { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; margin-left: 4px; }
  /* The task rows start beside the guide centered under the expanded arrow. */
  .project-children { margin-left: calc(var(--project-arrow-size) / 2 - .5px); border-left: 1px solid var(--edge); padding-left: 4px; display: flow-root; }
  .empty-project { color: var(--subtle); font-size: 11px; margin: 3px 0 6px; padding: 5px 4px; }
  .host-group { min-width: 0; width: 100%; }
  .host-heading { font-size: 10px; color: var(--subtle); margin: 16px 0 5px; padding: 4px; width: 100%; display: flex; align-items: center; gap: 4px; text-align: left; border-radius: 5px; }
  .host-heading:hover { background: var(--hover); color: var(--text); }
  .host-heading > span { white-space: nowrap; }
  .host-heading svg { width: 12px; height: 12px; }
  .host-heading > svg:last-child { width: 10px; height: 10px; margin-left: auto; transition: transform .15s; }
  .host-heading[aria-expanded="true"] > svg:last-child { transform: rotate(90deg); }
  .host-heading .offline-tag { margin-left: 4px; }
  .offline-tag { font-size: 9px; color: var(--subtle); margin-left: auto; }
  .connection-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); margin-left: auto; }
  .connection-dot.online { background: var(--online); }
  .pending-count { border: 1px solid color-mix(in srgb, var(--pending), transparent 65%); border-radius: 15px; padding: 4px 9px; color: var(--pending); font-size: 11px; }
  .message { min-width: 0; position: relative; }
  .message-user { align-self: flex-end; max-width: 82%; background: var(--bubble); padding: 12px 17px; border-radius: 20px 20px 5px 20px; overflow-wrap: anywhere; font-size: var(--chat-font-size,14px); line-height: 1.6; }
  .message-user > div:first-child { white-space: pre-wrap; }
  .message-user { transition: background .18s ease, border-color .18s ease, opacity .18s ease; }
  .message-assistant { padding: 0 0 4px; font-size: var(--chat-font-size,14px); line-height: 1.6; }
  .pending-bubble { opacity: .85; margin: 18px 0 0 auto; width: fit-content; background: #30253d; border: 1px solid #665177; }
  .delivery-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 7px; color: var(--pending); }
  .delivery-toolbar .icon-button { width: 27px; height: 27px; padding: 5px; color: inherit; }
  .delivery-status { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; font-size: 11px; cursor: help; }
  .delivery-status svg { width: 14px; height: 14px; }
  .pending-content { white-space: pre-wrap; overflow-wrap: anywhere; }
  :root[data-theme="light"] .pending-bubble { background: #eee5f6; border-color: #a38aba; }
  .image-thumbnail { padding: 0; border: 0; background: transparent; cursor: zoom-in; }
  .image-thumbnail img { display: block; width: 96px; height: 72px; object-fit: contain; border-radius: 6px; }
  .image-preview { display: block; max-width: 100%; max-height: 75vh; margin: auto; object-fit: contain; }
  .stream-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; padding: 18px 0 8px; }
  .stream-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text); animation: breathe 1.8s ease-in-out infinite; }
.status-unknown .stream-dot { animation: none; background: var(--muted); }
.message-activity { color: var(--muted); font-size: 13px; line-height: 1.55; }
.message-activity .activity-text { margin: 0; overflow-wrap: anywhere; }
  .activity-summary { width: fit-content; max-width: 100%; }
  .activity-summary summary { display: flex; align-items: center; gap: 7px; list-style: none; color: var(--subtle); font-size: 12px; }
  .activity-summary summary::-webkit-details-marker { display: none; }
  .activity-summary summary svg { width: 14px; height: 14px; }
  .activity-summary[open] summary { margin-bottom: 8px; color: var(--muted); }
  .activity-summary .activity-text { border-left: 2px solid var(--edge); padding-left: 14px; white-space: pre-wrap; }
  .message-tool-activity { color: var(--muted); font-size: 13px; }
  .activity-summary summary > svg:last-child, .file-changes-disclosure > summary > svg:last-child { width: 11px; height: 11px; transition: transform .15s; }
  .activity-summary[open] summary > svg:last-child, .file-changes-disclosure[open] > summary > svg:last-child { transform: rotate(90deg); }
  .operation-details { margin: 8px 0 0 7px; padding: 4px 0 4px 17px; border-left: 1px solid var(--edge); max-width: 100%; }
  .operation-detail + .operation-detail { margin-top: 14px; }
  .operation-detail p { margin: 3px 0; overflow-wrap: anywhere; }
  .operation-detail pre { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
  .operation-status { font-size: 11px; color: var(--subtle); }
  .outbox-group { margin-top: 22px; }
  .outbox-group h3, .outbox-history > summary { font-size: 13px; font-weight: 500; color: var(--muted); }
  .outbox-history { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--edge); }
  .thinking-placeholder { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--subtle); }
  .thinking-placeholder svg { width: 14px; height: 14px; }
  .file-changes-disclosure > summary { display: flex; align-items: center; gap: 8px; width: fit-content; padding: 7px 12px; border: 1px solid var(--edge); border-radius: 16px; color: var(--muted); font-size: 12px; list-style: none; }
  .file-changes-disclosure > summary::-webkit-details-marker { display: none; }
  .file-changes-disclosure > summary svg { width: 14px; height: 14px; }
  .file-changes-disclosure[open] > summary { margin-bottom: 12px; }
  .file-changes-card { border: 1px solid var(--edge); border-radius: 14px; background: var(--side); overflow: hidden; }
  .file-changes-heading { display: flex; gap: 12px; align-items: center; padding: 16px; }
  .file-changes-symbol { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--bg); }
  .file-changes-title { flex: 1; min-width: 0; }
  .file-changes-title > strong { display: block; font-size: 14px; font-weight: 600; }
  .change-stats { display: inline-flex; gap: 8px; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .diff-added { color: var(--online); } .diff-removed { color: var(--danger); }
  .change-partial { font-size: 11px; color: var(--subtle); }
  .changes-open { border: 1px solid var(--edge); border-radius: 8px; padding: 7px 10px; font-size: 12px; color: var(--text); }
  .changes-open:hover { background: var(--hover); }
  .changed-file-list { border-top: 1px solid var(--line); }
  .changed-file { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 16px; }
  .changed-file:hover { background: var(--hover); }
  .changed-file > svg { width: 16px; height: 16px; color: var(--subtle); }
  .changed-file-name { flex: 1; min-width: 0; }
  .changed-file-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 450; }
  .changed-file-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--subtle); font-size: 10px; }
  .more-file-changes > summary { display: flex; align-items: center; gap: 8px; padding: 11px 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); list-style: none; }
  .more-file-changes > summary::-webkit-details-marker { display: none; }
  .more-file-changes > summary svg { width: 13px; height: 13px; transform: rotate(90deg); transition: transform .15s; }
  .more-file-changes[open] > summary svg { transform: rotate(-90deg); }
  .gaia-dialog.diff-dialog { width: min(1100px, calc(100vw - 32px)); }
  .diff-workspace { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 20px; min-height: 260px; }
  .diff-file-list { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; border-right: 1px solid var(--line); padding-right: 12px; }
  .diff-file-tab { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 10px; border-radius: 7px; font-size: 12px; color: var(--muted); }
  .diff-file-tab[aria-current="true"] { color: var(--text); background: var(--hover); }
  .diff-detail { min-width: 0; }
  .diff-file-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .diff-file-heading strong { font-size: 14px; font-weight: 550; }
  .diff-file-heading p { color: var(--subtle); overflow-wrap: anywhere; font-size: 11px; margin: 4px 0 0; }
  .diff-code { padding: 8px 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: var(--bg); font-family: ui-monospace,Consolas,monospace; font-size: 12px; line-height: 1.65; tab-size: 2; }
  .diff-line { display: flex; min-width: fit-content; }
  .diff-line > span:last-child { padding-right: 14px; }
  .diff-line-number { min-width: 45px; padding: 0 12px 0 8px; text-align: right; user-select: none; opacity: .5; flex-shrink: 0; }
  .diff-line-add { color: var(--online); background: color-mix(in srgb,var(--online),transparent 94%); }
  .diff-line-remove { color: var(--danger); background: color-mix(in srgb,var(--danger),transparent 94%); }
  .diff-line-hunk { color: var(--accent); background: color-mix(in srgb,var(--accent),transparent 94%); }
  .diff-unavailable, .diff-patch-label { color: var(--muted); font-size: 12px; margin: 10px 0; }
  .artifact-card { display: flex; flex-direction: column; width: min(100%,480px); max-width: 100%; margin: 12px 0; overflow: hidden; border: 1px solid var(--edge); border-radius: 14px; background: var(--side); white-space: normal; }
  .artifact-card.artifact-inline { display: inline-flex; flex-direction: row; align-items: center; width: auto; max-width: min(100%,360px); margin: 2px; vertical-align: middle; border-radius: 8px; }
  .message-assistant .prose > .artifact-card:not(.artifact-inline) { width: min(100%,680px); }
  .message-assistant .prose > .artifact-card:not(.artifact-inline) .artifact-image-frame { max-height: 460px; }
  .artifact-heading { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 11px 13px; font-size: 12px; line-height: 1.4; }
  .artifact-heading > svg { width: 16px; height: 16px; color: var(--muted); }
  .artifact-name { min-width: 0; flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .artifact-size { color: var(--subtle); font-size: 10px; white-space: nowrap; }
  .artifact-body { display: block; position: relative; min-width: 0; }
  .artifact-image-frame { display: grid; place-items: center; aspect-ratio: 16 / 9; max-height: 360px; min-height: 90px; overflow: hidden; background: color-mix(in srgb,var(--bg),black 12%); }
  .artifact-image-open { display: block; width: 100%; height: 100%; padding: 0; cursor: zoom-in; }
  .artifact-image-open img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .artifact-card img, .image-preview, .artifact-full-image, .message-attachment img { pointer-events: auto; user-select: auto; -webkit-user-drag: element; }
  .image-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
  .image-actions .button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; font-size: 12px; }
  .image-actions svg { width: 15px; height: 15px; }
  .image-action-status { flex-basis: 100%; font-size: 11px; color: var(--muted); text-align: right; }
  .image-action-status:empty { display: none; }
  .artifact-actions:has(.image-actions) { flex-wrap: wrap; }
  .image-generation-placeholder { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; width: min(100%,480px); min-height: 220px; border: 1px solid var(--edge); border-radius: 14px; background: var(--side); color: var(--muted); }
  .image-generation-placeholder > svg { width: 38px; height: 38px; color: var(--accent); animation: breathe 1.6s ease-in-out infinite; }
  .image-generation-placeholder > strong { color: var(--text); font-size: 14px; font-weight: 500; }
  .image-generation-placeholder > span { font-size: 12px; }
  .image-generation-finished > svg { animation: none; }
  .message-image { margin: 12px 0; max-width: min(100%,680px); border: 1px solid var(--edge); border-radius: 14px; padding: 8px; background: var(--side); }
  .message-image > .image-thumbnail { width: 100%; height: auto; padding: 0; cursor: zoom-in; }
  .message-image img { display: block; max-width: 100%; width: auto; max-height: 480px; margin: auto; object-fit: contain; border-radius: 9px; }
  @media (prefers-reduced-motion: reduce) { .image-generation-placeholder > svg { animation: none; } }
  .artifact-placeholder { color: var(--subtle); opacity: .5; padding: 22px; }
  .artifact-placeholder svg { width: 28px; height: 28px; }
  .artifact-loading { display: block; font-size: 11px; color: var(--subtle); padding: 0 12px 14px; text-align: center; }
  .artifact-image-frame .artifact-loading { position: absolute; bottom: 5px; }
  .artifact-card[data-artifact-state="loading"] .artifact-placeholder { animation: breathe 1.6s ease-in-out infinite; }
  .artifact-actions { display: flex; justify-content: flex-end; align-items: center; gap: 3px; padding: 5px 8px; border-top: 1px solid var(--line); }
  .artifact-actions .icon-button { width: 28px; height: 28px; padding: 6px; color: var(--muted); }
  .artifact-open { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 11px; padding: 5px 7px; border-radius: 6px; }
  .artifact-open svg { width: 13px; height: 13px; color: var(--subtle); }
  .artifact-open:hover, .artifact-actions .icon-button:hover { background: var(--hover); }
  .artifact-inline .artifact-heading { padding: 9px 11px; }
  .artifact-inline .artifact-body { display: none; }
  .artifact-inline .artifact-actions { border-top: 0; padding: 0 6px 5px; }
  .artifact-inline .artifact-open { padding: 2px 5px; }
  .artifact-inline .artifact-actions .icon-button { width: 24px; height: 24px; padding: 5px; }
  .artifact-inline .artifact-inline-heading { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 8px; min-width: 0; max-width: 290px; font-size: 12px; text-align: left; }
  .artifact-inline-heading .artifact-name { flex: initial; }
  .artifact-inline .artifact-actions { flex-shrink: 0; padding: 0 4px 0 0; }
  .artifact-inline .artifact-size { font-size: 9px; }
  .artifact-inline[data-artifact-state="error"] .artifact-body { display: block; }
  .artifact-text-excerpt { margin: 0; padding: 13px; max-height: 130px; overflow: hidden; font: 11px/1.6 ui-monospace,Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); border-top: 1px solid var(--line); }
  .artifact-document-cover { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; min-height: 180px; background: var(--bg); color: var(--muted); font-size: 12px; }
  .artifact-document-cover > svg { width: 38px; height: 38px; margin-bottom: 6px; color: var(--subtle); }
  .artifact-document-cover > strong { font-weight: 500; color: var(--text); }
  .artifact-document-cover > span { font-size: 11px; }
  .artifact-file-detail { display: block; padding: 0 13px 12px; color: var(--muted); font-size: 11px; }
  .artifact-error { display: flex; align-items: center; gap: 8px; padding: 16px 13px 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
  .artifact-error svg { width: 17px; height: 17px; }
  .artifact-retry { display: inline-flex; align-items: center; gap: 6px; margin: 0 13px 14px; padding: 6px 8px; font-size: 11px; border: 1px solid var(--edge); border-radius: 6px; }
  .artifact-retry svg { width: 13px; height: 13px; }
  .artifact-image-frame:has(.artifact-error) { display: flex; flex-direction: column; align-items: stretch; justify-content: center; }
  .gaia-dialog.artifact-dialog { width: min(1100px,calc(100vw - 32px)); }
  .artifact-preview-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
  .artifact-preview-toolbar .button { display: inline-flex; align-items: center; gap: 7px; }
  .artifact-preview-toolbar svg { width: 15px; height: 15px; }
  .artifact-full-image { display: block; max-width: 100%; max-height: 72dvh; width: auto; height: auto; margin: auto; object-fit: contain; }
  .artifact-pdf { width: 100%; height: min(72dvh,900px); border: 0; border-radius: 8px; background: #fff; }
  .artifact-full-text { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); overflow: auto; font: 12px/1.7 ui-monospace,Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
  .markdown-image { display: block; max-width: 100%; max-height: 480px; border-radius: 12px; object-fit: contain; margin: 12px 0; }
  @keyframes breathe { 50% { opacity: .25; } }
  .history-status { color: var(--muted); font-size: 12px; }
  .history-status:not(:empty) { margin-bottom: 22px; }
  .load-older { align-self: center; margin: 0 0 24px; }
  .pending-message { margin: 18px 0 0 auto; width: min(100%, 570px); border: 1px solid color-mix(in srgb, var(--pending), transparent 62%); border-radius: 18px; padding: 13px 16px; background: color-mix(in srgb, var(--pending), transparent 92%); }
  .pending-message[data-status="sending"] { border-color: color-mix(in srgb, var(--online), transparent 50%); background: color-mix(in srgb, var(--online), transparent 90%); }
  .pending-message[data-status="accepted"] { border-color: var(--edge); background: transparent; }
  .pending-message[data-status="accepted"] .pending-label { color: var(--online); }
  .pending-message > p { margin: 5px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
  .pending-label { color: var(--pending); font-size: 11px; display: flex; gap: 7px; align-items: center; }
  .pending-label.sending { color: var(--online); }
  .pending-error { color: var(--muted); font-size: 12px; margin-top: 7px; overflow-wrap: anywhere; }
  .pending-actions { display: flex; flex-wrap: wrap; gap: 2px; margin: 6px -7px -4px; }
  .attachment-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
  .attachment-list:not(:empty) { padding: 0 4px 10px; }
  .attachment-chip { display: flex; align-items: center; gap: 7px; background: var(--raised); border: 1px solid var(--edge); border-radius: 10px; padding: 6px 6px 6px 10px; max-width: 260px; font-size: 11px; }
  .attachment-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .attachment-chip small { color: var(--muted); font-size: 10px; }
  .attachment-chip .icon-button { width: 25px; height: 25px; padding: 4px; }
  .message-attachments { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; white-space: normal; }
  .message-attachment { display: flex; gap: 9px; align-items: center; border: 1px solid var(--edge); background: var(--raised); padding: 10px 12px; border-radius: 12px; font-size: 12px; text-decoration: none; max-width: 100%; overflow-wrap: anywhere; }
  .message-attachment img { display: block; max-width: 300px; max-height: 220px; border-radius: 8px; object-fit: contain; }
  .setting-select select { appearance: auto; border: 0; border-radius: 6px; padding: 5px 2px; background: transparent; color: var(--muted); max-width: 172px; font-size: 11px; }
  .setting-select select:focus, .setting-select select:hover { color: var(--text); }
  .setting-select option { background: var(--raised); color: var(--text); }
  .select-trigger { justify-content: space-between; gap: 7px; padding: 5px 7px; color: var(--muted); font-size: 11px; max-width: 210px; min-width: 0; }
  .select-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .select-trigger > svg { width: 12px; height: 12px; transform: rotate(90deg); }
  .select-trigger:hover, .select-trigger[aria-expanded="true"] { background: var(--hover); color: var(--text); }
  .context-menu [role="menuitemradio"] { min-height: 32px; }
  .context-menu [role="menuitemradio"][aria-checked="true"] { color: var(--accent); background: var(--selected); }
  .context-menu [role="menuitemradio"][aria-checked="false"] { padding-left: 40px; }
  .send-button { margin-left: 4px; background: var(--button); color: var(--button-text); border-radius: 50%; width: 33px; height: 33px; }
  .send-button:hover { background: var(--button); color: var(--button-text); opacity: .85; }
  .stop-button { color: var(--text); border: 1px solid var(--edge); border-radius: 50%; width: 33px; height: 33px; }
  .stop-button svg { width: 13px; height: 13px; fill: currentColor; }
  .jump-latest { position: absolute; right: 30px; top: -48px; border-radius: 50%; border: 1px solid var(--edge); background: var(--raised); box-shadow: 0 3px 10px #0002; color: var(--text); }
  .notice { color: var(--muted); font-size: 12px; padding: 9px 22px; background: var(--side); display: flex; align-items: center; gap: 10px; }
  .notice.error { color: var(--danger); }
  .notice .icon-button { margin-left: auto; width: 24px; height: 24px; }
  .drop-overlay { position: absolute; inset: -8px 16px 4px; border: 1px dashed var(--focus); border-radius: 28px; background: var(--input); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; z-index: 4; pointer-events: none; }
  .drop-overlay > span { color: var(--muted); font-size: 11px; }
  .gaia-dialog { width: min(540px, calc(100vw - 32px)); max-height: min(780px, calc(100dvh - 48px)); background: var(--raised); color: var(--text); border: 1px solid var(--edge); border-radius: 18px; padding: 0; box-shadow: var(--shadow); overflow: auto; }
  .gaia-dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
  .dialog-heading { display: flex; justify-content: space-between; align-items: center; padding: 15px 16px 10px 22px; position: sticky; top: 0; background: var(--raised); z-index: 1; }
  .dialog-heading h2 { font-weight: 550; font-size: 16px; margin: 0; white-space: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .dialog-content { padding: 6px 22px 24px; }
  .dialog-content p { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
  .field { display: grid; gap: 7px; margin-bottom: 18px; font-size: 12px; }
  .reading-settings { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
  .pdf-controls { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; }
  .pdf-controls select { margin-left: auto; background: var(--bg); border: 1px solid var(--edge); border-radius: 7px; padding: 6px; font-size: 12px; }
  .pdf-controls > :last-child { margin-left: auto; }
  .pdf-page-status { font-size: 12px; color: var(--muted); }
  .pdf-previous svg { transform: rotate(180deg); }
  .pdf-page-viewport { overflow: auto; scrollbar-gutter: stable; max-height: min(60dvh,calc(100dvh - 300px)); min-height: 180px; padding: 16px; border-radius: 10px; background: #414141; }
  .pdf-page-viewport canvas { display: block; margin: 0 auto; background: white; box-shadow: 0 3px 18px #0004; }
  .pdf-page-viewport .artifact-error { color: #eee; }
  .pdf-text-details { margin-top: 12px; font-size: 12px; color: var(--muted); }
  .pdf-page-text { white-space: pre-wrap; overflow: auto; max-height: 180px; color: var(--text); font-size: 13px; }
  .app-version, .outbox-intro { font-size: 12px; color: var(--muted); margin: 18px 0 12px; }
  .field input, .field select, .field textarea, .search-input { width: 100%; border: 1px solid var(--edge); background: var(--bg); border-radius: 9px; padding: 10px 12px; outline-offset: 1px; font-size: 14px; }
  .field textarea { min-height: 90px; resize: vertical; }
  .field-error { font-size: 12px; margin: 6px 0; }
  .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
  .dialog-content hr { border: 0; border-top: 1px solid var(--edge); margin: 20px 0; }
  .search-dialog { width: min(640px, calc(100vw - 32px)); }
  .search-input { margin-bottom: 14px; }
  .search-results { display: grid; gap: 4px; max-height: 55dvh; overflow: auto; }
  .search-result { display: flex; gap: 12px; align-items: center; width: max-content; min-width: 100%; text-align: left; padding: 12px 9px; border-radius: 9px; }
  .search-result:hover, .search-result:focus { background: var(--hover); }
  .search-result > span { min-width: 0; }
  .search-result strong { font-weight: 500; font-size: 13px; display: block; white-space: nowrap; }
  .search-result small { display: block; font-size: 11px; color: var(--muted); }
  .context-menu { position: fixed; z-index: 30; width: 216px; padding: 5px; border: 1px solid var(--edge); background: var(--raised); border-radius: 11px; box-shadow: var(--shadow); }
  .context-menu .button { width: 100%; justify-content: flex-start; padding: 9px 10px; font-size: 12px; }
  .context-menu svg { width: 16px; height: 16px; }
  .context-menu .button:focus { background: var(--hover); outline-offset: -2px; }
  .diagnostics { font-size: 12px; color: var(--muted); }
  .diagnostics summary { padding-block: 5px; }
  .diagnostics dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; margin: 12px 0; }
  .diagnostics dt { color: var(--muted); }
  .diagnostics dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
  .usage-lines { font-size: 12px; margin: 12px 0; min-width: 0; }
  .usage-group { min-width: 0; padding: 12px; margin-top: 10px; background: var(--bg); box-shadow: var(--bevel); border-radius: 8px; }
  .usage-group h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .usage-model { display: block; color: var(--muted); font-size: 11px; margin: -4px 0 8px; overflow-wrap: anywhere; }
  .usage-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 10px 0 0; }
  .usage-row strong { font-weight: 500; white-space: nowrap; }
  .usage-row small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
  .approval-card { margin-top: 24px; border: 1px solid var(--edge); border-radius: 14px; padding: 16px; }
  .approval-card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 550; }
  .approval-card pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 180px; overflow: auto; }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .skip-link { position: absolute; top: -60px; left: 12px; z-index: 50; padding: 10px; background: var(--raised); border: 1px solid var(--edge); border-radius: 8px; }
  .skip-link:focus { top: 12px; }
  .login-shell { display: grid; min-height: 100dvh; place-items: center; padding: 24px; }
  .login-card { width: min(100%, 380px); padding: 32px; border: 1px solid var(--edge); border-radius: 20px; background: var(--side); }
  .login-brand { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; margin-bottom: 30px; }
  .login-card h1 { font-size: 25px; font-weight: 550; letter-spacing: -.5px; margin: 0 0 8px; }
  .login-card > p { color: var(--muted); font-size: 13px; margin: 0 0 26px; }
  .login-card form { display: grid; gap: 9px; }
  .login-card label { font-size: 12px; }
  .login-card input:not([type="hidden"]) { background: var(--bg); border: 1px solid var(--edge); border-radius: 9px; padding: 12px; width: 100%; }
  .login-card button { background: var(--button); color: var(--button-text); padding: 12px; border-radius: 9px; font-weight: 550; margin-top: 12px; }
  .login-error { color: var(--danger); font-size: 12px; margin: 0; }
  .gaia-dialog, .context-menu, .attachment-chip, .message-attachment, .approval-card, .login-card, .outline-button { border-color: var(--edge); }
  .dialog-heading { border-bottom: 1px solid var(--line); }
}
@layer prose {
  .prose { overflow-wrap: anywhere; }
  .prose > :first-child { margin-top: 0; }
  .prose > :last-child { margin-bottom: 0; }
  .prose p { margin: 0 0 12px; white-space: pre-wrap; }
  .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-size: 1.08em; font-weight: 600; line-height: 1.4; margin: 25px 0 12px; }
  .prose h2 { font-size: 1.25em; }
  .prose a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent), transparent 45%); text-underline-offset: 3px; }
  .prose a:hover { text-decoration-color: var(--text); }
  .native-file-chip { display: inline-flex; align-items: center; gap: 5px; vertical-align: baseline; max-width: 100%; border: 1px solid var(--edge); border-radius: 6px; background: var(--bubble); padding: 2px 6px; font-size: .85em; line-height: 1.5; text-align: left; }
  .native-file-chip > span:not(.sr-only) { overflow-wrap: anywhere; min-width: 0; }
  .native-file-chip > svg:last-child { width: 12px; height: 12px; color: var(--muted); }
  .file-location-device, .file-location-status { color: var(--muted); font-size: 12px; }
  .file-location-device strong { color: var(--text); font-weight: 500; }
  .field .file-location-path { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
  .native-file-chip svg { width: 13px; height: 13px; color: var(--muted); }
  .native-file-chip:hover { background: var(--hover); }
  .prose ul, .prose ol { padding-left: 25px; margin: 12px 0 18px; }
  .prose li { padding-left: 3px; margin: 6px 0; }
  .prose li .prose ul, .prose li .prose ol { margin: 6px 0; }
  .prose blockquote { border-left: 3px solid var(--edge); padding-left: 16px; margin: 18px 0; color: var(--muted); }
  .prose hr { border: 0; border-top: 1px solid var(--edge); margin: 24px 0; }
  .prose code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; padding: 2px 5px; background: var(--bubble); border-radius: 4px; }
  .code-block { border: 1px solid var(--edge); background: var(--side); border-radius: 12px; overflow: hidden; margin: 16px 0; }
  .code-heading { display: flex; justify-content: space-between; align-items: center; background: var(--bubble); padding: 3px 8px 3px 14px; font-size: 11px; color: var(--muted); }
  .code-heading .icon-button { width: 28px; height: 28px; padding: 6px; }
  .code-block pre { overflow-x: auto; margin: 0; padding: 16px; line-height: 1.6; }
  .code-block pre code { background: transparent; padding: 0; border-radius: 0; overflow-wrap: normal; }
  .table-scroll { overflow: auto; border: 1px solid var(--edge); border-radius: 10px; margin: 16px 0; }
  .prose table { border-collapse: collapse; width: 100%; min-width: 260px; font-size: .87em; line-height: 1.5; }
  .prose th, .prose td { padding: 10px 13px; border-bottom: 1px solid var(--edge); text-align: left; min-width: 100px; }
  .prose th { font-weight: 550; background: var(--side); }
  .prose tr:last-child td { border-bottom: 0; }
  .code-block, .table-scroll { border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light); }
  .code-heading { box-shadow: inset 0 -1px 0 var(--bevel-dark), 0 1px 0 var(--bevel-light); }
}
@layer responsive {
  #mobile-menu { display: none; }
  @media (max-width: 1100px) { .workspace { --sidebar-width: 230px; } .setting-select select { max-width: 145px; } .brand-copy { flex-direction: column; align-items: flex-start; gap: 0; } .taskspace-bar { gap: 8px; } .logout-label, .usage-label { display: none; } .taskspace-tools { gap: 4px; } }
  @media (max-width: 760px) {
    .workspace, .workspace.collapsed { grid-template-columns: minmax(0, 1fr); }
    .main-pane { grid-column: 1; }
    .taskspace-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: max(6px, env(safe-area-inset-top)) 10px 5px; }
    .taskspace-tools { grid-column: 1 / -1; justify-content: space-between; gap: 2px; }
    .view-switch button { min-width: 55px; padding: 3px 6px; }
    .taskspace-bar .brand { gap: 5px; }
    .brand-subtitle { font-size: 9px; }
    .topbar-button { font-size: 10px; }
    .taskspace-tools > .topbar-button { min-width: 0; }
    .taskspace-tools .original-link, .taskspace-tools .topbar-logout { flex-shrink: 0; }
    #usage-text, #bridge-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .usage-track { width: 28px; flex-shrink: 0; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 85vw); transform: translateX(-100%); z-index: 21; transition: transform .18s; padding-top: max(14px, env(safe-area-inset-top)); }
    .drawer-open .sidebar { transform: translateX(0); box-shadow: var(--bevel), var(--shadow); }
    .collapsed .sidebar-label, .collapsed .sidebar-content { display: revert; }
    .collapsed .sidebar-content { flex: 1; }
    .collapsed .sidebar { --sidebar-gutter: 6px; }
    .collapsed .primary-nav { display: flex; flex-direction: row; flex: none; }
    .collapsed .sidebar-search { display: flex; }
    .collapsed #sidebar-search { display: block; }
    .collapsed .sidebar-search-glyph { display: flex; }
    .collapsed #sidebar-toggle, .collapsed #new-chat { width: 30px; height: 34px; padding: 7px 5px; margin: 0; }
    .collapsed #search-chats { display: none; }
    .collapsed .nav-action { justify-content: flex-start; padding: 10px 4px; }
    .collapsed .connection-dot { display: block; }
    .drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: var(--scrim); }
    #mobile-menu { display: flex; }
    .chat-header { padding: max(10px, env(safe-area-inset-top)) 13px 10px; min-height: 62px; gap: 6px; }
    .chat-heading h1 { font-size: 14px; }
    .conversation-find { padding-inline: 10px; flex-wrap: wrap; }
    #find-input { flex-basis: 130px; } .find-result { font-size: 10px; }
    .conversation { padding: 18px 18px 24px; }
    .composer-dock { padding: 0 10px max(6px, env(safe-area-inset-bottom)); }
    .composer { border-radius: 23px; padding: 11px 8px 9px; }
    #prompt { font-size: 16px; }
    .composer-feedback { font-size: 10px; padding-inline: 10px; }
    .messages { gap: 23px; }
    .message-user { max-width: 92%; font-size: var(--chat-font-size,14px); padding: 10px 15px; }
    .message-assistant { font-size: var(--chat-font-size,14px); }
    .task-link, .project-toggle { padding-block: 12px; }
    .empty-chat { padding-bottom: 7vh; }
    .setting-select select { max-width: 126px; font-size: 10px; }
    .effort-select select { max-width: 75px; }
    .speed-select select { max-width: 73px; }
    .composer-bottom { gap: 0; }
    .prompt-controls { gap: 0; }
    .composer-bottom > .icon-button { width: 32px; height: 32px; }
    .gaia-dialog { max-height: calc(100dvh - 24px); }
    .dialog-content { padding-inline: 18px; }
    .message-attachment img { max-width: 200px; }
    .diff-workspace { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .diff-file-list { flex-direction: row; overflow: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; }
    .diff-file-tab { flex-shrink: 0; max-width: 180px; }
    .file-changes-heading { padding: 12px; gap: 9px; }
    .file-changes-symbol { width: 32px; height: 32px; }
    .file-changes-title > strong { font-size: 13px; }
    .changes-open { font-size: 11px; padding: 6px 8px; }
    .changed-file { padding: 10px 12px; }
    .artifact-card { border-radius: 11px; }
    .artifact-image-frame { max-height: 300px; }
    .artifact-heading { padding: 9px 10px; }
    .artifact-actions .icon-button { width: 32px; height: 32px; }
    .notice { padding: 7px 15px; }
  }
  @media (max-width: 380px) { #find-input { flex-basis: 110px; } .prompt-controls { row-gap: 0; } .setting-select select { max-width: 110px; } .effort-select select { max-width: 65px; } .speed-select select { max-width: 65px; } }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
}

/* Each native desktop has an independent connection and outbox. */
.device-switch{flex-shrink:0}.device-switch button:disabled{opacity:.38;cursor:not-allowed}.device-switch button[aria-pressed="true"]:disabled{box-shadow:inset 0 0 0 1px var(--border)}
@media(max-width:800px){.taskspace-bar{flex-wrap:wrap;gap:8px}.brand{margin-right:auto}.device-switch{order:2}.taskspace-tools{margin-left:auto}.view-switch button{padding:5px 9px}}
/* Four toolbar groups: brand, service, native device and account tools. */
.taskspace-bar{grid-template-columns:minmax(100px,1fr) auto auto auto}
.device-switch{justify-self:start}
@media(max-width:1100px){.brand-subtitle{display:none}.taskspace-bar{gap:8px}.view-switch button{min-width:58px;padding:4px 7px}}
@media(max-width:760px){
 .taskspace-bar{grid-template-columns:minmax(0,1fr) auto;gap:5px 8px}
 .taskspace-bar>.brand{grid-column:1;grid-row:1}
 .taskspace-bar>.view-switch:not(.device-switch){grid-column:2;grid-row:1}
 .taskspace-bar>.device-switch{grid-column:1 / -1;grid-row:2;justify-self:end;order:initial}
 .taskspace-tools{grid-column:1 / -1;grid-row:3;justify-content:space-between;margin:0;width:100%}
}
