/* Native flow diagrams: labels reflow with the page, connectors carry no content. */
.mt { max-width: 1140px; margin: 0 auto; padding-bottom: 24px; }
.mt-head { padding: 30px 0 24px; }
.mt-head h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.02em; }
.mt-head p { max-width: 66ch; margin-top: 12px; font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.mt-roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0 0 26px; }
.mt-roles > div { padding-left: 12px; border-left: 3px solid var(--mt-role, var(--control)); }
.mt-roles dt { font-weight: 600; margin-bottom: 4px; }
.mt-roles dd { margin: 0; color: var(--ink-2); line-height: 1.55; }
.mt-role-codex { --mt-role: var(--ink-2); }
.mt-role-gemini { --mt-role: var(--pos); }
.mt-role-program { --mt-role: var(--accent); }
.mt-toc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule-strong); }
.mt-toc a { display: flex; align-items: baseline; gap: 10px; padding: 15px 10px 15px 0; }
.mt-toc .n { color: var(--ink-2); font-size: 12px; }
.mt-section { border-bottom: 1px solid var(--rule-strong); padding: 38px 0; scroll-margin-top: 20px; }
.mt-section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 22px; }
.mt-number { font-size: 15px; color: var(--ink-2); }
.mt-section h2 { font-size: 23px; line-height: 1.3; letter-spacing: -.01em; }
.mt-section-head p { max-width: 72ch; margin-top: 8px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.mt h3 { font-size: 16px; line-height: 1.4; }
.mt h4 { font-size: 15px; line-height: 1.4; }
.mt-diagram { margin: 0; padding: 22px; border: 1px solid var(--rule-strong); background: var(--white); }
.mt-diagram figcaption { margin: 0 0 22px; font-size: 13px; color: var(--ink-2); }
.mt-columns { display: grid; gap: 36px; align-items: start; }
.mt-columns-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt-columns-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mt-lane { min-width: 0; position: relative; }
.mt-lane > h3 { margin-bottom: 18px; }
.mt-track { list-style: none; padding: 0; margin: 0; display: grid; gap: 28px; }
.mt-node, .mt-decision { position: relative; min-width: 0; }
.mt-node { padding: 13px 14px; border: 1px solid var(--control); border-left: 3px solid var(--mt-role, var(--control)); background: var(--panel); }
.mt-node strong { display: block; font-size: 14px; line-height: 1.5; font-weight: 600; }
.mt-owner { display: block; margin-bottom: 5px; color: var(--mt-role, var(--ink-2)); font-size: 12px; line-height: 1.45; }
.mt-node p { margin-top: 5px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.mt-node a { display: inline-block; margin-top: 10px; }
.mt-track > li + li::before, .mt-branch > .mt-node + .mt-node::before { content: ''; position: absolute; top: -29px; height: 27px; left: calc(50% - 1px); border-left: 1px solid var(--ink-3); }
.mt-track > li + li::after, .mt-branch > .mt-node + .mt-node::after { content: ''; position: absolute; top: -8px; left: calc(50% - 4px); width: 7px; height: 7px; border-right: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3); transform: rotate(45deg); }
.mt-decision { padding: 12px; border: 1px solid var(--ink-3); border-radius: 24px; text-align: center; background: var(--white); font-size: 14px; }
.mt-branches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-top: 22px; position: relative; }
.mt-branches::before { content: ''; position: absolute; left: 50%; top: 0; height: 12px; border-left: 1px solid var(--ink-3); }
.mt-branches::after { content: ''; position: absolute; top: 12px; left: calc(25% - 4px); right: calc(25% - 4px); border-top: 1px solid var(--ink-3); }
.mt-branch { position: relative; min-width: 0; }
.mt-branch::before { content: ''; position: absolute; left: 50%; top: -10px; height: 10px; border-left: 1px solid var(--ink-3); }
.mt-path { display: block; text-align: center; margin-bottom: 10px; color: var(--ink); font-size: 13px; font-weight: 600; }
.mt-branch > .mt-node + .mt-node { margin-top: 28px; }
.mt-proposed { border-style: dashed; border-left-width: 1px; }
.mt-state { display: block; margin-top: 8px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.mt-sequential > * { position: relative; min-width: 0; }
.mt-sequential > * + *::before { content: ''; position: absolute; top: 12px; left: -36px; width: 27px; border-top: 1px solid var(--ink-3); }
.mt-sequential > * + *::after { content: ''; position: absolute; top: 9px; left: -16px; width: 7px; height: 7px; border-top: 1px solid var(--ink-3); border-right: 1px solid var(--ink-3); transform: rotate(45deg); }
.mt-note { padding-left: 15px; border-left: 2px solid var(--control); margin: 20px 0 0; max-width: 90ch; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.mt-note strong { color: var(--ink); }
.mt-conditional { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--control); color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.mt-explain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 36px; margin-top: 28px; }
.mt-explain-grid p, .mt-details p { margin-top: 10px; max-width: 70ch; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.mt-definitions { margin: 14px 0 0; }
.mt-definitions > div { margin-top: 14px; }
.mt-definitions dt { font-size: 14px; font-weight: 600; }
.mt-definitions dd { margin: 4px 0 0; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.mt-compact-flow { margin: 14px 0 0; padding-left: 20px; }
.mt-compact-flow li { padding-left: 3px; margin-bottom: 10px; line-height: 1.6; color: var(--ink-2); }
.mt-compact-flow strong { color: var(--ink); }
.mt-details { margin-top: 26px; padding: 14px 0; border-top: 1px solid var(--rule-strong); }
.mt-details summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.mt-details[open] summary { margin-bottom: 16px; }
.mt-subheading { margin-top: 28px; }
.mt-entity-data { margin: 16px 0 0; border-top: 1px solid var(--rule-strong); }
.mt-entity-data > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.mt-entity-data dt { font-weight: 600; }
.mt-entity-data dd { margin: 0; max-width: 82ch; line-height: 1.65; color: var(--ink-2); }
.mt-counting { margin-top: 28px; }
.mt-counting .mt-explain-grid { margin-top: 16px; }
.mt-audit-finish { max-width: 520px; margin-left: auto; margin-right: auto; }
.mt-audit-passes { margin-top: 28px; position: relative; align-items: stretch; }
.mt-audit-passes::before { content: ''; position: absolute; left: calc((100% - 72px) / 6); top: -28px; height: 26px; border-left: 1px solid var(--ink-3); }
.mt-audit-passes::after { content: ''; position: absolute; left: calc((100% - 72px) / 6 - 3px); top: -8px; width: 7px; height: 7px; border-right: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3); transform: rotate(45deg); }
.mt-audit-passes > * + *::before { top: 50%; }
.mt-audit-passes > * + *::after { top: calc(50% - 3px); }
.mt-audit-return { width: calc((100% + 36px) / 3); height: 20px; margin-left: 50%; border-right: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3); }
.mt-audit-finish { margin-top: 28px; }
.mt-audit-finish > li:first-child::before { content: ''; position: absolute; top: -29px; height: 27px; left: calc(50% - 1px); border-left: 1px solid var(--ink-3); }
.mt-audit-finish > li:first-child::after { content: ''; position: absolute; top: -8px; left: calc(50% - 4px); width: 7px; height: 7px; border-right: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3); transform: rotate(45deg); }
.mt-audit-branches { max-width: 720px; margin: 0 auto; }
.mt-footer { display: flex; flex-wrap: wrap; gap: 18px 30px; padding-top: 24px; }
@media (max-width: 1050px) {
  .mt-columns-two { grid-template-columns: minmax(0, 1fr); }
  .mt-columns-two > .mt-lane + .mt-lane { border-top: 1px solid var(--rule-strong); padding-top: 24px; }
  .mt-columns-two .mt-branches { max-width: 700px; margin: 0 auto; }
}
@media (max-width: 800px) {
  .mt-roles, .mt-columns-three, .mt-explain-grid { grid-template-columns: minmax(0, 1fr); }
  .mt-roles { gap: 16px; }
  .mt-toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-toc a { padding-top: 12px; padding-bottom: 12px; }
  .mt-head h1 { font-size: 27px; }
  .mt-head p { font-size: 16px; }
  .mt-diagram { padding: 18px; }
  .mt-sequential > * + *::before { left: 50%; top: -36px; height: 28px; width: 0; border-top: 0; border-left: 1px solid var(--ink-3); }
  .mt-sequential > * + *::after { left: calc(50% - 3px); top: -15px; border-top: 0; border-bottom: 1px solid var(--ink-3); }
  .mt-audit-passes::before { left: calc(50% - 1px); }
  .mt-audit-passes::after { left: calc(50% - 4px); }
  .mt-audit-return { display: none; }
  .mt-entity-data > div { grid-template-columns: 130px minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 500px) {
  .mt-section { padding-top: 28px; padding-bottom: 28px; }
  .mt-section-head { gap: 10px; }
  .mt-section h2 { font-size: 21px; }
  .mt-diagram { padding: 14px; }
  .mt-branches { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 18px; }
  .mt-branches::before, .mt-branches::after, .mt-branch::before { display: none; }
  .mt-branch { padding-left: 14px; border-left: 1px solid var(--control); }
  .mt-path { text-align: left; }
  .mt-entity-data > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mt-node { padding: 12px; }
  .mt-footer { flex-direction: column; gap: 16px; }
}
@media print {
  .nav, .section-tabs, .mt-toc, .mt-footer { display: none; }
  .mt-node, .mt-section-head, .mt-entity-data > div { break-inside: avoid; }
  .mt-diagram { background: transparent; }
  .mt-section { padding-top: 20px; }
}
