@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --line: #e4e8f1;
  --text: #141a2b;
  --muted: #5d6680;
  --faint: #8d95ab;
  --accent: #2f5bea;
  --accent-ink: #ffffff;
  --accent-soft: #e9eefe;
  --ok: #138a4b;
  --ok-soft: #e3f5ea;
  --warn: #a86400;
  --warn-soft: #fff2dc;
  --bad: #c22d3a;
  --bad-soft: #fde8ea;
  --tg: #229ed9;
  --bale: #11a37f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 26, 43, .05), 0 4px 16px rgba(20, 26, 43, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1320; --surface: #171c2c; --surface-2: #1d2336; --line: #2a3149;
    --text: #e9ecf5; --muted: #a3abc4; --faint: #77809a;
    --accent: #6b8cff; --accent-ink: #0d1430; --accent-soft: #222c50;
    --ok: #4fd18b; --ok-soft: #173326; --warn: #f2b45a; --warn-soft: #3a2c14; --bad: #ff7a85; --bad-soft: #3d1a20;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Vazirmatn, Tahoma, sans-serif; background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.75; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
code, .mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: isolate; }
h1, h2, h3 { line-height: 1.4; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── نوار بالا ── */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px max(16px, calc((100vw - 1120px) / 2)); background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand b { display: block; font-size: 17px; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: -4px; }
.logo svg { width: 36px; height: 36px; display: block; fill: var(--accent); }
.conn { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.chip.ok i { background: var(--ok); } .chip.bad i { background: var(--bad); }
.chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 16px 80px; }

/* ── عناصر پایه ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: progress; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }

label.f { display: block; }
label.f > span { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.8; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.input.ltr { direction: ltr; text-align: left; }
.hint { font-size: 13px; color: var(--faint); margin-top: 6px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.off { background: var(--surface-2); color: var(--faint); }
.plat { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 6px; color: #fff; }
.plat.telegram { background: var(--tg); } .plat.bale { background: var(--bale); }

/* ── صفحه اصلی ── */
.hero { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.hero h1 { font-size: 26px; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.botcard { display: block; color: var(--text); padding: 18px; transition: border-color .15s, transform .15s; }
.botcard:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
.botcard h3 { font-size: 17px; }
.botcard .user { color: var(--muted); font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.kpi { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.kpi b { display: block; font-size: 18px; }
.kpi span { font-size: 12px; color: var(--muted); }
.empty { text-align: center; padding: 56px 20px; }
.empty .big { font-size: 44px; }
.empty h2 { font-size: 20px; margin: 8px 0; }

/* ── ساخت ربات ── */
.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.steps span { padding: 4px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.steps span.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.choice {
  text-align: right; padding: 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice b { display: block; font-size: 15.5px; margin-bottom: 4px; }
.choice small { color: var(--muted); font-size: 13px; line-height: 1.7; display: block; }
.howto { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; font-size: 14px; }
.howto ol { margin: 6px 0 0; padding-inline-start: 20px; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.err ul { margin: 6px 0 0; padding-inline-start: 20px; }

/* ── جزئیات ربات ── */
.bothead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.bothead h1 { font-size: 22px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a .n { display: inline-block; min-width: 20px; padding: 0 6px; margin-inline-start: 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; text-align: center; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { padding: 16px; }
.tile b { display: block; font-size: 26px; line-height: 1.3; }
.tile span { color: var(--muted); font-size: 13px; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
.codebox { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; }
.codebox code { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.bars .bar { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; margin: 6px 0; }
.bars .track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--accent); border-radius: 99px; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: right; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }
.answers { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.answers li span { color: var(--muted); }

/* ── ویرایشگر صفحه‌ها ── */
.pagecard { padding: 16px; }
.pagecard + .pagecard { margin-top: 12px; }
.pagecard .ph { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ptype { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .fields2 { grid-template-columns: 1fr; } }
textarea.code { font-family: ui-monospace, Consolas, monospace; direction: ltr; text-align: left; min-height: 420px; font-size: 13px; line-height: 1.6; }

/* پیش‌نمایش گوشی */
.phone { position: sticky; top: 84px; background: #dfe7ee; border-radius: 22px; padding: 14px; border: 6px solid #20263a; }
@media (prefers-color-scheme: dark) { .phone { background: #0e1621; } }
.bubble { background: #fff; color: #141a2b; border-radius: 14px 14px 4px 14px; padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
@media (prefers-color-scheme: dark) { .bubble { background: #182533; color: #e9ecf5; } }
.kbd { display: grid; gap: 4px; margin-top: 4px; }
.kbd div { display: grid; gap: 4px; }
.kbd span { background: rgba(70, 92, 120, .55); color: #fff; text-align: center; border-radius: 8px; padding: 7px 6px; font-size: 12.5px; }
.phone .cap { text-align: center; font-size: 12px; color: #5d6680; margin-bottom: 8px; }

/* اعلان */
#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px; transition: .2s; z-index: 20; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 560px) {
  .topbar .brand small { display: none; }
  .hero h1 { font-size: 22px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}

/* ═════════ ویرایشگر پیشرفته ═════════ */
.h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.ed { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); align-items: stretch; }
.f em { font-style: normal; font-size: 12px; }

/* انتخاب‌گر قطعه‌ای */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg > button {
  text-align: right; padding: 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer;
  display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  transition: border-color .15s, background .15s;
}
.seg > button b { font-size: 14.5px; } .seg > button small { grid-column: 2; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.seg > button .ill { grid-row: span 2; }
.seg > button.on { border-color: var(--accent); background: var(--accent-soft); }
.seg.mini { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg.mini > button { display: block; padding: 0 16px; min-height: 38px; border: 0; border-radius: 0; background: var(--surface-2); text-align: center; font-weight: 500; }
.seg.mini > button + button { border-inline-start: 1px solid var(--line); }
.seg.mini > button.on { background: var(--accent); color: var(--accent-ink); }
.ill { width: 64px; height: 52px; border-radius: 8px; background: #cfdbe6; position: relative; display: grid; gap: 3px; padding: 6px; }
.ill i { display: block; border-radius: 3px; background: rgba(70, 92, 120, .6); }
.ill-inline { grid-template-columns: 1fr 1fr; align-content: start; padding-top: 22px; }
.ill-inline::before { content: ''; position: absolute; top: 6px; right: 6px; left: 14px; height: 12px; border-radius: 4px; background: #fff; }
.ill-inline i { height: 8px; }
.ill-reply { grid-template-columns: 1fr 1fr; align-content: end; background: linear-gradient(#cfdbe6 45%, #f2f5f8 45%); }
.ill-reply i { height: 9px; background: #fff; box-shadow: 0 0 0 1px #d5dde6 inset; }

/* رنگ دکمه */
.swatches { display: inline-flex; gap: 6px; align-items: center; min-height: 42px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; transition: transform .1s, box-shadow .1s; }
.sw:hover { transform: scale(1.1); }
.sw.on { box-shadow: 0 0 0 2px var(--accent); }
.sw-def { background: linear-gradient(135deg, #9fb0c3, #6f8399); }
.sw-primary { background: #3e88f7; } .sw-success { background: #2fb45a; } .sw-danger { background: #e5484d; }

/* نوار قالب‌بندی */
.tb { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface); width: fit-content; }
.tb + textarea.input { border-top-right-radius: 0; }
.tb button { min-width: 30px; height: 28px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--muted); }
.tb button:hover { background: var(--accent-soft); color: var(--accent); }

/* عکس */
.photo { display: flex; gap: 12px; align-items: center; }
.thumb { width: 84px; height: 64px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; font-size: 22px; flex: none; }
.thumb span { font-size: 11.5px; color: var(--faint); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
label.btn.busy, .busy { opacity: .6; pointer-events: none; }

/* کارت صفحه */
.pagecard { padding: 0; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.pagecard + .pagecard { margin-top: 10px; }
.pagecard.open { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pagecard.off .ptitle .t { color: var(--faint); }
.pagecard .ph { display: flex; align-items: center; gap: 6px; padding: 8px 10px; margin: 0; }
.pagecard .mv { display: flex; flex-direction: column; }
.pagecard .mv .btn { min-height: 20px; height: 20px; padding: 0 8px; font-size: 10px; }
.ptitle { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; cursor: pointer; text-align: right; padding: 8px 4px; min-width: 0; }
.ptitle .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptitle .ptype { margin-inline-start: auto; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.pbody { padding: 4px 16px 16px; border-top: 1px solid var(--line); padding-top: 16px; }

/* سوییچ */
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--muted); white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 34px; height: 20px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(-14px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch.sm { min-height: 42px; }

/* زیربخش‌ها */
.sub { background: var(--surface-2); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.subh { font-size: 13px; font-weight: 500; color: var(--muted); }
.rowedit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rowedit .input { flex: 1; min-width: 140px; background: var(--surface); }
.rowcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.rowcard textarea.input { background: var(--surface-2); }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chipbox { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; cursor: pointer; }
.chipbox:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ایموجی */
.withemoji { position: relative; }
.withemoji .input { padding-inline-start: 44px; }
.emo { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 18px; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.emo:hover { background: var(--accent-soft); }
.emoji-pop { position: absolute; z-index: 30; width: 280px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.emoji-pop[hidden] { display: none; }
.emoji-pop button { border: 0; background: transparent; font-size: 19px; height: 32px; border-radius: 6px; cursor: pointer; }
.emoji-pop button:hover { background: var(--accent-soft); }

.savebar { position: sticky; bottom: 12px; margin-top: 16px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; z-index: 4; }

/* پیش‌نمایش شبیه تلگرام */
.phone-wrap { position: sticky; top: 84px; }
.phone2 { border-radius: 26px; overflow: hidden; border: 7px solid #1d2233; background: #cfdbe6; display: flex; flex-direction: column; min-height: 560px; box-shadow: var(--shadow); color: #141a2b; font-size: 13.5px; }
.ph-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border-bottom: 1px solid #e3e8ee; }
.ph-top .av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #6b8cff, #2f5bea); color: #fff; display: grid; place-items: center; font-weight: 700; }
.ph-top b { display: block; font-size: 14px; line-height: 1.3; } .ph-top small { color: #3e88f7; font-size: 12px; }
.pv-home { margin-inline-start: auto; border: 0; background: #eef3ff; color: #2f5bea; border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.ph-chat { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  background-color: #cfdbe6; background-image: radial-gradient(rgba(255,255,255,.35) 1px, transparent 1px); background-size: 14px 14px; }
.msg { background: #fff; border-radius: 14px 14px 4px 14px; overflow: hidden; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.08); align-self: flex-start; }
.pimg { height: 150px; background: #e7edf3; display: grid; place-items: center; font-size: 30px; }
.pimg img { width: 100%; height: 100%; object-fit: cover; }
.mtext { padding: 8px 12px 10px; white-space: pre-wrap; line-height: 1.75; }
.mtext blockquote { margin: 4px 0; padding: 2px 10px; border-right: 3px solid #3e88f7; background: #eef4fe; border-radius: 4px; }
.mtext .lnk { color: #2f7bd8; }
.spoiler { background: #9aa6b4; color: transparent; border-radius: 3px; }
.ph-chat .kbd { max-width: 92%; align-self: flex-start; width: 92%; }
.kbd .k { position: relative; background: rgba(60, 82, 110, .5); color: #fff; text-align: center; border-radius: 8px; padding: 7px 8px; font-size: 12.5px; backdrop-filter: blur(4px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kbd .k em { position: absolute; top: 1px; left: 4px; font-style: normal; font-size: 10px; opacity: .8; }
.kbd .k-primary { background: #3e88f7; } .kbd .k-success { background: #2fb45a; } .kbd .k-danger { background: #e5484d; }
.ph-reply { background: #f2f4f7; padding: 6px; border-top: 1px solid #dfe4ea; }
.kbd.rk .k { background: #fff; color: #141a2b; box-shadow: 0 1px 0 #d5dbe2; padding: 9px 6px; }
.kbd.rk .k-primary { background: #3e88f7; color: #fff; } .kbd.rk .k-success { background: #2fb45a; color: #fff; } .kbd.rk .k-danger { background: #e5484d; color: #fff; }
.ph-input { background: #fff; padding: 10px 14px; color: #9aa3b2; border-top: 1px solid #e3e8ee; font-size: 13px; }

/* کارت محصول */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.prod { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.prod.off { opacity: .55; }
.pthumb { width: 92px; height: 92px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; cursor: pointer; flex: none; transition: border-color .15s; }
.pthumb:hover { border-color: var(--accent); }
.pthumb span { font-size: 12px; color: var(--faint); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pinfo { min-width: 0; flex: 1; }
.pinfo b { display: block; line-height: 1.5; }
.price { color: var(--ok); font-weight: 500; font-size: 14px; }

@media (max-width: 860px) {
  .ed { grid-template-columns: minmax(0, 1fr); }
  .two { grid-template-columns: minmax(0, 1fr); }
  .switch span { display: none; }
  .pagecard .ph { gap: 2px; }
  .phone-wrap { position: static; }
  .seg { grid-template-columns: 1fr; }
}

/* ═════════ حساب، ورود، اشتراک، مدیریت ═════════ */
[hidden] { display: none !important; }
.topbar { justify-content: flex-start; }
.acctbtn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 6px 4px 12px; cursor: pointer; }
.acctbtn .nm { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14px; }
.av2 { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #6b8cff, #2f5bea); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.menu { position: relative; }
.dd { position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 20; display: grid; }
.dd a, .dd button { text-align: right; padding: 9px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; cursor: pointer; font-size: 14px; }
.dd a:hover, .dd button:hover { background: var(--surface-2); }
.ddh { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }
.impbar { background: var(--warn-soft); color: var(--warn); padding: 8px max(16px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }

.auth { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.authcard { width: min(420px, 100%); padding: 28px; }
.authh { font-size: 22px; }
.authlogo svg { width: 52px; height: 52px; fill: var(--accent); display: block; }
.input.big, .btn.big { min-height: 50px; font-size: 16px; }
.otp { text-align: center; font-size: 28px; letter-spacing: 12px; min-height: 60px; }
.devcode { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.okbox { background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-size: 14px; }

.planstrip { display: flex; align-items: center; gap: 20px; padding: 14px 18px; margin-bottom: 20px; flex-wrap: wrap; }
.planstrip.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.ps-main { display: grid; min-width: 120px; }
.ps-main b { font-size: 18px; }
.wtxt { color: var(--warn); font-weight: 500; }
.ps-meter { flex: 1; min-width: 160px; display: grid; gap: 6px; }
.ps-meter .track { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.ps-meter .fill { height: 100%; background: var(--accent); border-radius: 99px; }

.periods { margin: 0 0 16px; }
.seg.mini > a { display: grid; place-items: center; padding: 0 16px; min-height: 38px; background: var(--surface-2); color: var(--text); font-weight: 500; font-size: 14px; }
.seg.mini > a + a { border-inline-start: 1px solid var(--line); }
.seg.mini > a.on { background: var(--accent); color: var(--accent-ink); }
.seg.mini em { font-style: normal; font-size: 11.5px; opacity: .85; margin-inline-start: 4px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.plan { padding: 22px 20px; position: relative; display: flex; flex-direction: column; gap: 6px; }
.plan h3 { font-size: 19px; }
.plan.pop { border: 2px solid var(--accent); }
.plan.cur { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.ribbon { position: absolute; top: -12px; left: 16px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 99px; }
.plan .price { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.plan .price b { font-size: 28px; line-height: 1.2; }
.plan .price span { color: var(--muted); font-size: 13px; }
.feat { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; gap: 6px; font-size: 14px; flex: 1; }
.feat li::before { content: '✓'; color: var(--ok); font-weight: 700; margin-inline-end: 8px; }
.feat li.no { color: var(--faint); }
.feat li.no::before { content: '—'; color: var(--faint); }
.btn.wide { width: 100%; }
.checkout { margin-top: 18px; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.total { font-size: 20px; color: var(--accent); }
.paymethods { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.pm { background: var(--surface-2); border-radius: 12px; padding: 16px; }
.pm > b { font-size: 16px; }
.cardbox { background: linear-gradient(135deg, #20283f, #34406a); color: #fff; border-radius: 14px; padding: 16px; display: grid; gap: 6px; }
.cardbox .cnum { font-size: 19px; letter-spacing: 2px; direction: ltr; text-align: left; }
.cardbox .btn { justify-self: start; background: rgba(255,255,255,.15); color: #fff; border-color: transparent; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv span { color: var(--muted); }
.rowlink { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); flex-wrap: wrap; }
.rowlink:hover { background: var(--surface-2); }
.integs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.integ { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 12px; }
.dotx { width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; flex: none; }
.integ.ok .dotx { background: var(--ok); } .integ.no .dotx { background: var(--warn); }
.tile small { display: block; margin-top: 4px; font-size: 12px; }
.planedit td { padding: 8px 6px; vertical-align: top; }
.planedit .input { min-height: 36px; padding: 4px 8px; }

@media (max-width: 560px) {
  .acctbtn .nm { display: none; }
  .planstrip { gap: 12px; }
}

.plan .price { color: var(--text); font-weight: 400; }
.plan .price b { font-weight: 700; }

.pat { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; unicode-bidi: plaintext; }
.authcard form .btn.big { width: 100%; }

.lkmeta { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.lkmeta b { color: var(--text); }

/* آپلودر فایل */
.drop { display: grid; gap: 4px; place-items: center; text-align: center; padding: 28px 16px; border: 2px dashed var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.pack { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.pack.off { opacity: .6; }
.ptitle-in { flex: 1; font-weight: 500; }
.pitems { display: flex; flex-wrap: wrap; gap: 6px; }
.pitems span { background: var(--surface-2); border-radius: 8px; padding: 3px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.pitems em { font-style: normal; color: var(--faint); font-size: 12px; }
.pitems .x { border: 0; background: none; color: var(--bad); cursor: pointer; padding: 0 2px; }

/* نوبت‌ها */
.bkday { padding: 14px 16px; }
.bkday.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.bkday .t td { vertical-align: middle; }
tr.dim td { opacity: .55; }
.checkout .coupon { gap: 8px; flex-wrap: wrap; }
.checkout s { margin-left: 8px; }
.branch { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; background: var(--surface); }
.small.bad { color: var(--bad); }
