/* ══════════════════════════════════════════════════════════════════
   Xdownloader — پنل مدیریت
   پالت: جوهری آبی‌تیره + کهربایی. فونت: Vazirmatn (محلی، بدون CDN)
   ══════════════════════════════════════════════════════════════════ */
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --ink:      #09090a;
  --ink-2:    #111113;
  --ink-3:    #18181b;
  --line:     rgba(255, 255, 255, .09);
  --line-2:   rgba(255, 255, 255, .17);
  --text:     #ededee;
  --mute:     #9b9ba2;
  --dim:      #66666e;
  --accent:    #e5313f;
  --accent-2:  #a81c28;
  --accent-ink:#ffffff;
  --ok:       #f1f1f2;
  --bad:      #ff7782;
  --blue:     #b6b6be;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--ink);
  font: 400 15px/1.7 "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { width: 20px; height: 20px; flex: none; display: block; }
a { color: inherit; }
::selection { background: rgba(229, 49, 63, .35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── پس‌زمینه ─────────────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--ink); }
.backdrop i { position: absolute; border-radius: 50%; filter: blur(130px); opacity: .13; }
.backdrop i:nth-child(1) { width: 40vw; height: 40vw; right: -14vw; top: -22vw; background: #7a1520; animation: drift 60s ease-in-out infinite alternate; }
.backdrop i:nth-child(2) { width: 32vw; height: 32vw; left: -12vw; bottom: -18vw; background: #3a3a42; opacity: .12; animation: drift 70s ease-in-out infinite alternate-reverse; }
.backdrop i:nth-child(3) { display: none; }
@keyframes drift { to { transform: translate3d(3vw, 2vh, 0) scale(1.05); } }

/* ─── چیدمان ───────────────────────────────────────────────────── */
.app {
  position: relative; z-index: 1; display: grid; grid-template-columns: 252px minmax(0, 1fr);
  gap: 28px; width: min(1180px, 100% - 40px); margin: 0 auto; padding: 28px 0 64px; min-height: 100vh;
  transition: filter .9s var(--ease), opacity .9s var(--ease), transform .9s var(--ease);
}
body.locked .app { filter: blur(15px) saturate(1.2) brightness(.85); transform: scale(1.012); pointer-events: none; user-select: none; }

.side {
  position: sticky; top: 28px; align-self: start; height: calc(100vh - 56px); max-height: 760px;
  display: flex; flex-direction: column; gap: 26px; padding: 22px 16px 16px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #1f1f23, #111113); border: 1px solid var(--line-2); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-weight: 750; font-size: 18px; letter-spacing: .2px; direction: ltr; }

.nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px;
  color: var(--mute); font-weight: 560; text-align: start; transition: background .2s, color .2s; position: relative; }
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.nav-item.is-on { background: rgba(229,49,63,.11); color: var(--accent); }
.nav-item.is-on::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: -16px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-item span { flex: 1; }
.nav-badge { min-width: 24px; padding: 0 8px; border-radius: 99px; font-size: 12px; line-height: 22px; text-align: center; font-weight: 700;
  background: var(--accent); color: var(--accent-ink); }
.nav-badge.soft { background: rgba(255,255,255,.09); color: var(--text); }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.nav-item.quiet { color: var(--dim); }
.disk { padding: 12px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid var(--line); }
.disk-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--mute); }
.disk-row strong { color: var(--text); font-weight: 600; }
.disk-bar { height: 5px; margin-top: 9px; border-radius: 9px; background: rgba(255,255,255,.08); overflow: hidden; }
.disk-bar i { display: block; height: 100%; width: 0; border-radius: 9px; background: var(--blue); transition: width .6s var(--ease); }
.disk-bar i.warn { background: var(--bad); }

.main { min-width: 0; display: grid; gap: 22px; align-content: start; }

/* ─── نوار آمار (یک پنل، نه چهار کارت) ──────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); overflow: hidden; }
.stat { padding: 16px 22px; display: grid; gap: 2px; }
.stat + .stat { border-inline-start: 1px solid var(--line); }
.stat span { font-size: 13px; color: var(--mute); }
.stat strong { font-size: 24px; font-weight: 680; line-height: 1.3; letter-spacing: -.2px; }
.stat strong small { font-size: 13px; font-weight: 500; color: var(--mute); margin-inline-start: 4px; }

/* ─── پنل و فرم ───────────────────────────────────────────────── */
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); }
.panel-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.panel-head p { margin: 0 0 22px; color: var(--mute); }
.field { display: grid; gap: 8px; }
.field.grow { flex: 1; min-width: 0; }
.field-label { font-size: 13.5px; font-weight: 600; color: #d0d0d5; }
.field-label em { font-style: normal; font-weight: 400; color: var(--dim); margin-inline-start: 8px; }
input[type=text], input[type=search], input[type=password], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .42); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(229,49,63,.14); }
::placeholder { color: var(--dim); }
textarea { resize: vertical; min-height: 54px; max-height: 220px; line-height: 1.6; font-size: 14px; padding-right: 118px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.area-wrap { position: relative; }
.chip-btn { position: absolute; top: 9px; right: 9px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px;
  font-size: 12.5px; color: var(--mute); background: rgba(255,255,255,.07); transition: .2s; }
.chip-btn:hover { color: var(--text); background: rgba(255,255,255,.12); }
.chip-btn svg { width: 15px; height: 15px; }
.add-row { display: flex; gap: 14px; align-items: end; margin-top: 16px; }
.hint { margin: 14px 0 0; font-size: 13px; color: var(--dim); }

/* ─── دکمه‌ها ─────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 20px; border-radius: var(--r-md);
  font-weight: 650; white-space: nowrap; transition: transform .15s, background .2s, box-shadow .2s, opacity .2s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { color: var(--accent-ink); background: linear-gradient(180deg, #f04654, var(--accent)); box-shadow: 0 8px 22px -12px rgba(229,49,63,.55), inset 0 1px 0 rgba(255,255,255,.22); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #f65b68, #ee4553); }
.btn.ghost { background: rgba(255,255,255,.07); color: var(--text); }
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.danger { background: var(--bad); color: #2a0510; }
.btn.danger:hover { background: #ff8196; }
.btn.wide { width: 100%; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 11px; color: var(--mute); transition: .18s; }
.icon-btn:hover { background: rgba(255,255,255,.09); color: var(--text); }
.icon-btn.bad:hover { background: rgba(255,119,130,.16); color: var(--bad); }
.icon-btn svg { width: 19px; height: 19px; }
.link-btn { color: var(--mute); font-size: 13.5px; text-decoration: underline; text-underline-offset: 4px; }
.link-btn:hover { color: var(--text); }

/* ─── لیست دانلودها ───────────────────────────────────────────── */
.list-head { display: flex; justify-content: space-between; align-items: center; margin: 8px 4px -6px; }
.list-head h3 { margin: 0; font-size: 16px; font-weight: 650; color: #d6d6da; }
.jobs { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: rgba(255,255,255,.025); }
.job { padding: 18px 22px; display: grid; gap: 12px; }
.job + .job { border-top: 1px solid var(--line); }
.job-top { display: flex; align-items: center; gap: 14px; }
.job-main { flex: 1; min-width: 0; }
.job-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-sub { font-size: 12.5px; color: var(--dim); direction: ltr; text-align: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.08); color: var(--mute); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.run { color: var(--accent); background: rgba(229,49,63,.12); }
.tag.run::before { animation: pulse 1.4s ease-in-out infinite; }
.tag.wait { color: var(--blue); background: rgba(255,255,255,.09); }
.tag.bad { color: var(--bad); background: rgba(255,119,130,.12); }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.bar { height: 7px; border-radius: 9px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .9s linear; }
.bar.live i { background: linear-gradient(90deg, var(--accent-2), var(--accent), #ff8d96, var(--accent), var(--accent-2)); background-size: 200% 100%; animation: sheen 2.2s linear infinite; }
.bar.indet i { width: 35% !important; animation: indet 1.5s ease-in-out infinite alternate; }
@keyframes sheen { to { background-position: -200% 0; } }
@keyframes indet { from { transform: translateX(0); } to { transform: translateX(-185%); } }
.job-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--mute); }
.job-meta b { color: var(--text); font-weight: 600; }
.job-meta bdi { unicode-bidi: isolate; direction: ltr; }
.job-err { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: #ff9aa3; }
.job-err svg { width: 17px; height: 17px; margin-top: 4px; }
.job-actions { display: flex; gap: 4px; }

/* ─── خالی ─────────────────────────────────────────────────────── */
.empty { padding: 44px 24px; text-align: center; color: var(--mute); display: grid; gap: 6px; justify-items: center; }
.empty svg { width: 34px; height: 34px; color: var(--dim); margin-bottom: 6px; }
.empty strong { color: var(--text); font-weight: 650; }

/* ─── مدیریت ویدیو ────────────────────────────────────────────── */
.toolbar { display: flex; gap: 12px; }
.search { position: relative; flex: 1; }
.search svg { position: absolute; inset-block: 0; margin: auto 0; inset-inline-start: 14px; color: var(--dim); width: 18px; height: 18px; }
.search input { padding-inline-start: 42px; }
.select select { appearance: none; padding-inline-end: 38px; min-width: 170px; cursor: pointer;
  background: rgba(0,0,0,.42) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238e9bbd' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 14px center; }
.select select option { background: var(--ink-2); }
.videos { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: rgba(255,255,255,.025); }
.vrow { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px; transition: background .2s; }
.vrow + .vrow { border-top: 1px solid var(--line); }
.vrow:hover { background: rgba(255,255,255,.03); }
.vthumb { width: 62px; height: 62px; border-radius: 16px; position: relative; display: grid; place-items: center; overflow: hidden; cursor: pointer;
  background: linear-gradient(150deg, #26262a, #121214); border: 1px solid var(--line-2); transition: border-color .2s, transform .2s; }
.vthumb:hover { border-color: var(--accent); }
.vthumb svg { width: 22px; height: 22px; color: var(--accent); opacity: .95; margin-top: -8px; }
.vthumb b { position: absolute; inset-inline: 0; bottom: 6px; text-align: center; font-size: 10.5px; letter-spacing: .6px; color: var(--mute); font-weight: 700; direction: ltr; }
.vbody { min-width: 0; display: grid; gap: 7px; }
.vtitle { font-weight: 650; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--mute); }
.vlink { display: flex; align-items: stretch; max-width: 560px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(0,0,0,.55); overflow: hidden; }
.vlink code { flex: 1; min-width: 0; padding: 7px 12px; direction: ltr; text-align: left; font: 12.5px/1.7 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #c4c4cb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: all; }
.vlink button { display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; font-size: 13px; font-weight: 650; color: var(--accent-ink); background: var(--accent); transition: background .2s; }
.vlink button:hover { background: #f04654; }
.vlink button svg { width: 16px; height: 16px; }
.vlink button.done { background: #3b3b41; color: #fff; }
.vact { display: flex; gap: 2px; }
.more { margin: 14px auto 0; }

/* ─── مودال ورود شیشه‌ای ─────────────────────────────────────── */
.gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
body:not(.locked):not(.unlocking) .gate { display: none; }
body.unlocking .gate { pointer-events: none; }
.glass { --mx: 50%; --my: 0%; position: relative; width: min(420px, 100%); padding: 38px 34px 32px; border-radius: 30px; overflow: hidden;
  background: linear-gradient(150deg, rgba(255,255,255,.14), rgba(255,255,255,.045) 55%, rgba(255,255,255,.08));
  -webkit-backdrop-filter: blur(30px) saturate(1.5); backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.17);
  box-shadow: 0 40px 90px -24px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.28), inset 0 -30px 60px -44px rgba(229,49,63,.14);
  animation: gate-in .9s var(--ease) both;
  transition: opacity .7s var(--ease), transform .8s var(--ease), filter .7s var(--ease); }
.glass::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(255,255,255,.17), transparent 70%); transition: background .1s; }
@keyframes gate-in { from { opacity: 0; transform: translateY(26px) scale(.965); filter: blur(10px); } }
body.unlocking .glass { opacity: 0; transform: translateY(-18px) scale(.94); filter: blur(12px); pointer-events: none; }
body.unlocking .gate { background: transparent; }
.glass.shake { animation: shake .45s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.glass-mark { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 18px;
  background: linear-gradient(145deg, rgba(40,40,44,.92), rgba(12,12,14,.92)); border: 1px solid rgba(255,255,255,.2); box-shadow: 0 10px 28px -8px rgba(0,0,0,.6); }
.glass-mark svg { width: 34px; height: 34px; }
.glass h1 { margin: 0; text-align: center; font-size: 26px; font-weight: 760; letter-spacing: .3px; direction: ltr; }
.glass-sub { margin: 6px 0 26px; text-align: center; color: #b5b5bd; font-size: 14px; }
.g-field { display: grid; gap: 7px; margin-bottom: 16px; position: relative; }
.g-field > span { font-size: 13px; color: #d4d4d9; font-weight: 600; }
.glass input { background: rgba(0, 0, 0, .4); border-color: rgba(255,255,255,.14); padding: 13px 15px; }
.pw { position: relative; }
.pw input { padding-inline-end: 46px; }
.pw-eye { position: absolute; inset-block: 0; inset-inline-end: 6px; margin: auto 0; width: 36px; height: 36px; display: grid; place-items: center; color: var(--mute); border-radius: 10px; }
.pw-eye:hover { color: var(--text); background: rgba(255,255,255,.08); }
.g-error { margin: -4px 0 14px; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; color: #ffb6bd; background: rgba(255,119,130,.12); border: 1px solid rgba(255,119,130,.28); }
.btn .spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.4px solid rgba(255,255,255,.35); border-top-color: var(--accent-ink); animation: rot .7s linear infinite; }
.btn.busy .spin { display: block; }
.btn.busy > span { opacity: .75; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ─── مودال‌های داشبورد ───────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: min(480px, 100%); max-height: 92vh; overflow: auto; padding: 22px; border-radius: 24px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #1a1a1d, #111113); box-shadow: 0 40px 100px -30px #000; animation: pop .35s var(--ease) both; display: grid; gap: 16px; }
.modal-card.wide { width: min(940px, 100%); }
.modal-card.narrow { width: min(400px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head strong { font-size: 17px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-text { margin: 0; color: var(--mute); line-height: 1.9; }
.confirm-text b { color: var(--text); }
.player { border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.player video { width: 100%; height: 100%; background: #000; }
.ltr-line { direction: ltr; text-align: left; font: 12.5px ui-monospace, Menlo, Consolas, monospace; color: var(--mute); word-break: break-all; }

/* ─── Toast ──────────────────────────────────────────────────── */
.toasts { position: fixed; z-index: 90; inset-inline: 0; bottom: 24px; display: grid; gap: 8px; justify-items: center; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; font-weight: 560; font-size: 14px;
  background: #1f1f23; border: 1px solid var(--line-2); box-shadow: 0 16px 40px -12px #000; animation: toast-in .35s var(--ease) both; }
.toast svg { width: 18px; height: 18px; }
.toast.ok svg { color: var(--ok); } .toast.err svg { color: var(--bad); }
.toast.out { animation: toast-out .3s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ─── واکنش‌گرا ───────────────────────────────────────────────── */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; gap: 18px; width: min(100% - 28px, 760px); padding: 14px 0 40px; }
  .side { position: sticky; top: 10px; z-index: 5; height: auto; max-height: none; flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px;
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); background: rgba(14,21,41,.78); }
  .brand { padding: 0; } .brand-name { display: none; }
  .nav { display: flex; flex: 1; gap: 4px; }
  .nav-item { justify-content: center; padding: 10px; gap: 8px; } .nav-item span { flex: none; font-size: 14px; }
  .nav-item.is-on::before { display: none; }
  .side-foot { margin: 0; } .disk { display: none; }
  .nav-item.quiet span { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .panel { padding: 20px; }
}
@media (max-width: 560px) {
  .add-row { flex-direction: column; align-items: stretch; }
  .toolbar { flex-direction: column; } .select select { width: 100%; }
  .vrow { grid-template-columns: 52px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .vthumb { width: 52px; height: 52px; border-radius: 14px; }
  .vact { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px dashed var(--line); padding-top: 8px; }
  .job { padding: 16px; }
  .glass { padding: 32px 22px 26px; border-radius: 26px; }
  .nav-item span { display: none; } .nav-item { flex: 1; }
  .nav-item .nav-badge { position: absolute; top: 2px; inset-inline-start: 6px; min-width: 20px; line-height: 18px; font-size: 11px; padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ─── پوشه‌ها ─────────────────────────────────────────────────── */
.folder-field { width: 210px; flex: none; }
.new-folder { margin-top: 14px; }
.select { display: block; }
.field .select select { min-width: 0; }
.folders { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; font-weight: 580; font-size: 14px; color: var(--mute);
  background: rgba(255,255,255,.05); border: 1px solid var(--line); transition: background .2s, color .2s, border-color .2s; max-width: 240px; }
.fchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip svg { width: 17px; height: 17px; flex: none; }
.fchip b { font-size: 12px; font-weight: 650; padding: 0 7px; line-height: 20px; border-radius: 99px; background: rgba(255,255,255,.09); color: var(--text); }
.fchip:hover { color: var(--text); background: rgba(255,255,255,.09); }
.fchip.is-on { color: #fff; background: rgba(229,49,63,.18); border-color: rgba(229,49,63,.55); }
.fchip.is-on b { background: var(--accent); color: #fff; }
.fchip.add { border-style: dashed; background: transparent; }
.fchip.add:hover { border-color: var(--line-2); }
.fchip.drop { color: #fff; background: rgba(229,49,63,.28); border-color: var(--accent); transform: scale(1.04); }
.folder-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.fh-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fh-info > svg { width: 24px; height: 24px; color: var(--accent); }
.fh-info strong { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.fh-info span { font-size: 12.5px; color: var(--mute); }
.fh-act { display: flex; gap: 8px; }
.btn.sm { padding: 8px 14px; font-size: 13.5px; gap: 7px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn.ghost.bad:hover { background: rgba(255,119,130,.16); color: var(--bad); }
.ftag { display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; border-radius: 99px; background: rgba(229,49,63,.14); color: #ff9aa3; font-weight: 580; }
.ftag svg { width: 14px; height: 14px; }
.vrow[draggable=true] { cursor: default; }
.vrow.dragging { opacity: .45; }
@media (max-width: 560px) { .folder-field { width: auto; } .fchip { max-width: 100%; } }

/* ─── تنظیمات ─── */
#view-settings .panel + .panel { margin-top: 18px; }
#setForm { display: grid; gap: 18px; }
.switch-row, .check-row { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.switch-row small, .check-row small { display: block; color: var(--mute); margin-top: 3px; font-size: 12.5px; line-height: 1.7; }
.switch-row input, .check-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; width: 44px; height: 26px; border-radius: 99px; background: rgba(255,255,255,.12); position: relative; transition: background .2s; margin-top: 2px; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(-18px); }
.check-row > span:last-child { min-width: 0; }
.check-row::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 6px; border: 1.5px solid rgba(255,255,255,.28); order: 0; }
.check-row:has(input:checked)::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--accent); }
.check-row input:focus-visible ~ span, .switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 3px; }
.set-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.warn-box { padding: 12px 14px; border-radius: var(--r-md); background: rgba(255,170,60,.1); color: #ffc58a; font-size: 13px; line-height: 1.8; }
.test-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.test-list li { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-md); background: rgba(255,255,255,.04); font-size: 13.5px; }
.test-list li b { flex: none; font-size: 12px; padding: 2px 9px; border-radius: 99px; }
.test-list li.ok b { background: rgba(80,200,120,.16); color: #7fe0a0; }
.test-list li.no b { background: rgba(255,119,130,.16); color: var(--bad); }
.panel.note h3 { margin: 0 0 8px; font-size: 16px; }
.panel.note p { margin: 0 0 12px; color: var(--mute); line-height: 1.9; }
.panel.note details summary { cursor: pointer; color: var(--accent); }
.panel.note pre { overflow: auto; background: rgba(0,0,0,.35); padding: 14px; border-radius: var(--r-md); font-size: 12px; line-height: 1.6; }
