/* Light palette shared with Design Critic and Code Check: warm paper, black ink, red accent */
:root {
  --bg: #f4f3ef;
  --canvas: #efeee8;
  --surface: #ffffff;
  --raised: #ecebe5;
  --stroke: #e3e1da;
  --stroke-2: #cfccc2;

  --accent: #141414;
  --accent-muted: rgba(20, 20, 20, .08);
  --red: #c8231b;
  --blue: #2563eb;
  --now: #d9620b;
  --success: #15803d;
  --error: #c8231b;

  --text: #141414;
  --text-2: #555550;
  --text-3: #8a8a83;
  --on-accent: #ffffff;

  --code-bg: #1b1b1f;
  --radius: 16px;
  --ui: Inter, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

/* Black mode: chosen with the White/Black switch on Review Deck (/review-deck/theme.js).
   The rendered phones keep the app's own colours. */
:root[data-theme="dark"] {
  --bg: #0e0e0f;
  --canvas: #121214;
  --surface: #18181a;
  --raised: #242427;
  --stroke: #2a2a2d;
  --stroke-2: #3a3a3e;

  --accent: #f4f3ef;
  --accent-muted: rgba(255, 255, 255, .1);
  --red: #ef4b40;
  --blue: #5b8def;
  --now: #f07a2a;
  --success: #3fbf6f;
  --error: #ef4b40;

  --text: #f4f3ef;
  --text-2: #b4b3ad;
  --text-3: #85847e;
  --on-accent: #0e0e0f;

  --code-bg: #111113;
  color-scheme: dark;
}
:root[data-theme="dark"] .brand-logo { border-radius: 10px; box-shadow: 0 0 0 1px var(--stroke-2); }
:root[data-theme="dark"] .drop:hover, :root[data-theme="dark"] .drop.over { background: #1d1d20; }
:root[data-theme="dark"] .canvas { background-image: radial-gradient(circle, #2c2c30 1px, transparent 1px); }
:root[data-theme="dark"] .group-frame { border-color: #46464b; background: rgba(255,255,255,.025); }
:root[data-theme="dark"] .edges g:not(.hl) .line { stroke: #6e6e72; }
:root[data-theme="dark"] .edge-label { background: var(--surface); }
:root[data-theme="dark"] .edge-label.hl { background: rgba(239,75,64,.16); }
:root[data-theme="dark"] .node { box-shadow: 0 4px 14px rgba(0,0,0,.4); }
:root[data-theme="dark"] .node.kind-activity { border-left-color: #f4f3ef; }
:root[data-theme="dark"] .node.kind-fragment { border-left-color: #5b8def; }
:root[data-theme="dark"] .node.kind-dialog { border-left-color: #f07a2a; }
:root[data-theme="dark"] .kind-activity { color: #f4f3ef; }
:root[data-theme="dark"] .kind-fragment { color: #5b8def; }
:root[data-theme="dark"] .kind-dialog { color: #f07a2a; }
:root[data-theme="dark"] .legend, :root[data-theme="dark"] .zoom-ctl { background: rgba(24,24,26,.94); }
:root[data-theme="dark"] .legend i { border-top-color: #6e6e72; }
:root[data-theme="dark"] .viewer-card { box-shadow: 0 30px 80px rgba(0,0,0,.6); }
:root[data-theme="dark"] .b-card:hover { background: rgba(255,255,255,.04); }
:root[data-theme="dark"] .b-card.active { background: rgba(240,122,42,.1); }
:root[data-theme="dark"] .b-desc { color: #d8d7d1; }
:root[data-theme="dark"] a.go { text-decoration-color: rgba(239,75,64,.45); }
:root[data-theme="dark"] a.go:hover { color: #ff7a70; }
:root[data-theme="dark"] .uml-btn { box-shadow: 0 8px 24px rgba(0,0,0,.5); }
:root[data-theme="dark"] .uml-btn:hover { background: #ffffff; border-color: #ffffff; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--ui);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: .9em; background: var(--raised); padding: 1px 6px; border-radius: 6px; }

/* ---------------------------------------------------------------- top bar */

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--stroke);
  background: var(--surface);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: 36px; height: 36px; }
.brand h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.brand-sub { margin: 0; color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }

.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--stroke); border-radius: 12px; padding: 4px; }
.tab-btn { border: 0; background: none; padding: 6px 14px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.tab-btn.active { background: var(--accent); color: var(--on-accent); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--stroke); border-radius: 10px; padding: 0 10px; height: 36px; }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 16px; height: 16px; fill: var(--text-2); }
.search input { background: none; border: 0; outline: 0; color: var(--text); font: inherit; width: 170px; }
.pill-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--stroke-2); background: var(--surface); }
.pill-btn:hover { border-color: var(--accent); }
.pill-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

main { flex: 1; position: relative; min-height: 0; display: flex; }

/* ---------------------------------------------------------------- landing */

.landing {
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 1000px;
  padding: 40px;
}
.landing h2 { font-size: 34px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -.02em; }
.landing p { color: var(--text-2); font-size: 15.5px; margin: 0 0 22px; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.points li { color: var(--text-2); padding-left: 16px; border-left: 2px solid var(--stroke-2); }
.points b { display: block; color: var(--text); font-weight: 600; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px;
  min-height: 300px; padding: 32px;
  border: 2px dashed var(--stroke-2); border-radius: 24px; background: var(--surface);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #faf9f6; }
.drop svg { width: 52px; height: 52px; fill: none; stroke: var(--accent); stroke-width: 1.6; margin-bottom: 6px; }
.drop strong { font-size: 17px; }
.drop span { color: var(--text-2); }
.drop small { color: var(--text-3); margin-top: 10px; }
.error { grid-column: 1 / -1; color: var(--error); margin: 0; }

.loading { margin: auto; text-align: center; color: var(--text-2); }
.spinner { width: 40px; height: 40px; margin: 0 auto 16px; border-radius: 50%; border: 3px solid var(--stroke-2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- flow chart */

.flow-view { flex: 1; position: relative; min-width: 0; }
.canvas {
  position: absolute; inset: 0; overflow: hidden; cursor: grab;
  background-color: var(--canvas);
  background-image: radial-gradient(circle, #d6d3c9 1px, transparent 1px);
  background-size: 24px 24px;
  touch-action: none;
}
.canvas.panning { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; }
.world.animating { transition: transform .35s ease; }

.frames { position: absolute; left: 0; top: 0; }
.group-frame { position: absolute; border: 1.5px dashed #bdb9ad; border-radius: 22px; background: rgba(20,20,20,.025); }
.group-frame span { position: absolute; left: 20px; top: 11px; font-size: 13px; font-weight: 500; color: var(--text-3); white-space: nowrap; }

.edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.edges g.edge { pointer-events: stroke; cursor: pointer; }
.edges .line { fill: none; stroke: #8a8a83; stroke-width: 2; transition: opacity .15s, stroke .15s; }
.edges .hit { fill: none; stroke: transparent; stroke-width: 14; }
.edges g.auto .line { stroke-dasharray: 7 6; }
.edges g.shared .line { opacity: .45; }
.edges g.hl .line { stroke: var(--red); stroke-width: 2.6; opacity: 1; }
.edges g.dim .line { opacity: .1; }

.edge-labels { position: absolute; left: 0; top: 0; }
.edge-label {
  position: absolute; white-space: nowrap; cursor: pointer;
  background: #ffffff; border: 1px solid var(--stroke-2); color: var(--text); border-radius: 8px;
  padding: 4px 10px; font-size: 13.5px; font-weight: 500; line-height: 1.25;
  transition: opacity .15s, border-color .15s, background .15s;
}
.edge-label.auto { font-style: italic; color: var(--text-2); }
.edge-label.shared { opacity: .7; }
.edge-label.hl { border-color: var(--red); background: #fdecea; opacity: 1; z-index: 1; }
.edge-label.dim { opacity: .15; }

.node {
  position: absolute; z-index: 1; display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1.5px solid var(--stroke-2); border-radius: 16px;
  padding: 0 14px 0 10px; cursor: pointer; user-select: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  transition: opacity .15s, border-color .15s, box-shadow .15s;
}
.node:hover, .node.hl { border-color: var(--accent); }
.node.dim-node { opacity: .35; }
.node.flash { box-shadow: 0 0 0 4px rgba(200,35,27,.15), 0 4px 14px rgba(0,0,0,.08); border-color: var(--red); }
.node.kind-activity { border-left: 4px solid #141414; }
.node.kind-fragment { border-left: 4px solid #2563eb; }
.node.kind-dialog { border-left: 4px solid #d9620b; }
.node-thumb { flex: none; overflow: hidden; border-radius: 6px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); pointer-events: none; }
.node-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.node-text b { color: var(--text); font-size: 16.5px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.node-text small { color: var(--text-2); font-size: 12.5px; }
.node-open { font-size: 12px; color: var(--accent); opacity: 0; transition: opacity .15s; }
.node:hover .node-open { opacity: 1; }
.start-tag {
  position: absolute; top: -11px; left: 14px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px;
}
.kind { font-weight: 600; }
.kind-activity { color: #141414; }
.kind-fragment { color: #2563eb; }
.kind-dialog { color: #b45309; }
.kind-start { color: var(--red); }
.shot-scale { transform-origin: 0 0; width: 360px; }

/* ---------------------------------------------------------------- the rendered phone */

.phone {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  font-family: Roboto, "Segoe UI", system-ui, sans-serif; color: #000; text-align: left;
  font-size: 14px; line-height: 1.2; user-select: none;
}
.phone *, .phone *::before { box-sizing: border-box; }
.phone.standalone { min-height: 40px; }
.status-bar { flex: none; height: 24px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; font-size: 12px; font-weight: 500; }
.status-icons { display: flex; gap: 5px; align-items: center; }
.status-icons i { width: 12px; height: 9px; border-radius: 2px 2px 0 0; background: currentColor; opacity: .85; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.status-icons b { width: 16px; height: 8px; border: 1.5px solid currentColor; border-radius: 2px; opacity: .85; }
.action-bar { flex: none; height: 56px; display: flex; align-items: center; padding: 0 16px; font-size: 20px; font-weight: 500; box-shadow: 0 2px 4px rgba(0,0,0,.2); z-index: 1; }
.screen-content { flex: 1; position: relative; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); overflow: hidden; }
.standalone .screen-content { display: block; }
.no-layout { display: grid; place-items: center; color: #888; font-size: 14px; padding: 24px; text-align: center; }

.v { position: relative; min-width: 0; min-height: 0; flex-shrink: 1; }
.v-text, .v-button, .v-edit, .v-check, .v-radio, .v-switch, .v-chip, .v-spinner, .v-efab { overflow: hidden; }
.v .txt { overflow-wrap: anywhere; white-space: pre-wrap; }
.v .txt.clamp { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.v img.icon { display: block; max-width: 100%; max-height: 100%; }
.v .icon { flex: none; }
.bg-layer { position: absolute; z-index: -1; pointer-events: none; }
.mark { display: grid; place-items: center; }
.mark-radio i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.sw-track { position: relative; flex: none; }
.sw-track i { position: absolute; top: 50%; translate: 0 -50%; border-radius: 50%; }
.seek-track { height: 4px; border-radius: 2px; position: relative; }
.seek-fill { height: 100%; border-radius: 2px; }
.seek-thumb { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; translate: -50% -50%; }
.til-end { width: 40px; display: grid; place-items: center; flex: none; }
.til-help { font-size: 12px; padding: 4px 16px 0; }
.spin-arrow { padding: 0 8px; opacity: .7; }
.tb-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: none; font-size: 20px; }
.tb-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { font-size: 14px; opacity: .8; }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.bn-pill { width: 64px; height: 32px; border-radius: 16px; display: grid; place-items: center; }
.bn-label { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab { flex: 1; display: grid; place-items: center; font-size: 14px; font-weight: 500; }
.placeholder {
  display: grid; place-items: center; width: 100%; height: 100%; min-height: inherit; padding: 6px;
  font: 500 11px/1.2 var(--ui); color: #8a8aa0; text-align: center;
  background: repeating-linear-gradient(45deg, rgba(128,128,128,.08) 0 8px, rgba(128,128,128,.16) 8px 16px);
  border: 1px dashed rgba(128,128,128,.5); border-radius: 4px;
}
.empty-image { background: repeating-linear-gradient(45deg, rgba(128,128,128,.08) 0 8px, rgba(128,128,128,.16) 8px 16px); }
.list-skeleton { display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.list-skeleton i { width: 40px; height: 40px; border-radius: 50%; background: rgba(128,128,128,.25); flex: none; }
.list-skeleton span { flex: 1; display: grid; gap: 6px; }
.list-skeleton b { height: 10px; border-radius: 5px; background: rgba(128,128,128,.25); }
.list-skeleton b + b { width: 60%; opacity: .7; }
.list-row { flex: none; }
.dialog-scrim { grid-area: 1 / 1; z-index: 2; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 24px; }
.dialog-card { width: 100%; max-height: 100%; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.under-dialog { grid-area: 1 / 1; }

/* ---------------------------------------------------------------- canvas chrome */

.legend, .zoom-ctl {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: 18px;
  background: rgba(255,255,255,.94); border: 1px solid var(--stroke); border-radius: 12px; padding: 8px 14px;
  backdrop-filter: blur(6px); font-size: 13px; color: var(--text-2);
}
.legend { left: 16px; bottom: 16px; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 24px; height: 0; border-top: 2px solid #8a8a83; }
.legend .lg-dash { border-top-style: dashed; }
.lg-hint { color: var(--text-3); }
.lg-toggle { cursor: pointer; color: var(--text-2); user-select: none; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.lg-toggle input { accent-color: var(--accent); margin: 0; }
.zoom-ctl { right: 16px; bottom: 16px; gap: 4px; padding: 4px; }
.zoom-ctl button { border: 0; background: none; min-width: 34px; height: 32px; border-radius: 8px; padding: 0 10px; }
.zoom-ctl button:hover { background: var(--raised); color: var(--text); }
.zoom-ctl span { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- gallery */

.gallery-view { flex: 1; overflow: auto; background: var(--canvas); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, 180px); justify-content: center; gap: 28px 24px; padding: 28px; align-items: start; }
.g-card { cursor: pointer; }
.g-shot { overflow: hidden; border-radius: 12px; box-shadow: 0 0 0 1px var(--stroke-2), 0 6px 20px rgba(0,0,0,.1); transition: box-shadow .15s; }
.g-card:hover .g-shot { box-shadow: 0 0 0 2px var(--accent), 0 6px 20px rgba(0,0,0,.1); }
.g-head { padding: 10px 2px 0; display: grid; gap: 2px; }
.g-head b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-head small { color: var(--text-3); font-size: 12px; }
.g-group { grid-column: 1 / -1; margin: 8px 0 -10px; font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }

/* ---------------------------------------------------------------- screen viewer */

.viewer {
  position: fixed; inset: 0; z-index: 20; background: rgba(20,20,20,.45); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 24px; animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.viewer-card {
  position: relative; width: min(1180px, 100%); height: min(100%, 980px);
  background: var(--bg); border: 1px solid var(--stroke-2); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.viewer-bar { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; z-index: 2; pointer-events: none; }
.viewer-bar button { pointer-events: auto; }
.viewer-close { margin-left: auto; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--stroke-2); background: var(--surface); font-size: 15px; }
.viewer-back { height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--stroke-2); background: var(--surface); color: var(--text-2); }
.viewer-close:hover, .viewer-back:hover { border-color: var(--accent); color: var(--text); }
.viewer-body { flex: 1; min-height: 0; display: flex; }
.v-left { flex: none; display: flex; align-items: center; justify-content: center; padding: 60px 36px 36px; background: var(--canvas); border-right: 1px solid var(--stroke); overflow: auto; }
.v-shot { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 0 0 1px var(--stroke-2), 0 16px 40px rgba(0,0,0,.18); flex: none; }
.v-shot .wired { outline: 1.5px solid rgba(200,35,27,.45); outline-offset: 1px; cursor: pointer; }
.v-shot .wired.active { outline: 3px solid var(--now); }
.p-badge {
  position: absolute; z-index: 3; width: 20px; height: 20px; padding: 0; border-radius: 50%;
  border: 2px solid #fff; background: var(--red); color: #fff; font: 700 11px/16px var(--ui); text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.p-badge.active { background: var(--now); color: #fff; }
.v-right { flex: 1; min-width: 0; overflow-y: auto; padding: 60px 40px 48px; }
.v-head h2 { margin: 6px 0 2px; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.v-tags { display: flex; gap: 12px; font-size: 12.5px; }
.v-sub { margin: 0; color: var(--text-3); font: 12px var(--mono); }
.v-links { margin-top: 18px; display: grid; gap: 8px; padding: 14px 16px; background: var(--surface); border-radius: 14px; }
.v-link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.v-link-label { width: 84px; flex: none; color: var(--text-3); font-size: 13px; }
.chip-link { border: 1px solid var(--stroke-2); background: transparent; border-radius: 999px; padding: 3px 11px; font-size: 13px; }
.chip-link:hover { border-color: var(--accent); color: var(--text); }
.v-section { margin-top: 30px; }
.v-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); margin: 0 0 6px; font-weight: 600; }
.b-card { padding: 16px 14px 16px 12px; margin: 0 -12px; border-radius: 12px; border-bottom: 1px solid var(--stroke); transition: background .15s, box-shadow .15s; }
.b-card:last-child { border-bottom: 0; }
.b-card:hover { background: rgba(20,20,20,.03); }
.b-card.active { background: rgba(217,98,11,.07); box-shadow: inset 3px 0 0 var(--now); }
.b-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.b-num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.b-num.off { background: var(--raised); color: var(--text-3); }
.b-num.auto { background: var(--raised); font-size: 12px; }
.b-card.active .b-num:not(.off):not(.auto) { background: var(--now); color: #fff; }
.b-name { font-size: 16px; font-weight: 600; color: var(--text); }
.b-event { color: var(--text-3); font-size: 12px; border: 1px solid var(--stroke-2); border-radius: 6px; padding: 0 6px; }
.b-desc { margin: 8px 0 0 34px; font-size: 15px; line-height: 1.55; color: #2a2a28; }
.b-desc p { margin: 0; }
.b-desc .muted { font-size: 13.5px; }
.b-desc q { color: var(--text); font-style: italic; }
.b-desc code, .cond code { font-size: 12.5px; }
.b-calls { margin-top: 6px !important; color: var(--text-3); font-size: 13px; }
.b-calls code { margin-right: 4px; }
ul.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
ul.steps ul.steps { margin: 4px 0 2px 6px; padding-left: 14px; border-left: 2px solid var(--stroke-2); }
ul.steps > li:not(.step-if)::before { content: "→"; color: var(--text-3); margin-right: 8px; }
.cond { color: var(--blue); font-weight: 500; }
a.go { color: var(--red); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(200,35,27,.4); text-underline-offset: 3px; cursor: pointer; }
a.go:hover { color: #8f1610; text-decoration-color: var(--red); }
.fx { display: inline-flex; align-items: center; border-radius: 8px; padding: 3px 10px; font-size: 13.5px; background: var(--raised); color: var(--text-2); }
details.code { margin: 10px 0 0 34px; }
details.code summary { cursor: pointer; color: var(--text-3); font-size: 13px; width: max-content; }
details.code summary span { font-family: var(--mono); font-size: 12px; margin-left: 6px; opacity: .8; }
details.code summary:hover { color: var(--text-2); }
details.code pre { margin: 8px 0 0; background: var(--code-bg); border: 1px solid var(--code-bg); border-radius: 10px; padding: 10px 12px; overflow: auto; max-height: 340px; font: 12.5px/1.55 var(--mono); color: #d4d4e0; }
.muted { color: var(--text-3); font-size: 13.5px; }
.unwired { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

@media (max-width: 900px) {
  .landing { grid-template-columns: 1fr; }
  .legend .lg-hint { display: none; }
  .viewer { padding: 0; }
  .viewer-card { border-radius: 0; height: 100%; overflow-y: auto; }
  .viewer-body { flex-direction: column; flex: none; }
  .v-left { border-right: 0; border-bottom: 1px solid var(--stroke); padding: 64px 16px 24px; }
  .v-right { overflow: visible; padding: 24px 16px 40px; }
}

/* ---------------------------------------------------------------- UML download */
.uml-bar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 6; display: flex; gap: 6px; }
.uml-btn, .uml-src {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); white-space: nowrap;
}
.uml-src { padding: 0 14px; font: 500 12.5px var(--mono); color: var(--text-2); border-color: var(--stroke-2); background: var(--surface); }
.uml-btn:hover { background: #000; border-color: #000; }
.uml-src:hover { color: var(--text); border-color: var(--accent); }
.uml-btn:disabled { opacity: .7; cursor: progress; }
.uml-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 900px) { .uml-bar { bottom: 64px; } }

/* link back to Review Deck (shown when you came from there) */
.deck-back { flex: none; display: inline-flex; align-items: center; height: 30px; padding: 0 11px; margin-right: 4px; border-radius: 999px; border: 1px solid #cfccc2; background: #fff; color: #141414; font: 600 12.5px Inter, system-ui, sans-serif; text-decoration: none; white-space: nowrap; }
.deck-back:hover { border-color: #141414; }
:root[data-theme="dark"] .deck-back { border-color: #3a3a3e; background: #18181a; color: #f4f3ef; }
:root[data-theme="dark"] .deck-back:hover { border-color: #f4f3ef; }
