/* Lecture 09 drawings inherit the standard shared lesson layout and pane heights. */
.nc-visual { display:grid; gap:3px; width:min(100%,760px); min-width:0; color:var(--brand-deep); font-family:var(--mono); font-size:13px; line-height:18px; }
.nc-heading { min-height:18px; color:var(--muted); font-size:12px; }
.nc-array-row { display:grid; grid-template-columns:26px minmax(0,1fr); align-items:center; gap:4px; min-width:0; }
.nc-array-row > strong { font-size:12px; font-weight:500; }
.nc-array-scroll,.nc-table-scroll,.nc-queue-scroll { min-width:0; max-width:100%; overflow:auto; }
.nc-array { display:grid; grid-template-columns:repeat(var(--nc-items),minmax(0,1fr)); gap:3px; min-width:calc(var(--nc-items) * var(--nc-cell)); }
.nc-cell { display:grid; min-width:0; text-align:center; }
.nc-cell small { color:var(--muted); font-size:12px; line-height:14px; }
.nc-cell b { display:flex; justify-content:center; border:1px solid var(--border-strong); background:var(--surface); padding:2px 1px; font-size:13px; line-height:18px; font-weight:600; }
.nc-cell.is-action b,.nc-count-table td.is-action { background:var(--accent-soft); outline:2px solid var(--accent); outline-offset:-2px; }
.nc-cell.is-counted b,.nc-count-table td.is-counted,.nc-queue-item.is-counted { background:var(--teal-soft); outline:2px solid var(--teal); outline-offset:-2px; color:#17655f; }
.nc-cell.is-retained b { border-bottom:2px solid var(--brand); padding-bottom:1px; }
.nc-origin { min-height:14px; }
.nc-count-table { width:100%; border-collapse:collapse; text-align:center; }
.nc-count-table th,.nc-count-table td { min-width:28px; padding:1px 5px; border:1px solid var(--border-strong); font-size:12px; line-height:17px; white-space:nowrap; }
.nc-count-table th { font-weight:500; color:var(--muted); }
.nc-count-table tbody tr:nth-child(2) { background:var(--brand-soft); }
.nc-equation { min-height:24px; padding:3px 4px; background:var(--brand-soft); text-align:center; overflow-wrap:anywhere; font-size:12px; line-height:18px; }
.nc-equation.is-counted { background:var(--teal-soft); color:#17655f; outline:1px solid var(--teal); outline-offset:-1px; }
.nc-bins { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px 8px; min-width:0; }
.nc-bin { display:grid; grid-template-columns:42px minmax(0,1fr); align-items:center; min-width:0; min-height:20px; border:1px solid var(--border-strong); background:var(--surface); }
.nc-bin > strong { text-align:center; font-size:12px; line-height:18px; color:var(--muted); font-weight:500; border-right:1px solid var(--border); }
.nc-bin.is-active { outline:2px solid var(--accent); outline-offset:-2px; }
.nc-bin.is-active > strong { color:#70400b; background:var(--accent-soft); }
.nc-queue { display:flex; gap:6px; min-width:max-content; align-items:center; padding-inline:3px; }
.nc-queue-item { display:flex; justify-content:center; min-width:24px; padding:0 2px; font-size:13px; line-height:18px; }
.nc-empty { padding-inline:4px; color:var(--muted); font-size:12px; }
.nc-radix .nc-array { min-width:calc(var(--nc-items) * var(--nc-cell) + (var(--nc-items) - 1) * 3px); }
.nc-radix .nc-cell b { gap:2px; padding:0 2px; font-size:16px; line-height:22px; }
.nc-radix .nc-cell.is-retained b { padding-bottom:0; }
.nc-radix .nc-queue-item { gap:2px; padding:0; font-size:14px; }
.nc-radix .nc-queue-item .nc-digit,.nc-radix .nc-queue-item .nc-earlier-digits { padding-inline:0; }
.nc-radix .nc-queue-item.is-counted { outline-offset:1px; }
.nc-digit { padding-inline:1px; background:var(--accent-soft); border-radius:3px; font-weight:800; }
.nc-earlier-digits { padding-inline:1px; background:var(--brand-soft); letter-spacing:1px; font-weight:500; }
.nc-verified-digits { padding-inline:2px; color:var(--success); background:#e3f3e9; letter-spacing:1px; }
.nc-cell.is-group-start b { border-left:3px solid var(--brand); }
.nc-mark-new { padding-inline:2px; color:#70400b; background:var(--accent-soft); }
.nc-mark-keep { padding-inline:2px; background:var(--brand-soft); }
.nc-pass-proof { display:grid; gap:4px; align-content:center; min-height:92px; min-width:0; padding:6px 8px; border:1px solid var(--border-strong); background:var(--brand-soft); font-size:12px; line-height:18px; }
.nc-proof-witness { display:flex; align-items:center; gap:6px; min-width:0; }
.nc-proof-witness > strong { flex:none; font-size:12px; font-weight:500; }
.nc-proof-items-scroll { min-width:0; max-width:100%; overflow:auto; }
.nc-proof-items { display:flex; align-items:center; gap:4px; min-width:max-content; padding:2px; }
.nc-proof-key { display:inline-flex; gap:2px; font-size:16px; line-height:22px; }
.nc-proof-arrow { color:var(--muted); }
.nc-proof-lower { overflow-wrap:anywhere; }
.nc-suffix-proof { display:flex; gap:6px; align-items:center; min-width:0; min-height:24px; padding:3px 4px; font-size:12px; line-height:18px; }
.nc-suffix-proof > strong { flex:none; font-weight:500; }
.nc-suffix-proof > div { min-width:0; overflow:auto; white-space:nowrap; }
.nc-suffix-proof.is-verified { color:var(--success); background:#e3f3e9; outline:1px solid var(--success); outline-offset:-1px; }
@media(max-width:580px) {
  .nc-bins { column-gap:5px; }
  .nc-queue { gap:6px; }
  .nc-queue-item { padding-inline:1px; }
}

/* Instructor-requested MSD extension. */
.nc-msd .nc-array { min-width:calc(var(--nc-items) * var(--nc-cell) + (var(--nc-items) - 1) * 3px); }
.nc-msd .nc-cell b { gap:2px; padding:0 2px; font-size:16px; line-height:22px; }
.nc-msd-tree-scroll { min-width:0; max-width:100%; overflow:auto; }
.nc-msd-tree { position:relative; display:grid; grid-template-columns:repeat(var(--nc-items),minmax(0,1fr)); grid-template-rows:repeat(var(--nc-levels),22px); column-gap:3px; min-width:calc(var(--nc-tree-width) + (var(--nc-items) - 1) * 3px); }
.nc-msd-tree > svg { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.nc-msd-tree path { fill:none; stroke:var(--border-strong); stroke-width:1; }
.nc-msd-node { position:relative; align-self:start; min-width:0; height:18px; padding:1px 2px; border:1px solid var(--border-strong); background:var(--surface); font-size:12px; line-height:14px; text-align:center; white-space:nowrap; }
.nc-msd-node.is-active,.nc-msd-node.is-next { border-color:var(--accent); background:var(--accent-soft); }
.nc-msd-node.is-counted { border-color:var(--teal); background:var(--teal-soft); }
.nc-msd-node.is-complete { border-color:var(--success); color:var(--success); background:#e3f3e9; }
.nc-msd .nc-in-range b { border-bottom:2px solid var(--brand); }
.nc-msd-prefix { padding-inline:1px; background:var(--brand-soft); letter-spacing:1px; font-weight:500; }
.nc-msd-buckets { display:flex; flex-wrap:wrap; gap:4px 6px; min-width:0; min-height:36px; }
.nc-msd-bucket { max-width:100%; min-width:0; border:1px solid var(--border-strong); background:var(--surface); }
.nc-msd-bucket > strong { display:block; padding-inline:3px; color:var(--muted); font-size:12px; line-height:14px; font-weight:500; }
.nc-msd-bucket.is-active { outline:2px solid var(--accent); outline-offset:-2px; }
.nc-msd-bucket-items { display:flex; gap:6px; min-width:0; padding:1px 3px; overflow:auto; }
.nc-msd-key { display:inline-flex; flex:none; gap:2px; font-size:14px; line-height:18px; }
.nc-msd-empty { align-self:center; padding:4px; color:var(--muted); font-size:12px; }

/* American flag: one live array, reserved ranges, and cycle permutations. */
.nc-flag-row { display:grid; grid-template-columns:26px minmax(0,1fr); gap:4px; min-width:0; }
.nc-flag-row-labels { display:grid; grid-template-rows:14px 24px 14px 18px; align-items:center; text-align:left; }
.nc-flag-row-labels strong,.nc-flag-row-labels small { font-size:12px; line-height:14px; font-weight:500; }
.nc-flag-board { min-width:calc(var(--nc-items) * var(--nc-cell) + (var(--nc-items) - 1) * 3px); }
.nc-flag .nc-cell b { gap:2px; padding:0 2px; font-size:16px; line-height:22px; }
.nc-flag .nc-flag-target b { border-color:var(--brand); outline:1px dashed var(--brand); outline-offset:-2px; }
.nc-flag-ranges { display:grid; grid-template-columns:repeat(var(--nc-items),minmax(0,1fr)); gap:3px; min-height:16px; margin-top:2px; font-size:12px; line-height:14px; text-align:center; }
.nc-flag-ranges > span { min-width:0; border-top:2px solid var(--brand); white-space:nowrap; }
.nc-flag-ranges .is-filled { color:var(--success); background:#e3f3e9; border-color:var(--success); }
.nc-flag-table-scroll { min-width:0; max-width:100%; overflow:auto; }
.nc-flag-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:12px; line-height:16px; text-align:center; }
.nc-flag-table th,.nc-flag-table td { min-width:24px; padding:0 3px; border:1px solid var(--border-strong); white-space:nowrap; }
.nc-flag-table th:first-child { width:46px; }
.nc-flag-table th { color:var(--muted); font-weight:500; }
.nc-flag-table .is-action { background:var(--accent-soft); color:#70400b; }
.nc-flag-table .is-counted { background:var(--teal-soft); color:#17655f; outline:2px solid var(--teal); outline-offset:-2px; }
.nc-flag-placeholder { display:grid; place-items:center; min-height:86px; padding:8px; border:1px solid var(--border-strong); background:var(--brand-soft); font-size:12px; line-height:18px; text-align:center; }
.nc-flag-cycle { display:flex; align-items:center; gap:6px; min-width:0; min-height:18px; font-size:12px; line-height:18px; }
.nc-flag-cycle strong { flex:none; font-weight:500; }
.nc-flag-cycle > div { min-width:0; overflow:auto; white-space:nowrap; }
[data-module="09-non-comparison-sorting/american-flag-sort"] .code-indent-4 { padding-left:72px; }
