/* =============================================================
   TraceRecord — Workspace v4 · workspace-v4.css (Concept 6)
   Warm, rounded, interactive working environment. Two surface
   levels only: the environment, and the objects inside it.
   Radii: 5 ref · 10 control · 12 card · 18 feature · 0 report.
   ============================================================= */

.wsv4-page { background: #f3efe6; color: #24313f; font-family: "Source Sans 3", system-ui, sans-serif; }
.wsv4-page a { color: #3c6081; }
.wsv4-page a:hover { color: #182c46; }

/* ---------- banner (Concept 7 application family) ---------- */
.wsv4-banner { background: #0f1b2d; color: #e8eef4; }
.wsv4-banner-row { width: min(1280px, calc(100% - 40px)); margin: 0 auto; display: flex; align-items: center; gap: 26px; min-height: 60px; }
.wsv4-nav { display: flex; gap: 4px; }
.wsv4-nav a { display: inline-flex; align-items: center; color: #c8d2dd; text-decoration: none; font-weight: 700; font-size: .95rem; padding: 10px 14px; min-height: 44px; border-radius: 10px; }
.wsv4-nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.wsv4-nav a.is-current { color: #fff; background: rgba(255, 255, 255, .12); }
.wsv4-banner-meta { margin: 0 0 0 auto; display: flex; gap: 18px; align-items: center; font-size: .86rem; color: #9fb6cc; }
.wsv4-banner-meta span { display: inline-flex; gap: 7px; align-items: center; }
.wsv4-banner-meta .tr-icon { width: 16px; height: 16px; }
.wsv4-banner-meta a { color: #9fb6cc; text-decoration: none; padding: 8px 0; }
.wsv4-banner-meta a:hover { color: #fff; }
.wsv4-banner-meta b { color: #e8eef4; font-weight: 700; }
/* Semantic trace edge: source → run → registration → boundary → output */
.wsv4-trace-edge { display: flex; height: 4px; }
.wsv4-trace-edge i { display: block; height: 100%; }
.wsv4-trace-edge .te-source { width: 8%; background: #3c6081; }
.wsv4-trace-edge .te-run { flex: 1; background: linear-gradient(90deg, #3c6081, #2f6a4f); }
.wsv4-trace-edge .te-tick { width: 6%; background: #2f6a4f; }
.wsv4-trace-edge .te-boundary { width: 14%; background: repeating-linear-gradient(90deg, #b7791f 0 10px, transparent 10px 18px); }
.wsv4-trace-edge .te-output { width: 12%; background: #f6f3ea; }
@media (max-width: 760px) {
  .wsv4-banner-row { flex-wrap: wrap; padding: 8px 0; gap: 6px 14px; }
  .wsv4-banner-meta { margin-left: 0; flex-wrap: wrap; gap: 8px 14px; }
}

/* ---------- cross-tab conflict (designed, never alert()) ---------- */
.wsv4-conflict { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; background: #fbf5e8; border-bottom: 2px solid #b7791f; padding: 12px min(3vw, 30px); }
.wsv4-conflict b { color: #182c46; display: block; }
.wsv4-conflict span { font-size: .84rem; color: rgba(36, 49, 63, .7); }
.wsv4-conflict-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- buttons ---------- */
.wsv4-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 16px; border-radius: 10px; border: 1.5px solid rgba(24, 44, 70, .35); background: #fff; color: #182c46; font: 700 .92rem "Source Sans 3", system-ui, sans-serif; cursor: pointer; }
.wsv4-btn:hover { border-color: #182c46; }
.wsv4-btn-primary { background: #182c46; border-color: #182c46; color: #f6f3ea; }
.wsv4-btn-primary:hover { background: #21395c; }
.wsv4-btn-sm { min-height: 38px; padding: 6px 12px; font-size: .86rem; }
.wsv4-btn:focus-visible, .wsv4-link:focus-visible { outline: 3px solid #b7791f; outline-offset: 2px; }
.wsv4-link { background: none; border: none; color: #3c6081; font: 700 .88rem "Source Sans 3", system-ui, sans-serif; cursor: pointer; padding: 8px 2px; min-height: 38px; }
.wsv4-link:hover { color: #182c46; text-decoration: underline; }

/* ---------- floating active record card ---------- */
.wsv4-record { width: min(1280px, calc(100% - 40px)); margin: 22px auto 16px; background: #fdfcf9; border: 1px solid rgba(24, 44, 70, .16); border-radius: 18px; box-shadow: 0 14px 34px rgba(15, 27, 45, .08); }
.wsv4-record-head { display: flex; gap: 16px; align-items: center; padding: 18px 22px 14px; }
.wsv4-pathway-tile { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid rgba(24, 44, 70, .18); border-radius: 12px; background: #fff; flex: none; }
.wsv4-pathway-tile svg { width: 36px; height: 36px; color: #182c46; }
.wsv4-record-id { min-width: 0; }
.wsv4-ref { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; font-weight: 700; color: #3c6081; }
.wsv4-record-id h1 { font-family: "Source Serif 4", Georgia, serif; font-size: 1.45rem; color: #182c46; margin: 0; }
.wsv4-record-meta { margin: 2px 0 0; font-size: .86rem; color: rgba(36, 49, 63, .7); }
.wsv4-record-controls { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.wsv4-pathway { position: relative; }
.wsv4-pathway-btn { display: flex; align-items: center; gap: 10px; min-height: 44px; border: 1px solid rgba(24, 44, 70, .25); border-radius: 10px; background: #fff; padding: 6px 12px; cursor: pointer; font-family: inherit; }
.wsv4-pathway-label { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: rgba(36, 49, 63, .6); }
.wsv4-pathway-btn b { color: #182c46; font-size: .95rem; }
.wsv4-caret { color: #3c6081; }
.wsv4-pathway-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 320px; list-style: none; margin: 0; padding: 6px; background: #fff; border: 1px solid rgba(24, 44, 70, .2); border-radius: 12px; box-shadow: 0 18px 40px rgba(15, 27, 45, .16); }
.wsv4-pathway-menu li { border-radius: 10px; }
.wsv4-pathway-menu button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: none; padding: 10px 12px; min-height: 48px; cursor: pointer; font-family: inherit; border-radius: 10px; }
.wsv4-pathway-menu button:hover { background: #f3efe6; }
.wsv4-pathway-menu button svg { width: 26px; height: 26px; color: #182c46; flex: none; }
.wsv4-pathway-menu b { display: block; color: #182c46; font-size: .93rem; }
.wsv4-pathway-menu small { display: block; font-size: .76rem; color: rgba(36, 49, 63, .65); }
.wsv4-pathway-menu [aria-selected="true"] button { background: #edf2f7; }
.wsv4-approval-chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 800; letter-spacing: .04em; border: 1px solid rgba(24, 44, 70, .25); background: #fff; color: rgba(36, 49, 63, .8); }
.wsv4-approval-chip.is-approved { border-color: rgba(47, 106, 79, .55); background: #e9f3ec; color: #2f6a4f; }
.wsv4-approval-chip.is-reset { border-color: rgba(148, 66, 56, .55); background: #f9ece9; color: #944238; }
.wsv4-record-edge { display: flex; gap: 0; height: 3px; margin: 0 22px; }
.wsv4-record-edge i { flex: 1; background: rgba(24, 44, 70, .1); }
.wsv4-record-edge i.is-on { background: #3c6081; }
.wsv4-readiness-strip { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 12px 22px 16px; font-size: .9rem; }
.wsv4-strip-label { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 800; color: rgba(36, 49, 63, .6); }
.wsv4-strip-count { font-weight: 800; color: #182c46; }
.wsv4-strip-count.has-blockers { color: #944238; }
.wsv4-strip-rest { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px 14px; }
@media (max-width: 860px) {
  .wsv4-record-head { flex-wrap: wrap; }
  .wsv4-record-controls { margin-left: 0; width: 100%; justify-content: space-between; }
  .wsv4-strip-rest { margin-left: 0; }
}

/* ---------- shell: rail / canvas / coach ---------- */
.wsv4-shell { width: min(1280px, calc(100% - 40px)); margin: 0 auto 30px; display: grid; grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(230px, 280px); gap: 16px; align-items: start; }
.wsv4-rail { display: grid; gap: 10px; align-content: start; position: sticky; top: 16px; }
.wsv4-rail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: none; }
.wsv4-rail-list button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; min-height: 46px; background: none; border: 1px solid transparent; border-radius: 12px; padding: 8px 12px; cursor: pointer; font-family: inherit; }
.wsv4-rail-list button:hover { background: rgba(255, 255, 255, .7); }
.wsv4-rail-list .is-current button { background: #fff; border-color: rgba(60, 96, 129, .55); box-shadow: 0 6px 14px rgba(15, 27, 45, .06); }
.wsv4-rail-num { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; font-weight: 700; color: #3c6081; }
.wsv4-rail-name { font-weight: 700; color: #182c46; font-size: .92rem; flex: 1; }
.wsv4-rail-state { width: 10px; height: 10px; border-radius: 999px; border: 1.6px solid rgba(24, 44, 70, .35); flex: none; }
.wsv4-rail-state.is-complete { background: #2f6a4f; border-color: #2f6a4f; }
.wsv4-rail-state.is-partial { background: linear-gradient(90deg, #b7791f 50%, transparent 50%); border-color: #b7791f; }
.wsv4-rail-state.is-blocked { background: #944238; border-color: #944238; border-radius: 2px; }
.wsv4-rail-note { font-size: .78rem; color: rgba(36, 49, 63, .6); margin: 2px 4px; }
.wsv4-byl { display: flex; gap: 8px; align-items: center; text-align: left; background: #fff; border: 1px dashed rgba(183, 121, 31, .6); border-radius: 12px; padding: 10px 12px; min-height: 46px; font: 700 .86rem "Source Sans 3", system-ui, sans-serif; color: #182c46; cursor: pointer; }
.wsv4-byl .tr-icon { width: 18px; height: 18px; color: #b7791f; }

.wsv4-canvas { background: #fdfcf9; border: 1px solid rgba(24, 44, 70, .16); border-radius: 18px; padding: 24px; min-height: 480px; }
.wsv4-empty { color: rgba(36, 49, 63, .6); }

.wsv4-coach { background: #fff; border: 1px solid rgba(24, 44, 70, .14); border-radius: 18px; padding: 16px; position: sticky; top: 16px; display: grid; gap: 12px; align-content: start; }
.wsv4-coach-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wsv4-coach-title { display: inline-flex; gap: 8px; align-items: center; font-weight: 800; color: #182c46; font-size: .95rem; }
.wsv4-coach-title .tr-icon { width: 18px; height: 18px; color: #3c6081; }
.wsv4-coach-state { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #2f6a4f; }
.wsv4-coach-state.has-items { color: #b7791f; }
.wsv4-coach-prompt { border: 1px solid rgba(60, 96, 129, .35); border-left-width: 3px; border-radius: 10px; background: #f8fafc; padding: 10px 12px; }
.wsv4-coach-prompt p { font-family: "Source Serif 4", Georgia, serif; color: #182c46; margin: 0 0 4px; font-size: .98rem; }
.wsv4-coach-prompt small { color: rgba(36, 49, 63, .65); font-size: .78rem; }
.wsv4-coach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wsv4-coach-list li { display: flex; gap: 8px; align-items: flex-start; font-size: .85rem; border-radius: 10px; padding: 7px 9px; background: #f6f3ec; }
.wsv4-coach-list li.is-block { background: #f9ece9; }
.wsv4-coach-list li.is-warn { background: #fbf5e8; }
.wsv4-coach-list button { background: none; border: none; padding: 0; color: #3c6081; font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.wsv4-coach-foot { margin: 0; font-size: .76rem; color: rgba(36, 49, 63, .6); border-top: 1px dashed rgba(24, 44, 70, .16); padding-top: 10px; }

@media (max-width: 1080px) {
  .wsv4-shell { grid-template-columns: minmax(190px, 230px) minmax(0, 1fr); }
  .wsv4-coach { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .wsv4-shell { grid-template-columns: 1fr; }
  .wsv4-rail { position: static; }
  .wsv4-rail-list { display: flex; overflow-x: auto; padding-bottom: 6px; }
  .wsv4-rail-list li { flex: none; }
}

/* ---------- chapter canvas building blocks ---------- */
.wsv4-chapter-head { margin-bottom: 18px; }
.wsv4-chapter-kicker { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: #3c6081; margin: 0 0 4px; }
.wsv4-chapter-head h2 { font-family: "Source Serif 4", Georgia, serif; font-size: 1.5rem; color: #182c46; margin: 0 0 6px; }
.wsv4-chapter-head p { margin: 0; color: rgba(36, 49, 63, .75); max-width: 56em; }
.wsv4-stack { display: grid; gap: 12px; }
.wsv4-obj { border: 1px solid rgba(24, 44, 70, .13); border-radius: 12px; background: #fff; padding: 14px 16px; display: grid; gap: 10px; }
.wsv4-obj-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wsv4-obj-head .u-ref { margin-right: auto; }
.wsv4-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.wsv4-field { display: grid; gap: 4px; }
.wsv4-field--wide { grid-column: 1 / -1; }
.wsv4-field-label { font-size: .78rem; font-weight: 800; letter-spacing: .04em; color: rgba(36, 49, 63, .7); }
.wsv4-input { font: inherit; min-height: 44px; border: 1px solid rgba(24, 44, 70, .25); border-radius: 10px; background: #fff; padding: 8px 12px; color: #24313f; width: 100%; }
.wsv4-input:focus-visible { outline: 3px solid #b7791f; outline-offset: 1px; }
textarea.wsv4-input { min-height: 0; }
.wsv4-origin { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #3c6081; border: 1px solid rgba(60, 96, 129, .35); border-radius: 5px; padding: 3px 7px; }
.wsv4-check { display: flex; gap: 8px; align-items: center; min-height: 34px; font-size: .93rem; }
.wsv4-hint { font-size: .82rem; color: rgba(36, 49, 63, .62); margin: 0; }
.wsv4-boundary { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: rgba(36, 49, 63, .82); border-left: 3px solid #b7791f; padding: 6px 0 6px 12px; margin: 4px 0 0; }
.wsv4-boundary .tr-icon { width: 16px; height: 16px; color: #b7791f; flex: none; margin-top: 2px; }
.wsv4-add { justify-self: start; }
.wsv4-missing { color: #944238; font-weight: 700; font-style: normal; }
.wsv4-not-recorded { color: rgba(36, 49, 63, .55); font-style: italic; }

/* Investigation Frame — the complete conceptual sequence, always whole */
.wsv4-frame { display: grid; gap: 0; margin-bottom: 18px; }
.wsv4-frame-node { display: grid; grid-template-columns: 132px 1fr; gap: 14px; border: 1px solid rgba(24, 44, 70, .13); border-radius: 12px; background: #fff; padding: 12px 16px; }
.wsv4-frame-node + .wsv4-frame-node { margin-top: 10px; position: relative; }
.wsv4-frame-node + .wsv4-frame-node::before { content: ""; position: absolute; left: 40px; top: -11px; width: 2px; height: 11px; background: #3c6081; opacity: .5; }
.wsv4-frame-node > b { font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: #3c6081; padding-top: 12px; }
.wsv4-frame-node.is-record { border-color: rgba(60, 96, 129, .5); background: #f6f9fb; }

/* Judgement workbench */
.wsv4-linkset { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.wsv4-linkset label { display: inline-flex; gap: 6px; align-items: center; font-size: .86rem; border: 1px solid rgba(24, 44, 70, .18); border-radius: 999px; padding: 5px 12px; min-height: 34px; cursor: pointer; background: #fbf9f4; }
.wsv4-linkset input { margin: 0; }

/* readiness chapter */
.wsv4-gaps { display: grid; gap: 8px; }
.wsv4-gap { display: flex; gap: 9px; align-items: flex-start; border-radius: 10px; padding: 9px 12px; font-size: .92rem; background: #f6f3ec; }
.wsv4-gap.is-block { background: #f9ece9; }
.wsv4-gap.is-warn { background: #fbf5e8; }
.wsv4-gap b { color: #182c46; }
.wsv4-gap button { margin-left: auto; flex: none; }

/* dialogs (record map · backup · branding · BYL) */
.wsv4-dialog { border: 1px solid rgba(24, 44, 70, .25); border-radius: 18px; padding: 0; max-width: min(620px, calc(100vw - 32px)); width: 100%; background: #fdfcf9; color: #24313f; }
.wsv4-dialog::backdrop { background: rgba(15, 27, 45, .45); }
.wsv4-dialog-inner { padding: 22px; display: grid; gap: 14px; }
.wsv4-dialog h2 { font-family: "Source Serif 4", Georgia, serif; color: #182c46; margin: 0; font-size: 1.3rem; }
.wsv4-dialog-close { justify-self: end; }
.wsv4-map { display: grid; gap: 6px; }
.wsv4-map button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: #fff; border: 1px solid rgba(24, 44, 70, .13); border-radius: 10px; padding: 9px 12px; min-height: 44px; cursor: pointer; font-family: inherit; }
.wsv4-map button:hover { border-color: rgba(60, 96, 129, .5); }
.wsv4-map b { color: #182c46; font-size: .92rem; }
.wsv4-map span { margin-left: auto; font-size: .82rem; color: rgba(36, 49, 63, .65); }

.wsv4-foot { width: min(1280px, calc(100% - 40px)); margin: 0 auto 40px; font-size: .84rem; color: rgba(36, 49, 63, .65); }
.wsv4-noscript { width: min(760px, calc(100% - 40px)); margin: 40px auto; }
@media (max-width: 680px) { .wsv4-grid { grid-template-columns: 1fr; } .wsv4-frame-node { grid-template-columns: 1fr; gap: 4px; } }

/* hidden attribute must always win over class display values */
[hidden] { display: none !important; }

/* the pathway dropdown must escape the record card */
.wsv4-record { overflow: visible; }
.wsv4-record-controls, .wsv4-pathway { position: relative; }
.wsv4-pathway-menu { z-index: 60; max-height: min(60vh, 420px); overflow-y: auto; }
@media (max-width: 620px) {
  .wsv4-pathway-menu { position: fixed; left: 12px; right: 12px; top: auto; min-width: 0; width: auto; }
}


/* =============================================================
   Concept 6 instruments
   ============================================================= */

/* Access-area Sketch — areas as placed objects, access as tone */
.wsv4-sketch { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px;
  padding: 18px; border: 1px solid rgba(24, 44, 70, .14); border-radius: 12px; background: #fbf8f1;
  background-image: linear-gradient(rgba(24,44,70,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(24,44,70,.05) 1px, transparent 1px);
  background-size: 34px 34px; }
.wsv4-area-tile { position: relative; display: grid; gap: 3px; justify-items: start; text-align: left;
  min-height: 92px; padding: 12px 14px; border: 1.5px solid; border-radius: 12px; cursor: pointer; font-family: inherit; }
.wsv4-area-tile:hover { box-shadow: 0 6px 16px rgba(15, 27, 45, .1); }
.wsv4-area-tile.is-selected { outline: 2px solid #182c46; outline-offset: 2px; }
.wsv4-area-tile:focus-visible { outline: 3px solid #b7791f; outline-offset: 2px; }
.wsv4-area-code { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; font-weight: 700; color: #3c6081; }
.wsv4-area-name { font-weight: 700; color: #182c46; font-size: .96rem; line-height: 1.25; }
.wsv4-area-access { font-size: .78rem; font-weight: 700; }
.wsv4-area-flag { position: absolute; top: 10px; right: 10px; font-size: .64rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #944238; border: 1px solid rgba(148, 66, 56, .4); border-radius: 999px; padding: 2px 7px; }
.wsv4-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .78rem; color: rgba(36, 49, 63, .7); }
.wsv4-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wsv4-legend i { width: 13px; height: 13px; border: 1.5px solid; border-radius: 4px; }

/* Judgement Workbench — one instrument, five modes */
.wsv4-workbench-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.wsv4-finding-pick { display: flex; flex-wrap: wrap; gap: 5px; }
.wsv4-chip { min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(24, 44, 70, .25);
  background: #fff; font: 700 .84rem ui-monospace, Menlo, monospace; color: #3c6081; cursor: pointer; }
.wsv4-chip.is-on { background: #182c46; border-color: #182c46; color: #f6f3ea; }
.wsv4-chip:focus-visible { outline: 3px solid #b7791f; outline-offset: 2px; }
/* Judgement lenses: five ways of examining ONE finding, each showing what it
   already holds. Not a pill row — an instrument selector. */
/* auto-fit keys the column count to the CANVAS, not the viewport — the canvas
   is far narrower than the window once the rail and inspector take their space */
.wsv4-mode-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 6px; padding: 6px;
  background: #f3eee3; border: 1px solid rgba(24, 44, 70, .14); border-radius: 16px; align-items: stretch; }
.wsv4-mode { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; align-items: center;
  min-height: 72px; padding: 10px 12px; border: 1px solid rgba(24, 44, 70, .1); border-radius: 11px;
  background: #fdfcf9; font-family: "Source Sans 3", system-ui, sans-serif; color: #3d4c56;
  cursor: pointer; text-align: left; }
.wsv4-mode-ico { display: block; color: #7d8892; }
.wsv4-mode-ico svg.tr-icon { width: 22px; height: 22px; display: block; }
.wsv4-mode-text { min-width: 0; display: grid; gap: 1px; }
/* never break a lens name mid-word — it stops reading as a name */
.wsv4-mode b { font-size: .85rem; font-weight: 650; color: #3d4c56; line-height: 1.25;
  overflow-wrap: normal; word-break: normal; hyphens: none; text-wrap: balance; }
.wsv4-mode small { font-size: .71rem; color: #8b8578; line-height: 1.3; }
.wsv4-mode:hover { background: rgba(255, 255, 255, .8); border-color: rgba(24, 44, 70, .16); }
.wsv4-mode:hover b, .wsv4-mode:hover .wsv4-mode-ico { color: #182c46; }
/* a lens holding recorded content reads as engaged, without ranking it */
.wsv4-mode.has-content .wsv4-mode-ico { color: #3c6081; }
.wsv4-mode.has-content small { color: #4a5a66; }
.wsv4-mode.is-on { background: #fff; border-color: rgba(24, 44, 70, .2); box-shadow: 0 3px 10px rgba(15, 27, 45, .1); }
.wsv4-mode.is-on b { color: #0f1b2d; font-weight: 750; }
.wsv4-mode.is-on .wsv4-mode-ico { color: #0f1b2d; }
.wsv4-mode:focus-visible { outline: 3px solid #b7791f; outline-offset: 2px; }
@media (max-width: 700px) {
  /* one scrolling row beats several cramped ones */
  .wsv4-mode-rail { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(152px, 1fr);
    overflow-x: auto; scroll-snap-type: x proximity; border-radius: 14px; }
  .wsv4-mode { scroll-snap-align: start; }
}

/* Evidence Reliance Tray */
.wsv4-tray { display: grid; gap: 6px; }
.wsv4-tray-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 220px; gap: 12px; align-items: center;
  border: 1px solid rgba(24, 44, 70, .12); border-radius: 10px; background: #fff; padding: 9px 12px; }
.wsv4-tray-row.is-conflicting { border-color: rgba(148, 66, 56, .5); background: #fdf6f4; }
.wsv4-tray-desc { font-size: .9rem; color: #3d4c56; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Split Lens — the two columns must never merge visually */
.wsv4-split { grid-template-columns: 1fr 1fr; display: grid; gap: 0; padding: 0; overflow: hidden; }
.wsv4-split-col { padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.wsv4-split-col + .wsv4-split-col { border-left: 2px dashed rgba(183, 121, 31, .5); background: #fdfaf3; }
.wsv4-split-head { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.wsv4-split-head.is-established { color: #2f6a4f; }
.wsv4-split-head.is-not { color: #b7791f; }

/* Inspector in the right rail */
.wsv4-inspector-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.wsv4-inspector-title { margin: 0; font-family: "Source Serif 4", Georgia, serif; font-size: 1.05rem; color: #182c46; flex: 1; }
.wsv4-coach-now { font-weight: 600; }
.wsv4-coach-link { display: grid; gap: 1px; margin: 0; font-size: .8rem; color: rgba(36, 49, 63, .8); }
.wsv4-coach-link-label { font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #3c6081; }

@media (max-width: 680px) {
  .wsv4-tray-row { grid-template-columns: auto 1fr; }
  .wsv4-tray-row select { grid-column: 1 / -1; }
  .wsv4-split { grid-template-columns: 1fr; }
  .wsv4-split-col + .wsv4-split-col { border-left: 0; border-top: 2px dashed rgba(183, 121, 31, .5); }
}


/* Inspector shown inline beside the sketch when the rail is not an aside */
.wsv4-inspector--inline { display: grid; gap: 10px; border: 1.5px solid rgba(60, 96, 129, .55);
  border-radius: 12px; background: #fff; padding: 16px; box-shadow: 0 8px 22px rgba(15, 27, 45, .09); }
.wsv4-inspector--inline:focus, .wsv4-inspector--inline :focus { outline: none; }
.wsv4-inspector--inline .wsv4-inspector-title:focus-visible { outline: 3px solid #b7791f; outline-offset: 3px; }


/* =============================================================
   Working shell (Concept 6 Parts 2-4, 7, 21)
   ============================================================= */
.ws-shell-bar { background: #0f1b2d; color: #f6f3ea; }
.ws-shell-row { width: min(1280px, calc(100% - 40px)); margin: 0 auto; display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px 18px; min-height: 54px; padding: 8px 0; }
.ws-shell-brand { display: inline-flex; align-items: center; gap: 9px; color: #f6f3ea; text-decoration: none;
  font-family: "Source Serif 4", Georgia, serif; font-size: 1.05rem; font-weight: 600; }
.ws-shell-mark { width: 21px; height: 21px; }
.ws-shell-areas { display: flex; gap: 4px; }
.ws-shell-areas a { padding: 8px 15px; min-height: 40px; display: inline-flex; align-items: center;
  border-radius: 999px; font-size: .88rem; color: rgba(246, 243, 234, .75); text-decoration: none; }
.ws-shell-areas a:hover { color: #f6f3ea; background: rgba(255, 255, 255, .08); }
.ws-shell-areas a.is-current { background: #f6f3ea; color: #0f1b2d; font-weight: 600; }
.ws-shell-truth { margin: 0 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  font-size: .82rem; color: rgba(246, 243, 234, .68); }
.ws-storage { display: inline-flex; align-items: center; gap: 7px; background: none; border: none; cursor: pointer;
  font: inherit; color: inherit; padding: 8px 2px; min-height: 38px; }
.ws-storage i { width: 7px; height: 7px; border-radius: 50%; background: #e0a43a; flex: none; }
.ws-storage:hover { color: #f6f3ea; }
.ws-storage:focus-visible { outline: 2px solid #e0a43a; outline-offset: 3px; border-radius: 4px; }
.ws-shell-engineer { color: rgba(246, 243, 234, .8); }
.ws-storage-detail { background: #142338; color: rgba(246, 243, 234, .82); font-size: .85rem; line-height: 1.6;
  padding: 12px min(3vw, 30px); border-top: 1px solid rgba(246, 243, 234, .12); }
.ws-storage-detail b { color: #f6f3ea; }

/* Active record identity — one line each, no dashboard */
.ws-identity { width: min(1280px, calc(100% - 40px)); margin: 18px auto 14px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 14px 20px; background: #fdfcf9; border: 1px solid rgba(24, 44, 70, .16);
  border-radius: 16px; padding: 16px 20px; box-shadow: 0 12px 30px rgba(15, 27, 45, .07); }
.ws-identity-tile { width: 52px; height: 52px; flex: none; border-radius: 13px; background: #0f1b2d; color: #f6f3ea;
  display: inline-flex; align-items: center; justify-content: center; }
.ws-identity-tile svg { width: 32px; height: 32px; }
/* A real basis floor, not a 0% basis: the identity column asks for 320px and
   refuses to go under 260px, so when the state row cannot fit beside it the
   flex container wraps the state onto its own line instead of crushing the
   heading away from the metadata beneath it. */
.ws-identity-id { flex: 1 1 320px; min-width: 260px; }
.ws-identity-line { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 13px; }
.ws-identity-title { font-family: "Source Serif 4", Georgia, serif; font-size: 1.22rem; font-weight: 600; color: #17242c; }
.ws-identity-meta { margin: 4px 0 0; font-size: .86rem; color: #5c6a74; }
.ws-identity-state { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 0 1 auto; margin-left: auto; }
.ws-jobmenu { position: relative; }
.ws-jobmenu-btn { gap: 6px; font: 600 .88rem "Source Sans 3", system-ui, sans-serif; color: #3d4c56; }
.ws-jobmenu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 260px; list-style: none;
  margin: 0; padding: 6px; background: #fff; border: 1px solid rgba(24, 44, 70, .2); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 27, 45, .16); }
.ws-jobmenu-list button, .ws-jobmenu-list a { display: block; width: 100%; text-align: left; background: none;
  border: none; padding: 10px 12px; min-height: 44px; border-radius: 10px; cursor: pointer;
  font: 400 .9rem "Source Sans 3", system-ui, sans-serif; color: #3d4c56; text-decoration: none; }
.ws-jobmenu-list button:hover, .ws-jobmenu-list a:hover { background: #f3efe6; color: #0f1b2d; }

/* Chapter states — five, not three */
.ws-ch button { border-left: 3px solid transparent; }
.ws-ch.is-current button { background: #fff; border-color: rgba(60, 96, 129, .55); border-left-color: #0f1b2d;
  box-shadow: 0 6px 14px rgba(15, 27, 45, .06); }
.ws-ch.is-later .wsv4-rail-name { color: #8b8578; font-weight: 600; }
.ws-ch.is-later .wsv4-rail-state { display: none; }
.wsv4-rail-state.is-complete { background: #2f6a4f; border-color: #2f6a4f; }
.wsv4-rail-state.is-attention { background: #b7791f; border-color: #b7791f; }
.wsv4-rail-state.is-blocker { background: #8f3f22; border-color: #8f3f22; border-radius: 2px; }
.wsv4-rail-state.is-current { background: #0f1b2d; border-color: #0f1b2d; }

/* Readiness — exception first */
.ws-sev { flex: none; min-width: 118px; font-size: .7rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 7px; text-align: center; }
.ws-sev.is-block { background: #f6ddd5; border: 1px solid #e0bcae; color: #8f3f22; }
.ws-sev.is-warn { background: #f7ead0; border: 1px solid #e2cfa6; color: #8a5b12; }
.ws-gap-text { flex: 1; }
.ws-ready-ok { margin-top: 14px; border-top: 1px solid #eee8db; padding-top: 12px; }
.ws-ready-ok summary { cursor: pointer; font-size: .8rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: #245740; min-height: 34px; display: flex; align-items: center; }
.ws-ready-ok p { margin: 8px 0 0; font-size: .86rem; color: #3d4c56; line-height: 1.7; }
.ws-sev-key { margin-top: 12px; padding-top: 11px; border-top: 1px solid #eee8db; }
.ws-sev-key b.is-block { color: #8f3f22; } .ws-sev-key b.is-warn { color: #8a5b12; } .ws-sev-key b.is-adv { color: #5c6a74; }

/* Compact application footer */
.ws-appfoot { width: min(1280px, calc(100% - 40px)); margin: 0 auto 34px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 6px 18px; background: #f6f3ea; border: 1px solid #e3ddcf; border-radius: 12px;
  padding: 11px 18px; font-size: .82rem; color: #6b7780; }
.ws-appfoot a, .ws-appfoot .wsv4-link { color: #3d4c56; font-size: .82rem; font-weight: 400; text-decoration: none; padding: 6px 0; }
.ws-appfoot a:hover, .ws-appfoot .wsv4-link:hover { color: #0f1b2d; text-decoration: underline; }
.ws-appfoot-truth { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: #3d4c56; }
.ws-appfoot-truth i { width: 7px; height: 7px; border-radius: 50%; background: #e0a43a; }
.ws-appfoot-exit { margin-left: auto; }

@media (max-width: 760px) {
  .ws-identity-state { width: 100%; margin-left: 0; }
  .ws-identity-id { flex-basis: 100%; min-width: 0; }
  .ws-jobmenu-list { right: auto; left: 0; }
  .ws-appfoot-exit { margin-left: 0; }
}

/* state names are announced, not drawn */
.ws-vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* the shell brand is not a body link */
.ws-shell-bar .ws-shell-brand, .ws-shell-bar .ws-shell-brand:hover { color: #f6f3ea; }
.ws-shell-bar .ws-shell-mark { color: #f6f3ea; }
.ws-shell-bar .ws-shell-areas a.is-current { color: #0f1b2d; }

.ws-identity { position: relative; }
.ws-jobmenu-list { z-index: 60; }

/* storage truth now sits with the record identity, not in the shared banner */
.ws-identity-truth { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  font-size: .8rem; color: #6b7780; }
.ws-identity-truth .ws-storage { color: #6b7780; padding: 4px 0; min-height: 30px; }
.ws-identity-truth .ws-storage:hover { color: #0f1b2d; }
.ws-identity .ws-storage-detail { background: #f6f3ea; color: #3d4c56; border: 1px solid #e3ddcf;
  border-radius: 10px; padding: 10px 13px; margin: 8px 0 0; font-size: .83rem; line-height: 1.6; }
.ws-identity .ws-storage-detail b { color: #0f1b2d; }

/* engineer name now sits on the light identity card, not the dark bar */
.ws-identity-truth .ws-shell-engineer { color: #3d4c56; font-weight: 600; }
/* clear the floating banner comfortably */
.ws-identity { margin-top: 26px; }

/* The trace-field host raises every direct child to z-index:1 with 0-2-0
   specificity, which trapped both record menus inside a losing stacking
   context. Match that specificity so the identity row outranks the shell. */
.tr-field-host > .ws-identity.ws-identity { position: relative; z-index: 40; }
/* shell must NOT create a stacking context, or the fixed Coach sheet (41) and
   its tab (42) get trapped beneath the identity row */
.tr-field-host > .wsv4-shell.wsv4-shell { position: relative; z-index: auto; }

/* Per-object tool affordance (Part 23). Quiet until the object is hovered or
   focused, so the record reads as a record, not a toolbar. */
.ws-objtool { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px;
  border: 1px solid transparent; border-radius: 999px; font-size: .78rem; font-weight: 600;
  color: #5c6a74; text-decoration: none; opacity: .6; transition: opacity .18s ease, border-color .18s ease; }
.ws-objtool .tr-icon { width: 15px; height: 15px; }
.wsv4-obj:hover .ws-objtool, .wsv4-obj:focus-within .ws-objtool { opacity: 1; border-color: rgba(24, 44, 70, .2); }
.ws-objtool:hover { color: #0f1b2d; border-color: rgba(24, 44, 70, .45); background: #f6f3ea; }
.ws-objtool:focus-visible { outline: 3px solid #b7791f; outline-offset: 2px; opacity: 1; }
@media (max-width: 680px) { .ws-objtool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* ---------- Investigation chronology, swim lanes (Concept 6) ---------- */
.ws-chrono { border: 1px solid rgba(24,44,70,.16); border-radius: 14px; background: #fffdf8; padding: 14px 16px 16px; display: grid; gap: 10px; }
.ws-chrono-scale { display: grid; grid-template-columns: repeat(3,1fr); font: 600 .72rem/1 var(--mono); color: #7c8a95; letter-spacing: .04em; padding-left: 148px; }
.ws-chrono-scale span:nth-child(2) { text-align: center; }
.ws-chrono-scale span:last-child { text-align: right; }
.ws-chrono-lane { display: grid; grid-template-columns: 140px 1fr; gap: 8px; align-items: center; }
.ws-chrono-lane-name { margin: 0; font-size: .78rem; font-weight: 700; color: #40525f; }
.ws-chrono-track { position: relative; height: 46px; border-left: 1px solid rgba(24,44,70,.2); border-bottom: 1px dashed rgba(24,44,70,.16); }
.ws-chrono-pin { position: absolute; top: 4px; transform: translateX(-50%); display: grid; gap: 1px; justify-items: center;
  min-height: 38px; padding: 4px 8px; border-radius: 10px; border: 1px solid; background: #fff; cursor: pointer;
  font: 700 .7rem/1.1 var(--mono); transition: box-shadow .16s ease, transform .16s ease; }
.ws-chrono-pin-time { font-weight: 500; font-size: .66rem; color: #7c8a95; }
.ws-chrono-pin.is-method { border-color: #3c6081; color: #24455f; }
.ws-chrono-pin.is-evidence { border-color: #b7791f; color: #8a5a12; }
.ws-chrono-pin.is-conflict { border-color: #c0563f; color: #a5432c; background: #fdf3f0; }
.ws-chrono-pin:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 6px 16px rgba(15,27,45,.14); z-index: 2; }
.ws-chrono-pin:focus-visible { outline: 3px solid #b7791f; outline-offset: 2px; z-index: 2; }
.ws-chrono-untimed { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 6px; border-top: 1px dashed rgba(24,44,70,.16); }
.ws-chrono-chip { padding: 5px 10px; border-radius: 999px; border: 1px dashed rgba(24,44,70,.3); font: 600 .72rem var(--mono); color: #5c6a74; }
.ws-chrono-list { display: none; }
/* Below the lane width, the chart stops being readable — the ordered list is
   the honest fallback, not a squeezed chart. */
@media (max-width: 760px) {
  .ws-chrono { display: none; }
  .ws-chrono-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .ws-chrono-list li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 12px;
    border: 1px solid rgba(24,44,70,.16); border-radius: 12px; background: #fffdf8; }
  .ws-chrono-list b { font-size: .9rem; color: #182c46; }
  .ws-chrono-list-at, .ws-chrono-list-lane { grid-column: 2; font-size: .76rem; color: #6b7883; }
}
.ws-chrono-scale { padding-right: 8px; }
.ws-chrono-scale span:first-child { padding-left: 8px; }

/* staggered co-timed pins: the lane grows, the label stays at the top */
.ws-chrono-lane { align-items: start; }
.ws-chrono-lane-name { padding-top: 12px; }
.ws-chrono-pin { top: 4px; }

/* ---------- A-05 source-area reasoning map (Leak pathway) ---------- */
.ws-srcmap { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ws-srcmap-node { border: 1px solid; border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; }
.ws-srcmap-code { margin: 0; font: 700 .82rem/1.2 var(--mono); color: #182c46; }
.ws-srcmap-stances { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-srcmap-stance { min-height: 34px; padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(24,44,70,.22);
  background: #fff; color: #5c6a74; font-size: .76rem; font-weight: 600; cursor: pointer; transition: border-color .16s ease, color .16s ease; }
.ws-srcmap-stance:hover { border-color: rgba(24,44,70,.5); color: #182c46; }
.ws-srcmap-stance.is-on { border-width: 2px; font-weight: 700; background: #fff; }
.ws-srcmap-stance:focus-visible { outline: 3px solid #b7791f; outline-offset: 2px; }
.ws-srcmap-need { margin: 0; font-size: .78rem; font-weight: 600; color: #8f3f22; }

/* ---------- M-02 moisture location x visit comparison ---------- */
.ws-moist-wrap { overflow-x: auto; border: 1px solid rgba(24,44,70,.16); border-radius: 14px; background: #fffdf8; }
.ws-moist { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 520px; }
.ws-moist th, .ws-moist td { padding: 9px 12px; text-align: left; border-bottom: 1px solid rgba(24,44,70,.1); vertical-align: top; }
.ws-moist thead th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: #5c6a74; background: #f6f3ea; }
.ws-moist tbody th { font-weight: 700; color: #182c46; }
.ws-moist-val { display: block; font: 700 .9rem var(--mono); color: #182c46; }
.ws-moist-meta { display: block; font-size: .72rem; color: #7c8a95; }
.ws-moist-none { font-size: .76rem; color: #a09a8c; font-style: italic; }
.ws-moist-flag { font-size: .74rem; font-weight: 700; color: #8f3f22; }
.ws-moist-ok { font-size: .74rem; font-weight: 600; color: #245740; }

/* ---------- access storyboard ---------- */
.ws-story { display: grid; grid-auto-flow: column; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.ws-story-step { min-width: 132px; min-height: 66px; display: grid; gap: 2px; justify-items: start; text-align: left;
  padding: 9px 12px; border: 1px solid rgba(24,44,70,.18); border-radius: 12px; background: #fffdf8; cursor: pointer;
  transition: border-color .16s ease, transform .16s ease; }
.ws-story-step:hover { border-color: rgba(24,44,70,.45); transform: translateY(-1px); }
.ws-story-step.is-on { border-color: #182c46; border-width: 2px; background: #fff; }
.ws-story-step.is-filled .ws-story-state { color: #245740; }
.ws-story-step:focus-visible { outline: 3px solid #b7791f; outline-offset: 2px; }
.ws-story-num { font: 700 .7rem var(--mono); color: #8b8578; }
.ws-story-label { font-size: .84rem; font-weight: 700; color: #182c46; }
.ws-story-state { font-size: .72rem; color: #8b8578; }
@media (max-width: 680px) {
  .ws-story { grid-auto-flow: row; }
  .ws-story-step { min-width: 0; width: 100%; }
}

/* ---------- G-16 mobile Coach sheet ---------- */
.ws-coach-tab { display: none; }
.ws-coach-close { display: none; }
@media (max-width: 1080px) {
  .ws-coach-tab { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: 12px;
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 16px;
    border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: #0f1b2d; color: #f6f3ea; z-index: 42;
    font-size: .92rem; font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(15,27,45,.3); }
  .ws-coach-tab .tr-icon { width: 20px; height: 20px; }
  .ws-coach-tab-state { margin-left: auto; font-size: .78rem; font-weight: 600; color: #9fb6cc; }
  .ws-coach-tab-state.has-blockers { color: #ffb4a0; }
  .ws-coach-tab:focus-visible { outline: 3px solid #b7791f; outline-offset: 3px; }
  .wsv4-coach { position: fixed; z-index: 41; left: 0; right: 0; top: auto; bottom: 0; height: auto; max-height: 76vh; overflow-y: auto;
    border-radius: 20px 20px 0 0; box-shadow: 0 -14px 40px rgba(15,27,45,.28);
    transform: translateY(102%); transition: transform .26s ease; }
  body.ws-coach-open .wsv4-coach { transform: translateY(0); }
  body.ws-coach-open .ws-coach-tab { opacity: 0; pointer-events: none; }
  .ws-coach-close { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; margin: 0 0 4px auto;
    border: 1px solid rgba(24,44,70,.24); border-radius: 999px; background: #fff; color: #182c46;
    font-size: .82rem; font-weight: 700; cursor: pointer; }
  .ws-coach-close:focus-visible { outline: 3px solid #b7791f; outline-offset: 2px; }
  /* the sheet must not hide the last of the record */
  .wsv4-shell { padding-bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) { .wsv4-coach { transition: none; } }

/* ---------- reliance definitions (P1) ---------- */
.ws-reliance-defs { margin: 0 0 10px; padding: 10px 13px; border: 1px solid #ded6c5; border-radius: 12px; background: #fffdf8; }
.ws-reliance-defs summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: #182c46; min-height: 32px; display: flex; align-items: center; }
.ws-reliance-defs summary:focus-visible { outline: 3px solid #b7791f; outline-offset: 2px; }
.ws-reliance-dl { margin: 8px 0 0; display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: 5px 12px; }
.ws-reliance-dl dt { font-size: .78rem; font-weight: 700; color: #182c46; }
.ws-reliance-dl dd { margin: 0; font-size: .78rem; color: #4a5a66; }
@media (max-width: 560px) { .ws-reliance-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .ws-reliance-dl dd { margin-bottom: 6px; } }

/* ---------- Record map: an object register, deliberately NOT a node chain ---------- */
.ws-map-reg { display: grid; gap: 0; border: 1px solid #ded6c5; border-radius: 12px; overflow: hidden; background: #fffdf8; }
.ws-map-head, .ws-map-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .9fr); gap: 12px; padding: 9px 13px; }
.ws-map-head { background: #f2ede1; border-bottom: 1px solid #ded6c5; }
.ws-map-head span { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6b7780; }
.ws-map-row { border-bottom: 1px solid #ece6d9; align-items: start; font-size: .8rem; color: #3d4c56; }
.ws-map-row:last-child { border-bottom: 0; }
.ws-map-row.is-supplied { border-left: 3px solid #b7791f; padding-left: 10px; }
.ws-map-row > span { display: grid; gap: 2px; min-width: 0; }
.ws-map-what { color: #24313f; overflow-wrap: anywhere; }
.ws-map-origin { color: #4a5a66; }
.ws-map-owner { font-size: .74rem; font-weight: 700; color: #182c46; }
.ws-map-links { font-size: .76rem; color: #5c6a74; }
.ws-map-dest { font-family: var(--mono, ui-monospace, Menlo, monospace); font-size: .74rem; color: #245740; }
@media (max-width: 820px) {
  .ws-map-head { display: none; }
  .ws-map-row { grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 12px 13px; }
  .ws-map-links::before { content: "Linked to: "; color: #8b8578; }
  .ws-map-dest::before { content: "Prints in "; color: #8b8578; font-family: inherit; }
}

/* ---------- split lens: bounded result tied to its method (D-3) ---------- */
.ws-split-source { margin-top: 10px; padding: 10px 12px; border-left: 3px solid #3c6081; border-radius: 8px; background: #f6f3ea; }
.ws-split-source-head { margin: 0; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6b7780; }
.ws-split-source-val { margin: 4px 0 0; font-family: var(--mono, ui-monospace, Menlo, monospace); font-size: .82rem; color: #14181c; }
.ws-split-chain { margin-top: 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  border: 1px dashed #c9c0ad; border-radius: 10px; background: #fffdf8; font-size: .78rem; color: #3d4c56; }
.ws-split-arrow { color: #8b8578; }
.ws-split-chain-mid { color: #5c6a74; font-style: italic; }
.ws-split-chain-end { font-weight: 600; color: #182c46; }

/* ---------- Escape of Water: affected areas & response (D-4) ---------- */
.ws-eow-incident { margin: 10px 0 0; padding: 11px 13px; display: flex; gap: 10px; align-items: flex-start;
  border-left: 3px solid #b7791f; border-radius: 10px; background: #f6f3ea; }
.ws-eow-incident-head { margin: 0; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6b7780; }
.ws-eow-incident-val { margin: 3px 0 0; font-size: .84rem; color: #24313f; }
.ws-eow-grid { margin: 12px 0 0; border: 1px solid #ded6c5; border-radius: 12px; overflow: hidden; background: #fffdf8; }
.ws-eow-head, .ws-eow-row { display: grid; grid-template-columns: minmax(0, 1.1fr) repeat(3, minmax(0, 1fr)); gap: 10px; padding: 9px 12px; align-items: start; }
.ws-eow-head { background: #f2ede1; border-bottom: 1px solid #ded6c5; }
.ws-eow-head span { font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6b7780; }
.ws-eow-row { border-bottom: 1px solid #ece6d9; }
.ws-eow-row:last-child { border-bottom: 0; }
.ws-eow-row.is-open { border-left: 3px solid #b7791f; padding-left: 9px; }
.ws-eow-row > span { display: grid; gap: 3px; min-width: 0; }
.ws-eow-area { font-size: .82rem; color: #24313f; }
.ws-eow-access { font-size: .72rem; color: #6b7780; }
.ws-eow-row select { min-height: 40px; }
@media (max-width: 860px) {
  .ws-eow-head { display: none; }
  .ws-eow-row { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 12px; }
}

/* ---------- chapter rail: Concept 9 semantic mark per chapter ---------- */
.wsv4-rail-ico { width: 20px; height: 20px; flex: none; color: #5c6a74; }
.ws-ch button { display: grid; grid-template-columns: auto 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.ws-ch.is-current .wsv4-rail-ico, .ws-ch button[aria-current="true"] .wsv4-rail-ico { color: #0f1b2d; }
.ws-ch.is-blocker .wsv4-rail-ico { color: #8a5b12; }
.ws-ch button:hover .wsv4-rail-ico { color: #182c46; }
@media (max-width: 1080px) {
  .ws-ch button { grid-template-columns: auto 18px minmax(0, 1fr) auto; }
  .wsv4-rail-ico { width: 18px; height: 18px; }
}
/* pathway menu: the record mark reads as the pathway's own instrument */
.wsv4-pathway-menu button { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 11px; align-items: center; }
.wsv4-pathway-menu button svg { width: 30px; height: 30px; }
.ws-pathway-on { font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #245740; }

.wsv4-row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* the shared .tr-icon sizing would overflow the rail's 20px column */
.wsv4-rail-ico svg.tr-icon { width: 20px; height: 20px; display: block; }
@media (max-width: 1080px) { .wsv4-rail-ico svg.tr-icon { width: 18px; height: 18px; } }

/* ---------- opening choice: no record is loaded for the engineer ---------- */
.ws-open-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 14px; margin-top: 4px; }
.ws-open-card { display: grid; gap: 8px; align-content: start; padding: 20px;
  border: 1px solid #ded6c5; border-radius: 16px; background: #fffdf8; }
.ws-open-card.is-primary { border-color: rgba(24, 44, 70, .3); box-shadow: 0 3px 14px rgba(15, 27, 45, .07); }
.ws-open-ico { display: block; color: #3c6081; }
.ws-open-ico svg.tr-icon { width: 26px; height: 26px; display: block; }
.ws-open-title { margin: 2px 0 0; font: 700 1.06rem "Source Serif 4", Georgia, serif; color: #0f1b2d; }
.ws-open-body { margin: 0; font-size: .87rem; line-height: 1.5; color: #3d4c56; text-wrap: pretty; }
.ws-open-note { margin: 0; font-size: .76rem; color: #6b7780; }
.ws-open-note.is-sample { color: #8a5b12; font-weight: 600; }
.ws-open-card .wsv4-btn { margin-top: 6px; justify-self: start; }
.ws-open-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e2dccd; }

/* ---------- destructive action: visible, never the default ---------- */
.ws-objtool-del { opacity: .75; }
.wsv4-obj:hover .ws-objtool-del, .wsv4-obj:focus-within .ws-objtool-del { opacity: 1; }
.ws-objtool-del:hover { color: #8f3f22; border-color: rgba(143, 63, 34, .5); background: #fdf6f2; }
.ws-btn-danger { border-color: rgba(143, 63, 34, .55); color: #8f3f22; background: #fdf6f2; }
.ws-btn-danger:hover { background: #8f3f22; border-color: #8f3f22; color: #fff; }
.ws-del-list { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 3px; font-size: .84rem; color: #24313f; }
.wsv4-dialog-row { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }

.ws-btn-danger-sm { color: #8f3f22; border-color: rgba(143, 63, 34, .35); }
.ws-btn-danger-sm:hover { background: #fdf6f2; border-color: rgba(143, 63, 34, .6); color: #8f3f22; }

/* ---------- persistent output control (Gate E) ---------- */
.ws-output-btn{
  display:inline-flex;align-items:center;gap:8px;cursor:pointer;
}
.ws-output-btn .tr-icon{width:18px;height:18px;flex:none}
.ws-output-btn b{font-weight:700}

/* ---------- output overview ---------- */
.ws-out-overview{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:1px;margin:12px 0 4px;background:rgba(24,44,70,.14);
  border:1px solid rgba(24,44,70,.14);
}
.ws-out-cell{display:flex;flex-direction:column;gap:3px;padding:10px 12px;background:#fdfcf9}
.ws-out-key{font-size:.68rem;letter-spacing:.12em;text-transform:uppercase;color:#6f6a5f}
.ws-out-val{font-size:.9rem;color:#182c46}

/* ============ EVIDENCE DESK BOARD (2.3) ============ */
.ws-desk-wrap{margin:10px 0 6px}
.ws-desk{display:grid;grid-template-columns:repeat(auto-fill,minmax(238px,1fr));gap:10px}
.ws-desk-card{
  display:flex;flex-direction:column;gap:6px;padding:11px 12px;cursor:pointer;
  background:#fdfcf9;border:1px solid rgba(24,44,70,.16);border-left:3px solid #8b8578;
  text-align:left;transition:border-color .18s ease,box-shadow .18s ease;
}
.ws-desk-card:hover,.ws-desk-card:focus-visible{
  border-color:rgba(24,44,70,.4);box-shadow:0 2px 10px rgba(24,44,70,.09);outline:none;
}
.ws-desk-card.is-linked{border-left-color:#2f6a4f}
.ws-desk-card.is-unlinked{border-left-color:#b7791f;background:#fdfaf3}
.ws-desk-card.is-conflicting{border-left-color:#8f3f22;background:#fdf4f1}
.ws-desk-top{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.ws-desk-type{font-size:.8rem;font-weight:700;color:#182c46}
.ws-desk-origin{
  font-size:.64rem;letter-spacing:.1em;text-transform:uppercase;color:#6f6a5f;
  padding:2px 6px;border:1px solid rgba(24,44,70,.16);background:#fff;
}
.ws-desk-where{margin:0;font-size:.75rem;letter-spacing:.06em;text-transform:uppercase;color:#6f6a5f}
.ws-desk-shows{margin:0;font-size:.86rem;line-height:1.45;color:#24313f}
.ws-desk-not{margin:0;font-size:.78rem;line-height:1.4;color:#8f3f22}
.ws-desk-foot{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin-top:auto;padding-top:6px;border-top:1px solid rgba(24,44,70,.1)}
.ws-desk-link{
  font-size:.7rem;font-weight:700;padding:2px 7px;color:#1f4a37;
  background:#eef5f1;border:1px solid rgba(47,106,79,.3);
}
.ws-desk-link.is-none{color:#8a5b12;background:#fdf6e7;border-color:rgba(183,121,31,.34);font-weight:600}
.ws-desk-at{margin-left:auto;font-size:.7rem;font-family:ui-monospace,Menlo,monospace;color:#6f6a5f}

/* ============ LIMITATION LINKER (2.8) ============ */
.ws-linker{
  margin-top:10px;padding:10px 12px;
  background:#fdfaf3;border:1px dashed rgba(183,121,31,.5);
}
.ws-linker-head{margin:0 0 7px;font-size:.78rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#8a5b12}
.ws-linker-row{display:flex;flex-wrap:wrap;gap:7px}
.ws-linker-chip{
  display:inline-flex;align-items:center;gap:7px;padding:6px 11px;cursor:pointer;
  background:#fff;border:1px solid rgba(24,44,70,.24);color:#182c46;
  font:inherit;font-size:.84rem;transition:background .16s ease,border-color .16s ease;
}
.ws-linker-chip:hover{border-color:rgba(24,44,70,.5)}
.ws-linker-chip.is-on{background:#fdf6e7;border-color:#b7791f;border-style:dashed}
.ws-linker-chip-ref{font-family:ui-monospace,Menlo,monospace;font-weight:700}
.ws-linker-chip-state{font-size:.68rem;letter-spacing:.08em;text-transform:uppercase;color:#6f6a5f}
.ws-linker-chip.is-on .ws-linker-chip-state{color:#8a5b12}
.ws-linker-state{margin:9px 0 0;font-size:.8rem;line-height:1.45}
.ws-linker-state.is-linked{color:#2f6a4f}
.ws-linker-state.is-unlinked{color:#8a5b12}

@media (max-width:640px){
  .ws-desk{grid-template-columns:1fr}
}

/* chronology: the rest of the investigation sequence (2.6) */
.ws-chrono-pin.is-attend{border-color:#2f6a4f;color:#1f4a37}
.ws-chrono-pin.is-access{border-color:#5c6a74;color:#41525c}
.ws-chrono-pin.is-repair{border-color:#6b5b95;color:#4d4070}
.ws-chrono-pin.is-finding{border-color:#182c46;color:#182c46;background:#f4f6f9;font-weight:800}
.ws-chrono-pin.is-depart{border-color:#2f6a4f;color:#1f4a37;border-style:dashed}
.ws-chrono-chip.is-attend,.ws-chrono-chip.is-depart{border-color:rgba(47,106,79,.4);color:#1f4a37}
.ws-chrono-chip.is-access{border-color:rgba(92,106,116,.4);color:#41525c}
.ws-chrono-chip.is-repair{border-color:rgba(107,91,149,.4);color:#4d4070}
.ws-chrono-chip.is-finding{border-color:rgba(24,44,70,.45);color:#182c46;font-weight:700}

/* Page heading: present for assistive technology and for the document outline.
   The visible record identity beside it carries the reference and title. */
.ws-page-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Restore-from-backup on the opening screen: the file input is replaced by its
   own label styled as a button, so the third choice matches the other two. */
.ws-open-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ws-open-file:focus-visible + .wsv4-btn, .ws-open-card label.wsv4-btn { cursor: pointer; }
.ws-open-card label.wsv4-btn { display: inline-flex; align-items: center; justify-content: center; }

/* Relational area tile (Concept 13). The tile stops being an indicative
   swatch and carries what is attached to that area: the evidence recorded
   there and the finding relying on it. "no evidence" is stated plainly —
   an area with nothing attached is a gap, not an empty decoration. */
.wsv4-area-rel { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.wsv4-area-rel i { font-style: normal; font-family: ui-monospace, Menlo, monospace; font-size: .63rem; font-weight: 650; letter-spacing: .03em; padding: 2px 6px; border-radius: 4px; }
.wsv4-area-ev { background: rgba(15,27,45,.07); color: #2d4a63; }
.wsv4-area-ev.is-more { background: transparent; color: #8b8578; }
.wsv4-area-ev.is-none { background: transparent; color: #8a5b12; font-family: inherit; font-size: .68rem; font-weight: 600; padding-left: 0; }
.wsv4-area-fd { background: #0f1b2d; color: #e0a43a; }

/* Drawing-grid ground — raised above the `.workspace-body{background:…}`
   shorthand in tracerecord.css, which would otherwise reset the image. */
body.workspace-body{
  background-color:#efe8db;
  background-image:linear-gradient(rgba(24,44,70,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(24,44,70,.04) 1px,transparent 1px);
  background-size:28px 28px;
}
