/* ---------- فونت پلاک (نسخه FA با ارقام فارسی) ---------- */
@font-face { font-family: Pelak; font-weight: 100; font-display: swap; src: url(fonts/PelakFA-Thin.woff2) format("woff2"), url(fonts/PelakFA-Thin.woff) format("woff"); }
@font-face { font-family: Pelak; font-weight: 300; font-display: swap; src: url(fonts/PelakFA-light.woff2) format("woff2"), url(fonts/PelakFA-light.woff) format("woff"); }
@font-face { font-family: Pelak; font-weight: 400; font-display: swap; src: url(fonts/PelakFA-Regular.woff2) format("woff2"), url(fonts/PelakFA-Regular.woff) format("woff"); }
@font-face { font-family: Pelak; font-weight: 500; font-display: swap; src: url(fonts/PelakFA-Medium.woff2) format("woff2"), url(fonts/PelakFA-Medium.woff) format("woff"); }
@font-face { font-family: Pelak; font-weight: 600; font-display: swap; src: url(fonts/PelakFA-SemiBold.woff2) format("woff2"), url(fonts/PelakFA-SemiBold.woff) format("woff"); }
@font-face { font-family: Pelak; font-weight: 700; font-display: swap; src: url(fonts/PelakFA-Bold.woff2) format("woff2"), url(fonts/PelakFA-Bold.woff) format("woff"); }
@font-face { font-family: Pelak; font-weight: 800; font-display: swap; src: url(fonts/PelakFA-ExtraBold.woff2) format("woff2"), url(fonts/PelakFA-ExtraBold.woff) format("woff"); }
@font-face { font-family: Pelak; font-weight: 900; font-display: swap; src: url(fonts/PelakFA-Black.woff2) format("woff2"), url(fonts/PelakFA-Black.woff) format("woff"); }

/* ---------- رنگ‌ها ---------- */
:root {
  --bg: #f4f1eb;
  --bg-2: #ebe6dc;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #16181d;
  --ink-2: #464a52;
  --muted: #80838a;
  --line: #e4dfd5;
  --accent: #e8590c;
  --accent-2: #ff8a3d;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee4;
  --good: #1f8a5b;
  --good-soft: #e3f4ec;
  --warn: #b4321f;
  --warn-soft: #fbe9e5;
  --hero: #16181d;
  --hero-ink: #f4f1eb;
  --shadow: 0 1px 2px rgba(22, 24, 29, .05), 0 8px 24px -12px rgba(22, 24, 29, .12);
  --shadow-lg: 0 2px 4px rgba(22, 24, 29, .06), 0 24px 48px -20px rgba(22, 24, 29, .25);
  --r: 16px;
  --r-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111215; --bg-2: #17191d; --surface: #1b1d22; --surface-2: #202329;
    --ink: #efece6; --ink-2: #c3c0b9; --muted: #8b8e95; --line: #2c2f36;
    --accent: #ff7a2e; --accent-2: #ffa05e; --accent-ink: #1a0d04; --accent-soft: #33221a;
    --good: #4cc48d; --good-soft: #17302a; --warn: #ff8f7a; --warn-soft: #3a201c;
    --hero: #0b0c0e; --hero-ink: #efece6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* ---------- پایه ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Pelak, Tahoma, sans-serif; font-weight: 400; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.35; margin: 0; font-weight: 800; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 12px; }
.ic { flex: none; vertical-align: middle; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- سربرگ ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 900; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 16px -6px var(--accent);
}
.topnav { display: flex; gap: 4px; margin-inline-start: 12px; }
.topnav a { color: var(--ink-2); padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.topnav a:hover { background: var(--bg-2); text-decoration: none; }
.topnav a.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.topbar .spacer { flex: 1; }
.userchip { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: .9rem; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800;
}
.iconbtn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--ink-2); }
.iconbtn:hover { background: var(--bg-2); color: var(--ink); }
@media (max-width: 640px) {
  .topnav { display: none; }
  .userchip .uname { display: none; }
}

/* ناوبری پایین موبایل */
.bottomnav { display: none; }
@media (max-width: 640px) {
  .bottomnav {
    display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--muted); padding: 4px; }
  .bottomnav a.on { color: var(--accent); }
  .bottomnav a:hover { text-decoration: none; }
  body { padding-bottom: 72px; }
}

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: var(--bg); border: 0; border-radius: 12px;
  padding: 10px 20px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 20px -10px var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface); }
.btn.sm { padding: 6px 14px; font-size: .85rem; border-radius: 10px; }
.btn.lg { padding: 14px 28px; font-size: 1.05rem; border-radius: 14px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.linkbtn.danger { color: var(--warn); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- کارت و سطح ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.eyebrow { font-size: .78rem; font-weight: 700; color: var(--accent); letter-spacing: 0; display: inline-flex; gap: 6px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--bg-2); color: var(--ink-2); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* پیام‌ها */
.toast {
  position: fixed; top: 76px; inset-inline-start: 50%; transform: translateX(50%); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px; animation: toast 4s ease forwards; max-width: calc(100% - 32px);
}
@keyframes toast { 0% { opacity: 0; transform: translate(50%, -10px); } 8%, 85% { opacity: 1; transform: translate(50%, 0); } 100% { opacity: 0; transform: translate(50%, -10px); visibility: hidden; } }
.alert { padding: 10px 14px; border-radius: var(--r-sm); font-size: .9rem; margin-bottom: 12px; display: flex; gap: 8px; align-items: flex-start; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.good { background: var(--good-soft); color: var(--good); }
.alert.info { background: var(--bg-2); color: var(--ink-2); }

/* ---------- فرم ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 500; color: var(--ink-2); min-width: 0; }
.control {
  display: flex; align-items: stretch; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, background .15s; overflow: hidden;
}
.control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.control input, .control select, input.plain, select.plain, textarea.plain {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; font-weight: 500;
  padding: 10px 12px; outline: none;
}
input.plain, select.plain, textarea.plain { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
input.plain:focus, select.plain:focus, textarea.plain:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.control select, select.plain { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2380838a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 32px; }
.control .unit { display: grid; place-items: center; padding: 0 12px; font-size: .78rem; color: var(--muted); background: var(--bg-2); border-inline-start: 1px solid var(--line); white-space: nowrap; }
.control.own { border-color: var(--accent); }
.field .hint { font-size: .72rem; color: var(--muted); font-weight: 400; }
.flabel { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field .tag { font-size: .68rem; color: var(--accent); background: var(--accent-soft); padding: 0 6px; border-radius: 4px; font-weight: 700; line-height: 1.6; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* کنترل دوحالته */
.segmented { display: flex; background: var(--bg-2); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 20px; }
.segmented label { flex: 1; text-align: center; padding: 10px 8px; border-radius: 11px; cursor: pointer; font-weight: 700; color: var(--ink-2); transition: all .2s; display: flex; flex-direction: column; line-height: 1.4; }
.segmented label small { font-weight: 400; font-size: .72rem; color: var(--muted); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); }

/* ---------- صفحه اصلی ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; margin: 20px 0 28px; padding: clamp(28px, 5vw, 64px);
  background: var(--hero); color: var(--hero-ink); isolation: isolate;
}
.hero::before { /* شبکه نقشه */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: radial-gradient(ellipse at 30% 50%, #000 30%, transparent 75%);
}
.hero::after { content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; left: -120px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 89, 12, .45), transparent 65%); filter: blur(10px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { display: none; } }
.hero h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3.1rem); font-weight: 900; line-height: 1.3; margin: 12px 0 16px; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.08rem; color: color-mix(in srgb, var(--hero-ink) 75%, transparent); max-width: 560px; }
.hero .eyebrow { color: var(--accent-2); background: rgba(255,255,255,.06); padding: 4px 12px; border-radius: 99px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero .btn.ghost { color: var(--hero-ink); border-color: rgba(255,255,255,.18); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.06); }
.hero-stats { display: flex; gap: 28px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 1.5rem; font-weight: 900; color: #fff; }
.hero-stats span { font-size: .8rem; color: color-mix(in srgb, var(--hero-ink) 60%, transparent); }
.hero-art svg { width: 100%; height: auto; display: block; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 36px 0 16px; }
.section-head p { margin: 4px 0 0; color: var(--muted); }

.modules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1000px) { .modules { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .modules { grid-template-columns: 1fr; } }
.module {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.module:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.module .mi { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.module .step { position: absolute; top: 18px; left: 20px; font-weight: 900; font-size: 2.2rem; color: var(--bg-2); line-height: 1; }
.module p { color: var(--muted); font-size: .88rem; margin: 0; flex: 1; }
.module .go { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); font-size: .9rem; }
.module:hover .go .ic { transform: translateX(-4px); }
.module .go .ic { transition: transform .2s; }

.ways { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .ways { grid-template-columns: 1fr; } }
.way { padding: 28px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.way.featured { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.way ul { list-style: none; padding: 0; margin: 14px 0 20px; display: flex; flex-direction: column; gap: 8px; }
.way li { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
.way li .ic { color: var(--good); margin-top: 4px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.steps div { padding: 20px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--line); }
.steps div::before { counter-increment: s; content: counter(s, persian); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 900; margin-bottom: 10px; }

/* ---------- محاسبه ---------- */
.page-head { display: flex; align-items: center; gap: 14px; margin: 24px 0 16px; flex-wrap: wrap; }
.page-head .mi { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 24px -12px var(--accent); }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: .82rem; color: var(--muted); margin-top: 20px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); }
.modtabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 8px; scrollbar-width: none; }
.modtabs::-webkit-scrollbar { display: none; }
.modtabs a { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 12px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); white-space: nowrap; font-weight: 500; }
.modtabs a:hover { text-decoration: none; border-color: var(--ink-2); }
.modtabs a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.modtabs a .done { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }

.calc-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .calc-layout { grid-template-columns: 1fr; } }
.calc-form .group + .group { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.group-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.group-title .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: .8rem; font-weight: 900; }
.group-title h2 { font-size: 1rem; }
.group-title .muted { font-size: .8rem; font-weight: 400; margin-inline-start: auto; }
.prices-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; text-align: inherit; }
.prices-toggle .ic { transition: transform .2s; }
.prices-toggle[aria-expanded="true"] .ic.chev { transform: rotate(-90deg); }
.calc-submit { position: sticky; bottom: 12px; margin-top: 24px; z-index: 5; }
@media (max-width: 640px) { .calc-submit { bottom: 84px; } }
.calc-submit .btn { width: 100%; box-shadow: 0 16px 32px -12px var(--accent); }

/* نتیجه */
.result-wrap { position: sticky; top: 84px; }
@media (max-width: 960px) { .result-wrap { position: static; } }
.empty-result { text-align: center; padding: 40px 24px; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--r); }
.empty-result .ic { color: var(--line); margin-bottom: 8px; }
.result-hero { background: var(--hero); color: var(--hero-ink); border-radius: var(--r); padding: 24px; position: relative; overflow: hidden; }
.result-hero::after { content: ""; position: absolute; width: 300px; height: 300px; left: -100px; bottom: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(232, 89, 12, .5), transparent 65%); }
.result-hero .label { font-size: .85rem; color: color-mix(in srgb, var(--hero-ink) 65%, transparent); }
.result-hero .amount { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.5rem); font-weight: 900; line-height: 1.3; margin: 4px 0; position: relative; z-index: 1; }
.result-hero .amount small { font-size: .9rem; font-weight: 500; color: color-mix(in srgb, var(--hero-ink) 65%, transparent); }
.result-hero .sub { font-size: .8rem; color: color-mix(in srgb, var(--hero-ink) 55%, transparent); position: relative; z-index: 1; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; padding: 0; }
.facts div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.facts dt { font-size: .72rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 700; font-size: .95rem; }

.breakdown { margin: 18px 0 8px; }
.bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--bg-2); gap: 2px; }
.bar span { display: block; height: 100%; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .v { margin-inline-start: auto; font-weight: 700; }
.legend .p { color: var(--muted); width: 3.2em; text-align: left; }

.savebox { display: flex; gap: 8px; align-items: stretch; margin-top: 16px; padding: 12px; background: var(--accent-soft); border-radius: 14px; flex-wrap: wrap; }
.savebox select { flex: 1; min-width: 140px; }
.savebox .msg { width: 100%; font-size: .85rem; margin: 0; }
.cta-box { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--accent-soft); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cta-box p { margin: 0; flex: 1; min-width: 200px; font-size: .9rem; }

details.items { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
details.items summary { padding: 12px 16px; cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.items summary::-webkit-details-marker { display: none; }
details.items summary::after { content: "+"; font-size: 1.2rem; color: var(--muted); }
details.items[open] summary::after { content: "−"; }
details.items .tbl { padding: 0 8px 8px; }

/* جدول */
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { font-weight: 500; color: var(--muted); font-size: .76rem; text-align: right; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 900; border-top: 2px solid var(--ink); border-bottom: 0; }
tr.muted td { color: var(--muted); }

/* ---------- تبلیغ میان‌صفحه‌ای ---------- */
.ad-gate { position: fixed; inset: 0; z-index: 100; background: #000; display: grid; place-items: center; animation: fade .25s ease; }
.ad-gate[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.ad { position: relative; width: 100%; height: 100%; overflow: hidden; background: #000; color: #fff; display: flex; flex-direction: column; }
@media (min-width: 700px) {
  .ad-gate { background: rgba(0, 0, 0, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .ad { width: min(460px, 92vw); height: min(820px, 92vh); border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); animation: pop .35s cubic-bezier(.2, .9, .3, 1.2); }
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.ad-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.5); transform: scale(1.1); }
.ad-media { position: relative; flex: 1; display: grid; place-items: center; min-height: 0; }
.ad-media > a, .ad-media > .ad-html { display: grid; place-items: center; width: 100%; height: 100%; }
.ad-media img, .ad-media video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; display: block; }
.ad-media .ad-html { background: #fff; color: #16181d; overflow: auto; }
.ad-top { position: absolute; top: 0; inset-inline: 0; z-index: 2; padding: calc(10px + env(safe-area-inset-top)) 12px 28px;
  background: linear-gradient(rgba(0,0,0,.55), transparent); display: flex; flex-direction: column; gap: 10px; }
.ad-progress { height: 3px; border-radius: 3px; background: rgba(255,255,255,.3); overflow: hidden; }
.ad-progress span { display: block; height: 100%; width: 0; background: #fff; transition: width 1s linear; }
.ad-row { display: flex; align-items: center; gap: 8px; }
.ad-badge { font-size: .72rem; font-weight: 700; background: rgba(255,255,255,.18); padding: 2px 10px; border-radius: 6px; backdrop-filter: blur(6px); }
.ad-row .grow { flex: 1; }
.ad-round { width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; cursor: pointer; backdrop-filter: blur(6px); }
.ad-skip { border: 0; border-radius: 99px; padding: 7px 14px; font: inherit; font-size: .85rem; font-weight: 700; background: rgba(0,0,0,.55); color: #fff;
  display: inline-flex; align-items: center; gap: 6px; backdrop-filter: blur(6px); cursor: default; white-space: nowrap; }
.ad-skip.ready { background: #fff; color: #000; cursor: pointer; }
.ad-bottom { position: absolute; bottom: 0; inset-inline: 0; z-index: 2; padding: 40px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,.75)); display: flex; align-items: center; gap: 12px; }
.ad-bottom .t { flex: 1; min-width: 0; }
.ad-bottom b { display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-bottom small { color: rgba(255,255,255,.7); font-size: .75rem; }
.ad-cta { background: #fff; color: #000; border-radius: 12px; padding: 10px 18px; font-weight: 800; white-space: nowrap; }
.ad-cta:hover { text-decoration: none; }
/* ---------- پروژه‌ها ---------- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 28px 0 20px; flex-wrap: wrap; }
.dash-head p { margin: 4px 0 0; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.kpi .ki { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi b { display: block; font-size: 1.35rem; font-weight: 900; line-height: 1.3; }
.kpi span { font-size: .8rem; color: var(--muted); }
.kpi.dark { background: var(--hero); color: var(--hero-ink); border-color: transparent; }
.kpi.dark span { color: color-mix(in srgb, var(--hero-ink) 60%, transparent); }
.kpi.dark .ki { background: rgba(255,255,255,.08); color: var(--accent-2); }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; color: var(--ink);
  display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.pcard .cover { height: 112px; position: relative; background: var(--hero); overflow: hidden; }
.pcard .cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pcard .cover .pill { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(6px); }
.pcard .body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard h3 { font-size: 1.08rem; }
.pcard .meta { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.pcard .meta span { display: inline-flex; align-items: center; gap: 4px; }
.pcard .price { font-weight: 900; font-size: 1.15rem; }
.pcard .price small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.segs { display: flex; gap: 4px; }
.segs i { flex: 1; height: 6px; border-radius: 99px; background: var(--bg-2); }
.segs i.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.pcard .modchips { display: flex; gap: 6px; flex-wrap: wrap; }
.modchip { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--bg-2); color: var(--muted); }
.modchip.on { background: var(--good-soft); color: var(--good); }
.newcard { border: 2px dashed var(--line); background: transparent; box-shadow: none; justify-content: center; align-items: stretch; padding: 22px; }
.newcard:hover { transform: none; box-shadow: none; border-color: var(--accent); }
.newcard h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

.empty-state { text-align: center; padding: 56px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; }
.empty-state .art { width: 120px; margin: 0 auto 16px; color: var(--accent); }
.empty-state p { color: var(--muted); max-width: 420px; margin: 8px auto 20px; }

/* صفحه یک پروژه */
.phero { position: relative; overflow: hidden; border-radius: 24px; background: var(--hero); color: var(--hero-ink); padding: clamp(20px, 4vw, 36px); margin: 16px 0 20px; isolation: isolate; }
.phero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 28px 28px; }
.phero-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
@media (max-width: 700px) { .phero-grid { grid-template-columns: 1fr; } }
.phero h1 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); font-weight: 900; }
.phero .meta { display: flex; gap: 16px; font-size: .82rem; color: color-mix(in srgb, var(--hero-ink) 60%, transparent); margin: 6px 0 18px; flex-wrap: wrap; }
.phero .meta span { display: inline-flex; gap: 4px; align-items: center; }
.phero .label { font-size: .82rem; color: color-mix(in srgb, var(--hero-ink) 60%, transparent); }
.phero .amount { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.8rem); font-weight: 900; line-height: 1.3; }
.phero .amount small { font-size: .95rem; font-weight: 500; color: color-mix(in srgb, var(--hero-ink) 60%, transparent); }
.bigring { position: relative; width: 140px; height: 140px; }
.bigring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.bigring circle { fill: none; stroke-width: 10; }
.bigring .bg { stroke: rgba(255,255,255,.08); }
.bigring .fg { stroke: url(#ringGrad); stroke-linecap: round; }
.bigring div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.bigring b { font-size: 1.8rem; font-weight: 900; line-height: 1.1; }
.bigring span { font-size: .75rem; color: color-mix(in srgb, var(--hero-ink) 60%, transparent); }

.p-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .p-layout { grid-template-columns: 1fr; } }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tl { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.tl .mi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); position: relative; }
.tl.done .mi { background: var(--accent-soft); color: var(--accent); }
.tl.done .mi::after { content: ""; position: absolute; bottom: -3px; left: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 10px no-repeat; border: 2px solid var(--surface-2); }
.tl h3 { font-size: .98rem; }
.tl .cost { font-weight: 700; font-size: .92rem; }
.tl .when { font-size: .74rem; color: var(--muted); }
.tl .share { height: 4px; border-radius: 99px; background: var(--bg-2); margin-top: 6px; overflow: hidden; }
.tl .share span { display: block; height: 100%; background: var(--accent); }
@media (max-width: 520px) { .tl { grid-template-columns: auto 1fr; } .tl .btn { grid-column: 1 / -1; } }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.history li:last-child { border-bottom: 0; }
.history .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.history .t { color: var(--muted); font-size: .75rem; margin-inline-start: auto; white-space: nowrap; }
.history form { margin: 0; }

/* ---------- ورود و ثبت‌نام ---------- */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: min(680px, calc(100vh - 120px)); margin: 24px 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { margin-bottom: 6px; }
.auth-card > p { color: var(--muted); margin-bottom: 24px; }
.auth-side { background: var(--hero); color: var(--hero-ink); padding: 48px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; isolation: isolate; }
.auth-side::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 32px 32px; }
.auth-side h2 { font-size: 1.8rem; font-weight: 900; margin-bottom: 20px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-side li { display: flex; gap: 10px; color: color-mix(in srgb, var(--hero-ink) 80%, transparent); }
.auth-side li .ic { color: var(--accent-2); margin-top: 3px; }
.auth-switch { text-align: center; margin-top: 20px; color: var(--muted); font-size: .9rem; }

/* ---------- پابرگ ---------- */
.footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .8rem; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* حرکت کمتر برای کسانی که خواسته‌اند */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- صفحه اصلی تمام‌صفحه ---------- */
body.home { background: var(--hero); color: var(--hero-ink); }
body.home .topbar { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; position: absolute; inset-inline: 0; }
body.home .brand, body.home .topnav a, body.home .userchip, body.home .iconbtn { color: var(--hero-ink); }
body.home .topnav a:hover, body.home .iconbtn:hover { background: rgba(255,255,255,.08); }
body.home .topnav a.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: none; }
body.home .topbar .btn { background: rgba(255,255,255,.1); color: #fff; }
body.home .bottomnav { background: rgba(11,12,14,.85); border-top-color: rgba(255,255,255,.08); }
body.home main.wrap { max-width: none; padding: 0; }
.hero.full { margin: 0; border-radius: 0; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 96px max(16px, calc((100vw - 1168px) / 2)) 48px; }
.hero.full .hero-grid { width: 100%; }
.hero.full .hero-text .btn { margin-top: 28px; }
.hero.full::after { width: 720px; height: 720px; left: -220px; top: -260px; }
/* موبایل: تصویر بالا، متن و دکمه پایین، مثل صفحه آغاز اپ */
@media (max-width: 860px) {
  .hero.full { align-items: stretch; padding: 80px 20px calc(96px + env(safe-area-inset-bottom)); }
  .hero.full .hero-grid { display: flex; flex-direction: column-reverse; justify-content: space-between; gap: 24px; }
  .hero.full .hero-art { display: block; max-width: 320px; width: 78%; margin: 0 auto; }
  .hero.full .hero-text { text-align: center; }
  .hero.full .hero-text .lead { margin-inline: auto; }
  .hero.full .hero-text .btn { width: 100%; }
}
@media (max-width: 860px) and (max-height: 640px) { .hero.full .hero-art { width: 52%; } }
.hero .load { animation: hoist 4s ease-in-out infinite; }
.hero .cable { animation: cable 4s ease-in-out infinite; transform-origin: 160px 40px; }
@keyframes hoist { 50% { transform: translateY(-34px); } }
@keyframes cable { 50% { transform: scaleY(.52); } }
@media (max-width: 640px) { body.home { padding-bottom: 0; } }

/* ---------- پنل مدیریت ---------- */
.admin-body { background: var(--bg); }
.admin-login { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 16px; }
.admin-login .card { width: min(400px, 100%); }
.admin-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.admin-side { position: sticky; top: 0; height: 100vh; background: var(--hero); color: var(--hero-ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 24px; }
.admin-side .brand { color: var(--hero-ink); padding: 0 8px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a, .admin-side-foot a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: color-mix(in srgb, var(--hero-ink) 70%, transparent); font-weight: 500; }
.admin-nav a:hover, .admin-side-foot a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.admin-nav a.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 20px -10px var(--accent); }
.admin-side-foot { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.admin-main { padding: 24px clamp(16px, 3vw, 36px) 48px; max-width: 1100px; width: 100%; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-head .admin-out { display: none; }
.admin-tabs { display: none; }
.admin-main .card + .card, .admin-main .card + .alert, .admin-main .alert + .card { margin-top: 16px; }
.admin-main .alert a { font-weight: 700; }

/* موبایل: نوار پایین به جای سایدبار */
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: none; }
  .admin-main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .admin-head { position: sticky; top: 0; z-index: 20; margin: -16px -16px 16px; padding: 14px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .admin-head h1 { font-size: 1.2rem; }
  .admin-head .admin-out { display: grid; }
  .admin-tabs { display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 30; overflow-x: auto; scrollbar-width: none;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tabs a { flex: 1 0 54px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; color: var(--muted); padding: 4px 2px; white-space: nowrap; }
  .admin-tabs a.on { color: var(--accent); }
  .admin-tabs a:hover { text-decoration: none; }
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1000px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.stat span { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.stat b { font-size: 1.7rem; font-weight: 900; line-height: 1.3; }
.stat small { font-size: .75rem; color: var(--muted); }
.stat.dark { background: var(--hero); color: var(--hero-ink); border-color: transparent; }
.stat.dark span, .stat.dark small { color: color-mix(in srgb, var(--hero-ink) 60%, transparent); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.two-col .card + .card { margin-top: 0; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.history .avatar { width: 34px; height: 34px; flex: none; }

/* فهرست قیمت‌ها و ضرایب */
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 300px); gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-label b { display: block; font-weight: 500; font-size: .92rem; }
.row-label small { color: var(--muted); font-size: .72rem; }
.row.changed .control, td.changed input { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; gap: 6px; } }
table.edit input { width: 100%; min-width: 96px; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
table.edit input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
table.edit td:first-child { min-width: 140px; }
.savebar { position: sticky; bottom: 12px; z-index: 10; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--hero); color: var(--hero-ink); border-radius: 16px; padding: 10px 16px 10px 10px; box-shadow: var(--shadow-lg); }
.savebar .muted { color: color-mix(in srgb, var(--hero-ink) 65%, transparent); }
@media (max-width: 860px) { .savebar { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* آگهی‌ها */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.ad-grid .card + .card { margin-top: 0; }
.adcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.adcard.off { opacity: .6; }
.adcard .thumb { position: relative; aspect-ratio: 16 / 10; background: #000; display: grid; place-items: center; overflow: hidden; }
.adcard .thumb img, .adcard .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.adcard .thumb .pill { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff; }
.html-ph { color: rgba(255,255,255,.5); font-weight: 900; font-size: 1.4rem; }
.adbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.adtitle { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.adtitle form { margin: 0; }
.adstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.adstats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.adstats b { display: block; font-weight: 900; }
.adstats span { font-size: .7rem; color: var(--muted); }
.admeta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); }
.admeta span { display: inline-flex; align-items: center; gap: 4px; }
.addel { margin: auto 0 0; }

.switch { width: 46px; height: 28px; border-radius: 99px; border: 0; padding: 3px; background: var(--bg-2); cursor: pointer; display: flex; transition: background .2s; }
.switch i { width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch.on { background: var(--good); }
.switch.on i { transform: translateX(-18px); }
.switch-input { position: relative; display: inline-flex; flex: none; }
.switch-input input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch-input i { width: 50px; height: 30px; border-radius: 99px; background: var(--bg-2); position: relative; transition: background .2s; }
.switch-input i::after { content: ""; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch-input input:checked + i { background: var(--good); }
.switch-input input:checked + i::after { transform: translateX(-20px); }
.switch-input input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 28px 16px; margin-bottom: 16px;
  border: 2px dashed var(--line); border-radius: 16px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has { border-style: solid; border-color: var(--good); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.dz-name { font-weight: 700; color: var(--good); font-size: .85rem; }
.newad .segmented { margin-bottom: 16px; }
.newad [hidden] { display: none !important; }

.settings .setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.settings .setting:first-of-type { padding-top: 0; }
.settings .setting p { margin: 2px 0 0; }
.control.sm { width: 160px; flex: none; }

/* صفحه نصب */
.admin { max-width: 720px; margin: 0 auto; padding: 24px 16px; }
.admin h1 { margin-bottom: 16px; }
.admin .card { margin-bottom: 16px; }
.admin .grid label { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; color: var(--ink-2); }
.admin input { width: 100%; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.admin button[type=submit] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: 0; border-radius: 12px; padding: 10px 22px; font: inherit; font-weight: 700; cursor: pointer; }
@media (max-width: 480px) { .control.sm { width: 120px; } }
