:root {
  --bg: #0e0e10; --panel: #17171a; --line: #2a2a2e; --text: #e8e8ea; --muted: #8c8c94;
  --accent: #cca9fb; --ok: #3bbc61; --warn: #f2b84b; --err: #fd828f; --add: #10301b; --del: #3a1418;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { padding: 20px 24px 60px; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 22px; margin: 4px 0 12px; font-weight: 600; }
h2 { font-size: 17px; margin: 24px 0 8px; }
h3 { font-size: 15px; margin: 14px 0 6px; }
h4 { font-size: 13px; margin: 0 0 6px; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
code, pre, .code, textarea { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { white-space: pre-wrap; word-break: break-word; }
.top { display: flex; align-items: center; gap: 14px; padding: 8px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.top nav a { color: var(--muted); padding: 4px 8px; border-radius: 6px; font-size: 13.5px; white-space: nowrap; }
.top nav a.on, .top nav a:hover { color: var(--text); background: #26262b; text-decoration: none; }
.who { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
table { border-collapse: collapse; width: 100%; margin: 6px 0 12px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
/* Only code and ids may break mid-word; prose wraps at spaces, so the
   browser can never squeeze a column of words to one letter wide. */
td code, td .copy, td a[href*="cnv_"], td a[href*="trn_"] { overflow-wrap: anywhere; word-break: break-word; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
table.kv th { width: 110px; }
input, select, textarea { background: #101013; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font-size: 13px; }
textarea { width: 100%; display: block; margin: 6px 0; resize: vertical; }
input.wide { width: 100%; margin: 6px 0; }
label { display: block; margin: 8px 0; color: var(--muted); }
label input { color: var(--text); }
button, .button { background: var(--accent); color: #111; border: 0; border-radius: 6px; padding: 7px 14px; font-weight: 600; cursor: pointer; font-size: 13px; display: inline-block; }
.button:hover { text-decoration: none; filter: brightness(1.08); }
button.warn { background: var(--warn); }
button.danger { background: var(--err); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; }
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; padding: 8px 12px; }
legend { color: var(--muted); padding: 0 6px; }
.flash { padding: 9px 12px; border-radius: 6px; margin: 0 0 12px; }
.flash.ok { background: #12301e; color: #9fe6b5; }
.flash.err { background: #3a1418; color: #ffc1c8; white-space: pre-wrap; }
.chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #2a2a30; color: var(--muted); vertical-align: middle; }
.chip.ok, .chip.replied { background: #12301e; color: #8fe0a8; }
.chip.warn, .chip.deflected, .chip.concern { background: #3a2c10; color: #f6cf7c; }
.chip.error, .chip.crisis { background: #3a1418; color: #ffb3bd; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.card b { display: block; font-size: 22px; }
.card span { color: var(--muted); font-size: 12px; }
.card.alert { border-color: var(--err); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; }
.split.wide-right { grid-template-columns: minmax(0, 1fr) 320px; }
.split.wide-left { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 900px) { .cols, .split, .split.wide-right, .split.wide-left { grid-template-columns: 1fr; } }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.versions { list-style: none; padding: 0; margin: 0; }
.versions li { padding: 8px; border-radius: 6px; border: 1px solid transparent; margin-bottom: 4px; }
.versions li.sel { border-color: var(--accent); background: #1b1820; }
.diff { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0 14px; overflow: hidden; }
.diffhead { background: var(--panel); padding: 6px 10px; font-size: 12px; color: var(--muted); }
.diffhead .add { color: #8fe0a8; } .diffhead .del { color: #ffb3bd; }
.diff pre { margin: 0; padding: 6px 0; max-height: 520px; overflow: auto; }
.diff .l { display: block; padding: 0 10px 0 26px; text-indent: -16px; min-height: 1.5em; }
.diff .l .op { display: inline-block; width: 16px; text-indent: 0; color: var(--muted); user-select: none; }
.diff .l.add { background: var(--add); }
.diff .l.del { background: var(--del); }
.diff .l.fold { color: var(--muted); font-style: italic; }
pre.code { background: #101013; border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 640px; overflow: auto; }
pre.code.tall { max-height: 900px; }
.chatlog { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; padding: 8px 11px; border-radius: 10px; background: #29233a; }
.msg.user { align-self: flex-end; background: #222226; }
.msg.system { align-self: center; background: none; border: 1px solid var(--line); font-size: 12px; }
.msg .meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.msg .text { white-space: pre-wrap; }
.msg .trace { margin-top: 6px; font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mem { padding: 4px 0; border-bottom: 1px solid var(--line); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bubble { background: #29233a; border-radius: 10px; padding: 9px 12px; white-space: pre-wrap; margin-bottom: 6px; }
.bubble.new { background: #1f2a3a; }
.case { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; }
.case .meta { font-size: 12px; margin-bottom: 8px; }
.said { color: var(--muted); margin-bottom: 8px; }
.login { max-width: 360px; margin: 12vh auto; display: flex; flex-direction: column; gap: 14px; }
.login button { width: 100%; padding: 10px; }
details summary { cursor: pointer; color: var(--muted); margin: 8px 0; }
.versions .note { white-space: pre-wrap; }
details.label { margin: 6px 0 12px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
details.label summary { cursor: pointer; color: var(--muted); }
form.stack label input { width: 100%; margin-top: 4px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: inline-block; height: 8px; background: var(--accent); border-radius: 4px; vertical-align: middle; opacity: .7; }
form.stack label input[type=checkbox] { width: auto; margin: 0 6px 0 0; vertical-align: middle; }
th.num, td.num { overflow-wrap: normal; }

/* Copy a reference ("companion.system@9") */
button.copy { background: #1d1b24; color: var(--accent); border: 1px solid #3a3350; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 400; padding: 2px 8px; border-radius: 6px; }
button.copy::after { content: "⧉"; margin-left: 6px; color: var(--muted); }
button.copy.done::after { content: "copied"; color: var(--ok); font-family: system-ui, sans-serif; }
.useref { margin: 4px 0 10px; }
.lead { color: var(--text); margin: 0 0 14px; max-width: 900px; }

/* Map */
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cards3 .card { display: flex; flex-direction: column; gap: 6px; color: var(--text); border-top: 3px solid var(--line); }
.cards3 .card:hover { text-decoration: none; border-color: var(--accent); }
.cards3 .card b { font-size: 15px; }
.cards3 .card span { font-size: 13px; }
.cards3 .card em { font-style: normal; font-size: 12px; color: var(--muted); }
.card.c-prompt, .flow li.c-prompt { border-top-color: #b98cf5; }
.card.c-layer, .flow li.c-layer { border-top-color: #4fc3a1; }
.card.c-config { border-top-color: #f2b84b; }
.flow { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; counter-reset: step; }
.flow li { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; position: relative; counter-increment: step; }
.flow li b::before { content: counter(step) ". "; color: var(--muted); }
.flow li span { color: var(--muted); font-size: 12px; flex: 1; }
.flow li a { font-size: 12px; }
.slots { list-style: none; padding: 0; margin: 8px 0; border-left: 2px solid #4fc3a1; }
.slots > li { padding: 6px 0 10px 14px; position: relative; }
.slothead { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.slothead code { font-size: 14px; color: var(--text); }
.slothead .n { position: absolute; left: -12px; width: 22px; height: 22px; border-radius: 11px; background: #12302a; color: #8fe0c8; font-size: 12px; text-align: center; line-height: 22px; }
.slotbody p { margin: 4px 0; }
.layercard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; max-width: 900px; }
.layercard div { font-size: 12px; margin-top: 3px; color: var(--muted); }
.chip.ghost { background: none; border: 1px dashed #44444c; }
.chip.prompt { background: #231b33; color: #d6bdfb; }
a.chip:hover { text-decoration: none; filter: brightness(1.2); }
.chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chain .chip { font-size: 13px; padding: 3px 10px; }
.chain .arrow { color: var(--muted); }

/* Field references */
table.ref td { font-size: 13px; }
table.ref tr.sec td { color: var(--accent); font-weight: 600; padding-top: 14px; border-bottom-color: #3a3350; }
table.ref code.ex { color: #c9c9cf; }
table.ref tr:target { background: #1b1820; }
details.fields, details.slotsref { margin: 14px 0; }
.flow li .go { font-size: 12px; }

/* Guide */
.eli5 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.eli5-text p { margin: 0 0 10px; max-width: 720px; }
.eli5-pic { position: relative; padding-top: 4px; }
.pic-form, .pic-note { border-radius: 8px; padding: 10px 12px 10px; font-size: 13px; position: relative; }
.pic-form { background: #1c1c21; border: 1px solid #3a3a42; }
.pic-note { width: 72%; margin-left: auto; margin-bottom: -10px; z-index: 1; box-shadow: 0 2px 0 rgba(0,0,0,.4); }
.pic-note.n3 { background: #3a3014; border: 1px solid #6b5720; transform: rotate(-1.5deg); width: 60%; }
.pic-note.n2 { background: #12302a; border: 1px solid #2c6b5c; transform: rotate(1deg); }
.pic-form .tag, .pic-note .tag { display: block; font: 11px ui-monospace, Menlo, monospace; color: var(--muted); margin-bottom: 4px; }
.pic-eq { margin-top: 12px; font-size: 13px; color: var(--muted); }
#stacker { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.st-controls { display: flex; gap: 14px; flex-wrap: wrap; }
.st-controls label { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.st-main { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 10px; }
.sheet { border-radius: 8px; padding: 8px 10px; margin: 0 0 6px; border: 1px solid var(--line); border-left-width: 4px; }
.sheet.off { opacity: .55; border-style: dashed; border-left-style: solid; }
.sheet-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sheet-head .slotname { font: 12px ui-monospace, Menlo, monospace; color: var(--muted); min-width: 190px; }
.sheet-body { font-size: 13px; margin-top: 3px; }
.sheet.s0 { border-left-color: #8c8c94; } .sheet.s1 { border-left-color: #7aa7ff; } .sheet.s2 { border-left-color: #f28bb8; }
.sheet.s3 { border-left-color: #4fc3a1; } .sheet.s4 { border-left-color: #f2b84b; } .sheet.s5 { border-left-color: #b98cf5; } .sheet.s6 { border-left-color: #fd828f; }
.sheet.on.s0 { background: #1c1c21; } .sheet.on.s3 { background: #12302a; } .sheet.on.s4 { background: #33290f; } .sheet.on.s2 { background: #33182a; } .sheet.on.s6 { background: #331519; } .sheet.on.s1 { background: #172238; } .sheet.on.s5 { background: #231b33; }
.chip.s0 { background: #2a2a30; color: #d0d0d6; } .chip.s1 { background: #172238; color: #b7cdff; } .chip.s2 { background: #33182a; color: #f6bdd6; }
.chip.s3 { background: #12302a; color: #8fe0c8; } .chip.s4 { background: #33290f; color: #f6cf7c; } .chip.s5 { background: #231b33; color: #d6bdfb; } .chip.s6 { background: #331519; color: #ffb3bd; }
table.recipes td:first-child, table.glossary td:first-child { white-space: normal; width: 26%; }
@media (max-width: 900px) { .eli5, .st-main { grid-template-columns: 1fr; } }
table.recipes td, table.glossary td { white-space: normal; }
table.recipes td:nth-child(2) { width: 22%; min-width: 160px; }
table.recipes td:nth-child(3) { min-width: 0; }
.flash { white-space: pre-line; }
.funnel { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; }
.funnel .fn { display: grid; grid-template-columns: 26px 110px minmax(150px, 260px) 1fr; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--line); border-left-width: 4px; min-width: 520px; }
.funnel .fn .n { color: var(--muted); font-size: 12px; }
.funnel .fn .use { color: var(--muted); font-size: 12px; }
.fn.s0 { border-left-color: #8c8c94; background: #1c1c21; } .fn.s1 { border-left-color: #7aa7ff; background: #172238; } .fn.s2 { border-left-color: #f28bb8; background: #33182a; }
.fn.s3 { border-left-color: #4fc3a1; background: #12302a; } .fn.s4 { border-left-color: #f2b84b; background: #33290f; } .fn.s5 { border-left-color: #b98cf5; background: #231b33; } .fn.s6 { border-left-color: #fd828f; background: #331519; }
ul.why { max-width: 900px; padding-left: 18px; } ul.why li { margin: 4px 0; }
.funnel .fn { grid-template-columns: 26px 110px 1fr; row-gap: 2px; min-width: 360px; }
.funnel .fn .use { grid-column: 2 / -1; }

/* ---- Nav groups ---- */
.top nav .grp { display: inline-flex; gap: 0; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.top nav .grp:last-child { border-right: 0; }

/* ---- Shared bits ---- */
.lead { font-size: 15px; max-width: 900px; }
.hint { color: var(--muted); margin: 4px 0 10px; max-width: 820px; }
.flash.warn { background: #3a2c10; color: #f6cf7c; }
button.ghost, .button.ghost { background: #26262b; color: var(--text); border: 1px solid var(--line); }
button.primary, .button.primary { background: var(--accent); color: #111; }
button:disabled { opacity: .5; cursor: progress; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
label.check input { margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; align-items: start; }
.row2 label input { width: 100%; margin-top: 6px; }
@media (max-width: 900px) { .row2 { grid-template-columns: 1fr; } }
details.rename { margin-top: 6px; }
details.rename summary { font-size: 12px; margin: 2px 0; }
details.rename form { padding: 6px 0; }
details.rename input { width: 100%; }
.explain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 6px; }
.explain > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.explain p { margin: 0; }
@media (max-width: 900px) { .explain { grid-template-columns: 1fr; } }
.edhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border-radius: 0; padding: 5px 12px; font-weight: 500; }
.seg button.on { background: #2e2e35; color: var(--text); }

/* ---- Where each part comes from ---- */
.src-template { --c: #8c8c94; --bgc: transparent; }
.src-character { --c: #7fb2ff; --bgc: #14243d; }
.src-facts { --c: #c79bff; --bgc: #271a3d; }
.src-mode { --c: #ff8fcf; --bgc: #3a1630; }
.src-memory { --c: #6fdc8c; --bgc: #12301e; }
.src-clock { --c: #f2d36b; --bgc: #332a0f; }
.src-language { --c: #5fd6e0; --bgc: #0f2f33; }
.src-notices { --c: #ffad66; --bgc: #3a2410; }
.src-situation { --c: #a9a4ff; --bgc: #1f1d3d; }
.src-photos { --c: #ff8a80; --bgc: #3a1714; }
.src-safety { --c: #ff6b81; --bgc: #3d0f18; }
.src-other { --c: #b0b0b8; --bgc: #26262b; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }

/* ---- Words-only editor ---- */
.blocks { background: #101013; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 70vh; overflow: auto; }
.blocks .bt { outline: none; border-radius: 3px; }
.blocks .bt:hover { background: #1b1b20; }
.blocks .bt:focus { background: #1e1b26; box-shadow: 0 0 0 1px #4a3d66; }
.btag { display: inline-block; font: 11.5px/1.5 system-ui, sans-serif; padding: 0 7px; margin: 0 1px; border-radius: 9px; background: var(--bgc, #26262b); color: var(--c, #b0b0b8); border: 1px solid color-mix(in srgb, var(--c, #888) 45%, transparent); user-select: none; white-space: nowrap; vertical-align: 1px; cursor: help; }
.src-template.btag { background: #26262b; }
.bcond { border-left: 3px solid var(--c); background: color-mix(in srgb, var(--bgc) 45%, transparent); padding: 2px 0 4px 10px; margin: 4px 0; border-radius: 0 6px 6px 0; }
.bcond > .btag:first-child { margin-bottom: 2px; }
.belse { margin: 2px 0; }
textarea.raw { min-height: 420px; }

/* ---- Playground ---- */
.playhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.playhead p { margin: 0; }
.playgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); gap: 22px; margin-top: 10px; }
@media (max-width: 1000px) { .playgrid { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 8px; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--muted); border-radius: 6px 6px 0 0; padding: 8px 14px; font-weight: 500; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs button.dirty::after { content: " ●"; color: var(--warn); font-size: 10px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.legend .lg { font-size: 12px; padding: 2px 9px; border-radius: 10px; background: var(--bgc); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); cursor: pointer; }
.legend .src-template { background: #1b1b20; }
.final { background: #101013; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; white-space: pre-wrap; word-break: break-word; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 74vh; overflow: auto; }
.final .sx { cursor: pointer; border-radius: 3px; }
.final .sx:not([class*="src-"]):hover { background: #1b1b20; }
.final .sx[class*="src-"] { background: var(--bgc); color: color-mix(in srgb, var(--c) 35%, var(--text)); box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 1px 2px; }
.final .sx.cond { box-shadow: inset 2px 0 0 var(--c); }
.final .skip { display: inline-block; font: 11px/1.5 system-ui, sans-serif; color: var(--c); border: 1px dashed color-mix(in srgb, var(--c) 50%, transparent); border-radius: 9px; padding: 0 7px; margin: 2px 2px; opacity: .8; }
.final .volatile { margin: 10px 0; padding: 4px 0; border-top: 1px dashed var(--line); color: var(--muted); font: 11.5px system-ui, sans-serif; }
fieldset.inputs { border-left: 3px solid var(--c); }
fieldset.inputs legend { color: var(--text); font-weight: 600; }
fieldset.inputs label { margin: 6px 0; }
fieldset.inputs label .lbl { display: block; margin-bottom: 3px; }
fieldset.inputs input[type=text], fieldset.inputs select { width: 100%; }
label.changed > .lbl, label.changed.check { color: var(--warn); }
label.changed input, label.changed textarea, label.changed select { border-color: var(--warn); }
.mrow { display: grid; grid-template-columns: 190px minmax(160px, 320px) 1fr; gap: 10px; align-items: center; margin: 8px 0; }
.mrow .help { grid-column: 2 / -1; font-size: 12px; margin-top: -4px; }
.mrow .from { font-size: 12px; }
@media (max-width: 700px) { .mrow { grid-template-columns: 1fr; } }
.convhead { display: flex; justify-content: space-between; align-items: baseline; }
.msgs { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #101013; }
.pm, .reply { border-radius: 10px; padding: 7px 10px; margin: 6px 0; max-width: 92%; }
.pm.user { background: #1d1d22; }
.pm.assistant { background: #221c2e; margin-left: auto; }
.pm.dropped { opacity: .45; }
.pm.added { outline: 1px dashed #4a3d66; }
.pm .mh, .reply .mh { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.pm .mh b, .reply .mh b { color: var(--text); font-weight: 600; }
.pm .acts { margin-left: auto; display: none; gap: 10px; }
.pm:hover .acts { display: inline-flex; }
.pm .mt, .reply .mt { white-space: pre-wrap; word-break: break-word; }
.reply { max-width: 100%; border: 1px solid var(--line); }
.reply.orig { background: #17171a; }
.reply.new { background: #1a1528; border-color: #4a3d66; }
.reply details summary { font-size: 12px; margin: 6px 0 0; }
.composer { margin-top: 8px; padding: 8px 0 0; border-top: 1px solid var(--line); flex: none; }
.composer textarea { margin: 8px 0 6px; }
.trace a.play { margin-left: 8px; }

/* ---- Finders ---- */
.pagetabs { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.pagetabs h1 { margin-right: 14px; }
.pagetabs a { padding: 5px 12px; border-radius: 7px; color: var(--muted); }
.pagetabs a.on { background: #26262b; color: var(--text); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.preset { font-size: 12.5px; padding: 4px 11px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.preset:hover { border-color: var(--accent); text-decoration: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.filters label { margin: 0; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.filters label.check { flex-direction: row; align-items: center; font-size: 13px; padding-bottom: 7px; }
.filters label.grow { flex: 1 1 200px; }
.filters select { min-width: 110px; }
.filters .fbtns { display: flex; gap: 10px; align-items: center; padding-bottom: 2px; }
.filters details.more { flex-basis: 100%; }
.filters details.more summary { margin: 2px 0; font-size: 12.5px; }
.filters.inner { border: 0; padding: 4px 0 0; margin: 0; background: none; }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
table.people .preview { max-width: 460px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pager { display: flex; gap: 16px; }
.crumbs { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.rlist { display: flex; flex-direction: column; gap: 8px; }
.rrow { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--panel); }
.rmeta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 12.5px; }
.rmeta .acts { margin-left: auto; display: flex; gap: 12px; }
.exchange { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.exchange > div { border-radius: 8px; padding: 6px 10px; white-space: pre-wrap; word-break: break-word; }
.exchange .said { background: #1d1d22; }
.exchange .answer { background: #221c2e; }
@media (max-width: 800px) { .exchange { grid-template-columns: 1fr; } }
.msg.at { outline: 2px solid var(--accent); }
.err { color: var(--err); }

/* ---- Voice ---- */
audio { display: block; width: 100%; max-width: 360px; height: 36px; margin: 6px 0 2px; }
img.thumb { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; margin: 6px 0; }
.hear { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; }
.hear audio { flex-basis: 100%; }
button.small, .button.small { padding: 4px 10px; font-size: 12px; }
.vlab { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1000px) { .vlab { grid-template-columns: 1fr; } }
.vform { padding: 14px 16px; }
.vform input:not([type=checkbox]), .vform select { width: 100%; }
.vrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 10px; max-height: 330px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0 12px; }
.vgrid .vopt { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; margin: 3px 0; color: var(--text); font-size: 13px; }
.vgrid .vopt input { margin: 0; }
.links a { margin: 0 2px; }
.vresults { display: flex; flex-direction: column; gap: 14px; }
.vrun { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.vrunhead { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.vrunhead .vtext { font-size: 13.5px; }
.vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.vcard { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); }
.vcard audio { max-width: 100%; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }

/* ---- Page layout, one pattern everywhere ---- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; flex-wrap: wrap; margin: 2px 0 14px; }
.pagehead > div:first-child { flex: 1 1 520px; min-width: 0; }
.pagehead h1 { margin: 0 0 4px; }
.pagehead .sub { margin: 0; color: var(--muted); max-width: 920px; }
.pagehead .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pagehead .chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.h1sub { font-size: 15px; font-weight: 400; }
.crumbs + .pagehead, .crumbs + h1 { margin-top: 0; }
.inline-label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.chip { white-space: nowrap; }
h2 .small { font-size: 12px; font-weight: 400; margin-left: 6px; }
a.card { color: var(--text); }
a.card:hover { border-color: var(--accent); text-decoration: none; }
.card.warn { border-color: var(--warn); }
.kind { display: inline-block; min-width: 46px; font-size: 11px; color: var(--muted); }
.feed { display: flex; flex-direction: column; }
.fitem { padding: 8px 0; border-bottom: 1px solid var(--line); }
.fitem .fwhat a, .fitem .fwhat code { margin-left: 4px; }
.fnote { margin: 2px 0; color: var(--text); }
table.audit .fwhat { font-size: 13px; }
table.audit .fwhat b { font-weight: 500; }
.dkv { display: inline-block; margin-right: 10px; white-space: nowrap; }
.dkv > span { color: #6c6c74; }
td.num, th.num { text-align: right; }
.msg audio { margin-top: 8px; }

@media (max-width: 1320px) { .who .email { display: none; } .top nav a { padding: 4px 6px; } }

/* The playground's conversation keeps its own scroll, beside the prompt. */
@media (min-width: 1001px) {
  .pl-right { position: sticky; top: 58px; height: calc(100vh - 74px); display: flex; flex-direction: column; min-height: 420px; }
  .pl-right .msgs { flex: 1 1 45%; max-height: none; min-height: 100px; }
  .pl-right #pl-replies { flex: 1 1 55%; overflow: auto; min-height: 80px; }
}
details.diffbox > summary { margin: 6px 0; }
details.diffbox summary .add { color: #8fe0a8; } details.diffbox summary .del { color: #ffb3bd; }
.vsteps { display: flex; flex-direction: column; gap: 14px; }
.vstep > summary, .vstephead { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); margin: 0 0 6px; flex-wrap: wrap; }
.vstep > summary .muted { font-weight: 400; font-size: 12.5px; }
.stepno { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #111; font-size: 12px; font-weight: 700; }
.vrunmeta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.vrunmeta .acts { display: flex; gap: 12px; }
pre.vprompt { margin: 4px 0 0; padding: 6px 8px; background: var(--bg); border-radius: 6px; font-size: 12px; max-height: 140px; overflow: auto; }
.vcard .vname { display: flex; align-items: baseline; gap: 4px; }
.vcard .del { margin-left: auto; color: var(--muted); }
.vcard .del:hover { color: var(--err); }
.vcard.failed { border-color: #5a2a30; }
.vform .inline-label { width: 100%; } .vform .inline-label select { flex: 1; width: auto; }

/* Field references: fixed proportions, so prose gets the room. */
table.fields { table-layout: fixed; }
table.fields col.c-field { width: 19%; } table.fields col.c-what { width: 41%; }
table.fields col.c-def { width: 11%; } table.fields col.c-ex { width: 29%; }
table.fields.withnow col.c-field { width: 16%; } table.fields.withnow col.c-what { width: 31%; }
table.fields.withnow col.c-def { width: 9%; } table.fields.withnow col.c-ex { width: 22%; } table.fields.withnow col.c-now { width: 22%; }
table.fields code { white-space: pre-wrap; }
details.calltx { margin-top: 6px; }
details.calltx .cl { padding: 3px 0; border-top: 1px solid var(--line); }
details.calltx .cl.char b { color: var(--accent); }
details.calltx .cl b { font-weight: 600; margin-right: 4px; }
