/* Communication Engine V2 — page does not scroll; only message panel scrolls */
/* STABLE_ROLLBACK: ce2-keyboard-v60 — see ROLLBACK-KEYBOARD-v60.md + KEYBOARD-STABLE.lock */
/* UI-1–3: composure pass — PHASE-UI-COMPOSURE-REFINEMENT.md (keyboard v60 frozen) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.ce2-body-root {
  height: 100%;
  width: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #08080a;
  color: #f2f0ec;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

/* v59 FROZEN — counter iOS visual-viewport pan; do not change when tuning composer */
body.ce2-body-root.ce2-kb-active {
  transform: translate3d(0, calc(-1 * var(--ce2-vv-offset, 0px)), 0);
}

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

/* Label tap → hidden file input (iOS-safe; no overlay bleeding onto mic) */
.ce2-attach-wrap {
  position: relative;
  flex-shrink: 0;
  width: var(--ce2-composer-control);
  height: var(--ce2-composer-control);
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ce2-attach-wrap .ce2-composer-attach {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ce2-attach-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.ce2-attach-wrap.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.ce2-attach-status {
  margin: 6px var(--ce2-chrome-pad-x) 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.ce2-attach-status[hidden] {
  display: none !important;
}

.ce2-attach-status--ok {
  background: rgba(40, 90, 50, 0.45);
  color: #d8f0dc;
  border: 1px solid rgba(120, 200, 120, 0.35);
}

.ce2-attach-status--err {
  background: rgba(120, 40, 30, 0.5);
  color: #f5d0c8;
  border: 1px solid rgba(220, 100, 90, 0.4);
}

/* Header = flex child (never position:fixed). Keyboard: body vv counter + composer transform. */
.ce2-shell {
  --ce2-chrome-pad-y: 8px;
  --ce2-chrome-pad-x: 12px;
  --ce2-meta-opacity: 0.38;
  --ce2-border-subtle: rgba(255, 255, 255, 0.06);
  --ce2-bubble-radius: 14px;
  --ce2-row-gap: 14px;
  --ce2-composer-bg: #08080a;
  --ce2-composer-surface: rgba(255, 255, 255, 0.035);
  --ce2-composer-control: 40px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #08080a;
}

/* Do not disable pointer-events while loading — iOS PWA felt frozen */

.ce2-placeholder-loading {
  color: rgba(201, 184, 146, 0.55);
  animation: ce2-loading-pulse 1.4s ease-in-out infinite;
}

@keyframes ce2-loading-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

.ce2-alert {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 180, 80, 0.35);
  background: rgba(120, 70, 20, 0.35);
  color: #f5e6c8;
}

.ce2-alert.ce2-alert-ok {
  border-bottom-color: rgba(120, 200, 120, 0.35);
  background: rgba(40, 90, 50, 0.45);
  color: #d8f0dc;
}

.ce2-alert-hidden {
  display: none;
}


.ce2-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--ce2-chrome-pad-y) + env(safe-area-inset-top, 0)) var(--ce2-chrome-pad-x)
    var(--ce2-chrome-pad-y);
  border-bottom: 1px solid var(--ce2-border-subtle);
  background: #08080a;
}

.ce2-back {
  color: #c9b892;
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
  padding: 8px;
  margin-left: -4px;
}

.ce2-header-text {
  flex: 1;
  min-width: 0;
}

.ce2-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ce2-hub-unread-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #c9b892;
  color: #0a0907;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
}

.ce2-hub-unread-total[hidden] {
  display: none !important;
}

.ce2-sub {
  margin: 1px 0 0;
  font-size: 0.68rem;
  line-height: 1.25;
  opacity: 0.5;
}

/* UI-1: more room for thread on mobile */
@media (max-width: 719px) {
  .ce2-shell.ce2-thread-open .ce2-sub {
    display: none;
  }
}

.ce2-pill {
  flex-shrink: 0;
  font-size: 0.65rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201, 184, 146, 0.35);
  color: #c9b892;
}

.ce2-workspace {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 720px) {
  .ce2-workspace {
    flex-direction: row;
  }

  .ce2-sidebar {
    width: min(340px, 38vw);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
  }
}

.ce2-hub-nav {
  display: none;
}

.ce2-sidebar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  max-height: min(42vh, 320px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Mobile: hub (one list at a time) + full-screen thread */
@media (max-width: 719px) {
  .ce2-hub-nav {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #0a0a0e;
    z-index: 40;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .ce2-hub-tab {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #bdb6a8;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
  }

  .ce2-hub-tab-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #c9b892;
    color: #0a0907;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
  }

  .ce2-hub-tab-badge[hidden] {
    display: none !important;
  }

  .ce2-hub-tab.is-active {
    border-color: #c9b892;
    color: #f2f0ec;
    background: rgba(201, 184, 146, 0.12);
  }

  .ce2-hub-mode .ce2-sidebar {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    overflow: hidden;
  }

  .ce2-hub-mode .ce2-main {
    display: none !important;
  }

  .ce2-sidebar-scroll {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 10px 12px calc(8px + env(safe-area-inset-bottom, 0));
  }

  .ce2-sidebar .ce2-section[data-hub-panel] {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
  }

  .ce2-hub-groups .ce2-section[data-hub-panel='groups'],
  .ce2-hub-direct .ce2-section[data-hub-panel='direct'],
  .ce2-hub-discover .ce2-section[data-hub-panel='discover'],
  .ce2-hub-saved .ce2-section[data-hub-panel='saved'] {
    display: flex;
  }

  .ce2-panel-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .ce2-section[data-hub-panel] .ce2-section-title,
  .ce2-section[data-hub-panel] .ce2-hint,
  .ce2-section[data-hub-panel] .ce2-tabs,
  .ce2-section[data-hub-panel] .ce2-btn-ghost {
    flex-shrink: 0;
  }

  .ce2-thread-open .ce2-sidebar {
    display: none;
  }

  .ce2-thread-open .ce2-workspace {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .ce2-thread-open .ce2-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .ce2-thread-open .ce2-messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Composer stays in flex flow; translate lifts it above overlay keyboard (v60 measured lift) */
  body.ce2-composer-kb-active .ce2-thread-open .ce2-composer {
    transform: translate3d(0, calc(-1 * var(--ce2-composer-kb, 0px)), 0);
    will-change: transform;
    padding-bottom: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  body.ce2-composer-kb-active .ce2-thread-open .ce2-messages {
    padding-bottom: calc(8px + var(--ce2-composer-kb, 0px));
  }
}

@media (min-width: 720px) {
  .ce2-sidebar {
    max-height: none;
  }

  .ce2-sidebar .ce2-section[data-hub-panel] {
    display: block;
  }

  .ce2-back-thread {
    display: none !important;
  }
}

/* Desktop: sidebar column scrolls; mobile hub uses .ce2-panel-scroll only */
@media (min-width: 720px) {
  .ce2-sidebar-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0));
  }
}

.ce2-section {
  margin-bottom: 18px;
}

.ce2-section-title {
  margin: 0 0 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.ce2-hint {
  margin: 0 0 8px;
  font-size: 0.7rem;
  opacity: 0.48;
  line-height: 1.35;
}

.ce2-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.ce2-tabs-discovery .ce2-tab {
  flex: 1 1 calc(33% - 6px);
  min-width: 72px;
}

.ce2-tab {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #bdb6a8;
  font-size: 0.72rem;
}

.ce2-tab.is-active {
  border-color: #c9b892;
  color: #f2f0ec;
}

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

.ce2-li {
  padding: 10px 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  border: 1px solid transparent;
}

.ce2-li.is-selected {
  border-color: rgba(201, 184, 146, 0.45);
}

.ce2-li-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.ce2-li-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ce2-li-meta {
  margin-top: 3px;
  font-size: 0.68rem;
  opacity: 0.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ce2-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ce2-main-header {
  flex-shrink: 0;
  z-index: 10;
  background: #08080a;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--ce2-chrome-pad-y) var(--ce2-chrome-pad-x);
  border-bottom: 1px solid var(--ce2-border-subtle);
}

.ce2-back-thread {
  flex-shrink: 0;
  margin-top: 0;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(201, 184, 146, 0.35);
  background: rgba(201, 184, 146, 0.12);
  color: #c9b892;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.ce2-main-header-text {
  flex: 1;
  min-width: 0;
}

.ce2-thread-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.ce2-thread-meta {
  margin: 2px 0 0;
  font-size: 0.68rem;
  line-height: 1.3;
  opacity: var(--ce2-meta-opacity);
}

.ce2-thread-search-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(201, 184, 146, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #a89f8c;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ce2-thread-search-toggle.is-active {
  border-color: rgba(201, 184, 146, 0.45);
  background: rgba(201, 184, 146, 0.12);
  color: #c9b892;
}

.ce2-thread-search-toggle[hidden] {
  display: none !important;
}

.ce2-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 10px var(--ce2-chrome-pad-x) 12px;
}

.ce2-row {
  margin-bottom: var(--ce2-row-gap);
  max-width: min(100%, 22rem);
}

.ce2-row.is-self {
  margin-left: auto;
  max-width: min(100%, 24rem);
}

.ce2-row.is-pending .ce2-bubble {
  opacity: 0.72;
}

.ce2-row.is-pending.is-self .ce2-bubble {
  border: 1px dashed rgba(201, 184, 146, 0.35);
}

@media (max-width: 719px) {
  .ce2-row,
  .ce2-row.is-self {
    max-width: 100%;
  }
}

.ce2-bubble {
  padding: 9px 12px;
  border-radius: var(--ce2-bubble-radius);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.ce2-row.is-self .ce2-bubble {
  background: rgba(201, 184, 146, 0.18);
}

.ce2-bubble-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.ce2-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ce2-bubble.ce2-bubble-locked {
  font-style: italic;
  opacity: 0.7;
}

.ce2-row-actionable .ce2-bubble {
  cursor: context-menu;
  -webkit-touch-callout: none;
}

.ce2-row.ce2-bubble-pressing .ce2-bubble,
.ce2-row.ce2-row-menu-target .ce2-bubble {
  filter: brightness(1.12);
  box-shadow: 0 0 0 2px rgba(201, 184, 146, 0.35);
}

.ce2-msg-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.68rem;
  opacity: var(--ce2-meta-opacity);
}

.ce2-row.is-self .ce2-msg-foot {
  justify-content: flex-end;
}

.ce2-msg-foot-meta {
  opacity: 1;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

/* Long-press / right-click message menu */
.ce2-msg-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.ce2-msg-menu[hidden] {
  display: none !important;
}

.ce2-msg-menu.is-open {
  pointer-events: auto;
}

.ce2-msg-menu-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  margin: 0;
  padding: 0;
  background: rgba(4, 4, 8, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: default;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.ce2-msg-menu.is-open .ce2-msg-menu-backdrop {
  opacity: 1;
}

.ce2-msg-menu-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  margin: 0 10px calc(10px + env(safe-area-inset-bottom, 0));
  padding: 0;
  border-radius: 14px;
  background: #1a1a20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.48),
    0 2px 8px rgba(0, 0, 0, 0.32);
  transform: translateY(110%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.ce2-msg-menu-panel--sub {
  border-color: rgba(201, 184, 146, 0.22);
}

.ce2-msg-menu-grab {
  display: none;
  width: 40px;
  height: 4px;
  margin: 10px auto 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.ce2-msg-menu.is-sheet .ce2-msg-menu-grab {
  display: block;
}

.ce2-msg-menu.is-sheet.is-open .ce2-msg-menu-panel {
  transform: translateY(0);
}

.ce2-msg-menu.is-popover {
  align-items: flex-start;
  justify-content: flex-start;
}

.ce2-msg-menu.is-popover .ce2-msg-menu-panel {
  position: fixed;
  width: min(17.5rem, calc(100vw - 20px));
  margin: 0;
  border-radius: 16px;
  transform: scale(0.92) translateY(6px);
  opacity: 0;
  transition:
    transform 0.18s cubic-bezier(0.34, 1.2, 0.64, 1),
    opacity 0.16s ease;
}

.ce2-msg-menu.is-popover.is-open .ce2-msg-menu-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.ce2-msg-menu.is-popover.is-flip-above.is-open .ce2-msg-menu-panel {
  transform-origin: left bottom;
}

.ce2-msg-menu-list {
  list-style: none;
  margin: 0;
  padding: 6px 0 10px;
}

.ce2-msg-menu-list--enter-forward {
  animation: ce2MenuEnterForward 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.ce2-msg-menu-list--enter-back {
  animation: ce2MenuEnterBack 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ce2MenuEnterForward {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ce2MenuEnterBack {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ce2-msg-menu-row--divided .ce2-msg-menu-item {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ce2-msg-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  color: #ebe4d4;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: left;
  padding: 13px 18px;
  min-height: 46px;
  cursor: pointer;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.ce2-msg-menu-item:active:not(.is-nav) {
  transform: scale(0.985);
}

.ce2-msg-menu-item-label {
  flex: 1;
  min-width: 0;
}

.ce2-msg-menu-divider {
  list-style: none;
  height: 1px;
  margin: 4px 0 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
}

.ce2-msg-menu-group-label {
  list-style: none;
  margin: 0;
  padding: 10px 18px 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  pointer-events: none;
}

.ce2-msg-menu-item.is-nav {
  justify-content: space-between;
  min-height: 44px;
  padding: 12px 18px;
  color: rgba(235, 228, 212, 0.92);
}

.ce2-msg-menu-chevron {
  flex-shrink: 0;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: none;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1;
  color: rgba(255, 255, 255, 0.35);
}

.ce2-msg-menu-chevron::before {
  content: '›';
}

.ce2-msg-menu-chevron.is-back-chevron::before {
  content: '‹';
}

.ce2-msg-menu-back-wrap {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ce2-msg-menu-item.is-back {
  justify-content: flex-start;
  gap: 6px;
  min-height: 44px;
  padding: 11px 18px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(201, 184, 146, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
}

.ce2-msg-menu-item.is-back .ce2-msg-menu-chevron {
  color: rgba(201, 184, 146, 0.65);
}

.ce2-msg-menu-item:hover,
.ce2-msg-menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.ce2-msg-menu-item.is-danger {
  color: #f2b49a;
}

.ce2-msg-menu-item.is-danger:hover,
.ce2-msg-menu-item.is-danger:focus-visible {
  background: rgba(232, 100, 72, 0.16);
}

body.ce2-msg-menu-open {
  overflow: hidden;
}

.ce2-composer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 0 0 calc(env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ce2-border-subtle);
  background: var(--ce2-composer-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ce2-composer-format {
  flex-shrink: 0;
  width: var(--ce2-composer-control);
  height: var(--ce2-composer-control);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--ce2-composer-surface);
  color: #a89f8c;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ce2-composer-format strong,
.ce2-composer-format em {
  font-size: 0.88rem;
  color: inherit;
}

.ce2-composer-format:active,
.ce2-composer-format:focus-visible {
  border-color: rgba(201, 184, 146, 0.35);
  color: #c9b892;
  outline: none;
}

.ce2-composer-format-emoji {
  font-size: 1.05rem;
}

.ce2-composer-bar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px var(--ce2-chrome-pad-x) 8px;
}

@media (max-width: 719px) {
  .ce2-composer-bar {
    gap: 5px;
    --ce2-composer-control: 36px;
  }

  .ce2-composer-voice {
    margin-left: 4px;
  }

  .ce2-input-shell {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .ce2-btn-send {
    min-width: 52px;
    width: auto;
    padding: 0 11px;
  }

  .ce2-send-text {
    display: inline;
    font-size: 0.76rem;
  }
}

.ce2-send-icon {
  display: none;
}

.ce2-composer-more {
  flex-shrink: 0;
  width: var(--ce2-composer-control);
  height: var(--ce2-composer-control);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--ce2-composer-surface);
  color: #a89f8c;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ce2-composer-more.is-open {
  background: rgba(201, 184, 146, 0.14);
  border-color: rgba(201, 184, 146, 0.35);
  color: #c9b892;
}

.ce2-composer-drawer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px var(--ce2-chrome-pad-x) 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  animation: ce2-drawer-in 0.18s ease-out;
}

@keyframes ce2-drawer-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ce2-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ce2-drawer-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.45;
  color: #c9b892;
}

.ce2-drawer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ce2-reply-banner[hidden],
.ce2-attach-preview[hidden] {
  display: none !important;
}

.ce2-composer-drawer[hidden] {
  display: none !important;
}

.ce2-li-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ce2-li-body {
  flex: 1;
  min-width: 0;
}

.ce2-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(201, 184, 146, 0.2);
  color: #e8dcc4;
  border: 1px solid rgba(201, 184, 146, 0.35);
}

.ce2-select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #121218;
  color: inherit;
}

.ce2-typing-line {
  flex-shrink: 0;
  display: none !important;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 14px 6px;
  font-size: 0.72rem;
  font-style: italic;
  opacity: 0.72;
  color: #c9b892;
}

.ce2-typing-text {
  min-width: 0;
}

.ce2-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.ce2-typing-dots i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c9b892;
  opacity: 0.45;
  animation: ce2-typing-bounce 1.1s ease-in-out infinite;
}

.ce2-typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.ce2-typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ce2-typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  30% {
    transform: translateY(-3px);
    opacity: 0.95;
  }
}

.ce2-reply-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px var(--ce2-chrome-pad-x) 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border-left: 3px solid #c9b892;
  font-size: 0.75rem;
  line-height: 1.35;
}

#ce2ReplyBannerText {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ce2-reply-banner-kicker {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.55;
}

.ce2-reply-banner-name {
  font-weight: 650;
  font-size: 0.76rem;
  color: #c9b892;
}

.ce2-reply-banner-preview {
  font-size: 0.72rem;
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ce2-reply-cancel {
  margin-left: auto;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.7;
}

.ce2-li-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ce2-unread-badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #c9b892;
  color: #0a0907;
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
}

.ce2-li-meta--draft {
  font-style: italic;
  opacity: 0.72;
  color: #c9b892;
}

.ce2-load-older {
  width: calc(100% - 20px);
  margin: 8px 10px;
}

.ce2-msg-video-wrap {
  display: block;
  max-width: min(280px, 100%);
  margin-bottom: 6px;
}

.ce2-msg-video {
  display: block;
  width: 100%;
  max-width: min(280px, 100%);
  border-radius: 10px;
  margin-bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  min-height: 120px;
  object-fit: cover;
}

/* Data-light media: thumbnail in thread, full file only on tap */
.ce2-media-tap {
  display: block;
  position: relative;
  width: min(280px, 100%);
  margin: 0 0 6px;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.ce2-media-tap--image .ce2-media-thumb,
.ce2-media-full {
  display: block;
  width: 100%;
  max-width: min(280px, 100%);
  border-radius: 10px;
  object-fit: cover;
  vertical-align: top;
}

.ce2-media-video-poster {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.4);
}

.ce2-media-video-placeholder,
.ce2-attach-thumb-vid-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(232, 220, 196, 0.55);
  background: rgba(0, 0, 0, 0.35);
}

.ce2-media-play-icon::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.ce2-media-tap-hint {
  display: block;
  padding: 6px 10px 8px;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(232, 220, 196, 0.45);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.ce2-media-tap--video .ce2-media-tap-hint {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}

.ce2-media-tap:active {
  opacity: 0.92;
}

.ce2-msg-video-wrap.is-playing {
  margin-bottom: 6px;
}

.ce2-msg-audio-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(260px, 100%);
  margin-bottom: 6px;
}

.ce2-msg-audio {
  display: block;
  width: 100%;
  min-height: 44px;
}

.ce2-voice-player {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
}

.ce2-voice-play-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(201, 184, 146, 0.35);
  border-radius: 50%;
  background: rgba(201, 184, 146, 0.12);
  color: #e8dcc4;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ce2-voice-play-btn:active {
  transform: scale(0.96);
}

.ce2-voice-play-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.ce2-voice-player-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ce2-voice-player-wave {
  min-height: 22px;
}

.ce2-voice-wave-static {
  height: 22px;
  min-height: 22px;
  max-height: 22px;
}

.ce2-voice-wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
  width: 100%;
}

.ce2-voice-wave-bar {
  flex: 1;
  min-width: 2px;
  max-width: 6px;
  border-radius: 2px 2px 1px 1px;
  background: rgba(201, 184, 146, 0.45);
  align-self: flex-end;
}

.ce2-voice-player-progress {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.ce2-voice-player-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #9a8460, #c9b892);
  transition: width 0.1s linear;
}

.ce2-voice-player.is-playing .ce2-voice-player-bar {
  transition: none;
}

.ce2-voice-player-seek {
  width: 100%;
  height: 14px;
  margin: 0;
  accent-color: #c9b892;
  cursor: pointer;
}

.ce2-voice-player-time {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: #a89f8c;
  min-width: 4.5em;
  text-align: right;
}

.ce2-voice-unsupported {
  margin: 0;
  font-size: 0.78rem;
  color: #c8a0a0;
}

.ce2-voice-upload-progress {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.ce2-voice-upload-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #9a8460, #c9b892);
  transition: width 0.15s ease;
}

.ce2-voice-upload-label {
  margin: 0;
  font-size: 0.72rem;
  color: #a89f8c;
}

.ce2-voice-failed-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ce2-voice-retry,
.ce2-voice-discard {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #d8d0c0;
  font-size: 0.78rem;
  padding: 6px 10px;
  cursor: pointer;
  touch-action: manipulation;
}

.ce2-voice-retry {
  border-color: rgba(201, 184, 146, 0.45);
  color: #e8dcc4;
}

.ce2-row.is-pending.is-voice-failed .ce2-bubble {
  border-color: rgba(200, 90, 90, 0.35);
}

.ce2-composer-attach,
.ce2-composer-voice {
  flex-shrink: 0;
  width: var(--ce2-composer-control);
  height: var(--ce2-composer-control);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--ce2-composer-surface);
  color: #a89f8c;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ce2-composer-voice {
  position: relative;
  z-index: 4;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.ce2-composer-bar {
  -webkit-touch-callout: none;
}


.ce2-composer-voice.is-recording {
  background: rgba(180, 70, 70, 0.28);
  border-color: rgba(220, 100, 100, 0.5);
  color: #f0c8c0;
  animation: ce2-voice-pulse 1.2s ease-in-out infinite;
}

.ce2-composer-voice.is-cancel-armed {
  background: rgba(90, 90, 95, 0.45);
  border-color: rgba(140, 140, 150, 0.55);
  color: #c8c4bc;
  animation: none;
}

.ce2-voice-record-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 var(--ce2-chrome-pad-x) 6px;
  padding: 8px 12px;
  min-height: 52px;
  border-radius: 12px;
  background: rgba(180, 70, 70, 0.14);
  border: 1px solid rgba(220, 100, 100, 0.28);
  color: #e8d4d0;
  font-size: 0.82rem;
  line-height: 1.2;
}

.ce2-voice-record-wave {
  display: block;
  width: 100%;
  height: 28px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.ce2-voice-record-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
}

.ce2-voice-record-stop {
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(201, 184, 146, 0.5);
  background: rgba(201, 184, 146, 0.18);
  color: #e8dcc4;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  touch-action: manipulation;
}

.ce2-voice-record-bar--locked {
  border-color: rgba(201, 184, 146, 0.45);
  background: rgba(201, 184, 146, 0.12);
}

.ce2-composer-voice.is-locked {
  background: rgba(201, 184, 146, 0.22);
  border-color: rgba(201, 184, 146, 0.5);
  color: #e8dcc4;
}

.ce2-voice-record-bar[hidden] {
  display: none !important;
}

.ce2-voice-record-bar--cancel {
  background: rgba(90, 90, 95, 0.28);
  border-color: rgba(140, 140, 150, 0.4);
  color: #b8b4ac;
}

.ce2-voice-record-bar--cancel .ce2-voice-record-hint {
  color: #d4a0a0;
}

.ce2-voice-record-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e06060;
  flex-shrink: 0;
  animation: ce2-voice-pulse 1.2s ease-in-out infinite;
}

.ce2-voice-record-bar--cancel .ce2-voice-record-dot {
  background: #888;
  animation: none;
}

.ce2-voice-record-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 2.5em;
}

.ce2-voice-record-hint {
  margin-left: auto;
  opacity: 0.85;
  font-size: 0.78rem;
}

@keyframes ce2-voice-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.ce2-attach-preview {
  position: relative;
  margin: 6px var(--ce2-chrome-pad-x) 0;
  max-width: min(280px, 92vw);
}

.ce2-attach-preview-inner {
  position: relative;
}

.ce2-attach-preview-vid {
  display: block;
  max-width: 100%;
  max-height: 160px;
  border-radius: 10px;
}

.ce2-attach-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.ce2-attach-progress {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.ce2-attach-progress-bar {
  display: block;
  height: 100%;
  background: #c9b892;
  border-radius: 2px;
  transition: width 0.15s ease;
}

.ce2-attach-progress-label {
  font-size: 0.7rem;
  opacity: 0.75;
  min-width: 2.2em;
}

.ce2-attach-cancel {
  display: block;
  margin-top: 6px;
  padding: 4px 10px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.ce2-msg-removed {
  margin: 0;
  font-style: italic;
  opacity: 0.65;
  font-size: 0.85rem;
}

.ce2-attach-preview img {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ce2-attach-clear {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
}

.ce2-msg-image {
  display: block;
  max-width: min(260px, 100%);
  border-radius: 10px;
  margin-bottom: 6px;
}

.ce2-bubble--has-reply {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ce2-reply-quote {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0 0 2px;
  padding: 7px 8px 7px 0;
  border: none;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.ce2-reply-quote:focus-visible {
  outline: 2px solid rgba(201, 184, 146, 0.55);
  outline-offset: 1px;
}

.ce2-row.is-self .ce2-reply-quote {
  background: rgba(0, 0, 0, 0.2);
}

.ce2-reply-quote-bar {
  flex-shrink: 0;
  width: 3px;
  border-radius: 2px;
  margin: 1px 8px 1px 0;
  background: #7eb8d4;
}

.ce2-row.is-self .ce2-reply-quote-bar {
  background: #c9b892;
}

.ce2-reply-quote-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ce2-reply-quote-name {
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  color: #7eb8d4;
}

.ce2-row.is-self .ce2-reply-quote-name {
  color: #e8dcc4;
}

.ce2-reply-quote-text {
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0.68;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ce2-bubble--has-reply > .ce2-msg-text,
.ce2-bubble--has-reply > .ce2-msg-caption {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ce2-row.is-self .ce2-bubble--has-reply > .ce2-msg-text,
.ce2-row.is-self .ce2-bubble--has-reply > .ce2-msg-caption {
  border-top-color: rgba(0, 0, 0, 0.18);
}

.ce2-bubble--has-reply > .ce2-msg-image,
.ce2-bubble--has-reply > .ce2-msg-video,
.ce2-bubble--has-reply > .ce2-msg-audio-wrap {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ce2-row.is-self .ce2-bubble--has-reply > .ce2-msg-image,
.ce2-row.is-self .ce2-bubble--has-reply > .ce2-msg-video,
.ce2-row.is-self .ce2-bubble--has-reply > .ce2-msg-audio-wrap {
  border-top-color: rgba(0, 0, 0, 0.18);
}

.ce2-msg-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.ce2-msg-strong {
  font-weight: 650;
}

.ce2-msg-em {
  font-style: italic;
}

.ce2-msg-under {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ce2-msg-strike {
  text-decoration: line-through;
  opacity: 0.78;
}

.ce2-msg-color--gold {
  color: #c9b892;
}

.ce2-msg-color--blue {
  color: #8eb9d8;
}

.ce2-msg-color--green {
  color: #8fbc8f;
}

.ce2-fmt-u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ce2-fmt-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.ce2-msg-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.ce2-emoji-section-label {
  grid-column: 1 / -1;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.45;
  color: #c9b892;
  padding: 4px 2px 0;
}

.ce2-drawer-style-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #a89f8c;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  touch-action: manipulation;
}

.ce2-drawer-style-btn strong,
.ce2-drawer-style-btn em {
  font-size: 0.88rem;
  color: inherit;
}

.ce2-drawer-style-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 2px;
}

.ce2-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
}

.ce2-color-swatch--sm {
  width: 24px;
  height: 24px;
}

.ce2-color-swatch--gold {
  background: #c9b892;
}

.ce2-color-swatch--blue {
  background: #8eb9d8;
}

.ce2-color-swatch--green {
  background: #8fbc8f;
}

.ce2-color-swatch:active,
.ce2-color-swatch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(201, 184, 146, 0.45);
}

.ce2-edit-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.ce2-edit-tool {
  width: 32px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #a89f8c;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  touch-action: manipulation;
}

.ce2-edit-tool-emoji {
  font-size: 1rem;
}

.ce2-edit-tool-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
}

.ce2-input-shell--edit {
  width: 100%;
  margin-bottom: 10px;
}

.ce2-input-shell--edit .ce2-edit-input {
  min-height: 72px;
  max-height: 160px;
}

.ce2-emoji-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.ce2-emoji-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #a89f8c;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  touch-action: manipulation;
}

.ce2-emoji-tab.is-active {
  border-color: rgba(201, 184, 146, 0.35);
  background: rgba(201, 184, 146, 0.12);
  color: #c9b892;
}

.ce2-emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  max-height: 32vh;
  overflow-y: auto;
  margin-bottom: 12px;
}

.ce2-emoji-btn {
  font-size: 1.45rem;
  width: 100%;
  aspect-ratio: 1;
  max-height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ce2-emoji-btn:active {
  background: rgba(201, 184, 146, 0.14);
  border-color: rgba(201, 184, 146, 0.3);
}

.ce2-msg-caption {
  margin: 6px 0 0;
  font-size: 0.82rem;
  opacity: 0.85;
}

.ce2-link {
  color: #c9b892;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ce2-link-external {
  color: #e8a87c;
}

.ce2-board-share {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(201, 184, 146, 0.12);
  border: 1px solid rgba(201, 184, 146, 0.35);
  color: inherit;
  text-decoration: none;
}

.ce2-board-share-thumb {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

.ce2-board-share-thumb-img {
  display: block;
  width: 100%;
  height: auto;
}

.ce2-board-share-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ce2-board-share-note {
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 4px;
}

.ce2-board-share-kicker {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
  color: #c9b892;
}

.ce2-board-share-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}

.ce2-board-share-excerpt {
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0.72;
}

.ce2-board-share-cta {
  font-size: 0.72rem;
  margin-top: 4px;
  opacity: 0.8;
  color: #c9b892;
}

.ce2-input-inline {
  flex: 1 1 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #121218;
  color: inherit;
  font-size: 0.8rem;
}

.ce2-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  opacity: 0.72;
}

.ce2-input-shell {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--ce2-composer-surface);
}

.ce2-input-shell:focus-within {
  border-color: rgba(201, 184, 146, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.ce2-input-mirror {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  color: inherit;
}

.ce2-input-mirror-ph {
  color: rgba(242, 240, 236, 0.38);
}

.ce2-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  resize: none;
  scroll-margin: 0;
  min-height: 38px;
  max-height: 132px;
  overflow-y: hidden;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--ce2-composer-surface);
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
}

.ce2-input--rich {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: #f2f0ec;
  -webkit-text-fill-color: transparent;
}

.ce2-input--rich::placeholder {
  color: transparent;
}

.ce2-input-shell .ce2-input--rich:focus {
  outline: none;
  border: none;
  background: transparent;
}

.ce2-input::placeholder {
  color: rgba(242, 240, 236, 0.38);
}

.ce2-input:focus {
  outline: none;
  border-color: rgba(201, 184, 146, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.ce2-btn {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ce2-btn-ghost {
  width: 100%;
  margin-top: 10px;
  background: transparent;
  color: #c9b892;
  font-size: 0.75rem;
}

.ce2-btn-send {
  flex-shrink: 0;
  align-self: flex-end;
  background: linear-gradient(165deg, #a89468 0%, #8a7650 100%);
  color: #0a0907;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(201, 184, 146, 0.25);
  min-width: 56px;
  height: var(--ce2-composer-control);
  border-radius: 12px;
  padding: 0 14px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ce2-btn-send:active:not(:disabled) {
  filter: brightness(0.92);
}

.ce2-btn-send:disabled {
  opacity: 0.4;
}

.ce2-composer .ce2-select {
  flex: 1;
  min-width: 120px;
  max-width: 200px;
}

.ce2-placeholder {
  text-align: center;
  opacity: 0.45;
  font-size: 0.85rem;
  padding: 24px 12px;
}

/* Sheets (info, react, edit, forward, templates, mention) */
.ce2-sheet {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.ce2-sheet:not([hidden]) {
  pointer-events: auto;
}

.ce2-sheet[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden;
}

.ce2-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  cursor: default;
}

.ce2-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px;
  margin-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  padding: 16px;
  border-radius: 14px;
  background: #16161c;
  border: 1px solid rgba(201, 184, 146, 0.22);
}

/* Edit sheet: compact panel, sits just above keyboard (inset from --ce2-keyboard-inset) */
.ce2-sheet--edit {
  align-items: flex-end;
  justify-content: center;
}

.ce2-sheet-panel-edit {
  display: flex;
  flex-direction: column;
  width: min(calc(100% - 24px), 26rem);
  height: auto;
  max-height: min(70vh, 380px);
  flex: 0 0 auto;
  overflow: hidden;
}

.ce2-sheet--edit.ce2-sheet--above-keyboard .ce2-sheet-panel-edit {
  margin-bottom: calc(12px + var(--ce2-edit-kb, 0px));
  max-height: min(
    340px,
    calc(100dvh - var(--ce2-edit-kb, 0px) - env(safe-area-inset-top, 0px) - 56px)
  );
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.5);
}

.ce2-edit-input {
  display: block;
  width: 100%;
  min-height: 4.5rem;
  max-height: 9rem;
  margin: 0 0 12px;
  resize: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 0 1 auto;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

.ce2-sheet-panel-edit .ce2-sheet-title {
  flex-shrink: 0;
}

.ce2-sheet-panel-edit .ce2-sheet-actions {
  flex-shrink: 0;
  margin-top: 0;
}

.ce2-sheet-panel-compact {
  max-height: none;
}

.ce2-sheet-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #e8dcc4;
}

.ce2-sheet-body {
  font-size: 0.85rem;
  color: rgba(232, 220, 196, 0.9);
}

.ce2-info-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
}

.ce2-info-dl dt {
  opacity: 0.55;
  font-size: 0.75rem;
}

.ce2-info-mono {
  font-size: 0.68rem;
  word-break: break-all;
}

.ce2-sheet-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.ce2-sheet-list {
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 12px;
}

.ce2-react-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

.ce2-react-btn {
  font-size: 1.6rem;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(201, 184, 146, 0.25);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.ce2-thread-search {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--ce2-chrome-pad-x);
  border-bottom: 1px solid var(--ce2-border-subtle);
  background: #0a0a0e;
}

.ce2-thread-search[hidden] {
  display: none !important;
}

.ce2-thread-search-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(201, 184, 146, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.85rem;
}

.ce2-thread-search-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #a89f8c;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}

.ce2-pinned-banner {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(201, 184, 146, 0.3);
  background: rgba(201, 184, 146, 0.1);
  color: #e8dcc4;
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.ce2-msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.ce2-msg-reaction {
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.ce2-formation-tag {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(201, 184, 146, 0.15);
  color: #c9b892;
}

.ce2-forward-quote {
  font-size: 0.72rem;
  opacity: 0.55;
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 2px solid rgba(201, 184, 146, 0.32);
}

.ce2-msg-edited {
  opacity: var(--ce2-meta-opacity);
  font-size: 0.62rem;
}

.ce2-msg-star {
  color: #e8c87c;
}

.ce2-row.is-search-hit .ce2-bubble {
  box-shadow: 0 0 0 2px rgba(232, 200, 124, 0.55);
}

.ce2-attach-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px 4px;
}

.ce2-attach-cell {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.ce2-attach-thumb-img,
.ce2-attach-thumb-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ce2-attach-thumb-aud {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.5rem;
}

.ce2-attach-cell-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.ce2-attach-cell-uploading .ce2-attach-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.75rem;
  font-weight: 600;
}

.ce2-attach-queue-hint {
  margin: 0;
  padding: 0 12px 4px;
  font-size: 0.72rem;
  opacity: 0.55;
}

.ce2-attach-preview-actions {
  display: flex;
  gap: 10px;
  padding: 4px 12px 10px;
}

.ce2-attach-preview-actions .ce2-attach-clear,
.ce2-attach-preview-actions .ce2-attach-cancel {
  width: auto;
  margin: 0;
  font-size: 0.72rem;
  padding: 6px 12px;
}

.ce2-offline-bar {
  padding: 8px 12px;
  font-size: 0.78rem;
  text-align: center;
  background: rgba(180, 60, 40, 0.2);
  color: #f5d0c8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ce2-push-nudge {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0));
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1a1a1f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.ce2-push-nudge .ce2-push-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  font-size: 1.1rem;
  cursor: pointer;
}

.ce2-row.is-highlighted .ce2-bubble {
  outline: 2px solid rgba(200, 170, 120, 0.85);
  outline-offset: 2px;
}

.ce2-nudge-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(201, 184, 146, 0.12);
  border: 1px solid rgba(201, 184, 146, 0.28);
  font-size: 0.8rem;
  line-height: 1.35;
}

.ce2-nudge-banner .ce2-nudge-x {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  font-size: 1.1rem;
  cursor: pointer;
}
