/* provaldi_ui — enterprise-register styles. Self-hosted everything:
   system font stack, no external assets. Palette: paper + ink + slate
   accent. Typographic wordmark placeholder (no brand asset yet). */

:root {
  --paper: #f7f8fa;
  --panel: #ffffff;
  --ink: #1e2330;
  --muted: #6b7280;
  --accent: #2f5d7c;       /* slate-teal — enterprise register */
  --accent-soft: #e7eef3;
  --line: #e2e5ea;
  --agent-bg: #ffffff;
  --learner-bg: #eef2f6;
  --warn-line: #b45309;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 -apple-system, "Segoe UI", system-ui, sans-serif;
}

/* shell + topbar */
.shell { min-height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--panel);
}
.wordmark {
  font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em; color: var(--accent);
}
.wordmark-mark { color: var(--muted); }
.territory-tabs { display: flex; gap: 0.4rem; margin-left: 1rem; }
.territory-tab {
  background: none; border: 1px solid transparent; color: var(--muted);
  border-radius: 999px; padding: 0.3rem 0.9rem; cursor: pointer; font: inherit; font-size: 0.9rem;
}
.territory-tab--active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.viewer-pill {
  margin-left: auto; font-size: 0.8rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem;
}
.dev-note { max-width: 60rem; margin: 0.6rem auto 0; padding: 0 1rem; }

.app { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* arrival + assigned target */
.arrival { max-width: 34rem; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 1rem; }
.arrival h1 { font-size: 1.8rem; margin: 0; }
.tagline { color: var(--muted); margin: 0; }
.assigned-target { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; background: var(--panel); }
.assigned-target h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 0.5rem; }
.assigned-name { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.6rem; }
.assigned-provenance { margin: 0; display: grid; gap: 0.3rem; }
.assigned-provenance > div { display: flex; gap: 0.6rem; }
.assigned-provenance dt { color: var(--muted); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.08em; min-width: 3rem; padding-top: 0.15rem; }
.assigned-provenance dd { margin: 0; }
.fine-print { color: var(--muted); font-size: 0.85rem; }

/* disclosure strip + who-sees-what */
.disclosure-strip {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 0.7rem 1rem; font-size: 0.92rem;
}
.disclosure-strip-text { color: var(--ink); }
.draft-tag { color: var(--warn-line); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.who-sees-what { max-width: 40rem; margin: 3vh auto 0; }
.who-sees-what h2 { font-size: 1.4rem; margin: 0 0 0.3rem; }
.party-list { list-style: none; margin: 1rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.party { border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.9rem; background: var(--panel); }
.party-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.party-level { font-size: 0.75rem; color: var(--accent); }
.party-sees { font-size: 0.9rem; margin-top: 0.3rem; }
.party-cannot { font-size: 0.9rem; color: var(--muted); }
.never-list { border-top: 1px dashed var(--line); padding-top: 0.8rem; }
.never-list h3 { font-size: 0.9rem; margin: 0 0 0.4rem; }
.never-list ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.9rem; }

/* org mirror + visible tags */
.org-mirror { border: 1px solid var(--accent); border-radius: 12px; padding: 1rem 1.2rem; background: var(--accent-soft); margin: 1rem 0; }
.org-mirror h2 { font-size: 1rem; margin: 0 0 0.3rem; }
.org-mirror-note { color: var(--muted); font-size: 0.82rem; margin: 0 0 0.6rem; }
.org-evidence-list, .tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.org-evidence { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.5rem 0.7rem; background: var(--panel); border-radius: 8px; }
.org-evidence-paraphrase { font-size: 0.92rem; }
.org-evidence-basis { font-size: 0.75rem; color: var(--muted); }
.org-visible-tags h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.tag-row { display: flex; justify-content: space-between; gap: 0.7rem; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.tag-row--hidden { opacity: 0.7; }
.tag-basis { font-size: 0.78rem; color: var(--muted); }

/* reveal-with-preview layout */
.reveal-with-preview { display: grid; grid-template-columns: 1fr 22rem; gap: 1.5rem; align-items: start; }
@media (max-width: 52rem) { .reveal-with-preview { grid-template-columns: 1fr; } }
.roll-up-preview { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; background: var(--panel); }

/* organize territory */
.org-header { border-bottom: 1px solid var(--line); padding-bottom: 0.8rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.org-header h1 { margin: 0; font-size: 1.5rem; }
.scope-picker { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.scope-chip { border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 0.2rem 0.8rem; font-size: 0.82rem; }
.org-register-note { margin-top: 1rem; }
.boundary { border: 1px dashed var(--accent); border-radius: 12px; padding: 1rem 1.2rem; background: var(--accent-soft); }
.boundary-title { font-size: 1.05rem; margin: 0 0 0.4rem; }
.boundary-detail { margin: 0; }

/* conversation layout */
.conversation-layout { display: grid; grid-template-columns: 1fr 15rem; gap: 1.25rem; }
@media (max-width: 44rem) { .conversation-layout { grid-template-columns: 1fr; } .rail { order: -1; } }
.thread { display: flex; flex-direction: column; gap: 0.8rem; padding-bottom: 1rem; }
.msg { position: relative; padding: 0.7rem 1rem; border-radius: 10px; max-width: 44rem; }
.msg--agent { background: var(--agent-bg); border: 1px solid var(--line); align-self: flex-start; }
.msg--learner { background: var(--learner-bg); align-self: flex-end; }
.msg--system { align-self: center; background: none; }
.msg-body p { margin: 0.35rem 0; }
.msg-body blockquote {
  margin: 0.5rem 0; padding: 0.4rem 0.8rem; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 6px 6px 0;
}
.system-marker { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.code-block {
  background: #232833; color: #e8ecf2; padding: 0.75rem 1rem; border-radius: 8px;
  overflow-x: auto; font: 0.85rem/1.5 "SF Mono", ui-monospace, monospace;
}
.role-chip {
  display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
  padding: 0.05rem 0.5rem; margin-bottom: 0.35rem;
}
.evidence-glyph { position: absolute; right: -1.2rem; top: 0.8rem; color: var(--accent); cursor: help; font-size: 0.8rem; }
.quick-replies { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.quick-reply {
  border: 1px solid var(--accent); color: var(--accent); background: none;
  border-radius: 999px; padding: 0.35rem 0.9rem; cursor: pointer; font-size: 0.9rem;
}
.quick-reply:hover { background: var(--accent-soft); }

/* composer */
.composer { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.composer textarea {
  width: 100%; padding: 0.7rem 0.9rem; font: inherit; border: 1px solid var(--line);
  border-radius: 10px; resize: vertical; background: var(--panel);
}
.composer-row { display: flex; justify-content: space-between; }
.pause { background: none; border: none; color: var(--muted); cursor: pointer; }

/* rail */
.rail { border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem; height: fit-content; background: var(--panel); }
.rail-toggle { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0; font-size: 0.8rem; }
.rail-movement { font-size: 0.8rem; font-weight: 600; margin: 0.5rem 0; }
.rail-chips { display: flex; flex-direction: column; gap: 0.35rem; }
.chip { font-size: 0.85rem; color: var(--muted); }
.chip--landed { color: var(--accent); }
.chip em { color: var(--muted); font-size: 0.75rem; }
.rail-empty { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.rail-minutes { margin-top: 0.7rem; font-size: 0.75rem; color: var(--muted); }

/* reveal */
.reveal { max-width: 40rem; display: flex; flex-direction: column; gap: 1.1rem; }
.reveal h1 { font-size: 1.6rem; margin: 0; }
.reveal-band { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1.1rem; background: var(--panel); }
.reveal-band h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 0.6rem; }
.map-chip { display: inline-block; margin: 0 0.5rem 0.4rem 0; padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.95rem; }
.map-chip--demonstrated { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); cursor: pointer; }
.map-chip--frontier { border: 1px dashed var(--accent); color: var(--ink); }
.map-chip--unexplored { border: 1px solid var(--line); color: var(--muted); }
.band-note { color: var(--muted); font-size: 0.8rem; margin: 0.4rem 0 0; }
.evidence-panel { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 0.9rem 1.1rem; }
.wrap-actions { margin-top: 1rem; display: flex; gap: 0.75rem; align-items: center; }

/* shared */
button.primary {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 0.65rem 1.3rem; font-size: 1rem; cursor: pointer;
}
button.primary:disabled { opacity: 0.45; cursor: default; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
.linklike { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }

/* ── Organize demo panes (UI-4) ───────────────────────────────────── */
.scope-chip--active { background: var(--accent); color: #fff; }
button.scope-chip { cursor: pointer; font: inherit; }

.pane { display: flex; flex-direction: column; gap: 0.9rem; }
.pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pane-head h2 { margin: 0; font-size: 1.25rem; }
.pane-note { color: var(--muted); font-size: 0.9rem; margin: 0; }
.as-of { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

/* provenance popover */
.provenance { border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.8rem; background: var(--panel); font-size: 0.85rem; }
.provenance summary { cursor: pointer; color: var(--accent); }
.provenance-body { margin: 0.6rem 0 0; display: grid; gap: 0.3rem; }
.provenance-body > div { display: flex; gap: 0.6rem; }
.provenance-body dt { color: var(--muted); text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.06em; min-width: 6.5rem; padding-top: 0.1rem; }
.provenance-body dd { margin: 0; }

/* N1 network pulse */
.domain-group { display: flex; flex-direction: column; gap: 0.5rem; }
.domain-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0.4rem 0 0; }
.signal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.8rem; }
.signal-card { border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 0.9rem; background: var(--panel); display: flex; flex-direction: column; gap: 0.5rem; }
.signal-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.signal-card-name { font-weight: 600; }
.velocity { font-size: 0.78rem; }
.velocity--rising { color: #15803d; }
.velocity--fading { color: var(--warn-line); }
.velocity--flat { color: var(--muted); }
.velocity--unmeasured { color: var(--muted); font-style: italic; }
.histogram { width: 100%; height: auto; }
.histogram-bar { fill: var(--accent); }
.signal-stats { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem; }
.signal-stats > div { display: flex; flex-direction: column; }
.signal-stats dt { color: var(--muted); text-transform: uppercase; font-size: 0.62rem; letter-spacing: 0.05em; }
.signal-stats dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.signal-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.signal-badge { font-size: 0.72rem; border: 1px solid var(--warn-line); color: var(--warn-line); border-radius: 999px; padding: 0.05rem 0.55rem; }

/* Q1 refresher queue */
.assign-controls { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.reason-input { flex: 1 1 16rem; padding: 0.5rem 0.8rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.queue-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.queue-table th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 0.4rem 0.5rem; }
.queue-table td { padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--line); }
.queue-row--enrolled { opacity: 0.6; }
.decay-badge { font-size: 0.75rem; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 0.05rem 0.55rem; }
.enrolled-tag { font-size: 0.78rem; color: #15803d; }
.bulk-report { border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 1rem; background: var(--panel); }
.bulk-report h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.bulk-row { font-size: 0.9rem; padding: 0.2rem 0; }
.bulk-row--assigned, .bulk-row--skipped { color: #15803d; }
.bulk-row--failed { color: var(--warn-line); }
.action-log summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }

/* N2 franchise roll-up */
.rollup-scroll { overflow-x: auto; }
.rollup-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.rollup-table th, .rollup-table td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rollup-table th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.rollup-row-label { font-weight: 600; }
.rollup-cell { font-variant-numeric: tabular-nums; }
.rollup-cell--below { color: var(--muted); font-style: italic; }
.below-floor-bucket { border: 1px dashed var(--accent); border-radius: 10px; padding: 0.7rem 0.9rem; background: var(--accent-soft); }
.below-floor-count { color: var(--muted); font-size: 0.85rem; }
.drilldown { margin-top: 0.5rem; }

/* content-egress ledger — the synthetic-data marker (F11.E1). The demo has
   no transport and therefore no ledger; fixture rows must be unmistakable. */
.synthetic-marker { border: 2px dashed var(--warn-line); border-radius: 10px; padding: 0.7rem 0.9rem; margin: 0; color: var(--warn-line); background: var(--panel); font-size: 0.9rem; }
.egress-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.egress-table th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 0.4rem 0.5rem; }
.egress-table td { padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--line); }
.egress-table--synthetic { opacity: 0.75; font-style: italic; outline: 2px dashed var(--warn-line); outline-offset: 4px; }

/* refresher queue — the demo-write marker (the F11.E1 sibling, 2026-07-31).
   The demo has no transport and writes nothing; its receipts are invented,
   so the log that renders them must not read as a record. Reuses
   .synthetic-marker above — one marker vocabulary across both panes. */
.action-log--synthetic { border: 2px dashed var(--warn-line); border-radius: 10px; padding: 0.5rem 0.7rem; }
.action-log--synthetic summary { color: var(--warn-line); font-style: italic; }
.synthetic-tag { color: var(--warn-line); font-style: italic; }
