/* ==========================================================================
   rezahasanloo.ir — Design System v1.1
   Dark  → فروش · پشتیبانی · چک‌اوت
   Light → سرویس · پنل کاربر
   RTL-first · اعداد فارسی در UI، لاتین در کد
   ========================================================================== */

:root {
  /* dark (پیش‌فرض صفحهٔ فروش) */
  --bg-base: #0b0b0f;
  --bg-raised: #12111a;
  --bg-overlay: #1c1b24;
  --bg-sunken: #16151f;
  --border: #23222b;
  --fg: #eceaf2;
  --fg-muted: #9a97a8;
  --accent: oklch(0.72 0.16 195);
  --accent-ink: #04161b;
  --accent-2: oklch(0.72 0.16 300);

  --success: oklch(0.55 0.13 150);
  --warning: oklch(0.62 0.14 70);
  --danger: oklch(0.55 0.18 25);
  --info: oklch(0.55 0.13 250);

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 18px;
  --r-full: 999px;

  --shell: 1180px;
  --font: Vazirmatn, "Vazir", "IRANSans", system-ui, Tahoma, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* پوستهٔ روشن برای لایهٔ سرویس (پنل کاربر) */
.theme-light {
  --bg-base: #fcfcfb;
  --bg-raised: #ffffff;
  --bg-overlay: #ffffff;
  --bg-sunken: #f1f2f0;
  --border: #e3e5e2;
  --fg: #16181c;
  --fg-muted: #5c605e;
  --accent: oklch(0.55 0.13 250);
  --accent-ink: #ffffff;
  --accent-2: oklch(0.55 0.13 150);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .85; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }

/* ------------------------------------------------------------ تایپوگرافی */
h1, h2, h3, h4 { margin: 0 0 .55em; font-weight: 800; }
.display { font-size: clamp(30px, 6.4vw, 48px); line-height: 1.25; letter-spacing: -.025em; font-weight: 800; }
h1 { font-size: clamp(25px, 5vw, 34px); line-height: 1.3; letter-spacing: -.02em; }
h2 { font-size: clamp(21px, 3.6vw, 26px); line-height: 1.4; letter-spacing: -.015em; font-weight: 700; }
h3 { font-size: 19px; line-height: 1.5; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }
small, .small { font-size: 13px; line-height: 1.8; }
.mono { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .04em; direction: ltr; display: inline-block; }
.muted { color: var(--fg-muted); }
.center { text-align: center; }

.shell { width: min(var(--shell), calc(100% - 44px)); margin-inline: auto; }
@media (max-width: 640px) { .shell { width: calc(100% - 32px); } }

.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--sunken { background: var(--bg-raised); }
.section__head { margin-bottom: 30px; }
.section__head p { color: var(--fg-muted); margin: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- دکمه‌ها */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border-radius: var(--r-full);
  border: 1px solid transparent; font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .5; pointer-events: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.08); opacity: 1; }
.btn--secondary { background: var(--bg-overlay); color: var(--fg); border-color: var(--border); }
.btn--secondary:hover { border-color: var(--accent); opacity: 1; }
.btn--ghost { background: transparent; color: var(--fg-muted); border-color: transparent; }
.btn--ghost:hover { color: var(--fg); opacity: 1; }
.btn--danger { background: color-mix(in oklch, var(--danger) 16%, transparent); color: var(--danger); }
.btn--md { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn--block { width: 100%; }

/* ------------------------------------------------------------------ هدر */
.header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg-base) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header__row { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 800; font-size: 16px; }
.brand:hover { opacity: 1; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 17px; overflow: hidden;
}
.brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.nav { display: flex; gap: 20px; margin-inline-start: 14px; font-size: 14.5px; }
.nav a { color: var(--fg-muted); }
.nav a:hover, .nav a.is-active { color: var(--fg); opacity: 1; }
.header__end { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.burger { display: none; background: none; border: 0; color: var(--fg); padding: 8px; cursor: pointer; }
@media (max-width: 960px) {
  .nav { display: none; position: absolute; inset-block-start: 64px; inset-inline: 0; flex-direction: column; gap: 0; background: var(--bg-raised); border-bottom: 1px solid var(--border); padding: 8px 20px 16px; margin: 0; }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .burger { display: block; }
  .header__end .btn--secondary { display: none; }
}

/* ------------------------------------------------------------------ هیرو */
.hero { position: relative; padding: 52px 0 60px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% 20% auto -20%; height: 520px;
  background: radial-gradient(60% 60% at 50% 50%, color-mix(in oklch, var(--accent) 20%, transparent), transparent 70%);
  filter: blur(40px); pointer-events: none;
}
.hero__grid { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 42px; align-items: center; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; gap: 30px; } }

.badge-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px;
  border: 1px solid color-mix(in oklch, var(--accent) 45%, transparent);
  border-radius: var(--r-full); color: var(--accent); font-size: 12.5px; font-weight: 700;
}
.hero__sub { color: var(--fg-muted); font-size: clamp(15px, 2.2vw, 17px); max-width: 54ch; margin: 16px 0 26px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.fact {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-full);
  font-size: 13px; color: var(--fg-muted);
}
.fact b { color: var(--fg); font-weight: 700; }

.showreel {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-raised); aspect-ratio: 16/9;
}
.showreel video, .showreel img { width: 100%; height: 100%; object-fit: cover; }
.showreel__empty {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; justify-items: center;
  color: var(--fg-muted); font-size: 13px; text-align: center; padding: 20px;
}
.showreel__ring { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; color: var(--accent); }

/* ---------------------------------------------------------------- کارت‌ها */
.card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px;
  transition: transform .32s var(--ease), border-color .32s var(--ease);
}
.card--hover:hover { transform: translateY(-3px); border-color: color-mix(in oklch, var(--accent) 40%, var(--border)); }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--fg-muted); margin: 0; font-size: 14.5px; }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* -------------------------------------------------------------- رسانه‌ها */
.media {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-sunken); border: 1px solid var(--border);
}
.media > img, .media > video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s var(--ease); }
.card--hover:hover .media > img, .card--hover:hover .media > video { transform: scale(1.06); }
.media__empty {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; justify-items: center;
  color: var(--fg-muted); font-size: 11.5px; letter-spacing: .04em;
}
.media__badge {
  position: absolute; inset-block-start: 10px; inset-inline-start: 10px;
  background: color-mix(in srgb, #000 55%, transparent); color: #fff;
  border-radius: var(--r-full); padding: 3px 10px; font-size: 11.5px; backdrop-filter: blur(6px);
}

/* ------------------------------------------------------------- سرفصل‌ها */
.chapter { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-raised); overflow: hidden; }
.chapter + .chapter { margin-top: 10px; }
.chapter__btn { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; font-weight: 700; list-style: none; }
.chapter__btn::-webkit-details-marker { display: none; }
.chapter__num {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--bg-sunken); color: var(--fg-muted); font-size: 13px; font-weight: 700;
}
.chapter__meta { margin-inline-start: auto; color: var(--fg-muted); font-size: 13px; white-space: nowrap; }
.chapter__body { padding: 0 18px 16px; color: var(--fg-muted); font-size: 14px; }
.chapter[open] .chapter__num { background: var(--accent); color: var(--accent-ink); }

/* ----------------------------------------------------------------- قیمت */
.price {
  border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg-raised);
  padding: 30px; position: relative; overflow: hidden;
}
.price::before {
  content: ""; position: absolute; inset-block-start: -1px; inset-inline: 30px;
  height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.price__row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 14px 0 6px; }
.price__now { font-size: clamp(28px, 5.4vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.price__now small { font-size: 15px; font-weight: 600; color: var(--fg-muted); }
.price__old { color: var(--fg-muted); text-decoration: line-through; font-size: 16px; }
.price__off { background: color-mix(in oklch, var(--accent) 18%, transparent); color: var(--accent); border-radius: var(--r-full); padding: 3px 11px; font-size: 12.5px; font-weight: 700; }
.price ul { list-style: none; padding: 0; margin: 20px 0; }
.price li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14.5px; color: var(--fg-muted); }
.price li svg { flex: none; margin-top: 6px; color: var(--accent); }

.coupon { display: flex; gap: 8px; margin-bottom: 16px; }
.coupon .input { flex: 1; }

/* ------------------------------------------------------------- فیلدها */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; }
.input, .textarea, .select {
  width: 100%; height: 52px; padding: 0 16px;
  background: var(--bg-raised); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-family: inherit; font-size: 15px; line-height: 1.7;
}
.textarea { height: auto; min-height: 118px; padding: 14px 16px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(transparent, transparent); padding-inline-end: 40px; }
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--fg-muted) 70%, transparent); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent);
}
.input[disabled], .textarea[disabled] { opacity: .5; cursor: not-allowed; }
.field__hint { font-size: 12.5px; color: var(--fg-muted); margin-top: 7px; }
.field__hint--error { color: var(--danger); }
.input--ltr { direction: ltr; text-align: left; }

.otp { display: flex; gap: 10px; direction: ltr; justify-content: center; }
.otp input {
  width: 54px; height: 60px; text-align: center; font-family: var(--mono);
  font-size: 22px; font-weight: 700; color: var(--fg);
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-md);
}
.otp input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent); }
.otp.is-error input { border-color: var(--danger); }
.otp.is-ok input { border-color: var(--success); }
@media (max-width: 420px) { .otp input { width: 46px; height: 54px; font-size: 19px; } }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { width: 0; height: 0; opacity: 0; position: absolute; }
.switch i { width: 42px; height: 24px; border-radius: var(--r-full); background: var(--bg-sunken); border: 1px solid var(--border); position: relative; transition: background-color .2s; flex: none; }
.switch i::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--fg-muted); transition: transform .2s var(--ease), background-color .2s; }
.switch input:checked + i { background: color-mix(in oklch, var(--accent) 30%, transparent); border-color: var(--accent); }
.switch input:checked + i::after { background: var(--accent); transform: translateX(-18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent); }

/* -------------------------------------------------------------- بج‌ها */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 700; }
.badge--ok { background: color-mix(in oklch, var(--success) 18%, transparent); color: var(--success); }
.badge--fail { background: color-mix(in oklch, var(--danger) 16%, transparent); color: var(--danger); }
.badge--wait { background: color-mix(in oklch, var(--warning) 18%, transparent); color: var(--warning); }
.badge--info { background: color-mix(in oklch, var(--info) 18%, transparent); color: var(--info); }
.badge--muted { background: var(--bg-sunken); color: var(--fg-muted); }
.badge--lock { background: color-mix(in oklch, var(--accent-2) 20%, transparent); color: var(--accent-2); }

.alert { padding: 12px 15px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 16px; display: none; }
.alert.is-on { display: block; }
.alert--error { background: color-mix(in oklch, var(--danger) 14%, transparent); color: var(--danger); }
.alert--ok { background: color-mix(in oklch, var(--success) 14%, transparent); color: var(--success); }
.alert--info { background: var(--bg-sunken); color: var(--fg-muted); }

/* ------------------------------------------------------- کارت پرامپت */
.prompt { position: relative; overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.prompt .media { border: 0; border-radius: 0; aspect-ratio: 4/5; }
.prompt__body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.prompt__title { font-size: 15px; font-weight: 700; line-height: 1.6; margin: 0; }
.prompt__meta { display: flex; gap: 6px; flex-wrap: wrap; }
.prompt__actions { display: flex; gap: 8px; margin-top: auto; }
.prompt__actions .btn { flex: 1; }
.prompt.is-locked .media > img, .prompt.is-locked .media > video, .prompt.is-locked .media__empty { filter: blur(7px) saturate(.8); }
.prompt__lock {
  position: absolute; inset-block-start: 10px; inset-inline-end: 10px;
  background: color-mix(in srgb, #000 55%, transparent); color: #fff;
  border-radius: var(--r-full); padding: 4px 11px; font-size: 11.5px; font-weight: 700; backdrop-filter: blur(6px);
}
.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-overlay);
  color: var(--fg-muted); cursor: pointer; transition: color .2s, border-color .2s;
}
.icon-btn:hover, .icon-btn.is-on { color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------------- جدول‌ها */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 12px 10px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { color: var(--fg-muted); font-weight: 600; font-size: 12.5px; }
table.data tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------ پنل کاربر */
.panel { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; }
.panel h2 { font-size: 19px; margin-bottom: 4px; }
.panel__sub { color: var(--fg-muted); font-size: 14px; margin-bottom: 20px; }

.dash { display: grid; grid-template-columns: 236px 1fr; gap: 22px; padding: 26px 0 64px; align-items: start; }
@media (max-width: 900px) { .dash { grid-template-columns: 1fr; } }
.dash__side { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px; position: sticky; top: 84px; }
@media (max-width: 900px) { .dash__side { position: static; display: flex; gap: 4px; overflow-x: auto; } }
.dash__side a { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: var(--r-md); color: var(--fg-muted); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.dash__side a.is-active { background: var(--accent); color: var(--accent-ink); }
.dash__side a:hover:not(.is-active) { background: var(--bg-sunken); color: var(--fg); opacity: 1; }
.dash__main { display: grid; gap: 18px; min-width: 0; }

.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--bg-sunken) 0); }
.ring span { width: 52px; height: 52px; border-radius: 50%; background: var(--bg-raised); display: grid; place-items: center; }

.license-key {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px 18px; direction: ltr;
}
.license-key code { font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: .06em; word-break: break-all; color: var(--fg); }

/* -------------------------------------------------------------- نتیجه */
.result { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; }
.result__card { width: min(560px, 100%); background: var(--bg-raised); border: 1px solid var(--border); border-radius: 22px; padding: 38px 30px; text-align: center; }
.result__icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 20px; }
.result__icon--ok { background: color-mix(in oklch, var(--success) 18%, transparent); color: var(--success); }
.result__icon--fail { background: color-mix(in oklch, var(--danger) 16%, transparent); color: var(--danger); }
.result__card p { margin-inline: auto; }
.result__row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.result__row:last-of-type { border-bottom: 0; }
.result__row span { color: var(--fg-muted); }
.result__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 20px 0 0; text-align: start; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 38px; margin-bottom: 12px; color: var(--fg-muted); font-size: 14.5px; }
.steps li::before {
  content: counter(s); position: absolute; inset-inline-start: 0; inset-block-start: 2px;
  width: 26px; height: 26px; border-radius: 8px; background: var(--bg-sunken); color: var(--accent);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
}

/* -------------------------------------------------------- نوار خرید موبایل */
.buybar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 70; display: none;
  align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-overlay) 96%, transparent);
  border-top: 1px solid var(--border); backdrop-filter: blur(10px);
}
.buybar b { font-size: 16px; }
.buybar .btn { margin-inline-start: auto; }
@media (max-width: 860px) { .buybar { display: flex; } body.has-buybar { padding-bottom: 84px; } }

/* -------------------------------------------------------------- دستیار */
.assistant-fab {
  position: fixed; inset-inline-end: 18px; inset-block-end: 18px; z-index: 80;
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  box-shadow: 0 14px 34px -14px color-mix(in oklch, var(--accent) 80%, transparent);
}
@media (max-width: 860px) { .assistant-fab { inset-block-end: 88px; } }
.chat {
  position: fixed; inset-inline-end: 18px; inset-block-end: 82px; z-index: 81;
  width: min(380px, calc(100vw - 36px)); max-height: min(560px, 76vh);
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-xl);
  display: none; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7);
}
.chat.is-open { display: flex; }
@media (max-width: 860px) { .chat { inset-block-end: 152px; } }
.chat__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14.5px; }
.chat__head button { margin-inline-start: auto; background: none; border: 0; color: var(--fg-muted); font-size: 20px; cursor: pointer; line-height: 1; }
.chat__body { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bubble { padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.8; max-width: 88%; white-space: pre-wrap; }
.bubble--bot { background: var(--bg-sunken); align-self: flex-start; border-start-start-radius: 4px; }
.bubble--me { background: color-mix(in oklch, var(--accent) 18%, transparent); align-self: flex-end; border-start-end-radius: 4px; }
.chat__starters { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 10px; }
.chat__starters button { background: var(--bg-sunken); border: 1px solid var(--border); color: var(--fg-muted); border-radius: var(--r-full); padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.chat__foot { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.chat__foot .input { height: 42px; }

/* ---------------------------------------------------------------- فوتر */
.footer { border-top: 1px solid var(--border); padding: 44px 0 30px; color: var(--fg-muted); font-size: 14px; background: var(--bg-raised); }
.footer a { color: var(--fg-muted); }
.footer a:hover { color: var(--fg); }
.footer__grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 30px; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }
.footer h4 { color: var(--fg); font-size: 14.5px; margin-bottom: 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; }
.footer__bottom { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: 12.5px; }

/* -------------------------------------------------------------- توست */
.toast-host { position: fixed; inset-block-start: 16px; inset-inline: 0; display: grid; justify-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: var(--bg-overlay); color: var(--fg); border: 1px solid var(--border); padding: 10px 18px; border-radius: var(--r-full); font-size: 14px; box-shadow: 0 14px 34px -16px rgba(0, 0, 0, .6); }
.toast--ok { border-color: var(--success); color: var(--success); }
.toast--error { border-color: var(--danger); color: var(--danger); }

/* ------------------------------------------------------------- متفرقه */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 12px; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px 16px; color: var(--fg-muted); border: 1px dashed var(--border); border-radius: var(--r-lg); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { padding: 7px 15px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--bg-raised); color: var(--fg-muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.chip.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.9em; }
.prose ul { color: var(--fg-muted); padding-inline-start: 22px; }
.prose li { margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--bg-sunken), var(--bg-overlay), var(--bg-sunken)); background-size: 200% 100%; animation: sk 1.3s linear infinite; border-radius: var(--r-md); }
@keyframes sk { to { background-position: -200% 0; } }
