/* SmartVet Community + Webinars — matches brand #157E3D glass language */
:root {
  --cw-brand: #157E3D;
  --cw-brand-hover: #126b34;
  --cw-brand-50: #f0f9f4;
  --cw-text: #0f172a;
  --cw-muted: #64748b;
  --cw-border: rgba(21, 126, 61, 0.12);
  --cw-radius: 16px;
  --cw-shadow: 0 10px 28px rgba(15, 59, 35, 0.08);
}

.cw-body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--cw-text);
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(21, 126, 61, 0.06), transparent 55%),
    #f3f7f4;
  min-height: 100vh;
  /* Room for fixed SmartVet site navbar (landing/search chrome) */
  padding-top: 4.75rem;
}

/* In-page section tools — not a second site header */
.cw-subnav {
  margin: 0 0 1.15rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--cw-border);
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(15, 59, 35, 0.05);
}
.cw-subnav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  padding: 0.55rem 0.75rem;
}
.cw-subnav-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cw-brand);
  padding: 0.25rem 0.55rem 0.25rem 0.15rem;
  border-right: 1px solid var(--cw-border);
  margin-right: 0.15rem;
  white-space: nowrap;
}
.cw-subnav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
}
.cw-subnav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--cw-muted);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.cw-subnav-tab:hover {
  color: var(--cw-brand);
  background: var(--cw-brand-50);
}
.cw-subnav-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--cw-brand), #3daa6a);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(21, 126, 61, 0.22);
}
.cw-subnav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.cw-subnav-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cw-muted);
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  white-space: nowrap;
}
.cw-subnav-link:hover {
  color: var(--cw-brand);
  background: var(--cw-brand-50);
}
@media (max-width: 640px) {
  .cw-subnav-label {
    border-right: none;
    width: 100%;
    margin: 0;
    padding-bottom: 0.15rem;
  }
  .cw-subnav-actions {
    width: 100%;
    margin-left: 0;
    padding-top: 0.25rem;
    border-top: 1px solid var(--cw-border);
  }
}

.cw-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 1rem 3rem;
}

.cw-flash-wrap {
  max-width: 1120px;
  margin: 0 auto 0.5rem;
  padding: 0 1rem;
}
.cw-flash {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  background: var(--cw-brand-50);
  border: 1px solid var(--cw-border);
  color: var(--cw-brand-hover);
}
.cw-flash-error, .cw-flash-danger { background: #fef2f2; border-color: #fecdd3; color: #be123c; }
.cw-flash-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.cw-flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }

.cw-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .cw-grid { grid-template-columns: 1fr; }
}

.cw-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
}
.cw-card h1, .cw-card h2, .cw-card h3 { margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.cw-card h1 { font-size: 1.45rem; color: var(--cw-brand); }
.cw-card h2 { font-size: 1.1rem; }
.cw-muted { color: var(--cw-muted); font-size: 0.875rem; }

.cw-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 12px;
  padding: 0.55rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.15s ease;
}
.cw-btn:hover { transform: translateY(-1px); }
.cw-btn-primary {
  background: linear-gradient(135deg, var(--cw-brand), var(--cw-brand-hover));
  color: #fff;
  box-shadow: 0 6px 16px rgba(21, 126, 61, 0.22);
}
.cw-btn-outline {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--cw-border);
  color: var(--cw-text);
}
.cw-btn-ghost {
  background: transparent;
  color: var(--cw-muted);
  border-color: transparent;
}
.cw-btn-danger {
  background: #fef2f2;
  color: #be123c;
  border-color: #fecdd3;
}
.cw-btn-sm { padding: 0.35rem 0.65rem; font-size: 0.78rem; }

.cw-composer textarea,
.cw-form input,
.cw-form select,
.cw-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  margin-top: 0.3rem;
  margin-bottom: 0.75rem;
  background: #fff;
}
.cw-composer textarea:focus,
.cw-form input:focus,
.cw-form select:focus,
.cw-form textarea:focus {
  outline: none;
  border-color: var(--cw-brand);
  box-shadow: 0 0 0 3px rgba(21, 126, 61, 0.12);
}
.cw-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.cw-post-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.cw-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cw-brand), #3daa6a);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.cw-post-body { white-space: pre-wrap; line-height: 1.55; font-size: 0.95rem; }
.cw-post-title { font-weight: 700; margin-bottom: 0.35rem; font-size: 1.05rem; }
.cw-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--cw-border);
}
.cw-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cw-brand);
  background: var(--cw-brand-50);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin: 0.15rem 0.15rem 0 0;
}
.cw-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.cw-media-grid img,
.cw-media-grid video {
  width: 100%;
  border-radius: 12px;
  max-height: 200px;
  object-fit: cover;
  background: #e8f0ec;
}

.cw-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.cw-filters a {
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--cw-muted);
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--cw-border);
}
.cw-filters a.is-active {
  color: #fff;
  background: var(--cw-brand);
  border-color: var(--cw-brand);
}

.cw-pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.cw-webinar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.cw-webinar-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.cw-webinar-card .thumb {
  height: 140px;
  background: linear-gradient(135deg, #157E3D, #0f5a2c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.85);
  font-size: 2rem;
}
.cw-webinar-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cw-webinar-card .body { padding: 1rem 1.1rem 1.15rem; flex: 1; display: flex; flex-direction: column; }
.cw-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--cw-brand);
}
.cw-price-pill.is-free { background: #eff6ff; color: #1d4ed8; }

.cw-hero-band {
  border-radius: var(--cw-radius);
  padding: 1.5rem 1.35rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(120deg, #157E3D 0%, #0f5a2c 100%);
  color: #fff;
  box-shadow: 0 16px 36px rgba(21, 126, 61, 0.25);
}
.cw-hero-band h1 { margin: 0 0 0.4rem; font-size: 1.5rem; color: #fff; }
.cw-hero-band p { margin: 0; opacity: 0.92; font-size: 0.95rem; max-width: 36rem; }

/* Webinar host workspace — Hosts page only */
.cw-host-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.75rem 1.6rem;
  margin-bottom: 1.15rem;
  color: #fff;
  background:
    radial-gradient(ellipse 80% 90% at 100% 0%, rgba(255,255,255,0.14), transparent 50%),
    linear-gradient(125deg, #157E3D 0%, #0f5a2c 100%);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(21, 126, 61, 0.22);
}
.cw-host-hero-copy { min-width: 0; max-width: 34rem; }
.cw-host-hero h1 {
  margin: 0 0 0.4rem;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.cw-host-hero p { margin: 0; font-size: 0.94rem; line-height: 1.5; opacity: 0.92; }
.cw-host-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: #fff;
  color: #0f5a2c;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(8, 28, 18, 0.16);
}
.cw-host-hero-cta:hover { background: #f0f9f4; }
.cw-host-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(5.4rem, 1fr));
  gap: 0.55rem;
  flex-shrink: 0;
}
.cw-host-stats > div {
  min-width: 0;
  padding: 0.7rem 0.85rem;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 14px;
  background: rgba(255,255,255,0.12);
}
.cw-host-stats strong, .cw-host-stats span { display: block; }
.cw-host-stats strong { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.03em; }
.cw-host-stats span { margin-top: 0.15rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.88; }

.cw-host-edit-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: 1.15rem 1.25rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--cw-border);
  box-shadow: var(--cw-shadow);
}
.cw-host-edit-bar h1 { margin: 0.15rem 0 0.25rem; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--cw-text); }

.cw-host-list-card,
.cw-host-form-card {
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.15rem;
  border: 1px solid rgba(21,126,61,0.12);
  border-radius: 20px;
  background: rgba(255,255,255,0.9);
  box-shadow: var(--cw-shadow);
}
.cw-host-list-head,
.cw-host-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(21,126,61,0.08);
}
.cw-host-list-head h2,
.cw-host-form-head h2 { margin: 0 0 0.2rem; font-size: 1.12rem; letter-spacing: -0.02em; }
.cw-host-list-head p,
.cw-host-form-head p { margin: 0; }
.cw-host-review-note {
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.cw-host-list { display: flex; flex-direction: column; gap: 0.65rem; }
.cw-host-webinar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(21,126,61,0.1);
  border-radius: 14px;
  background: #fbfefc;
}
.cw-host-webinar-main { min-width: 0; flex: 1; }
.cw-host-webinar-title-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.cw-host-webinar-title-row h3 { margin: 0; font-size: 0.98rem; font-weight: 700; color: var(--cw-text); }
.cw-host-webinar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0.4rem 0 0;
  color: var(--cw-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}
.cw-host-state-copy, .cw-host-feedback { margin: 0.4rem 0 0; font-size: 0.8rem; line-height: 1.45; }
.cw-host-state-copy { color: #92400e; }
.cw-host-feedback {
  color: #9a3412;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: #fff7ed;
}
.cw-approval-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.cw-approval-pill.is-approved { background: #dcfce7; color: #166534; }
.cw-approval-pill.is-pending { background: #fef3c7; color: #92400e; }
.cw-approval-pill.is-rejected { background: #ffedd5; color: #c2410c; }
.cw-host-webinar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; flex-shrink: 0; }
.cw-host-empty {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.15rem 0.85rem;
  border-radius: 14px;
  background: #f8faf9;
  color: var(--cw-muted);
}
.cw-host-empty > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  color: var(--cw-brand);
  background: var(--cw-brand-50);
}
.cw-host-empty h3, .cw-host-empty p { margin: 0; }
.cw-host-empty h3 { color: var(--cw-text); font-size: 0.95rem; }
.cw-host-empty p { margin-top: 0.2rem; font-size: 0.82rem; line-height: 1.45; }

.cw-host-form { margin: 0; }
.cw-host-fieldset {
  margin: 0 0 1.15rem;
  padding: 1rem 1.05rem 0.35rem;
  border: 1px solid rgba(21,126,61,0.1);
  border-radius: 14px;
  background: #fbfefc;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.9rem;
}
.cw-host-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cw-brand);
}
.cw-host-field { min-width: 0; }
.cw-host-field-full { grid-column: 1 / -1; }
.cw-host-form .cw-host-field input,
.cw-host-form .cw-host-field select,
.cw-host-form .cw-host-field textarea {
  margin-bottom: 0.85rem;
}
.cw-req { color: #e11d48; }
.cw-host-checks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin: 0.15rem 0 0.95rem;
}
.cw-host-check {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  font-weight: 550;
  color: #334155;
  cursor: pointer;
}
.cw-host-check input {
  width: auto !important;
  margin: 0 !important;
  accent-color: var(--cw-brand);
}
.cw-host-form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-top: 0.25rem;
}
.cw-host-form-foot .cw-muted { margin: 0; max-width: 28rem; }

@media (max-width: 720px) {
  .cw-host-hero { align-items: stretch; flex-direction: column; padding: 1.3rem 1.15rem; }
  .cw-host-stats { grid-template-columns: repeat(2, 1fr); }
  .cw-host-list-card, .cw-host-form-card { padding: 1rem; }
  .cw-host-list-head, .cw-host-webinar-row, .cw-host-edit-bar, .cw-host-form-foot {
    align-items: flex-start;
    flex-direction: column;
  }
  .cw-host-webinar-actions { justify-content: flex-start; }
  .cw-host-fieldset { grid-template-columns: 1fr; padding: 0.85rem 0.85rem 0.2rem; }
}
.cw-hero-band-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: flex-end;
}
.cw-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
.cw-hero-stats {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.cw-stat-pill {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 0.55rem 0.85rem;
  min-width: 4.5rem;
  text-align: center;
}
.cw-stat-pill strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.1;
}
.cw-stat-pill span {
  font-size: 0.7rem;
  opacity: 0.9;
  font-weight: 600;
}

.cw-composer-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}
.cw-composer-head h2 { margin: 0; font-size: 1.05rem; }
.cw-composer-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
@media (max-width: 640px) {
  .cw-composer-tools { grid-template-columns: 1fr; }
}
.cw-composer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.35rem;
}
.cw-poll-details {
  margin: 0.25rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #f8faf9;
  border: 1px dashed var(--cw-border);
}
.cw-poll-details summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--cw-brand);
  font-size: 0.88rem;
}
.cw-login-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cw-login-prompt h2 { margin: 0 0 0.25rem; }

.cw-search-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--cw-border);
  border-radius: 14px;
  box-shadow: var(--cw-shadow);
}
.cw-search-bar i { color: var(--cw-muted); }
.cw-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  min-width: 0;
  outline: none;
}

.cw-community-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cw-brand);
  background: var(--cw-brand-50);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}
.cw-dot { margin: 0 0.15rem; opacity: 0.6; }
.cw-post-title a {
  color: inherit;
  text-decoration: none;
}
.cw-post-title a:hover { color: var(--cw-brand); }
.cw-link-line a {
  color: var(--cw-brand);
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-all;
}
.fa-heart.is-liked { color: #e11d48; }

.cw-checklist {
  margin: 0.65rem 0 0;
  padding: 0 0 0 1.1rem;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.65;
}
.cw-aside .cw-card h2 { font-size: 1rem; }

.cw-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--cw-muted);
}
.cw-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cw-brand-50);
  color: var(--cw-brand);
  font-size: 1.35rem;
}
.cw-empty h3 {
  margin: 0 0 0.35rem;
  color: var(--cw-text);
  font-size: 1.05rem;
}

/* ── Discussion / chat ── */
.cw-discussion-page {
  max-width: 760px;
  margin: 0 auto;
}
.cw-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--cw-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}
.cw-back-link:hover { color: var(--cw-brand); }

.cw-thread-post { margin-bottom: 1rem; }
.cw-thread-title {
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  margin: 0.15rem 0 0.65rem;
  color: #0f172a;
}
.cw-thread-body { font-size: 1rem; line-height: 1.65; }
.cw-avatar-lg { width: 48px; height: 48px; font-size: 1rem; border-radius: 14px; }
.cw-avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; border-radius: 10px; }
.cw-media-grid-lg img,
.cw-media-grid-lg video { max-height: 320px; }
.cw-report-inline {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}
.cw-report-inline input {
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 0.8rem;
  min-width: 8rem;
}
.cw-poll-box {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #f8faf9;
  border: 1px solid var(--cw-border);
}
.cw-poll-box ul {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
}
.cw-poll-box li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #eef2f0;
  font-size: 0.9rem;
}
.cw-poll-box li:last-child { border-bottom: none; }

.cw-chat {
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(15, 59, 35, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: min(78vh, 720px);
}
.cw-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--cw-border);
  background: linear-gradient(180deg, #f7fbf8 0%, #fff 100%);
}
.cw-chat-header h2 {
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--cw-brand);
}
.cw-chat-header p { margin: 0.15rem 0 0; }
.cw-lock-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
}

.cw-chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem 0.5rem;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(21, 126, 61, 0.04), transparent 55%),
    #f6f8f7;
  scroll-behavior: smooth;
}

.cw-chat-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--cw-muted);
}
.cw-chat-empty h3 {
  margin: 0 0 0.35rem;
  color: var(--cw-text);
}

.cw-msg {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-bottom: 0.95rem;
}
.cw-msg-col {
  flex: 1;
  min-width: 0;
  max-width: min(100%, 34rem);
}
.cw-msg.is-mine {
  flex-direction: row-reverse;
}
.cw-msg.is-mine .cw-msg-col {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
}
.cw-msg.is-mine .cw-msg-actions {
  justify-content: flex-end;
}

.cw-msg-bubble {
  background: #fff;
  border: 1px solid rgba(21, 126, 61, 0.1);
  border-radius: 16px 16px 16px 6px;
  padding: 0.7rem 0.9rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.cw-msg.is-mine .cw-msg-bubble {
  background: linear-gradient(145deg, #ecfdf5 0%, #f0fdf4 100%);
  border-color: rgba(21, 126, 61, 0.18);
  border-radius: 16px 16px 6px 16px;
}
.cw-msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.25rem;
}
.cw-msg-name {
  font-size: 0.84rem;
  color: #0f172a;
}
.cw-msg-time {
  font-size: 0.72rem;
  color: var(--cw-muted);
  font-weight: 500;
}
.cw-msg-text {
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.93rem;
  color: #1e293b;
  word-break: break-word;
}
.cw-msg-image {
  display: block;
  margin-top: 0.55rem;
}
.cw-msg-image img {
  max-width: min(100%, 280px);
  border-radius: 12px;
  border: 1px solid var(--cw-border);
}

.cw-msg-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.3rem;
  padding-left: 0.15rem;
}
.cw-reply-trigger {
  border: none;
  background: transparent;
  color: var(--cw-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 8px;
}
.cw-reply-trigger:hover {
  color: var(--cw-brand);
  background: var(--cw-brand-50);
}

/* Nested replies */
.cw-msg-reply {
  margin-top: 0.55rem;
  margin-left: 0.35rem;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(21, 126, 61, 0.18);
  width: 100%;
  box-sizing: border-box;
}
.cw-msg-reply .cw-msg-bubble {
  border-radius: 14px;
  padding: 0.6rem 0.8rem;
  background: #fbfcfb;
}
.cw-msg.is-mine.cw-msg-reply .cw-msg-bubble {
  background: #ecfdf5;
}

.cw-chat-composer {
  border-top: 1px solid var(--cw-border);
  background: #fff;
  padding: 0.75rem 0.9rem 0.9rem;
}
.cw-chat-composer-locked {
  text-align: center;
  padding: 1rem;
}
.cw-chat-composer-locked a {
  color: var(--cw-brand);
  font-weight: 700;
}

.cw-reply-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  background: var(--cw-brand-50);
  border: 1px solid rgba(21, 126, 61, 0.15);
  font-size: 0.82rem;
  color: #14532d;
}
.cw-reply-chip button {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}
.cw-reply-chip button:hover { background: rgba(0,0,0,0.05); color: #0f172a; }

.cw-chat-form {
  display: flex;
  gap: 0.65rem;
  align-items: flex-end;
}
.cw-chat-input-wrap {
  flex: 1;
  min-width: 0;
  background: #f8faf9;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 0.45rem 0.55rem 0.45rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cw-chat-input-wrap:focus-within {
  border-color: var(--cw-brand);
  box-shadow: 0 0 0 3px rgba(21, 126, 61, 0.12);
  background: #fff;
}
.cw-chat-input-wrap textarea {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  min-height: 40px;
  max-height: 160px;
  outline: none;
  margin: 0;
  padding: 0.35rem 0;
  box-sizing: border-box;
}
.cw-chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}
.cw-attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--cw-muted);
  cursor: pointer;
  position: relative;
}
.cw-attach-btn:hover {
  background: var(--cw-brand-50);
  color: var(--cw-brand);
}
.cw-attach-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.cw-msg:target .cw-msg-bubble,
.cw-msg-reply:target .cw-msg-bubble {
  box-shadow: 0 0 0 3px rgba(21, 126, 61, 0.25);
}

@media (max-width: 640px) {
  .cw-chat {
    max-height: none;
    min-height: 360px;
  }
  .cw-msg-reply {
    margin-left: 0;
    padding-left: 0.55rem;
  }
  .cw-discussion-page {
    max-width: 100%;
  }
}

/* ============================================================
   WhatsApp-style SmartVet Community group chat + private DMs
   ============================================================ */
.cw-main:has(.wa-room) {
  max-width: 920px;
  padding-bottom: 1rem;
}
.wa-room {
  display: flex;
  flex-direction: column;
  height: min(78vh, 820px);
  min-height: 520px;
  background: #e8f0ec;
  border: 1px solid var(--cw-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 59, 35, 0.1);
}
.wa-room-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #157E3D, #0f5a2c);
  color: #fff;
}
.wa-room-identity { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.wa-room-identity h1 { margin: 0; font-size: 1.05rem; color: #fff; font-weight: 800; }
.wa-room-identity p { margin: 0.15rem 0 0; font-size: 0.78rem; opacity: 0.9; }
.wa-room-identity a { color: #d1fae5; font-weight: 700; }
.wa-room-avatar {
  width: 44px; height: 44px; border-radius: 14px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.wa-room-tools { display: flex; align-items: center; gap: 0.45rem; }
.wa-search {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}
.wa-search input {
  border: none; background: transparent; color: #fff; font: inherit; font-size: 0.82rem;
  width: 9rem; outline: none;
}
.wa-search input::placeholder { color: rgba(255,255,255,0.7); }
.wa-search i { opacity: 0.85; font-size: 0.8rem; }

.wa-icon-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 12px;
  border: none; background: rgba(255,255,255,0.14);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; font-size: 0.95rem;
}
.wa-composer .wa-icon-btn {
  background: #eef5f0; color: #334155;
}
.wa-composer .wa-icon-btn:hover,
.wa-composer .wa-icon-btn.is-on {
  background: var(--cw-brand-50); color: var(--cw-brand);
}
.wa-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #fbbf24; color: #0f172a;
  font-size: 0.65rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.wa-room-tools .wa-badge { background: #fbbf24; }

.wa-stream {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 0.9rem 0.5rem;
  background:
    radial-gradient(ellipse 50% 30% at 0% 0%, rgba(21,126,61,0.06), transparent 50%),
    #dce8e0;
  scroll-behavior: auto;
}

.wa-date-chip {
  display: flex; justify-content: center; margin: 0.65rem 0;
}
.wa-date-chip span {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(21,126,61,0.1);
  color: #475569;
  font-size: 0.72rem; font-weight: 700;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.05);
}
.wa-load-older { text-align: center; margin-bottom: 0.75rem; }
.wa-pill-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.85rem; border-radius: 999px;
  background: #fff; color: var(--cw-brand); font-weight: 700; font-size: 0.8rem;
  text-decoration: none; border: 1px solid var(--cw-border);
}
.wa-pill-btn.is-primary {
  background: var(--cw-brand); color: #fff; border-color: var(--cw-brand);
}

.wa-msg {
  display: flex; gap: 0.5rem; align-items: flex-end;
  margin-bottom: 0.55rem; max-width: 100%;
}
.wa-msg.is-mine { flex-direction: row-reverse; }
.wa-avatar {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, #157E3D, #3daa6a);
  color: #fff; font-weight: 800; font-size: 0.78rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wa-bubble-wrap { max-width: min(78%, 420px); min-width: 0; }
.wa-msg.is-mine .wa-bubble-wrap { display: flex; flex-direction: column; align-items: flex-end; }

.wa-bubble {
  background: #fff;
  border-radius: 14px 14px 14px 4px;
  padding: 0.55rem 0.75rem 0.4rem;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
  border: 1px solid rgba(255,255,255,0.8);
  position: relative;
}
.wa-msg.is-mine .wa-bubble {
  background: #dcf8c6;
  border-radius: 14px 14px 4px 14px;
  border-color: rgba(21,126,61,0.12);
}
.wa-msg.wa-flash .wa-bubble {
  box-shadow: 0 0 0 3px rgba(21,126,61,0.35);
}

.wa-author {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.wa-author > span {
  font-size: 0.8rem; font-weight: 800; color: #0f766e;
}
.wa-dm-link {
  font-size: 0.7rem; font-weight: 700; color: #64748b; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.wa-dm-link:hover { color: var(--cw-brand); }

.wa-quote {
  display: flex; gap: 0.45rem; text-decoration: none; color: inherit;
  background: rgba(15,23,42,0.04);
  border-radius: 8px; padding: 0.35rem 0.5rem; margin-bottom: 0.4rem;
}
.wa-quote-bar {
  width: 3px; border-radius: 3px; background: var(--cw-brand); flex-shrink: 0;
}
.wa-quote-body { min-width: 0; font-size: 0.78rem; }
.wa-quote-body strong { display: block; color: var(--cw-brand); font-size: 0.75rem; }
.wa-quote-body em { font-style: normal; color: #64748b; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wa-title { font-weight: 800; font-size: 0.92rem; margin-bottom: 0.2rem; color: #0f172a; }
.wa-text { white-space: pre-wrap; word-break: break-word; font-size: 0.92rem; line-height: 1.45; color: #1e293b; }

.wa-attachments { display: grid; gap: 0.4rem; margin-top: 0.45rem; }
.wa-att-img img {
  max-width: 100%; max-height: 240px; border-radius: 10px; display: block; object-fit: cover;
}
.wa-att-video { max-width: 100%; border-radius: 10px; max-height: 240px; }
.wa-att-file {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.65rem; border-radius: 10px;
  background: rgba(15,23,42,0.04); color: #0f172a; text-decoration: none; font-weight: 650; font-size: 0.82rem;
}
.wa-link-card {
  display: flex; gap: 0.55rem; align-items: center;
  margin-top: 0.4rem; padding: 0.5rem 0.65rem; border-radius: 10px;
  background: rgba(21,126,61,0.06); text-decoration: none; color: inherit;
}
.wa-link-card i { color: var(--cw-brand); }
.wa-link-card strong { display: block; font-size: 0.8rem; color: #0f172a; word-break: break-all; }
.wa-link-card small { color: var(--cw-brand); font-weight: 700; font-size: 0.72rem; }

/* Polls */
.wa-poll {
  margin-top: 0.5rem;
  padding: 0.55rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(21,126,61,0.12);
}
.wa-msg.is-mine .wa-poll { background: rgba(255,255,255,0.45); }
.wa-poll-q {
  font-weight: 800; font-size: 0.88rem; margin-bottom: 0.45rem;
  display: flex; align-items: center; gap: 0.4rem; color: #0f172a;
}
.wa-poll-options { display: grid; gap: 0.35rem; }
.wa-poll-form { margin: 0; }
.wa-poll-opt {
  position: relative; width: 100%; text-align: left;
  border: 1px solid rgba(21,126,61,0.15); border-radius: 10px;
  background: #fff; padding: 0; overflow: hidden; cursor: pointer; font: inherit;
}
.wa-poll-opt.is-readonly { cursor: default; }
.wa-poll-opt.is-selected { border-color: var(--cw-brand); }
.wa-poll-fill {
  position: absolute; inset: 0 auto 0 0; background: rgba(21,126,61,0.14);
  transition: width 0.25s ease;
}
.wa-poll-opt-inner {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.65rem; font-size: 0.82rem;
}
.wa-poll-label { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 650; color: #0f172a; }
.wa-poll-meta { font-size: 0.72rem; font-weight: 700; color: #64748b; white-space: nowrap; }
.wa-poll-total { margin-top: 0.4rem; font-size: 0.72rem; color: #64748b; font-weight: 600; }

.wa-tag {
  display: inline-block; font-size: 0.7rem; font-weight: 700; color: var(--cw-brand);
  background: rgba(21,126,61,0.08); border-radius: 999px; padding: 0.1rem 0.45rem; margin: 0.25rem 0.15rem 0 0;
}
.wa-meta-row {
  display: flex; justify-content: flex-end; align-items: center; gap: 0.35rem;
  margin-top: 0.25rem; font-size: 0.68rem; color: #64748b; font-weight: 600;
}
.wa-meta-row .fa-check-double { color: #2563eb; }

.wa-actions {
  display: flex; flex-wrap: wrap; gap: 0.15rem; margin-top: 0.2rem; padding: 0 0.15rem;
  opacity: 0.85;
}
.wa-msg:hover .wa-actions { opacity: 1; }
.wa-act {
  border: none; background: transparent; color: #64748b;
  font: inherit; font-size: 0.72rem; font-weight: 700;
  padding: 0.2rem 0.4rem; border-radius: 8px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.25rem;
}
.wa-act:hover { background: rgba(255,255,255,0.7); color: var(--cw-brand); }
.wa-act.is-on { color: #e11d48; }
.wa-act.wa-danger:hover { color: #be123c; background: #fef2f2; }
.wa-inline-form { display: inline; margin: 0; }

.wa-composer {
  background: #f0f4f1;
  border-top: 1px solid rgba(21,126,61,0.12);
  padding: 0.55rem 0.65rem 0.7rem;
}
.wa-composer-form {
  display: flex; align-items: flex-end; gap: 0.4rem;
}
.wa-composer-tools { display: flex; gap: 0.25rem; flex-shrink: 0; }
.wa-composer-main {
  flex: 1; min-width: 0;
  background: #fff; border: 1.5px solid #dbe4de; border-radius: 18px;
  padding: 0.4rem 0.7rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.wa-composer-main:focus-within {
  border-color: var(--cw-brand);
  box-shadow: 0 0 0 3px rgba(21,126,61,0.12);
}
.wa-composer-main textarea {
  width: 100%; border: none; outline: none; resize: none; font: inherit;
  font-size: 0.92rem; line-height: 1.4; min-height: 36px; max-height: 140px;
  margin: 0; padding: 0.25rem 0; background: transparent; box-sizing: border-box;
}
.wa-send {
  width: 44px; height: 44px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, #157E3D, #126b34); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 6px 16px rgba(21,126,61,0.28); flex-shrink: 0;
}
.wa-send:hover { transform: scale(1.04); }
.wa-reply-chip {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  background: #fff; border: 1px solid var(--cw-border); border-radius: 12px;
  padding: 0.4rem 0.65rem; margin-bottom: 0.45rem; font-size: 0.8rem;
}
.wa-reply-chip-text strong { display: block; color: var(--cw-brand); font-size: 0.78rem; }
.wa-reply-chip-text em { font-style: normal; color: #64748b; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.wa-reply-chip button { border: none; background: transparent; cursor: pointer; color: #64748b; padding: 0.25rem; }
.wa-extra-panel {
  margin-bottom: 0.45rem; padding-bottom: 0.45rem; border-bottom: 1px dashed #e2e8f0;
}
.wa-extra-panel input {
  width: 100%; box-sizing: border-box; margin: 0.25rem 0;
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 0.45rem 0.6rem; font: inherit; font-size: 0.85rem;
}
.wa-extra-title { font-size: 0.78rem; font-weight: 800; color: var(--cw-brand); margin-bottom: 0.25rem; }
.wa-hint { margin: 0.25rem 0 0; font-size: 0.72rem; color: #64748b; }
.wa-files-preview {
  font-size: 0.78rem; color: #334155; font-weight: 600; margin-bottom: 0.3rem;
}
.wa-login-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.65rem;
  padding: 0.35rem 0.15rem; font-size: 0.88rem; color: #334155;
}
.wa-empty {
  text-align: center; padding: 3rem 1.25rem; color: #64748b;
}
.wa-empty h2 { margin: 0 0 0.4rem; color: #0f172a; font-size: 1.1rem; }
.wa-empty-icon {
  width: 64px; height: 64px; margin: 0 auto 0.85rem; border-radius: 20px;
  background: #fff; color: var(--cw-brand); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; box-shadow: 0 8px 20px rgba(15,59,35,0.08);
}

/* Private messages list */
.dm-shell { max-width: 720px; margin: 0 auto; }
.dm-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.75rem;
  margin-bottom: 1rem;
}
.dm-header h1 { margin: 0 0 0.25rem; font-size: 1.35rem; color: var(--cw-brand); display: flex; align-items: center; gap: 0.45rem; }
.dm-list {
  background: #fff; border: 1px solid var(--cw-border); border-radius: 18px; overflow: hidden;
  box-shadow: var(--cw-shadow);
}
.dm-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem; text-decoration: none; color: inherit;
  border-bottom: 1px solid #f1f5f9;
}
.dm-row:last-child { border-bottom: none; }
.dm-row:hover { background: #f8faf9; }
.dm-row-body { flex: 1; min-width: 0; }
.dm-row-top {
  display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline;
}
.dm-row-top strong { font-size: 0.95rem; color: #0f172a; }
.dm-row-top time { font-size: 0.72rem; color: #94a3b8; font-weight: 600; }
.dm-row-preview { font-size: 0.85rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.15rem; }
.dm-row-preview.is-unread { color: #0f172a; font-weight: 700; }
.dm-row .wa-badge { position: static; background: var(--cw-brand); color: #fff; }

@media (max-width: 640px) {
  .wa-room { height: min(82vh, 900px); border-radius: 14px; }
  .wa-bubble-wrap { max-width: 88%; }
  .wa-search input { width: 6.5rem; }
  .cw-main:has(.wa-room) { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* Force professional hide (CSS display:flex was overriding HTML hidden) */
.wa-reply-chip[hidden],
.wa-attach-menu[hidden],
.wa-extra-panel[hidden],
.wa-files-preview[hidden],
.wa-room [hidden] {
  display: none !important;
}

/* Compact workspace */
.cw-main:has(.wa-room) {
  max-width: 780px;
  padding: 0.35rem 0.65rem 0.75rem;
}
.cw-body:has(.wa-room) {
  padding-top: 4.25rem;
}
.cw-body:has(.wa-room) .cw-subnav {
  margin-bottom: 0.5rem;
  border-radius: 12px;
}
.cw-body:has(.wa-room) .cw-subnav-inner {
  padding: 0.35rem 0.55rem;
  gap: 0.35rem;
}
.cw-body:has(.wa-room) .cw-subnav-tab {
  font-size: 0.78rem;
  padding: 0.32rem 0.6rem;
}
.cw-body:has(.wa-room) .cw-subnav-label {
  font-size: 0.68rem;
  padding-right: 0.4rem;
}

.wa-room {
  height: min(74vh, 700px);
  min-height: 420px;
  border-radius: 14px;
}
.wa-room-header {
  padding: 0.45rem 0.7rem;
  gap: 0.5rem;
}
.wa-room-avatar {
  width: 34px; height: 34px; border-radius: 10px; font-size: 0.85rem;
}
.wa-room-identity h1 { font-size: 0.92rem; }
.wa-room-identity p { font-size: 0.7rem; margin-top: 0.05rem; }
.wa-search {
  padding: 0.22rem 0.55rem;
}
.wa-search input { width: 7rem; font-size: 0.75rem; }
.wa-icon-btn {
  width: 32px; height: 32px; border-radius: 9px; font-size: 0.82rem;
}
.wa-badge {
  min-width: 14px; height: 14px; font-size: 0.58rem; top: -3px; right: -3px;
}

.wa-stream { padding: 0.55rem 0.6rem 0.35rem; }
.wa-date-chip { margin: 0.4rem 0; }
.wa-date-chip span { font-size: 0.65rem; padding: 0.18rem 0.55rem; }
.wa-load-older { margin-bottom: 0.4rem; }
.wa-pill-btn { font-size: 0.72rem; padding: 0.28rem 0.65rem; }

.wa-msg { gap: 0.35rem; margin-bottom: 0.35rem; }
.wa-avatar {
  width: 28px; height: 28px; border-radius: 8px; font-size: 0.68rem;
}
.wa-bubble-wrap { max-width: min(82%, 360px); }
.wa-bubble {
  border-radius: 11px 11px 11px 3px;
  padding: 0.38rem 0.55rem 0.28rem;
  box-shadow: 0 1px 4px rgba(15,23,42,0.05);
}
.wa-msg.is-mine .wa-bubble { border-radius: 11px 11px 3px 11px; }
.wa-author { margin-bottom: 0.1rem; }
.wa-author > span { font-size: 0.72rem; }
.wa-dm-link { font-size: 0.65rem; }
.wa-quote { padding: 0.25rem 0.4rem; margin-bottom: 0.28rem; border-radius: 6px; }
.wa-quote-body { font-size: 0.7rem; }
.wa-quote-body strong { font-size: 0.68rem; }
.wa-title { font-size: 0.82rem; margin-bottom: 0.1rem; }
.wa-text { font-size: 0.84rem; line-height: 1.4; }
.wa-attachments { gap: 0.3rem; margin-top: 0.3rem; }
.wa-att-img img { max-height: 180px; border-radius: 8px; }
.wa-att-video { max-height: 180px; border-radius: 8px; }
.wa-att-file { padding: 0.35rem 0.5rem; font-size: 0.75rem; border-radius: 8px; }
.wa-link-card { margin-top: 0.28rem; padding: 0.35rem 0.5rem; font-size: 0.75rem; border-radius: 8px; gap: 0.4rem; }
.wa-link-card span { word-break: break-all; font-weight: 650; color: #0f172a; }

.wa-poll { margin-top: 0.35rem; padding: 0.4rem; border-radius: 9px; }
.wa-poll-q { font-size: 0.78rem; margin-bottom: 0.3rem; gap: 0.3rem; }
.wa-poll-options { gap: 0.25rem; }
.wa-poll-opt { border-radius: 8px; }
.wa-poll-opt-inner { padding: 0.35rem 0.5rem; font-size: 0.75rem; }
.wa-poll-meta { font-size: 0.65rem; }
.wa-poll-total { margin-top: 0.25rem; font-size: 0.65rem; }

.wa-meta-row { margin-top: 0.15rem; font-size: 0.62rem; }
.wa-actions { gap: 0.05rem; margin-top: 0.1rem; }
.wa-act { font-size: 0.68rem; padding: 0.12rem 0.28rem; border-radius: 6px; }

/* Composer compact + plus menu */
.wa-composer {
  padding: 0.4rem 0.5rem 0.5rem;
  background: #eef3ef;
}
.wa-composer-form {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
}
.wa-composer-main {
  flex: 1;
  min-width: 0;
  border-radius: 16px;
  padding: 0.28rem 0.55rem;
  border: 1px solid #d5e0d9;
}
.wa-composer-main textarea {
  font-size: 0.86rem;
  min-height: 30px;
  max-height: 100px;
  line-height: 1.35;
  padding: 0.2rem 0;
}
.wa-send {
  width: 36px; height: 36px;
  box-shadow: 0 3px 10px rgba(21,126,61,0.25);
  font-size: 0.82rem;
}

/* Reply chip — closed by default via [hidden] */
.wa-reply-chip {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid rgba(21,126,61,0.18);
  border-left: 3px solid var(--cw-brand);
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
}
.wa-reply-chip.is-open,
.wa-reply-chip:not([hidden]) {
  display: flex;
}
.wa-reply-chip[hidden] {
  display: none !important;
}
.wa-reply-chip-text {
  min-width: 0;
  flex: 1;
}
.wa-reply-chip-text strong {
  display: block;
  color: var(--cw-brand);
  font-size: 0.72rem;
  font-weight: 800;
}
.wa-reply-chip-text em {
  display: block;
  font-style: normal;
  color: #64748b;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70vw;
}
.wa-reply-close {
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wa-reply-close:hover {
  background: #fee2e2;
  color: #be123c;
}

/* Plus attach menu */
.wa-attach {
  position: relative;
  flex-shrink: 0;
}
.wa-plus-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: var(--cw-brand);
  border: 1.5px solid rgba(21,126,61,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.wa-plus-btn:hover {
  background: var(--cw-brand-50);
}
.wa-plus-btn.is-open {
  background: var(--cw-brand);
  color: #fff;
  border-color: var(--cw-brand);
  transform: rotate(45deg);
}
.wa-attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 168px;
  background: #fff;
  border: 1px solid rgba(21,126,61,0.12);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15,23,42,0.12);
  padding: 0.3rem;
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 0.1rem;
}
.wa-attach-menu.is-open,
.wa-attach-menu:not([hidden]) {
  display: flex;
}
.wa-attach-menu[hidden] {
  display: none !important;
}
.wa-attach-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  color: #0f172a;
  cursor: pointer;
  text-decoration: none;
}
.wa-attach-item i {
  width: 1.1rem;
  color: var(--cw-brand);
  text-align: center;
}
.wa-attach-item:hover {
  background: var(--cw-brand-50);
}

.wa-extra-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.35rem;
}
.wa-extra-panel.is-open,
.wa-extra-panel:not([hidden]) {
  display: block;
}
.wa-extra-panel[hidden] {
  display: none !important;
}
.wa-extra-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--cw-brand);
}
.wa-panel-close {
  border: none;
  background: #f1f5f9;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}
.wa-extra-panel input {
  width: 100%;
  box-sizing: border-box;
  margin: 0.18rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.8rem;
}
.wa-files-preview {
  display: none;
  font-size: 0.72rem;
  font-weight: 650;
  color: #334155;
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.3rem;
  align-items: center;
  gap: 0.35rem;
}
.wa-files-preview.is-open,
.wa-files-preview:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
}
.wa-files-preview[hidden] {
  display: none !important;
}
.wa-files-clear {
  border: none;
  background: #f1f5f9;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  margin-left: auto;
  color: #64748b;
}

.wa-empty { padding: 2rem 1rem; }
.wa-empty-icon { width: 48px; height: 48px; font-size: 1.15rem; border-radius: 14px; margin-bottom: 0.55rem; }
.wa-empty h2 { font-size: 0.98rem; }
.wa-empty p { font-size: 0.82rem; }
.wa-login-bar { font-size: 0.8rem; padding: 0.2rem; }

.dm-header h1 { font-size: 1.15rem; }
.dm-row { padding: 0.65rem 0.8rem; gap: 0.55rem; }
.dm-row-top strong { font-size: 0.88rem; }
.dm-row-preview { font-size: 0.78rem; }

@media (max-width: 640px) {
  .cw-main:has(.wa-room) {
    padding: 0.2rem 0.35rem 0.5rem;
  }
  .wa-room {
    height: min(80vh, 760px);
    min-height: 380px;
    border-radius: 12px;
  }
  .wa-bubble-wrap { max-width: 90%; }
  .wa-search input { width: 5.2rem; }
  .wa-room-header { padding: 0.4rem 0.5rem; }
  .wa-attach-menu { min-width: 150px; left: 0; }
  .wa-composer { padding: 0.35rem 0.4rem 0.45rem; }
  .wa-plus-btn, .wa-send { width: 34px; height: 34px; }
}

@media (min-width: 1024px) {
  .wa-room {
    height: min(72vh, 680px);
  }
  .wa-bubble-wrap { max-width: min(70%, 340px); }
}

/* ============================================================
   Community workspace: left / chat / right + mobile dock
   ============================================================ */
.cw-main:has(.cw-workspace) {
  max-width: 1280px;
  padding: 0.35rem 0.65rem 4.5rem;
}
.cw-workspace {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 220px;
  gap: 0.65rem;
  align-items: stretch;
  min-height: 0;
}
.cw-workspace .wa-room {
  min-width: 0;
  height: min(74vh, 700px);
}

/* Rails */
.cw-rail {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  max-height: min(74vh, 700px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.cw-rail-card {
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--cw-border);
  border-radius: 14px;
  padding: 0.65rem 0.7rem;
  box-shadow: 0 4px 14px rgba(15,59,35,0.05);
}
.cw-rail-heading {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cw-brand);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.cw-rail-profile {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.cw-rail-avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  font-size: 0.9rem !important;
}
.cw-rail-profile-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.cw-rail-profile-text strong {
  font-size: 0.86rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cw-rail-profile-text span { font-size: 0.7rem; }
.cw-rail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  margin-top: 0.65rem;
  text-align: center;
}
.cw-rail-stats strong {
  display: block;
  font-size: 0.9rem;
  color: var(--cw-brand);
  font-weight: 800;
}
.cw-rail-stats span {
  font-size: 0.62rem;
  color: #64748b;
  font-weight: 650;
}
.cw-rail-nav { padding: 0.45rem; }
.cw-rail-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.45rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  position: relative;
}
.cw-rail-link:hover { background: var(--cw-brand-50); }
.cw-rail-link-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--cw-brand-50);
  color: var(--cw-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.cw-rail-link-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.cw-rail-link-text strong {
  font-size: 0.8rem;
  color: #0f172a;
  font-weight: 750;
}
.cw-rail-link-text em {
  font-style: normal;
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
}
.cw-rail-badge {
  position: static !important;
  background: var(--cw-brand) !important;
  color: #fff !important;
}
.cw-rail-hint p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
}
.cw-rail-empty { margin: 0; font-size: 0.75rem; }

.cw-discover-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid #f1f5f9;
}
.cw-discover-item:last-child { border-bottom: none; }
.cw-discover-item:hover .cw-discover-title { color: var(--cw-brand); }
.cw-discover-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.35;
}
.cw-discover-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
}
.cw-discover-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.cw-discover-user:last-child { border-bottom: none; }
.cw-discover-user .wa-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.68rem;
}
.cw-discover-user-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.cw-discover-user-text strong {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cw-discover-user-text span { font-size: 0.65rem; }
.cw-mini-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--cw-brand-50);
  color: var(--cw-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.72rem;
  flex-shrink: 0;
}
.cw-mini-btn:hover { background: var(--cw-brand); color: #fff; }
.cw-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Mobile dock hidden on desktop */
.cw-mobile-dock {
  display: none;
}
.cw-sheet-backdrop {
  display: none;
}

@media (max-width: 1100px) {
  .cw-workspace {
    grid-template-columns: 180px minmax(0, 1fr) 200px;
    gap: 0.5rem;
  }
}

/* Mobile / tablet: full chat, rails as bottom sheets */
@media (max-width: 900px) {
  .cw-main:has(.cw-workspace) {
    padding: 0.25rem 0.35rem 4.25rem;
    max-width: 100%;
  }
  .cw-workspace {
    display: block;
    position: relative;
  }
  .cw-workspace .wa-room {
    height: min(78vh, 720px);
    min-height: 420px;
  }

  .cw-rail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    max-height: min(72vh, 560px);
    padding: 0.75rem 0.75rem calc(4.25rem + env(safe-area-inset-bottom, 0px));
    background: #f3f7f4;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 36px rgba(15,23,42,0.16);
    transform: translateY(110%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    pointer-events: none;
  }
  .cw-workspace.sheet-you .cw-rail-left,
  .cw-workspace.sheet-discover .cw-rail-right {
    transform: translateY(0);
    pointer-events: auto;
  }
  .cw-rail-left { z-index: 81; }
  .cw-rail-right { z-index: 82; }

  .cw-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15,23,42,0.35);
    backdrop-filter: blur(2px);
  }
  .cw-sheet-backdrop:not([hidden]),
  .cw-sheet-backdrop.is-open {
    display: block;
  }
  .cw-sheet-backdrop[hidden] {
    display: none !important;
  }
  body.cw-sheet-open {
    overflow: hidden;
  }

  .cw-mobile-dock {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: rgba(255,255,255,0.96);
    border-top: 1px solid rgba(21,126,61,0.12);
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 18px rgba(15,23,42,0.06);
  }
  .cw-dock-btn {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.25rem;
    border-radius: 10px;
    color: #64748b;
    font: inherit;
    font-size: 0.65rem;
    font-weight: 750;
    cursor: pointer;
  }
  .cw-dock-btn i { font-size: 1.05rem; }
  .cw-dock-btn.is-active {
    color: var(--cw-brand);
    background: var(--cw-brand-50);
  }
}

@media (min-width: 901px) {
  .cw-mobile-dock { display: none !important; }
  .cw-sheet-backdrop { display: none !important; }
}

/* Simple one-line footer for Community + Webinars */
.cw-mini-footer {
  text-align: center;
  padding: 0.65rem 1rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.01em;
}
.cw-mini-footer strong {
  color: #157E3D;
  font-weight: 800;
}
.cw-body:has(.cw-workspace) .cw-mini-footer,
.cw-body:has(.wa-room) .cw-mini-footer {
  padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 900px) {
  .cw-body:has(.cw-mobile-dock) .cw-mini-footer {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Avatar + country flag badge */
.wa-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
}
.wa-avatar-wrap .cw-flag,
.wa-author .cw-flag {
  font-style: normal;
  line-height: 1;
}
.wa-avatar-wrap > .cw-flag {
  position: absolute;
  right: -4px;
  bottom: -3px;
  font-size: 0.72rem;
  line-height: 1;
  background: #fff;
  border-radius: 4px;
  padding: 0 1px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.15);
  z-index: 1;
}
.wa-author .cw-flag {
  font-size: 0.85em;
  margin-left: 0.15rem;
  vertical-align: middle;
}
.wa-msg.is-mine {
  flex-direction: row-reverse;
}
.wa-msg.is-mine .wa-avatar-wrap {
  order: 0;
}
.cw-discover-user .wa-avatar-wrap > .cw-flag {
  font-size: 0.65rem;
  right: -3px;
  bottom: -2px;
}
.cw-rail-profile .wa-avatar-wrap {
  flex-shrink: 0;
}

