:root {
  color-scheme: dark;
  --ink: #e9e5dc;
  --muted: #9e9b92;
  --night: #101312;
  --panel: #181d1b;
  --panel-raised: #202724;
  --line: #343d39;
  --moss: #9db787;
  --moss-dark: #536a48;
  --amber: #d6a65d;
  --red: #d8776c;
  --blue: #79a9b8;
  --violet: #a88bc1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); }
body.room-previewing { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, .button {
  border: 1px solid var(--moss-dark);
  border-radius: 7px;
  background: var(--moss);
  color: var(--night);
  cursor: pointer;
  font-weight: 700;
  padding: .58rem .82rem;
  text-decoration: none;
}
button:hover, .button:hover { filter: brightness(1.08); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .45; }
button.quiet, .button.quiet { background: transparent; border-color: var(--line); color: var(--ink); }
button.danger { color: #efaaa3; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { color: var(--moss); font-size: .68rem; font-weight: 800; letter-spacing: .15em; margin: 0 0 .2rem; text-transform: uppercase; }
.error { color: #f0a39b; min-height: 1.25em; margin: .5rem 0 0; }

.studio-header {
  align-items: center;
  background: var(--night);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: 16rem 1fr auto;
  min-height: 4.25rem;
  padding: .6rem 1rem;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { align-items: center; color: var(--ink); display: flex; gap: .65rem; text-decoration: none; }
.brand-mark { border: 1px solid var(--moss-dark); color: var(--moss); display: grid; font-size: 1.25rem; height: 2.4rem; place-items: center; transform: rotate(45deg); width: 2.4rem; }
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand small, .brand strong { display: block; }
.brand small { color: var(--muted); font-size: .63rem; letter-spacing: .12em; text-transform: uppercase; }
.brand strong { font-family: Georgia, serif; font-size: 1.35rem; }
.project-heading { min-width: 0; text-align: center; }
.project-heading h1 { display: inline; font-family: Georgia, serif; font-size: 1.08rem; font-weight: 500; margin: 0; }
.save-state { color: var(--muted); font-size: .7rem; margin-right: .6rem; }
.save-state::before { background: var(--amber); border-radius: 50%; content: ""; display: inline-block; height: .45rem; margin-right: .35rem; width: .45rem; }
.save-state.connected::before { background: var(--moss); }
.revision { color: var(--muted); font-family: ui-monospace, monospace; font-size: .7rem; margin-left: .55rem; }
.header-actions { display: flex; gap: .45rem; }

.studio-shell { display: block; margin: 0; min-height: calc(100vh - 4.25rem); padding: 0; position: relative; width: 100%; z-index: auto; }
.library, .review { background: var(--panel); bottom: 0; box-shadow: 0 18px 55px rgba(0, 0, 0, .55); overflow: auto; padding: 1rem; position: fixed; top: 4.25rem; transition: transform .18s ease; width: min(22rem, calc(100vw - 2rem)); z-index: 12; }
.library { border-right: 1px solid var(--line); left: 0; transform: translateX(-105%); }
.review { border-left: 1px solid var(--line); right: 0; transform: translateX(105%); }
.studio-shell.library-open .library, .studio-shell.review-open .review { transform: translateX(0); }
.panel-heading, .editor-header, .dialog-heading { align-items: center; display: flex; justify-content: space-between; gap: 1rem; }
.panel-heading h2, .editor-header h2, .dialog-heading h2 { font-family: Georgia, serif; font-size: 1.12rem; margin: 0; }
.icon-button { align-items: center; background: transparent; border-color: var(--line); color: var(--ink); display: inline-flex; font-size: 1.15rem; height: 2rem; justify-content: center; padding: 0; width: 2rem; }

.field { display: grid; gap: .35rem; }
.field > span { color: var(--muted); font-size: .73rem; font-weight: 750; letter-spacing: .04em; }
.field input, .field select, .field textarea, select {
  background: var(--night);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: .65rem .7rem;
  width: 100%;
}
.field textarea { line-height: 1.55; resize: vertical; }
.field small { color: var(--muted); font-size: .7rem; }
.field.compact { margin: 1rem 0; }
.project-transfer-actions { display: grid; gap: .45rem; grid-template-columns: 1fr 1fr; margin: -.35rem 0 1rem; }
.project-transfer-actions button { font-size: .68rem; padding: .48rem .55rem; }
.project-transfer-actions small { color: var(--muted); font-size: .63rem; grid-column: 1 / -1; min-height: 1em; }
.campaign-image-direction { border-bottom: 1px solid var(--line); margin: 0 0 1rem; padding: 0 0 1rem; }
.campaign-image-direction summary { color: var(--moss); cursor: pointer; font-size: .72rem; font-weight: 800; margin-bottom: .7rem; }
.campaign-image-direction .field { margin-bottom: .55rem; }
.campaign-image-direction textarea { font-size: .7rem; }
.campaign-image-direction button { font-size: .68rem; padding: .45rem .55rem; width: 100%; }
.campaign-image-direction small { color: var(--muted); display: block; font-size: .63rem; margin-top: .4rem; min-height: 1em; }
.create-actions { display: grid; gap: .45rem; grid-template-columns: 1fr 1fr; margin-bottom: 1rem; }
.create-actions button:last-child { grid-column: 1 / -1; }
.create-actions button { background: var(--panel-raised); border-color: var(--line); color: var(--ink); font-size: .72rem; padding: .55rem .35rem; }
.document-list, .changeset-list { display: grid; gap: .4rem; }
.document-card, .changeset-card {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  display: grid;
  font-weight: 500;
  gap: .18rem;
  padding: .65rem;
  text-align: left;
  width: 100%;
}
.document-card:hover, .changeset-card:hover { background: var(--panel-raised); border-color: var(--line); filter: none; }
.document-card.active, .changeset-card.active { background: var(--panel-raised); border-color: var(--moss-dark); }
.document-card strong, .changeset-card strong { font-size: .83rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-meta { align-items: center; color: var(--muted); display: flex; font-family: ui-monospace, monospace; font-size: .62rem; gap: .4rem; }
.type-dot { border-radius: 50%; display: inline-block; height: .45rem; width: .45rem; }
.type-dot.adventure { background: var(--moss); }
.type-dot.room { background: var(--blue); }
.type-dot.actor { background: var(--amber); }
.type-dot.passage { background: #72aab5; }
.type-dot.event-graph { background: var(--violet); }
.empty-copy { color: var(--muted); font-size: .78rem; line-height: 1.5; }

.workspace { background: var(--night); min-height: calc(100vh - 4.25rem); overflow: auto; padding: 1.5rem clamp(1rem, 3vw, 3rem); }
.room-graph-overview { display: grid; gap: 1rem; margin: 0 auto; width: 100%; }
.room-graph-header { align-items: end; display: flex; gap: 1rem; justify-content: space-between; }
.room-graph-header h2 { font: 400 clamp(1.8rem, 4vw, 2.8rem)/1.1 Georgia, serif; margin: .25rem 0; }
.room-graph-header p:not(.eyebrow) { color: var(--muted); font-size: .76rem; margin: 0; }
.room-graph-actions { display: flex; gap: .5rem; justify-content: end; }
.room-graph { background: var(--night); border: 1px solid var(--line); border-radius: 12px; box-shadow: inset 0 0 70px rgba(0, 0, 0, .45); height: calc(100vh - 13rem); min-height: 32rem; overflow: hidden; position: relative; }
.room-graph-settings { background: rgba(20, 27, 23, .94); border: 1px solid var(--line); border-radius: 7px; position: absolute; right: .8rem; top: .8rem; width: 13rem; z-index: 4; }
.room-graph-settings summary { color: var(--muted); cursor: pointer; font-size: .68rem; font-weight: 800; letter-spacing: .08em; padding: .5rem .65rem; text-transform: uppercase; }
.room-graph-settings-fields { border-top: 1px solid var(--line); display: grid; gap: .7rem; padding: .7rem; }
.room-graph-settings-fields label { display: grid; gap: .25rem; }
.room-graph-settings-fields label > span { color: var(--muted); display: flex; font-size: .65rem; justify-content: space-between; }
.room-graph-settings-fields output { color: var(--moss); font-family: ui-monospace, monospace; }
.room-graph-settings-fields input { accent-color: var(--moss); cursor: pointer; margin: 0; width: 100%; }
.room-graph-edges, .room-graph-nodes { height: 100%; inset: 0; position: absolute; width: 100%; }
.room-graph-edges line { stroke: var(--control-line); stroke-opacity: .72; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.room-graph-node { align-items: center; background: transparent; border: 0; color: var(--ink); display: grid; filter: none; justify-items: center; min-width: 7rem; padding: .4rem; position: absolute; text-align: center; touch-action: none; transform: translate(-50%, -50%); user-select: none; }
.room-graph-node:hover { color: #fff; filter: none; }
.room-graph-node-dot { align-items: center; background: var(--panel-raised); border: 2px solid var(--ink); border-radius: 50%; box-shadow: 0 0 0 5px rgba(157, 183, 135, .09), 0 0 18px rgba(157, 183, 135, .45); display: flex; height: var(--room-node-size); justify-content: center; overflow: hidden; transition: box-shadow .15s, transform .15s; width: var(--room-node-size); }
.room-graph-node-dot img { height: 100%; object-fit: cover; width: 100%; }
.room-graph-node-fallback { color: var(--moss); font: 600 1.35rem/1 Georgia, serif; text-transform: uppercase; }
.room-graph-node:hover .room-graph-node-dot, .room-graph-node:focus-visible .room-graph-node-dot { box-shadow: 0 0 0 7px rgba(157, 183, 135, .15), 0 0 26px rgba(157, 183, 135, .75); transform: scale(1.18); }
.room-graph-node.dragging { cursor: grabbing; z-index: 2; }
.room-graph-node-label { font: 500 .76rem/1.2 Georgia, serif; margin-top: .45rem; max-width: 9rem; text-shadow: 0 2px 5px #000; }
.room-graph-node small { background: var(--panel-raised); border-radius: 999px; color: var(--muted); font-size: .55rem; margin-top: .2rem; min-width: 1rem; padding: .08rem .25rem; }
.room-graph-empty { color: var(--muted); font: italic 1rem/1.5 Georgia, serif; left: 50%; margin: 0; position: absolute; text-align: center; top: 50%; transform: translate(-50%, -50%); }
.room-graph-hint { color: var(--muted); font-size: .68rem; margin: 0; text-align: center; }
.room-graph-hint span { background: var(--moss); border-radius: 50%; display: inline-block; height: .5rem; margin-right: .35rem; width: .5rem; }
.editor { margin: 0 auto; max-width: 62rem; }
.editor-header { margin-bottom: 1rem; }
.editor-header h2 { font-size: 1.7rem; }
.editor-actions { display: flex; gap: .5rem; }
.document-identity { margin: 0 0 1rem; max-width: 24rem; }
.document-identity input { font-family: ui-monospace, monospace; }
.editor-tabs { border-bottom: 1px solid var(--line); display: flex; gap: .15rem; margin-bottom: 1.25rem; }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: .7rem .9rem; }
.tab.active { border-bottom-color: var(--moss); color: var(--ink); }
.editor-pane { min-height: 30rem; }
.editor-note, .block-toolbar p, .json-toolbar p { color: var(--muted); font-size: .76rem; }
.json-toolbar, .block-toolbar { align-items: center; display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.json-source { background: var(--night); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-family: "SFMono-Regular", Consolas, monospace; font-size: .78rem; line-height: 1.55; min-height: 34rem; padding: 1rem; resize: vertical; tab-size: 2; width: 100%; }

.room-composer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  margin: 0 auto;
  max-width: 42rem;
  overflow: hidden;
}
.room-preview-mode {
  background: var(--night);
  inset: 0;
  overflow: auto;
  position: fixed;
  z-index: 20;
}
.room-preview-mode .room-preview-scene-stage { position: absolute; }
.room-preview-mode .room-preview-scene-stage .scene-layer {
  filter: blur(8px) saturate(.92) contrast(1.02);
}
.room-preview-mode .room-preview-scene-stage .scene-shade {
  background:
    radial-gradient(circle at 50% 35%,
      color-mix(in srgb, var(--panel-strong) 18%, transparent), transparent 62%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--night) 46%, transparent),
      color-mix(in srgb, var(--night) 74%, transparent));
}
.room-preview-shell.game { height: 100vh; margin: 0 auto; max-width: 100rem; min-height: 40rem; padding: clamp(1rem, 3vw, 2.5rem); position: relative; width: 100%; z-index: 1; }
.room-preview-game-header { margin: 0; }
.room-preview-heading { align-items: center; display: flex; gap: 1rem; min-width: 0; }
.room-preview-heading h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-preview-status { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.room-preview-inline-name,
.room-preview-inline-description {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: inherit;
  font: inherit;
  padding: .12rem .2rem;
  width: 100%;
}
.room-preview-inline-name { margin: -.12rem -.2rem; }
.room-preview-inline-description { margin: -.12rem -.2rem 0; resize: vertical; }
.room-preview-inline-name:hover,
.room-preview-inline-description:hover { border-color: color-mix(in srgb, var(--moss) 42%, transparent); }
.room-preview-inline-name:focus,
.room-preview-inline-description:focus {
  background: color-mix(in srgb, var(--panel-strong) 86%, transparent);
  border-color: var(--moss);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--moss) 18%, transparent);
  outline: none;
}
.room-preview-layout { min-height: 0; }
.room-preview-chat .room-board { background: var(--panel); grid-area: transcript; }
.room-preview-mode .room-map-token,
.room-preview-mode .room-map-exit-marker { cursor: pointer; pointer-events: auto; }
.room-preview-mode .room-background-effect { z-index: 1; }
.room-preview-mode .combat-position-markers { z-index: 2; }
.room-preview-mode [draggable="true"] { cursor: grab; }
.room-preview-mode [draggable="true"]:active { cursor: grabbing; }
.room-preview-mode .placement-dragging { opacity: .42; }
.room-preview-mode .placement-drag-active .combat-position-markers {
  pointer-events: auto;
  z-index: 6;
}
.room-preview-mode .placement-drag-active .combat-position-marker {
  background: rgba(214, 166, 93, .08);
  outline: 1px dashed rgba(214, 166, 93, .28);
  outline-offset: -4px;
}
.room-preview-mode .placement-drag-active .combat-position-marker::before {
  background: linear-gradient(180deg, transparent, rgba(240, 223, 131, .78) 12% 88%, transparent);
  box-shadow: 0 0 10px rgba(240, 223, 131, .34);
  width: 3px;
}
.room-preview-mode .placement-drag-active .combat-position-marker.placement-drop-target {
  background: rgba(240, 223, 131, .2);
  outline-color: #f0df83;
}
.room-preview-mode .room-map-token:focus-visible { filter: drop-shadow(0 0 8px var(--amber)); outline: none; }
.room-preview-mode .room-map-exit-marker:focus-visible { border-color: var(--amber); outline: 2px solid var(--amber); outline-offset: 2px; }
.room-preview-mode .room-exit-action { cursor: pointer; }
.room-preview-mode .room-exit-action[draggable="true"] { cursor: grab; }
.room-preview-mode .room-exit-action.active { background: var(--selected); border-color: var(--moss); }
.room-preview-mode .room-preview-entity-control {
  width: 100%;
  color: inherit;
  font-weight: inherit;
  text-align: left;
}
.room-preview-mode .room-preview-entity-control:hover {
  border-color: var(--moss);
  background: var(--selected);
  filter: none;
}
.room-preview-mode .room-preview-entity-control.active {
  border-color: var(--moss);
  background: var(--selected);
}
.room-map-drag-hint { color: var(--muted); font-style: italic; }
.modification-panel { display: flex; flex-direction: column; overflow: hidden; }
.modification-panel > h2 { overflow-wrap: anywhere; }
.room-modification-content { flex: 1 1 auto; min-height: 0; overflow: auto; padding-right: .35rem; }
.modification-section { display: grid; gap: .65rem; }
.modification-field { display: grid; gap: .3rem; }
.modification-field > span { color: var(--muted); font-size: .68rem; font-weight: 750; }
.modification-field input,
.modification-field select,
.modification-field textarea {
  background: var(--night);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: .72rem;
  margin: 0;
  padding: .55rem .6rem;
  resize: vertical;
  width: 100%;
}
.modification-field input:focus,
.modification-field select:focus,
.modification-field textarea:focus { border-color: var(--moss); outline: 2px solid var(--selected); }
.modification-field input:disabled { color: var(--muted); opacity: .72; }
.modification-checkbox { align-items: center; color: var(--muted); display: flex; font-size: .72rem; gap: .45rem; }
.modification-checkbox input { accent-color: var(--moss); }
.illustration-editor { display: grid; gap: .55rem; }
.illustration-preview,
.actor-illustration-preview { aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 7px; object-fit: cover; width: 100%; }
.actor-illustration-preview { margin: .65rem 0; }
.illustration-upload { align-items: center; background: transparent; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); cursor: pointer; display: flex; font-size: .7rem; font-weight: 700; justify-content: center; padding: .52rem; }
.illustration-upload:hover { border-color: var(--moss-dark); }
.illustration-upload input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.illustration-status,
.illustration-editor > small { color: var(--muted); font-size: .64rem; }
.room-section-heading { align-items: center; display: flex; gap: .5rem; justify-content: space-between; margin-bottom: .65rem; }
.room-section-heading h3 { margin-bottom: 0; }
.room-section-add { align-items: center; background: transparent; border-color: var(--line); border-radius: 50%; color: var(--moss); display: inline-flex; flex: 0 0 auto; font-size: 1rem; height: 1.6rem; justify-content: center; line-height: 1; padding: 0 0 .08rem; width: 1.6rem; }
.room-section-add[aria-expanded="true"] { background: var(--moss-dark); color: var(--ink); }
.room-add-menu { display: grid; gap: .35rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: -.15rem 0 .65rem; }
.room-add-menu button { background: var(--panel-raised); border-color: var(--line); color: var(--ink); font-size: .65rem; padding: .4rem .3rem; }
.room-add-menu button:only-child { grid-column: 1 / -1; }
.room-modification-actions { display: grid; flex: 0 0 auto; gap: .45rem; grid-template-columns: 1fr 1.25fr; margin-top: 1rem; }
.room-modification-actions button { font-size: .7rem; padding: .55rem .4rem; }
.room-properties { background: var(--panel); display: grid; gap: .85rem; padding: 1rem; }
.inspector-heading { border-bottom: 1px solid var(--line); padding-bottom: .8rem; }
.inspector-heading h3 { font-family: Georgia, serif; margin: 0; }
.actor-composer { align-items: start; display: grid; gap: 1rem; grid-template-columns: 17rem minmax(0, 1fr); }
.actor-overview { background: linear-gradient(155deg, var(--panel-raised), var(--panel) 72%); border: 1px solid var(--line); border-radius: 10px; min-height: 18rem; padding: 1.25rem; position: sticky; top: 5.5rem; }
.actor-overview h3 { font: 500 1.8rem/1.08 Georgia, serif; margin: .4rem 0 .8rem; }
.actor-overview > p:not(.eyebrow) { color: var(--muted); font: .88rem/1.55 Georgia, serif; }
.actor-overview .actor-model-note { border-top: 1px solid var(--line); color: var(--muted); font: .7rem/1.45 Inter, sans-serif; margin-top: 1.2rem; padding-top: .8rem; }
.component-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; }
.component-badge { background: var(--panel-raised); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 700 .6rem/1 ui-monospace, monospace; padding: .35rem .48rem; text-transform: capitalize; }
.component-badge.identity, .component-badge.location { border-color: var(--moss-dark); color: var(--moss); }
.component-badge.hazard { border-color: #8a5149; color: #efaaa3; }
.type-dot.passage { background: var(--amber); }
.passage-composer { display: grid; gap: .85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.passage-composer > :first-child { grid-column: 1 / -1; }
.passage-composer .modification-section { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 1rem; }
.passage-composer .passage-endpoint { border-color: #665b42; }
.actor-properties { display: grid; gap: .7rem; }
.actor-component { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: .9rem; }
.actor-component.required-component { border-color: var(--moss-dark); }
.component-heading { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: .7rem; margin-bottom: .8rem; padding-bottom: .65rem; }
.component-heading span { background: var(--moss); border-radius: 4px; color: var(--on-accent); font-size: .58rem; font-weight: 900; letter-spacing: .08em; padding: .2rem .35rem; text-transform: uppercase; }
.component-heading h3 { font: 500 1.05rem/1.1 Georgia, serif; margin: 0; }
.component-grid { display: grid; gap: .7rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.component-grid .wide { grid-column: 1 / -1; }
.component-fields { border-top: 1px solid var(--line); margin-top: .75rem; padding-top: .75rem; }
.component-toggle { align-items: center; cursor: pointer; display: flex; gap: .7rem; }
.component-toggle > input { height: 1.05rem; width: 1.05rem; }
.component-toggle > span { display: grid; gap: .1rem; }
.component-toggle strong { font-family: Georgia, serif; font-size: 1rem; }
.component-toggle small { color: var(--muted); font-size: .68rem; }
.actor-component .checkbox-field { align-items: center; align-self: end; min-height: 2.45rem; }
.attached-event-graphs > p, .modification-note { color: var(--muted); font-size: .7rem; line-height: 1.45; margin: 0; }
.actor-event-graph-list { display: grid; gap: .4rem; margin: .75rem 0; }
.actor-event-graph-list button, .attached-event-graphs > button { font-size: .7rem; text-align: left; width: 100%; }

.event-rule-list { display: grid; gap: 1rem; }
.event-owner-editor { align-items: end; background: var(--panel); border: 1px solid var(--moss-dark); border-radius: 9px; display: grid; gap: .8rem; grid-template-columns: minmax(14rem, 1fr) 10rem 14rem; margin-bottom: 1rem; padding: .9rem; }
.event-owner-editor h3 { font: 500 1.1rem/1.1 Georgia, serif; margin: .2rem 0; }
.event-owner-editor > div > p:last-child { color: var(--muted); font-size: .7rem; line-height: 1.4; margin: .35rem 0 0; }
.study-topic-editor { background: var(--panel); border: 1px solid var(--moss-dark); border-radius: 9px; margin-bottom: 1rem; padding: .9rem; }
.study-topic-heading, .study-topic-block-heading { align-items: center; display: flex; justify-content: space-between; gap: .8rem; }
.study-topic-heading h3 { font: 500 1.1rem/1.1 Georgia, serif; margin: .2rem 0; }
.study-topic-heading p:last-child { color: var(--muted); font-size: .7rem; line-height: 1.4; margin: .35rem 0 .75rem; }
.study-topic-list { display: grid; gap: .7rem; }
.study-topic-block { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.study-topic-block-heading { background: var(--panel-raised); border-bottom: 1px solid var(--line); padding: .55rem .7rem; }
.study-topic-fields { display: grid; gap: .7rem; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .7rem; }
.study-topic-fields .wide { grid-column: 1 / -1; }
.rule-block { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rule-heading { align-items: center; background: var(--panel-raised); border-bottom: 1px solid var(--line); display: flex; gap: .65rem; padding: .7rem; }
.rule-heading .field { flex: 1; }
.rule-heading input { font-family: ui-monospace, monospace; }
.block-label { border-radius: 4px; color: #101312; font-size: .63rem; font-weight: 900; letter-spacing: .1em; padding: .25rem .42rem; text-transform: uppercase; }
.block-label.when { background: var(--amber); }
.block-label.then { background: var(--moss); }
.remove-button { background: transparent; border-color: transparent; color: var(--muted); padding: .3rem .45rem; }
.trigger-block, .effect-block { display: grid; gap: .7rem; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .8rem; }
.trigger-block { background: rgba(214, 166, 93, .06); border-bottom: 1px solid var(--line); }
.effect-list { display: grid; }
.effect-block { background: rgba(157, 183, 135, .035); border-bottom: 1px dashed var(--line); position: relative; }
.effect-block:last-child { border-bottom: 0; }
.effect-block .wide, .trigger-block .wide { grid-column: 1 / -1; }
.effect-heading { align-items: center; display: flex; gap: .45rem; grid-column: 1 / -1; }
.effect-heading select { flex: 1; }
.checkbox-field { align-items: center; display: flex; gap: .5rem; padding-top: 1.4rem; }
.checkbox-field input { accent-color: var(--moss); }
.study-entries, .study-entry { display: grid; gap: .7rem; }
.study-entry { border: 1px solid var(--line); border-radius: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .7rem; }
.study-entry .wide { grid-column: 1 / -1; }
.relationship-heading { border-top: 1px solid var(--line); margin-top: .25rem; padding-top: .8rem; }
.relationship-heading span { display: grid; gap: .2rem; }
.relationship-heading small, .relationship-help { color: var(--muted); font-size: .7rem; line-height: 1.4; }
.relationship-entries, .relationship-entry { display: grid; gap: .7rem; }
.relationship-entry { border: 1px solid var(--line); border-radius: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .7rem; }
.relationship-entry .wide, .relationship-entry .relationship-help { grid-column: 1 / -1; }
.wild-shape-form-picker { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: .55rem; grid-column: 1 / -1; margin: 0; padding: .7rem; }
.wild-shape-form-picker legend { color: var(--ink-muted); font-size: .78rem; font-weight: 700; padding: 0 .25rem; }
.wild-shape-selected { display: grid; gap: .35rem; }
.wild-shape-selected-form, .wild-shape-add-form { align-items: center; display: flex; gap: .5rem; justify-content: space-between; }
.wild-shape-add-form select { flex: 1; min-width: 0; }
.add-effect { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; color: var(--moss); width: 100%; }

.count { align-items: center; background: var(--panel-raised); border-radius: 999px; color: var(--muted); display: inline-flex; font-size: .7rem; height: 1.6rem; justify-content: center; min-width: 1.6rem; padding: 0 .45rem; }
.changeset-list { margin-top: 1rem; }
.changeset-card { border-color: var(--line); }
.changeset-card .diagnostic-count { color: var(--red); }
.changeset-review { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.review-summary h3 { font-family: Georgia, serif; font-size: 1.12rem; margin: .45rem 0 .25rem; }
.review-summary p { color: var(--muted); font-size: .72rem; }
.status-pill { background: var(--panel-raised); border: 1px solid var(--moss-dark); border-radius: 999px; color: var(--moss); font-size: .62rem; font-weight: 800; letter-spacing: .08em; padding: .2rem .45rem; text-transform: uppercase; }
.changeset-review h4 { color: var(--muted); font-size: .66rem; letter-spacing: .12em; margin: 1rem 0 .5rem; text-transform: uppercase; }
.operation, .diagnostic { border-left: 2px solid var(--line); font-size: .72rem; margin: .45rem 0; padding: .35rem .55rem; }
.operation code { color: var(--blue); }
.diagnostic.error { border-color: var(--red); color: #efaaa3; }
.diagnostic.success { border-color: var(--moss); color: var(--moss); }
.diagnostic small { color: var(--muted); display: block; font-family: ui-monospace, monospace; margin-top: .2rem; }
.review-actions { display: grid; gap: .5rem; grid-template-columns: 1fr 1.5fr; margin-top: 1rem; }

dialog { background: transparent; border: 0; color: var(--ink); padding: 1rem; }
dialog::backdrop { background: rgba(4, 6, 5, .78); backdrop-filter: blur(5px); }
.dialog-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 80px #0009; display: grid; gap: 1rem; min-width: min(30rem, calc(100vw - 2rem)); padding: 1.25rem; }
.dialog-card > p { color: var(--muted); font-size: .82rem; line-height: 1.5; margin: 0; }
.dialog-card code { color: var(--moss); }
.remember { align-items: center; color: var(--muted); display: flex; font-size: .75rem; gap: .45rem; }
.dialog-actions { display: flex; gap: .5rem; justify-content: end; }
.actor-template-card { max-height: calc(100vh - 2rem); overflow: auto; width: min(74rem, calc(100vw - 2rem)); }
.actor-template-description { color: var(--muted); font-size: .76rem; margin: 0; max-width: 48rem; }
.actor-template-step { display: grid; gap: .75rem; min-height: 0; }
.actor-template-step.hidden { display: none; }
.actor-template-step-heading { align-items: end; display: flex; gap: 1rem; justify-content: space-between; }
.actor-template-step-heading h3 { font: 500 1.25rem/1.15 Georgia, serif; margin: 0 0 .25rem; }
.actor-template-step-heading p { color: var(--muted); font-size: .74rem; margin: 0; }
.actor-template-step-heading .field { flex: 0 1 22rem; }
.actor-template-step-actions { display: flex; justify-content: start; }
.actor-control-choices { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.actor-control-choice { align-content: start; background: var(--panel); border: 1px solid var(--line); color: var(--ink); display: grid; gap: .45rem; justify-items: start; min-height: 11rem; padding: 1.2rem; text-align: left; }
.actor-control-choice:hover, .actor-control-choice:focus-visible { background: var(--panel-raised); border-color: var(--moss); filter: none; }
.actor-control-choice strong { font: 600 1.18rem/1.1 Georgia, serif; }
.actor-control-choice small { color: var(--muted); font-size: .73rem; line-height: 1.5; }
.actor-control-symbol { color: var(--amber); font-size: 2.4rem; line-height: 1; }
.class-backing-summary { align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: grid; gap: .2rem .7rem; grid-template-columns: auto 1fr; max-width: 36rem; padding: .8rem; }
.class-backing-summary .class-backing-symbol { color: var(--amber); font-size: 1.8rem; grid-row: 1 / 3; }
.class-backing-summary small { color: var(--muted); }
.actor-template-result-count { color: var(--muted); font-size: .68rem; margin: 0; }
.actor-template-stat-blocks { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.monster-manual-card {
  appearance: none;
  background: #e2d7ba;
  border: 1px solid #8b4937;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px rgba(255, 250, 224, .38), 0 5px 16px rgba(0, 0, 0, .28);
  color: #2d2119;
  display: block;
  font: 400 .72rem/1.35 Georgia, serif;
  min-width: 0;
  padding: .75rem;
  text-align: left;
  width: 100%;
}
button.monster-manual-card { cursor: pointer; }
button.monster-manual-card:hover,
button.monster-manual-card:focus-visible { border-color: #e7c36c; box-shadow: 0 0 0 3px rgba(231, 195, 108, .22), 0 9px 22px rgba(0, 0, 0, .4); filter: none; transform: translateY(-1px); }
.monster-manual-heading { border-bottom: 3px double #8b4937; display: grid; gap: .1rem; padding-bottom: .4rem; }
.monster-manual-heading h4 { color: #7d2f26; font: 700 1.15rem/1.05 Georgia, serif; margin: 0; }
.monster-manual-heading span { font-size: .68rem; font-style: italic; }
.monster-manual-defenses { border-bottom: 1px solid rgba(125, 47, 38, .55); display: flex; flex-wrap: wrap; font-weight: 700; gap: .35rem 1rem; padding: .45rem 0; }
.monster-manual-abilities { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: .45rem 0; text-align: center; }
.monster-manual-abilities div { display: grid; gap: .08rem; }
.monster-manual-abilities dt { color: #7d2f26; font-size: .62rem; font-weight: 800; }
.monster-manual-abilities dd { margin: 0; }
.monster-manual-actions { border-top: 1px solid rgba(125, 47, 38, .55); padding-top: .35rem; }
.monster-manual-actions p { margin: .35rem 0 0; }
#actor-template-selected-stat-block { max-width: 36rem; }
.actor-placement-prompt { align-items: center; background: #242a20; border: 1px solid #d6a65d; border-radius: 8px; display: grid; gap: .35rem 1rem; grid-template-columns: 1fr auto; margin: 0 0 .75rem; padding: .7rem .8rem; }
.actor-placement-prompt div { align-items: baseline; display: flex; flex-wrap: wrap; gap: .35rem .65rem; }
.actor-placement-card { border-radius: 6px; cursor: grab; padding: .2rem; }
.actor-placement-card:active { cursor: grabbing; }
.actor-placement-prompt .eyebrow { flex-basis: 100%; margin: 0; }
.actor-placement-prompt span { color: var(--muted); font-size: .72rem; }
.actor-placement-prompt .error { grid-column: 1 / -1; margin: 0; }
.room-preview-mode .room-map-field.actor-placement-active { border-color: #d6a65d; box-shadow: 0 0 0 3px rgba(214, 166, 93, .13), inset 0 0 30px rgba(0, 0, 0, .14); }
.room-preview-mode .actor-placement-active .combat-position-target { border-radius: 0; bottom: 0; left: 0; top: 0; transform: none; width: 100%; }
.room-preview-mode .actor-placement-active .combat-position-marker.available { transition: background .12s ease; }
.room-preview-mode .actor-placement-active .combat-position-marker.available:hover { background: rgba(240, 223, 131, .16); }
.actor-template-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.actor-template-grid .actor-template-wide { grid-column: 1 / -1; }
.mcp-connection { border-top: 1px solid var(--line); display: grid; gap: .7rem; margin-top: .25rem; padding-top: 1rem; }
.mcp-connection h3 { font-family: Georgia, serif; margin: 0; }
.mcp-connection > p { color: var(--muted); font-size: .76rem; margin: 0; }
.mcp-connection .mcp-access-summary { background: var(--night); border: 1px solid var(--line); border-radius: 7px; padding: .65rem .75rem; }
.scope-options { display: flex; flex-wrap: wrap; gap: .8rem; }
.scope-options label { align-items: center; color: var(--muted); display: flex; font-size: .72rem; gap: .35rem; }
.scope-options input { accent-color: var(--moss); }
.mcp-credentials { background: var(--night); border: 1px solid var(--line); border-radius: 7px; display: grid; gap: .65rem; padding: .75rem; }
.mcp-credentials input { font-family: ui-monospace, monospace; font-size: .7rem; }
.mcp-copy-actions { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; }
.mcp-credentials .mcp-connection-help { color: var(--muted); font-size: .68rem; line-height: 1.45; margin: 0; }

@media (max-width: 1100px) {
  .room-graph { height: calc(100vh - 12rem); }
}

@media (max-width: 900px) {
  .actor-composer { grid-template-columns: 1fr; }
  .passage-composer { grid-template-columns: 1fr; }
  .passage-composer > :first-child { grid-column: 1; }
  .actor-overview { min-height: 0; position: static; }
  .room-preview-shell.game { height: auto; }
  .room-preview-layout .character-panel { max-height: none; position: static; }
  .room-modification-content { overflow: visible; }
  .event-owner-editor { grid-template-columns: 1fr; }
  .study-topic-fields { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .studio-header { grid-template-columns: 1fr auto; }
  .project-heading { display: none; }
  .workspace { min-height: 70vh; padding: 1rem; }
  .room-graph { height: 36rem; min-height: 0; }
  .room-graph-header { align-items: start; flex-direction: column; }
  .trigger-block, .effect-block { grid-template-columns: 1fr; }
  .component-grid { grid-template-columns: 1fr; }
  .component-grid .wide { grid-column: 1; }
  .study-entry { grid-template-columns: 1fr; }
  .actor-template-grid { grid-template-columns: 1fr; }
  .actor-template-grid .actor-template-wide { grid-column: 1; }
  .actor-template-step-heading { align-items: stretch; flex-direction: column; }
  .actor-template-step-heading .field { flex-basis: auto; width: 100%; }
  .actor-template-stat-blocks { grid-template-columns: 1fr; }
  .actor-control-choices { grid-template-columns: 1fr; }
  .effect-block .wide, .trigger-block .wide { grid-column: 1; }
  .header-actions .button[href="/"] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Adventure-level navigation stays visible above the Area workspace. */
.adventure-overview { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border, var(--line)); }
.adventure-heading, .adventure-area-navigation { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.adventure-heading h2 { margin-right: auto; }
.adventure-area-navigation .field { flex: 1; min-width: 12rem; }
.adventure-editor { max-width: 64rem; padding: 1.5rem; display: grid; gap: 1rem; }
.adventure-section { border-top: 1px solid var(--border, var(--line)); padding-top: 1rem; }
.adventure-section > summary { cursor: pointer; font-weight: 650; padding: .5rem 0; }
.adventure-membership, .adventure-output, .adventure-route { padding: .8rem 0; border-bottom: 1px solid var(--border, var(--line)); display: grid; gap: .6rem; }
.adventure-membership > button { justify-self: start; }
.adventure-row { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; padding: .5rem 0; }
.adventure-row .field { flex: 1; min-width: 9rem; }
.adventure-conditions { padding: .5rem 0; }
.adventure-conditions summary { cursor: pointer; }
@media (max-width: 700px) {
  .adventure-overview, .adventure-editor { padding: 1rem; }
  .adventure-area-navigation > button { flex: 1; }
  .adventure-heading h2, .adventure-area-navigation .field { flex-basis: 100%; }
}
.library[aria-hidden="true"], .review[aria-hidden="true"] { visibility: hidden; }
@media (max-width: 720px) {
  .studio-header { grid-template-columns: 1fr; gap: .5rem; position: relative; }
  .header-actions { flex-wrap: wrap; }
  .header-actions button { padding: .5rem .65rem; }
  .library, .review { top: 0; max-width: 100vw; }
  .adventure-heading h2 { overflow-wrap: anywhere; }
}
.adventure-heading > .field { min-width: 12rem; max-width: 24rem; }
@media (max-width: 720px) {
  .adventure-heading > .field { min-width: 0; flex: 1; }
}

.studio-breadcrumbs { align-items: center; display: flex; flex-wrap: wrap; gap: .4rem; color: var(--muted); margin-bottom: 1.4rem; }
.studio-breadcrumbs button { border-color: transparent; padding: .35rem .5rem; }
.studio-breadcrumbs > span:last-child { color: var(--moss); }
.adventure-heading h2 { font: 500 2rem/1.2 Georgia, serif; }
.studio-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1.2rem; padding: 1.5rem 0 2rem; }
.studio-library-card { display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; min-height: 13rem; padding: 1.5rem; text-align: left; background: linear-gradient(145deg, var(--panel-raised), var(--panel)); border: 1px solid var(--line); color: var(--ink); overflow-wrap: anywhere; }
.studio-library-card:hover { border-color: var(--moss); }
.studio-library-card strong { font: 500 1.6rem/1.2 Georgia, serif; }
.library-card-detail { color: var(--muted); font-size: .8rem; font-weight: 400; }
.library-card-open { margin-top: auto; color: var(--moss); font-size: .8rem; }

/* Studio workspace surfaces. Keep room preview colors controlled by its scene. */
:root { --ink: #edf0eb; --muted: #aab4ad; --night: #101615; --panel: #18211e; --panel-raised: #222e29; --line: #3a4b43; --moss: #b5cda6; --moss-dark: #68875b; }
.studio-header { background: var(--night); padding-inline: clamp(1rem, 2vw, 2rem); box-shadow: 0 4px 20px #0002; grid-template-columns: auto minmax(0, 1fr) auto; }
.brand { gap: 1rem; }
.brand-mark { border-radius: 8px; background: var(--soft-highlight); }
.project-heading { text-align: left; padding-left: 1.25rem; border-left: 1px solid var(--line); }
.project-heading h1 { display: block; font-family: inherit; font-size: .9rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-state { font-size: .75rem; }
.header-actions { align-items: center; flex-wrap: wrap; }
.workspace { padding: clamp(1rem, 2.5vw, 2.5rem); }
.adventure-overview { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.5rem; }
.studio-breadcrumbs { font-size: .85rem; margin-bottom: 1rem; }
.studio-library-grid { gap: 1rem; }
.studio-library-card { min-height: 15rem; border-radius: 14px; padding: 1.5rem; box-shadow: 0 8px 24px #0002; background: var(--panel); }
.studio-library-card:hover { background: var(--panel-raised); box-shadow: 0 12px 32px #0003; filter: none; }
.studio-library-card .eyebrow { border: 1px solid var(--line); border-radius: 5px; padding: .3rem .5rem; }
.studio-library-card strong { font-size: 1.7rem; }
.library-card-detail { line-height: 1.65; }
.library-card-open { border-top: 1px solid var(--line); padding-top: .85rem; width: 100%; }
.library, .review { padding: 1.25rem; background: var(--panel); }
.panel-heading { padding-bottom: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.panel-heading > div { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.panel-heading .eyebrow { flex-basis: 100%; }
.panel-heading h2 { margin-right: auto; }
.document-card, .changeset-card { border-radius: 8px; padding: .85rem; }
.document-card.active, .changeset-card.active { border-color: var(--moss-dark); box-shadow: inset 3px 0 var(--moss); }
.document-meta { font-size: .72rem; flex-wrap: wrap; }
.field > span, .field small, .editor-note, .empty-copy { font-size: .82rem; }
.field input, .field textarea, .field select { border-radius: 8px; background: var(--night); }
.field { min-width: 0; }
.editor { max-width: 76rem; }
.editor-header { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.editor-tabs { gap: .5rem; }
.tab { font-size: .9rem; padding: .8rem 1.2rem; }
.tab.active { background: var(--soft-highlight); }
.room-graph { background-color: var(--night); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 24px 24px; border-radius: 14px; box-shadow: inset 0 0 80px #0003; }
.room-graph-header p:not(.eyebrow), .room-graph-hint { font-size: .82rem; }
.room-graph-actions, .editor-actions, .review-actions, .dialog-actions { flex-wrap: wrap; }
.dialog-card { padding: clamp(1rem, 3vw, 2rem); }
.dialog-heading { margin-bottom: 1.25rem; }
.dialog-heading h2 { font-size: 1.6rem; }
.actor-control-choice { border-radius: 10px; }
.json-source { font-size: .875rem; line-height: 1.7; }
@media (max-width: 1100px) {
  .studio-header { grid-template-columns: auto minmax(0, 1fr); }
  .header-actions { grid-column: 1 / -1; }
  .library, .review { top: 0; z-index: 12; }
}
@media (max-width: 720px) {
  .studio-header { position: relative; gap: .75rem; }
  .project-heading { display: block; padding-left: .75rem; }
  .header-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .header-actions .button[href="/"] { display: inline-flex; justify-content: center; }
  .header-actions button, .header-actions .button { font-size: .8rem; padding: .5rem; }
  .room-graph-actions, .editor-actions { justify-content: start; }
  .editor-header, .block-toolbar, .json-toolbar { align-items: flex-start; flex-direction: column; }
  .adventure-editor { padding-inline: 0; }
  .room-graph { min-height: 26rem; height: 65dvh; }
  .studio-library-card { min-height: 13rem; }
}
.adventure-overview:has(+ .room-graph-overview:not(.hidden)) { margin-bottom: 1.25rem; padding-block: .75rem; }
.adventure-overview:has(+ .room-graph-overview:not(.hidden)) .studio-breadcrumbs { margin: 0; }
.adventure-overview .error:empty { display: none; }
.studio-library-grid > .empty-copy { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 10px; padding: 2rem; margin: 0; text-align: center; }
/* Room authoring occupies the page; its covered workspace must not remain tabbable. */
body.room-previewing > .studio-header, body.room-previewing > .studio-shell { display: none; }
.adventure-overview { margin-bottom: 1.25rem; }
.room-section-add { min-width: 2.75rem; flex-shrink: 0; }

/* Room copy lives in a generous sidebar; the pencil opens its inline editor. */
#room-preview-sidebar-name { overflow-wrap: anywhere; }
#room-preview-sidebar-description { white-space: pre-wrap; overflow-wrap: anywhere; font: .95rem/1.6 system-ui, sans-serif; }
#room-text-edit { flex: 0 0 auto; min-width: 44px; min-height: 44px; font-size: 1.3rem; }
.room-text-editor { display: grid; gap: .65rem; margin: 1rem 0 1.5rem; }
.room-text-editor label { font-size: .8rem; color: var(--muted); }
.room-text-editor textarea { margin: 0; padding: .65rem; border-color: var(--line); font: 400 1rem/1.5 system-ui, sans-serif; resize: vertical; }
#room-text-done { justify-self: end; }
@media (min-width: 901px) {
  .studio-app .room-preview-layout { grid-template-columns: minmax(20rem, 26rem) minmax(0, 1fr) minmax(15rem, 18rem); }
}

/* Typed Blueprint execution and query ports. */
.blueprint-map { overflow: auto; max-height: 34rem; border: 1px solid #40536b; border-radius: .6rem; background: #111c2a; padding: 1rem; margin-block: 1rem; }
.blueprint-map p { color: #c4d3e8; max-width: 65ch; }
.blueprint-map svg { display: block; margin-inline: auto; }
.blueprint-wire { fill: none; stroke: #8ca6c7; stroke-width: 2; }
.blueprint-node { cursor: pointer; }
.blueprint-node rect { fill: #283c58; stroke: #90b4df; }
.blueprint-node.event rect { fill: #65333c; }
.blueprint-node.condition rect { fill: #254c43; }
.blueprint-node.merge rect { fill: #344052; }
.blueprint-node text, .blueprint-port-label { fill: #f2f6fc; font: 13px system-ui; }
.blueprint-node:focus rect, .blueprint-node:hover rect { stroke: #fff; stroke-width: 3; }
.blueprint-condition { border-left: 3px solid #529879; padding: .8rem; margin: .5rem 0; display: grid; gap: .6rem; }
.blueprint-ports { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.blueprint-port { border-left: 2px solid #7b96b5; padding-left: .8rem; min-width: 0; }
.blueprint-branch > .blueprint-condition { grid-column: 1 / -1; }
.blueprint-port .effect-block { display: flex; flex-direction: column; }
@media (max-width: 850px) { .blueprint-ports { grid-template-columns: 1fr; } }

#incoming-changes { border-bottom: 1px solid var(--line); margin-bottom: 1rem; padding-bottom: 1rem; }
#proposal-list { display: grid; gap: .6rem; margin: .75rem 0; }
#proposal-review details { margin: .75rem 0; }
#proposal-review summary { cursor: pointer; overflow-wrap: anywhere; }
#proposal-review > .button, #proposal-review > button { margin: .25rem .25rem .25rem 0; }
.proposal-document { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  font-size: .78rem; line-height: 1.5; max-height: 24rem; overflow: auto; padding: .75rem;
  white-space: pre-wrap; overflow-wrap: anywhere; }
