/* ============================================================
   Liquid Glass — سیستم طراحی نظرسنجی برند
   ============================================================ */

@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-300.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* ---------- توکن‌ها ---------- */
:root {
  --c1: 108 92 231;    /* بنفش  */
  --c2: 34 211 238;    /* فیروزه‌ای */
  --c3: 236 72 153;    /* صورتی */
  --c4: 250 204 21;    /* طلایی */

  --bg: #06060b;
  --bg-2: #0b0b16;
  --ink: #f4f5fb;
  --ink-soft: rgba(244, 245, 251, .66);
  --ink-faint: rgba(244, 245, 251, .40);

  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(255, 255, 255, .085);
  --rim: rgba(255, 255, 255, .14);
  --rim-hi: rgba(255, 255, 255, .38);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .75), 0 8px 24px -12px rgba(0, 0, 0, .5);

  --blur: 26px;
  --r-lg: 30px;
  --r-md: 22px;
  --r-sm: 15px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --maxw: 1120px;
}

:root[data-theme='light'] {
  --bg: #eef1f9;
  --bg-2: #e3e8f6;
  --ink: #10121c;
  --ink-soft: rgba(16, 18, 28, .66);
  --ink-faint: rgba(16, 18, 28, .42);
  --glass: rgba(255, 255, 255, .48);
  --glass-strong: rgba(255, 255, 255, .66);
  --rim: rgba(255, 255, 255, .85);
  --rim-hi: rgba(255, 255, 255, 1);
  --shadow: 0 24px 60px -22px rgba(40, 50, 90, .35), 0 6px 20px -10px rgba(40, 50, 90, .22);
}

/* ---------- پایه ---------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .35s var(--ease);
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.4; letter-spacing: -.01em; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: rgb(var(--c1) / .45); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .13); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .24); background-clip: content-box; }

/* ============================================================
   پس‌زمینه: شفق مایع
   ============================================================ */
.aurora { position: fixed; inset: 0; z-index: -3; overflow: hidden; background: radial-gradient(140% 110% at 50% -10%, var(--bg-2) 0%, var(--bg) 62%); }

.orb { position: absolute; border-radius: 50%; filter: blur(72px); opacity: .55; will-change: transform; }
:root[data-theme='light'] .orb { opacity: .48; filter: blur(80px); }

.orb-1 { width: 46vw; height: 46vw; min-width: 340px; min-height: 340px; top: -12%; inset-inline-end: -8%; background: radial-gradient(circle at 35% 35%, rgb(var(--c1) / .95), transparent 68%); animation: drift1 26s ease-in-out infinite; }
.orb-2 { width: 40vw; height: 40vw; min-width: 300px; min-height: 300px; bottom: -16%; inset-inline-start: -10%; background: radial-gradient(circle at 60% 40%, rgb(var(--c2) / .8), transparent 68%); animation: drift2 32s ease-in-out infinite; }
.orb-3 { width: 34vw; height: 34vw; min-width: 260px; min-height: 260px; top: 42%; inset-inline-start: 34%; background: radial-gradient(circle at 50% 50%, rgb(var(--c3) / .68), transparent 68%); animation: drift3 38s ease-in-out infinite; }

@keyframes drift1 { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-7%, 9%, 0) scale(1.14); } }
@keyframes drift2 { 0%, 100% { transform: translate3d(0, 0, 0) scale(1.06); } 50% { transform: translate3d(9%, -8%, 0) scale(.92); } }
@keyframes drift3 { 0%, 100% { transform: translate3d(0, 0, 0) scale(.95); } 33% { transform: translate3d(-11%, -7%, 0) scale(1.1); } 66% { transform: translate3d(8%, 6%, 0) scale(1); } }

/* دانه‌بندی ظریف روی همه‌چیز — بافت شیشه واقعی */
.grain { position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .28; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E"); }

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .12s !important; }
}

/* ============================================================
   شیشه
   ============================================================ */
.glass {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow), inset 0 1px 0 var(--rim-hi), inset 0 -1px 0 rgba(255, 255, 255, .05);
  isolation: isolate;
}

/* لبهٔ نورگیر — حلقهٔ گرادیانی ۱ پیکسلی که «ضخامت» شیشه را می‌سازد */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, var(--rim-hi), rgba(255, 255, 255, .04) 34%, rgba(255, 255, 255, .02) 62%, var(--rim));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* درخشش نرم داخلی */
.glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 80% at 80% -10%, rgba(255, 255, 255, .10), transparent 55%);
  pointer-events: none;
  z-index: 1;
}

.glass > * { position: relative; z-index: 3; }

/* ============================================================
   چیدمان
   ============================================================ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding: 28px 20px 80px; }
.stack { display: flex; flex-direction: column; gap: 22px; }

/* ---------- نوار بالا ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; margin-bottom: 26px; border-radius: var(--r-md); flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(140deg, rgb(var(--c1)), rgb(var(--c3)) 55%, rgb(var(--c2))); box-shadow: 0 8px 22px -8px rgb(var(--c1) / .9), inset 0 1px 0 rgba(255, 255, 255, .5); font-size: 19px; }
.brand-text { min-width: 0; }
.brand-title { font-size: 15px; font-weight: 700; white-space: nowrap; }
.brand-sub { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- دکمه‌ها ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border: 0; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  background: var(--glass-strong);
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--rim-hi), inset 0 0 0 1px var(--rim), 0 6px 18px -10px rgba(0, 0, 0, .7);
  transition: transform .3s var(--spring), box-shadow .3s var(--ease), background .3s var(--ease), opacity .2s;
  overflow: hidden;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .13); }
:root[data-theme='light'] .btn:hover { background: rgba(255, 255, 255, .8); }
.btn:active { transform: translateY(0) scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid rgb(var(--c2)); outline-offset: 3px; }

/* برق عبوری روی دکمه */
.btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); transform: translateX(-130%); transition: transform .75s var(--ease); }
.btn:hover::after { transform: translateX(130%); }

.btn-primary { background: linear-gradient(135deg, rgb(var(--c1)), rgb(var(--c3) / .92) 58%, rgb(var(--c2) / .9)); color: #fff; font-weight: 700; box-shadow: 0 14px 34px -14px rgb(var(--c1) / .95), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn-primary:hover { background: linear-gradient(135deg, rgb(var(--c1)), rgb(var(--c3)) 58%, rgb(var(--c2))); box-shadow: 0 20px 44px -14px rgb(var(--c1) / 1), inset 0 1px 0 rgba(255, 255, 255, .55); }
.btn-lg { padding: 15px 34px; font-size: 15.5px; }
.btn-sm { padding: 8px 15px; font-size: 12.5px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 16px; }
.btn-danger { color: #ff9aa8; }

/* ---------- نشان‌ها ---------- */
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--rim), inset 0 1px 0 var(--rim-hi); }
.badge-live { color: #7ef3c0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(126, 243, 192, .6); } 70% { box-shadow: 0 0 0 9px rgba(126, 243, 192, 0); } 100% { box-shadow: 0 0 0 0 rgba(126, 243, 192, 0); } }

/* ============================================================
   قهرمان صفحه
   ============================================================ */
.hero { padding: 40px 34px; text-align: center; overflow: hidden; }
.hero h1 { font-size: clamp(26px, 4.6vw, 42px); margin-bottom: 12px; }
.hero .grad { background: linear-gradient(120deg, rgb(var(--c2)), rgb(var(--c1)) 40%, rgb(var(--c3))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--ink-soft); font-size: clamp(13.5px, 1.9vw, 16px); max-width: 620px; margin-inline: auto; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 22px; }

/* ============================================================
   کارت گزینه‌ها
   ============================================================ */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-inline: 6px; margin-bottom: -4px; flex-wrap: wrap; }
.section-head h2 { font-size: 17px; }
.section-head span { font-size: 12.5px; color: var(--ink-faint); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; }

.opt {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: start;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  box-shadow: inset 0 0 0 1px var(--rim), inset 0 1px 0 var(--rim-hi), 0 10px 28px -18px rgba(0, 0, 0, .8);
  transition: transform .38s var(--spring), box-shadow .35s var(--ease), background .35s var(--ease);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  animation: rise .55s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.opt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(90% 60% at 85% 0%, rgba(255, 255, 255, .12), transparent 60%); pointer-events: none; }
.opt:hover { transform: translateY(-4px); background: var(--glass-strong); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), inset 0 1px 0 var(--rim-hi), 0 20px 40px -20px rgba(0, 0, 0, .9); }
.opt:active { transform: translateY(-1px) scale(.985); }
.opt:focus-visible { outline: 2px solid rgb(var(--c2)); outline-offset: 3px; }

.opt.on {
  background: linear-gradient(150deg, rgb(var(--c1) / .30), rgb(var(--c3) / .16) 55%, rgb(var(--c2) / .20));
  box-shadow: inset 0 0 0 1.5px rgb(var(--c1) / .75), inset 0 1px 0 rgba(255, 255, 255, .45), 0 18px 40px -18px rgb(var(--c1) / .85);
  transform: translateY(-3px);
}

.opt-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.opt-fa { font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.opt-en { font-size: 12.5px; color: var(--ink-faint); font-weight: 500; letter-spacing: .04em; direction: ltr; text-align: start; margin-top: 1px; }
.opt-domain { display: inline-flex; align-items: center; gap: 6px; margin-top: 13px; padding: 5px 11px; border-radius: 999px; font-size: 11.5px; direction: ltr; background: rgba(0, 0, 0, .26); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09); color: var(--ink-soft); font-family: 'Vazirmatn', ui-monospace, monospace; }
:root[data-theme='light'] .opt-domain { background: rgba(255, 255, 255, .6); }
.opt.on .opt-domain { background: rgba(0, 0, 0, .3); color: var(--ink); }

/* تیک انتخاب */
.tick { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--rim); background: rgba(255, 255, 255, .05); transition: all .35s var(--spring); }
.tick svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .35s var(--ease) .05s; }
.opt.on .tick { background: linear-gradient(140deg, rgb(var(--c1)), rgb(var(--c3))); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5), 0 4px 14px -4px rgb(var(--c1)); transform: scale(1.08); }
.opt.on .tick svg { stroke-dashoffset: 0; }

/* ---------- کارت صرف‌نظر ---------- */
.abstain { display: flex; align-items: center; gap: 14px; padding: 17px 20px; border-radius: var(--r-md); cursor: pointer; background: var(--glass); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); box-shadow: inset 0 0 0 1px var(--rim), inset 0 1px 0 var(--rim-hi); transition: all .35s var(--ease); -webkit-tap-highlight-color: transparent; }
.abstain:hover { background: var(--glass-strong); }
.abstain.on { background: linear-gradient(140deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04)); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4), inset 0 1px 0 var(--rim-hi); }
.abstain-txt strong { display: block; font-size: 14.5px; }
.abstain-txt span { font-size: 12.5px; color: var(--ink-faint); }

/* ============================================================
   فرم‌ها
   ============================================================ */
.field { display: block; }
.field-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; color: var(--ink-soft); }
.field-label .opt-tag { font-size: 11px; color: var(--ink-faint); font-weight: 400; }

.input, .textarea {
  width: 100%;
  padding: 13px 16px;
  border: 0; border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .24);
  color: var(--ink);
  font-size: 14px;
  box-shadow: inset 0 0 0 1px var(--rim), inset 0 2px 6px rgba(0, 0, 0, .22);
  transition: box-shadow .3s var(--ease), background .3s var(--ease);
  outline: none;
  resize: vertical;
}
:root[data-theme='light'] .input, :root[data-theme='light'] .textarea { background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 1px rgba(16, 18, 28, .1), inset 0 2px 5px rgba(16, 18, 28, .05); }
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input:focus, .textarea:focus { background: rgba(0, 0, 0, .32); box-shadow: inset 0 0 0 1.5px rgb(var(--c2) / .75), 0 0 0 4px rgb(var(--c2) / .12); }
:root[data-theme='light'] .input:focus, :root[data-theme='light'] .textarea:focus { background: rgba(255, 255, 255, .9); }
.textarea { min-height: 96px; line-height: 1.8; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- نوار ارسال ---------- */
.submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; border-radius: var(--r-md); }
.submit-info { font-size: 13px; color: var(--ink-soft); }
.submit-info b { color: var(--ink); font-weight: 700; }

/* ============================================================
   مودال
   ============================================================ */
.modal-bg { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(4, 4, 10, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); }
.modal-bg.open { opacity: 1; pointer-events: auto; }
.modal { width: min(520px, 100%); max-height: 90vh; overflow-y: auto; padding: 30px 28px; transform: translateY(22px) scale(.96); opacity: 0; transition: transform .45s var(--spring), opacity .35s var(--ease); }
.modal-bg.open .modal { transform: none; opacity: 1; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.modal-head h3 { font-size: 20px; }
.modal-head p { font-size: 13px; color: var(--ink-faint); margin-top: 4px; }

/* ============================================================
   نتایج زنده
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 13px; }
.stat { padding: 20px 20px 18px; border-radius: var(--r-md); }
.stat-val { font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; background: linear-gradient(120deg, var(--ink), var(--ink-soft)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-lbl { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.stat.accent .stat-val { background: linear-gradient(120deg, rgb(var(--c2)), rgb(var(--c1))); -webkit-background-clip: text; background-clip: text; }

.board { padding: 26px 24px; border-radius: var(--r-lg); }
.rows { display: flex; flex-direction: column; gap: 11px; }

.row { position: relative; padding: 13px 16px; border-radius: var(--r-sm); overflow: hidden; background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); transition: transform .6s var(--ease), box-shadow .4s; }
:root[data-theme='light'] .row { background: rgba(255, 255, 255, .35); box-shadow: inset 0 0 0 1px rgba(16, 18, 28, .07); }
.row.top { box-shadow: inset 0 0 0 1.5px rgb(var(--c1) / .5); }

/* نوار پرشونده پشت متن */
.row-fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, rgb(var(--c1) / .42), rgb(var(--c3) / .28) 60%, rgb(var(--c2) / .34)); transition: width 1s var(--ease); }
.row.r1 .row-fill { background: linear-gradient(90deg, rgb(var(--c4) / .48), rgb(var(--c3) / .34) 70%, rgb(var(--c1) / .38)); }
.row-fill::after { content: ''; position: absolute; inset-block: 0; inset-inline-end: 0; width: 60px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22)); }

.row-body { position: relative; display: flex; align-items: center; gap: 13px; }
.rank { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.row.r1 .rank { background: linear-gradient(140deg, rgb(var(--c4)), #f59e0b); color: #2b1a00; box-shadow: 0 4px 14px -4px rgb(var(--c4) / .9); }
.row.r2 .rank { background: linear-gradient(140deg, #e2e8f0, #94a3b8); color: #1f2937; }
.row.r3 .rank { background: linear-gradient(140deg, #d8a077, #b45309); color: #2b1600; }

.row-name { flex: 1; min-width: 0; }
.row-name b { font-size: 15px; font-weight: 700; }
.row-name small { display: block; font-size: 11.5px; color: var(--ink-faint); direction: ltr; text-align: start; }
.row-num { flex: none; text-align: center; }
.row-pct { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.row-votes { font-size: 11px; color: var(--ink-faint); }

/* ---------- فید فعالیت ---------- */
.feed { display: flex; flex-direction: column; gap: 9px; max-height: 320px; overflow-y: auto; padding-inline-end: 4px; }
.feed-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); animation: slideIn .45s var(--ease) both; }
:root[data-theme='light'] .feed-item { background: rgba(255, 255, 255, .4); box-shadow: inset 0 0 0 1px rgba(16, 18, 28, .06); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.feed-icon { flex: none; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; background: rgba(255, 255, 255, .08); }
.feed-txt { flex: 1; min-width: 0; }
.feed-time { font-size: 11px; color: var(--ink-faint); }

/* ============================================================
   پنل مدیریت
   ============================================================ */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); padding: 38px 32px; text-align: center; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card p { font-size: 13px; color: var(--ink-faint); margin-bottom: 24px; }
.pin { text-align: center; font-size: 24px; letter-spacing: .5em; padding-inline-start: .5em; font-weight: 700; }

.tabs { display: flex; gap: 6px; padding: 6px; border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 9px 18px; border: 0; border-radius: 999px; background: transparent; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); cursor: pointer; transition: all .3s var(--ease); white-space: nowrap; }
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.tab.on { color: #fff; background: linear-gradient(135deg, rgb(var(--c1)), rgb(var(--c3) / .9)); box-shadow: 0 8px 20px -10px rgb(var(--c1)); }

.panel { display: none; }
.panel.on { display: block; animation: fade .4s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th { text-align: start; font-weight: 500; font-size: 12px; color: var(--ink-faint); padding: 12px 14px; border-bottom: 1px solid var(--rim); position: sticky; top: 0; backdrop-filter: blur(10px); }
td { padding: 13px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: top; }
:root[data-theme='light'] td { border-bottom-color: rgba(16, 18, 28, .07); }
tbody tr { transition: background .25s; }
tbody tr:hover { background: rgba(255, 255, 255, .045); }
td.wrap-cell { white-space: normal; min-width: 220px; max-width: 380px; }

.chip { display: inline-block; padding: 3px 10px; margin: 2px 2px 2px 0; border-radius: 999px; font-size: 11.5px; background: rgb(var(--c1) / .22); box-shadow: inset 0 0 0 1px rgb(var(--c1) / .4); }
.chip.gray { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px var(--rim); color: var(--ink-faint); }
.chip.ok { background: rgba(52, 211, 153, .18); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .4); color: #6ee7b7; }
.chip.warn { background: rgba(251, 191, 36, .16); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .38); color: #fcd34d; }

.mono { font-size: 11.5px; direction: ltr; text-align: start; color: var(--ink-faint); font-family: ui-monospace, 'Cascadia Code', monospace; }

.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 13px; }
.mini { padding: 17px 18px; border-radius: var(--r-md); background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--rim); }
:root[data-theme='light'] .mini { background: rgba(255, 255, 255, .45); }
.mini-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mini h4 { font-size: 16px; }
.mini .mono { margin-top: 2px; }
.mini p { font-size: 13px; color: var(--ink-soft); line-height: 1.8; margin-top: 8px; white-space: pre-wrap; word-break: break-word; }

.empty { padding: 48px 20px; text-align: center; color: var(--ink-faint); font-size: 14px; }
.empty-icon { font-size: 40px; opacity: .35; display: block; margin-bottom: 10px; }

/* ============================================================
   نان تُست
   ============================================================ */
.toasts { position: fixed; z-index: 200; bottom: 22px; inset-inline-start: 22px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 19px; border-radius: 999px; font-size: 13.5px; font-weight: 500; background: rgba(20, 20, 32, .82); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 16px 36px -14px rgba(0, 0, 0, .9); color: #fff; animation: toastIn .45s var(--spring) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .3s var(--ease) both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.96); } }
.toast.err { color: #ffb4be; }
.toast.ok { color: #86efac; }

/* ---------- ریز ---------- */
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .28); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.identity { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-radius: var(--r-md); font-size: 12.5px; color: var(--ink-faint); background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
:root[data-theme='light'] .identity { background: rgba(255, 255, 255, .4); box-shadow: inset 0 0 0 1px rgba(16, 18, 28, .06); }
.identity b { color: var(--ink-soft); font-weight: 500; }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--rim), transparent); margin: 4px 0; }

@media (max-width: 640px) {
  .wrap { padding: 18px 14px 64px; }
  .hero { padding: 30px 20px; }
  .grid { grid-template-columns: 1fr; }
  .submit-bar { flex-direction: column; align-items: stretch; }
  .submit-bar .btn { width: 100%; }
  .toasts { inset-inline: 14px; bottom: 14px; }
  .brand-sub { display: none; }
}

/* اولین رندر: نوارها از صفر رشد می‌کنند.
   عرض واقعی همیشه inline است، پس اگر تایمر دیر اجرا شود باز هم نتیجه درست می‌ماند. */
.rows.boot .row-fill { width: 0 !important; }

/* ============================================================
   تم روشن — بازتعریف هرچه پس‌زمینهٔ تیره را فرض گرفته بود.
   (روکش‌های سفیدِ کم‌شفاف و چیپ‌های تیره روی زمینهٔ روشن دیده نمی‌شوند)
   ============================================================ */
:root[data-theme='light'] {
  --ok: #047857;
  --warn: #92620a;
  --danger: #c31d3c;
}

/* دانه‌بندی روی زمینهٔ روشن نباید کثیف به نظر برسد */
:root[data-theme='light'] .grain { opacity: .09; }

/* شیشه روی زمینهٔ روشن به یک حلقهٔ بیرونی ظریف نیاز دارد تا لبه‌اش گم نشود */
:root[data-theme='light'] .glass { box-shadow: var(--shadow), inset 0 1px 0 var(--rim-hi), 0 0 0 1px rgba(16, 18, 28, .05); }
:root[data-theme='light'] .glass::after { background: radial-gradient(120% 80% at 80% -10%, rgba(255, 255, 255, .55), transparent 58%); }

:root[data-theme='light'] ::-webkit-scrollbar-thumb { background: rgba(16, 18, 28, .18); background-clip: content-box; }
:root[data-theme='light'] ::-webkit-scrollbar-thumb:hover { background: rgba(16, 18, 28, .3); background-clip: content-box; }
:root[data-theme='light'] ::selection { background: rgb(var(--c1) / .25); }

/* دکمه‌ها و نشان‌ها */
:root[data-theme='light'] .btn { box-shadow: inset 0 1px 0 var(--rim-hi), 0 0 0 1px rgba(16, 18, 28, .08), 0 6px 16px -10px rgba(40, 50, 90, .5); }
:root[data-theme='light'] .btn::after { background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%); }
:root[data-theme='light'] .btn-primary { box-shadow: 0 14px 30px -14px rgb(var(--c1) / .8), inset 0 1px 0 rgba(255, 255, 255, .5); }
:root[data-theme='light'] .btn-danger { color: var(--danger); }
:root[data-theme='light'] .badge { box-shadow: inset 0 1px 0 var(--rim-hi), 0 0 0 1px rgba(16, 18, 28, .07); }
:root[data-theme='light'] .badge-live { color: var(--ok); }

/* عنوان گرادیانی: فیروزه‌ای روشن روی سفید خوانا نیست */
:root[data-theme='light'] .hero .grad { background: linear-gradient(120deg, #0e9bb5, #5b46d9 42%, #c9268a); -webkit-background-clip: text; background-clip: text; }

/* کارت گزینه‌ها */
:root[data-theme='light'] .opt { box-shadow: 0 0 0 1px rgba(16, 18, 28, .07), inset 0 1px 0 var(--rim-hi), 0 8px 20px -16px rgba(40, 50, 90, .7); }
:root[data-theme='light'] .opt:hover { box-shadow: 0 0 0 1px rgba(16, 18, 28, .13), inset 0 1px 0 var(--rim-hi), 0 16px 30px -18px rgba(40, 50, 90, .8); }
:root[data-theme='light'] .opt::after { background: radial-gradient(90% 60% at 85% 0%, rgba(255, 255, 255, .6), transparent 60%); }
:root[data-theme='light'] .opt.on {
  background: linear-gradient(150deg, rgb(var(--c1) / .20), rgb(var(--c3) / .12) 55%, rgb(var(--c2) / .16));
  box-shadow: 0 0 0 1.5px rgb(var(--c1) / .65), inset 0 1px 0 rgba(255, 255, 255, .7), 0 16px 32px -18px rgb(var(--c1) / .75);
}
/* چیپ دامنه در حالت انتخاب‌شده تیره بود و متنِ تیره رویش خوانده نمی‌شد */
:root[data-theme='light'] .opt.on .opt-domain { background: rgba(255, 255, 255, .8); color: var(--ink); }

/* تیک انتخاب در حالت خاموش */
:root[data-theme='light'] .tick { box-shadow: inset 0 0 0 1.5px rgba(16, 18, 28, .2); background: rgba(255, 255, 255, .6); }

/* کارت صرف‌نظر */
:root[data-theme='light'] .abstain { box-shadow: 0 0 0 1px rgba(16, 18, 28, .07), inset 0 1px 0 var(--rim-hi); }
:root[data-theme='light'] .abstain.on {
  background: linear-gradient(140deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .5));
  box-shadow: 0 0 0 1.5px rgba(16, 18, 28, .34), inset 0 1px 0 var(--rim-hi);
}

/* رده‌بندی */
:root[data-theme='light'] .rank { background: rgba(16, 18, 28, .07); box-shadow: inset 0 0 0 1px rgba(16, 18, 28, .07); }
:root[data-theme='light'] .row.top { box-shadow: inset 0 0 0 1.5px rgb(var(--c1) / .4); }
:root[data-theme='light'] .row-fill { background: linear-gradient(90deg, rgb(var(--c1) / .55), rgb(var(--c3) / .38) 60%, rgb(var(--c2) / .45)); }
:root[data-theme='light'] .row.r1 .row-fill { background: linear-gradient(90deg, rgb(var(--c4) / .75), rgb(var(--c3) / .45) 70%, rgb(var(--c1) / .48)); }
:root[data-theme='light'] .row-fill::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5)); }

/* فید فعالیت */
:root[data-theme='light'] .feed-icon { background: rgba(16, 18, 28, .06); }

/* پنل مدیریت */
:root[data-theme='light'] .tab:hover { background: rgba(16, 18, 28, .05); }
:root[data-theme='light'] th { border-bottom-color: rgba(16, 18, 28, .12); }
:root[data-theme='light'] tbody tr:hover { background: rgba(16, 18, 28, .035); }
:root[data-theme='light'] .mini { box-shadow: 0 0 0 1px rgba(16, 18, 28, .07); }
:root[data-theme='light'] .chip { background: rgb(var(--c1) / .13); box-shadow: inset 0 0 0 1px rgb(var(--c1) / .3); color: #3f2fae; }
:root[data-theme='light'] .chip.gray { background: rgba(16, 18, 28, .05); box-shadow: inset 0 0 0 1px rgba(16, 18, 28, .1); color: var(--ink-faint); }
:root[data-theme='light'] .chip.ok { background: rgba(4, 120, 87, .12); box-shadow: inset 0 0 0 1px rgba(4, 120, 87, .3); color: var(--ok); }
:root[data-theme='light'] .chip.warn { background: rgba(146, 98, 10, .12); box-shadow: inset 0 0 0 1px rgba(146, 98, 10, .3); color: var(--warn); }

:root[data-theme='light'] .divider { background: linear-gradient(90deg, transparent, rgba(16, 18, 28, .12), transparent); }

/* نقطهٔ «زنده» روی دکمهٔ شیشه‌ای — نعناییِ روشن روی سفید کنتراست ندارد */
.live-dot { color: #7ef3c0; }
:root[data-theme='light'] .live-dot { color: #047857; }

/* بازگرداندن رنگ مدال‌ها در تم روشن — قانون عمومیِ .rank بالاتر
   هم‌وزن بود و چون بعدتر می‌آمد، طلا/نقره/برنز را خنثی می‌کرد. */
:root[data-theme='light'] .row.r1 .rank { background: linear-gradient(140deg, rgb(var(--c4)), #f59e0b); color: #2b1a00; box-shadow: 0 4px 14px -4px rgb(var(--c4) / .9); }
:root[data-theme='light'] .row.r2 .rank { background: linear-gradient(140deg, #e2e8f0, #94a3b8); color: #1f2937; box-shadow: 0 4px 12px -5px rgba(100, 116, 139, .8); }
:root[data-theme='light'] .row.r3 .rank { background: linear-gradient(140deg, #d8a077, #b45309); color: #2b1600; box-shadow: 0 4px 12px -5px rgba(180, 83, 9, .7); }
