/* ==========================================================================
   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;
    --lesson-banner: #252032; --lesson-banner-text: #faf6ed;
    --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);
    --lesson-banner: #292437;
    --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; grid-template-columns: minmax(0, 1fr); gap: 14px; }   /* minmax(0): خط بلند خطای کامپایل/کد فرم را از عرض صفحه بیرون نزند */
.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; }
.problem-content { display: grid; gap: 10px; min-width: 0; }
.problem-content p + p { margin: 0; }
.problem-content :is(h2, h3), .problem-spec-title { color: var(--text); font-size: 16px; }
.problem-spec-title { margin-block-end: 4px; }
.problem-content p > span { display: block; text-align: start; }
.problem-content ul { margin: 0; padding-inline-start: 22px; }
.problem-content code[dir="ltr"] { unicode-bidi: isolate; }
.problem-content pre { min-width: 0; white-space: pre; }
.problem-content__note { padding: 10px 14px; border-inline-start: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); }
.problem-content__note strong { color: var(--text); }
.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); }
.problem-saved { align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--success-soft); }
.problem-saved i { color: var(--success); }

/* ── 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); }
    /* «خانه» وسط نوار و برجسته */
    .bottom-nav a.bottom-nav__home i { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -22px; border-radius: 50%;
        background: var(--accent); color: var(--accent-text); font-size: 22px; box-shadow: 0 6px 16px rgba(224,173,31,.35), 0 0 0 4px var(--surface); }
    .bottom-nav a.bottom-nav__home.is-active i { color: var(--accent-text); }
    .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: var(--cm-font, 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; flex: none; }
/* پیام خطا (فارسی + کد انگلیسی) نباید چیدمان را روی گوشی بشکند */
.lint-panel li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; word-break: break-word; unicode-bidi: plaintext; text-align: start; }
.lint-panel header { gap: 8px; flex-wrap: wrap; }
.run-result > div { min-width: 0; }
.run-result [data-sample-feedback] { overflow-wrap: anywhere; unicode-bidi: plaintext; white-space: pre-line; }
.run-result pre { max-width: 100%; white-space: pre; }
.editor-font { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 8px; }
.editor-font button { font: 700 12px/1 var(--mono); padding: 5px 8px; min-width: 30px; background: none; border: 0; color: var(--text); cursor: pointer; }
.editor-font button:hover { background: var(--surface-2); }
.editor-font output { font: 600 11px/1 var(--mono); color: var(--muted); min-width: 22px; text-align: center; }
.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; }
.problem-markdown-help { grid-column: 1 / -1; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.problem-markdown-help summary { cursor: pointer; font-weight: 800; }
.problem-markdown-help dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); gap: 8px; margin-block: 10px; }
.problem-markdown-help dl > div { min-width: 0; padding: 8px 10px; border-radius: 6px; background: var(--surface); }
.problem-markdown-help dt { font-weight: 700; }
.problem-markdown-help dd { margin: 0; overflow-wrap: anywhere; }
.problem-markdown-help pre { margin: 0; white-space: pre-wrap; }
.problem-markdown-help code[dir="ltr"] { display: inline-block; text-align: left; }
.problem-markdown-help p { color: var(--text-2); font-size: 13px; }
.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); }
.manage-form .manage-check {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 11px; align-items: center;
    min-height: 48px; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer;
}
.manage-form .manage-check:hover { border-color: var(--border-strong); }
.manage-form .manage-check > input { margin: 0; cursor: pointer; }
.manage-form .manage-check > span { font-size: 13px; overflow-wrap: anywhere; }
.manage-form .manage-check > .help, .manage-form .manage-check > .errorlist { grid-column: 2; }
.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; visibility: hidden; 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 { visibility: visible; 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:not(.cm-input) { font-size: 16px !important; }   /* ویرایشگر: اندازه‌ی قابل‌تنظیم (iOS با maximum-scale زوم نمی‌کند) */
}

/* ========================================
   نفرات برتر و رده‌بندی (توکن‌های سیستم طراحی؛ حالت شب/روز را خراب نمی‌کند)
   ======================================== */
.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; }
.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:has(.is-protected)::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); }

/* فوتر استاندارد: برند و پیوندها، و یک نوار کپی‌رایت یک‌خطی */
.site-footer { display: block; margin-top: 56px; padding: 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.site-footer__top { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; padding: 22px 0; }
.site-footer__links { display: flex; gap: 6px 22px; flex-wrap: wrap; }
.site-footer__links a { color: var(--text-2, var(--muted)); font-weight: 700; text-decoration: none; }
.site-footer__links a:hover, .site-footer__links a:focus-visible { color: var(--accent-strong, var(--text)); }
.site-footer__bar { display: flex; justify-content: center; align-items: center; gap: 6px 10px; flex-wrap: wrap; padding: 13px 18px; border-radius: 12px 12px 0 0;
    background: #0f2a3a; color: #e8eef3; font: 500 13px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; text-align: center; }
:root[data-theme="dark"] .site-footer__bar { background: #141a24; border: 1px solid var(--border); border-bottom: 0; }
.site-footer__bar b { color: #fff; }
.site-footer__bar .sep { opacity: .5; }
.site-footer__bar .heart { display: inline-block; animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .site-footer__bar .heart { animation: none; } }
@media (max-width: 560px) { .site-footer__top { flex-direction: column; align-items: flex-start; } .site-footer__bar .sep { display: none; } .site-footer__bar > span { flex-basis: 100%; } }
/* نوار کپی‌رایت در حالت روشن: طلایی با درخشش ملایم */
:root:not([data-theme="dark"]) .site-footer__bar {
    background: linear-gradient(120deg, #c8901a 0%, #e6b52c 38%, #f4d272 55%, #e3ac22 72%, #c08515 100%);
    background-size: 220% 100%; color: #2a1d02; border: 1px solid #c99319; border-bottom: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 -6px 24px rgba(224, 173, 31, .18);
    animation: gold-sheen 9s ease-in-out infinite alternate; }
:root:not([data-theme="dark"]) .site-footer__bar b { color: #1c1300; }
:root:not([data-theme="dark"]) .site-footer__bar .sep { opacity: .45; }
@keyframes gold-sheen { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) { :root:not([data-theme="dark"]) .site-footer__bar { animation: none; } }

/* ذخیره‌ی سؤال */
.save-problem { display: inline; margin: 0; }
.save-btn { cursor: pointer; font: inherit; }
.save-btn.is-on { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.save-btn.is-on i { color: var(--accent-strong); }
.head-links { display: inline-flex; gap: 14px; flex-wrap: wrap; }

/* ===================== مسابقه‌ی زنده ===================== */
/* زمان باقی‌مانده و «دست بالا» (شرکت‌کننده) */
.cl-bar { position: fixed; top: 10px; inset-inline-start: 50%; transform: translateX(50%); z-index: 40; display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 3px 3px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); }
[dir="rtl"] .cl-bar { padding: 3px 12px 3px 3px; }
.cl-bar__time { display: inline-flex; align-items: center; gap: 5px; font: 700 13px/1 var(--mono); }
.cl-bar.is-low { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.cl-bar.is-low .cl-bar__time { animation: cl-blink 1.4s steps(2) infinite; }
.cl-hand { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
    background: var(--surface-2); font-size: 16px; line-height: 1; transition: background .15s; }
.cl-hand:hover, .cl-hand:focus-visible { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: 1px; }
.cl-hand.is-waiting { background: var(--accent); animation: cl-wave 1.2s ease-in-out infinite; }
@keyframes cl-wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-16deg); } 75% { transform: rotate(12deg); } }
.cl-sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: start center; padding-top: 54px !important; background: rgba(10, 12, 16, .45); padding: 16px; }
.cl-sheet[hidden] { display: none; }
.cl-sheet__card { width: min(460px, 100%); background: var(--surface); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-pop); animation: cl-up .22s ease; }
.cl-sheet__card header { display: flex; align-items: center; justify-content: space-between; }
.cl-sheet__card h2 { font-size: 18px; margin: 0; }
@keyframes cl-up { from { transform: translateY(24px); opacity: 0; } }
.cl-kinds { display: grid; gap: 6px; }
.cl-kinds label { display: block; cursor: pointer; }
.cl-kinds input { position: absolute; opacity: 0; }
.cl-kinds span { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-weight: 700; }
.cl-kinds input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.cl-kinds input:focus-visible + span { outline: 2px solid var(--accent); }
.cl-mine { display: grid; gap: 6px; font-size: 12px; }
.cl-req { display: grid; gap: 2px; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); }
.cl-req.is-done { background: var(--success-soft); }
.cl-req.is-claimed { background: var(--info-soft); }
/* قفل تمام‌صفحه (حالت آزمون) */
.cl-lock { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(8, 10, 14, .92); backdrop-filter: blur(6px); }
.cl-lock[hidden] { display: none; }
.cl-lock__card { max-width: 460px; text-align: center; background: var(--surface); border-radius: 20px; padding: 28px 24px; display: grid; gap: 12px; justify-items: center; }
.cl-lock__icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-strong); font-size: 28px; }
.cl-lock__card h2 { margin: 0; font-size: 20px; }
/* پیام‌های شناور به سبک اعلان اپل */
.cl-pops { position: fixed; top: 58px; inset-inline-end: 16px; z-index: 90; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.cl-pop { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(18px) saturate(1.6); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: cl-drop .32s cubic-bezier(.2, .9, .3, 1.2); }
.cl-pop b { display: block; font-size: 14px; } .cl-pop p { margin: 2px 0 0; font-size: 13px; overflow-wrap: anywhere; }
/* بستن: داخل کارت، گوشه‌ی بالا-چپ */
.cl-pop { position: relative; padding-left: 40px; }
.cl-pop button { position: absolute; top: 9px; left: 9px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0;
    border-radius: 50%; border: 0; background: var(--surface-2); color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
.cl-pop button:hover, .cl-pop button:focus-visible { background: var(--accent-soft); color: var(--text); outline: none; }
.cl-pop.is-ann { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-pop); }
.cl-pop.is-warn { border-color: var(--warning); } .cl-pop.is-ok { border-color: var(--success); }
.cl-pop.is-out { opacity: 0; transform: translateY(-10px); transition: .4s; }
@keyframes cl-drop { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
.cl-anns { display: grid; gap: 0; margin-bottom: 16px; }
.cl-ann { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-top: 1px solid var(--border); }
.cl-ann:first-child { border-top: 0; } .cl-ann i { color: var(--accent-strong); }
/* لقب تیم‌ها */
.team-titles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.team-title { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700;
    background: var(--accent-soft); color: var(--accent-strong); white-space: nowrap; cursor: help; }

/* اتاق کنترل */
.cc-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin-bottom: 16px; }
.cc-clock, .cc-stat { display: grid; place-content: center; text-align: center; min-width: 96px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.cc-clock b { font: 800 24px/1.1 var(--mono); } .cc-clock small, .cc-stat small { color: var(--muted); font-size: 11px; }
.cc-stat b { font-size: 22px; } .cc-stat.is-warn b { color: var(--warning); } .cc-stat.is-hand b { color: var(--danger); } .cc-stat.is-muted b { color: var(--muted); }
.cc-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-inline-start: auto; }
.cc-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .cc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {   /* گوشی: کارت‌های آمار مرتب در ۳ ستون، ساعت سرتاسری */
    .cc-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .cc-clock, .cc-tools { grid-column: 1 / -1; }
    .cc-stat { min-width: 0; padding: 8px 6px; } .cc-stat b { font-size: 18px; }
    .cc-tools { margin: 0; justify-content: space-between; }
    .cc-teams { grid-template-columns: minmax(0, 1fr); padding: 8px; }
    .cc-hand { flex-wrap: wrap; } .cc-hand .grow { flex: 1 1 calc(100% - 56px); } .cc-hand .btn { flex: 1 1 0; justify-content: center; }
}
.cc-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 11px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.is-active { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot.is-away { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); animation: cl-blink 1s steps(2) infinite; }
.dot.is-offline { background: var(--danger); } .dot.is-never { background: transparent; border: 1.5px solid var(--muted); }
@keyframes cl-blink { 50% { opacity: .35; } }
.cc-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 12px; }
.cc-team { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 6px; }
.cc-team.is-alert { border-color: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.cc-team h3 { margin: 0 0 2px; font-size: 14px; }
.cc-member { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.cc-member .grow { min-width: 0; } .cc-member small { display: block; color: var(--muted); }
.cc-member.is-away small { color: var(--warning); font-weight: 700; }
.cc-chip { padding: 2px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--surface-2); white-space: nowrap; }
.cc-chip.is-warn { background: var(--warning-soft); color: var(--warning); } .cc-chip.is-bad { background: var(--danger-soft); color: var(--danger); }
.cc-chip.is-ok { background: var(--success-soft); color: var(--success); }
.cc-help.has-open { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.cc-help .list { max-height: 330px; overflow-y: auto; }
.cc-hand p { margin: 4px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.cc-hand.is-claimed .thumb { opacity: .5; }
.cc-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.cc-inline input { width: 72px; }
.cc-feed { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; font-size: 12px; }
.cc-feed li { display: flex; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--border); }
.cc-feed time { flex: none; color: var(--muted); font-family: var(--mono); }
.cc-feed .d { display: block; color: var(--muted); }
.cc-feed li.is-alert { background: var(--warning-soft); }
.cc-feed li.k-first, .cc-feed li.k-solved { background: var(--success-soft); }
.cc-feed li.k-help { background: var(--danger-soft); font-weight: 700; }
.cc-feed li.k-announce { background: var(--info-soft); }
.cc-feed.only-alerts li:not(.is-alert):not(.k-help) { display: none; }
.cc-guide ol { padding-inline-start: 18px; display: grid; gap: 8px; font-size: 13px; }
.cc-guide code { overflow-wrap: anywhere; }

/* جدول تمام‌صفحه */
.board-page { background: var(--bg); }
.board-wrap { padding: 24px clamp(16px, 3vw, 48px); display: grid; gap: 18px; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.board-head .brand strong { font-size: clamp(20px, 2.4vw, 32px); }
.board-clock { font: 800 clamp(28px, 4vw, 56px)/1 var(--mono); color: var(--accent); }
.board-frozen { margin: 0; text-align: center; font-weight: 800; color: var(--info); }
.board-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .board-grid { grid-template-columns: minmax(0, 1fr); } }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; overflow-x: auto; }
.board-card h2 { margin: 0 0 10px; }
.board-table { font-size: clamp(13px, 1.2vw, 17px); }
.board-table tr.r1 td { background: var(--accent-soft); }
.board-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board-people li { display: flex; align-items: center; gap: 10px; }
.board-people small { display: block; color: var(--muted); }
@media (max-width: 860px) { .cl-bar { top: 64px; } .cl-pops { top: 110px; } .cl-sheet { padding-top: 104px !important; } }

/* مشکوک‌ها (اتاق کنترل و گزارش) */
.susp-badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; white-space: nowrap; background: var(--surface-2); }
.susp-badge.is-high { background: var(--danger); color: #fff; }
.susp-badge.is-medium { background: var(--warning-soft); color: var(--warning); }
.susp-badge.is-low { background: var(--surface-2); color: var(--muted); }
.cc-susp .list { max-height: 300px; overflow-y: auto; }
.cc-susp.has-high { border-color: var(--danger); }
.cc-sus small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.susp-kv { margin-bottom: 14px; }
.susp-kv .is-high dd { color: var(--danger); } .susp-kv .is-medium dd { color: var(--warning); }
.susp-card { margin-bottom: 12px; } .susp-card.is-high { border-color: var(--danger); }
.susp-card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; }
.susp-reasons { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.susp-timeline summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.susp-timeline ol { margin: 8px 0 0; padding-inline-start: 18px; font-size: 12px; display: grid; gap: 3px; }
.susp-timeline li.is-alert { color: var(--warning); }
.susp-timeline time { font-family: var(--mono); color: var(--muted); }
@media print {
    .no-print, .sidebar, .topbar, .bottom-nav, .cl-pops { display: none !important; }
    .susp-timeline { display: block; } .susp-timeline > ol { display: grid !important; }
    .susp-card { break-inside: avoid; }
}

/* Contest final — the gold seal marks the team's irreversible choice. */
.gold-round {
    display: flex; align-items: flex-start; gap: 18px; margin: 10px; padding: clamp(14px, 3vw, 26px);
    border: 1px solid #9a783b; border-inline-start: 5px solid #e8bb62; border-radius: 14px;
    color: #fff3d6; background: linear-gradient(115deg, #302a23, #26221e 68%, #403322);
}
.gold-round__seal {
    flex: none; display: grid; place-items: center; width: 52px; height: 52px;
    color: #f1c97e; border: 1px solid #94713b; border-radius: 50%; font-size: 25px;
    box-shadow: inset 0 0 0 4px #302a23, inset 0 0 0 5px #6a5434;
}
.gold-round__body { min-width: 0; flex: 1; }
.gold-round__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 18px; color: #f1c97e; font-size: .86rem; }
.gold-round h2 { margin: .2em 0; color: inherit; }
.gold-round p { color: #e4d7be; margin: 5px 0 12px; line-height: 1.85; }
.gold-round summary { width: fit-content; cursor: pointer; color: #ffdc96; font-weight: 700; padding-block: 4px; }
.gold-round .btn { background: #f1c97e; color: #302315; border-color: #f1c97e; }
.gold-row { border-inline-start: 3px solid #c19848; }
.gold-row .thumb { color: #4d3610; background: #f3dba5; }
@media (max-width: 540px) {
    .gold-round { gap: 10px; margin: 6px; }
    .gold-round__seal { width: 34px; height: 34px; font-size: 18px; }
}

/* Learning roadmap and lesson reader */
.learning-overview { padding: clamp(18px, 3vw, 30px); margin-bottom: 18px; border-block-start: 3px solid var(--accent); }
.learning-overview__intro { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; }
.learning-overview__intro h2 { font-size: clamp(23px, 3vw, 34px); margin: 2px 0; }
.learning-resume {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
    flex: 0 1 auto; min-width: min(100%, 300px); max-width: min(100%, 400px); padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.learning-resume__lesson { min-width: 0; overflow-wrap: anywhere; }
.learning-resume__lesson span, .learning-resume__lesson strong { display: block; }
.learning-resume__lesson span { color: var(--muted); font-size: 11px; }
.learning-resume__lesson strong { color: var(--text); font-size: 14px; }
.learning-resume .btn { min-height: 44px; padding-inline: 12px; }
.learning-progress { margin-top: 22px; max-width: 610px; }
.learning-progress > div { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.learning-progress progress { appearance: none; display: block; inline-size: 100%; block-size: 8px; border: 0; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.learning-progress progress::-webkit-progress-bar { background: var(--surface-3); }
.learning-progress progress::-webkit-progress-value { background: var(--success); border-radius: 10px; }
.learning-progress progress::-moz-progress-bar { background: var(--success); border-radius: 10px; }
.learning-tabs { margin-block: 0 14px; }
.learning-tabs a { min-height: 44px; padding-inline: clamp(7px, 1.5vw, 16px); white-space: nowrap; }
.learning-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(218px, 29%); align-items: start; gap: 18px; }
.learning-content { min-width: 0; }
.learning-activity { align-items: flex-start; scroll-margin-block-start: 76px; }
.learning-activity__problems { margin-top: 9px; }
.learning-activity__problems a { white-space: normal; text-align: start; }
details.learning-module { scroll-margin-block-start: 76px; }
details.learning-module summary { min-height: 66px; gap: 10px; }
.learning-module summary .grow, .learning-lesson .grow { min-width: 0; overflow-wrap: anywhere; }
.learning-module summary .grow > strong { font-size: clamp(15px, 1.7vw, 18px); font-weight: 900; }
.learning-module summary small { display: block; color: var(--muted); }
.learning-module__state, .learning-lesson__state { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.learning-module.is-current summary { background: var(--accent-soft); }
.learning-module.is-current .learning-module__icon { color: var(--accent-strong); }
.learning-module.is-done summary { background: var(--success-soft); }
.learning-module.is-done .learning-module__icon, .learning-module.is-done .learning-module__state,
.learning-lesson.is-done > i, .learning-lesson.is-done .learning-lesson__state { color: var(--success); }
.learning-module.is-done .learning-module__icon { background: var(--success-soft); }
.learning-module__lessons {
    margin-block: 6px 14px; margin-inline: clamp(16px, 3.2vw, 48px) 12px;
    border-inline-start: 2px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface-2);
}
details.learning-module .learning-module__lessons > .list-item { padding-inline: clamp(9px, 1.6vw, 18px); min-height: 48px; }
.learning-lesson .grow > strong { font-weight: 700; white-space: normal; }
.learning-lesson.is-current { background: var(--accent-soft); }
.learning-lesson.is-current > i, .learning-lesson.is-current .learning-lesson__state { color: var(--accent-strong); }
.learning-milestone { position: sticky; top: 76px; }
.learning-milestone h2 { font-size: 17px; margin: 0 0 2px; }
.learning-milestone p { margin: 0; color: var(--muted); }
.learning-milestone ul { padding: 0; margin: 12px 0 0; display: grid; gap: 8px; list-style: none; }
.learning-milestone li { display: flex; align-items: baseline; gap: 7px; font-size: 13px; }
.learning-milestone li i { color: var(--muted); }
.learning-milestone li.is-done i { color: var(--success); }
.level.is-done { border-color: var(--success); background: var(--success-soft); }
.level.is-done .n { color: var(--success); }
.learning-reader { display: grid; gap: 16px; min-width: 0; }
.learning-reader__nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.learning-reader__nav .link { min-height: 44px; }
.learning-reader__hero {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: clamp(12px, 3vw, 24px);
    padding: clamp(17px, 4vw, 38px); border-radius: var(--radius-lg); border-block-end: 3px solid var(--accent);
    background: var(--lesson-banner); color: var(--lesson-banner-text);
}
.learning-reader__emblem {
    display: grid; place-items: center; inline-size: clamp(38px, 7vw, 70px); aspect-ratio: 1;
    border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 14%, var(--lesson-banner));
    color: var(--accent); font-size: clamp(20px, 4vw, 35px);
}
.learning-reader__module { display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--accent); }
.learning-reader__module span { min-width: 0; padding-inline-start: 7px; border-inline-start: 1px solid currentColor; font-weight: 700; overflow-wrap: anywhere; }
.learning-reader__title h1 { margin-block: 8px; font-size: clamp(23px, 4vw, 38px); overflow-wrap: anywhere; }
.learning-reader__summary { max-inline-size: 63ch; color: color-mix(in srgb, var(--lesson-banner-text) 84%, var(--lesson-banner)); overflow-wrap: anywhere; }
.learning-reader__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.learning-reader__meta li {
    display: flex; align-items: center; gap: 5px; padding: 3px 9px;
    border: 1px solid color-mix(in srgb, var(--lesson-banner-text) 23%, var(--lesson-banner));
    border-radius: 99px; font-size: 12px;
}
.learning-reader__meta li.learning-reader__done { border-color: var(--accent); }
.learning-reader__done i { color: var(--accent); }
.learning-reader__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 245px); align-items: start; gap: 16px; }
.learning-reader__layout--solo { grid-template-columns: minmax(0, 1fr); }
.learning-reader__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.learning-reader__panel { padding: clamp(14px, 2.5vw, 25px); }
.learning-reader__panel-head {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px;
    padding-block-end: 12px; margin-block-end: 16px; border-block-end: 1px solid var(--border);
}
.learning-reader__panel-head h2, .learning-reader__panel-head .link { display: inline-flex; align-items: center; gap: 7px; }
.learning-reader__panel-head h2 i, .learning-reader__note strong i { color: var(--accent-strong); font-size: 20px; }
.learning-reader__panel .video-box { overflow: hidden; }
.learning-reader__panel .video-box video { display: block; object-fit: contain; }
.learning-reader__body { display: grid; gap: 14px; max-inline-size: 72ch; overflow-wrap: anywhere; user-select: text; }
.learning-reader__body h3 { color: var(--text); font-size: 17px; font-weight: 800; padding-inline-start: 9px; border-inline-start: 3px solid var(--accent); }
.learning-reader__body h3:not(:first-child) { margin-block-start: 12px; }
.learning-reader__body p + p { margin: 0; }
.learning-reader__note { padding: 12px 14px; border-inline-start: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); }
.learning-reader__note strong { display: flex; align-items: center; gap: 6px; margin-block-end: 4px; color: var(--text); }
.learning-reader__example { min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.learning-reader__example figcaption { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 8px 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.learning-reader__example figcaption span { display: flex; align-items: center; gap: 7px; }
.learning-reader__example figcaption bdi { font-family: var(--mono); overflow-wrap: anywhere; }
.learning-reader__example pre { border: 0; border-block-start: 1px solid var(--border); border-start-start-radius: 0; border-start-end-radius: 0; overflow-wrap: normal; }
.learning-reader__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.learning-reader__actions > form, .learning-reader__actions > .btn-primary { margin-inline-start: auto; }
.learning-reader__actions .btn { min-height: 44px; }
.learning-reader__outline { position: sticky; top: 76px; padding: 12px; max-block-size: calc(100dvh - 96px); overflow-y: auto; }
.learning-reader__outline-head { display: grid; gap: 3px; padding: 5px 6px 10px; }
.learning-reader__outline-head p { color: var(--muted); font-size: 12px; }
.learning-reader__outline ol { display: grid; gap: 3px; list-style: none; padding: 0; margin: 0; }
.learning-reader__outline a {
    display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px;
    border-radius: var(--radius-sm); color: var(--text-2); overflow-wrap: anywhere;
}
.learning-reader__outline a:hover { background: var(--surface-2); }
.learning-reader__outline a[aria-current="page"] { background: var(--accent-soft); color: var(--text); font-weight: 700; }
.learning-reader__outline a i { color: var(--muted); }
.learning-reader__outline a[aria-current="page"] i { color: var(--accent-strong); }
.learning-reader__outline a.is-done i { color: var(--success); }
.lesson-optional > summary { cursor: pointer; list-style: none; }
.lesson-optional > summary::-webkit-details-marker { display: none; }
.lesson-optional > summary .chev { margin-inline-start: auto; }
.lesson-optional[open] > summary .chev { transform: rotate(180deg); }
@media (max-width: 760px) {
    .learning-layout { grid-template-columns: minmax(0, 1fr); }
    .learning-reader__layout { grid-template-columns: minmax(0, 1fr); }
    .learning-reader__outline { position: static; max-block-size: none; }
    .learning-milestone { position: static; }
    .learning-tabs { gap: 2px; }
    details.learning-module summary { padding-inline: 12px; }
    .learning-module__state, .learning-lesson__state { font-size: 11px; }
}
@media (max-width: 550px) {
    .learning-resume { flex: 1 1 100%; max-width: 100%; }
    .learning-reader__hero { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 365px) {
    .learning-tabs a { padding-inline: 6px; font-size: 12px; }
    .learning-tabs a i { display: none; }
}

/* Product navigation and the shared content rhythm */
.auth-card--entry { border-block-start: 4px solid var(--accent); padding: clamp(16px, 4vw, 28px); }
.auth-card--entry h1 { margin-block-end: 14px; font-size: clamp(21px, 3vw, 28px); }
.auth-card--entry .segmented { width: 100%; margin-block-end: 18px; }
.auth-card--entry .segmented a { min-height: 44px; display: grid; place-items: center; }
.app .brand { padding-block-end: 20px; border-bottom: 1px solid var(--border); }
.app .nav { padding-block-start: 10px; }
.app .nav a { border-inline-start: 3px solid transparent; }
.app .nav a.is-active { border-inline-start-color: var(--accent); }
.app .topbar { background: var(--surface); border-bottom-color: var(--border); }
.app .content { gap: clamp(14px, 2vw, 24px); }
.app .page-head h1 { font-size: clamp(22px, 3vw, 34px); overflow-wrap: anywhere; }
.app .actions { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app .card-head > * { min-width: 0; }
.app .card-head h2 { overflow-wrap: anywhere; }
.app .list-item > .grow, .app .form-grid > *, .app .filter-bar > * { min-width: 0; }
.app .list-item .grow strong, .app .list-item .grow small { overflow-wrap: anywhere; }
.app .table th { text-align: start; }
.app .table th, .app .table td { padding-block: 11px; }
.app .list + .card-body, .app .card-head + .table-wrap { margin-block-start: 12px; }
.app .empty { padding-block: clamp(22px, 4vw, 42px); }
.app .notice > *, .app .form-actions > * { min-width: 0; overflow-wrap: anywhere; }
.app .notice > i { flex: none; }
.app .icon-btn:focus-visible { outline-offset: 3px; }
.app .filter-bar input[type='search'], .app .bank-filters input[type='search'] { border-color: var(--border-strong); }

/* Bank results use stable columns so titles and statuses can be scanned. */
.bank-overview { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding-block: 8px; }
.bank-overview h1 { font-size: clamp(25px, 4vw, 42px); font-weight: 900; }
.bank-overview__progress { margin-top: 10px; width: min(68vw, 260px); color: var(--text-2); }
@media (min-width: 1081px) {
    .bank-discovery .bank-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; }
    .bank-discovery .bank-filters input[type='search'] { grid-column: 1 / -1; }
    .bank-discovery .bank-filters input[type='search'], .bank-discovery .bank-filters select { width: 100%; }
    .bank-discovery .bank-filters > a:last-child { grid-column: 1 / -1; justify-self: start; }
}
.bank-results { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.bank-results > li + li { border-block-start: 1px solid var(--border); }
.bank-results .bank-card {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(134px, .68fr);
    grid-template-areas: 'title topics states' 'notes topics states';
    align-items: center; column-gap: 14px; row-gap: 2px; min-height: 68px;
    padding: 10px clamp(10px, 2.3vw, 22px); border: 0; border-radius: 0; box-shadow: none; background: transparent;
}
.bank-results li:first-child .bank-card { border-start-start-radius: var(--radius); border-start-end-radius: var(--radius); }
.bank-results li:last-child .bank-card { border-end-start-radius: var(--radius); border-end-end-radius: var(--radius); }
.bank-results .bank-card:hover { background: var(--surface-2); transform: none; }
.bank-results .bank-card.is-solved .bank-card__title { color: var(--success); }
.bank-results .bank-card__title { grid-area: title; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; }
.bank-results .bank-card__stats { grid-area: notes; font-size: 12px; }
.bank-results .bank-card__top { grid-area: states; flex-wrap: wrap; justify-content: flex-end; }
.bank-results .bank-card .chips { grid-area: topics; min-width: 0; }
.bank-results .bank-card .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Contest covers borrow their shape and linework from the public event pass. */
.contest-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
    padding: clamp(18px, 4vw, 44px); border: 1px solid var(--border); border-inline-start: 5px solid var(--accent);
    border-radius: 5px 18px 5px 18px; background-color: var(--lesson-banner); color: var(--lesson-banner-text);
    background-image: repeating-linear-gradient(130deg, transparent 0 24px, color-mix(in srgb, var(--lesson-banner-text), transparent 94%) 25px 26px);
}
.contest-banner h1 { font-size: clamp(26px, 4vw, 46px); font-weight: 900; overflow-wrap: anywhere; }
.contest-banner p { margin-block-start: 8px; max-width: 58ch; overflow-wrap: anywhere; }
.contest-banner .btn:not(.btn-primary) { color: var(--text); }
.contest-banner :focus-visible { outline-color: var(--accent); }
.contest-banner--running { border-inline-start-color: var(--success); }
.contest-banner--finished { border-inline-start-color: var(--border-strong); }
.contest-listing .thumb { background: var(--accent-soft); color: var(--accent-strong); }
.contest-listing--running .thumb { background: var(--success-soft); color: var(--success); }
.contest-listing--upcoming .grow strong { font-size: 15px; }
.ranking-hero { border-inline-start: 4px solid var(--accent); }
.ranking-hero h1, .profile-hero h1 { font-size: clamp(23px, 3vw, 32px); overflow-wrap: anywhere; }
.app .top-list .is-me { border-inline-start: 3px solid var(--accent); }

/* Reading, solving, and feedback keep tools close to their content. */
.problem-context { padding-block-end: 12px; border-bottom: 1px solid var(--border-strong); }
.problem-layout .problem-statement, .problem-layout .workspace { min-width: 0; padding: clamp(13px, 2vw, 24px); }
.problem-layout .problem-statement h1 { font-size: clamp(20px, 2.65vw, 33px); overflow-wrap: anywhere; }
.problem-layout .problem-statement .prose { max-width: 70ch; overflow-wrap: anywhere; }
.problem-layout .problem-statement h3 { font-weight: 900; margin-block-end: 4px; }
.problem-layout .workspace { border-block-start: 3px solid var(--accent); }
.problem-layout .sample, .problem-layout .file-row .grow { min-width: 0; overflow-wrap: anywhere; }
.problem-layout .sample-pre { max-width: 100%; overflow-x: auto; }
.problem-layout .run-result { min-width: 0; }
.learning-overview, .learning-reader__hero { border-start-start-radius: 5px; }
.learning-reader__body { line-height: 2.15; }
.learning-reader__outline a:focus-visible { outline-offset: -3px; }
.learning-overview .learning-resume { border-inline-start: 3px solid var(--accent); }
.chat-thread .card-head { border-bottom: 1px solid var(--border); padding-block-end: 12px; }
.chat-thread .bubble, .chat-thread .bubble-problem, .chat-thread .chat-input textarea { min-width: 0; overflow-wrap: anywhere; }

/* Administration puts navigation, sections, and test inputs on separate visual levels. */
.management-head { padding: clamp(15px, 2.6vw, 30px); background: var(--surface); border-block-end: 1px solid var(--border); border-inline-start: 4px solid var(--accent); }
.management-head > div { min-width: 0; }
.management-head .actions:empty { display: none; }
.management-head .link + h1 { margin-block-start: 4px; }
.manage-form .form-section-head { background: var(--surface-2); border-block-end: 1px solid var(--border); border-start-start-radius: inherit; border-start-end-radius: inherit; }
.manage-form .form-section-head h2 { font-size: 17px; }
.manage-form .form-section-head .thumb { background: var(--accent-soft); color: var(--accent-strong); }
.manage-form .form-section .form-grid { align-items: start; }
.manage-form .field textarea, .manage-form .field input[type='file'] { width: 100%; }
.manage-form .inline-row { border-inline-start: 3px solid var(--border-strong); min-width: 0; }
.manage-form .inline-row.has-error { border-inline-start-color: var(--danger); }
.manage-form .inline-row-head { padding-block-end: 8px; border-bottom: 1px solid var(--border); }
.manage-form .inline-grid label[data-field='inline:input_data'] textarea,
.manage-form .inline-grid label[data-field='inline:expected_output'] textarea { direction: ltr; unicode-bidi: plaintext; font-family: var(--mono); }
.manage-form .inline-grid .check { flex-direction: row; align-items: center; justify-content: flex-start; }
.manage-form .inline-grid .check > input { order: -1; margin: 0; }
.resource-grid .resource-card { border-radius: 8px; box-shadow: none; }
.resource-grid .resource-card:hover, .resource-grid .resource-card:focus-visible { border-color: var(--accent); }
.cc-top { padding: 12px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); }
.cc-top .cc-stat, .cc-top .cc-clock { box-shadow: none; background: var(--surface-2); }
.cc-top .cc-clock { border-inline-start: 3px solid var(--accent); }
.cc-side > section { min-width: 0; }
.cc-side .cc-feed li { overflow-wrap: anywhere; }

@media (max-width: 780px) {
    .bank-results .bank-card { grid-template-columns: minmax(0, 1fr) minmax(102px, auto); grid-template-areas: 'title states' 'notes states' 'topics topics'; row-gap: 5px; }
    .bank-results .bank-card__top { flex-direction: column; align-items: flex-end; gap: 3px; }
    .bank-results .bank-card .chips:empty { display: none; }
    .app .card-head { flex-wrap: wrap; align-items: center; }
    .app .menu-toggle, .app .topbar .icon-btn { width: 44px; min-height: 44px; }
    .app .btn { white-space: normal; min-height: 36px; height: auto; }
    .app .problem-meta .badge { white-space: normal; height: auto; min-height: 22px; }
    .app .page-head .actions { overflow-wrap: anywhere; }
    .contest-listing .end { white-space: normal; height: auto; min-height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .bank-card, .app .resource-card, .app .nav a, .app .contest-listing { transition: none; }
}
