/* ==================================================================
   Tenant Profile and Messages from campus (tp-* and cm-* vocabularies) - Threshold settings surfaces.

   Token discipline (ADR-0035), same as branding.css: the design-canon
   tenant-profile.css uses unprefixed token names (--paper, --advant,
   --r-3, --f-mono, …); the live Threshold substrate prefixes every
   token --th-* (PR 51), so every reference below is mapped to its live
   name - same VALUE, no appearance change, no token re-declaration:

     --paper*    → --th-paper*      --r-N   → --th-radius-N
     --ink*      → --th-ink*        --r-pill → --th-radius-pill
     --line*     → --th-line*       --f-X   → --th-f-X
     --advant*   → --th-advant*     --ok*   → --th-ok*
     --marigold* → --th-marigold*   --warn* → --th-warn*
     --risk*     → --th-risk*

   Omitted from canon (already present elsewhere): the :root / dark token
   blocks (threshold-tokens.css), the global reset + .serif/.mono atoms
   and all .cc-* / .bf-* rules (threshold-chrome.css / branding.css).
   Only the surface-specific tp-* block is ported here. Raw oklch literals
   in .tp-note (amber body text) mirror branding.css's .bf-aspectwarn and
   are the canon's hardcoded values, not tokens.
   ================================================================== */

/* Floating save bar - sticky to the bottom of the scroll container while dirty. (The canon's global
   `.cc-shell { height:100vh; overflow:hidden }` is intentionally NOT ported here - tenant-profile.css is
   loaded app-wide, and the existing threshold-chrome shell already makes .cc-page the scroll container.) */
.tp-savebar {
  position: sticky; bottom: 18px; z-index: 30;
  width: min(600px, calc(100% - 48px));
  margin: 10px auto 6px;
  display: flex; align-items: center; gap: 13px;
  padding: 9px 11px 9px 17px;
  background: var(--th-paper-sunk);
  border: 1px solid color-mix(in oklab, var(--th-marigold-deep) 40%, var(--th-line-2));
  border-radius: var(--th-radius-8);
  box-shadow: 0 14px 34px oklch(25% 0.03 60 / 0.20), 0 2px 8px oklch(25% 0.03 60 / 0.10);
}
[data-theme="dark"] .tp-savebar { box-shadow: 0 14px 34px oklch(0% 0 0 / 0.5), 0 2px 8px oklch(0% 0 0 / 0.35); }
.tp-savebar-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--th-marigold-deep); box-shadow: 0 0 0 4px var(--th-marigold-soft);
}
.tp-savebar-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tp-savebar-text .t { font-size: 13px; font-weight: 600; color: var(--th-ink); }
.tp-savebar-text .s { font-size: 11px; color: var(--th-ink-3); margin-top: 1px; }
.tp-savebar-spacer { flex: 1; }
.tp-savebar .cc-btn { font-size: 12.5px; }

/* View-only banner (no OrganizationsEdit) */
.tp-viewbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 24px; flex: none;
  background: var(--th-paper-2);
  border-bottom: 1px solid var(--th-line);
  font-size: 12px; color: var(--th-ink-2);
}
.tp-viewbar .tp-vb-ico { color: var(--th-ink-3); display: inline-flex; }
.tp-viewbar b { color: var(--th-ink); font-weight: 600; }
.tp-viewbar .spacer { flex: 1; }
.tp-viewbar .tp-vb-tag {
  font-family: var(--th-f-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--th-ink-3);
  border: 1px solid var(--th-line-2); border-radius: var(--th-radius-pill); padding: 2px 9px;
}

/* Address grid */
.tp-addr-grid { display: grid; grid-template-columns: 1.4fr 0.9fr 0.7fr 1fr; gap: 16px 14px; }
@media (max-width: 900px) { .tp-addr-grid { grid-template-columns: 1fr 1fr; } }

/* Identifiers grid */
.tp-id-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }

/* Operator-managed read note (distinct from plain read-only) */
.bf-readnote.is-operator { color: var(--th-advant-deep); }
.bf-readnote.is-operator .bf-lock { color: var(--th-advant); }

/* Tag editor */
.tp-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 2px; }
.tp-tags-empty { font-size: 12px; color: var(--th-ink-4); font-style: italic; padding: 3px 0; }
.tp-tag {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 3px 4px 3px 10px; border-radius: var(--th-radius-pill);
  border: 1px solid var(--th-line-2); background: var(--th-paper-sunk);
  font-size: 12px; line-height: 1.5;
}
.tp-tag .k { font-weight: 600; color: var(--th-advant-deep); }
.tp-tag .sep { margin: 0 3px; color: var(--th-ink-4); }
.tp-tag .v { color: var(--th-ink-2); }
.tp-tag .rm {
  margin-left: 6px; width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--th-ink-4);
  border: none; background: transparent; padding: 0;
}
.tp-tag .rm:hover { background: var(--th-risk-soft); color: var(--th-risk); }
.tp-composer { display: flex; align-items: stretch; gap: 8px; margin-top: 10px; }
.tp-composer .tp-ci {
  font-family: var(--th-f-sans); font-size: 13px; color: var(--th-ink);
  background: var(--th-paper-sunk); border: 1px solid var(--th-line-2);
  border-radius: var(--th-radius-3); padding: 7px 10px; outline: none;
}
.tp-composer .tp-ci:focus { border-color: var(--th-advant); box-shadow: 0 0 0 3px var(--th-advant-soft); }
.tp-composer .tp-ci.k { width: 168px; }
.tp-composer .tp-ci.v { flex: 1; min-width: 0; }
.tp-composer .tp-csep { display: flex; align-items: center; color: var(--th-ink-4); font-family: var(--th-f-mono); }
.tp-tagerr { font-size: 11.5px; color: var(--th-risk); margin-top: 7px; }

/* Consequential-field callout (timezone) */
.tp-note {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 12px; margin-top: 2px; border-radius: var(--th-radius-3);
  background: var(--th-warn-soft);
  border: 1px solid color-mix(in oklab, var(--th-warn) 30%, transparent);
  font-size: 11.5px; color: oklch(42% 0.13 65); line-height: 1.5;
}
[data-theme="dark"] .tp-note { color: oklch(84% 0.12 75); }
.tp-note .tp-note-ico { flex: none; display: inline-flex; margin-top: 1px; }
.tp-note b { font-weight: 600; }

/* Inherit note (identifiers) */
.tp-inherit {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 13px; margin-bottom: 16px; border-radius: var(--th-radius-3);
  background: var(--th-advant-soft); border: 1px solid color-mix(in oklab, var(--th-advant) 22%, transparent);
  font-size: 12px; color: var(--th-advant-deep); line-height: 1.5;
}
.tp-inherit .tp-inherit-ico { flex: none; display: inline-flex; margin-top: 1px; }
.tp-inherit b { font-weight: 600; }

/* Timezone friendly label */
.tp-tz-friendly {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--th-ink-2);
}
.tp-tz-friendly .clock {
  font-family: var(--th-f-mono); font-variant-numeric: tabular-nums;
  font-size: 11px; color: var(--th-ink-3);
  background: var(--th-paper-2); border: 1px solid var(--th-line);
  border-radius: var(--th-radius-3); padding: 2px 7px;
}

/* SSO informational panel */
.tp-sso {
  border: 1px solid var(--th-line); border-radius: var(--th-radius-5);
  background: var(--th-paper-sunk); overflow: hidden;
}
.tp-sso-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--th-line);
}
.tp-sso-ico {
  width: 34px; height: 34px; flex: none; border-radius: var(--th-radius-3);
  background: var(--th-advant-soft); color: var(--th-advant-deep);
  display: grid; place-items: center;
}
.tp-sso-htext { flex: 1; min-width: 0; }
.tp-sso-htext .t { font-size: 13px; font-weight: 600; color: var(--th-ink); }
.tp-sso-htext .s { font-size: 11.5px; color: var(--th-ink-3); margin-top: 2px; }
.tp-sso-body { padding: 6px 16px 4px; }
.tp-sso-row {
  display: grid; grid-template-columns: 150px 1fr; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--th-line-soft); align-items: baseline;
}
.tp-sso-row:last-of-type { border-bottom: none; }
.tp-sso-k { font-size: 12px; color: var(--th-ink-3); }
.tp-sso-v { font-size: 13px; color: var(--th-ink); }
.tp-sso-v.mono { font-family: var(--th-f-mono); font-size: 12px; }
.tp-sso-v.muted { color: var(--th-ink-3); font-style: italic; }
.tp-managed {
  display: flex; gap: 11px; align-items: flex-start;
  margin: 12px 16px 16px; padding: 12px 14px;
  border-radius: var(--th-radius-3); background: var(--th-paper-2);
  border: 1px solid var(--th-line);
}
.tp-managed .tp-managed-ico {
  width: 26px; height: 26px; flex: none; border-radius: var(--th-radius-3);
  background: var(--th-paper-sunk); border: 1px solid var(--th-line-2);
  color: var(--th-ink-3); display: grid; place-items: center;
}
.tp-managed-body { flex: 1; min-width: 0; }
.tp-managed-body .t { font-size: 12px; color: var(--th-ink-2); line-height: 1.5; }
.tp-managed-body .t b { color: var(--th-ink); font-weight: 600; }
.tp-support-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 12px; font-weight: 500; color: var(--th-advant-deep);
  text-decoration: none; cursor: pointer;
}
.tp-support-link:hover { text-decoration: underline; }

/* Right summary / status panel */
.tp-aside { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 16px; }
.tp-card {
  border: 1px solid var(--th-line); border-radius: var(--th-radius-8);
  background: var(--th-paper-sunk); overflow: hidden;
}
.tp-card-cap {
  font-family: var(--th-f-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--th-ink-4);
  padding: 12px 16px 0;
}
.tp-ov { display: flex; align-items: center; gap: 13px; padding: 14px 16px 16px; }
.tp-ov-crest {
  width: 46px; height: 46px; flex: none; border-radius: var(--th-radius-5);
  background: linear-gradient(140deg, var(--th-marigold-deep), oklch(35% 0.07 50));
  color: var(--th-paper); display: grid; place-items: center;
  font-family: var(--th-f-serif); font-weight: 600; font-size: 21px; letter-spacing: -0.01em;
}
[data-theme="dark"] .tp-ov-crest { color: oklch(16% 0.01 60); }
.tp-ov-body { min-width: 0; flex: 1; }
.tp-ov-name { font-family: var(--th-f-serif); font-weight: 600; font-size: 17px; color: var(--th-ink); letter-spacing: -0.01em; }
.tp-ov-slug { font-family: var(--th-f-mono); font-size: 11.5px; color: var(--th-ink-3); margin-top: 3px; }
.tp-status-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--th-line);
}
.tp-status-row .lbl { font-size: 12px; color: var(--th-ink-3); }
.tp-facts { padding: 4px 16px 6px; }
.tp-fact {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--th-line-soft);
}
.tp-fact:last-child { border-bottom: none; }
.tp-fact .k { font-size: 12px; color: var(--th-ink-3); flex: none; }
.tp-fact .v { font-size: 12.5px; color: var(--th-ink); text-align: right; }
.tp-fact .v.mono { font-family: var(--th-f-mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tp-fact .v .sub { display: block; font-size: 10.5px; color: var(--th-ink-4); margin-top: 2px; font-family: var(--th-f-sans); }
.tp-quota { display: inline-flex; align-items: center; gap: 8px; }
.tp-quota-bar {
  width: 54px; height: 6px; border-radius: 999px; background: var(--th-paper-3);
  overflow: hidden; border: 1px solid var(--th-line);
}
.tp-quota-bar > i { display: block; height: 100%; background: var(--th-advant); }

/* Read-only legend */
.tp-legend {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 12px 14px; border: 1px dashed var(--th-line-2); border-radius: var(--th-radius-5);
  background: var(--th-paper); font-size: 11.5px; color: var(--th-ink-3); line-height: 1.5;
}
.tp-legend .tp-legend-ico { flex: none; color: var(--th-ink-4); display: inline-flex; margin-top: 1px; }
.tp-legend b { color: var(--th-ink-2); font-weight: 600; }

/* Profile page layout - form + summary aside */
.tp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
  padding: 4px 24px 16px;
  align-items: start;
}
@media (max-width: 1120px) { .tp-layout { grid-template-columns: 1fr; } .tp-aside { position: static; } }

/* ==================================================================
   MESSAGES FROM CAMPUS (cm-*) — tenant editor destination.
   Reuses cc-, bf-, and tp-prefixed chrome plus the shared cmp-mfc--panel renderer.
   The mfc-* review frame below is a direct token-mapped canon lift.
   ================================================================== */

.cm-layout { grid-template-columns: minmax(0, 1fr) 400px; }
.cm-form { max-width: 760px; }

.cm-conflict-banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 24px 14px; padding: 11px 14px;
  border: 1px solid color-mix(in oklab, var(--th-warn) 35%, var(--th-line));
  border-radius: var(--th-radius-5); background: var(--th-warn-soft);
  color: var(--th-ink-2); font-size: 12.5px; line-height: 1.5;
}
.cm-conflict-banner i { color: var(--th-warn); margin-top: 2px; }

/* One accessible disclosure per message slot. */
.cm-slot { padding: 26px 0; }
.cm-slot-toggle {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; background: transparent; color: inherit;
  font: inherit; cursor: pointer; border-radius: var(--th-radius-3);
}
.cm-slot-toggle:focus-visible {
  outline: 2px solid var(--th-advant); outline-offset: 4px;
}
.cm-section-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
}
.cm-section-head .bf-section-head { margin-bottom: 0; }
.cm-section-head .bf-section-desc { margin-bottom: 0; }
.cm-slot-meta {
  display: flex; align-items: center; gap: 12px; flex: none; margin-top: 3px;
}
.cm-scope-token {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--th-f-mono); font-size: 9.5px; letter-spacing: 0.04em;
  color: var(--th-ink-4); white-space: nowrap;
}
.cm-scope-token .lk { display: inline-flex; color: var(--th-ink-4); }
.cm-slot-chevron {
  color: var(--th-ink-4); font-size: 12px;
  transition: transform 140ms ease;
}
.cm-slot-toggle[aria-expanded="true"] .cm-slot-chevron { transform: rotate(180deg); }
.cm-slot-body { padding: 18px 0 0; }

.cm-slot.is-conflict {
  border-left: 3px solid var(--th-warn);
  padding-left: 15px;
}
.cm-slot-conflict {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid color-mix(in oklab, var(--th-warn) 35%, var(--th-line));
  border-radius: var(--th-radius-3); background: var(--th-warn-soft);
  color: var(--th-ink-2); font-size: 12px; line-height: 1.5;
}
.cm-slot-conflict i { color: var(--th-warn); margin-top: 2px; }

/* State control row. */
.cm-statebar { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; }
.cm-statebar-label {
  font-family: var(--th-f-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--th-ink-4); flex: none;
}
.cm-statebar .bf-seg { flex: 1; max-width: 460px; }
.cm-statebar .bf-seg-opt:disabled { cursor: wait; opacity: 0.65; }

/* Calm inherit / resolved-default box. */
.cm-preview-box {
  border: 1px solid var(--th-line); border-radius: var(--th-radius-5);
  background: var(--th-paper-2); padding: 14px 16px;
}
.cm-preview-box-cap {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px;
  font-family: var(--th-f-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--th-ink-4);
}
.cm-preview-box-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--th-ink-4); }
.cm-default-title {
  font-family: var(--th-f-serif); font-weight: 600; font-size: 17px;
  color: var(--th-ink-2); letter-spacing: -0.01em; margin-bottom: 6px;
}
.cm-default-body { font-size: 13px; color: var(--th-ink-3); line-height: 1.6; }
.cm-default-body p { margin: 0 0 9px; }
.cm-default-body p:last-child { margin-bottom: 0; }
.cm-default-body h1,
.cm-default-body h2,
.cm-default-body h3,
.cm-default-body h4,
.cm-default-body h5,
.cm-default-body h6 {
  font-family: var(--th-f-serif); font-weight: 600; font-size: 13px;
  color: var(--th-ink-2); margin: 14px 0 5px;
}
.cm-default-body ul, .cm-default-body ol { margin: 0 0 9px; padding-left: 20px; }
.cm-default-body a { color: var(--th-advant-deep); text-decoration: underline; text-underline-offset: 2px; }
.cm-default-body img { display: block; max-width: 100%; height: auto; }

/* Plain Markdown authoring controls — exact 80/4000 limits are in markup. */
.cm-markdown-input {
  width: 100%; min-height: 160px; resize: vertical;
  font-family: var(--th-f-sans); font-size: 13.5px; color: var(--th-ink); line-height: 1.65;
  background: var(--th-paper-sunk); border: 1px solid var(--th-line-2);
  border-radius: var(--th-radius-3); padding: 11px 13px; outline: none;
}
.cm-markdown-input:focus { border-color: var(--th-advant); box-shadow: 0 0 0 3px var(--th-advant-soft); }
.cm-markdown-input::placeholder { color: var(--th-ink-4); }
.cm-markdown-input:disabled { background: var(--th-paper-2); cursor: wait; }
.cm-markdown-hint { margin-top: 6px; font-size: 11px; color: var(--th-ink-3); line-height: 1.5; }
.cm-markdown-hint code {
  font-family: var(--th-f-mono); font-size: 10.5px; color: var(--th-ink-2);
  background: var(--th-paper-2); border: 1px solid var(--th-line);
  border-radius: var(--th-radius-2); padding: 0 4px;
}
.cm-field-error { font-size: 11.5px; color: var(--th-risk); line-height: 1.45; }

.cm-hidden {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 15px; border: 1px dashed var(--th-line-2);
  border-radius: var(--th-radius-3); background: var(--th-paper);
  font-size: 12.5px; color: var(--th-ink-3);
}
.cm-hidden-icon { display: inline-flex; flex: none; color: var(--th-ink-4); }
.cm-view-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-bottom: 11px;
  font-family: var(--th-f-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 9px; border-radius: var(--th-radius-pill);
  border: 1px solid var(--th-line-2); background: var(--th-paper-2); color: var(--th-ink-3);
}
.cm-view-chip.is-custom {
  color: var(--th-marigold-deep);
  border-color: color-mix(in oklab, var(--th-marigold-deep) 30%, var(--th-line-2));
}
.cm-view-chip .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cm-edited {
  display: flex; align-items: center; gap: 7px; margin-top: 11px;
  font-family: var(--th-f-mono); font-size: 10.5px; letter-spacing: 0.02em; color: var(--th-ink-4);
}
.cm-edited .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--th-ink-4); flex: none; }
.cm-edited.is-edited { color: var(--th-ink-3); }
.cm-edited.is-edited .dot { background: var(--th-marigold-deep); }
.cm-live-note {
  display: flex; align-items: center; gap: 8px; padding: 12px 0 4px;
  font-family: var(--th-f-mono); font-size: 10.5px; color: var(--th-ink-3);
}
.cm-live-note .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--th-marigold-deep); }

/* Right-side Compass applicant preview. The shared panel keeps tenant theme tokens light in both
   admin themes; only the surrounding browser frame follows Threshold light/dark chrome. */
.cm-aside { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 13px; }
.cm-preview-cap { display: flex; align-items: center; gap: 8px; }
.cm-preview-cap .t {
  font-family: var(--th-f-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--th-ink-3);
}
.cm-preview-cap .spacer { flex: 1; }
.cm-preview-cap .where {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--th-f-mono); font-size: 9.5px; color: var(--th-ink-4);
}
.cm-preview-cap .where .d { width: 6px; height: 6px; border-radius: 50%; background: var(--th-marigold); }
.cm-preview-where .d { width: 6px; height: 6px; border-radius: 50%; background: var(--cmp-secondary); }
.cm-browser {
  border: 1px solid var(--th-line-2); border-radius: var(--th-radius-8); overflow: hidden;
  background: var(--th-paper-sunk); box-shadow: 0 4px 20px oklch(25% 0.03 60 / 0.10);
}
[data-theme="dark"] .cm-browser { box-shadow: 0 6px 24px oklch(0% 0 0 / 0.4); }
.cm-browser-bar {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  background: var(--th-paper-2); border-bottom: 1px solid var(--th-line);
}
.cm-dots { display: flex; gap: 5px; }
.cm-dots i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--th-line-2); }
.cm-url {
  flex: 1; padding: 4px 12px; border: 1px solid var(--th-line);
  border-radius: var(--th-radius-pill); background: var(--th-paper);
  color: var(--th-ink-3); font-family: var(--th-f-mono); font-size: 10px; text-align: center;
}
.cmp.cm-preview-theme { height: auto; background: var(--cmp-bg-app); }
.cm-preview-stage { min-height: 300px; background: var(--cmp-bg-app); color: var(--cmp-text); }
.cm-preview-identity {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 16px; background: var(--cmp-bg-panel); border-bottom: 1px solid var(--cmp-border);
}
.cm-preview-mark {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: var(--cmp-radius-sm); background: var(--cmp-primary); color: var(--cmp-primary-fg);
  font-family: var(--cmp-font-headline); font-weight: 600; font-size: 15px;
}
.cm-preview-name {
  font-family: var(--cmp-font-headline); font-weight: 600; font-size: 14px;
  line-height: 1.1; color: var(--cmp-text);
}
.cm-preview-tag {
  margin-top: 3px; color: var(--cmp-text-muted);
  font-family: var(--th-f-mono); font-size: 8px; letter-spacing: 0.16em; text-transform: uppercase;
}
.cm-preview-surface { padding: 15px 16px 18px; }
.cm-preview-where {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 13px;
  font-family: var(--th-f-mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--cmp-text-muted);
}
.cm-preview-skeleton { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; opacity: 0.5; }
.cm-preview-skeleton i { display: block; height: 9px; border-radius: var(--cmp-radius-sm); background: var(--cmp-border); }
.cm-preview-skeleton i.w1 { width: 62%; }
.cm-preview-skeleton i.w2 { width: 88%; }
.cm-preview-skeleton i.w3 { width: 74%; }
.cm-preview-stage .cmp { height: auto; background: transparent; }
.cm-preview-stage .cmp .cmp-mfc--panel {
  position: static; max-height: none; overflow: visible;
  padding: 20px 22px 22px; border-radius: 0 var(--cmp-radius-lg) var(--cmp-radius-lg) 0;
}
.cm-preview-hidden {
  padding: 34px 24px; text-align: center;
  border: 1px dashed var(--cmp-border); border-radius: var(--cmp-radius-lg);
  color: var(--cmp-text-muted); background: var(--cmp-bg-panel);
  font-family: var(--cmp-font-headline); font-size: 14px;
}
.cm-preview-foot {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 13px; border: 1px solid var(--th-line); border-radius: var(--th-radius-5);
  background: var(--th-paper-2); color: var(--th-ink-3);
  font-family: var(--th-f-mono); font-size: 9.5px; line-height: 1.5;
}
[data-theme="dark"] .cm-preview-foot { background: var(--th-paper-3); }
.cm-preview-foot .d { width: 7px; height: 7px; border-radius: 50%; background: var(--th-warn); margin-top: 2px; flex: none; }

/* Review-confirm modal — complete tenant-canon commit gate. */
.mfc-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 24px;
  background: oklch(22% 0.02 60 / 0.34);
  backdrop-filter: blur(1.5px);
}
[data-theme="dark"] .mfc-overlay { background: oklch(6% 0.01 60 / 0.58); }
.mfc-modal {
  width: min(468px, 100%);
  background: var(--th-paper-sunk); border: 1px solid var(--th-line-2);
  border-radius: var(--th-radius-8); overflow: hidden;
  box-shadow: 0 24px 60px oklch(20% 0.03 60 / 0.28), 0 4px 12px oklch(20% 0.03 60 / 0.12);
}
.mfc-modal:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 3px; }
[data-theme="dark"] .mfc-modal { box-shadow: 0 24px 60px oklch(0% 0 0 / 0.6); }
.mfc-modal-head { padding: 20px 22px 0; }
.mfc-modal-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 9px;
  font-family: var(--th-f-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--th-marigold-deep);
}
.mfc-modal-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--th-marigold-deep); }
.mfc-modal-title {
  font-family: var(--th-f-serif); font-weight: 500; font-size: 20px;
  letter-spacing: -0.01em; color: var(--th-ink); margin: 0;
}
.mfc-modal-aud { margin-top: 7px; font-size: 12.5px; color: var(--th-ink-3); line-height: 1.5; }
.mfc-modal-aud b { color: var(--th-ink-2); font-weight: 600; }
.mfc-modal-body { padding: 16px 22px 4px; }
.mfc-modal-cap {
  font-family: var(--th-f-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--th-ink-4); margin-bottom: 4px;
}
.mfc-change {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--th-line-soft);
}
.mfc-change:last-child { border-bottom: none; }
.mfc-change .name { font-size: 13px; font-weight: 600; color: var(--th-ink); }
.mfc-change .arrow { color: var(--th-ink-4); margin: 0 2px; }
.mfc-change .state { font-size: 12px; color: var(--th-ink-2); text-align: right; }
.mfc-change .state.is-custom { color: var(--th-marigold-deep); }
.mfc-change .state.is-hidden { color: var(--th-ink-3); font-style: italic; }
.mfc-modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 16px 22px 20px;
}

@media (max-width: 1180px) {
  .cm-layout { grid-template-columns: 1fr; }
  .cm-aside { position: static; }
}

@media (max-width: 680px) {
  .tp-layout.cm-layout { padding-inline: 16px; }
  .cm-conflict-banner { margin-inline: 16px; }
  .cm-section-head { flex-direction: column; gap: 10px; }
  .cm-slot-meta { width: 100%; justify-content: space-between; }
  .cm-scope-token { white-space: normal; }
  .cm-statebar { align-items: stretch; flex-direction: column; }
  .cm-statebar .bf-seg { max-width: none; }
  .cm-statebar .bf-seg-opt { padding-inline: 8px; white-space: normal; }
  .cm-page .tp-savebar { width: calc(100% - 32px); gap: 9px; padding-left: 13px; }
  .cm-page .tp-savebar-text .s { display: none; }
  .mfc-overlay { padding: 16px; }
  .mfc-modal-head, .mfc-modal-body { padding-inline: 18px; }
  .mfc-modal-foot { padding: 14px 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .cm-slot-chevron { transition: none; }
}
