html:root,
html:root body {
  min-height: 100%;
  padding: 0;
}

html:root body {
  margin: 0;
  width: auto;
  display: block;
  background: #eef1ed;
  overflow: hidden;
}

.canvas-header,
.nav-sidebar,
.fake-kb,
#__dev-changelog {
  display: none !important;
}

/* Demo/dev: keep 新用户态/老用户态 switch above the phone frame on desktop. */
body .mode-switch {
  display: flex;
  flex-shrink: 0;
  justify-content: center;
}

body .page-layout {
  width: 100vw;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 12px 20px;
  display: grid;
  gap: 0;
  place-items: center;
  box-sizing: border-box;
}

body .device-col {
  width: min(430px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

body #device {
  width: 430px;
  max-width: 100%;
  /* Explicit height: flex:1 + min-height:0 without a sized parent collapses to 0. */
  height: min(932px, calc(100dvh - 76px));
  min-height: 0;
  max-height: calc(100dvh - 76px);
  margin: 0 auto;
  box-shadow: 0 24px 70px rgba(25, 31, 23, 0.18);
}

body #device #scrollArea:not(.chatting):not(.focusing):not(.onboarding) .hero-visual {
  height: 132px;
}

#device .screen {
  height: 100%;
}

.live-login {
  position: fixed;
  inset: 0;
  z-index: 120000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(238, 241, 237, 0.92);
  backdrop-filter: blur(16px);
}

.live-login[hidden] {
  display: none;
}

.live-login__panel {
  width: min(360px, 100%);
  padding: 28px;
  box-sizing: border-box;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(25, 31, 23, 0.12);
}

.live-login__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: #1d1d1f;
  font-size: 21px;
  font-weight: 700;
}

.live-login__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #74d944;
  color: #173d08;
}

.live-login__form {
  display: grid;
  gap: 12px;
}

.live-login__quick {
  display: grid;
  gap: 8px;
  padding: 0 0 4px;
}

.live-login__quick-label {
  color: #6e6e73;
  font-size: 12px;
}

.live-login__quick-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.live-login__quick-option {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 999px;
  background: #f5f8f2;
  color: #1d1d1f;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.live-login__quick-option:hover {
  border-color: rgba(100, 201, 54, 0.45);
  background: #eef8e8;
}

.live-login__quick-option:disabled {
  cursor: wait;
  opacity: 0.6;
}

.live-login__field {
  display: grid;
  gap: 6px;
  color: #6e6e73;
  font-size: 12px;
}

.live-login__field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid rgba(29, 29, 31, 0.14);
  border-radius: 6px;
  background: #fff;
  color: #1d1d1f;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.live-login__field input:focus {
  border-color: #62c732;
  box-shadow: 0 0 0 3px rgba(98, 199, 50, 0.13);
}

.live-login__submit {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: #64c936;
  color: #112d08;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.live-login__submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

.live-login__error,
.live-error {
  color: #b42318;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.live-error {
  margin: 10px 24px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: 6px;
  background: #fff4f2;
}

.live-interruption {
  margin: 0 24px 16px;
  padding: 12px;
  border: 1px solid rgba(180, 112, 24, 0.22);
  border-radius: 8px;
  background: #fffaf1;
  color: #6f4a14;
  font-size: 12px;
  line-height: 1.5;
}

.live-interruption--healing {
  border-color: rgba(24, 112, 180, 0.22);
  background: #f3f8ff;
  color: #1e4a6f;
}

.live-interruption__retry {
  min-height: 34px;
  margin-top: 10px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(111, 74, 20, 0.2);
  border-radius: 6px;
  background: #fff;
  color: #57390e;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.live-trace {
  margin-top: 4px;
  color: #8e8e93;
  font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.live-message {
  display: flex;
  margin: 0 24px 16px;
}

.live-message--user {
  justify-content: flex-end;
}

.live-message__body {
  max-width: 84%;
  color: #1d1d1f;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.live-message--user .live-message__body {
  padding: 10px 13px;
  border-radius: 16px 16px 4px 16px;
  background: #ecf8e6;
}

.live-message--assistant .live-message__body {
  max-width: 100%;
}

.live-message__body--streaming::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.1em;
  background: #1d1d1f;
  animation: live-caret-blink 1s steps(1, end) infinite;
}

.live-attachment-process {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: min(100%, 560px);
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 6px;
  background: #fff;
}

.live-attachment-process__icon {
  color: #477a31;
  font-size: 25px;
}

.live-attachment-process__copy {
  min-width: 0;
}

.live-attachment-process__name {
  overflow: hidden;
  color: #303033;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-attachment-process__status {
  margin-top: 3px;
  color: #737376;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.live-attachment-process__track {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: #eceeeb;
}

.live-attachment-process__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #57b82d;
  transition: width 160ms ease;
}

.live-attachment-process[data-stage='standby'] {
  border-color: rgba(71, 122, 49, 0.24);
  background: #f8fbf6;
}

.live-attachment-process[data-stage='failed'] {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff8f7;
}

.live-attachment-process[data-stage='failed'] .live-attachment-process__icon,
.live-attachment-process[data-stage='failed'] .live-attachment-process__status {
  color: #b42318;
}

@keyframes live-caret-blink {
  50% {
    opacity: 0;
  }
}

.live-runtime {
  margin: 0 24px 14px;
  padding: 10px 12px;
  border-left: 2px solid #70d43e;
  background: #f7f9f6;
  color: #6e6e73;
  font-size: 12px;
  line-height: 1.5;
}

.live-runtime[data-status='failed'] {
  border-left-color: #c84035;
  background: #fff6f4;
}

.live-runtime[data-status='stopped'] {
  border-left-color: #9a9a9f;
  background: #f6f6f6;
}

.live-runtime--pending .live-runtime__marker {
  animation: live-pending-pulse 1.1s ease-in-out infinite;
}

.live-runtime--pending.live-runtime--empty-body {
  animation: live-thinking-shell-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pending-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.live-runtime__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.live-runtime__summary {
  color: #3c3c3f;
  font-weight: 650;
}

.live-runtime__status {
  flex: 0 0 auto;
  color: #5a9f38;
  font-size: 10px;
}

.live-runtime[data-status='failed'] .live-runtime__status {
  color: #b42318;
}

.live-runtime[data-status='stopped'] .live-runtime__status {
  color: #77777c;
}

.live-runtime__steps {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.live-runtime__step {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 7px;
}

.live-runtime__marker {
  color: #61bd36;
  font-size: 9px;
  line-height: 18px;
}

.live-runtime__step[data-status='running'] .live-runtime__marker {
  animation: live-runtime-pulse 1.2s ease-in-out infinite;
}

.live-runtime__step[data-status='stopped'] .live-runtime__marker {
  color: #929297;
}

.live-runtime__step-title {
  color: #515154;
  font-weight: 600;
}

.live-runtime__step-detail {
  margin-top: 2px;
  color: #85858a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@keyframes live-runtime-pulse {
  50% { opacity: 0.35; }
}

/* generate_script readable preview — thinking chrome, not assistant body */
.live-thinking-stream {
  margin: 0 24px 14px;
  padding: 10px 12px;
  border-left: 2px solid #70d43e;
  background: #f7f9f6;
  color: #6e6e73;
  font-size: 12px;
  line-height: 1.5;
}

.live-thinking-stream--enter {
  animation: live-thinking-enter 0.28s ease-out;
}

@keyframes live-thinking-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.live-thinking-stream__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.live-thinking-stream__bar:focus-visible {
  outline: 2px solid rgba(94, 196, 43, 0.35);
  outline-offset: 2px;
  border-radius: 6px;
}

.live-thinking-stream__summary {
  flex: 1;
  min-width: 0;
  color: #3c3c3f;
  font-weight: 650;
}

.live-thinking-stream__status {
  flex: 0 0 auto;
  color: #5a9f38;
  font-size: 10px;
}

.live-thinking-stream[data-status='completed'] .live-thinking-stream__status {
  color: #77777c;
}

.live-thinking-stream__chev {
  flex: 0 0 auto;
  color: #9a9a9f;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.live-thinking-stream--collapsed .live-thinking-stream__chev {
  transform: rotate(-90deg);
}

.live-thinking-stream__body {
  margin-top: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #85858a;
  max-height: 280px;
  overflow-y: auto;
}

/* Collapsed: peek 1–2 lines so seed/stream never looks like a blank shell */
.live-thinking-stream--collapsed .live-thinking-stream__body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: 3em;
  margin-top: 6px;
  opacity: 0.88;
}

.live-thinking-stream--collapsed.live-thinking-stream--empty-body .live-thinking-stream__body {
  display: none;
  margin-top: 0;
}

.live-thinking-stream[data-status='failed'] .live-thinking-stream__status {
  color: #c45c4a;
}

.live-thinking-stream--streaming .live-thinking-stream__body::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.1em;
  background: #61bd36;
  animation: live-caret-blink 1s steps(1, end) infinite;
}

.live-thinking-stream--streaming .live-thinking-stream__status {
  animation: live-runtime-pulse 1.2s ease-in-out infinite;
}

/* Collapsed pending shell: soft pulse on the bar so click feedback is visible */
.live-thinking-stream--streaming.live-thinking-stream--collapsed {
  animation: live-thinking-shell-pulse 1.4s ease-in-out infinite;
}

.live-thinking-stream--streaming.live-thinking-stream--collapsed.live-thinking-stream--enter {
  animation:
    live-thinking-enter 0.28s ease-out,
    live-thinking-shell-pulse 1.4s ease-in-out 0.28s infinite;
}

@keyframes live-thinking-shell-pulse {
  0%,
  100% {
    background: #f7f9f6;
  }
  50% {
    background: #eef6e8;
  }
}

.agent-block {
  margin: 0 24px 14px;
  color: #1d1d1f;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.agent-block:not(.agent-block--text-markdown):not(.agent-block--runtime-task):not(.agent-block--runtime-step):not(.agent-block--action-quick-suggestions):not(.agent-block--action-route_chip) {
  padding: 14px;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 8px;
  background: #fff;
}

.agent-block--runtime-task,
.agent-block--runtime-step {
  padding: 10px 12px;
  border-left: 2px solid #64c936;
  background: #f7f9f6;
  color: #515154;
}

.agent-block--planning-gate {
  border-color: rgba(71, 120, 49, 0.2);
  background: #f8fbf6;
}

.planning-gate__reason {
  color: #3f4140;
  font-size: 14px;
}

.planning-gate__options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.planning-gate__option.agent-action {
  width: 100%;
  min-height: 42px;
  justify-content: space-between;
  margin: 0;
  border-color: rgba(29, 29, 31, 0.12);
  background: #fff;
  color: #313134;
  text-align: left;
}

.planning-gate__option[data-selected='true'] {
  border-color: #57b82d;
  background: #eff9ea;
  color: #245d0d;
}

.planning-gate__option:disabled {
  cursor: default;
  opacity: 0.58;
}

.planning-gate__option[data-selected='true']:disabled {
  opacity: 1;
}

.planning-gate__send {
  flex: 0 0 auto;
  font-size: 15px;
}

.agent-block--card-confirmation {
  border-color: rgba(40, 94, 29, 0.2);
  background: #fbfdf9;
}

.confirmation-card__heading {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.confirmation-card__icon {
  color: #477a31;
  font-size: 21px;
}

.confirmation-card__title {
  min-width: 0;
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.confirmation-card__content {
  display: grid;
  gap: 10px;
  margin-top: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 6px;
  background: #fff;
}

.confirmation-card__description {
  color: #454548;
}

.confirmation-card__impact {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid rgba(29, 29, 31, 0.08);
}

.confirmation-card__impact-title {
  margin: 0;
  color: #515154;
  font-size: 12px;
  line-height: 1.4;
}

.confirmation-card__impact-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.confirmation-card__impact-value {
  color: #245d0d;
  font-size: 17px;
  line-height: 1;
}

.confirmation-card__impact-label {
  min-width: 0;
  font-size: 12px;
  font-weight: 650;
}

.confirmation-card__impact-detail {
  min-width: 0;
  color: #77777b;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.confirmation-card__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.confirmation-card__controls .agent-action,
.confirmation-card__supplement-submit.agent-action {
  width: 100%;
  margin: 0;
}

.confirmation-card__confirm.agent-action {
  border-color: #57b82d;
  background: #57b82d;
  color: #102408;
}

.confirmation-card__cancel.agent-action {
  background: #fff;
  color: #515154;
}

.confirmation-card__supplement {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(29, 29, 31, 0.08);
}

.confirmation-card__supplement-label {
  display: grid;
  gap: 6px;
  color: #515154;
  font-size: 12px;
  font-weight: 650;
}

.confirmation-card__supplement-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 68px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid rgba(29, 29, 31, 0.14);
  border-radius: 6px;
  background: #fff;
  color: #1d1d1f;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
}

.confirmation-card__supplement-input[aria-invalid='true'] {
  border-color: #b42318;
}

@media (max-width: 460px) {
  .confirmation-card__impact-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .confirmation-card__impact-detail {
    grid-column: 1 / -1;
  }
}

.agent-block--action-route_chip {
  padding: 0;
  border: 0;
  background: transparent;
}

.route-chip {
  display: inline-grid;
  grid-template-columns: 18px minmax(0, auto) 16px;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 999px;
  background: #fff;
  color: #313134;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.route-chip__icon {
  color: #6e6e73;
  font-size: 16px;
}

.route-chip__arrow {
  color: #a0a0a5;
  font-size: 14px;
}

.agent-block--error-blocker {
  border-color: rgba(180, 35, 24, 0.2) !important;
  background: #fff6f4 !important;
}

.agent-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.agent-block__title,
.agent-topic__title,
.agent-script__title,
.agent-peer h4 {
  margin: 0;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.agent-block__detail,
.agent-block__meta {
  color: #85858a;
  font-size: 11px;
}

.agent-block__text,
.agent-block__preview,
.agent-block__warning,
.agent-block__empty,
.agent-markdown p,
.agent-topic p,
.agent-peer p {
  margin: 0 0 10px;
}

.agent-markdown p:last-child,
.agent-topic p:last-child,
.agent-peer p:last-child {
  margin-bottom: 0;
}

.agent-markdown {
  font-size: 15px;
  line-height: 1.7;
  /* Block HTML from markdown-it already encodes breaks; preserving source
     whitespace here creates empty gaps and list-marker overlap. */
}

.agent-markdown ol,
.agent-markdown ul {
  margin: 0 0 10px;
  padding-left: 1.35em;
}

.agent-markdown li {
  margin: 0 0 6px;
}

.agent-markdown li:last-child {
  margin-bottom: 0;
}

.agent-markdown ol:last-child,
.agent-markdown ul:last-child {
  margin-bottom: 0;
}

.agent-block__preview {
  max-height: 132px;
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 6px;
  background: #f7f7f7;
  color: #515154;
  white-space: pre-wrap;
}

.agent-block__label {
  margin: 12px 0 7px;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 600;
}

.agent-segmented,
.agent-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.agent-segmented__item,
.agent-choice,
.agent-action {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 6px;
  background: #fff;
  color: #313134;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
}

.agent-segmented__item[data-selected='true'],
.agent-choice[data-selected='true'] {
  border-color: #57b82d;
  background: #eff9ea;
  color: #245d0d;
  font-weight: 650;
}

.agent-field {
  width: 100%;
  min-height: 40px;
  margin-top: 10px;
  padding: 10px;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 6px;
  background: #fff;
  color: #1d1d1f;
  font: inherit;
  outline: none;
}

.agent-field:focus {
  border-color: #57b82d;
  box-shadow: 0 0 0 3px rgba(87, 184, 45, 0.12);
}

.agent-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 10px 7px 0 0;
  border-color: #5cc42f;
  background: #67cf38;
  color: #153b06;
  font-weight: 650;
}

.agent-action__price {
  padding-left: 7px;
  border-left: 1px solid rgba(21, 59, 6, 0.2);
  font-size: 10px;
  white-space: nowrap;
}

.agent-block__list,
.agent-block__risks {
  margin: 8px 0 10px;
  padding-left: 20px;
}

.agent-block__risks,
.agent-block__warning {
  color: #a13b31;
}

.agent-step {
  margin: 5px 0;
  padding-left: 12px;
  border-left: 2px solid #d5d7d3;
}

.agent-step--completed {
  border-color: #62c732;
  color: #477a31;
}

.agent-topic {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 6px;
  background: #fafafa;
}

.agent-topic__hook {
  margin-top: 5px !important;
  color: #333336;
}

.agent-topic__reason {
  color: #7b7b80;
  font-size: 12px;
}

.agent-peer-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 148px;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.agent-peer {
  min-width: 0;
  scroll-snap-align: start;
}

.agent-peer .agent-action {
  width: 100%;
  margin: 8px 0 0;
}

.agent-peer__cover {
  width: 148px;
  aspect-ratio: 9 / 14;
  display: block;
  margin-bottom: 7px;
  object-fit: cover;
  border-radius: 6px;
  background: #eceeeb;
}

.agent-peer p {
  color: #86868b;
  font-size: 10px;
}

.video-upload {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.video-upload__input {
  display: none;
}

.video-upload__pick.agent-action {
  width: 100%;
  min-height: 42px;
  margin: 0;
}

.video-upload__status {
  min-height: 18px;
  margin: 0;
  color: #6e6e73;
  font-size: 12px;
  line-height: 1.5;
}

.video-upload__status[data-stage='failed'] {
  color: #b42318;
}

.video-upload__status[data-stage='ready'],
.video-upload__status[data-stage='submitted'] {
  color: #2f7513;
}

.video-structure__transcript {
  margin-top: 12px;
  border-top: 1px solid rgba(29, 29, 31, 0.09);
  color: #515154;
}

.video-structure__transcript summary {
  padding: 10px 0 2px;
  color: #477a31;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.video-structure__transcript-text {
  max-height: 280px;
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #333336;
  font: inherit;
  font-size: 12px;
  line-height: 1.65;
}

.agent-script__title {
  margin-bottom: 10px;
  font-size: 16px;
}

.agent-shot {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid rgba(29, 29, 31, 0.07);
}

.agent-shot__number {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef5ea;
  color: #477a31;
  font-size: 10px;
  font-weight: 700;
}

.agent-shot__text {
  grid-column: 2;
  margin: 0;
  white-space: pre-wrap;
}

.agent-shot__director {
  grid-column: 2;
  margin: 2px 0 0;
  color: #66666a;
  font-size: 10px;
  line-height: 1.45;
}

.agent-shot__memory {
  grid-column: 2;
  color: #477a31;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  text-align: left;
}

.agent-script__memfoot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}

.agent-script__memlist {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.agent-script__memitem {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) auto minmax(0, 1.1fr);
  gap: 6px;
  align-items: start;
  font-size: 11px;
  line-height: 1.45;
  color: #4a4a4e;
}

.agent-script__memitem > * {
  min-width: 0;
}

.agent-script__memitem b {
  color: #1d1d1f;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.agent-script__memarrow {
  color: #a0a0a5;
}

.agent-script__memitem > span:not(.agent-script__memarrow) {
  overflow-wrap: anywhere;
}

.agent-script__memskip {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #6e6e73;
}

.agent-script__snapshot {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  border: 1px solid rgba(71, 122, 49, 0.3);
  border-radius: 6px;
  background: #f5faf3;
  color: #366b3f;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.agent-script__snapshot iconify-icon {
  font-size: 16px;
}

.agent-script__snapshot:disabled {
  cursor: wait;
  opacity: 0.55;
}

.agent-block--card-publish-advice .agent-block__header {
  display: none;
}

.pub {
  margin: 0;
  padding: 0;
  border-top: none;
}

.pub--standalone {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.pub__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.pub__ico {
  display: none;
}

.pub__t {
  font-size: 13px;
  font-weight: 700;
  color: #1d1d1f;
}

.pub__mini,
.pub__chev,
.pub__label {
  color: #6e6e73;
}

.pub__mini {
  font-size: 11px;
}

.pub__chev {
  margin-left: auto;
  font-size: 18px;
  transition: transform 0.18s ease;
}

.pub.open .pub__chev {
  transform: rotate(180deg);
}

.pub__body {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
}

.pub.open .pub__body {
  display: flex;
}

.pub__label {
  font-size: 11px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pub__label iconify-icon {
  font-size: 12px;
  color: #a0a0a5;
}

.pub__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pub__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  color: #1d1d1f;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  cursor: pointer;
}

.pub__tag iconify-icon {
  font-size: 11px;
  color: #6e6e73;
}

.pub__time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: rgba(79, 179, 56, 0.08);
  color: #3b8e22;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pub__time iconify-icon {
  font-size: 15px;
  color: #3b8e22;
}

.pub__copyline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f5f7;
  border: 0.5px solid rgba(0, 0, 0, 0.05);
}

.pub__copyline .cc {
  flex: 1;
  font-size: 13px;
  color: #1d1d1f;
  line-height: 1.5;
}

.pub__copybtn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  color: #1d1d1f;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  cursor: pointer;
}

.pub__copybtn iconify-icon {
  font-size: 15px;
  color: #6e6e73;
}

body #device .pub__compliance {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-radius: 8px;
  background: #fff9ec !important;
  border: 1px solid rgba(173, 117, 0, 0.2) !important;
}

body #device .pub__compliance[data-tone='warning'] {
  background: #fff6ea !important;
  border-color: rgba(185, 91, 25, 0.24) !important;
}

body #device .pub__compliance-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

body #device .pub__compliance-icon {
  width: 20px;
  height: 20px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #9b6a00;
}

body #device .pub__compliance-icon iconify-icon {
  font-size: 16px;
  color: #9b6a00 !important;
  margin-top: 0;
}

body #device .pub__compliance-title {
  color: #3f3525;
  font-size: 13px;
  font-weight: 700;
}

body #device .pub__compliance-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(155, 106, 0, 0.1);
  color: #795300;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

body #device .pub__compliance[data-tone='warning'] .pub__compliance-icon,
body #device .pub__compliance[data-tone='warning'] .pub__compliance-badge {
  color: #9e421c;
}

body #device .pub__compliance[data-tone='warning'] .pub__compliance-icon iconify-icon {
  color: #9e421c !important;
}

body #device .pub__compliance[data-tone='warning'] .pub__compliance-badge {
  background: rgba(158, 66, 28, 0.09);
}

body #device .pub__compliance-copy {
  display: grid;
  gap: 7px;
  color: #544a3c;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

body #device .pub__compliance-paragraph {
  margin: 0;
}

.agent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.agent-tag {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2464a8;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.agent-publish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.agent-copy:not(.agent-tag) {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 6px;
  background: #fff;
  color: #515154;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.agent-block--action-quick-suggestions {
  display: flex;
  gap: 7px;
  overflow-x: auto;
}

.agent-block--action-quick-suggestions .agent-block__header {
  display: none;
}

.agent-block--action-quick-suggestions .agent-action {
  flex: 0 0 auto;
  margin-top: 0;
  border-color: rgba(29, 29, 31, 0.12);
  background: #fff;
  color: #313134;
}

.input-row__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#device .drawer-scrim {
  background: rgba(24, 27, 22, 0.26);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#device .drawer-scrim > .statusbar {
  width: 82%;
  max-width: 340px;
  box-sizing: border-box;
  color: #1d1d1f;
}

#device .drawer {
  background: #fff;
  border-right: 1px solid rgba(29, 29, 31, 0.08);
  box-shadow: 20px 0 44px rgba(25, 31, 23, 0.16);
}

#device .drawer__profile {
  border-bottom: 1px solid rgba(29, 29, 31, 0.07);
  background: #fff;
}

#device .drawer__profile-name,
#device .drawer__top h3 {
  color: #1d1d1f;
  letter-spacing: 0;
}

#device .drawer__profile-sub {
  color: #85858a;
}

#device .drawer__profile > iconify-icon {
  color: #8e8e93;
}

#device .drawer__newbtn {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 6px;
  background: #f7f8f6;
  color: #515154;
  font-family: inherit;
  cursor: pointer;
}

#device .drawer__list {
  padding: 0 12px 28px;
}

#device .drawer__item {
  width: 100%;
  min-height: 56px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #1d1d1f;
  font-family: inherit;
  text-align: left;
}

#device .drawer__item:hover,
#device .drawer__item[aria-current='true'] {
  background: #f4f6f2;
}

#device .drawer__item-status {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0f2ef;
  color: #77777c;
}

#device .drawer__item-status iconify-icon {
  font-size: 17px;
}

#device .drawer__item[data-runtime-state='running'] .drawer__item-status {
  background: #eaf8e3;
  color: #3c9d19;
  animation: drawer-status-pulse 1.4s ease-in-out infinite;
}

#device .drawer__item[data-runtime-state='stopping'] .drawer__item-status {
  background: #fff6df;
  color: #9b6a00;
}

#device .drawer__item[data-runtime-state='stopped'] .drawer__item-status {
  background: #f0f0f1;
  color: #707075;
}

#device .drawer__item[data-runtime-state='failed'] .drawer__item-status {
  background: #fff0ee;
  color: #b42318;
}

#device .drawer__item-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

#device .drawer__item-t {
  display: block;
  overflow: hidden;
  color: #252527;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#device .drawer__item-sub {
  display: block;
  color: #8a8a8f;
  font-size: 11px;
  line-height: 1.3;
}

#device .drawer__state {
  min-height: 120px;
  padding: 24px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  color: #8a8a8f;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
}

#device .drawer__state--loading iconify-icon {
  font-size: 24px;
  animation: drawer-loading-spin 0.9s linear infinite;
}

#device .drawer__state--failed {
  color: #b42318;
}

@keyframes drawer-status-pulse {
  50% { opacity: 0.48; }
}

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

#device .attachment-target {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin: 0 0 8px;
  padding: 3px;
  border: 1px solid rgba(29, 29, 31, 0.07);
  border-radius: 8px;
  background: #f3f4f2;
}

#device .attachment-target__option {
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  color: #77777c;
  font-size: 12px;
  font-weight: 600;
}

#device .attachment-target__option iconify-icon {
  color: currentColor;
  font-size: 16px;
}

#device .attachment-target__option[aria-pressed='true'] {
  background: #fff;
  box-shadow: 0 1px 3px rgba(29, 29, 31, 0.08);
  color: #2f6f38;
}

#device .media-sources {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}

#device .media-source {
  min-width: 0;
  height: 72px;
  border-radius: 8px;
}

#device .media-source span {
  letter-spacing: 0;
}

#device .attach-strip {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 8px;
}

#device .attach-strip__group {
  width: 100%;
  min-width: 0;
}

#device .attach-strip__list {
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

#device .attach-strip__list::-webkit-scrollbar {
  display: none;
}

#device .attach-item {
  flex: 0 0 190px;
  width: 190px;
  height: 54px;
  padding: 7px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 7px;
  box-sizing: border-box;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 8px;
  background: #f7f8f6;
}

#device .attach-item[data-stage='ready'] {
  border-color: rgba(61, 151, 25, 0.2);
  background: #f3faef;
}

#device .attach-item[data-stage='extracted'],
#device .attach-item[data-stage='no_fact'] {
  border-color: rgba(61, 151, 25, 0.2);
  background: #f3faef;
}

#device .attach-item[data-stage='failed'] {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff4f2;
}

#device .attach-item__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e9ede6;
  color: #4f755e;
  font-size: 18px;
}

#device .attach-item[data-stage='failed'] .attach-item__icon,
#device .attach-item[data-stage='failed'] .attach-item__status {
  color: #b42318;
}

#device .attach-item__copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

#device .attach-item__name {
  overflow: hidden;
  color: #2b2b2d;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#device .attach-item__status {
  overflow: hidden;
  color: #77777c;
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#device .attach-item__rm {
  position: static;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: #77777c;
}

#device .attach-item__rm iconify-icon {
  color: currentColor;
  font-size: 17px;
}

#device .attach-strip__add {
  flex-basis: 46px;
  width: 46px;
  height: 54px;
  border-radius: 8px;
}

@media (max-width: 600px) {
  body:has(#device #toolsSheet[data-state='open']) .net-panel-trigger {
    opacity: 0;
    pointer-events: none;
  }

  /* Full-bleed phone layout: hide canvas demo chrome so it does not steal 100dvh. */
  body .mode-switch {
    display: none !important;
  }

  body .page-layout {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  body .device-col,
  body #device {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  body #device {
    flex: none;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body #device .screen {
    border-radius: 0;
  }
}

/* ── shadcn MessageScrollerButton 语义：跳到最新消息 ──
   仅在 chatting 且有未读时可见；data-active=false 时 inert + tabindex=-1，
   不占键盘顺序。水平居中、略放大，避免贴在输入栏右侧被忽略。 */
.msg-jump {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: calc(var(--tabbar-height, 98px) + 76px);
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid rgba(90, 196, 43, 0.55);
  border-radius: 50%;
  background: #ffffff;
  color: #1d1d1f;
  box-shadow:
    0 8px 22px rgba(26, 27, 37, 0.18),
    0 2px 6px rgba(90, 196, 43, 0.22);
  cursor: pointer;
  opacity: 0;
  transform: translateX(-50%) translateY(6px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.msg-jump iconify-icon {
  font-size: 22px;
  line-height: 1;
  color: inherit;
}

#scrollArea.chatting ~ .msg-jump {
  display: flex;
}

#scrollArea.chatting ~ .msg-jump[data-active="true"] {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

.msg-jump:focus-visible {
  outline: 2px solid var(--brand-accent, #7ae040);
  outline-offset: 2px;
}

.msg-jump:active {
  background: #f4fff0;
  box-shadow:
    0 4px 12px rgba(26, 27, 37, 0.14),
    0 1px 3px rgba(90, 196, 43, 0.2);
}

.industry-picker {
  max-height: 62vh;
}

.industry-picker__status {
  margin: 0 4px 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #6e6e73;
  background: #f5f5f7;
}

.industry-picker__status[data-tone='error'] {
  color: #b42318;
  background: #fff4f2;
  border: 1px solid rgba(180, 35, 24, 0.18);
}

.industry-picker__list {
  display: grid;
  gap: 8px;
  max-height: calc(62vh - 110px);
  overflow-y: auto;
  padding: 0 2px 8px;
}

.industry-picker__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 3px solid var(--industry-border, #5ac42b);
  border-radius: 12px;
  background: #fff;
  color: #1d1d1f;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.industry-picker__item:disabled {
  opacity: 0.55;
  cursor: wait;
}

.industry-picker__item:active:not(:disabled) {
  background: #f5f5f7;
}

.industry-picker__label {
  font-size: 15px;
  font-weight: 600;
}

.industry-picker__desc {
  font-size: 12px;
  line-height: 1.4;
  color: #6e6e73;
}

@media (prefers-reduced-motion: reduce) {
  .msg-jump {
    transition: none;
    transform: translateX(-50%);
  }

  #scrollArea.chatting ~ .msg-jump[data-active="true"] {
    transform: translateX(-50%);
  }
}
