.agent-state-machine {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 240px;
  align-items: stretch;
  max-width: 1080px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.input-channels,
.product-ux-layer {
  padding: 1rem 1.1rem;
}

.input-channels { border-right: 1px solid var(--line); }
.product-ux-layer { border-left: 1px solid var(--line); }

.input-channels > p,
.product-ux-layer > p {
  margin: 0 0 .65rem;
  color: var(--accent);
  font-family: Inter, "Pretendard Variable", sans-serif;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.input-channels div,
.product-ux-layer div {
  display: grid;
  gap: .12rem;
  padding: .56rem 0;
  border-top: 1px solid var(--line);
}

.input-channels b,
.product-ux-layer b {
  color: var(--accent);
  font-family: Inter, "Pretendard Variable", sans-serif;
  font-size: .63rem;
  letter-spacing: .08em;
}

.input-channels span,
.product-ux-layer span {
  color: var(--muted);
  font-size: .72rem;
}

.state-flow {
  padding: .8rem 2rem .75rem;
}

.state-flow .request-bubble {
  display: table;
  margin: 0 auto .45rem;
  padding: .45rem .75rem;
  background: var(--dark);
  color: #fff;
  font-size: .77rem;
  font-weight: 700;
}

.state-flow ol {
  display: grid;
  grid-template-columns: minmax(0, 420px);
  justify-content: center;
  gap: .26rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.state-flow li {
  position: relative;
  display: grid;
  grid-template-columns: 148px 1fr;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
}

.state-flow li:not(:last-child)::after {
  content: '↓';
  position: absolute;
  z-index: 1;
  right: 50%;
  bottom: -.9rem;
  transform: translateX(50%);
  color: var(--accent);
  font-size: .78rem;
}

.state-flow li.critical { border-color: #91a3bb; background: #eef3f8; }
.state-flow li.result { border-color: var(--accent); }

.state-flow b {
  color: var(--accent);
  font-family: Inter, "Pretendard Variable", sans-serif;
  font-size: .61rem;
  letter-spacing: .07em;
}

.state-flow span {
  color: var(--ink);
  font-size: .7rem;
  line-height: 1.45;
  word-break: keep-all;
}

.workflow-principle {
  max-width: 800px;
  margin: 1rem 0 0;
  font-size: .92rem;
  line-height: 1.6;
  letter-spacing: -.025em;
}

@media (min-width: 801px) {
  .deck-mode .workflow-section {
    padding: clamp(4.5rem, 7.5svh, 5.75rem) 0 clamp(1.5rem, 3svh, 2.4rem);
  }

  .deck-mode .workflow-section .section-heading { margin-bottom: 1.15rem; }

  .deck-mode .workflow-section .section-heading h2 {
    font-size: clamp(2.15rem, 2.85vw, 3rem) !important;
    line-height: 1.15 !important;
  }
}

@media (max-width: 800px) {
  .agent-state-machine { grid-template-columns: 1fr; }
  .input-channels,
  .product-ux-layer { border-inline: 0; }
  .input-channels { border-bottom: 1px solid var(--line); }
  .product-ux-layer { border-top: 1px solid var(--line); }
  .input-channels,
  .product-ux-layer { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
  .input-channels > p,
  .product-ux-layer > p { grid-column: 1 / -1; margin-bottom: 0; }
  .state-flow { padding-inline: 1.2rem; }
}

@media (max-width: 620px) {
  .input-channels,
  .product-ux-layer { grid-template-columns: 1fr 1fr; }
  .state-flow ol { grid-template-columns: 1fr; }
  .state-flow li { grid-template-columns: 128px 1fr; }
  .state-flow li::after,
  .state-flow li:not(:last-child)::after { content: '↓'; top: auto; right: 50%; bottom: -.95rem; transform: translateX(50%); }
  .state-flow li:last-child::after { content: none; }
}
