:root {
  color-scheme: dark;
  --bg: #050505;
  --workspace: #0d0d0d;
  --rail: #1b1b1b;
  --floating: #202020;
  --surface: #181818;
  --surface-2: #272727;
  --surface-3: #333333;
  --border: #303030;
  --border-soft: #222222;
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-dim: rgba(255, 255, 255, 0.38);
  --muted: var(--text-secondary);
  --faint: var(--text-tertiary);
  --accent: #ededed;
  --accent-2: #c7c7c7;
  --danger: #ff8585;
  --warning: #d6b45f;
  --status-ok: #0169cc;
  --control-charcoal: rgba(255, 255, 255, 0.055);
  --control-charcoal-hover: rgba(255, 255, 255, 0.085);
  --brand-strip: #0000ff;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: var(--workspace);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 430;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  --artifact-reserve: 0px;
  --chat-column-left: 80px;
  --chat-column-right: 80px;
  --chat-column-width: min(768px, calc(100vw - 480px));
  --composer-height: 100px;
  --composer-left: max(360px, calc(50vw - 380px));
  --composer-mobile-bottom: 14px;
  --composer-width: min(760px, calc(100vw - 400px));
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr);
  position: relative;
  background: var(--workspace);
  overflow: hidden;
}

.control-panel,
.artifact-panel,
.work-panel {
  min-width: 0;
  min-height: 0;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px 16px 10px;
  border-right: 0;
  background: var(--rail);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(24px);
  overflow-y: auto;
}

.brand-block,
.artifact-header {
  flex: 0 0 auto;
}

.brand-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  margin: -18px -16px 0;
  padding: 18px 22px 14px;
  background: var(--brand-strip);
  box-shadow:
    inset 0 -1px rgba(255, 255, 255, 0.18),
    0 12px 28px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand-title {
  display: inline-flex;
  align-items: center;
  height: 42px;
}

.brand-wordmark {
  display: block;
  width: 106px;
  height: auto;
  opacity: 0.96;
}

.brand-menu-button {
  display: none;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.brand-menu-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 4px;
}

.brand-mark {
  display: block;
}

.mobile-tools-button {
  display: none;
}

.mobile-workspace-rail,
.workspace-mobile-title {
  display: none;
}

.mobile-sheet-header,
.mobile-sheet-scrim {
  display: none;
}

.mobile-tools-icon,
.mobile-tools-minimize-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mobile-tools-minimize-icon {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.12;
}

h2 {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

h3 {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
}

.control-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-section + .control-section {
  margin-top: 6px;
}

.section-title,
.artifact-kicker,
.meta {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 6px 2px;
  color: var(--text-secondary);
  font-size: 13px;
}

.section-title-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  opacity: 0.82;
}

.connection-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.connection-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.connection-row:hover {
  background: var(--surface);
}

.connection-action {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-tertiary);
  text-decoration: none;
}

.connection-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.connection-action[hidden],
button.connection-action[hidden] {
  display: none;
}

button.connection-action {
  height: 30px;
  min-height: 30px;
  background: transparent;
  color: var(--text-tertiary);
}

.connection-action::after {
  content: "";
}

.connection-action:disabled {
  cursor: default;
  opacity: 0.5;
}

.connection-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.connection-info {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
}

.connection-info:hover,
.connection-info:focus-visible {
  color: var(--text);
}

.connection-info:focus-visible {
  outline: 1px solid var(--text-tertiary);
  outline-offset: 2px;
}

.connection-info svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.connection-tooltip {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  left: 50%;
  width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.connection-info:hover .connection-tooltip,
.connection-info:focus-visible .connection-tooltip,
.connection-info:focus-within .connection-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.connection-label {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-meta,
.integration-state {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-state.connected {
  color: var(--text);
}

.integration-state.warning {
  color: var(--danger);
}

.model-auth-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.model-auth-panel[hidden] {
  display: none;
}

.model-auth-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.model-auth-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.status-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: var(--text-dim);
}

.status-dot.alive {
  background: var(--status-ok);
}

.status-dot.error {
  background: var(--danger);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
}

.secondary-button[hidden],
button.secondary-button[hidden] {
  display: none;
}

button.secondary-button {
  height: auto;
  background: var(--surface-2);
  color: var(--text);
}

.secondary-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.model-auth-modal-scrim,
.tool-modal-scrim,
.feedback-modal-scrim,
.image-viewer-scrim,
.markdown-viewer-scrim {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
}

.image-viewer-scrim,
.markdown-viewer-scrim {
  z-index: 40;
  background: transparent;
  pointer-events: none;
}

.markdown-viewer-scrim {
  align-items: end;
  justify-items: end;
  padding-bottom: calc(var(--composer-height, 100px) + 60px);
}

.markdown-viewer {
  pointer-events: auto;
}

.model-auth-modal-scrim[hidden],
.tool-modal-scrim[hidden],
.feedback-modal-scrim[hidden],
.image-viewer-scrim[hidden],
.markdown-viewer-scrim[hidden] {
  display: none;
}

.model-auth-modal,
.tool-modal,
.feedback-modal,
.markdown-viewer {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(560px, 100%);
  max-height: calc(100dvh - 48px);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--floating);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}

.tool-modal {
  width: min(680px, 100%);
}

.feedback-modal {
  width: min(620px, 100%);
}

.markdown-viewer {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, calc(100vw - 32px));
  height: calc(100vh - var(--composer-height, 100px) - 156px);
  max-height: 620px;
  align-self: auto;
  justify-self: auto;
  margin-bottom: 0;
  overflow: hidden;
}

.markdown-viewer-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-width: 0;
}

.markdown-viewer-header h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.markdown-viewer-body {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.csv-table-wrap {
  min-width: 0;
  max-height: 100%;
  overflow: auto;
}

.csv-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.csv-table th,
.csv-table td {
  max-width: 320px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  color: var(--ink);
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
}

.csv-table th {
  background: var(--tray);
  color: var(--ink-2);
  font-weight: var(--weight-semibold);
}

.text-artifact-pre {
  margin: 0;
  overflow: auto;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  white-space: pre-wrap;
}

.markdown-viewer-scrim.is-loading .markdown-viewer-body::before {
  display: block;
  width: 24px;
  height: 24px;
  margin: 36px auto;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  animation: image-viewer-spin 780ms linear infinite;
  content: "";
}

.image-viewer-scrim {
  z-index: 42;
  padding: 18px;
  padding-bottom: calc(var(--composer-height, 100px) + 60px);
  background: transparent;
  place-items: end center;
}

.image-viewer {
  position: relative;
  display: block;
  width: min(1180px, 100%);
  max-width: calc(100vw - 36px);
  height: calc(100vh - var(--composer-height, 100px) - 140px);
  max-height: 760px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  pointer-events: none;
}

.image-viewer-header {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 2;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: max-content;
  max-width: min(720px, calc(100vw - 32px));
  min-width: 0;
  padding: 4px 11px 4px 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.46);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  transform: translateX(-50%);
}

.image-viewer-header h2 {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-header .modal-close {
  position: static;
  width: 28px;
  height: 28px;
  min-height: 28px;
  color: rgba(255, 255, 255, 0.84);
}

.image-viewer-header .modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.image-viewer-header .modal-close svg {
  width: 16px;
  height: 16px;
}

.image-viewer-body {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  background: transparent;
}

.image-viewer-body::before {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  animation: image-viewer-spin 780ms linear infinite;
  content: "";
  display: none;
}

.image-viewer-scrim.is-loading .image-viewer-body::before {
  display: block;
}

.image-viewer-scrim.is-error .image-viewer-body::before {
  display: none;
}

.image-viewer-body img,
.image-viewer-body canvas {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  filter: drop-shadow(0 22px 60px rgba(0, 0, 0, 0.36));
  object-fit: contain;
  pointer-events: auto;
}

.image-viewer-body img[hidden],
.image-viewer-body canvas[hidden] {
  display: none;
}

.image-viewer-scrim:not(.has-image) .image-viewer-body img,
.image-viewer-scrim:not(.has-image) .image-viewer-body canvas,
.image-viewer-scrim.is-loading .image-viewer-body img {
  display: none;
}

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

.model-auth-modal-header,
.tool-modal-header,
.feedback-modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.modal-kicker {
  margin-bottom: 7px;
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

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

.model-auth-modal-status {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.model-auth-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.model-auth-progress[hidden] {
  display: none;
}

.model-auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--text);
  border-radius: 999px;
  animation: model-auth-spin 900ms linear infinite;
}

.model-auth-modal-code {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
}

.model-auth-modal-code[hidden] {
  display: none;
}

.model-auth-modal-code span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.model-auth-modal-code strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
}

.bonzo-scope-box,
.loansifter-boundary-box {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
}

.bonzo-scope-box > span,
.loansifter-boundary-box > span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.loansifter-boundary-box p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.lendingpad-setup-steps {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: lendingpad-step;
}

.lendingpad-setup-steps > li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  counter-increment: lendingpad-step;
}

.lendingpad-setup-steps > li::before {
  display: grid;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  place-items: center;
  content: counter(lendingpad-step);
}

.lendingpad-setup-steps span {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.lendingpad-setup-steps p {
  grid-column: 2;
  margin: -1px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.25;
}

.lendingpad-step-lines {
  display: grid;
  grid-column: 2;
  gap: 1px;
  margin: -1px 0 0;
}

.lendingpad-step-lines p {
  grid-column: auto;
  margin: 0;
}

.lendingpad-storage-note {
  margin: calc(-1 * var(--space-1) / 2) 0 0;
  color: var(--text-tertiary);
  font-size: var(--text-2xs);
  line-height: var(--leading-normal);
}

.lendingpad-mfa-form input {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  letter-spacing: 0;
  text-align: center;
}

.bonzo-scope-box > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bonzo-scope-box > div > span {
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.bonzo-token-link {
  color: #8fc2ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bonzo-token-link:hover {
  color: #b9d9ff;
}

.bonzo-token-link.is-disabled {
  cursor: default;
  opacity: 0.55;
  pointer-events: none;
}

.loansifter-form {
  gap: 10px;
}

.loansifter-form .loansifter-password-field {
  position: relative;
  display: block;
}

.loansifter-form .loansifter-password-field input {
  width: 100%;
  padding-right: 42px;
}

.lendingpad-qr-field input[type="file"] {
  height: auto;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--text-secondary);
}

.lendingpad-qr-note {
  margin: -2px 0 2px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.35;
}

.password-reveal-button {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  place-items: center;
  transform: translateY(-50%);
  cursor: pointer;
}

.password-reveal-button:hover,
.password-reveal-button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.password-reveal-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.password-eye {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondary-button.loansifter-submit-button {
  width: 100%;
  min-height: var(--space-10);
  margin-top: var(--space-1);
  padding: 0 var(--space-4);
  border-color: transparent;
  border-radius: var(--radius-md);
  background: var(--grad-chip);
  color: var(--chip-ink);
  box-shadow: var(--shadow-md);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  transition:
    transform var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard),
    background var(--dur-fast) var(--ease-standard);
}

.secondary-button.loansifter-submit-button:hover:not(:disabled) {
  background: var(--send-hover);
  color: var(--send-hover-ink);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.secondary-button.loansifter-submit-button:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 2px;
}

.model-auth-modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 8px;
}

.model-auth-link-button {
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.42);
  background: var(--accent);
  color: #0a0a0a;
  font-size: 13px;
  font-weight: 600;
}

.model-auth-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.42;
}

.model-auth-steps[hidden] {
  display: none;
}

.model-auth-steps li {
  padding-left: 2px;
}

.model-auth-steps strong {
  color: var(--text);
  font-weight: 600;
}

.model-auth-modal-submit {
  display: grid;
  gap: 8px;
}

.model-auth-modal-submit[hidden] {
  display: none;
}

.model-auth-modal-submit label {
  color: var(--muted);
  font-size: 12px;
}

.model-auth-modal-submit div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.model-auth-modal-submit input {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

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

.capacity {
  --capacity-fill: var(--accent);
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
}

.capacity.warning {
  --capacity-fill: var(--warning);
}

.capacity.stale {
  opacity: 0.84;
}

.capacity.danger,
.capacity.unavailable {
  --capacity-fill: var(--danger);
}

.capacity-heading,
.capacity-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.capacity-heading span:last-child {
  display: none;
}

.capacity-heading span:first-child {
  overflow: hidden;
  color: var(--text);
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capacity-bars {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.capacity-window {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.capacity-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  white-space: nowrap;
}

.capacity-label span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.capacity-label span:last-child {
  color: var(--text-secondary);
  text-align: right;
}

.capacity-bar {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-3);
}

.capacity-bar::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--surface-3);
}

.capacity-bar::-webkit-progress-value {
  border-radius: 999px;
  background: var(--capacity-fill);
}

.capacity-bar::-moz-progress-bar {
  border-radius: 999px;
  background: var(--capacity-fill);
}

.tool-list {
  display: grid;
  gap: 6px;
}

.tool-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(44px, max-content);
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.tool-button-icon {
  display: inline-grid;
  flex: 0 0 19px;
  place-items: center;
  width: 19px;
  height: 19px;
  color: var(--text-tertiary);
}

.tool-button-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.tool-button:not(:disabled):hover,
.tool-button.active {
  color: var(--text);
}

.tool-button-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tool-button-label > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-button-meta {
  color: var(--text-tertiary);
  font-size: 11px;
}

.tool-invoke-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 44px;
  height: 26px;
  min-height: 26px;
  max-width: 64px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-invoke-chip:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--surface-2);
  color: var(--text);
}

.tool-use-button {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding: 0;
}

.tool-use-icon,
.tool-use-icon svg {
  display: block;
  width: 15px;
  height: 15px;
}

.tool-use-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mobile-tools-group-title,
.mobile-skills-group {
  display: none;
}

.tool-list-empty {
  padding: 8px 10px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.tool-modal-description,
.tool-modal-boundary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.tool-modal-section {
  display: grid;
  gap: 8px;
}

.tool-modal-section h3 {
  color: var(--text);
  font-size: 13px;
}

.subagent-modal-block {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface);
  color: var(--text-secondary);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.tool-modal-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.tool-tunable-list {
  display: grid;
  gap: 8px;
}

.tool-methodology-list {
  display: grid;
  gap: 7px;
}

.tool-methodology {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
}

.tool-methodology summary {
  min-height: 44px;
  padding: 10px 11px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
}

.tool-methodology .tool-modal-list {
  padding: 0 12px 11px 28px;
}

.feedback-modal-form {
  display: grid;
  gap: 14px;
}

.feedback-modal-selected {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  line-height: 1.2;
}

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

.feedback-field span {
  color: var(--text-secondary);
  font-size: 12px;
}

.feedback-field textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  resize: vertical;
}

.feedback-field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 255, 0.18);
}

.feedback-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.tool-tunable {
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
}

.tool-tunable-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.tool-tunable h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.tool-tunable-top span {
  max-width: 220px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-align: right;
}

.tool-tunable code {
  color: var(--text-tertiary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.tool-tunable p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.tool-config-list {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 7px 12px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
}

.tool-config-list dt {
  color: var(--text-tertiary);
}

.tool-config-list dd {
  min-width: 0;
  margin: 0;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.control-spacer {
  flex: 1 1 auto;
}

.settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: calc(100% - 18px);
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.settings-button:hover {
  background: rgba(255, 255, 255, 0.055);
}

.settings-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
  cursor: pointer;
}

.settings-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
}

.settings-toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-toggle-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.settings-toggle-description {
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.25;
}

.settings-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-switch {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
}

.settings-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--ink-3);
  transition: transform 0.16s ease, background 0.16s ease;
}

.settings-switch-input:checked + .settings-switch {
  background: var(--green-soft);
}

.settings-switch-input:checked + .settings-switch::after {
  transform: translateX(18px);
  background: var(--green);
}

.settings-switch-input:focus-visible + .settings-switch {
  outline: 1px solid var(--green);
  outline-offset: 2px;
}

.settings-select {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.settings-select:focus {
  outline: 1px solid var(--accent-2);
  outline-offset: 2px;
}

.settings-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.work-panel {
  display: grid;
  grid-column: 2;
  grid-template-rows: minmax(0, 1fr);
  margin-left: -14px;
  border-left: 1px solid var(--border);
  border-top-left-radius: 26px;
  border-bottom-left-radius: 26px;
  background: var(--workspace);
  overflow: hidden;
  z-index: 1;
}

.chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.chat::after {
  position: absolute;
  inset: 18px;
  z-index: 18;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 54px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  content: "";
}

.chat.is-file-drop-target::after {
  opacity: 1;
}

.chat[hidden],
.login[hidden] {
  display: none;
}

.login {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 24px;
}

.login-form {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.login-form h2,
.login-form p {
  margin: 0;
}

.login-form h2 {
  color: var(--text);
  font-size: 18px;
  font-weight: 430;
}

.login-form p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.primary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 14px;
  font-weight: 430;
  text-decoration: none;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.messages {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 56px var(--chat-column-right) calc(var(--composer-height) + 70px + env(safe-area-inset-bottom)) var(--chat-column-left);
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(var(--composer-height) + 70px + env(safe-area-inset-bottom));
}

.app-shell.artifact-pinned .messages {
  padding-right: var(--chat-column-right);
}

.message {
  width: min(var(--chat-column-width), 100%);
  padding: 8px 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 400;
  white-space: pre-wrap;
  line-height: 1.45;
}

.message.user {
  align-self: center;
  border-color: var(--border);
  background: var(--floating);
  padding: 14px 16px;
  border-radius: 18px;
}

.message.assistant {
  align-self: center;
}

.message.run-queued,
.message.run-running {
  color: var(--text-secondary);
}

.message.run-failed {
  color: var(--text);
}

.message.typing {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(768px, 100%);
  min-height: 36px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.message.typing .meta {
  margin-bottom: 0;
}

.message.typing .assistant-meta {
  flex: 0 0 auto;
  min-height: 18px;
}

.message-content {
  overflow-wrap: anywhere;
}

.markdown-content {
  white-space: normal;
}

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

.markdown-content > :last-child {
  margin-bottom: 0;
}

.markdown-content p {
  margin: 0 0 10px;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin: 16px 0 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.markdown-content h1,
.markdown-content h2 {
  font-size: 16px;
}

.markdown-content ul,
.markdown-content ol {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
  padding-left: 22px;
}

.markdown-content li {
  padding-left: 2px;
}

.markdown-content blockquote {
  margin: 0 0 10px;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--border);
  color: var(--text-secondary);
}

.markdown-content pre {
  margin: 0 0 10px;
  max-width: 100%;
  overflow-x: hidden;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.markdown-content code {
  padding: 1px 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.markdown-content pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.markdown-content a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 2px;
}

.markdown-table-wrap {
  max-width: 100%;
  margin: 0 0 10px;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: normal;
}

.markdown-content th,
.markdown-content td {
  min-width: 110px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  border-left: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
}

.markdown-content th:first-child,
.markdown-content td:first-child {
  border-left: 0;
}

.markdown-content tbody tr:last-child td {
  border-bottom: 0;
}

.markdown-content th {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 600;
}

.message-content-live {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.live-assistant-line {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.inline-live-dots {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 18px;
  padding-left: 8px;
}

.inline-live-dots > span:not(.dot-morph, .putt-stage, .morphed) {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-2);
  opacity: 0.4;
  animation: inline-dot-pulse 1.2s ease-in-out infinite;
}

.inline-live-dots > span:not(.dot-morph, .putt-stage, .morphed):nth-child(2) {
  animation-delay: 0.16s;
}

.inline-live-dots > span:not(.dot-morph, .putt-stage, .morphed):nth-child(3) {
  animation-delay: 0.32s;
}

.live-assistant-draft {
  width: min(100%, 620px);
  padding: 8px 10px;
  border-left: 2px solid var(--accent-2);
  border-radius: var(--r-xs);
  background: var(--control-charcoal);
  color: var(--text);
  font-size: var(--text-base);
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.live-workstream {
  width: min(100%, 620px);
  margin-top: 4px;
  font-size: var(--text-xs);
  line-height: 1.35;
}

.live-workstream-current {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 3px 8px;
  align-items: baseline;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--control-charcoal);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.live-workstream-current-text {
  min-width: 0;
  color: var(--text);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.live-workstream-current-text::before {
  content: "// ";
  color: var(--text-secondary);
}

.live-workstream-current.running .live-workstream-current-text {
  animation: live-workstream-text-pulse 1.8s var(--ease-standard) infinite;
}

.live-workstream-current.failed .live-workstream-current-text {
  color: var(--danger);
  animation: none;
}

.live-workstream-current-detail {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}


@keyframes live-workstream-text-pulse {
  0%,
  100% {
    opacity: 0.86;
  }

  45% {
    opacity: 1;
  }
}

@keyframes inline-dot-pulse {
  0%,
  70%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  35% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.message-artifacts {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.message-attachment {
  max-width: 100%;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-artifact {
  display: grid;
  gap: 10px;
  max-width: 520px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.artifact-preview-link {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  cursor: zoom-in;
}

.artifact-preview-link img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.message-artifact-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.message-artifact-copy > a,
.message-artifact-copy > button,
.artifact-title-link {
  width: fit-content;
  max-width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
}

button.artifact-title-link,
.message-artifact-copy > button {
  cursor: pointer;
}

.message-artifact-copy > a:hover,
.message-artifact-copy > button:hover,
.artifact-title-link:hover {
  text-decoration: underline;
}

.message-artifact-copy p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.35;
}

.message-feedback {
  display: flex;
  gap: 2px;
  margin-top: 6px;
}

.message-feedback .feedback-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
}

.feedback-menu {
  position: relative;
  display: inline-grid;
}

.feedback-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-tertiary);
}

.feedback-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.feedback-button.recorded {
  color: var(--status-ok);
}

.message-copy-button.recorded svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.response-speech-button[aria-pressed="true"] {
  color: var(--text);
}

.response-speech-button.is-ready {
  color: var(--status-warn);
}

.response-speech-button.is-loading {
  cursor: wait;
}

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

.feedback-issue-menu {
  position: absolute;
  z-index: 1000;
  left: 0;
  top: calc(100% + 6px);
  display: none;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--floating);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.26);
}

.feedback-menu.open .feedback-issue-menu {
  display: grid;
  gap: 2px;
}

.feedback-issue-option {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
}

.feedback-issue-option:hover,
.feedback-issue-option:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

.meta {
  margin-bottom: 6px;
}

.assistant-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  flex-wrap: wrap;
}

.assistant-mark {
  display: block;
  width: 21px;
  height: 20px;
  object-fit: contain;
  opacity: 0.86;
}

.model-timing-summary {
  color: var(--text-tertiary);
}

.model-timing-summary::before {
  content: "|";
  margin-right: 8px;
  color: var(--border-strong);
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 18px;
}

.typing-dots > span:not(.dot-morph, .putt-stage, .morphed) {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-2);
  opacity: 0.4;
  animation: typing-pulse 1.1s ease-in-out infinite;
}

.typing-dots > span:not(.dot-morph, .putt-stage, .morphed):nth-child(2) {
  animation-delay: 0.14s;
}

.typing-dots > span:not(.dot-morph, .putt-stage, .morphed):nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes typing-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.azalea-burst {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  width: 0;
  height: 0;
}

.azalea-burst .bloom {
  position: absolute;
  left: 0;
  top: 0;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  transform-origin: center;
  opacity: 0;
  animation: azalea-bloom 0.85s cubic-bezier(0.2, 0.7, 0.28, 1.08) forwards;
}

.azalea-burst .bloom svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 5px 12px rgba(178, 60, 119, 0.3));
}

.azalea-burst .bloom .lobe {
  transform-box: fill-box;
  transform-origin: 50% 92%;
  animation: azalea-unfurl 0.85s cubic-bezier(0.2, 0.7, 0.28, 1.08) forwards;
}

.azalea-burst .bloom .stamens {
  opacity: 0;
  animation: azalea-stamens 0.85s ease forwards;
}

.send-button.is-azalea-blooming,
.suggestion-send.is-azalea-blooming {
  opacity: 0;
}

.typing-dots > span.morphed {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  animation: none !important;
  opacity: 0 !important;
}

.typing-dots .dot-morph {
  position: absolute;
  top: 50%;
  pointer-events: none;
  border-radius: 0;
  background: transparent;
  opacity: 1;
  animation: augusta-dot-wave 1.4s ease-in-out infinite;
  animation-delay: var(--wave-delay, 0s);
}

.typing-dots .dot-morph.az {
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
}

.typing-dots .dot-morph.az .inner {
  display: block;
  width: 100%;
  height: 100%;
  transform: scale(0) rotate(-8deg);
  animation: dot-azalea-in 0.5s cubic-bezier(0.2, 0.75, 0.3, 1.1) forwards;
}

.typing-dots .dot-morph.az .inner svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 4px rgba(178, 60, 119, 0.4));
}

.typing-dots .dot-morph.golf {
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
}

.typing-dots .dot-morph.golf .inner {
  display: block;
  width: 100%;
  height: 100%;
  transform: scale(0);
  animation: dot-golf-in 0.42s cubic-bezier(0.2, 0.8, 0.3, 1.1) forwards;
}

.typing-dots .dot-morph.golf .inner svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px rgba(27, 38, 32, 0.25));
}

.typing-dots .dot-morph.az.out .inner,
.typing-dots .dot-morph.golf.out .inner {
  animation: dot-morph-out 0.42s cubic-bezier(0.4, 0, 0.5, 1) forwards;
}

.typing-dots .putt-stage {
  position: absolute;
  left: -4px;
  top: 50%;
  width: 70px;
  height: 36px;
  margin-top: -18px;
  pointer-events: none;
  border-radius: 0;
  background: transparent;
  opacity: 1;
  animation: none;
}

.putt-hole {
  position: absolute;
  left: 44px;
  bottom: 6px;
  z-index: 1;
  width: 14px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 28%, #0a1a12, var(--golf-hole, #10231a) 62%, #0a1a12 100%);
  box-shadow: 0 0 0 1.4px var(--golf-hole-rim, rgba(11, 106, 74, 0.5)), 0 1px 2px rgba(0, 0, 0, 0.25);
}

.putt-pole {
  position: absolute;
  left: 50px;
  bottom: 8px;
  z-index: 2;
  width: 2px;
  height: 25px;
  border-radius: 1px;
  background: var(--masters-pole, #5c645b);
  transform-origin: bottom center;
  animation: augusta-flag-wave 2.4s ease-in-out infinite;
}

.putt-flagcloth {
  position: absolute;
  left: 52px;
  bottom: 25px;
  z-index: 2;
  width: 13px;
  height: 9px;
  background: var(--masters-flag, #f5c518);
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.15);
  transform-origin: left center;
  animation: augusta-flag-wave 2.4s ease-in-out infinite;
}

.putt-ball {
  position: absolute;
  left: 1px;
  bottom: 9px;
  z-index: 3;
  width: 10px;
  height: 10px;
  animation: putt-roll 1.35s linear forwards;
}

.putt-ball svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes azalea-bloom {
  0% {
    opacity: 0;
    transform: scale(0.4) rotate(-6deg);
  }

  28% {
    opacity: 1;
    transform: scale(1.02) rotate(-1deg);
  }

  50% {
    opacity: 1;
    transform: scale(1.07);
  }

  72% {
    opacity: 1;
    transform: scale(1.03);
  }

  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}

@keyframes azalea-unfurl {
  0% {
    transform: scale(0.2);
  }

  45% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes azalea-stamens {
  0%,
  26% {
    opacity: 0;
  }

  50%,
  100% {
    opacity: 1;
  }
}

@keyframes augusta-dot-wave {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-3px);
  }
}

@keyframes dot-azalea-in {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-8deg);
  }

  45% {
    opacity: 1;
    transform: scale(1.12) rotate(2deg);
  }

  70% {
    transform: scale(1) rotate(0);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dot-golf-in {
  0% {
    opacity: 0;
    transform: scale(0);
  }

  60% {
    opacity: 1;
    transform: scale(1.15);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dot-morph-out {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.2);
  }
}

@keyframes augusta-flag-wave {
  0%,
  100% {
    transform: rotate(-2deg);
  }

  50% {
    transform: rotate(2deg);
  }
}

@keyframes putt-roll {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(0deg);
    animation-timing-function: ease-in;
  }

  6% {
    opacity: 1;
    animation-timing-function: ease-in;
  }

  30% {
    opacity: 1;
    transform: translateX(28px) translateY(0) rotate(420deg);
    animation-timing-function: ease-out;
  }

  55%,
  80% {
    opacity: 1;
    transform: translateX(39px) translateY(0) rotate(560deg);
    animation-timing-function: linear;
  }

  86% {
    opacity: 1;
    transform: translateX(40px) translateY(0) rotate(566deg);
    animation-timing-function: ease-in;
  }

  100% {
    opacity: 0;
    transform: translateX(43px) translateY(7px) rotate(620deg) scale(0.45);
  }
}

@keyframes augusta-reduced-fade {
  0% {
    opacity: 0;
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 1;
  }
}

.composer {
  position: fixed;
  left: var(--composer-left);
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 44px 44px;
  grid-template-rows: auto 44px auto;
  column-gap: 8px;
  row-gap: 4px;
  width: var(--composer-width);
  margin: 0;
  padding: 10px 8px 8px;
  border: 0;
  border-radius: 22px;
  background: var(--floating);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  z-index: 20;
}

.composer.has-attachments {
  grid-template-rows: auto auto 44px;
}

.composer.is-replying {
  grid-template-rows: auto auto 44px auto;
}

.composer.is-replying.has-attachments {
  grid-template-rows: auto auto auto 44px;
}

.app-shell.artifact-pinned .composer {
  transform: none;
}

#message-input {
  grid-column: 1 / -1;
  grid-row: 1;
  align-self: start;
  width: 100%;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  max-height: 152px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 5px 10px;
  font: inherit;
  line-height: 1.45;
  overflow-y: hidden;
  resize: none;
  scrollbar-width: thin;
}

.composer-reply-reference {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: var(--space-3);
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--gold-soft);
  color: var(--ink-2);
  overflow: hidden;
}

.composer-reply-reference[hidden] {
  display: none;
}

.composer-reply-label {
  color: var(--green);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.composer-reply-preview {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-reply-clear {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-3);
}

.composer-reply-clear:hover {
  background: var(--gold-wash);
  color: var(--ink);
}

.composer-reply-clear svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.composer.is-replying #message-input {
  grid-row: 2;
}

.composer.has-attachments #message-input {
  grid-row: 2;
}

.composer.is-replying.has-attachments #message-input {
  grid-row: 2;
}

#message-input::placeholder {
  color: var(--text-tertiary);
}

#message-input:focus {
  outline: 0;
}

button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #0a0a0a;
  padding: 0 16px;
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}

button:focus {
  outline: 0;
}

button:focus-visible {
  outline: 1px solid var(--accent-2);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.send-button {
  grid-column: 5;
  grid-row: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 999px;
  padding: 0;
  background: var(--control-charcoal-hover);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.send-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.composer.has-attachments .send-button {
  grid-row: 3;
}

.composer.is-replying .send-button {
  grid-row: 3;
}

.composer.is-replying.has-attachments .send-button {
  grid-row: 4;
}

.mic-button {
  grid-column: 4;
  grid-row: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
}

.composer.has-attachments .mic-button {
  grid-row: 3;
}

.composer.is-replying .mic-button {
  grid-row: 3;
}

.composer.is-replying.has-attachments .mic-button {
  grid-row: 4;
}

.mic-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.mic-button svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.mic-button .stop-icon,
.mic-button .button-spinner {
  display: none;
}

.composer.is-dictation-recording .mic-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.composer.is-dictation-recording .mic-button .mic-icon,
.composer.is-dictation-processing .mic-button .mic-icon {
  display: none;
}

.composer.is-dictation-recording .mic-button .stop-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: #fff;
  stroke: none;
}

.composer.is-dictation-processing .mic-button .button-spinner {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--text);
  border-radius: 999px;
  animation: model-auth-spin 900ms linear infinite;
}

.attach-button {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
}

.composer.has-attachments .attach-button {
  grid-row: 3;
}

.composer.is-replying .attach-button {
  grid-row: 3;
}

.composer.is-replying.has-attachments .attach-button {
  grid-row: 4;
}

.attach-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.attach-icon {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dictation-bars {
  position: relative;
  grid-column: 2 / 4;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  align-self: center;
  min-width: 0;
  height: 40px;
  padding: 0;
  overflow: hidden;
  transform-origin: center;
}

.composer.is-dictation-recording .dictation-bars {
  padding-right: 46px;
}

.composer.has-attachments .dictation-bars {
  grid-row: 3;
}

.composer.is-replying .dictation-bars {
  grid-row: 3;
}

.composer.is-replying.has-attachments .dictation-bars {
  grid-row: 4;
}

.dictation-bars[hidden] {
  display: none;
}

.dictation-bars span {
  position: relative;
  z-index: 1;
  flex: 0 0 2px;
  display: block;
  width: 2px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  opacity: 0.78;
  transform: scaleY(var(--wave-scale, 0.07));
  transform-origin: center;
  transition: none;
  will-change: transform;
}

.dictation-bars span.is-active {
  background: rgba(255, 255, 255, 0.94);
  opacity: 1;
}

.dictation-timer {
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  justify-self: end;
  min-width: 38px;
  z-index: 2;
  padding-left: 6px;
  background: var(--floating);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.composer.is-dictation-fallback .dictation-timer {
  min-width: 104px;
  color: var(--text);
}

.composer.has-attachments .dictation-timer {
  grid-row: 3;
}

.composer.is-replying .dictation-timer {
  grid-row: 3;
}

.composer.is-replying.has-attachments .dictation-timer {
  grid-row: 4;
}

.dictation-timer[hidden] {
  display: none;
}

.attachment-list {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.composer.is-replying .attachment-list {
  grid-row: 1;
}

.composer.is-replying.has-attachments .attachment-list {
  grid-row: 3;
}

.attachment-list:empty {
  display: none;
  pointer-events: none;
}

.attachment-list[hidden] {
  display: none;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 4px 3px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
}

.attachment-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-remove {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1;
}

.attachment-remove:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.jump-to-latest-shell {
  position: fixed;
  left: var(--composer-left);
  bottom: calc(var(--composer-height) + 60px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  width: var(--composer-width);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 14;
}

.jump-to-latest-shell[hidden] {
  display: none;
}

.jump-to-latest-shell.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.jump-to-latest {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--control-charcoal);
  color: var(--text-secondary);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}

.jump-to-latest:hover {
  background: var(--control-charcoal-hover);
  color: var(--text);
}

.jump-to-latest::before,
.jump-to-latest::after {
  position: absolute;
  left: 50%;
  content: "";
}

.jump-to-latest::before {
  top: 17px;
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.jump-to-latest::after {
  top: 11px;
  width: 2px;
  height: 18px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.artifact-panel {
  position: fixed;
  right: 20px;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 386px;
  max-height: calc(100dvh - 110px);
  margin: 0;
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(41, 41, 41, 0.34);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  backdrop-filter: blur(22px) saturate(1.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  z-index: 5;
}

.artifact-panel.is-pinned {
  background: rgba(41, 41, 41, 0.34);
}

.artifact-panel.is-positioned {
  right: auto;
}

.artifact-panel.is-collapsed {
  right: 18px;
  top: 18px;
  width: 48px;
  height: 48px;
  max-height: 48px;
  gap: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
}

.artifact-panel.is-collapsed .artifact-body,
.artifact-panel.is-collapsed .artifact-resize-handle {
  display: none;
}

.artifact-panel.is-collapsed .artifact-header {
  position: static;
  width: 100%;
  height: 100%;
  cursor: default;
  justify-content: center;
}

.artifact-panel.is-collapsed .artifact-header h2 {
  display: none;
}

.artifact-panel.is-collapsed .artifact-header-actions {
  display: grid;
  place-items: center;
}

.artifact-panel.is-collapsed .panel-collapse-button {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--text-secondary);
}

.artifact-panel.is-collapsed .panel-artifacts-icon {
  width: 20px;
  height: 20px;
}

.artifact-panel.is-collapsed .panel-minimize-icon {
  display: none;
}

.artifact-header {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  cursor: move;
  touch-action: none;
  user-select: none;
}

.artifact-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.artifact-header h2 {
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
}

.panel-collapse-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.panel-collapse-button:hover {
  background: var(--control-charcoal-hover);
}

.panel-minimize-icon,
.panel-close-icon,
.panel-artifacts-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.panel-artifacts-icon {
  display: none;
}

.panel-close-icon {
  display: none;
}

.artifact-panel.is-collapsed .panel-artifacts-icon {
  display: block;
}

.artifact-body {
  display: grid;
  flex: 1 1 auto;
  gap: 16px;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding-top: 10px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.workspace-section {
  display: grid;
  gap: 11px;
}

.progress-list {
  display: grid;
  gap: 12px;
}

.progress-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.38;
}

.todo-item {
  align-items: center;
}

.todo-item.done .todo-title-edit {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--ink-3) 72%, transparent);
}

.progress-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.todo-copy {
  display: block;
}

.todo-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
}

.progress-copy p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.35;
}

.progress-dot {
  display: block;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 0;
  border: 1px solid var(--faint);
  border-radius: 999px;
  background: transparent;
  position: relative;
}

button.progress-dot {
  cursor: pointer;
}

button.progress-dot:hover {
  border-color: var(--text-secondary);
}

.progress-dot.done {
  border-color: var(--status-ok);
  background: transparent;
}

.progress-dot.done::after {
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: var(--status-ok);
  content: "";
}

.progress-dot.active {
  border-color: var(--status-ok);
}

.progress-dot.active::after {
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: var(--status-ok);
  content: "";
}

.progress-dot.blocked {
  border-color: var(--danger);
}

.progress-dot.failed {
  border-color: var(--danger);
  background: rgba(255, 95, 95, 0.12);
}

.progress-dot.failed::after {
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: var(--danger);
  content: "";
}

.progress-dot.canceled,
.progress-dot.paused {
  border-color: var(--text-tertiary);
}

.panel-item-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: -4px;
}

.inline-edit-field {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
}

.inline-edit-field:focus {
  outline: 0;
  color: var(--text-primary);
}

.inline-edit-field:hover {
  color: var(--text-secondary);
}

.todo-detail-edit {
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.35;
}

.todo-delete-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  justify-self: end;
  color: var(--text-dim);
}

.todo-delete-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.panel-icon-button {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.4;
}

.panel-icon-button:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

.panel-divider {
  height: 1px;
  background: var(--border);
}

.artifact-list,
.subagent-list,
.scheduled-list {
  display: grid;
  gap: 12px;
}

.subagent-list {
  max-height: 178px;
  overflow-y: auto;
  padding-right: 2px;
}

.subagent-row {
  grid-template-columns: 16px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.subagent-copy {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.subagent-copy h3 {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subagent-copy p {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subagent-copy:hover h3 {
  color: var(--text-secondary);
}

.subagent-row .progress-dot {
  width: 10px;
  height: 10px;
  margin-top: 0;
  align-self: center;
}

.subagent-row .progress-dot::after {
  inset: 2px;
}

.subagent-cancel-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--text-dim);
}

.subagent-cancel-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.panel-show-more-button {
  width: fit-content;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.panel-show-more-button:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

.scheduled-row.hidden-row {
  opacity: 0.6;
}

.scheduled-copy {
  display: block;
  gap: 2px;
}

.scheduled-copy h3 {
  margin-bottom: 2px;
}

.panel-section-title {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.panel-row {
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
}

.panel-row.hidden-row {
  opacity: 0.6;
}

.panel-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.artifact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.artifact-actions a,
.artifact-remove,
.artifact-send {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.artifact-actions a:hover,
.artifact-remove:hover,
.artifact-send:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

.empty-panel-row {
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.35;
}

.artifact-resize-handle {
  position: absolute;
  left: -12px;
  top: 20px;
  bottom: 20px;
  width: 24px;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
}

.artifact-resize-handle::after {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 2px;
  height: 54px;
  border-radius: 999px;
  background: var(--faint);
  content: "";
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 140ms ease;
}

.artifact-panel:hover .artifact-resize-handle::after,
.artifact-resize-handle:focus-visible::after {
  opacity: 0.48;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 288px minmax(0, 1fr);
  }

  .messages {
    align-items: flex-start;
    padding: 64px 372px 142px 48px;
  }

  .app-shell.artifact-pinned .messages {
    padding-right: max(320px, calc(var(--artifact-reserve) + 16px));
  }

  .message {
    width: min(440px, 100%);
  }

  .message.typing {
    width: min(440px, 100%);
  }

  .composer {
    width: var(--composer-width);
  }

  .jump-to-latest-shell {
    width: var(--composer-width);
  }

  .artifact-panel {
    width: 340px;
    right: 16px;
  }
}

@media (max-width: 720px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    --composer-left: 14px;
    --composer-mobile-bottom: calc(5dvh + 7px);
    --composer-width: calc(100vw - 28px);
    display: block;
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 20;
    display: grid;
    gap: 0;
    height: 68px;
    max-height: none;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow: visible;
  }

  .control-panel.is-mobile-open {
    height: auto;
    max-height: min(440px, calc(100dvh - 18px));
    padding: 12px 14px 14px;
    border-bottom-right-radius: 24px;
    border-bottom-left-radius: 24px;
    background: rgba(26, 26, 26, 0.84);
    box-shadow: 0 24px 58px rgba(0, 0, 0, 0.34);
    -webkit-backdrop-filter: blur(26px) saturate(1.18);
    backdrop-filter: blur(26px) saturate(1.18);
    overflow-y: auto;
  }

  .brand-block {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .brand-title {
    height: 48px;
  }

  .brand-block h1 {
    font-size: 18px;
  }

  .brand-menu-button {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    outline: 0;
    background: #0000ff;
    box-shadow:
      0 16px 36px rgba(0, 0, 0, 0.2),
      0 0 22px rgba(0, 0, 255, 0.18);
  }

  .brand-menu-button:hover,
  .brand-menu-button[aria-expanded="true"] {
    background: #0000ff;
    color: var(--text);
  }

  .brand-menu-button[aria-expanded="true"] {
    box-shadow:
      0 18px 42px rgba(0, 0, 0, 0.28),
      0 0 24px rgba(0, 0, 255, 0.2);
  }

  .brand-wordmark {
    display: none;
  }

  .brand-mark {
    display: block;
    width: 25px;
    height: auto;
    opacity: 0.92;
  }

  .control-section,
  .settings-button {
    display: none;
  }

  .control-panel.is-mobile-open .control-section[aria-label="Connections"] {
    display: grid;
    gap: 6px;
    margin-top: 10px;
  }

  .control-panel.is-mobile-open .settings-button {
    display: inline-flex;
    width: 100%;
    margin-top: 8px;
  }

  .tools-section {
    display: none;
  }

  .tools-section.is-mobile-open {
    position: fixed;
    left: auto;
    right: 12px;
    top: auto;
    bottom: calc(var(--composer-height) + var(--composer-mobile-bottom) + 130px + env(safe-area-inset-bottom));
    z-index: 17;
    display: grid;
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100dvh - var(--composer-height) - var(--composer-mobile-bottom) - 196px - env(safe-area-inset-bottom));
    gap: 10px;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(22, 22, 22, 0.97);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
    -webkit-backdrop-filter: blur(14px) saturate(1.04);
    backdrop-filter: blur(14px) saturate(1.04);
    overflow-y: auto;
  }

  .mobile-tools-button {
    position: fixed;
    left: auto;
    right: 14px;
    bottom: calc(var(--composer-height) + var(--composer-mobile-bottom) + 72px + env(safe-area-inset-bottom));
    z-index: 18;
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--control-charcoal);
    color: var(--text-secondary);
  }

  .mobile-tools-button:hover {
    background: var(--control-charcoal);
  }

  .mobile-tools-button[aria-expanded="true"] {
    border: 1px solid var(--border);
    background: var(--control-charcoal);
    color: var(--text-secondary);
  }

  .mobile-tools-button[aria-expanded="true"] .mobile-tools-icon {
    display: none;
  }

  .mobile-tools-button[aria-expanded="true"] .mobile-tools-minimize-icon {
    display: block;
  }

  .connection-row {
    min-height: 44px;
    padding: 6px 8px;
  }

  .connection-label {
    font-size: 12px;
  }

  .integration-state,
  .capacity-heading,
  .capacity-label {
    font-size: 11px;
  }

  .capacity-bars {
    gap: 6px;
  }

  .capacity-unavailable {
    display: none;
  }

  .model-auth-modal-scrim,
  .tool-modal-scrim,
  .feedback-modal-scrim,
  .markdown-viewer-scrim {
    align-items: start;
    padding: 12px 14px calc(var(--composer-height, 100px) + var(--composer-mobile-bottom, 30px) + 22px);
  }

  .model-auth-modal,
  .tool-modal,
  .feedback-modal,
  .markdown-viewer {
    width: 100%;
    max-height: calc(100dvh - 28px);
    padding: 18px;
    border-radius: 14px;
  }

  .markdown-viewer {
    height: calc(100vh - var(--composer-height, 100px) - var(--composer-mobile-bottom, 30px) - 96px);
    max-height: 52vh;
    margin-top: 0;
    margin-bottom: 0;
  }

  .tool-tunable-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .tool-tunable-top span {
    max-width: none;
    text-align: left;
  }

  .image-viewer-scrim {
    padding: 10px 10px calc(var(--composer-height, 100px) + var(--composer-mobile-bottom, 30px) + 18px);
  }

  .image-viewer {
    max-width: calc(100vw - 20px);
    height: calc(100vh - var(--composer-height, 100px) - var(--composer-mobile-bottom, 30px) - 72px);
    max-height: 52vh;
  }

  .image-viewer-header {
    top: 8px;
    max-width: calc(100vw - 24px);
  }

  .model-auth-modal-actions,
  .model-auth-modal-submit div {
    grid-template-columns: 1fr;
  }

  .tool-button {
    text-align: center;
  }

  .tools-section .tool-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tools-section .tool-row {
    grid-template-columns: minmax(0, 1fr) minmax(52px, max-content);
    min-height: 52px;
    padding: 4px 0;
  }

  .tools-section .tool-button {
    height: 48px;
    text-align: left;
  }

  .tools-section .tool-button-label > span {
    white-space: normal;
  }

  .tools-section .tool-invoke-chip {
    min-width: 52px;
    max-width: 72px;
    font-size: 10px;
  }

  .tools-section .skill-row .tool-invoke-chip {
    max-width: 132px;
  }

  .tools-section .skill-row .tool-use-button {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
  }

  .control-spacer {
    display: none;
  }

  .artifact-panel {
    position: fixed;
    top: 70px;
    right: 12px;
    bottom: auto;
    left: auto;
    z-index: 15;
    display: flex;
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100dvh - var(--composer-height) - var(--composer-mobile-bottom) - 112px - env(safe-area-inset-bottom));
    height: auto;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: transparent;
    overflow: hidden;
    isolation: isolate;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .artifact-panel::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: rgba(22, 22, 22, 0.97);
    -webkit-backdrop-filter: blur(14px) saturate(1.04);
    backdrop-filter: blur(14px) saturate(1.04);
    content: "";
    pointer-events: none;
  }

  .artifact-panel.is-pinned {
    background: transparent;
  }

  .artifact-panel.is-collapsed::before {
    display: none;
  }

  .artifact-header {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: calc(var(--composer-height) + var(--composer-mobile-bottom) + 14px + env(safe-area-inset-bottom));
    display: flex;
    width: 46px;
    height: 46px;
    cursor: default;
    z-index: 18;
  }

  .artifact-resize-handle {
    display: none;
  }

  .panel-collapse-button {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: var(--control-charcoal);
  }

  .artifact-panel:not(.is-collapsed) .panel-collapse-button {
    color: var(--muted);
  }

  .panel-minimize-icon,
  .panel-artifacts-icon {
    width: 21px;
    height: 21px;
  }

  .artifact-panel.is-collapsed {
    top: auto;
    right: 14px;
    bottom: calc(var(--composer-height) + var(--composer-mobile-bottom) + 14px + env(safe-area-inset-bottom));
    width: 46px;
    height: 46px;
    max-height: 46px;
    padding: 0;
    border-radius: 15px;
  }

  .artifact-panel.is-collapsed .artifact-header {
    position: static;
    width: 100%;
    height: 100%;
    justify-content: center;
  }

  .artifact-panel.is-collapsed .panel-collapse-button {
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .artifact-panel.is-collapsed .panel-artifacts-icon {
    width: 21px;
    height: 21px;
  }

  .artifact-body {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding-top: 0;
    position: relative;
    z-index: 1;
  }

  .workspace-section {
    width: auto;
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    gap: 8px;
  }

  .panel-section-title {
    font-size: 12px;
  }

  .panel-divider {
    display: none;
  }

  .progress-list,
  .scheduled-list,
  .artifact-list {
    display: grid;
    gap: 8px;
    min-width: 0;
  }

  .progress-item {
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 8px;
    font-size: 12px;
  }

  .progress-dot {
    width: 14px;
    height: 14px;
  }

  .progress-dot.done::after {
    inset: 3px;
  }

  .panel-row p,
  .progress-copy p,
  .empty-panel-row {
    font-size: 11px;
  }

  .work-panel {
    height: 100dvh;
    margin-left: 0;
    padding-top: 0;
    border-left: 0;
    border-top: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  .messages {
    align-items: stretch;
    padding: 76px 14px calc(var(--composer-height) + var(--composer-mobile-bottom) + 28px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(var(--composer-height) + var(--composer-mobile-bottom) + 28px + env(safe-area-inset-bottom));
  }

  .jump-to-latest-shell {
    left: var(--composer-left);
    right: auto;
    bottom: calc(var(--composer-height) + var(--composer-mobile-bottom) + 16px + env(safe-area-inset-bottom));
    width: var(--composer-width);
  }

  .message {
    width: 100%;
    font-size: 15px;
  }

  .message.user {
    width: fit-content;
    max-width: min(86%, 340px);
    align-self: flex-end;
  }

  .composer {
    position: fixed;
    left: var(--composer-left);
    bottom: calc(var(--composer-mobile-bottom) + env(safe-area-inset-bottom));
    width: var(--composer-width);
    margin: 0;
    padding: 11px 9px 9px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background: rgba(32, 32, 32, 0.9);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
    -webkit-backdrop-filter: blur(24px) saturate(1.12);
    backdrop-filter: blur(24px) saturate(1.12);
  }

  #message-input {
    max-height: min(152px, 30dvh);
  }

  .message.typing {
    width: 100%;
  }
}

/* ALW-140 redesign layer. This maps the existing functional DOM to the new
   tokenized shell so backend and auth flows keep working while the visual
   system moves to the Augusta/Royal themes. */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --font-ui: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --weight-semibold: 600;
  --leading-tight: 1.25;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-10: 40px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --ease-standard: cubic-bezier(0.2, 0.7, 0.28, 1.05);
  --dur-fast: 0.15s;
  --dur-base: 0.2s;
  --dur-slow: 0.4s;
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
  --paper: #F5F4EC;
  --card: #FFFEFB;
  --card-2: #F1F0E7;
  --tray: #EBEAE0;
  --ink: #1B2620;
  --ink-2: #5C645B;
  --ink-3: #9CA197;
  --line: rgba(27, 38, 32, 0.08);
  --line-2: rgba(27, 38, 32, 0.045);
  --green: #0B6A4A;
  --green-bright: #13885F;
  --green-soft: rgba(11, 106, 74, 0.10);
  --green-soft-2: rgba(11, 106, 74, 0.05);
  --green-wash: var(--green-soft-2);
  --gold: #E0A411;
  --gold-bright: #FFC60A;
  --gold-soft: rgba(255, 198, 10, 0.20);
  --gold-wash: rgba(255, 198, 10, 0.10);
  --gold-solid: #FBBF00;
  --amber: #C8861B;
  --accent-chip: #FBBF00;
  --chip-ink: #fff;
  --send-hover: linear-gradient(150deg, var(--gold-bright), var(--gold));
  --send-hover-ink: #1B2620;
  --grad-chip: linear-gradient(150deg, #0c7152, #075238 62%, #053a28);
  --shadow-sm: 0 1px 2px rgba(27, 38, 32, 0.05);
  --shadow-md: 0 6px 22px rgba(27, 38, 32, 0.07), 0 2px 6px rgba(27, 38, 32, 0.04);
  --shadow-lg: 0 20px 48px rgba(27, 38, 32, 0.12), 0 6px 18px rgba(27, 38, 32, 0.07);
  --shadow-win: 0 44px 100px rgba(27, 38, 32, 0.16), 0 16px 40px rgba(27, 38, 32, 0.09);
  --glow: rgba(216, 165, 42, 0.14);
  --stripe: rgba(11, 106, 74, 0.03);
  --workspace-panel-width: 392px;
  --bg: var(--paper);
  --workspace: var(--paper);
  --rail: var(--tray);
  --floating: var(--card);
  --surface: var(--card-2);
  --surface-2: var(--card);
  --surface-3: rgba(255, 255, 255, 0.74);
  --border: var(--line);
  --border-soft: var(--line-2);
  --text: var(--ink);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-tertiary: var(--ink-3);
  --text-dim: color-mix(in srgb, var(--ink-3) 64%, transparent);
  --muted: var(--ink-2);
  --faint: var(--ink-3);
  --accent: var(--green);
  --accent-2: var(--green-bright);
  --danger: #B43B32;
  --warning: #A87412;
  --status-ok: var(--green);
  --control-charcoal: rgba(11, 106, 74, 0.08);
  --control-charcoal-hover: rgba(11, 106, 74, 0.14);
  --brand-strip: var(--grad-chip);
}

html[data-theme="light"] {
  --azalea-edge: #F7B2D0;
  --azalea-mid: #F08FBD;
  --azalea-throat: #D85C97;
  --azalea-blotch: #B23C77;
  --azalea-stamen: #E68FB6;
  --azalea-anther: #F6D77E;
  --golf-ball: #FFFFFF;
  --golf-shade: #D7DCD2;
  --golf-dimple: rgba(27, 38, 32, 0.16);
  --golf-hole: #10231A;
  --golf-hole-rim: rgba(11, 106, 74, 0.5);
  --masters-flag: #F5C518;
  --masters-pole: #5C645B;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0C100E;
  --card: #171E19;
  --card-2: #1E261F;
  --tray: #0E120F;
  --ink: #ECEEE8;
  --ink-2: #9BA39B;
  --ink-3: #6B746B;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.045);
  --green: #28B487;
  --green-bright: #38CD9A;
  --green-soft: rgba(40, 180, 135, 0.15);
  --green-soft-2: rgba(40, 180, 135, 0.07);
  --green-wash: var(--green-soft-2);
  --gold: #FFC60A;
  --gold-bright: #FFD42E;
  --gold-soft: rgba(255, 198, 10, 0.18);
  --gold-wash: rgba(255, 198, 10, 0.08);
  --gold-solid: #FFC100;
  --amber: #F0B84A;
  --accent-chip: #FFC100;
  --chip-ink: #102015;
  --send-hover: linear-gradient(150deg, var(--gold-bright), var(--gold));
  --send-hover-ink: #102015;
  --grad-chip: linear-gradient(150deg, #0e7754, #0a5840 60%, #073c2c);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --shadow-win: 0 54px 110px rgba(0, 0, 0, 0.6), 0 18px 46px rgba(0, 0, 0, 0.42);
  --glow: rgba(242, 198, 87, 0.12);
  --stripe: rgba(255, 255, 255, 0.016);
  --azalea-edge: #FBBCDA;
  --azalea-mid: #F59AC4;
  --azalea-throat: #E06FA4;
  --azalea-blotch: #C24E86;
  --azalea-stamen: #E68FB6;
  --azalea-anther: #F6D77E;
  --golf-ball: #F2F4EF;
  --golf-shade: #AEB6AC;
  --golf-dimple: rgba(0, 0, 0, 0.28);
  --golf-hole: #05100B;
  --golf-hole-rim: rgba(56, 205, 154, 0.5);
  --masters-flag: #FFD23E;
  --masters-pole: #9BA39B;
}

html[data-theme="royal-light"] {
  color-scheme: light;
  --paper: #F6F4EE;
  --card: #FFFFFD;
  --card-2: #F1EFE7;
  --tray: #EAE7DE;
  --ink: #1F1D18;
  --ink-2: #5E5A50;
  --ink-3: #A09B8F;
  --line: rgba(31, 29, 24, 0.08);
  --line-2: rgba(31, 29, 24, 0.045);
  --green: #1B47E0;
  --green-bright: #3A6BFF;
  --green-soft: rgba(27, 71, 224, 0.10);
  --green-soft-2: rgba(27, 71, 224, 0.05);
  --green-wash: var(--green-soft-2);
  --gold: #7E8CA8;
  --gold-bright: #AEBACE;
  --gold-soft: rgba(126, 140, 168, 0.18);
  --gold-wash: rgba(126, 140, 168, 0.12);
  --gold-solid: #9AA6BC;
  --amber: #6E7A93;
  --accent-chip: linear-gradient(155deg, #cdd5e3 0%, #aab4c8 48%, #8a96ad 100%);
  --chip-ink: #13307A;
  --send-hover: linear-gradient(150deg, var(--green-bright), var(--green));
  --send-hover-ink: #fff;
  --grad-chip: linear-gradient(150deg, #2f5cff, #1c46df 60%, #1338b0);
  --shadow-sm: 0 1px 2px rgba(31, 29, 24, 0.06);
  --shadow-md: 0 6px 22px rgba(31, 29, 24, 0.08), 0 2px 6px rgba(31, 29, 24, 0.05);
  --shadow-lg: 0 20px 48px rgba(31, 29, 24, 0.13), 0 6px 18px rgba(31, 29, 24, 0.08);
  --shadow-win: 0 44px 100px rgba(31, 29, 24, 0.17), 0 16px 40px rgba(31, 29, 24, 0.10);
  --glow: rgba(58, 107, 255, 0.13);
  --stripe: rgba(27, 71, 224, 0.028);
}

html[data-theme="royal-dark"] {
  color-scheme: dark;
  --paper: #0A0D14;
  --card: #141926;
  --card-2: #1B2233;
  --tray: #0C0F18;
  --ink: #E9ECF3;
  --ink-2: #99A1B3;
  --ink-3: #6A7283;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.045);
  --green: #5B82FF;
  --green-bright: #7B9BFF;
  --green-soft: rgba(91, 130, 255, 0.16);
  --green-soft-2: rgba(91, 130, 255, 0.08);
  --green-wash: var(--green-soft-2);
  --gold: #AAB6CC;
  --gold-bright: #C6D0E0;
  --gold-soft: rgba(170, 182, 204, 0.16);
  --gold-wash: rgba(170, 182, 204, 0.08);
  --gold-solid: #B6C0D4;
  --amber: #9AA6C0;
  --accent-chip: linear-gradient(155deg, #d3dae8 0%, #aab6cc 50%, #8893ab 100%);
  --chip-ink: #15246B;
  --send-hover: linear-gradient(150deg, var(--green-bright), var(--green));
  --send-hover-ink: #0A0D14;
  --grad-chip: linear-gradient(150deg, #2f5cff, #1f44d8 60%, #16329e);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.6);
  --shadow-win: 0 54px 110px rgba(0, 0, 0, 0.65), 0 18px 46px rgba(0, 0, 0, 0.45);
  --glow: rgba(91, 130, 255, 0.14);
  --stripe: rgba(255, 255, 255, 0.018);
}

:root,
html[data-theme="light"],
html[data-theme="dark"],
html[data-theme="royal-light"],
html[data-theme="royal-dark"] {
  --bg: var(--paper);
  --workspace: var(--paper);
  --rail: var(--tray);
  --floating: var(--card);
  --surface: var(--card-2);
  --surface-2: var(--card);
  --surface-3: color-mix(in srgb, var(--card) 74%, transparent);
  --border: var(--line);
  --border-soft: var(--line-2);
  --text: var(--ink);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-tertiary: var(--ink-3);
  --text-dim: color-mix(in srgb, var(--ink-3) 64%, transparent);
  --muted: var(--ink-2);
  --faint: var(--ink-3);
  --accent: var(--green);
  --accent-2: var(--green-bright);
  --danger: #B43B32;
  --warning: #A87412;
  --status-ok: var(--green);
  --control-charcoal: var(--green-soft-2);
  --control-charcoal-hover: var(--green-soft);
  --brand-strip: var(--grad-chip);
}

body {
  display: grid;
  place-items: center;
  padding: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  overflow: hidden;
  transition: background-color 0.4s, color 0.3s;
}

body::before {
  display: none;
  content: none;
}

body::after {
  display: none;
  content: none;
}

.app-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  height: calc(100dvh - 16px);
  min-height: 0;
  grid-template-columns: 304px minmax(360px, 1fr) var(--workspace-panel-width);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tray);
  box-shadow: var(--shadow-win);
  overflow: hidden;
  transition:
    background-color 0.4s,
    grid-template-columns 0.44s cubic-bezier(0.4, 0, 0.1, 1);
}

.app-shell.workspace-panel-collapsed {
  grid-template-columns: 304px minmax(360px, 1fr) 0;
}

.app-shell.is-resizing-workspace {
  cursor: ew-resize;
  user-select: none;
  transition: background-color 0.4s;
}

.app-shell.is-resizing-workspace .artifact-panel {
  transition: opacity 0.3s ease;
}

.app-shell.is-resizing-workspace .artifact-resize-handle::after {
  opacity: 0.7;
}

.control-panel {
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.brand-block {
  flex: 0 0 auto;
  min-height: 58px;
  margin: 0 0 8px;
  padding: 12px 10px 12px 14px;
  border-radius: var(--r-md);
  background: var(--grad-chip);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.control-scroll {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.brand-wordmark {
  width: 108px;
}

.section-title,
.panel-section-title,
.modal-kicker,
.settings-label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-section-title {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  text-align: left;
}

button.panel-section-title {
  cursor: pointer;
}

button.panel-section-title:hover {
  color: var(--ink-2);
}

.section-chevron {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transform: rotate(90deg);
  transition: transform 0.22s ease;
}

.workspace-section.is-collapsed .section-chevron {
  transform: rotate(0deg);
}

.workspace-section.is-collapsed > :not(.panel-section-title) {
  display: none;
}

.workspace-section > :not(.panel-section-title) {
  overflow: hidden;
  max-height: 900px;
  opacity: 1;
  transition:
    max-height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.18s ease,
    margin 0.18s ease;
}

.section-body {
  display: grid;
  gap: 4px;
  min-height: 0;
}

.control-section > .section-body {
  flex: 0 1 auto;
  overflow: hidden;
  max-height: 1200px;
  opacity: 1;
  visibility: visible;
  transition:
    max-height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.18s ease,
    visibility 0.18s ease;
}

.control-section.is-collapsed {
  gap: 0;
}

.control-section.is-collapsed > .section-body {
  flex-basis: 0;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.connection-row,
.tool-row,
.capacity {
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
}

.connection-row:hover,
.tool-row:hover {
  background: var(--card-2);
}

.connection-label,
.tool-button-label > span:first-child {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
}

.integration-state,
.tool-button-meta,
.capacity-heading,
.capacity-label {
  color: var(--ink-2);
}

.status-dot.alive,
.progress-dot.active,
.progress-dot.done,
.progress-dot.active::after,
.progress-dot.done::after {
  border-color: var(--green);
  background: var(--green);
}

.settings-button {
  width: 100%;
  border-radius: 11px;
  color: var(--ink);
}

.settings-button:hover {
  background: var(--green-soft);
}

.work-panel {
  grid-column: 2;
  margin: 11px -2px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--shadow-win);
  z-index: 3;
}

.chat {
  background: transparent;
}

.messages {
  gap: 18px;
  padding: 28px 26px 138px;
}

.message {
  width: min(760px, 100%);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.48;
}

.message.user {
  align-self: flex-end;
  width: fit-content;
  max-width: min(640px, 82%);
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--green) 38%, transparent);
  border-radius: 18px 18px 6px 18px;
  background: var(--green-soft);
  color: var(--ink);
}

.message.assistant {
  align-self: flex-start;
}

.message .meta {
  color: var(--ink-3);
  font-size: 12px;
}

.assistant-mark {
  width: 22px;
  height: 22px;
  padding: 5px;
  border-radius: 9px;
  background: var(--accent-chip);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.45), var(--shadow-sm);
}

.message-content a,
.message-artifact-copy > a,
.message-artifact-copy > button,
.artifact-title-link {
  color: var(--green);
}

.composer {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 20px;
  grid-template-columns: 44px minmax(0, 1fr) auto 44px 44px;
  grid-template-rows: auto 44px auto;
  width: auto;
  padding: 14px 14px 11px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 96%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px) saturate(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
}

#message-input {
  color: var(--ink);
}

#message-input::placeholder {
  color: var(--ink-3);
}

.send-button {
  border-radius: 12px;
  background: var(--grad-chip);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.send-button:hover {
  background: var(--send-hover);
  color: var(--send-hover-ink);
  transform: translateY(-1px);
}

.attach-button,
.mic-button,
.connection-action,
.panel-collapse-button,
.panel-icon-button,
.artifact-remove,
.feedback-button {
  color: var(--ink-2);
}

.attach-button:hover,
.mic-button:hover,
.connection-action:hover,
.panel-collapse-button:hover,
.panel-icon-button:hover {
  background: var(--green-soft);
  color: var(--green);
}

.composer.is-dictation-recording .mic-button,
.composer.is-dictation-recording .mic-button:hover {
  background: var(--green);
  color: var(--chip-ink);
}

.composer.is-dictation-recording .mic-button .stop-icon {
  fill: currentColor;
}

.composer.is-dictation-recording .dictation-bars {
  grid-column: 2 / 3;
  padding-right: 0;
}

.composer.is-dictation-recording .dictation-bars span {
  background: color-mix(in srgb, var(--green) 46%, transparent);
  opacity: 0.9;
}

.composer.is-dictation-recording .dictation-bars span.is-active {
  background: var(--green);
  opacity: 1;
}

.composer.is-dictation-recording .dictation-timer {
  grid-column: 3;
  justify-self: end;
  min-width: 44px;
  padding-left: 8px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  color: var(--ink-2);
}

.artifact-panel {
  position: relative;
  grid-column: 3;
  top: auto;
  right: auto;
  display: flex;
  width: auto;
  max-height: none;
  min-width: 0;
  margin: 0 0 0 0;
  margin: 14px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px) saturate(1.04);
  -webkit-backdrop-filter: blur(20px) saturate(1.04);
  transform: none;
  transition:
    opacity 0.3s ease,
    transform 0.44s cubic-bezier(0.4, 0, 0.1, 1),
    border-color 0.2s ease,
    margin 0.44s cubic-bezier(0.4, 0, 0.1, 1);
  z-index: 2;
}

.artifact-panel.is-collapsed {
  display: none;
}

@media (min-width: 1121px) {
  .artifact-panel.is-collapsed {
    display: flex;
    top: auto;
    right: auto;
    width: auto;
    height: auto;
    max-height: none;
    gap: initial;
    padding: 0;
    border-radius: var(--r-lg);
  }

  .app-shell.workspace-panel-collapsed .artifact-panel {
    margin-right: 0;
    margin-left: 0;
    border-color: transparent;
    opacity: 0;
    pointer-events: none;
    transform: translateX(18px);
  }

  .artifact-panel.is-collapsed .artifact-body {
    display: grid;
  }

  .artifact-panel.is-collapsed .artifact-resize-handle {
    display: block;
  }

  .artifact-panel.is-collapsed .artifact-header {
    position: static;
    justify-content: space-between;
    width: 100%;
    height: auto;
    cursor: default;
  }

  .artifact-panel.is-collapsed .artifact-header h2 {
    display: block;
  }

  .artifact-panel.is-collapsed .artifact-header-actions {
    display: inline-flex;
  }

  .artifact-panel.is-collapsed .panel-minimize-icon {
    display: block;
  }

  .artifact-panel.is-collapsed .panel-artifacts-icon {
    display: none;
  }
}

.artifact-header {
  position: static;
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: auto;
  margin-bottom: 0;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  cursor: default;
  touch-action: auto;
}

.artifact-header h2 {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel-collapse-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 10px;
  background: transparent;
}

.artifact-body {
  gap: 12px;
  padding: 4px 15px 16px;
}

.workspace-section {
  gap: 10px;
}

.review-count {
  display: inline-grid;
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: color-mix(in srgb, var(--gold) 68%, var(--ink));
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  place-items: center;
}

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

.app-shell.workspace-panel-wide .review-list {
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}

.suggestion-card {
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: var(--gold-wash);
  color: var(--ink);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.22);
}

.message-suggestions {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.message-suggestions .suggestion-card {
  max-width: 620px;
  padding: 16px;
}

.app-shell.workspace-panel-wide .message-suggestions .suggestion-heading {
  grid-template-columns: 18px minmax(0, 1fr) auto;
}

.app-shell.workspace-panel-wide .message-suggestions .suggestion-channel {
  grid-column: 2;
  justify-self: start;
}

.suggestion-card.compact {
  gap: 9px;
  padding: 11px 12px;
  border-radius: 12px;
}

.suggestion-heading {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.suggestion-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: color-mix(in srgb, var(--gold) 76%, var(--ink));
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.suggestion-route {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-channel {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 6px;
}

.thread-shell {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.thread-viewport {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-4) 2px 2px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 26px);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-3) transparent;
}

.thread-viewport::-webkit-scrollbar {
  width: 5px;
}

.thread-viewport::-webkit-scrollbar-thumb {
  border-radius: var(--radius-pill);
  background: var(--line);
}

.thread-viewport:hover::-webkit-scrollbar-thumb {
  background: var(--ink-3);
}

.thread-viewport .mini-msg {
  flex: none;
}

.thread-cue {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 34px;
  min-height: 20px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  box-shadow: var(--shadow-sm);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.95;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity var(--dur-base) var(--ease-standard);
}

.thread-cue svg {
  width: 9px;
  height: 9px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.thread-shell.scrolled .thread-cue {
  opacity: 0;
}

.mini-msg {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  max-width: 86%;
  padding: var(--space-2) var(--space-3);
  border-radius: 12px;
  color: var(--ink);
  font-size: var(--text-base);
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mini-msg .t {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.mini-attachments {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.mini-attachment {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-sm);
  line-height: 1.2;
  text-align: left;
}

button.mini-attachment {
  cursor: pointer;
}

button.mini-attachment:hover {
  border-color: color-mix(in srgb, var(--green) 38%, var(--line));
  color: var(--ink);
}

.mini-attachment img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--tray);
}

.mini-attachment span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-msg.in {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  background: var(--card);
}

.mini-msg.out {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--green-soft);
}

.mini-msg.out .t {
  text-align: right;
}

.mini-msg.draft {
  align-self: flex-end;
  max-width: 90%;
  border: 1.5px dashed var(--green);
  border-bottom-right-radius: 4px;
  background: var(--card);
  cursor: text;
  font-size: 0;
  -webkit-user-select: text;
  user-select: text;
}

.mini-msg.draft.pending-draft {
  cursor: default;
}

.mini-msg.draft.reengagement-prompt {
  border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--line));
  background: var(--gold-wash);
}

.mini-msg.draft.reengagement-prompt .d-text {
  color: color-mix(in srgb, var(--gold) 34%, var(--ink));
}

.mini-msg.draft.drafting-draft {
  border: 1px solid color-mix(in srgb, var(--gold) 54%, var(--line));
  background: var(--gold-wash);
}

.mini-msg.draft.drafting-draft .d-label {
  color: color-mix(in srgb, var(--gold) 78%, var(--ink));
}

.mini-msg.draft .d-label {
  display: block;
  margin-bottom: 3px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.mini-msg.draft .d-text {
  display: block;
  min-width: 0;
  max-width: 100%;
  font-size: var(--text-base);
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

.mini-msg.draft.editing {
  border-style: dashed;
  border-color: var(--green-bright);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.mini-msg.draft.sent-reply {
  border: 1px solid color-mix(in srgb, var(--green) 46%, var(--line));
  background: var(--green-soft);
  cursor: default;
}

.mini-msg.draft.sending-reply {
  border: 1px solid color-mix(in srgb, var(--gold) 46%, var(--line));
  background: var(--gold-wash);
  cursor: default;
}

.mini-msg.draft.failed-reply {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--card));
}

.mini-msg.draft.sent-reply .d-label,
.mini-msg.draft.sending-reply .d-label {
  color: var(--green);
}

.mini-msg.draft.failed-reply .d-label {
  color: var(--danger);
}

.mini-msg.draft .d-hint {
  position: absolute;
  top: 7px;
  right: var(--space-2);
  width: 11px;
  height: 11px;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-standard);
}

.mini-msg.draft:hover .d-hint,
.mini-msg.draft.editing .d-hint {
  opacity: 1;
}

.mini-msg.draft .d-hint svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.suggestion-card.compact .suggestion-heading {
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 7px;
}

.suggestion-card.compact .suggestion-icon {
  width: 13px;
  height: 13px;
}

.suggestion-card.compact .suggestion-route {
  font-size: 12.5px;
}

.suggestion-card.compact .suggestion-channel {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--ink-3);
}

.suggestion-card.compact .thread-viewport {
  max-height: 220px;
}

.suggestion-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.suggestion-send,
.suggestion-edit,
.suggestion-cancel {
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.suggestion-send {
  width: 68px;
}

.suggestion-card.compact .suggestion-send,
.suggestion-card.compact .suggestion-edit,
.suggestion-card.compact .suggestion-cancel {
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 11.5px;
}

.suggestion-card.compact .suggestion-send {
  width: 64px;
}

.suggestion-send {
  background: var(--grad-chip);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard);
}

.suggestion-send:hover {
  background: var(--send-hover);
  color: var(--send-hover-ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.suggestion-send:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.suggestion-send.sent-done,
.suggestion-sent .suggestion-send {
  background: var(--green-soft);
  color: var(--green);
  box-shadow: none;
  pointer-events: none;
}

.suggestion-send.sent-done:disabled {
  cursor: default;
  opacity: 1;
}

.suggestion-edit {
  background: transparent;
  color: var(--ink-2);
}

.suggestion-cancel {
  min-width: 44px;
  padding: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 17px;
}

.suggestion-status {
  max-width: 100%;
  min-height: 28px;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.suggestion-status-failed {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.suggestion-edit[hidden],
.suggestion-cancel[hidden] {
  display: none;
}

.suggestion-sent .suggestion-edit {
  display: none;
}

.suggestion-edit:hover,
.suggestion-cancel:hover {
  background: var(--gold-soft);
  color: var(--ink);
}

.progress-item {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.scheduled-next {
  margin-top: 3px;
  color: var(--green);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

.scheduled-faint {
  margin-top: 5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.6;
}

.wc-head.artifact-row-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 52px;
  padding: 9px 13px;
  color: inherit;
  transition: background-color 0.15s ease;
}

.artifact-row:hover .wc-head.artifact-row-head,
.artifact-row:focus-within .wc-head.artifact-row-head {
  background: var(--card-2);
}

.artifact-kind-badge {
  display: grid;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  place-items: center;
}

.artifact-kind-badge.image {
  background: var(--gold-soft);
  color: color-mix(in srgb, var(--gold) 76%, var(--ink));
}

.artifact-row-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.artifact-row .artifact-title-link {
  overflow: hidden;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-row .artifact-title-link:hover {
  color: var(--green);
}

.artifact-row-meta {
  overflow: hidden;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-row .artifact-actions {
  flex-wrap: nowrap;
  gap: 11px;
  margin: 0 0 0 10px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.artifact-row:hover .artifact-actions,
.artifact-row:focus-within .artifact-actions {
  opacity: 1;
}

.artifact-row .artifact-actions a,
.artifact-row .artifact-remove,
.artifact-row .artifact-send {
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.artifact-row .artifact-actions a:hover,
.artifact-row .artifact-remove:hover,
.artifact-row .artifact-send:hover {
  color: var(--green);
  text-decoration: none;
}

.inline-edit-field {
  color: var(--ink-2);
}

.inline-edit-field:hover,
.inline-edit-field:focus {
  color: var(--ink);
}

.panel-row {
  color: var(--ink-2);
}

.panel-divider {
  background: var(--line-2);
}

.artifact-resize-handle {
  left: -12px;
  top: 18px;
  bottom: 18px;
}

.artifact-resize-handle::after {
  background: var(--green);
}

.workspace-open-button {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}

.workspace-open-button[hidden] {
  display: none;
}

.workspace-open-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.settings-modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--ink) 26%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.settings-modal-scrim[hidden] {
  display: none;
}

.settings-modal {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(430px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow-win);
}

.settings-modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
}

.settings-modal h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.theme-settings-group {
  display: grid;
  gap: 8px;
}

.theme-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
}

.theme-segment button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.theme-segment button.on,
.theme-segment button[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.theme-segment svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-swatch {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.theme-swatch.augusta {
  background: linear-gradient(135deg, #0B6A4A 50%, #F6C65E 50%);
}

.theme-swatch.royal {
  background: linear-gradient(135deg, #1B47E0 50%, #AAB4C6 50%);
}

.model-auth-modal,
.tool-modal,
.feedback-modal,
.markdown-viewer,
.login-form {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.secondary-button,
.primary-link-button,
.model-auth-link-button {
  border-color: var(--line);
  background: var(--green);
  color: #fff;
}

.modal-close {
  color: var(--ink-2);
}

.modal-close:hover {
  background: var(--green-soft);
  color: var(--green);
}

@media (min-width: 1121px) {
  .artifact-panel[style*="width"] {
    width: auto !important;
  }

  .review-list {
    grid-template-columns: 1fr;
  }

  .app-shell:not(.workspace-panel-collapsed) .artifact-panel[style*="width"] {
    min-width: 0;
  }
}

@media (min-width: 1360px) {
  .artifact-panel {
    min-width: 0;
  }

  .app-shell:not(.workspace-panel-collapsed) .artifact-panel {
    width: auto;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 244px minmax(360px, 1fr) minmax(300px, var(--workspace-panel-width));
  }

  .app-shell.workspace-panel-collapsed {
    grid-template-columns: 244px minmax(360px, 1fr) 0;
  }

  .messages {
    padding-inline: 34px;
  }
}

@media (max-width: 1120px) {
  body {
    display: block;
    padding: 0;
  }

  .app-shell {
    display: block;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .control-panel {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .control-panel.is-mobile-open {
    background: var(--card);
    box-shadow: var(--shadow-lg);
  }

  .brand-menu-button {
    background: var(--grad-chip);
  }

  .work-panel {
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    transform: none;
  }

  .messages {
    padding: 64px 16px calc(var(--composer-height) + var(--composer-mobile-bottom) + 30px + env(safe-area-inset-bottom));
  }

  .message {
    width: 100%;
  }

  .message.user {
    max-width: 86%;
  }

  .composer {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(var(--composer-mobile-bottom) + env(safe-area-inset-bottom));
    width: auto;
  }

  .artifact-panel {
    position: fixed;
    top: 74px;
    right: 12px;
    left: 12px;
    z-index: 19;
    width: auto;
    max-height: calc(100dvh - var(--composer-height) - var(--composer-mobile-bottom) - 116px - env(safe-area-inset-bottom));
    margin: 0;
    padding: 16px;
    border-radius: 22px;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(26px) saturate(1.2);
    -webkit-backdrop-filter: blur(26px) saturate(1.2);
  }

  .artifact-panel::before,
  .artifact-panel.is-collapsed::before {
    display: none;
  }

  .artifact-header {
    position: static;
    width: 100%;
    height: auto;
  }

  .artifact-panel.is-collapsed {
    display: none;
  }

  .workspace-open-button {
    top: auto;
    right: 14px;
    bottom: calc(var(--composer-height) + var(--composer-mobile-bottom) + 14px + env(safe-area-inset-bottom));
    width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
  }

  .workspace-open-button span {
    display: none;
  }

  .settings-modal-scrim {
    align-items: end;
    padding: 14px;
  }

  .settings-modal {
    width: 100%;
  }
}

/* Third-pass spec alignment: brand, sidebar row anatomy, and mobile chrome. */
.brand-title {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 1 1 auto;
  height: auto;
  margin: 0;
  min-width: 0;
}

.brand-mark-tile {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  place-items: center;
}

.brand-mark {
  width: 18px;
  height: auto;
  opacity: 0.98;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.brand-name {
  color: #fdfaf0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-subtitle {
  overflow: hidden;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 var(--green-soft);
  animation: pulse 2.8s infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--green-soft);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(11, 106, 74, 0);
  }
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(360px, 1fr) var(--workspace-panel-width);
}

.app-shell.sidebar-collapsed.workspace-panel-collapsed {
  grid-template-columns: 0 minmax(360px, 1fr) 0;
}

.control-panel {
  transition:
    opacity 0.3s ease,
    transform 0.44s cubic-bezier(0.4, 0, 0.1, 1);
}

.control-panel.is-sidebar-collapsed {
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px);
}

.sidebar-collapse-button {
  z-index: 1;
  display: grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  place-items: center;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.sidebar-collapse-button:hover {
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
}

.sidebar-collapse-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.sidebar-open-button {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 7px 13px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  font-weight: 600;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.sidebar-open-button[hidden] {
  display: none;
}

.sidebar-open-button:hover {
  color: var(--green);
  transform: translateY(-1px);
}

.sidebar-open-button .brand-mark-tile {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--grad-chip);
}

.sidebar-open-button .brand-mark {
  width: 14px;
}

.control-section > .section-title {
  display: flex;
  width: 100%;
  height: auto;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 4px 2px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.control-section:first-of-type > .section-title {
  margin-top: 12px;
}

.control-section > .section-title:hover {
  color: var(--green);
}

.section-title-icon {
  display: none;
}

.mobile-tools-close-icon {
  display: none;
}

.control-section.is-collapsed > .section-title .section-chevron {
  transform: rotate(0deg);
}

.capacity-section .capacity {
  margin: 0 4px 2px;
}

.capacity-section .capacity-heading {
  display: none;
}

.panel-section-title {
  height: auto;
  min-height: 44px;
}

@media (min-width: 1121px) {
  .control-panel {
    position: relative;
    padding-bottom: 14px;
    overflow: hidden;
  }

  .control-scroll {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow-y: auto;
  }

  .control-section {
    flex: 0 0 auto;
    gap: 4px;
    min-height: 0;
  }

  .connection-row:not(.capacity) {
    min-height: 48px;
    padding: 9px 10px;
  }

  .integration-state {
    display: none;
  }

  .capacity-section .capacity {
    min-height: 0;
    padding-block: 5px;
  }

  .capacity-section .section-title {
    margin-top: 8px;
  }

  .capacity-section .capacity {
    gap: 6px;
    padding: 0 4px 3px;
  }

  .capacity-section .capacity-bars {
    gap: 6px;
  }

  .capacity-section .capacity-window {
    gap: 3px;
  }

  .tools-section {
    flex: 0 0 auto;
    grid-template-rows: auto auto;
    min-height: 0;
    margin-bottom: 0;
    overflow: visible;
  }

  .tools-section.is-collapsed {
    flex: 0 0 auto;
    min-height: 0;
    margin-bottom: 0;
  }

  .tools-section > .section-body,
  .tool-list {
    min-height: 0;
  }

  .tools-section > .section-body {
    display: grid;
    overflow: hidden;
  }

  .tool-list {
    overflow: visible;
  }

  .control-spacer {
    display: block;
    min-height: 12px;
    flex: 1 0 12px;
  }

  .settings-button {
    position: static;
    z-index: 5;
    isolation: isolate;
    width: 100%;
    flex: 0 0 auto;
    margin-top: 10px;
    background: transparent;
    box-shadow: none;
  }

  .settings-button::before {
    content: none;
  }
}

.connection-row:not(.capacity) {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 11px;
  min-height: 48px;
  padding: 9px 10px;
  border-radius: 11px;
}

.connection-row:not(.capacity)::before {
  display: none;
}

.connection-avatar {
  display: grid;
  grid-column: 1;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  place-items: center;
}

.connection-avatar svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.connection-avatar-mark {
  width: 17px;
  height: auto;
  fill: currentColor;
  stroke: none;
}

.connection-row:not(.capacity) > :first-child:not(.connection-avatar),
.connection-row:not(.capacity) > .connection-avatar + * {
  grid-column: 2;
}

.connection-row:not(.capacity) > .connection-action {
  grid-column: 3;
}

.connection-row.off {
  opacity: 0.72;
}

.connection-row.off .connection-avatar {
  background: var(--line-2);
  color: var(--ink-3);
}

.connection-row.status-inactive .connection-avatar {
  background: var(--line-2);
  color: var(--ink-3);
}

.connection-row.off .status-dot,
.connection-row.status-inactive .status-dot {
  display: none;
}

.connection-action,
button.connection-action {
  display: inline-flex;
  min-width: 64px;
  height: 30px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--green-soft);
  border-radius: 999px;
  background: var(--card);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.connection-action::after {
  content: none;
}

.connection-action-label {
  display: inline;
}

.connection-action svg {
  display: none;
}

.connection-action:hover,
button.connection-action:hover {
  background: var(--green-soft);
  color: var(--green);
}

.connection-action:disabled,
button.connection-action:disabled {
  background: var(--card);
  color: var(--green);
  opacity: 1;
}

.todo-toggle.active {
  display: grid;
  place-items: center;
  border-color: var(--ink-3);
  background: transparent;
}

.todo-toggle.active::after {
  display: none;
}

.todo-toggle.done {
  display: grid;
  place-items: center;
  border-color: transparent;
  background: transparent;
}

.todo-toggle.done::after {
  position: static;
  width: 9px;
  height: 5px;
  border-right: 0;
  border-bottom: 2px solid var(--green);
  border-left: 2px solid var(--green);
  border-radius: 0;
  background: transparent;
  content: "";
  transform: translate(-1px, -1px) rotate(-45deg);
}

.scheduled-row .progress-dot.active {
  display: grid;
  width: 18px;
  height: 18px;
  border: 2px solid var(--green);
  border-radius: 999px;
  background: transparent;
  place-items: center;
}

.todo-toggle.done,
.todo-toggle.is-completing {
  display: grid;
  width: 18px;
  height: 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  place-items: center;
}

.todo-toggle.done:hover,
.todo-toggle.is-completing:hover {
  border-color: transparent;
}

.scheduled-row .progress-dot.active::after {
  position: static;
  width: 6px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  content: "";
  transform: none;
}

.todo-toggle.is-completing::after {
  position: static;
  width: 9px;
  height: 5px;
  border-right: 0;
  border-bottom: 2px solid var(--green);
  border-left: 2px solid var(--green);
  border-radius: 0;
  background: transparent;
  content: "";
  transform: translate(-1px, -1px) rotate(-45deg);
}

.todo-toggle {
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.todo-toggle.is-completing {
  animation: todo-target-complete 0.24s ease-out;
}

.todo-toggle.is-completing::after {
  animation: todo-check-complete 0.24s ease-out;
}

@keyframes todo-target-complete {
  0% {
    border-color: var(--ink-3);
    transform: scale(0.92);
  }
  100% {
    border-color: transparent;
    transform: scale(1);
  }
}

@keyframes todo-check-complete {
  0% {
    opacity: 0;
    transform: translate(-1px, -1px) rotate(-45deg) scale(0.36);
  }
  100% {
    opacity: 1;
    transform: translate(-1px, -1px) rotate(-45deg) scale(1);
  }
}

.model-auth-panel {
  grid-column: 2 / -1;
}

.message .meta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  color: var(--ink-3);
  font-size: 12px;
}

.message.user .meta {
  justify-self: end;
  align-self: end;
  justify-content: flex-end;
  width: auto;
  padding-right: 2px;
}

.message.user {
  align-self: flex-end;
  display: grid;
  justify-items: end;
  gap: 8px;
  box-sizing: border-box;
  width: min(780px, 88%);
  max-width: calc(100% - 12px);
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.message.user .message-reply-reference {
  justify-self: stretch;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--gold-soft);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.message.user .message-reply-preview {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message.user .message-content {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--green);
  border-radius: 16px 16px 6px 16px;
  background: var(--green-soft);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.message-actor {
  color: var(--ink-2);
  font-weight: 600;
}

.model-timing-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  font-family: var(--font-mono);
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.45;
}

.model-timing-summary {
  color: var(--ink-3);
}

.model-timing-summary::before {
  content: none;
}

.model-timing-toggle {
  display: grid;
  width: 24px;
  height: 18px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  place-items: center;
}

.model-timing-toggle:hover,
.model-timing-toggle[aria-expanded="true"] {
  background: var(--green-soft-2);
  color: var(--ink-2);
}

.model-timing-toggle svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.model-timing-detail {
  flex-basis: 100%;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.7;
}

.status-dot.alive {
  box-shadow: 0 0 0 0 var(--green-soft);
  animation: pulse 2.8s infinite;
}

.tool-button {
  min-height: 30px;
  padding: 0;
  border-radius: 0;
}

.tool-button-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
}

.tool-button-icon svg {
  width: 15px;
  height: 15px;
}

@media (min-width: 1121px) {
  .connection-row:not(.capacity) {
    min-height: 48px;
    padding: 9px 10px;
  }

  .integration-state {
    display: none;
  }

  .capacity-section .capacity {
    min-height: 0;
    gap: 6px;
    padding: 0 4px 3px;
  }

  .capacity-section .section-title {
    margin-top: 8px;
  }

  .capacity-section .capacity-bars {
    gap: 6px;
  }

  .capacity-section .capacity-window {
    gap: 3px;
  }
}

@media (max-width: 1120px) {
  .app-shell {
    --composer-left: 14px;
    --composer-mobile-bottom: 30px;
    --composer-width: calc(100vw - 28px);
  }

  .control-panel {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: auto;
    left: 16px;
    z-index: 16;
    width: auto;
    max-width: calc(100vw - 32px);
    height: auto;
    max-height: none;
    padding: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }

  .brand-block {
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .brand-title {
    display: none;
  }

  .brand-menu-button {
    display: inline-flex;
    width: auto;
    height: auto;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 8px;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    border-radius: 999px;
    background: var(--card) !important;
    color: var(--ink);
    box-shadow: var(--shadow-md);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
  }

  .brand-menu-button .brand-mark-tile {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--grad-chip);
  }

  .brand-menu-button .brand-mark {
    width: 15px;
  }

  .brand-menu-button .brand-name {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    font-size: 18px;
  }

  .brand-menu-button .brand-copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
  }

  .brand-menu-button .brand-live-dot {
    flex: 0 0 auto;
    margin-left: 0;
  }

  .brand-menu-button .brand-subtitle {
    display: none;
  }

  .control-panel:not(.is-mobile-open) .mobile-sheet-header,
  .control-panel:not(.is-mobile-open) .control-section,
  .control-panel:not(.is-mobile-open) .settings-button {
    display: none;
  }

  .control-panel.is-mobile-tools-open {
    z-index: 32;
  }

  .control-panel:not(.is-mobile-open) .tools-section.is-mobile-open {
    display: flex;
  }

  .control-scroll {
    display: contents;
  }

  .work-panel::before,
  .work-panel::after {
    position: fixed;
    right: 0;
    left: 0;
    z-index: 11;
    content: "";
    pointer-events: none;
  }

  .work-panel::before {
    top: 0;
    height: 132px;
    background: linear-gradient(to bottom, var(--paper) 0%, var(--paper) 46%, color-mix(in srgb, var(--paper) 72%, transparent) 72%, transparent 100%);
  }

  .work-panel::after {
    bottom: 0;
    height: 172px;
    background: linear-gradient(to top, var(--paper) 0%, color-mix(in srgb, var(--paper) 78%, transparent) 48%, transparent 100%);
  }

  .mobile-workspace-rail {
    position: fixed;
    right: 14px;
    bottom: calc(var(--composer-height) + var(--composer-mobile-bottom) + 14px + env(safe-area-inset-bottom));
    z-index: 24;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .app-shell.mobile-workspace-rail-left .mobile-workspace-rail {
    right: auto;
    left: 14px;
  }

  .mobile-workspace-rail-button {
    position: relative;
    display: inline-grid;
    width: 46px;
    height: 46px;
    min-height: 0;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--line) 48%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card) 42%, transparent);
    color: var(--ink-2);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    place-items: center;
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
    backdrop-filter: blur(14px) saturate(1.12);
  }

  .mobile-workspace-rail-button:focus-visible,
  .mobile-workspace-rail-button.is-selected {
    border-color: color-mix(in srgb, var(--green) 44%, transparent);
    background: color-mix(in srgb, var(--green-soft) 42%, transparent);
    color: var(--ink);
  }

  @media (hover: hover) {
    .mobile-workspace-rail-button:hover {
      border-color: color-mix(in srgb, var(--green) 44%, transparent);
      background: color-mix(in srgb, var(--green-soft) 42%, transparent);
      color: var(--ink);
    }
  }

  .mobile-workspace-rail-button:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
  }

  .mobile-workspace-rail-icon,
  .mobile-workspace-rail-icon svg {
    display: block;
    width: 21px;
    height: 21px;
  }

  .mobile-workspace-rail-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .mobile-workspace-rail-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    display: inline-grid;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--paper);
    border-radius: 999px;
    background: var(--green);
    color: var(--chip-ink);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    place-items: center;
  }

  .workspace-open-button {
    border: 0;
    background: var(--control-charcoal);
    color: var(--text-secondary);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .workspace-open-button:hover {
    background: var(--control-charcoal-hover);
    color: var(--text);
  }

  .jump-to-latest-shell {
    left: 14px;
    right: 14px;
    bottom: calc(var(--composer-height) + var(--composer-mobile-bottom) + 16px + env(safe-area-inset-bottom));
    z-index: 18;
    width: auto;
  }

  .control-panel.is-mobile-open {
    width: min(374px, calc(100vw - 32px));
    max-height: calc(100dvh - var(--composer-height) - var(--composer-mobile-bottom) - 48px - env(safe-area-inset-bottom));
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: color-mix(in srgb, var(--card) 94%, transparent);
    box-shadow: var(--shadow-lg);
    -webkit-backdrop-filter: blur(26px) saturate(1.2);
    backdrop-filter: blur(26px) saturate(1.2);
    overflow-y: auto;
  }

  .send-button:hover,
  .send-button:active {
    background: var(--grad-chip);
    color: #fff;
    transform: none;
  }

  .mic-button:hover {
    background: transparent;
    color: var(--ink-2);
  }

  .composer.is-dictation-recording .mic-button,
  .composer.is-dictation-recording .mic-button:hover {
    background: var(--green);
    color: var(--chip-ink);
  }

  .composer.is-dictation-recording .mic-button .stop-icon {
    fill: currentColor;
  }

  .composer.is-dictation-recording .dictation-bars {
    grid-column: 2 / 3;
    padding-right: 0;
  }

  .composer.is-dictation-recording .dictation-bars span {
    background: color-mix(in srgb, var(--green) 46%, transparent);
    opacity: 0.9;
  }

  .composer.is-dictation-recording .dictation-bars span.is-active {
    background: var(--green);
    opacity: 1;
  }

  .composer.is-dictation-recording .dictation-timer {
    grid-column: 3;
    justify-self: end;
    min-width: 44px;
    padding-left: 8px;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    color: var(--ink-2);
  }

  .control-panel.is-mobile-open .brand-menu-button {
    width: 100%;
    box-shadow: none;
  }

  .control-panel.is-mobile-open .control-section[aria-label="Connections"] {
    margin-top: 12px;
  }

  .control-panel.is-mobile-open .capacity-section {
    display: flex;
  }

  .mobile-sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: rgba(8, 11, 9, 0.4);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }

  .mobile-sheet-scrim[hidden] {
    display: none;
  }

  .control-panel.is-mobile-open,
  .tools-section.is-mobile-open,
  .artifact-panel:not(.is-collapsed) {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    bottom: calc(var(--composer-height) + var(--composer-mobile-bottom) + 14px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 20;
    display: flex;
    width: auto;
    max-width: none;
    max-height: none;
    height: auto;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: color-mix(in srgb, var(--card) 94%, transparent);
    box-shadow: var(--shadow-lg);
    -webkit-backdrop-filter: blur(26px) saturate(1.3);
    backdrop-filter: blur(26px) saturate(1.3);
    overflow: hidden;
    animation: mobile-sheet-rise 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .artifact-panel:not(.is-collapsed) {
    right: 10px;
    left: 10px;
  }

  .app-shell.mobile-workspace-rail-left .artifact-panel:not(.is-collapsed) {
    right: 10px;
    left: 10px;
  }

  @keyframes mobile-sheet-rise {
    from {
      opacity: 0;
      transform: translateY(16px) scale(0.98);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }

  .control-panel.is-mobile-open {
    overflow: hidden;
  }

  .control-panel.is-mobile-open .mobile-sheet-header,
  .tools-section.is-mobile-open > .section-title,
  .artifact-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
  }

  .control-panel.is-mobile-open .brand-block {
    display: none;
  }

  .mobile-sheet-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .mobile-sheet-brand .brand-mark-tile {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--grad-chip);
  }

  .mobile-sheet-brand .brand-mark {
    width: 17px;
  }

  .mobile-sheet-brand .brand-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    line-height: 1;
  }

  .mobile-sheet-brand .brand-name {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
  }

  .mobile-sheet-brand .brand-subtitle {
    overflow: hidden;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sheet-title {
    color: var(--ink-3);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .mobile-sheet-close {
    display: grid;
    width: 30px;
    height: 30px;
    min-height: 0;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-3);
    place-items: center;
  }

  .mobile-sheet-close:hover {
    background: var(--green-soft-2);
    color: var(--ink);
  }

  .mobile-sheet-close svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
  }

  .tools-section.is-mobile-open > .section-title {
    display: flex;
    margin: 0;
  }

  .tools-section.is-mobile-open {
    z-index: 32;
  }

  .tools-section.is-mobile-open > .section-title {
    justify-content: space-between;
    min-height: 70px;
    color: var(--ink);
    font-size: 13px;
    letter-spacing: 0.16em;
  }

  .control-panel.is-mobile-open .brand-menu-button {
    width: auto;
    box-shadow: none;
  }

  .control-panel.is-mobile-open .brand-menu-button .brand-mark-tile {
    width: 26px;
    height: 26px;
  }

  .control-panel.is-mobile-open .brand-menu-button .brand-mark {
    width: 15px;
  }

  .control-panel.is-mobile-open .control-section {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 6px;
    margin: 14px 16px 0;
  }

  .control-panel.is-mobile-open #workspace-skills-section {
    display: flex;
    order: 2;
  }

  .control-panel.is-mobile-open #workspace-tools-section {
    display: flex;
    order: 3;
  }

  .control-panel.is-mobile-open .control-section[aria-label="Connections"] {
    order: 1;
  }

  .control-panel.is-mobile-open .capacity-section {
    display: flex;
    order: 4;
  }

  .control-panel.is-mobile-open .settings-button {
    order: 5;
  }

  .control-panel.is-mobile-open .control-section:first-of-type {
    margin-top: 10px;
  }

  .control-panel.is-mobile-open .settings-button {
    display: inline-flex;
    flex: 0 0 auto;
    margin: 14px 16px 16px;
  }

  .control-panel.is-mobile-open .control-scroll {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    overflow-y: auto;
  }

  .artifact-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px var(--space-6) 18px;
  }

  .tools-section.is-mobile-open .section-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 16px 18px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .tools-section.is-mobile-open .mobile-tools-group {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 11px;
  }

  .tools-section.is-mobile-open .mobile-skills-group {
    display: flex;
  }

  .tools-section.is-mobile-open .mobile-tools-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 2px;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-align: left;
    text-transform: uppercase;
  }

  .tools-section.is-mobile-open .mobile-tools-group-title:hover {
    color: var(--ink-2);
  }

  .tools-section.is-mobile-open .tool-list {
    display: grid;
    flex: 0 0 auto;
    gap: 6px;
    padding: 0;
    overflow: visible;
  }

  .tools-section.is-mobile-open .mobile-tools-group.is-collapsed > :not(.mobile-tools-group-title) {
    display: none;
  }

  .tools-section.is-mobile-open .mobile-tools-group.is-collapsed .section-chevron {
    transform: rotate(0deg);
  }

  .tools-section.is-mobile-open > .section-title .section-chevron {
    display: none;
  }

  .tools-section.is-mobile-open .mobile-tools-close-icon {
    display: block;
    width: 15px;
    height: 15px;
    margin-left: auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
  }

  .artifact-panel:not(.is-collapsed) .panel-minimize-icon {
    display: none;
  }

  .artifact-panel:not(.is-collapsed) .panel-close-icon {
    display: block;
  }

  .artifact-panel .suggestion-card.compact .suggestion-body {
    display: block;
    overflow: visible;
    -webkit-line-clamp: initial;
  }

  .mini-msg.draft.editing .d-text,
  .mini-msg.draft .d-text:focus {
    font-size: 16px;
  }

  .control-panel.is-mobile-open ~ .mobile-workspace-rail,
  .control-panel.is-mobile-open ~ .workspace-open-button,
  .app-shell.mobile-tools-sheet-open .workspace-open-button {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
  }

  .sidebar-collapse-button,
  .sidebar-open-button {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="light"],
  html[data-theme="dark"],
  html[data-theme="royal-light"],
  html[data-theme="royal-dark"],
  body,
  body::before,
  .app-shell,
  .control-panel,
  .work-panel,
  .artifact-panel,
  .workspace-open-button,
  .sidebar-open-button,
  .mobile-tools-button,
  .mobile-sheet-scrim,
  .composer,
  .jump-to-latest-shell,
  .connection-tooltip,
  .chat.is-file-drop-target::after,
  .artifact-resize-handle::after,
  .section-chevron,
  .workspace-section > :not(.panel-section-title),
  .control-section > .section-body,
  .suggestion-card,
  .suggestion-send,
  .suggestion-edit,
  .artifact-row,
  .azalea-burst .bloom,
  .azalea-burst .bloom .lobe,
  .azalea-burst .bloom .stamens,
  .typing-dots .dot-morph,
  .typing-dots .dot-morph .inner,
  .putt-ball,
  .putt-pole,
  .putt-flagcloth,
  .artifact-row .artifact-actions {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .status-dot.alive,
  .brand-live-dot,
  .markdown-viewer-scrim.is-loading .markdown-viewer-body::before,
  .image-viewer-body::before,
  .model-auth-spinner,
  .composer.is-dictation-processing .mic-button .button-spinner,
  .inline-live-dots span,
  .live-workstream-current.running .live-workstream-current-text,
  .typing-dots > span:not(.dot-morph, .putt-stage, .morphed),
  .azalea-burst .bloom,
  .azalea-burst .bloom .lobe,
  .azalea-burst .bloom .stamens,
  .typing-dots .dot-morph,
  .typing-dots .dot-morph .inner,
  .putt-ball,
  .putt-pole,
  .putt-flagcloth,
  .sms-reply-action-ready > span,
  .sms-reply-action-ready::before,
  .sms-reply-card.has-action-ready:nth-of-type(7n) .sms-reply-action-ready::after,
  .control-panel.is-mobile-open,
  .tools-section.is-mobile-open,
  .artifact-panel:not(.is-collapsed) {
    animation: none !important;
  }

  .azalea-burst .bloom {
    opacity: 1;
    transform: scale(1) !important;
    animation: augusta-reduced-fade 0.7s ease forwards !important;
  }

  .typing-dots .dot-morph .inner,
  .putt-ball {
    opacity: 1;
    transform: scale(1) !important;
    animation: augusta-reduced-fade 0.8s ease forwards !important;
  }

  .messages {
    scroll-behavior: auto;
  }
}


/* ALW-236 workspace workbench: chat fixed left, tabbed/movable workspace columns. */
.app-shell {
  grid-template-columns: 304px minmax(0, 1fr);
}

.app-shell.workspace-panel-collapsed,
.app-shell.sidebar-collapsed,
.app-shell.sidebar-collapsed.workspace-panel-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .workspace-flow {
  grid-column: 2;
  width: 100%;
  margin-left: 0;
}

.workspace-flow {
  grid-column: 2;
  display: flex;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  background: var(--tray);
}

.work-panel,
.artifact-panel,
.workspace-pulled-panel {
  flex: 1 1 0;
  min-width: 280px;
  min-height: 0;
}

.work-panel {
  grid-column: auto;
  margin: 11px 0 11px 11px;
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  border-top-width: 3px;
  border-radius: var(--r-xl);
  box-shadow: none;
}

.artifact-panel {
  grid-column: auto;
  margin: 11px;
  width: auto;
  min-width: 280px;
}

.artifact-panel.is-collapsed {
  display: none;
}

.artifact-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 10px 9px;
}

.artifact-header h2 {
  display: none;
}

.artifact-header-actions {
  gap: 4px;
}

.artifact-resize-handle {
  display: none;
}

.workspace-tabstrip {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.workspace-tabstrip::-webkit-scrollbar {
  display: none;
}

.workspace-tab-wrap {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 10px;
}

.workspace-tab-wrap:has(.workspace-tab.is-selected) {
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
  background: var(--green-soft-2);
}

.workspace-tab,
.workspace-tab-popout,
.workspace-reset-button,
.workspace-panel-grip,
.workspace-panel-close {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.workspace-tab {
  grid-template-columns: 16px minmax(0, max-content) auto 8px;
  gap: 6px;
  max-width: 190px;
  padding: 0 6px 0 9px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.workspace-tab:hover,
.workspace-tab-popout:hover,
.workspace-reset-button:hover,
.workspace-panel-grip:hover,
.workspace-panel-close:hover {
  background: var(--green-soft);
  color: var(--green);
}

.workspace-tab.is-selected {
  color: var(--ink);
}

.workspace-tab svg,
.workspace-tab-popout svg,
.workspace-reset-button svg,
.workspace-panel-grip svg,
.workspace-panel-close svg,
.workspace-panel-icon svg,
.workspace-drag-chip svg,
.workspace-drop-placeholder svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.workspace-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tab-count,
.workspace-panel-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: color-mix(in srgb, var(--gold) 66%, var(--ink));
  font-family: var(--font-mono);
  font-size: 9px;
  place-items: center;
}

.workspace-tab-unseen {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.workspace-tab.has-unseen .workspace-tab-unseen {
  background: var(--green);
}

.workspace-toast-zone {
  position: fixed;
  right: var(--space-6, 24px);
  bottom: var(--space-6, 24px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2, 8px);
  pointer-events: none;
}

.workspace-toast {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 260px;
  max-width: min(340px, calc(100vw - (var(--space-6, 24px) * 2)));
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-md, 10px);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  pointer-events: auto;
  transform: translateX(120%);
  transition:
    transform var(--dur-slow, 0.4s) var(--ease-standard),
    opacity var(--dur-base, 0.2s) var(--ease-standard);
}

.workspace-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.workspace-toast-icon {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
}

.workspace-toast-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.workspace-toast-copy {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

.workspace-toast-title {
  display: block;
  overflow: hidden;
  font-size: var(--text-sm, 0.8125rem);
  font-weight: 500;
  line-height: var(--leading-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-toast-title-name {
  font-weight: 700;
}

.workspace-toast-detail {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-size: var(--text-xs, 0.75rem);
  line-height: var(--leading-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-toast-action {
  flex: 0 0 auto;
  min-width: 52px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: var(--text-2xs, 0.6875rem);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.workspace-toast-undo {
  cursor: default;
}

.workspace-toast-undo-button {
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
  color: var(--green);
  cursor: pointer;
  font: inherit;
  min-height: 28px;
  padding: 0 var(--space-3);
  text-align: center;
}

.workspace-toast-undo-button:hover,
.workspace-toast-undo-button:focus-visible {
  border-color: var(--green);
  background: var(--green-soft);
}

.workspace-empty-strip {
  padding: 0 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}

.workspace-divider {
  flex: 0 0 10px;
  position: relative;
  min-height: 0;
  cursor: ew-resize;
  touch-action: none;
}

.workspace-divider::after {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 1px;
  border-radius: 999px;
  background: var(--line);
  content: "";
  transform: translateX(-50%);
}

.workspace-divider:hover::after,
.workspace-divider:focus-visible::after {
  width: 2px;
  background: var(--green);
}

.workspace-pulled-panel {
  display: flex;
  flex-direction: column;
  margin: 11px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.workspace-pulled-header {
  display: grid;
  grid-template-columns: 34px 18px minmax(0, 1fr) auto 34px;
  gap: 7px;
  align-items: center;
  min-height: 54px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.workspace-panel-label {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-pulled-body,
.artifact-body {
  container-type: inline-size;
  overflow-y: auto;
}

.workspace-pulled-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
}

.workspace-pulled-body > .workspace-section,
.artifact-body > .workspace-section {
  min-width: 0;
}

.workspace-drag-chip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-overlay);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  pointer-events: none;
}

.workspace-drop-placeholder {
  flex: 0 0 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-width: 280px;
  margin: 11px 0;
  border: 1px dashed color-mix(in srgb, var(--green) 55%, var(--line));
  border-radius: var(--r-lg);
  background: var(--green-soft-2);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  pointer-events: none;
}

.workspace-all-pulled .empty-panel-row {
  display: grid;
  gap: 4px;
}

.sms-bulk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
}

.sms-bulk-toggle button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
}

.sms-bulk-toggle button[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green);
}

.sms-reply-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}

.sms-reply-head {
  display: grid;
  grid-template-columns: 10px minmax(72px, max-content) minmax(0, 1fr) auto 18px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.sms-reply-head:hover {
  background: var(--green-soft-2);
}

.sms-reply-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.sms-reply-sender,
.sms-reply-preview,
.sms-reply-time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-reply-sender {
  font-size: 12.5px;
  font-weight: 700;
}

.sms-reply-preview {
  color: var(--ink-2);
  font-size: 12px;
}

.sms-reply-time {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.sms-reply-caret svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform var(--dur-base) var(--ease-standard);
}

.sms-reply-card.open .sms-reply-caret svg {
  transform: rotate(180deg);
}

.sms-reply-body {
  display: none;
  padding: 0 10px 10px;
}

.sms-reply-card.open .sms-reply-body {
  display: block;
}

.sms-reply-card:not(.open) .suggestion-card {
  display: none;
}

@container (max-width: 360px) {
  .review-list,
  .progress-list,
  .scheduled-list,
  .artifact-list {
    grid-template-columns: 1fr;
  }

  .suggestion-heading,
  .suggestion-card.compact .suggestion-heading {
    grid-template-columns: 16px minmax(0, 1fr);
  }

  .suggestion-meta,
  .suggestion-actions {
    grid-column: 1 / -1;
    justify-content: start;
  }
}

@container (max-width: 360px) {
  .artifact-body,
  .workspace-pulled-body {
    padding-left: 10px;
    padding-right: 10px;
  }

  .sms-reply-head {
    grid-template-columns: 10px minmax(0, 0.46fr) minmax(0, 1fr) 18px;
  }

  .sms-reply-time {
    display: none;
  }
}

@media (max-width: 1120px) {
  .app-shell,
  .app-shell.workspace-panel-collapsed,
  .app-shell.sidebar-collapsed,
  .app-shell.sidebar-collapsed.workspace-panel-collapsed {
    display: block;
  }

  .workspace-flow {
    display: block;
    height: 100dvh;
    overflow: hidden;
  }

  .work-panel {
    height: 100dvh;
    margin: 0;
    min-width: 0;
  }

  .workspace-divider,
  .workspace-pulled-panel {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-pulled-panel,
  .workspace-drag-chip,
  .workspace-drop-placeholder,
  .sms-reply-caret svg {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}

/* ALW-236 v10_4 workbench alignment */
.workspace-flow {
  --ws-text-2xs: 0.625rem;
  --ws-text-xs: 0.75rem;
  --ws-text-sm: 0.8125rem;
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 0;
  width: calc(100% + 2px);
  margin-left: -2px;
  padding: 12px 12px 12px 0;
  background: transparent;
  overflow-x: auto;
  overflow-y: hidden;
}

.workspace-flow > .work-panel,
.workspace-flow > .artifact-panel,
.workspace-flow > .workspace-pulled-panel {
  flex: 1 1 0;
  min-width: 280px;
  max-width: none;
  min-height: 0;
}

.workspace-flow > .work-panel {
  margin: 0;
  border: 1px solid var(--green);
  border-top-width: 2px;
  border-radius: var(--r-xl);
  box-shadow: none;
}

.workspace-flow > .artifact-panel,
.workspace-flow > .workspace-pulled-panel {
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.workspace-flow > .artifact-panel {
  width: auto;
}

.workspace-flow > .artifact-panel.is-collapsed {
  display: none;
}

.workspace-flow .artifact-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  min-height: 56px;
  padding: 11px 12px 0;
  border-bottom: 1px solid var(--line);
}

.workspace-flow .artifact-header-actions {
  align-self: center;
  gap: 3px;
  padding-bottom: 9px;
}

.workspace-flow .panel-collapse-button {
  display: none;
}

.workspace-reset-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: var(--r-xs);
  color: var(--ink-3);
}

.workspace-reset-button:hover {
  background: var(--card-2);
  color: var(--green);
}

.workspace-tabstrip {
  align-items: stretch;
  gap: 2px;
  min-height: 40px;
  border: 0;
}

.workspace-tab-wrap {
  position: relative;
  gap: 2px;
  align-items: stretch;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.workspace-tab-wrap:has(.workspace-tab.is-selected) {
  border-color: transparent;
  background: transparent;
}

.workspace-tab {
  display: inline-flex;
  grid-template-columns: none;
  gap: 7px;
  max-width: none;
  min-width: 0;
  min-height: 40px;
  padding: 9px 6px 11px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--ink-2);
  font-size: var(--ws-text-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}

.workspace-tab:hover {
  background: transparent;
  color: var(--ink);
}

.workspace-tab.is-selected {
  border-bottom-color: var(--green);
  color: var(--ink);
  font-weight: 600;
}

.workspace-tab-icon,
.workspace-panel-icon {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  color: currentColor;
}

.workspace-tab-count,
.workspace-panel-count {
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
  font-size: var(--ws-text-2xs);
}

.workspace-tab.is-selected .workspace-tab-count,
.workspace-panel-count {
  border-color: transparent;
  background: var(--green-soft);
  color: var(--green);
}

.workspace-tab-unseen {
  position: absolute;
  top: 6px;
  left: 4px;
  box-shadow: 0 0 0 2px var(--card);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard);
}

.workspace-tab.has-unseen .workspace-tab-unseen {
  opacity: 1;
  transform: scale(1);
}

.workspace-tab-popout {
  position: static;
  flex: 0 0 auto;
  align-self: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin-right: 2px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--ink-3);
  opacity: 0;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), opacity var(--dur-fast) var(--ease-standard);
}

.workspace-tab-wrap:hover .workspace-tab-popout,
.workspace-tab-popout:focus-visible {
  opacity: 0.82;
}

.workspace-tab-popout:hover {
  background: var(--card-2);
  color: var(--green);
  opacity: 1;
}

.workspace-tab-popout svg {
  width: 13px;
  height: 13px;
}

.artifact-body,
.workspace-pulled-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 16px;
  container-type: inline-size;
  overflow-y: auto;
}

.workspace-pulled-header {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 10px 12px 12px;
  border-bottom: 1px solid var(--line);
}

.workspace-panel-grip,
.workspace-panel-close {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-3);
  line-height: 0;
}

.workspace-panel-grip {
  cursor: grab;
}

.workspace-panel-grip:hover,
.workspace-panel-close:hover {
  background: var(--card-2);
  color: var(--ink);
}

.workspace-panel-label {
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.workspace-panel-grip svg,
.workspace-panel-close svg {
  display: block;
  width: 14px;
  height: 14px;
}

.workspace-panel-close {
  margin-left: auto;
}

.workspace-divider {
  flex: 0 0 10px;
  display: grid;
  place-items: center;
  cursor: col-resize;
}

.workspace-divider::after {
  position: static;
  width: 3px;
  height: 44px;
  background: var(--line);
  transform: none;
  transition: background var(--dur-fast) var(--ease-standard), height var(--dur-fast) var(--ease-standard);
}

.workspace-divider:hover::after,
.workspace-divider:focus-visible::after {
  width: 3px;
  height: 64px;
  background: var(--green);
}

.workspace-drop-placeholder {
  flex: 1 1 0;
  min-width: 280px;
  margin: 0;
  border-width: 2px;
  border-radius: var(--r-xl);
  background: var(--green-soft);
}

.workspace-drag-chip {
  border-color: var(--green-soft);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-weight: 600;
}

.workspace-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 12px;
  min-height: 0;
}

.workspace-section > .panel-section-title {
  min-height: 0;
  padding: 0 2px;
  border: 0;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.workspace-section > .panel-section-title:hover {
  background: transparent;
  color: var(--ink-2);
}

.workspace-section[data-workspace-tab-content="agents"] > .panel-section-title,
.workspace-section[data-workspace-tab-content="review"] > .panel-section-title {
  display: none;
}

.workspace-auto-sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 6px 2px 2px;
  padding: 6px 0 0;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.workspace-auto-sec:hover,
.workspace-auto-sec:focus-visible {
  color: var(--ink-2);
}

.workspace-auto-sec .n {
  margin-left: auto;
  margin-right: 6px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

.workspace-agent-subsection {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.workspace-section[data-workspace-tab-content="agents"] > .workspace-agent-subsection {
  overflow: visible;
}

.workspace-agent-subsection.is-collapsed > :not(.workspace-auto-sec) {
  display: none;
}

.workspace-agent-subsection.is-collapsed .section-chevron {
  transform: rotate(0deg);
}

.workspace-work-row,
.sms-reply-card,
.wcard,
.qcard,
.automation {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.sms-reply-card.has-action-ready {
  border-color: color-mix(in srgb, var(--green) 62%, var(--line));
}

.subagent-list,
.scheduled-list,
.artifact-list,
.review-list {
  gap: 12px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.review-list {
  display: grid;
  grid-template-columns: 1fr;
}

.workspace-section[data-workspace-tab-content="review"] > .review-list {
  max-height: none;
  overflow: visible;
}

.app-shell.workspace-panel-wide .review-list {
  grid-template-columns: 1fr;
}

.review-list.sms-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-shell.workspace-panel-wide .review-list.sms-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subagent-row.workspace-work-row {
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  gap: 13px;
  align-items: center;
  min-height: 52px;
  padding: 9px 13px;
}

.subagent-row.workspace-work-row .progress-dot {
  width: 18px;
  height: 18px;
  border: 2px solid var(--green);
  border-radius: 999px;
  background: transparent;
}

.subagent-row.workspace-work-row .progress-dot::after {
  inset: 4px;
  background: var(--green);
}

.subagent-row.workspace-work-row .progress-dot.failed {
  border-color: var(--danger);
}

.subagent-row.workspace-work-row .progress-dot.failed::after {
  background: var(--danger);
}

.subagent-row.workspace-work-row .progress-dot.canceled,
.subagent-row.workspace-work-row .progress-dot.paused {
  border-color: var(--ink-3);
}

.subagent-caret {
  display: grid;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  align-self: center;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  place-items: center;
}

.subagent-caret:hover,
.subagent-caret:focus-visible {
  background: var(--green-soft);
  color: var(--green);
}

.subagent-caret svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  transition: transform var(--dur-base) var(--ease-standard);
}

.subagent-row.open .subagent-caret svg {
  transform: rotate(180deg);
}

.subagent-copy h3,
.scheduled-copy h3 {
  color: var(--ink);
  font-size: var(--ws-text-sm);
  font-weight: 600;
  line-height: 1.25;
}

.subagent-copy p {
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
  line-height: 1.35;
}

.subagent-row.workspace-work-row .subagent-cancel-button {
  display: none;
}

.run-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  vertical-align: middle;
}

.run-pill.idle {
  background: var(--card-2);
  color: var(--ink-3);
}

.run-pill .pulse {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.subagent-output {
  grid-column: 1 / -1;
  margin: -1px -13px -9px;
  border-top: 1px solid var(--line);
  background: var(--tray);
}

.subagent-output-inner {
  display: grid;
  gap: 3px;
  max-height: 218px;
  overflow-y: auto;
  padding: 9px 13px 10px;
}

.subagent-output-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  line-height: 1.55;
}

.subagent-output-line .tm {
  color: var(--ink-3);
}

.subagent-output-line .ms {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.wc-head.automation-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 12px 13px;
  color: inherit;
}

.automation.hidden-row {
  opacity: 0.6;
}

.automation .automation-dot {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 2px solid var(--green);
  border-radius: 999px;
  background: transparent;
}

.automation .automation-dot::after {
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: var(--green);
  content: "";
}

.automation .automation-dot.failed {
  border-color: var(--danger);
}

.automation .automation-dot.failed::after {
  background: var(--danger);
}

.automation .ainfo {
  flex: 1;
  min-width: 0;
}

.automation .an {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--ink);
  font-size: var(--ws-text-sm);
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.health {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.health.ok {
  color: var(--green);
}

.health.err {
  color: var(--danger);
}

.health.off {
  color: var(--ink-3);
}

.health .hd {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.automation .stats {
  display: flex;
  gap: 14px;
  margin-top: 3px;
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
}

.automation .stats .st {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.automation .stats .st svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.9;
}

.automation .stats .st b {
  color: var(--ink);
  font-weight: 600;
}

.toggle {
  position: relative;
  flex: none;
  width: 36px;
  height: 21px;
  border-radius: 99px;
  background: var(--green);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-standard);
}

.toggle::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  content: "";
  transition: left var(--dur-base) var(--ease-standard);
}

.toggle.off {
  background: var(--ink-3);
  opacity: 0.6;
}

.toggle.off::after {
  left: 17px;
}

.workspace-toggle {
  position: relative;
  width: 36px;
  height: 22px;
  border-radius: 999px;
  background: var(--green);
}

.workspace-toggle::after {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--card);
  content: "";
}

.workspace-toggle.off {
  background: var(--ink-3);
}

.workspace-toggle.off::after {
  right: auto;
  left: 3px;
}

.workspace-section .scheduled-next {
  font-size: var(--ws-text-xs);
  line-height: 1.35;
}

.workspace-section .scheduled-faint,
.workspace-section .artifact-row-meta {
  font-size: var(--ws-text-2xs);
  line-height: 1.45;
}

.workspace-section .artifact-row .artifact-title-link {
  font-size: var(--ws-text-sm);
  font-weight: 600;
}

.workspace-example-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-3);
  font-size: var(--ws-text-xs);
}

.workspace-auto-sec-label,
.workspace-example-kicker {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.workspace-example-list {
  display: grid;
  gap: 12px;
}

.workspace-example-card {
  display: grid;
  gap: 7px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-md);
}

.workspace-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.workspace-example-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: var(--ws-text-sm);
  font-weight: 600;
  line-height: 1.25;
}

.workspace-example-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
  line-height: 1.4;
}

.workspace-example-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-example-pill.muted {
  background: var(--card-2);
  color: var(--ink-3);
}

.workspace-example-pill.done {
  background: var(--green-soft-2);
  color: var(--ink-2);
}

.workspace-example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 2px;
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
}

.workspace-example-grid span,
.workspace-example-note {
  min-width: 0;
  padding: 7px 8px;
  border-radius: var(--r-xs);
  background: var(--tray);
}

.workspace-example-grid b {
  color: var(--ink);
  font-weight: 600;
}

.workspace-example-note {
  color: var(--ink-3);
  font-size: var(--ws-text-xs);
}

.workspace-call-example {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.workspace-call-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
  font-weight: 700;
  place-items: center;
}

.sms-pane-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-bottom: 2px;
}

.sms-layout-toggle {
  margin-left: auto;
}

.sms-bulk-toggle,
.sms-layout-toggle,
.sms-bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
}

.sms-bulk-toggle button,
.sms-layout-toggle button {
  display: grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-3);
}

.sms-bulk-toggle button[aria-pressed="true"],
.sms-layout-toggle button[aria-pressed="true"],
.sms-select-toggle[aria-pressed="true"] {
  background: var(--card);
  color: var(--green);
  box-shadow: var(--shadow-md);
}

.sms-bulk-toggle svg,
.sms-layout-toggle svg,
.sms-select-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sms-select-tools {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.sms-select-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: var(--space-1);
  height: 26px;
  min-height: 26px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
  color: var(--ink-3);
  font-size: var(--ws-text-2xs);
  font-weight: 800;
  line-height: 1;
}

.sms-pane-tools .collapse-seg,
.sms-pane-tools .sms-select-toggle {
  border-radius: 999px;
}

.sms-pane-tools .collapse-seg button {
  border-radius: 999px;
}

.sms-bulk-actions[hidden] {
  display: none;
}

.sms-bulk-actions {
  box-sizing: border-box;
  height: 32px;
  min-height: 32px;
  gap: var(--space-1);
}

.sms-bulk-selection-count {
  padding: 0 var(--space-2);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 700;
  white-space: nowrap;
}

.sms-bulk-action-button {
  height: 26px;
  min-height: 26px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card);
  color: var(--ink-2);
  font-size: var(--ws-text-2xs);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.sms-bulk-action-button:not(:disabled):hover,
.sms-bulk-action-button:not(:disabled):focus-visible {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.sms-bulk-action-button:disabled {
  opacity: 0.48;
}

.sms-reply-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 14px;
  cursor: pointer;
  font-size: var(--ws-text-xs);
  line-height: 1.25;
  user-select: none;
}

.sms-reply-surface {
  position: relative;
  z-index: 1;
  background: var(--card);
  transition: transform var(--dur-base) var(--ease-standard);
  touch-action: pan-y;
}

.sms-reply-card {
  overflow: hidden;
  position: relative;
}

.sms-reply-card.is-swiping .sms-reply-surface {
  transition: none;
}

.sms-reply-card.is-selected {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 20%, transparent);
}

.sms-reply-card.is-archiving {
  max-height: 54px;
  opacity: 0.72;
  pointer-events: none;
  transition:
    max-height var(--dur-base) var(--ease-standard),
    opacity var(--dur-base) var(--ease-standard),
    margin var(--dur-base) var(--ease-standard);
}

.sms-reply-swipe-action {
  position: absolute;
  top: calc((43px - (var(--space-6) + var(--space-2))) / 2);
  right: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: min(
    calc(var(--space-10) * 2 + var(--space-5)),
    var(--sms-swipe-reveal, 0px)
  );
  height: calc(var(--space-6) + var(--space-2));
  padding: 0 var(--space-2);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--green) 38%, var(--line));
  border-radius: var(--radius-pill);
  background: var(--green-soft);
  color: var(--green);
  opacity: 0;
  font-size: var(--ws-text-xs);
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transform: scale(0.96);
  transition:
    opacity var(--dur-fast) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard),
    width var(--dur-fast) var(--ease-standard);
}

.sms-reply-card.is-swiping .sms-reply-swipe-action,
.sms-reply-card.is-archiving .sms-reply-swipe-action {
  opacity: 1;
  transform: scale(1);
}

.sms-reply-head:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
}

.sms-message-scope-toggle {
  display: flex;
  justify-content: center;
}

.sms-message-scope-toggle.is-expanded {
  padding: var(--space-2) 0;
}

.sms-message-scope-toggle.is-bottom {
  padding: var(--space-2) 0 0;
}

.sms-message-scope-toggle-button {
  min-height: 24px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
  color: var(--ink-3);
  font-size: var(--ws-text-2xs);
  font-weight: 700;
}

.sms-message-scope-toggle-button:not(:disabled):hover,
.sms-message-scope-toggle-button:not(:disabled):focus-visible {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.sms-message-scope-toggle-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.sms-reply-channel,
.sms-reply-channel svg {
  width: 14px;
  height: 14px;
}

.sms-reply-channel {
  flex: 0 0 auto;
  color: var(--green);
}

.sms-reply-channel svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.sms-reply-card.open .sms-reply-preview,
.sms-reply-card.open .sms-reply-time {
  display: none;
}

.sms-reply-dot,
.sms-reply-time {
  flex: 0 0 auto;
}

.sms-reply-caret {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--ink-3);
}

.sms-reply-sender {
  flex: 0 0 auto;
  max-width: min(52%, 16rem);
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-reply-preview {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-reply-time {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  white-space: nowrap;
}

.sms-reply-body {
  padding: 0;
}

.sms-reply-card .suggestion-card.compact {
  gap: 0;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sms-reply-card .suggestion-card.compact .suggestion-heading {
  display: none;
}

.sms-reply-card .thread-shell {
  margin: 0 12px;
  min-width: 0;
}

.sms-reply-card .thread-cue {
  display: none;
}

.sms-reply-card .suggestion-card.compact .thread-viewport {
  max-height: 420px;
  padding-top: 8px;
  -webkit-mask-image: none;
  mask-image: none;
}

.sms-reply-card .mini-msg {
  padding: 7px 11px;
  font-size: var(--ws-text-sm);
  line-height: 1.4;
}

.sms-reply-card .suggestion-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
}

.act-spacer {
  flex: 1 1 auto;
}

.sms-reply-card .suggestion-send,
.sms-reply-card .suggestion-edit,
.sms-reply-card .suggestion-no-reply,
.sms-reply-card .suggestion-cancel,
.sms-reply-card .suggestion-cancel-draft {
  min-width: 0;
  min-height: 32px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-size: var(--ws-text-xs);
}

.sms-reply-card .suggestion-send {
  width: auto;
}

.sms-reply-card .suggestion-card.compact .message-thread-draft-action,
.sms-reply-card .message-thread-draft-action {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  white-space: nowrap;
}

.sms-reply-card .message-thread-draft-action-secondary {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
  box-shadow: none;
}

.sms-reply-card .message-thread-draft-action-secondary:hover,
.sms-reply-card .message-thread-draft-action-secondary:focus-visible {
  border-color: var(--accent-2);
  background: var(--card);
  color: var(--ink);
}

.sms-reply-card .suggestion-no-reply {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
  font-weight: 600;
}

.sms-reply-card .suggestion-no-reply:hover,
.sms-reply-card .suggestion-no-reply:focus-visible {
  border-color: var(--green);
  color: var(--green);
}

.sms-reply-card .suggestion-cancel-draft {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
  font-weight: 600;
}

.sms-reply-card .suggestion-cancel-draft:hover,
.sms-reply-card .suggestion-cancel-draft:focus-visible {
  border-color: var(--accent-2);
  background: var(--card);
  color: var(--ink);
}

.sms-reply-context-menu {
  position: fixed;
  z-index: 120;
  display: grid;
  min-width: 112px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--floating);
  box-shadow: var(--shadow-sm);
}

.sms-reply-context-menu button.sms-reply-context-option {
  display: flex;
  align-items: center;
  height: 24px;
  min-height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  font-size: var(--text-2xs, 0.6875rem);
  font-weight: 600;
  line-height: 1;
  text-align: left;
}

.sms-reply-context-menu button.sms-reply-context-option:hover,
.sms-reply-context-menu button.sms-reply-context-option:focus-visible {
  background: var(--green-soft);
  color: var(--green);
}

.pane-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.pane-tools .pt-label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  letter-spacing: 0.1em;
}

.collapse-seg,
.layout-seg {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
}

.layout-seg {
  margin-left: auto;
}

.collapse-seg button,
.layout-seg button {
  display: grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--ink-3);
}

.collapse-seg button[aria-pressed="true"],
.layout-seg button[aria-pressed="true"],
.layout-seg button.on {
  background: var(--card);
  color: var(--green);
  box-shadow: var(--shadow-md);
}

.collapse-seg svg,
.layout-seg svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.wcard {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.wc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
  line-height: 1.25;
}

.wc-head:hover {
  background: var(--card-2);
}

.wc-head .who {
  flex: 0 0 auto;
  max-width: min(52%, 16rem);
  overflow: hidden;
  color: var(--ink);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-head .ch {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
}

.sms-reply-card.open .wc-preview,
.sms-reply-card.open .wc-time {
  display: none;
}

.sms-reply-card:not(.open) .wc-head .ch {
  display: none;
}

.wc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
}

.wc-preview {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-reply-card.is-unread .who,
.sms-reply-card.is-unread .wc-preview,
.sms-reply-card.is-unread .wc-time {
  color: var(--ink);
  font-weight: 700;
}

.sms-reply-action-slot {
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.sms-reply-action-ready {
  position: relative;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
}

.sms-reply-action-ready > span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green-soft);
  animation: sms-ready-pulse 1.8s var(--ease-standard) infinite;
}

.sms-reply-action-ready::before {
  position: absolute;
  inset: 2px;
  border: 1px solid var(--green);
  border-radius: 999px;
  content: "";
  opacity: 0.5;
  animation: sms-ready-ring 1.8s var(--ease-standard) infinite;
}

.sms-reply-card.has-action-ready:nth-of-type(7n) .sms-reply-action-ready::after {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px 999px 999px 0;
  background: radial-gradient(circle at 45% 48%, var(--azalea-mid, var(--green-soft)) 0 38%, var(--azalea-throat, var(--green)) 70%);
  opacity: 0;
  transform: scale(0.4) rotate(-18deg);
  animation: sms-ready-azalea 12s var(--ease-standard) infinite;
}

.sms-reply-drafting {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--gold) 76%, var(--ink));
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 600;
  white-space: nowrap;
}

.sms-reply-ready {
  flex: 0 0 auto;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 700;
  white-space: nowrap;
}

.sms-reply-sending {
  flex: 0 0 auto;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 600;
  white-space: nowrap;
}

.sms-reply-select {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 24px;
  cursor: pointer;
}

.sms-reply-select-input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--green);
}

.sms-reply-queue-marker {
  flex: 0 0 auto;
  padding: 2px var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card-2);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 700;
  white-space: nowrap;
}

.drafting-dots {
  display: inline-flex;
  width: 1.2em;
  margin-left: 1px;
  letter-spacing: 0;
}

.drafting-dots span {
  opacity: 0.22;
  animation: drafting-dot-pulse 1.1s var(--ease-standard) infinite;
}

.drafting-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.drafting-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

.wc-time {
  flex: 0 0 auto;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  white-space: nowrap;
}

@keyframes sms-ready-pulse {
  0% {
    box-shadow: 0 0 0 2px var(--green-soft);
    transform: scale(0.82);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--green) 18%, transparent);
    transform: scale(1.08);
  }
  100% {
    box-shadow: 0 0 0 2px transparent;
    transform: scale(0.82);
  }
}

@keyframes sms-ready-ring {
  0% {
    opacity: 0.55;
    transform: scale(0.65);
  }
  70% {
    opacity: 0;
    transform: scale(1.75);
  }
  100% {
    opacity: 0;
    transform: scale(1.75);
  }
}

@keyframes sms-ready-azalea {
  0%, 72%, 100% {
    opacity: 0;
    transform: scale(0.4) rotate(-18deg);
  }
  76%, 84% {
    opacity: 0.9;
    transform: scale(1) rotate(8deg);
  }
  90% {
    opacity: 0;
    transform: scale(0.7) rotate(16deg);
  }
}

@keyframes drafting-dot-pulse {
  0%, 20% {
    opacity: 0.22;
    transform: translateY(0);
  }
  45% {
    opacity: 1;
    transform: translateY(-1px);
  }
  80%, 100% {
    opacity: 0.22;
    transform: translateY(0);
  }
}

.wc-caret {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-left: 0;
  color: var(--ink-3);
  transition: transform var(--dur-base) var(--ease-standard);
}

.sms-reply-card.open .wc-caret {
  transform: rotate(180deg);
}

.sms-reply-card.open .wc-caret svg {
  transform: none;
}

.sms-reply-card.open {
  overflow: hidden;
}

.sms-reply-card.open.has-action-ready .wc-head {
  background: var(--green-soft);
  border-radius: calc(var(--r-md) - 1px) calc(var(--r-md) - 1px) 0 0;
}

.sms-reply-card:not(.open) .wc-head {
  background: transparent;
}

.wc-caret svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.wc-body {
  display: none;
}

.sms-reply-card.open .wc-body {
  display: block;
}

.sms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.sms-grid.two,
.review-list.sms-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-section .btn-send,
.workspace-section .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: var(--r-xs);
  font-size: var(--ws-text-xs);
  font-weight: 600;
}

.workspace-section .btn-send {
  border: 0;
  background: var(--grad-chip);
  color: #fff;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard);
}

.workspace-section .btn-send:hover,
.workspace-section .btn-send:focus-visible {
  background: var(--send-hover);
  color: var(--send-hover-ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.workspace-section .btn-send:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.workspace-section .btn-ghost {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
}

.workspace-section [aria-disabled="true"] {
  cursor: default;
}

.q-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  overscroll-behavior: contain;
  margin-inline: -8px;
  padding: 2px 8px 18px;
}

.workspace-section[data-workspace-tab-content="quotes"] > .q-grid {
  flex: 1 1 auto;
  align-content: start;
  grid-auto-rows: max-content;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.scheduled-list,
.agents-scheduled-list,
.artifact-list,
.agents-artifact-list {
  margin-inline: -8px;
  padding-inline: 8px;
}

.qcard {
  perspective: 1800px;
}

.qcard .flip {
  position: relative;
  display: grid;
  min-width: 0;
  max-width: 100%;
  transform-style: preserve-3d;
  transition: transform var(--dur-slow) var(--ease-standard);
}

.qcard .face {
  position: relative;
  grid-area: 1 / 1;
  min-width: 0;
  max-width: 100%;
  border: 0;
  border-radius: inherit;
  background: var(--card);
  box-shadow: none;
  backface-visibility: hidden;
  overflow: hidden;
}

.qcard:not(.is-editing) .face.back,
.qcard.is-editing .face.front {
  position: absolute;
  inset: 0;
}

.qcard .face.back {
  transform: rotateY(180deg);
}

.qcard:not(.is-editing) .face.back,
.qcard.is-editing .face.front {
  pointer-events: none;
}

.qcard.is-editing .flip {
  transform: rotateY(180deg);
}

.qcard-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .qcard-head:hover {
    background: var(--card-2);
  }
}

.qcard-head:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
}

.quote-live-card.open .qcard-head {
  border-radius: calc(var(--r-md) - 1px) calc(var(--r-md) - 1px) 0 0;
  background: var(--green-soft);
}

.quote-live-card:not(.open) .qcard-head,
.quote-live-card:not(.open) .qcard-head:active,
.quote-live-card:not(.open) .qcard-head:focus-visible {
  background: transparent;
}

.quote-live-card.open .qcard-head:focus-visible {
  background: var(--green-soft);
}

.new-leads-bulk-toggle {
  flex: 0 0 auto;
}

.quote-live-card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.quote-live-card.open {
  overflow: hidden;
}

.quote-live-card.open .face.front {
  overflow: hidden;
}

.quote-live-card.is-selected .face.front {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 20%, transparent);
}

.quote-live-card.is-selected {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line));
}

.quote-live-card.is-archiving {
  max-height: 74px;
  opacity: 0.72;
  pointer-events: none;
  transition:
    max-height var(--dur-base) var(--ease-standard),
    opacity var(--dur-base) var(--ease-standard),
    margin var(--dur-base) var(--ease-standard);
}

.new-lead-surface {
  position: relative;
  z-index: 1;
  background: transparent;
  transition: transform var(--dur-base) var(--ease-standard);
  touch-action: pan-y;
}

.quote-live-card.is-swiping .new-lead-surface {
  transition: none;
}

.new-lead-swipe-action {
  top: calc((52px - (var(--space-6) + var(--space-2))) / 2);
}

.quote-live-card.is-swiping .new-lead-swipe-action,
.quote-live-card.is-archiving .new-lead-swipe-action {
  opacity: 1;
  transform: scale(1);
}

.new-lead-summary {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) minmax(60px, auto) minmax(62px, auto) minmax(42px, auto) 18px;
  column-gap: 7px;
  row-gap: 2px;
  align-items: center;
  min-height: 46px;
}

.quote-live-card.is-bulk-selecting .new-lead-summary {
  grid-template-columns: 20px minmax(104px, 1fr) minmax(60px, auto) minmax(62px, auto) minmax(42px, auto) 18px;
}

.new-lead-caret {
  display: grid;
  width: 18px;
  height: 18px;
  margin-left: auto;
  place-items: center;
  border-radius: var(--r-xs);
  color: var(--ink-3);
}

.new-lead-caret svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  transition: transform var(--dur-base) var(--ease-standard);
}

.quote-live-card.open .new-lead-caret svg {
  transform: rotate(180deg);
}

.new-lead-main {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.new-lead-sub {
  min-width: 0;
  color: var(--ink-3);
  font-size: var(--ws-text-2xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-lead-amount,
.new-lead-ready {
  justify-self: end;
  white-space: nowrap;
}

.new-lead-amount {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 800;
}

.new-lead-ready {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.new-lead-ready.ready,
.new-lead-ready.sent {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  background: var(--green-soft);
  color: var(--green);
}

.new-lead-ready.blocked {
  background: var(--gold-wash);
  color: var(--ink-2);
}

.new-lead-ready.needs-info {
  border-color: color-mix(in srgb, var(--gold) 42%, var(--line));
  background: var(--gold-wash);
  color: var(--ink);
}

.new-lead-ready.sending,
.new-lead-ready.pending {
  background: var(--card-2);
  color: var(--ink-3);
}

.new-lead-expanded {
  display: none;
  border-top: 1px solid var(--line);
}

.quote-live-card.open .new-lead-expanded {
  display: grid;
}

.quote-live-card:not(.open) .new-lead-expanded-actions {
  display: none;
}

.qcard-head .who {
  min-width: 0;
  color: var(--ink);
  font-size: var(--ws-text-sm);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-lead-summary .who {
  display: block;
  max-width: none;
}

.qcard-head .qtag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.06em;
}

.quote-style-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.quote-style-select {
  min-height: 24px;
  max-width: 108px;
  padding: 2px 16px 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
}

.quote-style-select-wrap::after {
  position: absolute;
  right: 6px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--green);
  border-bottom: 1.5px solid var(--green);
  content: "";
  pointer-events: none;
  transform: translateY(-1px) rotate(45deg);
}

.quote-style-select:hover,
.quote-style-select:focus-visible {
  border-color: var(--green);
  background: var(--card);
  outline: none;
}

.qcard-head .ch {
  margin-left: auto;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
}

.new-lead-summary .ch {
  margin-left: 0;
  justify-self: end;
}

.qcard-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: stretch;
}

.qcard-actions {
  display: flex;
  justify-content: flex-end;
  padding: 9px 12px 11px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.quote-remove-button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-3);
  font-size: var(--ws-text-xs);
  font-weight: 600;
  cursor: pointer;
}

.quote-remove-button:hover,
.quote-remove-button:focus-visible {
  border-color: var(--line);
  background: var(--card-2);
  color: var(--ink);
}

.q-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  background: var(--tray);
}

.q-thumb .expand-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(19, 36, 59, 0.78);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  opacity: 0;
}

.q-thumb:hover .expand-badge {
  opacity: 1;
}

.quote-live-card .q-thumb {
  align-items: stretch;
  overflow: hidden;
  padding: 12px;
}

.quote-preview-button,
.quote-preview-empty {
  position: relative;
  display: grid;
  width: 100%;
  height: clamp(260px, 38vw, 360px);
  min-height: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
  overflow: hidden;
}

.quote-preview-button {
  align-self: stretch;
  border: 0;
  border-radius: 0;
  background: transparent;
  height: 100%;
  min-height: 240px;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.quote-preview-button img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  background: transparent;
}

.quote-preview-fallback {
  display: none;
  place-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: var(--ws-text-xs);
  font-weight: 700;
}

.quote-preview-fallback svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.quote-preview-button.is-missing-preview img {
  display: none;
}

.quote-preview-button.is-missing-preview .quote-preview-fallback {
  display: grid;
}

.quote-preview-button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.quote-preview-empty {
  gap: 8px;
  color: var(--ink-3);
  font-size: var(--ws-text-xs);
}

.quote-preview-needs-info {
  min-height: 180px;
  padding: 18px;
  color: var(--ink-2);
  text-align: center;
}

.quote-preview-needs-info strong {
  color: var(--ink);
  font-size: var(--ws-text-sm);
}

.quote-preview-needs-info span {
  max-width: 28ch;
  color: var(--ink-3);
  line-height: var(--leading-snug);
}

.quote-preview-empty svg {
  width: 24px;
  height: 24px;
  stroke: var(--ink-3);
}

.quote-product-strip,
.quote-warning-list,
.quote-artifact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.quote-product-pill {
  display: inline-flex;
  flex-direction: column;
  flex: 1 1 96px;
  gap: 4px;
  min-width: 96px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
}

.quote-product-pill b {
  color: var(--ink);
  font-size: var(--ws-text-xs);
  font-weight: 700;
}

.quote-product-pill span {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--ws-text-xs);
  font-weight: 800;
  line-height: 1.25;
}

.quote-warning-list span {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--gold-wash);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
}

.quote-artifact-links a {
  color: var(--green);
  font-size: var(--ws-text-xs);
  font-weight: 700;
  text-decoration: none;
}

.quote-artifact-links a:hover,
.quote-artifact-links a:focus-visible {
  color: var(--green);
  text-decoration: underline;
}

.quote-send-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.quote-send-panel > * {
  min-width: 0;
  max-width: 100%;
}

.scenario-draft-field.quote-send-message {
  justify-self: center;
  align-self: center;
  width: 100%;
  max-width: none;
}

.quote-send-panel.is-disabled {
  opacity: 0.72;
}

.quote-send-panel.is-sent {
  opacity: 1;
}

.quote-send-panel.is-failed {
  opacity: 1;
}

.scenario-draft-field.quote-send-message textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: none;
  min-height: calc(var(--quote-send-message-lines, 4) * 1.45em);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.45;
  outline: none;
  resize: vertical;
  field-sizing: content;
  overflow: hidden;
  overflow-y: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quote-send-lines-4 { --quote-send-message-lines: 4; }
.quote-send-lines-5 { --quote-send-message-lines: 5; }
.quote-send-lines-6 { --quote-send-message-lines: 6; }
.quote-send-lines-7 { --quote-send-message-lines: 7; }
.quote-send-lines-8 { --quote-send-message-lines: 8; }
.quote-send-lines-9 { --quote-send-message-lines: 9; }
.quote-send-lines-10 { --quote-send-message-lines: 10; }
.quote-send-lines-11 { --quote-send-message-lines: 11; }
.quote-send-lines-12 { --quote-send-message-lines: 12; }
.quote-send-lines-13 { --quote-send-message-lines: 13; }
.quote-send-lines-14 { --quote-send-message-lines: 14; }

.quote-send-message textarea:disabled {
  color: var(--ink-2);
  opacity: 1;
  -webkit-text-fill-color: var(--ink-2);
}

.quote-send-panel.is-sent .quote-send-message {
  border-style: solid;
  background: var(--green-soft);
}

.quote-send-panel.is-failed .quote-send-message {
  border-color: var(--danger);
}

.scenario-draft-actions.quote-send-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 0;
  border-top: 0;
}

.quote-send-actions .quote-edit-toggle {
  grid-column: 1;
  justify-self: start;
}

.quote-send-actions .scenario-send-status {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-send-actions .btn-send {
  grid-column: 3;
  justify-self: end;
}

.quote-send-actions .scenario-send-status:empty {
  display: none;
}

.quote-send-actions .scenario-send-status.error {
  color: var(--danger);
}

.q-thumb .expand-badge svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
}

.doc-mini {
  width: 100%;
  max-width: 340px;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: #fff;
  color: #1f2733;
  font-size: 0.5rem;
  box-shadow: var(--shadow-lg);
}

.dm-hero {
  padding: 9px 11px 8px;
  background: linear-gradient(135deg, #13243b, #1d3550);
  color: #eef2f7;
}

.dm-hero .t,
.dm-hero .ad,
.dm-row,
.dm-off {
  display: flex;
  justify-content: space-between;
}

.dm-hero .b {
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.dm-hero .e,
.dm-hero .f {
  color: #aebacb;
  font-family: var(--font-mono);
  font-size: 0.375rem;
}

.dm-hero .f {
  margin-top: 6px;
  letter-spacing: 0.16em;
}

.dm-hero .nm {
  margin-top: 1px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
}

.dm-hero .ad {
  align-items: baseline;
  margin-top: 4px;
}

.dm-hero .ad .a,
.dm-hero .ad .bal {
  color: #c4cedd;
  font-size: 0.4375rem;
}

.dm-hero .ad .bal b {
  margin-left: 3px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.5625rem;
}

.dm-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fff;
}

.dm-col {
  min-width: 0;
  padding: 7px 7px 8px;
  border-right: 1px solid #e7e9ec;
}

.dm-col:last-child {
  border-right: 0;
}

.dm-col.is-muted {
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.45;
}

.dm-col .cn {
  color: #1f2733;
  font-family: var(--font-mono);
  font-size: 0.375rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.dm-col .ct {
  display: inline-block;
  margin: 1px 0 4px;
  padding-bottom: 3px;
  border-bottom: 1.5px solid rgba(11, 106, 74, 0.18);
  color: #5c6470;
  font-size: 0.40625rem;
}

.dm-pay {
  margin-bottom: 4px;
  padding: 5px 4px;
  border-radius: 5px;
  background: #f3f4f6;
  text-align: center;
}

.dm-pay .big {
  color: #1f2733;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.dm-pay .big2 {
  margin-top: 4px;
  color: #0b6a4a;
  font-family: var(--font-display);
  font-size: 0.5625rem;
  font-weight: 600;
  line-height: 1;
}

.dm-pay .l {
  margin-top: 1px;
  color: #98a0ac;
  font-family: var(--font-mono);
  font-size: 0.28125rem;
  letter-spacing: 0.08em;
}

.dm-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dm-row {
  padding-bottom: 1px;
  border-bottom: 1px solid #e7e9ec;
  color: #5c6470;
  font-size: 0.375rem;
}

.dm-row b {
  color: #1f2733;
}

.dm-off {
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-top: 1px solid #e7e9ec;
  background: #f6f7f8;
}

.dm-off .ph {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid #e0e2e5;
  border-radius: 50%;
  background: #eceef0;
  color: #98a0ac;
  place-items: center;
}

.dm-off .ph svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
}

.dm-off .oi {
  flex: 1;
  min-width: 0;
}

.dm-off .ol {
  color: #98a0ac;
  font-family: var(--font-mono);
  font-size: 0.3125rem;
  letter-spacing: 0.1em;
}

.dm-off .on {
  color: #1f2733;
  font-family: var(--font-display);
  font-size: 0.5625rem;
  font-weight: 600;
}

.dm-off .od,
.dm-off .rt {
  color: #5c6470;
  font-size: 0.375rem;
}

.dm-off .rt {
  text-align: right;
}

.dm-off .rt .s {
  color: #e0a411;
}

.qcard-info {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border-left: 1px solid var(--line);
  background: var(--card);
}

.quote-live-card .qcard-info {
  border-left: 0;
  min-width: 0;
  overflow: hidden;
}

.quote-live-card .info-row {
  display: grid;
  grid-template-columns: minmax(108px, 0.9fr) minmax(0, 1.15fr);
  align-items: baseline;
  gap: 10px;
}

.quote-live-card .info-row .k,
.quote-live-card .info-row .v {
  min-width: 0;
}

.quote-live-card .info-row .v {
  overflow-wrap: anywhere;
  white-space: normal;
}

.quote-card-review-section {
  border-top: 1px solid var(--line);
}

.quote-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.quote-section-head .info-sec {
  flex: 1 1 auto;
}

.quote-card-review-section .q-thumb {
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
}

.info-sec {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
}

.info-sec::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.info-grid {
  display: flex;
  flex-direction: column;
}

.info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row .k {
  flex: 0 0 auto;
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
}

.info-row .v {
  color: var(--ink);
  font-size: var(--ws-text-sm);
  font-weight: 600;
  text-align: right;
}

.info-row .v.hl,
.badge-ltv {
  color: var(--green);
}

.badge-ltv {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 600;
}

.src-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
}

.src-row svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  stroke: var(--ink-3);
}

.src-row b {
  color: var(--ink);
  font-weight: 600;
}

.qcard-act {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}

.quote-edit-toggle {
  min-height: 28px;
  padding: 0 9px;
  font-size: var(--ws-text-xs);
}

.example-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.example-status.muted {
  background: var(--card-2);
  color: var(--ink-3);
}

.qback-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.qback-head .h {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qback-x {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
  color: var(--ink-2);
  place-items: center;
}

.qback-x svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.qback-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--tray);
}

.qback-pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
}

.qback-pane.intake {
  border-left: 1px solid var(--line);
  background: var(--card);
}

.qfield {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.qfield label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  letter-spacing: 0.08em;
}

.live-quote-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-height: min(72vh, 760px);
  overflow: auto;
}

.quote-editor-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.quote-editor-toggle {
  width: 100%;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  text-align: left;
  cursor: pointer;
}

.quote-editor-toggle .chev {
  display: inline-grid;
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  transition: transform var(--dur-fast) var(--ease-standard);
  place-items: center;
}

.quote-editor-toggle .chev svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.quote-editor-section.is-collapsed .quote-editor-toggle .chev {
  transform: rotate(-90deg);
}

.quote-editor-section.is-collapsed {
  padding-block: 8px;
}

.quote-editor-section.is-collapsed .quote-editor-toggle {
  min-height: 24px;
  color: var(--ink);
}

.quote-editor-section.is-collapsed .quote-editor-content {
  display: none;
}

.quote-editor-content {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.quote-editor-section.formulas {
  background: var(--tray);
}

.quote-editor-footer-section {
  border-bottom: 0;
  background: var(--card);
}

.quote-formula-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quote-formula-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card);
}

.quote-formula-row span {
  color: var(--ink);
  font-size: var(--ws-text-xs);
  font-weight: 700;
}

.quote-formula-row b {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 600;
  line-height: 1.45;
}

.qrow2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.quote-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.quote-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card);
  overflow: hidden;
}

.quote-option-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.quote-option-column + .quote-option-column {
  border-left: 1px solid var(--line);
}

.quote-option-head {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.quote-option-head b {
  color: var(--ink);
  font-size: var(--ws-text-sm);
  font-weight: 800;
}

.quote-option-head span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-initial-values {
  display: grid;
  gap: 5px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.quote-initial-values div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.quote-initial-values span {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
}

.quote-initial-values b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: var(--ws-text-xs);
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-option-fields {
  display: grid;
  gap: 8px;
}

.quote-cashout-option-fields {
  display: grid;
  gap: 8px;
}

.quote-cashout-option-fields[hidden] {
  display: none;
}

.quote-option-subhead {
  padding-top: 2px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qinput {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card);
  color: var(--ink);
}

.qinput input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--ws-text-xs);
}

.quote-edit-select {
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card);
  color: var(--ink);
  font-size: var(--ws-text-xs);
}

.qreadonly {
  display: flex;
  min-height: 30px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--tray);
  color: var(--ink-3);
  font-size: var(--ws-text-xs);
}

.quote-edit-status {
  min-height: 20px;
  color: var(--ink-3);
  font-size: var(--ws-text-xs);
}

.quote-edit-status.error {
  color: var(--danger);
}

.workspace-section .btn-send:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.qinput .pre,
.qinput .suf {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
}

.qproducts,
.qselect {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qchip,
.qselect button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  letter-spacing: 0.06em;
}

.qchip.on,
.qselect button.on {
  border-color: color-mix(in srgb, var(--green) 32%, transparent);
  background: var(--green-soft);
  color: var(--green);
}

.qhint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
  line-height: 1.4;
}

.qhint svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  stroke: var(--gold);
}

.scn-new {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 15px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--card-2);
}

.scn-input {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  outline: none;
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--ws-text-sm);
  line-height: 1.5;
  resize: none;
}

.scn-input::placeholder {
  color: var(--ink-3);
}

.scn-input:focus {
  border-color: var(--green);
}

.scn-new-act {
  display: flex;
  align-items: center;
  gap: 11px;
}

.scn {
  padding: 0;
}

.scn-head {
  display: grid;
  width: 100%;
  height: auto;
  min-height: 44px;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.scn-head:focus-visible,
.lender-head:focus-visible,
.call[role="button"]:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
}

.scn-topline {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.scn-ti {
  min-width: 0;
}

.scn-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: var(--ws-text-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scn-sub {
  display: grid;
  gap: 5px;
  max-width: 100%;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--ws-text-xs);
  line-height: 1.32;
  white-space: normal;
}

.scn-sub-bullet {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  gap: 7px;
}

.scn-sub-bullet::before {
  width: 4px;
  height: 4px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.run-pill.running {
  background: var(--green-soft);
  color: var(--green);
}

.run-pill.done {
  background: var(--gold-wash);
  color: var(--gold);
}

.run-pill.matched {
  background: var(--green-soft);
  color: var(--green);
}

.run-pill.blocked {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.scenario-live-list {
  display: grid;
  gap: 12px;
}

.workspace-section > .scenario-live-list {
  max-height: none;
  overflow: visible;
}

.scenario-summary,
.scenario-boundary {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
  line-height: 1.45;
}

.scenario-boundary {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  letter-spacing: 0.04em;
}

.scenario-open-questions {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card);
}

.scenario-live-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 3px;
}

.scenario-classification-summary {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  letter-spacing: 0.06em;
}

.scenario-feedback-slot {
  margin-left: auto;
}

.scenario-feedback-slot .feedback-issue-menu {
  right: 0;
  bottom: calc(100% + 6px);
  left: auto;
  top: auto;
}

.scn-head .chev,
.lender-head .chev.sm,
.call .chev {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  transition: transform var(--dur-base) var(--ease-standard);
}

.scn-head .chev,
.scn-head .chev svg {
  width: 16px;
  height: 16px;
}

.scn.open .scn-head .chev,
.lender.open .lender-head .chev.sm,
.wcard.open .call .chev {
  transform: rotate(180deg);
}

.scn-body {
  max-height: 0;
  overflow: hidden;
}

.scn.open .scn-body {
  max-height: none;
  border-top: 1px solid var(--line);
}

.scn-body-inner {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 14px;
}

.scn-section {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  letter-spacing: 0.14em;
}

.lender {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card);
}

.lender-head {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lender-logo {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 600;
  place-items: center;
}

.lender-info {
  flex: 1;
  min-width: 0;
}

.lender-pill-row {
  display: contents;
}

.lender-info .ln,
.call .ci .nm {
  overflow: hidden;
  color: var(--ink);
  font-size: var(--ws-text-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lender-info .ld,
.call .ci .meta {
  overflow: hidden;
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fit,
.draft-flag,
.call .stat {
  flex: 0 0 auto;
  border-radius: 999px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.fit {
  padding: 2px 8px;
  font-size: 0.53125rem;
}

.fit-strong {
  background: var(--green-soft);
  color: var(--green);
}

.fit-maybe {
  background: var(--gold-wash);
  color: var(--gold);
}

.draft-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-3);
  font-size: 0.5rem;
}

.draft-flag svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.draft-flag.replied {
  border-color: color-mix(in srgb, var(--green) 28%, transparent);
  background: var(--green-soft);
  color: var(--green);
}

.draft-flag.sent {
  background: var(--gold-wash);
  color: var(--gold);
}

.draft-flag.failed {
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.draft-flag.sending {
  background: var(--green-soft);
  color: var(--green);
}

.lender-head .chev.sm,
.lender-head .chev.sm svg {
  width: 14px;
  height: 14px;
}

.lender-detail {
  max-height: 0;
  overflow: hidden;
}

.lender.open .lender-detail {
  max-height: none;
  border-top: 1px solid var(--line);
}

.ld-split {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 11px;
  background: var(--tray);
}

.ld-analysis {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.ld-block .ld-h {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
}

.ld-block .ld-h svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.ld-block.ok .ld-h {
  color: var(--green);
}

.ld-block.warn .ld-h {
  color: var(--gold);
}

.ld-block.q .ld-h,
.ld-block.scenario-evidence .ld-h {
  color: var(--ink-2);
}

.ld-block ul {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ld-block li {
  position: relative;
  padding-left: 13px;
  color: var(--ink);
  font-size: var(--ws-text-xs);
  line-height: 1.4;
}

.ld-block li::before {
  position: absolute;
  top: 7px;
  left: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-3);
  content: "";
}

.ld-email {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card);
  overflow: hidden;
}

.ld-email-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 11px 8px;
  border-bottom: 1px solid var(--line);
}

.ld-email-label {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.ld-email-to {
  overflow: hidden;
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ld-email-body {
  flex: 1;
  max-height: 96px;
  overflow-y: auto;
  padding: 10px 11px;
}

.ee-subj {
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--ws-text-xs);
  font-weight: 600;
}

.ee-text {
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
  line-height: 1.55;
}

.ld-email-act {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-top: 1px solid var(--line);
}

.scenario-draft-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 10px 11px 3px;
}

.scenario-draft-field {
  display: grid;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  letter-spacing: 0.06em;
}

.scenario-draft-address {
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  min-height: 24px;
}

.scenario-draft-address span {
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
}

.scenario-draft-field input,
.scenario-draft-field textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--ws-text-xs);
  letter-spacing: 0;
}

.scenario-draft-field input {
  height: auto;
  padding: 0;
  line-height: 1.45;
}

.scenario-draft-field textarea {
  max-height: 96px;
  min-height: 0;
  padding: 0;
  line-height: 1.55;
  overflow-y: auto;
  resize: none;
  white-space: pre-wrap;
}

.scenario-draft-field input:focus,
.scenario-draft-field textarea:focus {
  box-shadow: 0 1px 0 var(--green);
}

.scenario-draft.needs-recipient [data-scenario-draft-to] {
  box-shadow: 0 1px 0 var(--gold-solid);
}

.scenario-draft-field input::placeholder {
  color: var(--ink-3);
}

.scenario-draft-field [data-scenario-draft-to]::placeholder {
  font-size: var(--ws-text-xs);
}

.scenario-draft-subject {
  margin: 8px 30px 0 11px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}

.scenario-draft-subject input {
  color: var(--ink);
  font-weight: 600;
}

.scenario-draft-body {
  padding: 8px 11px 0;
}

.scenario-draft-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-top: 1px solid var(--line);
}

.scenario-draft-actions .btn-send:disabled {
  border-color: var(--line);
  background: var(--card-2);
  box-shadow: none;
  color: var(--ink-3);
  cursor: not-allowed;
  opacity: 0.8;
}

.scenario-send-status {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--ink-3);
  font-size: var(--ws-text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-send-status.sent {
  color: var(--green);
  font-weight: 600;
}

.scenario-evidence li span {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
}

.ld-chain {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  padding: 10px 11px;
  background: var(--card);
}

.ch-meta {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  letter-spacing: 0.08em;
}

.ch-bubble {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-2);
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
  line-height: 1.45;
}

.ch-bubble.ch-reply {
  border-color: color-mix(in srgb, var(--green) 24%, transparent);
  background: var(--green-soft);
  color: var(--ink);
}

.ch-who,
.ch-subj {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--ws-text-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ch-waiting {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: var(--ws-text-xs);
}

.call {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.call .av {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card-2);
  color: var(--ink-2);
  font-size: var(--ws-text-sm);
  font-weight: 600;
  place-items: center;
}

.call .ci {
  flex: 1;
  min-width: 0;
}

.call .stat {
  padding: 3px 9px;
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
}

.stat-q {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
}

.stat-sched {
  background: var(--gold-wash);
  color: var(--gold);
}

.stat-done {
  background: var(--green-soft);
  color: var(--green);
}

.call .chev,
.call .chev svg {
  width: 15px;
  height: 15px;
}

.call-detail {
  max-height: 0;
  overflow: hidden;
}

.wcard.open .call-detail {
  max-height: 440px;
  border-top: 1px solid var(--line);
}

.cd-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
}

.cd-outcome {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--r-xs);
  background: var(--green-soft);
}

.cd-outcome.muted {
  background: var(--card-2);
}

.cd-outcome.muted .oi {
  color: var(--ink-3);
}

.cd-outcome .oi,
.cd-outcome .oi svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--green);
}

.cd-outcome .ot {
  font-size: var(--ws-text-xs);
}

.cd-outcome .ot b,
.cd-trans {
  display: block;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
}

.cd-trans {
  margin-bottom: 2px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
}

.cd-line {
  display: flex;
  gap: 9px;
  padding: 3px 0;
  font-size: var(--ws-text-xs);
  line-height: 1.5;
}

.cd-line .spk {
  flex: 0 0 46px;
  color: var(--ink-2);
  font-weight: 600;
}

.cd-line.agent .spk {
  color: var(--green);
}

.cd-line .ln {
  color: var(--ink);
}

.cd-actions {
  display: flex;
  gap: 8px;
  padding-top: 2px;
}

@container (max-width: 360px) {
  .review-list.sms-grid-two,
  .sms-grid.two {
    grid-template-columns: 1fr;
  }

  .qcard-split,
  .ld-split,
  .qback-cols,
  .quote-editor-grid,
  .quote-option-grid,
  .quote-formula-row,
  .qrow2 {
    grid-template-columns: 1fr;
  }

  .quote-option-column + .quote-option-column {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .qcard-info {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .quote-product-strip {
    flex-direction: column;
  }

  .quote-product-pill {
    width: 100%;
  }

  .new-lead-summary {
    grid-template-columns: minmax(0, 1fr) minmax(68px, auto) 18px;
    min-height: 54px;
  }

  .quote-live-card.is-bulk-selecting .new-lead-summary {
    grid-template-columns: 20px minmax(0, 1fr) minmax(68px, auto) 18px;
  }

  .new-lead-select {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .new-lead-main {
    grid-column: 1;
  }

  .quote-live-card.is-bulk-selecting .new-lead-main {
    grid-column: 2;
  }

  .new-lead-amount {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .quote-live-card.is-bulk-selecting .new-lead-amount {
    grid-column: 3;
  }

  .new-lead-ready {
    grid-column: 2;
    grid-row: 2;
    display: inline-flex;
    justify-self: end;
  }

  .quote-live-card.is-bulk-selecting .new-lead-ready {
    grid-column: 3;
  }

  .new-lead-summary .ch {
    grid-column: 1;
    grid-row: 2;
    display: block;
    justify-self: start;
  }

  .quote-live-card.is-bulk-selecting .new-lead-summary .ch {
    grid-column: 2;
  }

  .new-lead-caret {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .quote-live-card.is-bulk-selecting .new-lead-caret {
    grid-column: 4;
  }

  .quote-card-review-section .q-thumb {
    min-height: 240px;
  }

  .ld-analysis {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .qback-pane.intake {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .sms-reply-head {
    padding-inline: 12px;
  }

  .sms-reply-sender {
    max-width: 42%;
  }

  .sms-reply-time {
    display: none;
  }

  .sms-reply-card .suggestion-card.compact .thread-viewport {
    max-height: 460px;
    overscroll-behavior-y: auto;
  }

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

  .workspace-call-avatar {
    display: none;
  }

  .wc-head.automation-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .automation .stats {
    flex-wrap: wrap;
    gap: 7px 10px;
  }

  .automation .toggle {
    margin-left: 31px;
  }

  .subagent-row.workspace-work-row {
    grid-template-columns: 18px minmax(0, 1fr) 18px;
  }

  .wc-head.artifact-row-head {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .subagent-cancel-button,
  .artifact-row .artifact-actions {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 1120px) {
  .workspace-flow {
    display: block;
    height: 100dvh;
    width: 100%;
    margin-left: 0;
    padding: 0;
    overflow: hidden;
  }

  .workspace-flow > .work-panel {
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .workspace-flow > .workspace-pulled-panel,
  .workspace-flow .workspace-divider {
    display: none;
  }
}

@media (max-width: 520px) {
  .workspace-flow .artifact-header {
    min-height: 54px;
    padding-inline: 10px;
  }

  .workspace-tab {
    gap: 5px;
    padding-inline: 8px;
  }

  .workspace-tab:not(.is-selected) .workspace-tab-label {
    display: none;
  }
}

@media (max-width: 1120px) {
  .workspace-flow .artifact-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .workspace-mobile-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--ws-text-sm);
    font-weight: 600;
    line-height: 1;
  }

  .workspace-mobile-title-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    color: currentColor;
    place-items: center;
  }

  .workspace-mobile-title-icon svg {
    display: block;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .workspace-mobile-title-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-tabstrip {
    display: none;
  }

  .workspace-tabstrip::-webkit-scrollbar {
    display: none;
  }

  .workspace-tab-wrap {
    flex: 0 0 auto;
  }

  .workspace-tab {
    min-width: max-content;
    min-height: 42px;
    padding-inline: 9px;
    touch-action: manipulation;
  }

  .workspace-tab:not(.is-selected) .workspace-tab-label {
    display: inline;
  }

  .workspace-tab-popout,
  .workspace-divider,
  .workspace-pulled-panel,
  .workspace-drag-chip,
  .workspace-drop-placeholder {
    display: none;
  }

  .artifact-panel:not(.is-collapsed) .artifact-body {
    overflow-y: auto;
    overscroll-behavior-y: auto;
    padding-inline: var(--space-6);
    scrollbar-gutter: stable;
  }

  .workspace-section[data-workspace-tab-content="quotes"] > .q-grid {
    max-width: none;
    max-height: none;
    overflow: visible;
  }

  .artifact-body > .workspace-section {
    flex: 0 0 auto;
    min-height: min-content;
  }

  .workspace-section[data-workspace-tab-content="agents"] {
    gap: 10px;
  }

  .workspace-agent-subsection {
    gap: 10px;
  }

  .workspace-auto-sec {
    min-height: 34px;
    margin-top: 2px;
    padding: 8px 2px;
    touch-action: manipulation;
  }

  .workspace-auto-sec .section-chevron {
    flex: 0 0 auto;
  }

  .scheduled-list,
  .agents-scheduled-list,
  .subagent-list,
  .artifact-list,
  .agents-artifact-list {
    overflow: visible;
    max-height: none;
  }

  .agents-scheduled-list,
  .subagent-list,
  .agents-artifact-list {
    flex: 0 0 auto;
  }

  .agents-scheduled-list {
    gap: 8px;
  }

  .agents-scheduled-list .wc-head.automation-head {
    gap: 9px;
    padding: 8px 10px;
  }

  .agents-scheduled-list .automation .automation-dot {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }

  .agents-scheduled-list .automation .an {
    gap: 6px;
    font-size: var(--ws-text-xs);
    line-height: 1.25;
    white-space: normal;
  }

  .agents-scheduled-list .automation .stats {
    gap: 6px 10px;
    margin-top: 2px;
    font-size: var(--ws-text-2xs);
    line-height: 1.25;
  }

  .agents-scheduled-list .automation .toggle {
    width: 32px;
    height: 19px;
  }

  .agents-scheduled-list .automation .toggle::after {
    width: 15px;
    height: 15px;
  }

  .empty-panel-row {
    min-height: 44px;
    white-space: normal;
  }

  .qinput input,
  .quote-edit-select,
  .scn-input,
  .scenario-draft-field input,
  .scenario-draft-field textarea {
    font-size: 16px;
  }

  .scenario-draft-body textarea {
    min-height: 240px;
    font-size: 16px;
    line-height: 1.45;
    overflow-y: auto;
  }

  .scn-topline {
    align-items: flex-start;
  }

  .scn-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }

  .scenario-live-card .run-pill {
    align-self: flex-start;
    min-width: max-content;
    margin-left: auto;
    white-space: nowrap;
  }

  .scenario-live-card .run-pill[data-scenario-match-count] .run-pill-label {
    display: none;
  }

  .scenario-live-card .run-pill[data-scenario-match-count]::after {
    content: attr(data-scenario-match-count);
  }

  .lender-head {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 14px;
    grid-template-rows: auto auto;
    align-content: start;
    align-items: start;
    row-gap: 1px;
    min-height: 80px;
    padding-block: 8px;
  }

  .lender-info {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    gap: 1px;
  }

  .lender-logo {
    grid-column: 1;
    grid-row: 1;
  }

  .lender-info .ln {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.2;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .lender-pill-row {
    display: flex;
    grid-column: 2 / 4;
    grid-row: 2;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin-top: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  .lender-head .fit,
  .lender-head .draft-flag {
    min-width: 0;
    max-width: none;
  }

  .lender-head .draft-flag {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lender-head .chev.sm {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }
}
