.trace-mam { --mamt-accent:#165455; --mamt-dark:#213f49; --mamt-border:#b6c7c5; color:var(--mamt-dark); font:inherit; margin:0 auto 2rem; max-width:68rem; }
.trace-mam *, .trace-mam-paper * { box-sizing:border-box; }
.trace-mam h1, .trace-mam h2, .trace-mam p { margin:0; color:inherit; }
.trace-mam h1 { font-size:clamp(1.8rem,4.5vw,2.9rem); line-height:1.12; letter-spacing:-.035em; }
.trace-mam h2 { font-size:1.32rem; line-height:1.25; letter-spacing:normal; }
.trace-mam p { line-height:1.5; }
.mamt-heading, .mamt-pad-title { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.8rem 1rem; }
.mamt-heading { margin-bottom:1.2rem; }
.mamt-heading p { margin-top:.35rem; }
.trace-mam button, .trace-mam select { font:inherit; font-weight:600; border:1px solid #91aaa7; color:var(--mamt-dark); background:#fff; border-radius:.55rem; min-height:44px; min-width:44px; padding:.47rem .75rem; box-shadow:none; line-height:1.25; }
.trace-mam button { cursor:pointer; }
.trace-mam button:hover:not(:disabled), .trace-mam summary:hover { background:#e5f0ec; }
.trace-mam button:disabled { background:#edf1ef; color:#566965; border-color:#c5d0cc; cursor:default; opacity:1; }
.trace-mam :is(button,select,summary):focus-visible { outline:3px solid #116179; outline-offset:3px; }
.mamt-controls { display:flex; align-items:flex-end; gap:.65rem; flex-wrap:wrap; padding:1rem 0 1.2rem; }
.mamt-controls label { display:grid; gap:.3rem; font-weight:650; }
.mamt-controls select { width:auto; }
.trace-mam .mamt-controls button { color:#fff; background:var(--mamt-accent); border-color:var(--mamt-accent); }
.trace-mam .mamt-controls button:hover { background:#103e40; }
.mamt-layout { display:grid; grid-template-columns:minmax(0,1.75fr) minmax(15rem,1fr); gap:1rem; align-items:start; }
.mamt-pad, .mamt-steps { background:#fff; border:1px solid var(--mamt-border); border-radius:1rem; padding:clamp(.8rem,2vw,1.3rem); min-width:0; }
.mamt-pad-title span { font-size:.88rem; color:#47605f; }
.mamt-board { display:block; width:100%; height:auto; max-height:24rem; margin:.5rem auto; padding:0; background:#fbfcf9; border:1px solid #c4d1ca; border-radius:.55rem; touch-action:none; user-select:none; -webkit-user-select:none; -webkit-tap-highlight-color:transparent; cursor:crosshair; overflow:hidden; }
.mamt-rule, .mamt-mid, .mamt-tail, .mamt-template, .mamt-arrow, .mamt-start, .mamt-ink path { fill:none; stroke-linecap:round; stroke-linejoin:round; }
.mamt-rule { stroke:#657971; stroke-width:.9; }
.mamt-mid { stroke:#61766f; stroke-width:1; stroke-dasharray:.9 3; }
.mamt-tail { stroke:#9aa9a2; stroke-width:.65; }
.mamt-template { stroke:#70847c; stroke-width:2.25; stroke-dasharray:1.6 3.4; }
.mamt-template.mamt-current { stroke:#344f52; }
.mamt-template.mamt-dot { stroke-width:4; stroke-dasharray:none; }
.mamt-start { stroke:#874920; stroke-width:1.65; fill:#fff7e1; }
.mamt-arrow { stroke:#874920; stroke-width:1.85; }
.mamt-ink path { stroke:#146372; stroke-width:3.3; }
.mamt-pad-actions, .mamt-step-actions { display:flex; gap:.5rem; flex-wrap:wrap; }
.mamt-steps > p { margin:.55rem 0 1rem; }
.mamt-instruction { border-left:4px solid var(--mamt-accent); background:#eef5f0; padding:.8rem; }
.mamt-instruction strong { font-size:.9rem; font-weight:700; }
.mamt-instruction p { margin:.3rem 0 0; }
.mamt-step-actions { margin-top:.7rem; }
.mamt-lines { margin-top:1rem; }
.mamt-lines summary { cursor:pointer; font-weight:650; min-height:44px; padding:.6rem .1rem; }
.mamt-lines p { margin:.15rem 0 .5rem; }
.mamt-status { min-height:1.5em; margin-top:.4rem!important; }
.mamt-page-copy { display:none; }
@media(max-width:46rem) { .mamt-layout { grid-template-columns:minmax(0,1fr); } .mamt-board { max-height:20rem; } }
@media(forced-colors:active) {
  .mamt-rule, .mamt-mid, .mamt-tail, .mamt-template { stroke:GrayText; }
  .mamt-template.mamt-current, .mamt-arrow, .mamt-start { stroke:CanvasText; }
  .mamt-start { fill:Canvas; }
  .mamt-ink path { stroke:Highlight; }
}
@media print {
  body.mamt-printing { display:block!important; margin:0!important; padding:0!important; background:#fff!important; color:#111!important; }
  body.mamt-printing > :not(.mamt-page-copy) { display:none!important; }
  body.mamt-printing > .mamt-page-copy { display:block!important; position:static!important; max-width:none!important; margin:0!important; padding:0!important; border:0!important; box-shadow:none!important; visibility:visible!important; }
  .trace-mam-paper { color:#111; font:13pt/1.35 Arial,sans-serif; }
  .trace-mam-paper h1 { font-size:23pt; margin:.3em 0; color:#111; }
  .trace-mam-paper h2 { font-size:16pt; margin:.8em 0 .35em; color:#111; }
  .trace-mam-paper p { margin:.3em 0; }
  .mamt-print-steps { padding-left:1.6em; margin:0; }
  .mamt-print-steps li { padding-left:.2em; break-inside:avoid; }
  .mamt-step-mini { width:45pt; display:inline-block; vertical-align:middle; margin-right:8pt; }
  .mamt-print-grid { width:100%; height:auto; display:block; fill:none; }
  .mamt-print-row { display:grid; grid-template-columns:repeat(3,1fr); gap:4pt; break-inside:avoid; }
  .mamt-print-note { font-size:10pt; }
  .trace-mam-paper .mamt-rule { stroke:#595959; stroke-width:1; }
  .trace-mam-paper .mamt-mid { stroke:#777; stroke-width:1; stroke-dasharray:1 4; }
  .trace-mam-paper .mamt-tail { stroke:#959595; stroke-width:.6; }
  .trace-mam-paper .mamt-template { stroke:#707070; stroke-width:2; stroke-dasharray:2 3.5; }
  .trace-mam-paper .mamt-template.mamt-current, .trace-mam-paper .mamt-arrow, .trace-mam-paper .mamt-start { stroke:#111; }
  .trace-mam-paper .mamt-start { fill:white; }
  .trace-mam-paper .mamt-template.mamt-dot { stroke-width:4; stroke-dasharray:none; }
}
