:root {
  color-scheme: light;
  --background: #eef1ef;
  --surface: #fbfcfa;
  --surface-strong: #ffffff;
  --ink: #17211e;
  --muted: #62716b;
  --line: #d8dfdc;
  --accent: #116b63;
  --accent-strong: #0b554f;
  --accent-soft: #d9eeea;
  --amber: #9b5b00;
  --amber-soft: #fff0d4;
  --red: #a7352c;
  --red-soft: #f9e2df;
  --green: #20734b;
  --green-soft: #dff1e5;
  --shadow: 0 18px 50px rgba(28, 42, 37, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(17, 107, 99, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(155, 91, 0, 0.06), transparent 30%),
    var(--background);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(17, 107, 99, 0.25);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.35;
}

h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #e5eae7;
  font-size: 0.9em;
}

.boot {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.login-layout {
  min-height: 100vh;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 64px;
  align-items: center;
  padding: 56px 0;
}

.login-intro {
  max-width: 680px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  margin-bottom: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 800;
  letter-spacing: -0.06em;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  margin: 0;
  font-size: 13px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro-copy {
  max-width: 590px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.capability-list {
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(23, 33, 30, 0.14);
}

.capability-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(23, 33, 30, 0.1);
  color: #37433f;
}

.capability-list span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 14px;
}

.login-card .stack {
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  color: #394640;
  font-size: 13px;
  font-weight: 650;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid #cbd4d0;
  border-radius: 6px;
  background: #fdfdfc;
  color: var(--ink);
  padding: 11px 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 107, 99, 0.1);
  outline: none;
}

.primary-button,
.secondary-button,
.text-button,
.example-chip {
  border: 0;
  background: none;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 6px;
  font-weight: 650;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.secondary-button {
  border: 1px solid #ccd6d2;
  background: #f9fbfa;
  color: var(--ink);
}

.secondary-button:hover:not(:disabled) {
  background: #eef3f1;
}

.text-button {
  padding: 6px 0;
  color: var(--accent);
  font-weight: 650;
}

.text-button:hover {
  text-decoration: underline;
}

.text-button.danger {
  color: var(--red);
}

.wide {
  width: 100%;
}

.form-error,
.task-error {
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--red-soft);
  color: #7c211a;
}

.form-error {
  margin: 0;
  font-size: 13px;
}

.demo-hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 36px;
}

.topbar {
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  line-height: 1.2;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.readonly-badge,
.task-status,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.readonly-badge {
  background: var(--amber-soft);
  color: var(--amber);
}

.user-label {
  color: var(--muted);
  font-size: 13px;
}

.demo-banner {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: rgba(251, 252, 250, 0.7);
  color: var(--muted);
  font-size: 13px;
}

.demo-banner strong {
  color: var(--ink);
}

.agent-mode-status {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.agent-mode-status[data-mode="agentscope"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.side-column,
.main-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.panel,
.conversation-panel,
.history-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.94);
}

.panel {
  padding: 18px;
}

.connection-panel {
  border-top: 3px solid var(--accent);
}

.panel-heading,
.conversation-header,
.task-header,
.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.conversation-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.conversation-select {
  min-width: 150px;
  max-width: 240px;
  min-height: 40px;
  padding: 0 30px 0 10px;
  border: 1px solid #ccd6d2;
  border-radius: 6px;
  background: #f9fbfa;
  color: var(--ink);
}

.panel-heading h2,
.conversation-header h2 {
  margin-bottom: 0;
  font-size: 19px;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: #a8b1ae;
  box-shadow: 0 0 0 5px rgba(168, 177, 174, 0.14);
}

.status-dot[data-state="connected"] {
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}

.status-dot[data-state="login"] {
  background: var(--amber);
  box-shadow: 0 0 0 5px var(--amber-soft);
}

.status-dot[data-state="error"] {
  background: var(--red);
  box-shadow: 0 0 0 5px var(--red-soft);
}

.connection-state {
  display: grid;
  gap: 4px;
  margin: 18px 0;
}

.connection-state strong {
  font-size: 18px;
}

.connection-state span {
  line-height: 1.45;
  font-size: 13px;
}

.compact-facts,
.result-facts {
  display: grid;
  gap: 0;
  margin: 0;
}

.compact-facts > div,
.result-facts > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.compact-facts dt,
.result-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.compact-facts dd,
.result-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.button-stack {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.panel-note {
  margin: 14px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.prompt-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.recovery-demo-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding-top: 2px;
}

.recovery-demo-controls .form-select {
  min-width: 0;
  max-width: none;
}

.example-chip {
  padding: 6px 9px;
  border: 1px solid #ced8d4;
  border-radius: 5px;
  background: #f4f7f5;
  color: #43524c;
  font-size: 12px;
}

.example-chip:hover {
  border-color: #aabbb5;
  background: #edf2f0;
}

.conversation-panel {
  height: calc(100dvh - 170px);
  min-height: 640px;
  max-height: 900px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conversation-header {
  flex: 0 0 auto;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 250, 0.98);
}

.conversation-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.conversation-scroll::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
  width: 8px;
}

.conversation-scroll::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #c4cfca;
  background-clip: padding-box;
}

.empty-state {
  max-width: 490px;
  margin: 90px auto;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.empty-state h3 {
  color: var(--ink);
}

.empty-state p {
  line-height: 1.6;
}

.task-error {
  margin-top: 22px;
  line-height: 1.5;
}

.message-thread {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.message {
  display: grid;
  gap: 7px;
  max-width: min(760px, 88%);
  min-width: 0;
}

.message[data-role="user"] {
  justify-self: end;
}

.message[data-role="assistant"] {
  justify-self: start;
  width: min(100%, 720px);
  max-width: min(100%, 720px);
}

.message-meta {
  color: var(--muted);
  font-size: 11px;
}

.message-bubble {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-content {
  min-width: 0;
}

.message-bubble .message-paragraph {
  margin: 0;
}

.message-bubble .message-paragraph + .message-paragraph {
  margin-top: 8px;
}

.message-bubble ul {
  margin: 6px 0;
  padding-left: 20px;
}

.message-bubble li + li {
  margin-top: 4px;
}

.message.is-typing .message-screenshot,
.message.is-typing .message-result-action {
  display: none;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  border-radius: 1px;
  background: currentColor;
  vertical-align: -0.12em;
  animation: typewriter-cursor 0.8s step-end infinite;
}

@keyframes typewriter-cursor {
  50% {
    opacity: 0;
  }
}

.message[data-role="user"] .message-bubble {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: var(--accent-soft);
  color: #183c36;
}

.message[data-error="true"] .message-bubble {
  border-color: #e0a8a2;
  background: var(--red-soft);
  color: #7c211a;
}

.message-result-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.message-result-action span {
  color: var(--muted);
  font-size: 12px;
}

.message-screenshot {
  width: min(240px, 100%);
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.message-screenshot a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f6f5;
}

.message-screenshot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  transition: transform 160ms ease;
}

.message-screenshot a:hover img {
  transform: scale(1.015);
}

.message-screenshot figcaption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.conversation-composer {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 13px 22px 16px;
  border-top: 1px solid var(--line);
  background: rgba(251, 252, 250, 0.99);
  box-shadow: 0 -12px 30px rgba(28, 42, 37, 0.055);
}

.composer-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.composer-heading .eyebrow {
  margin-bottom: 0;
}

.composer-heading h2 {
  margin: 0;
  font-size: 16px;
}

.conversation-composer .stack {
  gap: 10px;
  margin-top: 10px;
}

.conversation-composer .field {
  gap: 0;
}

.conversation-composer .field textarea {
  min-height: 64px;
  max-height: 120px;
  padding: 10px 12px;
  resize: none;
  line-height: 1.55;
}

.composer-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.composer-actions .prompt-examples {
  min-width: 0;
  flex: 1 1 auto;
}

.composer-actions .primary-button {
  min-width: 116px;
}

.conversation-composer .recovery-demo-controls {
  padding-top: 0;
}

.active-task {
  min-width: 0;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.task-details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.task-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.task-details[open] summary {
  margin-bottom: 4px;
}

.result-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}

.answer-envelope {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.answer-text-block .message-paragraph:last-child {
  margin-bottom: 0;
}

.answer-block-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.answer-table-block {
  min-width: 0;
}

.answer-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.answer-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.answer-table th,
.answer-table td {
  min-width: 88px;
  max-width: 320px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.answer-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-muted, #f6f7f8);
  font-weight: 700;
  white-space: nowrap;
}

.answer-table tr:last-child td {
  border-bottom: 0;
}

.answer-table th:last-child,
.answer-table td:last-child {
  border-right: 0;
}

.answer-table-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.answer-fact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.answer-fact-list > div:not(.answer-block-title) {
  display: grid;
  grid-template-columns: minmax(88px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  padding: 9px 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.answer-fact-list dt {
  color: var(--muted);
}

.answer-fact-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.answer-fact-list > .answer-block-title {
  grid-column: 1 / -1;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.answer-envelope-warnings {
  display: grid;
  gap: 4px;
  padding: 9px 11px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: var(--text);
  font-size: 12px;
}

.answer-envelope-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 760px) {
  .answer-fact-list {
    grid-template-columns: 1fr;
  }
}

.task-header h3 {
  max-width: 700px;
  margin-bottom: 0;
  font-size: 19px;
}

.task-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-route {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.task-status[data-status="running"] {
  background: var(--amber-soft);
  color: var(--amber);
}

.task-status[data-status="queued"] {
  background: var(--amber-soft);
  color: var(--amber);
}

.task-status[data-status="succeeded"] {
  background: var(--green-soft);
  color: var(--green);
}

.task-status[data-status="failed"],
.task-status[data-status="cancelled"],
.task-status[data-status="timed_out"] {
  background: var(--red-soft);
  color: var(--red);
}

.task-steps {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.task-step {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-height: 46px;
}

.task-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 24px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.step-marker {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.task-step[data-status="completed"] .step-marker {
  border-color: #a8cdb8;
  background: var(--green-soft);
  color: var(--green);
}

.task-step[data-status="running"] .step-marker {
  border-color: #e0bd78;
  background: var(--amber-soft);
  color: var(--amber);
}

.task-step[data-status="failed"] .step-marker,
.task-step[data-status="cancelled"] .step-marker {
  border-color: #e0a8a2;
  background: var(--red-soft);
  color: var(--red);
}

.step-copy {
  padding: 4px 0 14px;
}

.step-copy strong {
  display: block;
  font-size: 13px;
}

.step-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.step-state {
  padding-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.result-block {
  min-width: 0;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.text-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.result-summary {
  margin: 14px 0;
  color: #405049;
  line-height: 1.6;
}

.result-warnings {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: #6d4204;
  font-size: 12px;
  line-height: 1.55;
}

.snapshot-context {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(90px, 0.4fr) minmax(0, 0.8fr);
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.snapshot-context > div {
  min-width: 0;
}

.snapshot-context span,
.snapshot-context strong {
  display: block;
}

.snapshot-context span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.snapshot-context strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.metric-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.metric-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  display: block;
  overflow-wrap: anywhere;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.metric-change {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.metric-change[data-direction="up"] {
  color: var(--green);
}

.metric-change[data-direction="down"] {
  color: var(--red);
}

.metric-change[data-direction="flat"] {
  color: var(--muted);
}

.pending-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pending-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.pending-heading > strong {
  color: var(--amber);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.pending-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.pending-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border-left: 2px solid #e0bd78;
  background: #fbf7ee;
}

.pending-item span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #5d5545;
  font-size: 12px;
}

.pending-item strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.pending-list-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pending-list-meta span,
.pending-list-meta strong {
  display: block;
}

.pending-list-meta span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.pending-list-meta strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.pending-list-summary {
  margin: 14px 0;
  color: #405049;
  line-height: 1.55;
}

.pending-leads-result {
  min-width: 0;
}

.lead-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.lead-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.lead-table th,
.lead-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.lead-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f3;
  color: #43524c;
  font-weight: 650;
}

.lead-table tbody tr:last-child td {
  border-bottom: 0;
}

.lead-table tbody tr:hover {
  background: #f8faf9;
}

.lead-table td[data-empty="true"] {
  padding: 26px 12px;
  color: var(--muted);
  text-align: center;
  white-space: normal;
}

.result-facts > div {
  grid-template-columns: 86px minmax(0, 1fr);
}

.excerpt-block {
  margin-top: 18px;
}

#page-inspection-result .result-facts {
  margin-top: 14px;
}

.excerpt-block pre {
  max-height: 260px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6f8f7;
  color: #34423c;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.module-summary {
  margin: 14px 0;
  color: #405049;
  line-height: 1.6;
}

.module-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
}

.module-facts > div {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.module-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.module-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.module-tables {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.module-table-block h4 {
  margin-bottom: 9px;
}

.module-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.module-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.module-table th,
.module-table td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.module-table th {
  position: sticky;
  top: 0;
  background: #f1f5f3;
  color: #43524c;
}

.module-table tbody tr:last-child td {
  border-bottom: 0;
}

.screenshot-figure {
  margin: 20px 0 0;
}

.screenshot-figure img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #e8ecea;
}

.screenshot-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.history-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 510px);
  min-height: 210px;
  padding: 18px 20px;
  overflow: hidden;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  min-height: 0;
  overflow-y: auto;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.history-item:first-child {
  border-top: 0;
}

.history-item.is-active {
  padding-right: 8px;
  padding-left: 8px;
  border-radius: 5px;
  background: #eef4f1;
}

.history-item button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
}

.history-item button:hover strong {
  color: var(--accent);
}

.history-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.history-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.status-chip[data-status="running"] {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-chip[data-status="succeeded"] {
  background: var(--green-soft);
  color: var(--green);
}

.status-chip[data-status="failed"] {
  background: var(--red-soft);
  color: var(--red);
}

.empty-history {
  padding: 16px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

body.presentation-mode .workspace {
  grid-template-columns: 280px minmax(0, 1fr);
}

body.presentation-mode .demo-banner,
body.presentation-mode .history-panel,
body.presentation-mode .conversation-select,
body.presentation-mode .connection-panel .compact-facts,
body.presentation-mode .connection-panel .panel-note,
body.presentation-mode #refresh-session-button,
body.presentation-mode #reset-session-button,
body.presentation-mode .task-route,
body.presentation-mode .task-steps {
  display: none;
}

body.presentation-mode .conversation-panel {
  height: calc(100dvh - 118px);
  max-height: 950px;
}

body.presentation-mode .conversation-tools {
  gap: 0;
}

body.presentation-mode .connection-panel .button-stack {
  margin-top: 18px;
}

body.presentation-mode .task-header {
  display: none;
}

body.presentation-mode .active-task[data-live="true"] .task-header {
  display: flex;
}

body.presentation-mode .active-task[data-live="true"] .task-header .eyebrow {
  display: none;
}

body.presentation-mode .active-task[data-live="false"] {
  margin-top: 14px;
  border-top: 0;
  padding-top: 0;
}

body.presentation-mode .active-task[data-live="false"] .result-block {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

body.presentation-mode .login-card {
  max-width: 380px;
  width: 100%;
  justify-self: center;
}

body.presentation-mode .demo-hint {
  display: none;
}

body.presentation-mode .login-card .stack {
  margin-top: 22px;
}

@media (max-width: 980px) {
  .login-layout {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 34px 0;
  }

  .login-intro {
    max-width: none;
  }

  .login-intro h1 {
    max-width: 760px;
  }

  .capability-list {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .main-column {
    order: 1;
  }

  .side-column {
    order: 2;
  }

  .side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversation-panel {
    height: min(780px, calc(100dvh - 150px));
    min-height: 600px;
    max-height: none;
  }

  body.presentation-mode .workspace {
    grid-template-columns: 1fr;
  }

  body.presentation-mode .conversation-panel {
    height: min(780px, calc(100dvh - 110px));
  }

  .history-panel {
    max-height: 420px;
    min-height: 240px;
  }
}

@media (max-width: 680px) {
  .app-shell,
  .login-layout {
    width: min(100% - 20px, 1440px);
  }

  .login-card {
    padding: 24px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .readonly-badge {
    display: none;
  }

  .user-label {
    display: none;
  }

  .demo-banner {
    display: grid;
  }

  .agent-mode-status {
    margin-left: 0;
    justify-self: start;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .conversation-panel {
    height: calc(100dvh - 110px);
    min-height: 620px;
    max-height: none;
    padding: 0;
  }

  .conversation-header {
    padding: 16px;
  }

  .conversation-scroll {
    padding: 16px;
  }

  .conversation-composer {
    padding: 12px 14px 14px;
  }

  .composer-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .composer-actions .prompt-examples {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .composer-actions .example-chip {
    flex: 0 0 auto;
  }

  .composer-actions .primary-button {
    width: 100%;
  }

  .empty-state {
    margin: 54px auto;
  }

  .task-header,
  .conversation-header,
  .result-heading {
    flex-wrap: wrap;
  }

  .conversation-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .conversation-select {
    flex: 1;
    max-width: none;
  }

  .recovery-demo-controls {
    grid-template-columns: 1fr;
  }

  .history-panel {
    max-height: 430px;
    min-height: 220px;
  }

  .message {
    max-width: 100%;
  }

  .compact-facts > div,
  .result-facts > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .task-step {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .step-state {
    display: none;
  }

  .snapshot-context,
  .home-metrics,
  .pending-items,
  .pending-list-meta,
  .module-facts {
    grid-template-columns: 1fr;
  }

  .metric-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    align-items: end;
  }

  .metric-label {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .metric-value {
    font-size: 22px;
  }

  .metric-change {
    margin-top: 0;
  }
}

.execution-preference {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 3px 14px;
  padding: 11px 12px;
  border: 1px solid #e6e7ec;
  border-radius: 9px;
  background: #fafafd;
  cursor: pointer;
}

.execution-preference > span:first-child {
  display: grid;
  gap: 2px;
}

.execution-preference strong {
  font-size: 12px;
}

.execution-preference small {
  color: #8c8e97;
  font-size: 10px;
  line-height: 1.45;
}

.execution-preference input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #d8dae2;
  transition: background 0.16s ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(28, 31, 45, 0.22);
  content: "";
  transition: transform 0.16s ease;
}

.execution-preference input:checked + .switch-track {
  background: #4d6bfe;
}

.execution-preference input:checked + .switch-track::after {
  transform: translateX(16px);
}

.execution-preference input:focus-visible + .switch-track {
  outline: 3px solid rgba(77, 107, 254, 0.18);
  outline-offset: 2px;
}

.execution-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e0e2ea;
  border-radius: 8px;
  background: #fff;
  color: #666873;
  font-size: 11px;
  cursor: pointer;
}

.execution-toggle-button[aria-pressed="true"] {
  border-color: #cfd6ff;
  background: #eef1ff;
  color: #3855d8;
}

.assistant-answer-section {
  display: grid;
  gap: 7px;
  padding: 0 0 14px;
}

.assistant-answer-section + .assistant-answer-section {
  padding-top: 14px;
  border-top: 1px solid rgba(86, 89, 106, 0.12);
}

.assistant-answer-section h4 {
  margin: 0;
  color: #8a8c95;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.assistant-answer-section p {
  margin: 0;
  color: #3f4149;
  line-height: 1.72;
}

.assistant-turn {
  width: 100%;
}

.assistant-turn.is-final-ready {
  display: grid;
  gap: 12px;
}

.assistant-final-details summary {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 7px;
  padding: 2px 0 8px;
  color: #8a8c95;
  font-size: 12px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.assistant-final-details summary::-webkit-details-marker {
  display: none;
}

.assistant-final-details summary::after {
  height: 1px;
  flex: 1 1 auto;
  margin-left: 4px;
  background: #e3e5eb;
  content: "";
}

.assistant-final-summary-chevron {
  width: 6px;
  height: 6px;
  border: solid #8e9099;
  border-width: 0 1.5px 1.5px 0;
  color: #8e9099;
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
}

.assistant-final-details[open] .assistant-final-summary-chevron {
  transform: rotate(45deg);
}

.assistant-final-details summary:hover {
  color: #4056c8;
}

.assistant-final-history {
  display: grid;
  gap: 2px;
  padding: 14px 0 4px;
}

.assistant-activity-summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 7px;
  color: #747780;
  font-size: 12px;
  line-height: 1.55;
}

.assistant-activity-icon {
  color: #8a8d97;
  font-size: 15px;
  line-height: 1.2;
}

.assistant-worklog {
  display: grid;
  gap: 2px;
  margin: 1px 0 0;
  padding: 0;
  list-style: none;
}

.assistant-worklog-step {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  min-width: 0;
  padding: 7px 8px 7px 6px;
  border-radius: 8px;
  color: #777983;
  font-size: 11px;
}

.assistant-worklog-step[data-status="completed"] {
  color: #81838b;
}

.assistant-worklog-step[data-status="running"] {
  background:
    linear-gradient(
      90deg,
      rgba(77, 107, 254, 0.055),
      rgba(77, 107, 254, 0.1),
      rgba(77, 107, 254, 0.055)
    );
  background-size: 200% 100%;
  color: #3f55b7;
  animation: step-shimmer 2.1s linear infinite;
}

.assistant-worklog-step[data-status="pending"] {
  color: #b0b1b8;
}

.assistant-worklog-step[data-status="failed"],
.assistant-worklog-step[data-status="cancelled"],
.assistant-worklog-step[data-status="timed_out"] {
  background: #fff4f3;
  color: #a13e38;
}

.assistant-worklog-step[data-status="rejected"],
.assistant-worklog-step[data-status="fallback"],
.assistant-worklog-step[data-status="recovered"] {
  background: #fff9eb;
  color: #8a641f;
}

.assistant-worklog-marker {
  display: grid;
  width: 18px;
  height: 16px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 9px;
  line-height: 1;
}

.assistant-worklog-step[data-event-type="model"] .assistant-worklog-marker {
  width: 20px;
  border-color: #ccd3f7;
  border-radius: 5px;
  background: #eef1ff;
  color: #5167c2;
  font-size: 7px;
  font-weight: 700;
}

.assistant-worklog-step[data-status="completed"] .assistant-worklog-marker {
  border-color: #c8cbd2;
  color: #85878f;
}

.assistant-worklog-step[data-status="running"] .assistant-worklog-marker {
  border-color: #7184e6;
  background: #657be3;
  color: #fff;
  animation: status-pulse 1.15s ease-in-out infinite;
}

.assistant-worklog-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.assistant-worklog-copy strong {
  display: flex;
  align-items: baseline;
  gap: 2px;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
}

.assistant-worklog-detail {
  overflow: hidden;
  color: #93959d;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-worklog[data-density="full"] .assistant-worklog-detail {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}

.assistant-worklog-state {
  padding-top: 1px;
  color: #a0a2aa;
  font-size: 9px;
  white-space: nowrap;
}

.assistant-execution-details {
  margin-top: 8px;
  color: #777985;
  font-size: 11px;
}

.assistant-execution-details summary {
  cursor: pointer;
}

.assistant-execution-details ol {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding-left: 20px;
}

.assistant-execution-details li {
  line-height: 1.55;
}

.execution-preference {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 11px 12px;
}

.execution-preference legend {
  padding: 0;
  color: #363842;
  font-size: 12px;
  font-weight: 700;
}

.execution-preference > p {
  margin: 0;
  color: #8c8e97;
  font-size: 10px;
  line-height: 1.45;
}

.execution-mode-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  background: #eff0f5;
}

.execution-mode-selector label {
  min-width: 0;
  cursor: pointer;
}

.execution-mode-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.execution-mode-selector span {
  display: block;
  padding: 6px 8px;
  border-radius: 7px;
  color: #777985;
  font-size: 11px;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.execution-mode-selector input:checked + span {
  background: #fff;
  color: #3855d8;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(37, 42, 66, 0.12);
}

.execution-mode-selector input:focus-visible + span {
  outline: 2px solid rgba(77, 107, 254, 0.28);
}

.message-status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(86, 89, 106, 0.13);
  color: #82848e;
  font-size: 10px;
}

.message-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef0f5;
  color: #60626c;
  font-weight: 600;
}

.message-status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.message-status-badge[data-status="succeeded"] {
  background: #eaf8f0;
  color: #267145;
}

.message-status-badge[data-status="running"],
.message-status-badge[data-status="queued"] {
  background: #eef1ff;
  color: #3855d8;
}

.message-status-badge[data-status="partial"],
.message-status-badge[data-status="needs_clarification"],
.message-status-badge[data-status="empty"] {
  background: #fff7e5;
  color: #8a6418;
}

.message-status-badge[data-status="failed"],
.message-status-badge[data-status="timed_out"] {
  background: #fff0f0;
  color: #a33c3c;
}

.execution-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.execution-summary-chip {
  padding: 4px 7px;
  border: 1px solid #e7e8ec;
  border-radius: 6px;
  background: #fbfbfc;
  color: #777983;
  font-size: 10px;
}

.execution-summary-chip.is-complete {
  border-color: #d9eadf;
  background: #f3faf5;
  color: #347252;
}

.assistant-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid rgba(86, 89, 106, 0.12);
  color: #8a8c95;
  font-size: 10px;
}

.message-copy-result {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #e2e4eb;
  border-radius: 7px;
  background: #fff;
  color: #666873;
  font-size: 10px;
  cursor: pointer;
}

.message-cancel-button {
  margin-left: auto;
  min-height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #a64040;
  font-size: 10px;
  cursor: pointer;
}

.message-cancel-button:hover:not(:disabled) {
  background: #fff0f0;
}

.live-ellipsis {
  display: inline-flex;
  width: 14px;
  align-items: baseline;
  gap: 2px;
  margin-left: 3px;
}

.live-ellipsis i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: live-dot 1.05s ease-in-out infinite;
}

.message-status-badge[data-status="running"]::before,
.message-status-badge[data-status="queued"]::before {
  animation: status-pulse 1.15s ease-in-out infinite;
}

.execution-summary-chip.is-live,
.assistant-execution-details li.is-current {
  position: relative;
  overflow: hidden;
}

.execution-summary-chip.is-live {
  border-color: #d7ddff;
  background: #f2f4ff;
  color: #455fc9;
}

.assistant-execution-details li.is-current {
  margin-left: -5px;
  padding: 3px 5px;
  border-radius: 5px;
  background: linear-gradient(
    90deg,
    rgba(77, 107, 254, 0.08),
    rgba(77, 107, 254, 0.16),
    rgba(77, 107, 254, 0.08)
  );
  background-size: 200% 100%;
  color: #425bc4;
  animation: step-shimmer 1.8s linear infinite;
}

.execution-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #858792;
  font-size: 10px;
}

.execution-progress-track {
  position: relative;
  flex: 1 1 180px;
  max-width: 300px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef4;
}

.execution-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #6178eb;
  transition: width 0.36s ease;
}

.execution-progress-track.is-running::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.75),
    transparent
  );
  content: "";
  transform: translateX(-100%);
  animation: progress-sweep 1.35s ease-in-out infinite;
}

@keyframes live-dot {
  0%,
  70%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

@keyframes status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 3px transparent;
    opacity: 0.55;
  }
}

@keyframes step-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@keyframes progress-sweep {
  to {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-ellipsis i,
  .message-status-badge[data-status="running"]::before,
  .message-status-badge[data-status="queued"]::before,
  .assistant-execution-details li.is-current,
  .execution-progress-track.is-running::after {
    animation: none;
  }
}

.automation-panel {
  display: grid;
  gap: 7px;
  padding: 0 12px 12px;
}

.automation-entry {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid #ececf0;
  border-radius: 10px;
  background: #fafafd;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.automation-entry:hover {
  border-color: #d8ddfb;
  background: #f6f7ff;
}

.automation-entry span:first-child {
  display: grid;
  gap: 2px;
}

.automation-entry strong {
  font-size: 12px;
}

.automation-entry small {
  color: #858791;
  font-size: 10px;
}

.inbox-badge {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #4d6bfe;
  color: #fff;
  font-size: 10px;
  text-align: center;
}

.agent-panel-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(22, 24, 35, 0.32);
  backdrop-filter: blur(3px);
}

.agent-panel {
  width: min(520px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e7e8ed;
  background: #fff;
  box-shadow: -20px 0 60px rgba(23, 27, 51, 0.16);
}

.agent-panel-header,
.agent-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.agent-panel-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid #efeff3;
}

.agent-panel-header h2,
.agent-section-heading h3 {
  margin: 2px 0 0;
}

.agent-panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 10px 16px;
  border-bottom: 1px solid #efeff3;
  background: #fafafd;
}

.agent-panel-tab {
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #71737d;
  cursor: pointer;
}

.agent-panel-tab.is-active {
  background: #eef1ff;
  color: #3855d8;
  font-weight: 600;
}

.agent-panel-body {
  flex: 1;
  overflow: auto;
  padding: 20px 24px 40px;
}

.agent-section-heading {
  margin-bottom: 14px;
}

.agent-section-heading h3 {
  font-size: 16px;
}

.agent-section-heading p {
  margin: 5px 0 0;
  color: #858791;
  font-size: 12px;
}

.secondary-button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.agent-list {
  display: grid;
  gap: 10px;
}

.agent-list-item {
  padding: 14px;
  border: 1px solid #e9eaf0;
  border-radius: 12px;
  background: #fff;
}

.agent-list-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.agent-list-item h4,
.agent-list-item p {
  margin: 0;
}

.agent-list-item p {
  margin-top: 6px;
  color: #747680;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.agent-list-meta,
.agent-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.agent-list-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dfe1e8;
  border-radius: 8px;
  background: #fff;
  color: #565862;
  font-size: 11px;
  cursor: pointer;
}

.agent-list-actions button.danger {
  color: #b74343;
}

.agent-status-pill {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f0f1f5;
  color: #666872;
  font-size: 10px;
}

.agent-status-pill[data-status="succeeded"] {
  background: #eaf8f0;
  color: #247344;
}

.agent-status-pill[data-status="partial"],
.agent-status-pill[data-status="empty"] {
  background: #fff6df;
  color: #8b6516;
}

.agent-status-pill[data-status="failed"],
.agent-status-pill[data-status="timeout"] {
  background: #fff0f0;
  color: #a13939;
}

.routine-form {
  display: grid;
  grid-template-columns: 1fr 130px auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #e9eaf0;
  border-radius: 12px;
  background: #fafafd;
}

.routine-form label {
  display: grid;
  gap: 6px;
  color: #666872;
  font-size: 11px;
}

.routine-form input,
.routine-form select {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #dfe1e8;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.empty-agent-list {
  padding: 26px 12px;
  border: 1px dashed #dfe1e8;
  border-radius: 12px;
  color: #92949d;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 680px) {
  .agent-panel-body {
    padding: 16px 14px 30px;
  }

  .routine-form {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Conversation-first demo workspace */
:root {
  --ui-blue: #4d6bfe;
  --ui-blue-strong: #3f5ce8;
  --ui-blue-soft: #eef2ff;
  --ui-line: #e7e8ec;
  --ui-sidebar: #f7f7f8;
}

body:has(#app-view:not([hidden])) {
  overflow: hidden;
  background: #fff;
}

.app-shell {
  width: 100%;
  height: 100dvh;
  min-height: 560px;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.app-shell[hidden] {
  display: none;
}

.demo-banner {
  flex: 0 0 auto;
  margin: 0;
  border-left: 0;
  border-bottom: 1px solid var(--line);
}

.workspace,
body.presentation-mode .workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.side-column {
  min-width: 0;
  height: 100%;
  padding: 0 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  border-right: 1px solid var(--ui-line);
  background: var(--ui-sidebar);
}

.main-column {
  min-width: 0;
  height: 100%;
  display: block;
  overflow: hidden;
  background: #fff;
}

.sidebar-header {
  flex: 0 0 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 0 6px;
}

.sidebar-header .brand {
  min-width: 0;
}

.sidebar-header .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #17181d;
  font-size: 12px;
}

.sidebar-header .brand strong {
  color: #202126;
  font-size: 16px;
}

.sidebar-header .brand span {
  max-width: 150px;
  overflow: hidden;
  color: #8b8d96;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #686a72;
}

.icon-button:hover {
  background: #ececef;
  color: #24252b;
}

.icon-button.quiet {
  width: 30px;
  height: 30px;
  color: #8a8c94;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.new-chat-button {
  flex: 0 0 43px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #dcdee4;
  border-radius: 999px;
  background: #fff;
  color: #26272d;
  box-shadow: 0 1px 2px rgba(20, 22, 30, 0.03);
  font-size: 14px;
  font-weight: 650;
}

.new-chat-button:hover {
  border-color: #c9ccd5;
  background: #fbfbfc;
}

.new-chat-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.history-panel,
body.presentation-mode .history-panel {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin: 3px 0 0;
  padding: 0 3px;
  display: flex;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.sidebar-section-heading {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-section-heading h2 {
  margin: 0;
  color: #9698a0;
  font-size: 12px;
  font-weight: 550;
}

.history-list {
  min-height: 0;
  margin: 2px 0 0;
  display: block;
  overflow-y: auto;
  scrollbar-width: thin;
}

.history-group + .history-group {
  margin-top: 18px;
}

.history-group-label {
  margin: 0 0 5px;
  padding: 0 9px;
  color: #a0a2aa;
  font-size: 11px;
  font-weight: 500;
}

.history-group-items {
  display: grid;
  gap: 1px;
}

.history-item,
.history-item:first-child,
.history-item.is-active {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.history-item button {
  width: 100%;
  min-height: 36px;
  padding: 8px 9px;
  display: block;
  overflow: hidden;
  border-radius: 9px;
  color: #37383e;
  text-align: left;
}

.history-item button:hover {
  background: #ededf0;
}

.history-item.is-active button {
  background: #e9edff;
  color: #425ee8;
}

.history-item strong {
  font-size: 13px;
  font-weight: 520;
}

.history-item span {
  color: #9a9ca4;
  font-size: 10px;
}

body.presentation-mode .history-item span {
  display: none;
}

.connection-panel,
body.presentation-mode .connection-panel {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 7px;
  border: 0;
  border-top: 1px solid var(--ui-line);
  border-radius: 0;
  background: transparent;
}

.connection-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.connection-summary > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.connection-summary strong {
  overflow: hidden;
  color: #4a4b52;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-summary span:not(.status-dot) {
  overflow: hidden;
  color: #989aa2;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-panel .status-dot {
  width: 8px;
  height: 8px;
  margin: 0;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(168, 177, 174, 0.13);
}

.connection-panel .connection-state {
  margin: 14px 0;
}

body.presentation-mode .connection-summary span:not(.status-dot),
body.presentation-mode .connection-advanced > .panel-heading,
body.presentation-mode .connection-advanced .connection-state,
body.presentation-mode .connection-advanced .compact-facts,
body.presentation-mode .connection-advanced .panel-note,
body.presentation-mode .connection-advanced #refresh-session-button,
body.presentation-mode .connection-advanced #reset-session-button {
  display: none;
}

body.presentation-mode .connection-advanced .button-stack {
  margin: 7px 0 0 17px;
}

body.presentation-mode #open-browser-button:not([hidden]) {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--ui-blue);
  font-size: 11px;
}

.sidebar-account {
  flex: 0 0 56px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 5px 0;
  border-top: 1px solid var(--ui-line);
}

.account-avatar {
  width: 31px;
  height: 31px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #202127;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.account-copy {
  min-width: 0;
  display: grid;
  flex: 1 1 auto;
  gap: 1px;
}

.account-copy strong {
  overflow: hidden;
  color: #45464c;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account .readonly-badge {
  min-height: auto;
  padding: 0;
  justify-self: start;
  background: transparent;
  color: #9a9ca4;
  font-size: 10px;
  font-weight: 500;
}

.conversation-panel,
body.presentation-mode .conversation-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.conversation-header {
  min-height: 58px;
  padding: 0 22px;
  align-items: center;
  border-bottom: 1px solid #f0f1f3;
  background: #fff;
}

.conversation-title-block {
  min-width: 0;
  flex: 1 1 auto;
}

.conversation-header h2 {
  overflow: hidden;
  color: #28292f;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-menu-button {
  display: none;
}

.conversation-tools {
  flex: 0 0 auto;
}

.conversation-select {
  min-width: 140px;
  max-width: 210px;
  min-height: 34px;
  border-color: #e1e2e6;
  border-radius: 9px;
  background: #fafafa;
  font-size: 12px;
}

body.presentation-mode .conversation-select {
  display: none;
}

.conversation-scroll {
  padding: 26px clamp(24px, 6vw, 96px) 12px;
  background: #fff;
}

.conversation-scroll > .task-error,
.conversation-scroll > .message-thread,
.conversation-scroll > .active-task {
  width: min(100%, 860px);
  margin-right: auto;
  margin-left: auto;
}

.empty-state {
  width: min(100%, 860px);
  max-width: none;
  margin: 76px auto;
  text-align: center;
}

.empty-brand-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #1b1c21;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.empty-state h1 {
  margin: 0 0 13px;
  color: #1d1e23;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0;
}

.empty-state p {
  max-width: 560px;
  margin: 0 auto;
  color: #858790;
  font-size: 14px;
  line-height: 1.65;
}

.conversation-panel[data-empty="true"] .conversation-scroll {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 12px;
}

.conversation-panel[data-empty="true"] .empty-state {
  margin: 0 auto 24px;
}

.conversation-panel[data-empty="true"]::after {
  content: "";
  display: block;
  flex: 0.82 1 0;
  min-height: 24px;
}

.task-error {
  margin-top: 8px;
}

.message-thread {
  gap: 25px;
}

.message {
  max-width: 100%;
  gap: 0;
}

.message[data-role="user"] {
  max-width: min(78%, 680px);
}

.message-meta {
  display: none;
}

.message-bubble {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #303138;
  font-size: 15px;
  line-height: 1.78;
  white-space: pre-wrap;
}

.message[data-role="user"] .message-bubble {
  padding: 11px 16px;
  border: 1px solid #dfe5ff;
  border-radius: 18px;
  background: var(--ui-blue-soft);
  color: #303b65;
}

.message[data-error="true"] .message-bubble {
  padding: 12px 14px;
  border: 1px solid #ebc0bc;
  border-radius: 14px;
}

.message-bubble .message-paragraph + .message-paragraph {
  margin-top: 12px;
}

.message-heading {
  margin: 20px 0 8px;
  color: #25262c;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
}

.message-content > .message-heading:first-child {
  margin-top: 0;
}

.message-subheading {
  margin: 17px 0 6px;
  color: #2e3037;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.message-bubble ul {
  margin: 7px 0 14px;
  padding-left: 23px;
}

.message-bubble ol {
  margin: 7px 0 14px;
  padding-left: 24px;
}

.message-bubble li {
  padding-left: 3px;
}

.message-bubble li::marker {
  color: #737680;
}

.message-bubble .message-paragraph + ul,
.message-bubble .message-paragraph + ol {
  margin-top: 6px;
}

.message-quote {
  margin: 14px 0;
  padding: 9px 13px;
  border-left: 3px solid #d5d9e7;
  background: #f8f9fc;
  color: #686b74;
  font-size: 13px;
  line-height: 1.65;
}

.message-rule {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid #ececf0;
}

.message-result-action {
  margin-top: 14px;
  padding-top: 10px;
  border-top-color: #ececf0;
}

.message-screenshot {
  width: min(340px, 100%);
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
}

.message-screenshot a {
  border-color: #e2e3e7;
  border-radius: 12px;
}

.message-screenshot figcaption {
  margin-top: 6px;
  color: #9b9da5;
}

.conversation-composer {
  padding: 8px clamp(24px, 6vw, 96px) 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.composer-heading {
  display: none;
}

.conversation-composer .stack {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 11px 12px 10px;
  gap: 3px;
  border: 1px solid #dedfe4;
  border-radius: 23px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(35, 38, 55, 0.07);
}

.conversation-composer .field {
  display: block;
}

.conversation-composer .field textarea,
.conversation-composer .field textarea:focus {
  min-height: 55px;
  max-height: 140px;
  padding: 7px 12px 2px;
  border: 0;
  border-radius: 14px;
  outline: none;
  background: transparent;
  box-shadow: none;
  color: #292a30;
  font-size: 15px;
  line-height: 1.55;
  resize: none;
}

.conversation-composer .field textarea::placeholder {
  color: #a1a3aa;
}

.composer-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 1px 0 3px;
}

.composer-actions .prompt-examples {
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.composer-actions .example-chip {
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid #e2e3e7;
  border-radius: 999px;
  background: #fff;
  color: #565861;
  font-size: 12px;
}

.composer-actions .example-chip:hover {
  border-color: #c9cbd3;
  background: #f8f8f9;
}

.send-button {
  width: 37px;
  height: 37px;
  padding: 0;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ui-blue);
  color: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}

.send-button:hover:not(:disabled) {
  background: var(--ui-blue-strong);
  transform: translateY(-1px);
}

.send-button:disabled {
  background: #b9c4fb;
  opacity: 1;
}

.send-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send-button.is-loading svg {
  animation: spin 0.8s linear infinite;
}

.composer-disclaimer {
  width: min(100%, 860px);
  margin: 7px auto 0;
  color: #a2a4ac;
  font-size: 10px;
  text-align: center;
}

.active-task {
  border-top-color: #ececf0;
}

.result-summary,
.module-summary,
.pending-list-summary {
  color: #3f4047;
}

.lead-table-wrap,
.module-table-wrap,
.screenshot-figure img {
  border-radius: 12px;
}

.sidebar-backdrop {
  display: none;
}

@media (min-width: 981px) {
  body.sidebar-collapsed .workspace,
  body.sidebar-collapsed.presentation-mode .workspace {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  body.sidebar-collapsed .side-column {
    padding: 0;
    overflow: hidden;
    border-right: 0;
    opacity: 0;
    pointer-events: none;
  }

  body.sidebar-collapsed .conversation-menu-button {
    display: inline-grid;
  }

  body.sidebar-collapsed .conversation-header {
    gap: 8px;
  }
}

@media (max-width: 980px) {
  body:has(#app-view:not([hidden])) {
    min-height: 100dvh;
  }

  .app-shell {
    min-height: 100dvh;
  }

  .workspace,
  body.presentation-mode .workspace {
    display: block;
    min-height: 0;
  }

  .side-column {
    position: fixed;
    z-index: 70;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 310px);
    height: 100dvh;
    padding: 0 12px max(10px, env(safe-area-inset-bottom));
    border-right: 1px solid var(--ui-line);
    box-shadow: 18px 0 50px rgba(18, 21, 30, 0.14);
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

  body.sidebar-open .side-column {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 60;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    display: block;
    border: 0;
    background: rgba(22, 24, 31, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .main-column,
  .conversation-panel,
  body.presentation-mode .conversation-panel {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  .conversation-menu-button {
    display: inline-grid;
  }

  .conversation-header {
    min-height: 56px;
    padding: 0 12px;
    gap: 8px;
  }

  .conversation-header h2 {
    font-size: 14px;
  }

  .conversation-scroll {
    padding: 18px 16px 8px;
  }

  .empty-state {
    margin: 48px auto;
  }

  .empty-brand-logo {
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    border-radius: 13px;
    font-size: 14px;
  }

  .empty-state h1 {
    margin-bottom: 10px;
    font-size: 25px;
  }

  .empty-state p {
    padding: 0 10px;
    font-size: 13px;
  }

  .conversation-panel[data-empty="true"]::after {
    flex: 0.25 1 0;
    min-height: 10px;
  }

  .conversation-composer {
    padding: 6px 10px max(8px, env(safe-area-inset-bottom));
  }

  .conversation-composer .stack {
    padding: 8px 9px 8px;
    border-radius: 20px;
  }

  .conversation-composer .field textarea,
  .conversation-composer .field textarea:focus {
    min-height: 49px;
    padding: 6px 8px 1px;
    font-size: 14px;
  }

  .composer-actions,
  .composer-actions .prompt-examples {
    display: flex;
    align-items: center;
  }

  .composer-actions .prompt-examples {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 1px 0 3px;
    scrollbar-width: none;
  }

  .composer-actions .prompt-examples::-webkit-scrollbar {
    display: none;
  }

  .composer-actions .example-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .send-button {
    width: 35px;
    height: 35px;
  }

  .composer-disclaimer {
    margin-top: 5px;
  }

  .message-thread {
    gap: 21px;
  }

  .message[data-role="user"] {
    max-width: 88%;
  }

  .message-bubble {
    font-size: 14px;
  }

  .conversation-scroll > .task-error,
  .conversation-scroll > .message-thread,
  .conversation-scroll > .active-task {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .conversation-header {
    padding: 0 9px;
  }

  .conversation-scroll {
    padding-right: 13px;
    padding-left: 13px;
  }

  .empty-state h1 {
    font-size: 23px;
  }

  .conversation-composer {
    padding-right: 8px;
    padding-left: 8px;
  }

  .composer-actions .example-chip {
    padding-right: 9px;
    padding-left: 9px;
    font-size: 11px;
  }
}

/* Unified ZZBot sign-in */
body:has(#login-view:not([hidden])) {
  overflow: auto;
  background: #f7f7f8;
}

.login-layout {
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.login-card,
body.presentation-mode .login-card {
  width: min(100%, 420px);
  max-width: 420px;
  margin: 0;
  padding: 30px;
  border: 1px solid #e5e6ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(28, 30, 38, 0.07);
  justify-self: auto;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-brand .brand-mark {
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 9px;
  background: #1b1c21;
  font-size: 12px;
}

.login-brand > div:last-child {
  min-width: 0;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  color: #202126;
  font-size: 15px;
  line-height: 1.2;
}

.login-brand span {
  margin-top: 2px;
  color: #92949c;
  font-size: 10px;
}

.login-copy {
  margin-top: 28px;
}

.login-copy .eyebrow {
  margin: 0 0 9px;
  color: var(--ui-blue);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.login-copy h1 {
  margin: 0 0 10px;
  color: #1f2025;
  font-size: 29px;
  line-height: 1.25;
  letter-spacing: 0;
}

.login-copy .muted {
  margin: 0;
  color: #858790;
  font-size: 13px;
  line-height: 1.65;
}

.login-card .stack {
  margin-top: 24px;
  gap: 14px;
}

.login-card .field {
  gap: 7px;
}

.login-card .field > span {
  color: #55565e;
  font-size: 12px;
  font-weight: 550;
}

.login-card .field input,
.login-card .field select {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid #dfe0e5;
  border-radius: 8px;
  background: #fff;
  color: #292a30;
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card .field input:focus,
.login-card .field select:focus {
  border-color: #8fa3ff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(77, 107, 254, 0.1);
}

.login-card .field input::placeholder {
  color: #aaaab1;
}

.login-card .form-error {
  margin: 0;
  border-radius: 8px;
  font-size: 12px;
}

.login-card .primary-button {
  min-height: 43px;
  margin-top: 2px;
  border-radius: 8px;
  background: var(--ui-blue);
  font-size: 13px;
  font-weight: 600;
}

.login-card .primary-button:hover:not(:disabled) {
  background: var(--ui-blue-strong);
}

.login-card .demo-hint {
  margin: 16px 0 0;
  color: #999ba3;
  font-size: 10px;
  line-height: 1.65;
}

.login-card .demo-hint code {
  padding: 1px 4px;
  background: #f0f1f3;
  color: #676972;
  font-size: 10px;
}

.login-assurance {
  margin-top: 20px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #efeff2;
  color: #91939b;
  font-size: 10px;
  line-height: 1.5;
}

.login-assurance .status-dot {
  width: 7px;
  height: 7px;
  margin: 0;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px var(--green-soft);
}

.login-page-footer {
  margin: 0;
  color: #a0a2aa;
  font-size: 10px;
}

body.presentation-mode .login-card .demo-hint {
  display: none;
}

body.presentation-mode .login-card .field {
  display: grid;
}

body.presentation-mode .login-card .stack {
  margin-top: 24px;
}

@media (max-width: 680px) {
  .login-layout {
    padding: 20px 14px max(20px, env(safe-area-inset-bottom));
  }

  .login-card,
  body.presentation-mode .login-card {
    width: 100%;
    padding: 24px 20px;
  }

  .login-copy {
    margin-top: 24px;
  }

  .login-copy h1 {
    font-size: 26px;
  }

  .login-card .stack {
    margin-top: 21px;
  }
}
