/* Zero Portal — semantic design tokens and the Zero v1 living field.
   The unbranded fallback contract lives in tokens/portal-base.tokens.json,
   generated to /tokens/portal-base.css (linked before this file). Named
   design-system packs override it through scoped /tokens/<pack>.css files.
   This stylesheet binds ONLY the semantic color/elevation/radius
   custom properties that file defines — run `npm run lint:tokens` to
   enforce it, and `npm run build:tokens` after editing the pack source. */

/* Border-box, adopted for real (plan-6f3b3943 Stage 4 round 2, operator-
   signed). History: a universal margin-padding-box-sizing reset sat here
   for a long time but never parsed — the header comment above used to
   contain a token glob whose closing star-slash sequence terminated the
   comment early, and the parser swallowed the rule during error recovery
   (defect 989). The app was therefore built and visually tuned against
   content-box. This flip is box-sizing ONLY — the old margin and padding
   zeroing stays out, since UA default margins are load-bearing today.
   Content-box-dependent dimensions elsewhere in this file were re-tuned
   in the same change. */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--type-family-body);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  background: var(--color-bg-canvas);
}

/* Bare links must participate in the theme instead of falling through to
   browser blue/purple. :where() keeps this contract at zero specificity so
   buttons, cards, navigation, and other component-owned link colors win. */
:where(a[href], a[href]:visited) {
  color: var(--color-text-primary);
  text-decoration-color: var(--color-text-link);
}
:where(a[href]:hover) {
  color: var(--color-text-primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.14em;
}
:where(a[href]:focus-visible) {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Bare <code>/<kbd>/<samp> otherwise fall back to the browser's UA
   monospace default (untouched by the token system, so a pack couldn't
   ever re-skin it). Bind them to the data-voice token so every inline
   code span — doc paths, IDs — reads with the same instrument face,
   overridable per-element by any more specific selector below. */
code, kbd, samp {
  font-family: var(--type-family-mono);
}

/* Zero v1 living field: quieter values from control/design-systems/zero/tokens.json.
   One CSS layer breathes; there is no canvas animation loop. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--field-light);
  animation: zeroFieldBreath 14s ease-in-out infinite;
}
:root[data-theme="dark"] body::before { background: var(--field-dark); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::before { background: var(--field-dark); }
}
@keyframes zeroFieldBreath {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
  50% { transform: translateY(1.5%) scale(1.04); opacity: 1; }
}
:root[data-field-motion="off"] body::before { animation: none; }
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* ---- Legacy constellation canvas (inactive) ---- */
#constellation {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: none;
}

/* ---- Hero (plan-0df49f54 P3 review item c — re-skinned on the token
   system, modernized within the existing landing.js markup/copy) ---- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--compat-space-2);
  position: relative;
  overflow: hidden;
  z-index: 1;
}
/* Static accent light behind the mark. Only the living field breathes.
   Purely decorative (aria-hidden in landing.js). */
.hero-glow {
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 130%;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(closest-side, var(--color-accent-tint-glow) 0%, transparent 70%) 30% 35% / 60% 60% no-repeat,
    radial-gradient(closest-side, var(--color-accent-secondary-tint-strong) 0%, transparent 70%) 72% 55% / 55% 55% no-repeat;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}
.hero-mark {
  font-family: var(--type-family-display);
  font-size: clamp(3.75rem, 9vw, 6.25rem);
  font-weight: var(--type-display-weight);
  letter-spacing: var(--type-display-tracking);
  line-height: 1;
  color: var(--color-text-primary);
}
.hero-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-family: var(--type-family-body);
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--color-text-primary);
}
.hero-lockup .zero-mark {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 0.08em var(--color-accent-tint-glow, transparent));
}
.hero-context {
  font-size: var(--compat-type-78);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--color-text-tertiary);
  margin-bottom: 1.5rem;
}
.hero-tagline {
  margin-top: 1.75rem;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.5;
}
.hero-sub {
  margin-top: 0.65rem;
  font-size: clamp(var(--compat-type-9), 2vw, 1.05rem);
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.hero-cta {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-hint {
  margin-top: 1rem;
  font-size: var(--compat-type-78);
  color: var(--color-text-tertiary);
}
.waitlist-form {
  width: min(100%, 520px);
  margin: 1.4rem auto 0;
  padding: var(--compat-space-1);
  text-align: left;
  background: color-mix(in srgb, var(--color-bg-surface) 88%, transparent);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-2xl);
  box-shadow: var(--elevation-raised);
  backdrop-filter: blur(10px);
}
.waitlist-email-row { display: flex; gap: 0.6rem; align-items: stretch; }
.waitlist-email-row .form-input { flex: 1; min-width: 0; }
.waitlist-email-row .btn { white-space: nowrap; }
.waitlist-consent {
  display: flex; gap: 0.55rem; align-items: flex-start;
  margin-top: 0.8rem; font-size: var(--compat-type-72); line-height: 1.45;
  color: var(--color-text-secondary); text-align: left;
}
.waitlist-consent input { margin-top: 0.15rem; flex: 0 0 auto; }
.waitlist-consent a { color: var(--color-accent-default); }
.waitlist-note { margin-top: 0.65rem; font-size: var(--compat-type-7); color: var(--color-text-tertiary); }
.waitlist-status { min-height: 1.25rem; margin-top: 0.55rem; font-size: var(--compat-type-75); }
.waitlist-status-success { color: var(--color-status-success-fg); }
.waitlist-status-error { color: var(--color-status-danger-fg); }
.waitlist-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-accent-default);
  opacity: 0.7;
  transition: opacity 0.3s, color 0.3s;
  cursor: pointer;
}
.scroll-hint:hover { opacity: 1; color: var(--color-accent-hover); }
.scroll-hint-label {
  font-size: var(--compat-type-82);
  font-weight: 500;
}
.scroll-hint svg {
  width: 24px; height: 24px;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--color-accent-tint-ring));
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow { animation: none; }
  .scroll-hint { animation: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-dark {
  background: var(--color-accent-default);
  color: var(--color-bg-surface);
  padding: 0.8rem var(--compat-space-2);
}
.btn-dark:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--color-accent-tint-glow);
}
.btn-dark .arrow {
  transition: transform 0.2s;
  font-weight: 400;
}
.btn-dark:hover .arrow { transform: translateX(3px); }
.btn-ghost {
  background: var(--color-overlay-white-strong);
  color: var(--color-text-primary);
  padding: 0.8rem var(--compat-space-2);
  border: 1px solid var(--color-border-default);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: var(--color-border-sheen);
  border-color: var(--color-decorative-gray);
}
/* One height per row (operator call, 2026-11-07): the primary shares the
   outline button's size, type and padding and differs by fill only. Hero
   surfaces that want a larger CTA size their own buttons (see entry.css). */
.btn-primary {
  background: var(--color-accent-default);
  color: var(--color-bg-surface);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: var(--compat-type-78);
}
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-outline, .btn-secondary {
  background: var(--color-bg-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-default);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: var(--compat-type-78);
}
.btn-outline:hover { background: var(--color-bg-surface); border-color: var(--color-decorative-gray); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: var(--compat-type-78); }
/* De-emphasized .btn-outline modifier — for controls that are navigation
   rather than the primary action of a header (e.g. the entity page's
   Capabilities/Trust links next to the Customize ▾ composition menu):
   quieter at rest, reads as a normal outline button on hover/focus. */
.btn-quiet { background: transparent; border-color: transparent; color: var(--color-text-tertiary); }
.btn-quiet:hover { background: var(--color-bg-surface); border-color: var(--color-border-default); color: var(--color-text-secondary); }

/* ---- Content sections ---- */
/* Border-box flip: gutters added back to preserve the 600px content column
   (same for .req-wrap and .stub-wrap further down). */
.content { max-width: calc(600px + 3rem); margin: 0 auto; padding: 0 var(--compat-space-1_5); position: relative; z-index: 1; }

/* Properties — floating containers */
.properties { padding: var(--compat-space-4) 0 var(--compat-space-2); }
.prop {
  padding: 1.3rem 1.4rem;
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  background: linear-gradient(180deg, var(--color-bg-surface) 0%, var(--color-bg-surface-raised) 100%);
  border-radius: var(--radius-3xl);
  border-top: 1px solid var(--color-border-sheen);
  box-shadow: var(--elevation-raised);
  backdrop-filter: blur(12px);
  transition: transform 0.25s var(--motion-easing-standard, ease), box-shadow 0.25s var(--motion-easing-standard, ease);
}
.prop:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-card-hover);
}
.prop-title {
  font-size: var(--compat-type-72);
  font-weight: 800;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-accent-default);
  min-width: 130px;
  flex-shrink: 0;
}
.prop-desc {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

/* Steps — floating container */
.steps { padding: var(--compat-space-2) 0 var(--compat-space-1_5); }
.steps-container {
  background: linear-gradient(180deg, var(--color-bg-surface) 0%, var(--color-bg-surface-raised) 100%);
  border-radius: var(--radius-3xl);
  border-top: 1px solid var(--color-border-sheen);
  box-shadow: var(--elevation-raised);
  backdrop-filter: blur(12px);
  padding: 1.4rem;
}
.steps h2 {
  font-size: var(--compat-type-7);
  font-weight: 800;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-text-tertiary);
  margin-bottom: 1.25rem;
}
.step {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.65rem 0;
}
.step-num {
  font-size: var(--compat-type-82);
  font-weight: 800;
  color: var(--color-accent-default);
  min-width: 1.5rem;
}
.step-text {
  font-size: var(--compat-type-9);
  color: var(--color-text-secondary);
  line-height: 1.55;
}
.step-text code {
  background: var(--color-accent-tint-code);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: var(--compat-type-82);
  font-family: var(--type-family-mono);
  color: var(--color-accent-default);
  font-weight: 500;
}

/* ---- Dashboard ---- */
/* Border-box flip: max-width now includes the horizontal page gutters, so
   the 720px content column is preserved by adding them back. Keep in
   lockstep with .header-bar-inner below (nav aligns with page content). */
.dash-wrap { max-width: calc(720px + 2 * var(--space-page-x)); margin: 0 auto; padding: var(--space-page-y-top) var(--space-page-x) var(--space-page-y-bottom); position: relative; z-index: 1; }

/* ---- Context tree (dashboard) ---- */
.context-group { margin-bottom: 0.75rem; }
.context-group:last-child { margin-bottom: 0; }
.context-group-other { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--color-border-subtle); }
.context-org {
  display: flex; align-items: center; gap: 0.4rem;
  padding: var(--compat-space-5) 0.6rem; border-radius: var(--radius-md);
  color: var(--color-text-primary); text-decoration: none; font-size: var(--compat-type-85); font-weight: 500;
  transition: background 0.15s;
}
.context-org:hover { background: var(--color-bg-sunken); }
.context-org-nested { padding-left: var(--compat-space-1_5); font-weight: 400; }
.context-org-name { flex: 1; }
.context-org-signal { display: inline-flex; align-items: center; }
.context-entities {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  padding: 0.2rem 0 0.4rem var(--compat-space-1_5);
}
.context-entity {
  font-size: var(--compat-type-75); color: var(--color-text-tertiary); text-decoration: none;
  padding: 0.15rem var(--compat-space-5); border-radius: var(--radius-sm); border: 1px solid var(--color-border-subtle);
  transition: color 0.15s, border-color 0.15s;
}
.context-entity:hover { color: var(--color-text-primary); border-color: var(--color-decorative-gray); }
.context-meta-child { padding-left: 0.75rem; }

/* ---- Header bar ---- */
/* Chrome (background, border) spans the full viewport; the inner row is
   constrained to the same max-width as `.dash-wrap` so nav + avatar line
   up with the page content below. */
.header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  /* Border-box flip: was 44px content + 1px border-bottom = 45px rendered;
     45px here keeps the rendered bar (and the 44px inner row) unchanged. */
  height: 45px;
  background: var(--color-overlay-cream-strongest);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
}
.header-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  /* Lockstep with .dash-wrap's border-box-adjusted max-width above. */
  max-width: calc(720px + 2 * var(--space-page-x));
  margin: 0 auto;
  padding: 0 var(--space-page-x);
}
@supports (backdrop-filter: blur(12px)) {
  .header-bar { background: var(--color-overlay-cream-strong); }
}

/* Nav — left side */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  font-size: var(--compat-type-82);
  font-weight: 500;
}
.header-nav-home {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--compat-type-82);
  letter-spacing: -0.025em;
  transition: color 0.15s;
}
.header-nav-home .zero-mark {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 3px var(--color-accent-tint-glow, transparent));
}
.header-nav-home:hover { color: var(--color-accent-default); }
.header-nav-sep { color: var(--color-text-tertiary); margin: 0 0.3rem; font-weight: 400; }
.header-nav-link {
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}
.header-nav-link:hover { color: var(--color-accent-default); }
.header-nav-current {
  color: var(--color-text-primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User — right side */
.header-user { position: relative; }
.header-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-text-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: var(--compat-type-7); color: var(--color-bg-surface);
  border: none; cursor: pointer;
  transition: opacity 0.15s;
}
.header-avatar:hover { opacity: 0.8; }

/* Dropdown */
.header-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--color-bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--elevation-overlay);
  border: 1px solid var(--color-border-subtle);
  padding: 0.35rem 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 60;
}
.header-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.header-dropdown-email {
  padding: var(--compat-space-5) 0.85rem;
  font-size: var(--compat-type-75);
  color: var(--color-text-tertiary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-dropdown-sep {
  height: 1px;
  background: var(--color-border-subtle);
  margin: 0.2rem 0;
}
.header-dropdown-item {
  display: block;
  padding: 0.45rem 0.85rem;
  font-size: var(--compat-type-82);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.header-dropdown-item:hover {
  background: var(--color-bg-canvas);
  color: var(--color-text-primary);
}
.header-dropdown-logout { color: var(--color-text-tertiary); }
.header-dropdown-logout:hover { color: var(--color-status-danger-fg); }

/* ---- Panel System (4-tier) ---- */
/* Card sizes: mini, small, medium, large (window) */

/* ---- Panel grid layout ---- */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 var(--space-panel-gap);
}
.panel-grid > div { min-width: 0; }
.panel-grid > div:empty { display: none; }

/* Default: panels span full width unless sized */
.panel-grid .panel:not(.panel-half):not(.panel-mini):not(.panel-small):not(.panel-medium) { grid-column: 1 / -1; }

/* ---- Mini: 2 per row, compact, horizontal scroll for sections ---- */
.panel-mini { min-width: 0; }
.panel-mini .panel-body { padding: 0.3rem 0.75rem var(--compat-space-5); }
.panel-mini .panel-header { padding: 0.4rem 0.75rem; }
.panel-mini .panel-summary h3 { font-size: var(--compat-type-8); }
/* Mini scroll container: horizontal scroll when mini cards are in a section */
.panel-mini-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--compat-space-25);
  margin-bottom: 0.75rem;
}
.panel-mini-row > .panel-mini {
  flex: 0 0 calc(50% - 0.25rem);
  scroll-snap-align: start;
  margin-bottom: 0;
}
.panel-mini-row > .panel-mini:only-child { flex: 0 0 100%; }

/* ---- Small: full row, summary + key action ---- */
.panel-small { grid-column: 1 / -1; }

/* ---- Medium: full row, detailed view ---- */
.panel-medium { grid-column: 1 / -1; }
.panel-medium .panel-body { padding: 0 1.25rem; }
.panel-medium.panel-expanded .panel-body { padding-bottom: 1.25rem; }

/* ---- Half: flows into 2-col grid naturally ---- */
/* Side-by-side half panels rely on `align-items: stretch` to match outer
   heights; flex the inner column so the body fills the stretched container
   instead of leaving a hollow gap below shorter content. */
.panel-grid > div:not(:empty) { display: flex; flex-direction: column; }
.panel-grid > div > .panel { flex: 1; display: flex; flex-direction: column; }
.panel-grid > div > .panel.panel-expanded > .panel-body { flex: 1; }
.panel-half { }

/* ---- Server-backed panel layout slots ---- */
.panel-layout-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.5rem;
}
.panel-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-panel-gap);
}
.panel-layout > [data-panel-layout-width="full"] { grid-column: 1 / -1; }
.panel-layout > [data-panel-layout-width="half"] {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.panel-layout > [data-panel-layout-width="half"] > .panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.panel-layout > [data-panel-layout-width="half"] > .panel.panel-expanded > .panel-body { flex: 1; }
.panel-layout > [data-panel-layout-id]:empty { display: none; }
.panel-layout-hidden { display: none !important; }
.panel-layout-editor {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.panel-layout-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.panel-layout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  /* Border-box flip: was 2.5rem content + 1rem padding + 2px border of
     rendered row height — restated to keep the tuned row size (same in
     .panel-editor-row below). */
  min-height: calc(2.5rem + 1rem + 2px);
  padding: var(--compat-space-5) 0.6rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-bg-canvas);
}
.panel-layout-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.86rem;
}
.panel-layout-row-actions,
.panel-layout-editor-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.panel-layout-status {
  min-width: 5rem;
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-82);
}

@media (max-width: 540px) {
  .panel-grid { grid-template-columns: 1fr; }
  .panel-layout { grid-template-columns: 1fr; }
  .panel-layout > [data-panel-layout-width] { grid-column: 1 / -1; }
  .panel-mini-row > .panel-mini { flex: 0 0 80%; }
}

/* Instrument panel — Cybersyn visual pass (plan-2c7e5c0e
   coordination/cybersyn-visual-spec, move 2 "instrument panels"): flat
   (no elevation/float shadow), a hairline border instead, and a tighter
   "instrument corner" radius (--radius-md — already the pack-personality
   small-radius token, e.g. 0 in swiss/artdeco/bauhaus, 6px in house/japanese,
   2px in nycsubway) so panels read as console modules, not floating cards. */
.panel {
  background: linear-gradient(180deg, var(--color-bg-surface) 0%, var(--color-bg-surface-raised) 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-default);
  padding: 0;
  margin-bottom: var(--space-panel-gap);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-panel-header-y) var(--space-panel-inset-x);
  border-radius: var(--radius-md);
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background 0.15s;
}
.panel[data-panel-id] .panel-header { cursor: pointer; user-select: none; -webkit-user-select: none; }
.panel[data-panel-id] .panel-header:hover { background: var(--color-overlay-black-weak); }
.panel-static .panel-header { cursor: default; }
.panel-static .panel-header:hover { background: none; }

/* Legible ops eyebrow — Cybersyn visual pass (plan-2c7e5c0e
   coordination/cybersyn-visual-spec, move 4): a reusable small title/label
   treatment (tracked, accent, hairline lead) for surfaces that
   have an unlabeled title slot. Reuse this class rather than one-off styling
   a new eyebrow per surface. */
.ops-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--type-family-body);
  font-size: var(--compat-type-7);
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-accent-default);
  margin-bottom: 0.5rem;
}
.ops-eyebrow::before {
  content: '';
  width: 1.6rem;
  height: 1px;
  background: var(--color-accent-default);
  opacity: 0.6;
  flex-shrink: 0;
}

.panel-summary { display: flex; align-items: baseline; flex: 1 1 auto; gap: 0.6rem; min-width: 0; overflow: hidden; }
.panel-summary h3 {
  color: var(--color-text-primary);
  flex: 0 1 auto;
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-hint {
  font-size: var(--compat-type-75); color: var(--color-text-tertiary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--type-family-body); font-variant-numeric: tabular-nums;
}

.panel-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

/* Chevron */
.panel-chevron { transition: transform 0.25s ease; color: var(--color-text-tertiary); flex-shrink: 0; }
.panel-expanded .panel-chevron { transform: rotate(180deg); }

/* Full-page button */
.panel-fp-btn {
  background: none; border: none; color: var(--color-text-tertiary); cursor: pointer;
  padding: 0.2rem; border-radius: var(--radius-sm); display: flex; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.panel-expanded .panel-fp-btn { opacity: 1; pointer-events: auto; }
.panel-fp-btn:hover { color: var(--color-accent-default); background: var(--color-accent-subtle-bg); }

/* Add-new (+) button — visual sibling to the expand (.panel-fp-btn) button */
.panel-add-btn {
  background: none; border: none; color: var(--color-text-tertiary); cursor: pointer;
  padding: 0.2rem; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  font-size: 1rem; line-height: 1; font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.panel-add-btn:hover { color: var(--color-accent-default); background: var(--color-accent-subtle-bg); }

/* Routed full-view link used by entity queue/plans panels. Visually a sibling
   of .panel-fp-btn/.panel-add-btn, but deliberately distinct because it is an
   anchor to a shareable page, not a generic panel overlay trigger. */
.panel-expand-btn {
  background: none; border: none; color: var(--color-text-tertiary); cursor: pointer;
  padding: 0.2rem; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.panel-expand-btn:hover { color: var(--color-accent-default); background: var(--color-accent-subtle-bg); }

/* ---- Composer (shared by plan/decision new-item forms) ---- */
.composer {
  display: flex; flex-direction: column; gap: var(--space-composer-gap);
  padding: var(--space-composer-pad); margin: 0 0 var(--space-composer-margin-bottom);
  background: var(--color-overlay-black-weak);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}
.composer[hidden] { display: none; }

.composer-input,
.composer-textarea {
  font-family: inherit;
  font-size: var(--compat-type-85);
  color: var(--color-text-primary);
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.55rem;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.composer-input:focus,
.composer-textarea:focus {
  outline: none;
  border-color: var(--color-accent-default);
  background: var(--color-bg-surface);
}
.composer-textarea { resize: vertical; min-height: 4.5rem; line-height: 1.45; }

.composer-row {
  display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap;
}
.composer-row .composer-input { flex: 1; min-width: 8rem; }

.composer-checkbox {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: var(--compat-type-78); color: var(--color-text-secondary); cursor: pointer;
  user-select: none;
}
.composer-checkbox input { margin: 0; cursor: pointer; }

.composer-actions {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.composer-status { margin-left: auto; font-size: var(--compat-type-75); }
.composer-status.plan-composer-status-ok,
.composer-status.decision-composer-status-ok { color: var(--color-status-success-fg); opacity: 1; }

.personal-setup-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.personal-activation-page {
  padding: var(--compat-space-1_5) 0;
}
.personal-setup-markers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 0.15rem;
}
.personal-setup-marker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-72);
  font-weight: 500;
}
.personal-setup-marker span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.personal-setup-marker-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 1.25rem;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  color: var(--color-text-tertiary);
  background: var(--color-bg-surface);
  font-size: var(--compat-type-68);
}
.personal-setup-marker-active,
.personal-setup-marker-complete {
  color: var(--color-text-primary);
}
.personal-setup-marker-active .personal-setup-marker-dot {
  color: var(--color-bg-surface);
  border-color: var(--color-accent-default);
  background: var(--color-accent-default);
}
.personal-setup-marker-complete .personal-setup-marker-dot {
  color: var(--color-accent-secondary-default);
  border-color: var(--color-accent-secondary-tint-ring);
  background: var(--color-accent-secondary-tint-medium);
}
.personal-setup-step {
  min-height: 8rem;
}
.personal-setup-error {
  margin: 0.4rem 0 0;
  color: var(--color-status-danger-fg);
  font-size: var(--compat-type-78);
  font-weight: 600;
}
.personal-setup-error[hidden] {
  display: none;
}
.personal-setup-form [aria-invalid="true"] {
  border-color: var(--color-status-danger-fg);
  box-shadow: 0 0 0 1px var(--color-status-danger-ring);
}
.personal-setup-review {
  padding: 0.75rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-overlay-black-weak);
}
.personal-setup-review-list {
  display: grid;
  grid-template-columns: minmax(6rem, 0.35fr) minmax(0, 1fr);
  gap: 0.5rem 0.75rem;
  font-size: var(--compat-type-82);
}
.personal-setup-review-list dt {
  color: var(--color-text-tertiary);
  font-weight: 600;
}
.personal-setup-review-list dd {
  min-width: 0;
  color: var(--color-text-secondary);
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .personal-activation-page { padding-top: 0.75rem; }
  .personal-setup-markers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personal-setup-review-list { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* Inline private toggle (switch) — sits beside other row controls */
.composer-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: var(--compat-type-78); color: var(--color-text-secondary);
  cursor: pointer; user-select: none;
  margin-left: auto;
}
.composer-toggle-label { font-weight: 500; }
.composer-toggle input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.composer-toggle-track {
  position: relative;
  display: inline-block;
  width: 28px; height: 16px;
  background: var(--color-decorative-gray);
  border-radius: var(--radius-full);
  transition: background 0.15s;
  flex-shrink: 0;
}
.composer-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: var(--color-bg-surface);
  border-radius: 50%;
  box-shadow: 0 1px 2px var(--color-overlay-control-shadow);
  transition: transform 0.15s;
}
.composer-toggle input:checked ~ .composer-toggle-track {
  background: var(--color-accent-default);
}
.composer-toggle input:checked ~ .composer-toggle-track .composer-toggle-thumb {
  transform: translateX(12px);
}
.composer-toggle input:focus-visible ~ .composer-toggle-track {
  outline: 2px solid var(--color-accent-default);
  outline-offset: 2px;
}

/* Panel body — animated */
.panel-body {
  padding: 0 var(--space-panel-inset-x);
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.25s ease, opacity 0.2s ease;
}
.panel-collapsed .panel-body {
  max-height: 0 !important;
  padding-top: 0; padding-bottom: 0;
  opacity: 0;
}
.panel-expanded .panel-body {
  padding-bottom: var(--space-panel-body-y);
  opacity: 1;
}
/* Static panels (no id) keep the old padding feel */
.panel-static .panel-body { padding-top: 0; }

/* Page top actions — H-1 replaced the per-view second header with the
   shared header's identity slot; surviving action/return links sit in this
   slim row topping the content instead. */
.page-top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  margin: 0 0 0.75rem;
}
/* Administrative arrivals name the destination within the existing actions row. */
.page-top-actions > .admin-page-title {
  flex: 1 1 12rem;
  min-width: 0;
  margin-right: auto;
}
/* Meta text in the actions row reads from the left; buttons keep the right. */
.page-top-actions .entity-settings-context-meta { margin-right: auto; }
.entity-header-actions,
.capability-builder-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 0 0 auto;
}
.entity-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.panel-desc { color: var(--color-text-secondary); font-size: var(--compat-type-82); margin-bottom: 0.85rem; line-height: 1.5; }

/* ---- Trust console ---- */
/* Border-box flip: gutters added back, same as .dash-wrap (these wide-page
   overrides ride on .dash-wrap's padding). Applies to the matching
   trust/knowledge/artifacts/workspace overrides below too. */
.action-wrap { max-width: calc(1120px + 2 * var(--space-page-x)); }
.action-lens-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.2rem;
  margin: 0;
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-border-default);
  border-bottom: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--color-bg-surface);
  overflow-x: auto;
  scrollbar-width: none;
}
.action-lens-tabs::-webkit-scrollbar { display: none; }
.action-lens-tabs .action-lens-tab {
  flex: 0 0 auto;
  padding: 0.7rem 0.05rem 0.6rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.action-lens-tabs .action-lens-tab:hover {
  border-bottom-color: var(--color-border-default);
  background: transparent;
  color: var(--color-text-primary);
}
.action-lens-tabs .action-lens-tab-active {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-accent-default);
  background: transparent;
}
.action-lens-tabs .action-lens-tab-active:hover { border-bottom-color: var(--color-accent-default); }
/* Board frame — canonical (Stage 4/Cybersyn v2 unified this against
   Knowledge/Artifacts' .knowledge-page-board/.artifacts-page-board below,
   which landed after this one: same border/radius/background/min-height
   now everywhere, and the flush-panel rule below closes the one real gap —
   Action's own decisions lens nests a .panel via decisions-entity-panel.js's
   mount(), which without this rule double-bordered against the board frame
   the same way Knowledge/Artifacts' panel already knew to avoid). */
.action-page-board {
  min-height: 620px;
  border: 1px solid var(--color-border-default);
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border-top-right-radius: 0;
  background: var(--color-bg-surface);
  overflow: hidden;
}
.action-page-board .panel { border: none; border-radius: 0; }
.action-page-board .panel-window-split { min-height: 620px; }
.person-messages-page [hidden] { display: none; }
.trust-wrap { max-width: calc(1120px + 2 * var(--space-page-x)); }
.trust-console {
  display: grid;
  gap: 1rem;
}
.trust-console.is-loading { opacity: 0.72; }
.trust-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.trust-toolbar .panel-desc { margin: 0; }
.trust-toolbar-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.trust-action-status { min-height: 1.2em; }
.trust-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0.5rem;
}
.trust-kpi {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  padding: 0.65rem 0.75rem;
}
.trust-kpi-value {
  display: block;
  color: var(--color-text-primary);
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.1;
}
.trust-kpi-label {
  display: block;
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-68);
  margin-top: 0.25rem;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--type-family-body);
}
.trust-section {
  display: grid;
  gap: 0.5rem;
}
.trust-section h2 {
  color: var(--color-text-secondary);
  font-family: var(--type-family-body);
  font-size: var(--compat-type-82);
  font-weight: 600;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}
.trust-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
}
.trust-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--compat-type-78);
}
.trust-table th {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-tertiary);
  font-size: 0.67rem;
  font-weight: 650;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  font-family: var(--type-family-body);
}
.trust-table td {
  padding: 0.55rem;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  vertical-align: top;
}
.trust-table tr:last-child td { border-bottom: 0; }
.trust-cap-name {
  color: var(--color-text-primary);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.trust-muted {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-7);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.trust-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.trust-action { white-space: nowrap; }
.trust-warn { color: var(--color-status-warning-fg); font-weight: 600; }
.trust-events {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
}
.trust-events li {
  display: grid;
  grid-template-columns: minmax(82px, 0.4fr) minmax(160px, 1fr) minmax(180px, 1.2fr);
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
  align-items: baseline;
}
.trust-events li:last-child { border-bottom: 0; }
.trust-event-time {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-72);
  white-space: nowrap;
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}
.trust-event-main {
  color: var(--color-text-primary);
  font-size: var(--compat-type-78);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.trust-error { color: var(--color-status-danger-fg); }

/* ---- Capability Builder ---- */
.capability-builder-wrap { max-width: 1040px; min-width: 0; }
.capability-builder-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}
.capability-builder-form {
  display: grid;
  gap: 1rem;
}
.capability-builder-section {
  display: grid;
  gap: 0.65rem;
}
.capability-builder-section h2 {
  color: var(--color-text-secondary);
  font-family: var(--type-family-body);
  font-size: var(--compat-type-82);
  font-weight: 600;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}
.capability-builder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.capability-builder-wide { grid-column: 1 / -1; }
.capability-builder-form label {
  display: grid;
  gap: 0.28rem;
  color: var(--color-text-secondary);
  font-size: var(--compat-type-72);
  font-weight: 650;
}
.capability-builder-form input,
.capability-builder-form select,
.capability-builder-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.35;
  padding: 0.58rem 0.65rem;
}
.capability-builder-form textarea {
  resize: vertical;
}
.capability-builder-submit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.capability-builder-submit .panel-desc { margin: 0; }
.capability-catalog-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 0.8rem;
  margin-top: 1.4rem;
}
.capability-catalog-head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}
.capability-catalog-head h2 {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-82);
  font-weight: 650;
  letter-spacing: normal;
  margin: 0;
  text-transform: none;
}
.capability-catalog-content { min-width: 0; max-width: 100%; }
.capability-catalog-table-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.capability-catalog-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}
.capability-catalog-table th,
.capability-catalog-table td {
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  padding: 0.68rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.capability-catalog-table th {
  background: var(--color-bg-sunken);
  color: var(--color-text-tertiary);
  font-weight: 650;
}
.capability-catalog-table tbody tr:last-child td { border-bottom: 0; }
.capability-catalog-table tbody tr.capability-catalog-focused td {
  background: var(--color-accent-tint-weak);
  box-shadow: inset 3px 0 0 var(--color-accent-default);
}
.capability-catalog-name {
  color: var(--color-text-primary);
  font-weight: 650;
}
.capability-catalog-id {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-72);
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
}
.capability-catalog-requires {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}
.capability-catalog-token {
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-72);
  padding: 0.12rem 0.42rem;
  white-space: nowrap;
}
.capability-catalog-actions,
.capability-test-control {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.capability-catalog-actions {
  min-width: 8rem;
}
.capability-test-control .badge {
  margin-top: 0.18rem;
}
.capability-test-result {
  color: var(--color-text-tertiary);
  flex-basis: 100%;
  font-size: var(--compat-type-72);
  line-height: 1.35;
  max-width: 18rem;
  overflow-wrap: anywhere;
}
.capability-test-unavailable {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-72);
  line-height: 1.35;
  max-width: 10rem;
  overflow-wrap: anywhere;
}
.capability-cert {
  display: grid;
  gap: 0.35rem;
  min-width: 12rem;
}
.capability-cert-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}
.capability-cert-metric {
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.12rem 0.38rem;
  white-space: nowrap;
}
.capability-cert-metric span {
  color: var(--color-text-tertiary);
}

@media (max-width: 720px) {
  .trust-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-top-actions,
  .entity-header-actions,
  .capability-builder-actions {
    justify-content: flex-start;
  }
  .capability-builder-grid {
    grid-template-columns: 1fr;
  }
  .capability-catalog-head {
    flex-direction: column;
  }
  .trust-events li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

/* ---- Full-page overlay ---- */
.panel-overlay {
  position: fixed; inset: 0; z-index: 100;
  /* border/margin/color reset: this class also backs a native <dialog>
     (components/share-artifact.js), whose UA stylesheet defaults
     (border: solid, margin: auto, color: CanvasText) would otherwise leak
     through — harmless no-ops on the plain-<div> usages elsewhere. */
  border: none; margin: 0; color: inherit;
  background: var(--color-overlay-scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: flex-start;
  padding: var(--compat-space-2) var(--compat-space-1);
  overflow-y: auto;
  opacity: 0; transition: opacity 0.2s ease;
}
.panel-overlay-open { opacity: 1; }

.panel-overlay-chrome {
  background: var(--color-bg-surface);
  border-radius: var(--radius-3xl);
  box-shadow: var(--elevation-overlay);
  width: 100%; max-width: min(960px, calc(100vw - 3rem));
  min-height: 50vh; max-height: calc(100vh - 4rem);
  overflow-y: auto;
  transform: translateY(12px);
  transition: transform 0.25s ease;
}
.panel-overlay-open .panel-overlay-chrome { transform: translateY(0); }

/* ---- Window mode: full-viewport overlay for board/reader layouts ---- */
.panel-overlay.panel-window { padding: 0.75rem; }
.panel-window .panel-overlay-chrome {
  max-width: calc(100vw - 1.5rem);
  min-height: calc(100vh - 1.5rem);
  max-height: calc(100vh - 1.5rem);
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
}
.panel-window .panel-overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
/* Window body content fills available space */
.panel-window .panel-window-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}
/* Window split layout: sidebar + main (reader/explorer views) */
.panel-window-split {
  display: flex;
  flex: 1;
  min-height: 0;
}
.panel-window-sidebar {
  width: 260px;
  min-width: 200px;
  max-width: 320px;
  border-right: 1px solid var(--color-border-subtle);
  overflow-y: auto;
  padding: var(--compat-space-1) 0;
  flex-shrink: 0;
}
.panel-window-main {
  flex: 1;
  overflow-y: auto;
  padding: var(--compat-space-1_5) var(--compat-space-2);
  min-width: 0;
}
/* Window columns layout: multi-column (kanban/board views) */
.panel-window-columns {
  display: flex;
  flex: 1;
  gap: 0.75rem;
  padding: var(--compat-space-1);
  overflow-x: auto;
  min-height: 0;
}
.panel-window-column {
  flex: 1;
  /* Border-box flip: the 0.75rem side padding (1.5rem total) added back so
     kanban/board columns keep their tuned card width. */
  min-width: calc(240px + 1.5rem);
  max-width: calc(360px + 1.5rem);
  display: flex;
  flex-direction: column;
  background: var(--color-bg-canvas);
  border-radius: var(--radius-xl);
  padding: 0.75rem;
  min-height: 0;
}
.panel-window-column-header {
  font-size: var(--compat-type-78);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  padding: var(--compat-space-25) var(--compat-space-5) var(--compat-space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-window-column-header .count {
  background: var(--color-bg-sunken);
  border-radius: var(--radius-xl);
  padding: 0.1rem var(--compat-space-5);
  font-size: var(--compat-type-72);
  font-weight: 500;
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}
.panel-window-column-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/* Column cards (used in kanban, board views) */
.panel-window-card {
  background: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  box-shadow: var(--elevation-card);
  cursor: default;
  transition: box-shadow 0.15s;
}
.panel-window-card:hover {
  box-shadow: var(--elevation-card-hover);
}

.panel-overlay-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem var(--compat-space-1_5);
  border-bottom: 1px solid var(--color-border-subtle);
  position: sticky; top: 0;
  background: var(--color-bg-surface);
  border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  z-index: 1;
  flex-shrink: 0;
}
.panel-overlay-header h2 { font-size: 1rem; font-weight: 600; }
.panel-close-btn {
  background: none; border: none; font-size: 1.4rem; color: var(--color-text-tertiary);
  cursor: pointer; padding: var(--compat-space-25) var(--compat-space-5); border-radius: var(--radius-md); line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.panel-close-btn:hover { color: var(--color-text-primary); background: var(--color-bg-canvas); }
.panel-overlay-body { padding: var(--compat-space-2) 2.5rem; }

/* Overlay renders markdown content */
.panel-overlay-body h1 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.panel-overlay-body h2 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 0.4rem; }
.panel-overlay-body h3 { font-size: 0.92rem; font-weight: 600; margin: 1rem 0 0.3rem; }
.panel-overlay-body p { font-size: 0.88rem; line-height: 1.6; margin-bottom: 0.6rem; color: var(--color-text-secondary); }
.panel-overlay-body ul, .panel-overlay-body ol { font-size: 0.88rem; padding-left: 1.25rem; margin-bottom: 0.6rem; color: var(--color-text-secondary); }
.panel-overlay-body li { margin-bottom: 0.25rem; line-height: 1.5; }

/* Loading skeleton */
.panel-loading {
  height: 1rem; border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--color-bg-canvas) 25%, var(--color-bg-sunken) 50%, var(--color-bg-canvas) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite; margin-bottom: 0.5rem;
}
.panel-loading:nth-child(2) { width: 80%; }
.panel-loading:nth-child(3) { width: 60%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Top progress bar */
.progress-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: 2px; background: transparent;
  pointer-events: none;
}
.progress-bar::after {
  content: ''; display: block; height: 100%;
  background: var(--color-decorative-gray);
  width: 0%; transition: width 0.3s ease;
}
.progress-bar.loading::after {
  width: 70%;
  transition: width 8s cubic-bezier(0.1, 0.5, 0.3, 1);
}
.progress-bar.done::after {
  width: 100%;
  transition: width 0.2s ease;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.4s 0.2s ease;
}

@media (max-width: 520px) {
  .panel-overlay { padding: 0; }
  .panel-overlay-chrome { max-width: 100%; min-height: 100vh; max-height: 100vh; border-radius: 0; }
  .panel-overlay-header { border-radius: 0; }
  /* Window mode: full bleed on mobile */
  .panel-overlay.panel-window { padding: 0; }
  .panel-window .panel-overlay-chrome { max-width: 100%; min-height: 100vh; max-height: 100vh; border-radius: 0; }
  /* Split becomes stacked on mobile */
  .panel-window-split { flex-direction: column; }
  .panel-window-sidebar { width: 100%; max-width: 100%; max-height: 35vh; border-right: none; border-bottom: 1px solid var(--color-border-subtle); }
  /* Columns scroll horizontally on mobile */
  .panel-window-columns { padding: var(--compat-space-5); gap: 0.5rem; }
  /* The column keeps its own 0.75rem side padding at this breakpoint (the
     0.5rem above is the container's) — border-box flip adds 1.5rem back. */
  .panel-window-column { min-width: calc(280px + 1.5rem); }
}

.code-block {
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: 0.75rem var(--compat-space-1);
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-78);
  color: var(--color-text-primary);
  position: relative;
  cursor: pointer;
  overflow-x: auto;
  white-space: nowrap;
  transition: border-color 0.15s;
}
.code-block:hover { border-color: var(--color-decorative-gray); }
.code-block .copy {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: var(--color-bg-surface); border: 1px solid var(--color-border-default);
  color: var(--color-text-tertiary); padding: 0.15rem 0.45rem;
  border-radius: var(--radius-md); font-size: 0.62rem;
  font-family: inherit; cursor: pointer; font-weight: 500;
}
.code-block .copy:hover { color: var(--color-text-primary); border-color: var(--color-decorative-gray); }

/* Connect page */
.connect-table { width: 100%; border-collapse: collapse; font-size: var(--compat-type-82); }
.connect-table td { padding: 0.4rem 0; vertical-align: top; }
.connect-table .connect-label { color: var(--color-text-tertiary); width: 40%; font-weight: 500; }
.connect-table code { background: var(--color-bg-canvas); padding: 0.15rem 0.4rem; border-radius: var(--radius-sm); font-size: var(--compat-type-78); }

.item-list { list-style: none; }
.item {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--compat-space-5) 0; border-bottom: 1px solid var(--color-border-subtle);
}
.item:last-child { border-bottom: none; }
.item-name { color: var(--color-text-primary); font-size: var(--compat-type-85); }
.item-meta { display: flex; align-items: center; gap: 0.4rem; }
.badge { font-size: var(--compat-type-65); padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); font-weight: 500; }
/* Status-color discipline (plan-6f3b3943 Stage 4 — Cybersyn v2): routine
   states read as calm structure (subtle border, neutral fill, secondary
   text) — no saturated tint. Status color stays reserved for the abnormal
   (badge-critical/badge-blocked/badge-high below, unchanged). */
.badge-ok { background: var(--color-bg-sunken); color: var(--color-text-secondary); border: 1px solid var(--color-border-default); }
.badge-steward { background: var(--color-status-info-bg); color: var(--color-status-info-fg); }
.badge-pending { background: var(--color-bg-sunken); color: var(--color-text-secondary); border: 1px solid var(--color-border-default); }
.badge-muted { background: var(--color-bg-sunken); color: var(--color-text-tertiary); border: 1px solid var(--color-border-default); }
.badge-area { background: var(--color-bg-sunken); color: var(--color-text-secondary); border: 1px solid var(--color-border-default); }
.item-date { color: var(--color-text-tertiary); font-size: var(--compat-type-68); font-family: var(--type-family-mono); font-variant-numeric: tabular-nums; }
.empty { color: var(--color-text-tertiary); font-size: var(--compat-type-85); font-style: italic; padding: 0.4rem 0; }

/* Phase 7 residual audit: personal previews and origin rollups use the same
   shrink/wrap contract. Their source-object title remains primary while the
   compact badge cluster moves as a unit instead of forcing page overflow. */
.personal-preview-row,
.origins-artifact-row {
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-sm);
}
.personal-preview-primary,
.origins-artifact-primary {
  align-items: center;
  display: inline-flex;
  flex: 1 1 14rem;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  min-width: 0;
}
.personal-preview-primary .item-name,
.origins-artifact-primary .item-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.personal-preview-meta {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
  gap: var(--space-2xs);
  margin-left: auto;
}

/* Members panel — per-row mutation controls (steward-only). */
.member-row .member-id { display: inline-flex; align-items: center; gap: 0.4rem; }
.member-controls { display: inline-flex; align-items: center; gap: 0.4rem; }
.member-controls .form-input {
  font-size: var(--compat-type-72);
  padding: 0.2rem 0.4rem;
  height: auto;
  width: auto;
}
.members-action-status { margin-top: 0.6rem; }
.members-action-status:empty { display: none; }
.member-controls .btn[disabled],
.member-controls .form-input[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-danger {
  background: var(--color-status-danger-bg);
  color: var(--color-status-danger-fg);
  border-color: var(--color-status-danger-fg);
}

/* Entity tree */
.org-group { margin-bottom: 1rem; }
.org-group:last-child { margin-bottom: 0; }
.org-header { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0; }
.org-name { font-size: var(--compat-type-9); font-weight: 600; color: var(--color-text-primary); }
.entity-list { list-style: none; padding-left: var(--compat-space-1); border-left: 2px solid var(--color-accent-tint-stronger); margin: 0.25rem 0 0 0.5rem; }
.entity-item { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--color-border-subtle); }
.entity-item:last-child { border-bottom: none; }
.entity-name { font-size: var(--compat-type-82); color: var(--color-text-primary); }
.entity-slug { font-size: var(--compat-type-68); color: var(--color-text-tertiary); font-family: var(--type-family-mono); }
.entity-cmd { font-size: var(--compat-type-65); color: var(--color-accent-default); cursor: pointer; font-family: var(--type-family-mono); opacity: 0.7; transition: opacity 0.15s; }
.entity-cmd:hover { opacity: 1; }

/* ---- Request Access ---- */
.req-wrap { max-width: calc(600px + 3rem); margin: 0 auto; padding: var(--compat-space-2) var(--compat-space-1_5) var(--compat-space-3); position: relative; z-index: 1; }
.request-box {
  background: linear-gradient(180deg, var(--color-bg-surface) 0%, var(--color-bg-surface-raised) 100%);
  border-radius: var(--radius-3xl);
  border-top: 1px solid var(--color-border-sheen);
  box-shadow: var(--elevation-overlay);
  backdrop-filter: blur(12px);
  padding: 1.75rem;
  text-align: center;
}
.request-box h2 { font-size: 1.1rem; font-weight: 700; color: var(--color-text-primary); margin-bottom: 0.5rem; }
.request-box .subtitle { font-size: 0.88rem; color: var(--color-text-secondary); margin-bottom: 1.5rem; line-height: 1.55; }
.form-group { text-align: left; margin-bottom: 1rem; }
.form-label { display: block; font-size: var(--compat-type-75); font-weight: 600; color: var(--color-text-secondary); margin-bottom: 0.3rem; }
.form-input {
  width: 100%; padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border-default); border-radius: var(--radius-lg);
  font-size: var(--compat-type-85); font-family: inherit; color: var(--color-text-primary);
  background: var(--color-bg-canvas); transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--color-accent-default); }
.form-input:read-only { color: var(--color-text-tertiary); cursor: default; }
textarea.form-input { resize: vertical; min-height: 80px; }
.request-sent { color: var(--color-status-success-fg); font-size: var(--compat-type-85); font-weight: 500; }
.request-box .waitlist-consent { margin-bottom: 0.75rem; }
.request-box .waitlist-note { margin-bottom: 0.85rem; text-align: left; }

.error-banner {
  text-align: center; color: var(--color-status-danger-fg); background: var(--color-status-danger-bg);
  border: 1px solid var(--color-status-danger-border); border-radius: var(--radius-3xl);
  padding: 0.65rem var(--compat-space-1); font-size: var(--compat-type-82); margin-bottom: 1rem;
}

/* ---- Onboarding steps ---- */
.onboard-steps { display: flex; flex-direction: column; gap: 0.25rem; }
.onboard-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.onboard-step:last-child { border-bottom: none; }
.step-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--compat-type-72); font-weight: 700;
  flex-shrink: 0;
}
.step-check.done { background: var(--color-status-success-bg); color: var(--color-status-success-fg); font-size: var(--compat-type-82); }
.step-check.pending { background: var(--color-bg-sunken); color: var(--color-text-tertiary); }
.onboard-step-content { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.onboard-step-label { font-size: var(--compat-type-85); font-weight: 500; color: var(--color-text-primary); }
.onboard-step.done .onboard-step-label { color: var(--color-text-secondary); }
.onboard-step-detail { font-size: var(--compat-type-75); color: var(--color-text-tertiary); }

/* ---- Invitation banner ---- */
.invite-banner {
  background: linear-gradient(135deg, var(--color-status-info-tint) 0%, var(--color-accent-secondary-tint-weak) 100%);
  border: 1px solid var(--color-status-info-border);
  border-radius: var(--radius-3xl);
  padding: var(--compat-space-1) 1.25rem;
  margin-bottom: 0.75rem;
}
.invite-banner h3 { font-size: 0.88rem; font-weight: 600; color: var(--color-status-info-fg); margin-bottom: 0.35rem; }
.invite-entity { font-size: var(--compat-type-85); color: var(--color-text-primary); font-weight: 500; }
.invite-actions { display: flex; gap: 0.5rem; margin-top: 0.65rem; }

.auth-status-banner {
  margin: 0 auto;
  max-width: 600px;
  padding: 0 var(--compat-space-1_5);
  position: relative;
  z-index: 4;
}
.auth-status-panel { border-left: 3px solid var(--color-status-danger-fg); }
.auth-status-panel[data-tone="warning"] { border-left-color: var(--color-status-warning-fg); }
.auth-status-panel[data-tone="info"] { border-left-color: var(--color-status-info-fg); }

/* ---- Identity-linking banner ---- */
.link-banner {
  background: var(--color-overlay-stone);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-3xl);
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.75rem;
}
.link-banner h3 { font-size: var(--compat-type-85); font-weight: 600; color: var(--color-text-primary); margin-bottom: 0.2rem; }
.link-banner p { font-size: var(--compat-type-78); color: var(--color-text-tertiary); margin-bottom: 0.5rem; }
.link-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ---- Entity view ---- */
.entity-doc { font-size: var(--compat-type-85); line-height: 1.6; color: var(--color-text-secondary); }
.entity-doc .md-h1 {
  font-size: 0.95rem; font-weight: 700; color: var(--color-text-primary);
  margin: 1.25rem 0 0.5rem; padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.entity-doc .md-h1:first-child { margin-top: 0; }
.entity-doc .md-h2 {
  font-size: 0.88rem; font-weight: 600; color: var(--color-text-primary);
  margin: 1.1rem 0 0.4rem; letter-spacing: 0.01em;
}
.entity-doc .md-h3, .entity-doc .md-h4 {
  font-size: var(--compat-type-82); font-weight: 600; color: var(--color-text-secondary);
  margin: 0.85rem 0 0.3rem;
}
.entity-doc .md-p { margin-bottom: 0.45rem; }
.entity-doc .md-ul {
  list-style: none; margin: 0.3rem 0 0.5rem; padding: 0;
}
.entity-doc .md-li {
  margin-left: 1rem; margin-bottom: 0.3rem;
  padding-left: var(--compat-space-25); position: relative;
}
.entity-doc .md-li::before {
  content: ''; position: absolute; left: -0.55rem; top: 0.55em;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--color-border-default);
}
.entity-doc .md-li strong:first-child {
  color: var(--color-text-primary); font-size: 0.84rem;
}
.entity-doc .md-bq {
  border-left: 3px solid var(--color-border-default);
  padding: 0.4rem 0.75rem;
  color: var(--color-text-tertiary); font-size: var(--compat-type-8);
  margin: 0.5rem 0; background: var(--color-overlay-black-weak);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.entity-doc .md-code {
  background: var(--color-overlay-black-strongest);
  padding: 0.1rem 0.35rem; border-radius: var(--radius-sm);
  font-size: var(--compat-type-78); font-family: var(--type-family-mono);
  color: var(--color-text-primary);
}
.entity-doc strong { color: var(--color-text-primary); }
.entity-doc .md-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--compat-type-8); margin: 0.5rem 0 0.75rem;
}
.entity-doc .md-table th {
  text-align: left; font-weight: 600; color: var(--color-text-primary);
  padding: 0.4rem 0.6rem; border-bottom: 2px solid var(--color-border-default);
  font-size: var(--compat-type-75); text-transform: none; letter-spacing: normal;
}
.entity-doc .md-table td {
  padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary); vertical-align: top;
}
.entity-doc .md-table tr:last-child td { border-bottom: none; }
.entity-doc .md-table tbody tr:hover { background: var(--color-overlay-black-weak); }

/* ---- Felt L1 (Stage 3 infodesign build — foreground the felt plane) ----
 * Generous whitespace + a plain top-level block (no card chrome, no
 * collapse) is the point: this is the page's primary element, not one
 * more panel among panels. Calm by construction — status color stays
 * reserved for the abnormal; the "Needs you" list is neutral/mono,
 * not chip-colored. */
.felt-l1 {
  padding: var(--compat-space-1_5) 0 var(--compat-space-2);
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.felt-l1-empty-copy { font-size: var(--compat-type-9); color: var(--color-text-secondary); margin-bottom: 0.3rem; }
.felt-l1-doc { font-size: 0.92rem; }
.felt-l1-doc.entity-doc .md-h1:first-child { margin-top: 0; }

/* Stage 3 living-object goal (plan-2c7e5c0e): the focus is the page's primary
 * statement of purpose — a calm heading + gist, not a bullet. Ma spacing +
 * Swiss order: one confident line, room to breathe, gist receding to secondary. */
.felt-l1-purpose,
.felt-l1-goal { max-width: 62ch; }
.felt-l1-purpose { margin-bottom: 1.05rem; }
.felt-l1-purpose-title {
  font-size: 1.15rem; font-weight: 600; line-height: 1.3;
  color: var(--color-text-primary); margin: 0;
}
.felt-l1-focus {
  font-size: 1.35rem; font-weight: 600; line-height: 1.25;
  color: var(--color-text-primary); margin: 0; letter-spacing: 0;
}
.felt-l1-gist {
  font-size: 0.95rem; line-height: 1.55; color: var(--color-text-secondary);
  margin: 0.5rem 0 0;
}
.felt-l1-goal .felt-l1-doc.entity-doc > :first-child { margin-top: 0; }

.felt-l1-attention { margin-top: 1.1rem; }
.felt-l1-attention-title {
  font-size: var(--compat-type-68); font-weight: 600; text-transform: none;
  letter-spacing: normal; color: var(--color-text-tertiary);
  margin: 0 0 0.4rem; font-family: var(--type-family-body);
}
.felt-l1-attention-list { list-style: none; margin: 0; padding: 0; }
.felt-l1-attention-item {
  font-size: var(--compat-type-82); color: var(--color-text-secondary);
  padding: var(--compat-space-25) 0; border-top: 1px solid var(--color-border-subtle);
}
.felt-l1-attention-item:first-child { border-top: none; }
.felt-l1-attention-more { margin-top: 0.15rem; }
.felt-l1-attention-more-summary {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  cursor: pointer;
  color: var(--color-text-link);
  font-size: var(--compat-type-78);
}
.felt-l1-attention-more[open] .felt-l1-attention-more-summary { margin-bottom: 0.1rem; }
.felt-l1-attention-overflow { padding-left: 0.65rem; }

/* Personal-dashboard Compass: identity is context, while purpose, current
   focus, steering, and attention retain distinct information roles. The
   entity view uses the compact rules below and keeps its existing flow. */
.felt-l1-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.felt-l1-header .ops-eyebrow { margin-bottom: 0; }
/* Ordinary section labels belong to the legible plane, not instrument data.
   Keep this scoped to the existing felt-L1 sections while the wider heading
   policy is reconciled separately. */
.felt-l1 .ops-eyebrow {
  margin-top: 0;
  font-family: var(--type-family-body);
  font-size: var(--type-body-size);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-primary);
}
.felt-l1-context {
  min-width: 0;
  max-width: 65%;
  margin: 0;
  overflow: hidden;
  color: var(--color-text-tertiary);
  font-family: var(--type-family-body);
  font-size: var(--compat-type-72);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.felt-l1-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding-top: var(--compat-space-1);
}
.felt-l1-layout-split {
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.48fr);
}
.felt-l1-primary { min-width: 0; }
.felt-l1-primary .felt-l1-goal { margin-top: 1.2rem; }
.felt-l1-secondary {
  min-width: 0;
  padding-left: 1.25rem;
  border-left: 1px solid var(--color-border-subtle);
}
.felt-l1-secondary .felt-l1-attention { margin-top: 0; }

@media (max-width: 700px) {
  .felt-l1-header { align-items: flex-start; }
  .felt-l1-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
  .felt-l1-secondary {
    padding-top: var(--compat-space-1);
    padding-left: 0;
    border-top: 1px solid var(--color-border-subtle);
    border-left: 0;
  }
}

/* Sites You Follow (SITE-105). Keep the register scannable on desktop while
   allowing metadata to wrap cleanly instead of forcing horizontal scrolling. */
.sites-following-page {
  width: min(100% - 2rem, 960px);
  margin: 0 auto;
  padding: 2.5rem 0 var(--compat-space-4);
}
.sites-following-header { margin-bottom: 1.5rem; }
.sites-following-header h1 { margin: 0 0 .45rem; }
.sites-following-header p { margin: 0; color: var(--color-text-secondary); }
.sites-following-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.sites-following-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1.25fr) minmax(18rem, 2fr) auto;
  gap: 1rem;
  align-items: center;
  padding: var(--compat-space-1);
  border: 1px solid var(--color-border-default);
  border-radius: 6px;
  background: var(--color-bg-surface);
}
.sites-following-main h2 { margin: 0 0 .3rem; font-size: 1rem; }
.sites-following-main .sites-following-open { border: 0; padding: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.sites-following-publisher { margin: 0; color: var(--color-text-secondary); font-size: var(--compat-type-82); }
.sites-following-publisher span { overflow-wrap: anywhere; }
.sites-following-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin: 0; }
.sites-following-meta div { min-width: 0; }
.sites-following-meta dt { color: var(--color-text-tertiary); font-size: var(--compat-type-7); text-transform: none; letter-spacing: normal; }
.sites-following-meta dd { margin: .2rem 0 0; overflow-wrap: anywhere; font-size: var(--compat-type-82); }
.sites-following-actions { display: flex; align-items: center; gap: .65rem; justify-content: flex-end; }
.sites-following-state { color: var(--color-status-success-fg); font-size: var(--compat-type-75); white-space: nowrap; }
.sites-following-state-stale { color: var(--color-status-warning-fg); }
.sites-following-error, .sites-following-status { margin: 1rem 0; }
.sites-following-status[data-error="true"], .sites-following-error { color: var(--color-status-danger-fg); }
.sites-following-load-more { margin-top: 1rem; }
@media (max-width: 760px) {
  .sites-following-page { width: min(100% - 1.25rem, 600px); padding-top: var(--compat-space-1_5); }
  .sites-following-row { grid-template-columns: 1fr; gap: .8rem; }
  .sites-following-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sites-following-actions { justify-content: space-between; }
}

/* Context pages already own the entity title and primary navigation. Their
   compass is a compact working strip; the personal dashboard keeps the full
   felt-L1 hero above. The meter's 28px interaction height is intentionally
   unchanged so compactness does not shrink its pointer target. */
.felt-l1-compact {
  padding: 0.75rem 0 var(--compat-space-1);
  margin-bottom: 0.25rem;
}
.felt-l1-compact .felt-l1-purpose { margin-bottom: 0.65rem; }
.felt-l1-compact .felt-l1-focus {
  font-size: 1.08rem;
  line-height: 1.25;
}
.felt-l1-compact .felt-l1-gist {
  margin-top: 0.3rem;
  font-size: 0.84rem;
  line-height: 1.4;
}
.felt-l1-gist-details { margin: 0; }
.felt-l1-gist-summary { cursor: pointer; }
.felt-l1-gist-more {
  color: var(--color-text-link);
  white-space: nowrap;
  font-size: var(--compat-type-78);
}
.felt-l1-gist-full { padding-left: 0.65rem; }
.felt-l1-compact .felt-l1-attention { margin-top: 0.7rem; }
.felt-l1-compact .felt-l1-attention-title { margin-bottom: 0.25rem; }
.felt-l1-compact .felt-l1-attention-item {
  padding: 0.18rem 0;
  font-size: var(--compat-type-78);
}

/* ---- Entity act/aware surface (plan-6f3b3943 Stage 1) ----
   Stage 4 (Cybersyn v2) section rhythm: the gap between the canonical
   Compass, Attention flagged, and Active work blocks steps up from 1rem to
   1.5rem so calm reads through space, not just hairlines — spacing INSIDE
   the legible lists (loop rows, triad grid) is unchanged. */
.entity-act-aware {
  display: grid;
  gap: 1.5rem;
  padding: 0.35rem 0 var(--compat-space-1_5);
}
.act-aware-compass { border-top: 0; padding-top: 0; }
.act-aware-compass .home-compass-content {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0;
  border: 0;
}
.act-aware-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
}
.act-aware-work-grid .felt-l1-goal { max-width: none; }
.act-aware-work-grid .ops-eyebrow { margin-top: 0; }
.act-aware-recent-activity { min-width: 0; }
.act-aware-activity-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-size: var(--compat-type-82);
  color: var(--color-text-secondary);
}
.act-aware-pulse-date {
  color: var(--color-text-tertiary);
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}
.act-aware-section {
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--compat-space-1_5);
}
.act-aware-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.act-aware-section h2 {
  font-size: 0.95rem;
  line-height: 1.25;
  margin: 0;
}
.act-aware-loop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.act-aware-loop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--color-border-subtle);
}
.act-aware-loop:first-child { border-top: none; }
.act-aware-loop-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.act-aware-loop-title {
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}
.act-aware-loop-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.act-aware-loop-error .act-aware-loop-title { color: var(--color-status-danger-fg); }
.act-aware-triad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.act-aware-entry {
  display: grid;
  gap: 0.25rem;
  /* Border-box flip: was 5rem content + 1.7rem padding + 2px border of
     rendered height — restated so the triad cards keep their tuned size. */
  min-height: calc(5rem + 1.7rem + 2px);
  padding: 0.85rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  color: inherit;
  text-decoration: none;
}
.act-aware-entry:hover {
  border-color: var(--color-border-strong);
}
.act-aware-entry-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
/* Mono data-voice (Stage 4): counts/meta read as instrument, not prose. */
.act-aware-entry-meta {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-72);
  line-height: 1.45;
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}
.act-aware-assurance {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border-subtle);
  font-size: var(--compat-type-78);
  color: var(--color-text-tertiary);
}

@media (max-width: 720px) {
  .act-aware-work-grid { grid-template-columns: minmax(0, 1fr); }
  .act-aware-compass .home-compass-content { grid-template-columns: minmax(0, 1fr); }
  .act-aware-triad {
    grid-template-columns: 1fr;
  }
  .act-aware-loop {
    align-items: flex-start;
    flex-direction: column;
  }
  .act-aware-loop-actions {
    justify-content: flex-start;
  }
}

.issue-meta { margin-left: 0.4rem; }
/* Abnormal — stays saturated. badge-high also covers non-priority "needs
   attention" states elsewhere (reauth, urgent counts, critical alert
   severity) — see issue-entity-panel.js/plans-entity-panel.js's
   priorityClass()/issue-panel.js, which no longer route routine "high"
   priority through this class (Stage 4 status-color discipline). */
.badge-critical { background: var(--color-status-danger-bg); color: var(--color-status-danger-fg); }
.badge-high { background: var(--color-status-warning-bg); color: var(--color-status-warning-fg); }
.badge-medium { background: var(--color-bg-sunken); color: var(--color-text-secondary); border: 1px solid var(--color-border-default); }

/* ---- Plan detail ---- */
.plan-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--color-decorative-gray); vertical-align: middle; }
.plan-dot-active { background: var(--color-status-success-fg); }
.plan-item-name { margin-left: 0.35rem; }
.plan-item { cursor: pointer; transition: background 0.15s; }
.plan-item:hover { background: var(--color-overlay-black-medium); }
.plan-item.plan-item-active { background: var(--color-overlay-black-weak); }
.panel-desc-faded { opacity: 0.5; }
.person-for-you-wrap .panel-desc-faded { opacity: 1; color: var(--color-text-secondary); }
#entity-settings-object-policies-section .panel-desc-faded { opacity: 1; }
.panel-desc-error { color: var(--color-status-danger-fg); }

.plan-detail { padding: 0.75rem 0 var(--compat-space-5); }
.plan-description { font-size: var(--compat-type-82); color: var(--color-text-secondary); margin-bottom: 0.75rem; line-height: 1.5; }

/* Stage timeline */
.stage-timeline { list-style: none; position: relative; padding-left: 1.25rem; margin: 0.5rem 0; }
.stage-timeline::before {
  content: ''; position: absolute; left: 0.35rem; top: 0.5rem; bottom: 0.5rem;
  width: 2px; background: var(--color-border-default);
}
.stage-item {
  position: relative; padding: 0.4rem 0 var(--compat-space-5); font-size: var(--compat-type-82);
  border-bottom: 1px solid var(--color-border-subtle);
}
.stage-item:last-child { border-bottom: none; }
.stage-item::before {
  content: ''; position: absolute; left: -1.05rem; top: 0.65rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--color-decorative-gray);
}
.stage-item[data-status="active"]::before { background: var(--color-accent-default); }
.stage-item[data-status="done"]::before { background: var(--color-status-success-fg); }
.stage-item[data-status="blocked"]::before { background: var(--color-status-danger-fg); }
.stage-item[data-status="pending"]::before { background: var(--color-decorative-gray); }

.stage-header { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.stage-number { font-size: var(--compat-type-7); color: var(--color-text-tertiary); font-weight: 600; min-width: 1.2rem; }
.stage-title { font-weight: 500; color: var(--color-text-primary); }
.stage-owner { font-size: var(--compat-type-72); color: var(--color-text-tertiary); }
.stage-meta { font-size: var(--compat-type-75); color: var(--color-text-tertiary); margin-top: 0.2rem; line-height: 1.4; }

.badge-active { background: var(--color-bg-sunken); color: var(--color-text-secondary); border: 1px solid var(--color-border-default); }
.badge-done { background: var(--color-bg-sunken); color: var(--color-text-secondary); border: 1px solid var(--color-border-default); }
/* Abnormal — stays saturated (a blocked stage genuinely needs attention). */
.badge-blocked { background: var(--color-status-danger-bg); color: var(--color-status-danger-fg); }
.badge-draft { background: var(--color-bg-sunken); color: var(--color-text-tertiary); border: 1px solid var(--color-border-default); }

/* Progress bar */
.plan-progress { margin: 0.5rem 0 0.25rem; }
.plan-progress-label { font-size: var(--compat-type-72); color: var(--color-text-tertiary); margin-bottom: 0.25rem; font-family: var(--type-family-mono); font-variant-numeric: tabular-nums; }
.plan-progress-bar {
  height: 4px; background: var(--color-border-default); border-radius: var(--radius-xs); overflow: hidden;
}
.plan-progress-fill {
  height: 100%; background: var(--color-status-success-fg); border-radius: var(--radius-xs);
  transition: width 0.3s ease;
}

/* Plan actions */
.plan-actions { margin-top: 0.5rem; }

/* Plans board (window view) */
.plans-board-nav { padding: 0; flex: 0 0 17rem; width: 17rem; }
.plans-board-nav-header {
  font-size: var(--compat-type-72);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  padding: var(--compat-space-1) var(--compat-space-1) var(--compat-space-5);
  font-family: var(--type-family-body);
}
.plans-board-nav-count { font-variant-numeric: tabular-nums; margin-left: 0.25rem; }
.plans-board-list { list-style: none; margin: 0; padding: 0 0 var(--compat-space-5); }
.plans-board-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem var(--compat-space-1);
  cursor: pointer;
  font-size: var(--compat-type-82);
  color: var(--color-text-secondary);
  transition: background 0.15s;
}
.plans-board-nav-item:hover { background: var(--color-overlay-black-medium); }
.plans-board-nav-item.active {
  background: var(--color-accent-subtle-bg);
  color: var(--color-text-primary);
  font-weight: 500;
}
.plans-board-nav-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.plans-board-nav-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 0.25rem; }
.plans-board-nav-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  color: var(--color-text-tertiary);
  font-family: var(--type-family-mono);
  font-size: 0.64rem;
  font-weight: 400;
  text-transform: capitalize;
}
.plans-board-attention {
  color: var(--color-text-secondary);
  font-size: 0.62rem;
  line-height: 1.3;
  max-width: 4.6rem;
  text-align: right;
}
@media (max-width: 520px) {
  .plans-board-nav { flex-basis: auto; width: 100%; }
}
.plans-board-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.plans-board-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}
.plans-board-copy-status {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-72);
}
.plans-board-stages {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.75rem;
}
.plans-board-stage {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-subtle);
  position: relative;
}
.plans-board-stage:last-child { border-bottom: none; }
.plans-board-stage[data-status="done"] { opacity: 0.65; }
.plans-board-stage[data-status="completed"] { opacity: 0.65; }
.stage-number-complete {
  color: var(--color-status-success-fg);
  font-size: var(--compat-type-82);
}
.plans-board-stage-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.plans-board-stage-queue {
  margin-top: 0.5rem;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.plans-board-issue {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--compat-type-78);
  color: var(--color-text-secondary);
}

/* ---- Stub views ---- */
.stub-wrap { max-width: calc(600px + 3rem); margin: 0 auto; padding: var(--compat-space-2) var(--compat-space-1_5) var(--compat-space-3); position: relative; z-index: 1; }
.stub-title { font-size: 1.1rem; font-weight: 700; color: var(--color-text-primary); margin-bottom: 0.5rem; }
.stub-hint { font-size: var(--compat-type-85); color: var(--color-text-tertiary); }

/* Footer */
.footer {
  text-align: center; padding: var(--compat-space-3) 0 var(--compat-space-2);
  color: var(--color-text-tertiary); font-size: var(--compat-type-75);
  position: relative; z-index: 1;
}
.footer a { color: var(--color-text-tertiary); text-decoration: none; transition: color 0.15s; }
.footer a:hover { color: var(--color-accent-default); }
.footer-links { margin-bottom: 0.5rem; }
.footer-links a { margin: 0 0.5rem; }
.footer-sep { margin: 0 0.15rem; color: var(--color-border-default); }

/* Context rename lives in entity settings (S5-L1a): a plain form row. */
.entity-settings-rename {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.entity-settings-rename-input {
  flex: 1 1 14rem;
  min-width: 0;
}
.entity-settings-rename-status {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
}

/* Markdown enhancements */
.md-ol { padding-left: 1.25rem; margin: 0.3rem 0; }
.md-hr { border: none; border-top: 1px solid var(--color-border-subtle); margin: 1rem 0; }

/* ---- Utilities ---- */
.hidden { display: none !important; }
.loading { text-align: center; padding: 5rem 0; color: var(--color-text-tertiary); font-size: 0.88rem; position: relative; z-index: 1; }

/* ---- Knowledge Explorer ---- */

/* Tree — shared between compact panel and overlay sidebar */
.doc-tree-compact { font-size: var(--compat-type-82); }

.doc-tree-folder-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: var(--compat-space-25) 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.15s;
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: var(--compat-type-82);
}
.doc-tree-folder-label:hover { color: var(--color-accent-default); }

.doc-tree-chevron {
  font-size: 0.55rem;
  color: var(--color-text-tertiary);
  width: 0.8rem;
  flex-shrink: 0;
  text-align: center;
  transition: color 0.15s;
}
.doc-tree-folder-label:hover .doc-tree-chevron { color: var(--color-accent-default); }

.doc-tree-folder-name { letter-spacing: 0.01em; }

.doc-tree-children {
  transition: none;
}

.doc-tree-file {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0;
  padding-left: var(--compat-space-1);
  cursor: pointer;
  font-size: var(--compat-type-8);
  color: var(--color-text-secondary);
  transition: color 0.15s, background 0.15s;
  border-radius: var(--radius-sm);
}
.doc-tree-file:hover { color: var(--color-accent-default); background: var(--color-accent-tint-weak); }
.doc-tree-file.doc-tree-active {
  color: var(--color-accent-default);
  background: var(--color-accent-tint-medium);
  font-weight: 500;
}

.doc-tree-file-icon {
  font-size: var(--compat-type-7);
  color: var(--color-text-tertiary);
  width: 0.8rem;
  flex-shrink: 0;
  text-align: center;
}
.doc-tree-file.doc-tree-active .doc-tree-file-icon { color: var(--color-accent-default); }

.doc-tree-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Explorer overlay — split layout */
.doc-explorer-chrome {
  display: flex;
  flex-direction: column;
}

.doc-explorer-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* H-2 (S5-L1b): hideable drawer — the sidebar collapses to a slim rail
   holding only the reveal toggle; the choice persists like theme/density. */
.doc-drawer-toggle {
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--color-text-tertiary);
  cursor: pointer;
  display: block;
  font-size: var(--compat-type-9);
  line-height: 1;
  margin-left: auto;
  padding: var(--compat-space-25) 0.45rem;
}
.doc-drawer-toggle:hover { background: var(--color-bg-sunken); color: var(--color-text-primary); }
.doc-drawer-toggle:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.doc-explorer-sidebar.doc-drawer-hidden {
  min-width: 0;
  width: calc(2.75rem + 1px);
}
.doc-explorer-sidebar {
  /* Border-box flip: the 1rem side padding now counts against these, so
     2rem is added back to preserve the tuned 320px tree width (the 1px
     border-right is ignored as invisible at this scale). */
  width: calc(320px + 2rem);
  min-width: calc(240px + 2rem);
  max-width: calc(360px + 2rem);
  border-right: 1px solid var(--color-border-subtle);
  overflow-y: auto;
  padding: 0;
  flex-shrink: 0;
  background: var(--color-overlay-cream-weak);
}

.doc-explorer-sidebar-head {
  align-items: center;
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  min-height: 3.75rem;
  padding: 0.55rem 0.75rem 0.55rem var(--compat-space-1);
}
.doc-explorer-sidebar-title {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-72);
  font-weight: 650;
  letter-spacing: normal;
  text-transform: none;
}
.doc-drawer-hidden .doc-explorer-sidebar-title { display: none; }
/* The collapsed flow row contains only its reveal control. Keep the control
   usable without retaining the expanded header's empty vertical space. */
.doc-drawer-hidden .doc-explorer-sidebar-head {
  justify-content: center;
  min-height: 2.75rem;
  padding: 0;
}
.doc-drawer-hidden .doc-drawer-toggle {
  margin-left: 0;
  min-height: 2.75rem;
  min-width: 2.75rem;
}
/* Keep keyboard focus visible inside the compact scrolling rail. */
.doc-drawer-hidden .doc-drawer-toggle:focus-visible { outline-offset: -3px; }

.doc-explorer-tree {
  font-size: var(--compat-type-82);
  padding: 0.75rem var(--compat-space-1) var(--compat-space-1);
}

.doc-explorer-viewer {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-width: 0;
  background: var(--color-bg-surface);
}

.knowledge-inline-explorer {
  min-height: min(68vh, 720px);
}
/* Knowledge browsing controls remain reachable when its navigation is hidden. */
.knowledge-browse-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.knowledge-browse-controls [role="group"] { display: flex; gap: var(--space-xs); }
.knowledge-browse-controls button { min-height: 44px; min-width: 44px; }
.knowledge-browse-controls [aria-pressed="true"] { border-color: var(--color-text-secondary); }
.knowledge-inline-explorer > .doc-explorer-sidebar[hidden],
.knowledge-inline-explorer .knowledge-document-list[hidden],
.knowledge-inline-explorer .doc-explorer-tree[hidden] { display: none; }
.knowledge-inline-explorer .knowledge-document-list {
  list-style: none;
  margin: 0;
  padding: var(--space-sm);
}
.knowledge-inline-explorer .knowledge-document-list li + li { margin-top: var(--space-xs); }
.knowledge-inline-explorer .knowledge-document-list button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: var(--space-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.knowledge-inline-explorer .knowledge-document-list button:hover,
.knowledge-inline-explorer .knowledge-document-list [aria-current="page"] { background: var(--color-bg-sunken); }
.knowledge-inline-explorer .knowledge-document-list button:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: -2px; }
.knowledge-inline-explorer .knowledge-document-name { display: block; }
.knowledge-inline-explorer .knowledge-document-path { display: block; color: var(--color-text-secondary); font-size: var(--compat-type-82); }

/* Routed document detail (/e/:id/d/*) reuses the canonical split; give it the
   same page height the inline knowledge explorer gets so the viewer fills. */
.doc-detail-routed {
  min-height: min(72vh, 780px);
  border-top: 1px solid var(--color-border-subtle);
}
.knowledge-filter-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-sm) var(--space-xs);
}
.artifact-filter-toolbar {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-sm) var(--space-xs);
  border-bottom: 1px solid var(--color-border-subtle);
}
.artifact-filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}
.artifact-filter-label {
  color: var(--color-text-tertiary);
  font-size: 0.76rem;
}
.artifact-filter-active > .filter-chip-row {
  margin: var(--space-xs) var(--space-sm) 0;
}
.artifact-library-viewbar {
  align-items: center;
  display: flex;
  gap: var(--space-sm);
  justify-content: space-between;
  padding: var(--space-xs) var(--space-sm);
}
.artifact-library-count {
  color: var(--color-text-tertiary);
  font-size: 0.76rem;
}
.artifact-library-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: flex-end;
}
.artifact-sort-control {
  align-items: center;
  color: var(--color-text-tertiary);
  display: inline-flex;
  font-size: 0.74rem;
  gap: 0.35rem;
}
.artifact-sort-control select {
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font: inherit;
  min-height: 36px;
  padding: 0 var(--space-xs);
}
.artifact-sort-control select:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
}
.artifact-view-toggle {
  align-items: center;
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  display: inline-flex;
  padding: 2px;
}
.artifact-view-option {
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--color-text-tertiary);
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  min-height: 30px;
  padding: 0 var(--space-xs);
}
.artifact-view-option[aria-pressed="true"] {
  background: var(--color-bg-surface-raised);
  box-shadow: var(--elevation-control);
  color: var(--color-text-primary);
}
.artifact-view-option:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
}
.artifact-library-results { padding: 0 var(--space-sm) var(--space-sm); }
.artifact-library-list { margin: 0; padding: 0; }
@media (max-width: 540px) {
  .artifact-library-viewbar { align-items: flex-start; flex-direction: column; }
  .artifact-library-controls { justify-content: space-between; width: 100%; }
  .artifact-sort-control select { min-height: 40px; }
  .artifact-view-option { min-height: 40px; }
}
.knowledge-collection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-bg-canvas);
}
.knowledge-collection-name {
  min-width: 0;
  color: var(--color-text-secondary);
  font-size: var(--compat-type-82);
  overflow-wrap: anywhere;
}
.knowledge-page-board > .filter-chip-row { margin: 0 var(--space-sm) var(--space-sm); }
.knowledge-filter-label {
  color: var(--color-text-tertiary);
  font-size: 0.76rem;
}
.doc-explorer-error,
.doc-explorer-loading {
  padding: var(--compat-space-2) 0;
}

.doc-explorer-doc-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap; /* the .share-surface strip wraps to its own row */
  padding: 0.85rem max(var(--compat-space-2), calc((100% - 980px) / 2));
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-overlay-white-strongest);
  backdrop-filter: blur(10px);
  min-height: 3.75rem;
}

.doc-draft-view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem max(var(--compat-space-2), calc((100% - 980px) / 2));
  border-bottom: 1px solid var(--color-border-default);
  background: var(--color-bg-sunken);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-82);
}

.doc-draft-view-banner div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

.doc-draft-view-banner strong {
  color: var(--color-text-primary);
}

.doc-explorer-doc-path {
  font-size: var(--compat-type-72);
  font-family: var(--type-family-mono);
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}

.doc-explorer-breadcrumb {
  font-size: var(--compat-type-72);
  font-family: var(--type-family-mono);
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
  min-width: 0;
  overflow-wrap: anywhere;
}
.doc-bc-sep { color: var(--color-text-tertiary); margin: 0 0.25rem; opacity: 0.6; }
.doc-bc-link {
  color: var(--color-text-tertiary);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.doc-bc-link:hover {
  color: var(--color-accent-default);
  border-bottom-color: var(--color-accent-default);
}
.doc-bc-current { color: var(--color-text-primary); }

.doc-explorer-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.doc-explorer-actions-main,
.doc-explorer-actions-utilities {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.doc-explorer-actions-utilities {
  border-left: 1px solid var(--color-border-subtle);
  padding-left: 0.4rem;
}
.doc-explorer-actions .panel-copy-url-btn {
  align-items: center;
  border-radius: var(--radius-full);
  display: inline-flex;
  font-weight: 600;
  min-height: 1.9rem;
  padding: 0.35rem 0.75rem;
}
.doc-explorer-doc-header-editing {
  border-bottom-color: var(--color-border-default);
  background: var(--color-bg-surface);
}
.doc-edit-mode-label {
  color: var(--color-text-primary);
  font-size: var(--compat-type-78);
  font-weight: 650;
  letter-spacing: 0.01em;
}
.doc-edit-mode-label::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: var(--space-2xs);
  border-radius: 50%;
  background: var(--color-accent-default);
  vertical-align: 0.05em;
}
.doc-editor-actions-header .doc-editor-status {
  max-width: min(28rem, 50vw);
  overflow-wrap: anywhere;
}

/* Backlinks */
.doc-backlinks {
  margin-top: 1.5rem;
  padding-top: var(--compat-space-1);
  border-top: 1px solid var(--color-border-subtle);
}
.doc-backlinks-header {
  font-size: var(--compat-type-72);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--type-family-body);
}
.doc-backlinks .count {
  background: var(--color-bg-sunken);
  border-radius: var(--radius-xl);
  padding: 0.1rem var(--compat-space-5);
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--compat-type-68);
}
.doc-backlink-item {
  display: block;
  font-size: var(--compat-type-78);
  color: var(--color-accent-secondary-default);
  padding: 0.2rem 0;
  text-decoration: none;
}
.doc-backlink-item:hover { text-decoration: underline; }

/* Frontmatter block — rendered at the top of the doc content when the
   toggle button reveals it. Hidden by default (the `hidden` attribute on
   the element itself does the work; this styles it when visible). */
.doc-frontmatter {
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-subtle);
  border-left: 3px solid var(--color-text-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-family: var(--type-family-mono);
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin: 0 0 1rem;
  overflow-x: auto;
  white-space: pre;
}
.doc-frontmatter code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Markdown extras for explorer */
.doc-explorer-content {
  /* Border-box flip: 4rem side padding added back to preserve the tuned
     980px reading column. */
  max-width: calc(980px + 4rem);
  margin: 0 auto;
  padding: var(--compat-space-1_5) var(--compat-space-2) var(--compat-space-4);
  overflow-wrap: anywhere;
}

.doc-explorer-content.entity-doc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.doc-explorer-content.entity-doc .md-h1 {
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 1.8rem 0 0.75rem;
}

.doc-explorer-content.entity-doc .md-h1:first-child { margin-top: 0; }

.doc-explorer-content.entity-doc .md-h2 {
  font-size: 1.08rem;
  line-height: 1.35;
  margin: 1.7rem 0 0.6rem;
  padding-top: 0.15rem;
}

.doc-explorer-content.entity-doc .md-h3,
.doc-explorer-content.entity-doc .md-h4 {
  font-size: 0.98rem;
  line-height: 1.4;
  margin: 1.2rem 0 0.45rem;
  color: var(--color-text-primary);
}

.doc-explorer-content.entity-doc .md-p {
  margin-bottom: 0.75rem;
  max-width: 78ch;
}

.doc-explorer-content.entity-doc .md-ul,
.doc-explorer-content.entity-doc .md-ol {
  margin: 0.45rem 0 0.9rem;
  max-width: 78ch;
}

.doc-explorer-content.entity-doc .md-li {
  margin-bottom: 0.4rem;
}

.doc-explorer-content.entity-doc .md-bq {
  max-width: 86ch;
  margin: 0.85rem 0 1rem;
  padding: 0.65rem 0.9rem;
  border-left: 3px solid var(--color-border-default);
  background: var(--color-overlay-cream-medium);
  color: var(--color-text-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.doc-explorer-content.entity-doc .md-bq-p {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  line-height: 1.65;
}

.doc-explorer-content.entity-doc .md-bq-p:last-child { margin-bottom: 0; }

.doc-explorer-content.entity-doc .md-bq strong { color: var(--color-text-primary); }

.doc-explorer-content.entity-doc .md-bq-spacer { height: 0.5rem; }

.doc-explorer-content.entity-doc .md-table {
  min-width: 100%;
  width: max-content;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
}
.entity-doc .md-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.entity-doc .md-table-scroll:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.doc-explorer-content.entity-doc .md-table :is(th, td) {
  min-width: 8rem;
}

.doc-explorer-content .code-block,
.doc-explorer-content .md-codeblock {
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: 0.75rem var(--compat-space-1);
  font-family: var(--type-family-mono);
  font-size: 0.76rem;
  overflow-x: auto;
  margin: 0.5rem 0 0.75rem;
  line-height: 1.5;
  white-space: pre;
}
.doc-explorer-content .md-codeblock code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: var(--color-text-primary);
}

.doc-source-view { width: 100%; }
.doc-source-label {
  color: var(--color-text-tertiary);
  font-family: var(--type-family-body);
  font-size: var(--compat-type-68);
  font-weight: 600;
  letter-spacing: normal;
  margin-bottom: 0.35rem;
  text-transform: none;
}
.doc-source-status {
  color: var(--color-status-warning-fg);
  font-size: var(--compat-type-78);
  margin: 0 0 0.4rem;
}
.doc-explorer-content .doc-source-code {
  cursor: text;
  max-width: 100%;
  tab-size: 2;
  white-space: pre;
}
.doc-source-code .syntax-key,
.doc-source-code .syntax-tag { color: var(--color-accent-default); }
.doc-source-code .syntax-string { color: var(--color-status-success-fg); }
.doc-source-code .syntax-number { color: var(--color-accent-tertiary-default); }
.doc-source-code .syntax-literal,
.doc-source-code .syntax-meta { color: var(--color-status-warning-fg); }
.doc-source-code .syntax-punctuation { color: var(--color-text-secondary); }
.doc-source-code .syntax-comment { color: var(--color-text-tertiary); }

.doc-explorer-content .md-hr {
  border: none;
  border-top: 1px solid var(--color-border-subtle);
  margin: 1.5rem 0;
}

.doc-explorer-link {
  color: var(--color-accent-secondary-default);
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent-secondary-tint-strong);
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.doc-explorer-link:hover {
  color: var(--color-accent-secondary-hover);
  border-color: var(--color-accent-secondary-hover);
}

/* Override overlay chrome for explorer to use full height with split */
/* panel-window handles chrome sizing; just hide unused overlay body */
.doc-explorer-overlay .panel-overlay-body { display: none; }

@media (max-width: 520px) {
  .doc-explorer-split { flex-direction: column; }
  .doc-explorer-sidebar {
    width: 100%;
    max-width: none;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--color-border-subtle);
    max-height: 40vh;
    overflow-y: auto;
  }
  .doc-explorer-sidebar.doc-drawer-hidden { width: 100%; }
  .doc-drawer-hidden .doc-explorer-sidebar-head { justify-content: flex-end; padding: 0; }
  .doc-explorer-doc-header {
    position: static;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem var(--compat-space-1);
  }
  .doc-explorer-doc-header-editing {
    position: sticky;
    top: 0;
  }
  .doc-editor-actions-header .doc-editor-status {
    max-width: 100%;
  }
  .doc-draft-view-banner {
    align-items: flex-start;
    padding: 0.75rem var(--compat-space-1);
  }
  .doc-explorer-actions,
  .doc-explorer-actions-main,
  .doc-explorer-actions-utilities { justify-content: flex-start; }
  .doc-explorer-actions-utilities {
    border-left: 0;
    border-top: 1px solid var(--color-border-subtle);
    padding-left: 0;
    padding-top: 0.4rem;
    width: 100%;
  }
  .doc-explorer-content { padding: var(--compat-space-1) var(--compat-space-1) var(--compat-space-3); }
  .hero-mark { font-size: 3rem; }
  .hero-cta { flex-direction: column; }
  .prop { flex-direction: column; gap: 0.3rem; }
  .prop-title { min-width: 0; }
}

/* ---- Queue panel ---- */
.issue-filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding-bottom: var(--compat-space-5);
  border-bottom: 1px solid var(--color-border-subtle);
}

/* Attribution chips — plan-6bd0aa02 Stage 6b */
.attribution-chips {
  margin-bottom: 0.75rem;
  padding-bottom: var(--compat-space-5);
  border-bottom: 1px solid var(--color-border-subtle);
}

/* Queue item expansion */
.issue {
  align-items: stretch;
  border-bottom: 0;
  border-radius: var(--radius-sm);
  flex-direction: column;
  margin: 0.15rem 0;
  padding-inline: 0.5rem;
}
.issue:hover { background: var(--color-bg-sunken); }
.issue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.issue-expanded {
  background: var(--color-overlay-black-weak);
  margin: 0 -0.5rem;
  padding-left: var(--compat-space-5);
  padding-right: var(--compat-space-5);
  border-radius: var(--radius-lg);
}

/* Queue detail panel */
.issue-detail {
  padding: 0.6rem 0 var(--compat-space-25);
}
.issue-detail-desc {
  font-size: var(--compat-type-82);
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin-bottom: 0.6rem;
  white-space: pre-wrap;
}
.issue-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}
.issue-detail-field {
  font-size: var(--compat-type-78);
  color: var(--color-text-secondary);
}
.issue-detail-field strong {
  color: var(--color-text-tertiary);
  font-weight: 500;
  margin-right: 0.3rem;
}

/* Queue actions */
.issue-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: var(--compat-space-5);
  border-top: 1px solid var(--color-border-subtle);
}
.issue-action-resolve {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.issue-action-movement {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.issue-movement-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.issue-note-input {
  flex: 1;
  padding: 0.35rem 0.6rem;
  font-size: var(--compat-type-78);
}
.issue-action-approval {
  display: flex;
  gap: 0.4rem;
}

/* ---- Queue kanban ---- */
.issue-header { cursor: pointer; }
.kanban-card { transition: box-shadow 0.15s; }
.kanban-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
}
.kanban-card-header {
  min-width: 0;
  flex: 1;
  cursor: pointer;
}
.kanban-card-title {
  font-size: var(--compat-type-82);
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.4;
}
.kanban-card-badges { display: flex; gap: 0.2rem; flex-shrink: 0; }
.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
  font-size: var(--compat-type-7);
  color: var(--color-text-tertiary);
}
.kanban-card-assigned {
  font-weight: 500;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}
/* Mono data-voice (Stage 4): the card's timestamp is instrument-face, same
   as .item-date elsewhere. */
.kanban-card-age {
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}
.kanban-card-detail[hidden] { display: none; }
.kanban-card-open .kanban-card-detail {
  margin-top: 0.5rem;
  padding-top: var(--compat-space-5);
  border-top: 1px solid var(--color-border-subtle);
}
.btn-approve { background: var(--color-status-success-fg); color: var(--color-bg-surface); }
.btn-approve:hover { background: var(--color-status-success-hover); }
.btn-reject { color: var(--color-status-danger-fg); border-color: var(--color-status-danger-fg); }
.btn-reject:hover { background: var(--color-status-danger-bg); }

/* ---- Usage & Spend panel ---- */
.usage-summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}
.usage-stat {
  display: flex;
  flex-direction: column;
}
.usage-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}
.usage-stat-label {
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--type-family-body);
}
.usage-chart {
  margin: 0.75rem 0;
}
.usage-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
}
.usage-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.usage-bar {
  width: 100%;
  max-width: 28px;
  background: var(--color-accent-default);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}
.usage-bar:hover {
  background: var(--color-accent-bright);
}
.usage-bar-label {
  font-size: 0.6rem;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}
/* Recent rooms use the same flat, wrappable row grammar as Action and Rooms. */
.usage-room-register { margin-top: 1rem; }
.usage-room-register > .ops-eyebrow { margin-bottom: 0.35rem; }
.usage-room-list { margin: 0; padding: 0; }
.usage-room-row {
  justify-content: flex-start;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}
.usage-room-row > .item-name {
  flex: 1 1 12rem;
  text-decoration: none;
}
.usage-room-row > .item-name:hover { color: var(--color-accent-default); }
.usage-room-row > .usage-td-actions {
  margin-left: auto;
  white-space: nowrap;
}
.usage-room-row .usage-td-actions .room-enter-copy {
  opacity: 0;
  transition: opacity 0.15s;
}
.usage-room-row:hover .usage-td-actions .room-enter-copy,
.usage-room-row:focus-within .usage-td-actions .room-enter-copy {
  opacity: 1;
}
@media (hover: none), (pointer: coarse) {
  .usage-room-row .usage-td-actions .room-enter-copy { opacity: 1; }
}
/* Visible at all times in the full-page view. */
.panel-overlay .usage-room-row .usage-td-actions .room-enter-copy {
  opacity: 1;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Resources panel (drive bindings + audit) ---- */
.drive-section { margin-bottom: 1.1rem; }
.drive-section:last-child { margin-bottom: 0; }
.drive-section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem; gap: 0.75rem;
}
.drive-section-title {
  font-size: var(--compat-type-82); font-weight: 600; color: var(--color-text-secondary);
  text-transform: none; letter-spacing: normal;
  font-family: var(--type-family-body);
}
.drive-perm-note { margin-top: 0.5rem; opacity: 0.75; font-size: var(--compat-type-78); }
.drive-perm-note code { background: var(--color-bg-canvas); padding: 0.1rem 0.35rem; border-radius: var(--radius-sm); font-size: var(--compat-type-72); }
.drive-creds-list { list-style: none; padding: 0; margin: 0; }
.drive-creds-list li {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0; border-bottom: 1px solid var(--color-border-subtle); font-size: var(--compat-type-82);
}
.drive-creds-list li:last-child { border-bottom: none; }
.drive-cred-email { font-family: var(--type-family-mono); color: var(--color-text-secondary); }
/* Workspace panel — administrative sections. */
.workspace-domain-section { padding-bottom: 0.4rem; }
.workspace-domain-badge { margin-right: 0.5rem; }
.workspace-domain-verify-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.workspace-account-add { margin-top: 0.75rem; }
.workspace-domain-status-line { margin-top: 0.5rem; }

.workspace-legacy-notice {
  margin-top: 0.75rem; padding: 0.6rem 0.75rem;
  background: var(--color-bg-sunken); border: 1px dashed var(--color-border-default); border-radius: var(--radius-md);
}
.workspace-legacy-notice p { margin: 0; }
.workspace-legacy-drive-list { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.workspace-legacy-drive {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--compat-space-25) 0; gap: 0.5rem;
}
.workspace-legacy-drive-name {
  font-family: var(--type-family-body); font-size: var(--compat-type-82); color: var(--color-text-secondary);
}

.drive-modal-provision {
  padding: 0.6rem 0.75rem; background: var(--color-bg-sunken);
  border: 1px dashed var(--color-border-default); border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.drive-modal-provision p { margin: 0; }
.drive-modal-provision-btn { align-self: flex-start; }

/* ── Personal-tier surfacing (plan-e921cef6 Stage 5b) ───────────────────
 * Personal artifacts authored by the operator under their self-entity,
 * surfaced read-only inside working-entity views. Visual intent: clearly
 * distinguishable as "yours, private" without overpowering canonical. */

.personal-lock {
  display: inline-block;
  font-size: 0.78em;
  margin-right: 0.35em;
  opacity: 0.78;
  vertical-align: baseline;
}

/* Plans panel — personal section divider + personal items */
.plans-personal-divider {
  display: flex; align-items: center; gap: 0.4rem;
  margin: 0.65rem 0 0.35rem;
  padding-top: var(--compat-space-5);
  border-top: 1px dashed var(--color-border-default);
  font-size: var(--compat-type-78); color: var(--color-text-secondary); letter-spacing: 0.02em;
}
.plans-personal-label { font-style: italic; }
.plan-item-personal { background: var(--color-overlay-black-weak); }
.plan-item-personal:hover { background: var(--color-overlay-black-strong); }
.plan-item-personal .plan-item-name { color: var(--color-text-secondary); }

/* Plans-board window — personal divider + nav items */
.plans-board-personal-divider {
  list-style: none;
  padding: 0.55rem 0.75rem 0.3rem;
  margin-top: 0.4rem;
  border-top: 1px dashed var(--color-border-default);
  font-size: 0.74rem; color: var(--color-text-secondary); letter-spacing: 0.02em;
  font-style: italic;
}
.plans-board-nav-personal { background: var(--color-overlay-black-weak); }
.plans-board-nav-personal:hover { background: var(--color-overlay-black-strong); }
.plans-board-nav-personal .plans-board-nav-title { color: var(--color-text-secondary); }

/* Doc-explorer — ~personal/ branch + file accent */
.doc-tree-folder.doc-tree-personal > .doc-tree-folder-label {
  color: var(--color-text-secondary);
  font-style: italic;
}
.doc-tree-folder.doc-tree-personal > .doc-tree-folder-label:hover {
  color: var(--color-accent-default);
}
.doc-tree-file.doc-tree-personal { color: var(--color-text-secondary); }
.doc-tree-file.doc-tree-personal:hover { color: var(--color-accent-default); }

/* Doc-explorer header for an open personal doc */
.doc-explorer-doc-header.doc-explorer-doc-personal {
  background: var(--color-overlay-black-weak);
  border-left: 2px dashed var(--color-border-default);
  padding-left: 0.55rem;
}



/* ---- Routed artifact detail (plan / decision / sensing / task / stage) ---- */
.artifact-detail-page {
  max-width: calc(920px + 2 * var(--space-page-x));
}
.artifact-detail-content { min-height: 18rem; }
.artifact-detail-content > .read-skeleton { padding: var(--compat-space-2) 0; }

.artifact-viewer {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--compat-space-1_5) 0;
}

.artifact-viewer-header {
  margin-bottom: 1.5rem;
  padding-bottom: var(--compat-space-1);
  border-bottom: 1px solid var(--color-border-subtle);
}

.artifact-viewer-title-row > h1 {
  font-size: 1.5em;
  margin: 0;
}

.artifact-viewer-title-row {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.artifact-viewer-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.plan-lifecycle-menu { position: relative; }
.plan-lifecycle-form {
  position: absolute;
  inset-inline-end: 0;
  z-index: 20;
  width: min(20rem, calc(100vw - 2rem));
  padding: var(--space-sm);
  display: grid;
  gap: var(--space-xs);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
}
.plan-lifecycle-form label:not([hidden]) { display: grid; gap: var(--space-2xs); }
.plan-lifecycle-form [hidden] { display: none; }
.plan-lifecycle-form .form-input { width: 100%; }

.artifact-detail-copy-status {
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.artifact-viewer-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: var(--compat-type-78);
  color: var(--color-text-tertiary);
  margin-top: 0.55rem;
}

.artifact-viewer-meta code {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
}

.artifact-viewer-body {
  margin-bottom: 1.5rem;
}

.artifact-viewer-section {
  margin-top: 1.5rem;
}

.artifact-viewer-section > h2,
.artifact-viewer-section h3 {
  font-size: var(--compat-type-85);
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  margin: 0 0 0.75rem 0;
}

/* Inline artifact ID links (auto-linkified in artifact-viewer bodies). */
.artifact-link {
  color: var(--color-accent-secondary-default);
  text-decoration: none;
  font-family: var(--type-family-mono);
  font-size: 0.94em;
}
.artifact-link:hover { text-decoration: underline; }
.artifact-link[data-artifact-id^="Q-"] { color: var(--color-accent-default); }
.artifact-link[data-artifact-id^="dec-"] { color: var(--color-accent-tertiary-default); }
.artifact-link[data-artifact-id^="int-"] { color: var(--color-text-secondary); }

/* Clickable stage titles in plan-viewer + enriched plan-card links. */
.stage-title-link {
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 500;
}
.stage-title-link:hover { color: var(--color-accent-secondary-default); text-decoration: underline; }

.artifact-link-enriched {
  font-family: inherit;
  font-size: inherit;
}
.artifact-link-status {
  font-size: 0.72em;
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-md);
  margin-left: 0.25rem;
  background: var(--color-bg-sunken);
  color: var(--color-text-tertiary);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.artifact-link-status[data-status="active"] { color: var(--color-accent-default); background: var(--color-accent-tint-medium); }
.artifact-link-status[data-status="completed"],
.artifact-link-status[data-status="done"] { color: var(--color-status-success-fg); background: var(--color-status-success-tint); }
.artifact-link-status[data-status="abandoned"] { color: var(--color-text-tertiary); }
.artifact-link-status[data-status="draft"] { color: var(--color-text-secondary); }
.artifact-link-status[data-status="app"] { color: var(--color-accent-secondary-default); background: var(--color-status-cyan-tint); }
.artifact-link-status[data-status="projected"] { color: var(--color-status-warning-fg); background: var(--color-status-warning-tint); }

.publications-item.publication-focused {
  border-color: var(--color-accent-secondary-default);
  background: var(--color-accent-tint-weak);
}

.publications-title,
.entity-search-publication-title {
  color: var(--color-text-primary);
  font-family: var(--type-family-body);
  font-size: 0.94em;
}

.publications-description {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  margin-top: 0.25rem;
}
.publications-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

/* Plan notes section in artifact viewer (plan-e099348b Stage 10 Tier 3). */
.plan-notes-section .plan-notes-count {
  background: var(--color-bg-sunken);
  color: var(--color-text-tertiary);
  font-size: 0.7em;
  padding: 0.1rem var(--compat-space-5);
  border-radius: var(--radius-xl);
  margin-left: 0.4rem;
  font-weight: normal;
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}
.plan-notes-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}
.plan-note-item {
  border-top: 1px solid var(--color-border-subtle);
}
.plan-note-item:last-child { border-bottom: 1px solid var(--color-border-subtle); }
.plan-note-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: none;
  border: none;
  padding: 0.55rem 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.plan-note-toggle:hover { background: var(--color-bg-sunken); }
.plan-note-chevron {
  font-size: var(--compat-type-65);
  color: var(--color-text-tertiary);
  width: 0.8rem;
  flex-shrink: 0;
}
.plan-note-path {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-82);
  color: var(--color-text-secondary);
  flex: 1;
}
.plan-note-date {
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
}
.plan-note-content {
  padding: var(--compat-space-5) 1.2rem var(--compat-space-1) 1.2rem;
  border-left: 2px solid var(--color-border-subtle);
  margin-left: 0.4rem;
}

/* Copy URL button in artifact-viewer header chrome. */
.panel-overlay-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.panel-copy-url-btn {
  background: none;
  border: 1px solid var(--color-border-default);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}
.panel-copy-url-btn:hover { background: var(--color-bg-sunken); color: var(--color-text-primary); }
.panel-copy-url-btn-ok {
  background: var(--color-status-success-tint);
  color: var(--color-status-success-fg);
  border-color: var(--color-status-success-fg);
}
.copy-url-fallback {
  flex: 1 1 18rem;
  max-width: 100%;
  min-width: 12rem;
  padding: 0.35rem var(--compat-space-5);
}

/* Description collapse for long artifact bodies (plan-e099348b Stage 10
   follow-up). Applied conditionally based on measured scrollHeight. */
.collapsible-body {
  position: relative;
  max-height: 360px;
  overflow: hidden;
}
.collapsible-body::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 64px;
  background: linear-gradient(to bottom, transparent 0%, var(--color-bg-canvas) 100%);
  pointer-events: none;
}
.collapsible-body.expanded {
  max-height: none;
}
.collapsible-body.expanded::after { display: none; }
.collapsible-toggle {
  display: inline-block;
  background: none;
  border: none;
  color: var(--color-accent-secondary-default);
  cursor: pointer;
  padding: 0.4rem 0;
  font-size: var(--compat-type-82);
  font-family: inherit;
  font-weight: 500;
}
.collapsible-toggle:hover { text-decoration: underline; }

/* Decision backreferences. */
.decision-backrefs-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}
.decision-backref-item {
  padding: 0.4rem 0;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.decision-backref-item:last-child { border-bottom: 1px solid var(--color-border-subtle); }

/* Backreferences section in artifact viewer (replaces V1 decision scan). */
.backref-group { margin-top: 0.75rem; }
.backref-group:first-child { margin-top: 0; }
.backref-group-header {
  font-size: var(--compat-type-72);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--type-family-body);
}
.backref-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.backref-item {
  padding: 0.35rem 0;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.backref-context {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-78);
}

/* Entity dashboard — Settings & integrations fold. Consolidates Members,
   GitHub, Workspace, Usage into a single collapsed group at the bottom. */
.entity-settings-fold {
  margin-top: 1rem;
}
.entity-settings-summary {
  cursor: pointer;
  padding: 0.6rem 0.85rem;
  font-size: var(--compat-type-82);
  color: var(--color-text-secondary);
  letter-spacing: normal;
  text-transform: none;
  font-weight: 600;
  border-top: 1px solid var(--color-border-subtle);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.entity-settings-summary::before {
  content: '\25B6';  /* right-pointing triangle */
  font-size: var(--compat-type-65);
  color: var(--color-text-tertiary);
  transition: transform 0.15s;
}
.entity-settings-fold[open] .entity-settings-summary::before {
  transform: rotate(90deg);
}
.entity-settings-summary:hover { color: var(--color-text-primary); background: var(--color-bg-sunken); }
.entity-settings-fold > .panel-grid,
.entity-settings-fold > div[id^="entity-"] {
  margin-top: 0.75rem;
}

/* Plan cards (multi-row item layout) — replaces single-line plan list rows. */
.plan-card.item {
  display: block;
  padding: 0.65rem var(--compat-space-5);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.plan-card.item:hover { background: var(--color-bg-sunken); }
.plan-card-primary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.plan-card-title-text {
  flex: 1;
  font-weight: 500;
}
.plan-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.25rem;
  padding-left: 1.1rem;
  font-size: 0.74rem;
  color: var(--color-text-tertiary);
}
/* Mono data-voice (Stage 4): shared by plan target dates and decision
   dates (renderListItem in both plans-entity-panel.js/decisions-entity-
   panel.js reuse this class) — the instrument face, like .item-date. */
.plan-card-target {
  color: var(--color-text-secondary);
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}
.plan-card-spacer { flex: 1; }
.plan-card-open {
  color: var(--color-text-tertiary);
  text-decoration: none;
  padding: 0 0.3rem;
  font-size: var(--compat-type-9);
  border-radius: var(--radius-sm);
}
.plan-card-open:hover { color: var(--color-accent-secondary-default); background: var(--color-bg-canvas); }
.algedonic-mark {
  color: var(--color-status-danger-fg);
  font-weight: 700;
  margin-left: 0.1rem;
}

/* Decision-specific tweaks layered over .plan-card. */
.decision-superseded-hint {
  font-size: var(--compat-type-7);
  color: var(--color-text-tertiary);
  letter-spacing: normal;
  text-transform: none;
  font-family: var(--type-family-body);
}
.decision-item-superseded .plan-card-title-text {
  color: var(--color-text-tertiary);
  text-decoration: line-through;
}

/* Queue item header — open-link aligned to the right of the timestamp. */
.issue-header-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Plan card — stage progress mini bar in the meta row. */
.plan-card-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.plan-card-progress-bar {
  display: inline-block;
  width: 64px;
  height: 4px;
  background: var(--color-bg-sunken);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.plan-card-progress-fill {
  display: block;
  height: 100%;
  background: var(--color-status-success-fg);
  transition: width 0.2s;
}
.plan-card-progress-label {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-tertiary);
}

/* Decision-panel timeline groups. */
.decision-group + .decision-group {
  margin-top: 1rem;
}
.decision-group-header {
  font-size: var(--compat-type-7);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  padding: 0.35rem 0 0.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.decision-group-count {
  background: var(--color-bg-sunken);
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-65);
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}

/* Entity dashboard search — top-of-page input + dropdown results. */
.entity-search {
  margin: 0.5rem 0 1rem 0;
  position: relative;
}
.entity-search-input {
  width: 100%;
  padding: 0.55rem 0.9rem;
  font-size: var(--compat-type-85);
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: inherit;
}
.entity-search-input:focus {
  outline: none;
  border-color: var(--color-accent-secondary-default);
  background: var(--color-bg-canvas);
}
.entity-search-input::placeholder { color: var(--color-text-tertiary); }
.entity-search-results {
  margin-top: 0.4rem;
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.6rem;
  max-height: 480px;
  overflow-y: auto;
}
.entity-search-summary {
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  padding: 0.2rem 0 0.4rem 0;
  letter-spacing: 0.02em;
}
.entity-search-group {
  margin-top: 0.5rem;
}
.entity-search-group:first-of-type { margin-top: 0; }
.entity-search-group-header {
  font-size: var(--compat-type-7);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.2rem;
  font-family: var(--type-family-body);
}
.entity-search-group-count {
  background: var(--color-bg-sunken);
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-65);
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}
.entity-search-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.entity-search-item {
  padding: 0.3rem 0;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.entity-search-item:first-child { border-top: none; }

/* Doc-tree folder file counts. */
.doc-tree-folder-count {
  margin-left: 0.4rem;
  background: var(--color-bg-sunken);
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-65);
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}

/* Search result term highlighting. */
.search-highlight {
  background: var(--color-overlay-highlight);
  color: inherit;
  padding: 0 1px;
  border-radius: var(--radius-xs);
  font-weight: 600;
}

/* Doc search result snippets — text window around the match. */
.entity-search-item-doc {
  display: block;
  padding: 0.4rem 0;
}
.entity-search-snippet {
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  line-height: 1.4;
  margin-top: 0.15rem;
  padding-left: 0.4rem;
  border-left: 2px solid var(--color-border-subtle);
}

/* Search row — input + scope selector side-by-side. */
.entity-search-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}
.entity-search-row .entity-search-input { flex: 1; }
.entity-search-scope,
.entity-search-type {
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  padding: 0 0.6rem;
  font-family: inherit;
  cursor: pointer;
}
.entity-search-scope:focus,
.entity-search-type:focus { outline: none; border-color: var(--color-accent-secondary-default); }

.entity-search-context {
  margin-left: auto;
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


@media (max-width: 640px) {
  .entity-search-item { flex-wrap: wrap; }
  .entity-search-item > .artifact-link,
  .entity-search-item > .entity-search-publication-title {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .entity-search-item > .entity-search-context {
    display: block;
    flex-basis: 100%;
    margin-left: 0;
    max-width: 100%;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }
}

.entity-search-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.55rem 0 0.15rem;
  border-top: 1px solid var(--color-border-subtle);
  margin-top: 0.5rem;
}
.entity-search-page-label {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-72);
  font-variant-numeric: tabular-nums;
}

/* Keyboard focus indicator for search results (↑/↓ navigation). */
.entity-search-focused {
  background: var(--color-bg-sunken);
  outline: 2px solid var(--color-accent-secondary-default);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* Search recent-queries dropdown. */
.entity-search-history-header {
  font-size: var(--compat-type-7);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  padding: 0.3rem 0.2rem 0.4rem 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.entity-search-history-clear {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-7);
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  letter-spacing: 0;
  text-transform: none;
}
.entity-search-history-clear:hover { color: var(--color-text-secondary); background: var(--color-bg-sunken); }
.entity-search-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.entity-search-history-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--compat-type-82);
  color: var(--color-text-secondary);
}
.entity-search-history-item:hover { background: var(--color-bg-sunken); color: var(--color-text-primary); }
.entity-search-history-glyph {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-85);
}

/* ---- Morning panel — today / updates / interest viewer ----
   Mirrors the .panel chrome pattern — kept in lockstep with the Cybersyn
   instrument-panel treatment (flat, hairline border, var(--radius-md)
   corners; see .panel above) rather than the earlier floating-card look,
   so the morning view reads as the same console-module language as the
   rest of the shell. Layout matches .dash-wrap's 720px column; each
   product is one card. */
.morning-wrap .morning-header {
  margin: 0 0 1.25rem;
}
.morning-wrap .morning-header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 0.2rem;
  letter-spacing: -0.01em;
}
.morning-date {
  color: var(--color-text-secondary);
  font-size: 0.88rem;
  margin: 0;
}
/* Local time + IANA zone label header (plan-681f3312 stage-797cd32c).
   Muted, monospace-leaning so the time reads as data — distinct from the
   prose date line below it. Sits between the page title and the long-form
   date so users can sanity-check what wall-clock the panel rendered
   under. Same chrome reused in the no-personId panel-body fallback. */
.morning-now {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-78);
  margin: 0.05rem 0 0.25rem;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  font-family: var(--type-family-mono);
}
.panel-body > .morning-now {
  margin-bottom: 0.6rem;
}
.morning-section {
  background: linear-gradient(180deg, var(--color-bg-surface) 0%, var(--color-bg-surface-raised) 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-default);
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.morning-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.morning-section-header h2 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
}
.morning-section-link {
  font-size: var(--compat-type-75);
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}
.morning-section-link:hover { color: var(--color-accent-default); }
.morning-section-body {
  padding: var(--compat-space-1) 1.25rem 1.1rem;
  color: var(--color-text-primary);
  font-size: 0.92rem;
  line-height: 1.55;
}
.morning-section-body > :first-child { margin-top: 0; }
.morning-section-body > :last-child { margin-bottom: 0; }

/* ---- Morning panel action affordances (plan-3fceb91e Stage 13B) ---- */
/* Global filter strip (header) */
.morning-filter {
  margin-top: 0.6rem;
  font-size: var(--compat-type-78);
}
.morning-filter summary {
  cursor: pointer;
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
  user-select: none;
  list-style: none;
}
.morning-filter summary::-webkit-details-marker { display: none; }
.morning-filter summary:hover { color: var(--color-accent-default); }
.morning-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.55rem 0.65rem;
  background: var(--color-overlay-white-weak);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-3xl);
}
.morning-filter-action,
.morning-filter-value {
  font: inherit;
  font-size: var(--compat-type-78);
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}
.morning-filter-value { flex: 1 1 12rem; min-width: 10rem; }
.morning-filter-submit {
  font: inherit;
  font-size: var(--compat-type-78);
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--color-accent-default);
  border-radius: var(--radius-sm);
  background: var(--color-accent-default);
  color: var(--color-bg-surface);
  cursor: pointer;
}
.morning-filter-submit:hover { filter: brightness(1.05); }
.morning-filter-status {
  font-size: var(--compat-type-75);
  color: var(--color-text-tertiary);
  font-style: italic;
}

/* Per-item action menu (inline trailing pills) */
.morning-item-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.morning-action-btn {
  font: inherit;
  font-size: var(--compat-type-7);
  padding: 0.15rem var(--compat-space-5);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  line-height: 1.2;
}
.morning-action-btn:hover {
  color: var(--color-accent-default);
  border-color: var(--color-accent-default);
  background: var(--color-accent-subtle-bg);
}
.morning-action-status {
  font-size: var(--compat-type-7);
  color: var(--color-text-tertiary);
  font-style: italic;
  margin-left: 0.25rem;
  align-self: center;
}

/* ---- Sessions list view (plan-2c350829 Stage 2) ---- */
.rooms-wrap { padding-bottom: var(--compat-space-3); }
.rooms-header {
  padding: 1.25rem 0 var(--compat-space-1);
  border-bottom: 1px solid var(--color-border-subtle);
  margin-bottom: 1rem;
}
.rooms-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 0.35rem;
}
.rooms-subtitle {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-82);
  margin: 0;
  line-height: 1.5;
}
.rooms-subtitle em { font-style: normal; color: var(--color-text-secondary); }

.rooms-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.rooms-filters-label {
  font-size: var(--compat-type-7);
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  font-weight: 600;
  font-family: var(--type-family-body);
}
.rooms-filters-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.rooms-filter-chip { font-size: var(--compat-type-72); }
.rooms-filter-count {
  font-size: var(--compat-type-65);
  color: var(--color-text-tertiary);
  background: var(--color-bg-sunken);
  padding: 0 0.35rem;
  border-radius: var(--radius-sm);
  font-family: var(--type-family-mono);
  font-variant-numeric: tabular-nums;
}

.rooms-list { display: flex; flex-direction: column; gap: 1.5rem; }

.rooms-history {
  margin-top: 1rem;
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-tertiary);
}
.rooms-history > summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 0;
  cursor: pointer;
  font-size: var(--compat-type-78);
  font-weight: 600;
}
.rooms-history-body { padding: var(--compat-space-25) 0 var(--compat-space-1); }
.rooms-history .rooms-filters { opacity: 0.82; }

.rooms-group { display: flex; flex-direction: column; gap: 0.5rem; }
.rooms-group-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.rooms-group-entity-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-decoration: none;
}
.rooms-group-entity-link:hover { color: var(--color-accent-default); }
.rooms-group-entity-unattached {
  color: var(--color-text-tertiary);
  font-style: italic;
  cursor: default;
}
.rooms-group-entity-slug {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-7);
  color: var(--color-text-tertiary);
}
.rooms-group-count {
  font-size: var(--compat-type-65);
  color: var(--color-text-tertiary);
  background: var(--color-bg-sunken);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  margin-left: auto;
}

.rooms-row-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.rooms-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.7rem 0;
  border: 0;
  border-bottom: 1px solid var(--color-border-subtle);
  border-radius: 0;
  background: transparent;
  transition: border-color 0.15s, background 0.15s;
}
.rooms-row:hover {
  background: var(--color-overlay-black-weak);
}
.rooms-row:last-child { border-bottom: 0; }
.rooms-row-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.rooms-row-title {
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: var(--compat-type-9);
  font-weight: 600;
}
.rooms-row-title:hover { color: var(--color-accent-default); }
.rooms-row-id {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-75);
  color: var(--color-text-secondary);
  background: var(--color-bg-sunken);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}
.rooms-row-draft-badge {
  white-space: nowrap;
}
.rooms-row-timing {
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  margin-left: auto;
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}
.rooms-row-timing-sep { opacity: 0.5; }
.rooms-row-focus {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--color-text-secondary);
}
.rooms-row-focus-label {
  font-size: 0.62rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  font-weight: 600;
  font-family: var(--type-family-body);
}
.rooms-row-focus-link {
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 600;
}
.rooms-row-focus-link:hover { color: var(--color-accent-default); }
.rooms-row-focus-slug {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-68);
  color: var(--color-text-tertiary);
}
.rooms-row-focus-none {
  color: var(--color-text-tertiary);
  font-style: italic;
}
.rooms-row-summary {
  font-size: var(--compat-type-82);
  color: var(--color-text-secondary);
  line-height: 1.4;
}
.rooms-row-about {
  font-size: var(--compat-type-82);
  color: var(--color-text-primary);
  line-height: 1.4;
}
.rooms-row-summary-muted {
  color: var(--color-text-tertiary);
  font-style: italic;
  font-size: var(--compat-type-78);
}
.rooms-row-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.rooms-row:hover .rooms-row-actions,
.rooms-row:focus-within .rooms-row-actions {
  opacity: 1;
}

/* plan-2c350829 Stage 4 — focused row from ?focus=<sessionId> deep link */
.rooms-row-focused {
  border-color: var(--color-accent-default);
  background: var(--color-accent-tint-weak);
  animation: rooms-row-focus-pulse 1.6s ease-out 1;
}
@keyframes rooms-row-focus-pulse {
  0%   { box-shadow: 0 0 0 0 var(--color-accent-tint-ring); }
  60%  { box-shadow: 0 0 0 6px var(--color-accent-tint-transparent); }
  100% { box-shadow: 0 0 0 0 var(--color-accent-tint-transparent); }
}
.rooms-focus-missing {
  margin: 0 0 0.75rem;
  padding: var(--compat-space-5) 0.75rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle-bg);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-82);
}


/* ---- Session resume copy buttons (plan-2c350829 Stage 3) ---- */
.room-enter-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.room-enter-copy-stacked {
  flex-direction: column;
  align-items: stretch;
}
.room-enter-copy-compact .room-enter-copy-btn {
  font-size: var(--compat-type-7);
  padding: 0.2rem 0.55rem;
}
.room-enter-copy-btn {
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.room-enter-copy-btn.is-copied {
  color: var(--color-status-success-fg);
  border-color: var(--color-status-success-fg);
}
.room-enter-copy-btn.is-copy-failed {
  color: var(--color-status-danger-fg);
  border-color: var(--color-status-danger-fg);
}

/* ── UX-3 — share dialog + frame collaboration (doc explorer) ─────────── */

.share-overlay { display: flex; align-items: center; justify-content: center; }
.share-chrome { max-width: 560px; width: calc(100% - 2rem); max-height: 85vh; overflow-y: auto; }
.share-dialog { padding: 1.25rem var(--compat-space-1_5); display: flex; flex-direction: column; gap: 1.25rem; }
.share-dialog-head { display: flex; align-items: center; gap: 0.75rem; }
.share-dialog-head h3 { font-size: 1rem; margin: 0; }
.share-dialog-head .share-dialog-close { margin-left: auto; }
.share-scope { font-size: var(--compat-type-75); color: var(--color-text-faded); overflow-wrap: anywhere; }
.share-section { display: flex; flex-direction: column; gap: 0.5rem; }
.share-section h4 { font-size: var(--compat-type-85); margin: 0; }
.share-mint-row { display: flex; align-items: center; gap: 0.75rem; }
.share-anon-result, .share-guest-result { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.share-anon-url, .share-guest-url { flex: 1 1 260px; font-size: var(--compat-type-75); }
.share-guest-form { display: flex; flex-direction: column; gap: 0.5rem; }
.share-link-row { display: flex; align-items: center; gap: 0.75rem; padding: var(--compat-space-25) 0; }

/* Q-20260705-003 — owner share surface strip in the artifact doc header. */
.share-surface { flex-basis: 100%; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.35rem; font-size: var(--compat-type-75); }
.share-surface-projection { color: var(--color-accent-default); text-decoration: none; border-bottom: 1px dotted var(--color-accent-default); }
.share-surface-pending { font-size: var(--compat-type-7); border: 1px solid var(--color-status-warning-fg, var(--color-border-default)); color: var(--color-status-warning-fg, var(--color-text-primary)); background: transparent; border-radius: var(--radius-full); padding: 0.1rem 0.6rem; cursor: pointer; }
.collab-patch-jump-highlight { outline: 2px solid var(--color-accent-default); outline-offset: 2px; transition: outline-color 0.4s ease; }

.collab-section { margin-top: 2rem; border-top: 1px solid var(--color-border-default); padding-top: var(--compat-space-1); display: flex; flex-direction: column; gap: 0.75rem; }
.collab-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.collab-header h3 { font-size: var(--compat-type-9); margin: 0; }
.collab-room-select { max-width: 320px; }
.collab-body { display: flex; flex-direction: column; gap: 0.75rem; }
.collab-body[hidden] { display: none; }
.collab-presence-list, .guest-presence-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.collab-presence-list li { display: flex; align-items: center; gap: 0.5rem; font-size: var(--compat-type-8); color: var(--color-text-faded); }
.presence-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--color-text-faded-strong); flex: 0 0 auto; }
.presence-dot.presence-active { background: var(--color-status-success-fg); }
.presence-role { font-size: var(--compat-type-65); border: 1px solid var(--color-border-default); border-radius: var(--radius-sm); padding: 0 0.3rem; }
.collab-patch-list { display: flex; flex-direction: column; gap: 0.6rem; }
.collab-patch { border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); padding: 0.6rem 0.75rem; }
.collab-patch-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.patch-status { font-size: var(--compat-type-65); border-radius: var(--radius-sm); padding: 0 0.4rem; border: 1px solid var(--color-border-default); color: var(--color-text-faded); }
.patch-status-comment { color: var(--color-status-comment-fg); border-color: var(--color-status-comment-fg); }
.patch-status-suggested { color: var(--color-status-suggested-fg); border-color: var(--color-status-suggested-fg); }
.patch-status-applied { color: var(--color-status-applied-fg); border-color: var(--color-status-applied-fg); }
.patch-author { font-size: var(--compat-type-65); color: var(--color-text-faded-strong); }
/* p5-b — renamed from .collab-patch-note / .collab-patch-proposed: now
   unscoped, shared by the member (.collab-patch) and guest (.guest-patch)
   patch-body renderer — see portal/public/js/components/collab-shared.js
   patchBodyHtml(). New p5-b rules for anchors/orphans/selection-suggest live
   in one block at the end of this file. */
.patch-note { font-size: var(--compat-type-85); white-space: pre-wrap; }
.patch-proposed { margin-top: 0.4rem; font-size: var(--compat-type-75); font-family: var(--type-family-mono); border-left: 2px solid var(--color-status-suggested-fg); padding: 0.35rem var(--compat-space-5); white-space: pre-wrap; max-height: 160px; overflow-y: auto; color: var(--color-text-faded); }
.collab-patch-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.collab-composer { display: flex; flex-direction: column; gap: 0.5rem; }

/* overlay primitive — Portal Phase 1 Workstream B (plan-0df49f54 / stage-eb6a1a7c)
   Single overlay system on native <dialog> + Popover API. Binds only the
   semantic tokens already defined in :root above — new classes only, no
   edits to the pre-existing .panel-overlay* / .panel-window* rules (those
   still back panel.js's collapse/expand/window-mode overlays, absorbed in
   a later phase). */
.ov-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  border: none;
  padding: 0;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  border-radius: var(--radius-3xl);
  box-shadow: var(--elevation-overlay);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.25s ease;
  overflow-y: auto;
}
.ov-dialog.ov-open { opacity: 1; transform: translateY(0); }
.ov-dialog::backdrop {
  background: var(--color-overlay-scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ov-dialog--default {
  width: 100%;
  max-width: min(960px, calc(100vw - 3rem));
  min-height: 50vh;
  max-height: calc(100vh - 4rem);
}
.ov-dialog--form {
  width: 100%;
  max-width: min(560px, calc(100vw - 3rem));
  max-height: calc(100vh - 4rem);
}
.ov-dialog--window {
  width: 100%;
  max-width: calc(100vw - 1.5rem);
  min-height: calc(100vh - 1.5rem);
  max-height: calc(100vh - 1.5rem);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.ov-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem var(--compat-space-1_5);
  border-bottom: 1px solid var(--color-border-subtle);
  position: sticky; top: 0;
  background: var(--color-bg-surface);
  border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  z-index: 1;
  flex-shrink: 0;
}
.ov-dialog--window .ov-header { border-radius: 12px 12px 0 0; }
.ov-title { font-size: 1rem; font-weight: 600; }
.ov-actions { display: flex; align-items: center; gap: 0.5rem; }
.ov-close-btn {
  background: none; border: none; font-size: 1.4rem; color: var(--color-text-tertiary);
  cursor: pointer; padding: var(--compat-space-25) var(--compat-space-5); border-radius: 6px; line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.ov-close-btn:hover { color: var(--color-text-primary); background: var(--color-bg-canvas); }
.ov-copy-btn {
  background: none;
  border: 1px solid var(--color-border-default);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.ov-copy-btn:hover { background: var(--color-bg-sunken); color: var(--color-text-primary); }
.ov-copy-btn-ok { background: var(--color-status-success-tint); color: var(--color-status-success-fg); border-color: var(--color-status-success-fg); }

.ov-body { padding: var(--compat-space-2) 2.5rem; }
.ov-dialog--form .ov-body { padding: var(--compat-space-1_5) 1.75rem; }
.ov-dialog--window .ov-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ov-decision { display: grid; gap: 1.25rem; }
.ov-decision-message {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
}
.ov-decision-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
}
.ov-prompt { gap: 0.75rem; }
.ov-prompt .ov-decision-actions { margin-top: 0.5rem; }
.ov-prompt-field { width: 100%; resize: vertical; }
.ov-dialog[data-decision-variant="destructive"] {
  border-top: 3px solid var(--color-status-danger-fg);
}

@media (max-width: 520px) {
  .ov-dialog--default, .ov-dialog--form { max-width: 100%; min-height: 100vh; max-height: 100vh; border-radius: 0; }
  .ov-dialog--window { max-width: 100%; min-height: 100vh; max-height: 100vh; border-radius: 0; }
  .ov-header, .ov-dialog--window .ov-header { border-radius: 0; }
  .ov-decision-actions { margin-top: auto; flex-direction: column-reverse; align-items: stretch; }
  .ov-decision-actions .btn { width: 100%; }
}

/* Transient popover menu (light-dismiss). `.ov-menu-open` only applies in
   the fallback path (environments without Popover API support); native
   popovers are shown/hidden via showPopover()/hidePopover() and don't need
   a display toggle class. */
.ov-menu {
  position: fixed;
  inset: auto;
  z-index: 70;
  margin: 0;
  padding: 0.35rem;
  min-width: 160px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  box-shadow: var(--elevation-raised);
  display: none;
  flex-direction: column;
  gap: 0.1rem;
  max-width: calc(100vw - 1rem);
  max-height: calc(100vh - 1rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ov-menu:popover-open { display: flex; }
.ov-menu.ov-menu-open { display: flex; }
.ov-menu-item {
  background: none;
  border: none;
  text-align: left;
  font-size: var(--compat-type-85);
  font-family: inherit;
  color: var(--color-text-primary);
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
}
.ov-menu-item:hover { background: var(--color-bg-canvas); }
.ov-menu-item[aria-current="page"] {
  background: var(--color-bg-sunken);
  color: var(--color-text-primary);
  font-weight: 650;
  box-shadow: inset 2px 0 0 var(--color-accent-default);
}
.ov-menu-item:disabled { color: var(--color-text-tertiary); cursor: default; }
.ov-menu-item:disabled:hover { background: none; }
.ov-menu-group-label {
  color: var(--color-text-tertiary);
  font-family: var(--type-family-body);
  font-size: var(--compat-type-7);
  letter-spacing: normal;
  padding: 0.35rem 0.6rem 0.2rem;
  text-transform: none;
}
.ov-menu-group-label:not(:first-child) {
  border-top: 1px solid var(--color-border-subtle);
  margin-top: 0.25rem;
  padding-top: var(--compat-space-5);
}
/* Top-level contexts read as headings; sub-contexts sit indented on a guide line. */
.ov-menu-context-switcher .ov-menu-item:not([data-depth]) { font-weight: 600; }
.ov-menu-context-switcher .ov-menu-item[data-depth="1"] { position: relative; padding-left: 1.5rem; font-weight: 400; color: var(--color-text-secondary); }
.ov-menu-context-switcher .ov-menu-item[data-depth="1"]::before { content: ""; position: absolute; left: .85rem; top: 0; bottom: 0; border-left: 1px solid var(--color-border-subtle); }
.ov-menu-context-switcher .ov-menu-item[data-depth="1"]:is(:hover, :focus-visible, [aria-current="page"]) { color: var(--color-text-primary); }

/* panels */
/* Panel-registry host (public/js/panels/host.js) — composition-config
   sections + per-panel containment states. 'auto-grid' sections reuse the
   existing .panel-layout 2-col grid (full/half via data-panel-layout-width,
   set by host.js from each panel type's manifest); 'stack' is new. */
.ph-section { margin-bottom: 0; }
.ph-section-title { font-size: var(--compat-type-78); text-transform: none; letter-spacing: normal; color: var(--color-text-tertiary); margin: 0 0 0.6rem; font-family: var(--type-family-body); }
.ph-section-error { border: 1px dashed var(--color-status-danger-fg); border-radius: 10px; padding: 0.75rem; }
.ph-layout-stack { display: flex; flex-direction: column; gap: 1rem; }
.ph-notice { margin: 0 0 1rem; padding: 0.75rem var(--compat-space-1); background: var(--color-status-warning-bg); border: 1px solid var(--color-status-warning-fg); border-radius: 8px; font-size: var(--compat-type-85); color: var(--color-text-secondary); }
.ph-notice p { margin: 0; }
.ph-notice p + p { margin-top: 0.35rem; }
/* Quiet informational variant (header cleanup) — the entity-generated
   banner (views/entity/index.js's renderGeneratedBanner) is a routine
   "here's what happened" hint, not a warning, so it uses the neutral info
   tokens instead of the warning ones .ph-notice defaults to. The base
   .ph-notice styling above stays warning-toned for host.js's genuine
   composition-config problem notices (bad schemaVersion, non-object
   config, etc.) — this only overrides the generated-banner instance. */
.ph-notice.ph-notice-info {
  background: var(--color-status-info-bg);
  border-color: var(--color-status-info-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.ph-notice-dismiss {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.2rem;
  cursor: pointer;
  flex: 0 0 auto;
}
.ph-notice-dismiss:hover { color: var(--color-text-secondary); }

/* Entity generated-view cue (Stage 4, plan-2c7e5c0e): the "this view was
 * auto-composed" hint is routine meta-info, so it renders as a quiet caption
 * above the panel grid it describes — no fill, no border, recedes into the
 * page — rather than the filled ph-notice-info block that stranded it between
 * the search and the grid. Customize is a subtle inline text action (the
 * header's Customize ▾ menu is the primary entry point). */
.entity-generated-hint {
  display: flex; align-items: baseline; gap: 0.5rem;
  margin: 0 0 1rem; font-size: var(--compat-type-78); color: var(--color-text-tertiary);
}
.entity-generated-hint-action {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--color-text-secondary);
  text-decoration: underline; text-underline-offset: 2px;
}
.entity-generated-hint-action:hover { color: var(--color-text-primary); }
.entity-generated-hint-dismiss {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--color-text-tertiary); font-size: 1rem; line-height: 1; padding: 0 0.2rem;
  flex: 0 0 auto;
}
.entity-generated-hint-dismiss:hover { color: var(--color-text-secondary); }
.ph-card { border: 1px solid var(--color-border-default); border-radius: 10px; background: var(--color-bg-surface); padding: 0.85rem var(--compat-space-1); }
.ph-card-head { font-size: var(--compat-type-72); text-transform: none; letter-spacing: normal; color: var(--color-text-tertiary); font-family: var(--type-family-body); }
.ph-card-body { font-size: var(--compat-type-85); color: var(--color-text-secondary); margin: 0.35rem 0 0; }
.ph-placeholder { border-left: 3px solid var(--color-status-warning-fg); background: repeating-linear-gradient(135deg, var(--color-bg-surface), var(--color-bg-surface) 8px, var(--color-status-warning-bg) 8px, var(--color-status-warning-bg) 16px); }
.ph-error { border-left: 3px solid var(--color-status-danger-fg); background: var(--color-status-danger-bg); }
.ph-error .ph-card-head { color: var(--color-status-danger-fg); }
.ph-guest-unavailable { border-left: 3px solid var(--color-border-default); opacity: 0.7; }

/* Panel-region hydration skeleton (P0 fix: empty-page flash) —
   views/entity/index.js's entity() renders this synchronously into
   #entity-panel-layout so the fold is never bare header+search while
   bindEntity's config/overlay fetches resolve. Shaped after .panel itself
   (same radius/gradient tokens — kept in lockstep with the Cybersyn
   instrument-panel treatment: flat, hairline border, var(--radius-md))
   rather than the thinner .ph-card, so it reads as "panels are coming"
   instead of a distinct placeholder style. host.js's
   renderComposedDashboard always does `container.innerHTML = ''` before
   rendering real sections, so this never coexists with — and can't leak
   style into — a loaded panel. */
.ph-skeleton-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.ph-skeleton-card {
  background: linear-gradient(180deg, var(--color-bg-surface) 0%, var(--color-bg-surface-raised) 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-default);
  padding: 1.25rem var(--compat-space-1_5);
}
.ph-skeleton-line {
  height: 0.85rem;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--color-bg-canvas) 25%, var(--color-bg-sunken) 50%, var(--color-bg-canvas) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 0.6rem;
}
.ph-skeleton-line:last-child { margin-bottom: 0; }
.ph-skeleton-title { width: 40%; height: 1rem; }

/* p2-workpanels */
/* Entity-scoped work-store panels (plan-0df49f54 stage-2cfabb8b Workstream 1):
   issue-entity-panel.js / plans-entity-panel.js / decisions-entity-panel.js.
   The full-density board toolbar reuses the existing panel/issues/
   plans-board/decision-group classes. */
.plans-board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; }
.plans-board-toolbar .plans-board-title { margin: 0; }
.ph-guest-unavailable .ph-card-body { margin: 0; font-style: italic; }

/* p2-knowledge */
/* Knowledge panel (public/js/panels/knowledge-panel.js) — compact index over
   the doc store; rows route into the canonical viewer. */
.knowledge-index-section { margin-bottom: 1rem; }
.knowledge-index-section:last-of-type { margin-bottom: 0.5rem; }
.knowledge-index-section-title { font-size: var(--compat-type-72); text-transform: none; letter-spacing: normal; color: var(--color-text-tertiary); margin: 0 0 0.35rem; font-family: var(--type-family-body); }
.knowledge-index-list .item-name code { background: var(--color-bg-canvas); padding: 0.1rem 0.35rem; border-radius: var(--radius-sm); font-size: var(--compat-type-78); }
.knowledge-index-footer { margin-top: 0.5rem; padding-top: var(--compat-space-5); border-top: 1px solid var(--color-border-subtle); text-align: right; }

/* p2-shellpanels */
/* Account dropdown (components/user-bar.js), built on the shared .ov-menu
   popover. Sign-out is always the last entry in ACCOUNT_MENU_ITEMS
   (menu-items.js) — style it as a destructive action by position rather
   than requiring openMenu to support a per-item className. */
.ov-menu-account, .ov-menu-appearance { min-width: 12rem; }
.ov-menu-account .ov-menu-item:first-child, .ov-menu-appearance .ov-menu-item:first-child {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-78);
  border-bottom: 1px solid var(--color-border-default);
  border-radius: 5px 5px 0 0;
  margin-bottom: 0.2rem;
  padding-bottom: var(--compat-space-5);
}

/* "Customize ▾" menu (views/entity/index.js) — same shared .ov-menu
   popover, consolidating what used to be four-plus separate header
   buttons (Add panel / Edit layout / Compose / the personal panel-order
   trigger / Customize my view). Its disabled rows are section-group
   labels (steward-gated entity composition vs. per-viewer "My view"), the
   same disabled-first-row idiom .ov-menu-account uses for its email row
   above — just generalized to any position, since this menu can have two
   of them. */
.ov-menu-customize { min-width: 13rem; }
.ov-menu-customize .ov-menu-item:disabled {
  font-size: var(--compat-type-7);
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--type-family-body);
  padding: 0.35rem 0.6rem 0.2rem;
}
.ov-menu-customize .ov-menu-item:disabled:not(:first-child) {
  margin-top: 0.25rem;
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--compat-space-5);
}

/* p3-b */
/* Panel library (panels/panel-library.js), composition editor
   (panels/composition-editor.js), and per-user view-overlay editor
   (panels/user-overlay-editor.js) — Portal Phase 3 lane P3-B. Reuses
   .item/.item-list/.item-name/.item-meta/.badge (knowledge panel's shared
   vocabulary) for the library rows, and mirrors panel-layout-row/-actions/
   -status's up/down-row-list idiom for the two editors' panel rows, since
   both are "a list of rows with move/remove/select controls" at heart. */
.panel-library-group { margin-bottom: 1.1rem; }
.panel-library-group:last-child { margin-bottom: 0; }
.panel-library-group-title { font-size: var(--compat-type-78); text-transform: none; letter-spacing: normal; color: var(--color-text-tertiary); margin: 0 0 0.5rem; font-family: var(--type-family-body); }
.panel-library-row .item-name { display: block; }
.panel-library-error { display: block; margin-top: 0.3rem; }
.composition-editor { display: flex; flex-direction: column; gap: 1.1rem; }
.panel-editor-section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; }
.panel-editor-section-head h3 { margin: 0; font-size: var(--compat-type-9); }
.panel-editor-list { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.panel-editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  /* Border-box flip: see .panel-layout-row. */
  min-height: calc(2.5rem + 1rem + 2px);
  padding: var(--compat-space-5) 0.6rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-bg-canvas);
}
.panel-editor-row-actions,
.panel-editor-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.panel-editor-status { min-width: 5rem; color: var(--color-text-tertiary); font-size: var(--compat-type-82); }
.tps-section:not(:first-child) { border-top: 1px solid var(--color-border-subtle); padding-top: 0.75rem; }
.ov-menu-account .ov-menu-item:last-child { color: var(--color-status-danger-fg); }

/* p3-packs */
/* The ONE host-owned opt-in texture/ornament slot (plan-0df49f54 P3-A item 1,
   dec-77929933/dec-05a9e993): a single structural rule, owned here, that
   every pack may opt into via its --texture-overlay / --texture-overlay-
   opacity semantic tokens — never a pack-authored stylesheet rule of its
   own. Defaults to fully transparent/off (house and every non-opted-in pack
   sets --texture-overlay: none, --texture-overlay-opacity: 0), so this is a
   no-op unless a pack explicitly asks for it (artdeco is the first). The
   var() fallback covers a pack file that predates the texture tokens
   entirely. --texture-overlay is validated at build time against a fixed
   host-owned asset allowlist (tokens/scripts/lint-pack-textures.js) — it can
   only ever resolve to `none` or a `url(...)` pointing under
   public/textures/, never arbitrary pack-supplied CSS.
   pointer-events: none + z-index: 0 keep it decorative-only and under all
   real content (every app root/panel establishes its own stacking context
   above z-index 0). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--texture-overlay, none);
  background-repeat: repeat;
  opacity: var(--texture-overlay-opacity, 0);
}

/* p5-x — Portal Phase 5 lane P5-A: CM6 hybrid editor, typed frontmatter
   properties panel, and owner edit-in-place (plan-0df49f54). Semantic
   tokens only — see components/editor/theme.js for the CM6-internal theme,
   which is styled separately (EditorView.theme()) since CM6 renders its own
   shadow-free DOM that isn't reachable from this stylesheet's selectors. */

.doc-editor-mount { margin: 0.75rem 0; }
.doc-editor { display: flex; flex-direction: column; gap: 0.75rem; }
.doc-editor-body { min-height: 12rem; }
.doc-editor-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.doc-editor-status { min-width: 6rem; }
.doc-editor-recovery-dialog {
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  overflow-wrap: anywhere;
  padding: var(--space-lg);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  background: var(--color-bg-canvas);
  color: var(--color-text-primary);
  font-family: var(--type-family-body);
}
.doc-editor-recovery-dialog textarea {
  display: block;
  width: 100%;
  min-height: 5rem;
  margin: var(--space-sm) 0;
  font: inherit;
  color: inherit;
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
}

/* Typed frontmatter properties panel */
.fm-fields { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.75rem; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); background: var(--color-bg-sunken); }
.fm-field { display: flex; align-items: center; gap: 0.6rem; }
.fm-field-raw { flex-direction: column; align-items: stretch; }
.fm-field-label { min-width: 7rem; font-size: var(--compat-type-8); color: var(--color-text-tertiary); }
.fm-field-raw .fm-field-label { min-width: 0; }
.fm-field-raw-badge { font-size: var(--compat-type-68); text-transform: none; letter-spacing: normal; color: var(--color-text-tertiary); opacity: 0.75; font-family: var(--type-family-body); }
.fm-field-input { flex: 1; padding: 0.35rem var(--compat-space-5); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-bg-canvas); color: var(--color-text-primary); font-size: var(--compat-type-85); }
.fm-field-checkbox { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; }
.fm-field-raw-input { font-family: var(--type-family-mono); font-size: var(--compat-type-8); padding: var(--compat-space-5); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-bg-canvas); color: var(--color-text-primary); resize: vertical; }
.fm-add-row { display: flex; gap: 0.4rem; padding-top: 0.4rem; border-top: 1px dashed var(--color-border-subtle); }
.fm-add-key, .fm-add-value { flex: 1; padding: 0.35rem var(--compat-space-5); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-bg-canvas); color: var(--color-text-primary); font-size: var(--compat-type-82); }

/* Hybrid decorations (Obsidian-style inactive-markdown softening) — see
   editor/decorations.js. Cursor-entry removes the .cm-md-mark class from
   the touched node's marks (recomputed every selection change), revealing
   raw syntax for editing. */
.cm-md-mark { opacity: 0.45; }
.cm-md-heading { font-weight: 700; }
.cm-md-heading-1 { font-size: 1.5em; }
.cm-md-heading-2 { font-size: 1.32em; }
.cm-md-heading-3 { font-size: 1.18em; }
.cm-md-heading-4, .cm-md-heading-5, .cm-md-heading-6 { font-size: 1.08em; }
.cm-md-strong { font-weight: 700; }
.cm-md-emphasis { font-style: italic; }
.cm-md-code { font-family: var(--type-family-mono); background: var(--color-accent-tint-code); border-radius: var(--radius-sm, 3px); padding: 0 0.15em; }
.cm-md-link-text { color: var(--color-accent-default); text-decoration: underline; }
.cm-md-link-url { color: var(--color-text-tertiary); }

/* Owner edit-in-place dialogs (edit-dialogs.js) */
.ed-takeover-actions, .ed-conflict-actions { margin-top: 1rem; }
.ed-diff-view { font-family: var(--type-family-mono); font-size: var(--compat-type-8); max-height: 50vh; overflow-y: auto; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); }
.ed-diff-line { display: flex; gap: 0.5rem; padding: 0.05rem var(--compat-space-5); white-space: pre-wrap; word-break: break-word; }
.ed-diff-prefix { flex: 0 0 1rem; opacity: 0.6; }
.ed-diff-removed { background: var(--color-status-danger-bg); }
.ed-diff-added { background: var(--color-status-success-tint); }

/* p5-b — version-pinned anchors, orphaned-suggestions section, and the
   selection-to-suggest floating toolbar (portal/public/js/lib/patch-
   anchors.js, components/collab-shared.js, components/room-collab.js). */
.anchor-status { font-size: 0.6rem; border-radius: var(--radius-sm); padding: 0 0.35rem; margin-left: 0.35rem; border: 1px solid var(--color-border-default); color: var(--color-text-faded); }
.anchor-status-orphaned { color: var(--color-status-suggested-fg); border-color: var(--color-status-suggested-fg); }
.anchor-status-recovered { color: var(--color-text-faded-strong); }
.collab-orphaned-section { margin-top: 0.75rem; padding-top: var(--compat-space-5); border-top: 1px dashed var(--color-border-default); display: flex; flex-direction: column; gap: 0.5rem; }
.collab-orphaned-heading { font-size: var(--compat-type-8); margin: 0; }
.collab-select-suggest-toolbar { position: absolute; display: flex; gap: 0.25rem; z-index: 20; background: var(--color-bg-surface-raised); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); padding: 0.2rem; box-shadow: var(--elevation-overlay); }
.collab-select-suggest-toolbar button { font-size: var(--compat-type-7); padding: 0.15rem var(--compat-space-5); }

/* UX-4 — owner edit-in-place (components/room-collab.js openInlineEdit):
   the inline block editor that replaces the selected rendered segment, and
   the panel notice line that carries apply-conflict messages across a doc
   reload. Reuses the shared .composer-textarea/.composer-actions chrome. */
.collab-inline-editor { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0; padding: 0.6rem; border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-bg-surface-raised); }
.collab-inline-editor .composer-actions { display: flex; align-items: center; gap: 0.4rem; }
.collab-edit-notice { margin: 0.4rem 0 0; }

/* p5-b — standard share sheet (expiry + history) and the notifications panel. */
.share-mint-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.share-history { margin-top: 0.5rem; }
.share-history summary { cursor: pointer; font-size: var(--compat-type-8); color: var(--color-text-faded-strong); }
.share-link-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.3rem 0; }
.share-link-row-settled { opacity: 0.75; }
.notification-list { display: flex; flex-direction: column; gap: 0.4rem; list-style: none; padding: 0; margin: 0; }
.notification-item { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.4rem var(--compat-space-5); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); }
.notification-item.notification-seen { opacity: 0.6; }
.notification-severity { font-size: var(--compat-type-65); border-radius: var(--radius-sm); padding: 0 0.4rem; border: 1px solid var(--color-border-default); color: var(--color-text-faded); text-transform: capitalize; }
.notification-severity-critical { color: var(--color-status-danger-fg, var(--color-status-suggested-fg)); border-color: currentColor; }
.notification-message { flex: 1 1 auto; font-size: var(--compat-type-85); }
.notification-meta { min-width: 0; overflow-wrap: anywhere; }
.notification-seen-section { margin-top: 0.5rem; }
.notification-seen-section summary { cursor: pointer; font-size: var(--compat-type-8); color: var(--color-text-faded-strong); }

/* Alert rows can combine a long source summary, context return path, and ack
   control. Give both clusters explicit shrink/wrap behavior at the Phase 7
   360px floor instead of relying on the generic two-column item grammar. */
[data-alert-row] { flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); }
[data-alert-row] > span:first-child {
  align-items: center;
  display: inline-flex;
  flex: 1 1 16rem;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  min-width: 0;
}
[data-alert-row] > span:last-child {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
  gap: var(--space-2xs);
  margin-left: auto;
}
/* p6 */
/* Unified panel/capability library tabs (panels/panel-library.js, Portal
   Phase 6 P6 task 2) — reuses .panel-library-row/.item/.item-list/.badge
   for capability cards exactly like the Panels tab's rows, so the two tabs
   read as one system. */
.panel-library-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.85rem; border-bottom: 1px solid var(--color-border-subtle); padding-bottom: 0.6rem; }
.panel-library-tab { border-color: transparent; background: transparent; color: var(--color-text-tertiary); }
.panel-library-tab-active { color: var(--color-text-primary); border-color: var(--color-border-default); background: var(--color-bg-canvas); }
.capability-library-provenance { display: block; font-family: var(--type-family-mono); }
.capability-library-error { color: var(--color-status-danger-fg); }

/* Conversational composer (panels/composer.js, Portal Phase 6 P6 task 1) —
   reuses the shared .composer/.composer-textarea/.composer-actions/
   .composer-status chrome components/other composers already use; only the
   preview/error surfaces below are new. */
.composer-errors { color: var(--color-status-danger-fg); font-size: var(--compat-type-82); min-height: 1em; }
.composer-errors:empty { display: none; }
.composer-diff-section { margin-top: 0.75rem; padding-top: 0.6rem; border-top: 1px solid var(--color-border-subtle); }
.composer-diff-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.composer-diff-title { margin: 0 0 0.4rem; font-size: var(--compat-type-85); }
.composer-diff-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.composer-diff-list { list-style: none; margin: 0.2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; font-size: var(--compat-type-82); }
.composer-diff-empty { font-style: italic; }
.composer-diff-theme { margin-top: 0.6rem; }

/* ---- Knowledge + Artifacts deep views (plan-6f3b3943 Stage 2) ----
   Routed /e/:entityId/knowledge and /e/:entityId/artifacts pages, cloned
   from the Action page shell (.action-wrap/.action-header/.action-page-
   board above) — reuses .dash-wrap/.page-top-actions/.panel-desc/.btn
   chrome, only the page-specific wrap widths and board frame are new here.
   All colors come from existing
   color/radius custom properties (see tokens/), so both views match
   the rest of the app in light and dark themes with no theme-specific rules
   of their own. */
.knowledge-wrap,
.artifacts-wrap { max-width: calc(1120px + 2 * var(--space-page-x)); }
/* H-4 (C-CRD-3): the shared header row tracks its page's column width — the
   wide boards had a 720px header floating over 1120px content. One rule for
   every 1120px wrap (action/trust above, knowledge/artifacts here,
   workspace below). */
/* min-height unified to the Action page's .action-page-board value (Stage
   4/Cybersyn v2 — Action landed first, so its board is canonical where the
   two conflicted; this was the only property that actually differed). */
.knowledge-page-board,
.artifacts-page-board {
  min-height: 620px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  overflow: hidden;
}
.knowledge-page-board .panel,
.artifacts-page-board .panel { border: none; border-radius: 0; }

/* ---- Workspace deep view (plan-6f3b3943 Stage 6) ----
   Routed /e/:entityId/workspace page, cloned from the Action/Knowledge/
   Artifacts shell above (.dash-wrap/.page-top-actions/.entity-header-
   actions/.panel-desc/.btn chrome). Its body is the composed-panel grid
   panels/host.js and components/panel-layout.js already render their own
   card chrome for (see entity-generated-hint and ph-skeleton rules further
   up this file), so unlike Knowledge/Artifacts this page adds no bordered
   board frame around #entity-panel-layout — only the wider page column and
   header spacing are new here. Existing custom properties only (see
   tokens directory), so this reads correctly in both light and dark
   without any theme-specific rules of its own. */
.workspace-wrap { max-width: calc(1120px + 2 * var(--space-page-x)); }
/* ==========================================================================
   Finder — global-header CTA + command-palette overlay (plan-6f3b3943 Stage 3)
   ========================================================================== */

/* Compact header CTA — sits between the breadcrumb and avatar; reuses
   .header-bar-inner's flex row, no layout changes there. */
.header-finder-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text-tertiary);
  font-family: inherit;
  font-size: 0.76rem;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.header-finder-btn:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
  background: var(--color-bg-sunken);
}
.header-finder-label { white-space: nowrap; }
.header-finder-kbd {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-68);
  color: var(--color-text-tertiary);
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.05rem 0.3rem;
  line-height: 1.3;
}

/* Find palette — built on the shared .ov-dialog (size="form"); this tunes
   height/scroll for a ranked results list (dec_bc5d8f7f items 4–6). */
.ov-dialog[data-overlay-id="finder"] .ov-body {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 10rem);
}
.finder {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
}
.finder-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.35rem 0.5rem;
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-accent-secondary-default);
  border-radius: var(--radius-md);
  color: var(--color-text-tertiary);
}
.finder-box:focus-within { box-shadow: 0 0 0 3px var(--color-focus-ring); }
.finder-box-icon { flex-shrink: 0; }
.finder-input {
  flex: 1;
  min-width: 4rem;
  border: 0;
  outline: none;
  background: none;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.35rem 0.1rem;
}
.finder-input::placeholder { color: var(--color-text-tertiary); }
/* The box carries the focus ring; the bare input inside it does not repeat it. */
.finder-box .finder-input:focus-visible { box-shadow: none; outline: none; }
.finder-token-slot:empty { display: none; }
.finder-token {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0 0.25rem 0 0.65rem;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  background: var(--color-bg-sunken);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  white-space: nowrap;
}
.finder-token:not(:has(button)) { padding-right: 0.65rem; }
.finder-token b { color: var(--color-text-primary); font-weight: 600; }
.finder-token-action {
  min-height: 1.75rem;
  min-width: 1.75rem;
  padding: 0 0.45rem;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--compat-type-78);
}
.finder-token-remove { font-size: 1rem; line-height: 1; }
.finder-token-action:hover { background: var(--color-bg-canvas); color: var(--color-text-primary); }
.finder .finder-kinds .filter-option { min-height: 2rem; padding: 0 0.75rem; font-size: var(--compat-type-78); }
.finder-results {
  margin: 0;
  min-height: 0;
  overflow-y: auto;
}
.finder-list { list-style: none; margin: 0; padding: 0; }
.finder-list > .finder-row { display: block; padding: 0; border: 0; }
.finder-row-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.15rem 1rem;
  min-height: 3.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  /* Titles, not monospace ids: undo .artifact-link's inline-id styling. */
  font-family: var(--type-family-body);
  font-size: inherit;
  text-decoration: none;
}
a.finder-row-link:hover { background: var(--color-bg-sunken); text-decoration: none; }
.finder-row-link.entity-search-focused {
  background: var(--color-bg-sunken);
  outline: 0;
  box-shadow: inset 3px 0 0 var(--color-accent-secondary-default);
}
.finder-row-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.finder-row-title {
  font-weight: 600;
  font-size: var(--compat-type-9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finder-row-title .search-highlight {
  background: none;
  padding: 0;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-color: var(--color-accent-secondary-default);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.finder-row-meta {
  display: flex;
  gap: 0 0.65rem;
  overflow: hidden;
  white-space: nowrap;
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-78);
}
.finder-row-meta > span { overflow: hidden; text-overflow: ellipsis; }
.finder-row-meta > span:first-child,
.finder-row-meta > .finder-row-context { flex-shrink: 0; }
.finder-row-kind { color: var(--color-text-secondary); }
.finder-row-when {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-78);
  white-space: nowrap;
}
.finder-empty { color: var(--color-text-tertiary); font-size: var(--compat-type-85); padding: 0.6rem; margin: 0; }
.finder-more[hidden] { display: none; }
.finder-more-note { color: var(--color-text-tertiary); font-size: var(--compat-type-78); margin: 0; }
.finder-widen {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-85);
}
.finder-widen-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-secondary-default);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  min-height: 2rem;
}
.finder kbd,
.finder-foot kbd {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-68);
  color: var(--color-text-tertiary);
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.05rem 0.3rem;
  line-height: 1.3;
}
.finder-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-72);
}
.finder-foot > span { display: inline-flex; align-items: center; gap: 0.3rem; }
.finder-foot > span[hidden] { display: none; }

@media (max-width: 640px) {
  .header-finder-kbd { display: none; }
  .entity-search-row { flex-wrap: wrap; }
  .entity-search-row .entity-search-input { flex-basis: 100%; }
  .entity-search-scope,
  .entity-search-type { flex: 1; min-height: 2.25rem; }
  .finder-input { font-size: 1rem; }
  .finder-row-link { grid-template-columns: minmax(0, 1fr); min-height: 3.5rem; }
  .finder-row-when,
  .finder-widen kbd,
  .finder-foot { display: none; }
  .finder .finder-kinds { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .finder .finder-kinds .filter-option { flex-shrink: 0; min-height: 2.75rem; }
  .finder-token-action { min-height: 2.75rem; min-width: 2.75rem; }
}

/* ==========================================================================
   Quiet-link utility (plan-6f3b3943 Stage 4 — Cybersyn v2)
   ==========================================================================
   One shared grammar for the low-emphasis navigational links scattered
   through the act/aware home and assurance chrome (see views/entity/
   index.js and components/finder.js) — small, text-secondary at rest, no
   underline until the operator actually reaches for it. Reuses the app's
   established link-hover color (--color-accent-default — same convention
   as .footer a:hover / .header-nav-link:hover) rather than inventing a new
   hover treatment. Existing custom properties only — no new tokens. Do not
   apply to anything already using the .btn family of classes. */
.quiet-link {
  font-size: var(--compat-type-8);
  color: var(--color-text-secondary);
  text-decoration: none;
  cursor: pointer;
}
.quiet-link:hover,
.quiet-link:focus-visible {
  color: var(--color-accent-default);
  text-decoration: underline;
}
/* ==== END Quiet-link utility ==== */

/* ==========================================================================
   feel-pass A1 (plan-6f3b3943 stage-adc63b9c) — PR 999 reconciliation
   ==========================================================================
   Append-only per this round's file-ownership rules; the earlier
   .act-aware-loop / .felt-l1-gist-* rules above are untouched. */

/* views/entity/index.js's act-aware "For you" rows: .act-aware-loop-main
   is now an <a> (was a plain <div>) so the row's primary click target
   spans the badge+title width, not just the small "Open" pill in
   .act-aware-loop-actions — matching .act-aware-entry's full-card link
   below it. Overrides the anchor defaults the same way .act-aware-entry
   already does, so the wrap is visually a silent no-op. */
.act-aware-loop-main {
  color: inherit;
  text-decoration: none;
}
.act-aware-loop-main:hover .act-aware-loop-title {
  color: var(--color-text-primary);
  text-decoration: underline;
}

/* felt-l1.js's compact gist <details>: the authored "… More" cue
   (.felt-l1-gist-more) was doubling up with the browser's own native
   summary marker (a second, redundant "click to expand" affordance on the
   same toggle). Suppress the native marker across engines so "More" is
   the one legible disclosure cue — same intent as morning-filter's
   `summary::-webkit-details-marker { display: none; }` elsewhere in this
   file, plus the standard ::marker pseudo for engines that honor it. */
.felt-l1-gist-summary {
  list-style: none;
}
.felt-l1-gist-summary::-webkit-details-marker {
  display: none;
}
.felt-l1-gist-summary::marker {
  content: '';
}

/* ==========================================================================
   Connect page — inline copyable field (feel-pass A2 bug burst: "MCP
   setup add-to-Claude buttons ... make fields copyable")
   ==========================================================================
   views/connect.js's copyableField() — a lighter sibling of .code-block for
   a single short connect-table value (Name / Remote MCP server URL). Manual
   select-to-copy on these was the reported friction, especially on mobile;
   every field gets an explicit tap target instead. Reuses .code-block's own
   data-copy + .copy click mechanism (bindConnect in connect.js), just a
   compact inline layout instead of the full padded code-block box, which
   reads as oversized for a two-or-three-word value inside a table cell. */
.connect-copy-field {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
.connect-copy-btn {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  color: var(--color-text-tertiary);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-md);
  font-size: 0.62rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}
.connect-copy-btn:hover { color: var(--color-text-primary); border-color: var(--color-decorative-gray); }

/* Q-20260808-008 — connect snippets that contain configuration files or
   AGENTS.md guidance must remain readable before they are copied. The base
   .code-block stays compact for one-line commands and URLs; only blocks that
   codeBlock() marks as multiline preserve authored line breaks and wrap long
   lines within the panel. */
.code-block.code-block-multiline {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
  padding-right: var(--compat-space-4);
}

/* ==========================================================================
   feel-pass A3 — UX grammar pass 2 (plan-6f3b3943 stage-c865abdd)
   Signed spec: plan-6f3b3943 context/design-note-a3-ux-grammar, decisions 1-6.
   Append-only per build protocol — new rules only below this line; existing
   rules above are never edited in place. Same-selector rules here win the
   cascade (later declaration, equal specificity) where they intentionally
   supersede an earlier block.
   ========================================================================== */

/* ---- Decision 1: ONE disclosure component system-wide ----
   Leading 16px secondary-color chevron, rotates ▸ (collapsed) → ▾
   (expanded); whole header row is the hit target (min 44px); count stays
   visible while collapsed (opts.summary / <summary> text already carries
   this in every caller). panel.js's existing SVG chevron is the canonical
   JS-driven implementation — corrected below to the signed ▸→▾ direction
   (it previously rotated the opposite way: down at rest, up when
   expanded). summary.disclosure-summary is the native-<details>
   counterpart for surfaces built on <summary> rather than panel(), sharing
   the same glyph/size/color/rotation contract. */
.panel-header { min-height: 44px; }
.panel-collapsed .panel-chevron { transform: rotate(-90deg); }
.panel-expanded .panel-chevron { transform: rotate(0deg); }

summary.disclosure-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.35rem 0;
  cursor: pointer;
  list-style: none;
  font-size: inherit;
  color: inherit;
}
summary.disclosure-summary::-webkit-details-marker { display: none; }
summary.disclosure-summary::marker { content: ''; }
summary.disclosure-summary::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background-color: var(--color-text-tertiary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%23000' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%23000' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: rotate(-90deg);
  transition: transform 0.2s ease;
}
details[open] > summary.disclosure-summary::before {
  transform: rotate(0deg);
}

/* doc-explorer.js tree chevron + artifact-viewer.js plan-note chevron
   (decision 1 migration off the old right/down triangle HTML-entity glyph
   swap onto the shared 16px secondary chevron). Tree rows keep their existing compact
   height — the 44px hit-target rule targets section-header disclosure rows
   (act/aware sections, triad groups, detail panels, Settings sections)
   named in the note, not a dense file-tree's per-row nav affordance; only
   the glyph/color/rotation contract is unified here. */
.doc-tree-chevron, .plan-note-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  transition: transform 0.2s ease;
  transform: rotate(-90deg);
  flex-shrink: 0;
}
.doc-tree-chevron svg, .plan-note-chevron svg { width: 16px; height: 16px; }
.doc-tree-chevron.doc-tree-chevron-open, .plan-note-chevron.plan-note-chevron-open {
  transform: rotate(0deg);
}
/* ==== END Connect page inline copyable field ==== */

/* ---- Decision 6: header IA — finder collapses to icon-only on narrow
   viewports instead of disappearing (permanent chrome = context identity —
   finder — avatar, every view). ---- */
.header-finder-icon { flex-shrink: 0; }
@media (max-width: 640px) {
  .header-finder-label { display: none; }
  .header-finder-btn { padding: 0.4rem; }
}

/* ---- Decision 6: Settings page meta line (context identity under the
   page title, same treatment as other detail-view meta lines). ---- */
.settings-page-meta {
  font-family: var(--type-family-body);
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  margin-top: 0.2rem;
}
#settings-personal-layout .ph-section + .ph-section,
#settings-appearance-layout .ph-section + .ph-section { margin-top: var(--space-lg); }
.personal-settings-connections { margin-top: var(--space-lg); }
.settings-account-surface {
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
}
.settings-account-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-bottom: 1px solid var(--color-border-subtle);
}
.settings-account-summary h3,
.settings-connection-heading h3 { margin: 0; font-size: 0.88rem; }
.settings-account-summary .panel-desc { margin: var(--space-2xs) 0 0; }
.settings-account-list { padding: 0 var(--space-sm); }
/* A connected-account source (e.g. "Google — verylong@address.com") can be one
   unbroken token; without this it becomes the flex row's min-content and is
   clipped by .settings-account-surface's overflow:hidden at narrow widths.
   Mirror the .publications-item wrap pattern so the id wraps instead. */
.settings-account-list .item { flex-wrap: wrap; }
.settings-account-list .item-name { min-width: 0; overflow-wrap: anywhere; }
.settings-account-list .item-meta { flex-shrink: 0; }
/* Feature copy and its action keep separate space even for long account names. */
.settings-google-features .item { align-items: flex-start; flex-wrap: wrap; }
.settings-google-feature-copy { flex: 1 1 15rem; min-width: 0; overflow-wrap: anywhere; }
.settings-google-feature-copy > .item-name,
.settings-google-feature-copy > .panel-desc { display: block; }
.settings-google-feature-copy > .panel-desc { margin: var(--space-2xs) 0 0; }
.settings-google-features .item > .btn,
.settings-google-features .item > .badge { flex-shrink: 0; }

/* Author button display rules must respect Drive prerequisite state. */
[data-drive-enable][hidden],
[data-drive-prepare-retry][hidden] { display: none; }

.settings-connections-list { border-top: 1px solid var(--color-border-subtle); }
.settings-connection-row { padding: var(--space-sm); }
.settings-connection-row + .settings-connection-row { border-top: 1px solid var(--color-border-subtle); }
.settings-delivery-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); }
.settings-delivery-toggle { display: inline-flex; align-items: center; gap: var(--space-xs); min-width: 8rem; }
.settings-delivery-hint, .settings-delivery-lede, .settings-delivery-status { color: var(--color-text-secondary); font-size: var(--type-small-size); }
.settings-connection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}
.settings-connection-body .panel-desc:last-child { margin-bottom: 0; }
.settings-preference-group + .settings-preference-group { margin-top: var(--space-sm); }
.settings-preference-label { margin: 0 0 var(--space-2xs); font-weight: 600; }
.settings-preference-options { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
@media (max-width: 390px) {
  .settings-account-summary { flex-wrap: wrap; }
  .settings-account-summary .btn { margin-left: auto; }
}

/* ---- Decision 2: tag-tap -> filter chips ----
   Chip row is the sole readout of tag-driven filter state on a view — one
   row under the view header. Muted per Cybersyn v2 status-color discipline
   (styles.css's .attribution-chip is the direct visual precedent this
   reuses: pill geometry, inverted-fill active state, no saturated tint —
   chips are structure, not alarm). Tags that source a chip (priority/type/
   approval/area badges etc.) get a tappable affordance layered on the
   existing .badge look, not a new visual language. */
.filter-chip-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: var(--compat-space-5);
  border-bottom: 1px solid var(--color-border-subtle);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-text-primary);
  color: var(--color-bg-surface);
  border: 1px solid var(--color-text-primary);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.3rem 0.15rem 0.6rem;
  font-size: var(--compat-type-68);
  font-weight: 500;
}
.filter-chip-remove {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: var(--compat-type-85);
  line-height: 1;
  padding: 0.1rem 0.3rem;
  font-family: inherit;
}
.filter-chip-remove:hover { opacity: 1; }
.filter-chip-clear {
  background: none;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  color: var(--color-text-tertiary);
  cursor: pointer;
  font-size: var(--compat-type-68);
  font-weight: 500;
  font-family: inherit;
  padding: 0.2rem 0.55rem;
  transition: all 0.15s;
}
.filter-chip-clear:hover { color: var(--color-text-secondary); border-color: var(--color-decorative-gray); }

/* Shared bounded filter controls. Active selections use the same calm inverse
   treatment on every surface; lifecycle and attribution remain semantics,
   never separate visual systems. */
.filter-option-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.filter-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--compat-type-68);
  font-weight: 500;
  line-height: 1.25;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.filter-option:hover {
  color: var(--color-text-secondary);
  border-color: var(--color-decorative-gray);
}
.filter-option[disabled] {
  cursor: not-allowed;
  opacity: 0.42;
}
.filter-option[hidden] { display: none; }
.filter-option.active {
  color: var(--color-bg-surface);
  border-color: var(--color-text-primary);
  background: var(--color-text-primary);
}
.filter-option-count {
  min-width: 1.15rem;
  padding: 0 0.3rem;
  border-radius: var(--radius-sm);
  background: var(--color-bg-sunken);
  color: var(--color-text-tertiary);
  font-family: var(--type-family-mono);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.filter-option.active .filter-option-count {
  background: var(--color-bg-surface);
  color: var(--color-text-secondary);
}

/* Full Action lenses share one compact filter grammar. The
   disclosure opens inline and pushes the list down (it never covers rows);
   active tokens remain visible exactly once below the control row. */
.action-filter-toolbar {
  position: relative;
  margin: 0;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border-subtle);
}
.action-toolbar-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 2.25rem;
}
.action-toolbar-button {
  min-height: 2rem;
  padding: 0 var(--space-xs);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-bg-surface);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: var(--compat-type-72);
  line-height: 1;
}
.action-filter-menu { position: relative; }
.action-filter-menu[open] { flex: 1 1 100%; min-width: 0; }
.action-filter-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  cursor: pointer;
  list-style: none;
}
.action-filter-menu > summary::-webkit-details-marker { display: none; }
.action-filter-menu[open] > summary,
.action-filter-menu > summary:hover {
  border-color: var(--color-text-secondary);
  color: var(--color-text-primary);
}
.action-toolbar-count {
  min-width: 1.1rem;
  padding: 0.15rem 0.3rem;
  border-radius: 999px;
  background: var(--color-text-primary);
  color: var(--color-bg-surface);
  font-family: var(--type-family-mono);
  font-size: 0.62rem;
  text-align: center;
}
.action-collection-total {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-sm);
  line-height: 2.25rem;
  color: var(--color-text-tertiary);
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-68);
  font-variant-numeric: tabular-nums;
}
.action-filter-popover {
  margin-top: var(--space-2xs);
  max-width: 34rem;
  max-height: min(24rem, 60vh);
  overflow: auto;
  padding: var(--space-sm);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
}
.action-filter-popover-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}
.action-filter-popover-head > strong {
  color: var(--color-text-primary);
  font-size: var(--compat-type-78);
  font-weight: 600;
}
.action-filter-close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--color-text-tertiary);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 1.15rem;
  height: 1.75rem;
  justify-content: center;
  line-height: 1;
  width: 1.75rem;
}
.action-filter-close:hover { background: var(--color-bg-sunken); color: var(--color-text-primary); }
.action-filter-group-label {
  color: var(--color-text-tertiary);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
}
.action-filter-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.action-filter-group {
  display: grid;
  gap: var(--space-2xs);
}
.action-filter-search {
  width: 100%;
  min-height: 2.25rem;
  padding: 0 var(--space-xs);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-bg-canvas);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--compat-type-78);
}
.action-filter-active { margin-top: var(--space-2xs); }
.action-filter-active:empty { display: none; }
.action-filter-active .filter-chip-row {
  margin: 0;
  padding: var(--space-2xs) 0 0;
  border: 0;
}
@media (max-width: 520px) {
  .action-toolbar-controls { flex-wrap: wrap; }
  .action-toolbar-summary { padding: 0 var(--space-2xs); }
}
.issue-filters > .attribution-chips {
  margin: 0;
  padding: 0;
  border: 0;
}

/* Tappable tag affordance layered on the existing .badge look — cursor +
   hover only, no new color language (badge-critical etc. keep their
   existing abnormal-state saturation per Stage 4 discipline). */
.badge.tag-tap {
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s, opacity 0.15s;
  /* .badge classes render as <button> for tag-tap sources — reset native
     button chrome so it stays visually identical to the plain-<span>
     badges at rest. */
  font-family: inherit;
  line-height: inherit;
  vertical-align: baseline;
  display: inline-block;
  margin: 0;
}
.badge.tag-tap:hover { border-color: currentColor; opacity: 0.85; }
.badge.tag-tap.tag-tap-active { outline: 2px solid var(--color-text-primary); outline-offset: 1px; }

/* ==========================================================================
   feel-pass A5 (plan-6f3b3943 stage-80db1fc8) — entity view coherence
   ==========================================================================
   Append-only per this round's file-ownership rules (A3 is concurrently
   editing styles.css too) — nothing above this point is touched. */

/* ---- Empty-purpose offer-create CTA (decision 6) ---- */
.felt-l1-purpose-cta-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  display: block;
  margin-top: 0.3rem;
}

/* ---- Active rooms ticker + plan position line (felt-l1.js) ---- */
.felt-l1-active-rooms-empty .felt-l1-empty-copy { margin-bottom: 0; }
.felt-l1-room-ticker {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.felt-l1-room-ticker-name {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.felt-l1-room-ticker-name:hover,
.felt-l1-room-ticker-name:focus-visible {
  color: var(--color-accent-default);
}
.felt-l1-room-ticker-next {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
/* Mono data-voice (matches .act-aware-entry-meta's established recipe
   above) — the "N active" count and the plan-of-record position line both
   read as instrument, not prose. */
.felt-l1-room-ticker-count,
.felt-l1-position-text {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}
.felt-l1-position {
  margin-top: 0.2rem;
  min-height: 1em;
}

/* ---- Entity-scoped Settings (/e/:entityId/settings) ---- */
.entity-settings-context-meta {
  font-size: var(--compat-type-82);
  color: var(--color-text-secondary);
  margin: 0.2rem 0 0;
}
.entity-settings-section { margin-bottom: 1.4rem; }
.entity-settings-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.entity-settings-your-role {
  font-size: var(--compat-type-8);
  color: var(--color-text-secondary);
  margin: 0 0 0.6rem;
}
.entity-settings-your-role-value {
  font-family: var(--type-family-body);
  color: var(--color-text-primary);
}
.entity-management-groups {
  display: grid;
  gap: var(--space-lg);
}
.entity-management-group {
  margin: 0;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-subtle);
}
.entity-management-subsection {
  margin-top: var(--space-md);
}
.entity-management-subtitle {
  margin: 0 0 var(--space-2xs);
  font-size: var(--type-body-size);
  font-weight: 600;
}
.entity-management-destination {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.entity-management-destination > div {
  min-width: 0;
  flex: 1 1 auto;
}
.entity-management-destination .panel-desc {
  margin: 0;
}
.entity-management-destination .btn {
  flex: 0 0 auto;
}
.entity-connection {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.entity-connection-title {
  margin: 0 0 var(--space-2xs);
  font-size: var(--type-body-size);
  font-weight: 600;
}
.entity-connection-status,
.entity-connection-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
.entity-connection-actions {
  margin-top: var(--space-xs);
}
@media (max-width: 480px) {
  .entity-management-destination {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .entity-management-destination > div {
    flex-basis: 100%;
  }
  .entity-management-destination .btn {
    margin-left: auto;
  }
  .entity-connection-actions .btn {
    margin-left: auto;
  }
}

/* ==== END feel-pass A5 ==== */

/* ==========================================================================
   feel-pass A6 (plan-6f3b3943 stage-922f90a5) — Action view maturation
   ==========================================================================
   Append-only per this round's file-ownership rules — nothing above this
   point is touched. */

/* ---- Plan detail grammar ---- */
.plan-detail-notes-list { margin-top: 0.75rem; }
.plan-detail-notes-list-header {
  font-size: var(--compat-type-7);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.plan-note-disclosure { border-bottom: 1px solid var(--color-border-subtle); }
.plan-note-disclosure:last-child { border-bottom: none; }
/* `summary.` prefix matches summary.disclosure-summary's own (tag+class)
   specificity so these overrides actually win the cascade instead of
   losing to that rule's font-size:inherit/color:inherit. */
summary.plan-note-disclosure-title { font-size: var(--compat-type-8); color: var(--color-text-secondary); }
.plan-note-disclosure-body { padding: 0 0 0.6rem var(--compat-space-1_5); font-size: var(--compat-type-82); }

/* Stage description clamp-with-inline-expand. */
.stage-meta-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stage-meta-expand-btn { display: block; margin-top: 0.15rem; font-size: var(--compat-type-72); }

/* Tap-to-scroll highlight for a routed stage deep link landing on the board. */
.plans-board-stage-highlight {
  animation: plans-board-stage-highlight-pulse 2.4s ease-out;
}
@keyframes plans-board-stage-highlight-pulse {
  0% { background: var(--color-bg-sunken); }
  100% { background: transparent; }
}

/* Linked queue/issue lines are now real links (nav for homes). */
.plans-board-issue {
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.3rem;
  margin: 0 -0.3rem;
}
.plans-board-issue:hover { background: var(--color-bg-canvas); }

/* ---- §4: queue/issues — drag-and-drop + oversize-card full-view ---- */
.kanban-card-dragging { opacity: 0.45; }
.kanban-col-drop-target { outline: 2px dashed var(--color-border-default); outline-offset: -2px; }
.kanban-card-desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kanban-card-meta { justify-content: flex-start; gap: 0.5rem; }
.kanban-card-open-link { margin-left: auto; }
.kanban-drag-confirm {
  margin-top: 0.5rem;
  padding-top: var(--compat-space-5);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.kanban-drag-confirm-text { font-size: var(--compat-type-75); color: var(--color-text-tertiary); }

/* ---- §5: decisions ledger — de-panel-ified, zero chrome ---- */
.decisions-ledger { padding: 0; }
/* "One chip row inside the content margin" — inset, not flush to the
   view's outer border. */
.decisions-ledger-chips:not(:empty) { margin: 0 0 0.75rem; }
.ledger-group { margin-inline: var(--space-sm); }
.ledger-group + .ledger-group { margin-top: 1rem; }
.ledger-group-header {
  font-size: var(--compat-type-7);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  padding: var(--compat-space-25) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
/* One line = text + tags + right-aligned mono date. Whole line is the tap
   target — no chevron, no expand button. */
.ledger-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  /* Same list-item container treatment as the Plans/Issues rows (.plan-card.item):
     inset padding + rounded hover surface, so a ledger row reads as a formatted
     row, not a flush full-width text line. Grammar (single line, right-aligned
     mono date) is unchanged. */
  padding: 0.6rem var(--compat-space-5);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border-bottom: 0;
}
.ledger-line:hover { background: var(--color-bg-sunken); }
.ledger-line-text {
  font-size: var(--compat-type-85);
  color: var(--color-text-primary);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.ledger-line-tags { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; max-width: 100%; }
.ledger-line-date {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.ledger-line-detail:not([hidden]) {
  padding: var(--compat-space-25) var(--compat-space-5) 0.9rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.ledger-line-detail .decision-detail-body { margin-top: 0.4rem; }

/* ---- §2: action timeline ---- */
.timeline-altitude-toggle { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; }
.timeline-altitude-active { border-color: var(--color-text-primary); color: var(--color-text-primary); }
.timeline-steer-aggregate { margin-bottom: 0.5rem; }
.timeline-day + .timeline-day { margin-top: 1rem; }
.timeline-day-header {
  font-size: var(--compat-type-7);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  padding: var(--compat-space-25) var(--compat-space-5);
  border-bottom: 1px solid var(--color-border-subtle);
}
.timeline-entry {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  /* Matches the ledger row / Plans-Issues list-item container treatment:
     inset padding + rounded hover surface, so an activity row reads as a
     formatted row rather than a flush text line. */
  padding: 0.6rem var(--compat-space-5);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: var(--compat-type-82);
}
.timeline-entry:hover { background: var(--color-bg-sunken); }
/* Interactive variant: an Artifact-activity row that opens its work in the
   review workspace. Adds the pointer + focus-visible ring (the shared
   role="button" outline token) on top of the base row's hover background. */
.timeline-entry-interactive { cursor: pointer; }
.timeline-entry-interactive:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.timeline-entry-kind {
  font-family: var(--type-family-body);
  font-size: var(--compat-type-65);
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  min-width: 4.5em;
}
.timeline-entry-title { color: var(--color-text-primary); flex: 1; }
.timeline-entry-meta { color: var(--color-text-tertiary); font-size: var(--compat-type-72); flex-shrink: 0; }
.artifact-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.artifact-activity-detail {
  display: block;
  color: var(--color-text-secondary);
  font-size: var(--compat-type-82);
  font-weight: 400;
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
}
/* `summary.` prefix matches summary.disclosure-summary's own (tag+class)
   specificity — see the same note on .plan-note-disclosure-title above. */
summary.timeline-burst-summary { font-size: var(--compat-type-82); color: var(--color-text-secondary); min-height: auto; padding: 0.6rem var(--compat-space-5); }
.timeline-burst-body { padding-left: var(--compat-space-1); }
.timeline-load-earlier,
.person-action-load-earlier,
.person-action-load-more { display: flex; justify-content: center; padding: var(--space-md) 0 var(--space-xs); }
/* ==== END feel-pass A6 ==== */



/* ==========================================================================
   plan-1e4b3ada stage-41751a34 — draft-visibility overlay
   ==========================================================================
   Append-only. components/pending-changes-overlay.js's badge/banner: a
   native <details>/<summary class="disclosure-summary"> (A3 grammar
   Decision 1 — one disclosure component system-wide), quiet at rest. The
   diff itself reuses edit-dialogs.js's existing .ed-diff-view/.ed-diff-line/
   .ed-diff-removed/.ed-diff-added rules unchanged — no new diff rendering
   introduced, just a shared component instead of a second bespoke one. */
.pending-changes-mount {
  margin: 0.5rem 0;
}
.pending-changes-summary {
  font-size: var(--compat-type-78);
  color: var(--color-text-tertiary);
}
.pending-changes-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.pending-changes-item {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--compat-space-5) 0.6rem;
  background: var(--color-bg-sunken);
}
/* Conflicted mirrors .ed-error-adjacent conventions elsewhere in this file
   (left accent bar in the danger color) rather than a saturated fill —
   this is advisory ("would need review to apply"), not a blocking error. */
.pending-changes-item-conflicted {
  border-left: 3px solid var(--color-status-danger-fg);
}
.pending-changes-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pending-changes-author {
  font-size: var(--compat-type-8);
  font-weight: 600;
  color: var(--color-text-secondary);
}
.pending-changes-action {
  font-size: var(--compat-type-8);
  color: var(--color-text-tertiary);
  font-style: italic;
}
.pending-changes-state {
  font-size: var(--compat-type-65);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--color-border-default);
  color: var(--color-text-tertiary);
  white-space: nowrap;
}
.pending-changes-state-conflicted {
  background: var(--color-status-danger-bg);
  color: var(--color-status-danger-fg);
  border-color: var(--color-status-danger-border);
}
.pending-changes-diff {
  margin-top: 0.4rem;
}
/* ==== END plan-1e4b3ada stage-41751a34 ==== */

/* ---- PR 1028 team-wide rooms roster: quiet human/agent count on the
   Active rooms ticker's showing room (one-glance, A3 grammar). Same mono
   data-voice recipe as .felt-l1-room-ticker-count / .felt-l1-position-text
   (views/entity/felt-l1.js). ---- */
.felt-l1-room-ticker-participants {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   Personal home — Phase 2 shell (plan-1e85d64c stage-d1ec0142;
   design-note-personal-home §1, dec-0cc2d205 / design-note-phase0 §1/§6,
   dec-4a8b69e5). Append-only; reuses existing color/type/radius tokens — no
   new tokens. Covers the shared header (context home + identity switcher +
   triad), the greeting band, the cross-context rooms band, and the For-You
   hero mount point. NO count/pending chrome anywhere (A5 §1).
   ============================================================================ */

/* ---- Shared header: identity switcher + triad doors ----
   Scoped to `.ph-shared-header` so the bare `userBar` on other surfaces is
   untouched. The finder slot starts the right-hand cluster, keeping the
   signed order home · identity · triad · finder · avatar. */
.ph-shared-header #header-finder-btn { margin-left: auto; }
.ph-shared-header .header-nav { gap: 0.1rem; }
.ph-shared-header .header-nav-home {
  flex: 0 0 auto;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
}
.ph-shared-header .header-nav-home .zero-mark {
  width: 1.3rem;
  height: 1.3rem;
}
.ph-shared-header .header-nav-home:hover { background: var(--color-bg-surface); }

.ph-context-home {
  display: block;
  min-width: 0;
  max-width: 40vw;
  padding: 0.28rem 0.2rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: var(--compat-type-9);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.ph-context-home:hover { background: var(--color-bg-surface); }

.ph-identity-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid transparent;
  height: 2rem;
  margin-left: 0.15rem;
  padding: 0;
  width: 2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  font-family: inherit;
  font-size: var(--compat-type-72);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.ph-identity-switcher:hover,
.ph-identity-switcher[aria-expanded="true"] {
  background: var(--color-bg-sunken);
  border-color: var(--color-decorative-gray);
  color: var(--color-text-primary);
}
.ph-identity-switcher:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
}
.ph-identity-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-identity-caret {
  color: currentColor;
  flex: 0 0 auto;
  height: 1rem;
  width: 1rem;
}

.ph-triad {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0 0.5rem 0 0.9rem;
}
.ph-triad-door {
  font-size: var(--compat-type-82);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.ph-triad-door:hover { background: var(--color-bg-surface); color: var(--color-text-primary); }
.ph-triad-door-active {
  background: var(--color-bg-sunken);
  color: var(--color-text-primary);
  font-weight: 600;
}
.ph-primary-nav-trigger {
  display: none;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.76rem;
  min-width: 0;
  padding: 0.32rem 0.45rem;
  white-space: nowrap;
}
.ph-primary-nav-trigger:hover {
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}
.ph-primary-nav-caret { color: var(--color-text-tertiary); font-size: var(--compat-type-85); }
.ov-menu-primary-nav { min-width: 10rem; }

@media (max-width: 640px) {
  .ph-shared-header {
    justify-content: flex-start;
    gap: 0.25rem;
    min-width: 0;
    flex-wrap: nowrap;
  }
  .ph-shared-header.header-bar-inner { padding-left: 0.75rem; padding-right: 0.75rem; }
  .ph-shared-header .header-nav {
    order: 1;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
  }
  .ph-context-home {
    flex: 0 1 auto;
    max-width: none;
  }
  .ph-shared-header #header-finder-btn {
    order: 3;
    flex: 0 0 auto;
    margin-left: 0;
  }
  .ph-shared-header .header-finder-kbd { display: none; }
  .ph-primary-nav-trigger { display: inline-flex; order: 2; }
  .ph-shared-header .header-user { order: 4; flex: 0 0 auto; }
  .ph-triad {
    display: none;
  }
}

@media (max-width: 340px) {
  .ph-context-home { max-width: 7rem; }
}

/* ---- Greeting band (§2) ---- */
.ph-greeting { margin-bottom: 1.4rem; }
.ph-greeting-line {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  color: var(--color-text-primary);
}
.ph-focus-pin {
  margin: 0.4rem 0 0;
  font-size: 0.98rem;
  color: var(--color-text-secondary);
  max-width: 62ch;
}

/* ---- Personal calm surface (plan-e01e94aa) ---- */
.home-compass,
.home-signals,
.home-site-updates,
.home-today,
.home-warm-rooms {
  margin-bottom: 1.7rem;
}
.home-compass { margin-top: 0.2rem; }
.home-compass .ph-greeting-line { margin-bottom: 1.25rem; }
.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.45rem;
}
.home-section-head .ops-eyebrow { margin: 0; }
.home-compass-content,
.home-today-row,
.home-signal-row,
.home-warm-room-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.home-compass-copy,
.home-row-copy { min-width: 0; flex: 1 1 auto; }
.home-compass-title {
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}
.home-compass-summary,
.home-row-summary {
  margin: 0.22rem 0 0;
  color: var(--color-text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
}
.home-compass-meta,
.home-row-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
  color: var(--color-text-tertiary);
  font-family: var(--type-family-body);
  font-size: var(--compat-type-72);
}
.home-row-list { list-style: none; margin: 0; padding: 0; }
.home-signal-row,
.home-warm-room-row,
.home-site-update-row {
  padding: 0.65rem 0;
  border-top: 1px solid var(--color-border-subtle);
}
.home-signal-row:first-child,
.home-warm-room-row:first-child,
.home-site-update-row:first-child { border-top: none; }
.home-signal-mark {
  flex: 0 0 auto;
  width: 1rem;
  color: var(--color-text-tertiary);
  text-align: center;
}
.home-row-title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 0.94rem;
  font-weight: 550;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.home-row-time { color: var(--color-text-tertiary); white-space: nowrap; }
.home-row-action,
.home-primary-action { flex: 0 0 auto; min-height: 2.5rem; display: inline-flex; align-items: center; }
.home-signals-more {
  padding: 0.65rem 0;
  border-top: 1px solid var(--color-border-subtle);
  font-size: 0.88rem;
}
.home-state-note {
  margin: 0;
  color: var(--color-text-tertiary);
  font-size: 0.88rem;
  line-height: 1.45;
}
.home-state-note { margin-top: 0.4rem; font-size: var(--compat-type-78); }

@media (max-width: 640px) {
  .home-compass-content,
  .home-today-row,
  .home-signal-row,
  .home-warm-room-row,
  .home-site-update-row {
    align-items: stretch;
    flex-direction: column;
    gap: 0.55rem;
  }
  .home-signal-mark { display: none; }
  .home-row-action,
  .home-primary-action { align-self: flex-start; min-height: 2.75rem; }
}

/* ---- Cross-context rooms band (§3) ---- */
.ph-rooms-band { margin-bottom: 1.6rem; }
.ph-rooms-band .ops-eyebrow { margin-bottom: 0.55rem; }

.ph-rooms-ticker { margin-bottom: 0.7rem; }
.ph-rooms-ticker-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ph-rooms-ticker-name {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  text-decoration: none;
}
.ph-rooms-ticker-name:hover { text-decoration: underline; }
.ph-rooms-next {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
/* Mono data-voice (Stage 4 recipe, shared with .felt-l1-room-ticker-count):
   counts/meta read as instrument, not prose. */
.ph-rooms-count,
.ph-rooms-participants,
.ph-rooms-position,
.ph-room-resume-time {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}
.ph-rooms-position { margin-top: 0.2rem; min-height: 0.9rem; }
.ph-room-context {
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.05rem 0.4rem;
}

/* Resume strip — your live/paused rooms, "pick up where you left off". */
.ph-rooms-resume { list-style: none; margin: 0; padding: 0; }
.ph-room-resume-row { border-top: 1px solid var(--color-border-subtle); }
.ph-room-resume-row:first-child { border-top: none; }
.ph-room-resume-link {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: var(--compat-space-5) 0;
  text-decoration: none;
  color: var(--color-text-secondary);
}
.ph-room-resume-link:hover .ph-room-resume-name { color: var(--color-text-primary); }
.ph-room-resume-name { font-size: 0.92rem; color: var(--color-text-secondary); }
.ph-room-status {
  font-family: var(--type-family-body);
  font-size: var(--compat-type-68);
  color: var(--color-text-tertiary);
  /* Register rule (dec-f92d25b7): lifecycle states read as quiet lowercase
     text ("paused"), never an ALL-CAPS badge. */
  text-transform: lowercase;
  letter-spacing: 0.04em;
}
.ph-room-resume-time { margin-left: auto; }
.ph-room-resume-more {
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--compat-space-5) 0;
}

.ph-rooms-partial {
  margin: -0.2rem 0 0.65rem;
  font-size: var(--compat-type-82);
  color: var(--color-text-tertiary);
}


/* ---- For-You hero mount point (§1 item 4) ----
   Phase 2 lays only the container with the A3 §5 empty-state grammar; the
   four-tier felt flow lands in Phase 3. Quiet, no CTA, no panel chrome. */
.ph-for-you { margin-bottom: 1.6rem; }
.ph-for-you-placeholder {
  margin: 0;
  font-size: var(--compat-type-9);
  color: var(--color-text-tertiary);
}

/* ============================================================================
   Personal home — Phase 3: the four-tier For-You hero (plan-1e85d64c
   stage-507368f4; design-note-personal-home §1/§2, dec-0cc2d205). Append-only;
   reuses existing color/type/radius tokens — NO new tokens; theme-aware via
   the same semantic tokens the rest of the surface uses (light + dark).
   ONE vertical felt flow, weight-from-order (Cybersyn v2): pigment appears
   ONLY on an algedonic row, never to decorate a tier. Rows reuse the badge /
   btn / quiet-link / ph-room-context grammar already on the page.
   ============================================================================ */

/* Active context-filter chips (A3 tag-tap). filter-chip-row carries its own
   bottom border/margin; this wrapper only reserves a little breathing room. */
.ph-foryou-filter { margin-bottom: 0.4rem; }

/* One tier = a section in the single flow. Distinguished by line-grammar and
   order, not by pigment. */
.ph-foryou-tier { margin-bottom: 1.4rem; }
.ph-foryou-tier:last-of-type { margin-bottom: 0.9rem; }
.ph-foryou-tier-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.ph-foryou-tier-head .ops-eyebrow { margin: 0; }
/* For you section names are legible text, not instrument values. Keep the
   approved ordinary-case treatment scoped to this destination's tiers. */
.person-for-you-wrap .ph-foryou-tier-head .ops-eyebrow {
  font-family: var(--type-family-body);
  font-size: var(--type-body-size);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-primary);
}

.ph-foryou-list { list-style: none; margin: 0; padding: 0; }

/* A row: primary target (badge + title / liveness) · context tag · actions. */
.ph-foryou-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--color-border-subtle);
}
.ph-foryou-row:first-child { border-top: none; }
.ph-foryou-main {
  min-width: 0;
  flex: 1 1 60%;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text-primary);
}
.ph-foryou-title {
  min-width: 0;
  color: var(--color-text-secondary);
  overflow-wrap: anywhere;
}
.ph-foryou-main:hover .ph-foryou-title {
  color: var(--color-text-primary);
  text-decoration: underline;
}

/* Actor marker (waiting-on-you) — the single element marking who is waiting;
   quiet glyph in secondary voice, never pigment. */
.ph-foryou-actor {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-9);
  flex: 0 0 auto;
}

/* Mono data-voice for the readouts (shared recipe with .ph-rooms-* meta):
   instrument, not prose. */
.ph-foryou-liveness,
.ph-foryou-time {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-72);
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Per-row context tag — a tappable A3 chip (button reset over .ph-room-context
   pill styling). Tapping filters the whole hero to that context. */
.ph-foryou-context {
  flex: 0 0 auto;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s, border-color 0.12s;
}
.ph-foryou-context:hover {
  color: var(--color-text-secondary);
  border-color: var(--color-border-default);
}

.ph-foryou-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin-left: auto;
}

/* Algedonic piercing — the ONLY escalating class: saturated, a left accent in
   the existing danger token. Everything else stays calm. */
.ph-foryou-row.is-algedonic {
  border-left: 2px solid var(--color-border-default);
  padding-left: 0.6rem;
  margin-left: -0.62rem;
}
.ph-foryou-row.is-algedonic .ph-foryou-title { color: var(--color-text-primary); }

/* A disposition that failed to land — quiet danger cue, row stays for retry. */
.ph-foryou-row-error .ph-foryou-title { color: var(--color-text-secondary); }

/* Empty tier — quiet order, no panel, no CTA (A3 §5). */
.ph-foryou-partial {
  margin: 0 0 0.45rem;
  font-size: var(--compat-type-82);
  color: var(--color-text-tertiary);
}

/* The single foot link to the depth view — the receded region does NOT render
   on the hero (design §1); this is the one door to it. */
.ph-foryou-foot {
  margin-top: 0.6rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--color-border-subtle);
}

@media (max-width: 640px) {
  .ph-foryou-main { flex-basis: 100%; }
  .ph-foryou-actions { margin-left: 0; }
}

/* ============================================================================
   Personal home — Phase 4: first-run / cold-start + calm-system (plan-1e85d64c
   stage-75a984bf; design-note-personal-home §1, dec-0cc2d205 / design-note-
   phase0 §5, dec-4a8b69e5; operator direction 2026-07-13 — onboarding OFF the
   home). Append-only; reuses existing color/type/radius tokens — NO new tokens;
   theme-aware via the same semantic tokens (light + dark). Covers the quiet
   setup notice at the foot and the per-item age.
   ============================================================================ */

/* The quiet setup notice — the ONLY onboarding-shaped element on the home
   (operator direction 2026-07-13), and only while setup remains. A single
   low-attention line at the foot, near the footer/assurance — never above the
   greeting, never competing with the hero. It opens to its own page; the home
   carries no onboarding flow. A quiet top rule separates it as a receded
   low-attention region below the hero (never louder than the hero above it). */
.ph-setup-notice {
  margin-top: 1.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--color-border-subtle);
  font-size: var(--compat-type-82);
  color: var(--color-text-tertiary);
}

/* Per-item age on directed rows (waiting + needs) — the calm-system recede
   grammar's client surface. Reuses the .ph-foryou-time mono data-voice recipe;
   sits between the context tag and the actions, reading right-aligned as the
   actions cluster pushes to the row end. Quiet, never pigment. */
.ph-foryou-age { flex: 0 0 auto; }

@media (max-width: 640px) {
  /* On narrow rows the age drops below the title/tag with the wrapped actions;
     keep it quiet and out of the way rather than competing for the first line. */
  .ph-foryou-age { order: 5; }
}

/* ==== BEGIN stage-d43d1eeb: responsive + power-user density ====
   plan-6f3b3943 stage-d43d1eeb. Append-only per this stage's file fence —
   nothing above this marker is edited, only new selectors added below it.
   Two jobs:
     1. A small, targeted responsive audit fix-list for the deep views
        (Action lenses, Knowledge, Artifacts, entity Settings) and the
        act/aware home — the existing @media coverage built up across
        A2/A3/A5/A6 (panel-window-split stacking, act-aware-triad/felt-
        l1-layout collapse, header-finder icon-only, kanban self-
        contained scroll) already carries most of this; the gaps closed
        here are long-unbroken-string rows that can force page-level
        horizontal scroll on narrow viewports.
     2. The density lever's actual effect on deep-view rows: every rule
        below is scoped to `html[data-density="compact"]`, stamped by
        lib/density-mode.js (index.html's pre-paint bootstrap script reads
        the same 'zero-density' key so there's no flash on load) and
        toggled from the avatar dropdown (user-bar.js) or the Settings/
        Display panel (theme-pack-switcher.js) — comfortable (no
        attribute) is unchanged and stays the default everywhere.
   Zero new tokens: every value below is an existing --space-*/--type-*
   custom property (tokens/house.css) or a literal already used elsewhere
   in this file for the same row class of component (list rows, table
   cells, card meta) — the compact rules only apply the existing scale
   more tightly to the specific deep-view/act-aware selectors, they don't
   introduce new sizes. The generic panel/composer/page-y compact
   overrides already wired via tokens/house.tokens.json's
   semantic-density-compact group (consumed automatically wherever a rule
   binds one of those panel/page-y/composer space custom properties) are
   untouched and unextended here — this section only covers the deep-view
   row/table/card classes that use their own literal paddings instead of
   those. */

/* ---- 1. Responsive audit fixes ----
   `.item`/`.ledger-line-text`/`.timeline-entry-title` are flex children
   with no min-width override; ordinary spaced titles already wrap fine
   (a flex item's content-based min-width is its widest WORD, not its full
   line), but an unbroken token — an id, slug, or URL landing in a title —
   has no break opportunity and can push the row (and so the page) wider
   than the viewport. min-width: 0 lets the item actually shrink to the
   row; overflow-wrap: anywhere gives the browser somewhere to break an
   unbroken run once it does. Covers Knowledge's index list, entity
   Settings' membership rows (both use .item), the decisions lens's
   .plan-card.item rows, the decisions ledger, and the activity timeline. */
.item-name,
.ledger-line-text,
.timeline-entry-title {
  min-width: 0;
  overflow-wrap: anywhere;
}
.member-row .member-id { min-width: 0; overflow-wrap: anywhere; flex-wrap: wrap; }
.member-row .member-id .badge { flex-shrink: 0; white-space: nowrap; }
.member-controls { flex-shrink: 0; }
@media (max-width: 600px) {
  .member-row { flex-direction: column; align-items: flex-start; gap: var(--space-xs); }
  .member-row .member-id { width: 100%; }
  .member-controls { flex-wrap: wrap; max-width: 100%; }
}

/* Person-scoped depth rows combine a title, lifecycle metadata, and a source
   context from several entities. Keep their wrapping contract local: the
   generic .item row is also used by dense entity panels whose layout should
   remain unchanged. Reset the person lists' UA inset, then give Action a
   stable title/meta/action rhythm instead of letting each value compete for
   the last flex line. */
:is(
  .person-action-waiting-list,
  .person-action-needs-list,
  .person-action-rooms-list,
  .person-artifacts-list
) {
  min-width: 0;
  margin: 0;
  padding: 0;
}
.person-action-row {
  align-items: start;
  display: grid;
  gap: 0.35rem 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  padding-block: 0.65rem;
}
.person-action-primary {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}
.person-action-primary > .item-name {
  flex: 1 1 14rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.person-action-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  grid-column: 1;
  min-width: 0;
}
.person-action-meta > * {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
.person-action-meta > .ph-room-context {
  /* Override the non-shrinking For You chip contract only in these rows. */
  flex-shrink: 1;
  max-width: 100%;
}
.person-action-actions {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-content: flex-end;
}

@media (max-width: 480px) {
  .person-action-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .person-action-meta,
  .person-action-actions {
    grid-column: 1;
  }
  .person-action-actions {
    grid-row: auto;
    justify-self: end;
  }
  .plan-card-meta {
    flex-wrap: wrap;
    padding-left: 0;
  }
  .plans-board-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .plans-board-nav-title {
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

/* ---- 2. Density lever: deep-view row/table/card tuning ----
   Action lenses (timeline, decisions/ledger, kanban) + Knowledge (index
   list, collection tables) + entity Settings (membership rows) share the
   .item/.item-list list-row component; one compact rule covers all three
   surfaces' plain rows at once, same as the existing panel/composer
   tokens do for panel chrome. */
html[data-density="compact"] .item {
  padding: var(--space-3xs) 0;
}
html[data-density="compact"] .item-name {
  font-size: var(--type-small-size);
}
html[data-density="compact"] .item-date {
  font-size: 0.62rem;
}

/* Action — activity timeline (timeline-entity-panel.js, CSS-only per this
   stage's file fence: the component's own logic is untouched). */
html[data-density="compact"] .timeline-entry {
  padding: var(--space-3xs) var(--space-2xs);
  font-size: var(--type-small-size);
}
html[data-density="compact"] .timeline-day-header,
html[data-density="compact"] .timeline-altitude-toggle {
  margin-bottom: var(--space-2xs);
}
html[data-density="compact"] .timeline-day + .timeline-day {
  margin-top: var(--space-xs);
}

/* Action — decisions lens (list rows share .plan-card.item, already
   covered by the .item rule above; the ledger view below is its own
   layout, decisions-entity-panel.js untouched, CSS-only). */
html[data-density="compact"] .ledger-line {
  padding: var(--space-2xs) var(--space-3xs);
}
html[data-density="compact"] .ledger-line-text {
  font-size: var(--type-small-size);
}
html[data-density="compact"] .decisions-ledger {
  padding: var(--space-2xs) 0;
}
html[data-density="compact"] .decisions-ledger-chips:not(:empty) {
  margin-bottom: var(--space-xs);
}

/* Action — issues (queue kanban, issue-entity-panel.js untouched,
   CSS-only): tighter column padding/gap and card meta rhythm. The 44px+
   card-header hit target (decision 1, disclosure component) is untouched —
   only the surrounding whitespace tightens. */
html[data-density="compact"] .panel-window-columns {
  padding: var(--space-xs);
  gap: var(--space-2xs);
}
html[data-density="compact"] .panel-window-column {
  padding: var(--space-2xs);
}
html[data-density="compact"] .panel-window-column-body {
  gap: var(--space-2xs);
}
html[data-density="compact"] .panel-window-card {
  padding: var(--space-xs);
}
html[data-density="compact"] .kanban-card-meta {
  margin-top: var(--space-3xs);
}

/* Artifacts — publications list rows. */
html[data-density="compact"] .publications-description {
  margin-top: var(--space-3xs);
  font-size: var(--compat-type-72);
}
html[data-density="compact"] .publications-actions {
  margin-top: var(--space-3xs);
  gap: var(--space-3xs);
}

/* entity Settings — section rhythm (membership rows covered by .item
   above). */
html[data-density="compact"] .entity-settings-section {
  margin-bottom: var(--space-sm);
}

/* ---- 3. PR 999's density impulse -> act/aware surface, compact-only ----
   PR 999 ("Compact context compass") first shipped a denser felt-L1
   entity/context variant; the labs design review (2026-07-10) reconciled
   its specific relabels/suppressions against signed canon in A1 but
   carried its underlying compactness impulse forward here, to land as an
   OPT-IN density-lever effect, not the standing default. .felt-l1-compact
   (felt-l1.js's own variant === 'compact' structural class for entity/
   context pages, distinct from this density attribute) already carries
   PR 999's shipped baseline; the rules below tighten it further only
   when the viewer has also chosen compact density — the personal
   dashboard's full felt-l1 hero (not .felt-l1-compact) is deliberately
   untouched, matching the file's existing "keeps its existing flow"
   comment above. felt-l1.js logic is untouched — CSS +
   the density attribute only, per this stage's file fence. */
html[data-density="compact"] .felt-l1-compact {
  padding: var(--space-xs) 0 var(--space-sm);
}
html[data-density="compact"] .felt-l1-compact .felt-l1-purpose {
  margin-bottom: var(--space-2xs);
}
html[data-density="compact"] .felt-l1-compact .felt-l1-focus {
  font-size: var(--type-body-size);
}
html[data-density="compact"] .felt-l1-compact .felt-l1-gist {
  margin-top: var(--space-3xs);
  font-size: var(--type-small-size);
}
html[data-density="compact"] .felt-l1-compact .felt-l1-attention {
  margin-top: var(--space-xs);
}
html[data-density="compact"] .felt-l1-compact .felt-l1-attention-title {
  margin-bottom: var(--space-3xs);
}
html[data-density="compact"] .felt-l1-compact .felt-l1-attention-item {
  padding: var(--space-3xs) 0;
  font-size: var(--type-micro-size);
}
html[data-density="compact"] .felt-l1-layout {
  gap: var(--space-md);
}
html[data-density="compact"] .felt-l1-secondary {
  padding-left: var(--space-sm);
}

/* act/aware home — triad + loop rhythm (views/entity/index.js untouched,
   CSS-only). */
html[data-density="compact"] .act-aware-triad {
  gap: var(--space-xs);
}
html[data-density="compact"] .act-aware-loop {
  gap: var(--space-2xs);
}

/* ==== END stage-d43d1eeb ==== */
/* ==========================================================================
   Room-state chip — Active rooms ticker (plan-3a91ef1f, signed dec-de68c9cf §6)
   ==========================================================================
   One chip per room in the entity and personal-home room tickers, fed by the
   enriched room projections (erroredAt / waitingOnYou / agent participant).
   Highest-priority state wins: errored earns the pigment, needs-you the
   accent, working stays quiet. Existing tokens only. */
.felt-l1-room-state {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: var(--compat-type-7);
  border: 1px solid transparent;
  white-space: nowrap;
}
.room-state-working {
  color: var(--color-text-secondary);
  border-color: var(--color-border-subtle);
}
.room-state-waiting {
  color: var(--color-accent-default);
  border-color: var(--color-accent-default);
}
.room-state-errored {
  color: var(--color-status-danger-fg);
  background: var(--color-status-danger-bg);
  border-color: var(--color-status-danger-border);
}
/* ==== END Room-state chip ==== */

/* ==========================================================================
   Person-scoped room detail — /rooms/:roomId
   ========================================================================== */
.room-detail-wrap {
  max-width: calc(980px + 2 * var(--space-page-x));
  padding-bottom: var(--compat-space-3);
}
.room-detail-wrap #room-detail-content { margin-top: 2rem; }
.room-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.room-detail-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.room-detail-hero h1 {
  margin: 0.2rem 0 0.55rem;
  color: var(--color-text-primary);
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1.12;
}
.room-detail-about {
  margin: 0 0 0.85rem;
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
}
.room-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}
.room-detail-date {
  color: var(--color-text-tertiary);
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-7);
}
.room-detail-status-live,
.room-detail-status-paused,
.room-detail-status-closed {
  color: var(--color-text-secondary);
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-default);
}
.room-detail-card {
  padding: var(--compat-space-1) 1.1rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
}
.room-detail-card h2,
.room-detail-history h2 {
  margin: 0 0 0.55rem;
  color: var(--color-text-primary);
  font-size: var(--compat-type-9);
}
.room-detail-enter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.room-detail-enter h2 { margin-bottom: 0.2rem; }
.room-detail-view-only,
.room-detail-recovery {
  margin: 0;
  padding: 0.75rem 0.9rem;
  color: var(--color-text-secondary);
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
}
.room-detail-recovery { font-size: var(--compat-type-8); }
.room-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.room-detail-plan { display: flex; flex-direction: column; }
.room-detail-active-plans > ul,
.room-detail-closed-strands > ul,
.room-detail-ownership-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.room-detail-active-plans > ul {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.room-detail-ownership-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.room-detail-ownership-list li {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.room-detail-ownership-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.room-detail-ownership-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--color-text-primary);
  font-size: var(--compat-type-8);
}
.room-detail-ownership-holder { font-weight: 600; }
.room-detail-ownership-live,
.room-detail-ownership-scope {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-68);
}
.room-detail-ownership-scope { display: block; margin-top: 0.15rem; }
.room-detail-ownership-list p {
  margin: 0.4rem 0 0.3rem;
  color: var(--color-text-secondary);
  font-size: var(--compat-type-75);
  line-height: 1.45;
}
.room-detail-active-plans li,
.room-detail-closed-strands li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}
.room-detail-closed-strands li p {
  margin: 0.2rem 0 0;
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-7);
  line-height: 1.4;
}
.room-detail-active-plans li > span,
.room-detail-closed-strands li > span:last-child,
.room-detail-strand-context {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-68);
}
.room-detail-work { display: flex; flex-direction: column; gap: 0.75rem; }
.room-detail-strands {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0.8rem;
}
.room-detail-strand-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.room-detail-strand h3 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 0.84rem;
}
.room-detail-strand p {
  margin: 0.4rem 0 0.55rem;
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  line-height: 1.45;
}
.room-detail-closed-strands {
  padding: 0.8rem var(--compat-space-1);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  background: var(--color-bg-surface);
}
.room-detail-closed-strands summary {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  font-weight: 600;
}
.room-detail-closed-strands > ul { margin-top: 0.65rem; }
.room-detail-closed-strands li {
  padding: 0.4rem 0;
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-75);
}
.room-detail-participants,
.room-detail-outputs > ul,
.room-detail-timeline-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.room-detail-participants {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.room-detail-participants li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--color-text-primary);
  font-size: var(--compat-type-8);
}
.room-detail-participant-kind,
.room-detail-output-kind {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-68);
}
.room-detail-outputs { grid-column: 1 / -1; }
.room-detail-output {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, auto);
  align-items: flex-start;
  gap: 0.75rem 1.25rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: var(--compat-type-8);
}
.room-detail-output-label {
  color: var(--color-text-primary);
  line-height: 1.4;
}
.room-detail-output-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: right;
}
.room-detail-output-links .quiet-link,
.room-detail-output-kind {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  display: inline-flex;
  padding: 0.16rem var(--compat-space-5);
  text-decoration: none;
  white-space: nowrap;
}
.room-detail-output-links .quiet-link:hover {
  background: var(--color-bg-sunken);
  border-color: var(--color-border-default);
}
.room-detail-output:last-child { border-bottom: 0; }
.room-detail-history {
  padding-top: var(--compat-space-25);
}
.room-detail-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.room-detail-section-head h2 { margin: 0; }
.room-detail-section-head > span {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-68);
}
.room-detail-timeline {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0 0;
}
.room-detail-timeline-row {
  display: grid;
  grid-template-columns: 0.75rem minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.65rem 0;
}
.room-detail-timeline-marker {
  width: 0.42rem;
  height: 0.42rem;
  margin-top: 0.38rem;
  border: 1px solid var(--color-border-default);
  border-radius: 50%;
  background: var(--color-bg-surface);
}
.room-detail-timeline-copy {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.room-detail-timeline-row:last-child .room-detail-timeline-copy { border-bottom: 0; }
.room-detail-timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.room-detail-timeline-title {
  color: var(--color-text-primary);
  font-size: var(--compat-type-82);
  font-weight: 600;
}
.room-detail-timeline-copy p {
  margin: 0.2rem 0 0;
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
}
.room-detail-timeline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
  font-size: var(--compat-type-72);
}
.room-detail-history-more { padding-top: 0.6rem; }
.room-detail-activity { padding-top: var(--compat-space-25); }
.room-detail-activity-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0 0;
}
.room-detail-activity-row {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.room-detail-activity-row:last-child { border-bottom: 0; }
.room-detail-activity-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
}
.room-detail-activity-author {
  color: var(--color-text-primary);
  font-size: var(--compat-type-8);
  font-weight: 600;
}
.room-detail-activity-kind {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-68);
  text-transform: none;
  letter-spacing: normal;
}
.room-detail-activity-text {
  margin: 0.25rem 0 0;
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  overflow-wrap: anywhere;
}
.room-detail-activity-more { padding-top: 0.6rem; }
.room-detail-activity-unavailable { display: grid; gap: 0.5rem; justify-items: start; }
.room-detail-hero-actions, .room-members-heading, .room-member-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.room-members-heading { justify-content: space-between; }
.room-members-heading h2 { margin: 0; }
.room-members-list { list-style: none; padding: 0; margin: 1rem 0; }
.room-member { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: var(--compat-space-1) 0; border-bottom: 1px solid var(--color-border-subtle); }
.room-member > div { min-width: 0; overflow-wrap: anywhere; }
.room-member p { margin: 0.35rem 0 0; }
.room-members-add { display: grid; gap: 0.75rem; max-width: 34rem; margin-top: 1rem; }
.room-members-add > label { display: grid; gap: 0.4rem; }
.room-member-confirm { padding: var(--compat-space-1); margin-top: 1rem; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); overflow-wrap: anywhere; }
.room-members-notice { min-height: 1.5em; }
@media (max-width: 768px) {
  .room-member { flex-direction: column; }
  .room-member-actions, .room-detail-hero-actions { width: 100%; }
  .room-member-confirm .btn { margin: 0.3rem 0; white-space: normal; }
}
.room-detail-unavailable {
  max-width: 34rem;
  margin: 4rem auto;
  text-align: center;
}
.room-detail-unavailable h1 {
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
  font-size: 1.35rem;
}
.room-detail-unavailable .btn { margin-top: 0.75rem; }

@media (max-width: 680px) {
  .room-detail-wrap #room-detail-content { margin-top: 1.35rem; }
  .room-detail-hero,
  .room-detail-enter,
  .room-detail-timeline-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .room-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .room-detail-strand-head,
  .room-detail-active-plans li,
  .room-detail-closed-strands li { align-items: flex-start; flex-direction: column; }
  .room-detail-outputs { grid-column: auto; }
  .room-detail-enter .room-enter-copy { width: 100%; }
  .room-detail-enter .room-enter-copy-btn { flex: 1; }
}
/* ==== END Person-scoped room detail ==== */

/* ==== Publisher Site controls ==== */
.site-controls-page { max-width: calc(780px + 2 * var(--space-page-x)); min-width: 0; }
.site-controls-heading {
  align-items: flex-start;
  display: flex;
  gap: var(--space-lg);
  justify-content: space-between;
  margin: 1.5rem 0 1rem;
}
.site-controls-heading h1 { font-size: 1.45rem; margin: 0; }
.site-controls-heading p { color: var(--color-text-secondary); margin: .35rem 0 0; max-width: 38rem; }
.site-controls-summary { align-items: center; display: flex; flex: 0 0 auto; gap: .65rem; }
.site-controls-summary > span { display: grid; gap: .1rem; text-align: right; }
.site-controls-summary small { color: var(--color-text-tertiary); font-size: var(--compat-type-72); text-transform: capitalize; }
.site-controls-status { min-height: 1.2rem; color: var(--color-text-secondary); margin: 0 0 .75rem; }
.site-controls-status[data-kind="ok"] { color: var(--color-status-success-fg); }
.site-controls-status[data-kind="error"] { color: var(--color-status-danger-fg); }
.site-controls-primary {
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 1rem;
  padding: var(--compat-space-1);
}
.site-controls-primary > .entity-settings-section-title { margin: 0; }
.site-controls-overview, .site-controls-lists, .site-controls-advanced-grid, .site-controls-analytics { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.site-controls-overview { margin: 0; }
.site-controls-overview dt { color: var(--color-text-secondary); font-size: var(--compat-type-75); text-transform: none; }
.site-controls-overview dd { margin: .2rem 0 0; overflow-wrap: anywhere; }
.site-controls-modes { border: 0; display: grid; gap: .5rem; margin: 0; padding: 0; }
.site-controls-modes > .site-controls-hint { margin: 0 0 .25rem; }
.site-controls-mode-option {
  align-items: start;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: grid;
  gap: .2rem .6rem;
  grid-template-columns: auto 1fr;
  padding: .75rem;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.site-controls-mode-option:hover { background: var(--color-bg-sunken); }
.site-controls-mode-option:has(input:checked) { background: var(--color-accent-subtle-bg); border-color: var(--color-accent-default); box-shadow: 0 0 0 1px var(--color-accent-default); }
.site-controls-mode-option input { accent-color: var(--color-accent-default); margin-top: .18rem; }
.site-controls-mode-option:has(input:focus-visible) { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.site-controls-mode-label { font-weight: 650; }
.site-controls-mode-hint { color: var(--color-text-secondary); font-size: var(--compat-type-8); grid-column: 2; }
.site-controls-audience { border-top: 1px solid var(--color-border-subtle); display: grid; gap: .75rem; padding-top: var(--compat-space-1); }
.site-controls-audience[hidden], .site-controls-deny[hidden] { display: none; }
.site-controls-audience h3, .site-controls-deny h3, .site-controls-journey h3, .site-controls-disclosure-body h3 { font-size: var(--compat-type-9); margin: 0; }
.site-controls-audience h3 + p, .site-controls-deny h3 + p { margin: .2rem 0 0; }
.site-controls-field { display: grid; gap: .3rem; min-width: 0; }
.site-controls-field > span:first-child { font-size: var(--compat-type-8); font-weight: 600; }
.site-controls-field textarea, .site-controls-field input, .site-controls-field select {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  color: var(--color-text-primary);
  font: inherit;
  font-size: .84rem;
  min-width: 0;
  padding: .55rem .65rem;
  width: 100%;
}
.site-controls-field textarea:focus-visible, .site-controls-field input:focus-visible, .site-controls-field select:focus-visible { border-color: var(--color-focus-ring); outline: 2px solid var(--color-focus-ring); outline-offset: 1px; }
.site-controls-field [aria-invalid="true"] { border-color: var(--color-status-danger-fg); }
.site-controls-field textarea { min-height: 5rem; resize: vertical; }
.site-controls-hint, .site-controls-privacy-notice { color: var(--color-text-secondary); font-size: var(--compat-type-82); }
.site-controls-field-error { color: var(--color-status-danger-fg); font-size: var(--compat-type-78); margin: 0; }
.site-controls-field-error:empty { display: none; }
.site-controls-journey { background: var(--color-bg-sunken); border-radius: var(--radius-md); display: grid; gap: .35rem; padding: .8rem; }
.site-controls-journey p { color: var(--color-text-secondary); font-size: var(--compat-type-82); margin: 0; }
.site-controls-journey p + p { margin-top: .3rem; }
.site-controls-disclosure { border-top: 1px solid var(--color-border-subtle); margin: 0; min-width: 0; }
.site-controls-disclosure > summary.disclosure-summary { padding: .55rem 0; }
.site-controls-disclosure > summary > span { display: grid; gap: .1rem; }
.site-controls-disclosure > summary small { color: var(--color-text-tertiary); font-size: .76rem; font-weight: 400; }
.site-controls-disclosure-body { display: grid; gap: 1rem; padding: .45rem 0 var(--compat-space-1) var(--compat-space-1_5); }
.site-controls-advanced-grid { align-items: start; }
.site-controls-input-suffix { align-items: center; display: grid; gap: .45rem; grid-template-columns: minmax(0, 8rem) auto; }
.site-controls-input-suffix > span { color: var(--color-text-secondary); font-size: var(--compat-type-8); }
.site-controls-deny { border-top: 1px solid var(--color-border-subtle); display: grid; gap: .75rem; padding-top: var(--compat-space-1); }
.site-controls-actions { align-items: center; display: flex; justify-content: flex-end; }
.site-controls-page > .site-controls-disclosure { border-bottom: 1px solid var(--color-border-subtle); }
.site-controls-page > .site-controls-disclosure + .site-controls-disclosure { margin-top: -1.4rem; }
.site-controls-danger[open] { border-bottom-color: var(--color-status-danger-border); }
.site-controls-danger .site-controls-disclosure-body { border-left: 2px solid var(--color-status-danger-border); margin-bottom: 1rem; padding: var(--compat-space-25) 0 var(--compat-space-25) var(--compat-space-1); }
.site-controls-diagnostics-section { border-top: 1px solid var(--color-border-subtle); display: grid; gap: .75rem; padding-top: var(--compat-space-1); }
.site-controls-entries { display: grid; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.site-controls-entries li { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; overflow-wrap: anywhere; }
.site-controls-stat { background: var(--color-bg-sunken); border-radius: 8px; display: grid; gap: .2rem; padding: .75rem; }
.site-controls-stat strong { font-size: 1.5rem; }
.site-controls-events-wrap { max-width: 100%; overflow-x: auto; }
.site-controls-events { border-collapse: collapse; min-width: 560px; width: 100%; }
.site-controls-events th, .site-controls-events td { border-bottom: 1px solid var(--color-border-default); padding: var(--compat-space-5); text-align: left; }
.site-controls-agent-view { display: grid; gap: .75rem; min-width: 0; }
.site-controls-agent-meta { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 0; }
.site-controls-agent-meta dt { color: var(--color-text-secondary); font-size: var(--compat-type-75); text-transform: none; }
.site-controls-agent-meta dd { margin: .2rem 0 0; overflow-wrap: anywhere; }
.site-controls-agent-details { border: 1px solid var(--color-border-default); border-radius: 8px; min-width: 0; padding: .75rem; }
.site-controls-agent-details summary { cursor: pointer; font-weight: 650; }
.site-controls-agent-details pre { background: var(--color-bg-sunken); max-height: 28rem; margin: .75rem 0 0; max-width: 100%; overflow: auto; padding: .75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.site-controls-agent-list { display: grid; gap: .45rem; margin: 0; padding-left: 1.2rem; }
@media (max-width: 620px) {
  .site-controls-heading { align-items: stretch; flex-direction: column; }
  .site-controls-summary { justify-content: space-between; }
  .site-controls-summary > span { text-align: left; }
}
@media (max-width: 520px) {
  .site-controls-lists { grid-template-columns: 1fr; }
  .site-controls-entries .btn, .site-controls-actions .btn { width: 100%; }
  .site-controls-disclosure-body { padding-left: 1.1rem; }
}

/* Routed object frame (site/deck kind frames). The embedded viewer iframe is
   height:100% (.artifact-review-frame), which only sizes when every ancestor
   carries a definite height — the legacy review workspace provided that chain, the
   routed shell must provide its own or the frame collapses to its intrinsic
   default. Scoped here so legacy surfaces sharing the iframe class keep their
   own sizing. */
.dash-wrap.object-site-page {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-width: none;
  min-height: 100vh;
  min-width: 0;
  width: 100%;
}
.object-site-page + .footer { display: none; }
.object-site-page .object-site-frame {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.object-site-page [data-site-body] {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.object-site-page [data-site-body] .artifact-review-frame {
  flex: 1 1 auto;
  min-height: 0;
}
/* Authored HTML has a preview + comments wrapper between the body host and
   its iframe. Give the preview an explicit reading height: percentage height
   cannot resolve through that wrapper and otherwise falls back to 150px. */
.object-site-page .html-viewer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.object-site-page [data-site-body] .html-viewer > .artifact-review-frame,
.object-site-page [data-site-body] .html-draft-preview .artifact-review-frame {
  display: block;
  flex: none;
  height: calc(100dvh - 10rem);
  min-height: 20rem;
}
.html-live-link { margin: 0; }
.html-comments {
  border-top: 1px solid var(--color-border-subtle);
  display: grid;
  gap: .75rem;
  min-width: 0;
  padding: var(--compat-space-1) 0;
}
.html-comments > h3 { font-size: .92rem; margin: 0; }
.html-comment-composer {
  align-items: start;
  display: grid;
  gap: .75rem;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}
.html-comment-composer textarea {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  color: var(--color-text-primary);
  font: inherit;
  grid-column: 1 / -1;
  min-height: 6rem;
  padding: .75rem;
  resize: vertical;
  width: 100%;
}
.html-comment-anchor-choice { display: flex; gap: .4rem; min-width: 0; }
.html-comment-anchor-choice input { flex: none; margin-top: .25rem; }
.html-comment-composer > button { grid-column: 2; justify-self: end; }
.html-comments-list, .html-comment-replies {
  display: grid;
  gap: .75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.html-comment { border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); padding: .75rem; }
.html-comment-body { overflow-wrap: anywhere; white-space: pre-wrap; }
.html-comment-anchor, .html-comment-meta { color: var(--color-text-secondary); font-size: var(--compat-type-82); }
.html-comment-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.html-comment-replies { margin: .75rem 0 0 1rem; }
@media (max-width: 640px) {
  .html-comment-composer { grid-template-columns: minmax(0, 1fr); }
  .html-comment-composer > button { grid-column: 1; }
}
.object-site-page [data-site-body] .deck-viewer-surface {
  background: var(--color-bg-sunken);
  display: flex;
  flex: 1 1 auto;
  /* The deck page is sized to the window (below), so the surface takes the
     space left under the navigation and output header. Slide navigation is
     the deck runtime's own rail inside the frame. */
  min-height: 0;
  min-width: 0;
}
.object-site-page [data-site-body] .deck-viewer-stage {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  position: relative;
}
.object-site-page [data-site-body] .deck-viewer-stage .artifact-review-frame {
  height: 100%;
  min-width: 0;
  width: 100%;
}
/* A deck reads like an app canvas: the page is exactly the window, nothing
   scrolls behind it, and the stage fills what the navigation and the output
   header leave. No sticky header is needed because the page never scrolls. */
.dash-wrap.object-site-page:has(.deck-viewer-surface) { height: 100dvh; min-height: 0; }
.object-site-page:has(.deck-viewer-surface) .page-shell-main { min-height: 0; }
.object-site-page [data-site-body] .deck-viewer-actions {
  bottom: .75rem;
  display: flex;
  gap: var(--space-xs);
  position: absolute;
  right: .75rem;
  z-index: 20;
}
.object-site-page [data-site-body] .deck-viewer-actions > .btn {
  background: color-mix(in srgb, var(--color-bg-surface-raised) 92%, transparent);
  box-shadow: var(--elevation-overlay);
}
/* Full screen: the Fullscreen API on the stage, or a window-covering stage
   where element full screen is unavailable (iPhone Safari). */
.object-site-page [data-site-body] .deck-viewer-stage:fullscreen { background: var(--color-bg-sunken); }
.object-site-page [data-site-body] .deck-viewer-stage.deck-viewer-full-window {
  background: var(--color-bg-sunken);
  inset: 0;
  position: fixed;
  z-index: 1000;
}
html.deck-viewer-full-window-open { overflow: hidden; }
.object-site-page [data-site-body] .object-review-mode {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  min-height: 0;
}
.object-site-page [data-site-body] .object-review-canvas {
  display: flex;
  min-height: 0;
  min-width: 0;
}
.object-site-page [data-site-body] .object-review-round {
  background: var(--color-bg-surface);
  border-left: 1px solid var(--color-border-default);
  min-width: 0;
  overflow-y: auto;
  padding: var(--compat-space-1);
}
.object-site-page [data-site-body] .object-review-round h3 { margin-top: 0; }
.object-review-version {
  display: grid;
  gap: .35rem;
  margin: .85rem 0;
}
.object-review-version > div {
  align-items: center;
  display: grid;
  gap: .5rem;
  grid-template-columns: 5.5rem minmax(0, 1fr);
}
.object-review-version dt {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-72);
}
.object-review-version dd { margin: 0; min-width: 0; }
.object-review-version code {
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  color: var(--color-text-secondary);
  display: block;
  font-size: var(--compat-type-68);
  max-width: 100%;
  overflow: hidden;
  padding: .2rem .35rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.object-review-revision { opacity: .78; }
@media (max-width: 760px) {
  .object-site-page [data-site-body] .object-review-mode {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(18rem, 1fr) auto;
  }
  .object-site-page [data-site-body] .object-review-round {
    border-left: 0;
    border-top: 1px solid var(--color-border-default);
  }
}

/* Site/deck working draft: rendered and source are mutually exclusive primary
   views. Authoring controls live in the object-only contextual header slot. */
.object-site-page [data-site-body] .site-editor {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.site-editor-tools,
.site-editor-context,
.site-editor-actions,
.site-working-mode {
  align-items: center;
  display: flex;
  gap: .35rem;
  min-width: 0;
}
.site-editor-tools { flex: 1 1 auto; justify-content: flex-end; }
.site-editor-actions { flex: 0 0 auto; }
.site-editor-file { display: inline-flex; min-width: 0; }
.site-editor-file[hidden] { display: none; }
.site-editor-file-trigger {
  align-items: center;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: .76rem;
  font-weight: 600;
  gap: .35rem;
  height: 2rem;
  max-width: min(14rem, 28vw);
  min-width: 0;
  padding: 0 .45rem 0 .55rem;
  text-align: left;
}
.site-editor-file-trigger:hover,
.site-editor-file-trigger[aria-expanded="true"] {
  background: var(--color-bg-sunken);
  border-color: var(--color-decorative-gray);
}
.site-editor-file-trigger:disabled {
  color: var(--color-text-tertiary);
  cursor: default;
}
.site-editor-file-kind {
  color: var(--color-text-tertiary);
  flex: 0 0 auto;
  font-size: var(--compat-type-68);
  font-weight: 600;
}
.site-editor-file-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-editor-file-caret {
  color: var(--color-text-secondary);
  flex: 0 0 auto;
  height: 1rem;
  transition: transform .15s ease;
  width: 1rem;
}
.site-editor-file-trigger[aria-expanded="true"] .site-editor-file-caret { transform: rotate(180deg); }
.ov-menu-site-file-picker { min-width: 12rem; max-width: min(22rem, calc(100vw - 1rem)); }
.ov-menu-site-file-picker .ov-menu-item {
  min-height: 2.25rem;
  overflow-wrap: anywhere;
}
.site-working-mode {
  background: var(--color-bg-sunken);
  border-radius: var(--radius-md);
  padding: .12rem;
}
.site-working-mode button {
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: var(--compat-type-75);
  padding: .28rem .48rem;
}
.site-working-mode button[aria-pressed="true"] {
  background: var(--color-bg-surface);
  box-shadow: 0 0 0 1px var(--color-border-subtle);
  color: var(--color-text-primary);
  font-weight: 600;
}
.site-editor-more { position: relative; }
.site-editor-more > summary {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--compat-type-75);
  list-style: none;
  padding: .32rem var(--compat-space-5);
  white-space: nowrap;
}
.site-editor-more > summary::-webkit-details-marker { display: none; }
.site-editor-more-narrow,
.site-editor-overflow-action { display: none; }
.site-editor-more-menu {
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--elevation-overlay);
  display: block;
  padding: var(--compat-space-25);
  position: absolute;
  right: 0;
  top: calc(100% + .35rem);
  z-index: 80;
}
.object-site-page [data-site-body] .site-editor-rendered-view,
.object-site-page [data-site-body] .site-editor-source-view {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}
.object-site-page [data-site-body] .site-editor-rendered-view {
  flex-direction: column;
}
.object-site-page [data-site-body] .deck-editor-preview {
  background: var(--color-bg-sunken);
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  /* The deck runtime fits and letterboxes the slide itself, beside its own
     rail, so the canvas takes the whole pane rather than a 16:9 box. */
  height: calc(100dvh - 7.5rem);
  isolation: isolate;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.object-site-page [data-site-body] .deck-editor-canvas {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.object-site-page [data-site-body] .deck-editor-canvas .artifact-review-frame {
  display: block;
  flex: none;
  height: 100%;
  min-height: 0;
  width: 100%;
}
.site-editor-background-control[hidden] { display: none !important; }
.object-site-page [data-site-body] .site-editor-source-view {
  background: var(--color-bg-surface);
  padding: .75rem var(--space-page-x, var(--compat-space-1));
}
.object-site-page [data-site-body] .deck-editor-source-view {
  flex-direction: column;
  gap: .65rem;
}
.object-site-page [data-site-body] .site-editor .site-editor-source {
  box-sizing: border-box;
  display: block;
  flex: 1 1 auto;
  font-family: var(--type-family-mono);
  min-height: 18rem;
  resize: none;
  width: 100%;
}
.object-site-page [data-site-body] .site-editor-rendered-view .artifact-review-frame {
  flex: 1 1 auto;
  min-height: 8rem;
  width: 100%;
}
.object-site-page [data-site-body] .site-inline-editor {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 0.55rem;
  box-shadow: var(--elevation-overlay);
  box-sizing: border-box;
  max-width: calc(100vw - 1rem);
  padding: 0.65rem;
  width: 20rem;
}
.object-site-page [data-site-body] .site-inline-editor[hidden] { display: none; }
.object-site-page [data-site-body] .site-inline-editor label {
  display: grid;
  font-size: var(--compat-type-78);
  gap: 0.3rem;
}
.object-site-page [data-site-body] .site-inline-editor textarea {
  box-sizing: border-box;
  min-height: 4.5rem;
  resize: vertical;
  width: 100%;
}
.object-site-page [data-site-body] .site-inline-editor-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 0.45rem;
}
.object-site-page [data-site-body] .site-editor .deck-alternates-panel {
  flex: 0 0 auto;
  max-height: 12rem;
  overflow-y: auto;
}

/* Object-frame contextual chrome. Object routes mount this into an optional
   shared-header slot; unauthenticated/test shells keep the same component as
   a compact contextual subrow. */
/* Recovery belongs to document content, outside the fixed-height mode strip. */
.doc-surface-recovery {
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: .875rem;
  margin: .75rem 0;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: .75rem;
  white-space: normal;
}
.doc-surface-recovery p { margin: 0 0 .5rem; }
.doc-surface-recovery a { display: inline-block; max-width: 100%; }
.doc-surface-recovery a:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.doc-mode-strip {
  align-items: center;
  display: flex;
  gap: .35rem;
  min-width: 0;
  position: relative;
  width: 100%;
}
.doc-mode-tab,
.doc-mode-share,
.doc-mode-comments {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: var(--compat-type-75);
  font-weight: 600;
  gap: .35rem;
  min-height: 1.9rem;
  padding: .3rem .65rem;
  white-space: nowrap;
}
.doc-mode-tab:hover,
.doc-mode-share:hover,
.doc-mode-comments:hover { background: var(--color-bg-sunken); color: var(--color-text-primary); }
.doc-mode-tab.active,
.doc-mode-comments.active {
  background: var(--color-bg-surface);
  border-color: var(--color-border-default);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-text-primary) 7%, transparent);
  color: var(--color-text-primary);
}
.doc-mode-tab:focus-visible,
.doc-mode-share:focus-visible,
.doc-mode-comments:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.doc-mode-comments-count {
  align-items: center;
  background: var(--color-text-primary);
  border-radius: var(--radius-full);
  color: var(--color-bg-surface);
  display: inline-flex;
  font-family: var(--type-family-mono);
  font-size: .62rem;
  height: 1rem;
  justify-content: center;
  min-width: 1rem;
  padding: 0 var(--compat-space-25);
}
.doc-mode-navigation,
.doc-mode-context {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: .35rem;
  min-width: 0;
}
.doc-view-picker select {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
  font-weight: 600;
  max-width: 8.5rem;
  padding: .32rem 1.55rem .32rem var(--compat-space-5);
}
.doc-view-picker select:focus-visible,
.site-editor-file-trigger:focus-visible,
.site-working-mode button:focus-visible,
.site-editor-more > summary:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.doc-mode-policy,
.doc-mode-pinned,
.doc-mode-drift,
.doc-mode-integrity {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-72);
}
.doc-mode-policy {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  padding: .1rem .45rem;
}
.doc-mode-drift {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-status-warning-fg);
  padding: .1rem .45rem;
}
.doc-mode-current {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}
.doc-mode-context-short,
.doc-mode-current-narrow { display: none; }
.object-share-slot {
  display: inline-flex;
  flex: 0 0 auto;
  margin-left: auto;
}
.doc-mode-strip .artifact-review-return {
  flex: 0 1 auto;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-mode-status-slot {
  bottom: auto;
  max-width: min(32rem, 70vw);
  pointer-events: none;
  position: absolute;
  right: 0;
  top: calc(100% + .45rem);
  z-index: 75;
}
.doc-mode-status {
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--elevation-overlay);
  color: var(--color-text-secondary);
  display: block;
  font-size: var(--compat-type-75);
  min-height: 2.25rem;
  padding: .5rem 4.5rem .5rem .65rem;
}
.doc-mode-status:empty { display: none; }
.doc-mode-status-close {
  pointer-events: auto;
  position: absolute;
  right: .3rem;
  top: .25rem;
}
.doc-mode-status-close[hidden] { display: none; }

.object-share-sheet { display: flex; flex-direction: column; gap: 1rem; }
.object-share-general-row,
.object-share-add,
.object-share-list li {
  align-items: end;
  display: flex;
  gap: .65rem;
}
.object-share-general { border-bottom: 1px solid var(--color-border-subtle); padding-bottom: var(--compat-space-1); }
.object-share-domains {
  display: grid;
  gap: .85rem;
  margin: .85rem 0 0 2.9rem;
}
.object-share-domains[hidden] { display: none; }
.object-share-domain-group {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  display: grid;
  gap: .55rem;
  padding: .7rem;
}
.object-share-domain-heading {
  align-items: baseline;
  display: flex;
  font-size: var(--compat-type-78);
  font-weight: 600;
  justify-content: space-between;
}
.object-share-domain-heading small,
.object-share-domain-chip small,
.object-share-domain-actions small {
  color: var(--color-text-tertiary);
  font-size: var(--compat-type-7);
  font-weight: 400;
}
.object-share-domain-list {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  min-height: 1.8rem;
}
.object-share-domain-chip {
  align-items: center;
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
  display: inline-flex;
  font-size: var(--compat-type-78);
  gap: .35rem;
  max-width: 100%;
  padding: var(--compat-space-25) var(--compat-space-25) var(--compat-space-25) .55rem;
}
.object-share-domain-chip[data-pending="add"] {
  border-style: dashed;
}
.object-share-domain-chip[data-pending="remove"] {
  opacity: .72;
}
.object-share-domain-chip[data-pending="remove"] > span {
  text-decoration: line-through;
}
.object-share-domain-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.object-share-domain-chip button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  height: 1.35rem;
  justify-content: center;
  padding: 0;
  width: 1.35rem;
}
.object-share-domain-chip button:hover:not(:disabled) {
  background: var(--color-bg-sunken);
  color: var(--color-text-primary);
}
.object-share-domain-chip button:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
}
.object-share-domain-entry,
.object-share-domain-actions {
  align-items: center;
  display: flex;
  gap: .45rem;
}
.object-share-domain-entry input {
  flex: 1 1 auto;
  min-width: 0;
}
.object-share-domains p { color: var(--color-text-tertiary); font-size: var(--compat-type-75); margin: 0; }
.object-share-advanced {
  border-top: 1px solid var(--color-border-subtle);
  padding-top: .65rem;
}
.object-share-advanced summary {
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--compat-type-78);
  font-weight: 600;
  list-style-position: outside;
}
.object-share-advanced[open] summary { margin-bottom: .65rem; }
.object-share-access-details {
  border-top: 0;
  margin-top: -.35rem;
  padding-top: 0;
}
.object-share-access-details .object-share-note { margin-top: 0; }
.object-share-domain-actions {
  justify-content: space-between;
}
.object-share-general h3,
.object-share-deck-options h3,
.object-share-people-heading { font-size: .86rem; margin: 0 0 .65rem; }
.object-share-deck-options { border-bottom: 1px solid var(--color-border-subtle); display: grid; gap: .35rem; padding-bottom: var(--compat-space-1); }
.object-share-deck-pdf-toggle { align-items: center; display: flex; gap: .5rem; }
.object-share-deck-options small { color: var(--color-text-secondary); }
.object-share-general-row { align-items: center; }
.object-share-link-name { align-items: center; display: flex; flex-wrap: wrap; gap: .35rem .5rem; margin-top: .6rem; }
.object-share-link-name label { font-size: var(--compat-type-78); font-weight: 600; width: 100%; }
.object-share-link-name .object-share-link-prefix { color: var(--color-text-secondary); font-size: var(--compat-type-85); }
.object-share-link-name input { flex: 1 1 8rem; min-width: 6rem; }
.object-share-link-name small { color: var(--color-text-secondary); width: 100%; }
.object-share-general-icon {
  align-items: center;
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-default);
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 2.25rem;
  height: 2.25rem;
  justify-content: center;
}
.object-share-general-row label { display: grid; flex: 1 1 auto; gap: .2rem; min-width: 0; }
.object-share-general-row select,
.object-share-general-row small { min-width: 0; }
.object-share-general-row small,
.object-share-note,
.object-share-status {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  margin: .2rem 0 0;
}
.object-share-add {
  border-bottom: 1px solid var(--color-border-subtle);
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--compat-space-1) 0;
}
.object-share-add label { display: grid; flex: 1 1 0; font-size: var(--compat-type-72); gap: .25rem; }
.object-share-general-row select,
.object-share-add select,
.object-share-list select {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font: inherit;
  min-height: 2rem;
  padding: var(--compat-space-25) .45rem;
}
.object-share-access h3 { font-size: .86rem; margin: 0 0 .5rem; }
.object-share-list { display: grid; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.object-share-list li { align-items: center; }
.object-share-person { display: grid; flex: 1 1 auto; min-width: 0; }
.object-share-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.object-share-person small { color: var(--color-text-tertiary); }
.object-share-status[data-kind="error"] { color: var(--color-status-danger-fg); }
.object-share-status[data-kind="ok"] { color: var(--color-status-success-fg); }

@media (max-width: 600px) {
  .object-share-general-row { align-items: stretch; flex-wrap: wrap; }
  .object-share-general-row label { flex-basis: calc(100% - 3rem); }
  .object-share-general-row .btn { margin-left: 2.9rem; }
  .object-share-domains { margin-left: 0; }
  .object-share-add { align-items: stretch; flex-direction: column; }
  .object-share-list li { align-items: stretch; flex-wrap: wrap; }
  .object-share-person { flex-basis: 100%; }
}

.ph-header-object-context {
  border-left: 1px solid var(--color-border-subtle);
  flex: 1 1 auto;
  margin-left: .75rem;
  max-width: 58rem;
  min-width: 0;
  padding-left: .75rem;
}
.ph-header-object-context:empty { display: none; }
.ph-header-object-context .doc-mode-context:empty { display: none; }
.ph-header-object-context .doc-mode-strip { flex-wrap: nowrap; }
.ph-header-object-context:has(> .html-frame-title) { align-items: center; display: flex; gap: .75rem; }
.ph-header-object-context > .html-frame-title {
  flex: 0 1 auto;
  font-size: var(--compat-type-85);
  line-height: 1.25;
  margin: 0;
  max-width: min(18rem, 25vw);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-header-object-context > .html-frame-title + .doc-mode-strip { flex: 1 1 auto; min-width: 0; }
.html-frame-kind { color: var(--color-text-secondary); font-size: var(--compat-type-7); }
.object-site-frame > [data-site-strip] {
  border-bottom: 1px solid var(--color-border-subtle);
  flex: 0 0 auto;
  padding: .45rem var(--space-page-x, var(--compat-space-1));
}

@media (max-width: 1280px) {
  .ph-header-object-context {
    background: var(--color-overlay-cream-strongest);
    border-left: 0;
    border-bottom: 1px solid var(--color-border-subtle);
    height: 45px;
    left: 0;
    margin: 0;
    max-width: none;
    padding: 0 var(--space-page-x, var(--compat-space-1));
    position: fixed;
    right: 0;
    top: 45px;
  }
  .ph-header-object-context .doc-mode-strip {
    height: 100%;
    overflow-x: auto;
    overflow-y: visible;
  }
  .ph-header-object-context .doc-mode-navigation,
  .ph-header-object-context .site-editor-tools,
  .ph-header-object-context .site-editor-context,
  .ph-header-object-context .site-editor-actions,
  .ph-header-object-context .site-working-mode {
    flex: 0 0 auto;
  }
  .ph-header-object-context button,
  .ph-header-object-context select { white-space: nowrap; }
  .ph-header-object-context .doc-mode-status-slot {
    position: fixed;
    right: var(--space-page-x, 1rem);
    top: 94px;
  }
  .ph-header-object-context .site-editor-more-menu {
    position: fixed;
    right: var(--space-page-x, 1rem);
    top: 94px;
  }
  .object-site-page .object-site-frame { margin-top: 45px; }
}

@media (max-width: 640px) {
  .ph-header-object-context { order: 5; }
  .ph-header-object-context .doc-mode-context {
    display: inline-flex;
    flex: 0 0 auto;
  }
  .ph-header-object-context .artifact-review-return { max-width: 5.5rem; }
  .doc-mode-context-long,
  .doc-mode-current-wide { display: none; }
  .doc-mode-context-short,
  .doc-mode-current-narrow { display: inline; }
  .doc-mode-pinned,
  .doc-mode-drift,
  .doc-mode-integrity { white-space: nowrap; }
  .doc-mode-pinned {
    align-items: center;
    display: inline-flex;
    gap: .25rem;
  }
  .site-editor-context { flex: 0 1 auto; }
  .site-editor-actions .btn { white-space: nowrap; }
  .site-editor-actions > .site-editor-primary-action { display: none; }
  .site-editor-more-wide { display: none; }
  .site-editor-more-narrow,
  .site-editor-overflow-action { display: block; }
}

/* Routed document chrome keeps return-to-origin at the edge of the object
   mode strip instead of floating it in a sparse, page-level actions row. */
.doc-detail-mode-chrome {
  align-items: center;
  border-bottom: 1px solid var(--color-border-subtle);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}
.doc-detail-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.doc-export-details { position: relative; }
.doc-export-options {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 10;
  min-width: 12rem;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: var(--space-sm);
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
}
.doc-export-options [role="status"]:empty { display: none; }
.doc-detail-mode-chrome .doc-mode-strip { border-bottom: 0; flex-wrap: wrap; }
.doc-detail-mode-chrome .doc-mode-pinned,
.doc-detail-mode-chrome .doc-mode-integrity { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.doc-detail-mode-chrome .doc-mode-pinned { flex-wrap: wrap; }
@media (max-width: 640px) {
  .doc-detail-mode-chrome { grid-template-columns: minmax(0, 1fr); }
  .doc-detail-actions { margin-left: var(--space-page-x, 1rem); }
  /* Let the disclosure take a row on narrow screens, even when Export sits
     near the right edge of a wrapped actions group. */
  .doc-export-options { position: static; min-width: 0; overflow-wrap: anywhere; }
  .doc-detail-mode-chrome [data-doc-detail-back] {
    justify-self: start;
    margin: .35rem var(--space-page-x, 1rem) .5rem 0;
    max-width: calc(100% - 2 * var(--space-page-x, 1rem));
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
.doc-detail-mode-chrome [data-doc-detail-back] {
  margin-right: var(--space-page-x, 1rem);
}

/* The routed document is the page. Versions and notes share one calm,
   revealable edge rail instead of stacking forms below the document. */
.doc-detail-stage {
  align-items: start;
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}
.doc-detail-board { grid-column: 1; min-width: 0; }
.doc-detail-rail {
  align-self: start;
  background: color-mix(in srgb, var(--color-bg-surface) 96%, transparent);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--elevation-raised);
  grid-column: 2;
  max-height: min(78vh, 760px);
  overflow: hidden;
  position: sticky;
  top: 3.75rem;
  width: clamp(19rem, 27vw, 22rem);
}

.doc-history-rail { display: flex; flex-direction: column; max-height: inherit; }
.doc-history-title {
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: .86rem;
  margin: 0;
  padding: var(--compat-space-1);
}
.doc-history-list { list-style: none; margin: 0; overflow-y: auto; padding: .35rem; }
.doc-history-item a {
  align-items: baseline;
  border-radius: var(--radius-md);
  display: grid;
  gap: .15rem .5rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: .65rem;
  text-decoration: none;
}
.doc-history-item a:hover { background: var(--color-bg-sunken); }
.doc-history-ordinal { font-family: var(--type-family-mono); font-size: var(--compat-type-7); font-weight: 700; }
.doc-history-label { font-size: var(--compat-type-8); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-history-live {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  font-size: .62rem;
  padding: .05rem .35rem;
}
.doc-history-when,
.doc-history-by { color: var(--color-text-tertiary); font-size: var(--compat-type-68); grid-column: 2 / -1; }

.doc-comments { display: flex; flex-direction: column; max-height: inherit; min-height: 18rem; }
.doc-comments-header {
  align-items: center;
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  justify-content: space-between;
  min-height: 4rem;
  padding: .75rem .85rem .75rem var(--compat-space-1);
}
.doc-comments-eyebrow {
  color: var(--color-text-tertiary);
  display: block;
  font-family: var(--type-family-body);
  font-size: .62rem;
  letter-spacing: normal;
  margin-bottom: .12rem;
  text-transform: none;
}
.doc-comments-title { font-size: .92rem; line-height: 1.2; margin: 0; }
.doc-comments-title span {
  color: var(--color-text-tertiary);
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-7);
  font-weight: 500;
  margin-left: .2rem;
}
.doc-comments-close {
  background: transparent;
  border: 0;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: var(--compat-type-72);
  padding: .35rem .55rem;
}
.doc-comments-close:hover { background: var(--color-bg-sunken); color: var(--color-text-primary); }
.doc-comments-close:focus-visible,
.doc-comments-add:focus-visible,
.doc-comment-actions button:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.doc-comments-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: .75rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .75rem;
}
.doc-comments-list { display: grid; gap: .65rem; list-style: none; margin: 0; padding: 0; }
.doc-comment {
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-text-primary) 7%, transparent);
  padding: .75rem;
}
.doc-comment-meta { align-items: baseline; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.doc-comment-by { color: var(--color-text-primary); font-size: var(--compat-type-78); font-weight: 650; }
.doc-comment-when { color: var(--color-text-tertiary); font-size: var(--compat-type-68); }
.doc-comment-anchor {
  color: var(--color-text-tertiary);
  font-family: var(--type-family-mono);
  font-size: .62rem;
  margin-left: auto;
}
.doc-comment-quote,
.doc-comment-anchor-preview blockquote {
  border-left: 2px solid var(--color-accent-secondary-default);
  color: var(--color-text-secondary);
  font-size: .74rem;
  line-height: 1.45;
  margin: .55rem 0;
  max-height: 5.2em;
  overflow: hidden;
  padding-left: .6rem;
}
.doc-comment-body { font-size: var(--compat-type-82); line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.doc-comment-actions { display: flex; justify-content: flex-end; margin-top: .45rem; }
.doc-comment-actions:empty { display: none; }
.doc-comment-actions button,
.doc-comment-anchor-preview button {
  background: transparent;
  border: 0;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: var(--compat-type-7);
  padding: var(--compat-space-25) .45rem;
}
.doc-comment-actions button:hover,
.doc-comment-anchor-preview button:hover { background: var(--color-bg-sunken); color: var(--color-text-primary); }
.doc-comments-prior { color: var(--color-text-tertiary); font-size: var(--compat-type-72); margin: 0; }
.doc-comments-add {
  align-self: stretch;
  background: transparent;
  border: 1px dashed var(--color-border-default);
  border-radius: var(--radius-lg);
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: var(--compat-type-78);
  min-height: 2.6rem;
  padding: .55rem .75rem;
  text-align: left;
}
.doc-comments-add:hover { background: var(--color-bg-sunken); border-style: solid; color: var(--color-text-primary); }
.doc-comment-composer {
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-text-primary) 7%, transparent);
  display: grid;
  gap: .55rem;
  padding: .65rem;
}
.doc-comment-composer textarea {
  background: transparent;
  border: 0;
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--compat-type-82);
  line-height: 1.5;
  min-height: 5.5rem;
  outline: 0;
  padding: .2rem;
  resize: vertical;
  width: 100%;
}
.doc-comment-composer textarea::placeholder { color: var(--color-text-tertiary); }
.doc-comment-composer-actions { align-items: center; display: flex; gap: .4rem; justify-content: flex-end; }
.doc-comment-anchor-preview { border-bottom: 1px solid var(--color-border-subtle); padding-bottom: .45rem; }

.doc-share-dialog {
  align-items: end;
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  padding: .75rem var(--space-page-x, var(--compat-space-1));
}
.doc-share-dialog label { display: grid; font-size: var(--compat-type-7); gap: .2rem; }
.doc-share-dialog :is(input, select) { min-height: 2rem; }
.doc-share-result,
.doc-share-error { flex-basis: 100%; font-size: var(--compat-type-75); margin: 0; }
.doc-share-error { color: var(--color-status-danger-fg); }

@media (max-width: 760px) {
  .doc-detail-stage { display: block; }
  .doc-detail-rail {
    border-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    bottom: 0;
    left: 0;
    max-height: min(72vh, 42rem);
    position: fixed;
    right: 0;
    top: auto;
    width: 100%;
    z-index: 90;
  }
  .doc-comments { min-height: min(22rem, 60vh); }
  .doc-share-dialog { align-items: stretch; flex-direction: column; }
}

/* Artifact review decision surface — the artifact stays primary while the
   shared Portal panel chrome carries review actions at the edge. */
.artifact-review-page {
  box-sizing: border-box;
  max-width: none;
  min-width: 0;
  padding-bottom: 0;
  width: 100%;
}
.artifact-review-page + .footer { display: none; }
.artifact-review-status {
  margin: 0;
  min-height: 0;
  padding: 0 var(--space-page-x);
}
.artifact-review-status:not(:empty) {
  min-height: 1.2rem;
  padding-bottom: .35rem;
  padding-top: .35rem;
}
.artifact-review-skeleton {
  animation: artifact-review-pulse 1.2s ease-in-out infinite alternate;
  background: var(--color-bg-sunken);
  min-height: calc(100vh - 7rem);
  padding: var(--space-lg) var(--space-page-x);
}
.artifact-review-skeleton > .read-skeleton { margin: 0 auto; max-width: 48rem; }
@keyframes artifact-review-pulse { to { opacity: .55; } }
.artifact-review-stage {
  background: var(--color-bg-sunken);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  height: calc(100vh - 5.5rem);
  min-height: 36rem;
  overflow: hidden;
  transition: grid-template-columns 160ms ease;
}
.artifact-review-stage.is-panel-open {
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 25rem);
}
.artifact-review-canvas {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}
.artifact-review-canvas-bar,
.artifact-review-panel-head {
  align-items: center;
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border-default);
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  min-height: 2.8rem;
  padding: var(--compat-space-5) .75rem;
}
.artifact-review-canvas-bar > div {
  align-items: baseline;
  display: flex;
  gap: .65rem;
  min-width: 0;
}
.artifact-review-revision-chip {
  background: var(--color-status-info-tint);
  border-radius: 999px;
  color: var(--color-text-primary);
  flex: none;
  font-size: var(--compat-type-7);
  font-weight: 600;
  padding: .1rem .55rem;
}
.artifact-review-orientation-selected {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-review-orientation {
  align-items: baseline;
  display: inline-flex;
  gap: .5rem;
  min-width: 0;
}
.artifact-review-orientation-pill {
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
  color: var(--color-text-primary);
  flex: none;
  font-size: var(--compat-type-72);
  font-weight: 600;
  padding: .1rem .55rem;
}
.artifact-review-orientation-pill[data-canvas-showing="base"] {
  background: var(--color-status-info-tint);
}
.artifact-review-orientation-ref { color: var(--color-text-secondary); flex: none; font-size: .74rem; }
.artifact-review-orientation-ref code { font-size: var(--compat-type-72); }
.artifact-review-orientation-relation {
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  flex: none;
  font-size: var(--compat-type-7);
  padding: .05rem .35rem;
}
.artifact-review-canvas-flip {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  display: inline-flex;
  flex: none;
  overflow: hidden;
}
.artifact-review-canvas-flip button {
  background: transparent;
  border: 0;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--compat-type-72);
  padding: .15rem .55rem;
}
.artifact-review-canvas-flip button[aria-pressed="true"] {
  background: var(--color-bg-sunken);
  color: var(--color-text-primary);
  font-weight: 600;
}
.artifact-review-workspace-mode {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  display: inline-flex;
  flex: none;
  overflow: hidden;
}
.artifact-review-workspace-mode button {
  background: transparent;
  border: 0;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--compat-type-72);
  padding: var(--compat-space-25) .65rem;
}
.artifact-review-workspace-mode button[aria-pressed="true"] {
  background: var(--color-bg-sunken);
  color: var(--color-text-primary);
  font-weight: 650;
}
.artifact-review-workspace-mode button:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: -2px;
}
/* Visual/Source switch for the revision editor — the segmented control that
   shows exactly one editing surface. Mirrors the canvas flip's treatment. */
.artifact-revision-surface-switch {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  display: inline-flex;
  flex: none;
  overflow: hidden;
  margin-bottom: .5rem;
}
.artifact-revision-surface-tab {
  background: transparent;
  border: 0;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--compat-type-72);
  padding: .15rem .55rem;
}
.artifact-revision-surface-tab[aria-pressed="true"] {
  background: var(--color-bg-sunken);
  color: var(--color-text-primary);
  font-weight: 600;
}
.artifact-revision-surface-tab:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
[data-projection-frame] > .object-html-review-frame {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: min(70vh, 48rem);
}

.artifact-review-frame {
  background: white;
  border: 0;
  height: 100%;
  min-width: 0;
  width: 100%;
}
.artifact-review-deck-frame {
  align-items: center;
  background: black;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: clamp(var(--compat-space-5), 1.25vw, 1.25rem);
}
.artifact-review-deck-frame .artifact-review-frame {
  aspect-ratio: 16 / 9;
  box-shadow: var(--elevation-overlay);
  flex: none;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  width: min(100%, calc((100dvh - 10rem) * 16 / 9));
}
.artifact-review-editor-canvas {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(.75rem, 2vw, var(--compat-space-1_5));
}
.artifact-review-editor-canvas > .artifact-revision-workspace {
  margin: 0 auto;
  max-width: 76rem;
}
.artifact-review-render-empty {
  align-items: center;
  color: var(--color-text-secondary);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  justify-content: center;
}
.artifact-review-version-intent {
  color: var(--color-text-secondary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-review-panel {
  background: var(--color-bg-surface);
  border-left: 1px solid var(--color-border-default);
  min-width: 0;
  overflow: hidden;
}
.artifact-review-stage:not(.is-panel-open) .artifact-review-panel {
  border-left: 0;
  visibility: hidden;
}
.artifact-review-panel-head { font-size: var(--compat-type-82); font-weight: 650; }
.artifact-review-panel-scroll {
  height: calc(100% - 2.8rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.artifact-review-panel-section {
  border-bottom: 1px solid var(--color-border-subtle);
  padding: var(--compat-space-1);
}
.artifact-review-panel-section h3 {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-7);
  letter-spacing: normal;
  margin: 0 0 .7rem;
  text-transform: none;
}
.artifact-review-panel-section p { margin: .35rem 0; overflow-wrap: anywhere; }
.artifact-review-quiet,
.artifact-review-empty {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-8);
}
.artifact-review-empty { font-style: italic; }
.artifact-revision-source-field { display: grid; gap: .3rem; }
.artifact-revision-source-field > span {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-72);
}
.artifact-revision-source-editor .cm-editor,
.artifact-revision-source-editor .cm-scroller { min-height: 16rem; }
.artifact-revision-source-editor .cm-scroller { max-height: 65vh; overflow: auto; tab-size: 2; }
.artifact-revision-workspace {
  display: grid;
  gap: .8rem;
  margin-top: .75rem;
}
.artifact-revision-authoring {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: .65rem .75rem;
}
.artifact-revision-authoring > summary { cursor: pointer; display: grid; gap: .12rem; }
.artifact-revision-authoring > summary strong { color: var(--color-text-primary); font-size: var(--compat-type-82); }
.artifact-revision-authoring > summary span { color: var(--color-text-secondary); font-size: var(--compat-type-72); }
.artifact-revision-authoring[open] > summary { border-bottom: 1px solid var(--color-border-subtle); padding-bottom: .6rem; }
.artifact-revision-heading,
.artifact-revision-selector,
.artifact-revision-selector label,
.artifact-revision-verdict > div {
  align-items: center;
  display: flex;
  gap: .55rem;
}
.artifact-revision-heading { justify-content: space-between; }
.artifact-revision-heading > div { align-items: center; display: flex; gap: .45rem; min-width: 0; }
.artifact-revision-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-revision-badge {
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
  color: var(--color-text-secondary);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: normal;
  padding: .15rem .4rem;
  text-transform: none;
}
.artifact-revision-selector { align-items: end; }
.artifact-revision-selector label { align-items: stretch; display: grid; flex: 1; gap: .25rem; }
.artifact-revision-selector label > span,
.artifact-revision-verdict label > span {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-72);
}
.artifact-revision-relation {
  align-items: center;
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  display: grid;
  gap: .45rem;
  grid-template-columns: 1fr auto 1fr;
  padding: .65rem;
}
.artifact-revision-relation span { display: grid; gap: .15rem; min-width: 0; }
.artifact-revision-relation small { color: var(--color-text-secondary); font-size: .66rem; text-transform: none; }
.artifact-revision-relation strong { font-size: var(--compat-type-78); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-revision-relation em {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-72);
  font-style: normal;
  grid-column: 1 / -1;
}
.artifact-revision-preview-identity {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
}
.artifact-revision-preview-identity small { color: var(--color-text-secondary); font-size: var(--compat-type-7); text-transform: none; }
.artifact-revision-preview-identity strong { font-size: var(--compat-type-8); }
.artifact-revision-preview-identity code { color: var(--color-text-tertiary); font-size: .66rem; overflow-wrap: anywhere; }
.artifact-revision-rendered-preview {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.artifact-revision-rendered-preview > summary {
  align-items: baseline;
  cursor: pointer;
  display: flex;
  gap: .45rem;
  padding: .55rem .7rem;
}
.artifact-revision-rendered-preview > summary strong { font-size: var(--compat-type-8); }
.artifact-revision-rendered-preview > summary span { color: var(--color-text-secondary); font-size: var(--compat-type-72); }
.artifact-revision-rendered-preview > .artifact-review-quiet { margin: 0; padding: 0 .7rem .55rem; }
.artifact-revision-generation-frame {
  background: white;
  border: 0;
  border-top: 1px solid var(--color-border-subtle);
  display: block;
  height: min(55vh, 42rem);
  min-height: 22rem;
  width: 100%;
}
.artifact-revision-rebase-callout {
  align-items: center;
  background: var(--color-bg-sunken);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  display: grid;
  gap: .3rem .65rem;
  grid-template-columns: 1fr auto;
  padding: .65rem;
}
.artifact-revision-rebase-callout strong,
.artifact-revision-rebase-callout span { grid-column: 1; }
.artifact-revision-rebase-callout span { color: var(--color-text-secondary); font-size: .76rem; }
.artifact-revision-rebase-callout button { grid-column: 2; grid-row: 1 / span 2; min-height: 44px; }
.artifact-revision-generation-inspector { display: grid; gap: .55rem; }
.artifact-revision-generation-inspector label { display: grid; gap: .3rem; }
.artifact-revision-generation-inspector label > span { color: var(--color-text-secondary); font-size: var(--compat-type-72); }
.artifact-revision-generation-inspector textarea {
  background: var(--color-bg-sunken);
  font-family: var(--type-family-mono);
  min-height: 16rem;
  resize: vertical;
}
.artifact-revision-review-state {
  border-left: 3px solid var(--color-accent-secondary-default);
  display: grid;
  font-size: var(--compat-type-78);
  gap: .3rem;
  padding: .3rem 0 .3rem .65rem;
}
.artifact-revision-review-state > span { color: var(--color-text-secondary); }
.artifact-revision-inline-site {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  display: grid;
  gap: .55rem;
  overflow: hidden;
  padding: .7rem;
}
.artifact-revision-inline-site-head {
  align-items: center;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
}
.artifact-revision-inline-site-head h3 { font-size: .88rem; margin: 0; }
.artifact-revision-inline-site-head p { color: var(--color-text-secondary); font-size: var(--compat-type-72); margin: .15rem 0 0; }
.artifact-revision-inline-site-head > span {
  background: var(--color-bg-sunken);
  border-radius: 999px;
  color: var(--color-text-secondary);
  flex: none;
  font-size: var(--compat-type-68);
  padding: .2rem .45rem;
}
.artifact-revision-inline-site iframe {
  background: white;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  height: 22rem;
  width: 100%;
}
.artifact-revision-inline-doc-body {
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  max-height: 32rem;
  overflow: auto;
  padding: var(--compat-space-1);
}
.artifact-revision-inline-doc-body [data-zero-doc-inline-edit] {
  cursor: text;
  outline: 1px dashed var(--color-accent-default);
  outline-offset: 2px;
  white-space: pre-wrap;
}
.artifact-revision-inline-doc-body [data-zero-doc-inline-edit]:focus {
  background: var(--color-accent-tint-medium);
  outline-width: 2px;
}
.artifact-revision-inline-doc-body [data-zero-dirty="true"] { outline-color: var(--color-status-warning-fg); }
.artifact-revision-verdict { display: grid; gap: .45rem; margin-top: .4rem; }
.artifact-revision-verdict label { display: grid; gap: .25rem; }
.artifact-revision-verdict textarea { min-height: 4rem; }
.artifact-revision-change-review {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  display: grid;
  gap: .7rem;
  padding: .75rem;
}
.artifact-revision-change-review-head,
.artifact-revision-change-actions {
  align-items: center;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
}
.artifact-revision-change-review-head h3 { font-size: .88rem; margin: 0; }
.artifact-revision-change-review-head p,
.artifact-revision-change-actions p { color: var(--color-text-secondary); font-size: var(--compat-type-72); margin: .15rem 0 0; }
.artifact-revision-change-review-head > span {
  background: var(--color-bg-sunken);
  border-radius: 999px;
  color: var(--color-text-secondary);
  flex: none;
  font-size: var(--compat-type-68);
  padding: .2rem .45rem;
}
.artifact-revision-change-list { display: grid; gap: .65rem; list-style: none; margin: 0; padding: 0; }
.artifact-revision-change-group > ol { display: grid; gap: .55rem; list-style: none; margin: 0; padding: 0; }
.artifact-revision-change-path {
  align-items: baseline;
  display: flex;
  gap: .5rem;
  justify-content: space-between;
  margin-bottom: .4rem;
}
.artifact-revision-change-path code { font-size: .74rem; font-weight: 650; }
.artifact-revision-change-path span { color: var(--color-text-tertiary); font-size: var(--compat-type-68); }
.artifact-revision-change {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  display: grid;
  gap: .55rem;
  padding: .65rem;
}
.artifact-revision-change[data-decision="accept"] { border-color: var(--color-status-success-fg); }
.artifact-revision-change[data-decision="reject"] { border-color: var(--color-status-danger-fg); }
.artifact-revision-change-title { font-size: .76rem; font-weight: 650; }
.artifact-revision-change-toolbar { align-items: center; display: flex; gap: .75rem; justify-content: space-between; }
.artifact-revision-change-toolbar > div { display: flex; gap: .4rem; }
.artifact-revision-change-progress { color: var(--color-text-secondary); font-size: var(--compat-type-72); }
.artifact-revision-change textarea {
  font-family: var(--type-family-mono);
  font-size: var(--compat-type-72);
  min-height: 6rem;
  resize: vertical;
  white-space: pre;
}
.artifact-revision-change textarea[readonly] { background: var(--color-bg-sunken); }

/* change-diff.js — the one shared change-diff component (.ed-diff-* stays
   the canonical diff row system; these are the component's own parts). */
.change-diff { display: grid; gap: .5rem; min-width: 0; }
.change-diff-set { display: grid; gap: .4rem; }
.change-diff-inline { padding: .4rem .55rem; white-space: pre-wrap; word-break: break-word; }
.change-diff-inline del { background: var(--color-status-danger-bg); text-decoration: line-through; }
.change-diff-inline ins { background: var(--color-status-success-tint); text-decoration: none; }
.change-diff-actions { align-items: center; display: flex; gap: .5rem; }
.change-diff-decide[aria-pressed="true"] { background: var(--color-accent-tint-code); border-color: var(--color-accent-default); }
.change-diff-replacement { display: grid; gap: .25rem; min-width: 0; }
.change-diff-replacement > span { color: var(--color-text-secondary); font-size: var(--compat-type-68); }
.change-diff-replacement small { color: var(--color-text-tertiary); font-size: var(--compat-type-68); }
.change-diff-fallback { display: grid; gap: .5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.change-diff-fallback label { display: grid; gap: .25rem; min-width: 0; }
.change-diff-fallback span { color: var(--color-text-secondary); font-size: var(--compat-type-68); }
.change-diff-file summary { color: var(--color-text-secondary); cursor: pointer; font-size: .74rem; }
.change-diff-file[open] summary { margin-bottom: .4rem; }
.change-diff-state {
  border: 1px solid var(--color-status-suggested-fg);
  border-radius: var(--radius-sm);
  color: var(--color-status-suggested-fg);
  font-size: .66rem;
  justify-self: start;
  padding: .05rem .35rem;
}
.artifact-revision-save-status { color: var(--color-text-secondary); font-size: var(--compat-type-75); margin: 0; }
.artifact-revision-save-status[data-kind="error"] { color: var(--color-status-danger-fg); }
.artifact-revision-workspace-toolbar {
  align-items: center;
  background: color-mix(in srgb, var(--color-bg-canvas) 94%, transparent);
  border-bottom: 1px solid var(--color-border-subtle);
  display: grid;
  gap: .2rem 1rem;
  grid-template-columns: minmax(8rem, 1fr) auto;
  padding: .65rem 0;
  position: sticky;
  top: 0;
  z-index: 3;
}
.artifact-revision-workspace-toolbar .artifact-review-quiet { grid-column: 1 / -1; margin: 0; }
.artifact-revision-generations { border-top: 1px solid var(--color-border-subtle); padding-top: .55rem; }
.artifact-revision-generations summary { color: var(--color-text-secondary); cursor: pointer; font-size: .76rem; }
.artifact-revision-generations ol { display: grid; gap: .3rem; margin: .5rem 0 0; padding-left: 1.4rem; }
.artifact-revision-generations li { align-items: baseline; display: grid; font-size: .76rem; gap: .1rem .45rem; grid-template-columns: 1fr auto; }
.artifact-revision-generations li small { color: var(--color-text-secondary); display: block; }
.artifact-revision-generations li .artifact-review-text-action { grid-column: 2; grid-row: 1 / span 2; min-height: 44px; }
.artifact-review-text-action {
  background: none;
  border: 0;
  color: var(--color-accent-secondary-default);
  cursor: pointer;
  font: inherit;
  font-size: var(--compat-type-8);
  padding: .2rem 0;
  text-decoration: none;
}
.artifact-review-text-action:hover { text-decoration: underline; }
.artifact-review-versions {
  display: grid;
  gap: .35rem;
}
.artifact-review-versions > button,
.artifact-review-version-information {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  display: flex;
  font: inherit;
  gap: .5rem;
  justify-content: space-between;
  min-width: 0;
  padding: .55rem;
  text-align: left;
}
.artifact-review-versions > button { cursor: pointer; }
.artifact-review-versions > button:hover { background: var(--color-bg-sunken); }
.artifact-review-versions > button.is-selected {
  background: var(--color-bg-sunken);
  border-color: var(--color-border-default);
}
.artifact-review-versions > :is(button, .artifact-review-version-information) span:first-child {
  display: grid;
  min-width: 0;
}
.artifact-review-versions small {
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-review-version-status {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-72);
}
.artifact-review-plain-list,
.artifact-review-checks {
  display: grid;
  gap: .6rem;
  list-style: none;
  margin: 0 0 .65rem;
  padding: 0;
}
.artifact-review-plain-list li {
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: .55rem;
}
.artifact-review-note-quote {
  border-left: 2px solid var(--color-border-default);
  color: var(--color-text-secondary);
  font-size: var(--compat-type-78);
  margin: .35rem 0;
  padding-left: .55rem;
}
.artifact-review-note-actions {
  align-items: center;
  display: flex;
  gap: .55rem;
  margin-top: .35rem;
}
.artifact-review-dismissed-notes { margin-bottom: .65rem; }
.artifact-review-dismissed-notes > summary {
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--compat-type-78);
  margin-bottom: .55rem;
}
.artifact-review-checks li {
  display: flex;
  font-size: var(--compat-type-8);
  gap: 1rem;
  justify-content: space-between;
  text-transform: capitalize;
}
.artifact-review-checks li span:last-child { color: var(--color-text-secondary); }
.artifact-review-suggestions {
  display: grid;
  gap: .75rem;
  list-style: none;
  margin: 0 0 .65rem;
  padding: 0;
}
.artifact-review-suggestions li {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: .65rem;
}
.artifact-review-suggestion-actions { align-items: center; display: flex; gap: .65rem; margin-top: .55rem; }
.artifact-review-intent-form,
.artifact-review-decision {
  display: grid;
  gap: .6rem;
  margin-top: .6rem;
}
.artifact-review-intent-form[hidden] { display: none; }
.artifact-review-intent-form label,
.artifact-review-decision label {
  display: grid;
  font-size: var(--compat-type-78);
  gap: .3rem;
}
.artifact-review-intent-form textarea,
.artifact-review-intent-form select,
.artifact-review-decision textarea {
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  color: var(--color-text-primary);
  font: inherit;
  min-height: 4.5rem;
  padding: var(--compat-space-5);
  resize: vertical;
  width: 100%;
}
.artifact-review-intent-form select { min-height: auto; }
.artifact-review-verdict-actions {
  align-items: center;
  display: flex;
  gap: .85rem;
  margin-top: .8rem;
}
.artifact-review-more {
  border-top: 1px solid var(--color-border-subtle);
  margin-top: 1rem;
  padding-top: .65rem;
}
.artifact-review-more summary {
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--compat-type-8);
  list-style: none;
}
.artifact-review-more summary::-webkit-details-marker { display: none; }

@media (max-width: 400px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .artifact-review-page { padding-left: 0; padding-right: 0; }
  .artifact-review-stage,
  .artifact-review-stage.is-panel-open {
    display: block;
    height: calc(100vh - 4.5rem);
    min-height: 0;
    position: relative;
  }
  .artifact-review-canvas { height: 100%; }
  .artifact-review-canvas-bar {
    align-items: flex-start;
    box-sizing: border-box;
    max-width: 100vw;
  }
  .artifact-review-canvas-bar > div {
    box-sizing: border-box;
    flex: 1 1 100%;
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
  }
  .artifact-review-canvas-bar > div:first-child > strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .artifact-review-canvas-bar > div:last-child {
    justify-content: flex-start;
    margin-left: 0;
  }
  .artifact-review-orientation { flex-wrap: wrap; max-width: 100%; }
  /* On small screens keep the orientation pill and the proposed↔live flip;
     drop only the ref/relation/date detail. */
  .artifact-review-orientation-ref,
  .artifact-review-orientation-relation,
  .artifact-review-orientation-selected { display: none; }
  .artifact-review-frame { min-height: 0; }
  .artifact-review-panel {
    border-left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    bottom: 0;
    box-shadow: var(--elevation-overlay);
    height: min(72vh, 38rem);
    left: 0;
    position: fixed;
    right: 0;
    transform: translateY(105%);
    transition: transform 180ms ease;
    visibility: visible;
    width: 100%;
    z-index: 50;
  }
  .artifact-review-stage.is-panel-open .artifact-review-panel { transform: translateY(0); }
  .artifact-revision-selector,
  .artifact-revision-verdict > div,
  .artifact-revision-change-review-head,
  .artifact-revision-change-actions,
  .artifact-revision-inline-site-head { align-items: stretch; flex-direction: column; }
  .artifact-revision-rebase-callout { grid-template-columns: 1fr; }
  .artifact-revision-rebase-callout button { grid-column: 1; grid-row: auto; width: 100%; }
  .artifact-revision-change-compare { grid-template-columns: 1fr; }
  .artifact-revision-selector .btn,
  .artifact-revision-verdict button,
  .artifact-revision-change-actions button { min-height: 44px; width: 100%; }
}

/* ── Shared explicit read states (lib/read-state.js, Q-20260729-013) ──
   One partial/empty/error grammar for deep views; supersedes the per-surface
   .ph-rooms-partial / .ph-foryou-partial copies (kept for their surfaces). */
.read-state-partial {
  margin: -0.2rem 0 0.65rem;
  font-size: var(--compat-type-82);
  color: var(--color-text-tertiary);
}
.read-skeleton { display: grid; gap: 0.45rem; padding: 0.2rem 0; }
.read-state-empty, .read-state-absent, .read-state-error { padding: 0.2rem 0; }
.read-state-error .read-state-retry-btn { margin-top: 0.35rem; }
/* A read still running (nothing failed) reads as pending: quieter than the
   partial/failure notice and never paired with a retry. */
.read-state-pending {
  margin: -0.2rem 0 0.65rem;
  font-size: var(--compat-type-82);
  color: var(--color-text-tertiary);
  font-style: italic;
}
.read-state-partial .read-state-retry-btn { margin-left: 0.35rem; }

/* Artifact library and review history stay bounded until the operator asks
   for more. These rules supersede the generic person-row flex treatment. */
.person-artifacts-section-head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}
.person-artifacts-section-head .panel-desc { margin: .25rem 0 0; }
.person-artifact-groups {
  display: grid;
  gap: 1.15rem;
}
.person-artifact-group-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: .2rem;
}
.person-artifact-group-head .ops-eyebrow { margin: 0; }
.person-artifact-row {
  align-items: stretch;
  display: grid;
  gap: .45rem;
  padding-block: .8rem;
}
.person-artifact-primary {
  align-items: flex-start;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  min-width: 0;
}
.person-artifact-primary > .item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.person-artifact-row-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  justify-content: flex-end;
}
.person-artifact-row-actions .quiet-link {
  font-size: .74rem;
  white-space: nowrap;
}
.artifact-delivery-menu { position: relative; }
.artifact-delivery-menu > summary { cursor: pointer; list-style: none; min-height: 2.25rem; display: flex; align-items: center; gap: .3rem; }
.artifact-delivery-menu > summary::-webkit-details-marker { display: none; }
.artifact-delivery-panel {
  position: absolute; z-index: 30; right: 0; top: 100%; width: min(17rem, 80vw);
  display: grid; gap: .35rem; padding: .65rem; border-radius: var(--radius-md);
  background: var(--color-bg-surface-raised); border: 1px solid var(--color-border-default);
  box-shadow: var(--elevation-overlay); color: var(--color-text-primary);
}
.artifact-delivery-panel p { margin: .2rem; font-size: .85rem; white-space: normal; }
.artifact-delivery-panel [data-delivery-slot] { display: contents; }
.artifact-delivery-panel > button.quiet-link, .artifact-delivery-panel [data-delivery-slot] > button.quiet-link { min-height: 2.75rem; text-align: left; font-size: .85rem; }
.artifact-delivery-menu > summary:focus-visible, .artifact-delivery-panel > button:focus-visible, .artifact-delivery-panel [data-delivery-slot] > button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (pointer: coarse) { .artifact-delivery-menu > summary { min-height: 2.75rem; } }
.person-artifact-meta {
  align-items: center;
  color: var(--color-text-secondary);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--compat-type-78);
  gap: .35rem .5rem;
  min-width: 0;
}
.person-artifact-meta > * { min-width: 0; }
.person-artifact-meta .ph-room-context {
  max-width: min(100%, 22rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-review-version-disclosure > summary {
  align-items: center;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  gap: .65rem;
  justify-content: space-between;
  list-style: none;
  padding: .6rem;
}
.artifact-review-version-disclosure > summary::-webkit-details-marker { display: none; }
.artifact-review-version-disclosure > summary::after {
  color: var(--color-text-secondary);
  content: '▾';
  font-size: var(--compat-type-72);
}
.artifact-review-version-disclosure[open] > summary::after { content: '▴'; }
.artifact-review-version-disclosure > summary small {
  color: var(--color-text-secondary);
  font-size: var(--compat-type-72);
  margin-left: auto;
}
.artifact-review-version-disclosure .artifact-review-versions {
  margin-top: .45rem;
  max-height: min(48vh, 28rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: .15rem;
}

@media (max-width: 480px) {
  .person-artifacts-section-head { align-items: center; }
  .person-artifact-primary {
    align-items: stretch;
    flex-direction: column;
    gap: .45rem;
  }
  .person-artifact-row-actions { justify-content: flex-start; }
  .person-artifact-meta .ph-room-context { max-width: 12rem; }
}

/* C-NAV-5 (interaction contract) — degraded link affordance: an action whose
   destination failed validation renders disabled with a reason, never a
   silent reroute. */
.link-unavailable {
  border-color: var(--color-border-subtle);
  color: var(--color-text-tertiary);
  cursor: not-allowed;
  opacity: .65;
}

/* Read-state truthfulness (contract C-RSV-2, Wave 2 slice D) — overlay
   artifact loads that end in terminal absence or a failed read. */
.artifact-viewer-unavailable {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-lg);
}

/* ---- Decision detail (shared renderer — contract C-DEC-1/5/6, wave2 Slice A) ----
   One styled home for the markup decision-render.js emits everywhere the
   detail appears (inline card expand, ledger expand, artifact-viewer
   overlay). Grammar follows the queue detail block above (.issue-detail-*):
   quiet meta ahead of the body, actions separated by a subtle rule. */
.decision-detail {
  padding: var(--space-panel-gap) 0 var(--space-2xs);
}
.decision-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-xs);
  margin-bottom: var(--space-panel-gap);
}
.decision-detail-field {
  font-size: var(--type-small-size);
  color: var(--color-text-secondary);
}
.decision-detail-label {
  color: var(--color-text-tertiary);
  font-weight: var(--type-small-weight);
  margin-right: var(--space-3xs);
}
.decision-detail-body {
  margin-bottom: var(--space-2xs);
}
.decision-detail-promote {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin-top: var(--space-2xs);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--color-border-subtle);
}
.decision-promote-status {
  margin: 0;
}
.decision-promote-status.decision-promote-status-ok {
  color: var(--color-status-success-fg);
  opacity: 1;
}
.decision-item-active {
  background: var(--color-overlay-black-weak);
  margin: 0 calc(-1 * var(--space-xs));
  padding-left: var(--space-xs);
  padding-right: var(--space-xs);
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   Wave 2 Slice B — shared filter grammar
   (contract C-FIL-3/4/9 + C-CRD-3, portal-interaction-contract-2026-08-11)
   ========================================================================== */

/* C-FIL-4: the tag-tap active outline applies uniformly to every (B) tag
   source, including the context-chip form (button reset over
   .ph-room-context) used by the person triad and the for-you hero. Same
   treatment as .badge.tag-tap.tag-tap-active above. */
.ph-foryou-context.tag-tap-active {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 1px;
}

/* C-FIL-9: chip controls are keyboard-complete — visible focus state for
   the chip x, Clear, and tag-tap sources (hover-only until now). */
.filter-chip-remove:focus-visible,
.filter-chip-clear:focus-visible,
.filter-option:focus-visible,
.badge.tag-tap:focus-visible,
.ph-foryou-context:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Slice-A a11y sweep (SHELL-5 + interactive rows + tree + lens tabs): one
   branded keyboard focus ring for shell triggers, popover menu items, the
   div/li rows that carry role="button", the Knowledge tree rows, and the
   Action lens tabs. Same token-driven outline as the chip rule above; NO
   border-radius (outline already follows each element's own radius, and
   .header-avatar is a circle). --color-focus-ring is defined across all theme
   tiers, so this is theme-aware with no media/[data-theme] block. */
.btn:focus-visible,
.header-avatar:focus-visible,
.ph-identity-switcher:focus-visible,
.ph-primary-nav-trigger:focus-visible,
.header-finder-btn:focus-visible,
.ov-menu-item:focus-visible,
.ledger-line:focus-visible,
.plans-board-nav-item:focus-visible,
.issue-header:focus-visible,
.kanban-card-header:focus-visible,
.doc-tree-file:focus-visible,
.doc-tree-folder-label:focus-visible,
.action-lens-tab:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* C-CRD-3: the fixed header's inner row follows the page's content width.
   The header renders inside the page wrap, so the wide (1120px) views widen
   it in lockstep with their own .dash-wrap max-width overrides above and
   header nav + avatar align with page content on every page. Everywhere
   else the 720px base rule stands. Narrow viewports are unaffected
   (C-DEN-2): max-width only ever widens the row. */

/* Narrow-density corrections for the Artifact surfaces (contract C-DEN-1,
   Q-20260811-015 / Q-20260811-016). The entity Artifact-work row groups its
   kind badge and status into one right-hand cluster so the base .item
   space-between no longer scatters three children; tight widths wrap the
   cluster under the title instead of overflowing. The review canvas bar
   wraps its action group onto its own line and keeps button labels on one
   line so pills never collapse into multi-line lozenges. */
.publications-item { flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); }
.publications-item .artifact-link { min-width: 0; overflow-wrap: anywhere; }
.publications-item-meta { flex-shrink: 0; margin-left: auto; white-space: nowrap; }
.artifact-review-canvas-bar { flex-wrap: wrap; row-gap: var(--space-2xs); }
.artifact-review-canvas-bar > div:last-child {
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
  row-gap: var(--space-2xs);
}
.artifact-review-canvas-bar .btn,
.artifact-review-canvas-bar .artifact-review-text-action { white-space: nowrap; }
.knowledge-index-list .item { flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); }
.knowledge-index-list .item-name { min-width: 0; }
.knowledge-index-list .item-name code { overflow-wrap: anywhere; }
.knowledge-index-list .item-date { flex-shrink: 0; margin-left: auto; white-space: nowrap; }

/* Wave 3 — review finish line (contract C-NAV-1/C-NAV-2, C-RSV-4): the
   routed review page names its origin in the canvas bar and its failure
   states carry a return affordance instead of dead-ending. */
.artifact-review-canvas-bar .artifact-review-return {
  color: var(--color-text-secondary);
  flex-shrink: 0;
}
.artifact-review-load-state {
  display: grid;
  gap: var(--space-2xs);
  justify-items: start;
  padding: var(--space-lg) var(--space-page-x);
}
.artifact-review-load-state .artifact-review-return-row { margin: 0; }

/* Wave 3 — Knowledge→Action edges (contract C-CRD-1/C-DEC-5): raise-task
   composer in the doc viewer and the sensing overlay's action status. */
.doc-raise-task-mount {
  border-bottom: 1px solid var(--color-border-default);
  padding: var(--space-sm) var(--space-md);
}
.doc-raise-task-form {
  display: grid;
  gap: var(--space-xs);
  max-width: 34rem;
}
.doc-raise-task-form label {
  color: var(--color-text-secondary);
  display: grid;
  font-size: var(--type-small-size);
  gap: var(--space-2xs);
}
.doc-raise-task-form input,
.doc-raise-task-form textarea {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font: inherit;
  padding: var(--space-2xs) var(--space-xs);
}
.doc-raise-task-controls {
  align-items: center;
  display: flex;
  gap: var(--space-xs);
}
.doc-raise-task-status:empty { display: none; }
.doc-raise-task-done { margin: 0; }
.artifact-intelligence-action-status { margin: var(--space-2xs) 0 0; }
.artifact-intelligence-action-status:empty { display: none; }

/* Native Pipeline: the shared Action shell with a bounded record editor. */
.pipeline-heading, .pipeline-detail-heading, .pipeline-toolbar, .pipeline-form-actions {
  display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
}
.pipeline-heading, .pipeline-detail-heading { justify-content: space-between; }
.pipeline-heading h1, .pipeline-detail-heading h2 { margin: var(--space-sm) 0; }
.pipeline-toolbar { margin: var(--space-md) 0; align-items: end; }
.pipeline-toolbar label, .pipeline-form-grid label, .pipeline-linked-editor label {
  display: flex; flex-direction: column; gap: var(--space-2xs); min-width: 0;
}
.pipeline-search { flex: 1; min-width: 12rem; }
.pipeline-wrap input, .pipeline-wrap select, .pipeline-wrap textarea,
.pipeline-master-detail input, .pipeline-master-detail select, .pipeline-master-detail textarea {
  font: inherit; color: var(--color-text-primary); background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default); border-radius: var(--radius-sm);
  padding: var(--space-xs); width: 100%; box-sizing: border-box;
}
.pipeline-master-detail { display: grid; grid-template-columns: minmax(14rem, 0.85fr) minmax(0, 1.3fr); gap: var(--space-md); }
.pipeline-list { min-width: 0; }
.pipeline-list ul { list-style: none; padding: 0; margin: 0; }
.pipeline-list li { border-bottom: 1px solid var(--color-border-default); }
.pipeline-list button {
  display: flex; flex-direction: column; gap: var(--space-2xs); text-align: left; width: 100%;
  font: inherit; padding: var(--space-sm); color: var(--color-text-primary); border: 0;
  background: transparent; cursor: pointer; overflow-wrap: anywhere;
}
.pipeline-list button span { color: var(--color-text-secondary); font-size: var(--type-small-size); }
.pipeline-list button[aria-current="true"] { background: var(--color-bg-surface); box-shadow: inset 3px 0 var(--color-text-primary); }
.pipeline-detail { min-width: 0; border-left: 1px solid var(--color-border-default); padding-left: var(--space-md); }
.pipeline-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
.pipeline-wide { grid-column: 1 / -1; }
.pipeline-contacts-field, .pipeline-linked-editor, .pipeline-detail details { margin: var(--space-md) 0; }
.pipeline-contacts-field { border: 1px solid var(--color-border-default); max-height: 14rem; overflow: auto; }
.pipeline-contacts-field label { display: block; margin: var(--space-xs) 0; }
.pipeline-contacts-field [hidden] { display: none; }
.pipeline-contacts-field input { width: auto; }
.pipeline-linked-editor label { margin: var(--space-sm) 0; }
.pipeline-notice { color: var(--color-text-secondary); }
.pipeline-operating-summary { margin: var(--space-md) 0; padding-bottom: var(--space-sm); border-bottom: 1px solid var(--color-border-default); }
.pipeline-card-work { margin: var(--space-xs) 0; overflow-wrap: anywhere; }
.pipeline-subject-evidence dd { margin: var(--space-2xs) 0 var(--space-sm); overflow-wrap: anywhere; }
.pipeline-subject-evidence dt { color: var(--color-text-secondary); }
.pipeline-subject-ecosystem { list-style: none; padding: 0; display: grid; gap: var(--space-sm); }
.pipeline-ecosystem-card { padding: var(--space-sm); border: 1px solid var(--color-border-default); border-radius: var(--radius-sm); min-width: 0; overflow-wrap: anywhere; }
.pipeline-ecosystem-card dl { margin: var(--space-sm) 0 0; }
.pipeline-ecosystem-card dt { color: var(--color-text-secondary); }
.pipeline-ecosystem-card dd { margin: var(--space-2xs) 0 var(--space-sm); }
.pipeline-detail [data-save-state] { min-height: 1.4em; }
.pipeline-board-layout { min-width: 0; }
.pipeline-board-layout.pipeline-has-selection { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.75fr); gap: var(--space-md); }
.pipeline-boards, .pipeline-department-board { min-width: 0; }
.pipeline-department-board + .pipeline-department-board { margin-top: var(--space-lg); }
.pipeline-department-board h2 { font-size: var(--type-heading-size); margin-bottom: var(--space-xs); }
.pipeline-stage-columns { padding: var(--space-xs) 0; max-width: 100%; }
.pipeline-overview .pipeline-stage-columns { align-items: stretch; }
.pipeline-context-column { flex: 1 0 min(20rem, 85vw); max-width: 28rem; min-width: 0; }
.pipeline-context-column .panel-window-column-header { margin: 0 0 var(--space-xs); }
.pipeline-focus { margin-bottom: var(--space-sm); }
.pipeline-overview .pipeline-card-work { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pipeline-toolbar .pipeline-search, .pipeline-toolbar .pipeline-scope { display: flex; flex-direction: column; gap: var(--space-2xs); font-size: var(--type-small-size); }
.pipeline-toolbar input, .pipeline-toolbar select { font: inherit; color: var(--color-text-primary); background: var(--color-bg-surface); border: 1px solid var(--color-border-default); border-radius: var(--radius-sm); padding: var(--space-xs) var(--space-sm); min-height: 2.25rem; box-sizing: border-box; width: 100%; }
.pipeline-scope { min-width: 10rem; }
.pipeline-stage-columns { overflow-x: auto; overscroll-behavior-x: contain; }
.pipeline-stage-column { flex: 0 0 min(18rem, 85vw); }
.pipeline-boards .panel-window-column-body { max-height: min(65vh, 42rem); overflow-y: auto; overscroll-behavior-y: contain; }
.pipeline-stage-column .panel-window-column-header { margin: 0 0 var(--space-sm); }
.pipeline-card-open { width: 100%; text-align: left; background: transparent; border: 0; padding: 0; font: inherit; }
.pipeline-card-open[aria-current="true"] { text-decoration: underline; text-underline-offset: var(--space-2xs); }
.pipeline-card-tags { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin-top: var(--space-xs); }
.pipeline-card-decision { margin: var(--space-xs) 0; font-size: var(--type-small-size); }
.pipeline-card-contact { font-size: var(--type-small-size); color: var(--color-text-secondary); overflow-wrap: anywhere; }
.pipeline-card-move { margin-top: var(--space-sm); font-size: var(--type-small-size); }
.pipeline-card-move summary { cursor: pointer; color: var(--color-text-secondary); }
.pipeline-board-layout input, .pipeline-board-layout select, .pipeline-board-layout textarea {
  font: inherit; color: var(--color-text-primary); background: var(--color-bg-surface); border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm); padding: var(--space-xs); width: 100%; box-sizing: border-box;
}
.pipeline-board-layout .pipeline-contacts-field input { width: auto; }
@media (max-width: 700px) {
  .pipeline-master-detail { display: block; }
  .pipeline-has-selection .pipeline-list { display: none; }
  .pipeline-detail { border: 0; padding: 0; }
  .pipeline-form-grid { grid-template-columns: 1fr; }
  .pipeline-toolbar { align-items: stretch; }
  .pipeline-toolbar > label { flex: 1 1 100%; }
  .pipeline-toolbar button { width: 100%; }
  .pipeline-wrap .action-lens-tabs { flex-wrap: wrap; }
  .pipeline-board-layout.pipeline-has-selection { display: block; }
  .pipeline-has-selection .pipeline-boards { display: none; }
  .pipeline-stage-columns { scroll-snap-type: x proximity; }
  .pipeline-stage-column { scroll-snap-align: start; }
}

/* Context lists disclose only children that overflow their available row. */
.context-overflow { display: flex; align-items: flex-start; gap: .3rem; }
.context-overflow-list { display: flex; flex: 1; min-width: 0; flex-wrap: wrap; gap: .5rem; }
.context-overflow-list > [hidden], .ov-menu-item[hidden] { display: none; }
.context-overflow-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 2rem; min-height: 2rem; background: transparent; border: 0; color: var(--color-text-secondary); cursor: pointer; }
.context-overflow-toggle[hidden] { display: none; }
.context-overflow-toggle[aria-expanded="true"] svg, .ov-menu-context-disclosure[aria-expanded="true"] svg { transform: rotate(180deg); }
.context-overflow-toggle:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.ov-menu-context-disclosure { justify-content: center; }

/* One SVG for disclosure controls, including native details markers. */
:where(details > summary):not(.felt-l1-gist-summary) {
  display: flex;
  align-items: center;
  gap: .5rem;
  list-style: none;
}
:where(details > summary)::-webkit-details-marker { display: none; }
:where(details > summary)::marker { content: ''; }
.disclosure-chevron,
:where(details > summary):not(.felt-l1-gist-summary)::before,
summary.disclosure-summary::before,
.entity-settings-summary::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: url('icons/chevron.svg') center / contain no-repeat;
  mask: url('icons/chevron.svg') center / contain no-repeat;
  transform: rotate(-90deg);
  transition: transform .2s ease;
}
details[open] > summary::before,
.entity-settings-fold[open] > .entity-settings-summary::before,
[aria-expanded="true"] > .disclosure-chevron {
  transform: rotate(0deg);
}
.artifact-review-version-disclosure > summary::after,
.artifact-review-version-disclosure[open] > summary::after { content: none; }
.ov-menu-context-row { display: flex; align-items: stretch; }
.ov-menu-context-row > [data-index] { flex: 1 1 auto; min-width: 0; }
.ov-menu-context-row > .ov-menu-context-disclosure {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 2rem;
}
@media (prefers-reduced-motion: reduce) {
  .disclosure-chevron, details > summary::before { transition: none; }
}

/* Optional Pipeline list: compact scanning without changing department funnels. */
.pipeline-layout-controls { display: flex; gap: var(--space-2xs); }
.pipeline-layout-controls [aria-pressed="true"] { background: var(--color-bg-surface); box-shadow: inset 0 -2px var(--color-text-primary); }
.pipeline-notice button.quiet-link,
.pipeline-record-list-meta button.quiet-link { border: 0; background: transparent; padding: var(--space-2xs) 0; font: inherit; cursor: pointer; text-decoration: underline; }
.pipeline-record-list { min-width: 0; }
.pipeline-record-list > ul { list-style: none; margin: 0; padding: 0; }
.pipeline-record-list-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: var(--space-md); padding: var(--space-sm); border-bottom: 1px solid var(--color-border-default);
  overflow-wrap: anywhere;
}
.pipeline-record-list-row[data-selected="true"] { background: var(--color-bg-surface); box-shadow: inset 3px 0 var(--color-text-primary); }
.pipeline-record-list-open { background: transparent; border: 0; padding: var(--space-xs) 0; text-align: left; font: inherit; color: var(--color-text-primary); cursor: pointer; }
.pipeline-record-list-open:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: var(--space-2xs); }
.pipeline-record-list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); color: var(--color-text-secondary); font-size: var(--type-small-size); }
.pipeline-record-list-work { min-width: 0; font-size: var(--type-small-size); }
.pipeline-record-list-work p { margin: var(--space-xs) 0; white-space: pre-wrap; }
.pipeline-record-list-work .kanban-card-desc-clamp { display: block; -webkit-line-clamp: unset; max-height: none; overflow: visible; }
@media (max-width: 700px) {
  .pipeline-record-list-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); }
  .pipeline-has-selection .pipeline-record-list { display: none; }
}

/* Shared read-state presentation (C-RSV-5). Surface-specific empty rules
   have been retired; layout remains on the containing section. */
.read-state-empty, .read-state-absent, .read-state-error, .read-state-prompt {
  color: var(--color-text-tertiary);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line-height);
  padding: var(--space-2xs) 0;
}
.read-state-empty > p, .read-state-absent > p, .read-state-error > p {
  margin: 0;
  color: inherit;
  font-size: inherit;
}
.read-state-absent em { font-style: normal; color: var(--color-text-secondary); }
.read-state-absent code { font-family: var(--type-family-mono); color: var(--color-accent-default); }
.read-skeleton-inline { display: inline-flex; width: 5em; padding: 0; vertical-align: middle; }
.read-skeleton-inline .ph-skeleton-line { display: block; width: 100%; margin: 0; }

/* Home v2: one column, with type and space carrying the four sections. */
.home-v2-section {
  margin-block: var(--space-lg) var(--space-xl);
  /* Hash targets must clear the fixed 45px header as well as the section gap. */
  scroll-margin-top: calc(45px + var(--space-md));
  outline: none;
}
.home-v2-section .home-section-head { margin-bottom: var(--space-sm); }
.home-v2-row, .home-v2-context {
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--color-border-subtle);
  overflow-wrap: anywhere;
}
.home-v2-context > .home-row-title { display: inline-block; margin-bottom: var(--space-xs); }
.home-v2-today { max-width: 68ch; margin-bottom: var(--space-sm); }
.home-v2 [data-health="healthy"] { color: var(--color-status-success-fg); }
.home-v2 [data-health="critical"] { color: var(--color-status-danger-fg); }

.home-v2-label {
  margin: 0;
  font-family: var(--type-family-body);
  font-size: var(--type-body-size);
  font-weight: 600;
  color: var(--color-text-primary);
}
.home-v2-today > h1 { margin-top: 0; font-family: var(--type-family-display); font-weight: 300; }
.home-v2 [data-health="warning"] { color: var(--color-status-warning-fg); }

/* Pages classes only appear when ZERO_PAGES is enabled. */
.entity-doc .zero-callout-label { font-weight: 600; }
.entity-doc .zero-mention, .entity-doc .zero-date { font-weight: 500; }
.entity-doc .zero-pending { color: var(--color-text-secondary); font-style: italic; }
.zero-page-break { display: block; break-after: page; }

/* T1-P2: consoles share the Settings shell, including at narrow widths. */
.entity-management-group,
.entity-settings-console {
  min-width: 0;
}
.entity-settings-console {
  width: 100%;
  max-width: none;
}
#entity-settings-connections,
#entity-settings-audit {
  scroll-margin-top: var(--space-lg);
}
.pages-create-dialog { width: min(900px, 90vw); max-height: 90vh; overflow: auto; }
.pages-create-editor { min-height: 220px; margin-block: 16px; }
[data-knowledge-new-page][hidden] { display: none; }

.timeline-view p.panel-desc-faded { opacity: 1; }

.object-agent-action { flex: 0 0 auto; white-space: nowrap; }
.ov-dialog[data-overlay-id="artifact-agent"] {
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  min-height: 0;
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
}
.ov-dialog[data-overlay-id="artifact-agent"] .ov-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.object-agent-handoff { display: grid; gap: 1rem; overflow-wrap: anywhere; }
.object-agent-handoff p { margin: 0; }
.object-agent-handoff summary { cursor: pointer; }
.object-agent-handoff textarea { display: block; width: 100%; box-sizing: border-box; margin-top: .5rem; min-height: 5rem; max-height: 40dvh; resize: vertical; }

/* Start flow uses the Portal's surfaces, typography, form controls and step markers. */
.start-flow {
  max-width: 40rem;
  margin-inline: auto;
}
.start-flow-card {
  padding: var(--space-lg);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
}
.start-flow-card h2 { margin-top: 0; }
.start-flow-card .form-input { width: 100%; margin-bottom: var(--space-md); }
.start-flow-card .composer-actions { margin-top: var(--space-lg); }
.start-flow-card .btn { line-height: 1.4; }
.start-flow-card .btn-outline {
  padding: calc(0.7rem - 1px) calc(1.8rem - 1px);
  font-size: 0.92rem;
}
.home-v2-section[hidden], [data-home-invitations][hidden] { display: none; }
