/* ============================================================
   ظاهر سایت — با پشتیبانی کامل راست‌به‌چپ و حالت شب
   از ویژگی‌های منطقی CSS استفاده شده (inline-start به‌جای left)
   تا فارسی و انگلیسی هر دو بدون کد جداگانه درست بیفتند.
   ============================================================ */

:root {
  --bg:          #F2F5F4;
  --surface:     #FFFFFF;
  --surface-2:   #E9EEEC;
  --ink:         #0D1A18;
  --ink-2:       #47605C;
  --ink-3:       #728A86;
  --line:        #DBE3E1;
  --line-2:      #C6D2CF;

  --brand:       #0E6B63;
  --brand-ink:   #FFFFFF;
  --brand-soft:  #DCEEEB;
  --brand-hover: #0A544E;

  --gift:        #A85B18;
  --gift-soft:   #FBEEE0;

  --ok:          #15653C;
  --ok-soft:     #DEF0E5;
  --warn:        #8A5209;
  --warn-soft:   #FBF0DD;
  --danger:      #A02419;
  --danger-soft: #FBE7E5;

  --radius:      10px;
  --radius-lg:   14px;
  --shadow:      0 1px 2px rgba(13,26,24,.06), 0 4px 16px rgba(13,26,24,.05);
  --shadow-lg:   0 2px 6px rgba(13,26,24,.08), 0 12px 32px rgba(13,26,24,.08);
  --sidebar:     264px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0A100F;
    --surface:     #121B1A;
    --surface-2:   #1A2523;
    --ink:         #E5EDEB;
    --ink-2:       #A2B4B1;
    --ink-3:       #7C908C;
    --line:        #223330;
    --line-2:      #2E4340;

    --brand:       #38B5A8;
    --brand-ink:   #04211E;
    --brand-soft:  #10312E;
    --brand-hover: #4FC9BC;

    --gift:        #DFA35C;
    --gift-soft:   #2C2113;

    --ok:          #5FC48A;
    --ok-soft:     #10291B;
    --warn:        #DFA35C;
    --warn-soft:   #2C2113;
    --danger:      #EE8B82;
    --danger-soft: #2E1614;

    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    --shadow-lg:   0 2px 6px rgba(0,0,0,.5), 0 12px 32px rgba(0,0,0,.4);
  }
}

:root[data-theme="dark"] {
  --bg:          #0A100F;
  --surface:     #121B1A;
  --surface-2:   #1A2523;
  --ink:         #E5EDEB;
  --ink-2:       #A2B4B1;
  --ink-3:       #7C908C;
  --line:        #223330;
  --line-2:      #2E4340;
  --brand:       #38B5A8;
  --brand-ink:   #04211E;
  --brand-soft:  #10312E;
  --brand-hover: #4FC9BC;
  --gift:        #DFA35C;
  --gift-soft:   #2C2113;
  --ok:          #5FC48A;
  --ok-soft:     #10291B;
  --warn:        #DFA35C;
  --warn-soft:   #2C2113;
  --danger:      #EE8B82;
  --danger-soft: #2E1614;
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --shadow-lg:   0 2px 6px rgba(0,0,0,.5), 0 12px 32px rgba(0,0,0,.4);
}

/* فونت میزبانی‌شده روی همین سرور — اگر install.sh دانلودش کرده باشد استفاده
   می‌شود، وگرنه بی‌صدا رد می‌شود و فونت سیستمی جایش را می‌گیرد. */
@font-face {
  font-family: "VazirmatnLocal";
  src: url("/static/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "VazirmatnLocal";
  src: url("/static/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500 600; font-display: swap;
}
@font-face {
  font-family: "VazirmatnLocal";
  src: url("/static/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700 800; font-display: swap;
}

/* Tahoma روی هر ویندوزی هست و فارسی را تمیز نشان می‌دهد — تکیه‌گاه مطمئن */
:root {
  --font-ui: "Vazirmatn", "VazirmatnLocal", "Vazir", Tahoma,
             "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.mono, code, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ shell */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: none;
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.4rem 1.25rem;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 34px; height: 34px; flex: none;
  border-radius: 9px;
  background: var(--brand);
  color: var(--brand-ink);
  display: grid; place-items: center;
  font-weight: 800; font-size: .95rem;
}

.nav { padding: .9rem .75rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .62rem .8rem;
  border-radius: var(--radius);
  color: var(--ink-2);
  font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--brand); color: var(--brand-ink); }
.nav a.on:hover { background: var(--brand-hover); }
.nav .ico { width: 18px; text-align: center; flex: none; }

.side-foot { border-top: 1px solid var(--line); padding: 1rem 1.1rem; }

.credit-box {
  background: var(--brand-soft);
  border-radius: var(--radius);
  padding: .7rem .9rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
  margin-bottom: .7rem;
}
.credit-box .label { font-size: .78rem; color: var(--ink-2); }
.credit-box .value { font-size: 1.35rem; font-weight: 800; color: var(--brand); }
.credit-box.gift { background: var(--gift-soft); }
.credit-box.gift .value { color: var(--gift); font-size: 1.1rem; }

.whoami { font-size: .8rem; color: var(--ink-3); overflow: hidden; }
.whoami b { display: block; color: var(--ink); font-size: .87rem; font-weight: 600; }
.whoami span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 62px; flex: none;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 1.12rem; font-weight: 700; margin: 0; }

.topbar-actions { display: flex; align-items: center; gap: .5rem; }

.content { padding: clamp(1.1rem, 3vw, 2rem); max-width: 1200px; width: 100%; }

/* ------------------------------------------------------------ cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.1rem, 2.5vw, 1.6rem);
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
}
.card h2 { margin: 0 0 .25rem; font-size: 1.05rem; font-weight: 700; }
.card .sub { color: var(--ink-2); font-size: .9rem; margin: 0 0 1.2rem; }
.card h3 {
  margin: 1.6rem 0 .7rem; font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
}
.card h3:first-child { margin-top: 0; }

.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ------------------------------------------------------------ stats */

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.stat .k { font-size: .78rem; color: var(--ink-3); letter-spacing: .03em; }
.stat .v { font-size: 1.7rem; font-weight: 800; line-height: 1.3; }
.stat .v.small { font-size: 1.15rem; }
.stat.brand { border-color: var(--brand); }
.stat.brand .v { color: var(--brand); }
.stat.warn { border-color: var(--warn); background: var(--warn-soft); }
.stat.warn .v { color: var(--warn); }

/* ------------------------------------------------------------ services */

.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; }
.svc { position: relative; }
.svc input { position: absolute; opacity: 0; pointer-events: none; }
.svc label {
  display: block; cursor: pointer; height: 100%;
  border: 2px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem;
  background: var(--surface);
  transition: border-color .15s, background .15s, transform .1s;
}
.svc label:hover { border-color: var(--brand); }
.svc label:active { transform: scale(.995); }
.svc input:checked + label { border-color: var(--brand); background: var(--brand-soft); }
.svc input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.svc .n { font-weight: 700; font-size: 1rem; display: block; }
.svc .d { color: var(--ink-2); font-size: .84rem; display: block; margin-top: .1rem; }
.svc .p {
  display: inline-block; margin-top: .7rem;
  background: var(--surface-2); color: var(--ink);
  border-radius: 99px; padding: .17rem .7rem;
  font-size: .82rem; font-weight: 700;
}
.svc input:checked + label .p { background: var(--brand); color: var(--brand-ink); }
.svc .bonus {
  display: block; margin-top: .45rem; font-size: .8rem;
  color: var(--gift); font-weight: 600;
}

/* ------------------------------------------------------------ dropzone */

.drop {
  display: block;              /* label به‌طور پیش‌فرض inline است و حاشیه‌اش تکه‌تکه می‌شود */
  border: 2px dashed var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 2.4rem 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .big { font-size: 1.05rem; font-weight: 700; }
.drop .small { color: var(--ink-2); font-size: .88rem; }
.drop .rules { color: var(--ink-3); font-size: .8rem; margin-top: .8rem; }
.drop .icon { font-size: 2rem; line-height: 1; margin-bottom: .5rem; }
.drop input[type=file] { display: none; }
.drop .chosen { display: none; font-weight: 700; color: var(--brand); margin-top: .6rem; }
.drop.has .chosen { display: block; }

/* ------------------------------------------------------------ forms */

label.field { display: block; margin-bottom: 1rem; }
label.field > .lab {
  display: block; font-size: .85rem; font-weight: 600;
  margin-bottom: .35rem; color: var(--ink-2);
}
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: .62rem .8rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
input::placeholder { color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--brand); color: var(--brand-ink);
  font: inherit; font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--brand-hover); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: .32rem .7rem; font-size: .82rem; font-weight: 600; }
.btn.danger { background: var(--danger); color: #fff; }

.inline-form { display: inline-flex; gap: .3rem; align-items: center; }
.inline-form input[type=number] { width: 74px; padding: .3rem .45rem; }

/* ------------------------------------------------------------ alerts */

.alert {
  border-radius: var(--radius);
  padding: .8rem 1rem;
  margin-bottom: 1.1rem;
  border-inline-start: 3px solid;
  font-size: .92rem;
}
.alert.ok   { background: var(--ok-soft);     border-color: var(--ok);     color: var(--ok); }
.alert.err  { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.alert.warn { background: var(--warn-soft);   border-color: var(--warn);   color: var(--warn); }
.alert.info { background: var(--brand-soft);  border-color: var(--brand);  color: var(--brand); }
.alert b { font-weight: 700; }

/* ------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 820px; }
/* ستون عنوان جا داشته باشد تا نام فایل سه‌خطی نشود،
   و ستون دانلود جا داشته باشد تا دکمه‌ها از لبه بیرون نزنند
   (اگر جمع ستون‌ها از عرض صفحه بیشتر شود، .table-wrap افقی اسکرول می‌شود) */
table th:first-child, table td:first-child { min-width: 190px; }
table th:last-child, table td:last-child { min-width: 205px; }
td .actions { display: flex; gap: .35rem; flex-wrap: nowrap; justify-content: flex-start; }
thead th {
  text-align: start; padding: .7rem .9rem;
  font-size: .73rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); font-weight: 700;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
  white-space: nowrap;
}
tbody td { padding: .72rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td.nowrap, th.nowrap { white-space: nowrap; }

.empty { padding: 3.4rem 1rem; text-align: center; color: var(--ink-2); }
.empty .icon { font-size: 2.2rem; }
.empty .big { font-weight: 700; color: var(--ink); margin-top: .4rem; }

/* ------------------------------------------------------------ badges */

.badge {
  display: inline-block; padding: .16rem .6rem;
  border-radius: 99px; font-size: .78rem; font-weight: 700;
  white-space: nowrap;
}
.badge.grey  { background: var(--surface-2); color: var(--ink-2); }
.badge.ok    { background: var(--ok-soft);    color: var(--ok); }
.badge.run   { background: var(--brand-soft); color: var(--brand); }
.badge.err   { background: var(--danger-soft);color: var(--danger); }
.badge.warn  { background: var(--warn-soft);  color: var(--warn); }
.badge.gift  { background: var(--gift-soft);  color: var(--gift); }

.score { font-weight: 800; }
.score.low  { color: var(--ok); }
.score.mid  { color: var(--warn); }
.score.high { color: var(--danger); }

/* ------------------------------------------------------------ misc */

.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input[type=text] { flex: 1; min-width: 200px; }
.filters select { width: auto; min-width: 130px; }

.pager { display: flex; gap: .4rem; justify-content: center; margin-top: 1.2rem; flex-wrap: wrap; }
.pager a, .pager span {
  padding: .3rem .7rem; border-radius: var(--radius);
  border: 1px solid var(--line-2); color: var(--ink-2); font-size: .85rem;
}
.pager span.now { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.auth-wrap {
  min-height: 100vh; display: grid; place-items: center;
  padding: 1.5rem; background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 2rem 1.7rem;
  box-shadow: var(--shadow-lg);
}
.auth-card .logo { display: flex; align-items: center; gap: .6rem; justify-content: center; margin-bottom: 1.3rem; font-weight: 800; }
.auth-card h1 { font-size: 1.3rem; margin: 0 0 .3rem; text-align: center; }
.auth-card .sub { color: var(--ink-2); font-size: .9rem; text-align: center; margin: 0 0 1.5rem; }
.auth-foot { text-align: center; margin-top: 1.2rem; font-size: .9rem; color: var(--ink-2); }
.auth-lang { text-align: center; margin-top: 1rem; font-size: .85rem; }

.code-input {
  text-align: center; font-size: 1.3rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  padding: .8rem !important;
}

.hint { color: var(--ink-3); font-size: .82rem; margin-top: .35rem; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.2rem; font-size: .92rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; }

.menu-toggle { display: none; }

/* ------------------------------------------------------------ mobile */

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    border-inline-end: none; border-bottom: 1px solid var(--line);
  }
  .nav { flex-direction: row; overflow-x: auto; padding: .5rem; gap: .3rem; }
  .nav a { white-space: nowrap; padding: .5rem .75rem; font-size: .9rem; }
  .nav .ico { display: none; }
  .side-foot { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; }
  .credit-box { margin-bottom: 0; flex: 1; padding: .45rem .7rem; }
  .credit-box .value { font-size: 1.05rem; }
  .whoami { display: none; }
  .topbar { height: 54px; }
  .topbar h1 { font-size: 1rem; }
  table { min-width: 560px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   صفحه‌های عمومی (لندینگ، تعرفه، سؤالات متداول) — بخش سئو
   ============================================================ */

.pub-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.pub-wrap {
  max-width: 1100px; margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: flex; align-items: center; gap: 1.2rem;
  min-height: 64px;
}
.pub-wrap.narrow { max-width: 780px; }
.pub-nav .brand { padding: 0; border: none; flex: none; }
.pub-links { display: flex; gap: 1.1rem; flex: 1; flex-wrap: wrap; }
.pub-links a { color: var(--ink-2); font-weight: 500; font-size: .93rem; }
.pub-links a:hover { color: var(--brand); text-decoration: none; }
.pub-actions { display: flex; gap: .5rem; align-items: center; flex: none; }

.pub-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 3rem;
  color: var(--ink-3); font-size: .88rem;
}
.pub-foot .pub-wrap { min-height: 72px; }

main > section { display: block; }

.hero {
  background: linear-gradient(180deg, var(--brand-soft), var(--bg));
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem);
}
.hero-in { flex-direction: column; align-items: center; text-align: center; }
.hero h1 {
  font-size: clamp(1.75rem, 5vw, 3.1rem);
  font-weight: 800; line-height: 1.25;
  letter-spacing: -.02em; text-wrap: balance;
  margin: 0 0 1rem; max-width: 20ch;
}
.lead {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--ink-2); max-width: 60ch; margin: 0 auto 1.6rem;
  line-height: 1.85;
}
.hero-btns { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; }
.btn.big { padding: .8rem 1.7rem; font-size: 1rem; }
.hero-note { color: var(--ink-3); font-size: .85rem; margin-top: 1rem; }

.sample {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 1.3rem 1.5rem; margin-top: 2.5rem;
  width: 100%; max-width: 460px;
  display: flex; flex-direction: column; gap: .9rem;
}
.sample-row { display: flex; align-items: center; gap: .8rem; }
.sample-k { font-size: .85rem; color: var(--ink-2); flex: none; min-width: 6.5rem; text-align: start; }
.bar { flex: 1; height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.bar.ai i { background: var(--warn); }
.sample-v { flex: none; min-width: 3rem; text-align: end; }

.band { padding: clamp(2.2rem, 5vw, 3.5rem) 0; }
.band.alt { background: var(--surface); border-block: 1px solid var(--line); }
.band .pub-wrap { flex-direction: column; align-items: stretch; }
.band h1, .band h2 {
  font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 800;
  margin: 0 0 .6rem; text-wrap: balance;
}
.band.cta { text-align: center; background: var(--brand-soft); }
.band.cta .pub-wrap { align-items: center; }

.cards4, .cards3 {
  display: grid; gap: 1rem; margin-top: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.feat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.3rem;
}
.band.alt .feat { background: var(--bg); }
.feat .ic { font-size: 1.6rem; line-height: 1; margin-bottom: .6rem; }
.feat h3 { font-size: 1rem; margin: 0 0 .35rem; font-weight: 700; }
.feat p { color: var(--ink-2); font-size: .91rem; margin: 0; }

.steps { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 1rem;
         grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { display: flex; gap: .9rem; align-items: flex-start; }
.steps .n {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
}
.steps h3 { font-size: 1rem; margin: .2rem 0 .3rem; }
.steps p { color: var(--ink-2); font-size: .91rem; margin: 0; }

/* ------------------------------------------------------------ plans */

.plans {
  display: grid; gap: 1rem; margin-top: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.plan {
  position: relative; background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.5rem 1.2rem 1.2rem; text-align: center;
}
.band.alt .plan { background: var(--bg); }
.plan.hot { border-color: var(--brand); }
.plan h3 { font-size: 1rem; margin: 0 0 .5rem; font-weight: 700; }
.plan .pc { color: var(--ink-2); font-size: .9rem; }
.plan .pp { font-size: 1.5rem; font-weight: 800; margin: .5rem 0 1rem; color: var(--brand); }
.plan .pp small { font-size: .75rem; font-weight: 500; color: var(--ink-3); }
.ribbon {
  position: absolute; top: -11px; inset-inline-start: 50%;
  transform: translateX(50%);
  background: var(--brand); color: var(--brand-ink);
  font-size: .72rem; font-weight: 700;
  padding: .12rem .7rem; border-radius: 99px; white-space: nowrap;
}
[dir="ltr"] .ribbon { transform: translateX(-50%); }

.plans.in-app .plan.pick { padding: 0; border: none; text-align: start; }
.plan.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick-body {
  display: block; position: relative; cursor: pointer; height: 100%;
  border: 2px solid var(--line-2); border-radius: var(--radius-lg);
  padding: 1.4rem 1.1rem 1.1rem; background: var(--surface);
  transition: border-color .15s, background .15s;
}
.plan.pick:hover .pick-body { border-color: var(--brand); }
.plan.pick input:checked + .pick-body { border-color: var(--brand); background: var(--brand-soft); }
.pick-body .pt { display: block; font-weight: 700; }
.pick-body .pc { display: block; color: var(--ink-2); font-size: .86rem; }
.pick-body .pp { display: block; font-size: 1.25rem; font-weight: 800; color: var(--brand); margin-top: .4rem; }

.pricing-note {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.3rem 1.5rem; margin-top: 2rem;
}
.pricing-note h3 { margin: 0 0 .5rem; font-size: 1rem; }
.pricing-note p { color: var(--ink-2); margin: 0 0 .8rem; }

/* ------------------------------------------------------------ faq */

.faq { margin-top: 1.6rem; display: flex; flex-direction: column; gap: .6rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1.2rem;
}
.faq summary {
  cursor: pointer; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.3rem; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--ink-2); margin: .7rem 0 0; }

/* ------------------------------------------------------------ payment */

.paybox { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.2rem; align-items: baseline; }
.pay-k { color: var(--ink-3); font-size: .85rem; }
.pay-v { font-weight: 600; }
.pay-v.big { font-size: 1.35rem; font-weight: 800; color: var(--brand); }
.pay-v.break { word-break: break-all; font-size: .85rem; }
.selectable { user-select: all; background: var(--surface-2); padding: .2rem .5rem; border-radius: 4px; }

textarea { resize: vertical; min-height: 90px; font-family: inherit; }

/* ------------------------------------------------------------ tickets */

.tlist { display: flex; flex-direction: column; gap: .5rem; }
.titem {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem .9rem; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); flex-wrap: wrap;
}
.titem:hover { border-color: var(--brand); text-decoration: none; background: var(--surface-2); }
.tsub { font-weight: 600; }
.tmeta { display: flex; gap: .5rem; align-items: center; color: var(--ink-3); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
       background: var(--danger); margin-inline-start: .35rem; }

.chat { display: flex; flex-direction: column; gap: .8rem; margin-top: 1.3rem; }
.bubble { max-width: 78%; padding: .7rem 1rem; border-radius: var(--radius-lg); }
.bubble.me { align-self: flex-start; background: var(--surface-2); }
.bubble.admin { align-self: flex-end; background: var(--brand-soft); }
.bubble .who { font-size: .76rem; color: var(--ink-3); font-weight: 700; margin-bottom: .2rem; }
.bubble .body { white-space: pre-wrap; word-break: break-word; }
.bubble .when { font-size: .72rem; color: var(--ink-3); margin-top: .3rem; }

/* ------------------------------------------------------------ google */

.or { display: flex; align-items: center; gap: .8rem; margin: 1.1rem 0; color: var(--ink-3); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gbtn { gap: .6rem; }
.gbtn svg { flex: none; }

@media (max-width: 760px) {
  .pub-wrap { flex-wrap: wrap; padding-block: .7rem; gap: .7rem; }
  .pub-links { order: 3; width: 100%; justify-content: center; gap: .9rem; }
  .bubble { max-width: 92%; }
  .paybox { grid-template-columns: 1fr; gap: .2rem; }
  .pay-k { margin-top: .6rem; }
}

/* ------------------------------------------------- نشانگر پیام خوانده‌نشده */
.pill {
  display: inline-block;
  min-width: 1.25rem;
  padding: 0 .35rem;
  margin-inline-start: .35rem;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.btn.ghost .pill { background: var(--danger); }

/* دکمه‌های کنار هم در جدول کدها و در سربرگ کارت */
.card > .actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
td .actions .btn { white-space: nowrap; }

/* خود کد همیشه چپ‌به‌راست خوانده شود، حتی داخل صفحهٔ فارسی */
.codecell { unicode-bidi: isolate; }
