:root {
  --stage: #111111; --panel: #262626; --panel-2: #333333; --sink: #ffffff; --muted: #aea79f; --line: #4d4d4d; --accent: #e95420; --cable: #ffffff; --danger: #e36a5c;
  --font-ui: "Ubuntu", system-ui, sans-serif; --font-mono: "Ubuntu Mono", ui-monospace, monospace;
  --hi-fill: #3d2419; --app-fill: #3a3a3a; --term-fill: #0d0d0d; --district: #3a3a3a; --road: #5a5a5a; --node-line: #6a6a6a;
  /* journeys: a line in --journey over a casing in --journey-case; the special
     one ("start here") in --journey-special, wider and with a soft glow. The
     ink colours are the badge numbers drawn on those fills. */
  --journey: var(--accent); --journey-ink: #ffffff; --journey-special: #ffc83d; --journey-special-ink: #1a1a1a; --journey-case: var(--stage);
  /* audience colours (--aud-<id>) and .aud-<id> classes are generated from site.json */
}
.slide svg text { font-family: var(--font-ui); font-size: 16px; fill: var(--sink); }
.slide svg .title { font-weight: 300; font-size: 54px; }
.slide svg .kicker { font-weight: 500; font-size: 20px; fill: var(--accent); letter-spacing: 0.08em; }
.slide svg .big { font-weight: 400; font-size: 30px; }
.slide svg .mono { font-family: var(--font-mono); font-size: 16px; white-space: pre; }
.slide svg .mono.sm { font-size: 14px; }
.slide svg .muted { fill: var(--muted); }
.slide svg .box { fill: var(--panel-2); stroke: var(--line); stroke-width: 1.5; }
.slide svg .snapbox { fill: none; stroke: var(--sink); stroke-width: 2; }
.slide svg .app { fill: var(--app-fill); stroke: var(--sink); stroke-width: 1.5; }
.slide svg .hi { fill: var(--hi-fill); stroke: var(--accent); stroke-width: 2; }
.slide svg .plug { fill: var(--stage); stroke: var(--cable); stroke-width: 2; }
.slide svg .plug.off { stroke: var(--line); }
.slide svg .sys { fill: var(--panel-2); stroke: var(--muted); stroke-width: 1.5; }
.slide svg .cable { stroke: var(--cable); stroke-width: 2.5; fill: none; }
.slide svg .cable.off { stroke: var(--line); stroke-dasharray: 3 5; }
.slide svg .edge { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.slide svg .accent { fill: var(--accent); }
.slide svg .badtext { fill: var(--danger); }
.slide svg .term { fill: var(--term-fill); stroke: var(--line); }
.slide svg .cut { stroke: var(--danger); stroke-width: 4; }
.slide svg .attach { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-dasharray: 8 5; }

/* ---- reading pages (dist/<topic>/index.html): one deck as a static page, every step shown ---- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--stage); color: var(--sink); font-family: var(--font-ui); font-size: 17px; line-height: 1.55; border-top: 4px solid var(--accent); }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px 60px; }
a { color: var(--accent); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--muted); padding: 14px 0 10px; border-bottom: 1px solid var(--line); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--sink); }
.deckhead h1 { font-weight: 300; font-size: 2rem; line-height: 1.2; margin: 18px 0 4px; }
.deckhead .kind { color: var(--muted); font-size: 15px; margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.deckhead .lead { font-size: 1.1rem; margin: 6px 0; max-width: 75ch; }
.deckhead .place { color: var(--muted); font-size: 15px; margin: 4px 0 12px; }
.chip { font-size: 13px; color: #fff; background: var(--aud, var(--panel-2)); border-radius: 999px; padding: 2px 10px; vertical-align: middle; font-weight: 400; white-space: nowrap; }
.chip.alt { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
a.watch { display: inline-block; font-weight: 500; color: var(--stage); background: var(--accent); border-radius: 8px; padding: 8px 16px; text-decoration: none; margin: 4px 0 8px; }
a.watch:hover { filter: brightness(1.1); }
.before, .journeys { margin: 10px 0; padding: 10px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 15px; }
.before h2, .journeys h2 { font-size: 1rem; font-weight: 500; margin: 0 0 4px; }
.before ul, .journeys ul { margin: 0; padding-left: 1.2em; }
.scene { margin: 34px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.scene > h2 { font-weight: 500; font-size: 1.3rem; margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.scene > h2 .n { color: var(--accent); font-size: 0.95rem; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.slide { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.slide svg { width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; background: var(--panel); }
.slide figcaption { font-size: 13px; color: var(--muted); padding: 6px 14px 8px; border-top: 1px solid var(--line); }
.scene .short { color: var(--muted); margin: 10px 0 6px; }
.scene .say { margin: 6px 0; max-width: 80ch; }
.scene audio { display: block; width: 100%; max-width: 480px; margin: 8px 0; }
.details { font-size: 15px; margin: 10px 0 0; padding: 4px 16px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.details > h3 { font-size: 0.9rem; font-weight: 500; letter-spacing: 0.04em; color: var(--muted); margin: 6px 0; }
.ref-sec .for { margin: 8px 0 0; }
code, pre { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre { font-size: 14px; background: var(--term-fill); color: var(--sink); padding: 10px 14px; border-radius: 8px; overflow-x: auto; }
.ref-table { overflow-x: auto; }
table { border-collapse: collapse; font-size: 14px; margin: 4px 0 10px; }
th, td { text-align: left; vertical-align: top; padding: 4px 12px 4px 0; border-bottom: 1px solid var(--line); }
th { font-weight: 500; color: var(--muted); }
.reference, .roads { margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--line); }
.reference > h2, .roads > h2 { font-weight: 400; font-size: 1.5rem; margin: 0 0 8px; }
.reference h3, .reference h4 { font-weight: 500; margin: 18px 0 6px; }
.toc ol { margin: 0 0 8px; padding: 8px 14px 8px 2.2em; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; columns: 2 260px; column-gap: 28px; font-size: 14px; }
.toc li { break-inside: avoid; }
.toc a { color: var(--sink); }
.roads h3 { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; color: var(--muted); margin: 14px 0 4px; }
.roads ul { margin: 0; padding-left: 1.2em; }
footer { margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer p { margin: 4px 0; }
@media (max-width: 700px) { body { font-size: 15px; } .deckhead h1 { font-size: 1.6rem; } }
:root { --aud-app-developers: #e95420; --aud-apparmor-developers: #772953; --aud-admins: #0b7285; --aud-security-researchers: #c7162b; --aud-everyone: #6b6b6b; }
.aud-app-developers { --aud: var(--aud-app-developers); } .aud-apparmor-developers { --aud: var(--aud-apparmor-developers); } .aud-admins { --aud: var(--aud-admins); } .aud-security-researchers { --aud: var(--aud-security-researchers); } .aud-everyone { --aud: var(--aud-everyone); }
/* AppArmor map theme: the engine defaults are the Ubuntu dark palette. */
/* A profile in a drawing: a white outline, like a snap box on the snapd map. */
.slide svg .profile { fill: none; stroke: var(--sink); stroke-width: 2; }
/* The kernel or a kernel object. */
.slide svg .kernel { fill: var(--panel-2); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 4; }
/* A denied access: red outline. */
.slide svg .denied { fill: none; stroke: var(--danger); stroke-width: 2; }

/* ---- the matching widget under the how-matching-works deck (site/matching.js) ---- */
.matching { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; scroll-margin-top: 64px; }
.matching[hidden] { display: none; }
.matching h3 { font-weight: 500; margin: 0 0 4px; font-size: 1.1rem; }
.matching .note { color: var(--muted); font-size: 14px; margin: 0 0 12px; max-width: 90ch; }
.matching code { font-family: var(--font-mono); }
.matching .mx-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); grid-template-areas: "profile draw" "form draw" "run draw" "result draw"; grid-template-rows: auto auto auto 1fr; gap: 12px 26px; align-items: start; }
.matching .mx-profile { grid-area: profile; } .matching .mx-form { grid-area: form; } .matching .mx-run { grid-area: run; } .matching .mx-result { grid-area: result; } .matching .mx-draw { grid-area: draw; }
.matching .mx-grid > * { min-width: 0; }
.matching .mx-profile { margin: 0; font-family: var(--font-mono); font-size: 14px; line-height: 1.45; background: var(--term-fill); color: var(--sink); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.matching .mx-line { display: inline-block; min-width: 100%; border-left: 3px solid transparent; padding-left: 6px; margin-left: -9px; }
.matching .mx-line.hit { border-left-color: var(--accent); background: var(--hi-fill); }
.matching .mx-form { display: grid; gap: 10px; }
.matching .mx-field { display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.matching .mx-field input, .matching .mx-field select { font: inherit; font-size: 15px; color: var(--sink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
.matching .mx-field input { font-family: var(--font-mono); }
.matching .mx-radio { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.matching .mx-radio legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 3px; }
.matching .mx-radio label { position: relative; cursor: pointer; }
.matching .mx-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.matching .mx-radio span { display: inline-block; font-size: 14px; font-weight: 500; color: var(--sink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; }
.matching .mx-radio input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.matching .mx-radio input:focus-visible + span, .matching button:focus-visible, .matching .mx-field input:focus-visible, .matching .mx-field select:focus-visible, .matching .mx-check input:focus-visible { outline: 2px solid var(--sink); outline-offset: 2px; }
.matching .mx-run { display: grid; gap: 8px; background: var(--stage); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.matching .mx-tape { display: flex; flex-wrap: wrap; gap: 2px; font-family: var(--font-mono); font-size: 16px; min-height: 30px; }
.matching .mx-tape span { min-width: 17px; text-align: center; padding: 2px 3px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.matching .mx-tape span.read { color: var(--sink); border-color: var(--muted); }
.matching .mx-tape span.now { color: #fff; background: var(--accent); border-color: var(--accent); }
.matching .mx-tape span.bad { border-color: var(--danger); }
.matching .mx-tape span.now.bad { background: var(--danger); }
.matching .mx-tape span.empty { border: 0; font-family: var(--font-ui); font-size: 14px; }
.matching .mx-transport { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.matching .mx-transport button { font: inherit; font-weight: 500; font-size: 15px; color: var(--sink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; min-width: 64px; min-height: 40px; cursor: pointer; }
.matching .mx-transport button:hover { border-color: var(--muted); }
.matching .mx-transport button:disabled { opacity: 0.45; cursor: default; }
.matching .mx-transport button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.matching .mx-check { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; margin-left: auto; }
.matching .mx-status { margin: 0; font-size: 15px; min-height: 3em; }
.matching .mx-lookup { display: block; font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.matching .mx-result { margin: 0; padding: 0 0 0 1.4em; display: grid; gap: 8px; font-size: 15px; }
.matching .mx-result.empty { display: none; }
.matching .mx-result li { padding-left: 4px; }
.matching .mx-result li.mx-ok b:first-child { border-bottom: 2px solid var(--sink); }
.matching .mx-result li.mx-no b:first-child { color: var(--danger); }
.matching .mx-entry, .matching .mx-log { display: block; font-family: var(--font-mono); font-size: 13.5px; background: var(--term-fill); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; margin-top: 5px; overflow-wrap: anywhere; }
.matching .mx-small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.matching .mx-draw { min-width: 0; position: sticky; top: 64px; }
.matching .mx-graph { display: block; width: 100%; height: auto; background: var(--stage); border: 1px solid var(--line); border-radius: 10px; }
.matching .mx-legend { color: var(--muted); font-size: 13px; margin: 6px 2px 0; }
.matching .mx-legend .k-acc { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--sink); box-shadow: 0 0 0 2px var(--stage), 0 0 0 3.5px var(--sink); margin: 0 6px 0 4px; vertical-align: middle; }
.matching .mx-graph text { font-family: var(--font-mono); font-size: 14px; fill: var(--sink); }
.matching .mx-graph .num { font-family: var(--font-ui); font-size: 10.5px; fill: var(--muted); }
.matching .mx-graph .tag { font-family: var(--font-ui); font-size: 11.5px; fill: var(--accent); font-weight: 500; }
.matching .mx-graph .mx-fanlabel { font-size: 12px; fill: var(--muted); }
.matching .mx-state circle, .matching .mx-state rect { fill: var(--panel-2); stroke: var(--muted); stroke-width: 1.5; transition: fill 0.2s ease, stroke 0.2s ease; }
.matching .mx-state .ring { fill: none; stroke: var(--sink); }
.matching .mx-deny .ring, .matching .mx-deny circle { stroke: var(--danger); }
.matching .mx-deny .tag { fill: var(--danger); }
.matching .mx-dead rect { stroke-dasharray: 5 4; fill: var(--panel); }
.matching .mx-state.seen circle:not(.ring) { stroke: var(--accent); }
.matching .mx-state.cur circle:not(.ring), .matching .mx-state.cur rect { fill: var(--accent); stroke: var(--accent); }
.matching .mx-state.cur .num { fill: #fff; font-weight: 700; }
.matching .mx-dead.cur rect { fill: var(--danger); stroke: var(--danger); stroke-dasharray: none; }
.matching .mx-dead.cur .num { fill: #111; }
.matching .mx-state.final .ring { stroke: var(--accent); stroke-width: 2.5; }
.matching .mx-deny.final .ring { stroke: var(--danger); }
.matching .mx-edge line, .matching .mx-edge path { stroke: var(--muted); stroke-width: 1.5; fill: none; transition: stroke 0.2s ease; }
.matching .mx-edge.mx-fan line { stroke: var(--line); stroke-width: 1; }
.matching .mx-edge.seen line, .matching .mx-edge.seen path { stroke: var(--accent); }
.matching .mx-edge.cur line, .matching .mx-edge.cur path { stroke: var(--accent); stroke-width: 3; }
.matching .mx-edge.cur text, .matching .mx-edge.seen text { fill: var(--accent); font-weight: 700; }
.matching .mx-head { fill: var(--muted); }
.matching .mx-head.on { fill: var(--accent); }
.matching .mx-head.bad { fill: var(--danger); }
.matching .mx-fall { stroke: var(--danger); stroke-width: 2; stroke-dasharray: 5 4; }
.matching .mx-token { fill: none; stroke: var(--accent); stroke-width: 2.5; pointer-events: none; transition: transform 0.32s ease; }
.matching .mx-token.jump { transition: none; }
@media (prefers-reduced-motion: reduce) { .matching .mx-token, .matching .mx-state circle, .matching .mx-state rect, .matching .mx-edge line, .matching .mx-edge path { transition: none; } }
@media (max-width: 860px) { .matching .mx-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "profile" "form" "run" "draw" "result"; grid-template-rows: none; } .matching .mx-draw { position: static; max-width: 460px; } .matching .mx-check { margin-left: 0; } }
