/* ========================================================
   OnlyHidden – Dark Theme
   ======================================================== */

:root {
  --bg:        #0d0d0d;
  --surface:   #161616;
  --surface2:  #1e1e1e;
  --surface3:  #262626;
  --border:    #2a2a2a;
  --accent:    #a855f7;
  --accent2:   #7c3aed;
  --accent-lo: rgba(168,85,247,.15);
  --text:      #f0f0f0;
  --muted:     #888;
  --danger:    #ef4444;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(0,0,0,.5);
}

/* ─── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* ─── Typography ────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; color: var(--text); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p  { color: var(--muted); margin-bottom: .75rem; }
small { font-size: .8rem; }

/* ─── Navbar ────────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(10px);
  transition: margin-left .28s;
}

.navbar-brand:hover { text-decoration: none; opacity: .9; }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  flex-wrap: wrap;
}

.navbar-links a {
  color: var(--muted);
  font-size: .9rem;
  transition: color .2s;
  white-space: nowrap;
}
.navbar-links a:hover { color: var(--text); text-decoration: none; }

.navbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

.notif-badge {
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 9999px;
  padding: 1px 5px;
  position: absolute;
  top: -5px;
  right: -7px;
  line-height: 1.4;
}

.notif-wrap {
  position: relative;
  display: inline-block;
}

/* ─── Container ─────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-wrap {
  padding: 2rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card-sm { padding: 1rem; }
.card-lg { padding: 2rem; }

/* ─── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
textarea,
select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: .65rem .9rem;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lo);
}

textarea { resize: vertical; min-height: 90px; }

select option { background: var(--surface2); }

.form-hint {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .3rem;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.25rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .2s, transform .1s, background .2s;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary  { background: var(--accent); color: #fff; }
.btn-secondary{ background: var(--surface3); color: var(--text); border: 1px solid var(--border); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-outline  { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.badge-success { background: rgba(34,197,94,.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-danger  { background: rgba(239,68,68,.15);  color: var(--danger);  }
.badge-info    { background: rgba(96,165,250,.15);  color: #60a5fa;        }
.badge-muted   { background: var(--surface3); color: var(--muted); }

/* ─── Alerts ────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  font-size: .9rem;
  margin-bottom: 1rem;
  border-left: 3px solid;
}
.alert-danger  { background: rgba(239,68,68,.1);  border-color: var(--danger);  color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.1);  border-color: var(--success); color: #86efac; }
.alert-warning { background: rgba(245,158,11,.1); border-color: var(--warning); color: #fcd34d; }
.alert-info    { background: rgba(96,165,250,.1); border-color: #60a5fa;        color: #93c5fd; }

/* ─── Grid ──────────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(var(--min, 280px), 1fr)); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── Feed grid (index homepage) ───────────────────────── */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}
.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.feed-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 28px rgba(168,85,247,.12); }
.feed-thumb {
  display: block;
  position: relative;
  width: 100%;
  padding-top: 62%;
  overflow: hidden;
  background: var(--surface2);
  text-decoration: none;
}
.feed-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.feed-card:hover .feed-thumb img { transform: scale(1.04); }
.feed-thumb img.blurred { filter: blur(20px); transform: scale(1.06); }
.feed-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--muted);
}
.feed-lock {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  pointer-events: none;
}
.feed-type-badge {
  position: absolute;
  bottom: .4rem;
  left: .4rem;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .06em;
}
.feed-meta {
  padding: .7rem .85rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
}
.feed-creator {
  display: flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  color: var(--muted);
  font-size: .78rem;
}
.feed-creator img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}
.feed-creator:hover { color: var(--text); text-decoration: none; }
.feed-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.feed-title:hover { color: var(--accent); text-decoration: none; }
.feed-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: .3rem;
}
.feed-likes { font-size: .78rem; color: var(--muted); }
.feed-price { font-size: .85rem; font-weight: 700; color: var(--accent); }

/* ─── Content Card (feed) — legacy keep for other pages ── */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.content-card:hover {
  border-color: var(--accent2);
  transform: translateY(-2px);
}

.content-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  overflow: hidden;
  background: var(--surface2);
}

.content-thumb img,
.content-thumb video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.content-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.75));
  display: flex;
  align-items: flex-end;
  padding: .75rem;
}

.content-lock-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 2.5rem;
  opacity: .7;
  pointer-events: none;
}

.content-meta {
  padding: .85rem 1rem;
}
.content-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.content-creator {
  font-size: .8rem;
  color: var(--muted);
}
.content-price {
  font-weight: 700;
  color: var(--accent);
  font-size: .9rem;
}
.content-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border-top: 1px solid var(--border);
}

/* ─── Like / Follow Buttons ─────────────────────────────── */
.btn-like {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .5rem;
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.btn-like:hover  { color: var(--danger); background: rgba(239,68,68,.08); }
.btn-like.liked  { color: var(--danger); }
.btn-like .like-count { font-weight: 600; font-size: .85rem; }

.btn-follow {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  padding: .3rem .85rem;
  border-radius: 9999px;
  transition: background .2s, color .2s;
}
.btn-follow:hover,
.btn-follow.following {
  background: var(--accent);
  color: #fff;
}
.btn-follow.following:hover {
  background: var(--danger);
  border-color: var(--danger);
}

/* ─── Profile Header ────────────────────────────────────── */
.profile-banner {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface2);
}

.profile-avatar-wrap {
  position: relative;
  margin-top: -56px;
  margin-left: 1.5rem;
  width: 112px;
  height: 112px;
}

.profile-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 4px solid var(--bg);
  object-fit: cover;
  background: var(--surface3);
}

.profile-info {
  padding: .5rem 1.5rem 1.5rem;
}
.profile-name { font-size: 1.4rem; font-weight: 800; }
.profile-bio  { color: var(--muted); font-size: .9rem; margin: .35rem 0; }
.profile-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: .75rem;
}
.profile-stat { text-align: center; }
.profile-stat .val { font-weight: 700; font-size: 1.1rem; display: block; }
.profile-stat .lbl { font-size: .75rem; color: var(--muted); }

/* ─── Content Detail ────────────────────────────────────── */
.content-detail-media {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  position: relative;
}
.content-detail-media img,
.content-detail-media video {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.blur-gate {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.blur-gate-img {
  width: 100%;
  display: block;
  filter: blur(18px);
}
.blur-gate-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}
.blur-gate-title { font-size: 1.3rem; font-weight: 700; }
.blur-gate-desc  { color: var(--muted); font-size: .9rem; }
.blur-gate-btns  { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }

/* ─── Comments ──────────────────────────────────────────── */
.comment-list { display: flex; flex-direction: column; gap: .75rem; }
.comment-item {
  display: flex;
  gap: .75rem;
  background: var(--surface2);
  border-radius: 8px;
  padding: .75rem;
}
.comment-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-author { font-weight: 600; font-size: .85rem; }
.comment-text { color: var(--muted); font-size: .9rem; margin: .2rem 0 0; word-break: break-word; }
.comment-time { font-size: .75rem; color: #555; }

/* ─── Star Rating ───────────────────────────────────────── */
.star-rating { display: flex; gap: .2rem; }
.star-rating input { display: none; }
.star-rating label {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--surface3);
  transition: color .15s;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: var(--warning); }
.star-rating { flex-direction: row-reverse; }

/* ─── Tabs ──────────────────────────────────────────────── */
.tabs, .tab-bar { border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; display: flex; gap: .25rem; }
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  padding: .65rem 1.1rem;
  margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.tab-btn:hover   { color: var(--text); }
.tab-btn.active  { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel       { display: none; }
.tab-panel.active{ display: block; }

/* ─── Table ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  text-align: left;
  padding: .6rem .9rem;
  background: var(--surface2);
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }

/* ─── Stats / Stat Boxes ────────────────────────────────── */
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.stat-box .stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
  line-height: 1;
}
.stat-box .stat-lbl {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .4rem;
  display: block;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ─── Seed Words Box ────────────────────────────────────── */
.seed-box {
  background: var(--surface2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}
.seed-words {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}
.seed-word {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .35rem .75rem;
  font-size: .85rem;
  font-family: 'Courier New', monospace;
  color: var(--text);
}
.seed-word span.num { color: var(--muted); font-size: .75rem; margin-right: .3rem; }

.seed-warn {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 8px;
  padding: .85rem 1.1rem;
  color: #fcd34d;
  font-size: .9rem;
  margin-top: .75rem;
}

/* ─── Notification Dropdown ─────────────────────────────── */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 999;
  max-height: 420px;
  overflow-y: auto;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: .75rem 1rem;
  font-weight: 700;
  font-size: .9rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-item {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: var(--accent-lo); }
.notif-item .notif-msg { color: var(--text); }
.notif-item .notif-time { color: var(--muted); font-size: .75rem; margin-top: .2rem; }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--muted); }

/* ─── Modal ─────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ─── Upload Area ───────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-lo);
}
.upload-icon { font-size: 3rem; margin-bottom: .75rem; }
.upload-text { color: var(--muted); font-size: .9rem; }

/* ─── Progress Bar ──────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--surface2);
  border-radius: 9999px;
  height: 6px;
  overflow: hidden;
  margin-top: .5rem;
}
.progress-bar {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width .3s;
}

/* ─── Dashboard sidebar (desktop) ──────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.dashboard-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem;
  position: sticky;
  top: 70px;
}
.dashboard-nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .85rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  transition: color .2s, background .2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dashboard-nav-link:hover,
.dashboard-nav-link.active {
  background: var(--accent-lo);
  color: var(--accent);
  text-decoration: none;
}
.dashboard-icon { font-size: 1rem; width: 1.1rem; text-align: center; }

@media (max-width: 768px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-sidebar { position: static; }
}

/* ─── Balance Display ───────────────────────────────────── */
.balance-chip {
  background: var(--accent-lo);
  border: 1px solid rgba(168,85,247,.3);
  border-radius: 9999px;
  padding: .3rem .85rem;
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ─── Video wrapper ─────────────────────────────────────── */
.video-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.video-wrap video {
  width: 100%;
  display: block;
}
.video-type-badge {
  position: absolute;
  top: .5rem; right: .5rem;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: 4px;
}

/* ─── Responsive Navbar ─────────────────────────────────── */
@media (max-width: 640px) {
  .navbar { padding: .65rem 1rem; gap: .75rem; }
  .navbar-links { display: none; }
  .navbar-brand { font-size: 1.1rem; }
}

/* ─── Misc Utilities ────────────────────────────────────── */
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem;  }
.mt-3 { margin-top: 1rem;   }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem;   }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem;  }
.mb-3 { margin-bottom: 1rem;   }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem;   }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem;  }
.gap-3 { gap: 1rem;   }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success);}
.font-bold   { font-weight: 700; }
.w-100       { width: 100%; }
.truncate    { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hidden      { display: none !important; }

/* ─── Auth Pages ────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at top, #1a0a2e 0%, var(--bg) 70%);
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.25rem;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-logo h1 {
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo p { color: var(--muted); font-size: .9rem; margin-top: .3rem; }

/* ─── Pagination ────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: .4rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: background .2s, color .2s;
}
.page-link:hover  { background: var(--surface3); color: var(--text); text-decoration: none; }
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Spinner ───────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem 1.25rem;
  min-width: 240px;
  max-width: 360px;
  font-size: .9rem;
  box-shadow: var(--shadow);
  animation: toast-in .25s ease;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger);  }
.toast.info    { border-left: 3px solid var(--accent);  }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Auth link ─────────────────────────────────────────── */
.auth-link { text-align: center; margin-top: .75rem; font-size: .88rem; color: var(--muted); }
.brand {
  display: block;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Alert alias ───────────────────────────────────────── */
.alert-error { background: rgba(239,68,68,.1); border-color: var(--danger); color: #fca5a5; border-left: 3px solid; border-radius: var(--radius); padding: .85rem 1.1rem; font-size: .9rem; margin-bottom: 1rem; }

/* ─── Warn text ─────────────────────────────────────────── */
.warn { color: var(--warning); font-size: .88rem; margin-top: .5rem; }

/* ─── Form row (inline fields) ──────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ─── Balance display (recargar page) ───────────────────── */
.balance-display {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: .95rem;
  color: var(--muted);
}
.balance-display strong { font-size: 1.4rem; font-weight: 800; color: var(--accent); }

/* ─── Invoice card ──────────────────────────────────────── */
.invoice-card {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.invoice-card h3 { margin-bottom: 1rem; }
.invoice-card code {
  background: var(--surface2);
  padding: .2rem .5rem;
  border-radius: 4px;
  font-size: .88rem;
  word-break: break-all;
}

/* ─── Recharge form ─────────────────────────────────────── */
.recharge-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ─── Crypto info box ───────────────────────────────────── */
.crypto-info {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--muted);
}
.crypto-info h4 { color: var(--text); margin-bottom: .75rem; font-size: .95rem; }
.crypto-info ol { padding-left: 1.25rem; }
.crypto-info li { margin-bottom: .4rem; }

/* ─── Data table ────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table thead th {
  text-align: left;
  padding: .6rem .9rem;
  background: var(--surface2);
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.data-table tbody td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface2); }

/* ─── Align-items-start util ────────────────────────────── */
.align-items-start { align-items: flex-start; }

/* ─── Page content padding ──────────────────────────────── */
.page-wrap {
  padding: 2rem 1.5rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
  transition: margin-left .28s;
}

/* ─── Language Switcher ─────────────────────────────────── */
.lang-switcher {
  position: relative;
}
.lang-toggle {
  cursor: pointer;
  min-width: 72px;
}
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 300;
  min-width: 110px;
  overflow: hidden;
}
.lang-switcher:hover .lang-menu,
.lang-switcher:focus-within .lang-menu { display: block; }
.lang-option {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .9rem;
  font-size: .88rem;
  color: var(--text);
  transition: background .15s;
}
.lang-option:hover { background: var(--surface2); text-decoration: none; }
.lang-option.active { color: var(--accent); background: var(--accent-lo); }

/* ─── Tip / Propina modal ───────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 380px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.tip-amounts { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.tip-preset {
  padding: .35rem .75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: .85rem;
  transition: all .2s;
}
.tip-preset:hover, .tip-preset.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Site logo SVG ─────────────────────────────────────── */
.site-logo-svg { width: 36px; height: 28px; flex-shrink: 0; }
.navbar-brand   { display: flex; align-items: center; gap: .5rem; }
.navbar-brand-text {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

/* ─── Hamburger button ──────────────────────────────────── */
.hamburger-btn, .sidebar-collapse-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background .2s;
  flex-shrink: 0;
}
.hamburger-btn:hover, .sidebar-collapse-btn:hover { background: var(--surface2); }
.hb-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: all .3s;
}
.hamburger-btn.is-active .hb-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.is-active .hb-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.is-active .hb-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Navbar left section ───────────────────────────────── */
.navbar-left { display: flex; align-items: center; gap: .5rem; }

/* ─── Icon button (layout switch, notif) ───────────────── */
.nav-icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all .2s;
  font-size: .9rem;
  position: relative;
}
.nav-icon-btn:hover { background: var(--surface2); color: var(--text); }
.notif-btn { font-size: 1rem; }

/* ─── User menu trigger (with avatar) ──────────────────── */
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  cursor: pointer;
  color: var(--text);
  font-size: .85rem;
  transition: all .2s;
  max-width: 180px;
}
.user-menu-trigger:hover { border-color: var(--accent); }
.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.nav-username {
  font-weight: 600;
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.nav-chevron { font-size: .7rem; color: var(--muted); }

/* ─── User menu dropdown ────────────────────────────────── */
.user-menu-wrap { position: relative; display: inline-block; }
.user-menu-drop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 300;
  min-width: 210px;
  overflow: hidden;
}
.user-menu-drop.open { display: block; }
.user-menu-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.user-menu-avatar-lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-menu-drop a {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1rem;
  font-size: .88rem;
  color: var(--text);
  text-decoration: none;
  transition: background .15s;
}
.user-menu-drop a:hover { background: var(--surface2); text-decoration: none; }

/* ─── Layout switch button active ───────────────────────── */
#layout-switch-btn.sidebar-active { color: var(--accent); border-color: var(--accent); background: var(--accent-lo); }

/* ─── Tags / hashtag chips ──────────────────────────────── */
.tag-chip {
  background: var(--surface2);
  color: var(--accent);
  padding: .2rem .5rem;
  border-radius: 5px;
  font-size: .78rem;
  text-decoration: none;
  transition: all .2s;
}
.tag-chip:hover { background: var(--accent); color: #fff; }
.tag-chip-sm {
  background: var(--surface2);
  color: var(--accent);
  padding: .1rem .3rem;
  border-radius: 3px;
  font-size: .72rem;
}
.content-tags  { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.search-tags   { display: flex; flex-wrap: wrap; gap: .25rem; margin: .25rem 0; }

/* ─── Sidebar navigation ────────────────────────────────── */
.sidebar-nav {
  position: fixed;
  top: 0;
  left: -260px;
  width: 240px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transition: left .28s cubic-bezier(.4,0,.2,1), width .28s;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-nav.open { left: 0; }

/* Pinned sidebar mode: always visible, pushes content */
body.sidebar-pinned .sidebar-nav { left: 0; }
body.sidebar-pinned .page-wrap   { margin-left: 240px; transition: margin-left .28s; }
body.sidebar-pinned .navbar      { margin-left: 240px; transition: margin-left .28s; }

/* Collapsed sidebar in pinned mode */
body.sidebar-pinned.sidebar-collapsed .sidebar-nav { width: 60px; }
body.sidebar-pinned.sidebar-collapsed .page-wrap   { margin-left: 60px; }
body.sidebar-pinned.sidebar-collapsed .navbar      { margin-left: 60px; }
body.sidebar-pinned.sidebar-collapsed .sidebar-brand-text,
body.sidebar-pinned.sidebar-collapsed .sl-label,
body.sidebar-pinned.sidebar-collapsed .sidebar-user-info,
body.sidebar-pinned.sidebar-collapsed .sidebar-logout { display: none; }
body.sidebar-pinned.sidebar-collapsed .sidebar-top { justify-content: center; padding: .75rem .5rem; }
body.sidebar-pinned.sidebar-collapsed .sidebar-collapse-btn { display: flex; }
body.sidebar-pinned.sidebar-collapsed .sidebar-divider { margin: .3rem .5rem; }
body.sidebar-pinned.sidebar-collapsed .sidebar-link { justify-content: center; padding: .7rem .5rem; }
body.sidebar-pinned.sidebar-collapsed .sl-icon { font-size: 1.1rem; }
body.sidebar-pinned.sidebar-collapsed .sidebar-user { justify-content: center; padding: .5rem; }
body.sidebar-pinned.sidebar-collapsed .sidebar-user-avatar { width: 32px; height: 32px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 499;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: .5rem;
  flex-shrink: 0;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  overflow: hidden;
}
.sidebar-brand-text {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.sidebar-links {
  flex: 1;
  overflow-y: auto;
  padding: .5rem 0;
  display: flex;
  flex-direction: column;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-link:hover  { background: var(--surface2); color: var(--text); text-decoration: none; }
.sidebar-link.active { background: var(--accent-lo); color: var(--accent); }
.sl-icon { font-size: .95rem; flex-shrink: 0; width: 20px; text-align: center; }
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: .4rem .75rem; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar-user-info { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow: hidden; }
.sidebar-user-name { font-size: .82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-bal  { font-size: .75rem; color: var(--accent); }
.sidebar-logout { color: var(--muted); font-size: 1.1rem; text-decoration: none; flex-shrink: 0; }
.sidebar-logout:hover { color: var(--danger); text-decoration: none; }

/* ─── Notification item actions ─────────────────────────── */
.notif-item-wrap {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.notif-item-wrap.unread-wrap { background: var(--accent-lo); }
.notif-item-wrap .notif-item {
  flex: 1;
  border-bottom: none;
  min-width: 0;
}
.notif-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: .3rem .4rem;
  flex-shrink: 0;
}
.notif-mark-btn, .notif-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .8rem;
  padding: 2px 5px;
  border-radius: 4px;
  transition: background .15s, color .15s;
  line-height: 1;
}
.notif-mark-btn  { color: var(--success); }
.notif-delete-btn { color: var(--muted); }
.notif-mark-btn:hover  { background: rgba(34,197,94,.15); color: var(--success); }
.notif-delete-btn:hover { background: rgba(239,68,68,.15); color: var(--danger); }
.notif-mark-all-btn    { padding: 0; background: none; }

/* ─── Clickable notification items ─────────────────────── */
a.notif-item {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.notif-item:hover { background: var(--surface2); }

/* ─── Crypto guide section ──────────────────────────────── */
.crypto-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.crypto-exchange-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: .75rem;
  transition: border-color .2s, transform .2s;
}
.crypto-exchange-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cex-logo { font-size: 1.8rem; flex-shrink: 0; line-height: 1; padding-top: .1rem; }
.cex-body { flex: 1; min-width: 0; }
.cex-name { font-weight: 700; font-size: .9rem; margin-bottom: .3rem; color: var(--text); }
.cex-desc { font-size: .8rem; color: var(--muted); margin-bottom: .5rem; line-height: 1.5; }
.cex-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.cex-tags .badge { font-size: .65rem; }

.crypto-how-to {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.crypto-steps { display: flex; flex-direction: column; gap: .6rem; }
.crypto-step {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: .85rem;
  color: var(--muted);
}
.step-num {
  background: var(--accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: .1rem;
}

/* ─── Nav layout toggle pill ────────────────────────────── */
.nav-layout-toggle {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.nav-layout-toggle button {
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem .7rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: .3rem;
  white-space: nowrap;
}
.nav-layout-toggle button.active {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
}
.nav-layout-toggle button:hover:not(.active) { color: var(--text); }

/* ─── Global img guard (prevent stretch inside flex) ────── */
.nav-avatar,
.user-menu-avatar-lg,
.sidebar-user-avatar {
  width: 28px !important;
  height: 28px !important;
  max-width: none !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}
.user-menu-avatar-lg  { width: 40px !important; height: 40px !important; }
.sidebar-user-avatar  { width: 34px !important; height: 34px !important; }

/* ─── Ghost button ──────────────────────────────────────── */
.btn-ghost {
  background: none; border: 1px solid transparent; color: var(--muted);
  padding: .3rem .7rem; border-radius: var(--radius); cursor: pointer;
  font-size: .82rem; transition: color .2s, border-color .2s;
}
.btn-ghost:hover { color: var(--danger); border-color: var(--danger); }

/* ─── Modal overlay ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 1rem;
}
.modal-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; width: 100%; max-width: 440px;
  box-shadow: var(--shadow);
}

/* ─── Chat layout ───────────────────────────────────────── */
.chat-layout {
  display: flex; height: calc(100vh - 60px);
  overflow: hidden;
}

.chat-sidebar {
  width: 320px; min-width: 280px; max-width: 340px;
  border-right: 1px solid var(--border); display: flex;
  flex-direction: column; background: var(--surface);
  flex-shrink: 0;
}
.chat-sidebar-header {
  padding: 1rem 1rem .75rem; border-bottom: 1px solid var(--border);
}
.chat-sidebar-header h2 { font-size: 1.1rem; }

.chat-conv-list { flex: 1; overflow-y: auto; }
.chat-conv-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: background .15s;
}
.chat-conv-item:hover, .chat-conv-item.active { background: var(--surface2); }
.chat-conv-item.active { border-left: 3px solid var(--accent); }
.chat-conv-info { flex: 1; min-width: 0; }
.chat-conv-name {
  font-weight: 600; font-size: .9rem; display: flex;
  align-items: center; gap: .4rem; justify-content: space-between;
}
.chat-conv-time { font-size: .72rem; color: var(--muted); margin-top: .15rem; }
.chat-unread-badge {
  background: var(--accent); color: #fff; font-size: .65rem;
  font-weight: 700; border-radius: 999px; padding: .1rem .4rem; min-width: 18px;
  text-align: center; flex-shrink: 0;
}
.chat-empty-conv {
  text-align: center; padding: 3rem 1.5rem; color: var(--muted); font-size: .88rem;
}

/* ── Main chat area ─────────────────────────────────────── */
.chat-main {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  background: var(--bg);
}
.chat-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
#chat-back-btn { display: none; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: .5rem;
}

/* ── Chat bubbles ───────────────────────────────────────── */
.chat-msg-wrap {
  display: flex; align-items: flex-end; gap: .5rem;
}
.chat-msg-wrap.mine { flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.chat-bubble {
  max-width: 68%; padding: .5rem .8rem .35rem;
  border-radius: 16px; position: relative;
  word-break: break-word; font-size: .9rem; line-height: 1.45;
}
.bubble-theirs {
  background: var(--surface2); border-bottom-left-radius: 4px;
}
.bubble-mine {
  background: var(--accent2); color: #fff; border-bottom-right-radius: 4px;
}
.chat-bubble-text { margin-bottom: .2rem; }
.chat-bubble-meta {
  display: flex; align-items: center; justify-content: flex-end;
  gap: .3rem; font-size: .65rem; opacity: .7; white-space: nowrap;
}
.chat-img-attachment {
  width: 100%; max-width: 240px; border-radius: 10px;
  cursor: pointer; margin-bottom: .3rem; display: block;
}

/* ── Chat input ─────────────────────────────────────────── */
.chat-input-area {
  padding: .75rem 1rem; border-top: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.chat-input-area form {
  display: flex; align-items: flex-end; gap: .5rem;
}
.chat-img-btn {
  font-size: 1.3rem; cursor: pointer; padding: .35rem;
  border-radius: 8px; transition: background .15s; flex-shrink: 0;
  display: flex; align-items: center;
}
.chat-img-btn:hover { background: var(--surface2); }
.chat-input-wrap {
  flex: 1; display: flex; align-items: center; gap: .4rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 22px; padding: .4rem .8rem; min-height: 42px;
}
.chat-input-wrap textarea {
  flex: 1; background: none; border: none; resize: none;
  color: var(--text); font-size: .9rem; line-height: 1.4;
  max-height: 120px; outline: none; font-family: inherit;
}
.chat-send-btn { border-radius: 999px; padding: .45rem 1.1rem; flex-shrink: 0; }

.chat-welcome {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 2rem; color: var(--muted);
}
.chat-welcome h2 { color: var(--text); margin-bottom: .5rem; }

/* ── Responsive chat ────────────────────────────────────── */
@media (max-width: 640px) {
  .chat-sidebar { width: 100%; position: absolute; z-index: 10;
    height: 100%; display: none; }
  .chat-sidebar.mobile-show { display: flex; }
  .chat-main { width: 100%; }
  #chat-back-btn { display: inline-flex; }
}

/* ─── Image protection overlay ──────────────────────────── */
.img-protected {
  position: relative; display: inline-block;
  -webkit-user-select: none; user-select: none;
}
.img-protected::after {
  content: ''; position: absolute; inset: 0;
  cursor: default;
}
.img-protected img { pointer-events: none; display: block; }

/* ─── Review: one-per-user indicator ───────────────────── */
.review-edit-note {
  font-size: .78rem; color: var(--accent); margin-top: .25rem;
}
