/* Aster layouts and DOM adapters for Orbit UI 0.3.0. */
:root {
  --app-height: 100dvh;
  --topbar-height: 4.75rem;
  --dock-space: 0px;
  --side-width: clamp(12.5rem, 17vw, 16rem);
  --reader-width: 50rem;
  --row-height: 2.75rem;
  --transcript-gap: 1.3rem;
}
:root[data-theme="graphite"] {
  --orbit-canvas: #111318;
  --orbit-surface: #181a20;
  --orbit-field: #1b1d23;
  --orbit-raised: #22252d;
  --orbit-elevated: #2b2f38;
  --orbit-glass: #1c2029bb;
  --orbit-mobile-glass: #1c2029d0;
  --orbit-action-glass: #1c2029e5;
}
:root[data-theme="light"] {
  color-scheme: light;
  --orbit-canvas: #f7f8fb;
  --orbit-surface: #fff;
  --orbit-field: #f3f4fa;
  --orbit-raised: #eceef6;
  --orbit-elevated: #fff;
  --orbit-text: #1c2232;
  --orbit-muted: #50596b;
  --orbit-disabled: #687182;
  --orbit-edge: #7a8497;
  --orbit-rim: #151d412d;
  --orbit-line: #151d4121;
  --orbit-accent: #425992;
  --orbit-hover: #344c86;
  --orbit-pressed: #29417b;
  --orbit-on-accent: #fff;
  --orbit-tonal: #e1e8fc;
  --orbit-on-tonal: #203d76;
  --orbit-row-selected: #e9eefb;
  --orbit-danger: #9c3d4b;
  --orbit-danger-soft: #9c3d4b13;
  --orbit-success: #356550;
  --orbit-warning: #795621;
  --orbit-glass: #f8f9fce0;
  --orbit-mobile-glass: #f5f7fbe9;
  --orbit-action-glass: #f7f8fcec;
  --orbit-glass-text: #1c2232;
}
:root :where(.orbit-menu, .orbit-dialog, .orbit-popover, .orbit-tooltip) {
  --orbit-canvas: inherit;
  --orbit-surface: inherit;
  --orbit-field: inherit;
  --orbit-raised: inherit;
  --orbit-elevated: inherit;
  --orbit-text: inherit;
  --orbit-muted: inherit;
  --orbit-disabled: inherit;
  --orbit-edge: inherit;
  --orbit-rim: inherit;
  --orbit-line: inherit;
  --orbit-accent: inherit;
  --orbit-hover: inherit;
  --orbit-pressed: inherit;
  --orbit-on-accent: inherit;
  --orbit-tonal: inherit;
  --orbit-on-tonal: inherit;
  --orbit-danger: inherit;
  --orbit-danger-soft: inherit;
  --orbit-success: inherit;
  --orbit-warning: inherit;
  --orbit-action-glass: inherit;
  --orbit-focus: inherit;
  color-scheme: inherit;
  font-size: 1em;
}
:root[data-font-size="small"] { font-size: .875rem; }
:root[data-font-size="large"] { font-size: 1.125rem; }
:root[data-chat-width="wide"] { --reader-width: 69rem; }
:root[data-density="compact"] { --row-height: 2.25rem; --transcript-gap: .85rem; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; min-height: 100dvh; }
p { margin: 0; }
h2 { margin: 1.2rem 0 .7rem; font-size: 1.25rem; letter-spacing: -.026em; }
h3 { margin: .85rem 0 .45rem; }
strong { font-weight: 650; }
a { color: var(--orbit-on-tonal); text-decoration: none; }
button { border: 0; color: inherit; background: none; cursor: pointer; }
button:not(.orbit-button):disabled { color: var(--orbit-disabled); cursor: default; }
[role="status"] { overflow-wrap: anywhere; }
:where(input:not([type=checkbox],[type=file],[type=range]), textarea, select) {
  min-width: 0; color: var(--orbit-text); background: var(--orbit-field);
  border: 1px solid var(--orbit-edge); border-radius: .8rem; padding: .55rem .7rem;
}
textarea { width: 100%; min-height: 4rem; resize: vertical; }
:where(input, textarea)::placeholder { color: var(--orbit-muted); }
pre, code, kbd { font-family: var(--orbit-mono); }
pre { margin: 0; font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
:where(summary):focus-visible { outline: 2px solid var(--orbit-focus); outline-offset: 2px; }
:where(.main, .sidebar, .detail, .chat-stream, .model-choices) { scrollbar-width: thin; scrollbar-color: var(--orbit-edge) transparent; }

.topbar {
  height: var(--topbar-height); padding: .35rem clamp(.75rem, 3vw, 2rem);
  z-index: 4; border-bottom: 1px solid var(--orbit-line); background: var(--orbit-canvas);
}
.topbar:not(:has(#section-dock:not([hidden]))) .orbit-edge-fade { display: none; }
.brand-lockup, .brand { display: flex; align-items: center; gap: .55rem; }
.brand { color: var(--orbit-text); font-weight: 780; letter-spacing: -.04em; font-size: 1.25rem; }
.mark {
  display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem;
  border-radius: .66rem; color: var(--orbit-on-tonal); background: var(--orbit-tonal);
}
.mark.large { width: 2.75rem; height: 2.75rem; border-radius: .9rem; }
.topbar .mobile-nav { --button-h: 2.75rem; }
.topbar .orbit-tabbar { justify-content: center; }
.topbar .orbit-adaptive-navigation__dock { min-width: min(10rem, 100%); }
.connection { display: flex; align-items: center; gap: .35rem; font-size: .74rem; }
.connection.ready::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--orbit-success); }
.layout { display: grid; min-width: 0; height: calc(var(--app-height) - var(--topbar-height)); grid-template-columns: var(--side-width) minmax(0,1fr); }
.layout:has(.detail:not([hidden])) { grid-template-columns: var(--side-width) minmax(0,1fr) clamp(16rem,26vw,22rem); }
.main { grid-column: 2; overflow: auto; min-width: 0; }
.detail { grid-column: 3; min-width: 0; overflow: auto; }
.content { max-width: 75rem; min-width: 0; margin-inline: auto; padding: clamp(1.1rem,3.5vw,3.25rem); }
.page-title, .hero h1 { margin: .28rem 0 .1rem; font-size: clamp(1.95rem,4.5vw,3.15rem); line-height: 1.05; font-weight: 720; letter-spacing: -.047em; overflow-wrap: anywhere; }
.eyebrow { color: var(--orbit-muted); font-size: .84rem; font-weight: 550; }
.hero { margin-bottom: 1.55rem; }
.hero p { color: var(--orbit-muted); margin-top: .6rem; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; min-width: 0; }
.text-control { min-height: 1.95rem; padding: .25rem .55rem; color: var(--orbit-on-tonal); border-radius: 999px; font-size: .84rem; text-align: start; }
.text-control:hover { background: var(--orbit-raised); }
.icon-control { --button-h: 2.25rem; display: inline-grid; place-items: center; }
.empty { padding: .9rem; color: var(--orbit-muted); font-size: .88rem; overflow-wrap: anywhere; }
.hint, .subtle { color: var(--orbit-muted); overflow-wrap: anywhere; }
.hint { font-size: .82rem; }

.sidebar {
  padding: .95rem .75rem 1rem; border-inline-end: 1px solid var(--orbit-line); background: var(--orbit-surface);
  overflow: auto; min-width: 0; grid-column: 1;
}
.sidebar-head { display: grid; gap: .5rem; padding-inline: .1rem; margin-bottom: 1.3rem; }
.sidebar .sidebar-head .new-chat { justify-content: center; min-height: 2.75rem; background: var(--orbit-tonal); color: var(--orbit-on-tonal); }
.sidebar .sidebar-head .new-chat:hover { background: color-mix(in srgb, var(--orbit-tonal), var(--orbit-text) 10%); }
.sidebar .sidebar-head .rail-search {
  min-height: 2.6rem; padding-inline: .7rem; border: 1px solid var(--orbit-rim); background: var(--orbit-field);
  font-size: .8rem; color: var(--orbit-muted);
}
.rail-search kbd { margin-inline-start: auto; padding: .1rem .3rem; }
.side-title { display: flex; justify-content: space-between; align-items: baseline; gap: .25rem; padding-inline: .75rem; margin: .85rem 0 .27rem; color: var(--orbit-muted); font-size: .77rem; font-weight: 650; }
#project-count { font-variant-numeric: tabular-nums; }
.side-list { display: grid; gap: .13rem; }
.sidebar .side-option { min-height: var(--row-height); font-size: .88rem; }
.sidebar .orbit-side-nav__label { line-height: 1.3; }
.sidebar .orbit-side-nav__label small { display: block; margin-top: .14rem; color: var(--orbit-muted); font-size: .69rem; }
.role-icon { width: 1.5rem; height: 1.5rem; display: inline-grid; place-items: center; flex: none; border-radius: .54rem; background: var(--orbit-tonal); color: var(--orbit-on-tonal); }
.role-icon[data-role="reviewer"] { color: var(--orbit-success); }
.sidebar .role-icon { width: auto; height: auto; color: currentColor; background: transparent; }
.side-empty { padding: 0 .75rem; color: var(--orbit-muted); font-size: .8rem; }
.sidebar-foot { display: grid; border-top: 1px solid var(--orbit-line); margin-top: .85rem; padding-top: .5rem; }
.sidebar .sidebar-foot .text-control { min-height: var(--row-height); color: var(--orbit-muted); font-size: .8rem; }
.sidebar .chat-swipe-row { --orbit-swipe-width: 9.25rem; border-radius: 999px; }
.sidebar .chat-swipe-row::after { content: none; }
.sidebar .chat-swipe-row .orbit-list-item__face { padding: 0; min-height: var(--row-height); background: var(--orbit-surface); }
.sidebar .orbit-swipe-actions { padding: .12rem; }
.sidebar .orbit-swipe-actions button { justify-content: center; width: auto; min-height: 0; padding: .12rem; gap: .08rem; border-radius: 999px; background: var(--orbit-tonal); color: var(--orbit-on-tonal); font-size: .65rem; }
.sidebar .orbit-swipe-actions button svg { width: .95rem; height: .95rem; }

.deck { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 1.4rem 1rem; }
.queue { min-width: 0; }
.queue-head { display: flex; align-items: center; gap: .4rem; margin: 0 0 .6rem; }
.queue-head h2, .role-panel h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.025em; }
.queue-total { border-radius: 999px; padding: .07rem .4rem; background: var(--orbit-raised); color: var(--orbit-muted); font-size: .73rem; font-variant-numeric: tabular-nums; }
.queue-list .orbit-list-item__face { padding: .2rem .65rem; }
.task-card { min-width: 0; width: 100%; }
.task-card .orbit-list-item__trailing { margin-inline-start: auto; color: var(--orbit-muted); }
.task-card:hover { background: var(--orbit-raised); }
.task-copy { min-width: 0; }
.task-copy .task-name, .task-copy .task-meta { white-space: normal; overflow-wrap: anywhere; }
.task-card .task-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.28; }
.role-panel { margin-top: 1.55rem; }
.role-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .45rem; margin-top: .65rem; }
.role-card { min-width: 0; display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; text-align: start; background: var(--orbit-surface); border: 1px solid var(--orbit-line); border-radius: 1.15rem; }
.role-card:hover { background: var(--orbit-raised); }
.role-card small { display: block; color: var(--orbit-muted); font-size: .77rem; overflow-wrap: anywhere; }

.reading-chat .main { overflow: hidden; }
.chat-content {
  max-width: var(--reader-width); height: 100%; min-height: 0; padding: .8rem clamp(.7rem,2.1vw,1.9rem);
  display: flex; flex-direction: column;
}
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: .45rem; flex: none; border-bottom: 1px solid var(--orbit-line); padding-bottom: .55rem; }
.chat-header > :first-child { min-width: 0; }
.chat-header h1 { font-size: 1.08rem; margin-top: .17rem; letter-spacing: -.03em; }
.chat-header .eyebrow { font-size: .74rem; }
.chat-header-actions { display: flex; flex: none; align-items: center; gap: .1rem; }
.chat-header-actions .text-control { font-size: .75rem; color: var(--orbit-muted); }
.chat-header-actions .selected-task { display: flex; align-items: center; gap: .35rem; }
.chat-frame { min-width: 0; }
.chat-content > .chat-frame { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: .42rem; }
.chat-stream { display: grid; align-content: start; min-height: 0; gap: var(--transcript-gap); overflow: auto; overscroll-behavior: contain; }
.chat-content .chat-stream { flex: 1; padding: .95rem .18rem .52rem; }
.chat-welcome { margin: min(13vh,6rem) auto 0; padding: .6rem; display: grid; justify-items: center; gap: .25rem; text-align: center; }
.chat-welcome h2 { margin: .65rem 0 .1rem; font-size: clamp(1.5rem,4vw,2rem); line-height: 1.15; }
.chat-welcome p { color: var(--orbit-muted); font-size: .89rem; }
.welcome-mark { display: grid; place-items: center; width: 2.65rem; height: 2.65rem; background: var(--orbit-tonal); color: var(--orbit-on-tonal); border-radius: .85rem; }
.bubble { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.bubble.user { justify-self: end; width: fit-content; max-width: min(92%,38rem); padding: .55rem .85rem; border-radius: 1.15rem; background: var(--orbit-tonal); color: var(--orbit-on-tonal); }
.message-byline, .bubble > small { display: flex; align-items: center; gap: .35rem; color: var(--orbit-muted); font-size: .75rem; margin-bottom: .3rem; }
.bubble.user .message-byline { color: inherit; opacity: .75; }
.message-actions { display: flex; flex-wrap: wrap; gap: .1rem .35rem; margin-top: .15rem; }
.message-actions .text-control { padding-inline: .3rem; font-size: .76rem; }
.plain-message, .personal-chat .bubble > span { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-prose { line-height: 1.6; overflow-wrap: anywhere; }
.message-prose :is(p,ul,ol,blockquote,table) { margin: .32rem 0 .65rem; }
.message-prose :is(h1,h2,h3,h4) { font-size: 1.11em; line-height: 1.3; margin: .8rem 0 .3rem; }
.message-prose :is(ul,ol) { padding-inline-start: 1.45rem; }
.message-prose li + li { margin-top: .22rem; }
.message-prose a { text-decoration: underline; text-underline-offset: 2px; }
.message-prose blockquote { padding-inline-start: .7rem; border-inline-start: 2px solid var(--orbit-accent); color: var(--orbit-muted); }
.message-prose table { display: block; overflow: auto; max-width: 100%; border-collapse: collapse; }
.message-prose :is(th,td) { padding: .35rem .55rem; border: 1px solid var(--orbit-line); }
.message-prose :not(pre) > code { background: var(--orbit-field); border: 1px solid var(--orbit-line); border-radius: .35rem; font-size: .84em; padding-inline: .2rem; }
.code-block { border: 1px solid var(--orbit-line); border-radius: .85rem; background: var(--orbit-surface); margin-block: .65rem; overflow: hidden; }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: .15rem .6rem; border-bottom: 1px solid var(--orbit-line); color: var(--orbit-muted); font: .75rem var(--orbit-mono); }
.code-block pre { padding: .6rem; overflow: auto; white-space: pre; }
:root[data-wrap-code="true"] .code-block pre { white-space: pre-wrap; }
.assistant-wait { display: flex; align-items: center; gap: .4rem; color: var(--orbit-muted); font-size: .8rem; }
.pm-choices, .archived-banner { background: var(--orbit-surface); border: 1px solid var(--orbit-line); border-radius: 1.1rem; padding: .7rem; margin-top: .4rem; }
.pm-choices p { color: var(--orbit-muted); font-size: .87rem; margin-bottom: .42rem; }
.pm-choices .orbit-button { --button-h: 2.25rem; }
.archived-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; justify-content: space-between; }

.compose-dock { position: relative; flex: none; min-width: 0; z-index: 3; }
.composer { display: grid; gap: .42rem; }
.chat-content .composer {
  padding: .58rem .5rem .46rem; background: var(--orbit-surface); border: 0; border-radius: 1.25rem;
}
.chat-content .composer:focus-within { background: var(--orbit-field); }
.chat-content .composer[data-dragging="true"] { outline: 2px dashed var(--orbit-accent); outline-offset: 2px; }
.chat-content .composer textarea { display: block; min-height: 2.2rem; max-height: 21dvh; field-sizing: content; resize: none; border: 0; background: transparent; padding: .24rem .4rem; font-size: .93rem; outline: 0; }
.composer-toolbar, .chat-submit { display: flex; align-items: center; min-width: 0; gap: .16rem; }
.composer-toolbar .model-picker { margin-inline-start: auto; }
.composer-toolbar .attach-control, .composer-options > summary, .round-send { --button-h: 2.35rem; }
.composer-toolbar .round-send { width: var(--button-h); height: var(--button-h); padding: 0; }
.composer-toolbar .orbit-button { flex: none; }
.chat-submit { margin-inline-start: .15rem; }
.composer .input-files { max-height: 6.25rem; overflow: auto; margin: .12rem .16rem; }
.input-files { display: flex; flex-wrap: wrap; gap: .34rem; min-width: 0; }
.input-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .36rem; min-width: 0; max-width: 100%; border: 1px solid var(--orbit-rim); border-radius: .7rem; background: var(--orbit-surface); color: var(--orbit-text); }
.input-icon { width: 1.9rem; height: 1.9rem; display: grid; place-items: center; flex: none; overflow: hidden; border-radius: .46rem; background: var(--orbit-tonal); color: var(--orbit-on-tonal); }
.input-thumb { display: block; width: 100%; height: 100%; object-fit: contain; }
.input-info { min-width: 0; }
.input-info small { display: block; font-size: .66rem; color: var(--orbit-muted); }
.input-filename { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(10rem,48vw); padding: 0; min-height: 0; font-size: .77rem; }
.input-chip .icon-control { --button-h: 1.6rem; }
.input-chip.image-draft { position: relative; display: block; padding: 0; width: 5.2rem; height: 4.9rem; overflow: hidden; }
.image-draft .input-icon { width: 100%; height: 100%; border-radius: 0; background: var(--orbit-field); }
.image-draft .input-info { position: absolute; inset: auto 0 0; padding: .08rem .2rem; background: #090b10ed; color: #fff; }
.image-draft .input-filename { font-size: .63rem; }
.image-draft .icon-control { position: absolute; top: .1rem; right: .1rem; --button-h: 1.45rem; color: #fff; background: #090b10dd; }
.image-draft .icon-control svg { width: .85rem; height: .85rem; }
.image-sent { display: grid; }
.image-sent .input-icon { width: min(6.9rem,38vw); height: 5.1rem; }
:is(.image-draft,.image-sent) .input-info small { display: none; }

.model-picker { position: relative; min-width: 0; flex: 0 1 auto; }
.model-trigger { display: flex; align-items: center; gap: .3rem; padding: .3rem .45rem; min-width: 0; max-width: 100%; min-height: 2.15rem; border-radius: 999px; background: transparent; color: var(--orbit-text); font-size: .77rem; line-height: 1.2; white-space: nowrap; }
.model-trigger:hover, .model-trigger[aria-expanded="true"] { background: var(--orbit-raised); }
.model-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.model-effort, .model-trigger svg { color: var(--orbit-muted); }
.model-tip { display: none; position: absolute; right: 0; bottom: calc(100% + .25rem); white-space: nowrap; padding: .24rem .5rem; pointer-events: none; }
.model-trigger[aria-expanded="false"]:is(:hover,:focus-visible) + .model-tip { display: flex; }
.model-popover {
  position: absolute; inset-inline-end: 0; bottom: calc(100% + .34rem); z-index: 22; width: min(13.75rem,78vw);
  max-height: min(18rem,48dvh); padding: .42rem .6rem; text-align: center; border-radius: .98rem;
}
.model-list-open { display: flex; flex-direction: column; width: min(15.1rem,81vw); padding: .3rem; }
.effort-value { display: block; color: var(--orbit-on-tonal); font-size: .86rem; line-height: 1.2; }
.model-setting { display: inline-flex; align-items: center; gap: .06rem; padding: .18rem .26rem; color: var(--orbit-muted); border-radius: 999px; font-size: .75rem; line-height: 1.2; }
.model-setting:hover { background: var(--orbit-raised); color: var(--orbit-text); }
.effort-rail { height: 1.25rem; margin-block: .28rem .22rem; border-radius: 999px; isolation: isolate; }
.effort-dots.orbit-slider__track {
  position: absolute; inset: 0; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 .58rem;
  background: var(--orbit-raised); pointer-events: none;
}
.effort-rail::before {
  content: ""; z-index: 1; position: absolute; inset: 0; background: var(--orbit-accent); border-radius: inherit;
  clip-path: inset(0 max(0px,calc(100% - var(--effort-progress,0%) - .45rem)) 0 0); pointer-events: none;
}
.effort-dots.orbit-slider__track span { width: 4px; height: 4px; flex: none; border-radius: 50%; background: var(--orbit-muted); opacity: .65; }
.effort-dots.orbit-slider__track span.past { z-index: 2; background: var(--orbit-on-accent); opacity: .55; }
.effort-thumb {
  position: absolute; z-index: 3; pointer-events: none; top: 50%;
  inset-inline-start: clamp(.64rem,var(--effort-progress,0%),calc(100% - .64rem)); translate: -50% -50%;
  width: 1.28rem; height: 1.28rem; border-radius: 50%; background: #f4f6ff;
  border: 1px solid #96a1ca90; box-shadow: 0 1px 3px #0005;
}
.effort-rail > .effort-slider { z-index: 4; display: block; }
.effort-rail:has(input:focus-visible) { outline: none; }
.effort-rail:has(input:focus-visible) .effort-thumb { outline: 2px solid var(--orbit-focus); outline-offset: 2px; }
.model-list-heading { display: flex; align-items: center; gap: .3rem; text-align: start; padding: .1rem .2rem .25rem; font-size: .82rem; }
.model-back { display: grid; place-items: center; color: var(--orbit-muted); border-radius: 999px; width: 1.6rem; height: 1.6rem; padding: 0; }
.model-back:hover, .model-option:hover, .orbit-menu__item:hover { background: var(--orbit-raised); }
.model-choices { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.model-option { width: 100%; min-height: 2rem; justify-content: space-between; padding: .25rem .4rem; font-size: .8rem; text-align: start; }
.model-option[aria-pressed="true"] { background: var(--orbit-tonal); color: var(--orbit-on-tonal); }

.composer-queue { position: relative; display: grid; gap: .16rem; margin: 0 .36rem -.08rem; max-height: min(20dvh,9rem); overflow: auto; overscroll-behavior: contain; }
.queued-note { min-width: 0; border: 1px solid var(--orbit-line); background: var(--orbit-surface); border-radius: .85rem; padding: .15rem .23rem .15rem .45rem; }
.queued-line, .queued-tools { display: flex; align-items: center; gap: .2rem; min-width: 0; }
.queued-line > svg, .queue-icon, .queue-steer { color: var(--orbit-muted); }
.queue-caption { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .79rem; }
.queue-icon, .queue-steer { display: flex; align-items: center; justify-content: center; gap: .2rem; min-height: 1.95rem; padding: .16rem .25rem; border-radius: 999px; cursor: pointer; }
.queue-icon { width: 1.95rem; padding: 0; }
.queue-steer { font-size: .75rem; }
.queue-steer:hover, .queue-icon:hover { background: var(--orbit-raised); color: var(--orbit-text); }
.queue-steer span { white-space: nowrap; }
.queue-edit { display: grid; gap: .3rem; padding-top: .3rem; }
.queue-edit textarea { min-height: 2.6rem; max-height: 20dvh; }
.queue-edit .row-actions { justify-content: end; }
.queue-edit .orbit-button { --button-h: 2rem; }
:is(.queue-menu,.chat-menu,.composer-options) { position: relative; }
:is(.queue-menu,.chat-menu,.composer-options) > summary { list-style: none; cursor: pointer; }
:is(.queue-menu,.chat-menu,.composer-options) > summary::-webkit-details-marker { display: none; }
:is(.queue-popover,.chat-menu-actions,.composer-options .options) { position: absolute; min-width: min(14.2rem,84vw); max-width: min(17rem,90vw); padding: .3rem; }
.queue-popover { position: fixed; inset: auto; }
.chat-menu-actions { right: 0; top: calc(100% + .3rem); }
.composer-options .options { left: 0; bottom: calc(100% + .3rem); }
:is(.queue-popover,.chat-menu-actions,.composer-options) .orbit-menu__item { width: 100%; text-align: start; font-size: .82rem; min-height: 2.33rem; }
.composer-options .options .orbit-choice { display: flex; gap: .4rem; font-size: .82rem; padding-inline: .5rem; }
.composer-options .options .orbit-choice:hover { background: var(--orbit-raised); border-radius: .65rem; }

.activity-group { min-width: 0; padding: .45rem .62rem; border: 1px solid var(--orbit-line); border-radius: 1.08rem; background: var(--orbit-surface); }
.activity-group > summary, .terminal-event > summary { display: flex; align-items: center; gap: .38rem; list-style: none; cursor: pointer; min-width: 0; outline-offset: 1px; }
.activity-group > summary { min-height: 1.75rem; font-size: .8rem; color: var(--orbit-muted); }
.activity-group > summary::-webkit-details-marker, .terminal-event > summary::-webkit-details-marker { display: none; }
.activity-group[open] > summary > svg:last-child, .terminal-event[open] summary > svg:last-child { transform: rotate(180deg); }
.run-dot { display: grid; place-items: center; color: var(--orbit-success); }
.activity-group[data-running="true"] .run-dot { color: var(--orbit-on-tonal); }
.run-clock { min-width: 0; overflow-wrap: anywhere; }
.run-count { margin-inline-start: auto; white-space: nowrap; color: var(--orbit-muted); font-size: .69rem; }
.activity-items { display: grid; min-width: 0; gap: .28rem; margin-top: .22rem; }
.event { min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--orbit-line); border-radius: .75rem; padding: .46rem; background: var(--orbit-surface); }
.activity-items .event { border: 0; padding: .2rem .15rem; }
.event small, .event-tools summary { color: var(--orbit-muted); font-size: .78rem; }
.event small { display: block; margin-bottom: .14rem; }
.event-tools { min-width: 0; padding: .42rem .58rem; background: var(--orbit-surface); border: 1px solid var(--orbit-line); border-radius: .73rem; }
.event-tools summary { cursor: pointer; overflow-wrap: anywhere; }
.event-tools pre { max-height: min(16rem,55dvh); overflow: auto; padding-top: .45rem; }
.terminal-event { padding: 0; background: var(--orbit-field); }
.terminal-event > summary { padding: .35rem .45rem; border-radius: .65rem; }
.terminal-event > summary:hover { background: var(--orbit-raised); }
.activity-title { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.terminal-event time, .usage { color: var(--orbit-muted); font-size: .69rem; overflow-wrap: anywhere; }
.terminal-body { padding: .25rem .53rem .4rem; border-top: 1px solid var(--orbit-line); }
.command-line { color: var(--orbit-on-tonal); }
.terminal-exit { color: var(--orbit-danger); }
.command-start { display: flex; align-items: center; gap: .32rem; color: var(--orbit-muted); font-size: .77rem; }
.older-events { justify-self: center; }
.chat-results { display: grid; min-width: 0; gap: .45rem; }
.preview-card, .result-files, .personal-results, .source-box { background: var(--orbit-surface); border: 1px solid var(--orbit-line); border-radius: 1.2rem; min-width: 0; }
.preview-card, .files-header { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; }
.preview-card > svg, .files-header > svg { color: var(--orbit-on-tonal); }
.preview-card > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.preview-card > .orbit-button { --button-h: 2rem; padding-inline: .65rem; font-size: .77rem; }
.result-files > .hint { margin: .6rem; }
.files-header { font-size: .88rem; }
.files-header .change-count { display: flex; font-size: .76rem; }
.file-rows { border-radius: 0 0 1.2rem 1.2rem; overflow: hidden; }
.file-row, .file-more { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .38rem .65rem; min-height: 2.3rem; width: 100%; text-align: start; border-top: 1px solid var(--orbit-line); font-size: .8rem; }
.file-row > span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-more, .live-files .file-row { justify-content: start; }
.file-more { color: var(--orbit-muted); }
.live-files .file-row { overflow-wrap: anywhere; }
.file-row:hover, .file-more:hover { background: var(--orbit-raised); }
.change-count { display: inline-flex; gap: .32rem; white-space: nowrap; font-family: var(--orbit-mono); }
.added { color: var(--orbit-success); }
.removed { color: var(--orbit-danger); }

.detail { background: var(--orbit-surface); border-inline-start: 1px solid var(--orbit-line); padding: .85rem clamp(.75rem,1.35vw,1.25rem); outline: none; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.detail-head strong { font-size: 1.12rem; }
.detail h2 { margin: .5rem 0; line-height: 1.15; overflow-wrap: anywhere; }
.detail h3 { font-size: .94rem; }
.detail .row-actions { margin-block: .5rem; }
.detail .orbit-button { --button-h: 2.2rem; padding-inline: .7rem; font-size: .8rem; }
.detail .icon-control { padding: 0; }
.detail-tabs { margin: .45rem 0 .85rem; }
.detail-tabs .detail-tab { min-height: 2.25rem; }
.detail-tabs button[data-current="true"] { background: var(--orbit-accent); color: var(--orbit-on-accent); border-radius: 999px; font-weight: 650; }
.steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .2rem; margin-block: .62rem; }
.steps span { border-top: 3px solid var(--orbit-rim); padding-top: .24rem; color: var(--orbit-muted); font-size: .7rem; overflow-wrap: anywhere; }
.steps .done { border-color: var(--orbit-success); }
.steps .current { border-color: var(--orbit-accent); color: var(--orbit-on-tonal); }
.branch { display: block; padding: .38rem .5rem; border-radius: .65rem; color: var(--orbit-on-tonal); background: var(--orbit-tonal); overflow-wrap: anywhere; font-size: .76rem; }
.detail-list { display: grid; gap: .35rem; }
.edit-composer { margin-block: .6rem; }
.detail:has(.detail-head) .empty { padding-inline: 0; }
.sheet-backdrop { position: fixed; z-index: 25; inset: 0; background: #0009; border-radius: 0; }

.personal-search { display: flex; gap: .5rem; flex-wrap: wrap; margin: .9rem 0 1.25rem; align-items: center; }
.personal-search .orbit-search { min-width: min(100%,15rem); flex: 1; }
.personal-results, .source-box { padding: .75rem; margin-block: .5rem 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.personal-item-copy { display: flex; flex-wrap: wrap; align-items: center; gap: .22rem .5rem; min-width: 0; flex: 1; padding-block: .3rem; }
.personal-item-copy .task-copy { flex: 1 1 11rem; }
.personal-items .orbit-list-item__face { gap: .65rem; }
.personal-chat { margin-top: 1.4rem; }
.personal-chat .chat-frame { display: grid; gap: .6rem; }
.personal-chat .chat-stream { max-height: 23rem; min-height: 3.4rem; padding: .75rem; border: 1px solid var(--orbit-line); border-radius: 1.2rem; background: var(--orbit-surface); }
.personal-chat .composer .orbit-button { justify-self: start; }

.settings-content { max-width: 54rem; }
.settings-form { display: grid; gap: 1.2rem; margin-top: 1rem; }
.settings-group h2 { font-size: 1rem; margin: 0 0 .48rem .12rem; }
.settings-group .setting-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .42rem .85rem; min-width: 0; padding: .46rem .77rem; min-height: 3.1rem; }
.setting-copy { min-width: 0; }
.setting-copy strong { font-size: .88rem; overflow-wrap: anywhere; }
.setting-copy small { display: block; font-size: .75rem; color: var(--orbit-muted); overflow-wrap: anywhere; }
.setting-select { position: relative; min-width: 0; max-width: min(17rem,48vw); }
.setting-select select { width: 100%; appearance: none; padding-inline: .62rem 1.8rem; font-size: .85rem; }
.setting-select > svg { position: absolute; inset-inline-end: .56rem; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--orbit-muted); }
.settings-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.settings-status { color: var(--orbit-muted); font-size: .83rem; }

.login-wrap { min-height: calc(var(--app-height) - var(--topbar-height)); display: grid; place-items: center; padding: 1.05rem; }
.login-card { width: min(100%,27rem); padding: clamp(1rem,4vw,1.7rem); }
.login-card h1 { font-size: clamp(1.85rem,8vw,2.5rem); margin: .65rem 0 .28rem; line-height: 1.08; letter-spacing: -.045em; }
.login-card p { color: var(--orbit-muted); }
.login-card form { display: grid; gap: .65rem; margin-block: .9rem .65rem; }
.login-card #login-status:not(:empty) { margin-top: .6rem; color: var(--orbit-danger); font-size: .85rem; }
.orbit-dialog { inset: 50% auto auto 50%; margin: 0; width: min(29rem,calc(100% - 1.3rem)); max-height: calc(100dvh - 1.3rem); }
.orbit-dialog::backdrop { background: #000a; }
.orbit-dialog .row-actions { margin-top: .6rem; }
.orbit-dialog > .dialog-heading { margin-bottom: .45rem; }
.orbit-dialog h2 { overflow-wrap: anywhere; line-height: 1.2; }
#dialog-input { width: 100%; }
.dialog-heading .orbit-button { --button-h: 2.45rem; }
.search-dialog { width: min(39rem,calc(100% - 1.3rem)); }
.search-results { display: grid; max-height: min(32rem,53dvh); overflow: auto; margin-top: .65rem; }
.search-result { display: grid; gap: .16rem; width: 100%; min-height: 3rem; border-radius: .65rem; padding: .46rem .65rem; text-align: start; }
.search-result + .search-result { border-top: 1px solid var(--orbit-line); }
.search-result:hover { background: var(--orbit-raised); }
.search-result :is(small,span) { color: var(--orbit-muted); font-size: .79rem; overflow-wrap: anywhere; }
.search-result strong { overflow-wrap: anywhere; }
.preview-dialog { width: min(81rem,calc(100% - 1rem)); }
.preview-frame { display: block; width: 100%; height: min(76dvh,54rem); border-radius: .9rem; border: 1px solid var(--orbit-line); background: var(--orbit-surface); }
.diff-dialog { width: min(62rem,calc(100% - 1rem)); }
.diff-output { overflow: auto; max-height: 68dvh; padding: .3rem; border-radius: .75rem; white-space: pre; background: var(--orbit-field); }
.diff-line { display: block; min-height: 1em; padding-inline: .45rem; min-width: max-content; }
.diff-line.added { background: color-mix(in srgb,var(--orbit-success) 12%,var(--orbit-field)); }
.diff-line.removed { background: color-mix(in srgb,var(--orbit-danger) 12%,var(--orbit-field)); }
.diff-line.hunk { color: var(--orbit-on-tonal); }
.toast { position: fixed; z-index: 50; right: .65rem; bottom: calc(var(--dock-space) + .6rem); max-width: min(28rem,calc(100% - 1.3rem)); padding: .6rem .8rem; background: var(--orbit-elevated); border: 1px solid var(--orbit-rim); border-radius: 1rem; box-shadow: 0 8px 28px #0006; }

@media (max-width: 1050px) {
  .layout:has(.detail:not([hidden])) .deck, .layout:has(.detail:not([hidden])) .role-grid { grid-template-columns: 1fr; }
}
@media (max-width: 879px) {
  :root { --topbar-height: 7.2rem; }
  .topbar { align-content: center; }
  .topbar:has(#section-dock[hidden]) { height: 3.55rem; }
  .brand-lockup { gap: .32rem; }
  .layout, .layout:has(.detail:not([hidden])) { grid-template-columns: minmax(0,1fr); }
  .main { grid-column: 1; }
  .sidebar {
    display: none; position: fixed; z-index: 26; top: 0; bottom: 0; inset-inline-start: 0;
    width: min(20rem,calc(100% - 2.65rem)); padding-top: max(.8rem,env(safe-area-inset-top));
    border-radius: 0 1.4rem 1.4rem 0; box-shadow: 0 3px 25px #0007;
  }
  .layout.navigation-open .sidebar { display: block; }
  .detail {
    position: fixed; z-index: 26; inset: auto 0 0; width: min(36rem,100%);
    max-height: min(84dvh,46rem); margin-inline: auto; padding: .55rem .8rem max(.8rem,env(safe-area-inset-bottom));
    border: 1px solid var(--orbit-rim); border-radius: 1.4rem 1.4rem 0 0;
  }
  .detail::before { display: block; content: ""; width: 2rem; height: .25rem; margin: 0 auto .32rem; border-radius: 999px; background: var(--orbit-edge); }
}
@media (max-width: 599px) {
  :root { --topbar-height: 3.55rem; --dock-space: calc(6.55rem + env(safe-area-inset-bottom)); }
  .topbar { padding-inline: .48rem .68rem; }
  .topbar .orbit-adaptive-navigation__dock { bottom: calc(.62rem + env(safe-area-inset-bottom)); }
  .topbar .orbit-adaptive-navigation__fade { --orbit-edge-fade-size: calc(var(--dock-space) + .25rem); }
  .software-keyboard .topbar .orbit-adaptive-navigation__fade { display: none; }
  .main { padding-bottom: var(--dock-space); }
  .sidebar .side-option, .sidebar .sidebar-foot button { min-height: 3rem; }
  .orbit-side-nav .sidebar-head .new-chat, .orbit-side-nav .sidebar-head .rail-search { min-height: 3rem; }
  .content { padding: 1rem .85rem; }
  .deck { grid-template-columns: 1fr; gap: 1.1rem; }
  .role-grid { grid-template-columns: 1fr; }
  .role-card, .orbit-button.primary, .login-card .orbit-button { min-height: 3rem; }
  .chat-content { padding: .48rem .5rem .3rem; }
  .chat-header { padding-bottom: .25rem; }
  .chat-header-actions .text-control:not(.selected-task) { display: none; }
  .chat-content .composer { padding: .38rem .37rem .3rem; }
  .chat-content .composer textarea { font-size: max(16px,.94rem); min-height: 1.95rem; }
  .composer-toolbar .orbit-button, .composer-toolbar .round-send { --button-h: 3rem; }
  .model-trigger { font-size: .72rem; padding-inline: .31rem; gap: .16rem; min-height: 2.6rem; }
  .model-popover { max-height: min(16rem,52dvh); }
  .queue-steer span { max-width: 5.9rem; overflow: hidden; text-overflow: ellipsis; }
  .settings-group .setting-row:has(.setting-select, .model-picker) { grid-template-columns: minmax(0,1fr); }
  .setting-select { max-width: 100%; }
  .settings-group .model-trigger { min-height: 2.1rem; max-width: 100%; }
  .settings-group .model-popover { inset-inline: 0 auto; }
  .preview-card { flex-wrap: wrap; }
  .preview-card > .orbit-button { max-width: 100%; }
  .settings-footer .orbit-button, .personal-search .orbit-button { min-height: 2.75rem; }
  .personal-search .orbit-search { flex-basis: 100%; }
  .login-card input, .personal-search input, .search-dialog input { font-size: max(16px,.94rem); }
}
@media (max-width: 359px), (max-width: 599px) and (max-height: 670px) {
  :root { --dock-space: calc(4.95rem + env(safe-area-inset-bottom)); }
  .topbar .orbit-tabbar .orbit-tab { gap: .32rem; min-height: 3rem; padding-inline: .55rem; }
  .model-trigger .model-effort { display: none; }
  .queue-steer span { max-width: 4.45rem; }
}
:root.software-keyboard { --dock-space: 0px; }
@media (max-width: 599px) and (max-height: 460px) {
  .chat-welcome { margin-top: 0; }
  .composer .input-files { max-height: 4rem; }
}

.sidebar .chat-list[data-variant="flat"] .chat-swipe-row .orbit-list-item__face { background: var(--orbit-surface); }
.chat-swipe-row:not([data-swipe-open="true"]):not([data-swiping="true"]) .orbit-swipe-actions { visibility: hidden; }
.model-popover { translate: var(--model-shift,0px) 0; }
@media (max-width: 359px) {
  .queue-steer span { display: none; }
  .queue-steer { width: 2rem; }
  .selected-task { justify-content: center; width: 2.4rem; min-height: 2.75rem; }
  .selected-task span { display: none; }
  .queue-caption { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; }
}

@media (max-width: 879px) { .detail-head { position: sticky; top: -.55rem; z-index: 1; background: var(--orbit-surface); } }

.sidebar-sheet-head { display: none; }
@media (max-width: 879px) {
  .sidebar-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: .4rem; padding-inline: .2rem; margin-bottom: .5rem; }
  .sidebar .sidebar-sheet-head .orbit-button { --button-h: 2.75rem; width: var(--button-h); justify-content: center; padding: 0; }
}
