/* ===========================
   INBOX – JobConnect
   Linear / Stripe aesthetic
   =========================== */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --border: rgba(0, 0, 0, 0.07);
  --border-solid: #e5e8ef;
  --text: #0d0e14;
  --muted: #6b7280;
  --soft: #9aa0ac;
  --blue: #1a56db;
  --blue-soft: #eef3ff;
  --blue-mid: #dce8ff;
  --green: #0d7a55;
  --green-soft: #e6f9f2;
  --amber: #b45309;
  --red: #c0392b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); line-height: 1.5; overflow: hidden; height: 100vh; }
button, input { font: inherit; }
a { text-decoration: none; color: inherit; }

/* ========================
   SHELL LAYOUT
   ======================== */
.inbox-shell {
  display: grid;
  grid-template-columns: 220px 300px 1fr 260px;
  height: 100vh;
  overflow: hidden;
}

/* ========================
   SIDEBAR
   ======================== */
.inbox-sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f4f6fa;
  border-right: 1px solid var(--border-solid);
  padding: 16px 12px;
  overflow-y: auto;
}

.inbox-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px;
  border-radius: 8px;
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
}
.inbox-brand img { width: 32px; height: 32px; object-fit: contain; }

.inbox-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 20px;
  flex: 1;
}

.inbox-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
  white-space: nowrap;
  overflow: hidden;
}
.inbox-nav a svg { flex-shrink: 0; opacity: .7; }
.inbox-nav a:hover { background: rgba(0,0,0,0.04); color: var(--text); }
.inbox-nav a.active {
  background: #fff;
  color: var(--blue);
  border-left-color: var(--blue);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.inbox-nav a.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  font-style: normal;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.inbox-sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 8px;
  border-top: 1px solid var(--border-solid);
  margin-top: 12px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  overflow: hidden;
}
.sidebar-user-info strong {
  display: block;
  font-size: .825rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-info span {
  font-size: .75rem;
  color: var(--muted);
}

.sidebar-cog {
  color: var(--soft);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color .14s;
}
.sidebar-cog:hover { color: var(--text); }

/* ========================
   CONVERSATION LIST
   ======================== */
.inbox-list {
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--border-solid);
  background: var(--surface);
  overflow: hidden;
}

.inbox-list-header {
  padding: 16px 16px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.inbox-list-header h1 {
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}

.inbox-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border-solid);
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 10px;
}
.inbox-search-wrap svg { color: var(--soft); flex-shrink: 0; }
.inbox-search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: .875rem;
  color: var(--text);
}
.inbox-search-wrap input::placeholder { color: var(--soft); }

.inbox-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-solid);
  margin: 0 -16px;
  padding: 0 16px;
}
.inbox-tabs button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 10px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .14s, border-color .14s;
}
.inbox-tabs button:hover { color: var(--text); }
.inbox-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

.conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}
.conv-list::-webkit-scrollbar { width: 4px; }
.conv-list::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 4px; }

/* Skeleton loaders */
.conv-skeleton {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: var(--radius);
  animation: skeleton-pulse 1.4s ease infinite;
}
.sk-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8ebf0;
  flex-shrink: 0;
}
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.sk-lines div { height: 10px; background: #e8ebf0; border-radius: 5px; }
.sk-lines div:first-child { width: 60%; }
.sk-lines div:last-child { width: 80%; }
@keyframes skeleton-pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* Conversation card */
.conv-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  padding: 10px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .12s ease;
  border-left: 2px solid transparent;
  position: relative;
}
.conv-card:hover { background: var(--bg); }
.conv-card.active {
  background: var(--blue-soft);
  border-left-color: var(--blue);
}
.conv-card + .conv-card { margin-top: 2px; }

.conv-avatar-wrap {
  grid-row: 1 / 3;
  position: relative;
  align-self: center;
}

.conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
}

.conv-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--surface);
}

.conv-card.active .conv-online-dot { border-color: var(--blue-soft); }

.conv-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.conv-name {
  font-size: .875rem;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.conv-time {
  font-size: .72rem;
  color: var(--soft);
  flex-shrink: 0;
  white-space: nowrap;
}

.conv-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
}

.conv-preview {
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.conv-badge {
  background: var(--blue);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.conv-job-tag {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.conv-tag-pill {
  font-size: .7rem;
  font-weight: 550;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border-solid);
  border-radius: 20px;
  padding: 2px 7px;
}

.conv-pin-icon {
  font-size: .7rem;
  color: var(--soft);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Empty list */
.conv-list-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.conv-list-empty svg { margin-bottom: 12px; display: block; margin-left: auto; margin-right: auto; }
.conv-list-empty strong { display: block; font-size: .95rem; color: var(--text); margin-bottom: 4px; }
.conv-list-empty p { font-size: .85rem; }

/* ========================
   CHAT WORKSPACE
   ======================== */
.inbox-chat {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
  padding: 40px;
}
.chat-empty strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
}
.chat-empty p { font-size: .875rem; max-width: 260px; line-height: 1.55; }

/* Chat header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-solid);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-header-info { min-width: 0; }

.chat-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-title-row h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-status-pill {
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--green-soft);
  color: var(--green);
  flex-shrink: 0;
}
.chat-status-pill.pending { background: #fef9ec; color: #92400e; }
.chat-status-pill.open { background: var(--blue-soft); color: var(--blue); }

.chat-meta-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--green);
  font-weight: 600;
  font-size: .75rem;
}

.meta-dot { color: var(--border-solid); }

.chat-budget { font-weight: 650; color: var(--text); }

.milestone-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: .75rem;
  color: var(--muted);
}

.milestone-track {
  width: 80px;
  height: 4px;
  background: var(--border-solid);
  border-radius: 4px;
  overflow: hidden;
}

.milestone-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  transition: width .4s ease;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Buttons */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-solid);
  background: var(--surface);
  color: var(--text);
  font-size: .825rem;
  font-weight: 550;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--bg); border-color: #c5cad4; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: .825rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, transform .1s;
  white-space: nowrap;
}
.btn-primary:hover { background: #1748c4; }
.btn-primary:active { transform: scale(.97); }

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-solid);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

.btn-sm {
  padding: 5px 10px;
  font-size: .78rem;
}

/* ========================
   MESSAGES
   ======================== */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 4px; }

/* Date separator */
.msg-date-sep {
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  color: var(--soft);
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 14px 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.msg-date-sep::before, .msg-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-solid);
}

/* Unread divider */
.msg-unread-sep {
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  color: var(--blue);
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.msg-unread-sep::before, .msg-unread-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--blue-mid);
}

/* System message */
.msg-system {
  display: block;
  text-align: center;
  font-size: .75rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-solid);
  border-radius: 20px;
  padding: 4px 14px;
  margin: 6px auto;
  width: fit-content;
  max-width: 80%;
}

/* Message row */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 72%;
  animation: msg-appear .18s ease;
}
@keyframes msg-appear { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

.msg-row.mine {
  flex-direction: row-reverse;
  margin-left: auto;
}

.msg-bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
}

.msg-bubble-wrap { display: flex; flex-direction: column; gap: 3px; }

.msg-bubble {
  padding: 9px 13px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: .875rem;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.msg-row.mine .msg-bubble {
  background: var(--blue);
  color: #fff;
  border: none;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(26,86,219,.25);
}

.msg-time {
  font-size: .68rem;
  color: var(--soft);
  padding: 0 2px;
}
.msg-row.mine .msg-time { text-align: right; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.typing-dots {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--soft);
  animation: typing-bounce .9s ease infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .30s; }
@keyframes typing-bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }

/* ========================
   COMPOSER
   ======================== */
.chat-composer-wrap {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border-solid);
  padding: 10px 16px 14px;
  position: relative;
}

.smart-replies {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.smart-replies::-webkit-scrollbar { display: none; }

.smart-reply {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-solid);
  background: var(--surface);
  color: var(--text);
  font-size: .775rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.smart-reply:hover { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }

.chat-composer {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border-solid);
  border-radius: 10px;
  padding: 6px 6px 6px 10px;
  transition: border-color .14s;
}
.chat-composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,.08); }

.composer-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--soft);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s, background .12s;
  flex-shrink: 0;
}
.composer-btn:hover { color: var(--blue); background: var(--blue-soft); }

.chat-composer input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: .875rem;
  color: var(--text);
}
.chat-composer input::placeholder { color: var(--soft); }

.btn-send {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, transform .1s;
  flex-shrink: 0;
}
.btn-send:hover { background: #1748c4; }
.btn-send:active { transform: scale(.93); }

/* Drag & drop overlay */
.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(238,243,255,.95);
  border: 2px dashed var(--blue);
  border-radius: 10px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--blue);
  font-weight: 600;
  font-size: .875rem;
  z-index: 10;
}
.drop-overlay.active { display: flex; }

/* ========================
   RIGHT DETAIL PANEL
   ======================== */
.inbox-detail {
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--border-solid);
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inbox-detail::-webkit-scrollbar { width: 4px; }
.inbox-detail::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 4px; }

.detail-client-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(160deg, #f0fdf8 0%, #fff 60%);
  border: 1px solid var(--border-solid);
  border-top: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 20px 16px;
  gap: 6px;
}

.detail-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.detail-client-card h3 { font-size: .95rem; font-weight: 700; }

.detail-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  color: var(--green);
  font-weight: 600;
}

.detail-stars { color: #f59e0b; font-size: .85rem; letter-spacing: 1px; }

.detail-meta { font-size: .78rem; color: var(--muted); }

.detail-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin-top: 4px;
}

.trust-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.trust-badge.green { background: var(--green-soft); color: var(--green); }
.trust-badge.blue { background: var(--blue-soft); color: var(--blue); }

.detail-section {
  background: var(--surface);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-section h4 {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.detail-ai-text {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.55;
}

.detail-actions { display: flex; flex-direction: column; gap: 6px; }
.detail-actions .btn-ghost { width: 100%; justify-content: center; }

/* Milestone list in detail */
.detail-milestone-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

.detail-milestone-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .8rem;
  color: var(--muted);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border-solid);
  border-left: 3px solid var(--border-solid);
}

.detail-milestone-list li.done {
  border-left-color: var(--green);
  color: var(--green);
}
.detail-milestone-list li.active {
  border-left-color: var(--blue);
  color: var(--text);
}

.milestone-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-solid);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.done .milestone-check { background: var(--green); border-color: var(--green); color: #fff; }
.active .milestone-check { border-color: var(--blue); }

/* ========================
   MOBILE NAV
   ======================== */
.inbox-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border-solid);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  z-index: 100;
}

.inbox-mobile-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 500;
  color: var(--soft);
  padding: 4px 0;
  transition: color .14s;
}
.inbox-mobile-nav a.active { color: var(--blue); }

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 1200px) {
  .inbox-shell { grid-template-columns: 220px 300px 1fr; }
  .inbox-detail { display: none !important; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .inbox-shell { grid-template-columns: 300px 1fr; height: auto; min-height: 100vh; overflow: hidden; }
  .inbox-sidebar { display: none; }
  .inbox-mobile-nav { display: flex; }
}

@media (max-width: 600px) {
  .inbox-shell { grid-template-columns: 1fr; }
  .inbox-list { display: block; }
  .inbox-chat { height: calc(100vh - 56px); }
}
