/**
 * Circles product layout — MOBILE FIRST messaging UX.
 * Loaded after social-platform.css; overrides legacy feed-style chat rules.
 */

/* ── Chrome height (set by JS from ticker + nav) ── */
:root {
  --circles-chrome-top: 96px;
  --fa-app-top-height: var(--circles-chrome-top);
}

/* ── App shell: no footer / bottom nav in Circles chat only ── */
body.circles-shell-page.is-circle-chat-active .app-main {
  padding-bottom: 0 !important;
  overflow: hidden;
}

@media (max-width: 767px) {
  body.circles-shell-page.is-circle-chat-active .app-main {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

body.circles-shell-page .footer--slim,
body.circles-shell-page.is-circle-chat-active .footer--slim,
body.circles-shell-page .footer {
  display: none !important;
}

body.circles-shell-page.is-circle-chat-active .mobile-bottom-nav,
body.is-circle-chat-active .mobile-bottom-nav {
  display: none !important;
}

body.is-circle-chat-active {
  overflow: hidden;
}

body.is-circle-chat-active .app-main {
  overflow: hidden;
}

/* ── Master shell ── */
.circles-desktop-shell {
  width: 100%;
  min-height: 0;
}

.circles-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  background: var(--navy, #0a1628);
}

@media (max-width: 767px) {
  .circles-desktop-shell {
    height: calc(100dvh - var(--circles-chrome-top, 96px));
    max-height: calc(100dvh - var(--circles-chrome-top, 96px));
    overflow: hidden;
  }

  /* Inside app-main (below ticker): fill parent — avoid 100dvh double-count */
  body.circles-has-active .circles-desktop-shell {
    height: 100%;
    max-height: 100%;
    flex: 1 1 0%;
    min-height: 0;
  }

  body.circles-has-active .circles-app {
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }

  .circles-app {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }
}

@media (min-width: 768px) {
  body.circles-shell-page .app-main {
    overflow: hidden;
    height: calc(100dvh - var(--circles-chrome-top, 96px));
    max-height: calc(100dvh - var(--circles-chrome-top, 96px));
  }

  /* Match .sf-feed-layout gutters (Fandom / feed pages) */
  .circles-desktop-shell {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px clamp(16px, 3vw, 28px) 20px;
    height: 100%;
    box-sizing: border-box;
  }

  .circles-app {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: clamp(20px, 2.5vw, 32px);
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    background: transparent;
    flex-direction: unset;
  }

  body.circles-has-active .circles-app {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .circles-panel-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
  }
}

.circles-inbox-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 16px;
}

.circles-inbox-skeleton-row {
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: circles-inbox-shimmer 1.1s ease-in-out infinite;
}

.circles-inbox-static .circles-inbox-create[disabled],
.circles-inbox-static .sf-circle-global-search-input[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.circles-chat-boot {
  padding: 16px;
  min-height: 120px;
}

@keyframes circles-inbox-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Sidebar / inbox ── */
.circles-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--navy, #0a1628);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 767px) {
  .circles-sidebar {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-right: none;
    background: var(--navy, #0a1628);
    border-radius: 0;
  }

  body.circles-has-active .circles-sidebar {
    display: none;
  }
}

@media (min-width: 768px) {
  .circles-sidebar {
    width: auto;
    flex-shrink: unset;
    height: 100%;
    border-right: none;
    background: transparent;
  }

  .circles-sidebar.circles-panel-card {
    background: rgba(255, 255, 255, 0.03);
  }

  .circles-sidebar-inbox {
    background: transparent;
  }
}

.circles-sidebar-inbox {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.circles-inbox-head {
  flex-shrink: 0;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.circles-inbox-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.circles-inbox-title {
  margin: 0;
  font-family: var(--font-display, 'Barlow Condensed', sans-serif);
  font-size: clamp(22px, 4vw, 26px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--white, #fff);
}

.circles-inbox-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(160, 174, 192, 0.92);
  line-height: 1.35;
}

.circles-inbox-head-text {
  flex: 1;
  min-width: 0;
}

.circles-inbox-create {
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 2px;
  font-size: 12px;
  padding: 6px 10px;
  min-height: 32px;
  border: 1px solid rgba(0, 194, 203, 0.35);
}

.circles-inbox-sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.circles-inbox-sticky .sf-circle-global-search {
  padding: 10px 12px 6px;
}

.circles-inbox-sticky .sf-circle-page-tabs {
  padding-bottom: 0;
  margin-bottom: 0;
}

.circles-inbox-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.circles-sidebar-inbox .sf-circle-mine-panel,
.circles-sidebar-inbox .sf-circle-discover-panel,
.circles-sidebar-inbox .sf-circle-search-panel,
.circles-sidebar-inbox .sf-circle-requests-panel {
  flex: 1;
  min-height: 0;
}

.circles-sidebar-inbox .sf-circle-inbox {
  max-width: none;
  margin: 0;
}

.circles-sidebar-inbox .sf-circle-page-tabs {
  display: flex;
  gap: 0;
  padding: 0 10px;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.circles-sidebar-inbox .sf-circle-page-tab {
  flex: 1;
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: rgba(160, 174, 192, 0.95);
  margin-bottom: -1px;
  cursor: pointer;
}

.circles-sidebar-inbox .sf-circle-page-tab.is-active {
  color: var(--white, #fff);
  border-bottom-color: var(--teal, #00c2cb);
}

.circles-sidebar-inbox .sf-circle-global-search {
  padding: 0;
  margin: 0;
}

.circles-sidebar-inbox .sf-circle-global-search-input {
  width: 100%;
  font-size: 16px;
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 768px) {
  .circles-inbox-head {
    padding: 12px 14px 10px;
    background: transparent;
  }

  .circles-inbox-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--white, #fff);
    position: relative;
    padding-left: 10px;
  }

  .circles-inbox-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1px;
    bottom: 1px;
    width: 3px;
    border-radius: 2px;
    background: var(--teal, #00C2CB);
  }

  .circles-inbox-sub {
    display: none;
  }

  .circles-inbox-create {
    font-size: 11px;
    padding: 5px 9px;
    min-height: 28px;
  }

  .circles-sidebar-inbox .sf-circle-page-tab {
    font-size: 12px;
    padding: 8px 4px;
  }

  .circles-sidebar-inbox .sf-circle-global-search-input {
    font-size: 13px;
    padding: 8px 10px;
  }

  .circles-sidebar-inbox .sf-circle-global-search {
    padding: 8px 12px 6px;
  }
}

.sf-circle-inbox-avatar-wrap,
.sf-circle-inbox-avatar-wrap .sf-circle-inbox-avatar,
.sf-circle-inbox-avatar-wrap img {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 194, 203, 0.12);
  color: var(--teal, #00c2cb);
  font-weight: 700;
  font-size: 1.125rem;
}

.sf-circle-inbox-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.sf-circle-inbox-badge--private {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(224, 224, 224, 0.85);
}

.sf-circle-inbox-badge--public {
  background: rgba(0, 194, 203, 0.15);
  color: var(--teal, #00c2cb);
}

.sf-circle-inbox-meta-dot {
  opacity: 0.5;
  margin: 0 0.2rem;
}

.sf-circle-inbox-empty {
  padding: 1.5rem 1rem 2rem;
  text-align: center;
}

.sf-circle-inbox-empty-cta {
  margin-top: 0.5rem;
}

/* Discover inbox rows */
.sf-circle-discover-inbox-list {
  display: flex;
  flex-direction: column;
}

.sf-circle-discover-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sf-circle-discover-row-avatar,
.sf-circle-discover-row-avatar img,
.sf-circle-discover-row-avatar span {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.sf-circle-discover-row-body {
  flex: 1;
  min-width: 0;
}

.sf-circle-discover-row-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.15rem;
}

.sf-circle-discover-row-desc {
  display: block;
  font-size: 0.8125rem;
  color: rgba(160, 174, 192, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}

.sf-circle-discover-row-desc--muted {
  font-style: italic;
  opacity: 0.75;
}

.sf-circle-discover-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.6875rem;
  color: rgba(136, 146, 164, 0.95);
}

.sf-circle-discover-suggestions {
  padding: 1rem 0.85rem 1.5rem;
}

.sf-circle-discover-suggestions-title {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
}

.sf-circle-discover-suggestions-lead {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--muted, #a0aec0);
  line-height: 1.45;
}

.sf-circle-suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sf-circle-suggestion-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(224, 224, 224, 0.92);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.sf-circle-suggestion-chip:hover {
  border-color: rgba(0, 194, 203, 0.35);
  color: var(--teal, #00c2cb);
}

.sf-circle-discover-toolbar {
  padding: 0.35rem 0.75rem 0.5rem !important;
}

.sf-circle-filter-chips {
  margin-bottom: 0 !important;
  gap: 0.35rem !important;
}

.sf-circle-filter-chip {
  padding: 0.35rem 0.65rem !important;
  font-size: 0.6875rem !important;
}

/* Requests */
.sf-circle-requests-empty {
  padding: 2rem 1rem;
  text-align: center;
}

.sf-circle-requests-empty-title {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
}

.sf-circle-requests-empty-lead {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted, #a0aec0);
}

.sf-circle-requests-section {
  padding: 0.5rem 0;
}

.sf-circle-requests-heading {
  margin: 0;
  padding: 0.5rem 0.85rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(136, 146, 164, 0.95);
}

.sf-circle-request-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sf-circle-request-body {
  flex: 1;
  min-width: 0;
}

.sf-circle-request-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
}

.sf-circle-request-meta,
.sf-circle-request-msg {
  display: block;
  font-size: 0.75rem;
  color: var(--muted, #a0aec0);
}

.sf-circle-request-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Inbox rows — WhatsApp style */
.sf-circle-inbox-list {
  display: flex;
  flex-direction: column;
}

.sf-circle-inbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  box-sizing: border-box;
}

.sf-circle-inbox-row:hover,
.sf-circle-inbox-row:focus-visible {
  background: rgba(255, 255, 255, 0.03);
}

.sf-circle-inbox-row:active {
  background: rgba(255, 255, 255, 0.05);
}

.sf-circle-inbox-row.is-active {
  background: rgba(0, 194, 203, 0.07);
  border-left-color: var(--teal, #00C2CB);
}

@media (min-width: 768px) {
  .circles-sidebar-inbox .sf-circle-inbox-row {
    padding: 10px 12px 10px 10px;
    margin: 1px 8px;
    width: calc(100% - 16px);
    border-bottom: none;
    border-radius: 8px;
  }

  .circles-sidebar-inbox .sf-circle-inbox-row.is-active {
    background: rgba(0, 194, 203, 0.1);
    border-left-color: var(--teal, #00C2CB);
  }

  .circles-sidebar-inbox .sf-circle-inbox-avatar-wrap,
  .circles-sidebar-inbox .sf-circle-inbox-avatar-wrap .sf-circle-inbox-avatar,
  .circles-sidebar-inbox .sf-circle-inbox-avatar-wrap img {
    width: 42px;
    height: 42px;
    font-size: 0.9375rem;
  }

  .circles-sidebar-inbox .sf-circle-inbox-name {
    font-size: 14px;
  }

  .circles-sidebar-inbox .sf-circle-inbox-preview {
    font-size: 12px;
  }

  .circles-sidebar-inbox .sf-circle-inbox-meta {
    font-size: 11px;
    margin-top: 2px;
  }

  .circles-sidebar-inbox .sf-circle-inbox-badge {
    background: transparent;
    padding: 0;
    font-weight: 500;
    letter-spacing: 0.02em;
  }

  .circles-sidebar-inbox .sf-circle-inbox-badge--private {
    color: rgba(160, 174, 192, 0.85);
  }

  .circles-sidebar-inbox .sf-circle-inbox-badge--public {
    color: var(--teal, #00c2cb);
  }
}

.sf-circle-inbox-row.is-unread .sf-circle-inbox-name,
.sf-circle-inbox-row.is-unread .sf-circle-inbox-preview {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
}

.sf-circle-inbox-row.is-unread .sf-circle-inbox-preview {
  color: rgba(255, 255, 255, 0.82);
}

.sf-circle-inbox-avatar,
.sf-circle-inbox-avatar img {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.sf-circle-inbox-body {
  flex: 1;
  min-width: 0;
}

.sf-circle-inbox-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.sf-circle-inbox-name {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-circle-inbox-time {
  font-size: 0.6875rem;
  color: rgba(160, 174, 192, 0.9);
}

.sf-circle-inbox-preview {
  font-size: 0.875rem;
  color: rgba(160, 174, 192, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sf-circle-inbox-meta {
  font-size: 0.6875rem;
  color: rgba(136, 146, 164, 0.95);
  margin-top: 0.15rem;
}

.sf-circle-inbox-unread {
  flex-shrink: 0;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--teal, #00c2cb);
  color: var(--navy, #0a1628);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}

.sf-circle-inbox-empty {
  padding: 2rem 1.25rem;
  text-align: center;
}

.sf-circle-inbox-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem;
}

.sf-circle-inbox-empty-copy {
  font-size: 0.875rem;
  color: var(--muted, #a0aec0);
  margin: 0 0 1rem;
  line-height: 1.45;
}

/* ── Guest / signed-out prompts ── */
.circles-guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(24px, 4vw, 40px) clamp(16px, 3vw, 28px);
  min-height: min(100%, 420px);
  box-sizing: border-box;
}

.circles-guest--sidebar {
  min-height: 280px;
  padding: 28px 20px 32px;
  justify-content: flex-start;
  padding-top: 48px;
}

.circles-guest--rail {
  min-height: 0;
  padding: 20px 16px 24px;
  align-items: stretch;
  text-align: left;
}

.circles-guest--main,
.circles-main-guest {
  flex: 1;
  min-height: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.02);
}

.circles-guest-visual {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 194, 203, 0.1);
  border: 1px solid rgba(0, 194, 203, 0.22);
}

.circles-guest--rail .circles-guest-visual {
  display: none;
}

.circles-guest-icon {
  width: 28px;
  height: 28px;
  color: var(--teal, #00c2cb);
}

.circles-guest-title {
  margin: 0 0 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1.2;
}

.circles-guest--rail .circles-guest-title {
  font-size: 15px;
  margin-bottom: 8px;
}

.circles-guest-lead {
  margin: 0 0 18px;
  max-width: 36ch;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.68);
}

.circles-guest--sidebar .circles-guest-lead,
.circles-guest--rail .circles-guest-lead {
  max-width: none;
  font-size: 13px;
  margin-bottom: 16px;
}

.circles-guest-features {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  max-width: 38ch;
  text-align: left;
}

.circles-guest-features li {
  position: relative;
  padding: 0 0 10px 18px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.circles-guest-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal, #00c2cb);
}

.circles-guest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
  max-width: 320px;
}

.circles-guest--rail .circles-guest-actions {
  flex-direction: column;
  max-width: none;
}

.circles-guest--rail .circles-guest-actions .btn {
  width: 100%;
}

.circles-guest-note {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.45);
  max-width: 32ch;
}

.circles-guest--rail .circles-guest-note {
  display: none;
}

@media (max-width: 767px) {
  .circles-guest--main {
    padding-bottom: calc(24px + var(--mobile-bottom-dock-h, 50px) + env(safe-area-inset-bottom, 0px));
  }

  body.circles-has-active .circles-info-rail .circles-guest--rail {
    display: none;
  }
}

/* ── Main panel ── */
.circles-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: #0d1a2d;
}

@media (max-width: 767px) {
  .circles-main {
    display: none;
    background: #0d1a2d;
    border-radius: 0;
  }

  body.circles-has-active .circles-main {
    display: flex;
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    position: relative;
    inset: auto;
    z-index: auto;
    padding-top: 0;
  }
}

@media (min-width: 768px) {
  .circles-main {
    flex: unset;
    height: 100%;
    border-right: none;
    background: transparent;
  }

  .circles-chat-panel {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: transparent !important;
  }

  .circles-main-empty {
    background: transparent;
  }

  .circles-main-empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.2);
  }
}

.circles-main-empty {
  display: none;
}

@media (min-width: 768px) {
  .circles-main-empty {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
  }
}

.circles-main-empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
}

.circles-main-empty-lead {
  margin: 0;
  max-width: 280px;
  font-size: 0.875rem;
  color: var(--muted, #a0aec0);
}

/* ── Desktop info rail ── */
.circles-info-rail {
  display: none;
}

@media (min-width: 1024px) {
  body.circles-has-active .circles-app {
    grid-template-columns: 260px minmax(0, 1fr) 280px;
  }

  .circles-info-rail {
    display: flex;
    flex-direction: column;
    width: auto;
    flex-shrink: unset;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: transparent;
  }

  /* Match inbox | main divider — visible edge between chat and info rail */
  body.circles-info-rail-active .circles-main.circles-panel-card {
    border-right: 1px solid rgba(255, 255, 255, 0.07);
  }

  body.circles-info-rail-active .circles-info-rail.circles-panel-card {
    border-left: 1px solid rgba(255, 255, 255, 0.07);
  }

  body.circles-has-active .circles-info-rail {
    display: flex;
  }

  body.circles-has-active .cc-chat-header-info {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .circles-info-rail {
    display: none !important;
  }
}

.circles-info-rail-inner {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
}

@media (max-width: 767px) {
  .circles-info-rail-inner {
    padding: 1rem;
  }
}

.circles-info-rail-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.circles-rail-quick {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.circles-rail-quick-link {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.circles-rail-quick-link:hover {
  color: var(--teal, #00c2cb);
  text-decoration: none;
}

.circles-rail-quick-link.is-active {
  background: rgba(0, 194, 203, 0.12);
  color: var(--teal, #00c2cb);
}

.circles-rail-here {
  font-size: 12px;
  font-weight: 600;
  color: rgba(160, 174, 192, 0.9);
}

.circles-rail-nav-link.is-active {
  color: var(--teal, #00c2cb);
}

.circles-rail-card {
  padding: 12px !important;
  margin: 0;
}

.circles-rail-card .fa-card-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
}

.circles-rail-card-body {
  min-width: 0;
}

.circles-rail-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.circles-rail-loading {
  padding: 16px;
  font-size: 13px;
}

.circles-rail-skel {
  height: 88px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: circles-inbox-shimmer 1.1s ease-in-out infinite;
}

.circles-rail-skel--nav {
  height: 40px;
}

.circles-rail-skel--short {
  height: 64px;
}

.circles-info-rail-title {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #8892a4);
}

.circles-info-rail-link {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--teal, #00c2cb);
}

.circles-info-rail-link:hover {
  opacity: 0.88;
  text-decoration: none;
}

.circles-info-rail-link {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.circles-rail-hero {
  text-align: center;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.circles-rail-hero--compact {
  text-align: left;
}

.circles-rail-hero--compact .circles-rail-avatar,
.circles-rail-hero--compact .circles-rail-avatar img,
.circles-rail-hero--compact .circles-rail-avatar span {
  width: 48px;
  height: 48px;
  margin: 0 0 8px;
}

.circles-rail-avatar,
.circles-rail-avatar img,
.circles-rail-avatar span {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  background: rgba(0, 194, 203, 0.12);
  font-weight: 700;
  color: var(--teal, #00c2cb);
}

.circles-rail-name {
  margin: 0 0 0.25rem;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.circles-rail-meta,
.circles-rail-desc {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.45;
}

.circles-rail-desc {
  margin-top: 6px;
}

.circles-rail-section {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.circles-rail-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(136, 146, 164, 0.95);
}

.circles-rail-members,
.circles-rail-shared {
  list-style: none;
  margin: 0;
  padding: 0;
}

.circles-rail-member {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.circles-rail-member-body {
  min-width: 0;
}

.circles-rail-member__ava {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 194, 203, 0.12);
  border: 1px solid rgba(0, 194, 203, 0.2);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.circles-rail-member__ava--img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.circles-rail-member__ava--brand {
  object-fit: cover;
  border-radius: 8px;
  background: #0a1628;
}

.circles-rail-member-user {
  display: block;
  font-size: 11px;
  color: rgba(160, 174, 192, 0.9);
}

a.circles-rail-member-name {
  display: block;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  text-decoration: none;
}

a.circles-rail-member-name:hover {
  color: var(--teal, #00c2cb);
  text-decoration: none;
}

.circles-rail-member:last-child {
  border-bottom: none;
}

.circles-rail-member-name {
  color: rgba(255, 255, 255, 0.88);
}

.circles-rail-member-role {
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.circles-rail-shared-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.circles-rail-shared-item:last-child {
  border-bottom: none;
}

.circles-rail-shared-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.circles-rail-shared-link:hover {
  color: var(--teal, #00C2CB);
  text-decoration: none;
}

.circles-rail-shared-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.circles-rail-shared-sub {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
  text-transform: capitalize;
}

.circles-rail-admin-nav {
  margin: 0;
}

.circles-rail-nav-btn,
.circles-rail-nav-link {
  display: block;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border: none;
  background: none;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.circles-rail-nav-btn:hover,
.circles-rail-nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--teal, #00C2CB);
  text-decoration: none;
}

.circles-rail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.circles-rail-empty {
  font-size: 0.8125rem;
  margin: 0 0 0.35rem;
}

.circles-rail-lb .fp-rank-list--compact {
  margin: 0;
}

/* System messages */
.sf-circle-chat-system {
  display: flex;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  margin: 0.25rem 0;
}

.sf-circle-chat-system-text {
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(160, 174, 192, 0.95);
  text-align: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

/* Share modal entity preview */
.sf-share-circle-entity-card {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  margin: 0.5rem 0 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.sf-share-circle-entity-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.sf-share-circle-entity-type {
  display: block;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal, #00c2cb);
}

.sf-share-circle-entity-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
}

.sf-share-circle-entity-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted, #a0aec0);
}


/* ══════════════════════════════════════
   MOBILE CHAT PAGE — flex column shell
   ══════════════════════════════════════ */
.circle-chat-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #0d1a2d;
}

.sf-page--circle-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  max-width: none !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

.sf-circle-detail-chrome {
  flex: 0 0 auto;
}

.sf-circle-stream-mount {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sf-circle-chat-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Override legacy max-height cap — critical for mobile */
.circles-shell-page .sf-circle-chat,
.circles-shell-page .sf-circle-chat.circle-chat-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  gap: 0;
}

.circles-shell-page .sf-circle-chat-scroll {
  flex: 1 1 0%;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.65rem 0.75rem 0.5rem;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
}

.circles-shell-page .sf-circle-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 0 0.25rem;
  margin-top: auto;
  flex-shrink: 0;
}

.circles-shell-page .sf-circle-chat-scroll-spacer {
  flex-shrink: 0;
  height: 0;
  min-height: 0;
}

/* Mobile: flex column chat — composer in flow, NOT fixed overlay */
@media (max-width: 767px) {
  html.is-circle-chat-active body.circles-shell-page {
    overflow: hidden;
    touch-action: auto;
  }

  body.circles-shell-page.is-circle-chat-active .circles-app {
    flex: 1 1 0%;
    min-height: 0;
    height: calc(100dvh - var(--circles-chrome-top, 96px));
    max-height: calc(100dvh - var(--circles-chrome-top, 96px));
  }

  body.circles-shell-page.is-circle-chat-active .circles-main,
  body.circles-shell-page.is-circle-chat-active .circle-chat-page,
  body.circles-shell-page.is-circle-chat-active .sf-page--circle-detail,
  body.circles-shell-page.is-circle-chat-active .sf-circle-stream-mount,
  body.circles-shell-page.is-circle-chat-active .sf-circle-chat-root,
  body.circles-shell-page.is-circle-chat-active .sf-circle-chat,
  body.circles-shell-page.is-circle-chat-active .circle-chat-shell {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.circles-shell-page.is-circle-chat-active .sf-circle-chat-scroll {
    flex: 1 1 0%;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-bottom: 0.5rem !important;
  }

  body.circles-shell-page.is-circle-chat-active .circle-chat-composer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 0 0 auto !important;
    z-index: auto;
  }

  body.circles-shell-page.is-circle-chat-active .sf-page--circle-detail {
    position: relative !important;
    top: auto !important;
    inset: auto !important;
  }

  body.circles-shell-page.is-circle-chat-active .sf-circle-stream-mount {
    padding: 0 !important;
  }
}

.sf-circle-chat-scroll-spacer {
  flex-shrink: 0;
  height: 0;
  pointer-events: none;
}

/* ── Chat header ── */
.cc-chat-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem 0.45rem 0.35rem;
  min-height: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 22, 40, 0.98);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .cc-chat-header {
    padding: 10px 14px;
    min-height: 52px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .cc-chat-header-name {
    font-size: 15px;
  }

  .cc-chat-header-sub {
    font-size: 11px;
  }
}

.cc-chat-header-tap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.35rem;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}

.cc-chat-header-tap:hover,
.cc-chat-header-tap:focus-visible {
  background: rgba(255, 255, 255, 0.04);
}

.cc-chat-header-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 194, 203, 0.12);
}

.cc-chat-header-avatar-img,
.cc-chat-header-avatar-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--teal, #00c2cb);
}

.cc-chat-header-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cc-chat-header-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--teal, #00c2cb);
  cursor: pointer;
  flex-shrink: 0;
}

.cc-chat-header-back:hover,
.cc-chat-header-back:focus-visible {
  background: rgba(255, 255, 255, 0.05);
}

@media (min-width: 768px) {
  body.circles-shell-page .cc-chat-header-back {
    display: none;
  }
}

.cc-chat-header-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}

.cc-chat-header-avatar img,
.cc-chat-header-avatar .sf-circle-avatar-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cc-chat-header-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-chat-header-sub {
  margin: 0;
  font-size: 0.6875rem;
  color: rgba(136, 146, 164, 0.95);
}

.cc-chat-header-info {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(224, 224, 224, 0.9);
  cursor: pointer;
  text-decoration: none;
}

.cc-chat-header-info:hover,
.cc-chat-header-info:focus-visible {
  color: var(--teal, #00c2cb);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

/* ══════════════════════════════════════
   MESSAGE BUBBLES
   ══════════════════════════════════════ */
.circles-shell-page .sf-circle-chat-msg.is-self {
  margin-left: auto;
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 76%;
  width: fit-content;
}

@media (min-width: 768px) {
  .circles-shell-page .sf-circle-chat-msg,
  .circles-shell-page .sf-circle-chat-msg.is-self {
    max-width: min(62%, 420px);
    margin-bottom: 2px;
  }

  .circles-shell-page .sf-circle-chat-messages {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: auto;
  }

  .circles-shell-page .sf-circle-chat-scroll {
    padding: 12px 16px 8px;
  }

  .circles-shell-page .sf-circle-chat-bubble {
    font-size: 14px;
    padding: 8px 12px;
  }

  .circles-shell-page .circle-chat-composer {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
  }
}

.circles-shell-page .sf-circle-chat-msg.is-grouped .sf-circle-chat-avatar {
  width: 26px;
  flex-shrink: 0;
}

.circles-shell-page .sf-circle-chat-text {
  font-size: 15px;
  line-height: 1.38;
  margin: 0;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: pre-wrap;
}

.circles-shell-page .sf-circle-chat-meta {
  margin-bottom: 0.15rem;
  font-size: 0.6875rem;
}

.circles-shell-page .sf-circle-chat-name {
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(0, 194, 203, 0.85);
  text-decoration: none;
}

.circles-shell-page .sf-circle-chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  max-width: 76%;
  width: fit-content;
  align-self: flex-start;
  margin-bottom: 0.1rem;
}

@media (min-width: 768px) {
  .circles-shell-page .sf-circle-chat-msg:not(.is-self) {
    max-width: min(62%, 420px);
  }
}

.circles-shell-page .sf-circle-chat-bubble-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.circles-shell-page .sf-circle-chat-msg.is-self .sf-circle-chat-bubble-col {
  align-items: flex-end;
}

.circles-shell-page .sf-circle-chat-time-outside {
  margin-top: 0.15rem;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.32);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.circles-shell-page .sf-circle-chat-msg.is-self .sf-circle-chat-time-outside {
  justify-content: flex-end;
}

.circles-shell-page .sf-circle-chat-receipt {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1;
}

.circles-shell-page .sf-circle-chat-receipt.is-delivered,
.circles-shell-page .sf-circle-chat-receipt.is-partial {
  color: rgba(255, 255, 255, 0.48);
}

.circles-shell-page .sf-circle-chat-receipt.is-read {
  color: var(--teal, #00C2CB);
}

.circles-shell-page .sf-circle-chat-receipt--pending,
.circles-shell-page .sf-circle-chat-receipt--failed {
  font-size: 0.625rem;
  font-weight: 700;
}

.circles-shell-page .sf-circle-chat-receipt-icon {
  display: block;
}

.circles-shell-page .sf-circle-chat-seen-wrap {
  margin-top: 0.1rem;
  padding: 0 0.25rem;
  text-align: right;
}

.circles-shell-page .sf-circle-chat-seen {
  font-size: 0.625rem;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.36);
}

.circles-shell-page .sf-circle-chat-unread-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.65rem 0;
  pointer-events: none;
}

.circles-shell-page .sf-circle-chat-unread-divider span {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(0, 194, 203, 0.22);
  border: 1px solid rgba(0, 194, 203, 0.35);
}

.circles-shell-page .sf-circle-chat-time-outside .sf-circle-chat-time {
  font-size: inherit;
  color: inherit;
  text-decoration: none;
  border: none;
  background: none;
}

.circles-shell-page .sf-circle-chat-time-foot {
  display: none !important;
}

.circles-shell-page .sf-circle-chat-bubble {
  width: fit-content;
  max-width: 100%;
  min-width: min(2.75rem, 100%);
  padding: 0.5rem 0.8rem;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.38;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(30, 41, 59, 0.9);
  box-shadow: none;
}

.circles-shell-page .sf-circle-chat-msg.is-self .sf-circle-chat-bubble {
  background: rgba(0, 100, 108, 0.55);
  border-color: rgba(0, 194, 203, 0.22);
}

.circles-shell-page .sf-circle-chat-msg.is-grouped {
  margin-top: -0.2rem;
}

.circles-shell-page .sf-circle-chat-msg.is-grouped .sf-circle-chat-bubble {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.circles-shell-page .sf-circle-chat-date {
  text-align: center;
  font-size: 0.6875rem;
  color: rgba(160, 174, 192, 0.8);
  padding: 0.45rem 0;
  margin: 0.15rem 0;
}

.circles-shell-page .sf-avatar--chat {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

/* ══════════════════════════════════════
   COMPOSER — WhatsApp style
   ══════════════════════════════════════ */
.circles-shell-page .circle-chat-composer {
  flex: 0 0 auto;
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  z-index: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 22, 40, 0.98);
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 4px);
}

.circles-shell-page .sf-circle-chat-form,
.circles-shell-page .circle-chat-composer-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: none;
  background: transparent;
}

.circles-shell-page .sf-circle-chat-attach {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(224, 224, 224, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circles-shell-page .sf-circle-chat-input-wrap {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.circles-shell-page .sf-circle-chat-input,
.circles-shell-page .sf-circle-chat-input.fa-textarea {
  width: 100%;
  min-height: 40px;
  max-height: 120px;
  padding: 0.55rem 0.875rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
  box-shadow: none;
  resize: none;
}

.circles-shell-page .sf-circle-chat-input:focus {
  outline: none;
  border-color: rgba(0, 194, 203, 0.35);
  box-shadow: none;
}

.circles-shell-page .sf-circle-chat-send {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--teal, #00c2cb);
  color: var(--navy, #0a1628);
  border: none;
  flex-shrink: 0;
}

.circles-shell-page .sf-circle-chat-send:disabled {
  opacity: 0.35;
}

.circles-shell-page .sf-circle-chat-readonly {
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.875rem;
}

/* Circle Info page — see css/circle-info-page.css */

@media (max-width: 767px) {
  body.circles-shell-page.is-circle-chat-active .app-main,
  body.circles-shell-page.is-circle-chat-active .app-shell__content {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden !important;
    padding-bottom: 0 !important;
  }

  body.circles-shell-page.is-circle-chat-active .app-main > * {
    flex: 1 1 0%;
    min-height: 0;
  }
}

body.circles-shell-page.circles-inbox-active .sf-page--circles {
  padding: 0 !important;
}

@media (max-width: 767px) {
  html.is-circle-chat-active body.circles-shell-page {
    overflow: hidden;
  }

  body.circles-shell-page.is-circle-chat-active .circles-app {
    height: calc(100dvh - var(--circles-chrome-top, 96px));
  }

  body.circles-shell-page.is-circle-chat-active .circles-main {
    flex: 1 1 0%;
    min-height: 0;
  }

  body.circles-shell-page.is-circle-chat-active .circle-chat-page {
    flex: 1 1 0%;
    min-height: 0;
  }

  /* Fill viewport: composer flush to bottom, no dead nav padding */
  html.is-circle-chat-active .circles-desktop-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100% !important;
    max-height: 100% !important;
  }

  html.is-circle-chat-active body.circles-shell-page .circles-app,
  html.is-circle-chat-active body.circles-shell-page.is-circle-chat-active .circles-app {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }

  html.is-circle-chat-active body.circles-shell-page .circles-main {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
  }

  html.is-circle-chat-active body.circles-shell-page .sf-page--circle-detail,
  html.is-circle-chat-active body.circles-shell-page .circle-chat-page {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
  }

  html.is-circle-chat-active body.circles-shell-page .sf-circle-stream-mount,
  html.is-circle-chat-active body.circles-shell-page .sf-circle-chat-root,
  html.is-circle-chat-active body.circles-shell-page .sf-circle-chat,
  html.is-circle-chat-active body.circles-shell-page .circle-chat-shell {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
  }

  html.is-circle-chat-active body.circles-shell-page .circle-chat-composer {
    flex: 0 0 auto;
    margin-top: auto;
    width: 100%;
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 6px);
    background: rgba(10, 22, 40, 0.98);
  }
}

.sf-page--circles {
  max-width: none !important;
  margin: 0 !important;
}

/* Hide legacy toolbar chrome */
.sf-circle-toolbar--conversation .sf-circle-view-tabs,
.sf-circle-toolbar-manage,
.sf-circle-toolbar-settings {
  display: none !important;
}
