/* Rede Global — layout Instagram (PC + mobile) */
:root {
  --bg: #000000;
  --bg-2: #121212;
  --bg-3: #1a1a1a;
  --elevated: #262626;
  --line: #262626;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --faint: #737373;
  --blue: #0095f6;
  --pink: #e1306c;
  --grad: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --sidebar-w: 244px;
  --rail-w: 320px;
  --feed-w: 470px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}
.auth-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 30% 0%, #cc236633, transparent),
    radial-gradient(ellipse 50% 40% at 100% 100%, #f0943322, transparent),
    var(--bg);
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 36px 32px 28px;
}
.brand-block { text-align: center; margin-bottom: 24px; }
.brand-block h1 { font-size: 1.75rem; font-weight: 700; margin: 14px 0 6px; letter-spacing: -0.03em; }
.brand-block p { color: var(--muted); font-size: 0.9rem; }

.logo-ring {
  width: 54px; height: 54px; margin: 0 auto;
  border-radius: 14px; padding: 2px; background: var(--grad);
  display: grid; place-items: center;
}
.logo-ring span {
  width: 100%; height: 100%; border-radius: 12px;
  background: #000; display: grid; place-items: center;
  font-weight: 800; font-size: 0.85rem; letter-spacing: 0.05em;
}
.logo-ring.sm { width: 32px; height: 32px; border-radius: 9px; margin: 0; }
.logo-ring.sm span { border-radius: 7px; font-size: 0.65rem; }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 18px;
}
.auth-tab {
  padding: 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 0.88rem;
}
.auth-tab.active { background: var(--elevated); color: var(--text); }

.field { display: block; margin-bottom: 12px; }
.field span {
  display: block; font-size: 0.72rem; color: var(--muted);
  margin-bottom: 6px; font-weight: 600;
}
.field input, .field textarea, .input {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 12px; outline: none;
}
.field input:focus, .field textarea:focus, .input:focus { border-color: #555; }
.error { color: #ed4956; font-size: 0.84rem; min-height: 1.2em; margin-bottom: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 0.9rem;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--blue); font-weight: 600; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; }
.btn-danger, .text-danger { color: #ed4956; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.app {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 20;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 28px;
}
.sidebar-logo-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  text-align: left;
  width: 100%;
  transition: background .12s;
}
.side-link:hover { background: var(--bg-2); }
.side-link.active { font-weight: 700; }
.side-ico {
  width: 24px;
  text-align: center;
  font-size: 1.35rem;
  line-height: 1;
}
.sidebar-foot { margin-top: auto; padding-top: 12px; }
.side-user {
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.chrome-handle { color: var(--text); font-weight: 600; }

.center-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 15;
  width: 100%;
  padding: 10px 14px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
}
.topbar-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.shell {
  width: 100%;
  max-width: var(--feed-w);
  padding: 16px 0 40px;
}

.right-rail {
  width: var(--rail-w);
  flex-shrink: 0;
  padding: 36px 16px 24px 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.rail-me { margin-bottom: 20px; }
.rail-me-row, .rail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.rail-me-text { flex: 1; min-width: 0; }
.rail-me-text strong {
  display: block;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-me-text span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-link {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 600;
}
.rail-block { margin-bottom: 20px; }
.rail-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.rail-tag {
  font-size: 0.72rem;
  color: var(--blue);
  font-weight: 600;
}
.rail-empty { font-size: 0.82rem; color: var(--faint); padding: 8px 0; }
.rail-footer {
  font-size: 0.72rem;
  color: var(--faint);
  line-height: 1.5;
  margin-top: 24px;
}

.tabbar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  justify-content: space-around;
  align-items: center;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab-btn {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 10px;
  color: var(--text);
  border-radius: 8px;
}
.tab-ico { font-size: 1.4rem; line-height: 1; }
.tab-plus {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--grad);
  color: #fff;
  display: grid; place-items: center;
  font-size: 1.1rem;
}

.stories {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 12px 20px;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.stories::-webkit-scrollbar { display: none; }
.story-item {
  flex: 0 0 auto;
  width: 74px;
  text-align: center;
  cursor: pointer;
}
.story-item span {
  display: block;
  font-size: 0.72rem;
  color: var(--text);
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.story-item.muted { opacity: 0.4; cursor: default; }
.story-ring {
  width: 66px; height: 66px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 2px;
  background: var(--line);
}
.story-ring.live { background: var(--grad); }
.story-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--bg);
  display: grid; place-items: center;
  font-weight: 700;
  color: var(--muted);
  overflow: hidden;
}
.story-add .story-inner { color: var(--text); font-size: 1.4rem; }

.feed { display: flex; flex-direction: column; gap: 0; }
.ig-card {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.ig-card.pinned { box-shadow: inset 3px 0 0 #e1306c; }
.ig-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.ig-user { flex: 1; min-width: 0; }
.ig-user strong { display: block; font-size: 0.88rem; }
.ig-user span { font-size: 0.75rem; color: var(--muted); }
.pin-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #f77737;
  text-transform: uppercase;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--elevated);
  overflow: hidden;
  display: grid; place-items: center;
  font-weight: 700;
  color: var(--pink);
  flex-shrink: 0;
  font-size: 0.8rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; }
.avatar.xl { width: 86px; height: 86px; font-size: 1.8rem; }

.ig-media {
  width: 100%;
  background: #0a0a0a;
  aspect-ratio: 1;
  position: relative;
}
.ig-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.ig-media.broken::after {
  content: "imagem indisponivel";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--faint);
  font-size: 0.85rem;
}

.ig-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px 0;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text);
  font-size: 1.35rem;
}
.icon-btn:hover { opacity: 0.7; }
.icon-btn.liked { color: #ed4956; }

.ig-meta { padding: 4px 14px 8px; }
.ig-likes { font-weight: 700; font-size: 0.88rem; margin-bottom: 4px; }
.ig-caption { font-size: 0.9rem; }
.ig-caption strong { margin-right: 6px; }
.ig-view-comments {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}
.tag { color: #e0f1ff; font-weight: 500; }

.profile-hero {
  display: flex;
  gap: 28px;
  align-items: center;
  padding: 20px 16px 28px;
}
.profile-info h2 { font-size: 1.25rem; font-weight: 400; }
.handle-line { color: var(--muted); font-size: 0.9rem; margin: 4px 0 10px; }
.profile-stats { font-size: 0.9rem; }
.profile-stats strong { font-weight: 700; }
.bio { margin-top: 10px; font-size: 0.9rem; }

.panel {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 0 12px 16px;
}
.panel h3 { font-size: 0.95rem; margin-bottom: 10px; }
.hint { color: var(--muted); font-size: 0.8rem; margin-bottom: 12px; }
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block; font-size: 0.72rem; color: var(--muted);
  margin-bottom: 6px; font-weight: 600;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.uid {
  display: block; font-size: 0.7rem; word-break: break-all;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px; color: var(--muted);
}

.grid-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--muted);
  padding: 12px;
  border-top: 1px solid var(--line);
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.grid-cell {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-2);
  border: none;
  padding: 0;
}
.grid-cell img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.admin-stack { display: flex; flex-direction: column; gap: 12px; padding: 0 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--faint); font-size: 0.7rem; text-transform: uppercase; }
.mod-list { display: flex; flex-direction: column; gap: 10px; }
.mod-row {
  display: flex; align-items: center; gap: 10px; font-size: 0.82rem;
}
.mod-row img {
  width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--bg-2);
}
.mod-row div { flex: 1; min-width: 0; }
.mod-row p {
  color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.open { display: flex; }
.modal-sheet {
  width: 100%;
  max-width: 440px;
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.sheet-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.compose-preview {
  aspect-ratio: 1;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  display: grid; place-items: center;
  overflow: hidden;
}
.compose-preview img { width: 100%; height: 100%; object-fit: cover; }

.post-sheet { max-width: 900px; padding: 0; overflow: hidden; }
.modal-post {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 480px;
  max-height: 90vh;
}
.modal-post-media {
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
.modal-post-media img {
  width: 100%; max-height: 90vh; object-fit: contain;
}
.modal-post-side {
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--bg);
}
.modal-comments {
  flex: 1; overflow: auto; padding: 12px 14px; max-height: 400px;
}
.comment-row { font-size: 0.88rem; margin-bottom: 12px; }
.comment-row strong { margin-right: 6px; }
.c-time { display: block; font-size: 0.7rem; color: var(--faint); margin-top: 2px; }
.modal-footer { border-top: 1px solid var(--line); padding: 10px 12px; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form .input { flex: 1; }

.story-layer { background: #000; padding: 0; }
.story-full {
  width: min(420px, 100%);
  height: min(90vh, 780px);
  margin: auto;
  position: relative;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
}
.story-full img { width: 100%; height: 100%; object-fit: contain; }
.story-full-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 14px 16px;
  background: linear-gradient(#000c, transparent);
  display: flex; justify-content: space-between;
  font-size: 0.85rem; z-index: 2;
}

.modal-body { color: var(--muted); font-size: 0.9rem; margin: 8px 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}
.empty-glow {
  width: 72px; height: 72px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--grad); opacity: 0.3; filter: blur(18px);
}
.empty h3 { color: var(--text); margin-bottom: 8px; }
.text-muted { color: var(--muted); }

#toasts {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
  width: min(360px, calc(100% - 24px));
  pointer-events: none;
}
.toast {
  background: var(--elevated);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  opacity: 0;
  transform: translateY(10px);
  transition: .2s ease;
  text-align: center;
}
.toast.show { opacity: 1; transform: none; }
.toast-err { border-color: #7f1d1d; }

@media (max-width: 1160px) {
  .right-rail { display: none; }
  :root { --sidebar-w: 72px; }
  .side-label, .sidebar-logo-text, .side-user { display: none; }
  .sidebar { width: 72px; padding: 16px 8px; align-items: center; }
  .sidebar-brand { justify-content: center; padding: 8px 0 24px; }
  .side-link { justify-content: center; padding: 14px; }
  .side-ico { font-size: 1.5rem; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .right-rail { display: none; }
  .mobile-topbar { display: flex; }
  .tabbar { display: flex; }
  .app { display: block; padding-bottom: 60px; }
  .center-col { width: 100%; }
  .shell {
    max-width: 100%;
    padding: 0 0 24px;
  }
  .stories { padding-left: 10px; padding-right: 10px; }
  .ig-card { border-radius: 0; }
  .modal-post { grid-template-columns: 1fr; }
  .modal-post-media img { max-height: 45vh; }
  .profile-hero { flex-direction: row; gap: 18px; padding: 16px; }
  .avatar.xl { width: 72px; height: 72px; }
  #toasts { bottom: 72px; }
}

@media (min-width: 769px) and (max-width: 1160px) {
  .shell { padding-left: 8px; padding-right: 8px; }
}


/* Instagram profile */
.ig-profile { width: 100%; }
.ig-profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}
.ig-profile-header {
  display: flex;
  gap: 28px;
  padding: 24px 20px 16px;
  align-items: center;
}
.ig-profile-meta { flex: 1; min-width: 0; }
.ig-profile-userline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ig-username {
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.btn-edit {
  background: var(--elevated);
  color: var(--text);
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}
.btn-edit:hover { filter: brightness(1.1); }
.ig-stats {
  display: flex;
  gap: 28px;
  margin-bottom: 12px;
}
.ig-stat {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted);
}
.ig-stat strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}
.ig-display-name { font-weight: 700; font-size: 0.9rem; }
.ig-bio { font-size: 0.9rem; margin-top: 4px; white-space: pre-wrap; }
.ig-badge-npc {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
}
.ig-profile-tabs {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.ig-tab {
  padding: 14px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  border-top: 1px solid transparent;
  margin-top: -1px;
}
.ig-tab.active {
  color: var(--text);
  border-top-color: var(--text);
}
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}
.mobile-only { display: none; }
.desktop-only { display: block; }
.ig-profile-userline.desktop-only { display: flex; }

.search-results {
  margin-top: 14px;
  max-height: 50vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  text-align: left;
  width: 100%;
  color: var(--text);
}
.search-row:hover { background: var(--bg-2); }

@media (max-width: 768px) {
  .mobile-only { display: flex; }
  .desktop-only, .ig-profile-userline.desktop-only { display: none !important; }
  .ig-profile-header { gap: 18px; padding: 16px; }
  .ig-stats { gap: 16px; justify-content: space-between; width: 100%; }
  .ig-stat { align-items: center; text-align: center; flex: 1; }
  .ig-stat span { font-size: 0.75rem; }
  .ig-profile-bio-block.mobile-only {
    display: block;
    padding: 0 16px 16px;
  }
  .avatar.xl { width: 77px; height: 77px; }
}


.nav-badge {
  margin-left: auto;
  background: #ed4956;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.session-banner {
  margin: 0 12px 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, #cc236633, #f0943322);
  border: 1px solid #333;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.88rem;
}
.ig-highlights {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 16px 16px;
  scrollbar-width: none;
}
.hl-item {
  flex: 0 0 auto;
  width: 72px;
  text-align: center;
  color: var(--text);
  font-size: 0.7rem;
}
.hl-ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1px solid var(--line);
  margin: 0 auto 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--bg-2);
}
.hl-ring img { width: 100%; height: 100%; object-fit: cover; }
.admin-comment-as {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 4px;
}
.admin-comment-as .input { flex: 1; }

.notif-list { display: flex; flex-direction: column; }
.notif-row {
  text-align: left;
  width: 100%;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9rem;
}
.notif-row.unread { background: #1a1a1a; }
.notif-row:hover { background: var(--bg-2); }

.dm-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 0 8px;
}
.dm-list {
  border-right: 1px solid var(--line);
  overflow: auto;
  max-height: 75vh;
}
.dm-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.dm-thread-row {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.dm-thread-row.active, .dm-thread-row:hover { background: var(--bg-2); }
.dm-chat { display: flex; flex-direction: column; min-height: 60vh; }
.dm-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.dm-messages {
  flex: 1;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
}
.dm-bubble {
  max-width: 75%;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--elevated);
  font-size: 0.9rem;
  align-self: flex-start;
}
.dm-bubble.mine {
  align-self: flex-end;
  background: #00376b;
}
.dm-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.dm-compose .input { flex: 1; }

@media (max-width: 768px) {
  .dm-layout { grid-template-columns: 1fr; margin: 0; border: none; border-radius: 0; }
  .dm-list.has-active { display: none; }
  .dm-list { max-height: none; }
  .dm-chat { min-height: 80vh; }
}
