@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-wght.woff2') format('woff2-variations'), url('/fonts/Vazirmatn-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #1d1c1a;
  --muted: #6e6a62;
  --line: #e6e2d9;
  --accent: #a4492a;
  --accent-ink: #ffffff;
  --ok: #2a6b4f;
  --ok-bg: #e7f1ec;
  --warn-bg: #f7efdc;
  --warn-ink: #6b5310;
  --err: #a32a22;
  --err-bg: #f9e9e7;
  --tone-0: #e9e4d8;
  --tone-1: #dfe5e0;
  --tone-2: #ece0d8;
  --tone-3: #e0e1e8;
  --tile-ink: #3c3a35;
  --radius: 10px;
  --wrap: 1120px;
  --glow-1: rgba(198, 92, 52, 0.30);
  --glow-2: rgba(104, 150, 126, 0.30);
  --glow-3: rgba(122, 118, 186, 0.26);
  --glow-4: rgba(222, 172, 84, 0.30);
  --grid-line: rgba(29, 28, 26, 0.06);
  --glass: rgba(255, 255, 255, 0.55);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #1f1e1b;
    --ink: #f1eee7;
    --muted: #a39e93;
    --line: #322f2a;
    --accent: #e08a63;
    --accent-ink: #1a1512;
    --ok: #7cc4a2;
    --ok-bg: #1b2c25;
    --warn-bg: #2e2715;
    --warn-ink: #e3cd8c;
    --err: #ec8f86;
    --err-bg: #331c1a;
    --tone-0: #2a2823;
    --tone-1: #252a27;
    --tone-2: #2d2622;
    --tone-3: #26272d;
    --tile-ink: #cfcabf;
    --glow-1: rgba(224, 138, 99, 0.24);
    --glow-2: rgba(110, 170, 140, 0.18);
    --glow-3: rgba(130, 126, 210, 0.22);
    --glow-4: rgba(220, 170, 90, 0.16);
    --grid-line: rgba(241, 238, 231, 0.05);
    --glass: rgba(31, 30, 27, 0.55);
  }
}

/* پس‌زمینهٔ متحرک: لکه‌های نور شناور، شبکهٔ محو و دانه‌بندی ریز */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blob { position: absolute; border-radius: 50%; will-change: transform; }
.bg-blob-1 { width: 70vmax; height: 70vmax; top: -32vmax; right: -18vmax; background: radial-gradient(circle, var(--glow-1), transparent 62%); animation: drift-1 26s ease-in-out infinite alternate; }
.bg-blob-2 { width: 60vmax; height: 60vmax; top: 4vmax; left: -26vmax; background: radial-gradient(circle, var(--glow-2), transparent 62%); animation: drift-2 32s ease-in-out infinite alternate; }
.bg-blob-3 { width: 65vmax; height: 65vmax; bottom: -36vmax; left: 18vw; background: radial-gradient(circle, var(--glow-3), transparent 62%); animation: drift-3 38s ease-in-out infinite alternate; }
.bg-blob-4 { width: 34vmax; height: 34vmax; top: 12vmax; right: 28vw; background: radial-gradient(circle, var(--glow-4), transparent 64%); animation: drift-4 22s ease-in-out infinite alternate; }
.bg-pointer { width: 46vmax; height: 46vmax; left: 0; top: 0; background: radial-gradient(circle, var(--glow-1), transparent 60%); opacity: 0; transition: opacity .6s; transform: translate3d(var(--px, 50vw), var(--py, 30vh), 0) translate(-50%, -50%); }
.bg-pointer.on { opacity: 0.7; }
.bg-grid {
  position: absolute; inset: -64px;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 75%);
  animation: grid-pan 18s linear infinite;
}
.bg-grain {
  position: absolute; inset: 0; opacity: 0.05;
  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");
}
@keyframes drift-1 { to { transform: translate3d(-14vmax, 10vmax, 0) scale(1.15); } }
@keyframes drift-2 { to { transform: translate3d(18vmax, -6vmax, 0) scale(0.9); } }
@keyframes drift-3 { to { transform: translate3d(-12vmax, -14vmax, 0) scale(1.2); } }
@keyframes drift-4 { 50% { transform: translate3d(-10vmax, 8vmax, 0) scale(1.3); } to { transform: translate3d(6vmax, 14vmax, 0) scale(0.85); } }
@keyframes grid-pan { to { transform: translate3d(64px, 64px, 0); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
[hidden] { display: none !important; }
img, video, iframe { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.4; font-weight: 700; margin: 0; }
h1 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem); letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.page { padding-block: 40px 72px; }
.narrow { max-width: 620px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }
.hp { position: absolute; inset-inline-start: -9999px; }
.ltr { direction: ltr; text-align: end; }

/* هدر و فوتر */
.site-head { border-bottom: 1px solid var(--line); }
body:not(.admin) .site-head { position: sticky; top: 0; z-index: 5; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-block: 14px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; text-decoration: none; min-height: 44px; }
.site-head nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-head nav a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
.site-head nav a:hover { color: var(--ink); }
.site-head nav a[aria-current] { color: var(--ink); font-weight: 600; }
.site-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-block: 20px; }
.foot-inner nav { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.foot-inner a { text-decoration: none; padding-block: 8px; display: inline-block; }
.foot-inner a:hover { color: var(--ink); }

/* صفحهٔ اصلی */
.hero { padding-block: 64px 24px; }
.hero h1 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem); max-width: 18em; }
.hero > p { color: var(--muted); font-size: 1.125rem; margin: 12px 0 0; max-width: 34em; }
.paths { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.paths a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; height: 100%; transition: border-color .15s; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.paths a:hover { border-color: var(--ink); }
.paths strong { display: block; font-weight: 700; }
.paths span { color: var(--muted); font-size: 0.875rem; }

.section { padding-block: 40px 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: 1.25rem; }
.section-head a { color: var(--muted); font-size: 0.9rem; text-decoration: none; white-space: nowrap; }
.section-head a:hover { color: var(--ink); }
.arrow { display: inline-block; transition: transform .15s; }
a:hover > .arrow { transform: translateX(-3px); }

/* کارت‌ها */
.grid { display: grid; gap: 28px 24px; grid-template-columns: repeat(3, 1fr); }
.grid-big { grid-template-columns: repeat(2, 1fr); gap: 36px 28px; }
.grid-small { grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { display: block; text-decoration: none; }
.tile { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; color: var(--tile-ink); transition: filter .15s; }
.tile img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .tile-backdrop { filter: blur(18px) brightness(0.85); transform: scale(1.2); }
.tile .tile-frame { object-fit: contain; }
.card:hover .tile { filter: brightness(0.96); }
.tone-0 { background: var(--tone-0); }
.tone-1 { background: var(--tone-1); }
.tone-2 { background: var(--tone-2); }
.tone-3 { background: var(--tone-3); }
.tile-icon { display: grid; place-items: center; width: 56px; height: 56px; }
.card-big .tile-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--bg); }
.card-body { display: block; padding-top: 12px; }
.card-title { display: block; font-weight: 700; line-height: 1.55; }
.card-big .card-title { font-size: 1.2rem; }
.card:hover .card-title, .row:hover .row-title { color: var(--accent); }
.meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.meta-lg { margin: 8px 0 0; font-size: 0.925rem; }
.price { color: var(--accent); font-weight: 600; }
.free { color: var(--ok); }
.draft { color: var(--warn-ink); background: var(--warn-bg); padding-inline: 8px; border-radius: 6px; }
.mini { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .15s; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.mini:hover { border-color: var(--ink); }
.mini strong { display: block; }
.mini span { display: block; color: var(--muted); font-size: 0.875rem; line-height: 1.7; margin-top: 2px; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 4px 20px; flex-wrap: wrap; padding: 14px 0; text-decoration: none; min-height: 44px; }
.row-title { font-weight: 600; }
.row .meta { margin: 0; }

/* کتابخانه */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 20px 0 28px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border-radius: 99px; text-decoration: none; color: var(--muted); min-height: 40px; display: inline-flex; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { background: var(--ink); color: var(--bg); }
.tabs-sub { margin-bottom: 20px; font-size: 0.875rem; }
.tabs-sub a { min-height: 34px; padding: 3px 12px; }
.search { display: flex; gap: 8px; flex: 0 1 320px; }
.search input { flex: 1; min-width: 0; }
.empty { color: var(--muted); padding-block: 32px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 44px; color: var(--muted); font-size: 0.9rem; }

/* صفحهٔ مطلب */
.post { max-width: 780px; }
.crumb { color: var(--muted); font-size: 0.875rem; margin-bottom: 10px; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.lead { font-size: 1.125rem; color: var(--muted); margin: 14px 0 0; }
/* قاب پخش: ارتفاع با padding ساخته می‌شود و پخش‌کننده با position: absolute آن را پر می‌کند؛
   این روش برخلاف aspect-ratio و height: 100% در مرورگرهای قدیمی اندروید (سامسونگ، مرورگر داخل پیام‌رسان‌ها) هم درست کار می‌کند. */
.player { position: relative; margin-top: 24px; border-radius: var(--radius); overflow: hidden; background: #000; }
.player::before { content: ''; display: block; padding-top: 56.25%; }
.player.is-portrait::before { padding-top: 177.78%; }
.player.is-portrait { width: 100%; max-width: 405px; width: min(100%, max(240px, calc(80vh * 9 / 16)), 430px); margin-inline: auto; }
.player > video, .player > iframe, .player > .plyr:not(.plyr--fullscreen-fallback) { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; border: 0; }
.player video { object-fit: contain; background: #000; }
.player .plyr { min-width: 0; direction: ltr; font-family: inherit; --plyr-color-main: var(--accent); --plyr-video-control-color-hover: var(--accent-ink); --plyr-menu-color: #1d1c1a; }
.player-empty::before { display: none; }
.player-empty { min-height: 200px; aspect-ratio: 16 / 9; }
.player-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--tile-ink); padding: 16px; text-align: center; }
.player-empty p { margin: 4px 0 0; font-size: 0.9rem; }
/* پخش‌کننده (Plyr): کنترل‌ها چپ‌به‌راست تا نوار زمان با جهت پخش یکی باشد */
.player .plyr__menu__container { direction: rtl; text-align: right; }
.buffering { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 4; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 0.875rem; direction: rtl; pointer-events: none; white-space: nowrap; }
.buffering[hidden] { display: none; }
.buffering-spin { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player .plyr--loading .plyr__control--overlaid { display: none; }
.now-playing { margin: 12px 0 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.now-playing .meta { margin: 0; }
.playlist { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass, var(--surface)); backdrop-filter: blur(10px); max-height: 420px; overflow-y: auto; }
.playlist ol { list-style: none; margin: 0; padding: 4px 0; }
.playlist li + li { border-top: 1px solid var(--line); }
.playlist a, .playlist .pl-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 48px; text-decoration: none; color: var(--ink); }
.playlist a:hover .pl-title, .playlist a[aria-current] .pl-title { color: var(--accent); }
.playlist a[aria-current] { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.playlist a[aria-current] .pl-num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.playlist .is-locked { color: var(--muted); }
.pl-num { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 0.8rem; }
.pl-title { flex: 1; min-width: 0; }
.playlist .meta { margin: 0; flex: none; }
.pl-lock { display: inline-flex; }
.prose { margin-top: 24px; font-size: 1.0625rem; line-height: 2; }
.prose h2 { font-size: 1.3rem; margin: 1.8em 0 0.5em; }
.prose h3 { font-size: 1.1rem; margin: 1.5em 0 0.4em; }
.prose h4 { font-size: 1rem; margin: 1.3em 0 0.3em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 1em; }
.prose blockquote { margin: 0 0 1em; padding-inline-start: 16px; border-inline-start: 3px solid var(--line); color: var(--muted); }
.prose a { color: var(--accent); }
.paywall { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; margin-top: 28px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.paywall h2 { font-size: 1.1rem; }
.paywall p { margin: 4px 0 0; color: var(--muted); font-size: 0.925rem; }
.paywall-action { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.section-tight { margin-top: 40px; }
.h-small { font-size: 1.05rem; margin: 32px 0 12px; }
.section-tight .h-small { margin-top: 0; }
.outline ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: lesson; }
.outline li { border-bottom: 1px solid var(--line); counter-increment: lesson; }
.outline a { display: flex; align-items: center; justify-content: space-between; gap: 4px 20px; flex-wrap: wrap; padding: 12px 0; text-decoration: none; min-height: 44px; }
.outline .row-title::before { content: counter(lesson, persian) '. '; color: var(--muted); font-weight: 400; }
.outline a:hover .row-title { color: var(--accent); }
.outline a[aria-current] .row-title { color: var(--accent); }
.outline .meta { margin: 0; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.cta strong { display: block; }
.cta span:not(.arrow) { color: var(--muted); font-size: 0.925rem; }

/* فرم‌ها */
.split { display: grid; grid-template-columns: 1fr minmax(0, 440px); gap: 48px; align-items: start; }
.form { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.form h2 { font-size: 1.1rem; margin-bottom: 16px; }
.form-plain { margin-top: 24px; }
.field { margin-bottom: 16px; min-width: 0; }
.field > label { display: block; font-weight: 600; font-size: 0.925rem; margin-bottom: 4px; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.825rem; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=search], select, textarea, input:not([type]) {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  min-height: 44px;
}
input[type=file] { font: inherit; font-size: 0.875rem; max-width: 100%; color: var(--muted); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
textarea { resize: vertical; line-height: 1.8; }
[aria-invalid=true] { border-color: var(--err) !important; }
.hint { color: var(--muted); font-size: 0.825rem; margin: 4px 0 0; line-height: 1.7; }
.error { color: var(--err); font-size: 0.85rem; margin: 4px 0 0; font-weight: 500; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 0.925rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: 8px; padding: 8px 18px; min-height: 44px; cursor: pointer; text-decoration: none; transition: opacity .15s; white-space: nowrap; }
.btn:hover { opacity: 0.85; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { opacity: 1; border-color: var(--ink); }
.btn-small { min-height: 36px; padding: 4px 12px; font-size: 0.875rem; }
.btn-full { width: 100%; }
.link { background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; padding: 4px; }
.link:hover { color: var(--ink); }
.link-danger { color: var(--err); }
.link-danger:hover { color: var(--err); }
.actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.summary { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; flex-wrap: wrap; padding: 16px 0; border-block: 1px solid var(--line); margin-top: 16px; text-align: start; }
.facts { margin: 20px 0 0; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.925rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: end; }
.plain { margin: 0; padding-inline-start: 1.2em; }
.pre { white-space: pre-wrap; margin: 0; }
.copy { display: flex; gap: 8px; }
.copy input { flex: 1; min-width: 0; font-size: 0.85rem; }
.notice { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 14px; border-radius: 8px; font-size: 0.925rem; margin: 16px 0; }
.notice a { color: inherit; font-weight: 600; }
.notice-ok { background: var(--ok-bg); color: var(--ok); }
.notice-error { background: var(--err-bg); color: var(--err); }
.notice-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }

/* پنل مدیریت */
.admin .head-inner { padding-block: 10px; }
.head-actions { display: flex; align-items: center; gap: 16px; font-size: 0.9rem; color: var(--muted); }
.head-actions a, .head-actions .link { text-decoration: none; display: inline-block; padding: 8px 4px; }
.head-actions form { margin: 0; }
.admin-nav { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 4px; }
.admin-nav a { white-space: nowrap; font-size: 0.925rem; }
.admin-nav a[aria-current] { background: var(--line); }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 99px; font-size: 0.72rem; padding: 0 7px; margin-inline-start: 4px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.title-row-sub { margin: 44px 0 12px; }
.title-row-sub h2 { font-size: 1.15rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 24px 0; }
.stats > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stats dt { color: var(--muted); font-size: 0.825rem; }
.stats dd { margin: 2px 0 0; font-size: 1.4rem; font-weight: 700; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th { text-align: start; font-weight: 600; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; font-weight: 600; }
td a:hover { color: var(--accent); }
.pill { display: inline-block; font-size: 0.75rem; padding: 1px 9px; border-radius: 99px; background: var(--line); color: var(--ink); white-space: nowrap; font-weight: 500; }
.pill-ok, .pill-done { background: var(--ok-bg); color: var(--ok); }
.pill-new { background: var(--warn-bg); color: var(--warn-ink); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.editor-side { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); position: sticky; top: 16px; }
.group { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 4px; margin: 0 0 16px; min-width: 0; }
.group legend { padding-inline: 6px; font-weight: 700; font-size: 0.925rem; }
.group > .btn { margin-bottom: 14px; }
.settings { max-width: 640px; }
.uploader progress { width: 100%; height: 6px; margin-top: 8px; accent-color: var(--accent); display: block; }
.current { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.85rem; margin: 0 0 6px; word-break: break-all; }
.thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin-bottom: 4px; }
/* فهرست ویدیوهای مطلب در پنل */
.vlist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.vrow { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 2px; background: var(--surface); }
.vrow-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.vrow-head input { flex: 1; min-width: 0; }
.vrow-num { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--line); font-size: 0.8rem; }
.vrow-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.icon-btn:hover { border-color: var(--ink); }
.vrow-foot { display: grid; grid-template-columns: 1fr 110px auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.vrow .uploader { margin-bottom: 10px; }
.vlist-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.vlist-actions label.btn { cursor: pointer; }
@media (max-width: 620px) {
  .vrow-foot { grid-template-columns: 1fr 1fr; }
  .vrow-foot input[name^="v_embed_"] { grid-column: 1 / -1; }
}
.danger { margin-top: 28px; }
.inline-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: start; margin-top: 12px; }
.inline-form .btn { margin-top: 28px; }
.login { padding-top: 12vh; max-width: 400px; }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid-small { grid-template-columns: 1fr; }
  .split, .editor { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .editor-side { position: static; }
  .inline-form { grid-template-columns: minmax(0, 1fr); }
  .inline-form .btn { margin-top: 0; }
}
@media (max-width: 620px) {
  .hero { padding-block: 40px 16px; }
  .paths, .grid, .grid-big { grid-template-columns: minmax(0, 1fr); }
  .page { padding-block: 28px 56px; }
  .wrap { padding-inline: 16px; }
  .search { flex: 1 1 100%; }
  .paywall-action, .paywall-action .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .bg-pointer { display: none; }
}
