:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #efeff1;
  background: #101011;
  --surface: #151517;
  --sidebar: #1b1b1c;
  --panel: #29292b;
  --line: #343436;
  --muted: #adaeb1;
  --subtle: #929397;
  --blue: #7aaaff;
  /* Dark conversation colors from the installed Harness theme. */
  --chat-text: #f9fafb;
  --chat-secondary: #cfd3d6;
  --chat-tertiary: #adb2b8;
  --chat-bubble: #2c2c2e;
  --chat-code: #1b1b1c;
  --chat-divider: rgb(255 255 255 / 12%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p { margin: 0; }
button, a { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.page-footer { padding: 9px 16px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
.workspace { --demo-height: max(550px, calc(100svh - 39px)); display: grid; grid-template-columns: 248px minmax(0, 1fr); min-width: 0; background: var(--surface); }
.sidebar { display: flex; flex-direction: column; min-width: 0; padding: 6px 10px 10px; background: var(--sidebar); border-right: 1px solid var(--line); }
.sidebar-brand { display: flex; gap: 5px; align-items: center; padding: 0 6px; height: 53px; }
.sidebar-brand img { display: block; }
.new-session { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; margin: 1px 2px 19px; border: 1px solid #53545a; border-radius: 8px; background: #3d3e43; font-size: 14px; }
.new-session:disabled { opacity: .65; }
.new-session:hover:not(:disabled) { background: #4c4d53; }
.sidebar-label { padding: 10px 9px 7px; color: var(--muted); font-size: 13px; }
.project { display: flex; gap: 6px; align-items: center; padding: 7px 9px; font-weight: 500; font-size: 14px; }
.project .icon { color: var(--blue); }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 12px; }
.sidebar-foot a { padding: 5px 7px; }
.sidebar-foot a:hover { color: var(--blue); }
.session-list { display: grid; gap: 2px; }
.session { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; min-height: 32px; border-radius: 6px; text-align: left; padding: 4px 12px 4px 31px; font-size: 13px; white-space: nowrap; }
.session[aria-current], .session:hover { background: #303032; }
.session-name, .conversation-header h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.session-trailing { display: flex; flex: none; align-items: center; gap: 5px; color: var(--subtle); }
.session-trailing .pin-mark { width: 14px; height: 14px; }
.archived-sessions { margin: 10px 7px; padding: 6px 0; color: var(--muted); font-size: 12px; }
.archived-sessions summary { cursor: pointer; }
.archived-sessions ul { margin: 6px 0 0; padding-inline-start: 20px; line-height: 1.8; }
.reset-button { margin-top: auto; align-self: flex-start; border-radius: 6px; min-height: 32px; padding: 4px 8px; color: var(--muted); font-size: 12px; }
.reset-button:hover:not(:disabled) { background: #303032; }
.reset-button:disabled { opacity: .72; }
.reset-button span { margin-right: 3px; }

.conversation {
  --thread-inset: clamp(10px, calc((100vw - 700px) / 4), 73px);
  --thread-width: min(680px, calc(100% - 2 * var(--thread-inset)));
  min-width: 0;
  height: var(--demo-height);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.conversation-header { position: relative; display: flex; align-items: center; gap: 12px; min-height: 41px; padding: 2px 24px 0; }
.conversation-header h2 { font-size: 14px; font-weight: 620; white-space: nowrap; }
.play-button { display: inline-flex; flex: none; min-height: 28px; align-items: center; justify-content: center; gap: 5px; padding: 3px 7px; border-radius: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.play-button:hover { background: #303032; color: #efeff1; }
.play-button { margin-inline-start: auto; }
.mode { color: var(--muted); font-size: 12px; white-space: nowrap; }
.view-tabs { display: flex; gap: 17px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.view-tabs button { min-height: 32px; padding: 1px 0 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; }
.view-tabs [aria-pressed=true] { color: var(--blue); border-bottom-color: var(--blue); }
.collaboration { position: relative; }
.expert-toggle { display: flex; gap: 4px; align-items: center; min-height: 28px; padding: 2px 4px; color: #c9c9cd; border-radius: 5px; font-size: 12px; white-space: nowrap; }
.expert-toggle:hover, .expert-toggle[aria-expanded=true] { background: #29292c; }
.chevron { width: 5px; height: 5px; margin: 0 3px 2px; transform: rotate(45deg); border: solid var(--subtle); border-width: 0 1px 1px 0; }
.expert-toggle[aria-expanded=true] .chevron { transform: rotate(225deg); margin-bottom: -2px; }
.expert-panel { position: absolute; top: calc(100% + 3px); left: 0; z-index: 3; width: 251px; padding: 4px; border: 1px solid #3c3c40; border-radius: 11px; background: #242426; box-shadow: 0 6px 18px #0006; animation: arrive .2s ease-out backwards; }
.expert-row { display: grid; grid-template-columns: 12px 1fr; align-items: start; gap: 8px; width: 100%; min-height: 45px; padding: 6px 8px; text-align: left; border-radius: 7px; }
.expert-row:hover { background: #333336; }
.expert-row .indicator { margin-top: 4px; }
.expert-row strong { display: block; font-size: 13px; font-weight: 550; }
.expert-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.indicator { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #78797d; }
.indicator.running { width: 11px; height: 11px; background: transparent; border: 2px solid #4e5057; border-top-color: var(--blue); animation: spin .92s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.transcript { overflow: auto; padding-block: 17px 10px; scrollbar-width: thin; scrollbar-color: #4a4a4d transparent; font-size: 14px; line-height: 1.55; }
.thread, .composer-slot { width: var(--thread-width); margin-inline: auto; }
.welcome { display: flex; align-items: center; justify-content: center; gap: 13px; padding: min(25vh, 175px) 4px 20px; }
.welcome strong { color: #e0e0e3; font-size: 21px; font-weight: 630; }
.welcome p { color: var(--muted); font-size: 13px; }
.transcript-item { animation: arrive .2s ease-out backwards; }
.transcript-item + .transcript-item { margin-top: 14px; }
@keyframes arrive { from { opacity: .6; transform: translateY(3px); } }
.message { display: grid; justify-items: end; }
.bubble { width: fit-content; max-width: 91%; padding: 9px 12px; border-radius: 12px; background: var(--chat-bubble); color: var(--chat-text); }
.source { margin-bottom: 3px; color: var(--chat-secondary); font-size: 13px; }
.receipt {
  border: 1px solid var(--chat-divider);
  border-radius: 10px;
  background: rgb(255 255 255 / 6%);
  color: var(--chat-tertiary);
}
.receipt summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
}
.receipt summary::-webkit-details-marker { display: none; }
.receipt summary:hover { color: var(--chat-secondary); }
.receipt summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.receipt time { margin-inline-start: auto; font-size: 12px; }
.receipt[open] .chevron { transform: rotate(225deg); }
.receipt-body { padding: 0 12px 12px 36px; font-size: 12px; color: var(--chat-secondary); }
.receipt-body pre { margin: 6px 0 0; max-height: 240px; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; }
.reference, .mention { display: inline-flex; vertical-align: baseline; align-items: center; gap: 3px; color: var(--blue); font-size: 13px; line-height: 1.4; }
.reference { padding: 0 2px; border-radius: 4px; }
.reference:hover { text-decoration: underline; }
.reference .icon, .mention .icon { width: 14px; height: 14px; }
.reference-note { color: var(--subtle); font-size: 11px; margin-top: 4px; }
.reply { padding: 4px 0; color: var(--chat-text); line-height: 24px; }
.working { display: flex; align-items: center; gap: 7px; color: var(--chat-tertiary); font-size: 13px; }
.tool-group { margin-top: 10px; padding-top: 5px; border-top: 0.5px solid var(--chat-divider); }
.tool-row { font-size: 13px; color: var(--chat-tertiary); }
.tool-row summary { min-height: 24px; line-height: 24px; cursor: pointer; }
.tool-name { white-space: pre-wrap; overflow-wrap: anywhere; }
.tool-row[open] summary, .tool-row summary:hover { color: var(--chat-secondary); }
.trace-event { color: var(--chat-tertiary); padding: 8px 0; border-bottom: 0.5px solid var(--chat-divider); }

.composer-slot { position: relative; padding-bottom: 13px; }
.composer { min-height: 87px; display: flex; flex-direction: column; justify-content: space-between; padding: 9px 10px 7px; background: var(--panel); border: 1px solid #38383b; border-radius: 17px; }
.draft, .placeholder { font-size: 14px; line-height: 1.6; min-height: 24px; padding: 1px 4px; }
.placeholder { color: var(--subtle); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 8px; }
.composer-tools { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.at-button, .send-button { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; }
.at-button { background: #353537; font-size: 17px; }
.at-button:hover:not(:disabled), .at-button[aria-expanded=true] { background: #454549; }
.send-button { padding: 0; font-size: 20px; background: var(--blue); color: #141c2d; }
.send-button:hover:not(:disabled) { background: #a3c4ff; }
.send-button .icon { width: 21px; height: 21px; stroke-width: 2; }
.demo-guide {
  position: fixed;
  z-index: 4;
  pointer-events: none;
  padding: 6px 9px;
  border-radius: 6px;
  background: #b9d2ff;
  color: #152644;
  box-shadow: 0 3px 12px #0005;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}
.demo-guide::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: inherit;
  transform: translate(-50%, -50%) rotate(45deg);
}
.demo-guide[data-arrow='left']::after { left: 0; top: var(--arrow-offset); }
.demo-guide[data-arrow='right']::after { left: 100%; top: var(--arrow-offset); }
.demo-guide[data-arrow='top']::after { left: var(--arrow-offset); top: 0; }
.demo-guide[data-arrow='bottom']::after { left: var(--arrow-offset); top: 100%; }
.at-button:disabled, .send-button:disabled { opacity: .45; }
.picker { position: absolute; inset: auto 0 calc(100% - 8px); z-index: 2; padding: 4px; border: 1px solid #3a3a3e; border-radius: 11px; background: #252527; box-shadow: 0 6px 18px #0006; }
.picker p { padding: 5px 8px; color: var(--muted); font-size: 12px; }
.picker-row { display: flex; align-items: center; gap: 7px; min-height: 32px; width: 100%; padding: 5px 8px; text-align: left; border-radius: 7px; font-size: 13px; }
.picker-row.selected, .picker-row:hover { background: #353538; }
.picker-row span { margin-left: auto; color: var(--muted); font-size: 11px; }

.tool-body {
  margin: 4px 0 4px 14px;
  padding: 8px 10px;
  border: 0.5px solid var(--chat-divider);
  border-radius: 6px;
  background: var(--chat-code);
  color: var(--chat-secondary);
}
.tool-caption { margin-bottom: 4px; color: var(--chat-tertiary); font-size: 12px; }
.tool-body pre, .tool-output { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tool-output { margin-top: 7px; border-top: 0.5px solid var(--chat-divider); padding-top: 7px; }
.release-summary { margin-top: 7px; white-space: pre-line; }

.drawer-backdrop, .mobile-control, .expert-count { display: none; }

@media (max-width: 700px) {
  .workspace {
    --demo-height: 100svh;
    --demo-height: 100dvh;
    display: block;
  }
  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4;
    background: rgb(0 0 0 / 48%);
  }
  .workspace[data-drawer-open] .drawer-backdrop { display: block; }
  .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 5;
    width: min(290px, calc(100% - 48px));
    padding: max(6px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .workspace[data-drawer-open] .sidebar { display: flex; }
  .sidebar-top { display: flex; align-items: center; justify-content: space-between; }
  .sidebar-brand { min-width: 0; }
  .sidebar-brand img:last-child { width: min(134px, 100% - 30px); height: auto; }
  .sidebar .new-session, .sidebar .session, .sidebar .reset-button { min-height: 44px; }
  .sidebar .new-session { flex: none; }
  .mobile-control {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    color: var(--chat-secondary);
  }
  .conversation {
    --thread-inset: clamp(20px, 8vw, 44px);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .conversation-header { min-height: 44px; gap: 5px; padding: 0 6px 0 4px; }
  .conversation-header h2 { font-weight: 550; }
  .mode, .play-button span, .expert-label, .expert-toggle .chevron { display: none; }
  .play-button, .expert-toggle { min-width: 44px; min-height: 44px; }
  .expert-toggle { justify-content: center; }
  .expert-count { display: inline; }
  .view-tabs { gap: 26px; padding-inline: 20px; }
  .collaboration { position: static; margin-inline-start: auto; }
  .conversation-header:has(.collaboration:not([hidden])) .play-button { margin-inline-start: 0; }
  .expert-panel {
    right: 12px;
    left: auto;
    width: min(260px, calc(100% - 24px));
    max-height: min(40dvh, 320px);
    overflow-y: auto;
  }
  .transcript { padding-block: 7px 12px; overscroll-behavior-y: contain; }
  .composer-slot { width: min(680px, calc(100% - 32px)); padding-bottom: 13px; }
  .composer { min-height: 96px; border-radius: 22px; }
  .picker { max-height: 42dvh; overflow-y: auto; }
  .receipt summary, .picker-row { min-height: 44px; }
  .tool-row summary { min-height: 32px; }
  .tool-body { margin-inline-start: 0; }
  .demo-guide { z-index: 6; max-width: calc(100vw - 16px); white-space: normal; }
  .page-footer { display: none; }

  .conversation[data-blank] { grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr); }
  .conversation[data-blank] .view-tabs { display: none; }
  .conversation[data-blank] .transcript { display: grid; align-items: end; padding-bottom: 16px; }
  .welcome { padding: 0; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
