/* ============================================================
   AMK MESSAGING — Full-Page Messenger Split Layout
   LEFT: conversation list   RIGHT: chat thread
   Aesthetic: 3D Neon Glassmorphism / Deep Void Dark
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ============================================================
   RESET + ROOT VARS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --void:          #060510;
  --deep:          #0c0a1d;
  --panel-l:       rgba(10, 8, 24, 0.92);
  --panel-r:       rgba(13, 10, 28, 0.78);
  --glass:         rgba(255,255,255,0.055);
  --glass-hi:      rgba(255,255,255,0.10);
  --border:        rgba(255,255,255,0.07);
  --border-hi:     rgba(168,85,247,0.30);

  --pink:          #f43f8e;
  --purple:        #a855f7;
  --blue:          #4f8ef7;
  --cyan:          #22d3ee;

  --grad-send:     linear-gradient(135deg, #f43f8e 0%, #a855f7 55%, #4f8ef7 100%);
  --grad-accent:   linear-gradient(135deg, #a855f7, #f43f8e);
  --grad-bg:       radial-gradient(ellipse 80% 60% at 20% 10%, rgba(168,85,247,0.18) 0%, transparent 65%),
                   radial-gradient(ellipse 60% 50% at 80% 90%, rgba(244,63,142,0.14) 0%, transparent 60%),
                   radial-gradient(ellipse 50% 40% at 60% 40%, rgba(79,142,247,0.10) 0%, transparent 55%);

  --text:          #ede9ff;
  --text-dim:      rgba(237,233,255,0.50);
  --text-xdim:     rgba(237,233,255,0.30);

  --radius-xl:     22px;
  --radius-lg:     16px;
  --radius-md:     12px;
  --radius-pill:   999px;

  --font-head:     'Syne', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --ease:          cubic-bezier(0.4,0,0.2,1);
  --t:             0.22s;
}

/* ============================================================
   PAGE WRAPPER — full-height two-column layout
   ============================================================ */
.amk-msg-page {
  display: flex;
  height: 100vh;
  min-height: 0;
  background: var(--void);
  background-image: var(--grad-bg);
  font-family: var(--font-body);
  color: var(--text);
  overflow: hidden;
  position: relative;
}

/* Animated ambient orbs in background */
.amk-msg-page::before,
.amk-msg-page::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  animation: amkOrb 8s ease-in-out infinite alternate;
}
.amk-msg-page::before {
  width: 500px; height: 500px;
  top: -120px; left: -80px;
  background: radial-gradient(circle, rgba(168,85,247,0.22) 0%, transparent 70%);
}
.amk-msg-page::after {
  width: 400px; height: 400px;
  bottom: -100px; right: -60px;
  background: radial-gradient(circle, rgba(244,63,142,0.18) 0%, transparent 70%);
  animation-delay: -4s;
}
@keyframes amkOrb {
  from { transform: scale(1) translate(0,0); }
  to   { transform: scale(1.15) translate(30px, 20px); }
}

/* ============================================================
   LEFT SIDEBAR — conversation list
   ============================================================ */
.amk-sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel-l);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border-right: 1px solid var(--border);
  position: relative;
  z-index: 2;
  box-shadow:
    4px 0 40px rgba(0,0,0,0.5),
    inset -1px 0 0 rgba(255,255,255,0.04);
}

/* Sidebar top neon line */
.amk-sidebar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-send);
  opacity: 0.6;
}

/* ── Sidebar Header ── */
.amk-sidebar-head {
  padding: 24px 20px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.amk-sidebar-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--grad-send);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
}

/* Search bar */
.amk-search {
  position: relative;
}
.amk-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.amk-search input::placeholder { color: var(--text-xdim); }
.amk-search input:focus {
  border-color: rgba(168,85,247,0.5);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}
.amk-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-xdim);
  font-size: 14px;
  pointer-events: none;
}

/* ── Conversation list scroll area ── */
.amk-convo-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168,85,247,0.25) transparent;
}
.amk-convo-list::-webkit-scrollbar { width: 4px; }
.amk-convo-list::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.3); border-radius: 4px; }

/* Empty state */
.amk-inbox-empty {
  color: var(--text-dim);
  text-align: center;
  padding: 40px 20px;
  font-size: 14px;
  font-family: var(--font-body);
}

/* ============================================================
   INBOX ITEM (conversation row in sidebar)
   ============================================================ */
.amk-inbox-item {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  margin-bottom: 4px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  user-select: none;
  transition:
    background var(--t) var(--ease),
    border-color var(--t) var(--ease),
    transform var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}

/* Left accent bar */
.amk-inbox-item::before {
  content: '';
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity var(--t) var(--ease), top var(--t) var(--ease), bottom var(--t) var(--ease);
}

.amk-inbox-item:hover {
  background: var(--glass-hi);
  border-color: rgba(168,85,247,0.22);
  transform: translateX(3px);
  box-shadow:
    0 4px 24px rgba(0,0,0,0.35),
    0 0 0 1px rgba(168,85,247,0.10);
}
.amk-inbox-item:hover::before { opacity: 0.7; top: 12%; bottom: 12%; }
.amk-inbox-item:active { transform: translateX(1px); }

/* ACTIVE (currently selected) */
.amk-inbox-item.is-active {
  background: linear-gradient(135deg,
    rgba(168,85,247,0.18) 0%,
    rgba(244,63,142,0.10) 100%);
  border-color: var(--border-hi);
  transform: translateX(4px);
  box-shadow:
    0 6px 28px rgba(168,85,247,0.20),
    0 0 0 1px rgba(168,85,247,0.15),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
.amk-inbox-item.is-active::before {
  opacity: 1; top: 8%; bottom: 8%;
  box-shadow: 0 0 10px rgba(244,63,142,0.6);
}

/* UNREAD state */
.amk-inbox-item.is-unread {
  background: linear-gradient(135deg,
    rgba(168,85,247,0.13) 0%,
    rgba(79,142,247,0.08) 100%);
  border-color: rgba(168,85,247,0.28);
}
.amk-inbox-item.is-unread::before { opacity: 0.8; top: 0; bottom: 0; border-radius: 0 3px 3px 0; }
.amk-inbox-item.is-unread .amk-inbox-body strong { color: #fff; font-weight: 600; }
.amk-inbox-item.is-unread .amk-inbox-preview    { color: rgba(255,255,255,0.8); font-weight: 500; }

/* Avatar */
.amk-inbox-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.10),
    0 0 16px rgba(168,85,247,0.35);
  transition: box-shadow var(--t) var(--ease);
  position: relative;
}
.amk-inbox-item.is-active .amk-inbox-avatar,
.amk-inbox-item:hover .amk-inbox-avatar {
  box-shadow:
    0 0 0 2px rgba(244,63,142,0.5),
    0 0 20px rgba(244,63,142,0.4);
}

/* Online dot on avatar */
.amk-inbox-avatar-wrap { position: relative; flex-shrink: 0; }
.amk-inbox-online {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 11px; height: 11px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--deep);
  box-shadow: 0 0 6px rgba(34,197,94,0.8);
}

/* Body text */
.amk-inbox-body { flex: 1; min-width: 0; }
.amk-inbox-body strong {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-body);
}
.amk-inbox-preview {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-body);
}

/* Meta (dot + chevron) */
.amk-inbox-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.amk-unread-dot {
  width: 9px; height: 9px;
  background: var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 7px rgba(244,63,142,0.8);
  animation: amkDotPulse 1.8s ease-in-out infinite;
}
@keyframes amkDotPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(244,63,142,0.6); transform: scale(1); }
  50%      { box-shadow: 0 0 0 5px rgba(244,63,142,0); transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .amk-unread-dot { animation: none; }
}

.amk-inbox-chevron {
  font-size: 16px;
  color: var(--text-xdim);
  transition: color var(--t) var(--ease), transform var(--t) var(--ease);
}
.amk-inbox-item:hover .amk-inbox-chevron,
.amk-inbox-item.is-active .amk-inbox-chevron {
  color: var(--pink);
  transform: translateX(2px);
}

.amk-inbox-item:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* ============================================================
   RIGHT PANEL — chat area
   ============================================================ */
.amk-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel-r);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  position: relative;
  z-index: 1;
}

/* Empty state when no conversation selected */
.amk-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-dim);
  font-size: 15px;
  font-family: var(--font-body);
}
.amk-chat-empty__icon {
  font-size: 52px;
  filter: drop-shadow(0 0 18px rgba(168,85,247,0.45));
  animation: amkFloat 3s ease-in-out infinite;
}
@keyframes amkFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.amk-chat-empty__text { font-size: 14px; color: var(--text-xdim); }

/* ── Chat Header ── */
.amk-chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  position: relative;
}
/* Top neon line */
.amk-chat-header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--grad-send);
  opacity: 0.3;
}

.amk-chat-header-avatar-wrap { position: relative; flex-shrink: 0; }
.amk-chat-header-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--grad-send);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.12),
    0 0 18px rgba(244,63,142,0.4);
}
.amk-chat-header-online {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 11px; height: 11px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--deep);
  box-shadow: 0 0 6px rgba(34,197,94,0.8);
}

.amk-chat-header-info { flex: 1; min-width: 0; }
.amk-chat-header-name {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  background: linear-gradient(90deg, #fff 30%, #d8b4fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.amk-chat-header-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status line (Sending… / errors) */
#amkMsgStatus {
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 4px 22px 0;
  font-family: var(--font-body);
  min-height: 18px;
  flex-shrink: 0;
}

/* ── Thread (scrollable messages) ── */
.amk-glass-thread, #amkMsgThread {
  flex: 1;
  overflow-y: auto;
  padding: 22px 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168,85,247,0.2) transparent;
}
.amk-glass-thread::-webkit-scrollbar,
#amkMsgThread::-webkit-scrollbar { width: 4px; }
.amk-glass-thread::-webkit-scrollbar-thumb,
#amkMsgThread::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.28); border-radius: 4px; }

/* ============================================================
   MESSAGE ROWS
   ============================================================ */
.amk-msg-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 100%;
  animation: amkMsgIn 0.25s var(--ease) both;
}
@keyframes amkMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.amk-row-buyer  { align-items: flex-start; }
.amk-row-seller { align-items: flex-end; }

/* Sender name label */
.amk-msg-name {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 0 6px;
  letter-spacing: 0.2px;
}
.amk-row-buyer  .amk-msg-name { color: rgba(79,142,247,0.85); text-align: left; }
.amk-row-seller .amk-msg-name { color: rgba(244,63,142,0.85); text-align: right; }

/* ============================================================
   BUBBLES
   ============================================================ */
.amk-bubble {
  max-width: 68%;
  padding: 11px 16px;
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  word-break: break-word;
  position: relative;
}

/* Incoming (other user) — frosted glass */
.amk-buyer {
  background: rgba(255,255,255,0.085);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px 18px 18px 4px;
  color: var(--text);
  backdrop-filter: blur(12px);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.30),
    inset 0 1px 0 rgba(255,255,255,0.10);
}

/* Outgoing (current user) — vivid neon gradient */
.amk-seller {
  background: var(--grad-send);
  border: none;
  border-radius: 18px 18px 4px 18px;
  color: #fff;
  box-shadow:
    0 4px 20px rgba(168,85,247,0.45),
    0 0 0 1px rgba(255,255,255,0.10),
    inset 0 1px 0 rgba(255,255,255,0.25);
}

/* Timestamp */
.amk-time {
  font-size: 10.5px;
  font-family: var(--font-body);
  color: var(--text-xdim);
  line-height: 1;
  padding: 0 6px;
}
.amk-row-buyer  .amk-time { text-align: left; }
.amk-row-seller .amk-time { text-align: right; }

/* ============================================================
   INPUT AREA
   ============================================================ */
.amk-glass-input {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  background: linear-gradient(0deg,
    rgba(6,4,18,0.65) 0%,
    rgba(6,4,18,0.30) 100%);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.amk-glass-input textarea,
#amkMsgText {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 130px;
  padding: 13px 18px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 26px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  outline: none;
  transition:
    border-color var(--t) var(--ease),
    background var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}
.amk-glass-input textarea::placeholder,
#amkMsgText::placeholder { color: var(--text-xdim); }
.amk-glass-input textarea:focus,
#amkMsgText:focus {
  border-color: rgba(168,85,247,0.55);
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.14), inset 0 2px 4px rgba(0,0,0,0.3);
}

/* Send button wrapper */
.amk-send-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Send button — circular neon */
#amkMsgSend,
.amk-glass-input button[id="amkMsgSend"] {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--grad-send);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 0 20px rgba(168,85,247,0.55),
    0 6px 20px rgba(244,63,142,0.35),
    inset 0 1px 0 rgba(255,255,255,0.30);
  transition:
    transform var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}
#amkMsgSend:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow:
    0 0 30px rgba(168,85,247,0.75),
    0 8px 28px rgba(244,63,142,0.50),
    inset 0 1px 0 rgba(255,255,255,0.40);
}
#amkMsgSend:active { transform: scale(0.95); }

/* ============================================================
   PROHIBITED WORD WARNING
   ============================================================ */
.amk-msg-warn {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  background: linear-gradient(135deg,
    rgba(239,68,68,0.97) 0%,
    rgba(190,18,60,0.97) 100%);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1.3;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,120,120,0.35);
  box-shadow:
    0 0 22px rgba(239,68,68,0.55),
    0 8px 18px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.18);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  animation: amkWarnGlow 1.8s ease-in-out infinite;
}
.amk-msg-warn[hidden]  { display: none; }
.amk-msg-warn__icon    { font-size: 14px; }
.amk-msg-warn::after {
  content: '';
  position: absolute;
  top: 100%; right: 18px;
  border: 6px solid transparent;
  border-top-color: rgba(190,18,60,0.97);
}
@keyframes amkWarnGlow {
  0%,100% { box-shadow: 0 0 22px rgba(239,68,68,0.50), 0 8px 18px rgba(0,0,0,0.55); }
  50%      { box-shadow: 0 0 36px rgba(239,68,68,0.90), 0 8px 18px rgba(0,0,0,0.55); }
}
@keyframes amkWarnShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-5px); }
  40%     { transform: translateX(5px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}
.amk-msg-warn.is-shake {
  animation: amkWarnShake 0.45s ease-in-out, amkWarnGlow 1.8s ease-in-out 0.45s infinite;
}

/* ============================================================
   UNREAD BADGE (nav header)
   ============================================================ */
.amk-msg-icon-wrapper {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.amk-msg-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--grad-send);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-body);
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 18px;
  box-shadow: 0 0 10px rgba(244,63,142,0.8);
  margin-top: 4px;
}

/* ============================================================
   MODAL FALLBACK — keep .amk-glass-modal working if still used
   (e.g. from listing "Message" button in other pages)
   ============================================================ */
.amk-glass-modal {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at 40% 30%,
    rgba(100,40,200,0.28) 0%,
    rgba(10,8,25,0.88) 60%,
    rgba(0,0,0,0.96) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  z-index: 99999;
}

.amk-glass-box {
  width: 500px;
  max-width: calc(100vw - 24px);
  max-height: 84vh;
  margin: 5vh auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg,
    rgba(22,16,50,0.82) 0%,
    rgba(10,8,28,0.92) 100%);
  backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.12),
    0 0 50px rgba(168,85,247,0.24),
    0 40px 80px rgba(0,0,0,0.75),
    inset 0 1px 0 rgba(255,255,255,0.10);
  animation: amkModalGlow 5s ease-in-out infinite;
  font-family: var(--font-body);
  color: var(--text);
}
@keyframes amkModalGlow {
  0%,100% { box-shadow: 0 0 0 1px rgba(168,85,247,0.12), 0 0 50px rgba(168,85,247,0.22), 0 40px 80px rgba(0,0,0,0.75), inset 0 1px 0 rgba(255,255,255,0.10); }
  50%      { box-shadow: 0 0 0 1px rgba(244,63,142,0.18), 0 0 65px rgba(244,63,142,0.28), 0 40px 80px rgba(0,0,0,0.75), inset 0 1px 0 rgba(255,255,255,0.14); }
}

.amk-glass-header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 20px 14px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.07) 0%,
    rgba(255,255,255,0.02) 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.amk-glass-header__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.amk-glass-header__title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(90deg, #fff 0%, #d8b4fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.amk-glass-header__subtitle {
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.amk-glass-header__subtitle:empty { display: none; }
.amk-glass-header button {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  width: 34px; height: 34px;
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), transform var(--t), color var(--t);
  flex-shrink: 0;
}
.amk-glass-header button:hover {
  background: rgba(244,63,142,0.22);
  border-color: rgba(244,63,142,0.5);
  color: #fff;
  transform: rotate(90deg);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 680px) {
  .amk-msg-page { flex-direction: column; }

  .amk-sidebar {
    width: 100%;
    height: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .amk-sidebar.is-hidden { display: none; }

  .amk-chat-panel {
    height: 100%;
    position: fixed;
    inset: 0;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s var(--ease);
  }
  .amk-chat-panel.is-open {
    transform: translateX(0);
  }

  .amk-bubble { max-width: 85%; }
  .amk-msg-warn { font-size: 10.5px; padding: 6px 10px; }
}

/* ============================================================
   EXTRA DETAILS — listing label, back button, search filter
   ============================================================ */

/* Listing name under contact name in sidebar */
.amk-inbox-listing {
  font-size: 10.5px;
  color: rgba(1, 22, 69, 0.829);
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-body);
}

/* Back button (mobile only) */
.amk-chat-back {
  display: none;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t) var(--ease);
}
.amk-chat-back:hover { background: rgba(85, 177, 247, 0.2); }
@media (max-width: 680px) {
  .amk-chat-back { display: flex; }
}

/* Filtered-out rows via JS search */
.amk-inbox-item.is-hidden-search { display: none; }

/* ============================================================
   THEME INTEGRATION FIXES
   Force the messages page to fill the full viewport and
   escape the theme's narrow content container.
   ============================================================ */

/* Break out of theme content container */
.amk-msg-page {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  height: calc(100vh - 0px); /* subtract header height if needed */
}

/* Hide page title on the messages page (WP adds <h1> above shortcode) */
.page-id-messages .entry-title,
.page-template-default .entry-title,
body.page-messages .entry-title,
.page .amk-msg-page ~ h1,
.page h1.entry-title:has(~ .amk-msg-page) {
  display: none !important;
}

/* Remove any padding/margin the theme adds around page content
   so the messenger fills edge-to-edge */
.page .entry-content:has(.amk-msg-page),
.single .entry-content:has(.amk-msg-page) {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
}

/* Ensure site body doesn't clip the full-height layout */
body:has(.amk-msg-page) {
  overflow: hidden;
}

/* Remove any extra heading "Message Box" that old shortcode added */
.amk-inbox-wrap,
.amk-inbox-heading {
  display: none;
}
/* ============================================================
   ▸▸▸ MESSENGER-STYLE LAYOUT for /messages/ page
   ▸▸▸ Append to the END of ultra-msg.css
   ▸▸▸
   ▸▸▸ Goal (matches Facebook Messenger behavior):
   ▸▸▸   • On every screen size — sidebar (user list) is the
   ▸▸▸     full content area by default
   ▸▸▸   • Chat panel is HIDDEN until a user is tapped
   ▸▸▸   • Tap a user → chat slides in, sidebar slides out
   ▸▸▸   • Back button (‹) returns to sidebar
   ▸▸▸
   ▸▸▸ The JS already handles the toggle (is-open / is-hidden);
   ▸▸▸ we just extend the existing mobile rules to ALL widths.
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   1. Override the desktop two-column layout
   The original CSS uses display:flex with both sidebar and
   chat-panel visible. Override so the page is a positioned
   container and only ONE pane shows at a time.
   ──────────────────────────────────────────────────────────── */
.amk-msg-page {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 120px) !important;     /* viewport minus header/footer */
    min-height: 500px !important;
    margin: 0 auto !important;
    overflow: hidden !important;
}


/* ────────────────────────────────────────────────────────────
   2. Sidebar (conversation list) — full width by default
   ──────────────────────────────────────────────────────────── */
.amk-msg-page .amk-sidebar {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    border-right: none !important;
    border-bottom: none !important;
    z-index: 1 !important;
    transform: translateX(0) !important;
    transition: transform 0.3s ease !important;
}

/* When chat is open on desktop too, slide sidebar out to the left */
.amk-msg-page .amk-sidebar.is-hidden {
    transform: translateX(-100%) !important;
    pointer-events: none !important;
}


/* ────────────────────────────────────────────────────────────
   3. Chat panel — HIDDEN by default, slides in when active
   ──────────────────────────────────────────────────────────── */
.amk-msg-page .amk-chat-panel {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2 !important;
    transform: translateX(100%) !important;     /* off-screen right */
    transition: transform 0.3s ease !important;
    background: var(--surface, #0e1626) !important;
}

.amk-msg-page .amk-chat-panel.is-open {
    transform: translateX(0) !important;        /* slide in */
}


/* ────────────────────────────────────────────────────────────
   4. Back button — visible on ALL screens (not just mobile)
   The original CSS may have hidden it on desktop because both
   panes were always visible. Show it everywhere now.
   ──────────────────────────────────────────────────────────── */
.amk-msg-page .amk-chat-back {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    margin-right: 10px !important;
    font-size: 22px !important;
    line-height: 1 !important;
    color: #fff !important;
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.amk-msg-page .amk-chat-back:hover {
    background: rgba(255,255,255,0.16) !important;
}


/* ────────────────────────────────────────────────────────────
   5. Mobile tweaks (smaller paddings on phones)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .amk-msg-page {
        height: calc(100vh - 80px) !important;
        min-height: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .amk-msg-page .amk-sidebar-head {
        padding: 12px 14px !important;
    }

    .amk-msg-page .amk-inbox-item {
        padding: 12px 14px !important;
        min-height: 64px !important;            /* touch-friendly */
    }

    .amk-msg-page .amk-chat-header {
        padding: 10px 12px !important;
    }
}


/* ────────────────────────────────────────────────────────────
   6. Polish — make user list rows look like Messenger
   ──────────────────────────────────────────────────────────── */
.amk-msg-page .amk-inbox-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    cursor: pointer !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    transition: background-color 0.15s ease !important;
}

.amk-msg-page .amk-inbox-item:hover {
    background: rgba(255,255,255,0.04) !important;
}

.amk-msg-page .amk-inbox-item.is-active {
    background: rgba(63,211,255,0.10) !important;
}

.amk-msg-page .amk-inbox-item.is-unread strong {
    font-weight: 700 !important;
    color: #fff !important;
}

.amk-msg-page .amk-inbox-item:not(.is-unread) strong {
    font-weight: 600 !important;
    color: #e7eefc !important;
}

.amk-msg-page .amk-inbox-preview {
    font-size: 13px !important;
    color: rgba(255,255,255,0.55) !important;
    margin-top: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

.amk-msg-page .amk-inbox-listing {
    font-size: 12px !important;
    color: rgba(127,240,255,0.7) !important;
    margin-top: 1px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.amk-msg-page .amk-inbox-body {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.amk-msg-page .amk-inbox-meta {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
}

.amk-msg-page .amk-unread-dot {
    width: 10px !important;
    height: 10px !important;
    background: #3fd3ff !important;
    border-radius: 50% !important;
    box-shadow: 0 0 8px rgba(63,211,255,0.6) !important;
}

.amk-msg-page .amk-inbox-chevron {
    color: rgba(255,255,255,0.4) !important;
    font-size: 18px !important;
}