/* شعرانه — کاغذ سفید، مرکب، و یک خط لاجوردی.
   سادگی شاعرانه: فضای خالی زیاد، خط‌های نازک، یک رنگ تأکید. */

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/Vazirmatn-Variable.woff2") format("woff2-variations"),
         url("../fonts/vazirmatn/Vazirmatn-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

/* پرستو: قلم فارسیِ کتابی برای شعر و عنوان‌ها */
@font-face {
    font-family: "Parastoo";
    src: url("../fonts/parastoo/Parastoo.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Parastoo";
    src: url("../fonts/parastoo/Parastoo-Bold.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

:root {
    /* سطح‌ها */
    --bg: #f7f7f5;
    --surface: #ffffff;
    --surface-2: #f1f2f0;
    --line: #e6e7e3;
    --line-strong: #d5d7d2;

    /* مرکب */
    --ink: #17191f;
    --ink-2: #4a4e57;
    --ink-3: #8a8e96;

    /* لاجوردی: تنها رنگ تأکید */
    --accent: #2f45b5;
    --accent-hover: #24379a;
    --accent-ink: #ffffff;
    --accent-soft: #eef0fb;
    --accent-line: #c9cff0;

    /* زنده بودن / صحبت کردن: فیروزه‌ای */
    --live: #0f9b8e;
    --live-soft: #e3f5f2;

    --danger: #c0392b;
    --danger-soft: #fbeceb;
    --ok: #1f8a5b;
    --ok-soft: #e6f4ec;

    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
    --shadow-sm: 0 1px 2px rgb(23 25 31 / 0.04);
    --shadow: 0 1px 2px rgb(23 25 31 / 0.04), 0 8px 24px -12px rgb(23 25 31 / 0.12);
    --shadow-lg: 0 24px 60px -24px rgb(23 25 31 / 0.25);

    /* متن روی زمینه‌های پررنگ */
    --on-ink: #ffffff;
    --on-live: #ffffff;
    --on-danger: #ffffff;
    --backdrop: rgb(23 25 31 / .28);

    /* پسند */
    --like: #d9415a;
    --like-soft: #fdeef1;
    --like-line: #f2c2cb;
    --header-h: 72px;

    --font-ui: "Vazirmatn", Tahoma, sans-serif;
    --font-verse: "Parastoo", "Vazirmatn", serif;

    color-scheme: light;
}

/* ------------------------------------------------------------------ تم تاریک
   شب و مرکب؛ همان یک رنگ تأکید لاجوردی، روشن‌تر برای خوانایی روی زمینه تیره.
   بدون data-theme: مثل سیستم. data-theme="light" یا "dark": انتخاب کاربر.
   دو بلوک زیر عمداً یکسان‌اند (CSS راهی برای اشتراک بدون پیش‌پردازنده ندارد). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1115;
        --surface: #171a21;
        --surface-2: #1e222b;
        --line: #2a2e37;
        --line-strong: #3a3f4b;
        --ink: #e8e9ec;
        --ink-2: #b9bdc6;
        --ink-3: #8b919c;
        --accent: #7d8cf2;
        --accent-hover: #98a4f6;
        --accent-ink: #0f1115;
        --accent-soft: #1d2240;
        --accent-line: #343d75;
        --live: #2cc3b3;
        --live-soft: #12302d;
        --danger: #ef6b5e;
        --danger-soft: #3a1c1a;
        --ok: #4cc18a;
        --ok-soft: #14301f;
        --on-ink: #0f1115;
        --on-live: #08221f;
        --on-danger: #1a0b09;
        --backdrop: rgb(0 0 0 / .55);
        --like: #f07088;
        --like-soft: #3a1a22;
        --like-line: #6b2c3a;
        --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
        --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .5);
        --shadow-lg: 0 24px 60px -24px rgb(0 0 0 / .7);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1e222b;
    --line: #2a2e37;
    --line-strong: #3a3f4b;
    --ink: #e8e9ec;
    --ink-2: #b9bdc6;
    --ink-3: #8b919c;
    --accent: #7d8cf2;
    --accent-hover: #98a4f6;
    --accent-ink: #0f1115;
    --accent-soft: #1d2240;
    --accent-line: #343d75;
    --live: #2cc3b3;
    --live-soft: #12302d;
    --danger: #ef6b5e;
    --danger-soft: #3a1c1a;
    --ok: #4cc18a;
    --ok-soft: #14301f;
    --on-ink: #0f1115;
    --on-live: #08221f;
    --on-danger: #1a0b09;
    --backdrop: rgb(0 0 0 / .55);
    --like: #f07088;
    --like-soft: #3a1a22;
    --like-line: #6b2c3a;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .5);
    --shadow-lg: 0 24px 60px -24px rgb(0 0 0 / .7);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); color: var(--accent-hover); }

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.45; margin: 0 0 .6rem; letter-spacing: -0.005em; }
h1 { font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2rem); font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .8rem; }
small, .muted { color: var(--ink-3); }
img { max-width: 100%; }
code { font-size: .9em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1:focus, h1:focus-visible, [tabindex="-1"]:focus { outline: none; }

/* ---------------------------------------------------------------- header */
.site-header {
    position: sticky; top: 0; z-index: 20;
    height: var(--header-h);
    display: flex; align-items: center;
    padding: 0 1rem;
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.site-header-inner {
    width: 100%; max-width: 1120px; margin: 0 auto;
    display: flex; align-items: center; gap: 1.25rem;
}
.brand {
    display: inline-flex; align-items: baseline; gap: .35rem;
    font-family: var(--font-verse); font-weight: 700; font-size: 1.7rem; line-height: 1;
    color: var(--ink); letter-spacing: 0;
}
.brand:hover { color: var(--ink); }
.brand-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; transform: translateY(-2px); }

.site-nav {
    display: flex; gap: .15rem; flex: 1; overflow-x: auto; scrollbar-width: none;
    padding: .25rem; border-radius: 999px;
}
.site-nav a {
    color: var(--ink-2); padding: .35rem .9rem; border-radius: 999px; white-space: nowrap; font-weight: 500; font-size: .95rem;
    transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.user-menu { display: flex; align-items: center; gap: .5rem; }
.user-menu form { margin: 0; }

/* ------------------------------------------------------------------ page */
.page { max-width: 1120px; margin: 0 auto; padding: 2rem 1rem 5rem; }
.page.narrow { max-width: 480px; padding-top: 3rem; }
.page.medium { max-width: 800px; }
.page.medium:has(> .poem) { max-width: 960px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
}
.card + .card, .stack > * + * { margin-top: 1rem; }
.grid > .card + .card { margin-top: 0; }
.page.narrow > .card { padding: 2rem; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 3rem 0 1rem; }
.section-title h2 { margin: 0; font-size: 1.35rem; }
.section-title a { font-size: .92rem; color: var(--ink-2); white-space: nowrap; flex: none; }
.section-title { gap: 1rem; }
.section-title a:hover { color: var(--accent); }
.empty { text-align: center; color: var(--ink-3); padding: 2.5rem 1rem; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font: inherit; font-weight: 600; font-size: .93rem; line-height: 1.4;
    padding: .55rem 1.1rem; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); background: var(--surface); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.small { padding: .3rem .8rem; font-size: .85rem; }
.btn.round { width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 1.1rem; flex: none; }
.btn.on { background: var(--live); border-color: var(--live); color: var(--on-live); }
.btn.on:hover { background: var(--live); color: var(--on-live); filter: brightness(1.05); }
.btn.recording { background: var(--danger); border-color: var(--danger); color: var(--on-danger); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--danger) 18%, transparent); } }

/* ------------------------------------------------------------------ forms */
.form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.field .hint { font-size: .82rem; color: var(--ink-3); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
    font: inherit; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    padding: .6rem .9rem; width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 120px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
input[type=file] { font: inherit; font-size: .9rem; color: var(--ink-2); }
input[type=file]::file-selector-button {
    font: inherit; font-weight: 600; margin-inline-end: .75rem; padding: .4rem .9rem;
    border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer;
}
input[type=checkbox] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.ltr { direction: ltr; text-align: left; }
.check { display: flex; align-items: center; gap: .55rem; color: var(--ink-2); }

/* سوییچ روشن/خاموش */
.switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; position: relative; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch-track {
    width: 38px; height: 22px; border-radius: 999px; flex: none; position: relative;
    background: var(--ink-3); transition: background .18s;
}
.switch-track::after {
    content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
    width: 16px; height: 16px; border-radius: 50%; background: var(--surface);
    box-shadow: var(--shadow-sm); transition: inset-inline-start .18s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { inset-inline-start: 19px; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }
.switch-text { font-size: .88rem; color: var(--ink-2); min-width: 3.5rem; }
.validation-message, .field-error { color: var(--danger); font-size: .85rem; }
.validation-errors { color: var(--danger); margin: 0; padding-inline-start: 1.2rem; }

.alert { border-radius: var(--radius-sm); padding: .75rem 1rem; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.alert.error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.alert.success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }

/* ----------------------------------------------------------------- avatar */
.avatar {
    width: var(--size, 40px); height: var(--size, 40px); border-radius: 50%;
    object-fit: cover; flex: none;
    display: inline-grid; place-items: center;
    background: var(--accent-soft); color: var(--accent);
    font-family: var(--font-verse); font-weight: 700; font-size: calc(var(--size, 40px) * .44); line-height: 1;
    box-shadow: 0 0 0 2px var(--surface);
}
.user-chip { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); }
.user-chip:hover { color: var(--accent); }
.user-chip .name { font-weight: 600; }

/* ----------------------------------------------------------------- badges */
.badge {
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: .74rem; font-weight: 600; padding: .1rem .6rem; border-radius: 999px;
    background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; line-height: 1.7;
}
a.badge:hover { background: var(--accent-soft); color: var(--accent); }
.badge.manager { background: var(--ink); color: var(--on-ink); }
.badge.deputy { background: var(--accent-soft); color: var(--accent); }
.badge.gold { background: var(--accent-soft); color: var(--accent); }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }

/* ------------------------------------------------------------------ hero */
.hero {
    position: relative; overflow: hidden;
    max-width: 1120px; margin: 1.5rem auto 0; padding: 5rem 1.5rem 4.5rem;
    text-align: center;
}
.hero::before {
    content: ""; position: absolute; inset: -40% 10% auto; height: 120%; z-index: -1;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
    pointer-events: none;
}
.hero-verse {
    font-family: var(--font-verse); font-weight: 400;
    font-size: clamp(1.6rem, 1rem + 2.4vw, 2.8rem); line-height: 1.9; color: var(--ink);
    margin: 0 auto .6rem;
}
.hero-verse span { display: block; white-space: nowrap; }
/* گوشی: هر مصراع در یک خط؛ اندازه با پهنای صفحه کوچک می‌شود (در کوچک‌ترین گوشی‌ها هم جا شود). */
@media (max-width: 719px) {
    .hero-verse { font-size: clamp(1rem, 5.4vw, 1.65rem); line-height: 2; }
}
.hero-verse-placeholder { height: 8rem; }
.hero-poet { color: var(--ink-3); font-size: .9rem; margin-bottom: 2.2rem; }
.hero-poet::before { content: ""; display: inline-block; width: 28px; height: 1px; background: var(--line-strong); vertical-align: middle; margin-inline-end: .6rem; }
.hero p.lead { color: var(--ink-2); max-width: 36rem; margin: 0 auto 1.6rem; font-size: 1.05rem; }

/* معرفی کوتاه زیر بیت: باکس نقل‌قول (سایت و ویندوز) */
.hero-quote {
    position: relative; max-width: 34rem; margin: 0 auto 1.8rem; padding: 1.25rem 1.6rem 1.2rem;
    border-radius: var(--radius-lg, 22px); border: 1px solid var(--accent-line);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
        color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    box-shadow: var(--shadow-sm);
}
/* نوار لاجوردی کنار باکس (سمت شروع خط در راست‌چین) */
.hero-quote::before {
    content: ""; position: absolute; inset-block: 1rem; inset-inline-start: 0;
    width: 3px; border-radius: 3px; background: var(--accent);
}
.hero-quote-mark {
    position: absolute; inset-block-start: -.85rem; inset-inline-start: 1.3rem;
    width: 30px; height: 24px; padding: 0 .35rem; box-sizing: content-box;
    fill: var(--accent); background: var(--bg); border-radius: 6px;
}
.hero-quote blockquote {
    margin: 0; font-size: .9rem; line-height: 2.05; color: var(--ink-2); text-align: center;
}
.hero-quote blockquote strong { font-family: var(--font-verse); font-size: 1.08rem; color: var(--ink); font-weight: 700; }

/* ----------------------------------------------------------------- poems */
/* فهرست انجمن‌ها (/anjomans): ردیف‌های افقی فشرده؛ پهن = دو ستون */
.anjoman-rows { display: grid; gap: .7rem; grid-template-columns: 1fr; margin-top: 1rem; }
@media (min-width: 900px) { .anjoman-rows { grid-template-columns: 1fr 1fr; } }
.anjoman-row {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: .9rem; min-height: 84px; padding: .8rem 1rem;
    border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink); text-decoration: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.anjoman-row[hidden] { display: none; }
.anjoman-row:hover { color: var(--ink); border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.anjoman-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.anjoman-row-mark {
    position: relative; flex: none; width: 52px; height: 52px; border-radius: 14px;
    display: grid; place-items: center;
    font-family: var(--font-verse); font-size: 1.55rem; font-weight: 700; color: var(--accent);
    background: var(--accent-soft) center / cover no-repeat;
}
.anjoman-row-dot {
    position: absolute; inset-block-start: -3px; inset-inline-end: -3px; width: 13px; height: 13px; border-radius: 50%;
    background: var(--live); box-shadow: 0 0 0 3px var(--surface);
}
.anjoman-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.anjoman-row-title { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.anjoman-row-name {
    font-family: var(--font-verse); font-size: 1.15rem; font-weight: 700; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.anjoman-row-title .badge { flex: none; font-size: .7rem; }
.anjoman-row-desc { font-size: .84rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anjoman-row-cap { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anjoman-row-chev { display: none; flex: none; color: var(--ink-3); }
.anjoman-row-chev .ico { width: 18px; height: 18px; }
/* گوشی: کل ردیف لمسی است؛ به‌جای دکمه یک فلش کوچک تا نام و توضیح جا شوند */
@media (max-width: 640px) {
    .anjoman-row { gap: .75rem; padding: .7rem .8rem; min-height: 74px; }
    .anjoman-row-mark { width: 46px; height: 46px; font-size: 1.35rem; border-radius: 12px; }
    .anjoman-row > .btn { display: none; }
    .anjoman-row-chev { display: inline-flex; }
}
.anjoman-row.is-live .anjoman-row-cap { color: var(--live); }
.anjoman-row > .btn { flex: none; pointer-events: none; }
.anjoman-row-bar { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--surface-2); }
.anjoman-row-bar > span { display: block; height: 100%; background: var(--live); border-radius: 0 3px 3px 0; }
.anjoman-row.is-full .anjoman-row-bar > span { background: var(--danger); }

.list-filter {
    display: flex; align-items: center; gap: .5rem; max-width: 420px; margin-top: 1rem;
    padding: .1rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.list-filter .ico { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.list-filter input { border: 0; background: none; box-shadow: none; padding: .55rem 0; width: 100%; color: var(--ink); font: inherit; }
.list-filter input:focus { outline: none; }
.list-filter:focus-within { border-color: var(--accent); }
.list-filter-empty { margin-top: 1rem; }

/* تازه‌ترین اشعار صفحه اول: کارت «بیت‌محور»؛ گوشی = ردیف افقی ورق‌خور، بزرگ‌تر = شبکه */
.poem-shelf {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.poem-tile {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: .55rem;
    min-height: 260px; padding: 2.1rem 1.4rem 1.2rem;
    border-radius: var(--radius-lg, 22px); border: 1px solid var(--line);
    background:
        radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
        var(--surface);
    color: var(--ink); text-decoration: none;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.poem-tile:hover { color: var(--ink); transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.poem-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.poem-tile-quote {
    position: absolute; z-index: -1; inset-block-start: 1rem; inset-inline-start: 1.1rem;
    width: 46px; height: 36px; fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: none;
}
.poem-tile-form {
    font-size: .72rem; font-weight: 600; letter-spacing: .02em; color: var(--accent);
    padding: .15rem .65rem; border-radius: 999px; background: var(--accent-soft);
}
.poem-tile-verse {
    margin: auto 0; font-family: var(--font-verse); font-size: 1.32rem; line-height: 2; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.poem-tile-rule { width: 38px; height: 2px; border-radius: 2px; background: var(--accent); opacity: .55; }
.poem-tile-title { font-weight: 700; font-size: .98rem; color: var(--ink); }
.poem-tile-foot {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding-top: .7rem; margin-top: .2rem; border-top: 1px solid var(--line);
    font-size: .8rem; color: var(--ink-2);
}
.poem-tile-poet { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poem-tile-meta { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink-3); white-space: nowrap; }
.poem-tile-meta > span { display: inline-flex; align-items: center; gap: .2rem; }
.poem-tile-meta .ico { width: 14px; height: 14px; }
@media (max-width: 640px) {
    .poem-shelf {
        grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%;
        overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
        margin-inline: -.9rem; padding: .25rem .9rem 1rem; scroll-padding-inline: .9rem;
    }
    .poem-shelf::-webkit-scrollbar { display: none; }
    .poem-tile { scroll-snap-align: start; min-height: 240px; }
}

.poem-card-head { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.poem-card-head h3 { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poem-card-head .badge { flex: none; }

.poem-card { display: flex; flex-direction: column; gap: .5rem; transition: border-color .2s, box-shadow .2s, transform .2s; }
.poem-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.poem-card h3 { margin: 0; font-family: var(--font-verse); font-size: 1.25rem; font-weight: 700; }
.poem-card h3 a { color: var(--ink); }
.poem-card h3 a:hover { color: var(--accent); }
.poem-card .first-line {
    font-family: var(--font-verse); color: var(--ink-2); font-size: 1.05rem; line-height: 2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.poem {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 4vw, 3rem); text-align: center; box-shadow: var(--shadow-sm);
}
.poem-title { font-family: var(--font-verse); font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); font-weight: 700; margin-bottom: .3rem; }
.poem-meta { color: var(--ink-3); margin-bottom: 2.2rem; }
.beyts { display: grid; gap: .5rem; font-family: var(--font-verse); font-size: clamp(1.15rem, 1rem + .5vw, 1.35rem); line-height: 2.4; }
.beyt { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; text-wrap: balance; }
.beyt .m1 { text-align: left; }
.beyt .m2 { text-align: right; }
.beyt.single { grid-template-columns: 1fr; }
.beyt.single .m1 { text-align: center; }
.free-verse {
    white-space: pre-wrap; font-family: var(--font-verse); font-size: clamp(1.12rem, 1rem + .4vw, 1.3rem);
    line-height: 2.3; max-width: 32rem; margin: 0 auto; text-align: right;
}
@media (max-width: 640px) {
    .beyt { grid-template-columns: 1fr; gap: 0; }
    .beyt .m1, .beyt .m2 { text-align: center; }
    .beyt + .beyt { margin-top: .8rem; }
}
/* جداکننده: یک خط نازک با نقطه لاجوردی وسطش */
.ornament { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: 2.4rem auto 0; max-width: 220px; }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.ornament span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ----------------------------------------------------------- recitations */
.recitation { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.recitation strong { font-family: var(--font-verse); font-size: 1.1rem; }
.recitation audio, audio.player { width: 100%; max-width: 380px; height: 40px; }

/* --------------------------------------------------------------- anjomans */
.anjoman-card { display: flex; flex-direction: column; gap: .7rem; position: relative; overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s; }
.anjoman-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.anjoman-card h3 { margin: 0; font-family: var(--font-verse); font-size: 1.3rem; }
.anjoman-card h3 a { color: var(--ink); }
.anjoman-card h3 a:hover { color: var(--accent); }
.anjoman-card p.muted { font-size: .92rem; line-height: 1.8; }
.anjoman-card-actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.anjoman-card-actions .btn { justify-content: center; padding-inline: .6rem; white-space: nowrap; }
.anjoman-card-actions .btn .ico { width: 17px; height: 17px; }
.anjoman-card-actions [aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.anjoman-cover {
    height: 104px; margin: -1.4rem -1.4rem .2rem;
    background:
        radial-gradient(120% 140% at 85% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
        linear-gradient(180deg, var(--accent-soft), var(--surface));
    display: grid; place-items: center;
    color: var(--accent); font-family: var(--font-verse); font-size: 1.9rem; font-weight: 700;
    background-size: cover; background-position: center;
    border-bottom: 1px solid var(--line);
}
.capacity { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .55rem; font-size: .85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.capacity .live-dot { margin-inline-end: .3rem; }
.capacity-bar { flex: 1 1 100%; height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.capacity-bar > span { display: block; height: 100%; background: var(--live); border-radius: inherit; transition: width .4s; }
.capacity-bar.full > span { background: var(--danger); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; box-shadow: 0 0 0 4px var(--live-soft); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px transparent; } }

/* ------------------------------------------------------------------ room */
.room {
    height: calc(100dvh - var(--header-h) - 1rem);
    display: flex; flex-direction: column;
    max-width: 1040px; margin: 0 auto .5rem;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow);
}
.room { width: 100%; min-width: 0; }
/* نوار بالای روم: همیشه یک خط باریک؛ نام طولانی با «…» کوتاه می‌شود */
.room-head {
    display: flex; align-items: center; gap: .5rem; min-height: 54px; padding: .4rem .6rem .4rem 1rem;
    border-bottom: 1px solid var(--line); flex: none; min-width: 0;
}
.room-head h1 {
    flex: 1; min-width: 0; margin: 0;
    font-family: var(--font-verse); font-size: 1.2rem; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.room-count {
    flex: none; display: inline-flex; align-items: center; gap: .3rem; height: 30px; padding: 0 .65rem;
    border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
    font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.room-count .ico { width: 16px; height: 16px; }
.room-count .room-cap { color: var(--ink-3); font-weight: 500; }
.room-head .countdown { flex: none; display: inline-flex; align-items: center; gap: .25rem; font-size: .82rem; white-space: nowrap; }
.room-head .countdown .ico { width: 15px; height: 15px; }
/* دکمه‌های گرد آیکونی (ابزار، خروج) */
.room-act {
    flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    height: 38px; min-width: 38px; padding: 0 .55rem; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
    font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.room-act:hover { background: var(--surface-2); color: var(--ink); }
.room-act .ico { width: 19px; height: 19px; }
.room-exit { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); padding-inline: .8rem; }
.room-exit:hover { background: var(--danger-soft); color: var(--danger); }

/* صندلی‌ها: یک ردیف افقی که با انگشت/چرخ موس اسکرول می‌شود */
.seats {
    display: flex; flex-wrap: nowrap; gap: .9rem; padding: .8rem 1rem .6rem;
    width: 100%; min-width: 0; max-width: 100%;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scroll-padding-inline: 1rem; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--line); background: var(--bg);
    flex: none;
}
.seats > .seat { scroll-snap-align: start; }
.seat {
    display: flex; flex-direction: column; align-items: center; gap: .2rem;
    width: 70px; flex: none; position: relative;
    background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: default;
}
.seat.clickable { cursor: pointer; }
/* لمس: هدف همیشه خود دکمه صندلی باشد (نه آواتار/نام داخلش) و بدون مکث دوبار-لمس */
.seat { touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.seat > * { pointer-events: none; }
.seat .seat-mute { pointer-events: auto; }
.seat .avatar { --size: 56px; transition: box-shadow .2s, transform .2s; }
@media (hover: hover) { .seat.clickable:hover .avatar { transform: translateY(-2px); } }
.seat.clickable:active .avatar { transform: scale(.94); }
.seat.speaking .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--live), 0 0 18px 2px color-mix(in srgb, var(--live) 35%, transparent); }
.seat.offline .avatar { opacity: .4; filter: grayscale(1); }
.seat .seat-name { font-size: .78rem; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.seat .seat-icons { position: absolute; top: 36px; inset-inline-start: 4px; display: flex; gap: 2px; }
.seat .seat-icon {
    width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
    font-size: .66rem; background: var(--surface); box-shadow: 0 0 0 1px var(--line);
}
.seat .seat-icon.mic-on { background: var(--live); color: var(--on-live); box-shadow: 0 0 0 2px var(--surface); }
.seat .seat-icon.blocked { background: var(--danger); color: var(--on-danger); box-shadow: 0 0 0 2px var(--surface); }
.seat .hand { position: absolute; top: -6px; inset-inline-end: 2px; font-size: 1rem; }
/* انسداد با دلیل: «!» روی آواتار؛ دلیل با نگه داشتن موس (title) */
.seat .seat-mute {
    position: absolute; top: -4px; inset-inline-start: 4px; z-index: 1;
    width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
    background: var(--danger); color: var(--on-danger); font-weight: 800; font-size: .78rem; line-height: 1;
    box-shadow: 0 0 0 2px var(--surface); cursor: help;
}
.mute-reason {
    display: flex; flex-direction: column; gap: .2rem; margin-top: .9rem;
    padding: .6rem .8rem; border-radius: var(--radius-sm);
    background: var(--danger-soft); color: var(--danger); font-size: .88rem;
}
.composer textarea:disabled { opacity: .6; cursor: not-allowed; }
.seat .role { font-size: .64rem; padding: 0 .45rem; }

.pinned {
    padding: .5rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--accent-soft);
    font-size: .9rem; display: flex; gap: .5rem; align-items: center; color: var(--ink-2);
}
.pinned .text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: .6rem; scroll-behavior: smooth; }
.msg { display: flex; gap: .55rem; align-items: flex-end; max-width: 80%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { --size: 30px; }
.bubble {
    background: var(--surface-2); border-radius: 18px; border-end-start-radius: 6px;
    padding: .45rem .9rem .35rem; position: relative; min-width: 84px;
}
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); border-end-start-radius: 18px; border-end-end-radius: 6px; }
.msg.mine .bubble .meta { color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.msg.mine .bubble .msg-actions .btn { color: var(--accent-ink); }
.bubble .from { font-size: .76rem; font-weight: 700; color: var(--accent); }
.bubble .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .meta { font-size: .7rem; color: var(--ink-3); display: flex; gap: .4rem; align-items: center; font-variant-numeric: tabular-nums; }
.bubble audio { height: 36px; max-width: 240px; margin-top: .2rem; }
.bubble:has(.voice) { padding-top: .5rem; min-width: 0; }

/* -------------------------------------------- voice message (Telegram-like) */
.voice { --v-btn: var(--accent); --v-icon: var(--accent-ink); --v-bar: color-mix(in srgb, var(--ink-3) 55%, transparent); --v-played: var(--accent); --v-time: var(--ink-3);
    display: flex; align-items: center; gap: .65rem; width: 232px; max-width: 100%; padding: .1rem 0 .15rem; }
.voice.mine { --v-btn: var(--accent-ink); --v-icon: var(--accent); --v-bar: color-mix(in srgb, var(--accent-ink) 45%, transparent); --v-played: var(--accent-ink); --v-time: color-mix(in srgb, var(--accent-ink) 80%, transparent); }
.voice-play {
    width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    background: var(--v-btn); color: var(--v-icon); display: grid; place-items: center;
    transition: transform .12s, filter .15s;
}
.voice-play:hover { filter: brightness(1.06); }
.voice-play:active { transform: scale(.93); }
.voice-play svg { width: 20px; height: 20px; fill: currentColor; grid-area: 1 / 1; }
.voice-play .i-play { transform: translateX(1px); }
.voice-play .i-pause, .voice-play .i-load { display: none; }
.voice-play .i-load { stroke: currentColor; animation: spin .8s linear infinite; transform-origin: center; }
.voice.playing .i-play { display: none; }
.voice.playing .i-pause { display: block; }
.voice.playing.loading .i-pause { display: none; }
.voice.playing.loading .i-load { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.voice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 26px; cursor: pointer; outline-offset: 3px; }
.voice-wave span { flex: 1; min-width: 2px; max-width: 3px; border-radius: 2px; background: var(--v-bar); transition: background .12s; }
.voice-wave span.played { background: var(--v-played); }
.voice-time { font-size: .72rem; line-height: 1; color: var(--v-time); font-variant-numeric: tabular-nums; }
.voice.playing .voice-time::after { content: " •"; color: var(--live); }
.voice.mine.playing .voice-time::after { color: var(--accent-ink); }
.voice.error .voice-time::before { content: "خطا در پخش · "; }
.msg-actions { opacity: 0; transition: opacity .15s; }
.msg-actions .btn.small { padding: 0 .4rem; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
@media (hover: none) { .msg-actions { opacity: 1; } }
.load-more { align-self: center; }

.composer {
    display: flex; gap: .5rem; align-items: flex-end;
    padding: .75rem .9rem; border-top: 1px solid var(--line); background: var(--surface);
    flex: none;
}
.composer textarea {
    flex: 1; font: inherit; color: var(--ink); resize: none;
    background: var(--surface-2); border: 1px solid transparent; border-radius: 23px;
    padding: .6rem 1rem; max-height: 120px; min-height: 46px; line-height: 1.6;
    transition: border-color .15s, background .15s;
}
.composer textarea:focus { outline: none; background: var(--surface); border-color: var(--accent-line); }
.rec-timer { font-variant-numeric: tabular-nums; color: var(--danger); font-weight: 700; min-width: 3.5rem; text-align: center; }

.room-notice { padding: .55rem 1.1rem; font-size: .88rem; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--ink-2); display: flex; gap: .6rem; align-items: center; }
.room-notice.warn { background: var(--danger-soft); color: var(--danger); }
.countdown { font-weight: 700; color: var(--danger); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ modal */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 50; background: var(--backdrop);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: grid; place-items: center; padding: 1rem;
    animation: fade .15s ease-out;
}
.modal {
    background: var(--surface); border-radius: var(--radius-lg);
    width: min(420px, 100%); padding: 1.5rem; box-shadow: var(--shadow-lg);
    animation: rise .2s ease-out;
}
.modal h3 { margin-top: 0; }
.menu-list { display: flex; flex-direction: column; gap: .35rem; margin: 1rem 0; }
.menu-list .btn { justify-content: flex-start; border-radius: var(--radius-sm); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th { color: var(--ink-3); font-weight: 600; font-size: .82rem; }

.tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; overflow-x: auto; scrollbar-width: none; padding: .25rem; background: var(--surface-2); border-radius: 999px; width: fit-content; max-width: 100%; }
.tabs.wrap { flex-wrap: wrap; width: auto; border-radius: var(--radius); }
.tabs button, .tabs a {
    font: inherit; font-size: .9rem; background: none; border: 0; padding: .35rem .95rem; cursor: pointer; color: var(--ink-2);
    border-radius: 999px; white-space: nowrap; transition: background .15s, color .15s;
}
.tabs button:hover, .tabs a:hover { color: var(--ink); }
.tabs .active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.stat { text-align: start; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1.3; font-variant-numeric: tabular-nums; }

.profile-head { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.profile-head .avatar { --size: 104px; }
.profile-head h1 { margin: 0; font-family: var(--font-verse); font-size: 2rem; }

#blazor-error-ui {
    display: none; position: fixed; bottom: 1rem; inset-inline: 1rem; z-index: 100;
    background: var(--ink); color: var(--on-ink); padding: .7rem 1rem; text-align: center; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
#blazor-error-ui a { color: var(--on-ink); text-decoration: underline; }
#blazor-error-ui .dismiss { cursor: pointer; margin-inline-start: 1rem; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 640px) {
    :root { --header-h: 60px; }
    .site-header { padding: 0 .6rem; }
    .site-header-inner { gap: .5rem; }
    .brand { font-size: 1.45rem; }
    .page { padding: 1.25rem .9rem 3rem; }
    .hero { padding: 3rem 1rem; }
    .room { border-radius: 0; border-inline: 0; margin: 0; height: calc(100dvh - var(--header-h)); }
    .room-head { min-height: 48px; padding: .3rem .4rem .3rem .75rem; gap: .35rem; }
    .room-head h1 { font-size: 1.05rem; }
    .room-count { height: 28px; padding: 0 .5rem; font-size: .75rem; }
    .room-count .room-cap { display: none; }
    .room-act { height: 34px; min-width: 34px; padding: 0; }
    .room-act-label { display: none; }
    .seats { gap: .65rem; padding: .6rem .75rem .5rem; scrollbar-width: none; }
    .seats::-webkit-scrollbar { display: none; }
    .seat { width: 60px; }
    .seat .avatar { --size: 48px !important; } /* Avatar اندازه را در style می‌گذارد */
    .seat .seat-name { max-width: 60px; font-size: .72rem; }
    .seat .seat-icons { top: 30px; }
    .msg { max-width: 90%; }
    .user-menu .btn.primary { display: none; }
    .user-menu .btn.ghost { padding: .3rem .5rem; }
    .site-nav a[href="/"] { display: none; }
    .site-nav a { padding: .3rem .65rem; font-size: .9rem; }
}

/* ===================================================================== فاز ۲ */

/* ------------------------------------------------------------- header icons */
.icon-btn, .bell {
    position: relative; width: 38px; height: 38px; border-radius: 50%;
    display: inline-grid; place-items: center; color: var(--ink-2); flex: none;
    transition: background .15s, color .15s;
}
.icon-btn:hover, .bell:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg, .bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-count {
    position: absolute; top: 3px; inset-inline-end: 1px; min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 999px; background: var(--danger); color: var(--on-danger); font-size: .66rem; font-weight: 700;
    display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--bg);
}

/* ------------------------------------------------------------------- tags */
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag {
    display: inline-flex; align-items: baseline; gap: 1px;
    font-size: .8rem; color: var(--accent); background: var(--accent-soft);
    padding: .1rem .6rem; border-radius: 999px; line-height: 1.8; transition: background .15s;
}
.tag:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent-hover); }
.tag::before { content: "#"; opacity: .7; }
.tag small { color: var(--ink-3); margin-inline-start: .3rem; }
.tag-list.big .tag { font-size: .9rem; padding: .25rem .85rem; }
.poem .tag-list { justify-content: center; margin-top: 1.4rem; }
.card-meta { gap: .7rem; font-size: .8rem; color: var(--ink-3); }
.card-foot { margin-top: auto; }

/* --------------------------------------------------------------- poem actions */
.actions-bar { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 1rem; }
.act {
    display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: .9rem; font-weight: 500;
    padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
    cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.act:hover { background: var(--surface-2); color: var(--ink); }
.act:active { transform: scale(.97); }
.act svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.act.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.act.on svg { fill: currentColor; }
.act:first-child.on { color: var(--like); border-color: var(--like-line); background: var(--like-soft); }

/* ------------------------------------------------------------------ comments */
.comments { margin-top: 3rem; }
.comment-form { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.4rem; }
.comment-form textarea {
    font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: var(--radius); padding: .8rem 1rem; resize: vertical; min-height: 90px;
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.comment { display: flex; gap: .8rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.comment-body { flex: 1; min-width: 0; }
.comment .name { font-weight: 600; color: var(--ink); }
.comment .text { margin: .2rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.comment-head { gap: .5rem; flex-wrap: wrap; }
.comment-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.comment-actions:empty { display: none; }
.reply-target { font-size: .8rem; color: var(--ink-3); }
.badge.pending { color: var(--accent); background: var(--accent-soft); }

/* پاسخ‌ها: یک سطح، با خط کناری نازک */
.reply-list {
    list-style: none; margin: .6rem 0 0; padding: 0 0 0 0;
    padding-inline-start: .9rem; border-inline-start: 2px solid var(--line);
    display: flex; flex-direction: column;
}
.comment.reply { padding: .7rem 0; border-top: 0; }
.comment.reply + .comment.reply { border-top: 1px dashed var(--line); }
.reply-more { padding: .3rem 0; }
.reply-form { margin: .6rem 0 0; padding-inline-start: .9rem; border-inline-start: 2px solid var(--accent-line); }
.reply-to { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ink-3); }
.reply-to .btn { margin-inline-start: auto; }

/* نظرهای منتظر تأیید */
.comment-pending-note {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .65rem 1rem; margin-bottom: 1.2rem; border-radius: var(--radius-sm);
    background: var(--accent-soft); color: var(--accent); font-size: .92rem; text-decoration: none;
}
.pending-list { list-style: none; margin: 0; padding: 0 1.2rem; }
.pending-item { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.pending-item:first-child { border-top: 0; }
.pending-item .comment { border-top: 0; padding: .4rem 0 0; }
.pending-poem { font-size: .85rem; color: var(--ink-3); }
.pending-parent {
    margin: .5rem 0 0; padding: .45rem .8rem; border-inline-start: 2px solid var(--line-strong);
    background: var(--surface-2); border-radius: var(--radius-sm); font-size: .88rem; color: var(--ink-2);
}

/* ------------------------------------------------------------------- follow */
.follow-box { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; }
.follow-stat { font-size: .9rem; color: var(--ink-3); }
.follow-stat strong { color: var(--ink); font-size: 1.05rem; margin-inline-end: .2rem; }

/* ------------------------------------------------------------- notifications */
.notif-list { list-style: none; margin: 0; padding: .4rem 0; }
.notif { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 1.2rem; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.notif-body { display: flex; flex-direction: column; min-width: 0; }
.notif-body a { color: var(--ink); }
.notif-body a:hover { color: var(--accent); }
.notif-icon { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }

/* -------------------------------------------------------------------- search */
.search-box { display: flex; gap: .5rem; max-width: 640px; margin: .5rem auto 0; }
.search-box .input { flex: 1; border-radius: 999px; padding: .7rem 1.2rem; font-size: 1.02rem; }

/* ------------------------------------------------------------------ sessions */
.page.medium > .card { margin-top: 1rem; }
.session-list { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.session {
    display: grid; grid-template-columns: 11rem 1fr auto; gap: 1rem; align-items: center;
    padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
}
.session.live { border-color: color-mix(in srgb, var(--live) 40%, var(--line)); background: var(--live-soft); }
.session-when { display: flex; flex-direction: column; font-weight: 600; font-size: .9rem; line-height: 1.6; }
.session-main { min-width: 0; }
.session-main strong { font-family: var(--font-verse); font-size: 1.15rem; }
.session-form { margin-top: 1rem; padding: 1rem; background: var(--bg); border-radius: var(--radius-sm); }
@media (max-width: 640px) { .session { grid-template-columns: 1fr; gap: .4rem; } }

/* ---------------------------------------------------------------- recordings */
.recording-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.recording-list li strong { font-family: var(--font-verse); font-size: 1.1rem; }
audio.player.wide { max-width: none; margin-top: .4rem; }

/* -------------------------------------------------------------- featured poem */
.featured {
    display: flex; flex-direction: column; gap: .15rem; margin-top: 1rem; text-align: center;
    padding: 1.4rem 1.2rem; border-radius: var(--radius); color: var(--ink);
    background: linear-gradient(180deg, var(--accent-soft), var(--surface)); border: 1px solid var(--accent-line);
    transition: box-shadow .2s;
}
.featured:hover { color: var(--ink); box-shadow: var(--shadow); }
.featured-label { font-size: .78rem; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.featured-title { font-family: var(--font-verse); font-size: 1.5rem; font-weight: 700; }
.featured-line { font-family: var(--font-verse); font-size: 1.15rem; color: var(--ink-2); }
.featured-by { font-size: .82rem; color: var(--ink-3); margin-top: .3rem; }
.featured.compact { flex-direction: row; align-items: baseline; gap: .7rem; text-align: start; padding: .5rem 1rem; margin: 0; border-radius: 0; border: 0; background: var(--accent-soft); }
.featured.compact .featured-title { font-size: 1.05rem; }
.featured.compact .featured-line { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.room-featured { border-bottom: 1px solid var(--line); }
.pick-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.pick-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }

/* ----------------------------------------------------------- room additions */
.room-notice.rec { background: var(--danger-soft); color: var(--danger); }
.room-notice.live { background: var(--live-soft); color: var(--live); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex: none; animation: recblink 1.2s ease-in-out infinite; }
@keyframes recblink { 50% { opacity: .25; } }

.mosh {
    display: flex; align-items: center; gap: .9rem; padding: .6rem 1.1rem;
    border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--accent-soft), var(--surface));
}
.mosh-letter {
    width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink); font-family: var(--font-verse); font-size: 1.7rem; font-weight: 700; line-height: 1;
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}
.mosh-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.6; }
.mosh-info small { color: var(--ink-2); }
.mosh-scores { display: flex; gap: .8rem; font-size: .78rem; color: var(--ink-3); flex-wrap: wrap; }
.mosh-scores b { color: var(--accent); }

.msg-system {
    align-self: center; max-width: 90%; text-align: center; font-size: .82rem; color: var(--ink-2);
    background: var(--surface-2); padding: .3rem .9rem; border-radius: 999px; margin: .3rem 0;
    display: inline-flex; align-items: center; gap: .35rem;
}
/* گزینه پیام سیستمی (فقط مدیر/معاون): مثل گزینه پیام‌ها با نگه داشتن موس پیدا می‌شود */
.msg-system-act {
    flex: none; width: 24px; height: 24px; margin-inline-end: -.5rem; padding: 0; border: 0; border-radius: 50%;
    display: inline-grid; place-items: center; background: none; color: var(--ink-3); cursor: pointer;
    opacity: 0; transition: opacity .15s, background .15s;
}
.msg-system-act .ico { width: 16px; height: 16px; }
.msg-system-act:hover { background: var(--surface); color: var(--ink); }
.msg-system:hover .msg-system-act, .msg-system:focus-within .msg-system-act { opacity: 1; }
@media (hover: none) { .msg-system-act { opacity: 1; } }
.msg.verse .bubble { background: var(--surface); border: 1px solid var(--accent-line); box-shadow: var(--shadow-sm); }
.msg.verse.mine .bubble { background: var(--accent-soft); color: var(--ink); }
.msg.verse.mine .bubble .meta { color: var(--ink-3); }
.msg.verse.mine .bubble .msg-actions .btn { color: var(--ink-2); }
.verse-label { font-size: .68rem; font-weight: 700; color: var(--accent); }
.verse-text { font-family: var(--font-verse); font-size: 1.15rem; line-height: 2.1; white-space: pre-wrap; }

/* ------------------------------------------------------------- منوی تم */
.theme-menu { position: relative; }
.theme-menu > summary { list-style: none; cursor: pointer; }
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-menu .ti { display: none; }
:root:not([data-theme]) .theme-menu .ti-system,
:root[data-theme="light"] .theme-menu .ti-light,
:root[data-theme="dark"] .theme-menu .ti-dark { display: block; }
.theme-pop {
    position: absolute; top: calc(100% + .4rem); inset-inline-end: 0; z-index: 40;
    min-width: 168px; padding: .35rem; display: flex; flex-direction: column; gap: .15rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    animation: rise .15s ease-out;
}
.theme-opt {
    display: flex; align-items: center; gap: .55rem; width: 100%;
    padding: .5rem .7rem; border: 0; border-radius: 8px; background: none;
    font: inherit; font-size: .92rem; color: var(--ink-2); cursor: pointer; text-align: start;
}
.theme-opt:hover { background: var(--surface-2); color: var(--ink); }
.theme-opt svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root:not([data-theme]) .theme-opt[value="system"],
:root[data-theme="light"] .theme-opt[value="light"],
:root[data-theme="dark"] .theme-opt[value="dark"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* ------------------------------------------------------------------ کپچا
   تصویر SVG داخل صفحه است؛ رنگ‌ها از توکن‌های تم می‌آیند (روشن و تاریک). */
.captcha { display: flex; flex-direction: column; gap: .35rem; }
.captcha-row { display: flex; align-items: center; gap: .5rem; }
.captcha-img {
    flex: 0 1 150px; min-width: 0; aspect-ratio: 260 / 96;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); overflow: hidden; direction: ltr;
}
.captcha-svg { display: block; width: 100%; height: 100%; }
.captcha-svg .cg { fill: var(--ink); stroke: none; }
.captcha-svg .cn { fill: none; stroke: var(--accent); opacity: .45; stroke-linecap: round; }
.captcha-svg .cf { fill: none; stroke: var(--ink); opacity: .85; stroke-linecap: round; }
.captcha-svg .cc { fill: none; stroke: var(--surface-2); stroke-linecap: round; }
.captcha-svg .cd { fill: var(--accent); opacity: .45; }
.captcha-svg .cdi { fill: var(--ink); opacity: .7; }
.btn.captcha-refresh { width: 1.9rem; height: 1.9rem; padding: 0; border-color: var(--line); justify-content: center; flex: none; }
.btn.captcha-refresh svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.captcha-label { font-weight: 600; font-size: .82rem; color: var(--ink-2); }
.captcha-input {
    width: 150px; max-width: 100%; padding: .4rem .7rem; font: inherit; font-size: .95rem; letter-spacing: .2em; text-align: center;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}
.captcha-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.captcha-input::placeholder { letter-spacing: normal; color: var(--ink-3); }

/* ------------------------------------------------------------- آیکون‌های خطی (Icon.razor) */
.ico {
    width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.btn.round .ico { width: 20px; height: 20px; }
.seat .seat-icon .ico { width: 12px; height: 12px; stroke-width: 2.2; }
.notif-icon .ico { width: 18px; height: 18px; color: var(--ink-2); }
.ico-rec { color: var(--danger); }
.ico-warn { color: var(--danger); }

/* وضعیت سرور در /admin */
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.health-list li { display: grid; grid-template-columns: auto auto 1fr; gap: .5rem; align-items: baseline; }
.health-list li > span { color: var(--ink-2); font-size: .9rem; }
.health-ok svg { color: var(--live); }
.health-warning svg { color: var(--accent); }
.health-error svg, .health-error strong { color: var(--danger); }
@media (max-width: 640px) { .health-list li { grid-template-columns: auto 1fr; } .health-list li > span { grid-column: 1 / -1; } }

/* ------------------------------------------------------------------ DropZone
   input فایل نامرئی روی کل ناحیه کشیده شده؛ کلیک و رهاکردن بومی مرورگر است. */
.dropzone {
    position: relative; display: flex; align-items: center; gap: 1rem;
    padding: 1.1rem 1.2rem; border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
    background: var(--surface-2); color: var(--ink-2); transition: border-color .15s, background .15s, box-shadow .15s;
}
.dropzone.compact { padding: .8rem 1rem; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { box-shadow: 0 0 0 4px var(--accent-soft); }
.dropzone.is-dragging { border-color: var(--accent); border-style: solid; background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--accent-line); background: var(--surface); }
.dropzone.is-busy, .dropzone.is-disabled { opacity: .7; }
.dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; }
.dropzone-input:disabled { cursor: not-allowed; }
.dropzone-icon {
    width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); color: var(--accent); box-shadow: 0 0 0 1px var(--line);
}
.dropzone-icon .ico { width: 22px; height: 22px; }
.dropzone.is-dragging .dropzone-icon { background: var(--accent); color: var(--accent-ink); }
.dropzone-thumb { width: 56px; height: 56px; flex: none; border-radius: var(--radius-sm); object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.dropzone-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.dropzone-title { font-weight: 600; color: var(--ink); }
.dropzone-filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: block; }
.dropzone-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.dropzone-hint { font-size: .82rem; color: var(--ink-3); }
.dropzone-spinner {
    display: inline-block; vertical-align: -.2em; margin-inline-end: .4rem;
    width: 16px; height: 16px; border-radius: 50%; flex: none;
    border: 2px solid var(--accent-line); border-top-color: var(--accent); animation: dz-spin .8s linear infinite;
}
@keyframes dz-spin { to { transform: rotate(360deg); } }
.dropzone-audio { width: 100%; margin-top: .6rem; height: 40px; }

/* ------------------------------------------------- ضبط مستقیم دکلمه (RecitationRecorder) */
.recorder {
    display: flex; flex-direction: column; gap: .7rem; padding: 1.1rem 1.2rem;
    border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
    transition: border-color .15s, background .15s;
}
.recorder.is-countdown, .recorder.is-recording { border-style: solid; border-color: var(--danger); background: var(--surface); }
.recorder.is-recorded { border-style: solid; border-color: var(--accent-line); background: var(--surface); }
.recorder-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.recorder-row .spacer { flex: 1; }
.recorder-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.recorder-title { font-weight: 600; color: var(--ink); }
.recorder-hint { font-size: .82rem; color: var(--ink-3); }
.btn.round.rec-start { width: 56px; height: 56px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.round.rec-start .ico { width: 24px; height: 24px; }
.rec-count {
    width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 50%;
    background: var(--danger-soft); color: var(--danger); font-size: 1.4rem; font-weight: 800;
    animation: rise .35s ease-out;
}
.recorder .voice { flex: 1; min-width: 220px; }
.rec-meter { display: flex; align-items: center; gap: 2px; height: 0; overflow: hidden; transition: height .2s; }
.recorder.is-countdown .rec-meter, .recorder.is-recording .rec-meter { height: 40px; }
.rec-meter span { flex: 1; min-width: 2px; max-width: 4px; height: 3px; border-radius: 2px; background: var(--line-strong); transition: height .07s linear; }
.rec-meter.recording span { background: var(--danger); }
@media (prefers-reduced-motion: reduce) { .rec-meter span { transition: none; } .rec-count { animation: none; } }
@media (prefers-reduced-motion: reduce) { .dropzone-spinner { animation-duration: 2.4s; } }

/* ------------------------------------------------------- انتخابگر تاریخ شمسی */
.pdp { position: relative; }
.pdp-field {
    width: 100%; display: flex; align-items: center; gap: .55rem; text-align: start; cursor: pointer;
    padding: .7rem .9rem; font: inherit; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.pdp-field:hover { border-color: var(--accent-line); }
.pdp-field[aria-expanded="true"], .pdp-field:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pdp-field .ico { color: var(--accent); }
.pdp-backdrop { position: fixed; inset: 0; z-index: 30; }
.pdp-pop {
    position: absolute; top: calc(100% + .4rem); inset-inline-start: 0; z-index: 31;
    width: min(320px, calc(100vw - 2rem)); padding: .9rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    animation: rise .15s ease-out;
}
.pdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.pdp-head strong { font-family: var(--font-verse); font-size: 1.1rem; }
.pdp-nav {
    width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-2); font-size: 1.2rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.pdp-nav:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.pdp-nav:disabled { opacity: .35; cursor: default; }
.pdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pdp-wd { text-align: center; font-size: .78rem; color: var(--ink-3); padding: .25rem 0; font-weight: 600; }
.pdp-day {
    aspect-ratio: 1; border: 0; border-radius: 50%; background: none; font: inherit; font-size: .92rem;
    color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.pdp-day:hover:not(:disabled) { background: var(--surface-2); }
.pdp-day.today { box-shadow: inset 0 0 0 1.5px var(--accent-line); color: var(--accent); font-weight: 700; }
.pdp-day.selected, .pdp-day.selected:hover { background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: none; }
.pdp-day:disabled { color: var(--ink-3); opacity: .4; cursor: default; }
.pdp-time {
    display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: .8rem; padding-top: .8rem;
    border-top: 1px solid var(--line); color: var(--ink-2); direction: ltr;
}
.pdp-time span:first-child { order: 9; margin-inline-start: .3rem; direction: rtl; }
.pdp-time select, .field .pdp-time select {
    width: auto; min-width: 4.4rem; text-align: center; padding: .35rem .5rem; font: inherit; color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.pdp-foot { display: flex; align-items: center; gap: .5rem; margin-top: .8rem; }

/* ------------------------------------------------------------- «مطمئنید؟» (ConfirmButton) */
.confirm-inline {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem;
    padding: .25rem .3rem .25rem .6rem; border-radius: var(--radius-sm);
    background: var(--danger-soft); animation: fade .12s ease-out;
}
.confirm-q { font-size: .88rem; font-weight: 600; color: var(--danger); }
.confirm-inline .btn.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.confirm-inline .btn.danger:hover { filter: brightness(1.08); }
.menu-list .confirm-inline { display: flex; padding: .5rem .6rem; }
.menu-list .confirm-inline .btn { justify-content: center; }

/* ------------------------------------------------------------------ قوانین */
.terms-body { line-height: 2; color: var(--ink-2); }
.terms-body h3 { font-family: var(--font-verse); font-size: 1.15rem; color: var(--ink); margin: 1.4rem 0 .4rem; }
.terms-body h3:first-child { margin-top: 0; }
.terms-body p { margin: .5rem 0; }
.terms-body ul { margin: .3rem 0 .6rem; padding-inline-start: 1.3rem; }
.terms-body li { margin: .25rem 0; }
.terms-body li::marker { color: var(--accent); }
.terms { padding: 1.6rem 1.8rem; }
.terms-updated { margin: 1.5rem 0 0; border-top: 1px solid var(--line); padding-top: .8rem; }
.terms-scroll {
    max-height: min(55vh, 460px); overflow-y: auto; padding: .2rem .9rem .2rem .4rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
    scrollbar-width: thin;
}
.terms-scroll .terms-body { padding: .8rem 0; font-size: .95rem; }
.terms-accept { display: flex; flex-direction: column; gap: .3rem; }
.terms-accept .check { align-items: flex-start; line-height: 1.8; }
.terms-accept input[type=checkbox] { margin-top: .45rem; }
.link-btn {
    background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent);
    text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.terms-dialog {
    width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 1.3rem 1.4rem;
    border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink);
    box-shadow: var(--shadow-lg);
}
.terms-dialog[open] { display: flex; flex-direction: column; gap: .8rem; animation: rise .2s ease-out; }
.terms-dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.terms-dialog-head { display: flex; align-items: center; justify-content: space-between; }
.terms-dialog-head h3 { margin: 0; font-family: var(--font-verse); font-size: 1.3rem; }
.terms-dialog-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.terms-dialog-foot a { font-size: .88rem; }
.terms-modal { width: min(640px, 100%); }
.terms-gate { z-index: 80; }
.terms-editor { min-height: 360px !important; font-size: .92rem; line-height: 1.9; }
.terms-preview { margin-top: 1rem; padding: 1rem 1.2rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.site-footer {
    display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem;
    padding: 2rem 1rem 2.4rem; font-size: .85rem; color: var(--ink-3);
}
.site-footer a { color: var(--ink-2); }

/* ------------------------------------------------ اپ: نوار «اتصال برقرار نیست» */
.app-offline {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 1000; padding: .55rem 1rem; text-align: center; font-size: .9rem;
    background: var(--danger); color: var(--on-danger); padding-bottom: calc(.55rem + env(safe-area-inset-bottom));
}

/* ===================================================== پیام قطع و وصل اتصال (App.razor) */
.reconnect-modal {
    max-width: min(360px, calc(100vw - 32px)); padding: 1.4rem 1.3rem 1.2rem; text-align: center;
    border: 1px solid var(--line); border-radius: var(--radius-lg, 22px);
    background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
    font-family: var(--font-ui); line-height: 1.9;
}
.reconnect-modal::backdrop { background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(3px); }
.reconnect-modal p { margin: 0 0 .9rem; color: var(--ink); }
.reconnect-modal .btn { margin-top: .2rem; }
/* هر پیام و دکمه فقط در وضعیت خودش */
.reconnect-modal > .reconnect-first, .reconnect-modal > .reconnect-repeated, .reconnect-modal > .reconnect-failed,
.reconnect-modal > .reconnect-paused, .reconnect-modal > .reconnect-resume-failed, .reconnect-modal > .reconnect-spinner { display: none; }
.reconnect-modal.components-reconnect-show > .reconnect-first,
.reconnect-modal.components-reconnect-show > .reconnect-spinner,
.reconnect-modal.components-reconnect-retrying > .reconnect-repeated,
.reconnect-modal.components-reconnect-retrying > .reconnect-spinner,
.reconnect-modal.components-reconnect-failed > .reconnect-failed,
.reconnect-modal.components-reconnect-paused > .reconnect-paused,
.reconnect-modal.components-reconnect-resume-failed > .reconnect-resume-failed { display: block; }
.reconnect-modal.components-reconnect-retrying > .reconnect-first { display: none; }
.reconnect-modal > button.reconnect-failed, .reconnect-modal > button.reconnect-paused, .reconnect-modal > button.reconnect-resume-failed { margin-inline: auto; }
.reconnect-spinner {
    width: 34px; height: 34px; margin: 0 auto .9rem; border-radius: 50%;
    border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: reconnect-spin 1s linear infinite;
}
@keyframes reconnect-spin { to { transform: rotate(360deg); } }

/* ===================================================== چیدمان اپ موبایل (IAppShell.MobileLayout) */
:root { --tabbar-h: 62px; }
.app-bar {
    position: sticky; top: 0; z-index: 20;
    height: calc(var(--header-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) .75rem 0;
    display: flex; align-items: center; gap: .35rem;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--line);
}
.app-bar .brand { font-size: 1.45rem; }
.app-main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.app-main.in-room { padding-bottom: 0; }
.app-main .page { padding-top: 1rem; padding-bottom: 1.5rem; }

.tab-bar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
    background: var(--surface); border-top: 1px solid var(--line);
    -webkit-tap-highlight-color: transparent;
}
.tab-bar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--ink-2); font-size: .72rem; font-weight: 500; text-decoration: none; min-width: 0;
}
.tab-bar a > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab-bar .ico { width: 24px; height: 24px; }
.tab-bar a.active { color: var(--accent); }
.tab-bar a.active .ico { stroke-width: 2.2; }
.tab-bar a.active .avatar { box-shadow: 0 0 0 2px var(--accent); }
.tab-bar .tab-fab {
    width: 46px; height: 46px; margin-top: -20px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm), 0 0 0 4px var(--surface);
}
.tab-bar .tab-fab .ico { width: 24px; height: 24px; stroke-width: 2.4; }
.tab-bar .tab-new { color: var(--ink); }
/* نوار «اتصال برقرار نیست» بالای تب‌بار */
body:has(.tab-bar) .app-offline { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

/* سایت روی گوشی: همان تب‌بار اپ؛ هدر مثل نوار بالای اپ (نام، جست‌وجو، زنگوله) و بقیه در منوی «من» */
.site-tabs { display: none; }
@media (max-width: 640px) {
    .site-tabs { display: grid; }
    .site-main:has(+ .site-tabs) { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
    body:has(.site-tabs) .site-footer { display: none; }
    .site-header .site-nav, .site-header .wide-only { display: none; }
    .site-header .user-menu { margin-inline-start: auto; gap: .35rem; }
}

/* منوی «من» */
.me-head { display: flex; align-items: center; gap: .9rem; }
.me-head .me-name { font-family: var(--font-verse); font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.me-head .me-handle { color: var(--ink-2); font-size: .85rem; }
.app-main .page.narrow > .card { padding: 1.15rem; box-shadow: none; }
.app-main .page > .card.menu-card, .page > .card.menu-card { padding: .2rem 0; overflow: hidden; }
.app-main .page > .card.me-head, .page > .card.me-head { padding: 1rem; color: var(--ink); }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li + li { border-top: 1px solid var(--line); }
.menu-list a, .menu-list button {
    display: flex; align-items: center; gap: .85rem; width: 100%; padding: .85rem 1rem;
    color: var(--ink); background: none; border: 0; border-radius: 0; font: inherit; text-align: start; cursor: pointer;
}
.menu-list a:active, .menu-list button:active { background: var(--surface-2); }
.menu-list .ico { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.menu-chev { margin-inline-start: auto; display: inline-flex; align-items: center; color: var(--ink-2); }
.menu-chev .ico { width: 18px; height: 18px; }
.me-head > div { flex: 1; min-width: 0; }
.menu-list .menu-danger, .menu-list .menu-danger .ico { color: var(--danger); }
.menu-section { margin: 1.25rem .25rem .5rem; color: var(--ink-2); font-size: .8rem; font-weight: 600; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; padding: .25rem; border-radius: 999px; background: var(--surface-2); }
.segmented button { border: 0; border-radius: 999px; padding: .45rem .5rem; background: none; color: var(--ink-2); font: inherit; font-size: .9rem; cursor: pointer; }
.segmented button.active,
html[data-theme="light"] .theme-seg button[value="light"],
html[data-theme="dark"] .theme-seg button[value="dark"],
html:not([data-theme]) .theme-seg button[value="system"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.theme-seg { margin: 0; }
.theme-seg input[type="hidden"] { display: none; }

/* اپ: نسخه قدیمی (اجباری = کل صفحه؛ پیشنهادی = نوار بالا) */
.app-update-block {
    position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px;
    background: var(--bg);
}
.app-update-block .card { max-width: 420px; text-align: center; display: grid; gap: 1rem; }
.app-update-bar {
    position: sticky; top: 0; z-index: 900; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
    justify-content: center; padding: .5rem 1rem; font-size: .9rem;
    background: var(--accent-soft); color: var(--ink); border-bottom: 1px solid var(--accent-line);
}

/* ----------------------------------------------- گزارش و رأی‌گیری حاضران روم */
.reason-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .2rem; }
.reason-chips button {
    border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
    border-radius: 999px; padding: .35rem .85rem; font: inherit; font-size: .88rem; cursor: pointer;
}
.reason-chips button:hover { border-color: var(--line-strong); }
.reason-chips button.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 600; }

.vote-modal { text-align: center; }
.vote-modal .vote-timer {
    width: 64px; height: 64px; margin: 0 auto .8rem; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums;
    color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent-line);
}
.vote-modal .vote-timer.low { color: var(--danger); background: var(--danger-soft); box-shadow: inset 0 0 0 2px var(--danger); }
.vote-modal .vote-question { font-size: 1.02rem; line-height: 1.9; margin: 0 0 .5rem; }
.vote-modal .vote-meta { font-size: .85rem; color: var(--ink-3); margin: 0 0 1rem; }
.vote-modal .vote-actions { display: flex; gap: .6rem; justify-content: center; }
.vote-modal .vote-actions .btn { min-width: 110px; justify-content: center; }
.vote-modal .vote-actions .btn.chosen { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.vote-modal .vote-actions .btn.danger.chosen { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.vote-modal .vote-stats { margin-top: .7rem; font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.vote-modal .vote-note { margin: .8rem 0 0; font-size: .78rem; color: var(--ink-3); line-height: 1.8; }

/* اطلاعیه همگانی در فهرست اعلان‌ها */
.notif-tag { display: block; font-size: .78rem; color: var(--accent); margin-bottom: .1rem; }
