/* Room (dialogue-at-scale) — a single conversation you step into. Direct
   replies, no argument machinery. */

.room-screen {
  gap: var(--space-5);
}

.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: var(--space-6);
  align-items: start;
}

.room-main {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
  /* Fills the column — so widening the page (wide mode) widens the writing. */
}

@media (max-width: 720px) {
  .room-layout {
    grid-template-columns: 1fr;
  }
  /* Rail moves above the feed and reads as a strip on narrow screens. */
  .room-toc {
    order: -1;
  }
}

.room-head {
  display: grid;
  gap: var(--space-2);
}

.room-eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* A flagged sentence under the lens: dimmed so it recedes into clean reading,
   un-dimmed on hover/focus as its why-popover opens (reusing .fallacy-popover).
   Overrides the shared .fallacy-anchor's highlight background — the room dims
   rather than spotlights. */
.room-fallacy {
  background: transparent;
  opacity: 0.35;
  transition: opacity 0.15s ease;
}

.room-fallacy:hover,
.room-fallacy:focus-visible,
.room-fallacy:focus-within {
  opacity: 1;
}

.room-title-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.room-title-icon {
  flex: 0 0 auto;
  color: var(--muted);
}

.room-claim {
  max-width: 620px;
  margin: 0;
  font-family: var(--font-reading);
  font-size: 1.4rem;
  line-height: 1.25;
}

/* Room Read: the header button (where the catch-up button once lived) and
   the panel it opens — goal + criteria (set at creation, permanent) and
   Crux's daily summary. */
.lane-room-read-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: 600 0.75rem var(--font-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.lane-room-read-btn:hover,
.lane-room-read-btn:focus-visible {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  outline: 0;
}

.lane-room-read-btn.is-open {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.lane-head-tools {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* The phone chips — map (the family column) and ○ + count (the unresolved
   rail). Desktop keeps the columns themselves, so the chips only exist under
   720px. Chrome icons, not primitives — they don't join the species colors. */
.lane-sheet-chip {
  display: none;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: 600 0.75rem var(--font-ui);
  cursor: pointer;
}

.lane-sheet-chip svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lane-sheet-chip:hover,
.lane-sheet-chip:focus-visible,
.lane-sheet-chip.is-open {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  outline: 0;
}

.lane-sheet-chip.is-open {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

/* Only while a sheet is open, the chips rise above its backdrop — so the open
   chip can close and the sibling can switch in one tap. Elevated always,
   they'd paint over the sticky topbar when the header scrolls under it. */
.lane-head-tools.is-sheet-open .lane-sheet-chip {
  position: relative;
  z-index: 42;
}

/* Each chip appears when its column collapses: ○ at 900px, map at 720px. */
@media (max-width: 900px) {
  .lane-sheet-chip-unresolved {
    display: inline-flex;
  }
}

@media (max-width: 720px) {
  .lane-sheet-chip-nav {
    display: inline-flex;
  }
}

/* The bottom sheet a chip opens — one chrome, two fillings (map/unresolved). */
.lane-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ink) 28%, transparent);
}

.lane-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  max-height: 72vh;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: var(--space-4);
  align-content: start;
  padding: var(--space-5) var(--space-4);
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: var(--shadow);
  font-family: var(--font-ui);
  animation: lane-sheet-in 0.18s ease-out;
}

@keyframes lane-sheet-in {
  from {
    transform: translateY(14px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lane-sheet {
    animation: none;
  }
}

/* If the viewport grows past both collapse points with a sheet open, the
   columns are back and the sheet has no job. */
@media (min-width: 901px) {
  .lane-sheet,
  .lane-sheet-backdrop {
    display: none;
  }
}

.lane-room-read {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--soft) 55%, transparent);
}

.lane-read-section {
  display: grid;
  gap: var(--space-1);
}

.lane-read-title {
  margin: 0;
  font: 700 0.68rem var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lane-read-body {
  margin: 0;
  font-family: var(--font-reading);
  font-size: 0.9rem;
  line-height: var(--line-reading);
}

.lane-read-criteria {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: var(--space-1);
  font-family: var(--font-reading);
  font-size: 0.9rem;
  line-height: var(--line-reading);
}

.lane-read-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.room-head-meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.room-feed {
  display: grid;
  gap: var(--space-3);
}

.room-post {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.room-post-opening {
  border-left: 3px solid var(--accent);
}

.room-post-head {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.person-avatar {
  --avatar-base: var(--muted);
  --avatar-bg: color-mix(in srgb, var(--avatar-base) 12%, var(--panel));
  --avatar-ink: color-mix(in srgb, var(--avatar-base) 76%, var(--ink));
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--avatar-ink) 18%, transparent);
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-ink);
  font: 700 0.7rem var(--font-ui);
  line-height: 1;
}

.person-avatar[data-avatar-tone="1"] {
  --avatar-base: var(--green);
}

.person-avatar[data-avatar-tone="2"] {
  --avatar-base: var(--accent);
}

.person-avatar[data-avatar-tone="3"] {
  --avatar-base: var(--clay);
}

.person-avatar[data-avatar-tone="4"] {
  --avatar-base: color-mix(in srgb, var(--accent) 62%, var(--green));
}

.person-avatar[data-avatar-tone="5"] {
  --avatar-base: color-mix(in srgb, var(--clay) 70%, var(--green));
}

.person-avatar[data-avatar-tone="6"] {
  --avatar-base: color-mix(in srgb, var(--accent) 48%, var(--clay));
}

.person-avatar.is-crux-logo {
  --avatar-base: var(--muted);
  font-family: var(--font-mono);
  font-weight: 600;
}

.room-post-author {
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 600;
}

.room-post-time {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
}

.room-post-body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-reading);
  font-size: 1rem;
  line-height: 1.5;
}

.room-post-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* Nested replies indent one step, with a thread line to show they hang off the
   post above. Deep chains compound the indent — kept shallow by the column. */
.room-replies {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-1);
  padding-left: var(--space-4);
  border-left: 2px solid var(--line);
}

/* Direct-reply composer. */
.room-composer {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.room-composer-input {
  width: 100%;
  min-height: 3rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--color-paper);
  color: var(--ink);
  font-family: var(--font-reading);
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
}

.room-composer-input:focus {
  border-color: var(--accent);
  outline: none;
}

.room-composer-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
}

/* Inline reply — opens right under the post you clicked Reply on. */
.room-inline-reply {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--page-edge);
}

.room-reply-cancel-btn {
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
}

.room-reply-cancel-btn:hover,
.room-reply-cancel-btn:focus-visible {
  color: var(--ink);
}

/* Optional "Get feedback" — quieter than the filled Reply: an outlined,
   secondary affordance so refining reads as offered, not required. */
.room-reply-feedback-btn {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.room-reply-feedback-btn:hover,
.room-reply-feedback-btn:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
}

.room-reply-feedback-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Private refine output under the composer. Grid mirrors .discuss-feedback but
   scoped to the room composer's tighter rhythm. */
.room-reply-feedback {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.room-reply-feedback-note {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.room-reply-feedback-item {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--soft);
}

.room-reply-feedback-tag {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.room-reply-feedback-item p {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-reading);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* A ToC jump flashes the post/reply it landed on, then fades on its own —
   long enough to catch the eye, gone before it becomes clutter. */
.room-post.is-focused,
.room-reply.is-focused {
  border-radius: var(--radius-md);
  animation: room-focus-flash 2.2s ease-out;
}

@keyframes room-focus-flash {
  0%,
  20% {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    background: var(--mark);
  }
  100% {
    outline: 2px solid transparent;
    outline-offset: 3px;
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .room-post.is-focused,
  .room-reply.is-focused {
    animation: none;
  }
}

.room-composer-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--color-on-accent);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.room-composer-submit-icon {
  position: relative;
  top: 0.22em;
}

.room-composer-submit:hover,
.room-composer-submit:focus-visible {
  background: var(--accent-dark);
}

/* Verb buttons — Reply (on a post) vs Go deeper (on a leaf) --------- */
.room-reply-btn,
.room-go-deeper {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.room-reply-btn:hover,
.room-reply-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* Reply-in-new-room — quiet, like Reply; the label carries the meaning. */
.room-go-deeper:hover,
.room-go-deeper:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* Once a reply spawned a room, its verb becomes this quiet pointer. */
.room-moved-link {
  padding: var(--space-1) var(--space-2);
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  cursor: pointer;
}

.room-moved-link:hover,
.room-moved-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Leaf replies — lighter than posts, no border card ---------------- */
.room-reply {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.room-reply + .room-reply {
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}

/* Reply-target banner in the composer ------------------------------ */
.room-reply-target {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.room-reply-target strong {
  color: var(--ink);
}

.room-reply-cancel {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}

.room-reply-cancel:hover,
.room-reply-cancel:focus-visible {
  color: var(--ink);
}

/* Table of contents rail — Open Tensions / Forks ------------------- */
.room-toc {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--page-edge);
  position: sticky;
  top: calc(var(--topbar-height) + var(--space-3));
}

.room-toc-group {
  display: grid;
  gap: var(--space-2);
}

/* The "Open Tensions" heading shares its row with the lens filter control. */
.room-toc-head {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
}

.room-toc-title {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Lens filter — the descending-lines icon right of "Open Tensions" opens a
   dropdown holding "Dim fallacies". Mirrors the charter's filter menu. */
.room-filter-control {
  position: relative;
  flex-shrink: 0;
}

.room-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.room-filter-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.room-filter-button:hover,
.room-filter-button:focus-visible {
  color: var(--ink);
  border-color: var(--line);
  outline: 0;
}

.room-filter-button.is-active {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--soft);
}

.room-filter-menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: 5;
  min-width: 160px;
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.room-filter-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.room-filter-item:hover,
.room-filter-item:focus-visible {
  background: var(--soft);
  color: var(--ink);
  outline: 0;
}

.room-filter-item.is-active {
  color: var(--ink);
}

/* The checkbox — an empty box when off, an accent box with a check when on. */
.room-filter-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: transparent;
  font-size: 0.7rem;
  line-height: 1;
}

.room-filter-item.is-active .room-filter-check {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--color-on-accent);
}

.room-toc-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.room-toc-open,
.room-toc-moved {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.room-toc-open:hover,
.room-toc-open:focus-visible,
.room-toc-moved:hover,
.room-toc-moved:focus-visible {
  color: var(--accent-dark);
}

.room-toc-open {
  padding-left: var(--space-3);
  text-indent: calc(-1 * var(--space-3));
}

.room-toc-open::before {
  margin-right: var(--space-1);
  color: var(--accent);
  content: "○";
}

.room-toc-moved::before {
  margin-right: var(--space-1);
  color: var(--accent);
  content: "";
}

.room-toc-room {
  color: var(--muted);
  font-size: 0.78rem;
}

.room-toc-empty {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-style: italic;
}

/* ── Lane room — the v8 linear thread (docs/crux-v8-direction.md) ──────────
   Reads as a normal chat; structure renders as quiet inline rows (folds,
   proposals, markers, decisions) and the rail indexes them. */

/* Three columns: family (where rooms come from) · the lane · structure rail
   (what this room knows about itself). */
.lane-screen .room-layout {
  grid-template-columns: 200px minmax(0, 1fr) 230px;
  gap: var(--space-5);
}

/* ── The family column — navigation, not structure ───────────────────────── */

.lane-family {
  display: grid;
  gap: var(--space-4);
  align-content: start;
  position: sticky;
  top: calc(var(--topbar-height) + var(--space-3));
  max-height: calc(100vh - var(--topbar-height) - (2 * var(--space-3)));
  overflow: auto;
  overscroll-behavior: contain;
  font-family: var(--font-ui);
  /* The topbar logo (32px mark centered in its 38px button) starts 3px right
     of the shared content edge — the rail starts where the logo does. */
  padding-left: calc((38px - 32px) / 2);
  padding-right: var(--space-1);
}

/* These sit after the base .lane-family/.room-layout rules — same specificity,
   so source order is what makes the narrow-screen overrides win. The columns
   collapse in stages: unresolved first (into the ○ chip), then the family
   column (into the map chip). */
@media (max-width: 900px) {
  .lane-screen .room-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .lane-screen .lane-rail {
    display: none;
  }
}

@media (max-width: 720px) {
  .lane-screen .room-layout {
    grid-template-columns: 1fr;
  }
  .lane-family {
    display: none;
  }
}

/* The space — the rail's quietest level: name only, a door up, visibly
   subordinate to the topic card under it. */
.lane-family-space {
  justify-self: start;
  margin-bottom: calc(-1 * var(--space-2));
  padding: 0;
  border: 0;
  background: transparent;
  /* Same voice as the rail's group headings ("Rooms", "Still unopened"). */
  font: 700 0.72rem var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.lane-family-space:hover,
.lane-family-space:focus-visible {
  color: var(--accent);
}

.lane-family-source {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
}

.lane-family-source:hover {
  border-color: var(--accent);
}

/* Source icon rests in the page's own cream/tan family; the brand red only
   wakes up when the card is hovered. */
.lane-family-source .play-link {
  margin-bottom: 0;
  color: var(--line);
  transition: color 0.15s ease;
}

.lane-family-source:hover .play-link,
.lane-family-source:focus-visible .play-link {
  color: var(--color-youtube);
}

.lane-family-source-title {
  font: 600 0.82rem var(--font-ui);
  line-height: 1.35;
  color: var(--ink);
}

.lane-family-group {
  display: grid;
  gap: var(--space-2);
}

.lane-family-section-body {
  display: none;
  gap: var(--space-2);
}

.lane-family-section-body.is-open,
.lane-family-section-body.is-preview-open {
  display: grid;
}

/* Forked Rooms / Bookmarks headings are toggles: the heading is the whole
   affordance, caret says which way. */
.lane-family-heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.lane-family-heading .room-toc-title {
  flex: 1 1 auto;
  margin: 0;
}

.lane-family-heading:hover,
.lane-family-heading:focus-visible {
  color: var(--ink);
  outline: 0;
}

.lane-family-heading:hover .room-toc-title,
.lane-family-heading:focus-visible .room-toc-title {
  color: var(--ink);
}

.lane-family-room {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 2px;
  column-gap: var(--space-1);
  align-items: start;
  text-align: left;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius-md);
  padding: var(--space-1);
  cursor: pointer;
}

.lane-family-room:hover {
  border-color: var(--accent);
}

.lane-family-room.is-here {
  background: var(--panel);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  cursor: default;
}

.lane-family-room.is-fork {
  grid-template-columns: minmax(0, 1fr);
}

.lane-family-room-title {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font: 600 0.8rem var(--font-ui);
  line-height: 1.35;
  color: var(--ink);
}

.lane-family-room-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lane-family-room-icon {
  position: relative;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.lane-family-room-icon svg {
  width: 21px;
  height: 20px;
}

.lane-family-room-title-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--accent);
}

.lane-family-room-title-mark svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* One line, always: the meta is priority-ordered (unvisited · new · people)
   and ellipsizes from the right — the tail is what gets sacrificed. */
.lane-family-room-meta {
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lane-family-room.is-fork .lane-family-room-meta,
.lane-family-room.is-fork .lane-family-here {
  margin-left: calc(1rem + var(--space-1));
}

.lane-family-here {
  font: 700 0.68rem var(--font-ui);
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* A forked room is a child: indented under its parent, clearly of it. */
.lane-family-room.is-fork {
  margin-left: 0;
}

/* Away-ness, quietly: a fork you haven't stepped into yet. Muted, not
   accent — accent is reserved for "you are here", the room you're in. */
.lane-family-unvisited {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.62rem;
  color: var(--muted);
}

/* Bookmarks — this room's notable parts, each a jump into the lane. Quieter
   than room cards: no border, just glyph + summary. */
.lane-bookmark {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  column-gap: var(--space-2);
  align-items: start;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: var(--space-1) 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.lane-bookmark .lane-structure-mark {
  margin-top: calc((0.8rem * 1.28 - 1rem) / 2);
}

.lane-bookmark:hover,
.lane-bookmark:focus-visible {
  background: var(--soft);
}

.lane-bookmark-label {
  display: block;
  margin-top: -0.06rem;
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--ink);
}

.lane-bookmark-status {
  margin-right: var(--space-1);
  color: var(--muted);
  font: 700 0.62rem var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lane-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  min-height: calc((0.8rem * var(--line-ui)) + (2 * var(--space-1)) + 2px);
}

.lane-head-row .room-eyebrow {
  margin: 0;
}

/* One light line per day, derived from the messages' local time. The label
   interrupts the hairline, quiet and centered. */
.lane-day {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted);
}

.lane-day::before,
.lane-day::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.lane-day-label {
  flex: 0 0 auto;
  font: 600 0.68rem var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The opening post — Crux's first message, a post like any other. */
.lane-author.is-crux {
  color: var(--green);
}

.lane-msg-opening .lane-opening-question {
  font-style: italic;
}

/* The lane itself — tighter than the pair feed; chat density. */
.lane-feed {
  display: grid;
  gap: var(--space-3);
}

.lane-msg {
  position: relative;
  display: grid;
  gap: 2px;
  padding: var(--space-2) var(--space-3) var(--space-2) 0;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

/* A challenged message sits quiet in the lane — the chip carries the mark.
   The clay outline only appears when the rail's challenge entry lands you
   here (the jump adds .is-focused). */
.lane-msg.is-challenged.is-focused {
  border-color: color-mix(in srgb, var(--clay) 45%, transparent);
}

.lane-msg.is-reply-target {
  isolation: isolate;
}

.lane-msg.is-reply-target::before {
  content: "";
  position: absolute;
  inset: 0 0 0 calc(-1 * var(--space-2));
  z-index: -1;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.lane-msg-reply {
  padding-right: 0;
  border-radius: var(--radius-sm);
}

.lane-thread {
  display: grid;
  gap: var(--space-1);
}

.lane-msg-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.lane-author {
  font: 700 0.85rem var(--font-ui);
}

.lane-author.is-you {
  color: var(--accent);
}

.lane-time {
  font-size: 0.72rem;
  color: var(--muted);
}

/* A button: tapping jumps to (and flashes) the message this one replies to. */
.lane-replying {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.72rem;
  color: var(--accent);
  cursor: pointer;
}

.lane-replying:hover {
  text-decoration: underline;
}

.lane-challenge-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--clay);
}

.lane-challenge-mark .lane-structure-mark {
  color: inherit;
}

.lane-challenge-open {
  cursor: pointer;
}

.lane-challenge-open:hover,
.lane-challenge-open:focus-visible {
  color: var(--accent);
  outline: 0;
}

.lane-msg-body {
  margin: 0;
  font-family: var(--font-reading);
  font-size: 0.95rem;
  line-height: var(--line-reading);
  text-wrap: pretty;
}

.lane-msg-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lane-replies {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  margin-left: var(--space-4);
}

/* The indent rail is the fold-back: it draws the thread's left line and is
   a button — a wider hit target than the 2px it shows. The expand is the
   avatar-stack chip, which only exists while the thread is folded. */
.lane-replies-rail {
  width: calc(var(--space-2) + 2px);
  padding: 0;
  border: 0;
  border-left: 2px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  background: transparent;
  cursor: pointer;
}

.lane-replies-rail:hover,
.lane-replies-rail:focus-visible {
  border-left-color: var(--accent);
}

.lane-replies-body {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
}

/* The mark on an auto-linked retro reply — Crux set the ↩; hover says so.
   For the involved authors it's a button that opens the undo menu. */
.lane-retro-linked-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: 700 0.62rem var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

button.lane-retro-linked-mark {
  cursor: pointer;
}

button.lane-retro-linked-mark:hover,
button.lane-retro-linked-mark:focus-visible {
  color: var(--accent-dark);
  outline: 0;
}

.lane-retro-linked-mark .lane-structure-mark {
  color: inherit;
}

.lane-replies-toggle {
  display: inline-flex;
  gap: var(--space-1);
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 0.75rem var(--font-ui);
  text-align: left;
  cursor: pointer;
}

.lane-replies-toggle:hover,
.lane-replies-toggle:focus-visible {
  color: var(--accent);
  outline: 0;
}

.lane-replies-toggle-copy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-reply-latest-avatar {
  width: 1.3rem;
  height: 1.3rem;
  font-size: 0.6rem;
}

.lane-reply-avatar-stack {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
}

.lane-reply-avatar-stack .lane-reply-latest-avatar + .lane-reply-latest-avatar,
.lane-reply-avatar-more {
  margin-left: -0.34rem;
}

.lane-reply-avatar-more {
  display: inline-grid;
  width: 1.3rem;
  height: 1.3rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font: 700 0.58rem var(--font-ui);
}

/* Reply appears on hover/focus without shifting. */
@media (hover: hover) and (pointer: fine) {
  .lane-msg .lane-reply-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
  }

  .lane-msg:hover .lane-reply-btn,
  .lane-msg:focus-within .lane-reply-btn {
    opacity: 1;
    pointer-events: auto;
  }
}

.lane-reply-btn,
.lane-quiet-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border: none;
  background: transparent;
  color: var(--muted);
  font: 600 0.75rem var(--font-ui);
  padding: 0;
  cursor: pointer;
}

.lane-reply-btn {
  margin-left: var(--space-2);
}

.lane-reply-btn-icon {
  position: relative;
  top: 0.16em;
}

.lane-reply-btn:hover,
.lane-quiet-btn:hover {
  color: var(--accent);
}

/* The chip menu — challenges (jump / reply / dismiss, yours alone) and
   retro-reply asks share it. */
.lane-chip-control {
  position: relative;
  display: inline-flex;
}

.lane-chip-menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  left: 0;
  z-index: 30;
  display: grid;
  min-width: 200px;
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.lane-chip-item {
  display: flex;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font: 600 0.8rem var(--font-ui);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.lane-chip-item:hover,
.lane-chip-item:focus-visible {
  background: var(--soft);
  outline: 0;
}

/* The ask's context line inside a chip menu (who noticed what, the tally). */
.lane-chip-note {
  margin: 0;
  padding: var(--space-1) var(--space-3) var(--space-2);
  max-width: 240px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
  white-space: normal;
}

/* Primitive icons are monochrome SVGs in source and inherit color here.
   Color is species: accent = structural movement, clay = challenge, green =
   decision, muted = waiting/unanswered. */
.lane-structure-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  font: 700 0.85rem var(--font-ui);
  line-height: 1;
}

.lane-structure-mark .primitive-icon,
.lane-structure-mark svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.lane-structure-mark svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lane-structure-mark-decision svg {
  stroke-width: 1.9;
}

.lane-structure-mark-fork,
.lane-structure-mark-retro,
.lane-structure-mark-drift {
  color: var(--accent);
}

.lane-structure-mark-decision {
  color: var(--green);
}

.lane-structure-mark-definition {
  color: var(--green);
}

.lane-structure-mark-unanswered {
  color: var(--muted);
}

.lane-structure-mark-challenge {
  color: var(--clay);
}

/* The seam: the one structural row in the lane — one grammar for collapsed
   and forked alike: glyph first, then the line, flush with the lane's
   content, no hairlines. Only the glyph and affordance change. */
.lane-seam {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-width: 0;
  padding: var(--space-1) 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

button.lane-seam:hover,
button.lane-seam:focus-visible {
  color: var(--ink);
}

/* Top-aligned, with the primitive mark and avatars centered against the first text
   line — so when the summary expands to multiple lines nothing already on
   screen moves; new lines just appear below. */
.lane-seam-fold {
  align-items: flex-start;
}

.lane-seam-fold .lane-fold-people {
  margin-top: calc((0.95rem * var(--line-reading) - 1.35rem) / 2);
}

.lane-seam-fold .lane-structure-mark {
  margin-top: calc((0.95rem * var(--line-reading) - 1rem) / 2);
}

/* Fold: a seam holding the collapse residue — one-line summary + expand. */
.lane-fold {
  display: grid;
  gap: var(--space-2);
}

.lane-fold-summary {
  font-family: var(--font-reading);
  font-size: 0.95rem;
  line-height: var(--line-reading);
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Expanded, the summary is the strand's heading — show all of it, wrapping
   below instead of ellipsing. */
.lane-fold.is-open .lane-fold-summary {
  white-space: normal;
  overflow: visible;
}

.lane-fold-people {
  display: flex;
  flex: none;
  align-items: center;
}

.lane-fold-people .lane-fold-avatar {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.62rem;
}

.lane-fold-people .lane-fold-avatar + .lane-fold-avatar {
  margin-left: -0.4rem;
}

.lane-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 0.9rem;
  height: 0.9rem;
  color: inherit;
}

.lane-caret::before {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.08rem) rotate(45deg);
}

.lane-caret.is-open::before {
  transform: translateY(0.08rem) rotate(225deg);
}

.lane-fold-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  margin-left: var(--space-4);
}

/* The fold's left line. As a button it's also the fold-back — same contract
   as the reply rail one level down; as a span (the static preview) it's just
   the line. A wider hit target than the 2px it shows. */
.lane-fold-rail {
  width: calc(var(--space-3) + 2px);
  padding: 0;
  border: 0;
  border-left: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: transparent;
}

button.lane-fold-rail {
  cursor: pointer;
}

button.lane-fold-rail:hover,
button.lane-fold-rail:focus-visible {
  border-left-color: var(--accent);
  outline: 0;
}

.lane-fold-body-inner {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

/* Note above, verbs below — the decision bar's grammar at lane weight, so a
   record's foot and a decision's bar read as the same species. */
.lane-fold-foot {
  display: grid;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 var(--space-3);
}

.lane-msg.is-inline-previewed,
.lane-fold.is-inline-previewed,
.lane-drift-placement-preview.is-inline-previewed,
.lane-msg.is-drift-preview-source,
.lane-fold.is-drift-preview-source {
  outline: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 2px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  transition:
    opacity 0.18s ease,
    background-color 0.18s ease,
    outline-color 0.18s ease;
}

.app-shell.is-previewing-drift-replacement .lane-feed .lane-msg.is-drift-preview-source,
.app-shell.is-previewing-drift-replacement .lane-feed .lane-fold.is-drift-preview-source {
  opacity: 0;
  pointer-events: none;
}

.app-shell.is-previewing-shown-drift.is-previewing-drift-leave .lane-feed .lane-msg.is-inline-previewed,
.app-shell.is-previewing-shown-drift.is-previewing-drift-leave .lane-feed .lane-fold.is-inline-previewed {
  outline-color: transparent;
  background: transparent;
}

.lane-proposal-note {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Verb weight: the proposal's verbs are peers — both outlined (a filled slab
   overpowers the lane); dismiss stays a bare link. */
.lane-agree-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border: 1px solid color-mix(in srgb, var(--ink) 42%, transparent);
  background: transparent;
  color: var(--ink);
  font: 600 0.8rem var(--font-ui);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.lane-agree-btn:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

/* Marker: where a strand forked out — the lane keeps the door (a seam). It
   keeps its hairline: a fork is a cut in the lane. The row reads like its
   siblings — title, then the fork mark — and the whole line routes to
   the room. */

/* Decision point — a live room call, bordered like a challenged point. */
.lane-decision {
  border: 1px solid color-mix(in srgb, var(--green) 34%, transparent);
  background: transparent;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: grid;
  gap: var(--space-2);
}

.lane-decision-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.lane-decision-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
  font: 600 0.75rem var(--font-ui);
}

.lane-decision-meta {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
}

.lane-decision-question {
  margin: 0;
  font: 600 0.92rem var(--font-ui);
  line-height: 1.4;
}

.lane-decision-why {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

.lane-decision-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.lane-drift-options {
  align-items: end;
}

.lane-drift-choice {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.lane-drift-tally-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 var(--space-2);
  min-height: 1.35rem;
}

.lane-decision-option {
  border: 1px solid var(--line);
  background: var(--panel);
  font: 600 0.8rem var(--font-ui);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
  min-width: 0;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: var(--space-1);
  text-align: left;
}

.lane-decision-option-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.lane-decision-option.is-active {
  border-color: var(--green);
  color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, transparent);
}

.lane-reference-toggle {
  margin-left: auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 700 0.66rem var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.lane-reference-toggle:hover,
.lane-reference-toggle:focus-visible,
.lane-reference-toggle.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  outline: 0;
}

@media (max-width: 560px) {
  .lane-decision-options {
    grid-template-columns: 1fr;
  }
}

.lane-drift-voter {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.54rem;
  box-shadow: 0 0 0 2px var(--panel);
}

.lane-drift-voter + .lane-drift-voter {
  margin-left: -0.35rem;
}

.lane-drift-vote-zero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px dashed var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
}

.lane-pill-mark {
  display: inline-block;
  width: 1rem;
  height: 0.48rem;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-pill);
  transform: rotate(-18deg);
}

.lane-drift-placement-preview {
  display: none;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 1px dashed color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.lane-drift-placement-preview.is-drift-preview-active {
  display: grid;
  animation: lane-drift-preview-in 0.18s ease-out both;
}

.lane-drift-decision {
  position: relative;
}

.lane-drift-decision > .lane-drift-placement-pill.is-drift-preview-active {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + var(--space-2));
  z-index: 2;
}

@keyframes lane-drift-preview-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lane-drift-placement-fork {
  padding: var(--space-1);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  cursor: default;
}

.lane-drift-preview-kicker {
  color: var(--muted);
  font: 700 0.62rem var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lane-drift-preview-room,
.lane-drift-preview-seam {
  pointer-events: none;
}

.lane-drift-preview-room {
  background: var(--panel);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  cursor: default;
}

.lane-drift-preview-seam {
  cursor: default;
  color: var(--ink);
}

/* A drift decision is structure-species: accent border, accent-active votes.
   Same card grammar as a decision point — drift IS a decision. */
.lane-drift-decision {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.lane-drift-decision .lane-decision-option.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.lane-decision-foot {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.lane-drift-fork-form {
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.lane-drift-fork-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.lane-drift-fork-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.lane-drift-fork-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: var(--space-1) var(--space-2);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-reading);
  font-size: 0.9rem;
}

.lane-drift-fork-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* The composer — people just post. Pinned to the viewport bottom while the
   lane scrolls, like any chat. */
.lane-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-2);
  gap: var(--space-2);
  align-items: end;
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-block: var(--space-2);
}

.lane-composer-row {
  display: contents;
}

/* Chat input that grows with the text — natively via field-sizing, with the
   data-autogrow JS as fallback. Floor of two lines, capped so it never eats
   the lane. */
.lane-composer-row .room-composer-input {
  grid-column: 1;
  flex: 1;
  min-height: calc(2lh + 2 * var(--space-1) + 2px);
  height: auto;
  field-sizing: content;
  max-height: 9rem;
  resize: none;
  overflow-y: auto;
  padding: var(--space-1) var(--space-3);
  background: var(--panel);
  font-size: 0.95rem;
}

.lane-composer-row .room-composer-submit {
  grid-column: 2;
  padding-block: var(--space-1);
}

.lane-composer-target {
  grid-column: 1;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.lane-composer-target::before {
  content: "";
  position: absolute;
  inset: 0 0 0 calc(-1 * var(--space-2));
  z-index: -1;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.lane-composer-target-label {
  flex: 0 1 auto;
  min-width: 0;
  font: 500 0.85rem var(--font-ui);
  color: var(--muted);
}

.lane-composer-target-clear {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
}

.lane-empty {
  margin: 0;
  padding: var(--space-4) var(--space-3);
  font-style: italic;
  color: var(--muted);
}

/* Flash targets in the lane (jump from the rail or a bookmark). */
.lane-msg.is-focused,
.lane-fold.is-focused,
.lane-decision.is-focused,
.lane-marker.is-focused {
  border-radius: var(--radius-md);
  animation: room-focus-flash 2.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .lane-msg.is-focused,
  .lane-fold.is-focused,
  .lane-decision.is-focused,
  .lane-marker.is-focused {
    animation: none;
  }
}

/* ── The rail: unresolved, in three collapsed categories ────────────────── */

/* The rail mirrors the family column: bare cards on paper, no container box
   (the pair-room .room-toc chrome doesn't apply here). */
.lane-rail {
  border: 0;
  background: transparent;
  padding: 0;
}

.lane-rail-group {
  display: grid;
  gap: var(--space-2);
}

.lane-rail-group + .lane-rail-group {
  margin-top: var(--space-3);
}

/* A category header: name · count · caret. Collapsed by default — the count
   is the always-on signal. */
.lane-rail-heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.lane-rail-heading:hover,
.lane-rail-heading:focus-visible {
  border-color: var(--accent);
  color: var(--ink);
  outline: 0;
}

.lane-rail-heading-label {
  flex: 1 1 auto;
  font: 700 0.68rem var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lane-rail-heading-count {
  font: 700 0.72rem var(--font-ui);
  color: var(--ink);
}

.lane-rail-list {
  gap: var(--space-1);
  padding-left: 0;
}

/* Rail entries — cards cut from the same cloth as the family column. */
.lane-rail-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  cursor: pointer;
}

.lane-rail-item.is-compact {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: var(--space-2);
}

.lane-rail-item:hover,
.lane-rail-item:focus-visible {
  border-color: var(--accent);
}

.lane-rail-label {
  font: 600 0.8rem var(--font-ui);
  line-height: 1.35;
  color: var(--ink);
}

.lane-rail-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font: 600 0.62rem var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lane-rail-item.is-compact .lane-rail-status {
  padding-top: 0.08rem;
}

.lane-rail-status .lane-structure-mark {
  font-size: 0.7rem;
  color: inherit;
}

.lane-rail-status .lane-structure-mark-decision {
  font-size: 0.58rem;
}

.lane-rail-status .lane-structure-mark-definition {
  font-size: 0.7rem;
}

.lane-rail-status-unanswered .lane-structure-mark {
  margin-left: -0.25rem;
}

/* Same species-color rule as the glyphs: structure blue, challenge clay,
   decision green, waiting muted. */
.lane-rail-status-drift { color: var(--accent); }
.lane-rail-status-retro { color: var(--accent); }
.lane-rail-status-unanswered { color: var(--muted); }
.lane-rail-status-definition { color: var(--green); }
.lane-rail-status-decision { color: var(--green); }
.lane-rail-status-challenge { color: var(--clay); }

/* A challenge entry carries its ✕ — yours alone to see, yours alone to
   dismiss. The row is a grid so the entry keeps its full hit area. */
.lane-rail-dismissable {
  position: relative;
}

.lane-rail-dismissable .lane-rail-item {
  padding-right: var(--space-5);
}

.lane-rail-dismiss {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 0.72rem var(--font-ui);
  line-height: 1;
  padding: var(--space-1);
  cursor: pointer;
}

.lane-rail-dismiss:hover,
.lane-rail-dismiss:focus-visible {
  color: var(--clay);
}

/* Strand provenance (the grew-from block for lane strands). */
.grew-from-strand-title {
  margin: 0;
  font: 600 0.88rem var(--font-ui);
}
