/* LES Sandbox wireframes, v2. Low fidelity on purpose: one card style, one accent, colour only on the outcome banner. */
:root {
  --bg: #eef1f4;
  --paper: #ffffff;
  --soft: #f5f7f9;
  --ink: #1c2733;
  --muted: #5b6673;
  --line: #d6dde5;
  --line-strong: #b9c3ce;
  --accent: #1f4f8f;
  --accent-ink: #ffffff;
  --tint: #e9f0fa;
  --ok: #1e6e48; --ok-bg: #e4f3ea; --ok-line: #9fd0b3;
  --warn: #8a5a00; --warn-bg: #fbf0d9; --warn-line: #e6c98a;
  --bad: #a12f2f; --bad-bg: #fbe6e6; --bad-line: #e8a5a5;
  --info: #2a5ca8; --info-bg: #e6eefa; --info-line: #a9c3ea;
  --font: Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: "Roboto Mono", Menlo, Consolas, monospace;
  --t-xs: 12px; --t-sm: 13px; --t-base: 15px; --t-md: 17px; --t-lg: 22px; --t-xl: 30px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --r: 8px; --r-sm: 6px;
  --frame-w: 1440px;
}
[data-theme="dark"] {
  --bg: #161b21; --paper: #1f262e; --soft: #252d36; --ink: #eef2f6; --muted: #aab4bf; --line: #3a4552; --line-strong: #52606f;
  --accent: #8fb4e8; --accent-ink: #10203a; --tint: #253649;
  --ok: #8fd4ad; --ok-bg: #1f3a2c; --ok-line: #2f6a49; --warn: #f0cd7a; --warn-bg: #3d3015; --warn-line: #7a6120;
  --bad: #f1a3a3; --bad-bg: #4a2323; --bad-line: #8a3c3c; --info: #a9c3ea; --info-bg: #223550; --info-line: #3c5a8a;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: var(--t-base)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--t-xl); line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: var(--t-lg); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: var(--t-base); line-height: 1.4; font-weight: 600; }
small, .muted { color: var(--muted); }
small { font-size: var(--t-sm); }
code, .mono { font-family: var(--mono); font-size: var(--t-xs); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -1000px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: var(--paper); padding: var(--s3); z-index: 50; }

/* Buttons and fields */
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line-strong); background: var(--paper); border-radius: var(--r-sm); min-height: 40px; padding: 0 var(--s4); font-size: var(--t-sm); font-weight: 500; }
button:hover:not(:disabled) { border-color: var(--ink); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
button.quiet:hover:not(:disabled) { color: var(--ink); background: var(--soft); border-color: transparent; }
button.sm { min-height: 32px; padding: 0 var(--s3); font-size: var(--t-xs); }
button.wide { width: 100%; text-align: left; }
input[type="text"], textarea, select { display: block; width: 100%; padding: 10px var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper); font-size: var(--t-sm); }
input[readonly] { background: var(--soft); border-color: var(--line); color: var(--muted); }
textarea { resize: vertical; min-height: 72px; }
label.field { display: block; font-size: var(--t-sm); font-weight: 500; }
label.field > input, label.field > textarea, label.field > select { margin-top: var(--s2); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: var(--t-base); font-weight: 600; margin-bottom: var(--s2); padding: 0; }
.check { display: flex; gap: var(--s3); align-items: flex-start; padding: 10px 0; font-size: var(--t-sm); cursor: pointer; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
.check.disabled { color: var(--muted); }
.chip { display: inline-block; font-size: var(--t-xs); padding: 2px var(--s2); border-radius: 999px; border: 1px solid var(--line); background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); padding: 2px var(--s2); border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.neutral { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }

/* Review chrome: hidden in capture mode */
#review { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s3) var(--s6); border-bottom: 1px solid var(--line); background: var(--bg); }
#review .brand { display: flex; align-items: center; gap: var(--s3); font-weight: 600; font-size: var(--t-sm); }
#review .brand span { color: var(--muted); font-weight: 500; }
#review nav { display: flex; gap: var(--s1); }
#review nav button { border-color: transparent; background: transparent; }
#review nav button.active { background: var(--paper); border-color: var(--line-strong); }
#screen-nav { display: flex; gap: var(--s1); overflow-x: auto; padding: var(--s2) var(--s6); background: var(--bg); border-bottom: 1px solid var(--line); }
#screen-nav button { flex: 1; white-space: nowrap; text-align: left; border-color: transparent; background: transparent; min-height: 44px; }
#screen-nav button span { display: block; font-size: var(--t-xs); color: var(--muted); }
#screen-nav button.active { background: var(--paper); border-color: var(--line-strong); }
html.capture #review, html.capture #screen-nav { display: none; }
html.capture body { background: var(--paper); }
html.capture .frame { width: var(--frame-w); margin: 0; }

/* App frame */
.frame { width: var(--frame-w); max-width: 100%; margin: 0 auto; background: var(--paper); position: relative; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--s6); padding: 0 var(--s8); border-bottom: 1px solid var(--line); }
.topbar .wordmark { font-weight: 600; font-size: var(--t-base); display: flex; align-items: center; gap: var(--s3); }
.topbar .wordmark i { width: 22px; height: 22px; border: 2px solid var(--accent); border-radius: 4px; display: inline-block; position: relative; }
.topbar .wordmark i::after { content: ""; position: absolute; left: 4px; top: 4px; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; }
.acting { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-sm); }
.acting small { color: var(--muted); }
.acting .dropdown { display: inline-flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 0 var(--s3); font-weight: 500; }
.acting .dropdown::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.topbar .actions { display: flex; align-items: center; gap: var(--s2); }
.topbar .actions button { min-height: 36px; }
.topbar .session { font-size: var(--t-xs); color: var(--muted); padding: 0 var(--s2); }
.banner { min-height: 32px; display: flex; align-items: center; padding: var(--s1) var(--s8); font-size: var(--t-xs); background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--warn-line); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: 820px; }
.workspace.collapsed { grid-template-columns: minmax(0, 1fr) 48px; }
.main { padding: var(--s8) var(--s10) var(--s12); min-width: 0; }
.main > .inner { max-width: 960px; }
.screen-code { font-size: var(--t-sm); color: var(--muted); margin-bottom: var(--s2); }
.lede { color: var(--muted); margin: var(--s2) 0 var(--s6); max-width: 680px; }
.lede:empty { margin-bottom: var(--s4); }

/* Layout helpers */
.stack { display: grid; gap: var(--s4); }
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.footer { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--line); }
.footer small { max-width: 520px; }
.footer .actions { display: flex; gap: var(--s2); }

/* The one card style */
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); padding: var(--s5) var(--s6); }
.card.soft { background: var(--soft); border-color: transparent; }
.card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s3); }
.card p.body { color: var(--muted); font-size: var(--t-sm); }
.card .meta { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.price { font-size: var(--t-md); font-weight: 600; }
.cat { font-size: var(--t-sm); color: var(--muted); margin-bottom: var(--s1); }
.note { padding: var(--s3) var(--s4); background: var(--soft); border-radius: var(--r-sm); font-size: var(--t-sm); }

/* Profile cards */
.profiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.profile { display: grid; grid-template-columns: 40px 1fr; gap: var(--s3); text-align: left; padding: var(--s4); min-height: 110px; align-items: start; border-radius: var(--r); border: 1px solid var(--line); background: var(--paper); }
.profile:hover:not(:disabled) { border-color: var(--line-strong); }
.profile.selected { border: 2px solid var(--accent); background: var(--tint); padding: 15px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--accent); display: grid; place-items: center; font-size: var(--t-sm); font-weight: 600; }
.profile.create .avatar { background: var(--soft); color: var(--muted); border: 1px dashed var(--line-strong); font-size: 20px; font-weight: 400; }
.profile > span:last-child { display: grid; gap: 2px; min-width: 0; }
.profile .name, .profile .type, .profile .note, .profile .proof { display: block; }
.profile .name { font-weight: 600; font-size: var(--t-base); line-height: 1.3; }
.profile .type { margin: var(--s1) 0; }
.profile .note { background: none; padding: 0; color: var(--muted); font-size: var(--t-sm); }
.profile .proof { margin-top: var(--s2); }

/* Terms table */
table.terms { width: 100%; border-collapse: collapse; font-size: var(--t-sm); margin-top: var(--s4); }
table.terms th, table.terms td { text-align: left; padding: 10px var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
table.terms th { font-weight: 500; color: var(--muted); font-size: var(--t-xs); }
table.terms tr.current td { background: var(--tint); }
table.terms tr.current td:first-child { font-weight: 600; }
.restrictions { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: 6px; font-size: var(--t-sm); }
.restrictions li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin: 0 10px 2px 2px; }

/* Stepper */
.stepper { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 28px 1fr auto; gap: var(--s4); align-items: center; padding: var(--s4) 0; position: relative; }
.step + .step::before { content: ""; position: absolute; left: 13px; top: -14px; width: 2px; height: 14px; background: var(--line); }
.step .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: var(--t-xs); font-weight: 600; color: var(--muted); background: var(--paper); }
.step.done .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.running .dot { border-color: var(--accent); color: var(--accent); }
.step.running .dot::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.step.failed .dot { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.step.waiting .dot { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.step .label { font-weight: 500; }
.step .detail { color: var(--muted); font-size: var(--t-sm); }
.step .state { font-size: var(--t-sm); color: var(--muted); }
.step.running .state { color: var(--accent); font-weight: 500; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Outcome banner: the one place with colour and size */
.outcome { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s8); }
.outcome.approved { background: var(--ok-bg); border-color: var(--ok-line); }
.outcome.conditions { background: var(--warn-bg); border-color: var(--warn-line); }
.outcome.refused { background: var(--bad-bg); border-color: var(--bad-line); }
.outcome.handoff { background: var(--info-bg); border-color: var(--info-line); }
.outcome .who { font-size: var(--t-sm); color: var(--muted); }
.outcome h2 { font-size: var(--t-xl); margin: var(--s2) 0 var(--s3); }
.outcome.approved h2 { color: var(--ok); } .outcome.conditions h2 { color: var(--warn); } .outcome.refused h2 { color: var(--bad); } .outcome.handoff h2 { color: var(--info); }
.outcome .text { max-width: 640px; }
.outcome .price { font-size: var(--t-lg); margin-top: var(--s4); }
.outcome .rule { margin-top: var(--s4); font-size: var(--t-sm); color: var(--muted); }
.outcome .actions { display: flex; gap: var(--s2); margin-top: var(--s6); align-items: center; }

/* Obligations, terms, certificate */
.obligation { display: grid; grid-template-columns: 22px 1fr; gap: var(--s3); padding: var(--s4) 0; border-bottom: 1px solid var(--line); align-items: start; }
.obligation:last-child { border-bottom: 0; }
.obligation input { accent-color: var(--accent); width: 18px; height: 18px; margin-top: 3px; }
.obligation .title, .obligation .text, .obligation .next { display: block; }
.obligation .title { font-weight: 500; }
.obligation .text { color: var(--muted); font-size: var(--t-sm); margin-top: 2px; }
.obligation .next { margin-top: var(--s2); font-size: var(--t-sm); }
.obligation.accepted .title::after { content: "Accepted"; margin-left: var(--s2); font-size: var(--t-xs); color: var(--ok); font-weight: 500; }
.cover { border-left: 3px solid var(--accent); }
.cover .tag { font-size: var(--t-xs); color: var(--muted); margin-bottom: var(--s2); }
.term { display: grid; grid-template-columns: 140px 1fr; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.term:last-child { border-bottom: 0; }
.term strong { font-weight: 600; }
.cert { border: 1px solid var(--line-strong); border-radius: var(--r); padding: var(--s8); position: relative; overflow: hidden; }
.cert::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); border-radius: 4px; pointer-events: none; }
.cert::after { content: "Sandbox"; position: absolute; right: 32px; top: 96px; font-size: 80px; font-weight: 700; color: var(--line); opacity: 0.3; letter-spacing: -0.04em; transform: rotate(-10deg); pointer-events: none; }
.cert > * { position: relative; }
.cert .head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--s6); }
.cert .id { font-family: var(--mono); font-size: var(--t-sm); color: var(--muted); }
.snippet { display: block; font-family: var(--mono); font-size: var(--t-xs); background: var(--soft); padding: var(--s3); border-radius: var(--r-sm); margin-top: var(--s2); overflow-wrap: anywhere; }

/* Question bubble and packet */
.bubble { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5) var(--s6); background: var(--soft); }
.bubble .counter { font-size: var(--t-sm); color: var(--muted); margin-bottom: var(--s2); }
.bubble .q { font-size: var(--t-md); line-height: 1.45; }
.bubble .about { margin-top: var(--s3); font-size: var(--t-sm); color: var(--muted); }
.packet .term { grid-template-columns: 120px 1fr; }

/* Payment notice */
.notice { text-align: center; padding: var(--s12) var(--s8); }
.notice p { font-size: var(--t-md); max-width: 520px; margin: 0 auto var(--s6); }

/* Sidecar */
.sidecar { border-left: 1px solid var(--line); background: var(--soft); padding: var(--s5); min-width: 0; display: flex; flex-direction: column; gap: var(--s4); }
.sidecar .head { display: flex; align-items: center; justify-content: space-between; }
.sidecar .head h2 { font-size: var(--t-base); }
.timeline { display: flex; gap: 4px; }
.timeline span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.timeline span.done { background: var(--accent); opacity: 0.45; }
.timeline span.current { background: var(--accent); }
.timeline-label { font-size: var(--t-xs); color: var(--muted); margin-top: -8px; }
.event { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); overflow: hidden; }
.event.hypothetical { border-style: dashed; }
.event .layer { border-top: 1px solid var(--line); }
.event .layer:first-child { border-top: 0; }
.event .layer .toggle { width: 100%; text-align: left; border: 0; background: transparent; min-height: 40px; padding: 0 var(--s4); display: flex; justify-content: space-between; align-items: center; font-size: var(--t-sm); font-weight: 500; border-radius: 0; }
.event .layer .toggle::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); }
.event .layer.open .toggle::after { transform: rotate(45deg); }
.event .layer .content { display: none; padding: 0 var(--s4) var(--s4); font-size: var(--t-sm); }
.event .layer.open .content { display: block; }
.event .layer .content p + p { margin-top: var(--s2); }
.event .layer.narration .content { font-size: var(--t-base); line-height: 1.5; }
.event .layer .by { color: var(--muted); margin-top: var(--s1); }
.trace { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.trace li { font-family: var(--mono); font-size: var(--t-xs); padding: 6px var(--s2); background: var(--soft); border-radius: 4px; overflow-wrap: anywhere; }
.trace li.deny { background: var(--bad-bg); color: var(--bad); }
.trace li.ctx { border: 1px dashed var(--info-line); background: var(--info-bg); color: var(--info); }
.event .streaming .content { color: var(--muted); }
.observer { margin-top: auto; padding-top: var(--s4); border-top: 1px solid var(--line); display: grid; gap: var(--s2); }
.observer h3 { font-size: var(--t-sm); }
.observer .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.observer .chips button { min-height: 30px; padding: 0 10px; font-size: var(--t-xs); border-radius: 999px; font-weight: 400; }
.observer .turn { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); font-size: var(--t-sm); }
.observer .turn .q { color: var(--muted); margin-bottom: var(--s2); }
.observer .box { display: flex; gap: var(--s2); align-items: flex-end; }
.observer textarea { min-height: 44px; flex: 1; }
.rail { border-left: 1px solid var(--line); background: var(--soft); display: flex; justify-content: center; padding-top: var(--s4); }
.rail button { width: 32px; min-height: 32px; padding: 0; font-size: var(--t-base); line-height: 1; }

/* Overlays are in-page, not native dialogs */
.overlay { position: absolute; inset: 0; background: rgba(28, 39, 51, 0.45); display: flex; align-items: flex-start; justify-content: center; padding-top: 120px; z-index: 10; }
.overlay .panel { width: 560px; background: var(--paper); border-radius: var(--r); padding: var(--s8); border: 1px solid var(--line); }
.overlay .panel h2 { margin-bottom: var(--s4); }
.overlay .panel .actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s6); }
.overlay .calendar { margin-top: var(--s4); padding: var(--s4); border: 1px solid var(--info-line); background: var(--info-bg); border-radius: var(--r-sm); font-size: var(--t-sm); }
#toast { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: var(--s3) var(--s5); border-radius: var(--r-sm); font-size: var(--t-sm); display: none; z-index: 20; }
#toast.show { display: block; }
html.capture #toast { display: none !important; }

/* Sheets: screen map and components */
.sheet { width: var(--frame-w); max-width: 100%; margin: 0 auto; background: var(--paper); padding: var(--s10); }
.sheet h1 { margin-bottom: var(--s2); }
.sheet > .lede { margin-bottom: var(--s8); }
.map { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s5); }
.map .tile { text-align: left; padding: var(--s4); border-radius: var(--r); border: 1px solid var(--line); background: var(--paper); display: grid; gap: var(--s3); min-height: 210px; align-content: start; }
.map .tile .code { font-size: var(--t-xs); color: var(--muted); }
.map .tile h2 { font-size: var(--t-base); }
.map .tile p { font-size: var(--t-sm); color: var(--muted); }
.wire { height: 90px; border: 1px solid var(--line); border-radius: 4px; display: grid; grid-template-columns: 1fr 28%; gap: 6px; padding: 6px; background: var(--soft); }
.wire > div { background: var(--paper); border: 1px solid var(--line); border-radius: 3px; padding: 6px; }
.wire b { display: block; height: 6px; width: 60%; background: var(--line-strong); border-radius: 2px; margin-bottom: 6px; }
.wire i { display: block; height: 4px; background: var(--line); border-radius: 2px; margin-top: 5px; }
.map .tile .next { font-size: var(--t-xs); color: var(--muted); border-top: 1px solid var(--line); padding-top: var(--s2); }
.components { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); }
.components > section { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5) var(--s6); display: grid; gap: var(--s4); align-content: start; }
.components > section.wide { grid-column: 1 / -1; }
.components > section > h2 { font-size: var(--t-base); }
.components .variants { display: grid; gap: var(--s3); }
.components .label { font-size: var(--t-xs); color: var(--muted); }
.components .sidecar { border: 1px solid var(--line); border-radius: var(--r); }
.confidence { display: grid; gap: 6px; font-size: var(--t-sm); }
.confidence .bar { position: relative; height: 10px; background: var(--line); border-radius: 5px; overflow: visible; }
.confidence .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 5px; }
.confidence .bar b { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--ink); }
.editor { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.editor th, .editor td { border: 1px solid var(--line); padding: 6px var(--s2); text-align: left; }
.editor th { background: var(--soft); font-weight: 500; color: var(--muted); font-size: var(--t-xs); }
.editor td.warn { background: var(--warn-bg); }
.diff { font-family: var(--mono); font-size: var(--t-xs); display: grid; gap: 2px; }
.diff .add { background: var(--ok-bg); color: var(--ok); padding: 2px 6px; }
.diff .del { background: var(--bad-bg); color: var(--bad); padding: 2px 6px; text-decoration: line-through; }
.tally { display: grid; gap: 6px; font-size: var(--t-sm); }
.tally .bar { display: grid; grid-template-columns: 200px 1fr 32px; gap: var(--s2); align-items: center; }
.tally .bar i { display: block; height: 14px; background: var(--accent); border-radius: 3px; }
.version { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); }

@media (max-width: 1200px) { .workspace { grid-template-columns: minmax(0, 1fr) 340px; } .main { padding: var(--s6); } .map { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px) {
  .workspace, .workspace.collapsed { display: block; }
  .sidecar { border-left: 0; border-top: 1px solid var(--line); }
  .profiles, .two-col, .components { grid-template-columns: 1fr; }
  .topbar { height: auto; padding: var(--s3) var(--s4); flex-wrap: wrap; }
  .map { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* chunk 5: the Observer's citations and hypothetical cards */
button.link { background: none; border: none; padding: 0; color: var(--ink, #1a3d6d); text-decoration: underline; cursor: pointer; font: inherit; font-size: 12px; }
button.link:focus-visible { outline: 2px solid var(--ink, #1a3d6d); outline-offset: 2px; }

/* the Licensing AI toggle: coloured so it stands out; grey when a request is in progress */
button.ai-toggle { border-radius: 999px; padding: 6px 12px; font-weight: 600; border: 1px solid transparent; }
button.ai-toggle.rule-bound { background: #dbe7f6; color: #123c6b; }
button.ai-toggle.discretionary { background: #fbe3c2; color: #6b3d00; }
button.ai-toggle:disabled { background: var(--soft, #eee); color: var(--muted, #888); cursor: not-allowed; opacity: 0.8; }

/* chunk 6: the Guide */
.guide-entry { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.guide-menu { position: absolute; top: 100%; right: 0; margin-top: 6px; background: var(--paper, #fff); border: 1px solid var(--line, #d8d8d8); border-radius: 8px; padding: 6px; display: grid; gap: 4px; min-width: 200px; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.guide-menu button { text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 6px; font: inherit; cursor: pointer; }
.guide-menu button:hover, .guide-menu button:focus-visible { background: var(--soft, #f2f2f2); outline: none; }
.guide-dim { position: fixed; inset: 0; background: rgba(0,0,0,0.30); z-index: 50; pointer-events: none; }
.guide-spot { position: fixed; z-index: 51; border: 2px solid var(--ink, #1a3d6d); border-radius: 8px; box-shadow: 0 0 0 4px rgba(26,61,109,0.18), 0 0 0 9999px rgba(0,0,0,0.30); pointer-events: none; transition: top .15s, left .15s, width .15s, height .15s; }
.guide-bubble { position: fixed; z-index: 52; background: var(--paper, #fff); color: var(--ink, #111); border: 1px solid var(--line, #d8d8d8); border-radius: 12px; padding: 12px 14px; max-width: 420px; box-shadow: 0 12px 32px rgba(0,0,0,0.18); font-size: 14px; line-height: 1.5; }
.guide-bubble.guide-center { top: 84px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-width: none; }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 600; }
.guide-part { margin: 0 0 6px; }
.guide-model { border-left: 3px solid var(--warn-line, #e0c070); padding-left: 8px; }
.guide-meta { margin: 0 0 6px; font-size: 12px; color: var(--muted, #666); }
.guide-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.guide-ask { display: flex; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line, #d8d8d8); }
.guide-ask input { flex: 1; font: inherit; padding: 6px 8px; border: 1px solid var(--line, #d8d8d8); border-radius: 6px; }
.guide-bubble .turn { margin-top: 8px; font-size: 13px; }
.guide-bubble .turn .q { font-weight: 600; margin: 0 0 2px; }
.guide-bubble button:focus-visible, .guide-bubble input:focus-visible { outline: 2px solid var(--ink, #1a3d6d); outline-offset: 2px; }
.guide-flash { outline: 3px solid var(--warn-line, #e0c070); outline-offset: 4px; transition: outline-color 1.2s; }
.guide-intro { min-width: 300px; max-width: 360px; font-size: 13px; line-height: 1.45; padding: 10px 12px; }
