/* ArchMeta generated site — single hand-written stylesheet. */
:root {
  --bg: #fff;
  --panel: #fafbfc;
  --rule: #e3e6eb;
  --text: #222;
  --muted: #6a737d;
  --link: #1976d2;
  --sidebar-w: 280px;
  --top-h: 44px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Business / Full detail modes ---------------------------------------
   Business is the BASE: with no class on <html>, technical markup is hidden.
   Written as :not(.detail-full) rather than as a pair of display rules on
   purpose — in Full mode `.tech-only` then carries NO display override at all,
   so each element keeps its own (.type-chip is inline-block, .element-id is
   block). A `display: revert` in the "on" state would flatten them to the
   user-agent default instead. */
html:not(.detail-full) .tech-only { display: none; }
html.detail-full .business-only { display: none; }

.detail-toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.detail-btn { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; padding: 2px 10px; cursor: pointer; }
.detail-btn.active { background: var(--link); color: #fff; }

.top-strip { position: sticky; top: 0; z-index: 10; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--rule); }
.top-title { font-weight: 600; color: var(--text); }
.top-sep { color: var(--muted); }
.top-build { color: var(--muted); font-size: 12px; }
.top-link { margin-left: auto; font-size: 12px; }

.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: calc(100vh - var(--top-h)); }
.sidebar { position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 16px 12px; border-right: 1px solid var(--rule); background: var(--panel); }
.sidebar ul { list-style: none; margin: 0; padding-left: 14px; }
.sidebar .root { padding-left: 0; }
.sidebar .node { margin: 2px 0; }
.sidebar .seg { font-weight: 600; color: var(--text); cursor: pointer; user-select: none; }
.sidebar .seg::before { content: "▾ "; color: var(--muted); }
.sidebar .seg.collapsed::before { content: "▸ "; }
.sidebar .seg.collapsed + ul { display: none; }
.sidebar .view-link { display: block; padding: 2px 0; color: var(--link); font-size: 13px; }

.main-pane { padding: 20px 28px 60px 28px; max-width: 980px; }
.main-pane h1 { font-size: 22px; margin: 0 0 6px 0; }
.main-pane h2 { font-size: 17px; margin: 28px 0 8px 0; border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.main-pane h3 { font-size: 15px; margin: 20px 0 6px 0; }
.main-pane code { background: #eef1f5; padding: 1px 4px; border-radius: 3px; font-family: var(--mono); font-size: 12.5px; }
.main-pane pre { background: #f6f8fa; padding: 10px 12px; border-radius: 4px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; }
.main-pane .view-desc { color: var(--muted); margin: 4px 0 12px 0; }
.main-pane .svg-wrap { margin: 12px 0 24px 0; border: 1px solid var(--rule); border-radius: 4px; background: #fafbfc; padding: 8px; overflow: auto; }
.view-svg { width: 100%; max-height: 720px; display: block; cursor: zoom-in; }
.svg-empty { padding: 32px; color: var(--muted); font-style: italic; text-align: center; }

/* Diagram zoom modal — opened by clicking on any .view-svg.
   Background matches the normal .svg-wrap so the diagram visually expands
   into a full-viewport version of itself. */
.dz-overlay { position: fixed; inset: 0; background: var(--panel); display: none; z-index: 1000; }
.dz-overlay.open { display: block; }
.dz-stage { position: absolute; inset: 0; overflow: hidden; }
.dz-stage > svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; }
.dz-stage.panning > svg { cursor: grabbing; }
.dz-controls { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; z-index: 2; }
.dz-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule); background: var(--bg); color: var(--text); font-size: 18px; font-family: var(--mono, monospace); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.dz-btn:hover { background: #eef1f5; }
.dz-btn:focus { outline: 2px solid var(--link); outline-offset: 2px; }
.dz-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 11px; font-family: var(--mono, monospace); pointer-events: none; }

/* Element + relationship sections flow as page content (no box). A thin
   horizontal rule separates them so the eye can still segment. */
.element-section, .relationship-section { padding: 0; border: none; border-radius: 0; margin: 28px 0 0 0; background: transparent; border-top: 1px solid var(--rule); padding-top: 14px; }
.element-section:first-of-type, .relationship-section:first-of-type { border-top: none; padding-top: 0; margin-top: 12px; }
.element-section h3, .relationship-section h3 { margin: 0 0 4px 0; font-size: 16px; }
.element-section .element-id, .relationship-section .element-id { margin-bottom: 8px; }
.element-section .el-desc, .relationship-section .el-desc { margin: 8px 0; color: var(--text); white-space: pre-wrap; }
.element-section .el-md, .relationship-section .el-md { margin: 8px 0; }

/* --- Rendered Markdown -------------------------------------------------
   A `description-file` body reaches the page as HTML from markdown-it, and
   until 2026-08-21 nothing here styled it: `.ep-value` sets inline `code` and
   nothing else, and `.el-md` set a margin. So a description's nested lists,
   headings, fenced code, quotes and tables arrived unstyled — the structure was
   in the DOM and invisible on the page. The Viewer has carried these rules in
   MetadataPopup.css all along; this is the same set, so the popup on screen and
   the popup on the site render an authored `.md` the same way. One selector
   list covers both containers rather than two that can drift apart. */
.ep-md, .el-md { line-height: 1.5; }
.ep-md > :first-child, .el-md > :first-child { margin-top: 0; }
.ep-md > :last-child, .el-md > :last-child { margin-bottom: 0; }
.ep-md h1, .ep-md h2, .ep-md h3, .ep-md h4,
.el-md h1, .el-md h2, .el-md h3, .el-md h4 { color: var(--text); line-height: 1.25; margin: 12px 0 6px; }
.ep-md h1, .el-md h1 { font-size: 17px; }
.ep-md h2, .el-md h2 { font-size: 15px; }
.ep-md h3, .el-md h3 { font-size: 14px; }
.ep-md h4, .el-md h4 { font-size: 13px; }
.ep-md p, .el-md p { margin: 1em 0; }
/* The indentation. A nested list is a nested <ul>, so each level adds its own
   padding — this is what makes the structure visible rather than merely present. */
.ep-md ul, .ep-md ol, .el-md ul, .el-md ol { margin: 6px 0; padding-left: 20px; }
.ep-md li, .el-md li { margin: 2px 0; }
.ep-md a, .el-md a { color: var(--link); }
.ep-md code, .el-md code { font-family: var(--mono); font-size: 12px; background: #eef1f5; padding: 1px 4px; border-radius: 3px; }
/* A fenced block keeps its own whitespace and scrolls rather than wrapping —
   indented code that reflows is no longer the code that was written. */
.ep-md pre, .el-md pre { background: #f6f8fa; padding: 8px 10px; border-radius: 6px; overflow-x: auto; }
.ep-md pre code, .el-md pre code { background: none; padding: 0; }
.ep-md blockquote, .el-md blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid #dfe4ea; color: var(--muted); }
.ep-md table, .el-md table { border-collapse: collapse; margin: 8px 0; font-size: 12px; display: block; overflow-x: auto; }
.ep-md th, .ep-md td, .el-md th, .el-md td { border: 1px solid #dfe4ea; padding: 4px 8px; text-align: left; }
.ep-md th, .el-md th { background: #f6f8fa; }
.ep-md img, .el-md img { max-width: 100%; }
.ep-md hr, .el-md hr { border: none; border-top: 1px solid #ecf0f1; margin: 10px 0; }
.element-id { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.source-ref { margin-bottom: 8px; }
.source-ref code { font-family: var(--mono); font-size: 11px; color: var(--muted); background: #fff7e6; }
.type-chip { display: inline-block; padding: 1px 7px; border-radius: 10px; font-family: var(--mono); font-size: 11px; border: 1px solid #888; background: #f4f6fa; color: #444; vertical-align: middle; margin-left: 6px; }
.cross-views { margin-top: 6px; }
.cross-views .label { font-size: 11px; color: var(--muted); margin-right: 4px; }
.cross-views a { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 8px; border: 1px solid var(--link); border-radius: 10px; background: #e8f0fe; font-size: 12px; font-family: var(--mono); }

.home-view-card { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 5px; margin: 8px 0; background: var(--panel); }
.home-view-title { font-weight: 600; font-size: 15px; }
.home-view-id { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.home-view-desc { margin-top: 6px; font-size: 13px; color: #333; }
.home-section { font-size: 17px; margin: 24px 0 8px 0; border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.home-intro { color: var(--muted); margin: 4px 0 16px 0; }

.error-banner { background: #fdecea; border: 1px solid #c44; padding: 8px 10px; border-radius: 4px; margin: 8px 0; color: #802222; font-size: 12.5px; }

/* Element metadata popup (clickable diagram elements). */
.ep-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: none; align-items: flex-start; justify-content: center; z-index: 100000; }
.ep-overlay.open { display: flex; }
.ep-panel { background: #fff; margin-top: 6vh; width: min(560px, 92vw); max-height: 80vh; overflow-y: auto; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,0.3); }
.ep-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #ecf0f1; position: sticky; top: 0; background: #f8f9fa; }
.ep-head h3 { margin: 0; font-size: 16px; color: #2c3e50; word-break: break-word; }
.ep-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: #7f8c8d; padding: 0 4px; }
.ep-body { padding: 12px 16px; }
.ep-row { margin-bottom: 12px; }
.ep-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 4px; }
.ep-value { font-size: 13px; color: #2c3e50; word-break: break-word; }
.ep-value.ep-text { white-space: pre-wrap; }
.ep-value code { font-family: var(--mono); font-size: 12px; background: #eef1f5; padding: 1px 4px; border-radius: 3px; }
.ep-list { margin: 0; padding-left: 18px; }
.ep-pairs { margin: 0; }
.ep-pairs dt { font-weight: 600; color: #2c3e50; }
.ep-pairs dd { margin: 0 0 6px 0; }
.view-svg { cursor: pointer; }

.bpmn-link { margin: 10px 0 0 0; }
.bpmn-link a { font-size: 13px; text-decoration: none; color: #3b82f6; }
.bpmn-link a:hover { text-decoration: underline; }

/* ── Hidden relationships (spec 2026-08-27) ──
   A relationship the architect curated out of this view is PRESENT in the SVG
   and switched off here, so the reader's control can reveal it without the
   page re-running any layout. A reader with JS disabled therefore sees the
   curated diagram — the same right-way-round failure the detail toggle has.

   Stated where it is implemented: a hidden relationship IS in the published
   page's source. Hiding is curation, not confidentiality. */
.rel-hidden {
  display: none;
}

.svg-wrap.reveal-hidden-rels .rel-hidden {
  display: initial;
}

/* The signal itself. It sits above the diagram and states a count, because its
   job is to stop a curated diagram being read as the whole truth. GREY with a
   plain border: it was amber with a callout stripe first and read as an alarm.
   A curated diagram is a normal state of affairs — the control's PRESENCE is
   the message, and the colour and the stripe were both repeating it. */
.hidden-rels {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.75rem;
  background: #f2f3f5;
  border: 1px solid #d6d9de;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #4a4f57;
}

.hidden-rels-note strong {
  font-variant-numeric: tabular-nums;
}

.hidden-rels-select {
  font: inherit;
  color: #2f3238;
  background: #fff;
  border: 1px solid #b9bec6;
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  cursor: pointer;
}
