.ex-figure {
  --ex-panel: var(--panel, #faf7ef);
  --ex-rule: var(--rule, #b8bbae);
  --ex-ink: var(--ink, #20251f);
  --ex-accent: var(--red, #b73325);
  margin: 30px 0;
  padding: 24px;
  border: 1px solid var(--ex-rule);
  border-top: 3px solid var(--ex-ink);
  background: var(--ex-panel);
  color: var(--ex-ink);
  min-width: 0;
}
.ex-figure p { margin: 0; }
.ex-figure p + p { margin-top: 0; }
.ex-caption .eyebrow { color: var(--ex-accent); font-size: 10px; }
.ex-caption h3 { margin: 8px 0 12px; font: 30px/1.2 var(--font-letter, Georgia, serif); letter-spacing: -.01em; }
.ex-caption > p:last-child, .ex-caption > div > p:last-child { max-width: 55em; font-size: 15px; line-height: 1.7; }
.ex-figure .ex-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 23px 0 0; padding: 0; list-style: none; }
.ex-figure .ex-steps-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ex-step { position: relative; min-width: 0; padding: 18px; border: 1px solid var(--ex-rule); background: var(--paper, #f0ede3); }
.ex-step-planned { border-style: dashed; }
.ex-step-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.ex-step-number { font: 27px/1 var(--font-display, Impact, sans-serif); color: var(--ex-accent); }
.ex-icon { display: block; width: 40px; height: 40px; flex: 0 0 40px; color: var(--ex-ink); }
.ex-figure .ex-badge { display: block; width: fit-content; max-width: 100%; padding: 4px 6px; border: 1px solid var(--ex-rule); font-size: 10px; line-height: 1.4; letter-spacing: .045em; text-transform: uppercase; font-weight: 600; }
.ex-step-planned .ex-badge { color: var(--ex-accent); border-color: var(--ex-accent); }
.ex-figure .ex-step-date { margin-top: 12px; color: var(--muted, #596052); font-size: 12px; line-height: 1.6; }
.ex-step h4, .ex-file h4, .ex-reply h4 { margin: 8px 0 10px; font-size: 18px; font-weight: 500; line-height: 1.35; letter-spacing: -.015em; }
.ex-figure .ex-step-body, .ex-figure .ex-file > p, .ex-figure .ex-reply > div > p:last-child { font-size: 14px; line-height: 1.75; }
.ex-steps-connected > .ex-step:not(:last-child)::after { content: '→'; position: absolute; right: -17px; top: 38px; width: 16px; text-align: center; color: var(--ex-accent); font-size: 18px; line-height: 1; z-index: 1; }
.ex-figure .ex-steps-unconnected { gap: 12px; }
.ex-steps-unconnected .ex-step { border-top: 3px solid var(--ex-rule); }
.ex-figure .ex-note { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--ex-rule); font-size: 13px; line-height: 1.8; color: var(--muted, #596052); }
.ex-note strong { color: var(--ex-ink); font-weight: 600; }
.ex-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; }
.ex-replay { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 12px; color: var(--ex-ink); border: 1px solid var(--ex-rule); background: transparent; font-size: 12px; line-height: 1.5; }
.ex-replay:not(:disabled):hover { border-color: var(--ex-accent); color: var(--ex-accent); }
.ex-replay > span { font-size: 17px; line-height: 1; }
.ex-figure .ex-play-status { flex: 1 1 200px; color: var(--muted, #596052); font-size: 11px; line-height: 1.6; }
.ex-play-status:empty { display: none; }
.ex-file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.ex-file { border-top: 3px solid var(--ex-ink); }
.ex-file:nth-child(2) { border-top-color: var(--ex-accent); }
.ex-file-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 15px; }
.ex-reply { display: flex; align-items: start; gap: 17px; margin-top: 18px; border-left: 3px solid var(--ex-accent); }
.ex-figure .ex-reply .ex-step-date { margin-top: 0; }
.ex-reply h4 { margin-top: 7px; }
.ex-replaying [data-ex-step] { animation: ex-highlight 800ms ease-out; animation-delay: calc(var(--ex-order, 0) * 850ms); }
@keyframes ex-highlight {
  0% { box-shadow: inset 0 0 0 2px var(--ex-accent); background-color: #f1dfc9; }
  70% { box-shadow: inset 0 0 0 2px var(--ex-accent); background-color: #f1dfc9; }
  100% { box-shadow: inset 0 0 0 0 transparent; background-color: var(--paper, #f0ede3); }
}
@media (max-width: 1050px) {
  .ex-figure .ex-steps-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-steps-four > .ex-step:nth-child(2)::after { display: none; }
}
@media (max-width: 700px) {
  .ex-figure { padding: 20px; }
  .ex-figure .ex-steps { grid-template-columns: 1fr; gap: 18px; }
  .ex-step { padding: 16px; }
  .ex-step-top { justify-content: start; align-items: center; margin-bottom: 12px; }
  .ex-step-number { margin-right: auto; }
  .ex-steps-connected > .ex-step:not(:last-child)::after { content: '↓'; right: auto; left: calc(50% - 8px); top: auto; bottom: -17px; }
  .ex-steps-four > .ex-step:nth-child(2)::after { display: block; }
  .ex-figure .ex-steps-unconnected { gap: 12px; }
  .ex-file-grid { grid-template-columns: 1fr; gap: 12px; }
  .ex-caption h3 { font-size: 27px; }
  .ex-step h4, .ex-file h4, .ex-reply h4 { font-size: 19px; }
  .ex-figure .ex-step-body, .ex-figure .ex-file > p, .ex-figure .ex-reply > div > p:last-child { font-size: 15px; }
}
@media (max-width: 400px) {
  .ex-figure { padding: 17px; }
  .ex-caption h3 { font-size: 25px; }
  .ex-reply { display: block; }
  .ex-reply > .ex-icon { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ex-replaying [data-ex-step] { animation: none !important; }
}
@media print {
  .ex-controls { display: none; }
  .ex-figure { background: white; border-color: #999; padding: 15px; break-inside: avoid; }
  .ex-step, .ex-file, .ex-reply { background: white; }
  .ex-replaying [data-ex-step] { animation: none !important; }
}
