/* CROC Chat — Full-Bleed Static Promoted Ambient Canvas, Floating Glass List & Fluid Motion (r33) */

.comm-layout {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: var(--list-w, 308px) minmax(0, 1fr) var(--context-w, 284px);
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}
.comm-layout.no-context,
.comm-layout:not(:has(.comm-context-pane)) {
  grid-template-columns: var(--list-w, 308px) minmax(0, 1fr);
}

/* Full-bleed Room-Reactive Ambient Canvas (fixed, static, own compositing layer — never repainted) */
.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 320ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1));
}
.app-shell::before {
  background:
    radial-gradient(960px circle at 80% 12%, rgba(45, 91, 142, 0.18) 0%, transparent 62%),
    radial-gradient(740px circle at 20% 84%, rgba(45, 91, 142, 0.10) 0%, transparent 60%);
}
.app-shell::after {
  background:
    radial-gradient(960px circle at 80% 12%, rgba(168, 93, 42, 0.17) 0%, transparent 62%),
    radial-gradient(740px circle at 20% 84%, rgba(168, 93, 42, 0.09) 0%, transparent 60%);
}
.app-shell[data-room-type="group"]::before { opacity: 1; }
.app-shell[data-room-type="dm"]::after { opacity: 1; }

[data-theme="dark"] .app-shell::before {
  background:
    radial-gradient(920px circle at 78% 14%, rgba(110, 159, 212, 0.20) 0%, transparent 62%),
    radial-gradient(680px circle at 24% 86%, rgba(110, 159, 212, 0.09) 0%, transparent 60%);
}
[data-theme="dark"] .app-shell::after {
  background:
    radial-gradient(920px circle at 78% 14%, rgba(224, 169, 79, 0.17) 0%, transparent 62%),
    radial-gradient(680px circle at 24% 86%, rgba(224, 169, 79, 0.08) 0%, transparent 60%);
}

/* De-paneled Floating Channel List Area (Open flowing list on Ambient Canvas, fluid width) */
.comm-sidebar,
.comm-list-pane {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  margin: 0;
  padding: 14px 4px 12px 16px;
  align-self: stretch;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  overflow: visible;
  contain: layout style;
  transition:
    transform 240ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)),
    opacity 200ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1));
}
[data-theme="dark"] .comm-sidebar,
[data-theme="dark"] .comm-list-pane {
  background: transparent;
  box-shadow: none;
}

.comm-main-pane,
.comm-thread-pane,
.comm-chat-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  background: transparent;
  contain: layout style;
}

/* Staggered Message Arrival (limited to first 6 visible items, transform & opacity only) */
@keyframes commMsgArrive {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.comm-msg-arriving {
  animation: commMsgArrive 260ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)) both;
}
.comm-msg-arriving:nth-last-child(5) { animation-delay: 20ms; }
.comm-msg-arriving:nth-last-child(4) { animation-delay: 40ms; }
.comm-msg-arriving:nth-last-child(3) { animation-delay: 60ms; }
.comm-msg-arriving:nth-last-child(2) { animation-delay: 80ms; }
.comm-msg-arriving:nth-last-child(1) { animation-delay: 100ms; }

/* Calm Single Segmented View Control + Floating Search & Four-Category Strip */
.comm-list-controls {
  padding: 4px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comm-view-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: none;
  border: none;
  gap: 4px;
}
[data-theme="dark"] .comm-view-segmented,
[data-theme="dark"] .comm-search-row {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}
.comm-view-segmented button {
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
  transition: background-color 160ms var(--ease-fluid), color 160ms var(--ease-fluid), opacity 160ms ease;
}
.comm-view-segmented button:active {
  background: var(--bg-active, rgba(128, 134, 148, 0.14));
  opacity: 0.84;
  transition-duration: 0ms;
}
.comm-view-segmented button.active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-primary);
  box-shadow: none;
}
[data-theme="dark"] .comm-view-segmented button.active {
  background: rgba(255, 255, 255, 0.14);
}
.comm-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: none;
}
.comm-search-row .input {
  background: transparent;
  box-shadow: none;
}
.comm-search-row .input:focus {
  background: transparent;
  box-shadow: none;
}

/* Four-Category Floating Capsule Strip & Category Cues (r40 / r40b) */
.comm-cat-strip {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 2px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.comm-cat-strip::-webkit-scrollbar {
  display: none;
}
.comm-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  scroll-snap-align: start;
  height: 28px;
  padding: 0 9px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 160ms var(--ease-fluid), color 160ms var(--ease-fluid), opacity 160ms ease;
}
.comm-cat-chip:hover {
  background: rgba(128, 134, 148, 0.10);
  color: var(--text-primary);
}
.comm-cat-chip:active {
  opacity: 0.84;
  transition-duration: 0ms;
}
.comm-cat-chip.active {
  background: rgba(255, 255, 255, 0.90);
  color: var(--text-primary);
  font-weight: 650;
}
[data-theme="dark"] .comm-cat-chip.active {
  background: rgba(255, 255, 255, 0.14);
}
.comm-cat-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.comm-cat-chip.active .comm-cat-count {
  color: var(--text-secondary);
}
.comm-cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.comm-cat-dot.is-group { background: var(--accent, #2d5b8e); }
.comm-cat-dot.is-dm { background: var(--warm-accent, #a85d2a); }
.comm-cat-dot.is-cross_task { background: #6b5ca5; }
.comm-cat-dot.is-cross_dept { background: #8c6d46; }
[data-theme="dark"] .comm-cat-dot.is-group { background: #8ab8e6; }
[data-theme="dark"] .comm-cat-dot.is-dm { background: #e0a94f; }
[data-theme="dark"] .comm-cat-dot.is-cross_task { background: #b1a3eb; }
[data-theme="dark"] .comm-cat-dot.is-cross_dept { background: #d6b687; }

.comm-archive-toggle {
  margin-left: auto;
  color: var(--text-muted);
}
.comm-archive-toggle.active {
  background: rgba(168, 93, 42, 0.14);
  color: var(--warm-accent, #a85d2a);
}
[data-theme="dark"] .comm-archive-toggle.active {
  background: rgba(224, 169, 79, 0.18);
  color: #e0a94f;
}

.comm-list-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.comm-list-section-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.comm-list-section-count {
  font-size: 13px;
  font-weight: 560;
  color: var(--text-muted);
}
.comm-list-empty-inline {
  padding: 6px 14px 10px;
  font-size: 14px;
  color: var(--text-muted);
}
.comm-row-cat-cue {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 560;
  color: var(--text-muted);
  flex-shrink: 0;
}
.comm-archived-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.comm-archived-back {
  padding: 4px 12px;
  border-radius: 9999px;
  border: none;
  background: rgba(128, 134, 148, 0.12);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.comm-archived-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 18px;
  opacity: 0.72;
  cursor: default;
  user-select: none;
}
.comm-subfilter-wrap {
  position: relative;
  flex-shrink: 0;
}
.comm-subfilter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: none;
  box-shadow: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 160ms var(--ease-fluid), opacity 160ms ease;
}
.comm-subfilter-btn:hover {
  background: var(--bg-elevated);
}
.comm-subfilter-btn:active {
  opacity: 0.84;
  transition-duration: 0ms;
}
.comm-subfilter-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 156px;
  padding: 8px;
  border-radius: 24px;
  background: var(--bg-surface-solid);
  border: none;
  box-shadow: none;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.comm-subfilter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 14px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 550;
  color: var(--text-primary);
  text-align: left;
  transition: background-color 140ms var(--ease-fluid), opacity 140ms ease;
}
.comm-subfilter-item:hover {
  background: var(--bg-hover);
}
.comm-subfilter-item:active {
  opacity: 0.84;
  transition-duration: 0ms;
}
.comm-subfilter-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* Fluid Inline Topic Strip with Gliding Underline Indicator (no box, full width) */
.comm-topic-strip {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  height: 38px;
  min-height: 38px;
  padding: 0 0 2px;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  scrollbar-width: none;
}
.comm-topic-strip::before {
  content: none;
  display: none;
}
.comm-topic-strip::-webkit-scrollbar {
  display: none;
}
.comm-topic-indicator {
  position: absolute;
  left: 0;
  top: auto;
  bottom: 0;
  height: 2.5px;
  width: 0;
  border-radius: 9999px;
  background: var(--accent);
  box-shadow: none;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transform-origin: left center;
  transition: transform 260ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)), opacity 160ms var(--ease-fluid);
}
.comm-topic-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 540;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  transition: color 160ms var(--ease-fluid), opacity 160ms ease;
}
.comm-topic-tab:first-of-type {
  padding-left: 4px;
}
.comm-topic-tab:hover {
  color: var(--text-primary);
}
.comm-topic-tab:active {
  opacity: 0.84;
  transition-duration: 0ms;
}
.comm-topic-tab.active {
  color: var(--accent-text);
  font-weight: 650;
}
.comm-topic-add {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--text-secondary);
  background: var(--bg-recessed);
  border: none;
}
.comm-topic-add:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.comm-channel-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.35;
}

.comm-channel-preview {
  font-size: 15px;
  line-height: 1.45;
}

.comm-context-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--bg-surface-solid);
  border-left: none;
  box-shadow: var(--shadow-3);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* Ambient List Area & Exact-Fit Shared Gliding Highlight (no mask-image layer cost) */
#comm-channel-list {
  position: relative;
  scrollbar-gutter: stable;
}
.comm-list-highlight {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: none;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform-origin: top left;
  transition: transform 260ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)), opacity 160ms var(--ease-fluid);
}
[data-theme="dark"] .comm-list-highlight {
  background: rgba(255, 255, 255, 0.11);
  box-shadow: none;
}

/* Light Floating Channel List Rows (No boxes/borders at rest) + Stagger Entrance */
@keyframes commRowIn {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.comm-channel-row {
  position: relative;
  z-index: 1;
  min-height: 68px;
  content-visibility: auto;
  contain-intrinsic-size: auto 50px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 22px;
  user-select: none;
  transition:
    background-color 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)),
    opacity 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1));
  animation: commRowIn 260ms var(--ease-enter, cubic-bezier(0.16, 1, 0.3, 1)) both;
}
html[data-list-settled] .comm-channel-row {
  animation: none;
}
.comm-channel-row:nth-child(2) { animation-delay: 28ms; }
.comm-channel-row:nth-child(3) { animation-delay: 56ms; }
.comm-channel-row:nth-child(4) { animation-delay: 84ms; }
.comm-channel-row:nth-child(5) { animation-delay: 112ms; }
.comm-channel-row:nth-child(6) { animation-delay: 140ms; }
.comm-channel-row:active {
  background: var(--bg-active, rgba(128, 134, 148, 0.14));
  opacity: 0.84;
  transition-duration: 0ms;
}

/* Open Conversation Header (No box, no bar, full pane width, light type on canvas) */
.comm-chat-header {
  width: 100%;
  max-width: none;
  align-self: stretch;
  margin: 0;
  padding: 14px 24px 6px;
  min-height: 0;
  justify-content: center;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  flex-shrink: 0;
  contain: layout style;
  z-index: 6;
  transition: transform 240ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)), opacity 200ms ease;
}
.comm-chat-header.is-scrolled {
  opacity: 0.86;
}
.comm-pinned-strip {
  width: 100%;
  max-width: none;
  align-self: stretch;
  margin: 2px 0 0;
  height: 30px;
  min-height: 30px;
  padding: 0 24px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  flex-shrink: 0;
  overflow: visible;
  transition: opacity 180ms var(--ease-fluid);
}
.comm-pinned-strip.is-empty {
  opacity: 0;
  pointer-events: none;
}
[data-theme="dark"] .comm-pinned-strip {
  background: transparent;
  box-shadow: none;
}
.comm-room-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 760;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-primary);
  min-width: 0;
  flex: 1 1 auto;
}
.comm-kind-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 520px) {
  .comm-chat-header .comm-header-lead {
    gap: 8px;
  }
  .comm-chat-header .comm-kind-pill {
    display: none;
  }
  .comm-chat-header .comm-room-title {
    font-size: 20px;
  }
  .comm-chat-header .comm-room-members {
    font-size: 13px !important;
  }
  .comm-chat-header [data-copy-email] {
    display: none;
  }
}

.comm-composer-dock {
  margin: 0 18px 14px;
  padding: 10px 14px;
  border-radius: 9999px;
  border: none;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
  flex-shrink: 0;
  contain: layout style;
  transition: background-color 160ms var(--ease-fluid), opacity 160ms var(--ease-fluid);
}
.comm-composer-dock:focus-within {
  background: rgba(255, 255, 255, 0.96);
}
[data-theme="dark"] .comm-composer-dock:focus-within {
  background: rgba(24, 27, 34, 0.96);
}

[data-theme="dark"] .comm-chat-header {
  background: transparent;
  box-shadow: none;
}
[data-theme="dark"] .comm-composer-dock {
  background: rgba(20, 22, 27, 0.88);
  box-shadow: none;
}

@media (prefers-reduced-transparency: reduce) {
  .comm-list-pane,
  .comm-chat-header {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .comm-composer-dock,
  .comm-subfilter-menu,
  .comm-context-pane {
    background: var(--bg-surface-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Hero Empty State (C14) */
.comm-hero-empty {
  flex: 1;
  width: 100%;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 32px;
  gap: 18px;
  animation: ds-route-enter 280ms var(--ease-decel, cubic-bezier(0.05, 0.7, 0.1, 1)) both;
}

.comm-hero-orb {
  position: relative;
  width: 124px;
  height: 124px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comm-hero-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent-border);
  opacity: 0.55;
}

.comm-hero-ring--outer {
  inset: -14px;
  border-color: var(--border-subtle);
}

.comm-hero-emblem {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 24px;
  background: var(--bg-surface-solid);
  border: none;
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.comm-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.comm-hero-desc {
  margin: 0;
  max-width: 440px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.comm-hero-loader {
  width: 180px;
  height: 4px;
  border-radius: 999px;
}

.comm-hero-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.comm-mobile-large-title {
  display: none;
}

.comm-mobile-back-btn {
  display: none;
}

/* Message Feed: ONLY scroller, anchored, contained */
#comm-message-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overflow-x: hidden;
  overflow-anchor: auto;
  overscroll-behavior: contain;
  contain: layout style;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  scroll-behavior: auto;
}

/* Date separators (sticky, subtle pill, zero border, zero shadow) */
.comm-day-sep,
.msg-date-sep {
  position: sticky;
  top: var(--space-2);
  z-index: 4;
  align-self: center;
  margin: var(--space-2) 0;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-solid);
  border: none;
  box-shadow: none;
  font-size: var(--text-sm, 13px);
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
}

/* Unread divider (soft gradient fade, no 1px line) */
.comm-unread-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-3) 0;
  color: var(--accent-text);
  font-size: var(--text-sm, 13px);
  font-weight: var(--fw-semibold);
}
.comm-unread-divider::before,
.comm-unread-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--accent-border);
  opacity: 0.5;
}

/* Asymmetric Squircle Message Bubbles (3 large corners + 1 small tail corner, zero borders, zero shadow) */
[data-msg-row]:not(:nth-last-child(-n+12)) {
  content-visibility: auto;
  contain-intrinsic-size: 0 84px;
}
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  max-width: min(740px, 90%);
  position: relative;
}
.msg-row.is-own {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-bubble {
  padding: 11px 16px;
  border-radius: 24px 24px 24px 14px;
  background: var(--bg-bubble-in);
  border: none;
  box-shadow: none;
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  word-break: break-word;
  transition: opacity 160ms var(--ease-fluid);
}
.msg-row.is-own .msg-bubble {
  border-radius: 24px 24px 14px 24px;
  background: var(--bg-bubble-out);
}
[data-room-type="group"] .msg-row.is-own .msg-bubble {
  background: rgba(45, 91, 142, 0.12);
}
[data-room-type="dm"] .msg-row.is-own .msg-bubble {
  background: rgba(168, 93, 42, 0.12);
}
[data-theme="dark"] [data-room-type="group"] .msg-row.is-own .msg-bubble {
  background: rgba(110, 159, 212, 0.18);
}
[data-theme="dark"] [data-room-type="dm"] .msg-row.is-own .msg-bubble {
  background: rgba(224, 169, 79, 0.16);
}

/* Group vs Direct Message Distinction (C10, Pill Marks, Zero Borders) */
.comm-kind-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  line-height: 1;
}
.comm-kind-tag.is-group {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: none;
}
.comm-kind-tag.is-dm {
  background: var(--warm-accent-soft, var(--bg-recessed));
  color: var(--warm-accent, var(--text-secondary));
  border: none;
}

.comm-kind-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1.2;
}
.comm-kind-pill.is-group {
  color: var(--accent-text, #2d5b8e);
}
.comm-kind-pill.is-dm {
  color: var(--warm-accent, #a85d2a);
}
.comm-kind-pill.is-cross_task {
  color: #6b5ca5;
}
.comm-kind-pill.is-cross_dept {
  color: #8c6d46;
}
[data-theme="dark"] .comm-kind-pill.is-group { color: #8ab8e6; }
[data-theme="dark"] .comm-kind-pill.is-dm { color: #e0a94f; }
[data-theme="dark"] .comm-kind-pill.is-cross_task { color: #b1a3eb; }
[data-theme="dark"] .comm-kind-pill.is-cross_dept { color: #d6b687; }

/* Avatars: clean, soft shadow, zero border ring */
.avatar {
  border-radius: 50%;
  box-shadow: var(--shadow-1);
}

/* Task cards: soft squircles, zero border */
.task-card,
.kanban-card,
.card {
  border: none;
  box-shadow: var(--shadow-2);
}

/* Jump to latest FAB / Banner */
.comm-new-msg-banner {
  position: sticky;
  bottom: var(--space-3);
  align-self: center;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  background: var(--cta-bg);
  color: var(--cta-text);
  border: none;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-2);
  cursor: pointer;
  user-select: none;
  transition: background-color 160ms ease, opacity 160ms ease;
}
.comm-new-msg-banner:hover {
  background: var(--cta-hover);
}
.comm-new-msg-banner:active {
  background: var(--cta-press);
  opacity: 0.85;
  transition-duration: 0ms;
}

/* Composer (Bare pill input inside glass dock) */
.comm-composer {
  flex-shrink: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
}
.comm-composer textarea,
#comm-composer-input {
  width: 100%;
  min-height: 42px;
  max-height: 156px;
  resize: none;
  border-radius: 9999px;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--text-primary);
  padding: 9px 14px;
  font-family: inherit;
  font-size: var(--text-base);
  line-height: var(--lh-base);
}
#comm-composer-input:focus {
  outline: none;
  background: transparent;
  box-shadow: none;
}

/* Reserved aspect-ratio media boxes to prevent CLS */
.media-image-card {
  aspect-ratio: 16 / 10;
  max-width: 320px;
  overflow: visible;
  border-radius: 22px;
  background: var(--bg-sunken);
  border: none;
  box-shadow: none;
}
.media-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 22px;
}

/* Collapse context column at <=1260px so 1024px+ desktop always fills width */
@media (max-width: 1260px) {
  .comm-layout {
    grid-template-columns: clamp(264px, 22vw, 316px) minmax(0, 1fr);
  }
  .comm-context-pane {
    display: none;
  }
}

/* Mobile List-Then-Thread (Telegram / iOS Push-Pop) */
@media (max-width: 960px) {
  .comm-layout[data-mobile-pattern="list-then-thread"] {
    display: block;
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
  }

  .comm-layout[data-mobile-pattern="list-then-thread"] .comm-list-pane,
  .comm-layout[data-mobile-pattern="list-then-thread"] .comm-chat-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    border-right: 0;
    transition: transform 280ms cubic-bezier(0.05, 0.7, 0.1, 1), opacity 240ms ease;
  }
  .comm-layout[data-mobile-pattern="list-then-thread"] .comm-chat-header {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 6px;
    min-height: 0;
    border-radius: 0;
    background: transparent;
  }
  .comm-layout[data-mobile-pattern="list-then-thread"] .comm-pinned-strip {
    padding: 0 16px;
  }
  .comm-layout[data-mobile-pattern="list-then-thread"] .comm-composer-dock {
    margin: 0 12px 10px;
    padding: 8px 12px;
    border-radius: 9999px;
  }
  .comm-layout[data-mobile-pattern="list-then-thread"] #comm-message-feed {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .comm-layout[data-mobile-pattern="list-then-thread"][data-mobile-view="list"] .comm-list-pane {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
  }
  .comm-layout[data-mobile-pattern="list-then-thread"][data-mobile-view="list"] .comm-chat-pane {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
  }

  .comm-layout[data-mobile-pattern="list-then-thread"][data-mobile-view="thread"] .comm-list-pane {
    transform: translateX(-24%);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
  }
  .comm-layout[data-mobile-pattern="list-then-thread"][data-mobile-view="thread"] .comm-chat-pane {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    z-index: 3;
  }

  .comm-mobile-large-title {
    display: block;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-primary);
    padding: 2px 2px 4px;
  }

  .comm-mobile-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px 0 2px;
    margin-left: -8px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
  }
  .comm-mobile-back-btn:active {
    opacity: 0.65;
  }

  .comm-list-pane button,
  .comm-chat-pane .btn-icon {
    min-height: 44px;
  }

  #comm-message-feed {
    padding: var(--space-3);
  }
  .comm-composer {
    padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  }
  .msg-row {
    max-width: 92%;
  }
}

[data-page-hidden="true"] .comm-layout::before,
[data-page-hidden="true"] .comm-layout::after,
[data-page-hidden="true"] .comm-hero-ring {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .comm-layout::before,
  .comm-layout::after {
    animation: none !important;
    transition: opacity 120ms ease !important;
  }
  .comm-list-pane:hover,
  .comm-list-pane:focus-within,
  .comm-composer-dock:focus-within {
    transform: none !important;
  }
  .comm-layout[data-mobile-pattern="list-then-thread"] .comm-list-pane,
  .comm-layout[data-mobile-pattern="list-then-thread"] .comm-chat-pane {
    transition: opacity 120ms ease !important;
    transform: none !important;
  }
  .comm-channel-row,
  .comm-hero-empty,
  .comm-hero-ring,
  .comm-thread-entering,
  .comm-msg-arriving {
    animation: none !important;
    transition: none !important;
  }
}

[data-reduce-motion="true"] .comm-layout::before,
[data-reduce-motion="true"] .comm-layout::after {
  animation: none !important;
  transition: opacity 120ms ease !important;
}
[data-reduce-motion="true"] .comm-list-pane:hover,
[data-reduce-motion="true"] .comm-list-pane:focus-within,
[data-reduce-motion="true"] .comm-composer-dock:focus-within {
  transform: none !important;
}

[data-reduce-motion="true"] .comm-layout[data-mobile-pattern="list-then-thread"] .comm-list-pane,
[data-reduce-motion="true"] .comm-layout[data-mobile-pattern="list-then-thread"] .comm-chat-pane {
  transition: opacity 120ms ease !important;
  transform: none !important;
}
[data-reduce-motion="true"] .comm-channel-row,
[data-reduce-motion="true"] .comm-hero-empty,
[data-reduce-motion="true"] .comm-hero-ring,
[data-reduce-motion="true"] .comm-thread-entering,
[data-reduce-motion="true"] .comm-msg-arriving {
  animation: none !important;
  transition: none !important;
}

/* ---- r22b / r23: In-chat Channel Management Controls & Onboarding Floating Rows ---- */
.cm-pill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.cm-float-bar {
  position: fixed;
  z-index: 900;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 9999px;
  background: var(--bg-surface-solid, #ffffff);
  border: none;
  box-shadow: none;
}

[data-theme="dark"] .cm-float-bar {
  background: var(--bg-surface-solid, #1c1f25);
}

.cm-act-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 9999px;
  border: none;
  background: rgba(128, 134, 148, 0.11);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background-color 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)),
              opacity 160ms ease;
}

.cm-act-pill:hover {
  background: var(--accent-soft, rgba(45, 91, 142, 0.14));
  color: var(--accent-text, #2d5b8e);
}
.cm-act-pill:active {
  opacity: 0.85;
  transition-duration: 0ms;
}

.cm-act-pill.is-pending,
.is-pending-archive {
  background: rgba(168, 93, 42, 0.18) !important;
  color: #a85d2a !important;
}

[data-theme="dark"] .cm-act-pill.is-pending,
[data-theme="dark"] .is-pending-archive {
  background: rgba(224, 169, 79, 0.20) !important;
  color: #e0a94f !important;
}

.cm-merge-hint {
  font-size: 15px;
  font-weight: 550;
  color: var(--text-secondary);
  padding: 0 6px;
}

.cm-inline-input {
  height: 32px;
  min-width: 120px;
  padding: 0 12px;
  border-radius: 16px;
  border: none;
  outline: none;
  background: rgba(45, 91, 142, 0.12);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
}

[data-theme="dark"] .cm-inline-input {
  background: rgba(110, 159, 212, 0.16);
}

.cm-archived-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.cm-archived-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9999px;
  border: none;
  background: rgba(128, 134, 148, 0.08);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 540;
  cursor: pointer;
}

.cm-archived-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9999px;
  border: none;
  background: rgba(128, 134, 148, 0.06);
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
}

.cm-archived-pill.active {
  background: rgba(168, 93, 42, 0.14);
  color: #a85d2a;
}

[data-theme="dark"] .cm-archived-pill.active {
  background: rgba(224, 169, 79, 0.16);
  color: #e0a94f;
}

.cm-readonly-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 9999px;
  background: rgba(128, 134, 148, 0.08);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 550;
}

.cm-member-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 9999px;
  background: rgba(128, 134, 148, 0.08);
  border: none;
  font-size: 15px;
  cursor: pointer;
}

/* Onboarding floating rows */
.ob-floating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)),
              opacity 160ms ease;
}
.ob-floating-row:hover,
.ob-floating-row.is-selected {
  background: rgba(128, 134, 148, 0.08);
}
.ob-floating-row:active {
  background: rgba(128, 134, 148, 0.14);
  opacity: 0.85;
  transition-duration: 0ms;
}

/* Calm 3-placeholder message skeleton */
@keyframes commSkelPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.8; }
}
.comm-msg-skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0;
}
.comm-msg-skeleton-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 76px;
  animation: commSkelPulse 1.4s ease-in-out infinite;
}
.comm-msg-skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-recessed);
  flex-shrink: 0;
}
.comm-msg-skeleton-bubble {
  height: 58px;
  border-radius: 22px;
  background: var(--bg-recessed);
}

/* ---- r22b: Department sheet restyle ---- */
body .cf-sheet {
  border-radius: 28px !important;
  border: none !important;
  background: var(--bg-surface, rgba(250, 249, 247, 0.96)) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 20px 22px !important;
}

[data-theme="dark"] body .cf-sheet {
  background: var(--bg-surface, rgba(28, 30, 36, 0.96)) !important;
}

body .cf-sheet .cf-in {
  border-radius: 18px !important;
  border: none !important;
  background: rgba(128, 134, 148, 0.10) !important;
  font-size: 15px !important;
  padding: 10px 14px !important;
  color: var(--text-primary) !important;
}

body .cf-sheet .cf-chip {
  border-radius: 9999px !important;
  border: none !important;
  background: rgba(128, 134, 148, 0.10) !important;
  font-size: 15px !important;
  padding: 7px 14px !important;
  color: var(--text-primary) !important;
}

body .cf-sheet .cf-go {
  border-radius: 9999px !important;
  border: none !important;
  background: var(--accent, #2d5b8e) !important;
  color: #fff !important;
  font-size: 15px !important;
  padding: 8px 18px !important;
}

body .cf-sheet .cf-row {
  border-radius: 18px !important;
  border: none !important;
  font-size: 15px !important;
  padding: 10px 14px !important;
}

body .cf-sheet .cf-link {
  font-size: 15px !important;
  color: var(--accent-text, #2d5b8e) !important;
}

body .cf-sheet .cf-tag {
  border-radius: 9999px !important;
  border: none !important;
  font-size: 15px !important;
  padding: 4px 12px !important;
  background: rgba(128, 134, 148, 0.10) !important;
}

body .cf-sheet .cf-sep {
  border: none !important;
  height: 8px !important;
  background: transparent !important;
}

/* ==================== r33: HUMAN-CHECK TIMELINE CARDS (#hs-queue / .hs-card[data-hs-card]) ==================== */
#hs-queue {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: stretch;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.hs-card[data-hs-card] {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: flex-start;
  max-width: min(560px, 92%);
  padding: 16px 20px;
  border-radius: 24px 24px 24px 12px;
  border: none;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
  color: var(--text-primary, #1d1d1f);
  contain: layout style;
  transition: opacity 200ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)), background-color 200ms ease;
}

[data-theme="dark"] .hs-card[data-hs-card] {
  background: rgba(26, 29, 36, 0.90);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  color: #f4f1ea;
}

.hs-card[data-hs-card][data-status="waiting_human"] {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(45, 91, 142, 0.11), inset 0 0 0 1px rgba(45, 91, 142, 0.14);
}

[data-theme="dark"] .hs-card[data-hs-card][data-status="waiting_human"] {
  background: rgba(30, 34, 42, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36), inset 0 0 0 1px rgba(110, 159, 212, 0.22);
}

.hs-card[data-hs-card][data-status="claimed"] {
  box-shadow: 0 8px 22px rgba(168, 93, 42, 0.09), inset 0 0 0 1px rgba(168, 93, 42, 0.20);
}

.hs-card[data-hs-card][data-status="passed"],
.hs-card[data-hs-card][data-status="archived"],
.hs-card[data-hs-card][data-status="closed"] {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: none;
  opacity: 0.86;
}

[data-theme="dark"] .hs-card[data-hs-card][data-status="passed"],
[data-theme="dark"] .hs-card[data-hs-card][data-status="archived"],
[data-theme="dark"] .hs-card[data-hs-card][data-status="closed"] {
  background: rgba(26, 29, 36, 0.56);
}

.hs-card[data-hs-card] [data-hs-claim],
.hs-card[data-hs-card] [data-hs-open],
.hs-card[data-hs-card] [data-hs-release],
.hs-card[data-hs-card] [data-hs-take] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)), background-color 160ms ease;
}

.hs-card[data-hs-card] [data-hs-claim],
.hs-card[data-hs-card] [data-hs-open] {
  background: linear-gradient(125deg, #2d5b8e, #3b6ea5);
  color: #ffffff;
}

.hs-card[data-hs-card] [data-hs-release],
.hs-card[data-hs-card] [data-hs-take] {
  background: rgba(45, 91, 142, 0.10);
  color: var(--text-primary, #1d1d1f);
}

[data-theme="dark"] .hs-card[data-hs-card] [data-hs-release],
[data-theme="dark"] .hs-card[data-hs-card] [data-hs-take] {
  background: rgba(110, 159, 212, 0.16);
  color: #f4f1ea;
}

.hs-card[data-hs-card] [data-hs-claim]:active,
.hs-card[data-hs-card] [data-hs-open]:active,
.hs-card[data-hs-card] [data-hs-release]:active,
.hs-card[data-hs-card] [data-hs-take]:active {
  opacity: 0.84;
  transition-duration: 0ms;
}


/* ==================== r35: TOTAL PROJECT TREE GITHUB SECTION (.pg-*) ==================== */
.pg-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 8px;
  contain: layout style;
}

.pg-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.pg-header-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1 1 320px;
}

.pg-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.pg-title {
  margin: 0;
  font-size: 20px;
  font-weight: 740;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.pg-hint {
  font-size: 15px;
  color: var(--text-secondary);
}

.pg-repo-bar,
.pg-repo-empty {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: rgba(128, 134, 148, 0.08);
  -webkit-touch-callout: none;
  user-select: none;
  cursor: context-menu;
  transition: opacity 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)),
              background-color 160ms ease;
}

.pg-repo-bar:hover,
.pg-repo-empty:hover {
  background: rgba(128, 134, 148, 0.13);
}

.pg-repo-bar:active,
.pg-repo-empty:active,
.pg-lane:active,
.pg-moment:active {
  opacity: 0.84;
  transition-duration: 0ms;
}

.pg-repo-bar.is-longpressing,
.pg-repo-empty.is-longpressing,
.pg-lane.is-longpressing,
.pg-moment.is-longpressing {
  opacity: 0.82;
}

.pg-repo-identity,
.pg-repo-empty-main {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pg-repo-icon {
  display: inline-flex;
  align-items: center;
  color: var(--accent-text, #2d5b8e);
}

.pg-repo-name {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.pg-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.pg-pill-sapphire {
  background: var(--accent-soft, rgba(45, 91, 142, 0.10));
  color: var(--accent-text, #234973);
}

.pg-pill-amber {
  background: var(--warm-accent-soft, rgba(168, 93, 42, 0.10));
  color: var(--warning-text, #86481e);
}

.pg-pill-neutral {
  background: rgba(128, 134, 148, 0.10);
  color: var(--text-secondary);
}

.pg-pill-muted {
  background: rgba(128, 134, 148, 0.08);
  color: var(--text-secondary);
}

.pg-pill-danger {
  background: var(--danger-soft, rgba(184, 50, 66, 0.10));
  color: var(--danger-text, #9a2634);
}

[data-theme="dark"] .pg-pill-sapphire {
  background: rgba(110, 159, 212, 0.16);
  color: #8ab8e6;
}

[data-theme="dark"] .pg-pill-amber {
  background: rgba(224, 169, 79, 0.16);
  color: #e0a94f;
}

.pg-progress-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.pg-progress-num {
  font-size: 38px;
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-text, #2d5b8e);
}

[data-theme="dark"] .pg-progress-num {
  color: #8ab8e6;
}

.pg-progress-sub {
  font-size: 15px;
  color: var(--text-secondary);
}

.pg-subblock {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pg-subhead {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-secondary);
}

/* Flowing Work Lanes */
.pg-lanes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pg-lane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  -webkit-touch-callout: none;
  user-select: none;
  cursor: context-menu;
  contain: layout style;
  transition: opacity 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)),
              background-color 180ms ease;
}

[data-theme="dark"] .pg-lane {
  background: rgba(28, 31, 38, 0.76);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.pg-lane:hover {
  background: rgba(255, 255, 255, 0.90);
}

[data-theme="dark"] .pg-lane:hover {
  background: rgba(34, 38, 46, 0.90);
}

.pg-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pg-lane-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pg-lane-title {
  font-size: 16px;
  font-weight: 680;
  color: var(--text-primary);
}

.pg-branch-chip {
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 15px;
  background: rgba(128, 134, 148, 0.10);
  color: var(--text-secondary);
}

.pg-branch-chip.is-empty {
  opacity: 0.72;
}

.pg-lane-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pg-lane-people {
  font-size: 15px;
  color: var(--text-secondary);
}

/* 5-node flowing thread */
.pg-thread {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pg-thread-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  color: var(--text-muted);
}

.pg-thread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(128, 134, 148, 0.28);
  flex-shrink: 0;
}

.pg-thread-step.is-reached {
  color: var(--text-primary);
}

.pg-thread-step.is-reached .pg-thread-dot {
  background: var(--accent, #2d5b8e);
}

.pg-thread-step.is-current {
  font-weight: 650;
  color: var(--accent-text, #234973);
}

[data-theme="dark"] .pg-thread-step.is-reached .pg-thread-dot {
  background: #6e9fd4;
}

[data-theme="dark"] .pg-thread-step.is-current {
  color: #8ab8e6;
}

.pg-thread-line {
  flex: 1 1 16px;
  min-width: 12px;
  height: 2px;
  border-radius: 9999px;
  background: rgba(128, 134, 148, 0.18);
}

/* PR Conversation Moments */
.pg-moments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pg-moment {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 20px;
  border-radius: 24px 24px 24px 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  -webkit-touch-callout: none;
  user-select: none;
  cursor: context-menu;
  contain: layout style;
  transition: opacity 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)),
              background-color 180ms ease;
}

[data-theme="dark"] .pg-moment {
  background: rgba(28, 31, 38, 0.84);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.pg-moment.is-merged {
  opacity: 0.88;
}

.pg-moment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pg-moment-title-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.pg-pr-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-text, #2d5b8e);
}

[data-theme="dark"] .pg-pr-num {
  color: #8ab8e6;
}

.pg-moment-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-primary);
}

.pg-moment-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 15px;
  color: var(--text-secondary);
}

.pg-chain-node {
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(128, 134, 148, 0.09);
}

.pg-chain-node.is-done {
  background: var(--accent-soft, rgba(45, 91, 142, 0.10));
  color: var(--accent-text, #234973);
}

.pg-chain-node.is-warn {
  background: var(--warm-accent-soft, rgba(168, 93, 42, 0.10));
  color: var(--warning-text, #86481e);
}

.pg-chain-node.is-ready {
  background: var(--warm-accent-soft, rgba(168, 93, 42, 0.12));
  color: var(--warning-text, #86481e);
  font-weight: 600;
}

[data-theme="dark"] .pg-chain-node.is-done {
  background: rgba(110, 159, 212, 0.16);
  color: #8ab8e6;
}

[data-theme="dark"] .pg-chain-node.is-warn,
[data-theme="dark"] .pg-chain-node.is-ready {
  background: rgba(224, 169, 79, 0.16);
  color: #e0a94f;
}

.pg-chain-arrow {
  color: var(--text-muted);
}

/* Recent Commits */
.pg-commit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pg-commit-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 16px;
  background: rgba(128, 134, 148, 0.06);
  font-size: 15px;
}

.pg-commit-sha {
  font-size: 15px;
  font-weight: 650;
  color: var(--accent-text, #2d5b8e);
}

[data-theme="dark"] .pg-commit-sha {
  color: #8ab8e6;
}

.pg-commit-msg {
  color: var(--text-primary);
  flex: 1 1 220px;
}

.pg-commit-meta {
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .pg-progress-hero {
    align-items: flex-start;
  }
  .pg-lane,
  .pg-moment {
    padding: 14px 16px;
  }
  .pg-thread-line {
    display: none;
  }
  .pg-thread {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pg-repo-bar,
  .pg-repo-empty,
  .pg-lane,
  .pg-moment {
    transition: none !important;
  }
}

/* ============================================================================
 * r37 — Performance containment for chat lists & message rows
 * ========================================================================== */
.comm-channel-row {
  content-visibility: auto;
  contain-intrinsic-size: 0 64px;
}

.comm-msg-row {
  content-visibility: auto;
  contain-intrinsic-size: 0 72px;
}

/* ============================================================================
 * r37 — Genesis v3.0 Surfaces (内心 · 回执状态 · 16 项实测 + 提醒队列)
 * Island language · r12 sapphire & copper-amber · 15px+ · zero green
 * ========================================================================== */
.g3-surface {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

.g3-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.g3-title {
  margin: 0;
  font-size: 20px;
  font-weight: 740;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.g3-sub {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.g3-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.g3-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.g3-role-pill.is-founder {
  background: var(--accent-soft, rgba(45, 91, 142, 0.12));
  color: var(--accent-text, #234973);
}

.g3-role-pill.is-readonly {
  background: rgba(128, 134, 148, 0.10);
  color: var(--text-secondary);
}

[data-theme="dark"] .g3-role-pill.is-founder {
  background: rgba(110, 159, 212, 0.18);
  color: #8ab8e6;
}

.g3-band-label {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.g3-fact-band {
  padding: 16px 20px;
  border-radius: 24px;
  background: rgba(128, 134, 148, 0.07);
}

.g3-fact-stream {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 15px;
  color: var(--text-primary);
}

.g3-entry-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.g3-inner-entry {
  padding: 16px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 6px 20px rgba(24, 30, 42, 0.05);
  cursor: context-menu;
  transition: opacity 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1));
}

.g3-inner-entry.is-uncertain {
  background: rgba(168, 93, 42, 0.07);
}

[data-theme="dark"] .g3-inner-entry {
  background: rgba(28, 31, 38, 0.78);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .g3-inner-entry.is-uncertain {
  background: rgba(224, 169, 79, 0.10);
}

.g3-entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 15px;
}

.g3-kind-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 9999px;
  background: var(--accent-soft, rgba(45, 91, 142, 0.10));
  color: var(--accent-text, #234973);
  font-size: 15px;
  font-weight: 600;
}

[data-theme="dark"] .g3-kind-pill {
  background: rgba(110, 159, 212, 0.16);
  color: #8ab8e6;
}

.g3-layer-tag {
  font-size: 15px;
  color: var(--text-secondary);
}

.g3-layer-tag.is-uncertain {
  color: var(--warning-text, #86481e);
  font-weight: 600;
}

[data-theme="dark"] .g3-layer-tag.is-uncertain {
  color: #e0a94f;
}

.g3-meta-tag {
  padding: 2px 10px;
  border-radius: 9999px;
  background: rgba(128, 134, 148, 0.10);
  color: var(--text-secondary);
  font-size: 15px;
}

.g3-edited-pill {
  padding: 2px 10px;
  border-radius: 9999px;
  background: rgba(168, 93, 42, 0.12);
  color: var(--warning-text, #86481e);
  font-size: 15px;
  font-weight: 600;
}

[data-theme="dark"] .g3-edited-pill {
  background: rgba(224, 169, 79, 0.16);
  color: #e0a94f;
}

.g3-recall-whisper {
  color: var(--text-muted);
  font-size: 15px;
}

.g3-time {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 15px;
}

.g3-entry-content {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-primary);
}

.g3-edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.g3-edit-textarea {
  width: 100%;
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.6;
}

.g3-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.g3-revert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 9999px;
  background: var(--accent-soft, rgba(45, 91, 142, 0.10));
  font-size: 15px;
}

.g3-audit-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.g3-audit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.g3-audit-row {
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(128, 134, 148, 0.06);
  font-size: 15px;
}

.g3-audit-row.is-denied {
  background: rgba(168, 93, 42, 0.10);
}

.g3-audit-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.g3-audit-action {
  font-weight: 650;
  color: var(--text-primary);
}

.g3-audit-row.is-denied .g3-audit-action {
  color: var(--warning-text, #86481e);
}

[data-theme="dark"] .g3-audit-row.is-denied .g3-audit-action {
  color: #e0a94f;
}

.g3-diff {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 15px;
}

.g3-diff-before {
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(168, 93, 42, 0.10);
  color: var(--warning-text, #86481e);
}

.g3-diff-after {
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--accent-soft, rgba(45, 91, 142, 0.10));
  color: var(--accent-text, #234973);
}

[data-theme="dark"] .g3-diff-before {
  color: #e0a94f;
}

[data-theme="dark"] .g3-diff-after {
  color: #8ab8e6;
}

/* Screen 2 — Receipt 4-step flowing line */
.g3-chain-warn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 9999px;
  background: rgba(168, 93, 42, 0.14);
  color: var(--warning-text, #86481e);
  font-size: 15px;
  font-weight: 650;
}

[data-theme="dark"] .g3-chain-warn {
  background: rgba(224, 169, 79, 0.18);
  color: #e0a94f;
}

.g3-flow-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 9999px;
  background: rgba(128, 134, 148, 0.07);
  flex-wrap: wrap;
}

.g3-flow-node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text-muted);
}

.g3-flow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(128, 134, 148, 0.35);
  flex-shrink: 0;
}

.g3-flow-node.is-done {
  color: var(--accent-text, #234973);
  font-weight: 600;
}

.g3-flow-node.is-done .g3-flow-dot {
  background: var(--accent, #2d5b8e);
}

.g3-flow-node.is-current {
  color: var(--text-primary);
  font-weight: 700;
}

.g3-flow-node.is-current .g3-flow-dot {
  background: var(--accent, #2d5b8e);
  box-shadow: 0 0 0 4px rgba(45, 91, 142, 0.18);
}

[data-theme="dark"] .g3-flow-node.is-done {
  color: #8ab8e6;
}

.g3-flow-connector {
  flex: 1 1 24px;
  min-width: 16px;
  height: 2px;
  border-radius: 9999px;
  background: rgba(128, 134, 148, 0.22);
}

.g3-flow-connector.is-done {
  background: var(--accent, #2d5b8e);
}

.g3-receipt-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.65);
}

[data-theme="dark"] .g3-receipt-details {
  background: rgba(28, 31, 38, 0.78);
}

.g3-kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 15px;
}

.g3-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.g3-history-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 18px;
  background: rgba(128, 134, 148, 0.06);
  font-size: 15px;
}

/* Screen 3 — 16 项实测 + 提醒队列 */
.g3-progress-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.g3-big-num {
  font-size: 28px;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent-text, #234973);
}

[data-theme="dark"] .g3-big-num {
  color: #8ab8e6;
}

.g3-soft-track {
  height: 6px;
  border-radius: 9999px;
  background: rgba(128, 134, 148, 0.16);
  overflow: hidden;
}

.g3-soft-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  border-radius: 9999px;
  background: var(--accent, #2d5b8e);
  transition: transform 280ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1));
}

.g3-phase-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.g3-phase-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 9999px;
  border: none;
  background: rgba(128, 134, 148, 0.09);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)),
              background-color 160ms ease;
}

.g3-phase-btn.active {
  background: var(--accent-soft, rgba(45, 91, 142, 0.14));
  color: var(--accent-text, #234973);
}

[data-theme="dark"] .g3-phase-btn.active {
  background: rgba(110, 159, 212, 0.20);
  color: #8ab8e6;
}

.g3-phase-btn:active {
  opacity: 0.84;
}

.g3-story-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.g3-story-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.65);
}

.g3-story-row.is-pending {
  opacity: 0.76;
  background: rgba(128, 134, 148, 0.06);
}

[data-theme="dark"] .g3-story-row {
  background: rgba(28, 31, 38, 0.78);
}

[data-theme="dark"] .g3-story-row.is-pending {
  background: rgba(28, 31, 38, 0.48);
}

.g3-story-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.g3-item-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-text, #234973);
}

[data-theme="dark"] .g3-item-num {
  color: #8ab8e6;
}

.g3-item-name {
  font-size: 16px;
  font-weight: 700;
}

.g3-status-tag {
  font-size: 15px;
  color: var(--text-muted);
}

.g3-status-tag.is-measured {
  color: var(--accent-text, #234973);
  font-weight: 600;
}

[data-theme="dark"] .g3-status-tag.is-measured {
  color: #8ab8e6;
}

.g3-story-detail {
  font-size: 15px;
  color: var(--text-secondary);
}

.g3-rhythm-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.g3-rhythm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.g3-rhythm-pill {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 9999px;
  background: rgba(128, 134, 148, 0.08);
  font-size: 15px;
}

.g3-prompt-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.g3-prompt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.g3-prompt-item {
  padding: 14px 18px;
  border-radius: 22px;
  background: rgba(128, 134, 148, 0.07);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.g3-empty {
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(128, 134, 148, 0.06);
  color: var(--text-secondary);
  font-size: 15px;
}

@media (max-width: 640px) {
  .g3-flow-line {
    border-radius: 22px;
  }
  .g3-inner-entry,
  .g3-fact-band,
  .g3-receipt-details,
  .g3-story-row {
    padding: 14px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .g3-inner-entry,
  .g3-soft-fill,
  .g3-phase-btn {
    transition: none !important;
  }
}
