:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #112138;
  background: #fcfcfa;
  font-synthesis: none;
  --green: #009a70;
  --mint: #dff8ed;
  --border: #e3e8e5;
  --muted: #7a8593;
  --amber: #d79220;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 15px;
}
button:disabled {
  opacity: 0.38;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #56cbaa;
  outline-offset: 4px;
}
button:not(:disabled):hover {
  background: #f0f8f4;
}
svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
header {
  height: 82px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 36px;
}
.brand {
  font-size: 28px;
  font-weight: 760;
  color: #102039;
  text-decoration: none;
  letter-spacing: -1.1px;
  white-space: nowrap;
}
.brand span {
  color: var(--green);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2.8px;
  color: #657284;
  font-weight: 600;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 25px;
}
.badge {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--green);
  background: var(--mint);
  border-radius: 30px;
  padding: 8px 13px;
  font-weight: 700;
}
.badge::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 7px;
}
#clock {
  font-variant-numeric: tabular-nums;
  font-size: 17px;
}
#details-toggle {
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: none;
  padding: 8px 0 8px 24px;
  font-size: 14px;
}
#details-toggle span {
  margin-left: 12px;
}
main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(170px, 1fr) auto auto;
  gap: 18px;
  padding: 0 30px 16px;
}
.intro h1 {
  font-size: clamp(20px, 2.15vw, 31px);
  margin: 4px 0 5px;
  letter-spacing: -0.9px;
}
.intro p {
  margin: 0;
  font-size: 15px;
  color: #73808e;
}
.workflow {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 24px 42px;
  background-color: #fff;
  background-image: radial-gradient(#dbe6de 0.8px, transparent 0.8px);
  background-size: 20px 20px;
  overflow: hidden;
}
.flow-grid {
  display: grid;
  grid-template-columns: 1.1fr 32px 1.1fr 32px 1.6fr 32px 1fr 32px 1fr 32px 0.95fr;
  align-items: center;
  position: relative;
  z-index: 1;
}
.flow-node {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 16px;
  border: 1px solid #dce2df;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 12px #16372906;
  transition:
    border-color 0.25s,
    box-shadow 0.25s,
    background 0.25s;
}
.flow-node > div {
  min-width: 0;
}
.flow-node strong {
  font-size: 16px;
  font-weight: 650;
  display: block;
  white-space: nowrap;
}
.flow-node small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.4;
}
.flow-node[data-state="passed"] {
  border-color: #6eddb5;
  box-shadow: 0 0 22px #11c38e16;
}
.flow-node[data-state="active"] {
  border-color: #27ca99;
  box-shadow:
    0 0 0 4px #35ce9e0c,
    0 0 26px #11c38e24;
}
.flow-node[data-state="active"] > svg {
  color: var(--green);
  animation: breathe 1.3s ease-in-out infinite;
}
.flow-node[data-state="waiting"] {
  border-color: #ebc278;
  background: #fffcf4;
}
.flow-node[data-state="waiting"] > svg {
  color: var(--amber);
}
.decision {
  display: block;
  padding: 18px 13px;
  min-height: 204px;
}
.decision-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.decision-title strong {
  font-size: 23px;
}
.decision-title small {
  font-size: 11px;
  margin-top: 3px;
}
.decision-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f6f8f7;
  border: 1px solid #ebefed;
  border-radius: 8px;
  margin-top: 7px;
  padding: 10px;
  font-size: 12px;
}
.decision-row strong {
  font-size: 10px;
  color: #7c8690;
  background: #e9edeb;
  padding: 4px 7px;
  border-radius: 5px;
  letter-spacing: 0.4px;
}
.decision-row[data-state="passed"] {
  border-color: #c0f0dd;
  background: #effcf6;
}
.decision-row[data-state="passed"] strong {
  color: var(--green);
  background: #d9f8ea;
}
.decision-row[data-state="waiting"] {
  border-color: #efdaab;
  background: #fffbef;
}
.decision-row[data-state="waiting"] strong {
  color: #956710;
  background: #fff0c9;
}
.connector {
  height: 2px;
  background: #d8e1db;
  position: relative;
}
.connector::before,
.connector::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  background: #d8e1db;
  border: 2px solid #fcfdfa;
  border-radius: 50%;
}
.connector::before {
  left: -4px;
}
.connector::after {
  right: -4px;
}
.connector[data-state="active"],
.connector[data-state="passed"] {
  background: #4fce9f;
}
.connector[data-state="active"]::before,
.connector[data-state="passed"]::before,
.connector[data-state="passed"]::after {
  background: #29c991;
}
.connector[data-state="active"]::after {
  background: #00b77e;
  box-shadow: 0 0 9px #1ac58e99;
  animation: flow 1.2s linear infinite;
}
.feedback {
  height: 70px;
  position: relative;
  margin-left: 43%;
  margin-right: 5%;
}
.return-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 24px;
  border: 1.5px dashed #bdc8c1;
  border-top: 0;
  border-radius: 0 0 32px 32px;
  color: #86968e;
}
.return-line::before {
  content: "↑";
  position: absolute;
  left: -6px;
  top: -11px;
}
.return-line span {
  position: absolute;
  left: 50%;
  top: 15px;
  transform: translateX(-50%);
  font-size: 11px;
  background: #fff;
  padding: 0 10px;
  white-space: nowrap;
}
.interrupt {
  top: 0;
  left: 14%;
  right: 4%;
}
.playback {
  top: 31px;
}
.return-line[data-state="active"] {
  border-color: #12b581;
  color: var(--green);
  animation: breathe 1.4s infinite;
}
.workflow-footer {
  position: absolute;
  bottom: 14px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #7a8593;
  gap: 12px;
}
.legend {
  display: flex;
  gap: 18px;
}
.legend span {
  white-space: nowrap;
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #9ea6ad;
  border-radius: 50%;
  margin-right: 7px;
}
.legend i.passed {
  background: #22c994;
}
.legend i.waiting {
  background: #edb13d;
}
#flow-status {
  text-align: right;
}
.current-turn {
  display: grid;
  gap: 10px;
}
.utterance {
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 15px 20px;
  min-width: 0;
}
.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: #e4f9ef;
  color: #008966;
}
.avatar.assistant {
  background: #eaf3ff;
  color: #1b3251;
}
.utterance-copy {
  flex: 1;
  min-width: 0;
}
.utterance h2 {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.7px;
  margin: 0 0 7px;
  color: #008966;
}
.utterance p {
  margin: 0;
  font-size: clamp(14px, 1.3vw, 19px);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
#unspoken {
  color: #929ba7;
}
#spoken {
  color: #14243a;
}
.utterance-state {
  font-size: 11px;
  color: var(--green);
  min-width: 65px;
  text-align: right;
}
.call-footer {
  text-align: center;
  position: relative;
}
.controls {
  display: inline-flex;
  gap: 20px;
  padding: 10px 16px;
  border-radius: 60px;
  background: white;
  box-shadow: 0 5px 25px #18352810;
  border: 1px solid #f0f2ef;
}
.icon-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  position: relative;
}
.icon-button.primary {
  color: white;
  background: var(--green);
  border-color: var(--green);
}
.icon-button.primary:not(:disabled):hover {
  background: #008560;
}
.icon-button.primary svg,
.danger svg {
  fill: currentColor;
}
.icon-button.danger {
  color: #ef6259;
  border-color: #ef6259;
}
.icon-button[aria-pressed="true"] {
  background: #eef1ef;
  color: #727f7a;
}
.slash {
  display: none;
  position: absolute;
  width: 28px;
  height: 2px;
  background: currentColor;
  transform: rotate(48deg);
  border-top: 2px solid #fff;
  box-sizing: content-box;
}
.icon-button[aria-pressed="true"] .slash {
  display: block;
}
#notice {
  font-size: 11px;
  color: #819087;
  margin: 9px 0 0;
}
#error {
  font-size: 12px;
  color: #ac403c;
  margin: 6px 0 0;
}
#error:empty {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(640px, 94vw);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100vw;
  margin: 0;
  border: 0;
  border-left: 1px solid var(--border);
  padding: 0;
  background: #fafcf9;
  color: inherit;
  box-shadow: -15px 0 60px #102c3217;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog::backdrop {
  background: #18312630;
  backdrop-filter: blur(3px);
}
.drawer-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px;
  border-bottom: 1px solid var(--border);
}
.drawer-heading h2 {
  margin: 8px 0 0;
}
.drawer-content {
  overflow: auto;
  padding: 22px;
  flex: 1;
}
.panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 16px;
}
.panel summary {
  font-weight: 650;
  cursor: pointer;
}
.panel p,
.panel small {
  font-size: 12px;
  line-height: 1.65;
  color: #69766f;
  overflow-wrap: anywhere;
}
.panel h3 {
  font-size: 13px;
}
.settings {
  display: grid;
  gap: 15px;
  margin-top: 20px;
}
.settings label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.settings textarea,
.settings select,
.settings input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fcfdfb;
  color: inherit;
}
.settings textarea {
  resize: vertical;
}
.settings p {
  margin: 0;
}
.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 15px;
}
.table-wrap {
  overflow: auto;
  max-height: 50vh;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
td,
th {
  text-align: left;
  padding: 9px 5px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
  max-width: 220px;
}
#history p {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  white-space: pre-wrap;
}
.build {
  font-size: 11px;
  color: var(--muted);
}
@keyframes flow {
  from {
    right: 90%;
  }
  to {
    right: -4px;
  }
}
@keyframes breathe {
  50% {
    opacity: 0.55;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 1100px) {
  header {
    padding: 0 22px;
    height: 68px;
  }
  .flow-grid {
    grid-template-columns: 1fr 17px 1fr 17px 1.45fr 17px 1fr 17px 1fr 17px 0.9fr;
  }
  .flow-node {
    padding: 12px 8px;
    gap: 7px;
  }
  .flow-node > svg {
    width: 22px;
  }
  .flow-node strong {
    font-size: 13px;
  }
  .flow-node small {
    font-size: 10px;
  }
  .decision-row {
    padding: 8px 6px;
    font-size: 11px;
  }
  .decision-title strong {
    font-size: 20px;
  }
  .workflow {
    padding-left: 16px;
    padding-right: 16px;
  }
  .header-right {
    gap: 15px;
  }
}
@media (max-height: 750px) {
  header {
    height: 62px;
  }
  main {
    gap: 11px;
    padding-bottom: 10px;
  }
  .intro h1 {
    font-size: 24px;
  }
  .intro p {
    font-size: 12px;
  }
  .workflow {
    padding-top: 12px;
    padding-bottom: 32px;
  }
  .decision {
    min-height: 165px;
    padding: 10px;
  }
  .decision-title {
    margin-bottom: 6px;
  }
  .decision-row {
    padding: 6px;
  }
  .feedback {
    height: 53px;
  }
  .playback {
    top: 25px;
  }
  .workflow-footer {
    bottom: 10px;
  }
  .utterance {
    padding: 10px 17px;
  }
  .avatar {
    width: 38px;
    height: 38px;
  }
  .icon-button {
    width: 44px;
    height: 44px;
  }
  .controls {
    padding: 7px 12px;
  }
  .utterance h2 {
    margin-bottom: 4px;
  }
}
@media (max-width: 700px) {
  header {
    height: 58px;
    padding: 0 16px;
    gap: 10px;
  }
  .brand {
    font-size: 23px;
  }
  header > .eyebrow {
    display: none;
  }
  .header-right {
    gap: 10px;
  }
  .badge {
    font-size: 9px;
    padding: 6px 8px;
  }
  #clock {
    font-size: 13px;
  }
  #details-toggle {
    font-size: 12px;
    padding-left: 10px;
  }
  main {
    padding: 0 12px 10px;
    gap: 10px;
  }
  .intro h1 {
    font-size: 23px;
  }
  .intro p {
    font-size: 11px;
  }
  .workflow {
    padding: 10px 12px 30px;
  }
  .flow-grid {
    grid-template-columns: 1fr 18px 1fr 18px 1.4fr;
    row-gap: 18px;
  }
  .flow-node {
    min-height: 59px;
  }
  .flow-node small {
    font-size: 9px;
  }
  .flow-node > svg {
    width: 20px;
  }
  .decision {
    min-height: 140px;
    grid-column: 5;
    grid-row: 1 / 4;
  }
  .decision-title {
    gap: 5px;
    margin-bottom: 7px;
  }
  .decision-title svg {
    width: 20px;
  }
  .decision-title strong {
    font-size: 18px;
  }
  .decision-row {
    font-size: 9px;
    padding: 6px 4px;
    gap: 2px;
  }
  .decision-row strong {
    font-size: 8px;
    padding: 3px;
  }
  .decision-title small {
    font-size: 9px;
  }
  #node-input {
    grid-column: 1;
    grid-row: 1;
  }
  #edge-input {
    grid-column: 2;
    grid-row: 1;
  }
  #node-asr {
    grid-column: 3;
    grid-row: 1;
  }
  #edge-asr {
    grid-column: 4;
    grid-row: 1;
  }
  #edge-decision {
    grid-column: 4;
    grid-row: 3;
    transform: rotate(180deg);
  }
  #node-llm {
    grid-column: 3;
    grid-row: 3;
  }
  #edge-llm {
    grid-column: 2;
    grid-row: 3;
    transform: rotate(180deg);
  }
  #node-tts {
    grid-column: 1;
    grid-row: 3;
  }
  #edge-tts {
    position: absolute;
    left: 15%;
    top: 77%;
    width: 18px;
    transform: rotate(90deg);
  }
  #node-output {
    grid-column: 1 / 4;
    grid-row: 5;
    justify-content: center;
    min-height: 45px;
  }
  #node-output small {
    display: inline-block;
    margin: 0 0 0 10px;
  }
  .feedback {
    position: absolute;
    left: 62%;
    right: 10%;
    bottom: 65px;
    margin: 0;
    height: 45px;
    width: auto;
  }
  .interrupt {
    display: none;
  }
  .playback {
    height: 44px;
    top: -20px;
    left: 0;
    right: 0;
    transform: rotate(180deg);
  }
  .return-line span {
    display: none;
  }
  .workflow-footer {
    left: 12px;
    right: 12px;
    font-size: 9px;
    bottom: 10px;
  }
  .legend {
    gap: 8px;
  }
  .legend i {
    margin-right: 4px;
    width: 6px;
    height: 6px;
  }
  #flow-status {
    max-width: 40%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .utterance {
    padding: 10px;
    gap: 10px;
  }
  .utterance-state {
    display: none;
  }
  .utterance p {
    font-size: 13px;
  }
  .avatar {
    width: 34px;
    height: 34px;
  }
  .avatar svg {
    width: 21px;
  }
  .current-turn {
    gap: 7px;
  }
  .icon-button {
    width: 46px;
    height: 46px;
  }
  .controls {
    gap: 15px;
    padding: 7px 12px;
  }
  #notice {
    font-size: 10px;
  }
  .utterance h2 {
    font-size: 9px;
    margin-bottom: 4px;
  }
}
.flow-node small {
  overflow-wrap: anywhere;
}
@media (min-width: 701px) and (max-width: 1000px) {
  .flow-node:not(.decision) {
    flex-direction: column;
    text-align: center;
    min-height: 110px;
    justify-content: center;
  }
  .flow-node strong {
    font-size: 12px;
  }
  .flow-node small {
    font-size: 9px;
  }
  .flow-node:not(.decision) > svg {
    width: 22px;
    height: 22px;
  }
  .flow-grid {
    grid-template-columns: 1fr 14px 1fr 14px 1.5fr 14px 1fr 14px 1fr 14px 1fr;
  }
}
@media (max-width: 700px) {
  .feedback {
    display: none;
  }
}
@media (max-width: 700px) and (max-height: 700px) {
  .intro h1 {
    font-size: 20px;
  }
  .flow-grid {
    row-gap: 10px;
  }
  .flow-node {
    min-height: 47px;
    padding: 8px 5px;
  }
  .decision {
    min-height: 126px;
  }
  .decision-row {
    padding: 4px;
  }
  .workflow {
    padding-top: 5px;
  }
  .utterance p {
    -webkit-line-clamp: 1;
  }
  .controls {
    padding: 5px 10px;
  }
  .icon-button {
    width: 40px;
    height: 40px;
  }
  header {
    height: 50px;
  }
}
