/*
 * yellowpin-communication.css
 * YellowPin Web Communication Module — Styles
 * Version: 20260924
 */

/* ─── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  --ypc-me-bg: #FFF8E7;
  --ypc-me-border: #FDE68A;
  --ypc-them-bg: #FFFFFF;
  --ypc-them-border: #E5E7EB;
  --ypc-panel-bg: #F9FAFB;
  --ypc-header-bg: #FFC61A;
  --ypc-header-text: #1A1A1A;
  --ypc-orange: #F97316;
  --ypc-green: #22C55E;
  --ypc-blue-tick: #2563EB;
  --ypc-chip-border: #FFC61A;
  --ypc-shadow: 0 8px 40px rgba(0,0,0,0.16);
  --ypc-radius: 16px;
  --ypc-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ypc-input-border: rgba(148,163,184,0.35);
}

/* ─── Header Chat Icon ──────────────────────────────────────────────────── */
.yp-chat-action {
  position: relative;
  display: none; /* hidden until auth-ready has-auth */
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  color: #1A1A1A;
  text-decoration: none;
  transition: background 0.2s;
  font-size: 18px;
}
html.auth-ready.has-auth .yp-chat-action {
  display: flex;
}
html.auth-ready:not(.has-auth) .yp-chat-action {
  display: none;
}
.yp-chat-action:hover { background: rgba(255,198,26,0.15); }

.chat-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #EF4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  padding: 0 3px;
  pointer-events: none;
  border: 1.5px solid #fff;
  animation: ypBadgePop 0.3s ease;
}
@keyframes ypBadgePop {
  0%   { transform: scale(0.5); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ─── Backdrop ──────────────────────────────────────────────────────────── */
.ypc-backdrop {
/* ─── Backdrop & Panel: Completely Retired in favor of Active Collaborations ── */
.ypc-backdrop,
.ypc-backdrop.open {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* ─── Panel ─────────────────────────────────────────────────────────────── */
.ypc-panel,
.ypc-panel.open {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transform: translateX(120%) !important;
}

/* ─── Panel Header ──────────────────────────────────────────────────────── */
.ypc-panel-header {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 58px;
  background: var(--ypc-header-bg);
  flex-shrink: 0;
  gap: 8px;
}
.ypc-panel-header .ypc-back-btn {
  display: none;
  background: none;
  border: none;
  color: var(--ypc-header-text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  line-height: 1;
  transition: background 0.15s;
}
.ypc-panel-header .ypc-back-btn:hover { background: rgba(0,0,0,0.08); }
.ypc-panel-header.in-chat .ypc-back-btn { display: flex; align-items: center; justify-content: center; }

.ypc-panel-title {
  flex: 1;
  font-weight: 700;
  font-size: 16px;
  color: var(--ypc-header-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ypc-header-chat-info {
  display: none;
  flex: 1;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  overflow: hidden;
}
.ypc-panel-header.in-chat .ypc-panel-title { display: none; }
.ypc-panel-header.in-chat .ypc-header-chat-info { display: flex; }

.ypc-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(255,255,255,0.6);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  color: var(--ypc-header-text);
}
.ypc-header-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.ypc-header-names { overflow: hidden; }
.ypc-header-partner-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ypc-header-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ypc-header-partner-sub {
  font-size: 11px;
  color: rgba(26,26,26,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ypc-panel-header .ypc-close-btn {
  background: none;
  border: none;
  color: var(--ypc-header-text);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
  z-index: 1;
}
.ypc-panel-header .ypc-close-btn:hover { background: rgba(0,0,0,0.1); }
.ypc-panel-header .ypc-download-btn {
  background: rgba(0,0,0,0.06);
  border: none;
  color: var(--ypc-header-text);
  font-size: 15px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  z-index: 1;
}
.ypc-panel-header .ypc-download-btn:hover {
  background: rgba(0,0,0,0.14);
  transform: translateY(-1px);
}

/* ─── Conversations View ────────────────────────────────────────────────── */
.ypc-view { display: none; flex: 1; flex-direction: column; min-height: 0; }
.ypc-view.active { display: flex; }

/* Search bar (Institute only) */
.ypc-search-wrap {
  padding: 10px 12px 6px;
  background: #fff;
  border-bottom: 1px solid var(--ypc-input-border);
  position: relative;
  flex-shrink: 0;
}
.ypc-search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--ypc-input-border);
  border-radius: 24px;
  font-size: 13px;
  background: #F8FAFC;
  outline: none;
  color: #1e293b;
  transition: border-color 0.2s;
}
.ypc-search-input:focus { border-color: var(--ypc-chip-border); }
.ypc-search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 13px;
  pointer-events: none;
}
.ypc-search-results {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% - 6px);
  background: #fff;
  border: 1px solid var(--ypc-input-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 10;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.ypc-search-results.open { display: block; }
.ypc-search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s;
}
.ypc-search-result-item:last-child { border-bottom: none; }
.ypc-search-result-item:hover { background: #FFF8E7; }
.ypc-search-result-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #F1F5F9;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #64748B;
  overflow: hidden; flex-shrink: 0;
}
.ypc-search-result-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ypc-search-result-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.ypc-search-result-loc { font-size: 11px; color: #64748B; }

/* Conversations list */
.ypc-conv-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.ypc-conv-list::-webkit-scrollbar { width: 4px; }
.ypc-conv-list::-webkit-scrollbar-track { background: transparent; }
.ypc-conv-list::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 2px; }

.ypc-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s;
  background: #fff;
}
.ypc-conv-item:hover, .ypc-conv-item:focus { background: #FFFBEB; }
.ypc-conv-item.unread { background: #FFFFF5; }

.ypc-conv-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #F1F5F9;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #64748B;
  flex-shrink: 0;
  overflow: hidden;
}
.ypc-conv-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.ypc-conv-info { flex: 1; min-width: 0; }
.ypc-conv-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.ypc-conv-item.unread .ypc-conv-name { font-weight: 700; }
.ypc-conv-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.ypc-conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.ypc-conv-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.ypc-conv-lastmsg,
.ypc-conv-preview {
  font-size: 12px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  line-height: 1.4;
  display: block;
}
.ypc-conv-item.unread .ypc-conv-lastmsg,
.ypc-conv-item.unread .ypc-conv-preview {
  color: #0f172a;
  font-weight: 500;
}

.ypc-conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.ypc-conv-time {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: #94A3B8;
  white-space: nowrap;
  text-align: right;
  margin-left: auto;
  line-height: 1.35;
}
.ypc-conv-badge,
.ypc-conv-unread-badge {
  min-width: 18px;
  height: 18px;
  background: #f59e0b;
  color: #ffffff;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.35);
  flex-shrink: 0;
  letter-spacing: -0.2px;
}

.ypc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 20px;
  text-align: center;
  color: #94A3B8;
}
.ypc-empty i { font-size: 40px; margin-bottom: 12px; color: #CBD5E1; }
.ypc-empty-title { font-size: 15px; font-weight: 600; color: #64748B; margin-bottom: 6px; }
.ypc-empty-sub { font-size: 13px; color: #94A3B8; line-height: 1.5; }

/* ─── Chat View ─────────────────────────────────────────────────────────── */
.ypc-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden !important;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: thin;
}
.ypc-chat-messages::-webkit-scrollbar { width: 4px; }
.ypc-chat-messages::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 2px; }

/* Bubbles */
.ypc-bubble-wrap {
  display: flex;
  margin-bottom: 10px;
  animation: ypMsgIn 0.2s ease;
}
@keyframes ypMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ypc-bubble-wrap.me { justify-content: flex-end; }
.ypc-bubble-wrap.them { justify-content: flex-start; }

.ypc-bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 14px;
  position: relative;
  cursor: default;
}
.ypc-bubble-wrap.me .ypc-bubble {
  background: var(--ypc-me-bg);
  border: 0.8px solid var(--ypc-me-border);
  border-radius: 14px 14px 2px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.ypc-bubble-wrap.them .ypc-bubble {
  background: var(--ypc-them-bg);
  border: 0.8px solid var(--ypc-them-border);
  border-radius: 14px 14px 14px 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.ypc-sender-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ypc-orange);
  margin-bottom: 3px;
}
.ypc-bubble-text {
  font-size: 13.5px;
  color: #1A1A1A;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.ypc-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  line-height: 1;
}
.ypc-bubble-time {
  font-size: 10.5px;
  color: #64748B;
  font-weight: 500;
  line-height: 1;
}
.ypc-bubble-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}
.ypc-tick-svg {
  display: inline-block;
  vertical-align: middle;
  color: #94A3B8;
  stroke: #94A3B8;
  transition: color 0.15s ease, stroke 0.15s ease;
}
.ypc-tick-svg.read {
  color: #0284c7;
  stroke: #0284c7;
}
.ypc-bubble-tick.read {
  color: #0284c7 !important;
}
.ypc-tick-svg.pending {
  color: #94A3B8;
  stroke: #94A3B8;
  animation: ypcTickSpin 0.9s linear infinite;
}
@keyframes ypcTickSpin {
  100% { transform: rotate(360deg); }
}

/* WhatsApp / Instagram style smooth message slide-in */
@keyframes ypcMsgSlideIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.ypc-bubble-wrap.ypc-msg-animate {
  animation: ypcMsgSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: bottom right;
}
.ypc-bubble-wrap.them.ypc-msg-animate {
  transform-origin: bottom left;
}

/* Unsent bubble */
.ypc-bubble.unsent {
  background: #F8FAFC;
  border-color: #E2E8F0;
}
.ypc-bubble.unsent .ypc-bubble-text {
  font-style: italic;
  color: #94A3B8;
  font-size: 12px;
}

/* ─── Special Message Cards ─────────────────────────────────────────────── */
.ypc-card {
  margin-top: 8px;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  width: 100%;
}
.ypc-card-job { border: 1.2px solid var(--ypc-me-border); }
.ypc-card-drive-invite { border: 1.2px solid var(--ypc-orange); }
.ypc-card-drive-confirmed { /* pill, inline */ }
.ypc-card-drive-accepted { border: 1.2px solid #86EFAC; background: #F0FDF4; }

.ypc-card-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.ypc-card-row i { font-size: 15px; color: var(--ypc-orange); flex-shrink: 0; }
.ypc-card-title { font-size: 13px; font-weight: 600; color: #0f172a; }
.ypc-card-sub { font-size: 11px; color: #64748B; margin-bottom: 6px; }

.ypc-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 34px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.ypc-card-btn:active { transform: scale(0.98); }
.ypc-card-btn.yellow { background: var(--ypc-header-bg); color: #1A1A1A; }
.ypc-card-btn.orange { background: var(--ypc-orange); color: #fff; }
.ypc-card-btn.green  { background: var(--ypc-green); color: #fff; }

/* Drive confirmed pill */
.ypc-drive-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #E8F5E9;
  border: 0.8px solid #81C784;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #2E7D32;
  margin-top: 6px;
}
.ypc-drive-pill i { font-size: 12px; }

/* Drive accepted card */
.ypc-drive-accepted-title {
  font-size: 12px;
  font-weight: 700;
  color: #166534;
}
.ypc-drive-accepted-date {
  font-size: 11px;
  font-weight: 500;
  color: #15803D;
  margin-top: 2px;
}

/* Student data request link */
.ypc-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--ypc-orange);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
}

/* Attachment card */
.ypc-attachment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #F1F8F5;
  border: 1px solid #C7E3D4;
  border-radius: 10px;
  margin-top: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}
.ypc-attachment-card:hover { background: #E8F5F0; border-color: #A3D4BA; }
.ypc-att-icon,
.ypc-attachment-card i { font-size: 22px; color: #16A34A; flex-shrink: 0; display: flex; align-items: center; }
.ypc-att-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.ypc-att-name,
.ypc-attachment-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  line-height: 1.35;
}
.ypc-att-sub,
.ypc-attachment-sub {
  font-size: 10.5px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

/* ─── Predefined Action Chips (Org) ─────────────────────────────────────── */
.ypc-chips-wrap,
.ypc-chips-bar {
  display: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 12px;
  gap: 8px;
  background: #FAF7EE;
  border-top: 1px solid rgba(148,163,184,0.25);
  flex-shrink: 0;
  scrollbar-width: none; /* Firefox: hide scrollbar */
  -ms-overflow-style: none; /* IE/Edge */
}
.ypc-chips-wrap.org,
.ypc-chips-bar.org { display: flex; }
.ypc-chips-wrap::-webkit-scrollbar,
.ypc-chips-bar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.ypc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #fff;
  border: 1.2px solid var(--ypc-chip-border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #1A1A1A;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ypc-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.ypc-chip i { font-size: 13px; }

/* ─── Attached File Preview Chip ────────────────────────────────────────── */
.ypc-file-preview {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 0 12px 4px;
  background: #F1F8F5;
  border: 0.8px solid #C7E3D4;
  border-radius: 8px;
  flex-shrink: 0;
}
.ypc-file-preview.show { display: flex; }
.ypc-file-preview i { color: #22C55E; font-size: 18px; flex-shrink: 0; }
.ypc-file-preview-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: #1A1A1A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ypc-file-preview-remove,
.ypc-file-remove {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #E2E8F0;
  border: none;
  outline: none;
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}
.ypc-file-preview-remove:hover,
.ypc-file-remove:hover {
  background: #CBD5E1;
  color: #0F172A;
  transform: scale(1.08);
}

/* ─── Input Bar ─────────────────────────────────────────────────────────── */
.ypc-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 10px;
  background: #fff;
  border-top: 0.8px solid var(--ypc-input-border);
  flex-shrink: 0;
}
.ypc-input-attach,
#ypcAttachBtn,
#ypmAttachBtn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: #F8FAFC;
  border: 0.8px solid var(--ypc-input-border);
  color: #64748B;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  line-height: 1;
  transition: all 0.15s ease;
}
.ypc-input-attach:hover,
#ypcAttachBtn:hover,
#ypmAttachBtn:hover {
  background: #FFFBEB;
  color: var(--ypc-orange);
  border-color: var(--ypc-chip-border);
}
.ypc-input-field {
  flex: 1;
  border: 0.8px solid var(--ypc-input-border);
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 13.5px;
  background: #F8FAFC;
  resize: none;
  outline: none;
  color: #1A1A1A;
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
  transition: border-color 0.2s;
  font-family: inherit;
}
.ypc-input-field:focus { border-color: var(--ypc-chip-border); }
.ypc-input-field::placeholder { color: #94A3B8; }
.ypc-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ypc-header-bg);
  border: none;
  color: #1A1A1A;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}
.ypc-send-btn:hover { transform: scale(1.08); }
.ypc-send-btn:active { transform: scale(0.95); }

/* ─── Modals (Drive date picker / Confirm date) ─────────────────────────── */
.ypc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 10999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 480px) {
  .ypc-modal-overlay { align-items: center; padding: 20px; }
}
.ypc-modal {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 440px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 0 0 20px;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
  animation: ypModalIn 0.3s cubic-bezier(0.4,0,0.2,1);
}
@media (min-width: 480px) {
  .ypc-modal { border-radius: 20px; }
}
@keyframes ypModalIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ypc-modal-handle {
  width: 40px; height: 4px;
  background: #E2E8F0;
  border-radius: 2px;
  margin: 10px auto 4px;
}
.ypc-modal-header {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid #F1F5F9;
}
.ypc-modal-title { font-size: 16px; font-weight: 700; color: #0f172a; flex: 1; }
.ypc-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px;
}
.ypc-modal-body { padding: 16px 18px 0; }
.ypc-modal-footer { padding: 14px 18px 0; display: flex; gap: 10px; }
.ypc-modal-footer .ypc-btn-cancel {
  flex: 1;
  padding: 12px;
  background: #F1F5F9;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
}
.ypc-modal-footer .ypc-btn-confirm {
  flex: 2;
  padding: 12px;
  background: var(--ypc-header-bg);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #1A1A1A;
  cursor: pointer;
}

/* ─── Calendar ──────────────────────────────────────────────────────────── */
.ypc-calendar {
  width: 100%;
  font-size: 13px;
}
.ypc-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ypc-cal-nav button {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #1A1A1A;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
.ypc-cal-nav button:hover { background: #F1F5F9; }
.ypc-cal-nav span { font-weight: 700; font-size: 14px; color: #0f172a; }
.ypc-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}
.ypc-cal-dayname { font-size: 11px; font-weight: 600; color: #94A3B8; padding: 3px 0; }
.ypc-cal-day {
  padding: 7px 3px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: #0f172a;
  transition: background 0.15s;
  user-select: none;
}
.ypc-cal-day:hover:not(.disabled):not(.empty) { background: #FEF9C3; }
.ypc-cal-day.empty { cursor: default; }
.ypc-cal-day.disabled { color: #CBD5E1; cursor: not-allowed; }
.ypc-cal-day.selected { background: var(--ypc-header-bg); font-weight: 700; }
.ypc-cal-day.range { background: #FEF9C3; }
.ypc-cal-day.range-start, .ypc-cal-day.range-end { background: var(--ypc-header-bg); font-weight: 700; }

/* Date confirmation radio list */
.ypc-date-radio-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.ypc-date-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ypc-date-radio.selected { border-color: var(--ypc-header-bg); background: rgba(255,198,26,0.1); }
.ypc-date-radio i { font-size: 16px; color: #CBD5E1; }
.ypc-date-radio.selected i { color: var(--ypc-orange); }
.ypc-date-radio span { font-size: 14px; color: #1A1A1A; }
.ypc-date-radio.selected span { font-weight: 600; }

/* ─── Loading spinner in chat ────────────────────────────────────────────── */
.ypc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px;
}
.ypc-loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid #FDE68A;
  border-top-color: var(--ypc-orange);
  border-radius: 50%;
  animation: ypSpin 0.7s linear infinite;
}
@keyframes ypSpin { to { transform: rotate(360deg); } }

/* ─── My Messages Full Page (2-col layout) ──────────────────────────────── */
.ypm-page-wrap {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100dvh - 80px);
  gap: 0;
  border: 1px solid var(--ypc-input-border);
  border-radius: var(--ypc-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
@media (max-width: 768px) {
  .ypm-page-wrap { grid-template-columns: 1fr; height: auto; }
  .ypm-chat-col { display: none; }
  .ypm-page-wrap.chat-active .ypm-conv-col { display: none; }
  .ypm-page-wrap.chat-active .ypm-chat-col { display: flex; }
}

.ypm-conv-col {
  border-right: 1px solid var(--ypc-input-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.ypm-conv-header {
  padding: 16px;
  border-bottom: 1px solid var(--ypc-input-border);
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  background: #fff;
  flex-shrink: 0;
}
.ypm-chat-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--ypc-panel-bg);
}
.ypm-chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  gap: 12px;
}
.ypm-chat-placeholder i { font-size: 48px; color: #E2E8F0; }
.ypm-chat-placeholder p { font-size: 15px; font-weight: 500; }

/* ─── Attachment Download Modal ─────────────────────────────────────────── */
.ypc-att-modal-file-icon { font-size: 28px; color: #22C55E; }
.ypc-att-modal-filename { font-size: 15px; font-weight: 700; color: #0f172a; }
.ypc-att-modal-sub { font-size: 12px; color: #64748B; }
.ypc-att-modal-download-btn {
  width: 100%;
  padding: 12px;
  background: #F1F5F9;
  border: 1px solid var(--ypc-orange);
  border-radius: 10px;
  color: var(--ypc-orange);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.ypc-att-modal-download-btn:hover { background: #FEF2E8; }

/* Ensure explore create FABs on Job, Courses, Events pages stay below chat drawer */
body.ypc-open .yp-explore-create-fab-wrapper {
  z-index: 100 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ─── Homepage Under-Header Notification Dropdown ────────────────────────── */
.ypc-header-drop-notice {
  position: fixed;
  top: 104px; /* fallback, dynamically set in JS based on actual header height */
  left: 50%;
  transform: translate(-50%, -180%);
  z-index: 9995;
  background: #ffffff;
  border: 1.2px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.16), 0 4px 10px rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  padding: 9px 20px 9px 15px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  user-select: none;
  max-width: 90vw;
  box-sizing: border-box;
}
.ypc-header-drop-notice.show {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.ypc-drop-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
  flex-shrink: 0;
  animation: ypcDotPulse 1.8s infinite;
}
@keyframes ypcDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}
.ypc-drop-icon {
  color: #f59e0b;
  font-size: 13.5px;
  flex-shrink: 0;
}
.ypc-drop-text {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ypc-drop-arrow {
  color: #94a3b8;
  font-size: 10px;
  margin-left: 2px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.ypc-header-drop-notice:hover {
  border-color: #f59e0b;
  box-shadow: 0 12px 30px -4px rgba(245, 158, 11, 0.25), 0 4px 12px rgba(0,0,0,0.08);
}
.ypc-header-drop-notice:hover .ypc-drop-arrow {
  transform: translateX(2px);
  color: #f59e0b;
}
