/* meta-v4.css - Meerkat Meta: a small application of ongoing agents, drawn live in SVG.
   Loaded after visual-polish.css. Scoped to #meta; the drawing lives in #meta-app (.mw-*). */

#meta .mw { margin: 0 0 40px; }
#meta .mw-pane .mw-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding: 14px 20px 0; }
#meta .mw-k { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--mid); }
#meta .mw-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--ink-2); }
#meta .mw-legend > span { display: inline-flex; align-items: center; gap: 7px; }
#meta .mw-legend i { flex: none; display: block; box-sizing: border-box; }
#meta .g-person { width: 12px; height: 12px; border-radius: 50%; border: 1.3px solid var(--mid); position: relative; }
#meta .g-person::after { content: ""; position: absolute; inset: 2.6px; border-radius: 50%; background: var(--mid); }
#meta .g-agent { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
#meta .g-worker { width: 10px; height: 10px; border-radius: 50%; border: 1.3px solid var(--ink); }
#meta .g-task { width: 8px; height: 8px; border: 1.3px solid var(--ink); }
#meta .g-mem { width: 12px; height: 9px; border-top: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); position: relative; }
#meta .g-mem::after { content: ""; position: absolute; left: 0; right: 0; top: 1.5px; height: 2px; background: var(--ink-2); }

#meta .mw-stage { position: relative; height: 420px; }
#meta .mw-pane:not(.mw-js) .mw-stage, #meta .mw-pane:not(.mw-js) .mw-legend { display: none; }
#meta .mw-pane[hidden] { display: none; }
#meta .mw-pane + .mw-pane:not([hidden]) { margin-top: 0; }
#meta .mw:not(:has(.mw-switch:not([hidden]))) .mw-pane + .mw-pane { margin-top: 24px; }
#meta .mw-pane.is-paused .key[aria-selected="true"] .cap::after { background: var(--ink-2); }
#meta .mw-pane.is-paused .key-pause { color: var(--ink); }
#meta .mw-pane.is-paused .key-pause .cap { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(28, 28, 26, 0.12); }

/* View switch: two keys on the instrument panel, above the screen */
#meta .mw-switch { display: flex; gap: 6px; padding: 0 0 10px; }
#meta .mw-switch[hidden] { display: none; }
#meta .mw-view { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 16px; border-radius: 8px; background: var(--screen); box-shadow: 0 1px 0 rgba(28, 28, 26, 0.12), inset 0 -2px 0 rgba(28, 28, 26, 0.05); font: 500 14px/1 var(--sans); color: var(--mid); transition: transform 0.08s, box-shadow 0.08s; }
#meta .mw-view::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background 0.2s; }
#meta .mw-view:hover { color: var(--ink); }
#meta .mw-view[aria-selected="true"] { color: var(--ink); transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(28, 28, 26, 0.12); }
#meta .mw-view[aria-selected="true"]::before { background: var(--accent); }
#meta .mw-view:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* Memory drawing */
#meta .mw-stage .lane { stroke: rgba(28, 28, 26, 0.12); stroke-width: 1; }
#meta .mw-stage .frag { stroke: rgba(28, 28, 26, 0.45); stroke-width: 3; stroke-linecap: round; }
#meta .mw-stage .arch { fill: #efeee8; stroke: rgba(28, 28, 26, 0.22); stroke-width: 1; }
#meta .mw-stage .arch-l { stroke: rgba(28, 28, 26, 0.28); stroke-width: 1.4; }
#meta .mw-stage .spark { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
#meta .mw-stage .spark.bad { stroke-width: 2; stroke-dasharray: 2 2.5; stroke-linecap: butt; }
#meta .mw-stage .mrec .bar { fill: var(--ink-2); }
#meta .mw-stage .mrec .ev { fill: var(--ink-2); }
#meta .mw-stage .mrec .evl { stroke: rgba(28, 28, 26, 0.4); stroke-width: 1; }
#meta .mw-stage .mrec .use, #meta .mw-stage .mrec .strike { display: none; stroke-width: 1.5; stroke-linecap: round; }
#meta .mw-stage .mrec .use { stroke: var(--accent); }
#meta .mw-stage .mrec .strike { stroke: var(--ink); }
#meta .mw-stage .mrec.used .use, #meta .mw-stage .mrec.struck .strike { display: inline; }
#meta .mw-stage .mrec.struck .bar { fill: rgba(28, 28, 26, 0.22); }
#meta .mw-stage .mrec.hot .bar, #meta .mw-stage .mrec.hot .ev, #meta .mw-stage .mrec.conf .bar { fill: var(--accent); }
#meta .mw-stage .mrec.sus .bar { fill: var(--screen); stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 2 2; }
#meta .mw-stage .mrec.sus .ev { fill: var(--accent); }
#meta .mw-stage .quar { fill: rgba(28, 28, 26, 0.03); stroke: rgba(28, 28, 26, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
#meta .mw-stage .quar.hot { stroke: var(--accent); }
#meta .mw-stage .small.hot { fill: var(--accent-ink); }
#meta .mw-stage .slot { fill: var(--screen); stroke: rgba(28, 28, 26, 0.3); stroke-width: 1; }
#meta .mw-stage .slot.hot { stroke: var(--accent); }
#meta .mw-stage .copy { fill: var(--ink-2); }
#meta .mw-stage .copy.hot { fill: var(--accent); }
#meta .mw-stage .sup { fill: none; stroke: var(--accent); stroke-width: 1.2; }
#meta .mw-stage .sweep { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 1 3; }
#meta .mw-stage .confl { stroke: var(--accent); stroke-width: 1.3; stroke-dasharray: 4 3; }
#meta .mw-stage .outbox { fill: var(--ink); }
#meta .mw-stage .outbox.held { fill: var(--screen); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 2; }
#meta .mw-stage .agent.hot { fill: var(--accent); }
#meta .g-rec { width: 22px; height: 7px; position: relative; }
#meta .g-rec::before { content: ""; position: absolute; left: 0; top: 1.5px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-2); }
#meta .g-rec::after { content: ""; position: absolute; left: 8px; top: 0; width: 14px; height: 7px; border-radius: 2px; background: var(--ink-2); }
#meta .mw-stage svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; font-family: var(--sans); }

/* Drawing styles; positions, opacity and state are set per frame by meta-v4.js. */
#meta .mw-stage .box { fill: none; stroke: rgba(28, 28, 26, 0.26); stroke-width: 1; stroke-dasharray: 4 4; }
#meta .mw-stage .edge { fill: none; stroke: rgba(28, 28, 26, 0.2); stroke-width: 1; }
#meta .mw-stage .edge.own { stroke: rgba(28, 28, 26, 0.42); }
#meta .mw-stage .route { fill: none; stroke: rgba(28, 28, 26, 0.32); stroke-width: 1; stroke-dasharray: 2 3; }
#meta .mw-stage .tether { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 3; }
#meta .mw-stage .arc { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 4; }
#meta .mw-stage .spine { stroke: rgba(28, 28, 26, 0.35); stroke-width: 1; }
#meta .mw-stage .rec { fill: var(--ink-2); }
#meta .mw-stage .rec.hot, #meta .mw-stage .chip { fill: var(--accent); }
#meta .mw-stage .agent { fill: var(--ink); }
#meta .mw-stage .agent.hot { fill: var(--accent); }
#meta .mw-stage .coord { fill: none; stroke: var(--ink); stroke-width: 1.1; opacity: 0.6; }
#meta .mw-stage .coord.hot { stroke: var(--accent); opacity: 1; }
#meta .mw-stage .person { fill: var(--screen); stroke: var(--mid); stroke-width: 1.3; }
#meta .mw-stage .person.hot { stroke: var(--accent); }
#meta .mw-stage .pdot { fill: var(--mid); }
#meta .mw-stage .worker { fill: var(--screen); stroke: var(--ink); stroke-width: 1.3; }
#meta .mw-stage .worker.hot { stroke: var(--accent); stroke-width: 1.5; }
#meta .mw-stage .task { fill: var(--screen); stroke: var(--ink); stroke-width: 1.3; }
#meta .mw-stage .task.claimed { fill: var(--accent); stroke: var(--accent); }
#meta .mw-stage .task.done { fill: var(--ink); stroke: var(--ink); }
#meta .mw-stage .ring { fill: none; stroke: var(--accent); stroke-width: 1.5; }
#meta .mw-stage .env { fill: var(--screen); stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
#meta .mw-stage .env.hot { stroke: var(--accent); }
#meta .mw-stage .gate { stroke: var(--ink-2); stroke-width: 2.4; stroke-linecap: round; }
#meta .mw-stage .gate.wait { stroke: var(--accent); }
#meta .mw-stage .dot { fill: var(--accent); }
#meta .mw-stage .trail { stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; opacity: 0.35; }
#meta .mw-stage text { paint-order: stroke; stroke: var(--screen); stroke-width: 4px; stroke-linejoin: round; }
#meta .mw-stage .lab { font-size: 13px; font-weight: 500; fill: var(--ink); }
#meta .mw-stage .lab.person-lab { font-weight: 600; }
#meta .mw-stage .lab.idle { fill: var(--ink-2); }
#meta .mw-stage .small { font-size: 10px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; fill: var(--mid); }
#meta .mw-stage .wait-lab { font-size: 12px; font-weight: 600; fill: var(--accent-ink); }
#meta .mw-stage .btn rect { fill: var(--screen); stroke: rgba(28, 28, 26, 0.3); stroke-width: 1; }
#meta .mw-stage .btn text { font-size: 12px; font-weight: 500; fill: var(--ink); stroke: none; }
#meta .mw-stage .btn.pressed rect { fill: var(--ink); stroke: var(--ink); }
#meta .mw-stage .btn.pressed text { fill: var(--screen); }

/* Caption, controls, and the readable description */
#meta .mw-ctl[hidden] { display: none; }
#meta .mw-cap { margin: 0; padding: 14px 8px 2px; min-height: 46px; font-size: 15px; font-weight: 500; line-height: 1.45; letter-spacing: -0.005em; color: var(--ink); text-wrap: pretty; }
#meta .mw-notes ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; margin: 0; padding: 16px 8px 6px; list-style: none; }
#meta .mw-notes li { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
#meta .mw-notes li b { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent-ink); }
#meta .mw-notes.mw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hand-off to the next section */
#meta .mx-next { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
#meta .mx-next a { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; }
#meta .mx-next a::after { content: ""; width: 7px; height: 7px; margin-top: -3px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
#meta .mx-next a:hover { color: var(--accent-ink); }
#meta .mx-next a:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 4px; }

@media (max-width: 720px) {
  #meta .mw { margin-bottom: 28px; }
  #meta .mw-switch { padding-bottom: 8px; }
  #meta .mw-view { flex: 1; justify-content: center; }
  #meta .mw-pane .mw-top { padding: 12px 14px 0; gap: 6px 16px; }
  #meta .mw-legend { gap: 4px 14px; font-size: 11.5px; }
  #meta .mw-cap { font-size: 14.5px; min-height: 52px; padding-top: 12px; }
  #meta .mw-notes ol { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  #meta .mw .key-progress { display: none; }
}
