.tf-overview {
    --tf-ink: #202020; --tf-blue: #20599a; --tf-blue-light: #edf4fc;
    --tf-green: #236347; --tf-green-light: #eaf5ee; --tf-orange: #855114;
    border: 1px solid #333; border-radius: 6px; margin: 28px 0;
    background: #fff; color: var(--tf-ink); font: 16px/1.55 system-ui, sans-serif;
    overflow: hidden; text-align: left;
}
.tf-overview *, .tf-overview *::before, .tf-overview *::after { box-sizing: border-box; }
.tf-overview-heading { padding: 22px 24px 16px; background: #f3f3f3; border-bottom: 1px solid #ccc; }
.tf-overview .tf-overview-eyebrow { margin: 0 0 5px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.tf-overview h3 { margin: 0 0 10px; font: 700 26px/1.2 system-ui, sans-serif; }
.tf-overview p { margin: 0 0 12px; font: inherit; text-align: left; }
.tf-overview-heading p:last-child { margin-bottom: 0; }
.tf-overview .tf-overview-note { padding: 16px 24px; margin: 0; border-top: 1px solid #ddd; font-size: 14px; background: #fafafa; }
.tf-overview-fallback { padding: 20px 24px; }
.tf-overview [hidden] { display: none !important; }
.tfo-player { padding: 20px 24px; }
.tfo-controls, .tfo-modes, .tfo-transport, .tfo-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tfo-controls { justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.tf-overview button, .tf-overview select {
    font: inherit; font-size: 14px; line-height: 1.3; border: 1px solid #777; border-radius: 4px;
    padding: 9px 12px; background: #fff; color: #202020; min-height: 40px;
}
.tf-overview select { max-width: 100%; }
.tf-overview button { cursor: pointer; }
.tf-overview button:hover:not(:disabled) { background: #eee; }
.tf-overview button[aria-pressed="true"], .tf-overview button.tfo-primary { background: #252525; border-color: #252525; color: #fff; }
.tf-overview button.tfo-primary:hover { background: #444; }
.tf-overview button:disabled { opacity: .45; cursor: default; }
.tf-overview :focus-visible { outline: 3px solid var(--tf-blue); outline-offset: 3px; }
.tfo-status { justify-content: space-between; padding: 10px 0; font-size: 14px; }
.tfo-weight { padding: 3px 8px; background: #f0f0f0; border: 1px solid #ccc; border-radius: 4px; font-weight: 600; }
.tfo-weight.is-updating { background: var(--tf-green-light); color: var(--tf-green); border-color: var(--tf-green); }
.tfo-timeline { display: flex; gap: 10px; align-items: center; margin: 4px 0 18px; }
.tfo-timeline label { font-size: 14px; white-space: nowrap; margin: 0; font-weight: 400; }
.tfo-timeline input { width: 100%; min-width: 0; accent-color: #333; cursor: pointer; }
.tfo-caption { border-left: 4px solid var(--tf-blue); background: var(--tf-blue-light); padding: 14px 16px; margin: 0 0 20px; min-height: 108px; }
.tfo-caption h4 { font: 700 18px/1.3 system-ui, sans-serif; margin: 0 0 6px; }
.tfo-caption p { margin: 0; }
.tfo-caption.is-backward { border-color: var(--tf-green); background: var(--tf-green-light); }
.tfo-sequence { padding: 14px 0; border-top: 1px solid #ddd; }
.tfo-sequence h4, .tfo-model h4 { font: 600 16px/1.4 system-ui, sans-serif; margin: 0 0 10px; }
.tfo-sequence .tfo-row-label { margin: 10px 0 5px; font-size: 14px; }
.tfo-scroll { overflow-x: auto; padding-bottom: 5px; }
.tfo-token-grid { display: grid; grid-template-columns: repeat(16, minmax(31px, 1fr)); gap: 4px; min-width: 556px; }
.tfo-token { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #aaa; background: #fff; border-radius: 3px; font-size: 16px; font-weight: 600; }
.tfo-token small { font-size: 12px; line-height: 1.1; font-weight: 400; margin-bottom: 3px; color: #555; }
.tfo-token.is-answer { background: var(--tf-blue-light); border-color: #648ab4; color: #174c84; }
.tfo-token.is-sep { background: #fff1da; border-color: #a76f27; color: #70430d; font-size: 12px; }
.tfo-token.is-future, .tfo-token.is-ignored { border-style: dashed; color: #666; background: #f2f2f2; }
.tfo-token.is-current { outline: 2px solid var(--tf-blue); outline-offset: 0; }
.tfo-token.is-new { background: var(--tf-green-light); border-color: var(--tf-green); color: var(--tf-green); }
.tfo-token.is-error { background: #fff0e5; border-color: #ac5a19; color: #884110; }
.tfo-mask .tfo-token { min-height: 26px; font-size: 14px; }
.tfo-sequence .tfo-legend { font-size: 14px; margin: 8px 0 0; color: #444; }
.tfo-model { border-top: 1px solid #ddd; padding: 16px 0; }
/* Model boundary: external token input, four internal stages, external output. */
.tfo-graph { position: relative; padding-left: 28px; }
.tfo-port { position: relative; border: 1px solid #8897a7; border-radius: 6px; padding: 14px; background: #f7f9fc; }
.tfo-port-title { display: block; font-size: 15px; letter-spacing: .035em; }
.tfo-port .tfo-port-detail { margin: 6px 0 10px; font-size: 14px; }
.tfo-port.is-active { border: 2px solid var(--tf-blue); padding: 13px; background: var(--tf-blue-light); }
.tfo-port-tokens { display: flex; flex-wrap: wrap; gap: 4px; }
.tfo-port-tokens .tfo-token { min-width: 33px; flex: 1 0 33px; max-width: 52px; }
.tfo-output-port { background: #fafafa; }
.tfo-wire { display: flex; align-items: center; justify-content: center; position: relative; gap: 12px; min-height: 44px; font-size: 14px; color: #525b65; padding: 3px 0; }
.tfo-wire-arrow { font-size: 30px; font-weight: 700; line-height: 1; }
.tfo-wire.is-active { color: var(--tf-blue); font-weight: 600; }
.tfo-wire.is-backward { color: var(--tf-green); }
.tfo-transformer { border: 3px solid #253b51; border-radius: 8px; background: #f7faff; box-shadow: 0 4px 0 #e0e6ed; }
.tfo-transformer-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; color: #fff; background: #253b51; padding: 12px 14px; }
.tfo-transformer-heading strong { font-size: 18px; letter-spacing: .09em; }
.tfo-transformer-heading > span { font-size: 14px; }
.tfo-transformer-heading .tfo-boundary-state { flex-basis: 100%; font-size: 14px; border-top: 1px solid #8495a5; padding-top: 8px; }
.tfo-path { display: grid; grid-template-columns: .95fr 1.25fr 1.25fr 1fr; align-items: stretch; gap: 22px; padding: 20px 12px 12px; }
.tfo-node { border: 1px solid #a0adbb; border-radius: 5px; background: #fff; padding: 12px 9px; min-width: 0; position: relative; transition: background-color .2s, border-color .2s; }
.tfo-node .tfo-node-title { display: block; font-size: 16px; line-height: 1.3; margin-bottom: 7px; }
.tfo-node .tfo-node-detail { display: block; font-size: 14px; line-height: 1.4; }
.tfo-node:not(:last-child)::after { content: "→"; position: absolute; right: -21px; top: 45%; color: #4f6479; font-size: 22px; }
.tfo-node.is-active { background: var(--tf-blue-light); border: 2px solid var(--tf-blue); padding: 11px 8px; }
.tfo-node.is-active::before { content: "ACTIVE"; font-size: 11px; font-weight: 700; color: var(--tf-blue); position: absolute; top: -12px; right: 6px; padding: 0 4px; background: #f7faff; }
.tfo-node.is-done { border-color: #555; }
.tfo-tensor { display: block; border: 1px solid #94abc2; border-radius: 4px; padding: 6px; margin-top: 16px; font: 600 14px/1.4 ui-monospace, monospace; text-align: center; background: #f3f7fc; }
.tfo-residual { position: relative; padding: 0 0 0 14px; margin-top: 12px; }
.tfo-residual::before { content: ""; position: absolute; left: 0; top: 0; bottom: 13px; width: calc(50% + 7px); border: 2px solid #7f8fa0; border-right: none; border-radius: 4px 0 0 4px; }
.tfo-operation { position: relative; display: block; border: 1px solid #9bafc3; background: #fff; border-radius: 3px; padding: 6px; font-size: 14px; line-height: 1.35; text-align: center; }
.tfo-operation::after { content: ""; position: absolute; height: 7px; width: 2px; background: #688098; bottom: -7px; left: calc(50% - 1px); }
.tfo-residual + .tfo-residual::after { content: ""; position: absolute; height: 12px; width: 2px; background: #688098; top: -12px; left: calc(50% + 6px); }
.tfo-add { display: block; position: relative; margin: 6px auto 0; width: 26px; height: 26px; line-height: 22px; text-align: center; border: 2px solid #688098; border-radius: 50%; background: #fff; font-size: 18px; font-weight: 700; }
.tfo-skip-label { display: block; font-size: 12px; line-height: 1.4; color: #475768; margin-top: 10px; }
.tfo-transformer .tfo-flow-legend { margin: 0; padding: 8px 12px 12px; font-size: 14px; }
.tfo-transformer.is-backward, .tfo-transformer.is-updating { border-color: var(--tf-green); }
.tfo-transformer.is-backward .tfo-transformer-heading, .tfo-transformer.is-updating .tfo-transformer-heading { background: var(--tf-green); }
.tfo-path.is-backward .tfo-node, .is-updating .tfo-node { border-color: var(--tf-green); background: var(--tf-green-light); }
.tfo-path.is-backward .tfo-node:not(:last-child)::after { content: "←"; color: var(--tf-green); }
.tfo-return-route { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: #536576; overflow: visible; }
.tfo-return-line { stroke: currentColor; stroke-width: 2; stroke-dasharray: 6 5; }
.tfo-return-route.is-active { color: var(--tf-blue); }
.tfo-return-route.is-active .tfo-return-line { stroke-width: 3; }
.tfo-graph .tfo-return-label { font-size: 14px; padding: 10px 0; margin: 0; color: #384e63; }
.tfo-model .tfo-feedback { margin-top: 14px; }
.tfo-details { border-top: 1px solid #ccc; margin-top: 10px; }
.tfo-details > summary { cursor: pointer; padding: 14px 0; font-size: 15px; font-weight: 600; }
.tf-overview.is-playing .tfo-return-route.is-active .tfo-return-line { animation: tfo-route 1s linear infinite; }
.tf-overview.is-playing .tfo-wire.is-active .tfo-wire-arrow { animation: tfo-down .8s ease-in-out infinite; }
.tf-overview.is-playing .tfo-wire.is-backward .tfo-wire-arrow { animation-name: tfo-up; }
.tf-overview.is-playing .tfo-node.is-active:not(:last-child)::after { animation: tfo-right .8s ease-in-out infinite; color: var(--tf-blue); }
.tf-overview.is-playing .tfo-path.is-backward .tfo-node:not(:last-child)::after { animation: tfo-left .8s ease-in-out infinite; }
@keyframes tfo-route { to { stroke-dashoffset: -22; } }
@keyframes tfo-down { 50% { transform: translateY(5px); } }
@keyframes tfo-up { 50% { transform: translateY(-5px); } }
@keyframes tfo-right { 50% { transform: translateX(4px); } }
@keyframes tfo-left { 50% { transform: translateX(-4px); } }
.tfo-feedback { border: 1px dashed #888; border-radius: 4px; background: #fafafa; padding: 12px; font-size: 14px; }
.tfo-feedback.is-active { border: 2px solid var(--tf-green); padding: 11px; background: var(--tf-green-light); }
.tfo-result { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.tfo-result .tfo-token { min-width: 34px; min-height: 36px; }
.tfo-result-label { font-size: 14px; flex-basis: 100%; margin-bottom: 3px; }
.tfo-transport { padding: 12px 0; margin-bottom: 8px; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }
.tfo-speed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; margin-left: auto; }
.tfo-speed label { margin: 0; font-weight: 400; }
@media (max-width: 650px) {
    .tf-overview-heading, .tfo-player, .tf-overview-fallback { padding: 16px 12px; }
    .tf-overview .tf-overview-note { padding: 12px; }
    .tf-overview h3 { font-size: 22px; }
    .tfo-speed { margin-left: 0; }
    .tfo-caption { min-height: 140px; }
}
@media (max-width: 900px) {
    .tfo-path { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 20px 12px; }
    .tfo-node:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -28px; font-size: 24px; }
    .tfo-path.is-backward .tfo-node:not(:last-child)::after { content: "↑"; }
    .tf-overview.is-playing .tfo-node.is-active:not(:last-child)::after { animation-name: tfo-down; }
    .tf-overview.is-playing .tfo-path.is-backward .tfo-node:not(:last-child)::after { animation-name: tfo-up; }
    .tfo-graph { padding-left: 20px; }
    .tfo-port { padding: 10px; }
    .tfo-port.is-active { padding: 9px; }
    .tfo-wire { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .tf-overview *, .tf-overview *::before, .tf-overview *::after { transition: none !important; animation: none !important; }
}
