/* The Verandah messenger (assets/cbb-verandah-chat.js). Room-page look: navy, gold, cream. */

.vc, .vc * { box-sizing: border-box; }
.vc [hidden] { display: none !important; }

.vc {
  position: relative;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  height: min(78vh, 760px);
  min-height: 480px;
  background: #0F1C36;
  border: 1px solid #C9A84C55;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: #f5f0e8;
  overflow: hidden;
  text-align: left;
}

.vc button { font: inherit; color: inherit; }

/* ── side column ── */
.vc-side {
  background: #13213D;
  border-right: 1px solid #C9A84C33;
  overflow-y: auto;
  padding: 1.1rem 0.9rem 1.4rem;
}
.vc-me { font-size: 0.98rem; color: #c8bfa8; line-height: 1.4; margin: 0 0.3rem 0.6rem; }
.vc-me b { color: #f5f0e8; font-weight: 600; }
.vc-me-biz { display: block; font-style: italic; color: #a89b7a; font-size: 0.9rem; }
.vc-head {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #a89b7a;
  margin: 1.2rem 0.3rem 0.5rem;
}
.vc-threads, .vc-residents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.vc-thread {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.1rem 0.5rem;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s;
}
.vc-thread:hover { background: rgba(201, 168, 76, 0.08); }
.vc-thread.is-current { background: rgba(201, 168, 76, 0.15); border-left-color: #C9A84C; }
.vc-thread-name {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: #f5f0e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vc-thread.is-lounge .vc-thread-name { color: #C9A84C; }
.vc-thread-preview {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: #a89b7a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vc-badge {
  display: inline-block;
  min-width: 1.3rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #C9A84C;
  color: #0d1b2a;
  font-family: Arial, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

.vc-search {
  width: 100%;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.98rem;
  color: #f5f0e8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #C9A84C44;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.4rem;
  outline: none;
}
.vc-search:focus { border-color: #C9A84C; }
.vc-search::placeholder { color: rgba(245, 240, 232, 0.3); }

.vc-person {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
}
.vc-person:hover { background: rgba(201, 168, 76, 0.08); }
.vc-avatar {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #C9A84C88;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  color: #C9A84C;
}
.vc-person-text { min-width: 0; display: flex; flex-direction: column; }
.vc-person-name { font-size: 1rem; color: #f5f0e8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-person-biz { font-size: 0.85rem; font-style: italic; color: #a89b7a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-none { font-size: 0.92rem; font-style: italic; color: #a89b7a; padding: 0.3rem 0.5rem; }

/* ── conversation ── */
.vc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.vc-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid #C9A84C33;
  background: #1B2A4A;
}
.vc-titles { flex: 1; min-width: 0; }
.vc-title {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #f5f0e8;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vc-sub { font-size: 0.92rem; font-style: italic; color: #a89b7a; margin: 0.1rem 0 0; }

.vc-teams, .vc-send, .vc-invite-join, .vc-menu-btn.is-teams {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0d1b2a !important;
  background: #C9A84C;
  border: none;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.vc-teams { padding: 0.65rem 0.9rem; white-space: nowrap; }
.vc-teams:hover:not(:disabled), .vc-send:hover:not(:disabled), .vc-invite-join:hover, .vc-menu-btn.is-teams:hover { background: #e0bc60; }
.vc-teams:disabled, .vc-send:disabled { opacity: 0.5; cursor: default; }

.vc-drawer-btn {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Cinzel', serif !important;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #C9A84C !important;
  background: transparent;
  border: 1px solid #C9A84C;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
}

.vc-log { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 1.2rem; }
.vc-earlier {
  display: block;
  margin: 0 auto 1rem;
  font-family: 'Cinzel', serif !important;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #C9A84C !important;
  background: transparent;
  border: 1px solid #C9A84C66;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}
.vc-empty { text-align: center; font-style: italic; color: #a89b7a; font-size: 1.05rem; margin: 3rem auto; max-width: 420px; line-height: 1.6; }

.vc-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.vc-msg {
  align-self: flex-start;
  max-width: 78%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #C9A84C22;
  border-radius: 2px 12px 12px 12px;
  padding: 0.5rem 0.8rem 0.35rem;
}
.vc-msg.is-mine {
  align-self: flex-end;
  background: rgba(201, 168, 76, 0.13);
  border-color: #C9A84C55;
  border-radius: 12px 2px 12px 12px;
}
.vc-msg-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.15rem; }
.vc-who {
  font-family: 'Cinzel', serif !important;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #C9A84C !important;
  background: none;
  border: none;
  padding: 0;
}
button.vc-who { cursor: pointer; }
button.vc-who:hover, button.vc-who:focus-visible { text-decoration: underline; }
.vc-biz { font-size: 0.85rem; font-style: italic; color: #a89b7a; }
.vc-time { margin-left: auto; font-family: Arial, sans-serif; font-size: 0.66rem; color: #8590a6; }
.vc-body {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.45;
  color: #f5f0e8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.vc-body a { color: #e0bc60; }
.vc-actions { display: flex; justify-content: flex-end; min-height: 1rem; opacity: 0; transition: opacity 0.15s; }
.vc-msg:hover .vc-actions, .vc-msg:focus-within .vc-actions { opacity: 1; }
@media (hover: none) { .vc-actions { opacity: 0.75; } }
.vc-act {
  font-family: Arial, sans-serif !important;
  font-size: 0.66rem;
  color: #a89b7a !important;
  background: none;
  border: none;
  padding: 0.1rem 0 0;
  text-decoration: underline;
  cursor: pointer;
}

.vc-invite {
  margin-top: 0.25rem;
  border: 1px solid #C9A84C;
  background: rgba(201, 168, 76, 0.1);
  padding: 0.75rem 0.95rem 0.85rem;
}
.vc-invite-title {
  margin: 0 0 0.25rem;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #C9A84C;
}
.vc-invite-when { margin: 0; font-size: 1rem; color: #c8bfa8; line-height: 1.45; }
.vc-invite-join { display: inline-block; margin-top: 0.6rem; padding: 0.6rem 1.1rem; text-decoration: none; }

.vc-status { margin: 0; padding: 0.45rem 1.2rem; font-size: 0.95rem; font-style: italic; color: #e0bc60; border-top: 1px solid #C9A84C22; }
.vc-status a { color: #f5f0e8; }

.vc-compose {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem 1rem;
  border-top: 1px solid #C9A84C33;
  background: #13213D;
}
.vc-compose textarea {
  flex: 1;
  resize: none;
  max-height: 160px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.4;
  color: #f5f0e8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #C9A84C44;
  padding: 0.6rem 0.8rem;
  outline: none;
}
.vc-compose textarea:focus { border-color: #C9A84C; background: rgba(255, 255, 255, 0.07); }
.vc-compose textarea::placeholder { color: rgba(245, 240, 232, 0.3); }
.vc-send { padding: 0.8rem 1.3rem; }

/* ── person menu ── */
.vc-menu {
  position: absolute;
  z-index: 30;
  width: 248px;
  background: #0F1C36;
  border: 1px solid #C9A84C;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.vc-menu-name { margin: 0; font-family: 'Cinzel', serif; font-size: 0.78rem; letter-spacing: 0.06em; color: #f5f0e8; }
.vc-menu-biz { margin: -0.2rem 0 0.2rem; font-size: 0.92rem; font-style: italic; color: #a89b7a; }
.vc-menu-btn {
  width: 100%;
  font-family: 'Cinzel', serif !important;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #C9A84C !important;
  background: transparent;
  border: 1px solid #C9A84C;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
}
.vc-menu-btn:hover { background: rgba(201, 168, 76, 0.12); }
.vc-menu-close {
  align-self: center;
  font-family: Arial, sans-serif !important;
  font-size: 0.7rem;
  color: #a89b7a !important;
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.2rem;
}

.vc button:focus-visible, .vc a:focus-visible { outline: 2px solid #e0bc60; outline-offset: 2px; }

/* ── phones ── */
@media (max-width: 760px) {
  .vc { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 90px); min-height: 440px; }
  .vc-side {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: min(86%, 320px);
    transform: translateX(-102%);
    transition: transform 0.25s ease;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.5);
  }
  .vc.is-drawer-open .vc-side { transform: none; }
  .vc-drawer-btn { display: inline-flex; }
  .vc-bar { padding: 0.7rem 0.8rem; gap: 0.6rem; }
  .vc-teams { padding: 0.55rem 0.6rem; font-size: 0.55rem; white-space: normal; max-width: 9rem; }
  .vc-log { padding: 0.8rem; }
  .vc-msg { max-width: 92%; }
  .vc-compose { padding: 0.6rem 0.8rem 0.8rem; }
  .vc-menu { left: 0.8rem !important; right: 0.8rem; width: auto; top: auto !important; bottom: 0.8rem; }
}
