.animated-story {
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 14px;
  overflow: hidden;
}
.story-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  min-height: 365px;
}
.story-garden {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fcfcfc;
  border-right: 1px solid #ededed;
  padding: 22px 0 17px;
}
.garden-meta,
.garden-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 23px;
  font-size: 10px;
  color: #949494;
}
.garden-meta > span:first-child {
  color: #5b5b5b;
}
.garden-count {
  font-variant-numeric: tabular-nums;
  color: #222;
  margin-right: 4px;
}
.garden-mode {
  font-size: 9px;
}
.garden-scene {
  display: block;
  width: 100%;
  height: auto;
  margin: auto 0;
  overflow: visible;
}
.conversation-blob > path {
  fill: #e6e6e6;
  stroke: #d9d9d9;
  stroke-width: 0.6;
  transition:
    fill 0.7s,
    opacity 0.7s;
  transform-box: fill-box;
  transform-origin: center;
  animation: blob-breathe 6s ease-in-out infinite;
  animation-delay: calc(var(--order) * -0.8s);
}
.conversation-blob:nth-child(3n) > path {
  fill: #eeeeee;
}
.conversation-blob:nth-child(4n) > path {
  fill: #dedede;
}
.conversation-blob:hover > path {
  fill: #b8b8b8;
}
.blob-detail {
  fill: #9b9b9b;
  opacity: 0.6;
  transition: fill 0.7s;
}
.blob-halo {
  fill: none;
  stroke: #555;
  stroke-width: 0.7;
  stroke-dasharray: 2 3;
  opacity: 0;
  transition: opacity 0.8s;
}
.garden-target-area {
  fill: #f8f8f8;
  stroke: #eaeaea;
  stroke-width: 1;
  stroke-dasharray: 3 5;
  transition:
    fill 1s,
    stroke 1s;
}
.destination-blob {
  fill: #fff;
  stroke: #bcbcbc;
  stroke-width: 1;
  transition:
    fill 0.8s,
    stroke 0.8s;
}
.garden-destination {
  color: #777;
  transition: color 0.8s;
}
.destination-label {
  font:
    11px Arial,
    Helvetica,
    sans-serif;
  fill: #555;
}
.garden-sub-label {
  font:
    9px Arial,
    Helvetica,
    sans-serif;
  fill: #a1a1a1;
}
.garden-floor-label {
  font:
    10px Arial,
    Helvetica,
    sans-serif;
  fill: #999;
}
.garden-thread {
  fill: none;
  stroke: #d1d1d1;
  stroke-width: 0.8;
  opacity: 0;
  transition: opacity 1s;
}
.garden-flow {
  fill: none;
  stroke: #555;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 2 75;
  opacity: 0;
  animation: context-flow 5s linear infinite;
  animation-delay: calc(var(--order) * -0.9s);
  transition: opacity 0.6s;
}
.garden-bottom {
  font-size: 9px;
}
.garden-bottom > span:last-child {
  font-size: 8px;
  color: #aaa;
}
.garden-signal {
  display: flex;
  gap: 6px;
  align-items: center;
}
.garden-signal > i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #909090;
}
.garden-scan {
  opacity: 0;
  transition: opacity 0.7s;
}
.scan-band {
  fill: #000;
  opacity: 0.035;
  animation: garden-scan 4.3s linear infinite;
}
.scan-line {
  stroke: #888;
  stroke-width: 0.7;
  stroke-dasharray: 3 3;
  animation: garden-scan 4.3s linear infinite;
}
.context-story[data-stage="0"] .garden-history {
  opacity: 0.9;
}
.context-story:not([data-stage="0"]) .conversation-blob.relevant > path,
.friction-story:not([data-stage="0"]) .conversation-blob.relevant > path {
  fill: #414141;
  stroke: #414141;
}
.animated-story:not([data-stage="0"]) .conversation-blob.relevant .blob-detail {
  fill: #fff;
  opacity: 0.8;
}
.animated-story:not([data-stage="0"]) .blob-halo {
  opacity: 1;
}
.context-story:not([data-stage="0"]) .garden-thread {
  opacity: 0.8;
}
.context-story:not([data-stage="0"]) .garden-flow {
  opacity: 1;
}
.context-story[data-stage="1"] .destination-blob,
.animated-story[data-stage="2"] .destination-blob,
.animated-story[data-stage="3"] .destination-blob {
  fill: #222;
  stroke: #222;
}
.context-story[data-stage="1"] .garden-destination,
.animated-story[data-stage="2"] .garden-destination,
.animated-story[data-stage="3"] .garden-destination {
  color: #fff;
}
.animated-story[data-complete="true"] .garden-target-area {
  stroke: #bcbcbc;
  fill: #f6f6f6;
  stroke-dasharray: none;
}
.animated-story[data-complete="true"] .garden-target-area {
  animation: target-arrive 1s ease-out;
}
.destination-pr,
.destination-check {
  display: none;
}
.friction-story .destination-chat {
  display: none;
}
.friction-story .destination-pr {
  display: block;
}
.friction-story[data-stage="3"] .destination-pr {
  display: none;
}
.friction-story[data-stage="3"] .destination-check {
  display: block;
}
.friction-story[data-stage="0"] .garden-scan {
  opacity: 1;
}
.friction-story[data-stage="0"] .conversation-blob > path {
  animation: scan-blob 4.3s ease-in-out infinite;
  animation-delay: var(--node-delay);
}
.friction-story[data-stage="1"] .garden-thread,
.friction-story[data-stage="2"] .garden-thread,
.friction-story[data-stage="3"] .garden-thread {
  opacity: 1;
}
.friction-story[data-stage="2"] .garden-flow {
  opacity: 1;
}
.friction-story[data-stage="3"] .conversation-blob.relevant > path {
  fill: #bcbcbc;
  stroke: #aaa;
}
.friction-story[data-stage="3"] .blob-halo {
  opacity: 0;
}
.story-card {
  padding: 27px 27px 21px;
  min-width: 0;
  align-self: center;
}
.story-overline {
  font-size: 8px;
  letter-spacing: 1.1px;
  color: #909090;
}
.story-card h3 {
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.85px;
  margin-top: 16px;
}
.story-intro {
  font-size: 11px;
  line-height: 1.75;
  color: #858585;
  margin-top: 13px;
  max-width: 270px;
}
.story-note {
  font-size: 10px;
  line-height: 1.7;
  color: #909090;
  margin-top: 19px;
}
.archive-list {
  margin-top: 22px;
  border-top: 1px solid #eee;
}
.archive-list > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}
.archive-list svg {
  width: 14px;
  height: 14px;
  color: #999;
  flex-shrink: 0;
}
.archive-list small {
  margin-left: auto;
  color: #aaa;
  font-size: 8px;
  white-space: nowrap;
}
.story-sources {
  margin-top: 13px;
}
.story-source {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #ededed;
  animation: story-appear 0.7s both;
  animation-delay: calc(var(--order) * 0.13s);
}
.story-source:last-child {
  border: 0;
}
.story-source-icon {
  width: 23px;
  height: 25px;
  flex-shrink: 0;
  padding: 4px;
  background: #f7f7f7;
  border-radius: 5px;
  color: #777;
}
.story-source-icon svg {
  width: 15px;
  height: 17px;
}
.story-source strong {
  font-size: 11px;
  font-weight: 500;
}
.story-source p {
  font-size: 10px;
  color: #858585;
  margin-top: 3px;
}
.story-source small {
  font-size: 8px;
  color: #a2a2a2;
  display: block;
  margin-top: 6px;
}
.story-source small > span {
  margin-left: 5px;
}
.context-bundle {
  margin-top: 20px;
  border: 1px solid #e7e7e7;
  border-radius: 9px;
  overflow: hidden;
}
.bundle-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f8f8;
  padding: 12px;
  font-size: 10px;
  border-bottom: 1px solid #eee;
}
.bundle-heading > span:last-child {
  margin-left: auto;
  color: #999;
  font-size: 8px;
}
.bundle-mark {
  font-size: 17px;
  color: #666;
}
.bundle-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
}
.bundle-line > span {
  font-size: 11px;
  color: #666;
}
.bundle-line strong {
  font-size: 10px;
  font-weight: 500;
}
.bundle-line p {
  font-size: 9px;
  color: #8c8c8c;
  margin-top: 3px;
}
.bundle-footer {
  padding: 10px 12px;
  border-top: 1px solid #eee;
  font-size: 8px;
  color: #999;
  display: flex;
  justify-content: space-between;
}
.new-chat {
  margin-top: 24px;
}
.chat-prompt {
  background: #f2f2f2;
  border-radius: 12px 12px 2px 12px;
  padding: 12px 14px;
  font-size: 11px;
  line-height: 1.6;
  margin-left: 20px;
}
.chat-agent {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}
.chat-agent-mark {
  display: block;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  filter: brightness(0);
}
.chat-agent strong {
  font-size: 11px;
  font-weight: 500;
}
.chat-agent p {
  font-size: 11px;
  color: #737373;
  line-height: 1.8;
  margin-top: 8px;
}
.context-attached {
  display: inline-block;
  font-size: 8px;
  border: 1px solid #e4e4e4;
  color: #888;
  border-radius: 15px;
  padding: 5px 8px;
  margin-top: 12px;
}
.effort-list {
  margin-top: 17px;
}
.effort-row {
  margin-top: 12px;
}
.effort-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
  color: #7a7a7a;
}
.effort-row b {
  font-size: 9px;
  font-weight: 400;
  color: #555;
  font-variant-numeric: tabular-nums;
}
.effort-track {
  height: 5px;
  display: flex;
  gap: 3px;
  margin-top: 7px;
}
.effort-track > span {
  background: #555;
  border-radius: 1px;
}
.effort-track > i {
  background: #e4e4e4;
  border-radius: 1px;
}
.effort-legend {
  display: flex;
  gap: 15px;
  font-size: 8px;
  color: #969696;
  margin-top: 14px;
}
.effort-legend > span {
  display: flex;
  gap: 5px;
  align-items: center;
}
.effort-legend i {
  width: 6px;
  height: 6px;
  background: #555;
  display: block;
  border-radius: 1px;
}
.effort-legend > span:last-child i {
  background: #e4e4e4;
}
.sample-note {
  display: block;
  font-size: 8px;
  color: #aaa;
  margin-top: 13px;
}
.pattern-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 21px;
}
.pattern-summary strong {
  font-size: 12px;
  font-weight: 500;
}
.pattern-summary > span {
  font-size: 9px;
  color: #999;
}
.manual-steps {
  list-style: none;
  padding: 0;
  margin: 17px 0 0;
}
.manual-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #eee;
  padding: 13px 0;
  font-size: 11px;
}
.manual-steps li > span {
  font-size: 9px;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}
.optimization-pr {
  border: 1px solid #dedede;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 20px;
  padding: 14px;
}
.pr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
  color: #666;
}
.pr-header > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pr-header svg {
  width: 15px;
  height: 15px;
}
.pr-header small {
  font-size: 8px;
  color: #aaa;
}
.optimization-pr h4 {
  font-size: 13px;
  letter-spacing: -0.25px;
  font-weight: 500;
  margin: 18px 0 7px;
}
.optimization-pr p {
  font-size: 10px;
  line-height: 1.7;
  color: #999;
  margin-bottom: 16px;
}
.pr-file {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 9px;
  border-top: 1px solid #eee;
  padding: 9px 0;
}
.pr-file > span {
  color: #777;
}
.pr-file code {
  font:
    9px ui-monospace,
    SFMono-Regular,
    monospace;
  color: #777;
}
.pr-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #eee;
  padding-top: 12px;
  font-size: 8px;
  color: #aaa;
}
.pr-pill {
  padding: 5px 8px;
  background: #272727;
  color: white;
  border-radius: 12px;
}
.workflow-before {
  margin-top: 25px;
}
.workflow-before small {
  font-size: 8px;
  letter-spacing: 0.6px;
  color: #999;
}
.workflow-before > span {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 11px;
  font-size: 10px;
  color: #aaa;
  line-height: 1.8;
  margin-top: 9px;
}
.workflow-after {
  border: 1px solid #e6e6e6;
  background: #fafafa;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}
.workflow-after > span {
  font-size: 8px;
  letter-spacing: 0.6px;
  color: #888;
}
.workflow-after code {
  display: block;
  font:
    14px ui-monospace,
    SFMono-Regular,
    monospace;
  margin-top: 15px;
}
.workflow-after code span {
  color: #aaa;
  margin-right: 5px;
}
.workflow-after p {
  font-size: 9px;
  color: #888;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
}
.story-controls {
  display: flex;
  align-items: stretch;
  gap: 18px;
  border-top: 1px solid #e9e9e9;
  padding: 0 22px;
  background: #fff;
}
.story-steps {
  display: grid;
  grid-template-columns: repeat(var(--story-step-count, 4), 1fr);
  flex: 1;
  gap: 20px;
}
.story-steps button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 18px 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 9px;
  color: #aaa;
  line-height: 1.4;
}
.story-steps button .step-index {
  font-size: 8px;
  color: #aaa;
}
.story-steps button[aria-pressed="true"] {
  color: #252525;
}
.story-steps button[aria-pressed="true"] .step-index {
  color: #666;
}
.story-steps button i {
  height: 2px;
  width: 0;
  position: absolute;
  bottom: 0;
  left: 0;
  background: #666;
}
.story-steps button[aria-pressed="true"] i {
  width: 100%;
}
.story-steps button:hover {
  color: #333;
}
.story-playback {
  display: flex;
  align-items: center;
  gap: 5px;
}
.story-playback button {
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid #e8e8e8;
  border-radius: 50%;
  height: 26px;
  width: 26px;
  font-size: 13px;
  color: #777;
  padding: 0;
}
.story-playback button:hover {
  background: #f4f4f4;
  color: #111;
}
.story-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  background: #fafafa;
  border-top: 1px solid #ececec;
  font-size: 10px;
  color: #858585;
  line-height: 1.6;
}
.story-caption small {
  font-size: 8px;
  color: #aaa;
  white-space: nowrap;
}
.animated-story button:focus-visible {
  outline: 2px solid #555;
  outline-offset: 3px;
}
.animated-story[data-playing="false"] .garden-scene * {
  animation-play-state: paused !important;
}
@keyframes blob-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.055);
  }
}
@keyframes context-flow {
  to {
    stroke-dashoffset: -308;
  }
}
@keyframes garden-scan {
  0% {
    transform: translateX(10px);
  }
  100% {
    transform: translateX(470px);
  }
}
@keyframes scan-blob {
  0%,
  10%,
  60%,
  100% {
    fill: #e6e6e6;
  }
  25%,
  40% {
    fill: #9c9c9c;
  }
}
@keyframes target-arrive {
  0% {
    stroke: #ddd;
  }
  45% {
    stroke: #555;
  }
  100% {
    stroke: #bcbcbc;
  }
}
@keyframes story-appear {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 1100px) {
  .story-layout {
    grid-template-columns: 1.35fr 1fr;
  }
  .story-card {
    padding: 23px 20px;
  }
  .story-card h3 {
    font-size: 23px;
  }
  .garden-meta,
  .garden-bottom {
    margin-inline: 17px;
  }
  .garden-mode {
    display: none;
  }
  .story-steps {
    gap: 12px;
  }
  .story-controls {
    gap: 12px;
    padding-inline: 18px;
  }
  .story-steps button {
    font-size: 8px;
    gap: 5px;
  }
  .story-caption {
    padding-inline: 18px;
  }
}
@media (max-width: 760px) {
  .story-layout {
    grid-template-columns: 1fr;
  }
  .story-garden {
    border-right: 0;
    border-bottom: 1px solid #ededed;
    padding: 17px 0 13px;
  }
  .garden-meta {
    font-size: 9px;
  }
  .garden-mode {
    display: block;
    font-size: 8px;
  }
  .garden-meta,
  .garden-bottom {
    margin-inline: 15px;
  }
  .garden-bottom {
    font-size: 8px;
  }
  .garden-bottom > span:last-child {
    font-size: 7px;
  }
  .story-card {
    padding: 23px;
    min-height: 335px;
    align-self: stretch;
  }
  .story-card h3 {
    font-size: 26px;
    line-height: 1.18;
  }
  .story-intro {
    max-width: none;
    font-size: 12px;
  }
  .story-overline {
    font-size: 8px;
  }
  .story-note {
    font-size: 10px;
  }
  .story-source strong {
    font-size: 12px;
  }
  .story-source p {
    font-size: 11px;
  }
  .story-source small {
    font-size: 9px;
  }
  .archive-list > span {
    font-size: 11px;
  }
  .context-bundle {
    margin-top: 18px;
  }
  .bundle-line {
    padding-block: 9px;
  }
  .bundle-line strong {
    font-size: 11px;
  }
  .bundle-line p {
    font-size: 10px;
  }
  .bundle-footer {
    font-size: 9px;
  }
  .chat-prompt,
  .chat-agent p {
    font-size: 12px;
  }
  .story-controls {
    padding: 0 13px;
    gap: 10px;
    align-items: center;
  }
  .story-steps {
    gap: 8px;
  }
  .story-steps button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: start;
    gap: 4px;
    font-size: 10px;
    padding: 14px 0;
    min-height: 80px;
  }
  .story-playback {
    flex-direction: column;
    gap: 4px;
  }
  .story-playback button {
    height: 22px;
    width: 22px;
    font-size: 12px;
  }
  .story-caption {
    padding: 12px 14px;
    font-size: 9px;
    min-height: 58px;
  }
  .story-caption small {
    display: none;
  }
  .effort-row > div:first-child,
  .effort-row b {
    font-size: 10px;
  }
  .pattern-summary > span {
    font-size: 10px;
  }
  .manual-steps li {
    font-size: 12px;
  }
  .optimization-pr p {
    font-size: 11px;
  }
  .optimization-pr {
    margin-top: 18px;
  }
  .workflow-after code {
    font-size: 15px;
  }
  .workflow-before > span {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .animated-story * {
    animation: none !important;
    transition: none !important;
  }
  .garden-flow {
    stroke-dasharray: 3 20;
  }
  .garden-scan {
    display: none;
  }
}
