/* The owner’s desk stays in the page flow; only its trip to the toolbar is fixed. */
.bodywrap:has(#workbench-slot) > .topbar {
  position: sticky;
  top: 0;
  z-index: 6;
}
#workbench-dock {
  width: 38px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: var(--primary);
  background: #24211d;
  border: 1px solid #514434;
  border-radius: 7px;
}
#workbench-slot {
  overflow-anchor: none;
}
#workbench-slot.is-folded {
  height: 0;
}
#workbench-dock[hidden],
.owner-workbench[hidden] {
  display: none;
}
.owner-workbench {
  color: var(--foreground);
  background: #12151b;
  border: 1px solid #37383c;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--topbar-height) - var(--main-padding-top));
}
.owner-workbench button {
  color: inherit;
}
.owner-workbench button,
.owner-workbench textarea {
  font-family: var(--font-sans);
}
.owner-workbench button:focus-visible,
#workbench-dock:focus-visible {
  outline-offset: -2px;
}
.owner-workbench button:disabled {
  cursor: default;
}
.wb-titlebar,
.wb-titlebar > div,
.wb-sidehead,
.wb-group,
.wb-thread,
.wb-tool,
.wb-compose-actions,
.wb-scope,
.wb-answer strong,
.wb-ref,
.wb-starters button {
  display: flex;
  align-items: center;
}
.wb-titlebar {
  background: #181b20;
  flex: 0 0 46px;
  padding: 0 18px 0 8px;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.wb-titlebar > div {
  gap: 2px;
}
.wb-genie {
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}
.wb-genie-strip {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
  contain: strict;
}
.wb-titlebar h1 {
  font: 600 15px/1.3 var(--font-sans);
  letter-spacing: 0.01em;
}
.wb-engine,
.wb-sidehead h2,
.wb-tools h2,
.wb-compose-actions {
  font-variant-numeric: tabular-nums;
}
.wb-engine {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-foreground);
  font-size: 12px;
}
.wb-engine::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}
.wb-min,
.wb-sidehead button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 5px;
}
.wb-min span {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ffbd2e;
  color: #5d4005;
}
.wb-min span svg {
  stroke-width: 2.5;
}
.wb-min:hover span,
.wb-min:focus-visible span {
  background: #ffcd60;
}
.wb-min:active span {
  background: #e6a424;
}
.wb-sidehead button:hover {
  background: var(--border);
}
.wb-columns {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: clamp(175px, 15vw, 222px) minmax(0, 1fr) clamp(
      169px,
      14vw,
      208px
    );
}
.wb-projects,
.wb-tools {
  background: #101319;
  min-height: 0;
}
.wb-projects {
  display: flex;
  flex-direction: column;
  padding: 12px 9px;
  border-right: 1px solid var(--border);
}
.wb-sidehead {
  justify-content: space-between;
  padding: 0 2px 5px 8px;
}
.wb-sidehead h2,
.wb-tools h2 {
  font: 600 13px/1.5 var(--font-sans);
  color: #b7bec5;
  letter-spacing: 0;
}
.wb-sidehead button {
  color: var(--muted-foreground);
}
.wb-tree,
.wb-tools,
.wb-history {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3b4048 transparent;
}
.wb-tree {
  min-height: 0;
}
.wb-group,
.wb-thread,
.wb-tool {
  text-align: left;
  gap: 8px;
  width: 100%;
  min-height: 37px;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 13px;
  line-height: 1.45;
}
.wb-group svg,
.wb-thread svg,
.wb-tool svg {
  flex: none;
  color: var(--muted-foreground);
}
.wb-group svg:last-child {
  margin-left: auto;
  width: 12px;
}
.wb-group span,
.wb-thread span,
.wb-scope {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-threads {
  margin: 0 1px 5px 15px;
  padding-left: 9px;
  border-left: 1px solid #37383b;
}
.wb-thread {
  min-height: 32px;
  font-size: 12px;
}
.owner-workbench .wb-thread[aria-current] {
  background: #2b2722;
  color: #ecd4a7;
}
.wb-thread[aria-current] svg {
  color: #dbbc88;
}
.wb-group:hover,
.wb-thread:hover,
.wb-tool:hover {
  background: #20242b;
}
.wb-tools {
  padding: 18px 11px;
  border-left: 1px solid var(--border);
}
.wb-tools h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 8px;
  margin: 0 0 9px;
}
.wb-tools h2 span {
  font: 12px var(--font-sans);
  color: #939ca6;
}
.wb-tool {
  min-height: 38px;
}
.wb-tool svg {
  color: #c6b79a;
}
.wb-tool small {
  margin-left: auto;
  font-size: var(--type-caption);
  color: var(--muted-foreground);
  white-space: nowrap;
}
.wb-connectors {
  border-top: 1px solid var(--border);
  margin: 14px 0 0;
  padding-top: 18px;
}
.wb-connectors svg {
  color: #a1b8ba;
}
.wb-chat {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(16px, 2.25vw, 38px) 20px;
}
.wb-current-title:not([hidden]) {
  padding: 10px 0 9px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  font: 600 13px/1.5 var(--font-sans);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.wb-history {
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 18px 0;
}
.wb-history.is-empty {
  display: grid;
  align-items: center;
  text-align: center;
}
.wb-welcome {
  padding: 8px 0;
}
.wb-welcome img {
  display: block;
  margin: 0 auto 14px;
  width: 41px;
  height: 43px;
}
.wb-welcome h2 {
  font-size: var(--type-feature);
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0;
}
.wb-welcome p {
  font-size: 13px;
  line-height: 1.55;
  color: #a6afb7;
  margin: 8px 0 0;
}
.wb-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 20px;
}
.wb-starters button {
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #343940;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}
.owner-workbench .wb-starters button {
  color: #c1c8ce;
}
.wb-starters button:hover {
  border-color: #746650;
  background: #202126;
}
.wb-question {
  width: fit-content;
  max-width: 86%;
  margin: 0 0 17px auto;
  padding: 9px 14px;
  border-radius: 12px 12px 3px 12px;
  background: #292c32;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wb-answer {
  margin: 0 0 23px;
  font-size: 14px;
}
.wb-answer strong {
  gap: 7px;
  font-weight: 600;
  color: var(--primary);
}
.wb-answer p {
  color: #e0e2df;
  line-height: 1.7;
  margin: 6px 0 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wb-answer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.wb-ref {
  gap: 4px;
  font-size: 12px;
  color: var(--primary);
}
.wb-ref:hover {
  text-decoration: underline;
}
.wb-compose {
  margin: 0;
  padding: 10px 12px 9px;
  border: 1px solid #41434a;
  border-radius: 12px;
  background: #1c2027;
}
.wb-compose:focus-within {
  border-color: #a88b62;
}
.wb-compose textarea {
  display: block;
  width: 100%;
  min-height: 38px;
  height: 42px;
  resize: none;
  outline: none;
  border: 0;
  padding: 3px 2px;
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.45;
}
.wb-compose textarea::placeholder {
  color: #adb3ba;
}
.wb-compose-actions {
  justify-content: space-between;
  gap: 8px;
}
.wb-scope {
  gap: 6px;
  color: #bcc0c3;
  font-size: 12px;
}
.wb-send {
  flex: none;
  height: 32px;
  width: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
}
.owner-workbench .wb-send {
  color: #221d18;
}
.wb-send svg {
  transform: rotate(-90deg);
}
.wb-send:disabled {
  background: #363b43;
}
.owner-workbench .wb-send:disabled {
  color: #a7afb6;
}
.wb-switch {
  display: none;
}
@media (max-width: 1170px) and (min-width: 1024px) {
  .wb-columns {
    grid-template-columns: 165px minmax(0, 1fr) 158px;
  }
  .wb-chat {
    padding-inline: 15px;
  }
  .wb-tools {
    padding-inline: 6px;
  }
}
@media (max-width: 760px) {
  .wb-switch {
    display: flex;
    gap: 4px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
  }
  .wb-switch button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    border-radius: 5px;
    font-size: 13px;
  }
  .owner-workbench .wb-switch button[aria-pressed="true"] {
    background: #28272a;
    color: #ecd4aa;
  }
  .wb-columns {
    display: flex;
    min-height: 0;
  }
  .wb-columns > * {
    width: 100%;
    border: 0;
  }
  .owner-workbench:not([data-pane="projects"]) .wb-projects,
  .owner-workbench:not([data-pane="chat"]) .wb-chat,
  .owner-workbench:not([data-pane="tools"]) .wb-tools {
    display: none;
  }
  .wb-sidehead,
  .wb-tools {
    padding-inline: 14px;
  }
  .wb-chat {
    padding: 0 13px 13px;
  }
  .wb-compose {
    /* Leave the send button beside the floating assistant, not behind it. */
    margin-inline-end: 56px;
  }
  .wb-group,
  .wb-thread,
  .wb-tool,
  .wb-min,
  .wb-sidehead button,
  .wb-send,
  .wb-starters button,
  .wb-switch button {
    min-height: 44px;
  }
  .wb-min,
  .wb-send,
  .wb-sidehead button {
    width: 44px;
  }
  .wb-send {
    border-radius: 9px;
  }
  .wb-welcome img {
    width: 33px;
    height: 35px;
    margin-bottom: 10px;
  }
  .wb-starters {
    margin-top: 12px;
  }
  .wb-starters button {
    padding: 5px 8px;
  }
  .wb-compose textarea {
    font-size: 16px;
  }
  #workbench-dock {
    height: 44px;
    width: 44px;
  }
  .bodywrap:has(#workbench-dock:not([hidden])) .exhibitshortcut {
    display: none;
  }
  .wb-titlebar {
    padding-right: 12px;
  }
}

/* Project conversations use the same desk, with the next handoff always in view. */
.wb-project-desk .wb-titlebar { min-height:49px; padding-inline:16px; }
.wb-project-desk .wb-titlebar > div { gap:9px; }
.wb-project-desk .wb-titlebar > div > svg { color:var(--primary); }
.wb-project-desk .wb-title-actions { gap:16px; }
.wb-create { display:inline-flex; align-items:center; gap:5px; padding:6px 10px; border:1px solid #584b38; border-radius:6px; font-size:13px; }
.wb-project-desk .wb-create { color:var(--primary); }
.wb-project-context { padding:18px 0 13px; border-bottom:1px solid var(--border); }
.wb-project-label,.wb-project-status { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 10px; }
.wb-project-label span { color:var(--primary); font:13px var(--chart-numerals); }
.wb-project-label strong { font:600 var(--type-section)/1.35 var(--display); }
.wb-project-status { margin-top:6px; color:var(--muted-foreground); font-size:13px; }
.wb-project-status span+span { border-inline-start:1px solid var(--border); padding-inline-start:10px; }
.wb-project-status b { font-weight:500; color:var(--success); }
.wb-project-desk .wb-group[aria-current] { color:var(--primary); }
.wb-project-references { padding:0; border:0; }
.wb-project-references summary { padding:4px 0; cursor:pointer; font-size:13px; color:var(--primary); }
.wb-project-references > div { display:flex; flex-wrap:wrap; gap:6px; }
.wb-project-desk .wb-current-title { color:var(--muted-foreground); font-weight:500; }
@media(max-width:760px) {
  .wb-project-desk .wb-compose { margin-inline-end:0; }
  .wb-project-context { padding:10px 0; }
  .wb-project-desk .wb-create,.wb-project-references summary { min-height:44px; }
  .wb-project-references summary { padding-block:10px; }
}
