/* Mirrored CP26 visual language — colours sampled read-only from the running
   portals (sidebar #232833, accent #A52A84, brand mark #FF5A1F, page #FAFBFC,
   content #ECEEF1, border #E2E5E9, ink #0B0D11, muted #4D5563).
   This stylesheet is for the PROTOTYPE only. Nothing here touches CP26. */

:root {
  --ink: #0B0D11;
  --muted: #4D5563;
  --line: #E2E5E9;
  --page: #FAFBFC;
  --shell: #ECEEF1;
  --sidebar: #232833;
  --sidebar-ink: #CBD5E1;
  --accent: #A52A84;
  --brand: #FF5A1F;
  --ok-bg: #DCFCE7; --ok-ink: #15803D;
  --warn-bg: #FEF3C7; --warn-ink: #92400E;
  --info-bg: #DBEAFE; --info-ink: #1D4ED8;
  --bad-bg: #FEE2E2; --bad-ink: #B91C1C;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--shell);
  color: var(--ink);
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- shell ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: var(--sidebar);
  color: var(--sidebar-ink); padding: 12px 8px; position: sticky; top: 0;
  height: 100vh; overflow: auto;
}
.brand {
  display: flex; align-items: center; gap: 8px; color: #fff;
  font-weight: 600; padding: 8px 10px 16px;
}
.brand .mark {
  width: 20px; height: 20px; border-radius: 5px; background: var(--brand);
  flex: 0 0 20px;
}
.sidebar nav a {
  display: block; padding: 7px 10px; border-radius: 6px; margin-bottom: 2px;
  color: var(--sidebar-ink); text-decoration: none; font-size: 13.5px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar .group { margin-top: 14px; padding: 0 10px 6px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .06em; color: #6b7280; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 24px; display: flex; align-items: center; gap: 12px;
}
.crumbs { color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.spacer { flex: 1; }
.avatar {
  background: var(--shell); border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 10px; font-size: 13px;
}
.content { padding: 24px; max-width: 1000px; }
.content.wide { max-width: 1180px; }

/* ---------- page header / tabs ---------- */
.pagehead h1 { font-size: 22px; margin: 0 0 4px; }
.pagehead p.sub { margin: 0 0 14px; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tabs a {
  padding: 8px 12px; text-decoration: none; color: var(--muted);
  font-size: 13.5px; border-bottom: 2px solid transparent;
}
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.subtabs { display: flex; gap: 6px; margin: 12px 0 20px; }
.subtabs a {
  padding: 5px 10px; border-radius: 999px; background: #F5F6F8;
  color: var(--muted); text-decoration: none; font-size: 13px;
}
.subtabs a.active { background: var(--accent); color: #fff; }

/* ---------- cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 16px;
}
.card > header {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.card > header h2 { font-size: 15px; margin: 0; }
.card .body { padding: 16px; }
.card .body > *:first-child { margin-top: 0; }
.card .body > *:last-child { margin-bottom: 0; }

/* ---------- provenance tags: the observed / proposed distinction ---------- */
.tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 4px; vertical-align: 2px;
  white-space: nowrap;
}
.tag.observed { background: #ECEEF1; color: #4D5563; }
.tag.proposed { background: #FCE7F3; color: #9D174D; }
.tag.unresolved { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- chips / states ---------- */
.chip {
  display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px;
}
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.info { background: var(--info-bg); color: var(--info-ink); }
.chip.bad { background: var(--bad-bg); color: var(--bad-ink); }
.chip.idle { background: #F5F6F8; color: var(--muted); }

/* ---------- forms ---------- */
fieldset { border: 0; margin: 0 0 18px; padding: 0; }
legend { font-weight: 600; font-size: 14.5px; padding: 0; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.opt {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 13px; margin-bottom: 8px; cursor: pointer; background: #fff;
}
.opt:hover { border-color: #c9cdd4; }
.opt input { margin-right: 9px; }
.opt .t { font-weight: 600; }
.opt .d { color: var(--muted); font-size: 13px; margin: 3px 0 0 24px; }
.opt.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

button, .btn {
  font: inherit; border-radius: 6px; padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  text-decoration: none; display: inline-block;
}
button.primary, .btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
button:disabled, .btn.disabled {
  opacity: .45; cursor: not-allowed;
}
button.danger { border-color: #DC2626; color: #DC2626; background: #FFFBEB; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

/* ---------- record blocks ---------- */
.rec {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  margin-bottom: 10px; background: #FAFBFC;
}
.rec .rh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rec .rh strong { font-size: 13.5px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- checklist ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 0; }
.steps .dot {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 22px; margin-top: 1px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: #F5F6F8; color: var(--muted);
}
.steps li.done .dot { background: var(--ok-bg); color: var(--ok-ink); }
.steps li.fail .dot { background: var(--bad-bg); color: var(--bad-ink); }
.steps li.busy .dot { background: var(--info-bg); color: var(--info-ink); }
.steps .txt { flex: 1; }
.steps .txt .t { font-weight: 600; }
.steps .txt .d { color: var(--muted); font-size: 13px; margin-top: 3px; }
.steps .txt .prov {
  font-size: 12px; margin-top: 6px; color: var(--muted);
  border-left: 2px solid var(--line); padding-left: 8px;
}

/* ---------- notices ---------- */
.note {
  border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; font-size: 13.5px;
  border: 1px solid var(--line); background: #fff;
}
.note.mail { border-color: #F5D0A9; background: #FFFBEB; }
.note.block { border-color: #F3B4B4; background: #FEF2F2; }
.note.calm { background: #F8FAFC; }
.note h3 { margin: 0 0 6px; font-size: 14px; }
.note p:last-child { margin-bottom: 0; }

/* ---------- scenario switcher (prototype control, not product UI) ---------- */
.harness {
  background: #232833; color: #CBD5E1; padding: 10px 24px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px;
}
.harness b { color: #fff; font-weight: 600; margin-right: 4px; }
.harness button {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18);
  color: #CBD5E1; padding: 4px 10px; font-size: 12.5px;
}
.harness button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th, table.grid td {
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top;
}
table.grid th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.hidden { display: none !important; }
ul.tight { margin: 8px 0; padding-left: 20px; }
ul.tight li { margin-bottom: 5px; }
