/* Math-order flow pages (option B · node graph, owner pick 2026-10-31). Colours ONLY from aijanitor-tokens.css; every
   relationship is carried by shape + position + a word, so the page reads in grayscale (whole-site-motion-plan.md:78). */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 13px; }
a { color: var(--amber); }
.wrap { max-width: 1320px; margin: 0 auto; padding: 16px; }
.crumbs { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: var(--label-track); margin-bottom: 8px; }
.crumbs a { text-decoration: none; }
h1 { font-size: clamp(18px, 3vw, 26px); margin: 0 0 6px; letter-spacing: .02em; }
.lede { color: var(--muted); max-width: 70rem; margin: 0 0 10px; font-family: system-ui, sans-serif; font-size: 13px; line-height: 1.5; }
.bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 8px 0 14px; }
select { background: var(--bg); color: var(--text); border: 1px solid var(--amber); font: inherit; min-height: 44px; padding: 0 8px; }
.totals { border: 1px solid var(--layer-edge); padding: 6px 10px; font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; border: 1px solid var(--layer-edge); padding: 8px 10px; margin-bottom: 14px; }
.legend b { color: var(--amber); }
.strip { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 14px; }
.strip a { border: 1px solid var(--text); padding: 6px 8px; text-decoration: none; color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }
.strip .arr { color: var(--amber); }
.phase { margin: 0 0 22px; border-top: 1px solid var(--layer-edge); padding-top: 10px; }
.ph-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; cursor: pointer; border: 1px solid var(--text); padding: 8px 10px; margin-bottom: 8px; }
.ph-head .n { font-weight: 700; color: var(--amber); }
.ph-head .t { font-weight: 700; }
.ph-head .c, .ph-head .o { color: var(--muted); font-size: 12px; }
.ph-head[data-order="fixed"] { border-width: 2px; }
.ph-foot { font-size: 12px; font-weight: 700; margin-top: 4px; }
.graph { overflow: visible; display: block; }
svg text { font-family: var(--mono); }
.nd { fill: var(--bg); stroke: var(--text); stroke-width: 1.2; }
.nd.mm { stroke: var(--amber); stroke-width: 2.6; }
.nd.recur { stroke-dasharray: 8 3; stroke-width: 2.2; }
.nd.dd { stroke-dasharray: 2 3; stroke-width: 2; }
.nd2 { fill: none; stroke: var(--text); stroke-width: 1.2; }
.tx { fill: var(--text); font-size: 11.5px; font-weight: 700; }
.td { fill: var(--muted); font-size: 9.5px; }
.tw { fill: var(--amber); font-size: 9.5px; font-weight: 700; }
.sumb rect { fill: var(--bg); stroke: var(--amber); stroke-width: 1; }
.sumb text { fill: var(--amber); font-size: 9.5px; font-weight: 700; }
.e { stroke: var(--amber); stroke-width: 1.6; fill: none; marker-end: url(#ah); }
.ef { stroke: var(--text); stroke-width: 1.1; fill: none; stroke-dasharray: 4 3; }
.fr { fill: none; stroke: var(--amber); stroke-width: 1.2; stroke-dasharray: 10 4; }
.frl { fill: var(--amber); font-size: 11px; font-weight: 700; }
.gl { fill: var(--text); font-size: 9.5px; font-weight: 700; letter-spacing: .06em; }
[data-id] { cursor: pointer; }
[data-id]:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
g[data-id]:focus-visible .nd { stroke: var(--focus); stroke-width: 3; }
.datapath { color: var(--muted); font-size: 11px; margin-top: 20px; word-break: break-all; }
.note { color: var(--muted); font-size: 11.5px; }
/* data modal (desktop) / bottom sheet (phone): one template, fixed section order */
.dim-all { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 10; }
.modal { position: fixed; background: var(--bg); border: 1px solid var(--amber); padding: 14px 16px; z-index: 11; max-height: calc(100vh - 60px); overflow: auto; }
.modal.desk { left: 50%; top: 40px; transform: translateX(-50%); width: min(600px, calc(100vw - 32px)); }
.modal.sheet { left: 0; right: 0; bottom: 0; max-height: 80vh; padding-bottom: 22px; }
.modal h3 { margin: 0 0 4px; font-size: 16px; display: flex; justify-content: space-between; gap: 10px; word-break: break-word; }
.modal .x { background: none; border: 1px solid var(--text); color: var(--text); min-width: 44px; min-height: 44px; font: inherit; cursor: pointer; }
.modal .kindline { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.modal h4 { margin: 10px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; border-top: 1px solid var(--layer-edge); padding-top: 6px; color: var(--amber); }
.modal .mean { font-family: system-ui, sans-serif; font-size: 14px; margin: 0 0 6px; line-height: 1.45; }
.modal .f { font-size: 12.5px; border: 1px solid var(--layer-edge); padding: 6px 8px; margin-bottom: 6px; overflow-x: auto; }
.modal table { border-collapse: collapse; width: 100%; font-size: 12px; }
.modal td { padding: 4px; border-top: 1px solid var(--layer-edge); vertical-align: top; word-break: break-word; }
.modal td:first-child { color: var(--muted); width: 32%; }
.modal ul { margin: 0; padding-left: 16px; font-size: 11.5px; word-break: break-all; }
.modal .none { font-size: 12px; color: var(--muted); margin: 0; }
.modal .none::before { content: "∅ "; }
.grab { width: 40px; height: 4px; background: var(--muted); margin: -4px auto 10px; }
.idx { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.idx a { display: block; border: 1px solid var(--text); padding: 10px; text-decoration: none; color: var(--text); min-height: 44px; }
.idx a b { color: var(--amber); display: block; margin-bottom: 4px; }
.idx a span { color: var(--muted); font-size: 11.5px; }
@media (max-width: 600px) { .wrap { padding: 16px; } .legend { font-size: 11px; } }
