/* ==================================================================
   اتاق فکر — نئوبروتالیست، موبایل اول
   ================================================================== */

@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-ExtraBold.woff2") format("woff2");
  font-weight: 800 900;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("/fonts/space-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("/fonts/space-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #131211;
  --paper: #fff6e6;
  --card: #fffcf4;
  --yellow: #ffce1f;
  --cyan: #5fd6e8;
  --red: #d62412;
  --muted: #221e17;
  --bg: #ffae1f;
  --line: 3px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 16px;
  --nav-h: 68px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(19, 18, 17, .3) 1.1px, transparent 1.2px);
  background-size: 20px 20px;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  color: var(--ink);
  padding-bottom: calc(var(--nav-h) + 26px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: var(--yellow); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--yellow);
}

.mono { font-family: "Space Mono", monospace; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------- topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: var(--paper);
  border-bottom: var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 900; font-size: 18px; letter-spacing: -0.3px;
  white-space: nowrap;
}
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--yellow); border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 15px; font-weight: 900;
  transform: rotate(-4deg);
}
.topnav { display: none; gap: 4px; margin-inline-start: 18px; }
.topnav a {
  padding: 5px 10px; border-radius: 9px; border: 2px solid transparent;
  font-size: 12.5px; font-weight: 800; color: var(--muted);
}
.topnav a.active {
  color: var(--ink); background: var(--yellow);
  border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-1deg);
}
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 7px; }

.credit-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 800; white-space: nowrap;
  background: var(--card); border: 2px solid var(--ink);
  border-radius: 20px; padding: 2px 9px;
  box-shadow: 2px 2px 0 var(--ink);
}
.credit-chip b { font-size: 12.5px; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--card); border: 2.5px solid var(--ink);
  border-radius: 10px; box-shadow: 2px 2px 0 var(--ink);
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.icon-btn .dot {
  position: absolute; top: -5px; left: -5px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--ink);
}

.avatar {
  --av: var(--yellow);
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: var(--av);
  border: 2.5px solid var(--ink); border-radius: 50%;
  font-weight: 900; font-size: 15px;
  box-shadow: 2px 2px 0 var(--ink);
  overflow: hidden;
}
.avatar.sm { width: 27px; height: 27px; flex-basis: 27px; font-size: 11px; border-width: 2px; box-shadow: none; }
.avatar.lg { width: 84px; height: 84px; flex-basis: 84px; font-size: 32px; border-width: 3px; box-shadow: var(--shadow); }

/* ---------------- layout ---------------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 14px 14px 8px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.layout > * { min-width: 0; }
.rail { display: none; }

.eyebrow {
  font-family: "Space Mono", monospace; direction: ltr; unicode-bidi: isolate;
  font-size: 11px; letter-spacing: 2px; color: #3a3226;
  margin: 0 0 4px;
}
.eyebrow.fa {
  font-family: "Vazirmatn", Tahoma, sans-serif; direction: rtl;
  font-size: 12.5px; font-weight: 800; letter-spacing: 0;
}
.page-title { margin: 0; font-size: 26px; font-weight: 900; line-height: 1.35; letter-spacing: -0.4px; }
.page-sub {
  margin: 6px 0 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.85;
  display: inline-block;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 4px 12px;
  box-shadow: 2px 2px 0 var(--ink);
}
.card .page-sub, .modal-head .page-sub, .auth-card .page-sub, .gate-card .page-sub {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: block;
  color: var(--ink);
  font-weight: 700;
  margin: 4px 0 0;
}

/* ---------------- buttons / chips ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 16px;
  background: var(--card); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 11px;
  box-shadow: var(--shadow-sm); white-space: nowrap;
  font-weight: 800; font-size: 13.5px; line-height: 1;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn.primary { background: var(--yellow); }
.btn.secondary { background: var(--cyan); }
.btn.danger { background: var(--red); color: #fff6ec; }
.btn.ghost { background: transparent; box-shadow: none; border-width: 2.5px; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 12.5px; border-width: 2.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.link-btn { background: none; border: none; padding: 6px; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  background: var(--paper); border: 2px solid var(--ink);
  border-radius: 20px; padding: 1px 8px;
}
.sticker {
  display: inline-block;
  font-size: 10.5px; font-weight: 900;
  background: var(--yellow); border: 2px solid var(--ink);
  border-radius: 6px; padding: 1px 7px;
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-2.5deg);
}
.sticker.red { background: var(--red); color: #fff6ec; }
.sticker.cyan { background: var(--cyan); }

/* ---------------- cards ---------------- */
.card {
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 900; margin: 20px 0 10px;
}
.section-title .count { color: var(--muted); font-size: 12px; font-weight: 700; }

/* ---------------- tabs / tags ---------------- */
.tabs {
  display: flex; gap: 6px; margin-top: 14px;
  overflow-x: auto; padding: 3px 1px 6px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  font-size: 13px; font-weight: 800; color: var(--muted);
  background: transparent; border: 2px solid transparent;
  border-radius: 9px; padding: 6px 11px;
  min-height: 36px;
}
.tab.active {
  color: var(--ink); background: var(--yellow);
  border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-1deg);
}
.tag-row { display: flex; gap: 6px; overflow-x: auto; padding: 0 1px 8px; scrollbar-width: none; }
.tag-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 700;
  border: 2px solid var(--ink); border-radius: 20px;
  background: var(--card); padding: 3px 9px; min-height: 30px;
  display: inline-flex; align-items: center;
}
.chip.active { background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }

/* ---------------- feed ---------------- */
.feed-head { display: flex; align-items: flex-start; gap: 10px; }
.feed-head > div { flex: 1; min-width: 0; }
.feed-head > .btn { flex: 0 0 auto; }
.feed-head .btn.compose-btn { display: none; margin-inline-start: auto; }
.people-inline {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 9px; font-size: 12.5px; font-weight: 800;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}

.q-card {
  position: relative;
  margin-top: 14px;
  padding: 13px 14px 14px;
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .1s ease, box-shadow .1s ease;
}
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meta-chip {
  font-size: 11px; font-weight: 800;
  background: var(--paper); border: 2px solid var(--ink);
  border-radius: 6px; padding: 1px 7px;
}
.meta-chip.hot { background: var(--red); color: #fff6ec; transform: rotate(-3deg); }


.q-title { margin: 8px 0 9px; font-size: 17px; font-weight: 800; line-height: 1.75; }
.q-title a { display: block; }
.q-owner { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.who-link { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.who-link .nm, .who-link b { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: rgba(19, 18, 17, .4); }
.who-link:hover .nm, .who-link:hover b, .who-link:focus-visible .nm { text-decoration-color: var(--ink); }
.q-owner .nm { font-size: 12px; font-weight: 700; }
.q-owner .hd { font-family: "Space Mono", monospace; direction: ltr; font-size: 10.5px; color: var(--muted); }
.q-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 7px; font-size: 11.5px; color: var(--muted);
}
.q-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.q-meta .deadline { color: #a3180d; font-weight: 800; }
.lock-strip {
  margin-top: 9px; display: flex; align-items: center; gap: 6px;
  border: 2px dashed var(--ink); border-radius: 9px;
  padding: 7px 9px; font-size: 11.5px; color: #2f2a21; line-height: 1.65;
}
.lock-strip.unlocked { border-style: solid; background: rgba(95, 214, 232, .35); color: var(--ink); }
.lock-strip.pending { background: rgba(255, 206, 31, .45); }
.q-actions { display: flex; gap: 8px; margin-top: 11px; }
.q-actions .btn { flex: 1; }

/* daily (mobile) */
.daily-card {
  margin-top: 12px; padding: 12px 13px;
  background: var(--yellow); border: var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.daily-card .eyebrow { color: #3a3226; }
.daily-card .q-title { margin: 5px 0 3px; font-size: 14px; }
.daily-card .q-meta { margin-top: 4px; }

/* ---------------- rail ---------------- */
.rail-card { margin-bottom: 14px; padding: 14px; }
.rail-card h3 { margin: 0 0 6px; font-size: 14px; font-weight: 900; }
.rail-card p { margin: 0; font-size: 12px; line-height: 1.9; color: #3b352a; }
.daily-rail p { font-size: 13px; line-height: 1.8; }
.daily-rail p b { color: var(--ink); }

.streak-box { display: flex; align-items: center; gap: 12px; }
.flame { font-size: 34px; line-height: 1; filter: saturate(1.2); }
.streak-num { font-size: 24px; font-weight: 900; line-height: 1.2; }
.streak-label { font-size: 11.5px; color: var(--muted); }

.mini-leaders { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.leader-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.leader-row .rank {
  width: 21px; height: 21px; display: grid; place-items: center;
  font-size: 11px; font-weight: 900;
  border: 2px solid var(--ink); border-radius: 6px; background: var(--paper);
}
.leader-row:nth-child(1) .rank { background: var(--yellow); }
.leader-row .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.leader-row .val {
  font-family: "Space Mono", monospace; font-size: 11.5px; font-weight: 700;
  color: var(--ink); line-height: 1.35; text-align: center;
}
.leader-row .val i {
  display: block; font-style: normal; font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 9.5px; font-weight: 700; color: var(--muted); direction: rtl;
}

.install-card { background: var(--cyan); }
.install-card .row { margin-top: 9px; }
.install-icon {
  width: 38px; height: 38px; border-radius: 10px; border: 2.5px solid var(--ink);
  background: var(--paper); overflow: hidden; flex: 0 0 38px;
}
.install-icon img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- question page ---------------- */
.back { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--muted); margin: 2px 0 10px; }
.back svg { transform: rotate(180deg); }

.question-hero { padding: 15px; }
.q-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.question-hero h1 { margin: 0 0 10px; font-size: 22px; font-weight: 900; line-height: 1.6; letter-spacing: -0.3px; }
.q-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.q-stats { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.q-stats b { color: var(--ink); }

.layer { margin-top: 14px; padding: 15px; }
.layer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.layer-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 900;
  background: var(--paper); border: 2px solid var(--ink);
  border-radius: 7px; padding: 1px 9px;
}
.layer.open .layer-badge { background: var(--yellow); }
.layer-body { font-size: 13px; line-height: 2.05; color: #2b2a26; }
.layer-body p { margin: 0 0 10px; }
.layer-body p:last-child { margin-bottom: 0; }
.layer-context { color: var(--muted); font-size: 12px; line-height: 1.95; }

.layer-locked {
  margin-top: 14px; padding: 18px 15px;
  background: rgba(255, 255, 255, .32);
  border: 3px dashed var(--ink); border-radius: var(--radius);
  text-align: center;
}
.lock-big {
  width: 52px; height: 52px; margin: 0 auto 10px;
  display: grid; place-items: center;
  background: var(--yellow); border: 3px solid var(--ink);
  border-radius: 50%; box-shadow: 3px 3px 0 var(--ink);
}
.layer-locked h3 { margin: 0 0 5px; font-size: 15px; font-weight: 900; }
.layer-locked p { margin: 0 auto; max-width: 460px; font-size: 12.5px; line-height: 1.95; color: var(--muted); }

.status-box {
  margin-top: 12px; padding: 11px 12px; text-align: right;
  border: 2.5px solid var(--ink); border-radius: 12px;
  background: var(--paper); font-size: 12.5px; line-height: 1.9;
}
.status-box.pending { background: rgba(255, 206, 31, .45); }
.status-box.rejected { background: rgba(232, 50, 31, .16); }
.status-box .status-head { font-weight: 900; font-size: 12.5px; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }

/* approvals */
.approvals {
  margin-top: 14px; padding: 14px;
  background: #fff1b8; border: var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.approvals h3 { margin: 0 0 4px; font-size: 15px; font-weight: 900; }
.approval-card {
  margin-top: 10px; padding: 11px 12px;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 12px;
}
.approval-card .text { margin: 8px 0; font-size: 12.5px; line-height: 1.95; }
.approval-actions { display: flex; gap: 8px; }
.approval-actions .btn { flex: 1; }

/* related thinkers */
.related-block { margin-top: 16px; }
.related-block .section-title { margin: 0 0 4px; }
.related-sub { margin: 0 0 10px; font-size: 12px; line-height: 1.85; color: var(--muted); }
.related-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.related-card {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 12px; background: var(--card);
  border: 2.5px solid var(--ink); border-radius: 13px;
  box-shadow: 2px 2px 0 var(--ink);
}
.related-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.related-who .avatar { width: 34px; height: 34px; flex: 0 0 34px; font-size: 13px; border-width: 2px; box-shadow: none; }
.related-name { min-width: 0; display: flex; flex-direction: column; }
.related-name b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-name span {
  font-family: "Space Mono", monospace; direction: ltr;
  font-size: 9.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.related-job {
  margin: 0; min-height: 20px; font-size: 11px; line-height: 1.75; color: #3b352a;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.related-card .tag { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-card .btn { margin-top: 4px; }
.related-card .btn:disabled { opacity: .8; }

/* rejection reasons */
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.reject-chips .chip { min-height: 34px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.reject-path {
  display: flex; gap: 7px; align-items: flex-start;
  margin-top: 12px; padding: 9px 11px;
  font-size: 11.5px; line-height: 1.85;
  background: rgba(142, 220, 230, .22);
  border: 2px dashed var(--ink); border-radius: 10px;
}
.reject-path svg { flex: 0 0 auto; margin-top: 2px; }
.status-box .reject-why, .status-box .reject-quote { margin: 2px 0 4px; }
.status-box .reject-quote { font-size: 12px; color: #3b352a; }

/* perspective form */
.persp-form { margin-top: 12px; text-align: right; }
.field { margin-bottom: 12px; }
.label { display: block; font-size: 12.5px; font-weight: 800; margin-bottom: 5px; }
.hint { display: block; font-size: 11.5px; color: #4a4234; margin-top: 4px; line-height: 1.8; }
.input, .textarea {
  width: 100%; padding: 11px 12px;
  background: #fffdf8; border: 3px solid var(--ink); border-radius: 11px;
  font-size: 16px; line-height: 1.7;
  box-shadow: 2px 2px 0 var(--ink);
}
.textarea { min-height: 130px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; background: #fff; }
.input::placeholder, .textarea::placeholder { color: #6a6151; opacity: 1; }

.mode-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mode-chip { position: relative; display: inline-flex; }
.mode-chip input { position: absolute; opacity: 0; pointer-events: none; }
.mode-chip span {
  display: inline-block; padding: 7px 11px; cursor: pointer;
  border: 2.5px solid var(--ink); border-radius: 999px;
  background: #fffdf8; font-size: 12px; font-weight: 800; line-height: 1.5;
}
.mode-chip input:checked + span {
  background: var(--yellow); box-shadow: 2px 2px 0 var(--ink);
}

/* perspectives */
.persp-card {
  padding: 12px 13px; margin-top: 10px;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 13px;
  box-shadow: 2px 2px 0 var(--ink);
}
.persp-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.persp-head .nm { font-size: 12.5px; font-weight: 800; }
.persp-head .hd { font-family: "Space Mono", monospace; direction: ltr; font-size: 10.5px; color: var(--muted); }
.persp-card .text { margin: 8px 0 0; font-size: 13px; line-height: 2; }
.persp-foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 11px; color: var(--muted); }
.status-badge {
  font-size: 10.5px; font-weight: 900; padding: 1px 7px; border-radius: 20px;
  border: 2px solid var(--ink);
}
.status-badge.pending { background: var(--yellow); }
.status-badge.rejected { background: rgba(232, 50, 31, .22); }

/* question actions */
.q-actions-bar { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 12px;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 10px;
  font-size: 11.5px; font-weight: 800; box-shadow: 2px 2px 0 var(--ink);
}
.action-btn.on { background: var(--yellow); }
.action-btn .count { font-family: "Space Mono", monospace; font-size: 11px; }

/* ---------------- profile ---------------- */
.profile-hero { padding: 16px; }
.profile-head { display: flex; gap: 13px; align-items: flex-start; }
.profile-name { font-size: 22px; font-weight: 900; line-height: 1.3; margin: 0; }
.profile-handle {
  display: inline-block; font-family: "Space Mono", monospace; direction: ltr;
  font-size: 11.5px; font-weight: 700;
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 6px;
  padding: 0 7px; margin-top: 3px; box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-2deg);
}
.profile-headline { margin: 8px 0 0; font-size: 12px; line-height: 1.9; color: #38352d; }
.profile-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.profile-job {
  padding: 1px 8px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 11px;
  box-shadow: 2px 2px 0 var(--ink);
}

.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 7px; margin-top: 14px;
}
.stat {
  padding: 7px 4px; text-align: center;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 10px;
}
.stat-num { font-size: 17px; font-weight: 900; line-height: 1.3; }
.stat-label { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.stats-note { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); }
.profile-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.profile-links .btn { width: 100%; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 800;
  background: var(--cyan); border: 2px solid var(--ink); border-radius: 20px;
  padding: 2px 8px; box-shadow: 2px 2px 0 var(--ink);
}

.profile-card { margin-top: 14px; padding: 15px; }
.profile-card h2 { margin: 0 0 8px; font-size: 14px; font-weight: 900; }
.about-text { margin: 0; font-size: 12.5px; line-height: 2.05; color: #33302a; white-space: pre-line; }
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.exp-list { margin: 0; padding: 0; list-style: none; }
.exp-list li { font-size: 12px; line-height: 1.9; padding: 7px 0; border-bottom: 2px dashed rgba(21, 21, 21, .2); }
.exp-list li:last-child { border-bottom: none; }
.links-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.links-list a {
  font-family: inherit; direction: rtl; font-size: 12px; font-weight: 800;
  color: var(--ink); text-decoration: none; padding: 7px 13px;
  border: 2.5px solid var(--ink); border-radius: 999px;
  background: var(--card); box-shadow: 2px 2px 0 var(--ink);
}
.links-list a:active { transform: translate(2px, 2px); box-shadow: none; }
.portfolio-item { padding: 10px 0; border-bottom: 2px dashed rgba(21, 21, 21, .2); }
.portfolio-item:last-child { border-bottom: none; }
.portfolio-item .q-link { font-size: 12.5px; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }
.portfolio-item p { margin: 6px 0 0; font-size: 12px; line-height: 1.95; color: #33302a; }

/* ---------------- settings / forms ---------------- */
.form-card { padding: 16px; max-width: 720px; margin-inline: auto; }
.narrow { max-width: 720px; margin-inline: auto; }
.form-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 900; }
.form-actions { display: flex; gap: 8px; margin-top: 4px; }
.form-actions .btn { flex: 1; }

.more {
  margin: 4px 0 14px; padding: 10px 12px;
  border: 2.5px dashed var(--ink); border-radius: 12px;
  background: rgba(255, 255, 255, .35);
}
.more summary { cursor: pointer; font-size: 13px; font-weight: 800; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: " +"; }
.more[open] summary::after { content: " −"; }
.more .field:first-of-type { margin-top: 12px; }

/* ---------------- notifications ---------------- */
.notif-card { padding: 0; overflow: hidden; }
.notif-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 13px; border-bottom: 2.5px solid var(--ink);
  font-size: 12px; line-height: 1.85;
}
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { background: rgba(255, 206, 31, .35); }
.notif-icon {
  width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 9px;
  font-size: 14px;
}
.notif-body { flex: 1; min-width: 0; }
.notif-time { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.notif-link { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- leaderboard ---------------- */
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-bottom: 2.5px solid var(--ink);
}
.lb-row:last-child { border-bottom: none; }
.lb-row.top { background: rgba(255, 206, 31, .32); }
.lb-rank {
  width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center;
  font-size: 11px; font-weight: 900;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 8px;
}
.lb-row.top .lb-rank { background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.lb-user { flex: 1; min-width: 0; }
.lb-name { display: block; font-size: 12.5px; font-weight: 800; }
.lb-sub { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-val { text-align: center; min-width: 48px; }
.lb-val b { display: block; font-size: 13px; }
.lb-val span { font-size: 10px; color: var(--muted); }

/* ---------------- people ---------------- */
.people-page { max-width: 880px; margin: 0 auto; }
.people-search { display: flex; gap: 8px; align-items: stretch; margin-top: 14px; }
.people-search .search-wrap { position: relative; flex: 1; min-width: 0; display: block; }
.people-search .search-wrap svg {
  position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.people-search .input { width: 100%; padding-inline-start: 38px; }
.people-search .btn { flex: 0 0 auto; }
.people-fields { margin-top: 12px; }
.people-fields .chip b { font-size: 10px; margin-inline-start: 4px; color: var(--muted); }
.people-fields .chip.active b { color: var(--ink); }
.people-active {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted);
}
.people-section { margin-top: 18px; }
.people-list { overflow: hidden; }
.person-row {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 13px; border-bottom: 2.5px solid var(--ink);
}
.person-row:last-child { border-bottom: none; }
.person-row .avatar { flex: 0 0 auto; }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.person-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.person-top b { font-size: 13.5px; }
.person-handle { font-size: 10.5px; color: var(--muted); direction: ltr; }
.person-sub { font-size: 12px; line-height: 1.75; color: #3b352a; }
.person-meta { font-size: 10.5px; color: var(--muted); }
.person-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.person-go { align-self: center; flex: 0 0 auto; color: var(--muted); display: none; }
.tag.match { background: var(--cyan); }
.people-note { margin: 8px 2px 0; font-size: 11.5px; color: var(--muted); line-height: 1.9; }
.people-nudge { margin-top: 14px; padding: 14px; }
.people-nudge b { display: block; font-size: 14px; margin-bottom: 4px; }
.people-nudge p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.9; color: #3b352a; }
.people-empty { padding: 4px 0 14px; text-align: center; }
.people-empty .empty { margin: 0; border: none; background: transparent; padding: 22px 16px 18px; }
.people-more { margin: 18px 0 4px; text-align: center; font-size: 12.5px; font-weight: 800; }
.people-more a { display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-underline-offset: 4px; }

/* ---------------- invite ---------------- */
.invite-big { padding: 18px; text-align: center; }
.invite-code {
  font-family: "Space Mono", monospace; direction: ltr;
  display: inline-block; margin: 10px 0;
  font-size: 22px; font-weight: 700; letter-spacing: 2px;
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 12px;
  padding: 8px 16px; box-shadow: var(--shadow-sm);
  transform: rotate(-1.5deg);
}
.invite-link {
  font-family: "Space Mono", monospace; direction: ltr; font-size: 11px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 9px;
  padding: 8px 10px; overflow-wrap: anywhere;
}

/* ---------------- auth / gate ---------------- */
.auth {
  min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(26px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: center;
  gap: 14px; max-width: 1020px; margin: 0 auto;
}
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 19px; }
.auth-grid { display: grid; gap: 14px; }
.auth-intro h1 {
  margin: 10px 0 10px; font-size: 34px; font-weight: 900; line-height: 1.45; letter-spacing: -1px;
}
.auth-intro .lead { margin: 0; font-size: 13px; line-height: 2; color: #35322b; }
.auth-points { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.auth-points li {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12px; line-height: 1.9;
}
.auth-points .n {
  width: 21px; height: 21px; flex: 0 0 21px; margin-top: 1px;
  display: grid; place-items: center; font-size: 10px; font-weight: 900;
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 6px;
}
.auth-card { padding: 18px; }
.auth-card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 900; }
.auth-card .fine { font-size: 11.5px; color: var(--muted); line-height: 1.9; margin: 10px 0 0; }
.auth-buttons { display: grid; gap: 12px; margin-top: 16px; }
.auth-choice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right;
  padding: 15px 16px; background: #fffdf8; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
}
.auth-choice.primary { background: var(--yellow); }
.auth-choice:active { transform: translate(2px, 2px); box-shadow: none; }
.auth-choice .ac-body { flex: 1; min-width: 0; }
.auth-choice b { display: block; font-size: 17px; font-weight: 900; }
.auth-choice small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.7; color: #3b372f; }
.auth-choice .arrow { font-size: 18px; font-weight: 900; }
.auth-card .demo-picks {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 0;
}
.demo-picks .chip { min-height: 26px; padding: 1px 8px; direction: ltr; font-family: "Space Mono", monospace; }

/* ---------------- modal ---------------- */
#modal-root[hidden] { display: none; }
#modal-root {
  position: fixed; inset: 0; z-index: 120; display: flex;
  align-items: center; justify-content: center; padding: 14px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(21, 21, 21, .58); }
.modal-card {
  position: relative; width: 100%; max-width: 530px; max-height: min(88dvh, 780px);
  overflow: auto; background: var(--card); border: 3px solid var(--ink);
  border-radius: 18px; box-shadow: 8px 8px 0 var(--ink); padding: 18px;
}
.modal-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.modal-head > div { flex: 1; min-width: 0; }
.modal-head h2 { margin: 0; font-size: 21px; font-weight: 900; }
.modal-head .page-sub { margin: 5px 0 0; font-size: 12px; }
.modal-close {
  flex: 0 0 auto; width: 38px; height: 38px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0;
  border: 2.5px solid var(--ink); border-radius: 10px;
  background: var(--paper); box-shadow: 2px 2px 0 var(--ink);
}
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }
body.modal-open { overflow: hidden; }

/* ---------------- settings shortcuts ---------------- */
.edit-list { display: grid; gap: 10px; margin: 16px 0; }
.edit-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right;
  padding: 12px 14px; background: var(--paper); color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink);
}
.edit-row:active { transform: translate(2px, 2px); box-shadow: none; }
.edit-row .er-icon {
  flex: 0 0 auto; width: 34px; height: 34px; display: flex;
  align-items: center; justify-content: center;
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 9px;
}
.edit-row .er-body { flex: 1; min-width: 0; }
.edit-row b { display: block; font-size: 13.5px; font-weight: 900; }
.edit-row small {
  display: block; margin-top: 2px; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.edit-row .arrow { font-size: 16px; font-weight: 900; }
.tg-slot { margin-top: 12px; min-height: 44px; }
.demo-box { margin-top: 12px; padding-top: 12px; border-top: 2px dashed rgba(21, 21, 21, .25); }
.demo-note {
  font-size: 11.5px; line-height: 1.9; color: var(--muted);
  background: var(--paper); border: 2px dashed var(--ink); border-radius: 9px;
  padding: 7px 9px; margin: 0 0 10px;
}
.demo-note b { color: var(--ink); }
.persona {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: right;
  padding: 10px 11px; margin-bottom: 8px;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 12px;
  box-shadow: 2px 2px 0 var(--ink);
}
.persona:active { transform: translate(2px, 2px); box-shadow: none; }
.persona .p-name { font-size: 12.5px; font-weight: 800; }
.persona .p-role { font-size: 11px; color: var(--muted); }
.persona .arrow { margin-inline-start: auto; font-size: 16px; font-weight: 900; }
.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; line-height: 1.8; margin: 4px 0 12px; }
.checkline input { width: 18px; height: 18px; accent-color: var(--ink); margin-top: 2px; }

.gate {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(26px + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto;
}
.gate-card { padding: 22px 18px; text-align: center; }
.gate-icon {
  width: 66px; height: 66px; margin: 0 auto 12px;
  display: grid; place-items: center;
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
.gate-card h1 { margin: 0 0 8px; font-size: 23px; font-weight: 900; }
.gate-card p { margin: 0 0 16px; font-size: 12px; line-height: 2; color: var(--muted); }
.gate-card .btn { width: 100%; margin-bottom: 8px; }
.gate-foot { margin-top: 12px; display: flex; justify-content: center; gap: 14px; font-size: 12px; }
.gate-foot button { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- install page ---------------- */
.install-hero { padding: 18px; text-align: center; }
.install-hero .app-icon {
  width: 84px; height: 84px; margin: 0 auto 10px;
  border: 3px solid var(--ink); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-sm); background: var(--paper);
}
.install-hero h1 { margin: 0 0 6px; font-size: 23px; font-weight: 900; }
.install-hero p { margin: 0; font-size: 12px; line-height: 1.95; color: var(--muted); }
.steps { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; text-align: right; }
.step {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 13px;
}
.step-num {
  width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center;
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px;
  font-size: 11px; font-weight: 900;
}
.step b { display: block; font-size: 12px; margin-bottom: 2px; }
.step span { font-size: 12px; line-height: 1.85; color: var(--muted); }

/* ---------------- bottom nav ---------------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 0 6px env(safe-area-inset-bottom);
  background: var(--paper);
  border-top: var(--line);
  display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center;
}
.nav-item {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 52px; font-size: 10.5px; font-weight: 800; color: var(--muted);
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { color: var(--ink); }
.nav-item.active::before {
  content: ""; position: absolute; z-index: -1;
  inset: 2px 4px 8px; background: var(--yellow);
  border-radius: 18px 24px 17px 22px; transform: rotate(-2deg);
}
.nav-fab {
  width: 54px; height: 54px; margin: -22px auto 0;
  display: grid; place-items: center;
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: var(--shadow);
  font-size: 26px; font-weight: 800; line-height: 0;
}
.nav-fab:active { transform: translate(2px, 2px); box-shadow: none; }
.nav-item .dot {
  position: absolute; top: 5px; inset-inline-end: 22%;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 1.5px solid var(--ink);
}

/* ---------------- toast / misc ---------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  z-index: 100; max-width: min(88vw, 420px);
  padding: 11px 16px; text-align: center;
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 800; line-height: 1.7;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #ffd9d3; }

.loading { padding: 22px 14px; text-align: center; }
.loading .spinner {
  width: 30px; height: 30px; margin: 0 auto 8px;
  border: 4px solid var(--ink); border-top-color: var(--yellow);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { margin: 0; font-size: 12.5px; color: var(--muted); }

.empty {
  margin-top: 16px; padding: 26px 16px; text-align: center;
  border: 3px dashed var(--ink); border-radius: var(--radius);
  background: rgba(255, 255, 255, .25);
}
.empty b { display: block; font-size: 14px; margin-bottom: 4px; }
.empty p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.9; }

/* ---------------- onboarding ---------------- */
.onboard {
  min-height: 100dvh; padding: 18px 14px 44px;
  background: radial-gradient(1200px 420px at 50% -10%, rgba(255, 206, 31, .35), transparent 70%);
}
.onboard-top { display: flex; align-items: center; justify-content: space-between; max-width: 660px; margin: 0 auto 20px; }
.onboard-inner { max-width: 660px; margin: 0 auto; }
.onboard-title { margin: 2px 0 6px; font-size: clamp(26px, 7vw, 38px); font-weight: 900; line-height: 1.25; letter-spacing: -.5px; }
.onboard-inner .page-sub { margin: 0 0 6px; line-height: 1.95; }
.steps-bar { display: flex; align-items: center; gap: 8px; margin: 16px 0 12px; }
.step-dot {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 4px 10px; border: 2px solid var(--ink); border-radius: 999px;
  background: #fffdf8; color: var(--muted); font-size: 11px; font-weight: 800;
}
.step-dot.active { background: var(--yellow); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.step-line { flex: 1; height: 3px; border-radius: 2px; background: rgba(19, 18, 17, .18); }
.onboard-card { padding: 16px; }
.onboard-card section[hidden] { display: none; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 0; }
.req { color: var(--red); }

.handle-wrap {
  display: flex; align-items: stretch; overflow: hidden;
  border: 3px solid var(--ink); border-radius: 11px;
  background: #fffdf8; box-shadow: 2px 2px 0 var(--ink);
}
.handle-wrap > span {
  display: flex; align-items: center; padding: 0 10px;
  background: var(--paper); border-inline-end: 2.5px solid var(--ink);
  font-family: "Space Mono", monospace; font-weight: 700;
}
.handle-wrap .input {
  min-width: 0; border: 0; border-radius: 0; box-shadow: none; direction: ltr;
}
.handle-wrap .input:focus { background: #fff; }
.social-grid { display: grid; gap: 10px; margin-top: 8px; }
.social-grid .handle-wrap > span {
  direction: ltr; font-size: 10px; padding: 0 8px; letter-spacing: -.02em;
}
.social-grid .input { font-size: 12px; }
.handle-state { min-height: 20px; margin-top: 6px; font-size: 11.5px; font-weight: 800; line-height: 1.6; }
.handle-state .handle-msg { display: inline-flex; align-items: center; gap: 4px; }
.handle-state.ok { color: #11623a; }
.handle-state.bad { color: #a3180b; }
.handle-state.busy { color: var(--muted); }
.suggest-row { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-inline-start: 8px; vertical-align: middle; }
.suggest-row .chip { direction: ltr; font-family: "Space Mono", monospace; font-size: 10.5px; padding: 1px 7px; }

.ltr { direction: ltr; text-align: left; font-family: "Space Mono", monospace; letter-spacing: .5px; }
.mini-spin {
  display: inline-block; width: 11px; height: 11px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.combo-wrap { position: relative; }
.combo-list {
  position: absolute; inset-inline: 0; top: calc(100% + 5px); z-index: 30;
  max-height: 240px; overflow: auto; padding: 5px;
  background: #fffdf8; border: 3px solid var(--ink); border-radius: 11px;
  box-shadow: 4px 4px 0 var(--ink);
}
.combo-list[hidden] { display: none; }
.combo-opt {
  display: block; width: 100%; padding: 9px 9px; text-align: right;
  border: 0; border-radius: 7px; background: transparent;
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.combo-opt:hover, .combo-opt.active { background: var(--yellow); }

.skill-picker {
  position: relative; padding: 7px;
  border: 3px solid var(--ink); border-radius: 11px;
  background: #fffdf8; box-shadow: 2px 2px 0 var(--ink);
}
.skill-picker:focus-within { background: #fff; }
.skill-picker .input { border: 0; box-shadow: none; background: transparent; padding: 6px 4px; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.skill-chips:not(:empty) { margin-bottom: 6px; }
.skill-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 6px 3px 9px; background: var(--cyan);
  border: 2px solid var(--ink); border-radius: 999px;
  font-size: 12px; font-weight: 800;
}
.skill-chip button {
  width: 18px; height: 18px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink); border-radius: 50%;
  background: #fffdf8; font-size: 12px; line-height: 1; cursor: pointer;
}

.onboard-error {
  margin: 6px 0 10px; padding: 9px 11px;
  color: #7d1309; background: #ffd9d3;
  border: 2.5px solid var(--red); border-radius: 10px;
  font-size: 12.5px; font-weight: 800; line-height: 1.8;
}
.onboard-error[hidden] { display: none; }
.onboard-actions { display: flex; gap: 8px; margin-top: 6px; }
.onboard-actions .btn { flex: 1; }
.onboard-actions .btn[hidden] { display: none; }
.onboard-privacy {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 14px 0 0; color: var(--muted); font-size: 11px;
  text-align: center; line-height: 1.8;
}

/* ---------------- responsive ---------------- */
@media (hover: hover) {
  .q-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
  .persona:hover { background: #fff6d5; }
  .person-row:hover { background: rgba(255, 206, 31, .16); }
}

@media (max-width: 639px) {
  .auth { justify-content: flex-start; gap: 10px; padding-top: calc(14px + env(safe-area-inset-top)); }
  .auth-intro h1 { font-size: 25px; margin: 4px 0 6px; line-height: 1.5; }
  .auth-intro .lead { font-size: 12px; line-height: 1.8; }
  .auth-points { display: none; }
  .auth-card { padding: 15px; }
  #modal-root { align-items: flex-end; padding: 0; }
  .modal-card {
    max-width: none; max-height: 92dvh; border-radius: 20px 20px 0 0;
    border-bottom: 0; box-shadow: 0 -4px 0 var(--ink);
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .related-row {
    display: flex; gap: 9px; overflow-x: auto; padding: 2px 2px 8px;
    scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .related-row::-webkit-scrollbar { display: none; }
  .related-card { flex: 0 0 78%; scroll-snap-align: start; }
}

@media (min-width: 640px) {
  .container { padding: 18px 20px 10px; }
  .page-title { font-size: 30px; }
  .two-col { grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .person-go { display: flex; }
  .q-title { font-size: 18px; }
  .feed-head .btn.compose-btn { display: inline-flex; }
  .q-actions .btn { flex: 0 0 auto; min-width: 110px; }
  .auth-intro h1 { font-size: 42px; }
}

@media (min-width: 1024px) {
  body { padding-bottom: 30px; }
  .topbar { padding: 10px 22px; }
  .topnav { display: flex; }
  .container { padding: 22px 22px 40px; }
  .layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
  .rail { display: block; position: sticky; top: 86px; }
  .bottom-nav { display: none; }
  .mobile-only { display: none !important; }
  .page-title { font-size: 34px; }
  .question-hero { padding: 20px; }
  .question-hero h1 { font-size: 26px; }
  .layer, .profile-card, .form-card, .profile-hero { padding: 20px; }
  .q-card { padding: 16px 18px; }
  .auth { padding: 40px 22px; }
  .auth-grid { grid-template-columns: 1.05fr .95fr; gap: 28px; align-items: center; }
  .auth-intro h1 { font-size: 52px; }
  .toast { bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* ---------------- closed questions & deadlines ---------------- */
.tag.closed {
  background: #eedfc8;
  color: #554c3e;
  border-color: #6d6251;
}
.deadline.closed {
  color: #6d6251 !important;
  font-weight: 700 !important;
}
.closed-notice {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f5ede0;
  border: 2px dashed #6d6251;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #3f372a;
}


/* ------------------------------------------------------------------ */
/* Chat & Direct Messaging (Neo-Brutalist & Minimal Storage)           */
/* ------------------------------------------------------------------ */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 680px;
  margin: 0 auto;
}

.chat-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink-muted, #555);
  margin-top: 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 2px solid var(--ink, #18181b);
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink, #18181b);
  text-decoration: none;
  color: inherit;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.chat-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink, #18181b);
}

.chat-card-info {
  flex: 1;
  min-width: 0;
}

.chat-card-name {
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-card-lastmsg {
  font-size: 0.82rem;
  color: var(--ink-muted, #666);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.chat-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--ink-muted, #777);
}

.chat-badge {
  background: var(--accent, #ff4757);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--ink, #18181b);
}

.chat-req-box {
  background: #fffbf0;
  border: 2px solid var(--ink, #18181b);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 2px 2px 0 var(--ink, #18181b);
  margin-bottom: 12px;
}
.chat-req-box .req-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chat-thread-box {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  min-height: 480px;
  background: #fff;
  border: 2px solid var(--ink, #18181b);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink, #18181b);
  overflow: hidden;
}

.chat-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fafaf9;
  border-bottom: 2px solid var(--ink, #18181b);
}

.chat-thread-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fdfdfc;
}

.chat-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 12px;
  border: 2px solid var(--ink, #18181b);
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.chat-bubble.mine {
  align-self: flex-start;
  background: #e0f2fe;
  border-bottom-left-radius: 2px;
  box-shadow: 2px 2px 0 var(--ink, #18181b);
}

.chat-bubble.theirs {
  align-self: flex-end;
  background: #fff;
  border-bottom-right-radius: 2px;
  box-shadow: -2px 2px 0 var(--ink, #18181b);
}

.chat-bubble-time {
  font-size: 0.68rem;
  color: var(--ink-muted, #777);
  margin-top: 4px;
  text-align: left;
}

.chat-thread-foot {
  padding: 10px 14px;
  background: #fafaf9;
  border-top: 2px solid var(--ink, #18181b);
}

.chat-limit-info {
  font-size: 0.75rem;
  color: var(--ink-muted, #666);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-form-row {
  display: flex;
  gap: 8px;
}
.chat-form-row input {
  flex: 1;
  border: 2px solid var(--ink, #18181b);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}
.chat-form-row input:focus {
  border-color: var(--brand, #3b82f6);
}

.chat-status-notice {
  padding: 16px;
  text-align: center;
  background: #fef3c7;
  border-top: 2px solid var(--ink, #18181b);
  font-size: 0.88rem;
  color: #92400e;
  font-weight: 600;
}

.telegram-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #229ed9;
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--ink, #18181b);
  transition: opacity 0.15s;
}
.telegram-pill:hover {
  opacity: 0.9;
  color: #fff;
}


/* ---------------- avatar builder ---------------- */
.avatar-builder-wrap {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  margin: 10px 0 16px;
}
.avatar-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0 14px;
  border-bottom: 2px dashed #d5cdbd;
  margin-bottom: 14px;
}
.avatar-preview-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--paper);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-group {
  margin-bottom: 12px;
}
.avatar-label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 6px;
}
.avatar-pills-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.avatar-option-pill {
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 800;
  background: #fff;
  cursor: pointer;
  transition: all .1s ease;
  color: var(--ink);
}
.avatar-option-pill:active, .avatar-option-pill.active {
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(-1px, -1px);
}
.avatar-color-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  cursor: pointer;
  transition: all .1s ease;
}
.avatar-color-pill.active {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  transform: scale(1.15);
}
.avatar.avatar-custom {
  background: transparent !important;
  border: 2.5px solid var(--ink);
  overflow: hidden;
  padding: 0;
}
.avatar.avatar-custom svg, .avatar.avatar-custom .avatar-svg-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}


/* ========================================================================== */
/* ADMIN DASHBOARD (NEO-BRUTALIST STYLES)                                     */
/* ========================================================================== */
.admin-container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 18px 14px 60px;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 2px solid var(--ink, #18181b);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink, #18181b);
  padding: 14px 18px;
  margin-bottom: 18px;
}
.admin-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
}
.admin-tab {
  background: #fff;
  border: 2px solid var(--ink, #18181b);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all .1s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink, #18181b);
  font-family: inherit;
}
.admin-tab:hover {
  background: #fafaf9;
}
.admin-tab.active {
  background: var(--yellow, #facc15);
  box-shadow: 2.5px 2.5px 0 var(--ink, #18181b);
  transform: translate(-1px, -1px);
}
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.admin-kpi-card {
  background: #fff;
  border: 2px solid var(--ink, #18181b);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink, #18181b);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.admin-kpi-num {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--ink, #18181b);
  line-height: 1.1;
  margin-bottom: 6px;
}
.admin-kpi-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-muted, #71717a);
}
.admin-table-wrap {
  background: #fff;
  border: 2px solid var(--ink, #18181b);
  border-radius: 12px;
  box-shadow: 3.5px 3.5px 0 var(--ink, #18181b);
  overflow-x: auto;
  margin-bottom: 20px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.88rem;
}
.admin-table th {
  background: #f4f4f5;
  border-bottom: 2px solid var(--ink, #18181b);
  padding: 11px 14px;
  font-weight: 900;
  color: var(--ink, #18181b);
  white-space: nowrap;
}
.admin-table td {
  border-bottom: 1px solid #e4e4e7;
  padding: 11px 14px;
  vertical-align: middle;
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table tr:hover td {
  background: #fafaf9;
}
.admin-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 6px;
  border: 1.5px solid var(--ink, #18181b);
}
.admin-badge.admin {
  background: #fef08a;
  color: #854d0e;
}
.admin-badge.banned {
  background: #fee2e2;
  color: #991b1b;
}
.admin-badge.active {
  background: #dcfce7;
  color: #166534;
}
.admin-btn-action {
  border: 1.5px solid var(--ink, #18181b);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 800;
  background: #fff;
  cursor: pointer;
  transition: all .1s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.admin-btn-action:hover {
  background: #f4f4f5;
  box-shadow: 1.5px 1.5px 0 var(--ink, #18181b);
}
.admin-btn-action.danger {
  background: #fee2e2;
  color: #991b1b;
}
.admin-btn-action.primary {
  background: var(--yellow, #facc15);
}
.admin-form-card {
  background: #fff;
  border: 2px solid var(--ink, #18181b);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink, #18181b);
  padding: 18px;
  margin-bottom: 20px;
}
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .admin-grid-2 {
    grid-template-columns: 1fr;
  }
}
