:root {
  color-scheme: dark;
  --shell: #11110f;
  --shell-raised: #171714;
  --shell-soft: #1d1c19;
  --shell-line: #2a2925;
  --shell-text: #f3f1eb;
  --shell-muted: #92918a;
  --paper: #f8f7f3;
  --paper-raised: #fffefa;
  --ink: #24231f;
  --ink-soft: #55534d;
  --ink-muted: #87847c;
  --paper-line: #e5e2da;
  --paper-line-dark: #d4d0c7;
  --accent: 116, 116, 111;
  --accent-solid: #74746f;
  --coral: #ee765e;
  --cyan: #48afd0;
  --amber: #d99a40;
  --violet: #9177dc;
  --sidebar-width: 216px;
  --rail-width: 292px;
  --topbar-height: 52px;
  --lensbar-height: 58px;
  --ease-out: cubic-bezier(.2, .75, .25, 1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-lens="sales"] { --accent: 238, 104, 81; --accent-solid: #ee6851; }
html[data-lens="usage"] { --accent: 42, 164, 205; --accent-solid: #2aa4cd; }
html[data-lens="support"] { --accent: 215, 146, 48; --accent-solid: #d79230; }
html[data-lens="delivery"] { --accent: 132, 103, 217; --accent-solid: #8467d9; }

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--shell);
}

body,
button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

button:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid rgba(var(--accent), .72);
  outline-offset: 2px;
}

.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--rail-width);
  background: var(--shell);
  color: var(--shell-text);
}

/* Sidebar */

.sidebar {
  min-width: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--shell-line);
  background: #131310;
  overflow: hidden;
}

.brand-row {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border-bottom: 1px solid var(--shell-line);
}

.brand-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #57564f;
  border-radius: 6px;
  color: #11110f;
  background: #f2f0e9;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
}

.brand-name {
  font-size: 13px;
  font-weight: 640;
  letter-spacing: -.01em;
}

.collapse-button {
  width: 26px;
  height: 26px;
  margin-left: auto;
  border-radius: 5px;
  color: #85847d;
  background: transparent;
  font-size: 19px;
}

.collapse-button:hover { background: #21211d; color: #dddcd5; }

.workspace-nav {
  display: grid;
  gap: 2px;
  padding: 10px 8px 8px;
}

.nav-row,
.tree-row {
  height: 30px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 5px;
  color: #aaa9a2;
  font-size: 12px;
  transition: color 160ms ease, background 160ms ease;
}

.nav-row { padding: 0 8px; }
.nav-row:hover,
.tree-row:hover { color: #f1efe8; background: #1e1e1a; }
.nav-row .icon { color: #77766f; }
.nav-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-row kbd { margin-left: auto; color: #62615b; font-size: 9px; font-family: inherit; }
.nav-count { margin-left: auto; color: #6f6e67; font-size: 10px; }
.status-dot { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: #db765f; }

.nav-section {
  flex: 1;
  min-height: 0;
  padding: 14px 8px;
  border-top: 1px solid #1f1f1b;
}

.nav-heading {
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #686760;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.nav-heading button {
  margin-left: auto;
  color: #62615b;
  background: transparent;
  font-size: 16px;
}

.tree-row { padding: 0 7px; }
.tree-row.child { padding-left: 23px; }
.tree-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row.active { color: #f2f0e9; background: #24231f; }
.tree-row.muted { color: #74736c; }
.disclosure { width: 9px; color: #64635d; text-align: center; }
.doc-glyph { color: #6e6d66; font-size: 11px; }

.sidebar-footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px;
  padding: 9px 10px;
  border: 1px solid #2b2a26;
  border-radius: 7px;
  background: #181815;
}

.presence-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6bbb83;
  box-shadow: 0 0 0 3px rgba(107, 187, 131, .12);
}

.sidebar-footer strong,
.sidebar-footer span { display: block; }
.sidebar-footer strong { color: #c5c3bc; font-size: 10px; font-weight: 560; }
.sidebar-footer span { margin-top: 2px; color: #66655f; font-size: 9px; }

/* Main chrome */

.main-column {
  min-width: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--topbar-height) var(--lensbar-height) minmax(0, 1fr);
}

.topbar {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--shell-line);
  background: #131310;
}

.breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #76756e;
  font-size: 11px;
  white-space: nowrap;
}

.breadcrumb strong { max-width: 240px; overflow: hidden; color: #c9c7c0; font-weight: 540; text-overflow: ellipsis; }
.breadcrumb .slash { color: #474641; }

.topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.save-state { display: flex; align-items: center; gap: 5px; color: #686761; font-size: 9px; }
.saved-dot { width: 4px; height: 4px; border-radius: 50%; background: #75a77e; }
.draft-chip { padding: 3px 6px; border: 1px solid #393833; border-radius: 4px; color: #85847d; font-size: 9px; }

.avatar-stack { display: flex; margin-left: 5px; }
.avatar {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin-left: -5px;
  border: 2px solid #131310;
  border-radius: 50%;
  color: #171614;
  font-size: 8px;
  font-weight: 750;
}
.avatar:first-child { margin-left: 0; }
.avatar-coral { background: #d88270; }
.avatar-amber { background: #d7a65d; }
.avatar-violet { background: #9c88cf; }
.avatar-more { color: #aaa8a1; background: #2b2a26; }

.share-button,
.more-button {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #34332f;
  border-radius: 5px;
  color: #c8c6be;
  background: #1b1b18;
}

.share-button { gap: 6px; padding: 0 9px; font-size: 10px; }
.share-button:hover,
.more-button:hover { border-color: #4a4943; background: #22221e; }
.more-button { width: 28px; }

.lens-bar-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--shell-line);
  background: #171714;
  box-shadow: 0 1px 0 rgba(255,255,255,.015);
}

.lens-intro { display: flex; align-items: center; gap: 7px; color: #77766f; font-size: 9px; text-transform: uppercase; letter-spacing: .075em; white-space: nowrap; }
.live-dot { width: 6px; height: 6px; border: 1px solid rgba(var(--accent), .9); border-radius: 50%; box-shadow: inset 0 0 0 2px #171714; background: rgb(var(--accent)); transition: background 180ms ease; }

.lens-switcher {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #2f2e2a;
  border-radius: 7px;
  background: #11110f;
  overflow-x: auto;
  scrollbar-width: none;
}
.lens-switcher::-webkit-scrollbar { display: none; }

.lens-tab {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 5px;
  color: #85847d;
  background: transparent;
  font-size: 10px;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.lens-tab .icon { opacity: .7; }
.lens-tab kbd { color: #4f4e49; font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.lens-tab:hover { color: #d2d0c8; background: #1b1b18; }
.lens-tab.selected { color: #f4f1e9; background: #292824; box-shadow: inset 0 0 0 1px #3c3b36; }
.lens-tab.selected .icon { color: rgb(var(--accent)); opacity: 1; }
.lens-tab.selected kbd { color: #85837b; }

.inspector-trigger {
  display: none;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-left: auto;
  border: 1px solid #34332f;
  border-radius: 5px;
  color: #aaa8a1;
  background: #1b1b18;
}

/* Document canvas */

.workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  color: var(--ink);
  background-color: #1a1a17;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 48px 48px;
  scrollbar-color: #3b3a35 transparent;
  scrollbar-width: thin;
}

.document-stage {
  position: relative;
  width: min(720px, calc(100% - 54px));
  margin: 34px auto 80px;
}

.page-index {
  position: absolute;
  top: 212px;
  left: -27px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #55544e;
  font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}

.document-page {
  position: relative;
  width: 100%;
  min-height: 1180px;
  padding: 60px 72px 52px;
  border: 1px solid #d7d3ca;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 12px 32px rgba(0,0,0,.18);
}

.document-header { position: relative; }
.doc-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 1px solid var(--paper-line-dark);
  border-radius: 8px;
  color: #4d4b45;
  background: #efede7;
  font-size: 17px;
}
.document-meta { display: flex; gap: 6px; margin-bottom: 10px; color: var(--ink-muted); font-size: 9px; font-weight: 560; letter-spacing: .035em; text-transform: uppercase; }
.document-header h1 { max-width: 560px; margin: 0; color: #20201c; font-size: clamp(32px, 4vw, 46px); line-height: .98; font-weight: 665; letter-spacing: -.052em; }
.document-subtitle { margin: 14px 0 24px; color: #66635d; font-size: 14px; line-height: 1.5; }

.document-properties {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.document-properties > span { display: grid; grid-template-columns: 22px auto; grid-template-rows: auto auto; column-gap: 7px; align-items: center; }
.document-properties i { width: 20px; height: 20px; grid-row: 1 / 3; display: grid; place-items: center; border-radius: 5px; color: #5f5c55; background: #ebe8e1; font-style: normal; font-size: 8px; }
.document-properties em { color: #99968e; font-style: normal; font-size: 8px; line-height: 1; text-transform: uppercase; letter-spacing: .04em; }
.document-properties strong { margin-top: 2px; color: #4d4b45; font-size: 10px; font-weight: 560; line-height: 1; }
.property-avatar { color: #5e4e3d !important; background: #e5d4c1 !important; }
.property-team { color: #466159 !important; background: #d9e4de !important; }

.document-divider { height: 1px; margin: 34px 0 10px; background: var(--paper-line); }

.doc-block {
  position: relative;
  margin: 0 -18px;
  padding: 24px 18px;
  border-radius: 5px;
  outline: none;
  scroll-margin: 120px;
  transition: background-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.doc-block + .doc-block { margin-top: 4px; }
.doc-block h2 { margin: 0 0 10px; color: #292823; font-size: 17px; line-height: 1.25; font-weight: 650; letter-spacing: -.02em; }
.doc-block p { margin: 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.68; }
.doc-block p + p { margin-top: 10px; }
.block-lead p { color: #3f3d37; font-size: 14px; line-height: 1.72; }
.block-lead h2 { font-size: 10px; color: #96938b; text-transform: uppercase; letter-spacing: .07em; }

.goal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.mini-label { display: block; margin-bottom: 9px; color: #8d8a83; font-size: 9px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.check-list,
.dash-list,
.feature-details { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.check-list li,
.dash-list li { display: grid; grid-template-columns: 16px 1fr; color: #55524c; font-size: 11px; line-height: 1.45; }
.check-list li span { color: #5f9672; }
.dash-list li span { color: #a09d95; }

.block-feature { margin-top: 10px !important; padding-top: 28px; padding-bottom: 28px; border-top: 1px solid var(--paper-line); }
.feature-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.feature-heading h2 { margin: 0; }
.step-number { color: #99968e; font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-label { margin-left: auto; padding: 3px 6px; border: 1px solid var(--paper-line-dark); border-radius: 4px; color: #85827a; background: rgba(255,255,255,.46); font-size: 8px; white-space: nowrap; }
.feature-details { gap: 0; margin-top: 14px; border: 1px solid var(--paper-line); border-radius: 6px; background: rgba(255,255,255,.42); }
.feature-details li { display: flex; align-items: center; gap: 9px; min-height: 30px; padding: 0 10px; color: #55524c; font-size: 10px; }
.feature-details li + li { border-top: 1px solid var(--paper-line); }
.detail-grip { color: #aaa79f; font-size: 8px; letter-spacing: -2px; }

.block-callout { margin-top: 12px !important; padding: 16px 18px 16px 52px; border: 1px solid var(--paper-line); background: #f0eee8; }
.block-callout h2 { margin-bottom: 5px; font-size: 12px; }
.callout-symbol { position: absolute; left: 18px; top: 17px; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #c8c4bb; border-radius: 50%; color: #77746c; font: 600 10px/1 Georgia, serif; }

.metric-table { margin-top: 16px; overflow: hidden; border: 1px solid var(--paper-line-dark); border-radius: 6px; }
.metric-row { min-height: 38px; display: grid; grid-template-columns: minmax(0, 1.6fr) .65fr .65fr; align-items: center; padding: 0 12px; color: #6b6861; font-size: 9px; }
.metric-row + .metric-row { border-top: 1px solid var(--paper-line); }
.metric-row strong { color: #47453f; font-weight: 560; }
.metric-head { min-height: 28px; color: #99968e; background: #eeece6; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.target-value { color: #3e7451; font-weight: 650; }

.rollout-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 20px 0 0; padding: 0; list-style: none; }
.rollout-track li { position: relative; display: grid; gap: 7px; justify-items: start; color: #8d8a83; font-size: 8px; }
.rollout-track li::before { content: ""; position: absolute; top: 9px; left: 18px; right: 0; height: 1px; background: #d6d2c9; }
.rollout-track li:last-child::before { display: none; }
.rollout-track li > span { position: relative; z-index: 1; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #c8c4bb; border-radius: 50%; background: var(--paper); font-size: 7px; }
.rollout-track li.complete > span { border-color: #7fa18a; color: #4f765a; background: #e1ebe4; }
.rollout-track li.complete::before { background: #9db5a4; }
.rollout-track strong { max-width: 90px; color: #76736c; font-weight: 560; line-height: 1.3; }

.document-footer { display: flex; justify-content: space-between; margin-top: 42px; padding-top: 14px; border-top: 1px solid var(--paper-line); color: #aaa79f; font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .04em; }

/* Lens signals */

.doc-block.has-signal {
  background-color: rgba(var(--accent), calc(.025 + var(--signal-strength) * .105));
  box-shadow: inset 0 0 0 1px rgba(var(--accent), calc(.04 + var(--signal-strength) * .11));
}
.doc-block.has-signal:hover,
.doc-block.has-signal.is-active,
.doc-block.has-signal:focus-visible {
  background-color: rgba(var(--accent), calc(.06 + var(--signal-strength) * .15));
  box-shadow: inset 0 0 0 1px rgba(var(--accent), calc(.16 + var(--signal-strength) * .19));
}
.doc-block.is-pinned { box-shadow: inset 0 0 0 1px rgba(var(--accent), .5), 0 0 0 2px rgba(var(--accent), .08); }
.doc-block.is-active,
.doc-block.is-pinned { z-index: 10; }

.intensity-rail {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: -8px;
  width: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(var(--accent), .12);
}
.intensity-rail span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(var(--signal-strength) * 100%);
  border-radius: inherit;
  background: rgba(var(--accent), calc(.55 + var(--signal-strength) * .4));
  transition: height 220ms var(--ease-out);
}

.comment-pin {
  position: absolute;
  z-index: 8;
  top: 13px;
  left: calc(100% - 36px);
  display: flex;
  align-items: flex-start;
  padding: 0;
  background: none;
  transition: left 140ms var(--ease-out);
}
.pin-badge {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 3px;
  border-radius: 50%;
  background: rgb(var(--accent));
  box-shadow: 0 2px 5px rgba(24,22,19,.2), 0 0 0 3px rgba(var(--accent), calc(.08 + var(--signal-strength, 0) * .12));
  transition: box-shadow 140ms var(--ease-out), transform 140ms var(--ease-out);
}
.pin-disc {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #3a382f;
  background: #f2f0e9;
}
.pin-badge::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: -4px;
  width: 7px;
  height: 7px;
  background: rgb(var(--accent));
  clip-path: polygon(0 0, 100% 0, 0 100%);
  transition: opacity 120ms var(--ease-out);
}
.comment-pin:hover .pin-badge,
.comment-pin:focus-visible .pin-badge {
  transform: scale(1.1);
  box-shadow: 0 3px 9px rgba(24,22,19,.26), 0 0 0 4px rgba(var(--accent), .22);
}
.comment-pin.is-open .pin-badge {
  width: 0;
  height: 0;
  padding: 0;
  margin: 13px 0 0;
  opacity: 0;
  box-shadow: none;
  overflow: hidden;
}
.comment-pin.is-open .pin-badge::after { opacity: 0; }

.pin-tooltip {
  overflow: hidden;
  width: 0;
  max-height: 0;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: width 200ms var(--ease-out), max-height 200ms var(--ease-out), opacity 140ms var(--ease-out);
}
.pin-tooltip-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 224px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #191916;
  box-shadow: 0 12px 28px rgba(24,22,19,.34), 0 2px 8px rgba(24,22,19,.24);
}
.pin-tooltip-inner::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: -4px;
  width: 7px;
  height: 7px;
  background: #191916;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.pin-tooltip-disc {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #3a382f;
  background: #f2f0e9;
}
.pin-tooltip-text {
  padding-top: 2px;
  color: #c7c5bc;
  font-size: 10.5px;
  line-height: 1.5;
  text-align: left;
}
.pin-tooltip-text strong { color: #faf8f1; font-weight: 650; }
.comment-pin.is-open .pin-tooltip {
  width: 224px;
  max-height: 140px;
  opacity: 1;
  pointer-events: auto;
}
.block-feature .comment-pin { top: 52px; }
.block-feature.has-signal > p { padding-right: 34px; }

@media (min-width: 1440px) {
  .comment-pin { left: calc(100% + 42px); }
}

/* Presence and evidence */

.presence-agent {
  --entry-x: 32px;
  --entry-y: -12px;
  position: absolute;
  z-index: 7;
  left: clamp(22px, var(--anchor-x), calc(100% - 138px));
  top: var(--anchor-y);
  width: 16px;
  height: 22px;
  color: var(--coral);
  opacity: 0;
  transform: translate(var(--entry-x), var(--entry-y)) scale(.96);
  pointer-events: none;
  animation: presence-enter 480ms var(--ease-out) forwards;
  isolation: isolate;
}

.presence-dev { --entry-x: -34px; --entry-y: -8px; }
.presence-nora { --entry-x: 24px; --entry-y: -18px; }
.presence-lin { --entry-x: 36px; --entry-y: 18px; }
.presence-coral { color: var(--coral); }
.presence-cyan { color: var(--cyan); }
.presence-amber { color: var(--amber); }
.presence-violet { color: var(--violet); }

.presence-drift {
  position: relative;
  width: 16px;
  height: 22px;
  animation: drift-maya 6s ease-in-out infinite;
}
.presence-dev .presence-drift { animation-name: drift-dev; animation-duration: 5.7s; }
.presence-nora .presence-drift { animation-name: drift-nora; animation-duration: 6.2s; }
.presence-lin .presence-drift { animation-name: drift-lin; animation-duration: 5.5s; }

.presence-cursor {
  position: relative;
  z-index: 3;
  display: block;
  color: currentColor;
  filter: drop-shadow(0 1px 1px rgba(20, 19, 17, .22));
}

.presence-label {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 17px;
  display: block;
  padding: 4px 6px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: currentColor;
  background: #191916;
  box-shadow: 0 2px 5px rgba(27, 25, 22, .18);
  font-size: 8px;
  font-weight: 590;
  line-height: 1;
  letter-spacing: .01em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(2px);
  animation: presence-label-in 280ms var(--ease-out) 40ms forwards;
}

[data-lens="document"] .presence-agent { animation: presence-cycle 18s linear infinite; }
[data-lens="document"] .presence-maya { animation-delay: -1s; }
[data-lens="document"] .presence-dev { animation-delay: -7s; }
[data-lens="document"] .presence-lin { animation-delay: -13s; }

@keyframes presence-enter {
  0% { opacity: 0; transform: translate(var(--entry-x), var(--entry-y)) scale(.96); }
  65% { opacity: 1; }
  100% { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes presence-label-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes presence-cycle {
  0%, 4% { opacity: 0; transform: translate(var(--entry-x), var(--entry-y)) scale(.96); }
  8%, 29% { opacity: 1; transform: translate(0, 0) scale(1); }
  35%, 100% { opacity: 0; transform: translate(3px, -2px) scale(1); }
}
@keyframes drift-maya {
  0%, 100% { translate: 0 0; }
  25% { translate: 4px -3px; }
  50% { translate: -2px 4px; }
  75% { translate: 3px 2px; }
}
@keyframes drift-dev {
  0%, 100% { translate: 0 0; }
  33% { translate: -4px 3px; }
  66% { translate: 3px -2px; }
}
@keyframes drift-nora {
  0%, 100% { translate: 0 0; }
  30% { translate: -3px 2px; }
  60% { translate: 4px -4px; }
}
@keyframes drift-lin {
  0%, 100% { translate: 0 0; }
  40% { translate: 3px 4px; }
  70% { translate: -3px -2px; }
}

.evidence-card {
  position: absolute;
  z-index: 12;
  right: 10px;
  top: calc(100% - 10px);
  width: 260px;
  padding: 12px;
  border: 1px solid #3b3934;
  border-radius: 7px;
  color: #e9e7e0;
  background: #191916;
  box-shadow: 0 14px 30px rgba(24,22,19,.26), 0 2px 8px rgba(24,22,19,.2);
  animation: evidence-in 180ms var(--ease-out) both;
}
.evidence-card::before { content: ""; position: absolute; top: -5px; right: 24px; width: 8px; height: 8px; border-top: 1px solid #3b3934; border-left: 1px solid #3b3934; background: #191916; transform: rotate(45deg); }
.evidence-card[data-placement="above"] { top: auto; bottom: calc(100% - 10px); }
.evidence-card[data-placement="above"]::before { top: auto; bottom: -5px; border: 0; border-right: 1px solid #3b3934; border-bottom: 1px solid #3b3934; }
.evidence-topline { display: flex; align-items: center; color: #85837c; font-size: 8px; text-transform: uppercase; letter-spacing: .055em; }
.evidence-topline > span { display: flex; align-items: center; gap: 6px; }
.evidence-topline i { width: 5px; height: 5px; border-radius: 50%; background: rgb(var(--accent)); box-shadow: 0 0 0 2px rgba(var(--accent), .12); }
.evidence-metric { display: flex; align-items: baseline; gap: 7px; margin-top: 10px; }
.evidence-metric strong { color: #faf8f1; font-size: 22px; line-height: 1; letter-spacing: -.035em; }
.evidence-metric span { color: #9c9a92; font-size: 9px; }
.trend-row { display: flex; gap: 5px; margin-top: 8px; }
.trend-row span { padding: 3px 5px; border: 1px solid #35342f; border-radius: 4px; color: #89877f; background: #20201c; font-size: 7px; }
.trend-row span:first-child { color: rgb(var(--accent)); border-color: rgba(var(--accent), .22); background: rgba(var(--accent), .08); }
.evidence-card > p { margin: 10px 0 11px; color: #b5b3ab; font-size: 9px; line-height: 1.5; }
.evidence-source { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; padding-top: 9px; border-top: 1px solid #2d2c28; }
.evidence-source span { color: #66655f; font-size: 7px; text-transform: uppercase; letter-spacing: .05em; }
.evidence-source code { overflow: hidden; color: #85837c; font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
@keyframes evidence-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Inspector */

.insight-rail {
  position: relative;
  z-index: 20;
  height: 100dvh;
  padding: 18px 16px 12px;
  border-left: 1px solid var(--shell-line);
  color: var(--shell-text);
  background: #141411;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3b3a35 transparent;
}

.inspector-mobile-head { display: none; }
.rail-title-row { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.source-disc-row { display: flex; align-items: center; }
.source-disc {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-left: -10px;
  border: 2px solid #141411;
  border-radius: 50%;
  color: #3a382f;
  background: #f2f0e9;
  box-shadow: 0 1px 3px rgba(0,0,0,.22);
}
.source-disc:first-child { margin-left: 0; }
.source-disc-more { color: #d8d5cb; font-size: 9px; font-weight: 650; background: #2a2924; }
.rail-eyebrow { display: block; color: #686760; font-size: 8px; line-height: 1.2; text-transform: uppercase; letter-spacing: .08em; }
.rail-title-row h2 { margin: 3px 0 0; color: #eeece5; font-size: 14px; line-height: 1; font-weight: 620; }
.rail-description { margin: 0 0 16px; color: #7f7e76; font-size: 10px; line-height: 1.55; }

.summary-card {
  position: relative;
  padding: 13px;
  border: 1px solid rgba(var(--accent), .19);
  border-radius: 8px;
  background: rgba(var(--accent), .055);
  overflow: hidden;
}
.summary-card::after { content: ""; position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: rgb(var(--accent)); opacity: .75; }
.summary-card > span { color: rgba(var(--accent), .8); font-size: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .075em; }
.summary-card > strong { display: block; margin-top: 11px; color: #f2f0e9; font-size: 30px; line-height: .9; font-weight: 620; letter-spacing: -.045em; }
.summary-card > p { margin: 7px 0 12px; color: #9f9d95; font-size: 9px; }
.summary-card > button { width: 100%; display: flex; align-items: center; gap: 4px; padding: 8px 0 0; border-top: 1px solid rgba(var(--accent), .13); color: #aaa8a1; background: transparent; font-size: 8px; text-align: left; }
.summary-card > button .icon { margin-left: auto; }

.rail-section { margin-top: 18px; padding-top: 15px; border-top: 1px solid #292824; }
.rail-section-heading { display: flex; align-items: center; min-height: 16px; margin-bottom: 9px; color: #8b8981; font-size: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .055em; }
.rail-section-heading .icon,
.rail-section-heading small { margin-left: auto; color: #56554f; font-size: 7px; font-weight: 500; text-transform: none; letter-spacing: 0; }

.segment-list { display: flex; flex-wrap: wrap; gap: 5px; }
.segment-list button { min-height: 26px; padding: 0 8px; border: 1px solid #302f2b; border-radius: 5px; color: #76756e; background: #181815; font-size: 8px; }
.segment-list button:hover { color: #b8b6af; border-color: #45443e; }
.segment-list button.selected { color: rgb(var(--accent)); border-color: rgba(var(--accent), .28); background: rgba(var(--accent), .08); box-shadow: inset 0 0 0 1px rgba(var(--accent), .05); }

.evidence-list { display: grid; }
.evidence-row { width: 100%; min-height: 46px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 0; border-bottom: 1px solid #24231f; color: #aaa8a1; background: transparent; text-align: left; }
.evidence-row:hover { background: #181815; }
.evidence-rank { color: #4f4e49; font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.evidence-row-copy { min-width: 0; }
.evidence-row-copy strong,
.evidence-row-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-row-copy strong { color: #aaa8a1; font-size: 8px; font-weight: 560; }
.evidence-row-copy small { margin-top: 3px; color: #5e5d57; font-size: 7px; }
.evidence-row-value { color: rgb(var(--accent)); font-size: 10px; font-weight: 620; }

.heat-legend { display: grid; grid-template-columns: auto repeat(5, 1fr) auto; align-items: center; gap: 3px; color: #55544e; font-size: 7px; }
.heat-legend i { height: 6px; border-radius: 2px; background: rgba(var(--accent), .12); }
.heat-legend i:nth-of-type(2) { background: rgba(var(--accent), .24); }
.heat-legend i:nth-of-type(3) { background: rgba(var(--accent), .4); }
.heat-legend i:nth-of-type(4) { background: rgba(var(--accent), .62); }
.heat-legend i:nth-of-type(5) { background: rgba(var(--accent), .9); }
.legend-section > p { margin: 7px 0 0; color: #55544e; font-size: 7px; }

.rail-source-note { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding: 10px; border: 1px solid #2a2925; border-radius: 6px; background: #181815; }
.rail-source-note > span strong,
.rail-source-note > span small { display: block; }
.rail-source-note strong { color: #96948c; font-size: 8px; font-weight: 560; }
.rail-source-note small { margin-top: 3px; color: #55544e; font-size: 7px; }
.source-stack { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #35342f; border-radius: 5px; color: #77756e; background: #20201c; font-size: 10px; }
.sync-dot { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: #6ba879; box-shadow: 0 0 0 2px rgba(107,168,121,.1); }

.document-inspector { display: flex; flex-direction: column; justify-content: center; }
.document-inspector .rail-eyebrow { color: #686760; }
.document-inspector > h2 { max-width: 230px; margin: 10px 0 10px; color: #e7e5de; font-size: 19px; line-height: 1.18; font-weight: 590; letter-spacing: -.025em; }
.document-inspector > p { margin: 0 0 18px; color: #74736c; font-size: 10px; line-height: 1.55; }
.quiet-orbit { position: relative; width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid #32312d; border-radius: 50%; color: #aaa8a1; }
.quiet-orbit > span { position: absolute; border: 1px solid #2b2a26; border-radius: 50%; }
.quiet-orbit > span:nth-child(2) { inset: -8px; border-left-color: #66645e; }
.quiet-orbit > span:nth-child(3) { inset: 9px; border-bottom-color: #5a5953; }
.quiet-orbit > span:nth-child(4) { width: 4px; height: 4px; top: -10px; right: 6px; border: 0; background: #8b8981; }
.lens-preview-list { display: grid; gap: 4px; }
.lens-preview-list button { min-height: 48px; display: grid; grid-template-columns: 22px minmax(0,1fr) 14px; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 6px; color: #77756e; background: transparent; text-align: left; }
.lens-preview-list button:hover { background: #1b1b18; color: #c1bfb8; }
.lens-preview-list button span { min-width: 0; }
.lens-preview-list strong,
.lens-preview-list small { display: block; }
.lens-preview-list strong { color: #aaa8a1; font-size: 9px; font-weight: 560; }
.lens-preview-list small { margin-top: 3px; overflow: hidden; color: #5f5e58; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.document-inspector .rail-source-note { margin-top: 22px; }

.drawer-scrim { display: none; }

/* Responsive */

@media (max-width: 1100px) {
  :root { --sidebar-width: 66px; --rail-width: 268px; }
  .brand-row { justify-content: center; padding: 0; }
  .brand-name,
  .collapse-button,
  .nav-row span,
  .nav-row kbd,
  .nav-heading,
  .tree-row span:last-child,
  .sidebar-footer > div:last-child { display: none; }
  .workspace-nav { justify-items: center; }
  .nav-row { width: 34px; justify-content: center; padding: 0; }
  .nav-row .icon { margin: 0; }
  .nav-section { padding: 12px 10px; }
  .tree-row { width: 34px; justify-content: center; padding: 0 !important; }
  .tree-row.parent { display: none; }
  .sidebar-footer { justify-content: center; padding: 0; }
  .lens-intro { display: none; }
  .presence-agent { left: clamp(24px, var(--anchor-x-narrow), calc(100% - 132px)); top: var(--anchor-y-narrow); }
  .document-stage { width: min(690px, calc(100% - 38px)); }
  .document-page { padding-right: 62px; padding-left: 62px; }
}

@media (max-width: 860px) {
  :root { --rail-width: 290px; }
  .app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .insight-rail {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--rail-width);
    transform: translateX(100%);
    box-shadow: -16px 0 32px rgba(0,0,0,.28);
    transition: transform 220ms var(--ease-out);
  }
  .insight-rail.open { transform: translateX(0); }
  .inspector-mobile-head { height: 32px; display: flex; align-items: center; margin: -6px 0 14px; padding-bottom: 10px; border-bottom: 1px solid #292824; color: #77756e; font-size: 9px; }
  .inspector-mobile-head button { width: 26px; height: 26px; display: grid; place-items: center; margin-left: auto; border-radius: 5px; color: #77756e; background: transparent; }
  .inspector-trigger { display: grid; }
  .drawer-scrim { position: fixed; z-index: 18; inset: 0; width: 100%; height: 100%; background: rgba(8,8,7,.54); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  .drawer-scrim.visible { display: block; opacity: 1; pointer-events: auto; }
  .document-stage { width: min(680px, calc(100% - 34px)); }
  .document-page { padding-right: 56px; padding-left: 56px; }
  .page-index { display: none; }
}

@media (max-width: 640px) {
  :root { --sidebar-width: 0px; --topbar-height: 48px; --lensbar-height: 54px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 0 10px 0 13px; }
  .breadcrumb span:first-child,
  .breadcrumb .slash,
  .save-state,
  .draft-chip,
  .avatar-stack .avatar:not(:first-child),
  .share-button span { display: none; }
  .breadcrumb strong { max-width: 150px; }
  .share-button { width: 28px; padding: 0; }
  .lens-bar-wrap { gap: 7px; padding: 0 8px; }
  .lens-switcher { flex: 1; }
  .lens-tab { padding: 0 8px; }
  .lens-tab kbd { display: none; }
  .workspace { background-size: 36px 36px; }
  .document-stage { width: calc(100% - 18px); margin: 12px auto 50px; }
  .document-page { padding: 38px 27px 38px; }
  .document-header h1 { font-size: 34px; }
  .document-subtitle { font-size: 13px; }
  .document-properties { display: grid; grid-template-columns: 1fr 1fr; }
  .doc-block { margin-right: -11px; margin-left: -11px; padding-right: 11px; padding-left: 11px; }
  .goal-grid { grid-template-columns: 1fr; gap: 18px; }
  .comment-pin { position: static; margin-top: 10px; }
  .block-feature.has-signal > p { padding-right: 0; }
  .feature-heading { flex-wrap: wrap; }
  .status-label { order: 3; margin-left: 25px; }
  .rollout-track { grid-template-columns: 1fr 1fr; gap: 16px 0; }
  .rollout-track li:nth-child(2)::before { display: none; }
  .presence-agent { display: none; }
  .evidence-card {
    position: fixed;
    z-index: 30;
    right: 8px;
    bottom: 8px;
    top: auto;
    width: calc(100% - 16px);
    max-width: none;
  }
  .evidence-card::before { display: none; }
  .insight-rail { width: min(320px, calc(100% - 28px)); }
  .document-footer { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .presence-agent,
  .presence-drift,
  .presence-label {
    animation: none !important;
  }
  .presence-agent { opacity: 1; transform: none; }
  .presence-label { opacity: 1; transform: none; }
  [data-lens="document"] .presence-agent { display: none; }
  [data-lens="document"] .presence-maya { display: block; }
}
