/* boleh.ai Library: the same light studio as the dioramas. Paper, ink, one signal orange. */
:root {
  --paper: #e6e2da;
  --card: rgba(250, 249, 246, 0.78);
  --ink: #15171a;
  --ink-2: rgba(21, 23, 26, 0.66);
  --ink-3: rgba(21, 23, 26, 0.42);
  --line: rgba(21, 23, 26, 0.1);
  --line-2: rgba(21, 23, 26, 0.18);
  --accent: #ff5b1f;
  --edge: clamp(18px, 2.6vw, 36px);
  --display: "Michroma", "Eurostile", "Arial Black", sans-serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 40px -22px rgba(40, 32, 20, 0.35), 0 2px 6px -2px rgba(40, 32, 20, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; color: var(--ink); }
body {
  font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  background: radial-gradient(90% 90% at 88% 50%, #f1eee8 0%, #e7e3db 45%, #d9d4c9 100%);
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 1; opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- the tree ---------- */
#tree { position: fixed; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
#tree.dragging { cursor: grabbing; }

.spoke { stroke: var(--line); stroke-width: 1; }
.band { fill: rgba(21, 23, 26, 0.035); }
.ring { fill: none; stroke: var(--line-2); stroke-width: 1.2; stroke-dasharray: 2 7; }
.ring.open { stroke: rgba(21, 23, 26, 0.32); stroke-dasharray: none; stroke-width: 1.5; }
.tier rect { fill: rgba(250, 249, 246, 0.6); stroke: var(--line-2); }
.tier text { font-family: var(--mono); font-size: 12px; fill: var(--ink-3); }
.tier.open rect { fill: var(--ink); stroke: none; }
.tier.open text { fill: #f6f4ef; }

.hub-halo { fill: rgba(255, 91, 31, 0.07); }
.hub-disc { fill: url(#hubFill); }
.hub-ring { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 5; }
.hub-name { font-family: var(--display); font-size: 26px; fill: #f6f4ef; letter-spacing: 0.04em; }
.hub-sub { font-family: var(--sans); font-size: 12.5px; fill: rgba(246, 244, 239, 0.62); }
.hub-count { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; fill: var(--accent); }

.link { fill: none; stroke: var(--accent); stroke-width: 1.6; }

.node { cursor: pointer; outline: none; }
.node .plate { fill: rgba(250, 249, 246, 0.9); stroke: var(--line-2); transition: fill 0.25s, stroke 0.25s, transform 0.35s; }
.node .face { fill: #fbfaf7; stroke: var(--ink); stroke-width: 1.5; }
.node .orbit { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 4 6; opacity: 0; transform-origin: 0 0; }
.node .icon { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.node .icon circle { fill: var(--ink); }
.node .name rect { fill: var(--ink); }
.node .name text { font-family: var(--sans); font-weight: 500; font-size: 12.5px; fill: #f6f4ef; }
.node .name .min { font-family: var(--mono); font-size: 10px; font-weight: 400; fill: rgba(246, 244, 239, 0.62); }
.node .badge rect { fill: rgba(250, 249, 246, 0.95); stroke: var(--line-2); }
.node .badge text { font-family: var(--mono); font-size: 10px; fill: var(--ink-2); }
.node:hover .plate, .node:focus-visible .plate { stroke: var(--accent); }
.node.on .plate { fill: var(--accent); stroke: none; }
.node.on .orbit { opacity: 1; animation: spin 14s linear infinite; }
.node.on .name rect { fill: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* entrance: rings draw in, then the link, then the node */
.ring, .link { stroke-dashoffset: 0; }
html:not(.is-ready) .ring, html:not(.is-ready) .link, html:not(.is-ready) .node, html:not(.is-ready) .hub { opacity: 0; }
.ring, .link, .node, .hub { transition: opacity 0.8s ease var(--d, 0s); }
.hub { transition-delay: 0s; }

/* ---------- copy and panels ---------- */
.intro { position: fixed; top: var(--edge); left: var(--edge); z-index: 5; max-width: 380px; pointer-events: none; }
.intro > * { pointer-events: auto; }
.brand { font-family: var(--display); font-size: 13px; letter-spacing: 0.02em; text-decoration: none; }
.brand span { color: var(--accent); }
.kicker, .detail .k, .keys b, .detail dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.kicker { margin-top: 26px; color: var(--accent); }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.2; margin-top: 10px; text-wrap: balance; }

.detail {
  position: fixed; left: var(--edge); bottom: var(--edge); z-index: 5; width: min(360px, calc(100vw - 2 * var(--edge)));
  padding: 14px 14px 16px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.detail figure { border-radius: 10px; overflow: hidden; background: #e9e6df; aspect-ratio: 840 / 560; }
.detail img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.detail .k { margin: 14px 6px 0; color: var(--ink-3); font-size: 9.5px; }
.detail .k i { font-style: normal; color: var(--accent); padding: 0 3px; }
.detail h2 { margin: 4px 6px 0; font-weight: 600; font-size: 20px; letter-spacing: -0.015em; }
.detail .sum { margin: 6px 6px 0; color: var(--ink-2); font-size: 14px; text-wrap: pretty; }
.topics { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 6px 0; }
.topics li { font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: rgba(21, 23, 26, 0.06); color: var(--ink-2); }
.detail dl { display: flex; gap: 24px; margin: 14px 6px 0; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.detail dt { color: var(--ink-3); font-size: 9.5px; }
.detail dd { font-size: 13.5px; font-weight: 500; }
.detail dd.ok::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2f9e6a; margin-right: 7px; vertical-align: 1px; }
.go {
  display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 12px 16px; border-radius: 11px;
  background: var(--ink); color: #f6f4ef; text-decoration: none; font-weight: 500; font-size: 14px; transition: background 0.2s;
}
.go:hover { background: var(--accent); }
.go span { transition: transform 0.2s; }
.go:hover span { transform: translateX(3px); }

.zoom { position: fixed; right: var(--edge); bottom: var(--edge); z-index: 5; display: flex; padding: 3px; border-radius: 11px; background: var(--card); box-shadow: var(--shadow); }
.zoom button { min-width: 36px; height: 32px; padding: 0 10px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.zoom button:hover { background: rgba(21, 23, 26, 0.06); color: var(--ink); }
.zoom [data-act="fit"] { font-size: 12px; }
.zoom svg { width: 14px; height: 14px; fill: currentColor; vertical-align: -2px; }
.zoom [data-act="sound"][aria-pressed="false"] { color: var(--ink-3); }
.zoom [data-act="sound"][aria-pressed="false"] .wave { opacity: 0.2; }
/* game-style button prompts */
.keys {
  position: fixed; left: 50%; bottom: calc(var(--edge) + 4px); transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 12px; background: rgba(21, 23, 26, 0.86); color: #f6f4ef; box-shadow: var(--shadow);
  opacity: 0; translate: 0 10px; pointer-events: none; transition: opacity 0.6s, translate 0.6s;
}
.keys.show { opacity: 1; translate: 0 0; }
.keys b { font-weight: 400; font-size: 9.5px; color: rgba(246, 244, 239, 0.7); margin-right: 8px; }
.keys b:last-child { margin-right: 0; }
.keys .pad { display: grid; grid-template-columns: repeat(3, 18px); grid-template-rows: 14px 18px; gap: 2px; }
.keys .pad kbd:nth-child(1) { grid-column: 2; }
.keys .pad kbd:nth-child(2) { grid-column: 1; grid-row: 2; }
.keys .pad kbd:nth-child(3) { grid-column: 2; grid-row: 2; }
.keys .pad kbd:nth-child(4) { grid-column: 3; grid-row: 2; }
.keys kbd {
  display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 4px; font-family: var(--mono); font-size: 10px;
  background: #2b2e33; border-bottom: 2px solid #0c0d0f; color: #f6f4ef;
}
.keys .pad kbd:nth-child(1) { height: 14px; font-size: 8px; }
.keys .wide { padding: 0 7px; }

/* the reticle: four orange corners that glide between nodes */
.reticle path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hub { cursor: pointer; outline: none; }
/* stages on the first ring: small dark discs, like the hub */
.stage-halo { fill: rgba(255, 91, 31, 0.08); }
.stage-disc { fill: url(#hubFill); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 4; }
.stage-name { font-family: var(--display); font-size: 11.5px; fill: #f6f4ef; letter-spacing: 0.02em; }
.stage-count { font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; fill: var(--accent); }
.node.stage.on .stage-disc { stroke-width: 3; stroke-dasharray: none; }
.hub.on .hub-ring { stroke-width: 3; }
.detail.swap > * { animation: swap-in 0.35s cubic-bezier(.2, .8, .2, 1) both; }
.detail.swap > *:nth-child(2) { animation-delay: 0.03s; } .detail.swap > *:nth-child(3) { animation-delay: 0.06s; } .detail.swap > *:nth-child(4) { animation-delay: 0.09s; }
@keyframes swap-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- branch tabs in the header ---------- */
.branches { display: inline-flex; gap: 2px; margin-top: 14px; padding: 3px; border-radius: 11px; background: var(--card); box-shadow: var(--shadow); }
.branches button { height: 30px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.branches button:hover { color: var(--ink); background: rgba(21, 23, 26, 0.06); }
.branches button[aria-pressed="true"] { background: var(--ink); color: #f6f4ef; }

/* ---------- a learning path: rings are tiers, progress lights the route ---------- */
.tier-label { cursor: pointer; outline: none; }
.tier-label rect { fill: rgba(250, 249, 246, 0.92); stroke: var(--line-2); transition: fill 0.25s, stroke 0.25s; }
.tier-label text { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; fill: var(--ink); }
.tier-label .count { fill: var(--ink-3); letter-spacing: 0.04em; }
.tier-label:hover rect, .tier-label:focus-visible rect { stroke: var(--accent); }
.tier-label.done rect { fill: #2f9e6a; stroke: none; }
.tier-label.done text, .tier-label.done .count { fill: #f6f4ef; }
.tier-label.on rect { fill: var(--accent); stroke: none; }
.tier-label.on text, .tier-label.on .count { fill: #f6f4ef; }

.link.path { stroke: rgba(21, 23, 26, 0.28); stroke-width: 1.4; stroke-dasharray: 3 5; }
.link.path.lit { stroke: var(--accent); stroke-width: 2.2; stroke-dasharray: none; }
.node.soon .plate { fill: rgba(250, 249, 246, 0.55); stroke-dasharray: 3 4; }
.node.soon .face { stroke: rgba(21, 23, 26, 0.45); }
.node.soon .icon { stroke: rgba(21, 23, 26, 0.55); }
.node.soon .icon circle { fill: rgba(21, 23, 26, 0.55); }
.node.done .face { fill: var(--ink); stroke: var(--ink); }
.node.done .icon { stroke: #f6f4ef; }
.node.done .icon circle { fill: #f6f4ef; }
.node.started .face { stroke: var(--accent); stroke-width: 2; }
.node .mark circle { fill: #fbfaf7; stroke: var(--ink); stroke-width: 1.4; }
.node .mark.done circle { fill: #2f9e6a; stroke: #fbfaf7; stroke-width: 2; }
.node .mark.done path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.node .mark.started path { fill: var(--accent); }
/* where to go now: a soft orange pulse */
.node .beacon { fill: none; stroke: var(--accent); stroke-width: 2; transform-origin: 0 0; animation: beacon 2.2s ease-out infinite; }
.node.next .name rect { fill: var(--accent); }
@keyframes beacon { from { transform: scale(0.75); opacity: 0.9; } to { transform: scale(1.35); opacity: 0; } }

/* the path's panel: what you get, what you'll be able to do, how you'd show it */
.detail { max-height: calc(100dvh - 2 * var(--edge) - 210px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.detail h3 { margin: 14px 6px 0; font-family: var(--mono); font-weight: 400; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.detail .gain { margin: 4px 6px 0; font-size: 14px; font-weight: 500; text-wrap: pretty; }
.detail .proof { margin: 4px 6px 0; padding: 8px 10px; border-radius: 9px; background: rgba(255, 91, 31, 0.08); font-size: 13px; color: var(--ink); }
.outcomes { list-style: none; margin: 6px 6px 0; display: grid; gap: 5px; }
.outcomes li { position: relative; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.outcomes li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 7px; height: 7px; border: 1.5px solid var(--accent); border-radius: 2px; transform: rotate(45deg); }
.variants { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 6px 0; }
.variants button { padding: 4px 10px; border-radius: 99px; font-size: 12px; background: rgba(21, 23, 26, 0.06); color: var(--ink-2); }
.variants button[aria-selected="true"] { background: var(--ink); color: #f6f4ef; }
.variant { margin: 8px 6px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); }
.variant ol { margin: 8px 0 0 18px; display: grid; gap: 4px; }
.variant .proof { margin: 10px 0 0; }
.variant .proof b, .detail .proof b { display: block; font-family: var(--mono); font-weight: 400; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.detail dd.soon { color: var(--ink-2); }
.detail dd.you.done { color: #2f9e6a; }
.detail dd.you.started { color: var(--accent); }
.detail .after { margin: 10px 6px 0; font-size: 12.5px; color: var(--ink-3); }
.detail .after button, .steps button { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; font-size: inherit; text-align: left; }
.detail .after button:hover, .steps button:hover { color: var(--accent); }
.acts { display: flex; gap: 8px; align-items: stretch; }
.acts .go { flex: 1; }
.tick { margin-top: 14px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.acts:not(:has(.go)) .tick { flex: 1; height: 44px; }
.tick:hover { border-color: var(--ink); }
.tick[aria-pressed="true"] { background: #2f9e6a; border-color: #2f9e6a; color: #fff; }
button.go { width: 100%; }
.steps { list-style: none; margin: 6px 6px 0; display: grid; gap: 2px; }
.steps li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.steps li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-3); transform: translateY(1px); }
.steps li.started::before { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.steps li.done::before { border-color: #2f9e6a; background: #2f9e6a; }
.steps li span { margin-left: auto; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.steps.tiers li { flex-wrap: wrap; }
.steps.tiers li::before { display: none; }
.steps.tiers li span { margin-left: 0; flex-basis: 100%; order: 3; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 12px; }
.steps.tiers li b { margin-left: auto; font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--ink-3); }

/* ---------- focus view: the selection is the subject, the tree recedes behind it ---------- */
.prime { position: fixed; z-index: 4; width: var(--pw, 40vw); transform: translateX(-50%); pointer-events: none; }
/* the stem: from the card down to the selected node, so the card reads as that node's label */
.prime.hang::after { content: ""; position: absolute; left: 50%; top: var(--ph); width: 2px; height: var(--stem); margin-left: -1px; background: var(--accent); border-radius: 2px; }
html:not(.focus) .prime { display: none; }
.prime-card { position: absolute; left: 0; right: 0; top: 0; display: block; color: inherit; text-decoration: none;
  border-radius: 20px; background: rgba(250, 249, 246, 0.95); box-shadow: 0 30px 80px -30px rgba(40, 32, 20, 0.45), var(--shadow); border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); overflow: hidden; }
.pv { aspect-ratio: 840 / 500; display: grid; place-items: center; background: #e9e6df; position: relative; }
.pv.pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; display: block; }
.pv.icon, .pv.disc, .pv.tierv { aspect-ratio: 2 / 1; }
.pv.icon { background: radial-gradient(60% 70% at 50% 45%, #fbfaf7, #ebe7df); }
.pv.icon svg { width: 30%; aspect-ratio: 1; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.pv.icon svg circle { fill: var(--ink); }
.pv.icon.done { background: radial-gradient(60% 70% at 50% 45%, #2a2e34, #15171a); }
.pv.icon.done svg { stroke: #f6f4ef; } .pv.icon.done svg circle { fill: #f6f4ef; }
.pv.icon em { position: absolute; top: 14px; right: 14px; font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; padding: 5px 10px; border-radius: 99px; background: #2f9e6a; color: #fff; }
.pv.icon.started em { background: var(--accent); }
.prime-card.soon .pv.icon:not(.done) svg { stroke: rgba(21, 23, 26, 0.55); }
.pv.disc, .pv.tierv { background: radial-gradient(70% 80% at 40% 45%, #20242a, #121417); color: #f6f4ef; align-content: center; gap: 8px; text-align: center; padding: 0 12%; }
.pv.disc b { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 3.4vw, 44px); letter-spacing: 0.04em; }
.pv.disc i, .pv.tierv i { font-style: normal; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.pv.tierv b { font-family: var(--display); font-weight: 400; font-size: clamp(54px, 7vw, 96px); line-height: 1; }
.pt { padding: 16px 20px 18px; }
.pk { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.pt h2 { margin-top: 4px; font-weight: 600; font-size: clamp(22px, 1.9vw, 28px); line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
.pl { margin-top: 6px; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* the tree behind: the selection hides under the subject, its neighbours stay clear, the rest fades back */
html.focus.is-ready .node, html.focus.is-ready .hub, html.focus.is-ready .tier-label, html.focus .links, html.focus .grid { transition: opacity 0.45s ease, filter 0.45s ease; }
html.focus .intro h1 { display: none; } /* the subject is the headline now */
html.focus .hub.on, html.focus .tier-label.on { opacity: 0; pointer-events: none; }
html.focus:not(:has(.prime.hang)) .reticle { display: none; }
html.focus .node.on .name { opacity: 0; } /* the card above is its label */
html.focus .node:not(.near):not(.on), html.focus .tier-label:not(.near):not(.on), html.focus .hub:not(.near):not(.on) { opacity: 0.22; filter: blur(2px); }
html.focus .links { opacity: 0.45; }
@property --fx { syntax: "<length>"; inherits: true; initial-value: 50vw; }
@property --fy { syntax: "<length>"; inherits: true; initial-value: 50vh; }
@property --frx { syntax: "<length>"; inherits: true; initial-value: 320px; }
@property --fry { syntax: "<length>"; inherits: true; initial-value: 320px; }
/* an oval round the subject and its node: clear inside, paper by the time it reaches the far nodes */
.vignette { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  transition: opacity 0.6s, --fx 0.5s cubic-bezier(.2,.8,.2,1), --fy 0.5s cubic-bezier(.2,.8,.2,1), --frx 0.5s, --fry 0.5s;
  background: radial-gradient(var(--frx) var(--fry) at var(--fx) var(--fy), rgba(230, 226, 218, 0) 0, rgba(230, 226, 218, 0) 100%, rgba(230, 226, 218, 0.6) 135%, rgba(228, 224, 216, 0.95) 175%); }
html.focus .vignette { opacity: 1; }
html.focus .grid { opacity: 0.6; }
html.focus .node.near .name rect { fill: var(--ink); }
/* the view switch: top right, a mirror of the branch tabs; on phones it sits by the thumb, bottom right */
.views { position: fixed; top: var(--edge); right: var(--edge); z-index: 5; display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--card); box-shadow: var(--shadow); }
.views button { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px 0 11px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.views button:hover { color: var(--ink); background: rgba(21, 23, 26, 0.06); }
.views button[aria-pressed="true"] { background: var(--ink); color: #f6f4ef; }
.views svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.views svg circle { fill: currentColor; stroke: none; }
.views button[data-view="focus"] svg rect { fill: none; }
.detail .more { display: none; }
/* The panel rides in the subject: the picture, name and gist are above it, so it starts folded to its actions
   (Open, or the tick) and More; More unfolds the details inside the card, which scrolls if it has to. */
.prime .detail { position: static; width: auto; max-height: none; overflow: visible; padding: 0 20px 18px; margin: 0; border: 0; border-radius: 0;
  background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: auto; }
.prime .detail figure, .prime .detail > .k, .prime .detail > h2, .prime .detail > .sum { display: none; }
.prime .detail:not(.open) { display: flex; align-items: center; gap: 10px; }
.prime .detail:not(.open) > :not(.more):not(.acts):not(.go) { display: none; }
.prime .detail:not(.open) > .go, .prime .detail:not(.open) > .acts { flex: 1; }
.prime .detail:not(.open) .go, .prime .detail:not(.open) .tick { margin-top: 0; }
.prime .detail:not(:has(.go, .acts)) { justify-content: flex-end; }
.prime .detail .more { display: block; flex: none; padding: 10px 16px; border-radius: 11px; font-size: 13.5px; font-weight: 500; background: rgba(21, 23, 26, 0.07); }
.prime .detail .more:hover { background: rgba(21, 23, 26, 0.12); }
.prime .detail.open { display: block; }
.prime .detail.open .more { float: right; margin: 0 0 8px 10px; }
.prime .detail.open .topics, .prime .detail.open dl { display: flex; }
.prime .detail .go { padding: 11px 16px; }
.prime .detail .k:first-child { margin-top: 0; }
.prime-card:has(.detail.open) { max-height: var(--pmax); overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; }
.prime:has(.detail.open)::after { display: none; } /* reading: the stem would cross the text */
.prime:has(.detail.open) { top: var(--atop) !important; }
.prime .detail .wyg, .prime .detail .wyg + .gain { display: none; }
.prime-card:has(.detail.open) .pv { aspect-ratio: auto; height: 132px; } /* reading: the picture steps back */
.prime-card:has(.detail.open) .pv.icon svg { width: auto; height: 62%; } /* the card's own line already says it */
.prime-card .pt { padding-bottom: 12px; }
.pl { -webkit-line-clamp: 2; }

@media (max-width: 820px) {
  /* phones: one slim top line, then the subject, carrying its panel */
  html.focus .intro { right: var(--edge); max-width: none; display: flex; align-items: center; justify-content: space-between; }
  html.focus .intro .kicker, html.focus .intro h1 { display: none; }
  html.focus .branches { margin-top: 0; }
  .views { top: auto; bottom: var(--edge); }
  .views button { height: 36px; }
  .zoom [data-act="in"], .zoom [data-act="out"] { display: none; } /* phones pinch to zoom; the room goes to the view switch */
  .pt { padding: 12px 16px 14px; }
  .pt h2 { font-size: 20px; }
  .pl { font-size: 14px; -webkit-line-clamp: 2; }
}

@media (max-width: 820px) {
  h1 { font-size: 18px; }
  .kicker { margin-top: 14px; }
  .detail { width: auto; right: var(--edge); bottom: calc(var(--edge) + 48px); display: grid; grid-template-columns: 96px 1fr; column-gap: 12px; padding: 10px; }
  .detail figure { grid-row: span 3; aspect-ratio: 1; }
  .detail.branch { display: block; padding: 12px 14px; }
  .detail .k, .detail h2, .detail .sum { margin-left: 0; margin-right: 0; }
  .detail .k { margin-top: 2px; }
  .detail h2 { font-size: 16px; }
  .detail .sum { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .topics, .detail dl { display: none; }
  .branches { margin-top: 10px; }
  .branches button { height: 26px; padding: 0 11px; font-size: 12px; }
  .detail { max-height: 40dvh; }
  .detail.branch .topics, .detail.branch dl { display: flex; }
  .go { grid-column: 1 / -1; margin-top: 10px; }
  .zoom { left: var(--edge); right: auto; }
  .keys { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
