/* DeepCircle web — desktop-first, mirrors the mobile design tokens.
   Keeping this as plain CSS without a build step matches the landing
   page next door. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #374151;
  --text-dim: #6b7280;
  --text-faint: #9ca3af;
  --brand: #3b82f6;
  --brand-2: #2563eb;
  --gold: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --sh-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --sh-md: 0 8px 24px rgba(15, 23, 42, .07);
  --sh-lg: 0 20px 48px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Manrope', 'Inter', sans-serif; color: #111827; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.4px; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 700; margin: 24px 0 12px; }
a { color: inherit; text-decoration: none; }
input, button { font-family: inherit; font-size: inherit; }
.muted { color: var(--text-dim); }
.small { font-size: 12px; }
.center { text-align: center; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 12.5px; color: #2563eb; }

.brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 22px rgba(59,130,246,.32);
  flex-shrink: 0;
}

/* ============================== buttons ============================== */
button { cursor: pointer; border: 1px solid transparent; border-radius: 12px; padding: 11px 16px; font-weight: 700; }
button.primary { background: var(--brand); color: #fff; box-shadow: var(--sh-sm); }
button.primary:hover { background: var(--brand-2); }
button.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
button.ghost:hover { background: var(--surface-2); }
button.small { padding: 8px 14px; font-size: 13px; }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* ============================== auth ============================== */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; }
.auth .back { position: absolute; top: 24px; left: 24px; color: var(--text-dim); font-weight: 600; }
.auth-card {
  background: var(--surface); border-radius: 20px; padding: 36px;
  box-shadow: var(--sh-lg); max-width: 420px; width: 100%;
  display: flex; flex-direction: column; gap: 18px;
}
.auth-card .brand-mark { margin: 0 auto 4px; }
.auth-card h1 { text-align: center; font-size: 24px; }
.auth-card p { text-align: center; margin: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--text); }
.auth-card input {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; color: var(--text); background: var(--surface);
  outline: none; transition: border-color .15s;
}
.auth-card input:focus { border-color: var(--brand); }
.auth-card .row { display: flex; gap: 10px; }
.auth-card .row button { flex: 1; }
.err { color: var(--danger); font-size: 13px; text-align: center; margin: 0; }

/* ============================== shell ============================== */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 24px 18px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.side .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.side .brand-name { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 18px; color: #111827; }
.side .nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.side .nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; color: var(--text);
  font-weight: 600; font-size: 14px;
}
.side .nav a:hover { background: var(--surface-2); }
.side .nav a.active { background: var(--surface-2); color: var(--brand-2); }
.side .nav a.active .ico { background: var(--brand-2); }
.side .logout { margin-top: auto; }

.ico { width: 18px; height: 18px; display: inline-block; background: var(--text-dim); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.ico-feed { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3 5h18v3H3zM3 10.5h18v3H3zM3 16h18v3H3z'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3 5h18v3H3zM3 10.5h18v3H3zM3 16h18v3H3z'/></svg>"); }
.ico-wallet { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M21 7H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zm-3 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM19 5H5a2 2 0 0 0-2 2v.5h18V7a2 2 0 0 0-2-2z'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M21 7H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zm-3 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM19 5H5a2 2 0 0 0-2 2v.5h18V7a2 2 0 0 0-2-2z'/></svg>"); }
.ico-msg { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-4 4V6a2 2 0 0 1 2-2z'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-4 4V6a2 2 0 0 1 2-2z'/></svg>"); }
.ico-me { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 1 1 16 0H4z'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 1 1 16 0H4z'/></svg>"); }

#route { padding: 36px 48px 64px; max-width: 880px; }
.page-h { margin-bottom: 22px; }
.sub { font-family: 'Manrope', sans-serif; color: var(--text); margin: 28px 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }

.loading { padding: 18px; text-align: center; color: var(--text-dim); }

/* ============================== feed ============================== */
.tabs { display: flex; gap: 6px; margin-top: 8px; }
.tabs .tab {
  background: transparent; color: var(--text-dim); border: 0;
  padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px;
}
.tabs .tab:hover { color: var(--text); background: var(--surface-2); }
.tabs .tab.active { background: var(--brand); color: #fff; box-shadow: var(--sh-sm); }
.tabs .tab.active:hover { background: var(--brand-2); }

.feed-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.post {
  background: var(--surface); border-radius: 14px; padding: 18px 20px;
  border: 1px solid var(--border); box-shadow: var(--sh-sm);
  display: flex; flex-direction: column; gap: 10px;
}
.post-h { display: flex; align-items: center; gap: 10px; }
.post-h .av {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0;
  background-size: cover; background-position: center;
}
.post-h .post-author { flex: 1; min-width: 0; }
.post-h .name { font-weight: 700; }
.post-h .handle, .post-h .time { color: var(--text-dim); font-size: 12.5px; }
.post-body { white-space: pre-wrap; word-break: break-word; }
.post-media { width: 100%; }
.post-media img, .post-media video {
  width: 100%; border-radius: 12px; max-height: 560px;
  background: #000; display: block;
}
.post-media .audio-wrap {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px;
}
.post-media .audio-wrap audio { width: 100%; }
.post-actions {
  display: flex; gap: 6px; padding-top: 4px;
  border-top: 1px solid var(--border); margin-top: 4px;
}
.ico-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; padding: 8px 12px;
  color: var(--text-dim); font-weight: 600; font-size: 13px; border-radius: 8px;
}
.ico-btn:hover { background: var(--surface-2); color: var(--text); }
.ico-btn.liked { color: var(--danger); }
.ico-btn.liked .ico-heart { background: var(--danger); }
.ico-btn .ico { width: 16px; height: 16px; }
.ico-heart { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 21s-7-4.35-7-10a4.5 4.5 0 0 1 8-2.83A4.5 4.5 0 0 1 19 11c0 5.65-7 10-7 10z'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 21s-7-4.35-7-10a4.5 4.5 0 0 1 8-2.83A4.5 4.5 0 0 1 19 11c0 5.65-7 10-7 10z'/></svg>"); }
.ico-bubble { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-4 4V6a2 2 0 0 1 2-2z'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-4 4V6a2 2 0 0 1 2-2z'/></svg>"); }
.ico-share { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M14 9V5l7 7-7 7v-4H3V9h11z'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M14 9V5l7 7-7 7v-4H3V9h11z'/></svg>"); }

.comments-pane { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.comments-pane .comment-form { display: flex; gap: 8px; }
.comments-pane .comment-form input {
  flex: 1; border: 1.5px solid var(--border); border-radius: 999px; padding: 8px 14px;
  font-size: 13px; outline: none;
}
.comments-pane .comment-form input:focus { border-color: var(--brand); }
.comments-pane .comment-form button {
  padding: 8px 14px; font-size: 13px; border-radius: 999px;
}
.comments-pane .list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 10px; }
.comment .av {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.comment .body { flex: 1; min-width: 0; }
.comment .meta { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.comment .meta .name { font-weight: 700; font-size: 13px; }
.comment .meta .handle { color: var(--text-dim); font-size: 12px; }
.comment .text { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }

/* ============================== wallet ============================== */
.balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.bal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--sh-sm);
}
.bal .v { font-family: 'Manrope', sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -.5px; color: #111827; }
.bal .l { color: var(--text-dim); font-size: 12px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; }
.tx-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tx {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px;
}
.tx .lbl { flex: 1; }
.tx .lbl .t { font-weight: 600; }
.tx .lbl .d { color: var(--text-dim); font-size: 12px; }
.tx .amt { font-weight: 800; font-family: 'Manrope', sans-serif; }
.tx .amt.pos { color: var(--success); }
.tx .amt.neg { color: var(--danger); }

/* ============================== messages ============================== */
.conv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.conv {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.conv .av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #cbd5e1, #94a3b8); }
.conv .lbl { flex: 1; }
.conv .lbl .t { font-weight: 700; }
.conv .lbl .d { color: var(--text-dim); font-size: 12.5px; }

/* ============================== profile ============================== */
.prof-hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px 24px; display: flex; align-items: center; gap: 20px;
  box-shadow: var(--sh-sm);
}
.av-edit {
  all: unset; cursor: pointer; position: relative;
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; display: block;
}
.av-edit .av-lg {
  width: 100%; height: 100%; border-radius: 50%;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 32px; font-family: 'Manrope', sans-serif;
}
.av-edit .av-overlay {
  position: absolute; inset: auto 0 0 0; padding: 6px 0;
  background: rgba(15, 23, 42, .68); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .4px; text-align: center;
  text-transform: uppercase; opacity: 0; transition: opacity .12s;
}
.av-edit:hover .av-overlay, .av-edit:focus .av-overlay { opacity: 1; }
.prof-id { flex: 1; min-width: 0; }
.prof-name { font-family: 'Manrope', sans-serif; font-size: 24px; font-weight: 800; color: #111827; }
.prof-handle { color: var(--brand-2); font-weight: 600; font-size: 14px; margin-top: 2px; }
.prof-mood { margin-top: 6px; font-size: 13px; font-style: italic; }
.prof-meta { margin: 12px 4px 0; display: flex; gap: 16px; flex-wrap: wrap; }
.prof-meta span::before { content: '· '; margin-right: 2px; color: var(--text-faint); }
.prof-meta span:first-child::before { content: ''; }
.prof-bio {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; margin-top: 14px; color: var(--text); white-space: pre-wrap;
  font-size: 14px;
}
.prof-bio:empty { display: none; }
.prof-stats, .prof-battle {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px;
}
.stat .v { font-family: 'Manrope', sans-serif; font-size: 22px; font-weight: 800; color: #111827; letter-spacing: -.3px; }
.stat .l { color: var(--text-dim); font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; margin-top: 2px; }
.prof-interests { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600;
}
.pill.pending { color: var(--text-dim); border-style: dashed; }

/* ============================== modal ============================== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal {
  background: var(--surface); border-radius: 18px; padding: 24px;
  max-width: 460px; width: 100%;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--sh-lg);
}
.modal header h2 { margin: 0 0 4px; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--text); letter-spacing: .3px; }
.modal input[type=text], .modal input:not([type]), .modal input[type=file], .modal textarea {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; font-weight: 500; color: var(--text); background: var(--surface);
  outline: none;
}
.modal input:focus, .modal textarea:focus { border-color: var(--brand); }
.modal textarea { resize: vertical; font-family: inherit; }
.modal .row { display: flex; gap: 10px; margin-top: 6px; }
.modal .row button { flex: 1; }

/* ============================== responsive ============================== */
@media (max-width: 880px) {
  .shell { grid-template-columns: 80px 1fr; }
  .side { padding: 18px 10px; }
  .side .brand-name, .side .nav a span:not(.ico), .side .logout { display: none; }
  .side .nav a { justify-content: center; padding: 12px; }
  #route { padding: 24px 18px 48px; }
}
@media (max-width: 600px) {
  h1 { font-size: 22px; }
  .auth-card { padding: 24px; }
  .balances { grid-template-columns: 1fr 1fr; }
}
