/* ══════════════════════════════════════════════════════════════════
   PREMIUM LANE, AI CHAT WIDGET
   ══════════════════════════════════════════════════════════════════ */

/* ── Floating trigger button ──────────────────────────────────── */
#pl-chat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 300;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #1C1917;
  border: 1px solid rgba(202,138,4,0.45);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 0 0 rgba(202,138,4,0);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 0;
}
#pl-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
}
#pl-chat-btn svg { color: #CA8A04; flex-shrink: 0; }

/* Pulse ring on first load */
#pl-chat-btn.pulse {
  animation: pl-pulse 2s ease-out 3;
}
@keyframes pl-pulse {
  0%   { box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 0 0 rgba(202,138,4,0.5); }
  70%  { box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 0 14px rgba(202,138,4,0); }
  100% { box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 0 0 rgba(202,138,4,0); }
}

/* Unread badge */
#pl-chat-badge {
  position: absolute;
  top: -3px; right: -3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #A16207;
  border: 2px solid #F5F0E8;
  font-size: 10px; font-weight: 700;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s, transform 0.3s;
  font-family: 'Montserrat', sans-serif;
}
#pl-chat-badge.show {
  opacity: 1;
  transform: scale(1);
}

/* ── Chat window ──────────────────────────────────────────────── */
#pl-chat-window {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 300;
  width: 372px;
  height: 600px;
  max-height: calc(100dvh - 130px);
  background: #141210;
  border-radius: 20px;
  border: 1px solid rgba(202,138,4,0.18);
  box-shadow: 0 28px 72px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.32,0.72,0,1),
              opacity 0.38s cubic-bezier(0.32,0.72,0,1);
  font-family: 'Montserrat', 'Plus Jakarta Sans', sans-serif;
}
#pl-chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ───────────────────────────────────────────────────── */
.pl-chat-header {
  padding: 14px 18px;
  background: #0d0b09;
  border-bottom: 1px solid rgba(202,138,4,0.12);
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.pl-chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(202,138,4,0.12);
  border: 1px solid rgba(202,138,4,0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pl-chat-avatar svg { color: #CA8A04; }
.pl-chat-header-info { flex: 1; min-width: 0; }
.pl-chat-header-name {
  font-size: 13px; font-weight: 600;
  color: #fff; letter-spacing: 0.02em;
  margin-bottom: 2px;
}
.pl-chat-header-status {
  font-size: 10.5px;
  color: rgba(255,255,255,0.4);
  display: flex; align-items: center; gap: 5px;
  letter-spacing: 0.03em;
}
.pl-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
}
.pl-chat-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.35);
  padding: 4px; display: flex;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.pl-chat-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* ── Messages ─────────────────────────────────────────────────── */
.pl-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(202,138,4,0.15) transparent;
}
.pl-chat-messages::-webkit-scrollbar { width: 3px; }
.pl-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(202,138,4,0.2); border-radius: 2px;
}

.pl-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: pl-msg-in 0.25s ease forwards;
}
@keyframes pl-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pl-msg.bot  { align-self: flex-start; }
.pl-msg.user { align-self: flex-end; }

.pl-msg-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.65;
  font-weight: 400;
  word-break: break-word;
}
.pl-msg.bot .pl-msg-bubble {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.82);
  border-bottom-left-radius: 4px;
}
.pl-msg.user .pl-msg-bubble {
  background: #A16207;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.pl-msg-time {
  font-size: 9.5px;
  color: rgba(255,255,255,0.22);
  margin-top: 3px;
  letter-spacing: 0.04em;
}
.pl-msg.user .pl-msg-time { text-align: right; }

/* Typing dots */
.pl-typing {
  display: flex; gap: 4px; align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.07);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.pl-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.35);
  animation: pl-bounce 1.3s infinite ease-in-out;
}
.pl-typing span:nth-child(2) { animation-delay: 0.16s; }
.pl-typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes pl-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ── Quick replies ─────────────────────────────────────────────── */
.pl-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 14px 10px;
  flex-shrink: 0;
}
.pl-quick-btn {
  background: rgba(202,138,4,0.08);
  border: 1px solid rgba(202,138,4,0.28);
  border-radius: 50px;
  padding: 5px 13px;
  font-size: 11px;
  color: #CA8A04;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.04em;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.pl-quick-btn:hover {
  background: rgba(202,138,4,0.18);
  border-color: rgba(202,138,4,0.5);
  color: #fff;
}

/* ── Input row ─────────────────────────────────────────────────── */
.pl-chat-input-row {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
#pl-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  padding: 9px 15px;
  font-size: 12.5px;
  color: #fff;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}
#pl-chat-input::placeholder { color: rgba(255,255,255,0.28); }
#pl-chat-input:focus { border-color: rgba(202,138,4,0.45); }

#pl-chat-attach {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.4);
  transition: color 0.2s, border-color 0.2s;
}
#pl-chat-attach:hover { color: #CA8A04; border-color: rgba(202,138,4,0.5); }

#pl-chat-send {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #A16207;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}
#pl-chat-send:hover { background: #CA8A04; transform: scale(1.05); }
#pl-chat-send svg { color: #fff; }

/* ── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 500px) {
  #pl-chat-window {
    left: 10px; right: 10px;
    width: auto;
    bottom: 86px;
    /* never taller than the visible screen minus button + margins */
    max-height: min(480px, calc(100dvh - 110px));
  }
  #pl-chat-btn {
    right: 18px;
    bottom: 18px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   HOME / MESSAGES / TABS  (v6 redesign)
   ══════════════════════════════════════════════════════════════════ */

#pl-view-home, #pl-view-messages, #pl-view-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#pl-view-messages, #pl-view-chat { display: none; }
#pl-chat-topbar { display: none; }

.pl-chat-back {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.45);
  padding: 4px; display: flex;
  border-radius: 6px;
  margin-right: -3px;
  transition: color 0.2s, background 0.2s;
}
.pl-chat-back:hover { color: #CA8A04; background: rgba(202,138,4,0.08); }

/* ── Home hero ─────────────────────────────────────────────────── */
.pl-home-hero {
  padding: 20px 20px 24px;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(202,138,4,0.16), transparent 55%),
    linear-gradient(160deg, #0d0b09 0%, #171310 100%);
  border-bottom: 1px solid rgba(202,138,4,0.1);
  flex-shrink: 0;
}
.pl-home-brandrow {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
/* MIUUM text wordmark, placeholder until the real logo art lands. */
.pl-home-logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .30em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
}
.pl-home-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.35);
  padding: 4px; display: flex;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.pl-home-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.pl-home-welcome {
  font-size: 21px; font-weight: 500;
  color: rgba(255,255,255,0.45);
  line-height: 1.25;
}
.pl-home-welcome b { color: rgba(255,255,255,0.7); font-weight: 600; }
.pl-home-title {
  font-size: 22px; font-weight: 700; color: #fff;
  letter-spacing: 0.01em;
}

/* ── Home body & cards ─────────────────────────────────────────── */
.pl-home-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.pl-card {
  background: #1d1915;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.pl-help-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 13px 15px;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
  font-size: 12.5px; text-align: left;
  color: rgba(255,255,255,0.82);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s, color 0.15s;
}
.pl-help-row:last-child { border-bottom: none; }
.pl-help-row svg { color: #CA8A04; flex-shrink: 0; }
.pl-help-row:hover { background: rgba(202,138,4,0.06); color: #fff; }

.pl-chat-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  border: 1px solid rgba(202,138,4,0.3) !important;
  background: linear-gradient(135deg, rgba(202,138,4,0.1), rgba(202,138,4,0.03)) , #1d1915;
  transition: border-color 0.2s, transform 0.2s;
}
.pl-chat-card:hover { border-color: rgba(202,138,4,0.6) !important; transform: translateY(-1px); }
.pl-chat-card-title { font-size: 14px; font-weight: 700; color: #CA8A04; margin-bottom: 3px; }
.pl-chat-card-sub { font-size: 11.5px; color: rgba(255,255,255,0.5); }
.pl-chat-card-ico {
  width: 40px; height: 40px; border-radius: 50%;
  background: #A16207; color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.pl-hours-card {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 15px;
  font-size: 11px; color: rgba(255,255,255,0.55);
  letter-spacing: 0.02em;
}
.pl-hours-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; flex-shrink: 0;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
}

/* ── Messages view ─────────────────────────────────────────────── */
.pl-msgs-titlerow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.pl-msgs-title { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 0.02em; }
#pl-history {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.pl-history-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  background: #1d1915;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.2s, background 0.15s;
  flex-shrink: 0;
}
.pl-history-row:hover { border-color: rgba(202,138,4,0.4); background: #221d18; }
.pl-history-row > svg { color: rgba(202,138,4,0.7); flex-shrink: 0; }
.pl-history-main { flex: 1; min-width: 0; }
.pl-history-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pl-history-topic {
  font-size: 12px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-history-when { font-size: 10px; color: rgba(255,255,255,0.35); flex-shrink: 0; }
.pl-history-preview {
  margin-top: 3px;
  font-size: 11.5px; color: rgba(255,255,255,0.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-history-meta { margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.pl-pill {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px;
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.15);
}
.pl-pill-open { color: #22c55e; border-color: rgba(34,197,94,0.4); }
.pl-history-agent { font-size: 10px; color: rgba(202,138,4,0.8); }
.pl-history-empty {
  padding: 40px 20px; text-align: center;
  font-size: 12px; color: rgba(255,255,255,0.35);
  line-height: 1.7;
}
.pl-newchat-btn {
  margin: 10px 12px 12px;
  padding: 12px;
  border-radius: 12px;
  background: #A16207; color: #fff;
  border: none; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 0.2s;
  flex-shrink: 0;
}
.pl-newchat-btn:hover { background: #CA8A04; }

/* ── Bottom tabs ───────────────────────────────────────────────── */
.pl-tabs {
  display: flex;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: #0d0b09;
  flex-shrink: 0;
}
.pl-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0 11px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35);
  transition: color 0.2s;
}
.pl-tab:hover { color: rgba(255,255,255,0.6); }
.pl-tab.active { color: #CA8A04; }

/* input disabled state (viewing an ended chat) */
#pl-chat-input:disabled { opacity: 0.45; cursor: not-allowed; }
