/* Story figure (scoped under .tds). Without JavaScript the steps read as a list and the complete
   figure and table below carry everything; the scrolling figure exists only once .is-live is set. */
.tds { --ink: #121820; --muted: #5b6573; --line: #dce1e6; --pale: #f0f5fa; --title: #0a2240; --blue: #14549a;
  --ai: #116dcc; --ai-soft: #cfe5f8; --human: #596269; --cond-line: #8db3d8; --none: #f1f6fa; --hatch: #aab4bf;
  --lane-ai: #e9f4fd; --lane-human: #eef0f2;
  --ease: cubic-bezier(.2, 0, 0, 1); --t-react: 140ms; --t-toggle: 220ms; --t-step: 480ms; --t-sweep: 900ms;
  --fig-h: 56vh;
  position: relative; width: min(1280px, calc(100vw - 48px)); margin: 40px 0 40px calc(50% - min(640px, 50vw - 24px));
  color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; line-height: 1.8; }
.tds *, .tds *::before, .tds *::after { box-sizing: border-box; }
.tds h3, .tds h4, .tds p, .tds ol { margin: 0; }
.tds:not(.is-live) .tds-live-only { display: none; }
.tds-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* scrolly */
.tds-scrolly { display: grid; grid-template-columns: minmax(260px, 30%) 1fr; gap: 44px; }
.tds-fig { display: none; }
.tds.is-live .tds-fig { display: flex; grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100vh; flex-direction: column; gap: 8px; padding: 52px 0 16px; }
.tds-steps { grid-column: 1; grid-row: 1; list-style: none; padding: 0; }
.tds.is-live .tds-steps { padding: 30vh 0 46vh; }
.tds-step { padding: 0 0 18px; }
.tds.is-live .tds-step { min-height: 72vh; display: flex; align-items: center; }
.tds.is-live .tds-step.is-long { min-height: 150vh; align-items: flex-start; }
.tds-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: 0 6px 24px rgba(10, 34, 64, .06); }
.tds.is-live .tds-card { position: sticky; top: 26vh; opacity: .4; transition: opacity var(--t-toggle) var(--ease), border-color var(--t-toggle) var(--ease); }
.tds.is-live .tds-step.is-active .tds-card { opacity: 1; border-color: #b9d2ea; }
.tds-card .k { font-size: 12px; font-weight: 800; color: var(--blue); letter-spacing: .06em; }
.tds-card h4 { margin: 4px 0 8px; font-size: 19px; line-height: 1.5; color: var(--title); font-feature-settings: "palt"; }
.tds-card p { font-size: 15px; line-height: 1.85; color: #2b3a52; }
.tds-card .cite { margin-top: 10px; font-size: 12px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 10px; line-height: 1.7; }
.tds-card .cite b { color: var(--title); }
.tds-card.view, .tds-card.guide { border-style: dashed; border-color: #9fb3c8; }
.tds-tag { display: inline-block; font-size: 11px; font-weight: 800; color: var(--muted); border: 1px dashed #9fb3c8; padding: 0 8px; border-radius: 99px; margin-bottom: 6px; }

.tds-rail { position: absolute; left: 0; right: 0; top: 18px; display: flex; gap: 4px; }
.tds-rail i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background var(--t-toggle) var(--ease); }
.tds-rail i.on { background: var(--ai); }
.tds-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tds-title { font-size: 15px; font-weight: 800; color: var(--title); }
.tds-stop { appearance: none; border: 1px solid var(--line); background: #fff; color: var(--title); font: inherit; font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.tds-stop[aria-pressed="true"] { background: var(--title); color: #fff; border-color: var(--title); }
.tds-flow { position: relative; flex: 1 1 auto; min-height: 340px; max-height: 470px; margin-top: 4px; }
.tds-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tds-lanes { transition: opacity var(--t-step) var(--ease); }
.tds-lane-label { position: absolute; font-size: 13px; font-weight: 800; line-height: 1.3; transition: opacity var(--t-step) var(--ease); }
.tds-lane-label small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.tds-lane-label.ai { color: var(--ai); }
.tds-lane-label.human { color: #3b4249; }
.tds-lane-label.mid { color: var(--muted); font-weight: 700; font-size: 11.5px; }
.tds-stg { position: absolute; transform: translate(-50%, 0); text-align: center; font-size: 12px; font-weight: 800; color: var(--title); line-height: 1.35; }
.tds-stg .no { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--title); color: #fff; font-size: 11px; }
.tds-stg span { display: block; margin: 3px auto 0; width: 92px; }
.tds-route { transition: opacity var(--t-step) var(--ease); }
.tds-route .line { fill: none; stroke: var(--title); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tds-route.draw .line { transition: stroke-dashoffset var(--t-sweep) var(--ease); }
.tds-route .dot { transition: opacity var(--t-step) var(--ease); }
.tds-route.is-dim { opacity: .14; }
.tds-route.is-hidden { opacity: 0; }
.tds-handoff { transition: opacity var(--t-step) var(--ease); }
.tds-token { position: absolute; z-index: 7; transform: translate(-50%, -50%); background: var(--title); color: #fff; font-size: 12.5px; font-weight: 800; padding: 6px 12px 6px 10px; border-radius: 99px; white-space: nowrap; box-shadow: 0 8px 22px rgba(10, 34, 64, .28); display: flex; align-items: center; gap: 6px; transition: opacity var(--t-step) var(--ease); }
.tds-token i { width: 9px; height: 9px; border-radius: 50%; background: var(--ai-soft); display: inline-block; }
.tds-token.at-human i { background: #fff; border-radius: 2px; transform: rotate(45deg); }
.tds-token.is-hidden { opacity: 0; }
.tds-rowlabel { position: absolute; transform: translateY(-50%); font-size: 12px; font-weight: 800; color: var(--title); line-height: 1.25; transition: opacity var(--t-step) var(--ease); }
.tds-rowlabel small { display: block; font-size: 11px; color: var(--muted); }
.tds-rowlabel.is-hidden { opacity: 0; }
.tds-note { position: absolute; z-index: 8; background: var(--title); color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.5; padding: 6px 10px; border-radius: 8px; box-shadow: 0 6px 18px rgba(10, 34, 64, .18); transition: opacity var(--t-step) var(--ease); }
.tds-note.human { background: #3b4249; }
.tds-note::after { content: ""; position: absolute; width: 10px; height: 10px; background: inherit; transform: rotate(45deg); }
.tds-note.below::after { top: -5px; left: var(--ax, 18px); }
.tds-note.above::after { bottom: -5px; left: var(--ax, 18px); }
.tds-num { position: absolute; z-index: 7; transform: translateY(-50%); background: #fff; border: 1px solid #b9d2ea; border-radius: 10px; padding: 4px 9px 5px; box-shadow: 0 8px 24px rgba(10, 34, 64, .12); font-size: 11px; line-height: 1.4; color: #2b3a52; max-width: 260px; transition: opacity var(--t-step) var(--ease); }
.tds-num b { font-size: 19px; color: var(--title); font-variant-numeric: tabular-nums; margin-right: 6px; }
.tds-num .m { display: inline; margin-right: 6px; font-size: 11px; font-weight: 800; color: var(--blue); }
.tds-num .w { color: var(--title); margin-right: 4px; }
.tds-num.is-hidden { opacity: 0; }
.tds-tl[data-n="2"] { grid-template-columns: repeat(2, 1fr); } .tds-tl[data-n="3"] { grid-template-columns: repeat(3, 1fr); } .tds-tl[data-n="4"] { grid-template-columns: repeat(4, 1fr); } .tds-tl[data-n="5"] { grid-template-columns: repeat(5, 1fr); }
.tds-tl { display: grid; gap: 6px; transition: opacity var(--t-step) var(--ease); }
.tds-tl.is-hidden { opacity: 0; }
.tds-tl div { border-top: 3px solid var(--line); padding-top: 5px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.tds-tl div b { display: block; font-size: 12px; }
.tds-tl div.on { border-color: var(--ai); color: var(--title); }
.tds-tl div.now { border-color: var(--title); }
.tds-viewbox { border: 1px dashed #7f97ae; border-radius: 10px; padding: 6px 12px; font-size: 12px; color: #2b3a52; background: #fff; transition: opacity var(--t-step) var(--ease); }
.tds-viewbox.is-hidden { opacity: 0; }
.tds-foot { font-size: 12px; color: var(--muted); }

/* complete figure (static, also the explore view) */
.tds-whole { margin-top: 36px; }
.tds-whole h3 { font-size: 22px; color: var(--title); margin-bottom: 6px; font-feature-settings: "palt"; }
.tds-whole .sub { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.tds-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: #2b3a52; margin: 10px 0; }
.tds-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tds .sym { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-size: 11px; line-height: 1; flex: none; font-style: normal; }
.tds .sym.ai { background: var(--ai); color: #fff; }
.tds .sym.ai_approve { background: var(--ai-soft); color: var(--ai); box-shadow: inset 0 0 0 2px var(--ai); }
.tds .sym.human { background: var(--human); color: #fff; }
.tds .sym.conditional { background: #fff; color: var(--ai); outline: 2px dashed var(--cond-line); outline-offset: -2px; }
.tds .sym.none { background: repeating-linear-gradient(135deg, var(--none) 0 3px, var(--hatch) 3px 4px); color: transparent; }
.tds-filters { display: none; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; align-items: center; }
.tds.is-live .tds-filters { display: flex; }
.tds-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.tds-cite .where { color: var(--muted); }
.tds-chip { appearance: none; font: inherit; font-size: 13px; font-weight: 700; padding: 5px 13px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: #2b3a52; cursor: pointer; }
.tds-chip[aria-pressed="true"] { background: var(--title); color: #fff; border-color: var(--title); }
.tds-mx[data-cols="3"] { --cols: 3; } .tds-mx[data-cols="4"] { --cols: 4; } .tds-mx[data-cols="5"] { --cols: 5; } .tds-mx[data-cols="6"] { --cols: 6; } .tds-mx[data-cols="7"] { --cols: 7; } .tds-mx[data-cols="8"] { --cols: 8; }
.tds-mx { display: grid; grid-template-columns: 132px repeat(var(--cols), minmax(0, 1fr)); gap: 6px; }
.tds-mx .st { text-align: center; padding: 6px 4px 8px; border-radius: 10px; background: var(--pale); border: 1px solid #d6e5f2; font-size: 13px; font-weight: 800; color: var(--title); line-height: 1.35; }
.tds-mx .st small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.tds-mx .rh { display: flex; flex-direction: column; justify-content: center; padding: 6px 10px; border-radius: 10px; background: #f5f9fc; border: 1px solid #e1ebf3; font-size: 14px; font-weight: 800; color: var(--title); line-height: 1.35; }
.tds-mx .rh small { font-size: 11px; color: var(--muted); }
.tds-cell { position: relative; min-height: 70px; border-radius: 10px; padding: 7px 8px; font-size: 12.5px; line-height: 1.5; font-weight: 600; white-space: pre-line; letter-spacing: -.01em; transition: opacity var(--t-toggle) var(--ease); }
.tds-cell .sym { width: 15px; height: 15px; font-size: 9px; margin-right: 4px; vertical-align: -2px; }
.tds-cell[data-state="ai"] { background: var(--ai); color: #fff; }
.tds-cell[data-state="ai"] .sym, .tds-cell[data-state="human"] .sym { background: rgba(255, 255, 255, .18); color: #fff; }
.tds-cell[data-state="ai_approve"] { background: var(--ai-soft); color: var(--title); box-shadow: inset 0 0 0 2px var(--ai); }
.tds-cell[data-state="human"] { background: var(--human); color: #fff; }
.tds-cell[data-state="conditional"] { background: #fff; color: #2b3a52; outline: 2px dashed var(--cond-line); outline-offset: -2px; }
.tds-cell[data-state="none"] { background: repeating-linear-gradient(135deg, var(--none) 0 5px, #dfe5eb 5px 6px); color: var(--muted); display: grid; place-items: center; }
.tds.is-live .tds-cell { cursor: pointer; }
.tds-cell.is-dim, .tds-mx .rh.is-dim { opacity: .18; }
.tds-cell.is-picked { box-shadow: 0 0 0 3px var(--title); }
.tds-cite { display: none; margin-top: 14px; min-height: 60px; background: var(--pale); border-radius: 12px; padding: 12px 16px; font-size: 14px; color: #2b3a52; line-height: 1.85; }
.tds.is-live .tds-cite { display: block; }
.tds-cite b { color: var(--title); }
.tds-list { display: none; }
.tds-list .li { margin-top: 12px; font-size: 13px; }
.tds-list ol { list-style: none; padding: 0; margin: 4px 0 0; }
.tds-list li { display: flex; gap: 6px; align-items: flex-start; line-height: 1.6; padding: 3px 0; border-bottom: 1px solid var(--line); }
.tds-list li .sym { margin-top: 3px; }
.tds-table { margin-top: 16px; }
.tds-table summary { cursor: pointer; font-weight: 800; color: var(--title); padding: 8px 0; }
.tds-table .wrap { overflow-x: auto; }
.tds-table table { border-collapse: collapse; font-size: 13px; min-width: 760px; width: 100%; }
.tds-table th, .tds-table td { border: 1px solid var(--line); padding: 7px 9px; vertical-align: top; text-align: left; line-height: 1.6; }
.tds-table thead th { background: var(--pale); }
.tds-source { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* reduce motion: crossfades only; the stop button: nothing moves */
.tds.reduce *, .tds.reduce *::before, .tds.reduce *::after { transition-property: opacity !important; transition-duration: 150ms !important; animation-duration: 1ms !important; }
.tds.still *, .tds.still *::before, .tds.still *::after { transition: none !important; animation: none !important; }

@media (max-width: 1099px) {
  .tds { width: calc(100vw - 32px); margin-left: calc(50% - 50vw + 16px); }
  .tds-scrolly { display: block; }
  .tds.is-live .tds-fig { position: sticky; top: 0; height: var(--fig-h); padding: 28px 10px 8px; background: #fff; z-index: 10; border-bottom: 1px solid var(--line); }
  .tds-flow { min-height: 0; max-height: none; }
  .tds-foot, .tds-tl { display: none; }
  .tds.is-live .tds-steps { padding: 6vh 0 40vh; position: relative; z-index: 1; }
  .tds.is-live .tds-step { min-height: 64vh; align-items: flex-start; }
  .tds.is-live .tds-card { top: calc(var(--fig-h) + 10px); opacity: 1; box-shadow: 0 8px 30px rgba(10, 34, 64, .12); }
  .tds-rail { top: 10px; left: 10px; right: 10px; }
  .tds-stg { transform: translate(0, -50%); text-align: left; display: flex; align-items: center; gap: 5px; font-size: 10.5px; }
  .tds-stg span { margin: 0; width: auto; }
  .tds-lane-label { font-size: 11px; transform: translateX(-50%); text-align: center; }
  .tds-lane-label small { display: none; }
  .tds-token { font-size: 11px; padding: 4px 9px 4px 8px; }
  .tds-num { font-size: 10px; padding: 3px 8px; transform: none; }
  .tds-num b { font-size: 14px; }
  .tds-num .m { font-size: 10px; display: inline; margin-right: 6px; }
  .tds-note { font-size: 11.5px; }
  .tds-mx { grid-template-columns: 70px repeat(var(--cols), minmax(0, 1fr)); gap: 4px; }
  .tds-mx .st { font-size: 10px; padding: 4px 2px; }
  .tds-mx .st small { display: none; }
  .tds-mx .rh { font-size: 10.5px; padding: 3px 5px; }
  .tds-mx .rh small { font-size: 9px; }
  .tds-list { display: block; }
  .tds-cell { min-height: 34px; padding: 0; font-size: 0; display: grid; place-items: center; }
  .tds-cell .sym { margin: 0; width: 16px; height: 16px; font-size: 10px; vertical-align: 0; }
}
