:root {
  --ink: #12312e;
  --ink-soft: #3d5c57;
  --muted: #6f8b85;
  --bg: #eef7f3;
  --bg-elev: #f7fcfa;
  --bg-card: #ffffff;
  --line: rgba(18, 49, 46, 0.08);
  --teal: #0f766e;
  --mint: #34d399;
  --amber: #f59e0b;
  --coral: #fb7185;
  --ok: #059669;
  --warn: #d97706;
  --danger: #e11d48;
  --shadow: 0 12px 30px rgba(11, 61, 58, 0.1);
  --radius: 20px;
  --font: "Vazirmatn", "Tahoma", sans-serif;
  --nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --sheet-max: 100%;
  --sheet-pad: 20px;
  --sheet-pad-top: 8px;
  --scroll-thumb: rgba(15, 118, 110, .28);
  --scroll-thumb-hover: rgba(15, 118, 110, .45);
  --scroll-track: transparent;
}
html[data-theme="dark"] {
  --ink: #eaf8f4;
  --ink-soft: #b6d4cd;
  --muted: #7a9a93;
  --bg: #071412;
  --bg-elev: #0e211e;
  --bg-card: #122926;
  --line: rgba(167, 243, 208, 0.1);
  --teal: #2dd4bf;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  --scroll-thumb: rgba(45, 212, 191, .28);
  --scroll-thumb-hover: rgba(45, 212, 191, .45);
  --scroll-track: rgba(0, 0, 0, .2);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Scrollbars — هماهنگ با تم */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  -webkit-user-select: none;
  user-select: none;
}
input, button, select, textarea, option {
  font-family: var(--font);
}
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}
button, a, [role="button"] {
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
a { color: inherit; text-decoration: none; }
a:active, button:active { background-color: inherit; }
[v-cloak] { display: none; }

.icon { width: 22px; height: 22px; display: block; }
.icon.tiny { width: 15px; height: 15px; }
.icon.xl { width: 48px; height: 48px; opacity: .85; }
html[data-theme="dark"] .icon { filter: invert(.92) sepia(.12) saturate(.4) hue-rotate(110deg); }
html:not([data-theme="dark"]) .icon { filter: invert(.28) sepia(.35) saturate(1.4) hue-rotate(120deg); }
.cta-main .icon, .bottom-nav button.active .icon { filter: invert(1) !important; }
.avatar-img, .avatar-opt img, .person-main img, .story-avatar img, .lead-row img, .notif-item img, .avatar-wrap img, .react-faces img, .reactor-row img {
  filter: none !important;
}

#app {
  position: relative;
  width: min(720px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  padding-top: var(--zx-pad-top, 0px);
  padding-bottom: var(--zx-pad-bot, 0px);
  transition: padding-top .2s ease, padding-bottom .2s ease;
}

.app-layout {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.adly-slot {
  margin: 10px 0 14px;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
}
.adly-slot:empty { display: none; }
.side-brand, .side-rail { display: none; }
.side-card {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.side-profile { text-align: center; cursor: pointer; }
.side-profile h2 { margin: 10px 0 2px; font-size: 1.1rem; }
.side-stats { display: grid; gap: 10px; }
.side-stat { display: flex; align-items: center; justify-content: space-between; font-size: .86rem; color: var(--ink-soft); }
.side-stat b { color: var(--ink); font-size: 1rem; }
.rail-nav, .rail-actions { display: none; }

.atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 85% -8%, rgba(52, 211, 153, .22), transparent 55%),
    radial-gradient(700px 380px at 0% 40%, rgba(245, 158, 11, .12), transparent 50%),
    var(--bg);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .4;
  animation: float 12s ease-in-out infinite;
}
.orb-a { width: 170px; height: 170px; background: #34d399; top: 8%; left: -40px; }
.orb-b { width: 150px; height: 150px; background: #f59e0b; top: 50%; right: -35px; animation-delay: -4s; }

.app-shell {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(10px + var(--safe-top)) 14px 16px;
}

.bottom-nav {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
}
html[data-theme="dark"] .bottom-nav { background: rgba(11, 31, 29, .94); }
.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .7rem;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 14px;
  cursor: pointer;
}
.bottom-nav button.active {
  color: #fff;
  background: linear-gradient(145deg, #0b3d3a, #0f766e);
}

.page { animation: rise .28s ease both; }
.center-panel, .profile-hero, .head-center, .panel-title, .panel-empty, .empty { text-align: center; }

.top-row, .page-head, .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.top-actions { display: flex; gap: 5px;}

.page-head.stacked { justify-content: center; }
.brand-inline { display: flex; align-items: center; gap: 10px; text-align: right; }
.brand-text { display: grid; text-align: right; }
.brand-text strong { font-size: 1.05rem; }
.brand-text span { color: var(--muted); font-size: .78rem; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #114e49, #0f766e 55%, #34d399);
}
.brand-mark.sm { width: 40px; height: 40px; }
.brand-mark .icon { filter: invert(1) !important; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: .78rem; text-align: right; }
.page-head h1, .head-center h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; text-align: right; }
.head-center h1, .head-center .eyebrow { text-align: center; }

.icon-btn, .pill-btn, .ghost, .mini-btn {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  position: relative;
}
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px; font-weight: 700; font-size: .86rem; color: var(--ink);
}
.ghost { width: 34px; height: 34px; display: grid; place-items: center; background: transparent; }
.mini-btn { padding: 8px 10px; font-size: .76rem; color: var(--ink-soft); white-space: nowrap; }
.mini-btn.ok { background: linear-gradient(135deg, #0b3d3a, #0f766e); color: #fff; border-color: transparent; }
.mini-btn.danger, .ghost-wide.danger, .setting-row.danger { color: var(--danger); border-color: rgba(225,29,72,.2); }
.dot-badge {
  position: absolute; top: -4px; left: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--coral); color: #fff;
  font-size: .65rem; font-style: normal; display: grid; place-items: center;
}

.guest-banner.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: right;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(15, 118, 110, .32);
  background: rgba(52, 211, 153, .1);
}
.guest-banner.compact span { flex: 1; min-width: 0; color: var(--ink-soft); font-size: .8rem; line-height: 1.5; }
.mini-cta {
  flex: 0 0 auto;
  border: 0;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: .78rem;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e, #34d399);
  white-space: nowrap;
}

.profile-hero { margin-bottom: 12px; }
.profile-hero h1, .profile-hero h2 { margin: 10px 0 2px; font-size: 1.35rem; }
.uname { margin: 0; color: var(--muted); font-size: .88rem; }
.last-seen { margin: 6px 0 0; color: var(--muted); font-size: .8rem; }
.avatar-ring {
  width: 88px; height: 88px; margin: 0 auto; border-radius: 50%; padding: 3px;
  background: linear-gradient(145deg, #0f766e, #34d399 55%, #f59e0b);
  position: relative;
}
.avatar-ring.lg { width: 104px; height: 104px; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #fff; display: block; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.hero-pills span {
  padding: 6px 10px; border-radius: 999px; background: var(--bg-elev);
  border: 1px solid var(--line); font-size: .76rem; color: var(--ink-soft);
}

.online-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #9ca3af;
  border: 3px solid var(--bg-card);
  z-index: 3;
  box-sizing: border-box;
}
/* مرکز نقطه تقریباً روی محیط دایره (≈۲۲۵ درجه) */
.avatar-ring .online-dot,
.online-dot.self {
  bottom: 2px;
  left: 2px;
}
.avatar-ring.lg .online-dot {
  width: 16px;
  height: 16px;
  bottom: 3px;
  left: 3px;
}
.online-dot.on { background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, .2); }
.avatar-wrap { position: relative; }
.avatar-wrap .online-dot, .avatar-wrap.sm .online-dot {
  width: 11px; height: 11px; bottom: 0; left: 0; border-width: 2px;
}
.story-avatar { position: relative; display: inline-block; }
.story-avatar .online-dot {
  width: 12px; height: 12px;
  bottom: 3px; left: 3px;
  border-width: 2px;
  border-color: var(--bg-elev);
}

.panel {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.panel.soft { box-shadow: none; }
.panel.glow { background: linear-gradient(160deg, rgba(15,118,110,.12), rgba(245,158,11,.08)), var(--bg-elev); }
.panel-title, .section-head h2 { margin: 0 0 10px; font-size: .98rem; }
.section-head h2 { margin: 0; text-align: right; }
.text-link { border: 0; background: transparent; color: var(--teal); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.panel-empty { margin: 0; color: var(--muted); line-height: 1.7; font-size: .88rem; }

.ring-wrap { position: relative; width: 118px; height: 118px; margin: 0 auto 8px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 10; }
.ring-bg { stroke: rgba(15,118,110,.12); }
.ring-fg { stroke: #0f766e; stroke-linecap: round; stroke-dasharray: 326.56; transition: stroke-dashoffset .5s ease; }
html[data-theme="dark"] .ring-fg { stroke: #34d399; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; }
.ring-center strong { font-size: 1.3rem; }
.ring-center span { color: var(--muted); font-size: .7rem; }
.quote { margin: 0; color: var(--ink-soft); line-height: 1.75; font-size: .92rem; }

.boost-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.boost {
  text-align: center; padding: 10px 4px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--bg-elev);
  display: grid; justify-items: center; gap: 3px;
}
.boost strong { font-size: 1rem; }
.boost span { color: var(--muted); font-size: .66rem; }

.cta-main {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #0f766e, #14b8a6 55%, #f59e0b);
  background-size: 160% 160%;
  animation: sheen 7s ease infinite;
  border-radius: 16px; padding: 14px 16px;
  font: inherit; font-weight: 800;
  margin-bottom: 12px;
  box-shadow: 0 12px 24px rgba(15, 118, 110, .25);
}
.cta-main:disabled { opacity: .45; cursor: not-allowed; }
.cta-main.slim { width: auto; margin: 10px auto 0; padding: 11px 16px; }
.cta-main.soft-empty {
  width: auto;
  margin: 0 auto;
  padding: 10px 18px;
  font-size: .86rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0e6b64, #0f766e 45%, #12837b);
  background-size: 160% 160%;
  animation: sheen 7s ease infinite;
  box-shadow: 0 8px 18px rgba(15, 118, 110, .18);
}
.ghost-wide {
  width: 100%; border: 1px solid var(--line); background: transparent;
  border-radius: 14px; padding: 12px; font: inherit; color: var(--ink-soft); cursor: pointer; margin-top: 8px;
}

.badge-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 8px 6px;
}
.profile-sheet .badge-row.profile-badges {
  border: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
  justify-content: center;
  flex-wrap: wrap;
  overflow: hidden;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}
.profile-sheet .sheet-actions.stack {
  border-top: 0;
  background: transparent;
}
.badge-row::-webkit-scrollbar { display: none; }
.badge-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.3);
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
  opacity: .5;
  filter: grayscale(.4);
}
.badge-chip .icon { width: 16px; height: 16px; }
.badge-chip.on {
  opacity: 1;
  filter: none;
  color: var(--ink);
  border-color: rgba(15, 118, 110, .28);
  background: linear-gradient(135deg, rgba(15,118,110,.16), rgba(245,158,11,.12));
}

.story-row {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.story-row::-webkit-scrollbar { display: none; }
.story-card {
  flex: 0 0 auto; width: 84px; border: 1px solid var(--line);
  background: rgba(255,255,255,.35); border-radius: 16px; padding: 10px 8px;
  text-align: center; font: inherit; color: var(--ink); cursor: pointer;
}
.story-avatar { position: relative; width: 48px; height: 48px; margin: 0 auto 6px; }
.story-avatar img, .avatar-wrap img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
}
.story-card strong, .friend-streak strong {
  display: block; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.story-card em { font-style: normal; font-size: .7rem; color: var(--warn); }

.article-list { display: grid; gap: 8px; text-align: right; padding: 2px 2px 4px; }
.article-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; cursor: pointer;
  background: rgba(255,255,255,.3); text-align: right; overflow: hidden;
}
.article-card h3 { margin: 0 0 6px; font-size: .95rem; }
.article-meta { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: .72rem; }
.sheet-body.article-view { padding-bottom: 24px; }
.article-body { text-align: right; line-height: 2; font-size: .94rem; color: var(--ink-soft); padding: 0; word-break: break-word; }
.article-body a { color: var(--teal); text-decoration: underline; }
.article-body p { margin: 0 0 12px; }
.article-body img { max-width: 100%; border-radius: 12px; }

.task-progress-card {
  margin-bottom: 12px;
  padding: 14px 16px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(15,118,110,.1), rgba(255,255,255,.4));
}
html[data-theme="dark"] .task-progress-card {
  background: linear-gradient(160deg, rgba(45, 212, 191, .12), rgba(12, 32, 29, .85));
  border-color: rgba(231, 246, 241, .12);
}
html[data-theme="dark"] .task-progress-top strong,
html[data-theme="dark"] .task-progress-hint { color: var(--ink-soft); }
html[data-theme="dark"] .task-progress-top span { color: #5eead4; }
.confirm-text { white-space: pre-line; line-height: 1.75; }
.task-progress-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
}
.task-progress-top strong { font-size: .9rem; }
.task-progress-top span {
  color: var(--teal); font-size: .86rem; font-weight: 800;
}
.task-progress-track {
  height: 9px; border-radius: 999px; overflow: hidden;
  background: rgba(15, 118, 110, .12);
}
.task-progress-track i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #0d5c56, #0f766e 60%, #14958c);
  transition: width .35s ease;
}
.task-progress-hint {
  margin: 8px 0 0; color: var(--muted); font-size: .72rem; text-align: right;
}
.task-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: rgba(15, 118, 110, .08);
}
.task-tabs button {
  border: 0; background: transparent; border-radius: 11px;
  padding: 10px 6px; font: inherit; font-size: .82rem; font-weight: 700;
  color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.task-tabs button em { font-style: normal; opacity: .65; font-weight: 700; }
.task-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #0b3d3a, #0f766e);
  box-shadow: 0 6px 14px rgba(15, 118, 110, .2);
}

.task-list { display: grid; gap: 4px; }
.task-list.is-dragging .task:not(.dragging) {
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.task-list.is-dragging .task-slot:not(.is-source) .task {
  opacity: .78;
}
.task-slot {
  position: relative;
  padding: 4px 0;
}
.task-slot .drop-indicator {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  transition: opacity .12s ease;
}
.task-slot.drop-before .drop-indicator { top: 0; opacity: 1; }
.task-slot.drop-after .drop-indicator { bottom: 0; opacity: 1; }
.task-slot .drop-indicator i {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d5c56, #0f766e 55%, #128a82);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.task-slot.drop-before .drop-indicator::before,
.task-slot.drop-after .drop-indicator::before,
.task-slot.drop-before .drop-indicator::after,
.task-slot.drop-after .drop-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .16);
  transform: translateY(-50%);
}
.task-slot.drop-before .drop-indicator::before,
.task-slot.drop-after .drop-indicator::before { right: -2px; }
.task-slot.drop-before .drop-indicator::after,
.task-slot.drop-after .drop-indicator::after { left: -2px; }
.task-slot.drop-before { padding-top: 14px; }
.task-slot.drop-after { padding-bottom: 14px; }
.task-slot.is-source .task.dragging {
  opacity: .28;
  transform: scale(.98);
  border-style: dashed;
}

.task {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease, transform .15s ease;
}
.task.done { grid-template-columns: auto 1fr auto; opacity: .72; }
.drag-handle {
  width: 28px; height: 40px; border: 0; background: rgba(15,118,110,.06);
  border-radius: 10px;
  display: grid; align-content: center; gap: 3px; cursor: grab; padding: 0;
  opacity: .7;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.drag-handle:hover { opacity: 1; background: rgba(15,118,110,.12); }
.drag-handle:active,
body.task-dragging .drag-handle { cursor: grabbing; }
.drag-handle span {
  display: block; width: 14px; height: 2px; border-radius: 2px;
  background: var(--muted); margin: 0 auto;
}
body.task-dragging {
  cursor: grabbing !important;
  user-select: none;
  -webkit-user-select: none;
}
body.task-dragging * { cursor: grabbing !important; }

.task-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  pointer-events: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15, 118, 110, .35);
  background: color-mix(in srgb, var(--bg-card) 92%, #14b8a6);
  box-shadow:
    0 18px 40px rgba(11, 61, 58, .28),
    0 0 0 1px rgba(255,255,255,.08) inset;
  backdrop-filter: blur(10px);
  will-change: transform;
}
.task-drag-ghost .drag-handle {
  background: rgba(15,118,110,.14);
  opacity: 1;
}
.task-drag-ghost .title {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  min-width: 0;
}
.task-drag-ghost em {
  font-style: normal;
  font-size: .68rem;
  font-weight: 800;
  color: #0f766e;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .12);
}
.task-drag-ghost.p-high { border-inline-start: 3px solid var(--coral); }
.task-drag-ghost.p-normal { border-inline-start: 3px solid var(--teal); }
.task-drag-ghost.p-low { border-inline-start: 3px solid var(--muted); }
html[data-theme="dark"] .task-drag-ghost em { color: #5eead4; }
.task .title { margin: 0; font-size: .92rem; min-width: 0; }
.task .title.ellipsis,
.article-card .ellipsis,
.article-author.ellipsis {
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.task-actions-col { display: flex; align-items: center; gap: 2px; }
.task.p-high { border-inline-start: 3px solid var(--coral); }
.task.p-normal { border-inline-start: 3px solid var(--teal); }
.task.p-low { border-inline-start: 3px solid var(--muted); }
.task.done { opacity: .68; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.check {
  width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: rgba(15, 118, 110, .08); display: grid; place-items: center; cursor: pointer;
}
.task-body { min-width: 0; text-align: right; overflow: hidden; }
.title { margin: 0 0 4px; font-size: .94rem; line-height: 1.5; text-align: right; }
.prio-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(15, 118, 110, .1); color: var(--muted); font-size: .72rem;
}
.edit-input {
  width: 100%; border: 0; outline: 0; background: transparent;
  color: var(--ink); font: inherit; text-align: right;
}
.empty { padding: 36px 10px; color: var(--muted); }
.tasks-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 20px 28px;
  text-align: center;
}
.tasks-empty-icon {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: rgba(15, 118, 110, .1);
  border: 1px solid rgba(15, 118, 110, .12);
  margin-bottom: 4px;
}
.tasks-empty-icon .icon { width: 28px; height: 28px; }
.tasks-empty h3 {
  margin: 0; font-size: 1rem; color: var(--ink); font-weight: 800;
}
.tasks-empty p {
  margin: 0 0 8px; font-size: .82rem; color: var(--muted); line-height: 1.6;
}

.search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--bg-elev); margin-bottom: 12px;
}
.search-box.friends-search input {
  text-align: left !important;
  direction: ltr !important;
}
.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.search-box input, .field input, .field textarea {
  width: 100%; max-width: 100%; box-sizing: border-box;
  border: 1px solid var(--line); background: rgba(255,255,255,.45);
  border-radius: 14px; padding: 12px 14px; font: inherit; color: var(--ink); outline: none;
}
/* ── Dark mode: surfaces, contrast, tabs ── */
html[data-theme="dark"] body {
  background:
    radial-gradient(120% 80% at 100% -10%, rgba(45, 212, 191, .08), transparent 45%),
    radial-gradient(90% 60% at 0% 100%, rgba(15, 118, 110, .1), transparent 50%),
    var(--bg);
}
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .admin-form input,
html[data-theme="dark"] .admin-form textarea,
html[data-theme="dark"] .edit-input,
html[data-theme="dark"] .shared-composer input,
html[data-theme="dark"] .redeem-box input {
  background: rgba(7, 20, 18, .72);
  border-color: rgba(167, 243, 208, .12);
  color: var(--ink);
}
html[data-theme="dark"] .search-box input { background: transparent; }
html[data-theme="dark"] .panel {
  background: rgba(14, 33, 30, .88);
  border-color: rgba(167, 243, 208, .09);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}
html[data-theme="dark"] .panel.soft {
  background: rgba(14, 33, 30, .55);
  box-shadow: none;
}
html[data-theme="dark"] .panel.glow {
  background:
    linear-gradient(160deg, rgba(45, 212, 191, .1), rgba(245, 158, 11, .05)),
    rgba(14, 33, 30, .9);
}
html[data-theme="dark"] .person-card,
html[data-theme="dark"] .story-card,
html[data-theme="dark"] .article-card,
html[data-theme="dark"] .setting-row,
html[data-theme="dark"] .task-card,
html[data-theme="dark"] .task,
html[data-theme="dark"] .friend-card,
html[data-theme="dark"] .badge-cell,
html[data-theme="dark"] .blocked-row {
  background: rgba(10, 26, 24, .72);
  border-color: rgba(167, 243, 208, .1);
  color: var(--ink);
}
html[data-theme="dark"] .story-card {
  background: rgba(10, 26, 24, .85);
}
html[data-theme="dark"] .friend-card {
  background: rgba(12, 30, 28, .92);
}
html[data-theme="dark"] .friend-card::before { opacity: .22; }
html[data-theme="dark"] .sheet-handle { background: rgba(94, 234, 212, .28); }
html[data-theme="dark"] .sheet,
html[data-theme="dark"] .confirm-card,
html[data-theme="dark"] .auth-card {
  background: var(--bg-card);
  color: var(--ink);
  border-color: rgba(167, 243, 208, .1);
}
html[data-theme="dark"] .sheet h3,
html[data-theme="dark"] .sheet-sub { color: var(--ink); }
html[data-theme="dark"] .toast { color: #071412; }
html[data-theme="dark"] .react-summary-btn,
html[data-theme="dark"] .react-add-btn {
  background: rgba(7, 20, 18, .8);
  border-color: rgba(167, 243, 208, .12);
  color: var(--ink);
}
html[data-theme="dark"] .reaction-chip {
  background: rgba(45, 212, 191, .12);
  color: #99f6e4;
}
html[data-theme="dark"] .prio-chip,
html[data-theme="dark"] .filter-chip {
  background: rgba(7, 20, 18, .65);
  color: var(--ink-soft);
  border-color: rgba(167, 243, 208, .1);
}
html[data-theme="dark"] .prio-chip.on,
html[data-theme="dark"] .filter-chip.on,
html[data-theme="dark"] .prio-chip.active,
html[data-theme="dark"] .filter-chip.active {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  border-color: transparent;
}
html[data-theme="dark"] .home-tabs,
html[data-theme="dark"] .friends-tabs,
html[data-theme="dark"] .me-subtabs,
html[data-theme="dark"] .admin-tabs,
html[data-theme="dark"] .task-tabs,
html[data-theme="dark"] .auth-tabs {
  background: rgba(7, 20, 18, .55);
  border: 1px solid rgba(167, 243, 208, .08);
}
html[data-theme="dark"] .home-tabs button,
html[data-theme="dark"] .friends-tabs button,
html[data-theme="dark"] .me-subtabs button,
html[data-theme="dark"] .admin-tabs button,
html[data-theme="dark"] .task-tabs button,
html[data-theme="dark"] .auth-tabs button {
  background: transparent;
  color: var(--muted);
}
html[data-theme="dark"] .home-tabs button.active,
html[data-theme="dark"] .friends-tabs button.active,
html[data-theme="dark"] .me-subtabs button.active,
html[data-theme="dark"] .admin-tabs button.active,
html[data-theme="dark"] .task-tabs button.active,
html[data-theme="dark"] .auth-tabs button.active {
  color: #fff !important;
  background: linear-gradient(135deg, #0f766e, #14b8a6) !important;
  box-shadow: 0 8px 18px rgba(20, 184, 166, .22);
}
html[data-theme="dark"] .home-tabs button.active .icon,
html[data-theme="dark"] .friends-tabs button.active .icon,
html[data-theme="dark"] .me-subtabs button.active .icon,
html[data-theme="dark"] .admin-tabs button.active .icon {
  filter: invert(1) !important;
}
html[data-theme="dark"] .friends-tabs button.active em,
html[data-theme="dark"] .task-tabs button.active em {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  opacity: 1;
}
html[data-theme="dark"] .badge-cell.on {
  background: linear-gradient(165deg, rgba(45, 212, 191, .16), rgba(10, 26, 24, .9));
  border-color: rgba(45, 212, 191, .28);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .28);
}
html[data-theme="dark"] .badge-cell .icon {
  background: rgba(45, 212, 191, .1);
}
html[data-theme="dark"] .badge-cell.on .icon {
  background: rgba(45, 212, 191, .18);
}
html[data-theme="dark"] .bottom-nav {
  background: rgba(7, 20, 18, .92);
  border-top-color: rgba(167, 243, 208, .08);
}
html[data-theme="dark"] .drag-handle {
  background: rgba(45, 212, 191, .08);
}
html[data-theme="dark"] .cta-main {
  box-shadow: 0 10px 24px rgba(20, 184, 166, .22);
}
html[data-theme="dark"] .boost {
  background: rgba(10, 26, 24, .75);
  border-color: rgba(167, 243, 208, .1);
}
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .ghost,
html[data-theme="dark"] .ghost-wide,
html[data-theme="dark"] .mini-btn {
  background: rgba(10, 26, 24, .7);
  border-color: rgba(167, 243, 208, .12);
  color: var(--ink);
}
html[data-theme="dark"] .mini-btn.ok {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  border-color: transparent;
}
html[data-theme="dark"] .notif-item {
  background: rgba(10, 26, 24, .72);
  border-color: rgba(167, 243, 208, .1);
}
html[data-theme="dark"] .notif-item.unread {
  background: rgba(45, 212, 191, .1);
  border-color: rgba(45, 212, 191, .18);
}
html[data-theme="dark"] .atmosphere {
  background:
    radial-gradient(900px 480px at 85% -8%, rgba(45, 212, 191, .1), transparent 55%),
    radial-gradient(700px 380px at 0% 40%, rgba(245, 158, 11, .06), transparent 50%),
    var(--bg);
}
html[data-theme="dark"] .orb { opacity: .22; }
html[data-theme="dark"] .bottom-nav button { color: var(--muted); }
html[data-theme="dark"] .bottom-nav button.active { color: #5eead4; }
html[data-theme="dark"] .online-dot.on { box-shadow: 0 0 0 2px rgba(10, 26, 24, .9); }

.blocked-list { display: grid; gap: 8px; padding: 0 4px; }
.blocked-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
}
.blocked-main {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
  border: 0; background: transparent; font: inherit; color: inherit;
  cursor: pointer; text-align: right; padding: 0;
}
.blocked-main img {
  width: 42px; height: 42px; border-radius: 14px; object-fit: cover;
  border: 2px solid rgba(15,118,110,.18); flex: 0 0 auto;
}
.blocked-main strong { display: block; font-size: .92rem; }
.blocked-main span { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; }
.blocked-unblock {
  border: 0; border-radius: 999px; padding: 8px 12px;
  background: rgba(15,118,110,.12); color: var(--teal);
  font: inherit; font-weight: 800; font-size: .75rem; cursor: pointer; white-space: nowrap;
}
.blocked-empty {
  display: grid; place-items: center; gap: 8px;
  padding: 36px 16px; color: var(--muted); text-align: center;
}
.blocked-empty p { margin: 0; font-weight: 700; }
.search-box input { border: 0; background: transparent; padding: 10px 4px; text-align: right; direction: rtl; }
.field { display: grid; gap: 6px; margin-bottom: 10px; text-align: right; }
.field span { color: var(--muted); font-size: .8rem; text-align: right; }
.field textarea { resize: vertical; min-height: 120px; text-align: right; }

.people-list { display: grid; gap: 8px; }
.person-card {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px; border-radius: 16px; border: 1px solid var(--line);
  background: rgba(255,255,255,.28);
}
.person-card.rich { flex-wrap: wrap; }
.person-main {
  display: flex; align-items: center; gap: 10px; border: 0; background: transparent;
  font: inherit; color: var(--ink); cursor: pointer; text-align: right; min-width: 0; flex: 1;
}
.avatar-wrap { position: relative; width: 46px; height: 46px; flex: 0 0 auto; }
.avatar-wrap.sm { width: 38px; height: 38px; }
.person-text { min-width: 0; text-align: right; }
.person-text strong, .lead-text strong { display: block; font-size: .9rem; }
.person-text span, .lead-text span, .person-text small {
  display: block; color: var(--muted); font-size: .74rem;
}
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions.wrap { width: 100%; justify-content: flex-start; margin-top: 4px; }

.friends-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.friend-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 16px 12px 14px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.friend-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .14;
  z-index: 0;
}
.friend-card.grad-1::before { background: linear-gradient(160deg, #0f766e, #34d399); }
.friend-card.grad-2::before { background: linear-gradient(160deg, #f59e0b, #fb7185); }
.friend-card.grad-3::before { background: linear-gradient(160deg, #6d28d9, #34d399); }
.friend-card.grad-4::before { background: linear-gradient(160deg, #0369a1, #14b8a6); }
.friend-card > * { position: relative; z-index: 1; }
.online-tag {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  background: rgba(34, 197, 94, .16); color: #16803d;
  font-size: .6rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
html[data-theme="dark"] .online-tag { color: #4ade80; background: rgba(34, 197, 94, .2); }
.story-ring {
  width: 66px; height: 66px; margin: 0 auto 6px; padding: 3px; border-radius: 50%;
  background: linear-gradient(145deg, #f59e0b, #fb7185 45%, #0f766e);
}
.story-ring.online { background: linear-gradient(145deg, #22c55e, #34d399 70%); }
.story-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: #fff; }
.friend-card strong { font-size: .9rem; }
.friend-uname { color: var(--muted); font-size: .72rem; }
.friend-card small { color: var(--muted); font-size: .68rem; }
.friend-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; margin-top: 10px; }
.fc-btn { border: 0; border-radius: 12px; padding: 9px 4px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.fc-btn.ok { background: linear-gradient(135deg, #0b3d3a, #0f766e); color: #fff; }
.fc-btn.gift { background: rgba(245, 158, 11, .16); color: #b45309; }
html[data-theme="dark"] .fc-btn.gift { color: #fbbf24; background: rgba(245, 158, 11, .18); }

.two-col-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.two-col-actions .ghost-wide { margin-top: 0; }
.more-toggle { display: block; width: 100%; margin-top: 10px; text-align: center; }
.more-menu { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 6px; }

.leaderboard { display: grid; gap: 8px; }
.lead-row {
  display: grid; grid-template-columns: 28px 40px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.3);
  border-radius: 14px; padding: 10px 12px; font: inherit; color: var(--ink); cursor: pointer; text-align: right;
}
html[data-theme="dark"] .lead-row {
  background: rgba(10, 26, 24, .78);
  border-color: rgba(167, 243, 208, .1);
  color: var(--ink);
}
.lead-row em { font-style: normal; color: var(--muted); font-weight: 800; }
.lead-row b {
  color: #b45309;
  font-size: .86rem;
  min-width: 2.6rem;
  text-align: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, .14);
  justify-self: end;
}
html[data-theme="dark"] .lead-row b { color: #fbbf24; background: rgba(245, 158, 11, .18); }
.lead-text { min-width: 0; text-align: right; }
.lead-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-text span { color: var(--muted); font-size: .72rem; }

/* Friends tabs + shared tasks */
.friends-tabs-panel { padding-top: 12px; }
.friends-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: rgba(15, 118, 110, .08);
}
.friends-tabs button {
  border: 0; background: transparent; border-radius: 11px;
  padding: 10px 8px; font: inherit; font-size: .8rem; font-weight: 700;
  color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.friends-tabs button .icon { width: 16px; height: 16px; }
.friends-tabs button em {
  font-style: normal; font-size: .7rem; opacity: .7;
  padding: 1px 6px; border-radius: 999px; background: rgba(15,118,110,.1);
}
.friends-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #0b3d3a, #0f766e);
  box-shadow: 0 6px 14px rgba(15, 118, 110, .2);
}
.friends-tabs button.active .icon { filter: invert(1) !important; }
.friends-tabs button.active em { background: rgba(255,255,255,.18); opacity: 1; }
.friends-tab-pane { min-height: 40px; }

/* Shared board — compact, clear, low-scroll */
.shared-panel { display: grid; gap: 10px; }
.shared-pick {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.shared-pick-label {
  flex: 0 0 auto;
  font-size: .78rem;
  font-weight: 800;
  color: var(--muted);
}
.shared-avatars {
  display: flex; gap: 8px; overflow-x: auto; min-width: 0; flex: 1;
  padding: 2px 0; scrollbar-width: none;
}
.shared-avatars::-webkit-scrollbar { display: none; }
.shared-avatar-btn {
  position: relative;
  flex: 0 0 auto;
  width: 42px; height: 42px;
  padding: 0; border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.shared-avatar-btn img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
  box-shadow: 0 0 0 1px var(--line);
}
.shared-avatar-btn .online-dot {
  position: absolute; bottom: -2px; left: -2px;
}
.shared-avatar-btn:active { transform: scale(.96); }
.shared-avatar-btn.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .18);
}
.shared-avatar-btn.active img { box-shadow: none; }

.shared-stage {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(15,118,110,.1), transparent 55%),
    var(--bg-elev);
  padding: 10px;
  display: grid;
  gap: 8px;
  min-width: 0;
}
.shared-stage-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0;
}
.shared-stage-who {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  border: 0; background: transparent; padding: 0;
  font: inherit; color: var(--ink); cursor: pointer; text-align: right;
}
.shared-stage-who img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
}
.shared-stage-who strong {
  font-size: .86rem; font-weight: 800; min-width: 0;
}
.shared-seg {
  display: inline-flex; gap: 2px; flex: 0 0 auto;
  padding: 2px; border-radius: 999px;
  background: rgba(15, 118, 110, .08);
}
.shared-seg button {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .7rem; font-weight: 800;
  color: var(--ink-soft);
  padding: 5px 10px; border-radius: 999px;
  white-space: nowrap;
}
.shared-seg button.on {
  color: #fff;
  background: linear-gradient(135deg, #0b3d3a, #0f766e);
  box-shadow: 0 4px 10px rgba(15, 118, 110, .2);
}

.shared-composer {
  display: grid; grid-template-columns: 1fr 40px; gap: 6px; align-items: center;
}
.shared-composer input {
  width: 100%; border: 1px solid var(--line);
  background: rgba(255,255,255,.5);
  border-radius: 12px; padding: 9px 12px;
  font: inherit; font-size: .86rem; color: var(--ink);
  outline: none; text-align: right;
}
html[data-theme="dark"] .shared-composer input {
  background: rgba(0,0,0,.18);
}
.shared-composer input:focus {
  border-color: rgba(15,118,110,.45);
  box-shadow: 0 0 0 3px rgba(15,118,110,.1);
}
.shared-composer-go {
  width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, #0b3d3a, #0f766e);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 14px rgba(15,118,110,.22);
}
.shared-composer-go .icon {
  width: 20px; height: 20px;
  filter: invert(1) !important;
}
.shared-composer-go:disabled {
  opacity: .35; cursor: not-allowed; box-shadow: none;
}

.shared-list {
  display: grid; gap: 6px;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 2px 2px 0;
  margin-inline-end: -2px;
}
.shared-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center;
  padding: 7px 8px; border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.42);
  transition: background .15s ease, opacity .15s ease;
}
html[data-theme="dark"] .shared-item {
  background: rgba(0,0,0,.14);
}
.shared-item.done { opacity: .62; }
.shared-item.done .shared-title { text-decoration: line-through; color: var(--muted); }
.shared-check {
  width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: rgba(15,118,110,.1); display: grid; place-items: center; cursor: pointer;
}
.shared-check .icon { width: 18px; height: 18px; }
.shared-body {
  min-width: 0; text-align: right; cursor: pointer;
}
.shared-title {
  margin: 0; font-size: .86rem; font-weight: 700; line-height: 1.35;
}
.shared-body small {
  color: var(--muted); font-size: .68rem; line-height: 1.35; display: block; margin-top: 2px;
}
.shared-del { opacity: .55; }
.shared-del:hover { opacity: 1; }
.shared-empty {
  text-align: center; padding: 22px 10px 14px; color: var(--muted);
  display: grid; justify-items: center; gap: 4px;
}
.shared-empty.slim { padding: 16px 8px 10px; }
.shared-empty p { margin: 0; color: var(--ink); font-weight: 800; font-size: .86rem; }
.shared-empty span { font-size: .74rem; }
.shared-empty .text-link { margin-top: 2px; font-size: .78rem; }

@media (min-width: 1280px) {
  .shared-list { max-height: min(48vh, 420px); }
}

.settings-list { display: grid; gap: 8px; margin-bottom: 12px; }
.setting-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); background: var(--bg-elev); border-radius: 16px;
  padding: 12px; font: inherit; color: var(--ink); cursor: pointer; text-align: right;
}
.setting-left { display: flex; align-items: center; gap: 12px; }
.setting-left strong { display: block; font-size: .9rem; }
.setting-left span { color: var(--muted); font-size: .75rem; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row .setting-row:only-child { grid-column: 1 / -1; }
.setting-row.compact { padding: 10px; min-width: 0; }
.setting-row.compact .setting-left { gap: 8px; min-width: 0; }
.setting-row.compact .setting-left > div { min-width: 0; overflow: hidden; }
.setting-row.compact strong {
  /* font-size: .82rem; */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.setting-row.compact span {
  font-size: .68rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: block;
}
@media (max-width: 360px) {
  .btn-row.settings-pair { grid-template-columns: 1fr; }
}

.admin-panel { border: 1px solid rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .07); }
.admin-panel .panel-title { color: var(--warn); }
.admin-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: rgba(245, 158, 11, .12);
}
.admin-tabs button {
  border: 0; background: transparent; border-radius: 11px;
  padding: 9px 4px; font: inherit; font-size: .72rem; font-weight: 700;
  color: var(--ink-soft); cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
}
.admin-tabs button .icon { width: 16px; height: 16px; }
.admin-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #92400e, #d97706);
  box-shadow: 0 6px 14px rgba(217, 119, 6, .22);
}
.admin-tabs button.active .icon { filter: invert(1) !important; }
.admin-form { display: grid; gap: 8px; margin-bottom: 16px; }
.admin-form:last-child { margin-bottom: 0; }
.admin-broadcast-list { display: grid; gap: 6px; margin-top: 4px; }
.admin-broadcast-list > .field-label { margin-bottom: 2px; }
.code-row.admin-broadcast-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  justify-content: stretch;
}
.admin-broadcast-text { min-width: 0; text-align: right; }
.admin-broadcast-text strong { display: block; font-size: .8rem; margin-bottom: 2px; }
.admin-broadcast-text span { display: block; color: var(--muted); font-size: .7rem; }
.admin-broadcast-row small { color: var(--muted); font-size: .68rem; white-space: nowrap; }
.field-label { color: var(--muted); font-size: .8rem; }
.admin-form input, .admin-form textarea {
  width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.5);
  border-radius: 12px; padding: 10px 12px; font: inherit; color: var(--ink); outline: none;
}
.admin-key-card {
  display: block; text-decoration: none; color: inherit; margin-top: 10px;
  background: var(--bg-elev);
}
.admin-key-row {
  display: flex; align-items: center; gap: 12px; text-align: right;
}
.admin-key-row strong { display: block; font-size: .95rem; }
.admin-key-row span { display: block; color: var(--muted); font-size: .75rem; margin-top: 2px; }
.admin-full-link { justify-content: center; gap: 8px; }

/* پیش‌فرض مطلقاً مخفی — فقط با .is-on بعد از تایید سرور */
#maint-overlay.maintenance-screen,
.maintenance-screen {
  position: fixed; inset: 0; z-index: 10000;
  display: none !important;
  place-items: center;
  padding: 28px 20px;
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(20, 184, 166, 0.1), transparent 55%),
    radial-gradient(700px 420px at 100% 100%, rgba(45, 212, 191, 0.08), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #f7fbf9 48%, #eef7f3 100%);
}
#maint-overlay.maintenance-screen.is-on,
.maintenance-screen.is-on {
  display: grid !important;
}
.maintenance-card {
  width: min(380px, 100%);
  padding: 40px 28px 32px;
  border-radius: 28px;
  background: #ffffff;
  border: 1px solid rgba(15, 118, 110, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 24px 60px rgba(11, 61, 58, 0.08);
  text-align: center;
  color: #102926;
}
.maintenance-orbit {
  position: relative; width: 112px; height: 112px; margin: 0 auto 22px;
  display: grid; place-items: center;
}
.maintenance-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(15, 118, 110, 0.08);
  border-top-color: #14b8a6;
  border-right-color: rgba(45, 212, 191, 0.35);
  animation: maintSpin 1.35s linear infinite;
}
.maintenance-ring.delay {
  inset: 14px; animation-duration: 2s; animation-direction: reverse; opacity: .7;
  border-top-color: #2dd4bf;
  border-right-color: transparent;
}
@keyframes maintSpin { to { transform: rotate(360deg); } }
.maintenance-mark {
  width: 66px; height: 66px; border-radius: 20px;
  background: url("assets/original-logo.png") center/cover no-repeat;
  box-shadow: 0 14px 36px rgba(15, 118, 110, 0.16);
  position: relative; z-index: 1;
}
.maintenance-mark.maintenance-tea {
  background: linear-gradient(145deg, #0f766e, #14b8a6);
  display: grid; place-items: center;
}
.maintenance-mark.maintenance-tea img {
  width: 34px; height: 34px;
  filter: invert(1) brightness(1.05);
  display: block;
}
.maintenance-kicker {
  margin: 0 0 6px;
  font-size: .72rem; font-weight: 800; letter-spacing: .12em;
  color: #0d9488;
}
.maintenance-card h2 {
  margin: 0 0 10px; font-size: 1.55rem; font-weight: 900; letter-spacing: -.03em;
  color: #0b3d3a;
}
.maintenance-card > p {
  margin: 0 0 18px; color: #5f7f78; line-height: 1.8; font-size: .95rem;
}
.maintenance-eta {
  display: grid; gap: 2px; margin: 0 auto 14px;
  padding: 12px 20px; border-radius: 16px; width: min(100%, 260px);
  background: rgba(15, 118, 110, 0.06); border: 1px solid rgba(15, 118, 110, 0.1);
}
.maintenance-eta[hidden] { display: none !important; }
.maintenance-eta em { font-style: normal; font-size: .68rem; font-weight: 700; color: #6b8a84; }
.maintenance-eta strong { color: #0f766e; font-size: 1.02rem; }
.maintenance-card .cta-main {
  display: flex; align-items: center; justify-content: center;
  width: min(100%, 280px); min-height: 52px; margin: 0 auto;
  padding: 14px 22px; font-size: 1.02rem; font-weight: 900;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.22);
}
.maintenance-card .cta-main.slim {
  width: min(100%, 280px); margin: 0 auto; padding: 14px 22px;
}
.maintenance-actions {
  display: grid; gap: 12px; justify-items: center; width: 100%; margin-top: 4px;
}
/* host بدون کلمه ad تا بلاکرها نگیرند — خود تگ‌های mediaad-* دست نخورده می‌مانند */
#zx-slots {
  position: absolute;
  width: 0; height: 0; overflow: visible;
  pointer-events: none;
}
#zx-slots > * { pointer-events: auto; }
/* جلوگیری از نمایش جایگاه‌های غیرفعال حتی اگر لودر خودکار ساخت */
html.zx-deny-mediaad-83nDy #mediaad-83nDy,
html.zx-deny-mediaad-6pPv9 #mediaad-6pPv9,
html.zx-deny-mediaad-0ek5A #mediaad-0ek5A {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
}
.admin-form textarea { min-height: 90px; resize: vertical; }
.admin-form .cta-main { justify-self: start; padding-inline: 20px; }

.sheet-root {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(7, 24, 22, .62);
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.sheet-root.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%;
  max-width: 100%;
  max-height: min(92dvh, 92vh);
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  transform: translateY(18px);
  transition: transform .22s ease;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  margin: 0;
  padding: var(--sheet-pad-top) 0 0;
  box-sizing: border-box;
}
.sheet-root.open .sheet { transform: none; }
.sheet.tall { max-height: min(94dvh, 94vh); }
.sheet-handle {
  width: 44px; height: 5px; border-radius: 999px;
  background: rgba(15, 118, 110, .2);
  margin: 4px auto 12px;
  flex: 0 0 auto;
}
.sheet h3 {
  margin: 0 var(--sheet-pad) 10px;
  padding: 0;
  font-size: 1.12rem;
  text-align: center;
  flex: 0 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}
.sheet-sub {
  margin: 0 var(--sheet-pad) 14px;
  padding: 0;
  color: var(--muted);
  font-size: .84rem;
  text-align: center;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}
.sheet > .panel-empty {
  margin: 0;
  padding: 24px var(--sheet-pad) calc(24px + var(--safe-bottom));
  box-sizing: border-box;
}
.sheet-form { display: flex; flex-direction: column; min-height: 0; flex: 1; width: 100%; box-sizing: border-box; }
.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px var(--sheet-pad) 16px;
  text-align: right;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.sheet-body > *,
.sheet-form .field,
.sheet-form .prio-row,
.sheet-form .gender-row,
.sheet-form .avatar-grid,
.sheet-form .avatar-pick,
.sheet-form .avatar-hero,
.sheet-form .gender-seg,
.cheer-grid,
.react-compact,
.react-picker,
.reactor-list,
.notif-list,
.eprofile-menu,
.badge-detail-card {
  max-width: 100%;
  box-sizing: border-box;
}
.sheet-actions {
  flex: 0 0 auto;
  padding: 14px var(--sheet-pad) calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg-card);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.sheet-actions .cta-main { margin: 0; max-width: 100%; }
.sheet-actions.stack { display: grid; gap: 8px; padding-top: 4px; }
.badge-detail-card {
  text-align: center;
  padding: 8px var(--sheet-pad) 24px;
  box-sizing: border-box;
  width: 100%;
}
.badge-detail-card h3 {
  margin: 0 0 8px !important;
  max-width: none;
  white-space: normal;
}
.profile-sheet .profile-hero {
  margin: 0;
  padding: 4px var(--sheet-pad) 12px;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}
.profile-sheet .badge-row {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}
.profile-sheet .sheet-actions {
  padding: 12px var(--sheet-pad) calc(18px + var(--safe-bottom));
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}
.profile-sheet .profile-hero h2,
.profile-sheet .profile-hero .uname {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prio-row, .gender-row, .cheer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.gender-row { grid-template-columns: 1fr 1fr; }
.cheer-grid {
  grid-template-columns: 1fr 1fr;
  padding: 4px var(--sheet-pad) calc(18px + var(--safe-bottom));
  margin: 0;
}
.prio-chip, .cheer-btn {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 14px;
  padding: 11px 8px;
  font: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.prio-chip.active, .auth-tabs button.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #0b3d3a, #0f766e);
}
.prio-chip.active .icon { filter: invert(1) !important; }
.cheer-btn { flex-direction: column; min-height: 84px; }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin: 0 var(--sheet-pad) 12px; padding: 4px; border-radius: 14px;
  background: rgba(15, 118, 110, .08);
  box-sizing: border-box;
}
.auth-tabs button {
  border: 0; background: transparent; border-radius: 10px; padding: 10px;
  font: inherit; color: var(--ink-soft); cursor: pointer;
}
.form-error { color: var(--danger); text-align: center; margin: 0 0 8px; font-size: .85rem; }

.stepper { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0 16px; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(15, 118, 110, .1); color: var(--muted); font-size: .8rem; font-weight: 800;
  flex: 0 0 auto;
}
.step-dot.active, .step-dot.done { background: linear-gradient(135deg, #0b3d3a, #0f766e); color: #fff; }
.step-line { width: 28px; height: 2px; background: rgba(15, 118, 110, .15); flex: 0 0 auto; }
.step-line.done { background: #0f766e; }
.step-pane { animation: rise .2s ease both; }

.reg-steps {
  margin: 0 0 12px;
  padding: 10px 12px 8px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: start;
  column-gap: 0;
}
.reg-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 0;
  min-width: 44px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: var(--muted);
}
.reg-step i {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-style: normal; font-size: .72rem; font-weight: 800;
  background: rgba(15,118,110,.1); color: var(--muted);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.reg-step span {
  font-size: .66rem; font-weight: 700; line-height: 1.2; text-align: center;
}
.reg-step.on { color: var(--teal); }
.reg-step.on i {
  background: linear-gradient(145deg, #0b3d3a, #0f766e);
  color: #fff;
  box-shadow: 0 6px 14px rgba(15,118,110,.22);
}
.reg-step.done { color: #0f766e; }
.reg-step.done i {
  background: #0f766e;
  color: #fff;
}
.reg-bar {
  height: 3px;
  min-width: 28px;
  margin: 12.5px 10px 0;
  border-radius: 999px;
  background: rgba(15,118,110,.16);
  align-self: start;
}
.reg-bar.on { background: #0f766e; }
.reg-step-hint { display: none; }
.avatar-pick.tall {
  max-height: min(38vh, 280px);
  overflow-y: auto;
  padding: 2px;
}
.review-card.compact { margin-top: 8px; }
html[data-theme="dark"] .reg-steps {
  background: rgba(15, 36, 33, .55);
}
html[data-theme="dark"] .reg-step.on { color: #5eead4; }
html[data-theme="dark"] .reg-step.on i {
  background: linear-gradient(145deg, #0f766e, #14b8a6);
  color: #fff;
}
html[data-theme="dark"] .reg-step.done { color: #2dd4bf; }
html[data-theme="dark"] .reg-step.done i {
  background: #14b8a6;
  color: #042f2e;
}
html[data-theme="dark"] .reg-bar.on { background: #14b8a6; }
.field-pwd {
  position: relative;
  display: block;
}
.field-pwd input {
  padding-right: 44px;
  padding-left: 14px;
}
.pwd-toggle {
  position: absolute;
  right: 6px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border: 0; padding: 0;
  border-radius: 10px;
  background: transparent;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--muted);
}
.pwd-toggle:hover { color: var(--teal); background: rgba(15,118,110,.08); }
.pwd-toggle .icon { width: 18px; height: 18px; }
.field-hint { margin: 0 0 8px; color: var(--muted); font-size: .8rem; text-align: center; }
.review-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.3); margin-top: 6px;
}
.review-card img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.review-card strong { display: block; font-size: .92rem; }
.review-card span { color: var(--muted); font-size: .78rem; }
.step-actions-row { display: flex; gap: 8px; }
.step-actions-row .ghost-wide { margin-top: 0; flex: 1; }
.step-actions-row .cta-main { flex: 2; margin: 0; }

.avatar-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 8px 0 12px; max-height: 220px; overflow-y: auto;
}
.avatar-grid.mini { max-height: 160px; }
.avatar-opt {
  border: 2px solid transparent; background: transparent; border-radius: 14px; padding: 2px; cursor: pointer;
}
.avatar-opt.active { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
.avatar-opt img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }

/* Register avatar step */
.avatar-step {
  display: grid;
  gap: 12px;
}
.avatar-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px 12px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(15,118,110,.14), transparent 60%),
    var(--bg-elev);
  text-align: center;
}
.avatar-hero-ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(145deg, #0f766e, #34d399 55%, #f59e0b);
  box-shadow: 0 12px 28px rgba(15, 118, 110, .22);
}
.avatar-hero-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--bg-card);
  border: 3px solid var(--bg-card);
}
.avatar-hero-copy strong {
  display: block;
  font-size: .95rem;
  font-weight: 800;
}
.avatar-hero-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.55;
}
.gender-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(15, 118, 110, .08);
}
.gender-seg button {
  border: 0;
  background: transparent;
  border-radius: 11px;
  padding: 10px 8px;
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
}
.gender-seg button.on {
  color: #fff;
  background: linear-gradient(135deg, #0b3d3a, #0f766e);
  box-shadow: 0 6px 14px rgba(15, 118, 110, .2);
}
.avatar-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
  margin: 0;
}
.avatar-pick-item {
  border: 2px solid transparent;
  background: rgba(255,255,255,.28);
  border-radius: 18px;
  padding: 4px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease, background .15s ease;
}
html[data-theme="dark"] .avatar-pick-item {
  background: rgba(0,0,0,.16);
}
.avatar-pick-item:active { transform: scale(.97); }
.avatar-pick-item.active {
  border-color: var(--teal);
  background: rgba(15, 118, 110, .12);
  box-shadow: 0 0 0 3px rgba(15,118,110,.16), 0 8px 18px rgba(15,118,110,.12);
}
.avatar-pick-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
@media (min-width: 420px) {
  .avatar-pick { grid-template-columns: repeat(4, 1fr); }
}

.notif-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0; padding: 0 var(--sheet-pad) 12px; box-sizing: border-box; width: 100%;
}
.notif-head h3 { margin: 0; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-list {
  display: grid; gap: 8px;
  padding: 0 var(--sheet-pad) calc(18px + var(--safe-bottom));
  text-align: right; overflow-x: hidden; overflow-y: auto;
  box-sizing: border-box; width: 100%;
}
.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.3);
}
.notif-item.unread { background: rgba(15, 118, 110, .1); }
.notif-item img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.notif-body { flex: 1; min-width: 0; }
.notif-item strong { display: block; font-size: .88rem; }
.notif-item p { margin: 3px 0; color: var(--ink-soft); font-size: .82rem; line-height: 1.6; }
.notif-item small { color: var(--muted); font-size: .72rem; }
.notif-del {
  flex: 0 0 auto; width: 32px; height: 32px; border: 0; background: transparent;
  border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.notif-del:hover { background: rgba(225, 29, 72, .1); }

.confirm-root {
  align-items: center !important;
  justify-content: center !important;
  padding: 20px;
  background: rgba(7, 24, 22, .72);
  box-sizing: border-box;
}
.confirm-card {
  width: min(360px, 100%);
  max-width: 100%;
  margin: 0 auto;
  align-self: center;
  flex: 0 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px var(--sheet-pad);
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
  animation: rise .2s ease both;
  color: var(--ink);
  box-sizing: border-box;
}
.confirm-card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--ink); }
.confirm-card p,
.confirm-card .confirm-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: .88rem;
  line-height: 1.7;
  white-space: pre-line;
}
.confirm-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 14px;
}
.confirm-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.4;
  background: rgba(15, 118, 110, .1);
  color: var(--teal);
  border: 1px solid rgba(15, 118, 110, .14);
}
.confirm-tag .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.confirm-tag.coin {
  background: linear-gradient(135deg, rgba(15, 118, 110, .12), rgba(45, 212, 191, .14));
  color: #0f766e;
  border-color: rgba(15, 118, 110, .2);
}
.confirm-tag.coin .icon {
  filter: invert(.35) sepia(.45) saturate(2.2) hue-rotate(130deg);
}
.confirm-tag.cost {
  background: linear-gradient(135deg, rgba(8, 145, 178, .1), rgba(56, 189, 248, .14));
  color: #0e7490;
  border-color: rgba(8, 145, 178, .22);
}
.confirm-tag.cost .icon {
  filter: invert(.35) sepia(.4) saturate(1.8) hue-rotate(160deg);
}
.confirm-tag.cost {
  background: linear-gradient(135deg, rgba(8, 145, 178, .1), rgba(56, 189, 248, .14));
  color: #0e7490;
  border-color: rgba(8, 145, 178, .22);
}
.confirm-tag.cost .icon {
  filter: invert(.35) sepia(.4) saturate(1.8) hue-rotate(160deg);
}
html[data-theme="dark"] .confirm-tag {
  background: rgba(45, 212, 191, .12);
  color: #5eead4;
  border-color: rgba(45, 212, 191, .18);
}
html[data-theme="dark"] .confirm-tag.coin {
  background: linear-gradient(135deg, rgba(45, 212, 191, .14), rgba(20, 184, 166, .2));
  color: #99f6e4;
  border-color: rgba(45, 212, 191, .28);
}
html[data-theme="dark"] .confirm-tag.coin .icon {
  filter: invert(.92) sepia(.18) saturate(.6) hue-rotate(110deg);
}
.confirm-text + .confirm-actions { margin-top: 16px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.confirm-actions .ghost-wide { margin-top: 0; }
.confirm-actions .cta-main { margin: 0; }
.confirm-actions .cta-main.danger { background: linear-gradient(135deg, #be123c, #e11d48); }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  transform: translateX(-50%);
  z-index: 60;
  padding: 11px 14px;
  border-radius: 14px;
  background: #12312e;
  color: #fff;
  font-size: .86rem;
  max-width: 90%;
  text-align: center;
}
.toast.ok { background: #065f46; }
.toast.warn { background: #92400e; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.badge-grid { grid-template-columns: repeat(3, 1fr); }
.badge-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.32);
  text-align: center;
  cursor: pointer;
  opacity: .55;
  filter: grayscale(.35);
  font: inherit;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
}
.badge-cell.on {
  opacity: 1;
  filter: none;
  background: linear-gradient(165deg, rgba(15,118,110,.14), rgba(255,255,255,.42));
  border-color: rgba(15,118,110,.22);
  box-shadow: 0 8px 18px rgba(11, 61, 58, .06);
}
.badge-cell .icon {
  width: 28px; height: 28px; flex: 0 0 auto;
  padding: 10px; border-radius: 14px;
  background: rgba(15,118,110,.1);
  box-sizing: content-box;
}
.badge-cell.on .icon { background: rgba(15,118,110,.16); }
.badge-cell > div { min-width: 0; width: 100%; overflow: hidden; }
.badge-cell strong {
  display: block; font-size: .78rem; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.badge-cell span {
  display: block; color: var(--muted); font-size: .64rem; margin-top: 3px; line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 420px) {
  .boost-grid { grid-template-columns: repeat(2, 1fr); }
  .avatar-grid { grid-template-columns: repeat(3, 1fr); }
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Desktop: لپ‌تاپ = مرکز + ریل راست (بدون سایدبار چپ) ===== */
@media (min-width: 960px) {
  body {
    background:
      radial-gradient(1400px 700px at 8% -12%, rgba(15, 118, 110, .2), transparent 55%),
      radial-gradient(1000px 560px at 100% 10%, rgba(245, 158, 11, .12), transparent 48%),
      #d7ebe4;
  }
  html[data-theme="dark"] body {
    background:
      radial-gradient(120% 80% at 100% -10%, rgba(45, 212, 191, .1), transparent 45%),
      radial-gradient(90% 60% at 0% 100%, rgba(15, 118, 110, .14), transparent 50%),
      radial-gradient(800px 500px at 100% 20%, rgba(245, 158, 11, .06), transparent 50%),
      #071412;
  }

  #app {
    width: 100%;
    max-width: none;
    height: 100dvh;
    margin: 0;
    padding-top: var(--zx-pad-top, 0px);
    padding-bottom: var(--zx-pad-bot, 0px);
    padding-left: 0;
    padding-right: 0;
  }
  .atmosphere { inset: 0; border-radius: 0; }

  .app-layout {
    display: grid;
    direction: ltr;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    grid-template-rows: 1fr;
    grid-template-areas: "main rail";
    gap: 0;
    height: 100%;
    min-height: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    overflow: hidden;
  }
  .side-brand { display: none !important; }
  .side-rail, .app-shell { direction: rtl; }

  .app-shell {
    grid-area: main;
    min-height: 0;
    border-radius: 0;
    background: var(--bg);
    border: 0;
    padding: 28px clamp(22px, 3vw, 40px) 32px;
  }
  .app-shell .page { max-width: 820px; margin: 0 auto; }
  .app-shell .top-row { margin-bottom: 18px; }
  .app-shell .panel { margin-bottom: 16px; }

  /* پروفایل/تگ‌ها در دسکتاپ فقط در ریل راست */
  .home-mobile-profile { display: none !important; }
  .mobile-only-notif { display: none !important; }

  .side-rail {
    grid-area: rail;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 16px 16px;
    border-left: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
    background:
      linear-gradient(180deg, rgba(15, 118, 110, .05), transparent 36%),
      color-mix(in srgb, var(--bg) 92%, var(--bg-elev));
  }
  .rail-profile {
    cursor: pointer;
    padding: 14px 12px 12px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  }
  .rail-profile:hover {
    border-color: rgba(15, 118, 110, .28);
    box-shadow: 0 10px 24px rgba(11, 61, 58, .08);
    transform: translateY(-1px);
  }
  .rail-profile-top {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: right;
  }
  .rail-profile .avatar-ring.lg {
    width: 52px; height: 52px; flex: 0 0 auto; margin: 0;
  }
  .rail-profile-text { min-width: 0; flex: 1; }
  .rail-profile h2 {
    margin: 0; font-size: 1rem; font-weight: 800; line-height: 1.3;
  }
  .rail-profile .uname {
    margin: 2px 0 0; font-size: .74rem; color: var(--muted);
  }
  .rail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  }
  .rail-stat {
    text-align: center;
    padding: 6px 4px;
    border-radius: 12px;
    background: rgba(15, 118, 110, .06);
  }
  .rail-stat strong {
    display: block; font-size: .92rem; font-weight: 800; color: var(--ink); line-height: 1.2;
  }
  .rail-stat span {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    margin-top: 3px; font-size: .62rem; font-weight: 700; color: var(--muted);
  }
  .rail-stat span .icon {
    width: 12px; height: 12px; flex: 0 0 auto;
  }
  html[data-theme="dark"] .rail-profile {
    background: rgba(14, 33, 30, .72);
    border-color: rgba(167, 243, 208, .1);
  }
  html[data-theme="dark"] .rail-stat {
    background: rgba(45, 212, 191, .08);
  }

  .rail-progress {
    padding: 12px 12px 10px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
    background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  }
  html[data-theme="dark"] .rail-progress {
    background: rgba(14, 33, 30, .65);
    border-color: rgba(167, 243, 208, .1);
  }
  html[data-theme="dark"] .rail-progress-top strong { color: var(--ink); }
  html[data-theme="dark"] .rail-progress-top em { color: #5eead4; }
  html[data-theme="dark"] .rail-progress-meta { color: var(--muted); }
  .rail-progress-top {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    margin-bottom: 8px;
  }
  .rail-progress-top strong { font-size: .82rem; font-weight: 800; }
  .rail-progress-top em {
    font-style: normal; font-size: .95rem; font-weight: 800;
    color: var(--teal);
  }
  .rail-progress-track {
    height: 9px; border-radius: 999px; overflow: hidden;
    background: rgba(15, 118, 110, .12);
    box-shadow: inset 0 1px 2px rgba(11, 61, 58, .08);
  }
  .rail-progress-track i {
    display: block; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, #0b3d3a 0%, #0f766e 35%, #14b8a6 55%, #2dd4bf 75%, #0f766e 100%);
    background-size: 220% 100%;
    animation: railProgressFlow 2.8s ease-in-out infinite;
    transition: width .4s ease;
  }
  @keyframes railProgressFlow {
    0% { background-position: 100% 50%; }
    50% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
  }
  .mobile-task-progress { display: none !important; }

  .story-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 12px;
    overflow: visible;
    padding-bottom: 0;
  }
  .story-card {
    width: auto;
    padding: 12px 10px 12px;
    border-radius: 18px;
  }
  .story-avatar {
    width: 78px; height: 78px; margin: 0 auto 8px;
  }
  .story-card strong { font-size: .86rem; }
  .story-card em { font-size: .76rem; margin-top: 2px; display: block; }

  .badge-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  .badge-cell {
    padding: 18px 14px 16px;
    gap: 10px;
    border-radius: 18px;
    min-height: 0;
  }
  .badge-cell .icon {
    width: 30px; height: 30px;
    padding: 12px;
    border-radius: 16px;
  }
  .badge-cell strong {
    font-size: .88rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .badge-cell span {
    font-size: .72rem;
    margin-top: 4px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .rail-progress-meta {
    display: flex; justify-content: space-between; gap: 8px;
    margin-top: 8px; color: var(--muted); font-size: .68rem; font-weight: 700;
  }
  .rail-progress-meta span {
    display: inline-flex; align-items: center; gap: 4px; min-width: 0;
  }

  .rail-nav {
    display: grid;
    gap: 4px;
    margin-top: 4px;
    flex: 1 1 auto;
    align-content: start;
    padding: 4px;
    border-radius: 16px;
    background: rgba(15, 118, 110, .04);
  }
  .rail-nav button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: .88rem;
    font-weight: 750;
    padding: 11px 12px;
    border-radius: 12px;
    cursor: pointer;
    text-align: right;
    transition: background .15s ease, color .15s ease, transform .15s ease;
  }
  .rail-nav-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center; flex: 0 0 auto;
    background: rgba(15, 118, 110, .08);
  }
  .rail-nav button .icon { width: 18px; height: 18px; }
  .rail-nav button > span:last-child {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .rail-nav button:hover {
    background: rgba(15, 118, 110, .08);
    color: var(--ink);
  }
  .rail-nav button.active {
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    box-shadow: 0 8px 18px rgba(15, 118, 110, .2);
  }
  .rail-nav button.active .rail-nav-icon {
    background: rgba(255, 255, 255, .18);
  }
  .rail-nav button.active .icon { filter: invert(1) !important; }
  html[data-theme="dark"] .rail-nav {
    background: rgba(7, 20, 18, .45);
  }
  html[data-theme="dark"] .rail-nav button {
    color: var(--ink-soft);
  }
  html[data-theme="dark"] .rail-nav-icon {
    background: rgba(45, 212, 191, .08);
  }
  html[data-theme="dark"] .rail-nav button:hover {
    background: rgba(45, 212, 191, .1);
    color: var(--ink);
  }
  html[data-theme="dark"] .rail-nav button.active {
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    box-shadow: 0 8px 20px rgba(20, 184, 166, .22);
  }

  .rail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
  }
  .rail-icon-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 44px;
    border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
    background: color-mix(in srgb, var(--bg-card) 90%, transparent);
    color: var(--ink-soft);
    font: inherit;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
  }
  .rail-icon-btn:hover {
    background: rgba(15, 118, 110, .08);
    border-color: rgba(15, 118, 110, .22);
    transform: translateY(-1px);
  }
  .rail-icon-btn .icon { width: 20px; height: 20px; }
  .rail-icon-btn .dot-badge {
    position: absolute;
    top: 6px;
    inset-inline-end: 8px;
  }
  html[data-theme="dark"] .rail-icon-btn {
    background: rgba(14, 33, 30, .7);
    border-color: rgba(167, 243, 208, .1);
  }

  .bottom-nav { display: none !important; }
  .friends-grid { grid-template-columns: repeat(2, 1fr); }

  .sheet-root {
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(7, 24, 22, .72);
    backdrop-filter: blur(8px);
  }
  .sheet {
    --sheet-max: min(460px, 42vw);
    --sheet-pad: 18px;
    --sheet-pad-top: 16px;
    width: var(--sheet-max);
    max-width: min(460px, calc(100vw - 40px));
    margin: 0;
    border-radius: 20px;
    max-height: min(84dvh, 820px);
    padding: var(--sheet-pad-top) 0 0;
    transform: translateY(10px) scale(.98);
  }
  .sheet-root.open .sheet { transform: none; }
  .sheet-handle {
    display: none;
    margin: 0;
    height: 0;
  }
  .sheet.tall { max-height: min(88dvh, 900px); }
  .sheet h3 {
    margin: 0 var(--sheet-pad) 8px;
    font-size: 1.05rem;
  }
  .sheet-sub {
    margin: 0 var(--sheet-pad) 10px;
    font-size: .8rem;
  }
  .sheet-body { padding: 2px var(--sheet-pad) 14px; }
  .sheet-actions {
    padding: 12px var(--sheet-pad) 14px;
  }
  .profile-sheet .profile-hero {
    padding: 2px var(--sheet-pad) 12px;
  }
  .profile-sheet .sheet-actions {
    padding: 10px var(--sheet-pad) 14px;
  }
  .profile-top-actions { top: 12px; left: 12px; }
  .cheer-grid {
    padding: 2px var(--sheet-pad) 14px;
  }
  .notif-head { padding: 0 var(--sheet-pad) 10px; }
  .notif-list { padding: 0 var(--sheet-pad) 14px; }
  .session-list { padding: 0 var(--sheet-pad); margin-top: 4px; }
  .auth-tabs { margin-inline: var(--sheet-pad); }
  .confirm-card {
    width: min(380px, 88%);
    padding: 22px 18px;
  }

  .panel, .task, .friend-card, .article-card, .setting-row {
    transition: transform .18s ease, box-shadow .18s ease;
  }
  .article-card:hover, .friend-card:hover, .task:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(11, 61, 58, .12);
  }

  .toast { bottom: 28px; }
}

/* ===== دسکتاپ بزرگ: سایدبار چپ (درباره برنامه) برمی‌گردد ===== */
@media (min-width: 1280px) {
  .app-layout {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) minmax(300px, 360px);
    grid-template-areas: "brand main rail";
  }
  .side-brand {
    --sb-deep: #06332f;
    --sb-mid: #0b4f48;
    --sb-glow: rgba(45, 212, 191, .35);
    display: flex !important;
    grid-area: brand;
    position: relative;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 34px 26px 28px;
    border-right: 1px solid rgba(15, 118, 110, .14);
    background:
      linear-gradient(165deg, #d8f3ea 0%, #e4f6ef 38%, #eef8f3 100%);
    direction: rtl;
    cursor: default;
    user-select: none;
    isolation: isolate;
  }
  html[data-theme="dark"] .side-brand {
    border-right-color: rgba(148, 197, 188, .12);
    background:
      linear-gradient(165deg, #0a2421 0%, #0c2c28 42%, #0a1f1c 100%);
  }
  .side-brand, .side-brand * { cursor: default !important; }

  .side-brand-atmos {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .sb-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: .9;
  }
  .sb-orb-a {
    width: 220px; height: 220px;
    top: -70px; left: -50px;
    background: radial-gradient(circle, rgba(45, 212, 191, .45), rgba(15, 118, 110, .08) 55%, transparent 70%);
    animation: sbFloat 9s ease-in-out infinite;
  }
  .sb-orb-b {
    width: 180px; height: 180px;
    bottom: 8%; right: -40px;
    background: radial-gradient(circle, rgba(245, 158, 11, .22), transparent 68%);
    animation: sbFloat 11s ease-in-out infinite reverse;
  }
  .sb-mesh {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(15, 118, 110, .05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(15, 118, 110, .05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 78%);
    opacity: .55;
  }
  .sb-chain {
    position: absolute;
    top: 42%;
    left: -10%;
    width: 120%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(15, 118, 110, .22), rgba(45, 212, 191, .35), rgba(15, 118, 110, .18), transparent);
    transform: rotate(-18deg);
    opacity: .55;
  }
  .sb-chain::before,
  .sb-chain::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 10px; height: 10px;
    border: 2px solid rgba(15, 118, 110, .35);
    border-radius: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.35);
  }
  .sb-chain::before { left: 28%; }
  .sb-chain::after { left: 62%; border-color: rgba(245, 158, 11, .45); }
  html[data-theme="dark"] .sb-orb-a {
    background: radial-gradient(circle, rgba(45, 212, 191, .28), transparent 70%);
  }
  html[data-theme="dark"] .sb-orb-b {
    background: radial-gradient(circle, rgba(245, 158, 11, .16), transparent 70%);
  }
  html[data-theme="dark"] .sb-mesh {
    background-image:
      linear-gradient(rgba(94, 234, 212, .06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(94, 234, 212, .06) 1px, transparent 1px);
  }
  html[data-theme="dark"] .sb-chain {
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, .2), rgba(45, 212, 191, .4), transparent);
  }
  html[data-theme="dark"] .sb-chain::before,
  html[data-theme="dark"] .sb-chain::after {
    background: rgba(12, 40, 36, .8);
    border-color: rgba(94, 234, 212, .4);
  }

  .side-banner,
  .side-brand-feats,
  .side-brand-aside {
    position: relative;
    z-index: 1;
  }
  .side-banner {
    flex: 0 0 auto;
    text-align: right;
    padding: 4px 2px 2px;
    animation: sbRise .55s ease both;
  }
  .side-banner-visual {
    position: relative;
    width: 92px; height: 92px;
    margin: 0 0 18px auto;
    display: grid;
    place-items: center;
  }
  .side-banner-logo {
    width: 68px; height: 68px;
    border-radius: 22px;
    object-fit: cover;
    position: relative;
    z-index: 2;
    box-shadow:
      0 16px 36px rgba(11, 61, 58, .22),
      0 0 0 3px rgba(255, 255, 255, .55);
    animation: sbPulse 2.8s ease-in-out infinite;
  }
  html[data-theme="dark"] .side-banner-logo {
    box-shadow:
      0 16px 36px rgba(0, 0, 0, .35),
      0 0 0 3px rgba(45, 212, 191, .2);
  }
  .side-banner-spark {
    position: absolute;
    z-index: 3;
    bottom: -2px; left: -2px;
    width: 30px; height: 30px;
    border-radius: 11px;
    display: grid; place-items: center;
    background: linear-gradient(145deg, #0b3d3a, #0f766e);
    box-shadow: 0 8px 18px rgba(15, 118, 110, .35);
    animation: sbSpark 2.4s ease-in-out infinite;
  }
  .side-banner-spark .icon {
    width: 15px; height: 15px;
    filter: invert(1) !important;
  }
  .side-brand .brand-kicker {
    margin: 0 0 8px;
    font-size: .7rem;
    font-weight: 800;
    color: #0f766e;
    letter-spacing: .06em;
  }
  html[data-theme="dark"] .side-brand .brand-kicker { color: #5eead4; }
  .side-banner h1 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 2.6vw, 2.55rem);
    line-height: 1.1;
    letter-spacing: -.03em;
    background: linear-gradient(120deg, #0b3d3a 10%, #0f766e 55%, #147a5f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  html[data-theme="dark"] .side-banner h1 {
    background: linear-gradient(120deg, #ecfdf5 8%, #5eead4 55%, #99f6e4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .side-banner .tagline {
    margin: 0;
    color: var(--ink-soft);
    font-size: .92rem;
    line-height: 1.85;
    max-width: 30ch;
  }

  .side-brand-feats {
    display: grid;
    gap: 10px;
    flex: 1 1 auto;
    align-content: start;
  }
  .side-brand-feats article {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 13px 14px;
    border-radius: 18px;
    border: 1px solid rgba(15, 118, 110, .12);
    background:
      linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,255,255,.38));
    box-shadow: 0 10px 24px rgba(11, 61, 58, .06);
    backdrop-filter: blur(10px);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    animation: sbRise .55s ease both;
  }
  .side-brand-feats article:nth-child(1) { animation-delay: .08s; }
  .side-brand-feats article:nth-child(2) { animation-delay: .16s; }
  .side-brand-feats article:nth-child(3) { animation-delay: .24s; }
  .side-brand-feats article:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, .22);
    box-shadow: 0 14px 30px rgba(11, 61, 58, .1);
  }
  html[data-theme="dark"] .side-brand-feats article {
    background: linear-gradient(145deg, rgba(18, 48, 44, .78), rgba(14, 36, 33, .55));
    border-color: rgba(148, 197, 188, .12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  }
  .sb-feat-ico {
    width: 40px; height: 40px;
    border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(145deg, rgba(15, 118, 110, .16), rgba(45, 212, 191, .1));
    border: 1px solid rgba(15, 118, 110, .12);
    flex: 0 0 auto;
  }
  .sb-feat-ico .icon { width: 20px; height: 20px; }
  .sb-feat-ico.hot {
    background: linear-gradient(145deg, rgba(245, 158, 11, .22), rgba(15, 118, 110, .14));
    border-color: rgba(245, 158, 11, .28);
  }
  .side-brand-feats strong {
    display: block;
    font-size: .9rem;
    margin-bottom: 3px;
  }
  .side-brand-feats span {
    display: block;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.7;
  }

  .side-brand-aside {
    margin-top: auto;
    padding-top: 6px;
    display: grid;
    gap: 12px;
    animation: sbRise .55s ease both;
    animation-delay: .3s;
  }
  .side-native-chip {
    margin: 0;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(15, 118, 110, .14), rgba(45, 212, 191, .12));
    color: #0f766e;
    font-size: .7rem;
    font-weight: 800;
    border: 1px solid rgba(15, 118, 110, .14);
    box-shadow: 0 6px 14px rgba(15, 118, 110, .08);
  }
  html[data-theme="dark"] .side-native-chip {
    background: linear-gradient(120deg, rgba(45, 212, 191, .16), rgba(15, 118, 110, .18));
    color: #5eead4;
    border-color: rgba(94, 234, 212, .18);
    box-shadow: none;
  }
  .side-brand-line {
    margin: 0;
    padding: 14px 14px;
    border-radius: 16px;
    border: 1px dashed rgba(15, 118, 110, .28);
    background: rgba(15, 118, 110, .05);
    color: var(--ink-soft);
    font-size: .78rem;
    line-height: 1.85;
  }
  html[data-theme="dark"] .side-brand-line {
    border-color: rgba(94, 234, 212, .22);
    background: rgba(45, 212, 191, .05);
  }
  .app-shell { padding: 32px clamp(28px, 4vw, 56px) 36px; }
  .app-shell .page { max-width: 880px; }
  .friends-grid { grid-template-columns: repeat(3, 1fr); }
}

@keyframes sbFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(10px, 14px, 0) scale(1.05); }
}
@keyframes sbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
@keyframes sbSpark {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes sbRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 1540px) {
  .app-layout {
    grid-template-columns: minmax(340px, 400px) minmax(0, 1fr) minmax(320px, 380px);
  }
  .side-brand { padding: 36px 28px 32px; }
  .friends-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ارتفاع کم: فشرده‌سازی ریل */
@media (min-width: 960px) and (max-height: 700px) {
  .rail-stats { display: none !important; }
  .side-rail { gap: 10px; padding-top: 14px; }
  .rail-profile { padding: 10px; }
}
@media (min-width: 960px) and (max-height: 580px) {
  .rail-progress { display: none !important; }
  .side-rail { gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .rail-nav button { padding: 9px 10px; font-size: .82rem; }
  .rail-nav-icon { width: 30px; height: 30px; }
}

/* Heatmap — modern showcase */
.heat-card {
  margin: 10px 0 6px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(15, 118, 110, .08), transparent 50%),
    color-mix(in srgb, var(--bg-elev) 94%, transparent);
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.heat-card.me-heat {
  box-shadow: 0 10px 28px rgba(11, 61, 58, .05);
}
.heat-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 12px; border: 0; background: transparent;
  font: inherit; color: inherit; cursor: pointer; text-align: right;
}
.heat-toggle-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.heat-toggle-main .heat-ico {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(15,118,110,.1); flex: 0 0 auto;
}
.heat-toggle-main .heat-ico .icon { width: 17px; height: 17px; }
.heat-toggle-main strong { display: block; font-size: .88rem; font-weight: 800; letter-spacing: -.015em; }
.heat-toggle-main span { display: block; color: var(--muted); font-size: .7rem; margin-top: 2px; font-weight: 600; }
.heat-switch {
  position: relative; width: 42px; height: 24px; border-radius: 999px; flex: 0 0 auto;
  background: rgba(15,118,110,.14); transition: background .2s ease;
}
.heat-switch::after {
  content: ""; position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.14); transition: transform .2s ease;
}
.heat-switch.on { background: linear-gradient(135deg, #2dd4bf, #14b8a6 55%, #0d9488); }
.heat-switch.on::after { transform: translateX(-18px); }
html[data-theme="dark"] .heat-switch::after { background: #e7f6f1; }
.heat-pill {
  flex: 0 0 auto; padding: 5px 10px; border-radius: 999px;
  background: rgba(15,118,110,.1); color: var(--teal);
  font-size: .66rem; font-weight: 800; letter-spacing: -.01em;
}
.heat-body {
  padding: 12px 14px 14px;
  animation: heatIn .22s ease;
}
@keyframes heatIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.heat-card.profile-heat .heat-body { padding-top: 0; }
.heat-head.me-heat-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 0; color: inherit;
}
.heat-head.me-heat-head .heat-toggle-main strong { color: var(--ink); }
.contrib-well {
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, .04), transparent 40%),
    color-mix(in srgb, var(--bg-card) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  padding: 12px 10px 0;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.contrib-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 14px;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, .28) transparent;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  direction: ltr;
  display: flex;
  justify-content: safe center;
}
.heat-card.me-heat .contrib-grid {
  margin-inline: auto;
  flex: 0 0 auto;
}
.contrib-scroll::-webkit-scrollbar {
  height: 5px;
}
.contrib-scroll::-webkit-scrollbar-track {
  background: transparent;
  margin: 0 10px;
}
.contrib-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 118, 110, .28);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
.contrib-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 118, 110, .42);
  background-clip: padding-box;
}
.contrib-grid {
  display: flex;
  gap: 3px;
  width: max-content;
  max-width: none;
  direction: ltr;
  margin: 0;
  padding: 0 2px;
  box-sizing: border-box;
}
.contrib-grid.year { gap: 3px; }
.contrib-week { display: flex; flex-direction: column; gap: 3px; }
.contrib-grid.year .contrib-week { gap: 3px; }
.contrib-day {
  width: 10px; height: 10px; border-radius: 2.5px; display: block;
  background: rgba(15, 118, 110, .08);
  box-sizing: border-box;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.contrib-grid.year .contrib-day {
  width: 9px; height: 9px; border-radius: 2.5px;
}
.contrib-day:not(.future):hover {
  transform: scale(1.28);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg-card) 80%, transparent);
  z-index: 1;
}
html[data-theme="dark"] .contrib-day { background: rgba(255,255,255,.06); }
.contrib-day.lvl-1 { background: #9de8c8; }
.contrib-day.lvl-2 { background: #4fc99a; }
.contrib-day.lvl-3 { background: #1fa97a; }
.contrib-day.lvl-4 {
  background: #0b7a58;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
html[data-theme="dark"] .contrib-day.lvl-1 { background: rgba(52, 211, 153, .28); }
html[data-theme="dark"] .contrib-day.lvl-2 { background: rgba(45, 212, 191, .45); }
html[data-theme="dark"] .contrib-day.lvl-3 { background: rgba(20, 184, 166, .7); }
html[data-theme="dark"] .contrib-day.lvl-4 {
  background: #14b8a6;
  box-shadow: 0 0 10px rgba(20, 184, 166, .22);
}
.contrib-day.future { opacity: 0; pointer-events: none; }
.contrib-legend {
  display: flex; align-items: center; justify-content: flex-end; gap: 5px;
  margin-top: 10px; color: var(--muted); font-size: .64rem; font-weight: 650; direction: ltr;
}
.contrib-legend .contrib-day {
  width: 8px; height: 8px; border-radius: 2px;
  box-shadow: none;
}
html[data-theme="dark"] .heat-card {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(45, 212, 191, .1), transparent 50%),
    rgba(15, 36, 33, .55);
}
html[data-theme="dark"] .heat-card.me-heat {
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}
html[data-theme="dark"] .contrib-well {
  background:
    linear-gradient(180deg, rgba(45, 212, 191, .05), transparent 45%),
    rgba(8, 24, 22, .35);
  border-color: rgba(231, 246, 241, .06);
}
html[data-theme="dark"] .contrib-scroll {
  scrollbar-color: rgba(45, 212, 191, .35) transparent;
}
html[data-theme="dark"] .contrib-scroll::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, .35);
  background-clip: padding-box;
}
html[data-theme="dark"] .heat-pill {
  background: rgba(45, 212, 191, .12);
  color: #5eead4;
}

/* Sessions / devices */
.session-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 0 var(--sheet-pad);
  box-sizing: border-box;
  width: 100%;
}
.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
}
.session-row.current { border-color: rgba(15, 118, 110, .35); background: rgba(15, 118, 110, .08); }
.session-meta { min-width: 0; text-align: right; }
.session-meta strong,
.session-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .88rem;
  min-width: 0;
}
.session-name > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #9ca3af;
  box-shadow: 0 0 0 2px rgba(156, 163, 175, .18);
}
.session-dot.on {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .2);
}
.session-current-inline {
  flex: 0 0 auto;
  font-style: normal;
  font-size: .65rem;
  font-weight: 800;
  color: var(--teal);
  background: rgba(15, 118, 110, .12);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.session-meta > span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  margin-top: 4px;
  margin-inline-start: 15px;
}
.session-meta span.session-online {
  color: #16a34a;
  font-weight: 800;
}
html[data-theme="dark"] .session-meta span.session-online { color: #4ade80; }
html[data-theme="dark"] .session-current-inline {
  color: #5eead4;
  background: rgba(45, 212, 191, .14);
}
.session-row.online {
  border-color: rgba(34, 197, 94, .28);
}
.session-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: .65rem;
  font-weight: 800;
  color: var(--teal);
  background: rgba(15, 118, 110, .12);
  padding: 2px 8px;
  border-radius: 999px;
}
.blocked-banner {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  margin: 8px 0 4px;
}
