@import url("./ui-theme.css");

:root {
  font-size: 14px;
  --sidebar-left-width: 300px;
  --sidebar-right-width: 360px;
}
header {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.7px;
  text-decoration: none;
}
.brand span {
  border-left: 1px solid var(--border-strong);
  padding-left: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}
nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
}
nav a {
  color: var(--muted);
  text-decoration: none;
}
nav a:hover {
  color: var(--foreground);
}
main {
  display: grid;
  position: relative;
  grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr) var(
      --sidebar-right-width
    );
  height: calc(100dvh - 64px);
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}
.pane {
  padding: 18px 16px;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}
.users {
  border-right: 1px solid var(--border);
  background: var(--subtle);
}
.memory {
  border-left: 1px solid var(--border);
  background: var(--surface);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
h1 {
  margin: 0 0 24px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
h3 {
  margin: 24px 0 12px;
  font-size: 13px;
  font-weight: 600;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
}
.memory > .section-title {
  margin-top: 0;
}
.section-title button {
  padding: 3px 6px;
  min-height: 28px;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  font-size: 11px;
}
.section-title button:hover {
  background: var(--accent);
  color: var(--foreground);
}
label {
  display: block;
  margin: 14px 0 8px;
  font-size: 12px;
  font-weight: 500;
}
input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.6;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
textarea {
  resize: vertical;
}
button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled) {
  background: var(--primary-hover);
}
.secondary,
nav button,
.record-actions button,
#clear {
  background: var(--surface);
  color: var(--foreground);
  border-color: var(--border);
}
:is(.secondary, nav button, .record-actions button, #clear):hover:not(
    :disabled
  ) {
  background: var(--accent);
  border-color: var(--border-strong);
}
form > button {
  width: 100%;
  margin-top: 10px;
}
small,
.metadata {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}
small {
  margin-top: 9px;
}
.metadata {
  margin: 8px 0;
}
.stack {
  display: grid;
  gap: 6px;
}
#users {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.stack > button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--foreground);
  border: 1px solid transparent;
  overflow-wrap: anywhere;
}
.stack > button:hover {
  background: var(--accent);
}
.stack > button.selected {
  background: var(--accent);
  border-color: var(--border-strong);
}
.stack > button small {
  margin-top: 4px;
  font-weight: 400;
}
.empty {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px 0;
  min-width: 0;
  min-height: 0;
  --chat-width: 800px;
  --chat-inset: 32px;
}
.chat-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.chat-heading h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}
.chat-heading button {
  white-space: nowrap;
}
.welcome {
  margin: auto;
  padding: 40px 0;
  text-align: left;
  width: 100%;
  max-width: 640px;
}
.welcome h2 {
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -1px;
}
.welcome p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}
.message {
  flex-shrink: 0;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.85;
  font-size: 14px;
}
.message.user {
  align-self: flex-end;
  padding: 12px 16px;
  background: var(--accent);
  border-radius: 18px;
  max-width: min(85%, 640px);
}
.message.assistant {
  align-self: flex-start;
  width: 100%;
  padding: 8px 0;
}
.typing-message {
  padding: 0;
}
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 11px 14px;
  border-radius: 18px;
  background: var(--accent);
}
.typing-dots > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-pulse 1.3s ease-in-out infinite;
}
.typing-dots > span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots > span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing-pulse {
  0%,
  70%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .typing-dots > span {
    animation: none;
    opacity: 0.7;
  }
}
.message .role {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4px;
}
#notice {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
#notice.error {
  color: var(--destructive);
}
/* Keep the idle composer one line high; pasted multiline messages grow modestly. */
.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 8px;
}
.composer-toolbar select {
  width: auto;
  max-width: min(270px, 100%);
  padding: 4px 24px 4px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.composer-toolbar .metadata {
  margin: 0;
}
.composer-toolbar .show-tools-toggle {
  margin-left: auto;
  flex-shrink: 0;
}
#composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 23px;
  background: var(--surface);
}
#composer:focus-within {
  border-color: var(--ring);
}
#composer textarea {
  flex: 1;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  max-height: 128px;
  padding: 5px 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  line-height: 22px;
  resize: none;
  outline: none;
}
.icon-button,
.section-title .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover:not(:disabled) {
  background: var(--accent);
  color: var(--foreground);
}
#composer > button {
  margin: 0;
}
#send,
#stop {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 6px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}
#send:hover:not(:disabled),
#stop:hover:not(:disabled) {
  background: var(--primary-hover);
  color: var(--primary-foreground);
}
#stop {
  background: var(--foreground);
  color: var(--surface);
}
#send:disabled {
  background: var(--accent);
  color: var(--muted);
}
.chat-heading {
  justify-content: flex-end;
}
#notice:empty {
  display: none;
}
#recovery {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--subtle);
  font-size: 12px;
  line-height: 1.7;
}
#recovery {
  margin-top: 12px;
}
#recovery button {
  margin: 8px 4px 0 0;
  font-size: 11px;
}
pre {
  max-height: 340px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--subtle);
  color: var(--text-secondary);
  font: 11px/1.7 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.record-actions button {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 11px;
}
.job {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--subtle);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.job button {
  margin-top: 6px;
  font-size: 11px;
}
.connector-details {
  margin: 12px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.connector-details summary {
  width: fit-content;
  cursor: pointer;
}
#managed-account > a {
  display: inline-block;
  margin: 4px 0;
  font-size: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 1600px) {
  main {
    grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr) var(
        --sidebar-right-width
      );
  }
  .pane {
    padding: 20px 18px;
  }
  .chat {
    padding: 28px 0;
  }
}
@media (max-width: 1100px) {
  main {
    grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
    height: auto;
    min-height: calc(100dvh - 64px);
  }
  .chat {
    height: calc(100dvh - 64px);
    padding: 24px 0;
  }
  .memory {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}
@media (max-width: 650px) {
  header {
    padding: 0 16px;
    gap: 12px;
  }
  .brand span {
    display: none;
  }
  nav {
    gap: 12px;
    font-size: 11px;
  }
  nav button {
    padding: 7px 9px;
    min-height: 32px;
    font-size: 11px;
  }
  main {
    display: block;
  }
  .pane {
    padding: 20px;
  }
  .users {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .users h1 {
    margin-bottom: 16px;
  }
  .chat {
    height: 80dvh;
    min-height: 500px;
  }
  .chat-heading h2 {
    font-size: 17px;
  }
  .message {
    max-width: 100%;
  }
  .welcome h2 {
    font-size: 25px;
  }
}

/* Demo navigation and a separate settings surface share the chat session. */
.demo-navigation {
  display: grid;
  gap: 4px;
  margin: -4px 0 18px;
}
.demo-navigation a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.demo-navigation a:hover {
  background: var(--accent);
  color: var(--foreground);
}
.demo-navigation a[aria-current="page"] {
  background: var(--accent);
  color: var(--foreground);
  font-weight: 600;
}
.demo-navigation a span {
  font-size: 12px;
}
#demo-layout.settings-open {
  grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
}
.settings {
  min-width: 0;
  padding: 28px 32px;
}
.settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.settings-heading h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.9px;
}
.settings-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.back-to-chat {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.93rem;
  color: var(--text-secondary);
}
.back-to-chat:hover {
  color: var(--foreground);
}
.back-to-chat span {
  margin-left: 8px;
}
#settings-notice {
  margin-top: 20px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
}
#settings-notice:empty {
  display: none;
}
#settings-notice.error {
  color: var(--destructive);
}
.integration-provider {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.provider-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}
.provider-copy {
  flex: 1;
  min-width: 0;
}
.provider-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.provider-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 18px;
  font-weight: 600;
}
.provider-heading h3 {
  margin: 0;
  font-size: 15px;
}
.provider-heading p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.integration-badge {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.integration-services {
  margin-top: 12px;
  border-top: 1px solid var(--border);
}
.integration-service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.integration-service h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}
.integration-service p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.integration-service > span {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
}
.integration-setup {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.provider-connection {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.provider-connection .section-title h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
}
.provider-connection > .metadata {
  margin: 0;
}
.google-accounts {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.google-account {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.google-account-info {
  flex: 1;
  min-width: 160px;
  overflow-wrap: anywhere;
}
.google-account-email {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 500;
}
.google-account-info .metadata {
  margin: 0;
}
#naver-form {
  display: grid;
  gap: 8px;
  max-width: 420px;
  margin-top: 16px;
}
.provider-connection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
@media (min-width: 1600px) {
  #demo-layout.settings-open {
    grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
  }
}
@media (max-width: 1100px) {
  #demo-layout.settings-open {
    grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
  }
  .settings {
    padding: 32px 28px;
  }
}
@media (max-width: 650px) {
  #demo-layout.settings-open {
    display: block;
  }
  .demo-navigation {
    display: flex;
    margin-bottom: 20px;
  }
  .demo-navigation a {
    flex: 1;
  }
  .settings {
    padding: 28px 20px;
  }
  .settings-heading {
    display: block;
  }
  .settings-heading h1 {
    font-size: 26px;
  }
  .back-to-chat {
    display: inline-block;
    margin-top: 16px;
  }
  .integration-provider {
    padding: 18px;
  }
  .provider-heading {
    flex-wrap: wrap;
  }
  .provider-copy {
    flex-basis: calc(100% - 42px);
  }
  .provider-actions {
    width: 100%;
    justify-content: space-between;
  }
  .integration-service {
    align-items: flex-start;
    gap: 12px;
  }
  .provider-connection-actions > button {
    width: 100%;
  }
}

.setup-required {
  max-width: 1040px;
  margin: 24px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--subtle);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.8;
}

.memory-workspace {
  min-width: 0;
  padding: 28px;
  background: var(--surface);
}
.memory-workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#demo-workspace > .memory-workspace-heading {
  margin-bottom: 16px;
}
.memory-workspace-heading h1 {
  margin: 0;
  font-size: 24px;
}
.memory-workspace-heading button {
  flex-shrink: 0;
}
.memory-workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.memory-primary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.memory-reset-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--foreground);
}
.memory-reset-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}
.memory-reset-dialog h2 {
  margin-top: 0;
  font-size: 20px;
}
.memory-reset-dialog p {
  line-height: 1.7;
}
#memory-reset-status:empty {
  display: none;
}
#memory-reset-status.error {
  color: var(--destructive);
}
#memory-notice:empty {
  display: none;
}
#memory-notice {
  font-size: 12px;
  margin: 16px 0;
}
#memory-notice.error {
  color: var(--destructive);
}
#memory-workspace-status {
  margin: 16px 0;
  overflow-wrap: anywhere;
}
#memory-workspace-status.error {
  color: var(--destructive);
}
#memory-workspace-refresh.memory-syncing .icon-refresh-cw {
  animation: memory-sync-rotate 1s linear infinite;
}
@keyframes memory-sync-rotate {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  #memory-workspace-refresh.memory-syncing .icon-refresh-cw {
    animation: none;
  }
}
.memory-repository-panel {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.memory-repository-sidebar {
  display: block;
  min-width: 0;
  padding: 12px 8px;
  background: var(--subtle);
  border-right: 1px solid var(--border);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.memory-repository-label {
  padding: 0 8px;
  margin: 4px 0 12px;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.memory-folder {
  padding-left: 10px;
}
.memory-folder summary {
  cursor: pointer;
  padding: 7px 0;
  color: var(--text-secondary);
  font-size: 12px;
}
.memory-file-link {
  display: block;
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  padding: 7px 8px;
  overflow-wrap: anywhere;
}

.memory-file-link[aria-current="true"] {
  background: var(--border);
  color: var(--foreground);
}
.memory-file-link:hover:not(:disabled) {
  background: var(--accent);
}
.memory-source-view {
  min-width: 0;
}
.memory-file-heading {
  padding: 16px;
  min-height: 66px;
  border-bottom: 1px solid var(--border);
  background: var(--subtle);
  overflow-wrap: anywhere;
}
.memory-file-heading h2 {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
}
.memory-file-heading small {
  margin-top: 6px;
  font-size: 10px;
}
.memory-source-content {
  margin: 0;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  min-height: 300px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  tab-size: 2;
}
.memory-source-view > .empty {
  margin: 24px;
}
.memory-workspace-note {
  margin-top: 16px;
}
@media (min-width: 1101px) and (max-width: 1400px) {
  #demo-layout.memory-open {
    grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
  }
  .memory-workspace {
    padding: 24px 20px;
  }
  .memory-repository-panel {
    grid-template-columns: 150px minmax(0, 1fr);
  }
}
@media (max-width: 800px) {
  .memory-workspace {
    padding: 24px 16px;
  }
  .memory-repository-panel {
    grid-template-columns: minmax(0, 1fr);
  }
  .memory-repository-sidebar {
    max-height: 240px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .memory-source-content {
    min-height: 180px;
  }
  .memory-workspace-heading h1 {
    font-size: 22px;
  }
  .memory-workspace-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .memory-workspace-actions {
    justify-content: flex-start;
    gap: 6px;
  }
}

/* A shared reading column keeps the transcript, composer and execution UI aligned. */
.chat
  > :is(
    .chat-heading,
    #notice,
    #history-banner,
    .composer-toolbar,
    #composer,
    #recovery
  ) {
  width: calc(100% - 64px);
  max-width: var(--chat-width);
  margin-left: auto;
  margin-right: auto;
}
#messages,
#tasks-messages {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 24px;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px max(var(--chat-inset), calc((100% - var(--chat-width)) / 2));
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
#messages::-webkit-scrollbar,
#tasks-messages::-webkit-scrollbar {
  width: 6px;
}
#messages::-webkit-scrollbar-thumb,
#tasks-messages::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: transparent;
}
#messages.is-scrolling,
#tasks-messages.is-scrolling {
  scrollbar-color: var(--border-strong) transparent;
}
#messages.is-scrolling::-webkit-scrollbar-thumb,
#tasks-messages.is-scrolling::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}
.message.custom {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--subtle);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.sidebar-section {
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar-section > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0 10px;
  cursor: pointer;
  list-style: none;
}
.sidebar-section > summary::-webkit-details-marker {
  display: none;
}
.sidebar-section > summary::before {
  content: "›";
  color: var(--muted);
}
.sidebar-section[open] > summary::before {
  transform: rotate(90deg);
}
.sidebar-section > summary .metadata {
  margin: 0 0 0 auto;
  font-size: 10px;
}
.sidebar-section-title {
  font-size: 13px;
  font-weight: 600;
}
@media (max-width: 650px) {
  .chat {
    --chat-inset: 16px;
    padding-left: 0;
    padding-right: 0;
  }
  .chat
    > :is(
      .chat-heading,
      #notice,
      #history-banner,
      .composer-toolbar,
      #composer,
      #recovery
    ) {
    width: calc(100% - 32px);
  }
}
.message-content {
  min-width: 0;
}
.message.assistant,
.markdown-content {
  white-space: normal;
}
.message.user .message-content {
  white-space: pre-wrap;
}
#send:disabled {
  opacity: 1;
}
#stop:disabled {
  opacity: 0.5;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.ui-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  vertical-align: middle;
  overflow: visible;
}
.icon-button .ui-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}
header nav .ui-icon,
.back-to-chat .ui-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.section-title h2,
.sidebar-heading,
#memory-workspace-refresh {
  display: flex;
  align-items: center;
  gap: 8px;
}
header nav a,
.back-to-chat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sidebar-heading .ui-icon {
  color: var(--muted);
}
.sidebar-description {
  margin: 10px 0 24px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;
}

/* Rich messages wrap prose and scroll wide code, tables and diagrams locally. */
.markdown-content {
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.markdown-content > :first-child {
  margin-top: 0;
}
.markdown-content > :last-child {
  margin-bottom: 0;
}
.markdown-content p {
  margin: 0 0 14px;
}
.markdown-content :is(h1, h2, h3, h4, h5, h6) {
  margin: 28px 0 12px;
  color: var(--foreground);
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: -0.3px;
}
.markdown-content h1 {
  font-size: 25px;
}
.markdown-content h2 {
  font-size: 21px;
}
.markdown-content h3 {
  font-size: 18px;
}
.markdown-content :is(h4, h5, h6) {
  font-size: 15px;
}
.markdown-content :is(ul, ol) {
  padding-left: 24px;
  margin: 12px 0 18px;
}
.markdown-content li {
  margin: 5px 0;
}
.markdown-content li > p {
  margin: 4px 0;
}
.markdown-content li > :is(ul, ol) {
  margin: 6px 0;
}
.markdown-content blockquote {
  margin: 18px 0;
  padding: 2px 16px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-secondary);
}
.markdown-content blockquote p {
  margin: 8px 0;
}
.markdown-content hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.markdown-content a {
  text-decoration: underline;
}
.markdown-content :not(pre) > code {
  border-radius: 5px;
  padding: 2px 5px;
  background: var(--accent);
  font: 0.9em var(--font-mono);
}
.markdown-content .markdown-code-block {
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--subtle);
}
.markdown-code-header {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font: 11px var(--font-mono);
}
.markdown-content pre {
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 0;
  max-height: none;
  color: var(--foreground);
  background: var(--subtle);
  white-space: pre;
  overflow-wrap: normal;
  font: 12px/1.8 var(--font-mono);
}
.markdown-content pre code {
  font: inherit;
}
.markdown-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  white-space: normal;
  font-size: 13px;
}
.markdown-content :is(th, td) {
  padding: 10px 14px;
  min-width: 100px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.markdown-content th {
  background: var(--subtle);
  font-weight: 600;
}
.markdown-content tr:last-child td {
  border-bottom: 0;
}
.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.markdown-diagram {
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.diagram-canvas {
  overflow: auto;
  padding: 20px;
  background: var(--surface);
}
.diagram-canvas svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
}
.diagram-status {
  margin: 0;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
}
.diagram-source {
  border-top: 1px solid var(--border);
}
.diagram-source summary {
  padding: 10px 14px;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-meta {
  color: #7c3aed;
}
.hljs-string,
.hljs-regexp,
.hljs-template-variable {
  color: #047857;
}
.hljs-number,
.hljs-literal,
.hljs-symbol,
.hljs-bullet {
  color: #b45309;
}
.hljs-title,
.hljs-section,
.hljs-function,
.hljs-attr {
  color: #1d4ed8;
}
.hljs-comment,
.hljs-quote {
  color: var(--muted);
  font-style: italic;
}
.hljs-type,
.hljs-built_in,
.hljs-variable {
  color: #0e7490;
}
.hljs-link {
  color: #1d4ed8;
  text-decoration: underline;
}
.hljs-strong {
  font-weight: 700;
}
.hljs-emphasis {
  font-style: italic;
}
.hljs-addition {
  color: #166534;
  background: #ecfdf0;
}
.hljs-deletion {
  color: #b91c1c;
  background: #fff1f2;
}

/* The file reader takes the remaining viewport height, with its own scroll. */
#demo-layout.memory-open {
  grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
  height: calc(100dvh - 64px);
  min-height: 0;
}
.memory-workspace {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.memory-workspace-heading,
.memory-workspace-note,
.memory-management,
#memory-workspace-status,
#memory-notice,
#memory-reset-status {
  flex-shrink: 0;
}
.memory-repository-panel {
  flex: 1;
  min-height: 0;
  grid-template-columns: 220px minmax(0, 1fr);
}
.memory-repository-sidebar {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}
.memory-source-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.memory-file-heading {
  flex-shrink: 0;
}
.memory-source-content {
  flex: 1;
  min-height: 0;
  max-height: none;
  white-space: pre;
  overflow-wrap: normal;
}
.memory-management {
  max-height: 45%;
  overflow: auto;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.memory-management > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 0;
  color: var(--text-secondary);
}
.memory-management-body {
  padding: 0 0 12px;
}
.memory-management-body > .section-title {
  margin-top: 12px;
}
.memory-bootstrap {
  flex-shrink: 0;
  max-height: 35%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
}
.memory-bootstrap > summary {
  cursor: pointer;
  font-weight: 500;
}
.memory-bootstrap-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.memory-bootstrap-controls label:first-child {
  flex: 1;
  min-width: 180px;
}
.memory-bootstrap-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.memory-bootstrap-controls input {
  max-width: 110px;
}
#memory-learning-status {
  flex-shrink: 0;
  margin: 10px 0;
}
#memory-learning-status:empty {
  display: none;
}
.memory-candidates-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
}
.memory-fact-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.memory-fact-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.memory-fact-card > details {
  margin: 12px 0;
}
.memory-fact-edit {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.memory-fact-edit label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.memory-fact-edit input[type="checkbox"] {
  align-self: start;
}
.memory-evidence {
  margin: 10px 0;
  padding: 12px;
  background: var(--subtle);
  border-radius: 6px;
}
.memory-evidence pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 260px;
  overflow: auto;
}
.memory-evidence details {
  overflow-wrap: anywhere;
}
.memory-folder summary {
  display: flex;
  align-items: center;
  gap: 7px;
}
.memory-file-link > .ui-icon {
  width: 14px;
  height: 14px;
  margin-right: 7px;
  vertical-align: -2px;
}
.memory-folder summary > .ui-icon {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}
#memory-files-panel .memory-repository-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 8px;
  overflow: hidden;
}
.memory-explorer-toolbar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 8px;
  margin-bottom: 6px;
}
.memory-explorer-toolbar h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
}
#memory-files-refresh {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
}
#memory-files-refresh:hover {
  background: var(--accent);
}
#memory-file-tree {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}
#memory-file-tree :is(summary, button) {
  min-height: 34px;
  border-radius: 6px;
}
#memory-file-tree summary {
  position: relative;
  padding-left: 16px;
}
#memory-file-tree summary::before {
  position: absolute;
  left: 3px;
  width: 5px;
  height: 5px;
  content: "";
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
}
#memory-file-tree details[open] > summary::before {
  transform: rotate(45deg);
}
#memory-file-tree summary:hover {
  background: var(--accent);
}
#memory-file-tree .memory-file-link {
  display: flex;
  align-items: center;
}
#memory-file-tree .memory-file-link .ui-icon {
  flex: 0 0 14px;
}
#memory-file-tree :focus-visible,
#memory-file-content:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}
#memory-file-heading {
  height: auto;
  flex-wrap: wrap;
  gap: 4px 16px;
}
#memory-file-path {
  min-width: 0;
  margin: 0;
}
#memory-file-meta {
  margin: 0;
}
#memory-files-status:empty {
  display: none;
}
#memory-file-content {
  font-size: 0.8125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (prefers-color-scheme: dark) {
  #memory-file-content :is(.hljs-section, .hljs-link, .hljs-attr) {
    color: #93c5fd;
  }
  #memory-file-content :is(.hljs-bullet, .hljs-symbol, .hljs-number) {
    color: #fcd34d;
  }
  #memory-file-content :is(.hljs-code, .hljs-string) {
    color: #a7f3d0;
  }
}
@media (max-width: 650px) {
  #memory-files-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  #memory-files-panel .memory-repository-sidebar {
    max-height: 32dvh;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  #memory-file-tree :is(summary, button) {
    min-height: 44px;
  }
  #memory-file-heading {
    display: block;
  }
  #memory-file-meta {
    margin-top: 4px;
  }
}
.memory-change-summary {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.8;
}
@media (max-width: 1100px) {
  #demo-layout.memory-open {
    grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
  }
}
@media (max-width: 800px) {
  .memory-repository-panel {
    grid-template-columns: 160px minmax(0, 1fr);
  }
  .memory-repository-sidebar {
    max-height: none;
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }
}
@media (max-width: 650px) {
  .users {
    max-height: 200px;
    overflow: auto;
  }
  #demo-layout.memory-open {
    display: flex;
    flex-direction: column;
  }
  #demo-layout.memory-open .users {
    flex-shrink: 0;
    max-height: none;
    padding: 12px 16px;
  }
  #demo-layout.memory-open .demo-navigation {
    margin: 0;
  }
  .demo-navigation a {
    justify-content: center;
    padding: 9px 8px;
    gap: 6px;
  }
  .memory-workspace {
    flex: 1;
    height: auto;
    padding: 20px 12px 12px;
  }
  .memory-repository-panel {
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .memory-file-heading,
  .memory-source-content {
    padding: 12px;
  }
  .memory-source-content {
    font-size: 11px;
  }
  .memory-workspace-note {
    font-size: 10px;
    line-height: 1.6;
    margin: 10px 0 0;
  }
  .message.user {
    max-width: 92%;
  }
  .markdown-content h1 {
    font-size: 22px;
  }
}
@media (max-width: 650px) {
  #demo-layout:not(.settings-open) {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 64px);
    min-height: 0;
  }
  #demo-layout:not(.settings-open) > .users {
    flex-shrink: 0;
    max-height: 180px;
    padding: 12px 16px;
  }
  .demo-navigation {
    margin-bottom: 12px;
  }
  #demo-history .section-title {
    margin-top: 12px;
  }
  .chat {
    flex: 1;
    height: auto;
    min-height: 0;
    padding: 16px 0;
  }
  #messages {
    min-height: 0;
  }
  #demo-layout.memory-open .users {
    max-height: none;
  }
}

/* Conversation call stack keeps payloads folded while names and timings remain visible. */
.activity-sidebar {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 18px 14px;
}
.token-usage {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.token-usage-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}
.token-usage-heading h2 {
  margin: 0;
  font-size: 13px;
}
.token-estimate {
  padding: 1px 5px;
  background: var(--subtle);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
}
.token-usage-summary {
  margin: 8px 0 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.token-capacity {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e5e7eb;
}
.token-segment {
  display: block;
  flex: 0 0 auto;
  height: 100%;
  background: var(--token-color);
  transition: width 120ms ease;
}
.token-system_prompt {
  --token-color: #5078bd;
}
.token-tool_prompt {
  --token-color: #9a68b4;
}
.token-memory {
  --token-color: #42a092;
}
.token-context {
  --token-color: #cc9b37;
}
.token-thinking {
  --token-color: #bd7294;
}
.token-tool_output {
  --token-color: #b67849;
}
.token-text,
.token-input_text {
  --token-color: #789644;
}
.token-output_text {
  --token-color: #0e7490;
}
.token-skill {
  --token-color: #6372ac;
}
.token-flow-summary {
  display: flex;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.token-legend {
  display: grid;
  gap: 2px;
  padding: 0;
  margin: 8px 0 0;
  list-style: none;
}
.token-label {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 7px;
  width: 100%;
  min-height: 30px;
  padding: 4px 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--foreground);
  text-align: left;
  font-size: 10px;
  line-height: 1.7;
}
.token-label:hover:not(:disabled),
.token-label[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--border);
}
.token-label::before {
  content: "";
  width: 6px;
  height: 6px;
  align-self: center;
  border-radius: 50%;
  background: var(--token-color);
}
.token-category-name {
  color: var(--text-secondary);
}
.token-category-count {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
  .token-segment {
    transition: none;
  }
}

/* Prompt inspection shares the center workspace while retaining the Chat DOM. */
.chat-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.chat-workspace > .chat {
  flex: 1;
}
.chat-tabs {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  gap: 4px;
  overflow-x: auto;
  padding: 12px 20px 0;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.chat-tab-item {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
}
.chat-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 5px 5px 0 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}
.chat-tab:hover:not(:disabled),
.chat-tab-close:hover:not(:disabled) {
  background: var(--accent);
}
.chat-tab[aria-selected="true"] {
  border-bottom-color: var(--foreground);
  color: var(--foreground);
}
.chat-tab-close {
  min-height: 32px;
  align-self: center;
  width: 25px;
  padding: 2px;
  margin-right: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
}
.prompt-panels {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.prompt-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 28px max(32px, calc((100% - 920px) / 2));
  scrollbar-width: thin;
}
.prompt-heading {
  margin: 0 0 6px;
  font-size: 20px;
}
.prompt-source {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.prompt-content {
  line-height: 1.8;
  color: var(--foreground);
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  .chat-workspace {
    height: calc(100dvh - 64px);
  }
}
@media (max-width: 650px) {
  .chat-workspace {
    flex: none;
    height: 65dvh;
    min-height: 440px;
  }
  .chat-tabs {
    padding: 8px 12px 0;
  }
  .prompt-panel {
    padding: 22px 16px;
  }
  .chat-workspace > .chat {
    min-height: 0 !important;
  }
}
.call-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.trace-run {
  min-width: 0;
}
.trace-run-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 0 7px;
  cursor: pointer;
  list-style: none;
}
.trace-run-summary::-webkit-details-marker {
  display: none;
}
.trace-run-summary::before {
  content: "›";
  color: var(--muted);
}
.trace-run[open] > .trace-run-summary::before {
  transform: rotate(90deg);
}
.trace-run-heading {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.trace-run-meta {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.trace-run-summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.trace-run-timing {
  white-space: normal;
  line-height: 1.6;
  margin: 8px 0;
}
.trace-calls {
  display: grid;
  gap: 4px;
  position: relative;
}
.trace-call {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  min-width: 0;
  position: relative;
}
.trace-call-summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 6px;
  padding: 6px 8px 6px 23px;
  cursor: pointer;
  list-style: none;
}
.trace-call-summary::-webkit-details-marker {
  display: none;
}
.trace-call-summary::before {
  content: "›";
  position: absolute;
  left: 9px;
  top: 5px;
  color: var(--muted);
  font-size: 16px;
}
.trace-call[open] > .trace-call-summary::before {
  transform: rotate(90deg);
}
.trace-call-title {
  font: 11px/1.6 var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trace-call-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trace-status {
  align-self: start;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--subtle);
  font-size: 10px;
  line-height: 1.7;
  white-space: nowrap;
  color: var(--text-secondary);
}
.trace-status-running {
  background: #eff6ff;
  color: #1d4ed8;
}
.trace-status-completed {
  background: #f0fdf4;
  color: #166534;
}
.trace-status-queued,
.trace-status-unconfirmed {
  background: var(--warning-surface);
  color: var(--warning);
}
.trace-status-cancelled {
  color: var(--muted);
}
.trace-status-failed,
.trace-status-interrupted {
  background: var(--destructive-surface);
  color: var(--destructive);
}
.trace-call[data-kind="tool"] {
  margin-left: 16px;
}
.trace-call[data-kind="tool"]::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 0;
  width: 5px;
  height: 18px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trace-error {
  margin: 10px 12px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--destructive);
  overflow-wrap: anywhere;
}
.trace-payload {
  border-top: 1px solid var(--border);
  margin: 0 10px;
}
.trace-payload > summary {
  padding: 6px 2px;
  color: var(--text-secondary);
  cursor: pointer;
  font: 11px/1.6 var(--font-mono);
}
.trace-payload pre {
  max-height: 340px;
  overflow: auto;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--subtle);
  border-radius: 5px;
  font: 10px/1.8 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
}
.trace-call > summary:focus-visible,
.trace-payload > summary:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (max-width: 1100px) {
  #demo-layout:not(.settings-open):not(.memory-open):not(.understanding-open) {
    grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
    height: auto;
  }
  .activity-sidebar {
    display: block;
    grid-column: 2;
    height: auto;
    max-height: 480px;
  }
}
@media (max-width: 650px) {
  #demo-layout:not(.settings-open):not(.memory-open):not(.understanding-open) {
    height: auto;
    min-height: calc(100dvh - 64px);
  }
  #demo-layout:not(.settings-open):not(.memory-open):not(.understanding-open)
    .chat {
    flex: none;
    min-height: 65dvh;
  }
  .activity-sidebar {
    max-height: 480px;
    padding: 20px 16px;
  }
}

/* Task lists use the global sidebar, with the Agent transcript in the center. */
.tasks-workspace {
  --chat-width: 800px;
  --chat-inset: 32px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 18px 0;
  background: var(--surface);
}
.tasks-heading,
.task-detail-heading,
.task-ticket-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tasks-heading,
#tasks-notice,
.tasks-create,
.task-detail-heading,
.task-metadata,
.tasks-detail-tabs,
.task-composer {
  width: calc(100% - 64px);
  max-width: var(--chat-width);
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
}
.tasks-heading {
  justify-content: space-between;
}
.tasks-heading h1 {
  margin: 0;
  font-size: 18px;
}
.tasks-heading .eyebrow {
  margin-bottom: 4px;
  font-size: 10px;
}
#tasks-notice {
  margin-top: 8px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#tasks-notice:empty {
  display: none;
}
.tasks-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.tasks-toolbar select {
  min-width: 0;
  width: auto;
  padding: 5px 7px;
  font-size: 11px;
}
.tasks-toolbar .metadata {
  margin: 0 0 0 auto;
  font-size: 10px;
  white-space: nowrap;
}
#tasks-list-controls .section-title {
  margin-top: 18px;
}
#tasks-list-controls > button {
  margin-top: 10px;
  width: 100%;
}
#tasks-list-controls .section-title h2 {
  flex: 1;
}
#tasks-create-toggle {
  font-size: 20px;
  line-height: 1;
}
.tasks-create {
  flex: 1;
  min-height: 0;
  margin-top: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: auto;
}
.tasks-create-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
}
.tasks-create-heading h2 {
  margin: 0;
  font-size: 14px;
}
.tasks-create-heading button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}
.tasks-create form {
  display: grid;
  gap: 6px;
  padding: 2px 12px 12px;
}
.tasks-create label {
  margin: 6px 0 0;
  font-size: 11px;
}
.tasks-create :is(input, textarea) {
  padding: 6px 8px;
  font-size: 12px;
}
.tasks-create form > button {
  margin-top: 6px;
  min-height: 30px;
}
.tasks-create-budgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tasks-create-budgets label {
  display: grid;
  gap: 4px;
}
.tasks-create-budgets input {
  min-width: 0;
}
.task-empty {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
}
.task-empty h2 {
  font-size: 16px;
}
.task-empty p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 6px;
  text-align: left;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--foreground);
  border-radius: 6px;
  margin-bottom: 2px;
  min-height: 42px;
}
.task-row:hover:not(:disabled) {
  background: var(--accent);
}
.task-row[aria-current="true"] {
  background: #f1f5fb;
  border-color: #dce5f3;
}
.task-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}
.task-row :is(small, .metadata) {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}
.task-row .task-summary {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-status {
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  white-space: nowrap;
}
.task-status-running,
.task-status[data-status="running"] {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #dbeafe;
}
.task-status-waiting,
.task-status[data-status="waiting"] {
  color: var(--warning);
  background: var(--warning-surface);
}
.task-status-failed,
.task-status[data-status="failed"] {
  color: var(--destructive);
  background: var(--destructive-surface);
}
.task-status-finished,
.task-status[data-status="finished"] {
  color: #166534;
  background: #f0fdf4;
}
.task-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 4px 0 0;
}
.task-detail-heading h2 {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.task-detail-heading button {
  padding: 4px 7px;
  min-height: 28px;
  font-size: 11px;
}
.task-metadata {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}
.task-metadata > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
.task-metadata > summary::before {
  content: "›";
}
.task-metadata[open] > summary::before {
  transform: rotate(90deg);
}
.task-metadata .metadata {
  display: inline;
  margin: 0;
  font-size: 10px;
}
.task-metadata p.metadata {
  display: block;
  padding: 6px 0;
  line-height: 1.6;
}
.task-ticket-heading {
  justify-content: space-between;
  margin: 10px 0;
  flex-wrap: wrap;
}
.task-ticket-heading code {
  min-width: 0;
  font-size: 10px;
  overflow-wrap: anywhere;
}
.task-ticket-heading button {
  padding: 4px 7px;
  min-height: 26px;
  font-size: 10px;
}
.tasks-ticket-tabs,
.tasks-detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.tasks-ticket-tabs button,
.tasks-detail-tabs button {
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 8px;
  min-height: 28px;
  font-size: 11px;
}
.tasks-ticket-tabs button[aria-selected="true"],
.tasks-detail-tabs button[aria-selected="true"] {
  color: var(--foreground);
  border-bottom-color: var(--foreground);
}
#tasks-ticket-source {
  max-height: none;
  padding: 10px;
  font-size: 10px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
#tasks-ticket-rendered {
  overflow-wrap: anywhere;
  font-size: 12px;
}
#tasks-ticket-rendered :is(h1, h2, h3) {
  font-size: 14px;
  margin: 14px 0 8px;
}
.tasks-detail-tabs {
  margin-top: 16px;
  margin-bottom: 0;
}
.tasks-detail-tabs button {
  padding: 10px 12px;
  font-size: 12px;
}
.tasks-detail-tabs button:hover:not(:disabled) {
  background: var(--accent);
  color: var(--foreground);
}
.task-description-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px max(var(--chat-inset), calc((100% - var(--chat-width)) / 2));
  overflow-wrap: anywhere;
}
.task-progress-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.task-result-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px max(var(--chat-inset), calc((100% - var(--chat-width)) / 2));
  overflow-wrap: anywhere;
}
.task-result-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.task-result-heading h3 {
  margin: 0;
  font-size: 14px;
}
.task-result-files {
  margin-top: 24px;
}
.task-result-files h3 {
  font-size: 13px;
  margin: 0 0 8px;
}
.task-result-heading button {
  padding: 5px 9px;
  min-height: 28px;
  font-size: 11px;
}
.task-completion-reason {
  margin: 24px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.8;
}
.task-chat-toolbar {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  padding: 10px max(var(--chat-inset), calc((100% - var(--chat-width)) / 2)) 0;
}
.show-tools-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}
.show-tools-toggle input {
  appearance: none;
  width: 28px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--subtle);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}
.show-tools-toggle input::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition:
    transform 160ms ease,
    background 160ms ease;
}
.show-tools-toggle input:checked {
  background: var(--foreground);
  border-color: var(--foreground);
}
.show-tools-toggle input:checked::before {
  background: var(--surface);
  transform: translateX(12px);
}
.show-tools-toggle input:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}
.show-tools-toggle:has(input:checked) {
  color: var(--foreground);
}
.inline-tool-call.trace-call[data-kind="tool"] {
  width: 100%;
  margin: 0;
  flex-shrink: 0;
  animation: inline-tool-enter 180ms ease-out;
}
.inline-tool-call.trace-call[data-kind="tool"]::before {
  content: none;
}
.inline-tool-call .trace-call-summary {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  padding: 9px 12px 9px 28px;
}
.inline-tool-call .trace-call-summary::before {
  top: 8px;
  left: 12px;
  transition: transform 140ms ease;
}
.inline-tool-call .trace-call-title {
  font-size: 12px;
}
.inline-tool-call .trace-call-meta {
  grid-column: auto;
}
.inline-tool-call .trace-status-running::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: tool-status-pulse 1.4s ease-in-out infinite;
}
.inline-tool-call[open] > .trace-payload,
.inline-tool-call .trace-payload[open] > pre {
  animation: inline-tool-enter 140ms ease-out;
}
@keyframes inline-tool-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes tool-status-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}
@media (max-width: 650px) {
  .inline-tool-call .trace-call-summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .inline-tool-call .trace-call-meta {
    grid-column: 1 / -1;
  }
  .task-result-heading {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .inline-tool-call,
  .inline-tool-call[open] > .trace-payload,
  .inline-tool-call .trace-payload[open] > pre,
  .inline-tool-call .trace-status-running::before {
    animation: none;
  }
  .show-tools-toggle input,
  .show-tools-toggle input::before,
  .inline-tool-call .trace-call-summary::before {
    transition: none;
  }
}
#tasks-answer-form {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 10px;
  padding: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
}
#tasks-answer {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  max-height: 128px;
  resize: vertical;
  padding: 5px 9px;
  border: 0;
  border-radius: 12px;
  font-size: 13px;
}
#tasks-answer-submit {
  flex-shrink: 0;
  width: auto;
  margin: 0;
  padding: 6px 9px;
  min-height: 30px;
  border-radius: 12px;
  font-size: 11px;
}
.task-artifacts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.task-artifacts button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
}
@media (max-width: 1100px) {
  .tasks-workspace {
    height: calc(100dvh - 64px);
  }
}
@media (max-width: 650px) {
  .tasks-workspace {
    --chat-inset: 16px;
    flex: none;
    height: 65dvh;
    min-height: 440px;
    padding: 16px 0;
  }
  .tasks-heading,
  #tasks-notice,
  .tasks-create,
  .task-detail-heading,
  .task-metadata,
  .tasks-detail-tabs,
  .task-composer {
    width: calc(100% - 32px);
  }
  .tasks-create-budgets {
    grid-template-columns: minmax(0, 1fr);
  }
  .task-detail-heading {
    flex-wrap: wrap;
  }
  .task-detail-heading h2 {
    flex-basis: 100%;
  }
  .task-empty {
    padding: 20px 16px;
  }
}

/* Sidebar separators overlay the pane borders without taking reading space. */
.sidebar-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  z-index: 5;
  cursor: col-resize;
  touch-action: none;
}
.sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: transparent;
  transition: background 120ms;
}
.sidebar-resizer-left {
  left: calc(var(--sidebar-left-width) - 5px);
}
.sidebar-resizer-right {
  right: calc(var(--sidebar-right-width) - 5px);
}
.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
.sidebar-resizer[data-dragging]::after {
  background: #5078bd;
}
.sidebar-resizer:focus-visible {
  outline: 2px solid #5078bd;
  outline-offset: -2px;
}
.resizing-sidebar,
.resizing-sidebar * {
  cursor: col-resize !important;
  user-select: none !important;
}
#demo-layout:is(.settings-open, .memory-open) > .sidebar-resizer-right {
  display: none;
}

#demo-layout.understanding-open {
  grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
  height: calc(100dvh - 64px);
  min-height: 0;
}
#demo-layout.understanding-open > .sidebar-resizer-right {
  display: none;
}
.understanding-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 28px;
  overflow: hidden;
}
.understanding-workspace > .memory-workspace-heading,
#understanding-notice {
  flex-shrink: 0;
}
#understanding-notice.error {
  color: var(--destructive);
}
.understanding-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.understanding-setup {
  padding: 16px 0 24px;
  border-bottom: 1px solid var(--border);
}
.understanding-workspace h2 {
  font-size: 16px;
}
.understanding-account {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 13px;
}
.understanding-account input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}
.understanding-columns {
  display: grid;
  grid-template-columns: minmax(160px, 230px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 20px;
}
.understanding-history button {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.understanding-history button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--border-strong);
}
.understanding-result {
  min-width: 0;
}
#understanding-report {
  margin: 20px 0;
  overflow-wrap: anywhere;
}
#understanding-coverage pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  max-height: 320px;
  overflow: auto;
}
#understanding-claims textarea {
  width: 100%;
  min-height: 70px;
}
#understanding-claims .memory-evidence {
  max-width: 100%;
}
@media (max-width: 1100px) {
  #demo-layout.understanding-open {
    grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
    height: calc(100dvh - 64px);
  }
}
@media (max-width: 650px) {
  #demo-layout.understanding-open {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 64px);
  }
  .understanding-workspace {
    flex: 1;
    padding: 20px 16px;
  }
  .understanding-columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .understanding-history {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
  }
}

#history {
  gap: 3px;
}
#history > .history-session {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
}
.history-session-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1px 6px;
  min-width: 0;
  min-height: 42px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--foreground);
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.5;
}
.history-session-open:hover:not(:disabled) {
  background: var(--accent);
}
.history-title {
  min-width: 0;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#history .history-time {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-session.selected .history-session-open {
  background: #f1f5fb;
  border-color: #dce5f3;
}
.history-current {
  grid-column: 2;
  grid-row: 1;
  padding: 0 4px;
  border-radius: 4px;
  color: #5078bd;
  background: #e4ecf8;
  font-size: 10px;
  line-height: 1.7;
}
.history-session-delete {
  visibility: hidden;
  display: grid;
  place-items: center;
  align-self: start;
  width: 30px;
  min-height: 30px;
  margin-top: 3px;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  opacity: 0;
  cursor: pointer;
  transition:
    color 120ms,
    background 120ms,
    opacity 120ms;
}
.history-session-delete .ui-icon {
  width: 15px;
  height: 15px;
}
.history-session:hover .history-session-delete,
.history-session:focus-within .history-session-delete {
  visibility: visible;
  opacity: 1;
}
.history-session-delete:hover:not(:disabled),
.history-session-delete:focus-visible {
  color: #b42318;
  background: #fef0ef;
}
@media (hover: none) {
  .history-session-delete {
    visibility: visible;
    opacity: 0.75;
  }
}

#history-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin: 4px 0 0;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}
.archive-heading-copy {
  min-width: 0;
  flex: 1;
}
.archive-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
}
#history-session-title {
  font-size: 15px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.archive-readonly {
  color: var(--muted);
  font-size: 10px;
}
#history-banner button {
  flex-shrink: 0;
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}
#new-current-message {
  width: 100%;
  margin: 0;
  color: #1d4ed8;
  font-size: 11px;
}
.chat:has(#history-banner:not([hidden]))
  > :is(.chat-heading, .composer-toolbar, #composer, #send-shortcut) {
  display: none;
}

.settings > :is(.settings-heading, #settings-notice, .settings-stack) {
  max-width: 740px;
  margin-inline: auto;
}
.settings-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.settings-card {
  min-width: 0;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}
.settings-card > h2,
.usage-heading h2 {
  font-size: 1.25rem;
}
.settings-card .settings-description {
  font-size: 0.93rem;
  line-height: 1.6;
}
.settings-card > small {
  display: block;
  margin-top: 6px;
}
#account-id {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--subtle);
  font-size: 0.93rem;
}
#account-id dt {
  color: var(--text-secondary);
}
#account-id dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.usage-heading,
.usage-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.usage-heading {
  justify-content: space-between;
  margin-bottom: 18px;
}
.usage-controls :is(#usage-period, #usage-refresh) {
  width: auto;
  min-height: 44px;
  margin: 0;
  padding-inline: 12px;
  font-size: 0.93rem;
}
#usage-status {
  margin: 0;
}
#usage-status:not(:empty) {
  padding: 14px;
  border-radius: 10px;
  background: var(--subtle);
  color: var(--text-secondary);
  line-height: 1.6;
}
.usage-costs,
.usage-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
  gap: 10px;
  margin: 0;
}
.usage-costs > div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--subtle);
}
.usage-totals {
  margin-top: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.usage-costs dt,
.usage-totals dt,
.usage-breakdown dt {
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.5;
}
.usage-costs dd,
.usage-totals dd {
  margin: 5px 0 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.usage-costs dd {
  font-size: 1.4rem;
  letter-spacing: -0.025em;
}
.usage-costs small {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: normal;
}
.usage-details {
  border-bottom: 1px solid var(--border);
}
.usage-details > summary {
  align-content: center;
  min-height: 44px;
  color: var(--foreground);
  cursor: pointer;
  font-size: 0.93rem;
  overflow-wrap: anywhere;
}
.usage-details[open] > :last-child {
  margin-bottom: 12px;
}
.usage-breakdown {
  display: grid;
  gap: 8px;
  margin: 0;
}
.usage-breakdown dd {
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.usage-models h3 {
  margin: 18px 0 2px;
  font-size: 1rem;
}
.usage-note {
  display: block;
  margin-top: 12px;
  color: var(--text-secondary);
}
@media (max-width: 500px) {
  .usage-costs,
  .usage-totals {
    grid-template-columns: minmax(0, 1fr);
  }
  .usage-costs > div,
  .usage-totals > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
  }
  .usage-costs dd,
  .usage-totals dd {
    margin: 0;
    text-align: end;
  }
}

.settings :is(input, select, textarea) {
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.5;
}
.settings label {
  margin: 10px 0 6px;
  font-size: 11px;
}
.settings button {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11px;
}
.settings .icon-button {
  width: 28px;
  min-height: 28px;
  padding: 5px;
}
.settings small,
.settings .metadata {
  font-size: 0.86rem;
  line-height: 1.6;
}
#connection,
#select-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: center;
}
#connection label,
#select-user label,
#connection small,
#select-user small {
  grid-column: 1 / -1;
  margin: 0;
}
#connection button,
#select-user button {
  margin: 0;
}
#connection small,
#select-user small {
  margin-top: 2px;
}
.settings-disclosure > summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.7;
}
.settings-disclosure > form {
  margin-top: 12px;
}
.user-id-settings:has(#select-user[hidden]) {
  display: none;
}
.integration-services > summary {
  margin-top: 10px;
}
.integration-service p {
  font-size: 11px;
  line-height: 1.6;
}
.integration-service h4 {
  font-size: 12px;
}
.integration-provider .section-title {
  margin: 0 0 8px;
}
.provider-heading p {
  font-size: 11px;
}
.provider-heading h3 {
  font-size: 13px;
}
#naver-form {
  gap: 5px;
  margin-top: 10px;
}
#naver-form label {
  margin: 6px 0 0;
}
.setup-required {
  margin-top: 16px;
  padding: 9px 12px;
  font-size: 11px;
  line-height: 1.6;
}
@media (max-width: 1100px) {
  .sidebar-resizer-right {
    display: none;
  }
}
@media (max-width: 650px) {
  .sidebar-resizer {
    display: none;
  }
  .settings {
    padding: 24px 18px;
  }
  .settings-heading h1 {
    font-size: 22px;
  }
  .settings-heading .back-to-chat {
    display: inline-flex;
    margin-top: 4px;
  }
  .settings-stack {
    margin-top: 12px;
  }
  .integration-provider {
    padding: 12px;
  }
  .archive-heading-copy {
    flex-basis: 60%;
  }
  #history-banner button {
    margin-left: auto;
  }
}

.browser-context-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 12px 0 8px;
}
#browser-location-status,
#browser-location-help {
  color: var(--muted);
}

/* iMessage-inspired sender alignment and compact groups of distinct bubbles. */
.message.assistant {
  width: fit-content;
  max-width: min(92%, 720px);
  padding: 0;
}
.message.assistant .message-content {
  padding: 11px 16px;
  border-radius: 20px;
  background: #e9e9eb;
  color: #171719;
}
.message.user {
  padding: 11px 16px;
  border-radius: 20px;
  background: #007aff;
  color: #fff;
}
.message.user.bubble-last {
  border-bottom-right-radius: 6px;
}
.message.assistant.bubble-last .message-content {
  border-bottom-left-radius: 6px;
}
.message.bubble-continuation {
  margin-top: -19px;
}
.message.bubble-continuation > .role {
  display: none;
}
.message.assistant .role {
  padding-left: 12px;
  margin-bottom: 5px;
}
.message.assistant.typing-message {
  padding: 0;
}
.typing-message .typing-dots {
  background: #e9e9eb;
}
.message.assistant .markdown-content :not(pre) > code {
  background: #dcdce0;
}
.message.assistant .markdown-content a {
  color: #005fc5;
}
@media (max-width: 650px) {
  .message.assistant {
    max-width: 96%;
  }
  .message.assistant .message-content,
  .message.user {
    padding: 10px 14px;
  }
}

.human-input-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line, #d7dbe0);
  border-radius: 14px;
  width: min(100%, 600px);
  box-sizing: border-box;
  margin: 12px 0;
  background: var(--surface, #fff);
}
.human-input-card p {
  margin: 0;
  white-space: pre-wrap;
}
.human-input-context,
.human-input-status {
  color: var(--muted, #64748b);
  font-size: 13px;
}
.human-input-options {
  display: grid;
  gap: 8px;
}
.human-input-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 12px;
  white-space: normal;
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border);
}
.human-input-option[aria-pressed="true"] {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  background: var(--accent);
}
.human-input-option span {
  font-size: 13px;
  font-weight: 400;
}
.human-input-option:hover:not(:disabled) {
  background: var(--accent);
  color: var(--foreground);
}
.human-input-card textarea {
  min-height: 72px;
  resize: vertical;
}
.human-input-card button[type="submit"] {
  align-self: flex-start;
}

/* Authenticated user uploads retain readable names and bounded photo previews. */
.message-attachments {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.message-attachments:empty {
  display: none;
}
.message-attachments img {
  display: block;
  max-width: 100%;
  object-fit: contain;
}
.attachment-file {
  min-height: 44px;
  border-radius: 14px;
  padding: 8px 12px;
  overflow-wrap: anywhere;
}
.message.user .attachment-file {
  color: inherit;
  background: rgb(255 255 255 / 14%);
  border: 1px solid rgb(255 255 255 / 25%);
}
#attachment-draft {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#attachment-draft:empty {
  display: none;
}

.live-browser {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.live-browser-heading,
.live-browser-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.live-browser-heading strong {
  margin-right: auto;
}
.live-browser p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
.live-browser button,
.live-browser input {
  min-height: 36px;
}
.live-browser-viewport {
  min-height: 48px;
  overflow: auto;
  border-radius: 12px;
  background: var(--subtle);
}
.live-browser video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  touch-action: none;
}
.live-browser video[aria-disabled="false"] {
  cursor: crosshair;
}
.live-browser input {
  width: 100%;
  min-width: 0;
  flex: 1;
}
.live-browser form label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}
.live-browser-expanded {
  position: fixed;
  inset: 16px;
  z-index: 100;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 16px 80px #0006;
  overflow: hidden;
}
.live-browser-expanded > :is(label, details) {
  display: none;
}
.live-browser-expanded > :not(.live-browser-viewport) {
  flex-shrink: 0;
}
.live-browser-expanded .live-browser-viewport {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
.live-browser-expanded video {
  width: 100%;
  height: 100%;
}
@media (max-width: 700px) {
  .live-browser-expanded {
    inset: 6px;
    padding: 12px;
  }
}

.browser-login-account {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.browser-login-account p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.composer-toolbar .show-tools-toggle:has(#fast-mode) {
  margin-left: 0;
}

.conversation-older {
  display: block;
  margin: 0 auto 24px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--foreground);
  font: inherit;
}
.conversation-older:hover:not(:disabled),
.trace-load-diagnostics:hover:not(:disabled) {
  background: var(--accent);
  color: var(--foreground);
}
.trace-load-diagnostics {
  min-height: 44px;
  margin-top: 10px;
  background: var(--subtle);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 10px;
}
@media (max-width: 650px) {
  #demo-chat #demo-chat-panel {
    flex: 1 1 0;
    overflow: hidden;
  }
}

/* Native v2 resource views retain the workbench's restrained reading surfaces. */
[hidden] {
  display: none !important;
}
.chat-heading h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}
.chat
  > :is(
    .composer-meta,
    #attachment-draft,
    #input-requests,
    #messages-more,
    small
  ) {
  width: calc(100% - 64px);
  max-width: var(--chat-width);
  margin: 8px auto;
  flex-shrink: 0;
}
.composer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.v2-resource-card,
.v2-input-request,
.v2-surface {
  border: 1px solid var(--border);
  background: var(--subtle);
  border-radius: 14px;
  padding: 16px;
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.v2-resource-card > strong {
  display: block;
}
.v2-resource-card > button {
  margin: 8px 6px 0 0;
}
.v2-input-request pre {
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
}
.v2-input-request button {
  width: auto;
  margin: 8px 8px 0 0;
}
.v2-reaction-picker select {
  width: auto;
  padding: 4px 8px;
  margin-top: 8px;
  font-size: 12px;
}
.v2-reactions {
  margin: 6px 0 0;
  font-size: 14px;
}
.v2-source-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--subtle);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.7;
}
.v2-source-option input {
  width: auto;
  flex-shrink: 0;
  margin-top: 4px;
}
.v2-source-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}
#report-sources {
  max-height: 320px;
  overflow: auto;
  margin: 12px 0;
}
.v2-surface dl {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 2fr;
  gap: 8px;
}
.v2-surface dd {
  margin: 0;
}
.v2-chart-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.v2-chart-bar {
  height: 6px;
  flex-basis: auto;
  border-radius: 4px;
  background: var(--foreground);
  margin-top: 6px;
}
#input-requests:not(:empty) {
  max-height: 35vh;
  overflow: auto;
}
.settings-stack form {
  margin: 16px 0;
}
.settings-stack input[type="checkbox"],
#photo-consent {
  width: auto;
}
.connector-details {
  margin-top: 12px;
}
#tasks-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
#tasks-inputs,
#tasks-detail-meta,
#tasks-open-chat {
  margin: 10px 32px;
}
.oauth-page {
  max-width: 640px;
  margin: 10vh auto;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--background);
}
.oauth-page h1 {
  font-size: 26px;
}
.oauth-page p {
  line-height: 1.8;
}
.oauth-page a {
  display: block;
  margin: 20px 0;
  text-decoration: underline;
}
@media (max-width: 650px) {
  .chat-heading {
    flex-direction: column;
    gap: 8px;
  }
  .chat-heading .record-actions {
    flex-wrap: wrap;
  }
  .chat
    > :is(
      .composer-meta,
      #attachment-draft,
      #input-requests,
      #messages-more,
      small
    ) {
    width: calc(100% - 32px);
  }
  .v2-resource-card,
  .v2-input-request,
  .v2-surface {
    padding: 12px;
  }
  .settings-stack input,
  .settings-stack textarea {
    font-size: 16px;
  }
  .oauth-page {
    margin: 24px 12px;
    padding: 20px;
  }
  #tasks-inputs,
  #tasks-detail-meta,
  #tasks-open-chat {
    margin: 10px 16px;
  }
}
.chat-heading {
  justify-content: space-between;
}
.live-browser-viewport:not(:has(video:not([hidden]))) {
  display: none;
}
.oauth-page {
  display: block;
  height: auto;
}
@media (prefers-color-scheme: dark) {
  .message.assistant .message-content,
  .typing-message .typing-dots {
    background: #303035;
    color: var(--foreground);
  }
  .message.assistant .markdown-content :not(pre) > code {
    background: #43434b;
  }
  .message.assistant .markdown-content a {
    color: #8fbbff;
  }
}
@media (max-width: 650px) {
  .demo-navigation {
    gap: 8px;
    white-space: nowrap;
    overflow-x: auto;
  }
  .demo-navigation a {
    flex-shrink: 0;
    min-height: 44px;
  }
  .record-actions button,
  .settings-stack button,
  .v2-reaction-picker select {
    min-height: 44px;
  }
}
.v2-history-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.v2-history-filter input {
  width: auto;
  margin: 0;
}
#cognito-auth [hidden] {
  display: none !important;
}
#auth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
}
#auth-google:hover:not(:disabled) {
  background: var(--accent);
}
#auth-google svg {
  flex: 0 0 18px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
#auth-email-form,
#auth-code-form {
  display: grid;
  gap: 10px;
}
#auth-email-form label,
#auth-code-form label {
  margin: 0 0 -4px;
  font-size: 13px;
  font-weight: 500;
}
#auth-code-form .record-actions {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
#auth-code {
  font-size: 20px;
  letter-spacing: 0.35em;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
#auth-code-destination {
  margin: 0;
  overflow-wrap: anywhere;
}
.auth-hint {
  color: var(--muted);
}
#cognito-auth,
.account-auth .settings-description,
#passkeys-card {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
#passkeys-card[hidden],
#passkeys-empty[hidden],
#passkeys-status:empty {
  display: none;
}
#passkeys-card {
  display: grid;
  gap: 12px;
  align-content: start;
}
#passkeys-card > * {
  margin: 0;
}
#passkeys-add {
  justify-self: start;
  min-height: 44px;
}
.passkey-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.passkey-list:empty {
  display: none;
}
.passkey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--subtle);
}
.passkey-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.passkey-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.passkey-row small {
  color: var(--muted);
}
.passkey-row button {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 64px;
}
.passkey-row button.danger {
  border-color: var(--destructive);
  color: var(--destructive);
  background: var(--destructive-surface);
}
#imessage-card > *,
#imessage-card .imessage-group > * {
  margin: 0;
}
#imessage-card,
#imessage-card .imessage-group {
  display: grid;
  gap: 10px;
}
#imessage-card h3 {
  font-size: 0.95rem;
}
#imessage-address:empty,
#imessage-status:empty {
  display: none;
}
#imessage-status {
  font-size: 12px;
  line-height: 1.7;
}
.imessage-pending-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.imessage-pending {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--subtle);
}
.imessage-pending-heading {
  display: grid;
  gap: 2px;
}
.imessage-pending-heading small,
.imessage-pending > small {
  color: var(--muted);
}
.imessage-held {
  margin: 0;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--border-strong);
  max-height: 16em;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.imessage-pending .record-actions {
  justify-content: flex-end;
}
.imessage-pending button,
#imessage-card .passkey-row button {
  min-height: 44px;
  min-width: 64px;
}
#imessage-card button.danger {
  border-color: var(--destructive);
  color: var(--destructive);
  background: var(--destructive-surface);
}
#imessage-card button.armed {
  outline: 2px solid var(--focus, currentColor);
  outline-offset: 2px;
}
#passkeys-status {
  font-size: 12px;
  line-height: 1.7;
}
#auth-notice:empty {
  display: none;
}
#auth-notice {
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
#account-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-wrap: anywhere;
}
.account-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  object-fit: cover;
}
#cognito-auth .record-actions {
  flex-wrap: wrap;
}
@media (prefers-color-scheme: dark) {
  .swagger-ui {
    color-scheme: light;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    color: #171717;
  }
}

/* Product destinations share one owner-verified controller and restrained surfaces. */
#demo-layout.product-open {
  grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr);
}
.product-open #resize-right,
.product-open #demo-memory,
.product-open #demo-task-sidebar {
  display: none;
}
.product-workspace {
  padding: clamp(24px, 4vw, 56px);
}
.product-heading,
.product-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.product-heading h1 {
  font-size: clamp(24px, 3vw, 34px);
  margin-bottom: 12px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}
.product-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  overflow-wrap: anywhere;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 12px;
}
.product-card p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}
.product-card h2 {
  margin: 0;
  font-size: 17px;
}
.product-card a {
  margin-top: auto;
  padding-block: 8px;
}
.product-card small,
.privacy-note {
  color: var(--muted);
  line-height: 1.6;
}
.product-toolbar label {
  max-width: 480px;
  flex: 1;
}
#vault-dialog {
  max-width: min(520px, calc(100vw - 32px));
  width: 100%;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 28px;
  color: var(--foreground);
  background: var(--surface);
  box-shadow: 0 24px 80px #0002;
}
#vault-dialog::backdrop {
  background: #0004;
  backdrop-filter: blur(4px);
}
#vault-form {
  display: grid;
  gap: 12px;
}
#vault-form input {
  min-width: 0;
  width: 100%;
  min-height: 46px;
}
#vault-error {
  color: var(--destructive);
}
#browser-mount .live-browser {
  max-width: 1100px;
  margin: 24px auto;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
}
.demo-navigation {
  flex-wrap: wrap;
  row-gap: 8px;
}
.demo-navigation a,
.product-workspace button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.login-label {
  display: none;
}
#demo-layout[data-verified="false"] > :not(#demo-settings) {
  visibility: hidden;
}
.sierra-login > header {
  border: 0;
}
.sierra-login header nav {
  display: none;
}
#demo-layout.login-open {
  display: block;
  height: auto;
  min-height: calc(100dvh - 64px);
  padding: 36px 20px;
  background: var(--subtle);
}
.login-open > :not(#demo-settings) {
  display: none !important;
}
.login-open #demo-settings {
  display: block;
  max-width: 480px;
  margin: auto;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
}
.login-open .settings-heading a,
.login-open .settings-description,
.login-open .settings-label,
.login-open .settings-card:not(.account-auth),
.login-open #logout,
.login-open .account-signout-note,
.login-open #account-info,
.login-open #account-id {
  display: none;
}
.login-open .login-label {
  display: inline;
}
.login-open .account-auth .settings-description {
  display: block;
}
.login-open .account-auth {
  display: grid;
  gap: 16px;
  padding: 0;
  border: 0;
}
.login-open .account-auth h2 {
  display: none;
}
.login-open #cognito-auth {
  display: grid;
  gap: 16px;
}
.login-open input,
.login-open button {
  min-height: 46px;
  width: 100%;
}
.login-open .record-actions {
  display: grid;
  gap: 8px;
}
.login-open .settings-heading {
  margin-bottom: 24px;
}
.login-open .settings-heading h1 {
  font-size: 28px;
  margin-bottom: 0;
}
#demo-layout[data-verified="true"] #auth-help,
#demo-layout[data-verified="true"] #cognito-auth,
#demo-layout[data-verified="true"][data-auth-mode="cognito"] #connection {
  display: none;
}
@media (max-width: 650px) {
  #demo-layout.product-open {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: calc(100dvh - 64px);
  }
  .product-open #demo-users {
    max-height: none;
  }
  .product-heading,
  .product-toolbar {
    flex-wrap: wrap;
  }
  .product-workspace {
    overflow: visible;
  }
  .login-open #demo-settings {
    padding: 24px;
  }
}
@media (prefers-reduced-transparency: reduce) {
  #vault-dialog::backdrop {
    backdrop-filter: none;
    background: #0009;
  }
}

.product-open #demo-history {
  display: none;
}
.voice-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.voice-controls button {
  min-height: 44px;
}
@media (max-width: 650px) {
  .demo-navigation {
    flex-wrap: nowrap;
  }
}

.parity-wide,
.parity-toolbar {
  grid-column: 1 / -1;
}
.parity-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.parity-toolbar label {
  flex: 1;
  min-width: 180px;
}
.parity-toolbar select,
.parity-toolbar input {
  min-height: 44px;
}
.product-artwork {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 20px;
  background: var(--subtle);
}
.shopping-grid .product-card {
  overflow: hidden;
}
.shopping-grid .product-artwork {
  max-height: 260px;
}
#parity-detail {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 28px;
  color: var(--foreground);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 24px 80px #0003;
}
#parity-detail::backdrop {
  background: #0005;
  backdrop-filter: blur(4px);
}
#parity-detail > * {
  margin-bottom: 16px;
}
#parity-detail > button {
  margin-right: 8px;
  min-height: 44px;
}
#parity-detail .product-card {
  margin-block: 16px;
}
#parity-detail label {
  display: grid;
  gap: 8px;
}
#parity-detail input {
  min-height: 44px;
  width: 100%;
}
.app-catalog-glyph,
.friend-profile-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 600;
  color: white;
  border-radius: 20px;
}
.companion-card {
  align-items: center;
  text-align: center;
}
.companion-portrait {
  width: 140px;
  height: 140px;
  font-size: 80px;
  display: grid;
  place-items: center;
  background: var(--subtle);
  border-radius: 48px;
}
.companion-card progress {
  accent-color: #63896b;
  width: min(100%, 240px);
  height: 8px;
}
.mission-card {
  grid-column: span 2;
}
.mission-row {
  width: 100%;
  padding-block: 14px;
  border-top: 1px solid var(--border);
}
.mission-row h3 {
  margin: 0 0 8px;
}
.mission-row button {
  margin-right: 8px;
  margin-top: 12px;
}
.meal-ingredients label {
  min-height: 52px;
  display: flex !important;
  align-items: center;
  gap: 12px;
}
.meal-ingredients input {
  width: 22px !important;
  min-height: 22px !important;
}
.friend-debug-room {
  margin-top: 28px;
}
.friend-transcript {
  max-height: 480px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--subtle);
  border-radius: 24px;
  margin-block: 16px;
}
.friend-bubble {
  width: fit-content;
  max-width: 88%;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
}
.friend-bubble p {
  white-space: pre-wrap;
  margin: 6px 0;
}
.friend-me {
  align-self: end;
}
.friend-my-character,
.friend-friend-character {
  border-style: dashed;
}
.friend-debug-room form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}
.friend-debug-room textarea {
  min-height: 80px;
  width: 100%;
}
@media (max-width: 900px) {
  .mission-card {
    grid-column: auto;
  }
}
@media (max-width: 650px) {
  #parity-detail {
    padding: 20px;
  }
  .friend-debug-room form {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-transparency: reduce) {
  #parity-detail::backdrop {
    backdrop-filter: none;
    background: #0009;
  }
}
.native-companion {
  width: 120px;
  height: 120px;
  object-fit: contain;
}
img.companion-portrait {
  width: 176px;
  height: 176px;
  object-fit: contain;
  background: transparent;
  border-radius: 50%;
}
img.friend-profile-avatar {
  object-fit: cover;
  border-radius: 24px;
}
.companion-emoji {
  font-size: 24px;
}
.browser-network {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
}
.browser-network summary {
  cursor: pointer;
  min-height: 32px;
  align-content: center;
}
.browser-network fieldset {
  border: 0;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.browser-network label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}
.browser-network select,
.browser-network input {
  width: 100%;
  min-height: 44px;
  min-width: 0;
}
.browser-network [data-live-route-options] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
}

.browser-handoff { max-width: 28rem; }
.browser-handoff-preview { position: relative; overflow: hidden; display: flex; min-height: 140px; padding: 1rem; gap: .6rem; border-radius: 1rem; align-items: center; justify-content: center; flex-direction: column; background: var(--surface-soft, #f2f2f7); color: var(--text, #1c1c1e); overflow-wrap: anywhere; }
.browser-handoff button { min-height: 44px; margin: .35rem .4rem 0 0; }
.browser-handoff button.browser-handoff-preview { width: 100%; min-height: 140px; margin: 0; border: 0; font: inherit; cursor: pointer; }
.browser-password-sheet { width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 3rem); overflow: auto; border: 1px solid var(--border, #ccc); border-radius: 1.5rem; padding: 1.5rem; background: var(--surface, #fff); color: var(--text, #1c1c1e); }
.browser-password-sheet::backdrop { background: rgb(0 0 0 / 30%); }
.browser-password-sheet button { display: block; width: 100%; min-height: 44px; margin-block: .6rem; }
@media (prefers-color-scheme: dark) { .browser-password-sheet { background: #1c1c1e; color: #fff; } .browser-handoff-preview { background: #2c2c2e; color: #fff; } }

.browser-handoff-preview img { position: absolute; inset: 0; border-radius: inherit; }
/* Live calls remain readable in the app's light and dark palettes. */
.phone-card { display:flex; flex-direction:column; gap:12px; width:min(100%,420px); padding:20px; border:1px solid var(--border, #8883); border-radius:24px; background:var(--surface, #f4f4f6); color:inherit; text-align:left; font:inherit; cursor:pointer; }
.phone-card:hover { filter:brightness(.98); }
.phone-card-title { font-size:17px; font-weight:650; }
.phone-status { font-size:13px; color:#1479eb; font-weight:600; }
.phone-muted,.phone-speaker { color:var(--muted, #76767e); font-size:13px; }
.phone-preview,.phone-preview-turn { display:flex; flex-direction:column; gap:5px; }
.phone-preview { gap:12px; }
.phone-preview-text { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.5; }
.phone-dialog { width:min(720px,calc(100vw - 32px)); height:min(860px,calc(100dvh - 32px)); padding:0; border:1px solid var(--border, #8883); border-radius:28px; color:var(--foreground, #202025); background:var(--background, #fff); box-shadow:0 16px 70px #0003; overflow:hidden; }
.phone-dialog[open] { display:flex; flex-direction:column; }
.phone-dialog::backdrop { background:#20202555; backdrop-filter:blur(8px); }
.phone-dialog-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 24px; border-bottom:1px solid var(--border, #8883); }
.phone-dialog-header h2 { margin:0; font-size:19px; overflow-wrap:anywhere; }
.phone-dialog button { min-height:44px; }
.phone-dialog-content { padding:20px 24px max(24px,env(safe-area-inset-bottom)); overflow-y:auto; overscroll-behavior:contain; }
.phone-stop { background:var(--surface, #f4f4f6); color:#d33a37; border-radius:24px; padding:10px 20px; border:1px solid var(--border, #8883); cursor:pointer; }
.phone-transcript { display:flex; flex-direction:column; gap:20px; padding-top:20px; }
.phone-turn { align-self:flex-start; max-width:90%; }
.phone-turn p { padding:14px 18px; border-radius:22px; background:color-mix(in srgb, var(--foreground, #202025) 6%, var(--background, #fff)); margin:6px 0 0; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }
.phone-assistant { align-self:flex-end; }
.phone-assistant p { background:#1479eb; color:white; }
.phone-summary { padding-top:20px; line-height:1.6; white-space:pre-wrap; }
.phone-summary h3 { font-size:14px; }
.phone-empty { text-align:center; color:var(--muted, #76767e); padding:30px 0; }
@media (max-width:600px) { .phone-dialog { width:100%; height:100dvh; max-width:100%; max-height:100%; border-radius:0; border:0; } .phone-dialog-content { padding-inline:16px; } }
@media (prefers-reduced-transparency:reduce) { .phone-dialog::backdrop { background:#555; backdrop-filter:none; } }

/* Dedicated phone and SMS inbox. */
.phone-inbox-root { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.phone-inbox-root > *, .phone-inbox-grid > * { min-width: 0; }
.phone-account .phone-number { color: var(--foreground); font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 600; letter-spacing: -.025em; }
.phone-compose { display: grid; gap: 14px; align-content: start; }
.phone-compose label { display: grid; gap: 8px; }
.phone-compose input, .phone-compose textarea { width: 100%; box-sizing: border-box; min-height: 44px; font: inherit; }
.phone-compose button { min-height: 44px; justify-self: start; }
.phone-inbox-grid { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.phone-inbox-root .phone-thread-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; text-align: left; width: 100%; min-height: 64px; padding: 14px; border-radius: 16px; margin-block: 6px; background: var(--surface); color: var(--foreground); border: 1px solid var(--border); }
.phone-thread-row[aria-pressed="true"] { background: var(--hover); }
.phone-thread-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-text { max-width: 92%; padding: 12px 16px; margin-block: 8px; border: 1px solid var(--border); border-radius: 18px; overflow-wrap: anywhere; }
.phone-text p { white-space: pre-wrap; color: var(--foreground); }
.phone-text-assistant { align-self: flex-end; }
.phone-text-recipient { align-self: flex-start; }
.phone-text .phone-delivery-error { color: #ce4b43; }
@media (max-width: 850px) { .phone-inbox-root { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 620px) { .phone-inbox-grid { grid-template-columns: minmax(0, 1fr); } }

/* The controller owns these subtrees; no parallel React interaction state. */
.workspace-header { height: 56px; padding: 0 22px; background: var(--surface); }
.workspace-brand { display: flex; align-items: center; gap: 14px; }
.workspace-header .brand { font-size: 18px; gap: 9px; letter-spacing: -.5px; }
.workspace-header .brand .brand-mark { display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 8px; color: var(--primary-foreground); background: var(--primary); font-size: 21px; font-weight: 650; }
.workspace-caption { border-left: 1px solid var(--border); padding-left: 14px; color: var(--muted); font-size: 12px; }
#demo-layout { height: calc(100dvh - 56px); }
#demo-users { display: flex; flex-direction: column; gap: 18px; padding: 22px 16px 14px; overflow: hidden; background: var(--subtle); }
.session-sidebar-heading .eyebrow { margin: 0 10px 16px; letter-spacing: 1.8px; font-size: 10px; }
.new-session { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--foreground); text-align: left; font-weight: 550; box-shadow: 0 1px 2px #00000006; }
.new-session span { font-size: 19px; line-height: 1; font-weight: 400; }
#demo-history { flex: 1; display: flex; flex-direction: column; min-height: 100px; overflow: hidden; }
.session-search { margin: 0; }
.session-search input { min-height: 36px; padding: 8px 11px; border-color: transparent; background: transparent; font-size: 12px; }
.session-search input:focus { background: var(--surface); border-color: var(--border-strong); }
#demo-history .section-title { padding: 0 10px; margin: 16px 0 4px; }
#demo-history h2 { font-size: 11px; color: var(--muted); font-weight: 500; }
#demo-history h2 svg { display: none; }
.v2-history-filter { margin: 4px 10px 12px; font-size: 11px; color: var(--muted); }
#history { min-height: 0; overflow-y: auto; gap: 3px; padding: 3px; scrollbar-width: thin; }
#history .session-row { display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; text-align: left; background: transparent; color: var(--foreground); }
#history .session-row[aria-current="true"] { background: var(--accent); border-color: var(--border); }
.session-row-title { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; line-height: 1.5; }
.session-row-meta { font-size: 10px; color: var(--muted); }
#history .empty { padding: 12px 8px; font-size: 12px; line-height: 1.7; }
.workspace-destinations { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 0; padding-top: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.workspace-destinations a { min-width: 0; min-height: 32px; padding: 6px 9px; font-size: 11px; gap: 7px; }
.workspace-destinations svg { width: 14px; height: 14px; }
.chat-open #demo-chat { background: var(--background); padding: 0; }
.chat-open #demo-chat-panel { --chat-width: 820px; padding: 0 0 max(20px, env(safe-area-inset-bottom)); }
.chat-open .chat-heading { align-items: center; width: 100%; max-width: none; padding: 22px 30px 18px; margin: 0; border-bottom: 1px solid var(--border); gap: 12px; }
.session-heading-copy { min-width: 0; }
.session-heading-copy .eyebrow { margin: 0 0 7px; font-size: 9px; letter-spacing: 1.5px; }
.chat-open .chat-heading h1 { font-size: 16px; line-height: 1.5; }
.chat-open .chat-heading .record-actions { flex-wrap: nowrap; flex-shrink: 0; gap: 3px; }
.chat-open .chat-heading button { font-size: 11px; padding: 7px 9px; background: transparent; border-color: transparent; color: var(--muted); border-radius: 7px; min-height: 34px; }
.chat-open #notice:empty { display: none; }
.chat-open #messages { display: flex; flex-direction: column; gap: 16px; padding-top: 26px; padding-bottom: 26px; }
.chat-open .message.user { background: var(--accent); color: var(--foreground); border-radius: 16px; padding: 11px 16px; max-width: 88%; margin-left: auto; }
.chat-open .message.assistant { padding: 8px 0; }
.chat-open .message.assistant .message-content { background: transparent; color: var(--foreground); padding: 0; border: 0; border-radius: 0; }
.chat-open .message .role { display: block; color: var(--muted); font-size: 9px; letter-spacing: 1.5px; margin-bottom: 8px; }
.chat-open .v2-reaction-picker select { border-color: transparent; background: transparent; color: var(--muted); font-size: 10px; margin-top: 4px; }
.chat-open .v2-reaction-picker { margin: 3px 0 0; }
.chat-open button { transition: none; }
.chat-open #composer { padding: 12px 12px 12px 16px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--subtle); box-shadow: 0 3px 18px #00000004; gap: 8px; }
.chat-open #prompt { min-height: 44px; max-height: 220px; line-height: 1.6; padding: 10px 0; background: transparent; }
.chat-open #composer:focus-within { border-color: var(--ring); }
.chat-open #composer .icon-button { width: 34px; height: 34px; min-height: 34px; border-radius: 50%; flex-shrink: 0; }
.chat-open #attach { background: transparent; color: var(--muted); }
.chat-open #send { background: var(--primary); color: var(--primary-foreground); }
.chat-open .workspace-browser-section .live-browser { border: 0; padding-bottom: 0; }
.chat-open .composer-meta { margin-top: 6px; margin-bottom: 2px; font-size: 11px; }
.chat-open .composer-meta .metadata { font-size: 10px; }
.chat-open .voice-controls { margin: 2px 32px 6px; font-size: 10px; }
.chat-open .voice-controls button { min-height: 28px; padding: 5px 8px; font-size: 10px; background: transparent; border-color: transparent; color: var(--muted); }
.chat-open .chat > small { margin-bottom: 0; font-size: 10px; color: var(--muted); }
.workspace-welcome { margin: auto; width: min(100%, 530px); padding: 40px 8px; }
.welcome-mark { display: block; font-size: 40px; line-height: 1; margin-bottom: 24px; color: var(--muted); }
.workspace-welcome h2 { font-size: clamp(22px, 2.3vw, 30px); letter-spacing: -1px; font-weight: 550; line-height: 1.4; }
.workspace-welcome p { color: var(--muted); line-height: 1.8; max-width: 420px; margin: 14px 0 24px; font-size: 13px; }
.workspace-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.workspace-suggestions button { border: 1px solid var(--border); padding: 10px 12px; border-radius: 10px; font-size: 11px; background: var(--surface); }
.tool-activity { width: 100%; border-radius: 8px; margin: -4px 0; font-size: 12px; background: transparent; }
.tool-activity summary { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 8px 4px; cursor: pointer; list-style: none; }
.tool-activity summary::-webkit-details-marker { display: none; }
.tool-state { width: 18px; flex: 0 0 18px; text-align: center; color: var(--muted); }
.tool-activity[data-state="running"] .tool-state { color: #547eeb; }
.tool-activity[data-state="failed"] .tool-state { color: var(--destructive); }
.tool-activity[data-state="interrupted"] .tool-state { color: var(--warning); }
.tool-label { flex-shrink: 0; color: var(--text-secondary); }
.tool-preview { flex: 1; min-width: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font: 11px var(--font-mono); color: var(--muted); }
.tool-status { font-size: 10px; color: var(--muted); flex-shrink: 0; }
.tool-chevron { color: var(--muted); margin-left: 2px; }
.tool-activity[open] { border: 1px solid var(--border); background: var(--subtle); padding: 0 10px 10px; }
.tool-activity[open] .tool-chevron { transform: rotate(90deg); }
.tool-facts { margin: 6px 0 6px 27px; display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 8px; font-size: 11px; }
.tool-facts dt { color: var(--muted); }
.tool-facts dd { margin: 0; overflow-wrap: anywhere; font-family: var(--font-mono); }
.tool-privacy { margin: 14px 0 0 27px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.inspector-heading { padding: 6px 0 16px; }
.inspector-heading .eyebrow { letter-spacing: 1.5px; font-size: 9px; }
.inspector-heading h2 { font-size: 13px; }
.chat-open .activity-sidebar { padding: 22px 22px; background: var(--subtle); }
.workspace-status { font-size: 14px; font-weight: 550; }
.workspace-run { display: flex; gap: 10px; align-items: baseline; font-size: 12px; padding: 7px 0; margin: 0; color: var(--text-secondary); }
.workspace-run::before { content: "○"; color: var(--muted); }
.workspace-run.completed::before { content: "✓"; }
.workspace-run.running::before { content: "●"; color: #547eeb; }
.workspace-run.failed::before { content: "!"; color: var(--destructive); }
.chat-open .activity-sidebar .sidebar-section { margin-top: 0; padding: 20px 0; border-top: 1px solid var(--border); }
.chat-open .activity-sidebar .sidebar-section > summary { font-size: 12px; }
.chat-open .activity-sidebar .empty { font-size: 11px; line-height: 1.8; }
.session-editor { width: min(420px, calc(100% - 32px)); padding: 26px; color: var(--foreground); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: 0 20px 80px #0004; }
.session-editor::backdrop { background: #0006; }
.session-editor form { margin: 0; }
.session-editor h2 { font-size: 18px; }
.session-editor .record-actions { justify-content: flex-end; gap: 8px; margin-top: 24px; }
#session-edit-error { font-size: 12px; line-height: 1.7; color: var(--destructive); }
#session-edit-error:empty { display: none; }
.panel-toggle { display: none; }
#workspace-backdrop { position: fixed; inset: 56px 0 0; width: 100%; height: auto; z-index: 80; border: 0; border-radius: 0; background: #0005; }
.login-open .session-sidebar-heading { display: none; }
body:has(.login-open) .panel-toggle { display: none; }
@media (hover: hover) and (pointer: fine) {
  .session-row:hover, .tool-activity summary:hover, .new-session:hover { background: var(--accent); }
  .chat-open .chat-heading button:hover { background: var(--accent); color: var(--foreground); }
}
@media (max-width: 1100px) {
  .chat-open #demo-memory { display: none; }
  body:has(.chat-open) #toggle-inspector { display: inline-flex; align-items: center; min-height: 36px; font-size: 11px; }
  #demo-layout.inspector-panel-open #demo-memory { display: block; position: fixed; inset: 56px 0 0 auto; width: min(360px, 90vw); z-index: 90; background: var(--surface); }
}
@media (max-width: 650px) {
  .workspace-header { padding: 0 12px; }
  .chat-open #demo-chat { flex: 1; height: auto; min-height: 0; }
  .workspace-header nav { gap: 10px; }
  .workspace-caption { display: none; }
  .workspace-brand { gap: 8px; }
  #toggle-sessions { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; background: transparent; color: var(--foreground); border: 0; }
  #demo-layout:not(.settings-open) { height: calc(100dvh - 56px); }
  #demo-layout > #demo-users { display: none; }
  #demo-layout.sessions-panel-open > #demo-users { display: flex; position: fixed; inset: 56px auto 0 0; width: min(320px, 90vw); height: auto; max-height: none; padding: 20px 14px; z-index: 90; border-right: 1px solid var(--border); background: var(--surface); }
  #demo-users .workspace-destinations { display: grid; overflow: visible; white-space: normal; }
  #demo-users .workspace-destinations a { justify-content: flex-start; min-height: 38px; }
  .session-row, .new-session { min-height: 44px; }
  .chat-open .chat-heading { flex-direction: row; padding: 16px; }
  .chat-open .chat-heading h1 { font-size: 14px; }
  .chat-open .chat-heading button { min-height: 40px; padding: 6px; font-size: 10px; }
  .chat-open #composer { padding: 8px 10px; }
  .chat-open #prompt { font-size: 16px; }
  .chat-open #composer .icon-button { min-width: 40px; min-height: 40px; }
  .chat-open #demo-chat-panel { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .chat-open .voice-controls { margin-left: 16px; }
  .tool-status { font-size: 9px; }
  .tool-activity summary { min-height: 44px; gap: 6px; }
  .tool-label { font-size: 11px; }
  .tool-preview { font-size: 10px; }
  .workspace-welcome { padding: 24px 0; }
  .workspace-welcome p { font-size: 12px; }
  .workspace-suggestions button { min-height: 44px; }
  .session-editor input { font-size: 16px; }
}
