/* =========================================================
   Conjj design system — RTL, light + dark, brand navy/indigo
   ========================================================= */
:root {
  --brand: #21A08C;
  --brand-600: #178A78;
  --brand-400: #4FBFAD;
  --brand-300: #8DD8CA;
  --brand-50: #EAF7F4;
  --brand-100: #D2EFE8;
  --navy: #12312C;
  --navy-950: #08201C;
  --navy-900: #0D2723;
  --navy-850: #10302B;
  --navy-800: #153A34;
  --navy-700: #1B463F;

  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface-2: #F9FAFC;
  --surface-3: #EEF0F2;
  --line: #E8EAEE;
  --line-2: #DCDFE5;
  --text: #1B2422;
  --text-2: #4E5A57;
  --muted: #7A8582;
  --brand-ink: #178A78;
  --brand-soft: #DDF3EE;

  --ok: #1E9E63;   --ok-bg: #E2F5EA;
  --warn: #A5670B; --warn-bg: #FDF3E1;
  --bad: #CC3149;  --bad-bg: #FDEBEE;
  --info: #2E64D6; --info-bg: #EAF0FD;
  --neutral: #5D6380; --neutral-bg: #EEF0F5;

  --ch-line: #21A08C;
  --ch-fill: rgba(33, 160, 140, .20);
  --ch-grid: #ECEEF3;
  --ch-base: #C9CDDA;
  --violet: #6B5BE6; --violet-bg: #ECE9FC; --blue: #3A6FE0; --blue-bg: #E5EEFC;

  --r-xs: 8px; --r-sm: 12px; --r: 16px; --r-lg: 22px; --r-xl: 30px;
  --sh-xs: 0 1px 2px rgba(17, 22, 42, .035);
  --sh-sm: 0 1px 2px rgba(17, 22, 42, .025), 0 4px 14px -6px rgba(17, 22, 42, .06);
  --sh: 0 14px 36px -16px rgba(17, 22, 42, .12), 0 2px 6px rgba(17, 22, 42, .03);
  --sh-lg: 0 32px 70px -30px rgba(12, 17, 34, .24), 0 8px 22px -14px rgba(12, 17, 34, .12);
  --ring: 0 0 0 4px rgba(33, 160, 140, .18);
  --font: "Vazirmatn", "Vazir", Tahoma, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1513; --surface: #111D1A; --surface-2: #152522; --surface-3: #1A2D29;
    --line: #20332F; --line-2: #2A423C; --text: #EAF2EF; --text-2: #B5C4BF; --muted: #7F918C;
    --brand-ink: #7FDCCB; --brand-soft: rgba(33, 160, 140, .14);
    --ok: #3DD29A; --ok-bg: rgba(61, 210, 154, .12); --warn: #F2B550; --warn-bg: rgba(242, 181, 80, .12);
    --bad: #FF7489; --bad-bg: rgba(255, 116, 137, .12); --info: #7EA8FF; --info-bg: rgba(126, 168, 255, .12);
    --neutral: #A3AAC4; --neutral-bg: rgba(163, 170, 196, .12);
    --ch-line: #4FCFB8; --ch-fill: rgba(79, 207, 184, .24); --ch-grid: #1B2C28; --ch-base: #2E4640; --violet: #A79BFF; --violet-bg: rgba(124,108,240,.18); --blue: #8FB0FF; --blue-bg: rgba(76,127,232,.18);
    --sh-sm: 0 1px 2px rgba(0,0,0,.3); --sh: 0 16px 40px -16px rgba(0,0,0,.6); --sh-lg: 0 40px 80px -28px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1513; --surface: #111D1A; --surface-2: #152522; --surface-3: #1A2D29;
  --line: #20332F; --line-2: #2A423C; --text: #EAF2EF; --text-2: #B5C4BF; --muted: #7F918C;
  --brand-ink: #7FDCCB; --brand-soft: rgba(33, 160, 140, .14);
  --ok: #3DD29A; --ok-bg: rgba(61, 210, 154, .12); --warn: #F2B550; --warn-bg: rgba(242, 181, 80, .12);
  --bad: #FF7489; --bad-bg: rgba(255, 116, 137, .12); --info: #7EA8FF; --info-bg: rgba(126, 168, 255, .12);
  --neutral: #A3AAC4; --neutral-bg: rgba(163, 170, 196, .12);
  --ch-line: #4FCFB8; --ch-fill: rgba(79, 207, 184, .24); --ch-grid: #1B2C28; --ch-base: #2E4640; --violet: #A79BFF; --violet-bg: rgba(124,108,240,.18); --blue: #8FB0FF; --blue-bg: rgba(76,127,232,.18);
  --sh-sm: 0 1px 2px rgba(0,0,0,.3); --sh: 0 16px 40px -16px rgba(0,0,0,.6); --sh-lg: 0 40px 80px -28px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.75; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "ss01";
  overflow-x: hidden; overflow-x: clip;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: rgba(33, 160, 140, .22); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 24px; }
.grow { flex: 1; min-width: 0; }
.only-dark { display: none !important; }
[data-theme="dark"] .only-dark { display: block !important; }
[data-theme="dark"] .only-light { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block !important; }
  :root:not([data-theme="light"]) .only-light { display: none !important; }
}
.logo { display: inline-flex; align-items: center; }
.logo-img { height: 38px; width: auto; }

/* ---------- buttons ---------- */
.btn {
  --bh: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--bh); padding: 0 20px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 14.5px; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, color .2s; user-select: none;
  background: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-sm { --bh: 40px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { --bh: 54px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-primary {
  color: #fff; background: linear-gradient(180deg, #2BB09A, #1C9482);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 6px 16px -8px rgba(33, 160, 140, .55);
}
.btn-primary:hover { background: linear-gradient(180deg, #33BBA4, #21A08C); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 10px 22px -10px rgba(33, 160, 140, .65); }
.btn-dark { color: #fff; background: var(--navy); box-shadow: 0 8px 20px -10px rgba(12,17,34,.6); }
.btn-dark:hover { background: var(--navy-700); }
.btn-outline { border-color: var(--line-2); background: var(--surface); color: var(--text); box-shadow: var(--sh-xs); }
.btn-outline:hover { border-color: var(--brand-300); color: var(--brand-ink); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-soft:hover { background: var(--brand-100); }
[data-theme="dark"] .btn-soft:hover { background: rgba(33,160,140,.24); }
.btn-danger { color: #fff; background: linear-gradient(180deg, #E0485F, #C8304A); box-shadow: 0 8px 20px -10px rgba(204, 49, 73, .7); }
.btn-danger:hover { background: #D63B53; }
.btn-ok { color: #fff; background: linear-gradient(180deg, #14A774, #0B8A5F); box-shadow: 0 8px 20px -10px rgba(11, 138, 95, .7); }
.btn-glass { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255,255,255,.14); }
.btn-white { color: var(--navy); background: #fff; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5); }
.btn-white:hover { background: #EDF7F4; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
  color: var(--text-2); transition: background .2s, color .2s; flex: none; position: relative;
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.link { color: var(--brand-ink); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; font-size: 13.5px; align-content: start; }
.field > span { font-weight: 700; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12.5px; }
.req { color: var(--bad); font-weight: 700; }
.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text); font-size: 14.5px; transition: border-color .2s, box-shadow .2s; outline: none;
}
textarea.input { resize: vertical; line-height: 1.8; }
select.input { appearance: none; padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23767C94' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; }
.input::placeholder { color: var(--muted); opacity: .8; }
.input:hover { border-color: var(--muted); }
.input:focus { border-color: var(--brand); box-shadow: var(--ring); }
.input.invalid { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(204, 49, 73, .12); }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.input-group:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.input-group .input { border: 0; box-shadow: none !important; border-radius: 0; }
.affix { display: grid; place-items: center; padding: 0 14px; color: var(--muted); background: var(--surface-2); font-size: 13px; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; position: relative; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.switch i { width: 42px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(-18px); }
.switch input:focus-visible + i { box-shadow: var(--ring); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 3px; flex: none; }

/* ---------- badges / chips / avatars ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  color: var(--c); background: var(--cb);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-ok { --c: var(--ok); --cb: var(--ok-bg); }
.tone-warn { --c: var(--warn); --cb: var(--warn-bg); }
.tone-bad { --c: var(--bad); --cb: var(--bad-bg); }
.tone-info { --c: var(--info); --cb: var(--info-bg); }
.tone-neutral { --c: var(--neutral); --cb: var(--neutral-bg); }
.tone-brand { --c: var(--brand-ink); --cb: var(--brand-soft); }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2);
  background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: all .2s;
}
.chip:hover { border-color: var(--brand-300); color: var(--text); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
[data-theme="dark"] .chip.on { background: var(--brand); border-color: var(--brand); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.avatar {
  --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: calc(var(--s) * .36); font-weight: 700; color: var(--brand-ink); background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(33, 160, 140, .14); letter-spacing: -.02em; line-height: 1;
}
[data-theme="dark"] .avatar { color: #9FE3D6; background: rgba(33,160,140,.18); }
.avatars { display: inline-flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--surface); margin-inline-start: -8px; }
.avatars .avatar:first-child { margin-inline-start: 0; }
.avatar-more { background: var(--surface-3); color: var(--text-2); font-size: 11px; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text); font-size: 13.5px; }
.rating .ic { color: #F2A93B; fill: #F2A93B; stroke: #F2A93B; }
.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-400), var(--brand)); }
.progress.tone-ok i { background: var(--ok); } .progress.tone-warn i { background: var(--warn); } .progress.tone-bad i { background: var(--bad); }
.kbd { font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px 22px 22px; }
.card-flush .card-body { padding: 12px 0 6px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-sm);
  display: grid; gap: 6px; position: relative; overflow: hidden; min-width: 0;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-inline-start: 4px; }
.stat-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.delta.up { color: var(--ok); background: var(--ok-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.stat-hero { background: radial-gradient(120% 140% at 100% 0%, rgba(33, 160, 140, .7) 0%, #1B4A42 55%, #12312C 100%); border: 0; color: #fff; }
.stat-hero .stat-label, .stat-hero .stat-foot { color: rgba(255,255,255,.7); }
.stat-hero .stat-ic { background: rgba(255,255,255,.12); color: #fff; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2e { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 640px; }
.table th { text-align: right; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child { border-start-start-radius: 0; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .end { text-align: left; white-space: nowrap; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-user b { display: block; font-weight: 700; font-size: 14px; white-space: nowrap; }
.cell-user span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; direction: ltr; unicode-bidi: isolate; color: var(--text-2); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.toolbar .search { flex: 1; min-width: 200px; max-width: 360px; }
.search:not(body) { position: relative; }
.search:not(body) .ic { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search:not(body) .input { padding-right: 40px; min-height: 42px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 12px 14px; border: 0; background: none; font-weight: 700; font-size: 14px; color: var(--muted);
  position: relative; white-space: nowrap; transition: color .2s;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 2.5px; border-radius: 3px 3px 0 0; background: var(--brand); }
.tab-count { font-size: 11.5px; background: var(--surface-3); color: var(--text-2); padding: 0 7px; border-radius: 99px; line-height: 20px; }
.tab.on .tab-count { background: var(--brand-soft); color: var(--brand-ink); }
.seg { display: inline-flex; padding: 4px; background: var(--surface-3); border-radius: 12px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--muted); transition: all .2s; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }

/* ---------- empty / misc ---------- */
.empty { text-align: center; padding: 44px 20px; display: grid; justify-items: center; gap: 8px; }
.empty-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 6px; }
.empty h4 { font-size: 16px; }
.empty p { color: var(--muted); font-size: 14px; max-width: 360px; }
.nf { min-height: 80vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 12px; padding: 24px; }
.nf-code { font-size: 96px; font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--brand), var(--navy)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf p { color: var(--muted); margin-bottom: 8px; }
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--line); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .grow span { display: block; font-size: 12.5px; color: var(--muted); }
.ic-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--cb, var(--brand-soft)); color: var(--c, var(--brand-ink)); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; text-align: left; }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--brand-soft); color: var(--text-2); font-size: 13.5px; line-height: 1.8; }
.note .ic { color: var(--brand-ink); margin-top: 3px; }
.note.tone-warn { background: var(--warn-bg); } .note.tone-warn .ic { color: var(--warn); }
.note.tone-bad { background: var(--bad-bg); } .note.tone-bad .ic { color: var(--bad); }
.note.tone-ok { background: var(--ok-bg); } .note.tone-ok .ic { color: var(--ok); }
.note b { color: var(--text); }

/* status timeline (payout steps) */
.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; position: relative; padding-bottom: 18px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; right: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); position: relative; z-index: 1; }
.step.done .step-dot { background: var(--ok); color: #fff; box-shadow: none; }
.step.done::before { background: var(--ok); }
.step.cur .step-dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 5px var(--brand-soft); }
.step.fail .step-dot { background: var(--bad); color: #fff; box-shadow: none; }
.step b { font-size: 14px; display: block; }
.step span { font-size: 12.5px; color: var(--muted); }

/* ---------- toast / modal ---------- */
.toasts { position: fixed; bottom: 24px; left: 24px; z-index: 200; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--navy-900); color: #fff;
  box-shadow: var(--sh-lg); font-weight: 600; font-size: 14px; animation: toastIn .35s var(--ease); max-width: min(420px, calc(100vw - 48px));
  border: 1px solid rgba(255,255,255,.08);
}
.toast-ok .ic { color: #3DD29A; } .toast-bad .ic { color: #FF7489; } .toast-warn .ic { color: #F2B550; } .toast-info .ic { color: #8DD8CA; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }
#layer { position: fixed; inset: 0; z-index: 150; display: none; }
#layer.open { display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 26, .55); backdrop-filter: blur(6px); animation: fade .25s; }
.modal {
  position: relative; width: 100%; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 24px; box-shadow: var(--sh-lg);
  border: 1px solid var(--line); animation: pop .35s var(--ease);
}
.modal-sm { max-width: 460px; } .modal-md { max-width: 580px; } .modal-lg { max-width: 820px; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 6px; }
.modal-head > div { flex: 1; }
.modal-head h3 { font-size: 18px; }
.modal-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.modal-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--cb); color: var(--c); flex: none; }
.modal-body { padding: 14px 24px 8px; display: grid; gap: 16px; }
.modal-text { color: var(--text-2); font-size: 14.5px; }
.modal-foot { display: flex; justify-content: flex-start; flex-direction: row-reverse; gap: 10px; flex-wrap: wrap; padding: 14px 24px 22px; }
.reauth { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.reauth .ic { color: var(--brand-ink); margin-top: 3px; }
.reauth b { display: block; font-size: 14px; } .reauth span { font-size: 12.5px; color: var(--muted); }
.audit-note { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; user-select: none; touch-action: pan-y; }
.chart svg { display: block; overflow: visible; }
.ch-grid { stroke: var(--ch-grid); stroke-width: 1; }
.ch-base { stroke: var(--ch-base); stroke-width: 1; }
.ch-y { fill: var(--muted); font-size: 11.5px; text-anchor: start; font-family: var(--font); }
.ch-x { fill: var(--muted); font-size: 11.5px; text-anchor: middle; font-family: var(--font); }
.ch-line { fill: none; stroke: var(--ch-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-stop1 { stop-color: var(--ch-line); stop-opacity: .22; }
.ch-stop2 { stop-color: var(--ch-line); stop-opacity: 0; }
.ch-end { fill: var(--ch-line); stroke: var(--surface); stroke-width: 2.5; }
.ch-cross { stroke: var(--ch-base); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-dot { fill: var(--surface); stroke: var(--ch-line); stroke-width: 2.5; }
.ch-bar { fill: var(--ch-line); transition: opacity .15s; }
.ch-bar.dim { opacity: .35; }
.ch-tip {
  position: absolute; top: 0; left: 0; pointer-events: none; background: var(--navy-900); color: #fff; padding: 7px 12px; border-radius: 10px;
  font-size: 12.5px; display: grid; gap: 0; box-shadow: var(--sh); white-space: nowrap; border: 1px solid rgba(255,255,255,.08);
}
.ch-tip span { color: rgba(255,255,255,.65); font-size: 11.5px; }
.ch-tip b { font-size: 14px; }

/* =========================================================
   Public site — calm, logo palette only (white · indigo · navy)
   ========================================================= */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 60; transition: box-shadow .3s, border-color .3s;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
}
.nav .container { display: flex; align-items: center; gap: 24px; height: 60px; }
.nav .btn-sm { --bh: 34px; }
.nav .role-switch { height: 34px; }
.nav .btn-icon { width: 36px; height: 36px; }
.nav .logo-img { height: 29px; }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-links a { padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14.5px; color: var(--text-2); transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--text); background: var(--surface-3); }
.nav-links a.on { color: var(--brand-ink); }
.nav-tools { display: flex; gap: 8px; align-items: center; }
.nav.scrolled, .nav.solid { border-color: var(--line); }
.nav-burger { display: none; }
.mnav { display: none; }

/* shared bits still used by panels / auth */
.grain { position: absolute; inset: 0; z-index: -1; opacity: .06; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.glass {
  background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(22px); border-radius: 22px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
}
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--bad); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 rgba(255,77,106,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255,77,106,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,106,0); } }
@keyframes float { 50% { translate: 0 -10px; } }
.mini-bars { display: flex; align-items: flex-end; gap: 5px; height: 46px; margin-top: 8px; }
.mini-bars i { flex: 1; border-radius: 4px 4px 1px 1px; background: var(--brand); opacity: .9; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--brand-soft); color: var(--brand-ink); }
.accent { color: var(--brand); white-space: nowrap; }
[data-theme="dark"] .accent { color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .accent { color: var(--brand-ink); } }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }



/* sections */
.section { padding: 110px 0; position: relative; background: var(--surface); }
.section-tight { padding: 70px 0; background: var(--surface); }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin: 0 auto 56px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.section-head.start { margin-inline: 0; text-align: right; justify-items: start; }
.kicker { font-size: 13.5px; font-weight: 700; color: var(--brand-ink); }
.section-head h2 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -.025em; line-height: 1.35; }
.section-head p { font-size: 17px; color: var(--muted); line-height: 2; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .07s; } .reveal.d2 { transition-delay: .14s; } .reveal.d3 { transition-delay: .21s; }


/* community cards */
.comm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 18px; }
.comm-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; position: relative;
}
.comm-card:hover { transform: translateY(-4px); box-shadow: var(--sh); border-color: var(--line-2); }
/* covers use only the logo colours; each community differs by angle, not hue */
.cover {
  position: relative; height: 150px; overflow: hidden;
  background:
    radial-gradient(60% 90% at 90% 0%, rgba(33, 160, 140, .75), transparent 70%),
    linear-gradient(calc(var(--h1) * 1deg), #12312C 20%, #1F7F6E);
}
.cover-glyph { position: absolute; left: 22px; bottom: -14px; color: rgba(255,255,255,.16); transform: rotate(-12deg); }
.cover-glyph .ic { width: 110px; height: 110px; stroke-width: 1.2; }
.comm-card .cover { height: 120px; }
.comm-badges { position: absolute; top: 12px; right: 12px; left: 12px; display: flex; justify-content: space-between; z-index: 2; }
.glass-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(8,12,26,.3); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.16); }
.comm-body { padding: 0 20px 18px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.comm-teacher { display: flex; align-items: flex-end; gap: 10px; margin-top: -22px; position: relative; z-index: 2; }
.comm-teacher .avatar { box-shadow: 0 0 0 4px var(--surface); }
.comm-teacher span { font-size: 12.5px; color: var(--muted); padding-bottom: 2px; }
.comm-card h3 { font-size: 17px; font-weight: 700; }
.comm-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.comm-card p { font-size: 13.5px; color: var(--muted); line-height: 1.9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.comm-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.comm-meta span { display: inline-flex; align-items: center; gap: 5px; }
.comm-price { margin-inline-start: auto; font-size: 15px; color: var(--text); font-weight: 800; white-space: nowrap; }
.comm-price small { font-size: 11.5px; color: var(--muted); font-weight: 600; }



/* pricing */
.pricing { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 30px 28px; display: flex; flex-direction: column; gap: 18px; position: relative;
}
.plan h3 { font-size: 20px; }
.plan > p { color: var(--muted); font-size: 14px; margin-top: -10px; }
.plan-price { display: flex; align-items: baseline; gap: 8px; }
.plan-price b { font-size: 38px; font-weight: 800; letter-spacing: -.03em; }
.plan-price span { color: var(--muted); font-size: 14px; }
.plan-save { font-size: 12.5px; color: var(--muted); font-weight: 600; min-height: 20px; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; font-size: 14.5px; }
.plan li { display: flex; gap: 10px; color: var(--text-2); }
.plan li .ic { color: var(--brand); margin-top: 4px; }
.plan li.off { color: var(--muted); opacity: .6; } .plan li.off .ic { color: var(--muted); }
.plan > .btn { margin-top: auto; }
.plan-hot { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 30px 60px -30px rgba(31, 40, 68, .6); }
.plan-hot > p, .plan-hot .plan-price span, .plan-hot .plan-save { color: rgba(255,255,255,.6); }
.plan-hot li { color: rgba(255,255,255,.82); } .plan-hot li .ic { color: #7FDCCB; }
.plan-flag { position: absolute; top: 24px; left: 24px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 99px; }


/* faq */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 0 4px; }
.faq summary { list-style: none; cursor: pointer; padding: 22px 0; font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { transition: transform .3s; color: var(--muted); }
.faq details[open] summary .ic { transform: rotate(45deg); color: var(--brand); }
.faq details p { padding: 0 0 22px; color: var(--muted); line-height: 2.05; }


/* footer */
.footer { padding: 14px 0; background: var(--surface); border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 18px; }
.footer a { color: var(--muted); transition: color .2s; }
.footer a:hover { color: var(--brand-ink); }

/* page hero (explore, pricing) */
.page-hero { padding: 116px 0 64px; position: relative; }
.page-hero.center { text-align: center; }
.page-hero.center .container { display: grid; justify-items: center; }
.page-hero.center p { margin-inline: auto; }
.page-hero .hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 80% at 50% 0%, var(--brand-soft), transparent 75%); pointer-events: none; }
.page-hero h1 { font-size: clamp(32px, 4.2vw, 50px); font-weight: 800; letter-spacing: -.025em; margin-top: 16px; }
.page-hero p { color: var(--muted); font-size: 17px; margin-top: 12px; max-width: 620px; }
.explore-bar { display: flex; gap: 12px; width: 100%; max-width: 620px; margin: 26px auto 0; position: relative; z-index: 3; background: var(--surface); padding: 10px; border-radius: 18px; box-shadow: var(--sh); border: 1px solid var(--line); flex-wrap: wrap; }
.explore-bar .search { flex: 1; min-width: 220px; }
.explore-bar .search .input { border: 0; background: var(--surface-2); min-height: 48px; }

/* community page */
.c-hero { position: relative; padding: 60px 0 0; overflow: hidden; }
.c-hero .cover { position: absolute; inset: 0; height: auto; }
.c-hero .cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,17,34,.1), rgba(12,17,34,.6)); z-index: 1; }
.c-hero .cover-glyph { left: 8%; bottom: auto; top: 90px; }
.c-hero .cover-glyph .ic { width: 280px; height: 280px; }
.c-hero-inner { position: relative; z-index: 2; color: #fff; padding: 40px 0 44px; }
.c-hero h1 { font-size: clamp(30px, 4vw, 50px); font-weight: 800; letter-spacing: -.02em; margin: 14px 0 10px; }
.c-hero p { color: rgba(255,255,255,.75); font-size: 17px; max-width: 640px; }
.c-facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 22px; font-size: 14px; color: rgba(255,255,255,.8); }
.c-facts span { display: inline-flex; align-items: center; gap: 7px; }
.c-facts .rating { color: #fff; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.crumbs a:hover { color: var(--brand-ink); }
.c-hero .crumbs { color: rgba(255,255,255,.6); }
.c-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; padding: 36px 0 90px; }
.c-main { display: grid; gap: 24px; min-width: 0; }
.c-aside { position: sticky; top: 96px; display: grid; gap: 16px; margin-top: -120px; z-index: 5; }
.buy-card { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 24px; box-shadow: var(--sh-lg); display: grid; gap: 16px; }
.plan-opts { display: grid; gap: 10px; }
.plan-opt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: 16px; cursor: pointer; transition: all .2s; position: relative; }
.plan-opt:hover { border-color: var(--brand-300); }
.plan-opt input { position: absolute; opacity: 0; }
.plan-opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; transition: all .2s; }
.plan-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.plan-opt:has(input:checked) .radio { border: 6px solid var(--brand); }
.plan-opt:has(input:focus-visible) { box-shadow: var(--ring); }
.plan-opt b { display: block; font-size: 14.5px; } .plan-opt small { color: var(--muted); font-size: 12px; }
.plan-opt .p { margin-inline-start: auto; text-align: left; font-weight: 800; font-size: 15px; white-space: nowrap; }
.plan-opt .p s { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.save-tag { position: absolute; top: -10px; left: 14px; font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 99px; background: var(--ok); color: #fff; }
.trust-row { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 12.5px; color: var(--muted); }
.trust-row .ic { color: var(--ok); }
.prose { color: var(--text-2); line-height: 2.1; font-size: 15.5px; }
.prose p + p { margin-top: 12px; }
.curr { display: grid; gap: 10px; }
.curr-item { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.curr-item .n { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 14px; flex: none; }
.curr-item b { display: block; font-size: 14.5px; } .curr-item span { font-size: 12.5px; color: var(--muted); }
.rules { counter-reset: r; display: grid; gap: 10px; padding: 0; margin: 0; }
.rules li { list-style: none; display: flex; gap: 12px; font-size: 14.5px; color: var(--text-2); counter-increment: r; }
.rules li::before { content: counter(r, persian); width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.teacher-card { display: flex; gap: 18px; align-items: flex-start; }
.teacher-card h4 { font-size: 18px; } .teacher-card .muted { font-size: 13.5px; }
.teacher-card p { margin-top: 10px; color: var(--text-2); line-height: 2; font-size: 14.5px; }
.review { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.review:last-child { border-bottom: 0; padding-bottom: 0; }
.review p { color: var(--text-2); font-size: 14.5px; line-height: 2; }
.checkout-sum { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.checkout-sum div { display: flex; justify-content: space-between; gap: 12px; }
.checkout-sum .total { border-top: 1px dashed var(--line-2); padding-top: 10px; font-weight: 800; font-size: 16px; }
.gw-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gw { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 14px; cursor: pointer; font-weight: 700; font-size: 14px; position: relative; }
.gw input { position: absolute; opacity: 0; }
.gw:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.gw i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; color: #fff; }
.pay-state { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 14px 0; }
.pay-state .big-ic { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--surface); }
.auth-form { display: flex; flex-direction: column; padding: 32px clamp(20px, 6vw, 88px); }
.auth-form-inner { width: 100%; max-width: 420px; margin: auto; display: grid; gap: 20px; padding: 40px 0; }
.auth-form h1 { font-size: 30px; font-weight: 800; }
.auth-form .lead { color: var(--muted); margin-top: -10px; }
.auth-side { position: relative; overflow: hidden; margin: 12px; border-radius: 30px; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; color: #fff; isolation: isolate; background: var(--navy); }
.auth-side h2 { font-size: 34px; font-weight: 800; line-height: 1.4; letter-spacing: -.02em; }
.auth-side p { color: rgba(255,255,255,.65); margin-top: 12px; font-size: 16px; max-width: 460px; }
.auth-quote { margin-top: 30px; padding: 20px; }
.auth-quote p { color: rgba(255,255,255,.85); font-size: 15px; margin: 0 0 14px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick label { display: grid; gap: 4px; padding: 16px; border: 1.5px solid var(--line-2); border-radius: 16px; cursor: pointer; transition: all .2s; position: relative; }
.role-pick input { position: absolute; opacity: 0; }
.role-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.role-pick .ic { color: var(--brand-ink); }
.role-pick b { font-size: 14.5px; } .role-pick span { font-size: 12px; color: var(--muted); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.otp { display: flex; gap: 10px; direction: ltr; justify-content: center; }
.otp input { width: 52px; height: 58px; text-align: center; font-size: 22px; font-weight: 700; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); outline: none; }
.otp input:focus { border-color: var(--brand); box-shadow: var(--ring); }

/* =========================================================
   Panel shell
   ========================================================= */
.shell { display: grid; grid-template-columns: 276px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--navy-900); color: #fff; padding: 18px 14px;
  background-image: radial-gradient(120% 50% at 100% 0%, rgba(33, 160, 140, .22), transparent 60%);
  border-inline-start: 1px solid rgba(255,255,255,.04); z-index: 40;
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 18px; }
.side-logo .logo-img { height: 34px; }
.side-close { display: none; color: rgba(255,255,255,.7); }
.side-role { display: flex; align-items: center; gap: 8px; margin: 0 6px 14px; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); font-size: 13px; font-weight: 700; color: rgba(255,255,255,.85); }
.side-role .ic { color: #7FDCCB; }
.side-nav { display: grid; gap: 2px; overflow-y: auto; flex: 1; align-content: start; padding: 0 2px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent; }
.side-group { font-size: 11.5px; font-weight: 700; color: rgba(255,255,255,.38); padding: 16px 12px 6px; letter-spacing: .02em; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: rgba(255,255,255,.66); font-weight: 600; font-size: 14.5px; transition: all .2s; position: relative; }
.side-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-link.on { background: linear-gradient(90deg, rgba(33,160,140,.08), rgba(33,160,140,.32)); color: #fff; box-shadow: inset 0 0 0 1px rgba(141,216,202,.22); }
.side-link.on::before { content: ""; position: absolute; right: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px 0 0 3px; background: #4FCFB8; }
.side-link.on .ic { color: #8DD8CA; }
.side-badge { margin-inline-start: auto; font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: #21A08C; color: #fff; }
.side-foot { padding-top: 12px; display: grid; gap: 10px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.side-user > div { flex: 1; min-width: 0; }
.side-user b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user span { display: block; font-size: 11.5px; color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: right; }
.side-user .btn-icon { color: rgba(255,255,255,.55); width: 34px; height: 34px; }
.side-user .btn-icon:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-user .avatar { color: #fff; background: linear-gradient(135deg, #4FBFAD, #178A78); box-shadow: none; }
.side-promo { padding: 16px; border-radius: 16px; background: linear-gradient(150deg, rgba(33,160,140,.35), rgba(33,160,140,.08)); border: 1px solid rgba(141,216,202,.25); font-size: 13px; }
.side-promo b { display: block; font-size: 14px; margin-bottom: 4px; }
.side-promo span { color: rgba(255,255,255,.7); display: block; margin-bottom: 10px; }
.side-promo .progress { background: rgba(255,255,255,.12); height: 6px; margin-bottom: 8px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 70px; display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--line);
}
.burger { display: none; }
.topbar-search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.topbar-search:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.topbar-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 14px; color: var(--text); }
.topbar-tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.bell-dot { position: absolute; top: 9px; left: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--bg); }
.topbar-me { margin-inline-start: 6px; }
.role-switch { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; font-weight: 700; }
.page { padding: 28px; width: 100%; max-width: 1360px; margin: 0 auto; display: grid; gap: 22px; align-content: start; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.shell-backdrop { display: none; }
.welcome {
  border-radius: 22px; padding: 20px 24px; color: #fff; position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(90% 160% at 0% 0%, rgba(79,191,173,.42), transparent 60%), linear-gradient(135deg, #1B4A42, #12312C);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.welcome h2 { font-size: 20px; font-weight: 700; }
.welcome p { color: rgba(255,255,255,.72); margin-top: 4px; font-size: 14px; }
.welcome .grain { opacity: .08; }

/* community space */
.space { display: grid; grid-template-columns: 240px minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.space-nav { position: sticky; top: 92px; display: grid; gap: 14px; }
.space-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.space-card .cover { height: 76px; }
.space-card .cover-glyph .ic { width: 70px; height: 70px; }
.space-card h3 { font-size: 15px; padding: 12px 14px 0; }
.space-card p { font-size: 12.5px; color: var(--muted); padding: 0 14px 12px; }
.chan { display: grid; gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.chan a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.chan a:hover { background: var(--surface-3); }
.chan a.on { background: var(--brand-soft); color: var(--brand-ink); }
.chan a em { margin-inline-start: auto; font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--bad); color: #fff; padding: 0 7px; border-radius: 99px; }
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; display: grid; gap: 12px; box-shadow: var(--sh-sm); }
.composer .row { align-items: flex-start; }
.composer textarea { border: 0; background: var(--surface-2); border-radius: 14px; min-height: 52px; resize: vertical; }
.composer-tools { display: flex; align-items: center; gap: 4px; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh-sm); overflow: hidden; }
.post-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.post-head b { font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.post-head span { font-size: 12.5px; color: var(--muted); }
.post-body { padding: 12px 20px 4px; display: grid; gap: 12px; }
.post-body h4 { font-size: 17px; }
.post-body p { color: var(--text-2); line-height: 2.05; font-size: 15px; white-space: pre-line; }
.post-attach { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.post-attach b { font-size: 14px; display: block; } .post-attach span { font-size: 12px; color: var(--muted); }
.post-video { aspect-ratio: 16/8; border-radius: 16px; display: grid; place-items: center; position: relative; overflow: hidden; background: radial-gradient(60% 90% at 85% 0%, rgba(33, 160, 140, .7), transparent 70%), linear-gradient(135deg, #12312C, #1F7F6E); }
.post-video .play { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--navy); display: grid; place-items: center; box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.post-video .dur { position: absolute; bottom: 12px; left: 12px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0,0,0,.45); padding: 2px 10px; border-radius: 8px; }
.post-actions { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-top: 1px solid var(--line); margin-top: 10px; }
.post-actions button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.post-actions button:hover { background: var(--surface-3); color: var(--text); }
.post-actions button.on { color: var(--bad); }
.post-actions button.on .ic { fill: currentColor; }
.post-actions .end { margin-inline-start: auto; }
.comments { background: var(--surface-2); border-top: 1px solid var(--line); padding: 14px 20px; display: grid; gap: 12px; }
.comment { display: flex; gap: 10px; }
.comment-bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 10px 14px; font-size: 14px; flex: 1; min-width: 0; }
.comment-bubble b { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.comment-bubble b span { color: var(--muted); font-weight: 500; font-size: 12px; }
.comment-bubble p { color: var(--text-2); line-height: 1.95; margin-top: 2px; }
.comment-form { display: flex; gap: 10px; align-items: center; }
.comment-form .input { min-height: 42px; border-radius: 99px; }
.tag-teacher { font-size: 11px; font-weight: 700; padding: 0 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); line-height: 20px; }
.pinned { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--brand-ink); }
.event-card { display: flex; gap: 14px; align-items: center; }
.date-box { width: 54px; height: 58px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-content: center; text-align: center; flex: none; line-height: 1.2; }
.date-box b { font-size: 20px; font-weight: 800; } .date-box span { font-size: 11px; font-weight: 700; }
.chat { display: flex; flex-direction: column; height: min(640px, calc(100vh - 220px)); }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 72%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.9; }
.msg time { display: block; font-size: 11px; opacity: .6; margin-top: 2px; }
.msg.me { align-self: flex-start; background: linear-gradient(180deg, #2BB09A, #1C9482); color: #fff; border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-end; background: var(--surface-3); border-bottom-left-radius: 6px; }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }

/* notification list */
.notif { display: flex; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--line); position: relative; }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: color-mix(in srgb, var(--brand-soft) 50%, transparent); }
.notif.unread::before { content: ""; position: absolute; right: 8px; top: 24px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.notif b { font-size: 14.5px; display: block; } .notif p { font-size: 13.5px; color: var(--text-2); } .notif time { font-size: 12px; color: var(--muted); }

/* sub card */
.sub-card { display: grid; grid-template-columns: 76px 1fr auto; gap: 18px; align-items: center; padding: 18px 20px; }
.sub-card .cover { height: 76px; border-radius: 18px; }
.sub-card .cover-glyph .ic { width: 60px; height: 60px; }
.sub-card h4 { font-size: 16px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .space { grid-template-columns: 220px minmax(0, 1fr); }
  .space-aside { display: none; }
}
@media (max-width: 1024px) {
  .pricing { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
  .c-layout { grid-template-columns: 1fr; }
  .c-aside { position: static; margin-top: 0; }
  .grid-2, .grid-2e { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; bottom: 0; right: 0; width: 290px; transform: translateX(105%); transition: transform .35s var(--ease); box-shadow: var(--sh-lg); }
  .side { visibility: hidden; transition: transform .35s var(--ease), visibility 0s linear .35s; }
  .drawer-open .side { transform: none; visibility: visible; transition: transform .35s var(--ease); }
  .drawer-open .shell-backdrop { display: block; position: fixed; inset: 0; background: rgba(8,12,26,.5); backdrop-filter: blur(3px); z-index: 35; }
  .side-close, .burger { display: inline-grid; }
}
@media (max-width: 860px) {
  .nav-links, .nav-tools .hide-m { display: none; }
  .nav-burger { display: inline-grid; }
  .nav .container { gap: 12px; justify-content: space-between; }
  .mnav { display: block; position: fixed; inset: 60px 0 auto; z-index: 59; background: var(--surface); padding: 8px 16px 16px; transform: translateY(-120%); transition: transform .35s var(--ease); border-bottom: 1px solid var(--line); box-shadow: var(--sh); }
  .drawer-open .mnav { transform: none; }
  .mnav a { display: block; padding: 12px 8px; color: var(--text-2); font-weight: 600; border-bottom: 1px solid var(--line); }
  .mnav a:last-child { border-bottom: 0; }
  .space { grid-template-columns: 1fr; }
  .space-nav { position: static; }
  .space-card { display: none; }
  .chan { display: flex; overflow-x: auto; scrollbar-width: none; }
  .chan a { white-space: nowrap; }
  .topbar-search { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .container { padding-inline: 16px; }
  .section { padding: 76px 0; }
  .section-head { margin-bottom: 36px; }
  .section-head p { font-size: 15.5px; }
  .grid-3 { grid-template-columns: 1fr; }
  .page { padding: 18px 16px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .role-switch > .ic { display: none; }
  .page-head h1 { font-size: 22px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 14px 16px 18px; }
  .toolbar { padding: 12px 16px; }
  .list-item { padding: 12px 16px; }
  .notif { padding: 14px 16px; }
  .gw-list { grid-template-columns: 1fr; }
  .sub-card { grid-template-columns: 56px 1fr; }
  .sub-card .cover { height: 56px; border-radius: 14px; }
  .sub-card > :last-child { grid-column: 1 / -1; }
  .msg { max-width: 88%; }
  .stat-value { font-size: 22px; }
  .modal-head, .modal-body, .modal-foot { padding-inline: 18px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .c-hero .cover-glyph { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* OS-level dark preference: mirror the [data-theme="dark"] component overrides */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar { color: #9FE3D6; background: rgba(33,160,140,.18); }
  :root:not([data-theme="light"]) .chip.on { background: var(--brand); border-color: var(--brand); }
  :root:not([data-theme="light"]) .btn-soft:hover { background: rgba(33,160,140,.24); }
}

/* Guard shared marks against generic "container span" rules (.cell-user span, .side-user span …) */
.avatar.avatar { display: inline-grid; place-items: center; width: var(--s); height: var(--s); font-size: calc(var(--s) * .36); font-weight: 700; line-height: 1; color: var(--brand-ink); white-space: nowrap; direction: rtl; text-align: center; overflow: visible; margin-top: 0; }
[data-theme="dark"] .avatar.avatar { color: #9FE3D6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar.avatar { color: #9FE3D6; } }
.side-user .avatar.avatar { color: #fff; }
.avatar.avatar-more { color: var(--text-2); font-size: 11px; }
.ic-box.ic-box { display: grid; place-items: center; margin-top: 0; }
/* chart hover marks stay hidden until the pointer is on the plot */
.ch-tip[hidden] { display: none; }
.ch-cross, .ch-dot { opacity: 0; transition: opacity .12s; }
.chart:hover .ch-cross, .chart:hover .ch-dot { opacity: 1; }

[hidden] { display: none !important; }

/* unified user panel */
.side-cap { margin-inline-start: auto; font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(141,216,202,.18); color: #9FE3D6; }
.l-own-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.l-own-stats div { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 2px; }
.l-own-stats b { font-size: 18px; font-weight: 800; }
.l-own-stats span { font-size: 11.5px; color: var(--muted); }
.l-own-cta .card-body { display: grid; gap: 10px; justify-items: start; }
.l-own-cta h3 { font-size: 17px; }
.l-own-cta p { font-size: 13.5px; line-height: 1.9; }

/* create community flow */
.cr-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.cr-step { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.cr-step i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--surface-3); color: var(--text-2); }
.cr-step.on { color: var(--text); border-color: var(--brand-300); }
.cr-step.on i { background: var(--brand); color: #fff; }
.cr-step.done i { background: var(--brand-soft); color: var(--brand-ink); }
.cr-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cr-plan { position: relative; display: grid; gap: 10px; align-content: start; padding: 22px; border-radius: 20px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.cr-plan:hover { border-color: var(--brand-300); }
.cr-plan input { position: absolute; opacity: 0; }
.cr-plan:has(input:checked) { border-color: var(--brand); box-shadow: var(--ring); }
.cr-plan:has(input:focus-visible) { box-shadow: var(--ring); }
.cr-plan h4 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.cr-plan .plan-price b { font-size: 28px; }
.cr-plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.cr-plan li { display: flex; gap: 8px; }
.cr-plan li .ic { color: var(--brand); margin-top: 3px; }
@media (max-width: 1024px) { .cr-plans { grid-template-columns: 1fr; } }

/* phones: community cards two per row, compact */
@media (max-width: 640px) {
  .comm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .comm-card { border-radius: 16px; }
  .comm-card:hover { transform: none; }
  .comm-card .cover { height: 78px; }
  .comm-card .cover-glyph { left: 10px; bottom: -8px; }
  .comm-card .cover-glyph .ic { width: 64px; height: 64px; }
  .comm-badges { top: 8px; right: 8px; left: 8px; }
  .comm-badges > :nth-child(2) { display: none; }
  .comm-badges .glass-pill { font-size: 10.5px; padding: 2px 8px; gap: 4px; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .comm-badges .glass-pill .ic { width: 11px; height: 11px; }
  .comm-body { padding: 0 12px 12px; gap: 6px; }
  .comm-teacher { margin-top: -18px; gap: 6px; }
  .comm-teacher .avatar.avatar { --s: 34px !important; box-shadow: 0 0 0 3px var(--surface); }
  .comm-teacher span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .comm-card h3 { font-size: 14px; line-height: 1.5; }
  .comm-card p { font-size: 12px; line-height: 1.8; }
  .comm-meta { flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; padding-top: 8px; }
  .comm-meta .ic { width: 13px; height: 13px; }
  .comm-meta .rating { font-size: 12px; }
  .comm-price { width: 100%; margin: 0; font-size: 13.5px; }
  .comm-price small { font-size: 10.5px; }
}

/* referral programme */
.rf-hero { background: var(--navy); color: #fff; border-radius: 24px; padding: 28px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.rf-hero-main { display: flex; gap: 20px; align-items: center; }
.rf-pct { font-size: 56px; font-weight: 800; line-height: 1; color: #7FDCCB; letter-spacing: -.03em; flex: none; }
.rf-hero h2 { font-size: 21px; font-weight: 800; line-height: 1.5; }
.rf-hero p { color: rgba(255,255,255,.7); font-size: 14px; margin-top: 6px; line-height: 1.9; }
.rf-link label { font-size: 12.5px; color: rgba(255,255,255,.6); font-weight: 700; }
.rf-link-row { display: flex; gap: 8px; margin-top: 8px; }
.rf-link-row .input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #fff; font-size: 14px; text-align: left; }
.rf-share { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: rgba(255,255,255,.6); }
.rf-steps { margin: 0; padding: 0; list-style: none; counter-reset: rf; display: grid; gap: 14px; }
.rf-steps li { counter-increment: rf; display: grid; grid-template-columns: 32px 1fr; gap: 2px 12px; }
.rf-steps li::before { content: counter(rf, persian); grid-row: span 2; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.rf-steps b { font-size: 14.5px; }
.rf-steps span { font-size: 13.5px; color: var(--muted); line-height: 1.9; }
.rf-rules { margin: 0; padding: 0 18px 0 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); line-height: 1.9; }
.rf-promo .card-body { display: flex; align-items: center; gap: 14px; }
.rf-promo-pct { font-size: 26px; font-weight: 800; color: var(--brand); flex: none; }
.rf-promo b { display: block; font-size: 14px; }
.rf-promo span { display: block; font-size: 12.5px; color: var(--muted); }
@media (max-width: 1024px) { .rf-hero { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .rf-hero { padding: 20px; }
  .rf-hero-main { flex-direction: column; align-items: flex-start; gap: 10px; }
  .rf-pct { font-size: 44px; }
  .rf-link-row { flex-direction: column; }
  .rf-promo .card-body { flex-wrap: wrap; }
}
.rf-bottom { align-items: start; }
@media (max-width: 1180px) { .rf-bottom { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .rf-bottom { grid-template-columns: 1fr; } }

/* custom dropdown (replaces native <select> everywhere) */
.cs { position: relative; display: inline-block; min-width: 0; }
.cs-field { display: block; width: 100%; }
.cs-native { position: absolute !important; inset: auto auto 0 0; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.cs-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: right; cursor: pointer; }
.cs-btn.input { min-height: 46px; }
.cs-btn:disabled { opacity: .55; cursor: not-allowed; }
.cs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-chev { flex: none; color: var(--muted); transition: transform .2s var(--ease); }
.cs.open .cs-chev { transform: rotate(180deg); color: var(--brand); }
.cs.open .cs-btn.input { border-color: var(--brand); box-shadow: var(--ring); }
.cs-bare .cs-btn { border: 0; background: none; padding: 0; font-weight: 700; font-size: 13px; color: inherit; gap: 6px; }
.cs-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 80; min-width: 100%; width: max-content; max-width: min(320px, calc(100vw - 32px)); max-height: 300px; overflow-y: auto;
  padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s var(--ease), visibility .15s;
}
.cs.up .cs-menu { top: auto; bottom: calc(100% + 6px); transform: translateY(4px); }
.cs.open .cs-menu { opacity: 1; visibility: visible; transform: none; }
.cs:not(.open) .cs-menu { display: none; }
.cs-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px;
  background: none; text-align: right; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.cs-opt:hover, .cs-opt:focus-visible { background: var(--surface-3); color: var(--text); outline: none; }
.cs-opt.on { background: var(--brand-soft); color: var(--brand-ink); }
.cs-opt:disabled { opacity: .45; cursor: not-allowed; }
.cs-tick { flex: none; opacity: 0; color: var(--brand-ink); }
.cs-opt.on .cs-tick { opacity: 1; }
.role-switch .cs-menu { right: -10px; }
.role-switch .cs-opt { font-size: 13.5px; }
.cs.t-select .cs-btn, .cs.a-select .cs-btn { min-height: 42px; }
.cs.a-select { padding-block: 0; font-size: 14px; }

/* kanj switcher (management pages) */
.ksw { position: relative; }
.ksw-btn {
  display: flex; align-items: center; gap: 12px; min-width: 280px; padding: 6px 14px 6px 10px; border-radius: 14px; cursor: pointer; text-align: right;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-sm); transition: border-color .2s, box-shadow .2s;
}
.ksw-btn:hover { border-color: var(--brand-300); }
.ksw.open .ksw-btn { border-color: var(--brand); box-shadow: var(--ring); }
.ksw-thumb {
  flex: none; border-radius: 10px; display: grid; place-items: center; color: rgba(255,255,255,.85);
  background: radial-gradient(60% 90% at 90% 0%, rgba(33, 160, 140, .75), transparent 70%), linear-gradient(calc(var(--h1) * 1deg), #12312C 20%, #1F7F6E);
}
.ksw-text { display: grid; flex: 1; min-width: 0; line-height: 1.5; }
.ksw-text small { font-size: 11.5px; color: var(--muted); }
.ksw-text b { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ksw-chev { flex: none; color: var(--muted); transition: transform .2s var(--ease); }
.ksw.open .ksw-chev { transform: rotate(180deg); color: var(--brand); }
.ksw-menu {
  position: absolute; top: calc(100% + 8px); right: 0; left: 0; min-width: 300px; z-index: 40; padding: 6px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s var(--ease), visibility .15s;
}
.ksw.open .ksw-menu { opacity: 1; visibility: visible; transform: none; }
.ksw-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ksw-head span { font-weight: 600; }
.ksw-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: none; text-align: right; cursor: pointer; color: var(--text); }
.ksw-opt:hover, .ksw-opt:focus-visible { background: var(--surface-3); outline: none; }
.ksw-opt.on { background: var(--brand-soft); }
.ksw-opt .ksw-text b { font-size: 14px; }
.ksw-tick { flex: none; color: var(--brand-ink); opacity: 0; }
.ksw-opt.on .ksw-tick { opacity: 1; }
.ksw-new { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 11px 10px 6px; border-top: 1px solid var(--line); color: var(--brand-ink); font-weight: 700; font-size: 14px; }
.ksw-new:hover { text-decoration: underline; text-underline-offset: 4px; }
.ksw-limit { margin-top: 6px; padding: 11px 10px 6px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .ksw { width: 100%; }
  .ksw-btn { min-width: 0; width: 100%; }
  .ksw-menu { min-width: 0; }
}

/* ---------- desktop sidebar: icon rail that opens on hover, pin keeps it open ---------- */
.side-mark { display: none; height: 22px; width: auto; }
.side-pin { display: none; color: rgba(255,255,255,.5); width: 34px; height: 34px; margin-inline-start: auto; }
.side-pin:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-pinned .side-pin { color: #9FE3D6; background: rgba(33,160,140,.22); }
.side-pinned .side-pin .ic { transform: rotate(45deg); }
.side-sec-btn { position: relative; }
.side-link span, .side-sec-btn span, .side-role span, .side-user b, .side-user span { white-space: nowrap; }
@media (min-width: 1025px) {
  .side-pin { display: inline-grid; }
  .shell { grid-template-columns: 80px minmax(0, 1fr); transition: grid-template-columns .28s var(--ease); }
  .side-pinned .shell { grid-template-columns: 276px minmax(0, 1fr); }
  .side { width: 80px; overflow-x: hidden; transition: width .26s var(--ease), box-shadow .26s; }
  .side-pinned .side, .side.peek { width: 276px; }
  html:not(.side-pinned) .side.peek { box-shadow: -30px 0 70px -30px rgba(8,12,26,.55); }

}
@media (min-width: 1025px) and (prefers-reduced-motion: reduce) { .shell, .side { transition: none; } }
/* ---------- panel shell: flat menu, mode switch, kanj picker, create / view-as-member links ---------- */
.shell .side-link.on { background: var(--brand-soft); }
.side-head { display: grid; gap: 10px; padding: 0 2px 12px; }
.side-mode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-3); }
.side-mode a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--muted); transition: background .2s, color .2s; }
.side-mode a:hover { color: var(--text); }
.side-mode a.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-xs); }
.side-mode-cur { display: none; } /* the collapsed desktop rail's current-mode square (see the rail block) */
.ksw-side { width: 100%; }
.ksw-side .ksw-btn, .ksw-one { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; text-align: right; }
a.ksw-opt, a.ksw-one { color: var(--text); }
a.ksw-one:hover { border-color: var(--brand-300); color: var(--text); }
.ksw-one.on { background: var(--brand-soft); border-color: transparent; }
.ksw-side .ksw-text b { font-size: 14px; }
.ksw-side .ksw-text small { font-size: 12px; }
.ksw-st { font-weight: 700; color: var(--c); }
.ksw-side .ksw-menu { min-width: 0; }
.side-more { margin-top: 6px; }
.side-more-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-size: 14px; font-weight: 600; text-align: right; cursor: pointer; transition: background .2s, color .2s; }
.side-more-btn:hover { background: var(--surface-3); color: var(--text); }
.side-more-btn > span { flex: 1; }
.side-more-btn .side-badge { margin-inline-start: 0; }
.side-more-chev { transition: transform .2s var(--ease); }
.side-more.open .side-more-chev { transform: rotate(180deg); }
.side-more-list { display: grid; gap: 2px; }
.side-create { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--text); transition: border-color .2s, background .2s; }
.side-create:hover { border-color: var(--brand-300); background: var(--surface-2); }
.side-create-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.side-create-t { display: grid; min-width: 0; line-height: 1.45; }
.side-create-t b { font-size: 14px; font-weight: 700; }
.side-create-t small { font-size: 12px; color: var(--muted); }
.side-view { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--text); font-size: 14px; font-weight: 600; transition: border-color .2s, color .2s; }
.side-view:hover { border-color: var(--brand-300); color: var(--brand-ink); }
.side-view.on { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.side-mode span, .side-view span, .side-more-btn span { white-space: nowrap; }
/*
 * Desktop rail: the collapsed menu is the open menu clipped to 80px. Every row keeps the open width, so
 * hovering never reflows anything — the column widens, labels fade in, and each row's highlight grows
 * from an icon-sized square (clip-path) to the full row.
 */
@media (min-width: 1025px) {
  .shell .side { overflow: hidden; }
  .shell .side > * { width: 232px; flex-shrink: 0; align-self: flex-start; }
  .shell .side .side-top { padding: 2px 3px 14px; }
  .shell .side .side-nav { scrollbar-gutter: stable; overflow-x: hidden; }
  .shell .side .side-link, .shell .side .side-more-btn { min-height: 44px; padding-block: 0; padding-inline: 16px 12px; }
  .shell .side .side-mode a { justify-content: flex-start; padding-inline-start: 13px; }
  .shell .side .ksw-side .ksw-btn, .shell .side .ksw-one { min-height: 54px; }
  .shell .side .ksw-side .ksw-text { line-height: 1.35; }
  .shell .side .side-view { justify-content: flex-start; padding-inline: 15px 12px; }
  .shell .side .side-create { padding-inline: 7px 12px; }
  .shell .side :is(.side-link, .side-more-btn, .side-mode, .ksw-btn, .ksw-one, .side-create, .side-view) {
    clip-path: inset(0 0 0 0 round 12px); transition: clip-path .26s var(--ease), background .2s, color .2s, border-color .2s;
  }
  .shell .side :is(.side-title, .side-pin, .side-link > span, .side-link .side-badge, .side-more-btn > span, .side-more-chev, .side-mode a > span, .ksw-text, .ksw-chev, .side-create-t, .side-view span) { transition: opacity .22s var(--ease); }
  .shell .side .side-group { position: relative; transition: color .22s var(--ease); }
  .shell .side .side-group::after { content: ""; position: absolute; inset-inline-start: 14px; bottom: 14px; width: 24px; height: 1px; background: var(--line-2); opacity: 0; transition: opacity .22s var(--ease); }
  .shell .side .side-link::after { content: ""; position: absolute; top: 8px; inset-inline-start: 31px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--surface); opacity: 0; transition: opacity .22s var(--ease); }

  html:not(.side-pinned) .shell .side:not(.peek) :is(.side-link, .side-more-btn, .side-mode, .ksw-btn, .ksw-one, .side-create, .side-view) { clip-path: inset(0 0 0 calc(100% - 52px) round 12px); }
  html:not(.side-pinned) .shell .side:not(.peek) :is(.side-title, .side-pin, .side-link > span, .side-link .side-badge, .side-more-btn > span, .side-more-chev, .side-mode a > span, .ksw-text, .ksw-chev, .side-create-t, .side-view span) { opacity: 0; }
  html:not(.side-pinned) .shell .side:not(.peek) .side-group { color: transparent; }
  html:not(.side-pinned) .shell .side:not(.peek) .side-group::after { opacity: 1; }
  html:not(.side-pinned) .shell .side:not(.peek) .side-link:has(.side-badge)::after { opacity: 1; }
  html:not(.side-pinned) .shell .side:not(.peek) .side-nav { scrollbar-width: none; }
  html:not(.side-pinned) .shell .side:not(.peek) .side-nav::-webkit-scrollbar { display: none; }
  .shell .side .side-mode { position: relative; }
  .shell .side .side-mode > a { transition: opacity .22s var(--ease), background .2s, color .2s; }
  .shell .side .side-mode-cur { position: absolute; inset-block: 4px; inset-inline-start: 4px; width: 44px; display: grid; place-items: center; border-radius: 9px; background: var(--surface); color: var(--text); box-shadow: var(--sh-xs); opacity: 0; pointer-events: none; transition: opacity .22s var(--ease); }
  html:not(.side-pinned) .shell .side:not(.peek) .side-mode > a { opacity: 0; }
  html:not(.side-pinned) .shell .side:not(.peek) .side-mode-cur { opacity: 1; }
}

/* slim icon rail (C.shell({ rail:true }) on desktop; phones keep the drawer) */
.rail { display: none; }
@media (min-width: 1025px) {
  html .shell.has-rail { grid-template-columns: 80px minmax(0, 1fr); }
  .rail {
    position: sticky; top: 0; z-index: 40; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0;
    background: var(--surface); border-inline-end: 1px solid var(--line); overflow-y: auto; scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
}
.rail-logo { flex: none; margin-bottom: 12px; border-radius: 12px; }
.rail-logo img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.rail-link, .rail-kanj { position: relative; flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); transition: background .2s, color .2s, box-shadow .2s; }
.rail-link:hover { background: var(--surface-3); color: var(--text); }
.rail-link.on { background: var(--brand-soft); color: var(--brand-ink); }
.rail-kanj { border-radius: 14px; background: var(--surface-3); color: var(--text-2); font-size: 14px; font-weight: 800; line-height: 1; white-space: nowrap; }
.rail-kanj:hover { color: var(--text); box-shadow: 0 0 0 2px var(--line-2); }
.rail-kanj.on { background: var(--brand-soft); color: var(--brand-ink); box-shadow: 0 0 0 2px var(--brand); }
.rail-add { background: none; border: 1px dashed var(--line-2); color: var(--muted); }
.rail-sep { flex: none; width: 28px; height: 1px; margin: 8px 0; background: var(--line); }
.rail-fill { flex: 1; }
.rail-dot { position: absolute; top: 8px; left: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--surface); }

/* topbar search (kanjs + panel pages) */
.topbar-title { flex: 0 1 auto; }
.tsearch { position: relative; flex: 1 1 auto; min-width: 0; max-width: 380px; }
.tsearch-box { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: text; transition: border-color .2s, box-shadow .2s; }
.tsearch-box:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.tsearch-box input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 13.5px; color: var(--text); -webkit-appearance: none; appearance: none; }
.tsearch-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
.tsearch-box .kbd { flex: none; direction: ltr; }
.tsearch-pop { position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 50; max-height: min(420px, 70vh); overflow-y: auto; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-lg); }
.tsearch-head { padding: 6px 10px 2px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.tsearch-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 600; }
.tsearch-opt > span { display: grid; min-width: 0; line-height: 1.45; }
.tsearch-opt small { font-size: 12px; font-weight: 500; color: var(--muted); }
.tsearch-opt .ic { color: var(--muted); }
.tsearch-opt:hover, .tsearch-opt.on { background: var(--surface-3); }
.tsearch-opt.on .ic { color: var(--brand-ink); }
.tsearch-none { padding: 14px 10px; font-size: 13.5px; color: var(--muted); text-align: center; }
.tsearch-open { display: none; }
@media (max-width: 860px) {
  .tsearch { display: none; }
  .tsearch-open { display: inline-grid; }
  .topbar.ts-open .tsearch { display: block; position: absolute; top: 10px; inset-inline: 12px; max-width: none; z-index: 5; }
  .topbar.ts-open .tsearch-box { height: 44px; box-shadow: var(--sh); }
  .tsearch-box .kbd { display: none; }
}
@media (pointer: coarse) { .tsearch-box .kbd { display: none; } }

/* "⋯" overflow menu: C.ui.menu(items) */
.kmenu { position: relative; display: inline-flex; flex: none; }
.kmenu.open .kmenu-btn { background: var(--surface-3); color: var(--text); }
.kmenu-pop { position: fixed; z-index: 90; min-width: 180px; max-width: min(280px, calc(100vw - 16px)); padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-lg); }
.kmenu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font-size: 14px; font-weight: 600; text-align: right; cursor: pointer; white-space: nowrap; }
.kmenu-item .ic { color: var(--muted); }
.kmenu-item:hover, .kmenu-item:focus-visible { background: var(--surface-3); outline: none; }
.kmenu-item.danger, .kmenu-item.danger .ic { color: var(--bad); }
@media (pointer: coarse) { .kmenu-item { min-height: 46px; } }

/* stats: no empty footer; phones get a compact 2-column grid */
.stat-foot:empty { display: none; }
@media (max-width: 640px) {
  .grid-stats, .page .grid-stats[class] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .grid-stats .stat { padding: 14px; gap: 6px; border-radius: 16px; }
  .grid-stats .stat-label { font-size: 12.5px; line-height: 1.5; }
  .grid-stats .stat-ic { width: 32px; height: 32px; border-radius: 10px; }
  .grid-stats .stat-ic .ic { width: 16px; height: 16px; }
  .grid-stats .stat-value { font-size: 20px; white-space: normal; overflow-wrap: anywhere; }
  .grid-stats .stat-foot { font-size: 11.5px; }
  .grid-stats .spark { display: none; }
  .grid-stats .stat .ring { --s: 44px; --w: 5px; }
}

/* horizontally scrolling bars: fade the edge that hides more items (classes set by core.js) */
.fade-e { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px); mask-image: linear-gradient(to right, transparent, #000 36px); }
.fade-s { -webkit-mask-image: linear-gradient(to left, transparent, #000 36px); mask-image: linear-gradient(to left, transparent, #000 36px); }
.fade-s.fade-e { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }

/* clickable rows: keyboard focus */
.table tr.clickable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 0; background: var(--surface-2); }

/* tables built with C.ui.table stack into label / value rows on phones */
@media (max-width: 640px) {
  .table.t-stack { min-width: 0; }
  .table.t-stack thead { display: none; }
  .table.t-stack, .table.t-stack tbody, .table.t-stack tr { display: block; width: 100%; }
  .table.t-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table.t-stack tr:last-child { border-bottom: 0; }
  .table.t-stack td { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 4px 0; border: 0; text-align: start; white-space: normal; overflow-wrap: anywhere; }
  .table.t-stack td.end { text-align: start; white-space: normal; }
  .table.t-stack td::before { content: attr(data-label); flex: none; max-width: 45%; font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .table.t-stack td:first-child { padding-bottom: 6px; }
  .table.t-stack td:first-child::before, .table.t-stack td[data-label=""]::before { display: none; }
  .table.t-stack td > * { min-width: 0; }
}

/* tap targets */
@media (pointer: coarse) {
  .btn-sm { --bh: 44px; }
  .btn-icon { width: 44px; height: 44px; }
}
.role-admin .side-foot { border-top: 1px solid var(--line); }

/* ---------- homepage (explore): one search, categories + sort, rows that reveal on scroll, then a pager ---------- */
.home-hero { padding-bottom: 40px; }
.home-search { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 600px; min-height: 58px; margin: 28px auto 0; padding: 0 20px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--sh); color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.home-search:focus-within { border-color: var(--brand); box-shadow: var(--sh), var(--ring); }
.home-search input { flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: none; color: var(--text); font-size: 16px; }
.home-list { padding-bottom: 56px; }
.home-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.home-bar .chips-scroll { flex: 1; min-width: 0; }
.home-sort { display: flex; align-items: center; gap: 10px; flex: none; font-size: 13.5px; color: var(--muted); }
.home-sort select { min-height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); padding: 0 12px; font-size: 13.5px; }
@media (max-width: 760px) {
  .home-hero { padding-bottom: 28px; }
  .home-search { min-height: 52px; margin-top: 22px; }
  .home-search input { height: 50px; }
  .home-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .home-sort { justify-content: space-between; }
}
.ex-in { animation: exIn .55s var(--ease) backwards; }
@keyframes exIn { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ex-in { animation: none; } }
.ex-more { height: 1px; }
.ex-pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 32px; }
.ex-pager[hidden] { display: none; }
.ex-pg { min-width: 44px; height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 14px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.ex-pg:hover:not(:disabled):not(.on) { border-color: var(--brand-300); color: var(--brand-ink); }
.ex-pg.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ex-pg:disabled { opacity: .45; cursor: default; }
.ex-pg-gap { min-width: 24px; text-align: center; color: var(--muted); }
@media (max-width: 480px) { .ex-pg-step span { display: none; } .ex-pg { min-width: 42px; height: 42px; padding: 0 10px; } }
/* «ویژه»: kanjs with a paid spot (or picked by the admin) stand out in gold on the homepage */
.comm-card.is-featured { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent), 0 10px 26px -14px color-mix(in srgb, var(--warn) 60%, transparent); background-image: linear-gradient(0deg, color-mix(in srgb, var(--warn-bg) 85%, transparent), transparent 70%); }
.comm-card.is-featured:hover { border-color: var(--warn); }
.glass-pill.pill-featured { background: #F2B550; border-color: transparent; color: #3A2604; font-weight: 800; }
.glass-pill.pill-featured .ic { color: #3A2604; }
.chip.chip-featured { border-color: color-mix(in srgb, var(--warn) 50%, var(--line-2)); color: var(--warn); font-weight: 700; }
.chip.chip-featured .ic { color: var(--warn); }
.chip.chip-featured:hover { border-color: var(--warn); }
.chip.chip-featured.on { background: #F2B550; border-color: #F2B550; color: #3A2604; box-shadow: 0 6px 16px -8px rgba(242, 181, 80, .7); }
.chip.chip-featured.on .ic { color: #3A2604; }
/* phones: dialogs open as a bottom sheet above the keyboard; the action row never wraps, so the main button stays visible */
@media (max-width: 640px) {
  #layer.open { place-items: end stretch; padding: 12px 0 0; top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100dvh); }
  #layer.open .modal { max-width: none; max-height: calc(var(--vvh, 100dvh) - 12px); border-radius: 22px 22px 0 0; animation: sheetUp .3s var(--ease); }
  .modal-foot { flex-wrap: nowrap; }
  .modal-foot > .btn { flex: 0 1 auto; min-width: 0; padding-inline: 14px; }
  .modal-foot > .btn-primary, .modal-foot > .btn-danger { flex: 1 1 auto; }
  .modal-foot:has(> .btn:nth-child(3)) > .btn-ghost { display: none; } /* three actions: «انصراف» gives way, ✕ closes */
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }

/* the kanj «گالری معرفی»: a big stage (video with a large play button and its length) and thumbnails under it */
.c-gal { display: grid; gap: 12px; }
.c-gal-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; isolation: isolate; box-shadow: var(--sh);
  background: radial-gradient(120% 90% at 50% 0%, var(--navy-700), var(--navy-950)); }
.c-gal-bg { position: absolute; inset: -30px; z-index: -1; background-size: cover; background-position: center; filter: blur(28px) saturate(1.2); opacity: .65; }
.c-gal-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.c-gal-play { position: absolute; inset: 0; margin: auto; width: 92px; height: 92px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  color: #fff; background: linear-gradient(180deg, #2BB09A, #1C9482); box-shadow: 0 0 0 10px rgba(33, 160, 140, .28), 0 18px 40px -12px rgba(0, 0, 0, .6); transition: transform .2s var(--ease), box-shadow .2s; }
.c-gal-play .ic { margin-inline-end: -4px; }
.c-gal-play:hover { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(33, 160, 140, .32), 0 22px 46px -12px rgba(0, 0, 0, .65); }
.c-gal-dur { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 14px;
  background: rgba(8, 20, 18, .72); color: #fff; font-size: 14px; backdrop-filter: blur(8px); }
.c-gal-dur b { font-weight: 800; }
.c-gal-stage.is-playing .c-gal-play, .c-gal-stage.is-playing .c-gal-dur { display: none; }
/* room above for the hover lift and the selected ring (a scrolling row clips whatever sticks out), taken back with negative margins so the layout stays put */
.c-gal-thumbs { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 7px 4px 12px; margin: -5px -4px -10px; }
.c-gal-thumbs::-webkit-scrollbar { display: none; }
.c-gal-thumb { position: relative; flex: none; width: 112px; aspect-ratio: 16 / 10; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--navy-900);
  box-shadow: 0 0 0 1px var(--line); opacity: .75; transition: opacity .2s, box-shadow .2s, transform .2s; }
.c-gal-thumb img, .c-gal-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.c-gal-thumb:hover { opacity: 1; transform: translateY(-2px); }
.c-gal-thumb.on { opacity: 1; box-shadow: 0 0 0 2px var(--brand), 0 6px 16px -8px rgba(33, 160, 140, .6); }
.c-gal-tplay { position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(8, 20, 18, .7); color: #fff; }
@media (max-width: 640px) {
  .c-gal-stage { border-radius: 16px; }
  .c-gal-play { width: 68px; height: 68px; box-shadow: 0 0 0 8px rgba(33, 160, 140, .28), 0 12px 28px -10px rgba(0, 0, 0, .6); }
  .c-gal-dur { bottom: 12px; padding: 6px 12px; font-size: 12.5px; }
  .c-gal-thumb { width: 88px; }
}
/* studio: the gallery editor */
.t-gal { display: grid; gap: 10px; }
.t-gal-head b { display: block; font-size: 14.5px; font-weight: 800; }
.t-gal-head span { display: block; font-size: 12.5px; color: var(--muted); }
.t-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.t-gal-tile, .t-gal-add { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; }
.t-gal-tile { background: var(--navy-900); box-shadow: 0 0 0 1px var(--line); }
.t-gal-tile img, .t-gal-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-gal-vid { position: absolute; top: 8px; inset-inline-start: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(8, 20, 18, .7); color: #fff; }
.t-gal-main { display: none; position: absolute; top: 8px; inset-inline-end: 8px; font-style: normal; font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--brand); color: #fff; }
.t-gal-grid > .t-gal-tile:first-child .t-gal-main { display: block; }
.t-gal-grid > .t-gal-tile:first-child { box-shadow: 0 0 0 2px var(--brand); }
.t-gal-acts { position: absolute; inset-inline: 6px; bottom: 6px; display: flex; gap: 4px; justify-content: flex-end; }
.t-gal-btn { width: 32px; height: 32px; border: 0; border-radius: 9px; display: grid; place-items: center; background: rgba(8, 20, 18, .72); color: #fff; cursor: pointer; }
.t-gal-btn:hover { background: rgba(8, 20, 18, .9); }
.t-gal-btn.is-del:hover { background: var(--bad); }
.t-gal-grid > .t-gal-tile:first-child [data-dir="-1"], .t-gal-grid > .t-gal-tile:nth-last-child(2) [data-dir="1"] { visibility: hidden; }
.t-gal-prog { position: absolute; inset: 0; display: grid; align-content: center; gap: 6px; padding: 12px; color: #fff; font-size: 12px; background: var(--navy-800); }
.t-gal-prog b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-gal-prog .up-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.t-gal-prog .up-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.t-gal-add { display: grid; place-items: center; align-content: center; gap: 6px; border: 1.5px dashed var(--line-2); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; text-align: center; padding: 8px; transition: border-color .2s, color .2s; }
.t-gal-add:hover { border-color: var(--brand-300); color: var(--brand-ink); }
.t-gal-add[hidden] { display: none; }
@media (pointer: coarse) { .t-gal-btn { width: 36px; height: 36px; } }
.c-gal-tph, .t-gal-noposter { display: block; width: 100%; height: 100%; background: radial-gradient(120% 120% at 30% 20%, var(--navy-700), var(--navy-950)); }
