#komate-auto-demo {
  --demo-blue: #2f73ff;
  --demo-text: #20242b;
  --demo-muted: #7b8493;
  --demo-border: #e2e8f2;
  --demo-surface: #f7f9fc;
  container-type: inline-size;
  display: none;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  height: 0;
  left: 0;
  line-height: 1.5;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 0;
  z-index: 80;
}

#komate-auto-demo.is-ready {
  display: block;
}

#komate-auto-demo button {
  font-family: inherit;
}

.komate-demo-control {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  pointer-events: auto;
  position: absolute;
  right: calc(100% - var(--demo-sidebar-width, 40%) + clamp(16px, 2.15vw, 32px));
  top: calc(var(--demo-header-height, 56px) + 8px);
  z-index: 84;
}

.komate-demo-primary,
.komate-demo-story,
.komate-demo-sound,
.komate-demo-exit,
.komate-demo-step-button {
  align-items: center;
  border: 1px solid #d7e3f5;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  height: 32px;
  justify-content: center;
  padding: 0 8px;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.komate-demo-primary {
  background: #edf4ff;
  color: #2864ca;
}

.komate-demo-primary:hover {
  background: #e0edff;
  border-color: #afc9f4;
}

.komate-demo-primary:focus-visible,
.komate-demo-sound:focus-visible,
.komate-demo-exit:focus-visible,
.komate-demo-step-button:focus-visible {
  outline: 3px solid #2f73ff55;
  outline-offset: 2px;
}

.komate-demo-exit {
  background: #fff;
  color: #657187;
  display: none;
}

.komate-demo-exit:hover {
  background: #f1f5f9;
}

.komate-demo-sound {
  background: #fff;
  color: #2864ca;
}

.komate-demo-sound:hover {
  background: #edf4ff;
}

.komate-demo-sound[aria-pressed="false"] {
  background: #f1f5f9;
  color: #657187;
}

.komate-demo-message.is-speaking .komate-message-avatar {
  box-shadow: 0 0 0 3px #2f73ff24;
}

.komate-demo-control.is-active .komate-demo-exit {
  display: inline-flex;
}

.komate-demo-progress {
  background: #dbe5f7;
  border-radius: 999px;
  bottom: -4px;
  display: none;
  height: 2px;
  left: 3px;
  overflow: hidden;
  position: absolute;
  right: 3px;
}

.komate-demo-control.is-active .komate-demo-progress {
  display: block;
}

.komate-demo-progress span {
  background: #2f73ff;
  border-radius: inherit;
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
}

.komate-demo-chat,
.komate-demo-workbench {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  visibility: hidden;
}

#komate-auto-demo.is-active .komate-demo-chat,
#komate-auto-demo.is-active .komate-demo-workbench {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.komate-demo-chat {
  background: #fff;
  bottom: var(--demo-composer-height, 152px);
  display: flex;
  flex-direction: column;
  left: 0;
  padding: 1.35cqw 2.15cqw 1.05cqw;
  position: absolute;
  top: calc(var(--demo-header-height, 56px) + 48px);
  width: var(--demo-sidebar-width, 40%);
  z-index: 82;
}

@media (max-height: 700px) {
  .komate-demo-chat {
    padding-top: 0.6cqw;
    padding-bottom: 0.4cqw;
  }

  .komate-demo-chat .komate-demo-chat-header {
    margin-bottom: 0.5cqw;
    padding-bottom: 0.5cqw;
  }

  .komate-demo-chat .komate-demo-message {
    line-height: 1.6;
  }

  .komate-demo-chat .komate-demo-messages {
    gap: 0.8cqw;
  }
}

.komate-demo-chat-header {
  align-items: center;
  border-bottom: 1px solid #eef1f6;
  display: flex;
  flex: 0 0 auto;
  gap: 0.65cqw;
  margin-bottom: 0.95cqw;
  padding-bottom: 0.8cqw;
}

.komate-demo-chat-logo {
  align-items: center;
  background: linear-gradient(135deg, #135fe8, #54d4ee);
  border-radius: 8px;
  color: #fff;
  display: flex;
  font-size: clamp(14px, 1.25cqw, 18px);
  font-weight: 800;
  height: clamp(26px, 2.5cqw, 36px);
  justify-content: center;
  width: clamp(26px, 2.5cqw, 36px);
}

.komate-demo-chat-title {
  color: var(--demo-text);
  font-size: clamp(11px, 1.08cqw, 16px);
  font-weight: 700;
  line-height: 1.3;
}

.komate-demo-chat-subtitle {
  color: #8b94a4;
  font-size: 14px;
  margin-top: 0.08cqw;
}

.komate-demo-live {
  align-items: center;
  background: #eaf8ef;
  border-radius: 999px;
  color: #2d9b58;
  display: inline-flex;
  font-size: clamp(9px, 0.75cqw, 11px);
  gap: 0.35cqw;
  margin-left: auto;
  padding: 0.32cqw 0.62cqw;
}

.komate-demo-live::before {
  background: #35b868;
  border-radius: 50%;
  content: "";
  height: 0.42cqw;
  min-height: 5px;
  min-width: 5px;
  width: 0.42cqw;
}

.komate-demo-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1.35cqw;
  min-height: 0;
  overflow: hidden auto;
  padding: 0.2cqw 0.15cqw 0.85cqw;
  scrollbar-color: #d5dce8 transparent;
  scrollbar-width: thin;
}

.komate-demo-message {
  animation: komate-message-in 0.28s cubic-bezier(0.23, 1, 0.32, 1) both;
  align-items: start;
  color: #26364b;
  display: flex;
  flex-shrink: 0;
  font-size: clamp(12px, 1.1cqw, 16px);
  gap: 0.65cqw;
  line-height: 1.75;
  max-width: 95%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.komate-demo-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 85%;
}

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

.komate-message-avatar {
  align-items: center;
  background: linear-gradient(145deg, #2160e8, #24bace);
  border-radius: 0.8cqw;
  color: #fff;
  display: flex;
  flex: 0 0 auto;
  font-size: clamp(12px, 1.05cqw, 16px);
  font-weight: 750;
  height: clamp(26px, 2.35cqw, 34px);
  justify-content: center;
  margin-top: 1.85cqw;
  width: clamp(26px, 2.35cqw, 34px);
}

.komate-demo-message.user .komate-message-avatar {
  background: #e8edf5;
  border: 1px solid #d4ddeb;
  border-radius: 50%;
  color: #425570;
}

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

.komate-message-sender {
  align-items: center;
  color: #304c74;
  display: flex;
  font-size: clamp(10px, 0.85cqw, 13px);
  font-weight: 700;
  gap: 0.48cqw;
  margin-bottom: 0.4cqw;
}

.komate-demo-message.user .komate-message-sender {
  color: #657389;
  justify-content: flex-end;
}

.komate-message-ai-badge {
  background: #e5efff;
  border-radius: 0.3cqw;
  color: #2e62b2;
  font-size: clamp(9px, 0.68cqw, 11px);
  font-weight: 550;
  padding: 0.02cqw 0.4cqw;
}

.komate-message-bubble {
  background: #f1f6ff;
  border: 1px solid #dbe7fa;
  border-radius: 0.2cqw 1cqw 1cqw;
  padding: 0.85cqw 1cqw;
}

.komate-demo-message.user .komate-message-bubble {
  background: #2864d9;
  border-color: #2864d9;
  border-radius: 1cqw 0.2cqw 1cqw 1cqw;
  color: #fff;
  box-shadow: 0 0.28cqw 0.7cqw #2864d918;
}

.komate-demo-message strong {
  color: #235fdd;
  font-weight: 700;
}

.komate-demo-message .demo-message-label {
  color: #245eaf;
  display: block;
  font-size: clamp(11px, 0.92cqw, 14px);
  font-weight: 700;
  margin-bottom: 0.45cqw;
}

.komate-demo-message.is-soft-notice {
  max-width: 95%;
}

.is-soft-notice .komate-message-bubble {
  background: #fffaf0;
  border: 1px solid #eddfc1;
  border-left: 3px solid #d4b574;
  border-radius: 10px;
  padding: 10px 14px;
}

.demo-notice-heading {
  align-items: center;
  color: #806b47;
  display: flex;
  font-size: 11px;
  font-weight: 600;
  gap: 5px;
  margin-bottom: 5px;
}

.demo-notice-icon {
  align-items: center;
  background: #f5ecd8;
  border-radius: 5px;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.demo-notice-icon svg {
  height: 13px;
  width: 13px;
}

.komate-demo-message .demo-notice-title {
  color: #604f32;
  display: block;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
}

.demo-notice-detail {
  color: #766850;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.komate-demo-message ul {
  display: grid;
  gap: 0.22cqw;
  margin-top: 0.35cqw;
}

.komate-demo-message li {
  padding-left: 0.95cqw;
  position: relative;
}

.komate-demo-message li::before {
  color: #5d8df5;
  content: "•";
  left: 0.2cqw;
  position: absolute;
}

.komate-demo-typing {
  align-items: center;
  color: #9aa3b1;
  display: flex;
  flex-shrink: 0;
  font-size: 14px;
  gap: 0.28cqw;
  padding: 0.25cqw 0 0.25cqw 3cqw;
}

.komate-demo-typing i {
  animation: komate-typing 0.7s ease-in-out infinite alternate;
  background: #7d899a;
  border-radius: 50%;
  height: 0.34cqw;
  min-height: 4px;
  min-width: 4px;
  width: 0.34cqw;
}

.komate-demo-typing i:nth-child(2) {
  animation-delay: 0.14s;
}

.komate-demo-typing i:nth-child(3) {
  animation-delay: 0.28s;
}

.komate-demo-typing span {
  margin-left: 0.25cqw;
}

@keyframes komate-message-in {
  from {
    opacity: 0;
    transform: translateY(0.42cqw);
  }
}

@keyframes komate-typing {
  to {
    opacity: 0.35;
    transform: translateY(-0.15cqw);
  }
}

.komate-demo-workbench {
  background: #f7f9fc;
  bottom: 0;
  display: flex;
  flex-direction: column;
  left: var(--demo-sidebar-width, 40%);
  min-width: 0;
  overflow: hidden;
  padding: clamp(12px, 1.1cqw, 18px) clamp(14px, 1.4cqw, 24px) 12px;
  position: absolute;
  right: 0;
  top: var(--demo-header-height, 56px);
  z-index: 81;
}

.komate-demo-navigation {
  align-items: center;
  background: #fff;
  border: 1px solid #d7e3f5;
  border-radius: 8px;
  box-sizing: border-box;
  display: none;
  flex-shrink: 0;
  height: 32px;
  padding: 2px;
}

.komate-demo-control.is-active .komate-demo-navigation {
  display: inline-flex;
}

.komate-demo-step-button {
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: #2864ca;
  gap: 4px;
  height: 26px;
  padding: 0 7px;
}

.komate-demo-step-button:hover:not(:disabled) {
  background: #edf4ff;
  border-color: #afc9f4;
}

.komate-demo-step-button:disabled {
  background: transparent;
  color: #99a3b2;
  cursor: default;
}

.komate-demo-step-counter {
  border-left: 1px solid #e8edf5;
  border-right: 1px solid #e8edf5;
  color: #657187;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  min-width: 42px;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .komate-demo-nav-arrow {
    display: none;
  }
}

@media (max-width: 900px) {
  .komate-demo-control.is-active {
    gap: 4px;
    justify-content: center;
    left: 10px;
    right: 10px;
  }

  .komate-demo-workbench {
    top: calc(var(--demo-header-height, 56px) + 48px);
  }

  .komate-demo-control.is-active button {
    padding-left: 6px;
    padding-right: 6px;
  }
}

.demo-workbench-head {
  align-items: flex-start;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.demo-workbench-kicker {
  color: #3775ee;
  font-size: 11px;
  font-weight: 650;
  margin-bottom: 0.18cqw;
}

.demo-workbench-title {
  color: #172033;
  font-size: clamp(16px, 1.52cqw, 23px);
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.28;
}

.demo-workbench-title span {
  color: #7c8594;
  font-size: clamp(10px, 0.9cqw, 14px);
  font-weight: 500;
  margin-left: 0.55cqw;
}

.demo-status-pill {
  align-items: center;
  background: #e9f1ff;
  border: 1px solid #d7e5ff;
  border-radius: 999px;
  color: #2f73ff;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 650;
  gap: 0.38cqw;
  padding: 4px 9px;
}

.demo-status-pill::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 0.42cqw;
  min-height: 5px;
  min-width: 5px;
  width: 0.42cqw;
}

.demo-context-strip {
  background: #e8efff;
  border-radius: 8px;
  color: #5e6878;
  display: block;
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 10px;
  padding: 5px 10px;
}

.demo-context-strip strong {
  color: #303846;
}

.demo-workbench-body {
  animation: komate-panel-in 0.32s cubic-bezier(0.23, 1, 0.32, 1) both;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}

@keyframes komate-panel-in {
  from {
    opacity: 0;
    transform: translateY(0.45cqw);
  }
}

.demo-loading-grid {
  display: grid;
  gap: 0.9cqw;
  grid-template-columns: 1fr 1fr;
}

.demo-skeleton {
  background: linear-gradient(100deg, #edf1f7 15%, #f8fafe 35%, #edf1f7 55%) 0 0 / 220% 100%;
  border-radius: 1cqw;
  height: 8.5cqw;
  animation: komate-scan 1.1s ease-in-out infinite;
}

.demo-skeleton.wide {
  grid-column: 1 / -1;
  height: 18cqw;
}

@keyframes komate-scan {
  to {
    background-position: -120% 0;
  }
}

.demo-metric-row {
  display: grid;
  gap: 0.8cqw;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0.9cqw;
}

.demo-metric {
  background: #fff;
  border: 1px solid var(--demo-border);
  border-radius: 0.9cqw;
  padding: 0.75cqw 0.9cqw;
}

.demo-metric label {
  color: #8b94a2;
  display: block;
  font-size: 12px;
  margin-bottom: 0.12cqw;
}

.demo-metric strong {
  color: #263142;
  font-size: clamp(13px, 1.28cqw, 20px);
  font-weight: 720;
}

.demo-metric strong em {
  color: #35a86a;
  font-size: 12px;
  font-style: normal;
  margin-left: 0.3cqw;
}

.demo-timeline {
  background: #fff;
  border: 1px solid var(--demo-border);
  border-radius: 1cqw;
  padding: 0.9cqw 1.15cqw;
}

.demo-section-title {
  align-items: center;
  color: #273142;
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
  gap: 3px 8px;
  justify-content: space-between;
  margin-bottom: 0.55cqw;
}

.demo-section-title small {
  color: #939baa;
  font-size: 11px;
  font-weight: 500;
}

.demo-timeline-item {
  border-left: 2px solid #dbe7fb;
  display: grid;
  gap: 0.7cqw;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  margin-left: 0.45cqw;
  min-height: 4cqw;
  padding: 8px 0 8px 14px;
  position: relative;
}

.demo-timeline-item::before {
  background: #fff;
  border: 0.24cqw solid #4f86f5;
  border-radius: 50%;
  content: "";
  height: 0.62cqw;
  left: -0.42cqw;
  position: absolute;
  top: 0.85cqw;
  width: 0.62cqw;
}

.demo-timeline-item.pending::before {
  border-color: #c6ceda;
}

.demo-timeline-day {
  color: #2f73ff;
  font-size: 12px;
  font-weight: 720;
}

.demo-timeline-content strong {
  color: #333b48;
  display: block;
  font-size: clamp(12px, 0.95cqw, 14px);
  margin-bottom: 0.08cqw;
}

.demo-timeline-content p,
.demo-timeline-source {
  color: #7c8593;
  font-size: 12px;
}

.demo-timeline-source {
  align-self: start;
  background: #f1f5fa;
  border-radius: 999px;
  font-size: 11px;
  justify-self: end;
  padding: 0.25cqw 0.42cqw;
  text-align: center;
}

.demo-analysis-grid {
  display: grid;
  gap: 0.78cqw;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.demo-analysis-card,
.demo-draft-card,
.demo-publish-card,
.demo-stat-panel {
  background: #fff;
  border: 1px solid var(--demo-border);
  border-radius: 1cqw;
  box-shadow: 0 0.35cqw 1.1cqw #243b6408;
}

.demo-analysis-card {
  min-height: 20.5cqw;
  padding: 1cqw;
}

.demo-analysis-card.fact {
  border-top: 0.32cqw solid #4f87f6;
}

.demo-analysis-card.ai {
  border-top: 0.32cqw solid #8a63ee;
}

.demo-analysis-card.pending {
  border-top: 0.32cqw solid #f0ad45;
}

.demo-card-eyebrow {
  color: #8690a0;
  font-size: 11px;
  margin-bottom: 0.28cqw;
}

.demo-analysis-card h3,
.demo-draft-card h3,
.demo-publish-card h3 {
  color: #273142;
  font-size: clamp(14px, 1.05cqw, 16px);
  font-weight: 720;
  margin-bottom: 0.75cqw;
}

.demo-analysis-card li,
.demo-draft-card li,
.demo-publish-card li {
  color: #5f6978;
  font-size: clamp(12px, 0.95cqw, 14px);
  line-height: 1.65;
  margin: 0 0 8px;
  padding-left: 14px;
  position: relative;
}

.demo-analysis-card li::before,
.demo-draft-card li::before,
.demo-publish-card li::before {
  background: #d8e4fb;
  border-radius: 50%;
  content: "";
  height: 0.38cqw;
  left: 0.18cqw;
  position: absolute;
  top: 0.48cqw;
  width: 0.38cqw;
}

.demo-review-badge {
  align-items: center;
  background: #fff5df;
  border-radius: 999px;
  color: #b87716;
  display: inline-flex;
  font-size: 11px;
  font-weight: 650;
  gap: 0.28cqw;
  margin-top: 0.45cqw;
  padding: 0.32cqw 0.55cqw;
}

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

.demo-clinical-metrics > div {
  background: #edf3ff;
  border: 1px solid #dce7fb;
  border-radius: 10px;
  padding: 7px 10px;
}

.demo-clinical-metrics span,
.demo-clinical-metrics small {
  color: #728098;
  display: block;
  font-size: 11px;
  line-height: 1.45;
}

.demo-clinical-metrics strong {
  color: #2864ca;
  display: block;
  font-size: clamp(16px, 1.45cqw, 21px);
  margin: 2px 0;
}

.demo-clinical-grid {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.demo-clinical-grid.record-review {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.demo-clinical-card {
  background: #fff;
  border: 1px solid var(--demo-border);
  border-radius: 12px;
  min-width: 0;
  padding: clamp(9px, 0.8cqw, 13px);
}

.demo-clinical-card.interpretation {
  border-top: 3px solid #8a63ee;
}

.demo-clinical-source {
  color: #7e899b;
  font-size: 10px;
  margin-bottom: 3px;
}

.demo-clinical-card h3,
.demo-clinical-followup h3 {
  color: #26344d;
  font-size: clamp(14px, 1.05cqw, 16px);
  font-weight: 700;
  margin-bottom: 7px;
}

.demo-clinical-card p,
.demo-clinical-card dd,
.demo-clinical-followup p {
  color: #59667b;
  font-size: clamp(12px, 0.95cqw, 14px);
  line-height: 1.5;
}

.demo-record-fields {
  margin: 0;
}

.demo-record-fields > div {
  border-top: 1px solid #edf1f6;
  display: grid;
  font-size: 12px;
  gap: 8px;
  grid-template-columns: 2em minmax(0, 1fr);
  padding: 6px 0;
}

.record-review .demo-record-fields > div {
  grid-template-columns: 4em minmax(0, 1fr);
}

.demo-record-fields > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.demo-record-fields > div:last-child {
  padding-bottom: 0;
}

.demo-record-fields dt {
  color: #7b8699;
  font-size: 12px;
  line-height: 1.5;
}

.demo-record-fields dd {
  margin: 0;
}

.demo-clinical-point + .demo-clinical-point {
  border-top: 1px solid #edf1f6;
  margin-top: 6px;
  padding-top: 6px;
}

.demo-clinical-point h4 {
  color: #405578;
  font-size: clamp(12px, 0.95cqw, 14px);
  font-weight: 650;
  margin-bottom: 2px;
}

.demo-clinical-followup {
  background: #fff9ed;
  border: 1px solid #f0dfbc;
  border-radius: 12px;
  margin-top: 8px;
  padding: 9px 11px;
}

.demo-clinical-checks {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.demo-clinical-checks strong {
  color: #8b6426;
  margin-right: 5px;
}

.demo-clinical-followup .demo-clinical-caution {
  border-top: 1px solid #f0dfbc;
  color: #8b6426;
  font-size: 11px;
  margin-top: 6px;
  padding-top: 6px;
}

.demo-record-summary-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.demo-record-loading {
  color: #59667b;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.demo-record-loading strong {
  color: #2864ca;
  display: block;
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  .demo-clinical-grid,
  .demo-clinical-grid.record-review,
  .demo-clinical-checks {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .demo-clinical-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-record-fields > div,
  .record-review .demo-record-fields > div {
    gap: 3px;
    grid-template-columns: minmax(0, 1fr);
  }
}

.demo-stat-grid {
  display: grid;
  gap: 0.9cqw;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
}

.demo-stat-panel {
  min-width: 0;
  padding: clamp(12px, 1cqw, 16px);
}

.demo-funnel {
  align-items: stretch;
  display: grid;
  gap: 0.42cqw;
  grid-template-columns: 1fr 0.88fr 0.72fr;
  margin-top: 1cqw;
}

.demo-funnel-step {
  align-items: center;
  background: #edf3ff;
  border: 1px solid #dce8ff;
  border-radius: 0.8cqw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(88px, 8cqw, 116px);
  padding: 0.7cqw;
  position: relative;
  text-align: center;
}

.demo-funnel-step:nth-child(2) {
  background: #f0efff;
  border-color: #e3defe;
}

.demo-funnel-step:nth-child(3) {
  background: #eaf8f0;
  border-color: #d4efdf;
}

.demo-funnel-step strong {
  color: #265fd6;
  font-size: clamp(16px, 1.8cqw, 27px);
  line-height: 1.2;
}

.demo-funnel-step:nth-child(2) strong {
  color: #7459d7;
}

.demo-funnel-step:nth-child(3) strong {
  color: #2d9d61;
}

.demo-funnel-step span {
  color: #6e7888;
  font-size: 12px;
  margin-top: 0.2cqw;
}

.demo-bar-list {
  display: grid;
  gap: 0.72cqw;
  margin-top: 0.75cqw;
}

.demo-bar-row {
  display: grid;
  gap: 0.45cqw;
  grid-template-columns: 7em minmax(0, 1fr) 2ch;
  font-size: 12px;
  align-items: center;
}

.demo-bar-row label,
.demo-bar-row strong {
  color: #667080;
  font-size: 12px;
}

.demo-bar-track {
  background: #edf1f6;
  border-radius: 999px;
  height: 0.55cqw;
  overflow: hidden;
}

.demo-bar-track span {
  background: linear-gradient(90deg, #5d8ef3, #80a9fb);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.demo-insight-note {
  background: #f1f6ff;
  border-left: 0.28cqw solid #4f83ed;
  border-radius: 0.6cqw;
  color: #4f5e73;
  font-size: 12px;
  line-height: 1.55;
  margin-top: 0.9cqw;
  padding: 0.68cqw 0.8cqw;
}

.demo-draft-grid {
  display: grid;
  gap: 0.85cqw;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.demo-draft-card {
  min-width: 0;
  padding: clamp(12px, 1cqw, 16px);
}

.demo-draft-card.care h3 {
  color: #2d70eb;
}

.demo-draft-card.medical h3 {
  color: #7d5bd6;
}

.demo-ai-warning {
  align-items: center;
  background: #fff7e6;
  border: 1px solid #f4dfaf;
  border-radius: 0.7cqw;
  color: #a16a14;
  display: flex;
  font-size: 12px;
  gap: 0.45cqw;
  margin-top: 0.7cqw;
  padding: 0.55cqw 0.68cqw;
}

.demo-confirm-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--demo-border);
  border-radius: 0.8cqw;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 0.85cqw;
  padding: 0.62cqw 0.8cqw;
}

.demo-confirm-row span {
  color: #7b8594;
  font-size: 12px;
}

.demo-confirm-row strong {
  background: #2f73ff;
  border-radius: 0.55cqw;
  color: #fff;
  flex-shrink: 0;
  font-size: 12px;
  padding: 0.42cqw 0.7cqw;
}

.demo-publish-grid {
  display: grid;
  gap: 0.85cqw;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.demo-publish-card {
  min-width: 0;
  padding: clamp(12px, 1cqw, 16px);
}

.demo-publish-card li.done::before {
  background: #35b46b;
  box-shadow: 0 0 0 0.2cqw #e2f6ea;
}

.demo-patient-message {
  background: #eef5ff;
  border-radius: 0.9cqw;
  color: #34425a;
  font-size: clamp(12px, 0.95cqw, 14px);
  line-height: 1.6;
  margin-top: 0.85cqw;
  padding: 0.9cqw;
}

.demo-patient-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55cqw;
  margin-top: 0.7cqw;
}

.demo-patient-actions span {
  border: 1px solid #d8e2f0;
  border-radius: 0.58cqw;
  color: #647084;
  font-size: 12px;
  padding: 0.38cqw 0.62cqw;
}

.demo-patient-actions span:first-child {
  background: #2f73ff;
  border-color: #2f73ff;
  color: #fff;
}

.demo-complete {
  align-items: center;
  background: #fff;
  border: 1px solid var(--demo-border);
  border-radius: 1cqw;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3cqw, 48px) 18px;
  text-align: center;
}

.demo-complete-icon {
  align-items: center;
  background: #35ba6f;
  border: 0.55cqw solid #dcf8e8;
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 2cqw;
  font-weight: 800;
  height: 4.4cqw;
  justify-content: center;
  width: 4.4cqw;
}

.demo-complete h3 {
  color: #243044;
  font-size: clamp(15px, 1.4cqw, 22px);
  font-weight: 720;
  margin: 0.8cqw 0 0.25cqw;
}

.demo-complete p {
  color: #7c8696;
  font-size: clamp(12px, 0.95cqw, 14px);
}

.demo-flow-status {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 1.35cqw;
}

.demo-flow-status span {
  align-items: center;
  color: #657185;
  display: flex;
  font-size: 11px;
  gap: 0.35cqw;
}

.demo-flow-status span::after {
  color: #b7bfcb;
  content: "→";
}

.demo-flow-status span:last-child::after {
  content: "";
}

@media (max-width: 680px) {
  .demo-analysis-card,
  .demo-draft-card,
  .demo-publish-card,
  .demo-stat-panel {
    box-shadow: none;
  }
}

@media (max-width: 900px) {
  .demo-stat-grid,
  .demo-draft-grid,
  .demo-publish-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-timeline-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .demo-timeline-source {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .demo-metric-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  #komate-auto-demo *,
  #komate-auto-demo *::before,
  #komate-auto-demo *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* 單一醫師工作台：病程日期與資料來源分開呈現。 */
.demo-case-timebar {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-bottom: 8px;
}

.demo-case-timeline {
  align-items: center;
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.demo-case-node {
  align-items: center;
  color: #8b96a8;
  display: flex;
  font-size: 11px;
  gap: 5px;
}

.demo-case-node + .demo-case-node::before {
  background: #dce4f0;
  content: "";
  height: 1px;
  width: clamp(8px, 1.3cqw, 20px);
}

.demo-case-node b {
  background: #eaf0f8;
  border: 1px solid #dde5f0;
  border-radius: 5px;
  font-size: 11px;
  padding: 2px 5px;
}

.demo-case-node.is-current { color: #2864ca; font-weight: 650; }
.demo-case-node.is-current b { background: #2f73ff; border-color: #2f73ff; color: #fff; }
.demo-case-node.is-past { color: #6682ac; }
.demo-record-day { color: #9c6a24; font-size: 11px; margin-left: auto; }

.demo-symptom-chips, .demo-source-legend, .demo-capture-status, .demo-cycle-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.demo-symptom-chips { margin: 8px 0; }
.demo-symptom-chips span { background: #eef7f3; border: 1px solid #dcece5; border-radius: 6px; color: #397d64; font-size: 12px; padding: 4px 6px; }
.demo-source-legend { margin-bottom: 8px; }
.demo-source-legend span { border-radius: 4px; font-size: 11px; padding: 2px 7px; }
.demo-source-legend .previsit { color: #2864ca; background: #edf3ff; }
.demo-source-legend .capture { color: #26775c; background: #e9f6ee; }
.demo-source-legend .visit { color: #a36718; background: #fff1dc; }
.demo-updated-text { background: #fff0d8; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.demo-capture-status { background: #edf7f3; border: 1px solid #d9ede3; border-radius: 8px; color: #357a62; font-size: 12px; gap: 8px 14px; margin-bottom: 10px; padding: 9px 12px; }
.demo-capture-status small { color: #779085; font-size: 11px; margin-left: auto; }
.demo-diagnosis-line { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
.demo-diagnosis-line strong { color: #31558a; font-size: 16px; }
.demo-diagnosis-line span { border: 1px solid #e2dcf8; background: #f5f1fe; border-radius: 6px; color: #7652b4; font-size: 12px; padding: 3px 8px; }
.demo-followup-summary { margin-top: 8px; }
.demo-plan-grid { grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr); }
.demo-plan-clinical { display: grid; gap: 8px; min-width: 0; }
.demo-plan-grid .demo-clinical-card p,
.demo-plan-grid .demo-clinical-card dd { font-size: 12px; line-height: 1.5; }
.demo-plan-grid .demo-record-fields > div { gap: 7px; grid-template-columns: 2em minmax(0, 1fr); padding: 5px 0; }
.demo-prescription-title { color: #405578; font-size: 12px; font-weight: 650; margin: 0 0 7px; }
.demo-prescription-list { display: grid; gap: 4px 9px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.demo-prescription-list > div { align-items: baseline; border-bottom: 1px solid #edf1f6; display: flex; gap: 4px; justify-content: space-between; min-width: 0; padding: 3px 0; }
.demo-prescription-list dt { color: #59667b; font-size: 12px; line-height: 1.5; }
.demo-prescription-list dd { color: #31558a; flex-shrink: 0; font-variant-numeric: tabular-nums; font-weight: 650; margin: 0; white-space: nowrap; }
.demo-prescription-list dd span { font-weight: 400; margin-left: 2px; }
.demo-prescription-use { background: #f1f6ff; border-radius: 6px; margin: 9px 0; padding: 6px 8px; }
.demo-prescription-use strong { color: #405578; font-weight: 650; }
.demo-prescription-use p { margin: 0; }
.demo-comparison-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.demo-comparison-grid .demo-record-fields > div { grid-template-columns: 3em minmax(0, 1fr); }
.demo-composite-score { align-items: center; background: #eef3ff; border-radius: 8px; display: flex; gap: 10px; margin-top: 10px; padding: 8px 10px; }
.demo-composite-score strong { color: #3470d8; font-size: 27px; line-height: 1.3; }
.demo-composite-score span { color: #687b98; font-size: 11px; }
.demo-score-table { border-collapse: collapse; font-size: 12px; line-height: 1.5; table-layout: fixed; text-align: left; width: 100%; }
.demo-score-table caption { color: #71809a; font-size: 11px; padding-bottom: 6px; text-align: left; }
.demo-score-table th, .demo-score-table td { border-bottom: 1px solid #e7edf6; color: #576982; overflow-wrap: anywhere; padding: 9px 7px; vertical-align: top; }
.demo-score-table thead th { background: #f3f6fc; color: #60718a; font-size: 11px; font-weight: 500; }
.demo-score-table th:first-child { width: 24%; }
.demo-score-table th:last-child { width: 29%; }
.demo-score-table tbody th { color: #354a68; font-weight: 600; }
.demo-score-table .needs-review { background: #fff9ed; }
.demo-score-table .needs-review td:last-child { color: #956723; }
.demo-cycle-summary { background: #eaf7f1; border: 1px solid #d2eade; border-radius: 8px; color: #36785d; font-size: 11px; justify-content: space-between; margin-top: 10px; padding: 9px 12px; }
.demo-dictation { align-items: center; background: #eff4ff; border: 1px solid #dce7fc; border-radius: 10px; color: #466187; display: flex; gap: 14px; margin-bottom: 12px; padding: 14px; }
.demo-dictation strong { font-size: 13px; }
.demo-dictation p { font-size: 12px; line-height: 1.65; margin-top: 6px; }
.demo-dictation-wave { align-items: center; display: flex; flex-shrink: 0; gap: 3px; height: 35px; }
.demo-dictation-wave i { background: #6496f5; border-radius: 3px; height: 12px; width: 4px; }
.demo-dictation-wave i:nth-child(2n) { height: 25px; }
.demo-dictation-wave i:nth-child(3) { height: 35px; }

.demo-day-transition {
  align-items: center;
  background: radial-gradient(ellipse at 50% 30%, #e5edff, #f7f9fc 75%);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: absolute;
  z-index: 5;
}
.is-day-transitioning > .demo-workbench-body { opacity: 0; }
.demo-day-transition-card { color: #273f69; max-width: 520px; text-align: center; width: 100%; }
.demo-day-transition-kicker { color: #6481af; font-size: 13px; letter-spacing: 0.14em; }
.demo-day-transition-number { color: #2f73ff; font-size: clamp(64px, 7cqw, 104px); font-weight: 750; letter-spacing: -0.05em; line-height: 1.1; margin: 14px 0 10px; }
.demo-day-transition h2 { font-size: clamp(22px, 2.2cqw, 32px); font-weight: 700; margin: 0 0 8px; }
.demo-day-transition p { color: #7184a2; font-size: 14px; }
.demo-day-track { display: flex; justify-content: space-between; margin: 30px auto 20px; padding-top: 16px; position: relative; width: 90%; }
.demo-day-track-line { background: #d7e3f8; height: 3px; left: 10%; position: absolute; right: 10%; top: 0; }
.demo-day-track span { color: #8d9bb0; display: flex; flex-direction: column; font-size: 14px; gap: 4px; width: 25%; }
.demo-day-track small { font-size: 11px; }
.demo-day-track .is-destination { color: #2f73ff; }
.demo-day-traveller { background: #2f73ff; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 5px #2f73ff1c, 0 0 20px #2f73ff44; height: 15px; left: calc(10% + 80% * var(--day-position)); position: absolute; top: -6px; transform: translateX(-50%); width: 15px; }
.demo-day-transition-progress { background: #e1e9f7; border-radius: 99px; height: 3px; margin: 0 auto; overflow: hidden; width: 80px; }
.demo-day-transition-progress span { background: #2f73ff; display: block; height: 100%; transform: scaleX(var(--day-progress)); transform-origin: left; }

@media (max-width: 1100px) {
  .demo-comparison-grid .demo-score-table th, .demo-comparison-grid .demo-score-table td { padding: 7px 4px; }
}
@media (max-width: 900px) {
  .demo-plan-grid, .demo-comparison-grid { grid-template-columns: minmax(0, 1fr); }
  .demo-prescription-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-case-timebar { gap: 6px; }
  .demo-case-node span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-day-traveller { left: 50%; }
}

/* 小視窗以原生縱向分區呈現對話和工作台，保留獨立捲動。 */
@media (max-width: 760px) {
  #komate-auto-demo.is-active {
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
  }
  .komate-demo-control {
    top: calc(var(--demo-header-height, 52px) + 8px);
    left: 10px;
    right: 10px;
    justify-content: flex-end;
    gap: 4px;
  }
  .komate-demo-control.is-active { justify-content: center; }
  .komate-demo-chat {
    top: calc(var(--demo-header-height, 52px) + 48px);
    height: 26dvh;
    bottom: auto;
    width: 100%;
    padding: 8px 16px 10px;
    border-bottom: 1px solid #e6edf7;
  }
  .komate-demo-chat-header { margin-bottom: 7px; padding-bottom: 7px; }
  .komate-demo-chat-header { gap: 8px; }
  .komate-demo-chat-subtitle { font-size: 11px; margin-top: 3px; }
  .komate-demo-live { gap: 4px; padding: 3px 6px; }
  .komate-demo-messages { gap: 10px; }
  .komate-demo-message { gap: 7px; }
  .komate-message-avatar { margin-top: 20px; border-radius: 7px; }
  .komate-message-sender { gap: 5px; margin-bottom: 4px; }
  .komate-message-bubble { padding: 9px 11px; border-radius: 0 10px 10px; }
  .komate-demo-message.user .komate-message-bubble { border-radius: 10px 0 10px 10px; }
  .komate-demo-workbench {
    left: 0;
    top: calc(var(--demo-header-height, 52px) + 48px + 26dvh);
    padding: 12px 14px;
  }
  .demo-workbench-head { gap: 7px; }
  .demo-workbench-title { font-size: 16px; }
  .demo-status-pill { font-size: 10px; padding: 3px 6px; }
  .demo-workbench-kicker { font-size: 10px; }
  .demo-context-strip { font-size: 10px; padding: 5px 7px; }
  .demo-clinical-grid,
  .demo-clinical-grid.record-review { grid-template-columns: minmax(0,1fr); }
  .demo-clinical-metrics { gap: 5px; }
  .demo-clinical-metrics > div { padding: 6px; }
  .demo-confirm-row { flex-wrap: wrap; gap: 7px; padding: 8px; }
  .demo-confirm-row strong { margin-left: auto; }
  .demo-day-transition { padding: 14px; }
  .demo-day-transition-number { font-size: 48px; margin: 5px 0; }
  .demo-day-transition h2 { font-size: 18px; }
  .demo-day-transition p { font-size: 11px; }
  .demo-day-track { margin: 18px auto 12px; }
}
