/* ==========================================================================
   Dot League — یک سیستم طراحی واحد برای سایت، ورود و پنل
   همه‌ی رنگ‌ها از متغیرهای زیر می‌آیند؛ هیچ رنگ ثابتی خارج از :root و
   [data-theme="dark"] نباید نوشته شود تا حالت شب/روز هرگز خراب نشود.
   ========================================================================== */

@font-face { font-family: "IRANYekanX"; src: url("../home/fonts/IRANYekanXFaNum-Regular.d0ca4bc2d7ae.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IRANYekanX"; src: url("../home/fonts/IRANYekanXFaNum-Bold.b4fb2dace2e4.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IRANYekanX"; src: url("../home/fonts/IRANYekanXFaNum-Black.c703b25ac1ef.ttf") format("truetype"); font-weight: 900; font-display: swap; }

:root {
    color-scheme: light;
    --bg: #f6f6f3;
    --surface: #ffffff;
    --surface-2: #f1f1ed;
    --surface-3: #e8e8e3;
    --text: #16181c;
    --text-2: #3d4148;
    --muted: #5c6169;           /* ≥ ۴.۵:۱ روی همه‌ی سطح‌ها (WCAG AA) */
    --border: #e4e4de;
    --border-strong: #d2d2cb;
    --accent: #e0ad1f;          /* پس‌زمینه‌ی دکمه‌ی اصلی */
    --accent-text: #1c1504;     /* متن روی accent */
    --accent-strong: #7d5a00;   /* متن/آیکون طلایی روی پس‌زمینه‌ی روشن (≥ ۵:۱) */
    --accent-soft: #fbf1d3;
    --success: #15704a; --success-soft: #e3f4ec;
    --danger: #b02c22;  --danger-soft: #fbe7e5;
    --warning: #8f5500; --warning-soft: #fdf0dc;
    --info: #2458d6;    --info-soft: #e6edfc;
    --shadow-sm: 0 1px 2px rgba(20, 22, 26, .05);
    --shadow: 0 6px 24px rgba(20, 22, 26, .06);
    --shadow-pop: 0 14px 40px rgba(20, 22, 26, .14);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --sidebar-w: 236px;
    --font: "IRANYekanX", Tahoma, sans-serif;
    --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1015;
    --surface: #161920;
    --surface-2: #1c2028;
    --surface-3: #252a33;
    --text: #eceef1;
    --text-2: #c5c9d0;
    --muted: #979ea8;
    --border: #262b34;
    --border-strong: #353b46;
    --accent: #e6b52c;
    --accent-text: #1c1504;
    --accent-strong: #f0c24a;
    --accent-soft: rgba(230, 181, 44, .14);
    --success: #45c08a; --success-soft: rgba(69, 192, 138, .14);
    --danger: #f06a5f;  --danger-soft: rgba(240, 106, 95, .14);
    --warning: #f0a53c; --warning-soft: rgba(240, 165, 60, .14);
    --info: #6f9bff;    --info-soft: rgba(111, 155, 255, .14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 6px 24px rgba(0, 0, 0, .28);
    --shadow-pop: 0 14px 40px rgba(0, 0, 0, .5);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; font-family: var(--font); font-size: 14px; line-height: 1.7;
    color: var(--text); background: var(--bg);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0; }
code, pre { font-family: var(--mono); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; border-radius: 6px; }   /* طلایی تیره: ≥ ۳:۱ روی زمینه (۲.۴.۷) */
i[class^="ri-"], i[class*=" ri-"] { line-height: 1; color: currentColor; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: plaintext; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* تصاویری که نسخه‌ی روشن/تیره دارند */
[data-theme="dark"] .only-light, :root:not([data-theme="dark"]) .only-dark { display: none !important; }

/* ── App shell ── */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
    padding: 18px 14px; background: var(--surface); border-inline-start: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.brand strong { font-size: 15px; font-weight: 900; }
.brand small { display: block; font: 700 9px/1 var(--font); letter-spacing: 2px; color: var(--muted); direction: ltr; text-align: right; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; color: var(--muted); padding: 14px 10px 4px; }
.nav a {
    display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: var(--radius-sm);
    color: var(--text-2); font-weight: 700; font-size: 13px;
}
.nav a i { font-size: 18px; color: var(--muted); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.is-active { background: var(--accent-soft); color: var(--text); }
.nav a.is-active i { color: var(--accent-strong); }
.nav .count { margin-inline-start: auto; font-size: 11px; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; background: var(--accent); color: var(--accent-text); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot small { display: block; font-size: 11px; color: var(--muted); direction: ltr; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px;
    padding: 0 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 700; font-size: 15px; margin-inline-end: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title small { color: var(--muted); font-weight: 400; margin-inline-start: 6px; }
.topbar .mobile-brand { display: none; }
.content { width: 100%; max-width: 1160px; margin: 0 auto; padding: 24px 28px 64px; display: flex; flex-direction: column; gap: 20px; }

.bottom-nav { display: none; }

/* ── Avatar ── */
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text); }
.avatar--lg { width: 64px; height: 64px; font-size: 20px; }
.avatar--sm { width: 26px; height: 26px; font-size: 10px; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
    border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface);
    color: var(--text); font-weight: 700; font-size: 13px; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn i { font-size: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
    position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 18px;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.link { color: var(--accent-strong); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }

/* ── Cards & sections ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head h2 { font-size: 15px; }
.card-head + .card-body { padding-top: 12px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 16px; }
.section-head p { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ── Page header ── */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--muted); margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.league-head { display: flex; align-items: center; gap: 14px; }
.league-head img { width: 52px; height: 52px; object-fit: contain; }
.league-logo-fallback { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; background: var(--surface-2); color: var(--league, var(--text)); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 12px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--text); border-bottom-color: var(--accent); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.segmented a, .segmented button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.segmented .is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ── Lists (rows) ── */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); min-width: 0; }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item small { display: block; font-size: 12px; color: var(--muted); }
.list-item .end { margin-inline-start: auto; text-align: left; flex: none; }
.list-item > i.chev { color: var(--muted); font-size: 18px; }
.list--flush .list-item { padding-inline: 0; }
.thumb { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-size: 17px; }
.thumb img { width: 28px; height: 28px; object-fit: contain; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge--accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--info { background: var(--info-soft); color: var(--info); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--league, var(--accent)); flex: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

/* نوع رویداد/تمرین → رنگ از توکن‌ها */
.tone-practice, .tone-class { --tone: var(--info); --tone-soft: var(--info-soft); }
.tone-challenge, .tone-contest { --tone: var(--accent-strong); --tone-soft: var(--accent-soft); }
.tone-deadline, .tone-exam { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.tone-project, .tone-event { --tone: var(--success); --tone-soft: var(--success-soft); }
.thumb[class*="tone-"] { background: var(--tone-soft); color: var(--tone); }

/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { display: block; font-size: 22px; font-weight: 900; margin-top: 2px; }

/* ── Greeting (home) ── */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hello h1 { font-size: 20px; }
.hello p { color: var(--muted); margin-top: 2px; }
.hello .summary { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text-2); }
.pill i { font-size: 15px; color: var(--muted); }
a.pill:hover { border-color: var(--border-strong); color: var(--text); }

/* ── Weekly calendar ── */
.week-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; }
.week-head h2 { font-size: 15px; }
.week-head small { color: var(--muted); font-size: 12px; font-weight: 400; margin-inline-start: 6px; }
.week-nav { display: flex; align-items: center; gap: 4px; }
.week-nav .icon-btn { width: 32px; height: 32px; font-size: 16px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.day { min-height: 150px; padding: 10px; border-inline-start: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day:first-child { border-inline-start: 0; }
.day-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.day-name { font-size: 12px; font-weight: 700; color: var(--muted); }
.day-num { font-size: 18px; font-weight: 900; line-height: 1; }
.day-title { font-size: 11px; color: var(--muted); min-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day.is-today { background: var(--accent-soft); }
.day.is-today .day-num { color: var(--accent-strong); }
.day.is-today .day-name { color: var(--text); }
.day.is-friday .day-name, .day.is-friday .day-num { color: var(--danger); }
.ev { display: block; padding: 5px 7px; border-radius: 8px; background: var(--tone-soft, var(--surface-2)); border-inline-start: 3px solid var(--tone, var(--border-strong)); min-width: 0; }
.ev strong { display: block; font-size: 11px; line-height: 1.5; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev small { display: block; font-size: 10px; color: var(--muted); }
a.ev:hover { filter: brightness(.97); }

/* ── Monthly calendar ── */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.month-wd { padding: 8px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); }
.month-wd:last-child { color: var(--danger); }
.month-wd .wd-short { display: none; }
.mday { min-height: 104px; padding: 6px; border-bottom: 1px solid var(--border); border-inline-start: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mday:nth-child(7n + 1) { border-inline-start: 0; }
.mday.is-empty { background: var(--surface-2); }
.mday .num { font-weight: 900; font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.mday.is-today .num { background: var(--accent); color: var(--accent-text); }
.mday.is-friday .num { color: var(--danger); }
.mday.is-today.is-friday .num { color: var(--accent-text); }
.mday .ev { padding: 3px 6px; }
.agenda { display: none; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: right; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-me td { background: var(--accent-soft); }
.table .num { font-weight: 900; }
.table .center { text-align: center; }
.rank { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--surface-2); font-weight: 900; font-size: 12px; }
.rank-1 { background: var(--accent); color: var(--accent-text); }
.rank-2, .rank-3 { background: var(--surface-3); }
.person { display: flex; align-items: center; gap: 10px; }
.cell-ok { color: var(--success); font-weight: 700; }
.cell-bad { color: var(--danger); font-weight: 700; }

/* ── Podium (نفرات برتر) ── */
.podium { display: flex; flex-direction: column; }
.podium .list-item .rank { flex: none; }

/* ── Forms ── */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.field .help { font-size: 11px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"],
input[type="date"], input[type="time"], input[type="datetime-local"], input:not([type]), select, textarea {
    width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; }
select[multiple] { min-height: 100px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--danger); font-size: 12px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }

/* ── Messages ── */
.toasts { position: fixed; bottom: 20px; left: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); font-size: 13px; transition: opacity .3s, transform .3s; }
.toast i { font-size: 18px; color: var(--info); }
.toast--success i { color: var(--success); }
.toast--error i { color: var(--danger); }
.toast--warning i { color: var(--warning); }
.toast.is-hiding { opacity: 0; transform: translateY(8px); }

/* ── Notifications dropdown ── */
.notif { position: relative; }
.notif-badge { position: absolute; top: -4px; left: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--danger); color: #fff; border: 2px solid var(--bg); }
.notif-panel { position: absolute; top: calc(100% + 8px); left: 0; width: min(360px, calc(100vw - 24px)); max-height: 440px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); overflow: hidden; z-index: 50; }
.notif-panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-panel header button { border: 0; background: none; color: var(--accent-strong); font-size: 12px; font-weight: 700; }
.notif-list { overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-item:hover { background: var(--surface-2); }
.notif-item i { font-size: 17px; color: var(--muted); margin-top: 2px; }
.notif-item strong { display: block; font-size: 13px; font-weight: 400; }
.notif-item span { display: block; font-size: 12px; color: var(--muted); }
.notif-item small { font-size: 11px; color: var(--muted); }
.notif-item.is-unread strong { font-weight: 700; }
.notif-item.is-unread i { color: var(--accent-strong); }

/* ── Empty ── */
.empty { padding: 28px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty i { display: block; font-size: 26px; margin-bottom: 6px; opacity: .7; }
.empty .btn { margin-top: 12px; }

/* ── Progress ── */
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* ── Level path ── */
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.level { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.level .n { font-size: 11px; color: var(--muted); font-weight: 700; }
.level p { font-size: 12px; color: var(--muted); }
.level.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.level.is-locked { opacity: .6; }
a.level:hover { border-color: var(--border-strong); }

/* ── Modules / lessons ── */
details.module { border-top: 1px solid var(--border); }
details.module:first-of-type { border-top: 0; }
details.module summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 20px; }
details.module summary::-webkit-details-marker { display: none; }
details.module summary .chev { margin-inline-start: auto; color: var(--muted); transition: transform .2s; }
details.module[open] summary .chev { transform: rotate(180deg); }
details.module .list-item { padding-inline-start: 68px; }
.lesson-done { color: var(--success); }

/* ── Reader ── */
.reader { max-width: 760px; }
.prose { font-size: 15px; line-height: 2; color: var(--text-2); }
.prose p + p { margin-top: 12px; }
.prose pre, .code { direction: ltr; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.6; color: var(--text); margin: 0; }
.video-box { aspect-ratio: 16 / 9; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); }
.video-box iframe, .video-box video { width: 100%; height: 100%; border: 0; border-radius: inherit; }

/* ── Problem workspace ── */
.problem-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.problem-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.samples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sample { position: relative; }
.sample > span { font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 4px; }
/* دکمه‌ی کپی سمت راست، با فاصله از متن؛ قبلاً روی خط اول ورودی/خروجی نمونه می‌افتاد و آن را می‌پوشاند */
.sample .copy { position: absolute; top: 28px; right: 8px; }
.sample-pre { white-space: pre; unicode-bidi: plaintext; min-height: 48px; font-family: var(--mono); padding-right: 52px; }
.sample-pre.is-empty { color: var(--muted); font-style: italic; }
.editor { width: 100%; min-height: 380px; direction: ltr; text-align: left; font-family: var(--mono); font-size: 13px; line-height: 1.6; tab-size: 4; background: var(--surface-2); }
.run-result { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.run-result.is-success { background: var(--success-soft); border-color: transparent; }
.run-result.is-error { background: var(--danger-soft); border-color: transparent; }
.run-result.is-success > i { color: var(--success); }
.run-result.is-error > i { color: var(--danger); }
.run-result pre { margin-top: 8px; font-size: 12px; background: var(--surface); padding: 8px; border-radius: 8px; overflow-x: auto; }
.upload { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); text-align: center; cursor: pointer; }
.upload i { font-size: 28px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--text); font-size: 13px; }
.notice i { color: var(--warning); font-size: 18px; }
.notice--info { background: var(--info-soft); }
.notice--info i { color: var(--info); }

/* ── Verdicts ── */
.v-accepted { --tone: var(--success); --tone-soft: var(--success-soft); }
.v-wrong, .v-runtime_error, .v-compile_error { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.v-time_limit { --tone: var(--warning); --tone-soft: var(--warning-soft); }
.v-queued, .v-running { --tone: var(--info); --tone-soft: var(--info-soft); }
.v-judge_error { --tone: var(--warning, #b7791f); --tone-soft: var(--warning-soft, rgba(183,121,31,.12)); }
.verdict { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--tone-soft); color: var(--tone); }
.result-hero { display: flex; align-items: center; gap: 16px; padding: 20px; }
.result-hero .big { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: var(--tone-soft); color: var(--tone); flex: none; }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.kv div { padding: 12px 20px; border-inline-start: 1px solid var(--border); }
.kv div:first-child { border-inline-start: 0; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }

/* ── Invite code ── */
.code-box { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.code-box code { flex: 1; font-size: 15px; font-weight: 700; letter-spacing: 2px; direction: ltr; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-box code.small { font-size: 12px; letter-spacing: 0; font-weight: 400; }

/* ── Profile ── */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 20px; flex-wrap: wrap; }
.profile-head .grow { flex: 1; min-width: 200px; }
.dl { display: grid; gap: 0; margin: 0; }
.dl div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.dl div:first-child { border-top: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 700; text-align: left; }

/* ── Auth ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); padding: 28px; }
/* صفحه‌ی قوانین: همان کارت ورود ولی پهن‌تر برای متن طولانی */
.auth-card:has(.terms) { width: min(760px, 100%); }
.logout-card { display: flex; align-items: center; gap: 12px; }
.logout-card small { display: block; font-size: 12px; }
.terms h1 { font-size: 22px; color: var(--text); margin: 8px 0 4px; }
.terms h2 { font-size: 16px; color: var(--text); margin: 22px 0 6px; }
.terms ul { padding-inline-start: 20px; display: grid; gap: 6px; }
.terms li { list-style: disc; }
.check a { color: var(--accent); text-decoration: underline; }
.auth-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }

/* ── Public landing ── */
.site { max-width: 1120px; margin: 0 auto; padding: 0 24px 64px; }
.site-header { display: flex; align-items: center; gap: 12px; height: 72px; }
.site-header .brand { padding: 0; margin-inline-end: auto; }
.site-nav { display: flex; gap: 4px; margin-inline-end: 8px; }
.site-nav a { padding: 6px 10px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--text-2); }
.site-nav a:hover { background: var(--surface-2); }
.hero { padding: 56px 0 40px; display: grid; gap: 18px; max-width: 720px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 900; line-height: 1.3; }
.hero h1 em { font-style: normal; color: var(--accent-strong); }
.hero p { font-size: 16px; color: var(--muted); max-width: 560px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.site section { margin-top: 36px; }
.site-footer { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.site-footer .partners { display: flex; align-items: center; gap: 16px; }
.site-footer img { height: 48px; width: auto; }
.site-footer .partners { gap: 28px; }
.footer-text { display: flex; flex-direction: column; gap: 6px; }
.footer-credit { font-size: 12px; color: var(--muted); }
.footer-credit i { color: #e0475b; margin: 0 2px; vertical-align: -1px; }
.footer-credit b { color: var(--text); font-weight: 800; letter-spacing: .3px; }
@media (max-width: 560px) { .site-footer img { height: 40px; } .site-footer { justify-content: center; text-align: center; } }
.league-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.league-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.league-card .top { display: flex; align-items: center; gap: 12px; }
.league-card img { width: 44px; height: 44px; object-fit: contain; }
.league-card p { color: var(--muted); font-size: 13px; flex: 1; }

/* ── Responsive ── */
@media (max-width: 1080px) {
    .grid-2, .problem-layout { grid-template-columns: minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar { display: none; }
    .topbar { padding: 0 16px; }
    .topbar .mobile-brand { display: block; }
    .topbar .mobile-brand img { width: 30px; height: 30px; }
    .content { padding: 16px 16px 96px; gap: 16px; }
    .bottom-nav {
        position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
        background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 700; color: var(--muted); padding: 4px 0; }
    .bottom-nav a i { font-size: 20px; }
    .bottom-nav a.is-active { color: var(--text); }
    .bottom-nav a.is-active i { color: var(--accent-strong); }
    .grid-2-even, .form-grid, .samples { grid-template-columns: minmax(0, 1fr); }
    .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kv div:nth-child(3) { border-inline-start: 0; }
    .kv div:nth-child(n + 3) { border-top: 1px solid var(--border); }
    /* تقویم هفتگی روی موبایل: لیست عمودی روزها */
    .week { grid-template-columns: minmax(0, 1fr); }
    .day { min-height: 0; flex-direction: row; align-items: flex-start; gap: 12px; border-inline-start: 0; border-top: 1px solid var(--border); padding: 10px 16px; }
    .day:first-child { border-top: 0; }
    .day-top { flex-direction: column; align-items: center; width: 44px; flex: none; gap: 4px; }
    .day-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
    .day:not(.has-items):not(.is-today) .day-body .day-title:empty::after { content: "—"; }
    /* تقویم ماهانه روی موبایل: شبکه‌ی فشرده + لیست رویدادها */
    .mday { min-height: 48px; align-items: center; padding: 4px 2px; }
    /* موبایل: نام کوتاه روزها (ش ی د …) و بدون عنوان روز داخل خانه‌ها — قبلاً روی هم می‌افتادند */
    .month-wd { padding: 8px 2px; }
    .month-wd .wd-full { display: none; }
    .month-wd .wd-short { display: inline; }
    .mday .day-title { display: none; }
    .mday .ev { display: none; }
    .mday .has-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-strong); }
    .agenda { display: block; }
    .site-nav { display: none; }
    .table th, .table td { padding: 10px 12px; }
}
@media (min-width: 861px) { .mday .has-dot { display: none; } .day-body { display: contents; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── Error pages ── */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.error-card { max-width: 440px; text-align: center; align-items: center; display: flex; flex-direction: column; gap: 10px; }
.error-code { font: 800 44px/1 var(--mono); color: var(--accent-strong, var(--text)); direction: ltr; }
.error-card .actions { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }

/* ── Phase 3: code editor ── */
.cm { position: relative; display: flex; direction: ltr; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; min-height: 380px; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.cm.is-focused { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cm-gutter { flex: none; width: 46px; overflow: hidden; background: var(--surface-3); color: var(--muted); text-align: right; user-select: none; }
.cm-gutter-inner { padding: 8px 8px 8px 0; }
.cm-gutter span { display: block; height: calc(1em * 1.6); line-height: 1.6; font-size: inherit; }   /* هم‌اندازه‌ی خط کد؛ ۱۲px با 1.6em خط‌به‌خط عقب می‌ماند */
.cm-gutter span.is-active { color: var(--text); font-weight: 700; }
.cm-gutter span.has-error { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.cm-gutter span.has-warning { background: var(--warning-soft); color: var(--warning); font-weight: 700; }
.cm-body { position: relative; flex: 1; min-width: 0; }
.cm-highlight, .cm-input { position: absolute; inset: 0; margin: 0; padding: 8px 12px; font: inherit; line-height: inherit; tab-size: 4; white-space: pre; overflow: auto; border: 0; border-radius: 0; background: transparent; direction: ltr; text-align: left; }
.cm-highlight { pointer-events: none; color: var(--text); overflow: hidden; }
.cm-input { color: transparent; caret-color: var(--text); resize: none; min-height: 380px; box-shadow: none !important; z-index: 2; }
.cm-input::selection { background: color-mix(in srgb, var(--info) 30%, transparent); color: transparent; }
.cm-activeline { position: absolute; inset-inline: 0; top: 0; background: color-mix(in srgb, var(--text) 5%, transparent); pointer-events: none; }
.cm-marks { position: absolute; inset: 0; pointer-events: none; }
.cm-mark { position: absolute; inset-inline: 0; border-bottom: 2px wavy var(--danger); background: color-mix(in srgb, var(--danger) 7%, transparent); }
.cm-mark.is-warning { border-bottom-color: var(--warning); background: color-mix(in srgb, var(--warning) 7%, transparent); }
.cm-measure { position: absolute; visibility: hidden; white-space: pre; }
.cm-popup { position: absolute; z-index: 10; width: 280px; max-height: 220px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-pop); font-size: 12px; }
.cm-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; }
.cm-item.is-active, .cm-item:hover { background: var(--accent-soft); }
.cm-item small { margin-inline-start: auto; color: var(--muted); }
.tk-keyword { color: #a626a4; font-weight: 700; } .tk-type { color: #c18401; } .tk-string { color: #50a14f; } .tk-number { color: #986801; }
.tk-comment { color: var(--muted); font-style: italic; } .tk-call { color: #4078f2; } .tk-annotation { color: #e45649; }
[data-theme="dark"] .tk-keyword { color: #c678dd; } [data-theme="dark"] .tk-type { color: #e5c07b; } [data-theme="dark"] .tk-string { color: #98c379; } [data-theme="dark"] .tk-call { color: #61afef; } [data-theme="dark"] .tk-number { color: #d19a66; }
.code-static .ln { display: block; padding-inline-start: 3.5em; position: relative; }
.code-static .ln::before { content: attr(data-line); position: absolute; left: 0; width: 2.5em; text-align: right; color: var(--muted); }
.code-static .ln.is-error { background: var(--danger-soft); }
.editor-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.editor-tools { display: flex; gap: 2px; flex-wrap: wrap; margin-inline-end: auto; }
.lang-select { width: 120px; }
.lint-panel { margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.lint-panel header { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; }
.lint-panel ul, .diag-list { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow-y: auto; }
.lint-panel li, .diag-list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border-top: 1px solid var(--border); font-size: 12px; cursor: pointer; }
.lint-panel li:first-child { border-top: 0; }
.lint-panel li:hover, .diag-list li:hover { background: var(--surface-2); }
.lint-panel li .fix { margin-inline-start: auto; }
.diag-line { flex: none; font-weight: 700; color: var(--danger); min-width: 48px; }
li.is-warning .diag-line { color: var(--warning); }
.diag-list small { display: block; color: var(--muted); }
.workspace-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.editor-status { margin-inline-end: auto; font-size: 12px; }
.custom-run summary, .answer-guide summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.test-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.test-chip { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--surface-3); }
.t-ok, .t-done { background: var(--success-soft); color: var(--success); }
.t-wrong, .t-runtime_error { background: var(--danger-soft); color: var(--danger); }
.t-time_limit { background: var(--warning-soft); color: var(--warning); }
.test-detail { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.test-detail summary { cursor: pointer; font-size: 13px; }
.test-io { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 8px; }
.test-io span { font-size: 11px; color: var(--muted); }
.file-box { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; }
.file-row > i { font-size: 20px; color: var(--accent-strong); }
.file-row .grow { flex: 1; min-width: 0; } .file-row small { display: block; color: var(--muted); font-size: 12px; }
.sub-row .grow { display: block; } .sub-row.is-final { background: var(--accent-soft); }
.icon-btn.is-on { color: var(--accent-strong); border-color: var(--accent); }
.final-note { font-size: 13px; padding-bottom: 4px; }
.notice--danger { background: var(--danger-soft); } .notice--danger i { color: var(--danger); }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface-2); }
.student-strip { display: flex; align-items: center; gap: 12px; } .student-strip .grow { flex: 1; } .student-strip small { display: block; color: var(--muted); }
.review-grid { display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
.quick-scores { display: flex; gap: 4px; flex-wrap: wrap; }
/* ── Phase 3: manage ── */
.manage-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.manage-layout.no-guide { grid-template-columns: minmax(0, 1fr); }
.guide { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.guide summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 14px 16px; }
.guide summary i:first-child { color: var(--accent-strong); font-size: 18px; } .guide summary .chev { margin-inline-start: auto; }
.guide-body { padding: 0 16px 16px; font-size: 13px; color: var(--text-2); display: grid; gap: 10px; }
.guide-body ol, .guide-body ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.guide-type { display: flex; gap: 8px; padding: 8px; border-radius: 10px; background: var(--surface-2); margin-bottom: 6px; }
.guide-type i { font-size: 18px; color: var(--accent-strong); } .guide-type p { font-size: 12px; color: var(--muted); }
.guide-example { white-space: pre-wrap; font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 8px; }
.form-section-head { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px 0; }
.form-section-head p { font-size: 12px; color: var(--muted); }
.field .req { color: var(--danger); } .field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.inline-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.inline-row-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.inline-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .inline-grid .half { grid-column: span 2; }
.form-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.resource-card { display: flex; gap: 12px; align-items: center; padding: 14px 16px; } .resource-card:hover { border-color: var(--border-strong); }
.resource-card .grow { flex: 1; min-width: 0; } .resource-card small { display: block; font-size: 12px; color: var(--muted); }
.count-pill { font-weight: 900; font-size: 13px; color: var(--muted); }
.group-title { font-size: 13px; color: var(--muted); }
.filter-bar { flex-wrap: wrap; align-items: center; } .filter-bar select { width: auto; min-width: 160px; }
@media (max-width: 1080px) { .manage-layout { grid-template-columns: minmax(0, 1fr); } .guide { position: static; max-height: none; } }
@media (max-width: 860px) { .review-grid, .inline-grid { grid-template-columns: minmax(0, 1fr); } .inline-grid .half { grid-column: auto; } }

/* ── Phase 4: موبایل ── */
.menu-toggle { display: none; }
.inline-row.is-new { border-style: dashed; }
@media (max-width: 860px) {
    .menu-toggle { display: inline-grid; }
    .sidebar { display: flex; position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; width: min(290px, 84vw);
        transform: translateX(100%); transition: transform .2s ease; overflow-y: auto; box-shadow: var(--shadow-pop); }
    .sidebar.is-open { transform: none; }
    body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 55; }
    .form-actions { bottom: calc(60px + env(safe-area-inset-bottom)); }
    .editor-toolbar { gap: 6px; } .lang-select { width: 100%; }
    .editor-tools .btn span { display: none; }
    .workspace-actions .btn { flex: 1 1 140px; justify-content: center; }
    .editor-status { flex-basis: 100%; }
    .cm, .cm-input { min-height: 300px; }
    .cm-popup { width: min(280px, calc(100% - 56px)); }
    .problem-meta { flex-wrap: wrap; }
    .page-head { flex-wrap: wrap; gap: 8px; }
    .filter-bar select { min-width: 0; flex: 1 1 140px; }
    .inline-row { padding: 10px; }
    .notif-panel { position: fixed; top: 60px; inset-inline: 8px; left: 8px; width: auto; }
}
/* جلوگیری از zoom خودکار iOS هنگام فوکوس روی input (فونت کمتر از ۱۶px) */
@media (max-width: 860px) and (pointer: coarse) {
    input, select, textarea, .cm { font-size: 16px !important; }
}

/* ========================================
   نفرات برتر و رده‌بندی (توکن‌های سیستم طراحی؛ حالت شب/روز را خراب نمی‌کند)
   ======================================== */
.podium { display: flex; flex-direction: column; }
.podium .list-item .rank { flex: none; }

.podium-card { padding: 22px 20px 24px; background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--surface); }
.podium-stage { display: grid; grid-template-columns: 1fr 1.25fr 1fr; align-items: end; gap: 12px; }
.podium-col { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.podium-col--1 { order: 2; }
.podium-col--2 { order: 1; }
.podium-col--3 { order: 3; }
.podium-person { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 10px; min-width: 0; max-width: 100%; }
.podium-person strong { font-size: 13px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.podium-person small { font-size: 11px; color: var(--muted); }
.podium-crown { font-size: 22px; color: var(--accent-strong); margin-bottom: -2px; }
.podium-avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 15px;
    background: var(--surface-3); color: var(--text); border: 3px solid var(--border-strong); }
.podium-col--1 .podium-avatar { width: 62px; height: 62px; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.podium-col--2 .podium-avatar { border-color: #9aa0a8; }
.podium-col--3 .podium-avatar { border-color: #c48a52; }
.podium-col.is-me .podium-avatar { outline: 2px dashed var(--accent-strong); outline-offset: 3px; }
.podium-block { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px 12px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-2); border: 1px solid var(--border); border-bottom: 0; }
.podium-col--1 .podium-block { min-height: 118px; background: var(--accent-soft); border-color: var(--accent); }
.podium-col--2 .podium-block { min-height: 92px; }
.podium-col--3 .podium-block { min-height: 76px; }
.podium-rank { font-size: 26px; font-weight: 900; line-height: 1; color: var(--text); }
.podium-col--1 .podium-rank { color: var(--accent-strong); }
.podium-points { font-size: 12px; font-weight: 700; color: var(--text-2); }
.podium-points small { font-size: 11px; color: var(--muted); margin-inline-start: 4px; font-weight: 400; }

.rank-tag { margin-inline-start: 4px; }
.board-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.board-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); transition: background .15s; }
.board-row:first-child { border-top: 0; }
.board-row:hover { background: var(--surface-2); }
.board-row.is-me { background: var(--accent-soft); }
.board-row--pinned { border-top: 2px dashed var(--border-strong); }
.board-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.board-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.board-name strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.board-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.board-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.board-points { flex: none; min-width: 84px; text-align: left; font-weight: 900; font-size: 15px; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.board-points small { font-size: 11px; font-weight: 400; color: var(--muted); }
.level-chip { display: inline-flex; height: 20px; align-items: center; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 700;
    background: color-mix(in srgb, var(--lv, var(--accent)) 16%, transparent); color: var(--text-2); }
.badge--accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.stat--me { border-color: var(--accent); }

.points-layout { align-items: start; }
.points-direction { display: flex; gap: 8px; flex-wrap: wrap; }
.points-dir { flex: 1; min-width: 140px; cursor: pointer; }
.points-dir input { position: absolute; opacity: 0; pointer-events: none; }
.points-dir span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--text-2); }
.points-dir input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.points-dir input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.points-chip { flex: none; min-width: 58px; text-align: center; padding: 4px 10px; border-radius: 99px; font-weight: 900; font-size: 13px; }
.points-chip.is-plus { background: var(--success-soft); color: var(--success); }
.points-chip.is-minus { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 768px) {
    .podium-stage { gap: 8px; }
    .podium-avatar { width: 44px; height: 44px; font-size: 13px; }
    .podium-col--1 .podium-avatar { width: 52px; height: 52px; }
    .podium-rank { font-size: 20px; }
    .board-row { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
    .board-points { min-width: 0; }
}

/* ── پنل مدیریت: وضعیت سرورها و نقشه‌ی راه ── */
.srv-overall { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.srv-overall small { color: var(--muted); font-size: 12px; }
.srv-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.srv-warning .srv-dot { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.srv-danger .srv-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.srv-issues { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.srv-issues li { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.srv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.srv-wide { grid-column: 1 / -1; }
.srv-body { display: grid; gap: 14px; padding-top: 14px; }
.srv-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.srv-facts div { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.srv-facts span { font-size: 11px; color: var(--muted); }
.srv-facts strong { font-size: 13px; overflow-wrap: anywhere; }
.meter { display: grid; gap: 4px; }
.meter-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.meter-top strong { font-weight: 900; }
.meter-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter-bar span { display: block; height: 100%; border-radius: inherit; background: var(--success); transition: width .4s; }
.meter-warning .meter-bar span { background: var(--warning); }
.meter-danger .meter-bar span { background: var(--danger); }
.meter-unknown .meter-bar span { background: var(--surface-3); }
.meter small { font-size: 11px; color: var(--muted); }
.judge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.judge-card { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.judge-card.judge-danger, .judge-card.judge-down { border-color: var(--danger); }
.judge-card.judge-warning { border-color: var(--warning); }
.judge-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.judge-top strong { font-size: 13px; overflow-wrap: anywhere; }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.small { font-size: 12px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.auth-state { display: grid; justify-items: center; text-align: center; gap: 8px; margin-bottom: 18px; }
.auth-state h1 { font-size: 18px; }
.auth-state p { color: var(--muted); font-size: 13px; }
.auth-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: var(--accent-soft); color: var(--accent-strong); }
.auth-icon.is-success { background: var(--success-soft); color: var(--success); }
.auth-icon.is-warning { background: var(--warning-soft); color: var(--warning); }
.auth-icon.is-danger { background: var(--danger-soft); color: var(--danger); }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; }
@media (max-width: 860px) { .srv-grid { grid-template-columns: minmax(0, 1fr); } .srv-facts { grid-template-columns: minmax(0, 1fr); } }

/* ── انتخاب‌گر تاریخ شمسی (static/js/datepicker.js) ── */
.jd-wrap { position: relative; display: block; }
.jd-wrap > input { padding-left: 40px; width: 100%; }
.jd-btn { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.jd-btn:hover, .jd-btn[aria-expanded="true"] { color: var(--accent-strong); background: var(--surface-2); }
.jd-pop { position: absolute; z-index: 80; top: calc(100% + 6px); left: 0; width: 292px; padding: 12px; direction: rtl;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.jd-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.jd-head select { flex: 1; min-width: 0; height: 34px; padding: 0 8px; font-size: 13px; }
.jd-nav { width: 32px; height: 32px; flex: none; }
.jd-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jd-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.jd-wd.is-friday, .jd-cell.is-friday { color: var(--danger); }
.jd-cell { aspect-ratio: 1; border: 0; border-radius: 50%; background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.jd-cell:hover { background: var(--surface-2); }
.jd-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 900; }
.jd-cell.is-selected { background: var(--accent); color: var(--accent-text); font-weight: 900; }
.jd-cell.is-empty { pointer-events: none; }
.jd-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.jd-time { display: flex; align-items: center; gap: 6px; margin-inline-end: auto; color: var(--muted); }
.jd-time input { height: 32px; width: 110px; direction: ltr; }
@media (max-width: 560px) {
    /* موبایل: پایین صفحه، تمام‌عرض */
    .jd-pop { position: fixed; top: auto; bottom: calc(68px + env(safe-area-inset-bottom)); left: 12px; right: 12px; width: auto; }
    .jd-cell { font-size: 15px; }
}

/* ───────── فاز ۲: آواتار، تکمیل پروفایل، علاقه‌مندی‌ها، صف تأیید ───────── */
.avatar.has-img { background: var(--surface-2); overflow: hidden; padding: 0; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.avatar--xl { width: 88px; height: 88px; font-size: 26px; }
button.link { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

.avatar-edit { position: relative; display: inline-flex; border-radius: 50%; flex: none; }
.avatar-edit .avatar { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--accent-soft); }
.avatar-edit__btn { position: absolute; inset-inline-end: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent); color: var(--accent-text); border: 3px solid var(--surface); font-size: 14px; transition: transform .15s; }
.avatar-edit:hover .avatar-edit__btn, .avatar-edit:focus-visible .avatar-edit__btn { transform: scale(1.1); }

.profile-hero { margin-bottom: 16px; overflow: hidden; }
.profile-hero .profile-head { background: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.profile-hero h1 { font-size: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.chip i { color: var(--accent-strong); font-size: 14px; }

.completion { padding: 14px 20px 18px; border-top: 1px solid var(--border); }
.completion__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.completion__bar { height: 8px; margin: 10px 0 12px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.completion__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #f3c94a); transition: width .4s; }
.completion__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.completion__steps a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); font-size: 12px; font-weight: 700; color: var(--text-2); min-height: 44px; }
.completion__steps a:hover { border-color: var(--accent); background: var(--accent-soft); }
.completion__steps i { font-size: 17px; color: var(--accent-strong); }
.completion__steps span { flex: 1; }
.completion__steps small { color: var(--accent-strong); font-weight: 900; }
.completion__steps .is-done a { border-style: solid; color: var(--muted); }
.completion__steps .is-done i, .completion__steps .is-done small { color: var(--success); font-weight: 700; }

.profile-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.profile-edit .card h2 i { color: var(--accent-strong); }
.profile-edit section { scroll-margin-top: 80px; }
.profile-edit section:target { box-shadow: 0 0 0 2px var(--accent); }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 10px; margin-top: 10px; }
.preset { position: relative; cursor: pointer; border-radius: 50%; aspect-ratio: 1; }
.preset input { position: absolute; opacity: 0; pointer-events: none; }
.preset img { width: 100%; height: 100%; border-radius: 50%; display: block; transition: transform .15s, box-shadow .15s; }
.preset:hover img { transform: translateY(-2px); }
.preset input:focus-visible + img { outline: 2px solid var(--info); outline-offset: 2px; }
.preset input:checked + img { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.upload-tile { display: flex; align-items: center; gap: 14px; padding: 14px; border: 2px dashed var(--border-strong); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background .15s; }
.upload-tile:hover, .upload-tile:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.upload-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload-tile__preview { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 26px; color: var(--muted); overflow: hidden; }
.upload-tile__preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-tile__text { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.upload-tile__text small { font-size: 12px; line-height: 1.7; }
.upload-tile.is-error { border-color: var(--danger); background: var(--danger-soft); }
.chip-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.chip--pick { cursor: pointer; height: 36px; padding: 0 12px; user-select: none; transition: background .15s, border-color .15s; }
.chip--pick input { position: absolute; opacity: 0; pointer-events: none; }
.chip--pick:hover { border-color: var(--accent); }
.chip--pick:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip--pick:has(input:checked) i { color: var(--accent-text); }
.chip--pick:has(input:focus-visible) { outline: 2px solid var(--info); outline-offset: 2px; }

/* صف تأیید ادمین */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-bar input[type=search] { flex: 1; min-width: 180px; }
.review-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.review-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.review-card__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.review-card__who div { min-width: 0; }
.review-card__who strong, .review-card__who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-card__who small { font-size: 12px; color: var(--muted); }
.review-card__compare { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.review-card__compare img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; }
.review-card__compare .avatar { width: 56px; height: 56px; opacity: .7; }
.review-card__bio { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-card__old { font-size: 12px; color: var(--muted); }
.review-card details { font-size: 13px; }
.review-card summary { cursor: pointer; color: var(--danger); font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.review-card .reject-box { display: grid; gap: 8px; margin-top: 8px; }

@media (max-width: 860px) {
    .profile-edit { grid-template-columns: minmax(0, 1fr); }
    .profile-head { text-align: center; justify-content: center; }
    .profile-head .chips, .profile-head .actions { justify-content: center; }
    .avatar--xl { width: 76px; height: 76px; }
}
@media (max-width: 560px) {
    .completion__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .completion__steps a { padding: 8px; font-size: 11px; gap: 6px; }
    .completion__steps i { font-size: 15px; }
}

/* دوستان و تولد */
.tone-birthday { --tone: #c2417a; --tone-soft: #fbe4ef; }
[data-theme="dark"] .tone-birthday { --tone: #f08cb8; --tone-soft: rgba(240, 140, 184, .14); }
.nav-count { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 900; display: inline-grid; place-items: center; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.person-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 12px 14px; text-align: center; }
.person-card__link { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; width: 100%; }
.person-card__link strong { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card__link small { font-size: 12px; color: var(--muted); line-height: 1.6; }
.person-card__link:hover strong { color: var(--accent-strong); }
.bday-list { display: flex; gap: 10px; overflow-x: auto; padding: 12px 20px 18px; scroll-snap-type: x mandatory; }
.bday { flex: none; min-width: 170px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius);
    background: var(--tone-soft, #fbe4ef); border: 1px solid transparent; --tone: #c2417a; --tone-soft: #fbe4ef; }
[data-theme="dark"] .bday { --tone: #f08cb8; --tone-soft: rgba(240, 140, 184, .14); }
.bday__when { font-size: 11px; font-weight: 900; color: var(--tone); }
.bday strong { font-size: 13px; }
.bday small { font-size: 12px; color: var(--muted); }
.bday.is-today { border-color: var(--tone); box-shadow: 0 6px 18px rgba(194, 65, 122, .18); }
.bday:hover { border-color: var(--tone); }
@media (max-width: 560px) { .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* امتیاز کل: tooltip صفحه‌ی اول، کارت ریز امتیاز، هدیه */
.top-list { list-style: none; margin: 0; padding: 0; }
.top-row .grow strong { font-size: 13px; }
.score-pop { position: relative; flex: none; }
.score-pop__btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--surface-2); color: var(--text); border-radius: 99px; padding: 4px 10px;
    font: inherit; font-weight: 900; font-size: 13px; cursor: help; min-height: 32px; }
.score-pop__btn i { color: var(--muted); font-size: 14px; }
.score-pop__panel { position: absolute; z-index: 30; inset-inline-end: 0; top: calc(100% + 6px); width: 230px; padding: 12px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); display: grid; gap: 6px; font-size: 12px;
    opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; }
.score-pop__panel > strong { font-size: 12px; margin-bottom: 2px; }
.score-pop:hover .score-pop__panel, .score-pop:focus-within .score-pop__panel { opacity: 1; visibility: visible; transform: none; }
.score-pop__row { display: flex; align-items: center; gap: 6px; }
.score-pop__row i { color: var(--accent-strong); }
.score-pop__row span { flex: 1; color: var(--text-2); }
.score-pop__row b.is-minus, .score-bars .is-minus b { color: var(--danger); }
.top-list li:nth-last-child(-n+3) .score-pop__panel { top: auto; bottom: calc(100% + 6px); }
.stat small { display: block; font-size: 11px; margin-top: 2px; }
.score-card .card-head .num { font-size: 18px; font-weight: 900; color: var(--accent-strong); }
.score-bars { list-style: none; margin: 0; padding: 12px 20px 18px; display: grid; gap: 10px; }
.score-bars li { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12px; }
.score-bars__label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.score-bars__label i { color: var(--accent-strong); font-size: 15px; }
.score-bars__track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.score-bars__track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #f3c94a); }
.score-bars .is-minus .score-bars__track span { background: var(--danger); }
.score-bars b { font-weight: 900; min-width: 36px; text-align: left; }
.gift-form { display: grid; gap: 10px; }
.gift-amounts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) { .score-bars li { grid-template-columns: 100px minmax(0, 1fr) auto; } }

/* دوئل */
.duel-hero { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 20px; flex-wrap: wrap;
    background: linear-gradient(135deg, var(--accent-soft), transparent 65%); }
.duel-hero h1 { font-size: 20px; display: flex; align-items: center; gap: 8px; } .duel-hero h1 i { color: var(--accent-strong); }
.duel-hero__text { flex: 1; min-width: 240px; } .duel-hero p { margin: 6px 0 10px; font-size: 13px; line-height: 1.9; }
.duel-record { display: flex; gap: 8px; }
.duel-record div { min-width: 64px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); text-align: center; }
.duel-record strong { display: block; font-size: 22px; font-weight: 900; } .duel-record small { font-size: 11px; color: var(--muted); }
.duel-record div:first-child strong { color: var(--success); } .duel-record div:last-child strong { color: var(--danger); }
.duel-live { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; border-color: var(--accent); }
.duel-live strong { display: block; font-size: 14px; } .duel-live small { font-size: 12px; color: var(--muted); }
.duel-live__pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 0 rgba(201, 54, 44, .5); animation: duel-pulse 1.4s infinite; flex: none; }
@keyframes duel-pulse { 70% { box-shadow: 0 0 0 10px rgba(201, 54, 44, 0); } 100% { box-shadow: 0 0 0 0 rgba(201, 54, 44, 0); } }
.duel-timer { font-family: var(--mono); font-weight: 900; font-size: 18px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--surface-2); direction: ltr; }
.duel-timer.is-urgent { background: var(--danger-soft); color: var(--danger); }
.duel-timer--big { font-size: 34px; padding: 8px 18px; }
.duel-board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 28px 20px; margin-bottom: 16px; }
.duel-board.is-live { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.duel-side { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.duel-side strong { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-side.is-winner .avatar { box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--success); }
.duel-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.duel-vs { font-size: 28px; font-weight: 900; color: var(--accent-strong); letter-spacing: 2px; }
.duel-result { flex: none; min-width: 56px; text-align: center; font-size: 11px; font-weight: 900; padding: 4px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.duel-result.is-win { background: var(--success-soft); color: var(--success); } .duel-result.is-loss { background: var(--danger-soft); color: var(--danger); }
.duel-result.is-draw { background: var(--info-soft); color: var(--info); }
.num.is-plus { color: var(--success); } .num.is-minus { color: var(--danger); }
@media (max-width: 560px) {
    .duel-board { grid-template-columns: 1fr; padding: 20px 12px; }
    .duel-mid { order: -1; }
    .duel-board .avatar--xl { width: 64px; height: 64px; }
    .duel-timer--big { font-size: 28px; }
}

/* گزارش مشکل سؤال */
.report-box { border-top: 1px dashed var(--border-strong); padding-top: 12px; }
.report-box summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--text-2); min-height: 36px; list-style: none; }
.report-box summary::-webkit-details-marker { display: none; }
.report-box summary i { color: var(--danger); font-size: 17px; }
.report-box summary:hover { color: var(--text); }
.report-box__body { display: grid; gap: 12px; margin-top: 10px; }
.report-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.report-item small { font-size: 12px; color: var(--muted); } .report-item p { flex-basis: 100%; margin: 0; }
.report-kinds { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.report-kinds legend { margin-bottom: 6px; }
.report-kinds .chip--pick { height: auto; min-height: 34px; padding: 6px 12px; }
.queue-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.queue-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.queue-link > i:first-child { font-size: 22px; color: var(--muted); }
.queue-link strong { display: block; font-size: 14px; } .queue-link small { font-size: 12px; color: var(--muted); }
.queue-link.has-items { border-color: var(--warning); } .queue-link.has-items > i:first-child { color: var(--warning); }
@media (max-width: 640px) { .queue-links { grid-template-columns: minmax(0, 1fr); } }

/* آموزش و بانک سؤال */
.learn-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 22px; margin-bottom: 16px; background: linear-gradient(135deg, var(--info-soft), transparent 70%); }
.learn-hero h1 { font-size: 20px; display: flex; gap: 8px; align-items: center; } .learn-hero h1 i { color: var(--info); }
.learn-hero p { margin: 6px 0 0; font-size: 13px; line-height: 1.9; max-width: 560px; }
.learn-hero__bank { display: grid; gap: 4px; justify-items: center; padding: 14px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-align: center; }
.learn-hero__bank strong { font-size: 26px; font-weight: 900; } .learn-hero__bank strong small { font-size: 13px; color: var(--muted); }
.learn-hero__bank > span:not(.btn) { font-size: 12px; color: var(--muted); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); } .chip.is-on i { color: inherit; }
a.chip:hover { border-color: var(--accent); }
.path-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.path-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-top: 4px solid var(--path, var(--accent)); transition: transform .15s, box-shadow .15s; }
.path-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.path-card strong { font-size: 15px; } .path-card > small { font-size: 12px; color: var(--muted); line-height: 1.8; }
.path-card .chips { margin: 0; } .path-card .chip { height: 24px; font-size: 11px; }
.path-card__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex: none;
    background: color-mix(in srgb, var(--path, var(--accent)) 16%, transparent); color: var(--path, var(--accent-strong)); }
.path-card__progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: auto; }
.path-card__progress span { display: block; height: 100%; background: var(--path, var(--accent)); border-radius: inherit; }
.path-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 20px; margin-bottom: 16px; border-top: 4px solid var(--path); }
.path-head h1 { font-size: 20px; margin: 4px 0; } .path-head p { margin: 0 0 10px; font-size: 13px; }
.path-head .path-card__progress { margin: 8px 0 4px; max-width: 420px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 17px; top: 10px; bottom: 10px; width: 2px; background: var(--border); }
.timeline__item { display: flex; gap: 12px; align-items: center; position: relative; }
.timeline__dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); border: 2px solid var(--border-strong); color: var(--muted); z-index: 1; }
.timeline__item.is-done .timeline__dot { background: var(--success); border-color: var(--success); color: #fff; }
.timeline__item.is-next .timeline__dot { border-color: var(--accent); color: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline__card { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-width: 0; }
.timeline__card strong { display: block; font-size: 14px; } .timeline__card small { font-size: 12px; color: var(--muted); }
.timeline__item.is-next .timeline__card { border-color: var(--accent); }
.step-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.lesson h1 { font-size: 22px; margin: 8px 0 14px; }
.lesson-body { font-size: 15px; line-height: 2.1; } .lesson-body p { margin: 0 0 12px; }
.lesson-code { margin: 12px 0; padding: 14px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 13px; line-height: 1.7; text-align: left; }
.lesson-foot { justify-content: space-between; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 18px; }
.step-nav { position: sticky; top: 80px; } .step-nav ol { list-style: none; margin: 0; padding: 8px; display: grid; gap: 2px; }
.step-nav a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); }
.step-nav a:hover { background: var(--surface-2); } .step-nav a.is-current { background: var(--accent-soft); color: var(--text); font-weight: 700; }
.step-nav a.is-done i { color: var(--success); } .step-nav i { color: var(--muted); }
.bank-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .bank-filters input[type=search] { flex: 1 1 220px; }
.bank-filters select { width: auto; flex: 1 1 150px; }
.bank-filters input[type=search] { width: auto; }
.filter-bar select, .filter-bar input[type=search] { width: auto; }
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.bank-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding: 12px 20px 18px; scroll-snap-type: x mandatory; }
.bank-strip .bank-card { scroll-snap-align: start; }
.bank-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; transition: border-color .15s, transform .15s; }
.bank-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.bank-card strong { font-size: 14px; } .bank-card .chips { margin: 0; } .bank-card .chip { height: 24px; font-size: 11px; }
.bank-card.is-solved { background: color-mix(in srgb, var(--success-soft) 55%, var(--surface)); }
.bank-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.diff { font-size: 11px; font-weight: 900; padding: 3px 10px; border-radius: 99px; }
.diff-easy { background: var(--success-soft); color: var(--success); } .diff-medium { background: var(--warning-soft); color: var(--warning); } .diff-hard { background: var(--danger-soft); color: var(--danger); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; }
@media (max-width: 900px) { .step-layout { grid-template-columns: minmax(0, 1fr); } .step-nav { position: static; order: -1; } .step-nav ol { display: flex; overflow-x: auto; } .step-nav a { white-space: nowrap; } }

/* «به زودی» */
.soon { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; text-align: center; }
.soon__icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 26px;
    background: var(--accent-soft); color: var(--accent-strong); animation: soon-float 3s ease-in-out infinite; }
.soon__badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 900; padding: 3px 10px; border-radius: 99px;
    background: var(--accent); color: var(--accent-text); letter-spacing: .3px; }
.soon strong { font-size: 15px; } .soon small { font-size: 12px; color: var(--muted); max-width: 360px; line-height: 1.8; }
.list .soon, .timeline .soon { padding: 24px 16px; }
@keyframes soon-float { 50% { transform: translateY(-4px); } }
.path-group { margin-bottom: 20px; }
.path-group__title { font-size: 14px; margin: 0 4px 10px; display: flex; align-items: center; gap: 6px; }
.path-group__title a:hover { color: var(--accent-strong); }
.notif-setting { cursor: pointer; }
.notif-setting small { white-space: normal !important; line-height: 1.7; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: inset-inline-start .15s; }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { inset-inline-start: 21px; }
.switch input:focus-visible + span { outline: 2px solid var(--info); outline-offset: 2px; }

/* ───────── تقویم گرافیکی ───────── */
.cal { --season: var(--accent); --season-soft: var(--accent-soft); overflow: hidden; }
.cal.season-spring { --season: #2f9e5b; --season-soft: rgba(47, 158, 91, .12); }
.cal.season-summer { --season: #e0ad1f; --season-soft: rgba(224, 173, 31, .14); }
.cal.season-autumn { --season: #d9622b; --season-soft: rgba(217, 98, 43, .13); }
.cal.season-winter { --season: #2f6fd6; --season-soft: rgba(47, 111, 214, .13); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px;
    background: linear-gradient(135deg, var(--season-soft), transparent 70%); border-bottom: 1px solid var(--border); }
.cal-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cal-title h2 { font-size: 18px; }
.cal-month-badge { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; font-weight: 900; font-size: 18px;
    background: var(--season); color: #fff; box-shadow: 0 6px 16px var(--season-soft); font-family: var(--mono); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
.cal-legend__item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.cal-legend__item i { width: 8px; height: 8px; border-radius: 50%; background: var(--tone, var(--accent)); }
.cal-legend__item b { color: var(--text); }
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
.cal .month { border-top: 0; }
.cal .mday { font: inherit; color: inherit; text-align: start; background: transparent; border-top: 0; border-inline-end: 0; cursor: pointer;
    min-height: 96px; transition: background .12s; position: relative; }
.cal .mday:hover { background: var(--surface-2); }
.cal .mday:focus-visible { outline: 2px solid var(--info); outline-offset: -2px; }
.cal .mday.is-friday { background: color-mix(in srgb, var(--danger-soft) 35%, transparent); }
.cal .mday.is-past .num { opacity: .55; }
.cal .mday.is-today .num { background: var(--season); color: #fff; box-shadow: 0 0 0 4px var(--season-soft); opacity: 1; }
.cal .mday.is-selected { background: var(--season-soft); box-shadow: inset 0 0 0 2px var(--season); }
.cal .mday .more { font-size: 10px; color: var(--muted); }
.cal .mday .dots { display: none; gap: 3px; justify-content: center; }
.cal .mday .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--tone, var(--accent)); }
.cal-day { border-inline-start: 1px solid var(--border); padding: 14px; background: var(--surface-2); min-height: 100%; }
.cal-day__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-day__head strong { font-size: 14px; }
.cal-item { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 8px; border-radius: var(--radius-sm); background: var(--surface);
    border-inline-start: 3px solid var(--tone, var(--border-strong)); }
.cal-item strong { display: block; font-size: 13px; } .cal-item small { display: block; font-size: 11px; color: var(--muted); }
a.cal-item:hover { box-shadow: var(--shadow-sm); }
.cal-day__free { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 8px; color: var(--muted); font-size: 13px; text-align: center; }
.cal-day__free i { font-size: 24px; }
@media (max-width: 1080px) { .cal-body { grid-template-columns: minmax(0, 1fr); } .cal-day { border-inline-start: 0; border-top: 1px solid var(--border); } }
@media (max-width: 860px) {
    .cal .mday { min-height: 54px; align-items: center; padding: 6px 2px; }
    .cal .mday .ev, .cal .mday .more, .cal .mday .day-title { display: none; }
    .cal .mday .dots { display: flex; }
    .cal .mday .has-dot { display: none; }
    .cal-month-badge { width: 40px; height: 40px; font-size: 16px; }
}

/* ───────── داشبورد ───────── */
.home-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px; margin-bottom: 14px;
    background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 55%), var(--surface); }
.home-hero__me { display: flex; align-items: center; gap: 16px; min-width: 0; }
.home-hero__me h1 { font-size: 22px; margin-bottom: 2px; } .home-hero__me p { margin: 0 0 4px; font-size: 13px; }
.home-hero__avatar { position: relative; display: inline-flex; border-radius: 50%; flex: none; }
.home-hero__avatar .ring { position: absolute; inset: -6px; border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0); }
.home-hero__score { display: grid; justify-items: center; gap: 4px; padding: 14px 22px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); min-width: 170px; }
.home-hero__score .label { font-size: 12px; color: var(--muted); }
.home-hero__score strong { font-size: 30px; font-weight: 900; line-height: 1.1; color: var(--accent-strong); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
    border: 1px solid var(--border); transition: transform .15s, box-shadow .15s, border-color .15s; --t: var(--accent); --t-soft: var(--accent-soft); min-width: 0; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--t); }
.tile > i { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: none; background: var(--t-soft); color: var(--t); }
.tile div { min-width: 0; } .tile strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile--gold { --t: var(--accent-strong); --t-soft: var(--accent-soft); }
.tile--red { --t: var(--danger); --t-soft: var(--danger-soft); }
.tile--pink { --t: #c2417a; --t-soft: #fbe4ef; }
[data-theme="dark"] .tile--pink { --t: #f08cb8; --t-soft: rgba(240, 140, 184, .14); }
.tile--blue { --t: var(--info); --t-soft: var(--info-soft); }
.tile.is-live { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.tile .duel-timer { font-size: 13px; padding: 2px 8px; }
.tile__count { position: absolute; top: 8px; inset-inline-end: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center;
    font-size: 11px; font-weight: 900; background: var(--t); color: #fff; }
@media (max-width: 1080px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
    .home-hero { padding: 16px; } .home-hero__me h1 { font-size: 18px; } .home-hero__score { width: 100%; }
    .tiles { gap: 8px; } .tile { padding: 12px; gap: 10px; } .tile > i { width: 36px; height: 36px; font-size: 18px; }
}

/* ───────── صفحه‌ی اول (طراحی جدید) ───────── */
.btn-lg { height: 46px; padding: 0 20px; font-size: 14px; border-radius: 12px; }
.hero2 { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; padding: 56px 0 36px; }
.hero2::before { content: ""; position: absolute; inset: -40px -10% auto; height: 520px; z-index: -1; pointer-events: none;
    background: radial-gradient(40% 50% at 75% 30%, var(--accent-soft), transparent 70%),
                radial-gradient(35% 45% at 15% 70%, var(--info-soft), transparent 70%);
    -webkit-mask: linear-gradient(#000 60%, transparent); mask: linear-gradient(#000 60%, transparent); }
.hero2__eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 700;
    background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 14px; }
.hero2 h1 { font-size: clamp(32px, 5.2vw, 54px); font-weight: 900; line-height: 1.25; margin: 0 0 14px; }
.hero2 h1 em { font-style: normal; color: var(--accent-strong); position: relative; }
.hero2 h1 em::after { content: ""; position: absolute; inset-inline: 0; bottom: 4px; height: 10px; background: var(--accent-soft); z-index: -1; border-radius: 4px; }
.hero2 p { font-size: 16px; line-height: 2; color: var(--muted); max-width: 560px; margin: 0 0 20px; }
.hero2 .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero2__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 28px 0 0; max-width: 520px; }
.hero2__stats div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.hero2__stats dt { font-size: 11px; color: var(--muted); } .hero2__stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 900; }
.hero2__art { position: relative; display: grid; place-items: center; min-height: 320px; }
.code-card { width: 100%; max-width: 440px; border-radius: 18px; overflow: hidden; background: #12151c; color: #e6e6e6; border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 30px 60px rgba(0,0,0,.25); transform: rotate(-2deg); animation: card-float 6s ease-in-out infinite; }
.code-card__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #1a1e27; font-size: 12px; direction: ltr; }
.code-card__bar span { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; } .code-card__bar span:nth-child(2) { background: #febc2e; } .code-card__bar span:nth-child(3) { background: #28c840; }
.code-card__bar b { margin-inline-start: 8px; color: #9aa3b2; font-weight: 600; font-family: var(--mono); }
.lang-chips { margin-inline-start: auto; display: flex; gap: 4px; font-style: normal; }
.lang-chips i { font-style: normal; font-size: 10px; padding: 2px 7px; border-radius: 99px; background: rgba(255,255,255,.07); color: #c9cfda; }
.lang-chips i:first-child { background: #e0ad1f; color: #1c1504; }
.code-card pre { margin: 0; padding: 16px; font-family: var(--mono); font-size: 13px; line-height: 1.8; text-align: left; overflow: hidden; white-space: pre; }
.code-card .k { color: #c678dd; } .code-card .t { color: #e5c07b; } .code-card .f { color: #61afef; } .code-card .n { color: #d19a66; }
.code-card__verdict { display: flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 13px; background: rgba(31,138,91,.18); color: #7fe0b0; }
.code-card__verdict b { color: #fff; }
.float-chip { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; font-size: 12px; font-weight: 700;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); animation: card-float 5s ease-in-out infinite; }
.float-chip i { font-size: 16px; }
.float-chip--duel { top: 8%; inset-inline-end: 0; color: var(--danger); animation-delay: -1.5s; }
.float-chip--rank { bottom: 8%; inset-inline-start: 0; color: var(--accent-strong); animation-delay: -3s; }
@keyframes card-float { 50% { transform: translateY(-8px) rotate(-2deg); } }
.float-chip { animation-name: chip-float; } @keyframes chip-float { 50% { transform: translateY(-6px); } }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 8px 0 36px; }
.feature { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: transform .15s, border-color .15s; }
.feature:hover { transform: translateY(-3px); border-color: var(--accent); }
.feature i { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 12px; }
.feature h3 { font-size: 15px; margin: 0 0 6px; } .feature p { margin: 0; font-size: 13px; line-height: 1.9; color: var(--muted); }
.feature:nth-child(3) i { background: var(--danger-soft); color: var(--danger); }
.feature:nth-child(5) i { background: var(--info-soft); color: var(--info); }
.feature:nth-child(6) i { background: #fbe4ef; color: #c2417a; }
[data-theme="dark"] .feature:nth-child(6) i { background: rgba(240,140,184,.14); color: #f08cb8; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 36px 0 8px; padding: 26px 28px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent), #f3c94a); color: var(--accent-text); }
.cta-band h2 { font-size: 20px; margin: 0 0 4px; } .cta-band p { margin: 0; font-size: 13px; opacity: .85; }
.cta-band .btn-primary { background: #1c1504; color: #fff; border-color: #1c1504; }
@media (max-width: 960px) { .hero2 { grid-template-columns: minmax(0, 1fr); padding-top: 32px; } .hero2__art { min-height: 0; padding: 12px 0 24px; } .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
    .hero2__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .features { grid-template-columns: minmax(0, 1fr); }
    .float-chip { display: none; } .code-card { transform: none; animation: none; } .code-card pre { font-size: 11px; }
}
.site { overflow-x: clip; }
.bank-card__stats { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* ساخت دوئل */
.duel-builder { display: grid; gap: 16px; }
.duel-builder__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; flex-wrap: wrap; }
.duel-builder__head .duel-vs { font-size: 18px; }
.duel-builder__head strong { display: block; } .duel-builder__head small { font-size: 12px; }
.builder-row { display: grid; gap: 8px; } .builder-label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.choice-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; min-width: 170px; padding: 12px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface); transition: border-color .15s, background .15s; }
.choice i { grid-row: span 2; font-size: 22px; color: var(--muted); } .choice b { font-size: 13px; } .choice small { font-size: 11px; color: var(--muted); }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); } .choice input:checked + span i { color: var(--accent-strong); }
.choice input:focus-visible + span { outline: 2px solid var(--info); outline-offset: 2px; }
.seg { position: relative; cursor: pointer; } .seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.pool-item { cursor: default; } label.pool-item { cursor: pointer; }
.pool-item input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.pool-item.is-picked { background: var(--accent-soft); }
.pool-item input:disabled + .grow { opacity: .5; }
.duel-items { display: grid; gap: 8px; padding: 12px 20px 18px; }
.duel-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.duel-item__n { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; background: var(--surface); }
.duel-item__who { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); min-width: 64px; justify-content: center; }
.duel-item__who.is-solved { color: var(--success); font-weight: 700; }
.duel-scoreline { font-size: 26px; font-weight: 900; font-family: var(--mono); direction: ltr; }
.away-note { font-size: 11px; color: var(--warning); }

/* ───────── محافظت از صورت سؤال (ضد کپی/عکس/هوش مصنوعی؛ بازدارنده) ───────── */
.is-protected { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; position: relative;
    background-image: var(--wm); background-repeat: repeat; }
.is-protected pre, .is-protected code { -webkit-user-select: none; user-select: none; }
.is-protected .sample-pre { -webkit-user-select: text; user-select: text; }   /* ورودی نمونه برای تست قابل کپی می‌ماند */
.ai-notice { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
.protect-banner { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.protect-banner i { color: var(--accent-strong); }
.is-protected.is-veiled > *:not(.protect-veil) { filter: blur(9px); transition: filter .05s; }
.protect-veil { position: absolute; inset: 0; z-index: 5; display: none; place-items: center; text-align: center; padding: 20px; font-weight: 700; color: var(--text-2); }
.is-protected.is-veiled .protect-veil { display: grid; }
@media print { .is-protected { display: none !important; } body::after { content: "چاپ این صفحه مجاز نیست."; } }

/* نوار کناری: فهرست طولانی (مدیر/منتور) اسکرول می‌خورد و پایینش بریده نمی‌شود */
.sidebar .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-inline-end: 2px; }
.sidebar .brand, .sidebar .sidebar-foot { flex: none; }
.sidebar .nav a { flex: none; }
.learn-intro, .ranking-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 20px; margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.learn-intro h1, .ranking-hero h1 { font-size: 19px; display: flex; gap: 8px; align-items: center; margin: 0 0 6px; }
.learn-intro p, .ranking-hero p { margin: 0; font-size: 13px; line-height: 1.9; max-width: 640px; }
.learn-intro__links { display: flex; gap: 8px; flex-wrap: wrap; }
.top-row.is-me { background: var(--accent-soft); }

/* نقشه‌ی محتوا */
.map-intro { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 20px; margin-bottom: 16px; background: linear-gradient(135deg, var(--info-soft), transparent 70%); }
.map-intro h1 { font-size: 19px; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; } .map-intro p { margin: 0; font-size: 13px; line-height: 1.9; max-width: 720px; }
.map { display: grid; gap: 12px; }
.map-node { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 6px 12px 10px; }
.map-node .map-node { margin: 8px 0 0; background: var(--surface-2); }
.map-node > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; min-height: 40px; font-size: 13px; list-style: none; }
.map-node > summary::-webkit-details-marker { display: none; }
.map-node > summary::before { content: "›"; font-weight: 900; color: var(--muted); transition: transform .15s; }
.map-node[open] > summary::before { transform: rotate(-90deg); }
.map-node > summary > i { color: var(--accent-strong); font-size: 17px; }
.map-actions { margin-inline-start: auto; display: inline-flex; gap: 4px; flex-wrap: wrap; }
.map-actions a { display: inline-flex; align-items: center; gap: 2px; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--accent-strong); background: var(--accent-soft); }
.map-actions a:hover { background: var(--accent); color: var(--accent-text); }
.map-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.map-col h4 { font-size: 12px; color: var(--muted); margin: 0 0 6px; display: flex; gap: 4px; align-items: center; }
.map-box { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; background: var(--surface); display: grid; gap: 2px; }
.map-box__head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; padding-bottom: 4px; }
.map-leaf { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; font-size: 12px; color: var(--text-2); }
.map-leaf:hover { background: var(--surface-2); color: var(--text); } .map-leaf small { margin-inline-start: auto; }
.map-warn { color: var(--danger); font-weight: 700; }
.map-empty { font-size: 12px; color: var(--muted); padding: 4px 6px; }
.map-empty-cta { display: flex; align-items: center; gap: 6px; padding: 10px 12px; margin: 8px 0; border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: 13px; font-weight: 700; }
.map-empty-cta:hover { border-color: var(--accent); color: var(--accent-strong); }
.map-contest { margin-top: 8px; }
@media (max-width: 860px) { .map-cols { grid-template-columns: minmax(0, 1fr); } }

/* دسترسی‌پذیری: پرش به محتوا، هدف لمسی بزرگ‌تر روی گوشی */
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px;
    background: var(--accent); color: var(--accent-text); font-weight: 900; transition: top .15s; }
.skip-link:focus { top: 12px; }
@media (pointer: coarse) {
    .btn-sm { min-height: 38px; }
    .icon-btn { min-width: 40px; min-height: 40px; }
    .check input[type=checkbox], .check input[type=radio], label.pool-item input { width: 22px; height: 22px; }
    .map-actions a, .score-pop__btn { min-height: 34px; }
}
a.home-hero__score:hover { border-color: var(--accent); }
.filter-bar > * { min-width: 0; max-width: 100%; }
@media (max-width: 560px) {
    .filter-bar input[type=search], .bank-filters input[type=search] { flex: 1 1 100%; width: 100%; }
    .filter-bar select, .bank-filters select { flex: 1 1 45%; }
}
.board-levels { margin-bottom: 14px; flex-wrap: wrap; }

/* پاپ‌آپ اعلان (حس iOS): شیشه‌ی مات، فنر ورود، محو و کوچک شدن هنگام خروج */
.toast-stack { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 10px;
    width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 20px; color: var(--text); text-decoration: none;
    background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
    border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); box-shadow: 0 12px 40px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .08);
    animation: toast-in .62s cubic-bezier(.2, 1.35, .35, 1) both; transform-origin: top center; }
.toast.is-leaving { animation: toast-out .36s cubic-bezier(.4, 0, 1, 1) both; }
.toast__icon { flex: 0 0 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #1a1405; font-size: 18px; }
.toast__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.6; }
.toast__body strong { font-size: 13.5px; }
.toast__body span { color: var(--muted); }
.toast__close { border: 0; background: transparent; color: var(--muted); font-size: 18px; padding: 2px; cursor: pointer; border-radius: 8px; }
.toast__close:hover { background: var(--surface-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-120%) scale(.92); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-40%) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-leaving { animation-duration: .01s; } }

.is-protected.protect-no-copy, .is-protected.protect-no-copy pre, .is-protected.protect-no-copy code { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* جست‌وجو: یک شکل در همه‌جا (ارتفاع، گوشه، آیکون ذره‌بین) */
input[type=search] { height: 40px; padding-inline: 38px 12px; border-radius: 12px; background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M18.03 16.62l4.28 4.28-1.41 1.41-4.28-4.28A9 9 0 1 1 18.03 16.62zM11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14z'/%3E%3C/svg%3E"); }
input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }

/* فیلترهای جمع‌شونده در موبایل */
.filter-toggle { display: none; }
@media (max-width: 720px) {
    .is-collapsible .filter-toggle { display: inline-flex; flex: 0 0 auto; gap: 6px; }
    .is-collapsible > :not(input[type=search]):not(.filter-toggle) { display: none !important; }
    .is-collapsible.is-open > :not(input[type=search]):not(.filter-toggle) { display: flex !important; flex: 1 1 100%; }
    .is-collapsible.is-open > select { display: block !important; }
    .is-collapsible input[type=search] { flex: 1 1 0 !important; width: auto !important; }
    .is-collapsible.is-open { padding: 10px; border-radius: 14px; background: var(--surface-2); animation: filter-open .22s ease both; }
}
@keyframes filter-open { from { opacity: 0; transform: translateY(-4px); } }

/* تقویم: سوییچ لیگ‌ها، رنگ هر لیگ، و روزهای دارای برنامه که در موبایل از روزهای خالی پیداست */
.cal-leagues { margin-bottom: 12px; flex-wrap: wrap; }
.cal-leagues a { display: inline-flex; align-items: center; gap: 6px; }
.cal-league-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lc, var(--accent)); display: inline-block; }
.cal.is-league { border-top: 3px solid var(--lc); }
.ev.has-league { border-inline-start: 3px solid var(--lc); }
.dots .league-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1.5px var(--surface); }
.cal-league-tag { display: inline-block; padding: 0 6px; border-radius: 6px; font-weight: 700; color: var(--text); background: color-mix(in srgb, var(--lc) 22%, transparent); }
.mday.has-items { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.cal.is-league .mday.has-items { background: color-mix(in srgb, var(--lc) 10%, var(--surface)); }
.mday.has-items .num { font-weight: 900; }
@media (max-width: 720px) {
    .mday:not(.has-items):not(.is-today) .num { color: var(--muted); font-weight: 400; }
    .mday.has-items { box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--lc, var(--accent)) 70%, transparent); }
    .mday.has-items .num { color: var(--text); }
}

.topbar-title .crumb { color: var(--muted); font-weight: 400; font-size: 13px; margin-inline-end: 4px; display: inline-flex; align-items: center; }
.topbar-title .crumb i { font-size: 16px; opacity: .7; }

.interest-group + .interest-group { margin-top: 14px; }
.interest-group h4 { margin: 0 0 8px; font-size: 12px; font-weight: 800; color: var(--muted); }

/* گفت‌وگو با منتور */
.chat-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.chat-contacts .list-item.is-active { background: var(--accent-soft); }
.chat-thread { display: flex; flex-direction: column; min-height: 70vh; }
.chat-thread .card-head { justify-content: flex-start; gap: 10px; }
.chat-back { display: none; }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px; overflow-y: auto; max-height: 60vh; }
.bubble { max-width: 78%; align-self: flex-start; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); line-height: 1.8; }
.bubble.is-mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--accent-soft); }
.bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.bubble time { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }
.bubble-problem { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 700;
    background: var(--surface); color: var(--accent-strong); border: 1px solid var(--border); }
.chat-form { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-mention { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chat-mention a:first-of-type { font-weight: 700; color: var(--accent-strong); }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; border-radius: 14px; }
.ask-mentor { align-self: flex-start; }
@media (max-width: 860px) {
    .chat-layout { grid-template-columns: 1fr; }
    .chat-layout.has-thread .chat-contacts { display: none; }
    .chat-back { display: inline-grid; }
}

.notif-head-actions { display: inline-flex; align-items: center; gap: 6px; }
.notif-panel header .notif-clear { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--danger); font-size: 16px; }
.notif-panel header .notif-clear:hover { background: var(--danger-soft); }
