/* Telegram Ads Manager — Global & Standalone Stylesheet */
:host,
#tgads-root,
.tgads-standalone-root {
  display: block;
  width: 100%;
  min-height: 100vh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.tgads-app {
  --font: "Vazirmatn", "IRANSans", "Segoe UI", Tahoma, system-ui, sans-serif;
  --bg: #eef2f6;
  --surf: #ffffff;
  --surf2: #f4f7fa;
  --ink: #0e1a2b;
  --mut: #5a6b80;
  --line: #d9e1ea;
  --acc: #1b8ad8;
  --acc-ink: #ffffff;
  --acc-soft: #e3f1fc;
  --ok: #17935b;
  --warn: #b86e00;
  --bad: #cf3a3a;
  --bub: #ffffff;
  --wall1: #cfe6d3;
  --wall2: #b8d6ea;
  --r: 14px;
  --sh: 0 1px 2px rgba(14, 26, 43, .06), 0 6px 20px -10px rgba(14, 26, 43, .18);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tgads-app[data-theme="dark"] {
  --bg: #0e1621;
  --surf: #17212b;
  --surf2: #1d2a37;
  --ink: #e6edf4;
  --mut: #8fa3b8;
  --line: #263646;
  --acc: #4db2f5;
  --acc-ink: #06121d;
  --acc-soft: #173046;
  --ok: #3fc58a;
  --warn: #e0a03a;
  --bad: #ef6a6a;
  --bub: #182533;
  --wall1: #14261f;
  --wall2: #11202e;
  --sh: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  .tgads-app[data-theme="auto"] {
    --bg: #0e1621;
    --surf: #17212b;
    --surf2: #1d2a37;
    --ink: #e6edf4;
    --mut: #8fa3b8;
    --line: #263646;
    --acc: #4db2f5;
    --acc-ink: #06121d;
    --acc-soft: #173046;
    --ok: #3fc58a;
    --warn: #e0a03a;
    --bad: #ef6a6a;
    --bub: #182533;
    --wall1: #14261f;
    --wall2: #11202e;
    --sh: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

.tgads-app[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
.tgads-app[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.tgads-app[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.9) brightness(1.2);
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  .tgads-app[data-theme="auto"] input[type="date"]::-webkit-calendar-picker-indicator,
  .tgads-app[data-theme="auto"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
  .tgads-app[data-theme="auto"] input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.9) brightness(1.2);
    cursor: pointer;
  }
}

a {
  color: var(--acc);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

.tgads-app svg:not(.tg-native-chart-svg):not(.tg-subchart-svg):not(.tg-chart-svg):not(.tg-official-verified-badge) {
  width: 1.2em;
  height: 1.2em;
  fill: currentColor;
  flex: none;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.4;
}

small {
  color: var(--mut);
}

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  background: var(--surf);
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px;
  font-size: 16px;
}

.brand small.curr-badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--acc-soft);
  color: var(--acc);
  font-weight: 700;
  margin-top: 2px;
}

.logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--acc);
  color: var(--acc-ink);
  flex: none;
}

.logo svg {
  width: 22px;
  height: 22px;
}

.logo.big {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  margin: 0 auto 16px;
}

.logo.big svg {
  width: 36px;
  height: 36px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 11px;
  color: var(--mut);
  font-weight: 500;
  font-size: 14.5px;
  transition: background .15s, color .15s;
}

.nav a:hover {
  background: var(--surf2);
  text-decoration: none;
  color: var(--ink);
}

.nav a.on {
  background: var(--acc-soft);
  color: var(--acc);
  font-weight: 700;
}

.who {
  margin-top: auto;
  padding: 12px 8px 0;
  color: var(--mut);
  font-size: 13px;
  border-top: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 28px 6px;
}

.top h1 {
  font-size: 22px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-r {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.bal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surf);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--sh);
  transition: border-color .15s;
}

.bal:hover {
  text-decoration: none;
  border-color: var(--acc);
}

.bal svg {
  color: var(--acc);
}

.main {
  padding: 16px 28px 48px;
  flex: 1;
}

/* ---------- controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  min-height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background .15s, border-color .15s, filter .15s;
}

.btn:hover {
  border-color: var(--acc);
  text-decoration: none;
}

.btn.pri {
  background: var(--acc);
  color: var(--acc-ink);
  border-color: var(--acc);
}

.btn.pri:hover {
  filter: brightness(1.08);
}

.btn.sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
}

.btn.wide {
  width: 100%;
  margin-top: 14px;
}

.btn.danger {
  color: var(--bad);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  transition: all .18s ease;
}

.btn.ghost:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-color: color-mix(in srgb, var(--ink) 14%, transparent);
  transform: translateY(-1px);
}

.btn.ghost.warn {
  color: var(--warn, #b86e00);
}

.btn.ghost.warn:hover {
  background: color-mix(in srgb, var(--warn, #b86e00) 14%, transparent);
  border-color: color-mix(in srgb, var(--warn, #b86e00) 28%, transparent);
  color: var(--warn, #b86e00);
  transform: translateY(-1px);
}

.btn.ghost.pri {
  color: var(--acc);
}

.btn.ghost.pri:hover {
  background: var(--acc-soft);
  border-color: color-mix(in srgb, var(--acc) 30%, transparent);
  color: var(--acc);
  transform: translateY(-1px);
}

.btn.ghost.danger {
  color: var(--bad);
}

.btn.ghost.danger:hover {
  background: color-mix(in srgb, var(--bad) 12%, transparent);
  border-color: color-mix(in srgb, var(--bad) 25%, transparent);
  color: var(--bad);
  transform: translateY(-1px);
}

.ad-act-btn {
  transition: all 0.2s ease;
  cursor: pointer;
}
.ad-act-btn:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.btn:disabled {
  opacity: .55;
  cursor: wait;
}

.fld {
  margin: 0 0 18px;
  position: relative;
}

.fld>label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 14px;
}

.hint {
  margin-top: 6px;
  color: var(--mut);
  font-size: 12.5px;
  line-height: 1.6;
}

.in {
  width: 100%;
  min-height: 44px;
  padding: 9px 13px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
  color: var(--ink);
}

select.in {
  cursor: pointer;
}

textarea.in {
  resize: vertical;
  min-height: 104px;
  line-height: 1.7;
}

.in:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
}

.in::placeholder {
  color: var(--mut);
  opacity: .7;
}

.cnt {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--mut);
  text-align: left;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  gap: 3px;
  background: var(--surf2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.seg button {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--mut);
  min-height: 36px;
  transition: background .15s, color .15s;
}

.seg button.on {
  background: var(--surf);
  color: var(--acc);
  box-shadow: var(--sh);
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  min-height: 46px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.chips:focus-within {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
}

.chips.ro {
  background: var(--surf2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 10px;
  border-radius: 8px;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 13.5px;
  direction: ltr;
  font-weight: 600;
}

.chip button {
  border: 0;
  background: transparent;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  line-height: 1;
  color: inherit;
  font-size: 17px;
}

.chip button:hover {
  background: rgba(127, 127, 127, .2);
}

.chip-in {
  flex: 1;
  min-width: 140px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 6px 4px;
  min-height: 32px;
  font-size: 14px;
  color: var(--ink);
}

.sw {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
}

.sw input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.sw i {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--line);
  flex: none;
  transition: background .2s;
}

.sw i::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

.sw input:checked+i {
  background: var(--acc);
}

.sw input:checked+i::after {
  transform: translateX(-18px);
}

.sw input:focus-visible+i {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

.daily,
#schedBox {
  margin-top: 12px;
}

/* ---------- tabs ---------- */
/* ---------- tabs wrap & scroll arrows ---------- */
.tabs-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.tabs-wrap .tabs {
  margin: 0;
  border-bottom: none;
  flex: 1 1 auto;
  overflow-x: auto;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
}

.tabs-wrap .tabs:active {
  cursor: grabbing;
}

.tab-scroll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: all 0.18s ease;
  flex-shrink: 0;
  user-select: none;
  margin-bottom: 4px;
}

.tab-scroll-btn:hover {
  background: var(--surf2);
  border-color: var(--acc);
  color: var(--acc);
  transform: scale(1.08);
}

[data-theme="dark"] .tab-scroll-btn {
  background: #17212b;
  border-color: #263646;
  color: #e6edf4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .tab-scroll-btn:hover {
  background: #1e2c3a;
  border-color: var(--acc);
  color: var(--acc);
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  flex: none;
  border: 0;
  background: transparent;
  padding: 11px 16px;
  font-weight: 600;
  color: var(--mut);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  font-size: 14.5px;
}

.tabs button.on {
  color: var(--acc);
  border-bottom-color: var(--acc);
  font-weight: 700;
}

/* ---------- editor ---------- */
.ed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
  align-items: start;
}

.ed-main {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 24px 10px;
  box-shadow: var(--sh);
  min-width: 0;
}

.ed-side {
  position: sticky;
  top: 16px;
}

.pv-wrap h3 {
  font-size: 14px;
  color: var(--mut);
  margin-bottom: 10px;
  font-weight: 700;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--surf2);
  border-radius: 11px;
  border: 1px solid var(--line);
}

.actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 20px -28px -48px;
  padding: 14px 28px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}

.act-info {
  margin-inline-end: auto;
  font-size: 14px;
  color: var(--mut);
}

.act-info b {
  color: var(--ink);
}

.note {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 11px;
  background: var(--acc-soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

.note.warn {
  background: color-mix(in srgb, var(--warn) 14%, var(--surf));
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  color: var(--ink);
}

/* media */
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 26px 16px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: 13px;
  background: var(--surf2);
  cursor: pointer;
  color: var(--mut);
  transition: border-color .15s, background .15s;
}

.drop:hover {
  border-color: var(--acc);
  background: var(--acc-soft);
}

.drop svg {
  width: 32px;
  height: 32px;
  color: var(--acc);
}

.drop b {
  color: var(--ink);
}

.drop.has {
  cursor: default;
  border-style: solid;
  padding: 10px;
}

.drop.has:hover {
  background: var(--surf2);
  border-color: var(--line);
}

.drop.has.txt {
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
}

.drop.has img,
.drop.has video {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 9px;
  background: #000;
}

.drop.up {
  cursor: progress;
}

.prog {
  width: 100%;
  max-width: 320px;
  height: 8px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.prog i {
  display: block;
  height: 100%;
  background: var(--acc);
  width: 0;
  transition: width .2s;
}

/* budget */
.box {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: var(--surf2);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.box h3 {
  font-size: 15px;
  margin-bottom: 12px;
  font-weight: 700;
}

.pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
}

.pair label {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
  color: var(--mut);
  font-weight: 600;
}

.pair .in {
  text-align: left;
}

.eq {
  padding-bottom: 12px;
  color: var(--mut);
}

.sum {
  margin-top: 12px;
  font-size: 14px;
  display: grid;
  gap: 3px;
}

.sum .bad,
.bad {
  color: var(--bad);
}

.muted {
  color: var(--mut);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 18px;
}

.tiles.four {
  grid-template-columns: repeat(4, 1fr);
}

.tiles.five {
  grid-template-columns: repeat(5, 1fr);
}

.tiles>div {
  padding: 12px 14px;
  background: var(--surf2);
  border: 1px solid var(--line);
  border-radius: 13px;
  display: flex;
  flex-direction: column;
}

.tiles small {
  font-size: 12px;
  color: var(--mut);
}

.tiles b {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

.tiles i {
  font-style: normal;
  font-size: 12px;
  color: var(--mut);
}

.txl>div {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.txl>div:last-child {
  border: 0;
}

.txl em {
  font-style: normal;
  color: var(--mut);
}

/* schedule grid */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gridw {
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.grid {
  display: grid;
  gap: 3px;
  min-width: 640px;
  user-select: none;
}

.g-h,
.g-r {
  display: grid;
  grid-template-columns: 72px repeat(24, minmax(0, 1fr));
  gap: 3px;
  align-items: center;
}

.hh {
  border: 0;
  background: transparent;
  height: 20px;
  font-size: 11px;
  color: var(--mut);
  padding: 0;
}

.dn {
  border: 0;
  background: transparent;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  padding: 0 2px;
  color: var(--ink);
}

.cell {
  display: block;
  height: 28px;
  border-radius: 5px;
  background: var(--surf2);
  border: 1px solid var(--line);
  cursor: pointer;
}

.cell.on {
  background: var(--acc);
  border-color: var(--acc);
}

.cell:hover {
  filter: brightness(.94);
}

/* ---------- Telegram-style preview ---------- */
.tg {
  padding: 18px 14px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--wall1), var(--wall2));
  border: 1px solid var(--line);
}

.bub {
  max-width: 320px;
  margin-inline: auto;
  background: var(--bub);
  border-radius: 14px 14px 14px 4px;
  padding: 6px 6px 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  direction: rtl;
}

.pm {
  margin: 0 0 6px;
  border-radius: 9px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
}

.pm img,
.pm video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ph {
  height: 100%;
  display: grid;
  place-items: center;
  color: #9bb;
}

.ph svg {
  width: 34px;
  height: 34px;
}

.pt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  font-size: 14px;
  line-height: 1.5;
}

.pt b {
  color: var(--acc);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.site-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surf2);
  color: var(--mut);
}

.adtag {
  font-size: 10.5px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--acc-soft);
  color: var(--acc);
  flex: none;
  font-weight: 600;
}

.px {
  padding: 4px 6px 8px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
  color: var(--ink);
}

.pb {
  margin: 2px 4px 0;
  text-align: center;
  padding: 7px;
  border-radius: 8px;
  background: var(--acc-soft);
  color: var(--acc);
  font-weight: 700;
  font-size: 13.5px;
}

/* ---------- lists / cards ---------- */
.grid-ads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(315px, 1fr));
  gap: 18px;
}

.card {
  display: block;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--sh);
  color: var(--ink);
  transition: border-color .15s, transform .15s;
}

.card:hover {
  border-color: var(--acc);
  text-decoration: none;
  transform: translateY(-2px);
}

.card.ad {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  min-height: 230px;
}

.ad-h {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.ad-h b {
  font-size: 15.5px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.ad-url {
  font-size: 12.5px;
  color: var(--mut);
  margin-bottom: 12px;
  direction: ltr;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-s {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--surf2);
  color: var(--mut);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.chip-s.ok {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 13%, var(--surf));
  border-color: transparent;
}

.chip-s.ready {
  color: var(--acc);
  background: var(--acc-soft);
  border-color: transparent;
}

.chip-s.warn,
.chip-s.review {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, var(--surf));
  border-color: transparent;
}

.chip-s.bad {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 13%, var(--surf));
  border-color: transparent;
}

.chip-s.paused {
  color: var(--mut);
  background: var(--surf2);
}

.kv {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 10px 0 12px;
}

.kv-cell {
  background: var(--surf2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.kv-cell small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--mut);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kv-cell b {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.bar {
  height: 6px;
  background: var(--surf2);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--acc);
  border-radius: 99px;
}

.ad-budget-row,
.sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--mut);
}

.sub-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.sub-item b {
  color: var(--ink);
}

.pct-num {
  font-size: 11px;
  opacity: .85;
}

.empty {
  text-align: center;
  padding: 56px 20px;
  background: var(--surf);
  border: 1px dashed var(--line);
  border-radius: var(--r);
}

.empty h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.empty p {
  color: var(--mut);
  margin: 0 0 20px;
}

.chart {
  padding-top: 8px;
}

.chart svg {
  width: 100%;
  height: 160px;
  display: block;
}

.chart rect {
  fill: var(--acc);
  transition: opacity .15s;
}

.chart rect:hover {
  opacity: .75;
}

.cl {
  display: flex;
  justify-content: space-between;
  color: var(--mut);
  font-size: 12px;
  margin-top: 6px;
}

/* wallet */
.wal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.wal .box {
  margin: 0;
  background: var(--surf);
  box-shadow: var(--sh);
}

.box.big .amt {
  display: block;
  font-size: 32px;
  font-weight: 800;
  margin: 4px 0 8px;
  line-height: 1.4;
}

.rate {
  color: var(--mut);
  font-size: 13.5px;
}

.rate b {
  color: var(--ink);
}

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.txt .tr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.txt .tr:last-child {
  border: 0;
}

.txt .tr small {
  display: block;
  font-size: 12.5px;
}

.txt .r {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.pos {
  color: var(--ok);
}

.neg {
  color: var(--bad);
}

/* gate */
.gate {
  max-width: 420px;
  margin: 0 auto;
  padding: 14vh 20px 40px;
  text-align: center;
}

.gate h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.gate p {
  color: var(--mut);
  margin: 0 0 22px;
  line-height: 1.6;
}

.load {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 40px 0;
}

.load i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--acc);
  animation: b 1s infinite ease-in-out;
}

.load i:nth-child(2) {
  animation-delay: .15s;
}

.load i:nth-child(3) {
  animation-delay: .3s;
}

@keyframes b {

  0%,
  80%,
  100% {
    transform: scale(.5);
    opacity: .4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.toasts {
  position: fixed;
  inset-inline: 0;
  bottom: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
  padding: 0 14px;
}

.toast {
  pointer-events: auto;
  max-width: 460px;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .3);
  animation: up .25s ease-out;
}

.toast.err {
  background: var(--bad);
  color: #fff;
}

.toast.out {
  opacity: 0;
  transition: opacity .3s;
}

@keyframes up {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .ed {
    grid-template-columns: minmax(0, 1fr);
  }

  .ed-side {
    position: static;
  }

  .tiles.five {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Mobile Elements Hidden on Desktop ---------- */
.mobile-top-subbar,
.mobile-drawer-edge-tab {
  display: none;
}
.desktop-top-acts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (min-width: 861px) {
  .mobile-bottom-bar,
  .mobile-drawer,
  .mobile-drawer-backdrop,
  .top-hamburger-btn,
  .mobile-top-subbar,
  .mobile-drawer-edge-tab {
    display: none !important;
  }
}

/* دکمه کشویی بغل صفحه برای موبایل (Edge Drawer Pull-Tab Handle) */
@media (max-width: 860px) {
  .mobile-drawer-edge-tab {
    display: flex !important;
    position: fixed;
    top: 130px;
    inset-inline-start: 0;
    z-index: 998;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 48px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--line, #334155);
    border-inline-start: none;
    border-start-end-radius: 12px;
    border-end-end-radius: 12px;
    background: var(--surf, #1e293b);
    color: var(--txt, #f1f5f9);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: width 0.18s ease, background-color 0.15s ease, opacity 0.2s ease;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-drawer-edge-tab:hover,
  .mobile-drawer-edge-tab:active {
    width: 32px;
    background: var(--card, #253347);
    color: var(--pri, #1b8ad8);
  }
  .mobile-drawer-edge-tab svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.9;
  }
  .drawer-open .mobile-drawer-edge-tab,
  .shell.drawer-open .mobile-drawer-edge-tab,
  .shell.drawer-open ~ .mobile-drawer-edge-tab {
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100vw;
    overflow-x: hidden;
  }

  .col {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* نوار کناری دسکتاپ در موبایل پنهان شده و منوی پایین و کشوی همبرگری جایگزین می‌شوند */
  .side {
    display: none !important;
  }

  .admin-top-bal,
  .topbar-profile-btn,
  .topbar-logout-btn,
  .sidebar-toggle-btn,
  .lang-dropdown {
    display: none !important;
  }

  /* هدر جمع‌وجور بدون سرریز در موبایل */
  .top {
    padding: 10px 12px 6px;
    gap: 8px;
    max-width: 100vw;
    overflow: hidden;
    box-sizing: border-box;
  }

  .top-hamburger-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--surf);
    color: var(--ink);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.15s ease;
  }

  .top-hamburger-btn:active {
    background: var(--line);
  }

  .top-hamburger-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
  }

  .top h1 {
    font-size: 16px;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    margin: 0;
  }

  .top-r {
    gap: 6px;
    flex: 0 0 auto !important;
    min-width: 0;
    flex-wrap: nowrap;
    overflow: visible !important;
  }

  /* در موبایل، اکشن‌های دسکتاپ از نوار بالایی پنهان شده و در صورت وجود به ساب‌بار منتقل می‌شوند */
  .desktop-top-acts,
  .top-r .desktop-top-acts,
  .top-r .head-acts,
  .top-r .top-new-ad-btn,
  .top-r a[href="#tg/new"],
  .top-r .btn[href="#tg/new"] {
    display: none !important;
  }

  /* نوار اکشن فرعی موبایل زیر هدر */
  .mobile-top-subbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: var(--surf);
    border-bottom: 1px solid var(--line);
    gap: 8px;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: auto;
  }
  .mobile-top-subbar .head-acts {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }
  .mobile-top-subbar .btn {
    padding: 5px 12px;
    font-size: 12px;
    height: 32px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .mobile-top-subbar a[href="#tg/new"],
  .mobile-top-subbar .top-new-ad-btn {
    margin-inline-start: auto;
  }

  .top h1 {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-top-bal {
    display: none !important;
  }

  .top-r .btn.primary {
    padding: 5px 8px;
    font-size: 11.5px;
    height: 32px;
    white-space: nowrap;
  }

  /* دکمه تم در هدر موبایل هم‌اندازه سایر عناصر */
  .theme-toggle-btn,
  #btnThemeToggle {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: 14px !important;
  }
  .theme-toggle-btn svg,
  #btnThemeToggle svg {
    width: 16px !important;
    height: 16px !important;
  }

  /* در موبایل فقط آیکن کره زمین نمایش داده شود و پرچم کشور پنهان شود */
  .lang-active-flag {
    display: none !important;
  }
  .lang-globe-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .lang-globe-btn svg.globe-icon {
    width: 18px !important;
    height: 18px !important;
  }

  /* پنهان‌سازی دکمه تبلیغ جدید در هدر اصلی موبایل */
  .shell .top-r .top-new-ad-btn,
  .shell .top-r a[href="#tg/new"],
  .shell .top-r .btn[href="#tg/new"] {
    display: none !important;
  }

  /* پنهان‌سازی کامل ویجت شناور ارتباطات در حالت موبایل/تبلت هنگام فعال بودن منوی پایین */
  .tgads-floating-contact,
  #tgadsFloatingContact,
  .tgads-fc-toggle,
  #tgadsFcToggle,
  .tgads-fc-menu {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* خلاصه‌سازی کیف پول در موبایل: پنهان کردن آیکن کیف پول و کلمه TON، نمایش فقط 💎 و مبلغ */
  .bal {
    padding: 4px 8px !important;
    font-size: 12px;
    gap: 4px !important;
    height: 32px;
    max-width: none !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }

  .bal > svg {
    display: none !important;
  }

  .bal .bal-unit {
    display: none !important;
  }

  .bal .bal-ton {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
  }

  .bal span {
    max-width: none !important;
    width: auto !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  /* نوار ناوبری پایین صفحه برای موبایل (بلور به سبک آیفون با آیکن‌های بزرگتر) */
  .mobile-bottom-bar {
    position: fixed;
    inset: auto 0 0 0;
    height: 62px;
    z-index: 9999;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px calc(env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(25px) saturate(190%);
    backdrop-filter: blur(25px) saturate(190%);
    border-top: 0.5px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.08);
  }

  [data-theme="dark"] .mobile-bottom-bar,
  .tgads-app[data-theme="dark"] .mobile-bottom-bar {
    background: rgba(23, 33, 43, 0.82);
    border-top: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.4);
  }

  .mb-nav-item {
    flex: 1 1 0;
    min-width: 0;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    margin: 0 2px;
    font-size: 11px;
    font-weight: 500;
    color: var(--mut);
    text-align: center;
    border-radius: 10px;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mb-nav-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    fill: currentColor;
    transition: transform 0.2s ease;
  }

  .mb-nav-item.mb-nav-new .mb-nav-icon {
    width: 36px;
    height: 36px;
  }

  .mb-nav-item.mb-nav-new .mb-nav-icon svg {
    width: 20px;
    height: 20px;
  }

  .mb-nav-item .mb-nav-text {
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .mb-nav-item:hover {
    color: var(--ink);
  }

  .mb-nav-item.on {
    color: var(--acc) !important;
    background: rgba(36, 129, 204, 0.12) !important;
    font-weight: 700;
  }

  .mb-nav-item.on svg {
    color: var(--acc);
    transform: translateY(-1px);
  }

  .mb-nav-item.mb-nav-new {
    position: relative;
  }

  .mb-nav-item.mb-nav-new.on {
    background: transparent !important;
  }

  .mb-nav-item.mb-nav-new .mb-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2AABEE, #229ED9);
    color: #ffffff !important;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(36, 129, 204, 0.4);
    margin-bottom: 1px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .mb-nav-item.mb-nav-new:hover .mb-nav-icon,
  .mb-nav-item.mb-nav-new.on .mb-nav-icon {
    transform: scale(1.08);
  }

  .mb-nav-item.mb-nav-new .mb-nav-icon svg,
  .mb-nav-item.mb-nav-new.on .mb-nav-icon svg,
  .mb-nav-item.mb-nav-new.on svg {
    width: 18px;
    height: 18px;
    fill: #ffffff !important;
    color: #ffffff !important;
    transform: none !important;
  }

  /* منوی کشویی همبرگری موبایل (Slide-out Drawer) */
  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .drawer-open .mobile-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 310px;
    max-width: 86vw;
    background: var(--surf);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    padding: 16px 14px calc(20px + env(safe-area-inset-bottom, 0px));
    gap: 14px;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* جهت‌بندی RTL (فارسی): باز شدن از سمت راست */
  body[dir="rtl"] .mobile-drawer,
  #app[dir="rtl"] .mobile-drawer,
  .mobile-drawer {
    right: 0;
    left: auto;
    transform: translateX(100%);
    border-left: 1px solid var(--line);
  }

  /* جهت‌بندی LTR (انگلیسی / اسپانیایی): باز شدن از سمت چپ */
  body[dir="ltr"] .mobile-drawer,
  #app[dir="ltr"] .mobile-drawer,
  html[lang="en"] .mobile-drawer,
  html[lang="es"] .mobile-drawer,
  body[data-lang="en"] .mobile-drawer,
  body[data-lang="es"] .mobile-drawer {
    left: 0;
    right: auto;
    transform: translateX(-100%);
    border-right: 1px solid var(--line);
    border-left: none;
  }

  /* حالت باز شدن کشو */
  .drawer-open .mobile-drawer {
    transform: translateX(0) !important;
  }

  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  .drawer-brand {
    display: flex;
    align-items: center;
    gap: 9px;
  }

  .drawer-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--acc);
    color: #fff;
  }

  .drawer-logo svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }

  .drawer-brand b {
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
  }

  .drawer-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--mut);
    cursor: pointer;
  }

  .drawer-close-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }

  .drawer-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: var(--bg);
    border: 1px solid var(--line);
  }

  .drawer-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--acc-soft);
    color: var(--acc);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .drawer-user-avatar svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
  }

  .drawer-user-info {
    min-width: 0;
    flex: 1;
  }

  .drawer-user-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .drawer-user-badge {
    display: inline-block;
    margin-top: 3px;
    padding: 1px 7px;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 6px;
    background: rgba(36, 129, 204, 0.15);
    color: var(--acc);
  }

  .drawer-bal-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    background: var(--bg);
    border: 1px solid var(--line);
  }

  .drawer-bal-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .drawer-bal-row.admin-acc-bal {
    padding-top: 8px;
    border-top: 1px dashed var(--line);
  }

  .drawer-bal-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--mut);
    font-weight: 600;
  }

  .drawer-bal-label svg {
    width: 14px;
    height: 14px;
  }

  .drawer-bal-val {
    font-size: 16px;
    font-weight: 800;
    color: #0088cc;
  }

  .drawer-bal-sub {
    font-size: 11px;
    color: var(--mut);
  }

  a.drawer-bal-row.drawer-bal-clickable {
    text-decoration: none !important;
    cursor: pointer;
    border-radius: 10px;
    padding: 6px 8px;
    margin: -4px -6px;
    transition: all 0.18s ease;
  }

  a.drawer-bal-row.drawer-bal-clickable:hover {
    background: var(--surf2, rgba(0, 0, 0, 0.04));
    text-decoration: none !important;
  }

  [data-theme="dark"] a.drawer-bal-row.drawer-bal-clickable:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .drawer-bal-badge {
    margin-inline-start: auto;
    font-size: 10.5px;
    font-weight: 700;
    color: #fff;
    background: var(--acc, #0088cc);
    padding: 2px 7px;
    border-radius: 99px;
  }

  .drawer-nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--mut);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 4px 0;
  }

  .drawer-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.15s ease;
  }

  .drawer-nav-item:hover,
  .drawer-nav-item:active {
    background: var(--bg);
  }

  .drawer-nav-item.on {
    background: var(--acc-soft) !important;
    color: var(--acc) !important;
    font-weight: 700;
  }

  .drawer-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .drawer-nav-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
  }

  .drawer-nav-text {
    flex: 1;
    min-width: 0;
  }

  .drawer-nav-arrow {
    color: var(--mut);
    font-size: 16px;
    margin-inline-start: auto;
  }

  .drawer-social-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
  }

  .drawer-social-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
  }

  .drawer-social-link:hover,
  .drawer-social-link:active {
    background: var(--bg);
    text-decoration: none !important;
  }

  .drawer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 17px;
    flex-shrink: 0;
  }

  .drawer-social-label {
    flex: 1;
    min-width: 0;
  }

  .drawer-social-link.fc-bot { color: #0088cc; }
  .drawer-social-link.fc-channel { color: #229ed9; }
  .drawer-social-link.fc-instagram { color: #e1306c; }
  .drawer-social-link.fc-whatsapp { color: #25d366; }
  .drawer-social-link.fc-custom { color: #0284c7; }

  .drawer-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .drawer-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }

  .drawer-tool-btn .flag-icon svg {
    width: 18px;
    height: 13px;
    border-radius: 2px;
  }

  .drawer-tool-btn svg {
    width: 16px;
    height: 16px;
  }

  .drawer-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .drawer-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 11px;
    border: 1px solid rgba(220, 53, 69, 0.25);
    background: rgba(220, 53, 69, 0.08);
    color: #e53935;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .drawer-logout-btn:active {
    background: rgba(220, 53, 69, 0.18);
  }

  .drawer-logout-btn svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
  }

  .main {
    padding: 10px 14px calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .ed {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .ed-side {
    order: -1 !important;
    position: static !important;
    width: 100% !important;
    margin-bottom: 8px !important;
  }

  .ed-main {
    order: 2 !important;
    width: 100% !important;
    padding: 14px 14px 4px;
  }

  .profile-package-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .actions {
    bottom: calc(60px + env(safe-area-inset-bottom));
    margin: 14px -14px 0;
    padding: 10px 14px;
  }

  .act-info {
    display: none;
  }

  .actions .btn {
    flex: 1;
  }

  .toasts {
    bottom: 150px;
  }

  .wal,
  .two {
    grid-template-columns: minmax(0, 1fr);
  }

  .tiles.four,
  .tiles.five {
    grid-template-columns: repeat(2, 1fr);
  }

  .tiles b {
    font-size: 18px;
  }

  .kv {
    grid-template-columns: repeat(2, 1fr);
  }

  .pair {
    grid-template-columns: 1fr;
  }

  .eq {
    display: none;
  }

  .gate {
    padding-top: 10vh;
  }
}

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

/* ---------- AdBlock Modal ---------- */
.tgads-ab-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 28, .82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 18px;
  animation: tgads-fade-in .25s ease-out;
}

.tgads-ab-card {
  background: var(--surf);
  color: var(--ink);
  max-width: 520px;
  width: 100%;
  border-radius: 18px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  border: 1px solid var(--line);
  direction: rtl;
}

.tgads-ab-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(207, 58, 58, .12);
  color: var(--bad);
  display: inline-grid;
  place-items: center;
  margin-bottom: 18px;
}

.tgads-ab-icon svg {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

.tgads-ab-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.4;
  color: var(--ink);
}

.tgads-ab-text {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--mut);
  margin: 0 0 24px;
}

.tgads-ab-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.tgads-ab-btn {
  padding: 11px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  border: 0;
  transition: all .15s;
  font-family: inherit;
}

.tgads-ab-btn.pri {
  background: var(--acc);
  color: var(--acc-ink);
}

.tgads-ab-btn.pri:hover {
  filter: brightness(1.08);
}

.tgads-ab-btn.sec {
  background: var(--surf2);
  color: var(--ink);
  border: 1px solid var(--line);
}

.tgads-ab-btn.sec:hover {
  background: color-mix(in srgb, var(--line) 40%, var(--surf2));
}

@keyframes tgads-fade-in {
  from {
    opacity: 0;
    transform: scale(.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- Channel Avatar Chips ---------- */
.chip-peer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: var(--surf2);
  border: 1px solid var(--line);
  color: var(--ink);
  max-width: 100%;
  transition: border-color .15s;
}

.chip-peer:hover {
  border-color: var(--acc);
}

.chip-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--acc-soft);
  display: inline-grid;
  place-items: center;
  flex: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--acc);
  border: 1px solid var(--line);
}

.chip-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chip-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  text-align: right;
}

.chip-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.chip-un {
  font-size: 11px;
  color: var(--mut);
  direction: ltr;
  text-align: right;
  white-space: nowrap;
}

.chip-ver svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  flex: none;
}

.chip-spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.chip-peer.chip-bad {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 8%, var(--surf2));
}

.chip-peer.chip-bad .chip-un {
  color: var(--bad);
}

/* ---------- Countries & Languages Picker ---------- */
.picker-wrap {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.pick-tags-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  align-items: center;
}

.pick-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent);
}

.pick-tag small {
  font-size: 11px;
  opacity: .85;
  font-weight: 400;
  direction: ltr;
}

.pick-tag button {
  border: 0;
  background: transparent;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.pick-tag button:hover {
  background: rgba(0, 0, 0, .1);
}

.pick-empty {
  color: var(--mut);
  font-size: 12.5px;
}

.pick-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  color: var(--mut);
  padding: 4px 0 2px;
}

.pick-quick b {
  color: var(--ink);
  margin-inline-end: 4px;
  font-size: 12px;
}

.pick-pill {
  border: 1px solid var(--line);
  background: var(--surf2);
  color: var(--ink);
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.pick-pill:hover {
  border-color: var(--acc);
}

.pick-pill.on {
  background: var(--acc);
  color: var(--acc-ink);
  border-color: var(--acc);
}

.pick-dropdown {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--surf2);
}

.pick-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surf);
  border-bottom: 1px solid var(--line);
}

.pick-search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--mut);
  flex: none;
}

.pick-search {
  border: 0;
  background: transparent;
  width: 100%;
  outline: none;
  font-size: 13.5px;
  color: var(--ink);
  font-family: inherit;
}

.pick-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
  display: grid;
  gap: 2px;
}

.pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
  font-size: 13.5px;
  user-select: none;
}

.pick-item:hover {
  background: color-mix(in srgb, var(--acc) 10%, var(--surf));
}

.pick-item.on {
  background: var(--acc-soft);
  color: var(--acc);
}

.pick-chk {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line);
  display: inline-grid;
  place-items: center;
  flex: none;
  background: var(--surf);
}

.pick-item.on .pick-chk {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-ink);
}

.pick-chk svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  fill: currentColor;
}

.pick-fl {
  font-size: 16px;
  line-height: 1;
  flex: none;
}

.pick-name {
  font-weight: 600;
  min-width: 0;
}

.pick-en {
  margin-inline-start: auto;
  color: var(--mut);
  font-size: 11.5px;
  direction: ltr;
}

/* ---------- Schedule 2D Drag Selection & Timezone Bar ---------- */
.sched-settings-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.sched-tz-col {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 240px;
}

.sched-tz-col label {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
}

.sched-tz-col select {
  min-height: 38px;
  padding: 6px 10px;
  font-size: 13.5px;
}

.sched-viewer-sw {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.cell.drag-preview {
  transition: none !important;
  position: relative;
  z-index: 2;
}

.cell.drag-preview.preview-on {
  background: color-mix(in srgb, var(--acc) 85%, #fff) !important;
  outline: 2px dashed var(--acc);
  outline-offset: -2px;
}

.cell.drag-preview.preview-off {
  background: color-mix(in srgb, var(--bad) 35%, var(--surf2)) !important;
  outline: 2px dashed var(--bad);
  outline-offset: -2px;
}

/* ---------- Ad Card Actions (Two-Tier Clean Layout) ---------- */
.ad-acts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ad-act-main {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  background: var(--pri, #2ea6ff);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(46, 166, 255, 0.25);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  line-height: 1;
}

.ad-act-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(46, 166, 255, 0.4);
  filter: brightness(1.06);
}

.ad-act-main svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ad-acts-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.ad-tool-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 33px;
  padding: 0 6px;
  background: var(--bg-alt, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  color: var(--ink, #fff);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1;
}

.ad-tool-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-tool-btn:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.1));
  border-color: var(--pri, #2ea6ff);
  color: var(--pri, #2ea6ff);
  transform: translateY(-1px);
}

.ad-tool-btn.pause {
  color: #e5a93c;
}

.ad-tool-btn.pause:hover {
  border-color: #e5a93c;
  background: rgba(229, 169, 60, 0.12);
}

.ad-tool-btn.resume {
  color: #38c172;
}

.ad-tool-btn.resume:hover {
  border-color: #38c172;
  background: rgba(56, 193, 114, 0.12);
}

.ad-tool-btn.danger {
  color: #f25555;
}

.ad-tool-btn.danger:hover {
  border-color: #f25555;
  background: rgba(242, 85, 85, 0.12);
}

.ad-tool-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  vertical-align: middle;
}

.ad-act-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 35px;
  text-decoration: none;
  border-radius: 8px;
  text-overflow: ellipsis;
  line-height: 1;
}

.ad-act-btn svg {
  width: 14px;
  height: 14px;
  flex: none;
  vertical-align: middle;
}

.ad-title {
  color: var(--ink);
  text-decoration: none;
}

.ad-title:hover {
  color: var(--acc);
}

.in.in-err {
  border-color: var(--bad) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 25%, transparent) !important;
}

.cnt.bad {
  color: var(--bad);
  font-weight: 700;
}

/* ---------- Admin Mode & Ads Management ---------- */
.admin-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.admin-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chip-admin-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
}

.chip-admin-info svg {
  width: 18px;
  height: 18px;
  color: var(--acc);
  flex: none;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border: 1px solid var(--line);
  background: var(--surf2);
  color: var(--ink);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.pill:hover {
  border-color: var(--acc);
}

.pill.active {
  background: var(--acc);
  color: var(--acc-ink);
  border-color: var(--acc);
}

.ad-h-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-owner {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--acc) 10%, var(--surf2));
  color: var(--acc);
  border: 1px solid color-mix(in srgb, var(--acc) 25%, transparent);
}

.admin-editor-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--acc) 8%, var(--surf));
  border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent);
  border-radius: 11px;
}

.admin-editor-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink);
}

.admin-editor-info svg {
  width: 20px;
  height: 20px;
  color: var(--acc);
  flex: none;
}

.admin-editor-acts {
  display: flex;
  align-items: center;
  gap: 8px;
}

.head-acts {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn.loading {
  opacity: .7;
  pointer-events: none;
}

.btn.loading svg {
  animation: spin .8s linear infinite;
}

/* ---------- Theme Toggle Button ---------- */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--ink);
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--sh);
  font-size: 16px;
  flex: none;
}

.theme-toggle-btn:hover {
  border-color: var(--acc);
  transform: scale(1.08) rotate(15deg);
}

.theme-toggle-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  display: block;
}

/* ---------- Draft Badge & Chips ---------- */
.chip-s.draft {
  color: #8e44ad;
  background: color-mix(in srgb, #8e44ad 14%, var(--surf));
  border-color: color-mix(in srgb, #8e44ad 30%, transparent);
}

/* ---------- Target Restriction Alert & Disabled Picker ---------- */
.target-alert {
  margin: 8px 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 12%, var(--surf));
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.picker-disabled {
  opacity: .45;
  pointer-events: none;
  filter: grayscale(0.6);
  user-select: none;
}

/* ---------- TON Base Currency & Transaction Styling ---------- */
.ton-icon-svg {
  display: inline-block;
  vertical-align: -3px;
  width: 17px;
  height: 17px;
  margin-inline-end: 4px;
}

.bal-ton {
  color: #0088cc;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

.bal-toman {
  color: var(--mut);
  font-size: 11.5px;
  margin-inline-start: 4px;
}

.amt.ton-main {
  color: #0088cc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.amt-sub {
  color: var(--mut);
  font-size: 14px;
  margin-top: 4px;
  font-weight: 500;
}

.tx-amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.tx-ton {
  font-size: 14px;
  font-weight: 800;
  color: #0088cc;
}

.tx-ton.pos {
  color: var(--ok);
}

.tx-ton.neg {
  color: var(--bad);
}

.tx-toman {
  font-size: 11.5px;
  color: var(--mut);
}

/* ---------- Interactive Live Preview ---------- */
.pv-link {
  text-decoration: none;
  color: inherit;
}

.pv-link:hover {
  text-decoration: underline;
  color: var(--acc);
}

.pb {
  display: block;
  text-decoration: none !important;
  transition: all .2s;
  cursor: pointer;
}

.pb:hover {
  filter: brightness(1.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  transform: translateY(-1px);
}

/* ---------- Admin Telegram Account Total Balance Dashboard ---------- */
.admin-account-card {
  background: color-mix(in srgb, var(--acc) 6%, var(--surf));
  border: 1px solid color-mix(in srgb, var(--acc) 25%, var(--line));
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--sh);
}

.admin-acc-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--acc) 15%, var(--line));
}

.admin-acc-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-acc-icon {
  font-size: 24px;
}

.admin-acc-title b {
  display: block;
  font-size: 15px;
  color: var(--ink);
}

.admin-acc-title small {
  display: block;
  font-size: 12px;
  color: var(--mut);
  margin-top: 2px;
}

.admin-acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.acc-tile {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.acc-tile::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--line);
}

.acc-tile.total::before {
  background: linear-gradient(90deg, #0088cc, #29b6f6);
}

.acc-tile.free::before {
  background: var(--ok);
}

.acc-tile.ads::before {
  background: var(--warn);
}

.acc-tile.spent::before {
  background: var(--mut);
}

.acc-tile small {
  font-size: 12px;
  font-weight: 600;
  color: var(--mut);
}

.acc-tile .acc-num {
  font-size: 18px;
  font-weight: 800;
  color: #0088cc;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.acc-tile .acc-sub {
  font-size: 12px;
  color: var(--mut);
}

.admin-top-bal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  background: color-mix(in srgb, #0088cc 12%, var(--surf));
  border: 1px solid color-mix(in srgb, #0088cc 30%, transparent);
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}

.admin-top-bal span {
  color: var(--mut);
  font-size: 12px;
}

.admin-top-bal b {
  color: #0088cc;
  font-weight: 800;
}

.admin-top-bal small {
  color: var(--mut);
  font-size: 11.5px;
}

/* ---------- Rich Target Read-only Chips ---------- */
.chip-peer.ro {
  cursor: default;
}

.chip-peer.ro:hover {
  transform: none;
  box-shadow: none;
}

.target-ro-val {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 12px;
  background: var(--surf2);
  border-radius: 8px;
  display: inline-block;
}

/* ---------- English Number Formatting & Bidi Isolation ---------- */
.en-num {
  direction: ltr !important;
  unicode-bidi: isolate;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
}

/* ---------- Disabled Preview Button ---------- */
.pb.disabled {
  opacity: .55;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: var(--surf2) !important;
  color: var(--mut) !important;
  border: 1px dashed var(--line) !important;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
}

/* ---------- Custom Auth Gate (Login & Register Tabs) ---------- */
.auth-gate {
  max-width: 460px;
  margin: 0 auto;
  padding: 40px 16px;
  text-align: center;
}

.auth-card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--sh);
  margin-top: 18px;
  text-align: right;
}

.auth-lang-pills {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surf2);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 24px;
  margin: 0 auto 18px auto;
}

.auth-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--mut);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}

.auth-lang-pill:hover {
  color: var(--ink);
}

.auth-lang-pill.active {
  background: var(--surf);
  color: var(--acc);
  box-shadow: var(--sh);
}

.auth-lang-pill .flag-svg {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  vertical-align: middle;
}

.auth-tabs {
  display: flex;
  background: var(--surf2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
  margin-bottom: 20px;
}

.auth-tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--mut);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.auth-tab-btn.on {
  background: var(--surf);
  color: var(--acc);
  box-shadow: var(--sh);
}

.auth-form {
  display: grid;
  gap: 4px;
}

.auth-form .fld {
  margin-bottom: 14px;
}

.auth-form .fld label {
  font-size: 13px;
  margin-bottom: 5px;
  font-weight: 700;
}

.auth-form .in {
  min-height: 42px;
  font-size: 14px;
}

.auth-wc-link {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
}

.auth-wc-link a {
  color: var(--acc);
  text-decoration: none;
  font-weight: 700;
}

.auth-wc-link a:hover {
  text-decoration: underline;
}

/* ---------- Field Labels & Flat Monochrome Icons ---------- */
.fld-lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 6px;
}

.fld-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--acc);
  flex: none;
}

.fld-ic svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* ---------- Modern Toggle Switch Row (.sw-row) ---------- */
.sw-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  background: var(--surf2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  transition: all .2s ease;
  user-select: none;
  box-sizing: border-box;
}

.sw-row:hover {
  border-color: color-mix(in srgb, var(--acc) 50%, var(--line));
}

.sw-row.active {
  background: rgba(27, 138, 216, 0.12) !important;
  border-color: var(--acc) !important;
  box-shadow: 0 0 0 1px var(--acc);
}

[data-theme="dark"] .sw-row.active {
  background: rgba(41, 182, 246, 0.16) !important;
  border-color: var(--acc) !important;
}

.sw-info {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline-end: 14px;
}

.sw-title {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-desc {
  font-size: 12.5px;
  color: var(--mut);
  line-height: 1.55;
}

.sw-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex: 0 0 46px;
  cursor: pointer;
  margin-inline-start: auto;
  align-self: center;
}

.sw-toggle input {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
}

.sw-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--line);
  transition: all .22s ease;
  border-radius: 99px;
}

.sw-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  top: 3px;
  inset-inline-start: 3px;
  background-color: #ffffff;
  transition: all .22s ease;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
}

.sw-toggle input:checked+.sw-slider {
  background-color: var(--acc) !important;
}

[dir="rtl"] .sw-toggle input:checked+.sw-slider:before,
.tgads-app[dir="rtl"] .sw-toggle input:checked+.sw-slider:before {
  transform: translateX(-20px);
}

[dir="ltr"] .sw-toggle input:checked+.sw-slider:before,
.tgads-app[dir="ltr"] .sw-toggle input:checked+.sw-slider:before {
  transform: translateX(20px);
}

/* ---------- Schedule Timezone Box Below Grid ---------- */
.sched-tz-footer {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--surf2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.sched-tz-col {
  margin-bottom: 12px;
}

.sched-tz-col select {
  width: 100%;
}

/* ---------- Language Globe Dropdown in Header ---------- */
.lang-globe-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-globe-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surf);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: all .18s ease;
  box-shadow: var(--sh);
}

.lang-globe-btn:hover,
.lang-globe-wrap:hover .lang-globe-btn,
.lang-globe-wrap.open .lang-globe-btn {
  border-color: var(--acc);
  color: var(--acc);
  background: var(--surf2);
}

.lang-globe-btn svg.globe-icon,
.lang-globe-btn svg.globe-icon circle,
.lang-globe-btn svg.globe-icon path,
.lang-globe-btn svg.globe-icon line {
  width: 17px;
  height: 17px;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  flex-shrink: 0;
}

.lang-active-flag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 200px;
  max-width: calc(100vw - 32px);
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 1000;
}

[dir="rtl"] .lang-dropdown {
  inset-inline-end: 0;
  left: 0;
  right: auto;
}

[dir="ltr"] .lang-dropdown {
  inset-inline-end: 0;
  right: 0;
  left: auto;
}

.lang-dropdown::before {
  content: "";
  position: absolute;
  top: -14px;
  inset-inline: 0;
  height: 16px;
  background: transparent;
}

.lang-globe-wrap:hover .lang-dropdown,
.lang-globe-wrap:focus-within .lang-dropdown,
.lang-globe-wrap.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  transition: background .12s, color .12s;
  user-select: none;
}

.lang-opt:hover {
  background: var(--surf2);
  color: var(--acc);
}

.lang-opt.on {
  background: var(--acc-soft);
  color: var(--acc);
  font-weight: 700;
}

.lang-opt .flag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 15px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.lang-opt .lang-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
}

.lang-opt .lang-text small {
  font-size: 11px;
  opacity: .75;
  font-weight: 500;
}

/* ---------- Mobile Language Bottom Sheet Modal ---------- */
.lang-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s;
}

.lang-sheet-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lang-sheet {
  width: 100%;
  max-width: 500px;
  background: var(--surf);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 12px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-bottom: none;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(0.32, 1, 0.23, 1);
  display: flex;
  flex-direction: column;
}

.lang-sheet-backdrop.open .lang-sheet {
  transform: translateY(0);
}

.lang-sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  margin: 0 auto 12px;
  opacity: 0.8;
}

.lang-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.lang-sheet-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.lang-sheet-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surf2);
  color: var(--mut);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.lang-sheet-close:hover {
  background: var(--line);
  color: var(--ink);
}

.lang-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lang-sheet-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surf2);
  cursor: pointer;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.lang-sheet-opt:active {
  transform: scale(0.98);
}

.lang-sheet-opt.active {
  border-color: var(--acc);
  background: rgba(36, 129, 204, 0.12);
}

.lang-sheet-opt-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-sheet-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.lang-sheet-flag svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lang-sheet-opt-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-sheet-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.lang-sheet-opt.active .lang-sheet-name {
  color: var(--acc);
}

.lang-sheet-sub {
  font-size: 12px;
  color: var(--mut);
}

.lang-sheet-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--acc);
  color: #fff;
  flex-shrink: 0;
}

.lang-sheet-check svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

@media (min-width: 861px) {
  .lang-sheet-backdrop {
    display: none !important;
  }
}

/* Flag SVG general styles */
.flag-svg {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 3px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.country-flag-icon {
  margin-inline-end: 6px;
  vertical-align: middle;
}

/* ---------- Visual Device Targeting Cards ---------- */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.device-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 12px 14px;
  border-radius: 14px;
  background: var(--surf);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  user-select: none;
}

.device-card:hover {
  border-color: var(--acc);
  transform: translateY(-2px);
  box-shadow: var(--sh);
}

.device-card.on {
  border-color: var(--acc);
  background: var(--acc-soft);
  box-shadow: 0 4px 16px rgba(0, 152, 234, 0.18);
}

.device-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surf2);
  color: var(--ink);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  transition: all .2s ease;
}

.device-card:hover .device-card-icon,
.device-card.on .device-card-icon {
  background: var(--acc);
  color: var(--acc-ink);
  transform: scale(1.05);
}

.device-card-icon svg {
  width: 26px;
  height: 26px;
}

.device-card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 3px;
}

.device-card-desc {
  font-size: 11.5px;
  color: var(--mut);
  line-height: 1.35;
}

.device-card-check {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surf);
  display: grid;
  place-items: center;
  transition: all .15s;
}

.device-card.on .device-card-check {
  border-color: var(--acc);
  background: var(--acc);
  color: var(--acc-ink);
}

.device-card-check svg {
  width: 10px;
  height: 10px;
  stroke-width: 3;
}

/* ---------- Support Tickets System UI ---------- */
.support-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.support-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.support-head h2 {
  font-size: 20px;
  font-weight: 800;
}

.ticket-list {
  display: grid;
  gap: 12px;
}

.ticket-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--surf);
  border: 1px solid var(--line);
  box-shadow: var(--sh);
  cursor: pointer;
  transition: all .16s ease;
}

.ticket-card:hover {
  border-color: var(--acc);
  transform: translateY(-1px);
}

.ticket-card-main {
  min-width: 0;
  flex: 1;
}

.ticket-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.ticket-id {
  font-family: monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--mut);
}

.ticket-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--mut);
}

.badge-dept {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surf2);
  color: var(--ink);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-status.open {
  background: rgba(0, 152, 234, 0.12);
  color: var(--acc);
}

.badge-status.answered {
  background: rgba(52, 199, 89, 0.14);
  color: #28a745;
}

.badge-status.user_reply {
  background: rgba(255, 149, 0, 0.14);
  color: #e67e22;
}

.badge-status.closed {
  background: var(--surf2);
  color: var(--mut);
}

/* Ticket Conversation Thread */
.ticket-thread-box {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
}

.ticket-thread-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.ticket-thread-msgs {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 520px;
  overflow-y: auto;
  background: var(--surf2);
}

.ticket-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.ticket-msg-row.user {
  align-self: flex-start;
}

.ticket-msg-row.admin {
  align-self: flex-end;
}

.ticket-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ticket-msg-row.user .ticket-msg-bubble {
  background: var(--surf);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 3px;
}

.ticket-msg-row.admin .ticket-msg-bubble {
  background: var(--acc);
  color: var(--acc-ink);
  border-bottom-right-radius: 3px;
}

.ticket-msg-meta {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--mut);
  display: flex;
  gap: 8px;
  padding: 0 4px;
}

.ticket-reply-area {
  padding: 18px 22px;
  border-top: 1px solid var(--line);
  background: var(--surf);
}

.ticket-reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

/* ---------- LTR Layout Adjustments (Strict & Comprehensive) ---------- */
html[dir="ltr"] body,
html[dir="ltr"] .tgads-app,
.tgads-app[dir="ltr"] {
  direction: ltr !important;
  text-align: left !important;
}

html[dir="ltr"] .fld>label,
.tgads-app[dir="ltr"] .fld>label,
html[dir="ltr"] .fld-lbl,
.tgads-app[dir="ltr"] .fld-lbl {
  text-align: left !important;
  justify-content: flex-start !important;
}

html[dir="ltr"] .hint,
.tgads-app[dir="ltr"] .hint {
  text-align: left !important;
}

html[dir="ltr"] .cnt,
.tgads-app[dir="ltr"] .cnt {
  text-align: right !important;
}

html[dir="ltr"] .seg,
.tgads-app[dir="ltr"] .seg {
  justify-content: flex-start !important;
}

html[dir="ltr"] h1,
html[dir="ltr"] h2,
html[dir="ltr"] h3,
html[dir="ltr"] h4,
.tgads-app[dir="ltr"] h1,
.tgads-app[dir="ltr"] h2,
.tgads-app[dir="ltr"] h3,
.tgads-app[dir="ltr"] h4 {
  text-align: left !important;
}

html[dir="ltr"] .brand,
.tgads-app[dir="ltr"] .brand {
  text-align: left !important;
  flex-direction: row !important;
}

html[dir="ltr"] .who,
.tgads-app[dir="ltr"] .who {
  text-align: left !important;
}

html[dir="ltr"] .top,
.tgads-app[dir="ltr"] .top {
  flex-direction: row !important;
}

html[dir="ltr"] .sw-info,
.tgads-app[dir="ltr"] .sw-info {
  text-align: left !important;
  padding-right: 14px !important;
  padding-left: 0 !important;
}

html[dir="ltr"] .nav a,
.tgads-app[dir="ltr"] .nav a {
  text-align: left !important;
  justify-content: flex-start !important;
}

html[dir="ltr"] .side,
.tgads-app[dir="ltr"] .side {
  border-right: 1px solid var(--line) !important;
  border-left: none !important;
}

html[dir="ltr"] .toast,
.tgads-app[dir="ltr"] .toast {
  right: auto !important;
  left: 24px !important;
}

html[dir="ltr"] .auth-card {
  text-align: left !important;
}

html[dir="ltr"] .lang-dropdown {
  inset-inline-end: auto;
  inset-inline-start: 0;
}

.en-num {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  direction: ltr !important;
  display: inline-block;
  unicode-bidi: isolate;
}

/* User Profile, Blocked State & Admin Management Styles */
.note.blocked-banner {
  background: rgba(239, 106, 106, 0.12);
  border: 1px solid var(--bad);
  color: var(--bad);
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.note.blocked-banner strong {
  font-weight: 700;
  font-size: 15px;
}

.sidebar-who-box {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surf);
  border-radius: 12px;
  margin: 10px;
}

.sidebar-who-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-who-acts {
  display: flex;
  gap: 8px;
}

.btn-sidebar-act {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surf2);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.btn-sidebar-act svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform .2s ease;
}

.btn-sidebar-act:hover {
  background: var(--acc-soft);
  color: var(--acc);
  border-color: var(--acc);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(36, 129, 204, 0.15);
}

.btn-sidebar-act:hover svg {
  transform: scale(1.12);
}

.btn-sidebar-act.logout:hover {
  background: rgba(239, 106, 106, 0.15);
  color: var(--bad);
  border-color: var(--bad);
  box-shadow: 0 4px 12px rgba(239, 106, 106, 0.15);
}

.topbar-profile-btn,
.topbar-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--mut);
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}

.topbar-profile-btn svg,
.topbar-logout-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform .2s;
}

.topbar-profile-btn:hover {
  color: var(--acc);
  border-color: var(--acc);
  background: var(--acc-soft);
  transform: translateY(-1px);
}

.topbar-profile-btn:hover svg {
  transform: scale(1.1);
}

.topbar-logout-btn:hover {
  color: var(--bad);
  border-color: var(--bad);
  background: rgba(239, 106, 106, 0.12);
  transform: translateY(-1px);
}

.topbar-logout-btn:hover svg {
  transform: scale(1.1);
}

/* ---------- Deposit Gateway Choice Cards ---------- */
.gw-choice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.gw-choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--surf);
  cursor: pointer;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.gw-choice-card:hover {
  border-color: var(--acc);
  background: var(--surf2);
  transform: translateY(-1px);
}

.gw-choice-card.active {
  border-color: var(--acc);
  background: var(--acc-soft);
  box-shadow: 0 4px 14px rgba(36, 129, 204, 0.15);
}

.gw-choice-icon {
  font-size: 24px;
  flex: none;
}

.gw-choice-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gw-choice-txt b {
  font-size: 13.5px;
  color: var(--ink);
}

.gw-choice-txt small {
  font-size: 11.5px;
  color: var(--mut);
  line-height: 1.4;
}

.profile-card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--sh);
  margin-bottom: 24px;
}

.profile-package-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.profile-stat-box {
  background: var(--surf2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-stat-label {
  font-size: 12.5px;
  color: var(--mut);
}

.profile-stat-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--sh);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-title {
  font-size: 13px;
  color: var(--mut);
}

.kpi-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.kpi-val.green {
  color: var(--ok);
}

.kpi-val.blue {
  color: var(--acc);
}

.badge-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status.active {
  background: rgba(63, 197, 138, 0.15);
  color: var(--ok);
}

.badge-status.blocked {
  background: rgba(239, 106, 106, 0.15);
  color: var(--bad);
}

/* ---------- Empty State Centering ---------- */
.empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 48px 24px;
  margin: 32px auto;
  max-width: 520px;
  background: var(--surf);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
}

.empty .logo.big {
  margin: 0 auto 16px !important;
  display: grid;
  place-items: center;
}

.empty h2 {
  text-align: center !important;
  margin: 0 0 10px !important;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.empty p {
  text-align: center !important;
  margin: 0 0 20px !important;
  color: var(--mut);
  line-height: 1.6;
}

/* ---------- Desktop Sidebar Minimize / Collapse ---------- */
.shell {
  transition: grid-template-columns 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 861px) {
  .shell.collapsed {
    grid-template-columns: 78px minmax(0, 1fr) !important;
  }

  .shell.collapsed .side {
    padding: 22px 8px;
    align-items: center;
  }

  .shell.collapsed .brand > div,
  .shell.collapsed .nav a span,
  .shell.collapsed .sidebar-who-info b,
  .shell.collapsed .sidebar-who-acts .btn-sidebar-act span {
    display: none !important;
  }

  .shell.collapsed .brand {
    justify-content: center;
    padding: 0;
  }

  .shell.collapsed .nav a {
    justify-content: center;
    padding: 12px 10px;
    width: 100%;
  }

  .shell.collapsed .sidebar-who-box {
    padding: 8px 4px;
  }

  .shell.collapsed .sidebar-who-info {
    justify-content: center;
  }

  .shell.collapsed .sidebar-who-acts {
    flex-direction: column;
    gap: 6px;
  }

  .shell.collapsed .btn-sidebar-act {
    justify-content: center;
    padding: 8px;
  }
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surf);
  border: 1px solid var(--line);
  color: var(--mut);
  cursor: pointer;
  transition: all .2s ease;
  flex: none;
}

.sidebar-toggle-btn:hover {
  background: var(--surf2);
  color: var(--ink);
  border-color: var(--acc);
}

.sidebar-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- Pagination Controls ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px 0 12px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--surf);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--acc-soft);
  color: var(--acc);
  border-color: var(--acc);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-info {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mut);
}

/* ---------- Telegram Bot Connect Card ---------- */
.tg-bot-connect-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--r);
  background: var(--surf2);
  border: 1px solid var(--line);
  margin-top: 16px;
  flex-wrap: wrap;
}

.tg-bot-connect-card.connected {
  border-color: color-mix(in srgb, var(--ok) 30%, var(--line));
  background: color-mix(in srgb, var(--ok) 6%, var(--surf2));
}

.tg-bot-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #2481cc;
  color: #fff !important;
  font-weight: 600;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  transition: opacity .2s;
  text-decoration: none !important;
}

.tg-bot-connect-btn:hover {
  opacity: 0.9;
}

/* ---------- Stats View & Telegram Public Link ---------- */
.stats-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.stats-pills {
  display: inline-flex;
  background: var(--surf2);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  gap: 4px;
}
.stats-pill {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--mut);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stats-pill:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--acc) 8%, transparent);
}
.stats-pill.active {
  background: var(--acc);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 136, 204, 0.25);
}
/* Official Telegram Ads Verified Button */
.tg-official-verified-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #17212b;
  border: 1px solid rgba(0, 136, 204, 0.5);
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 9px;
  box-shadow: 0 2px 10px rgba(0, 136, 204, 0.22);
  transition: all .2s ease;
  cursor: pointer;
  line-height: 1.4;
}
.tg-official-verified-btn:hover {
  background: #1e2c3a;
  border-color: #0088cc;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 136, 204, 0.4);
}
.tg-official-verified-btn.is-syncing {
  background: var(--card-sub);
  border: 1px solid var(--line);
  color: var(--ink) !important;
  box-shadow: none;
}
.tg-official-verified-badge {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Telegram Native Chart Container */
.tg-native-chart-card {
  background: #131f2b;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px 18px 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
  user-select: none;
  box-sizing: border-box;
  width: 100% !important;
  direction: ltr !important;
}
.tg-native-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
  direction: rtl;
}
[dir="ltr"] .tg-native-chart-header {
  direction: ltr;
}
.tg-native-chart-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.tgads-app .tg-native-chart-card svg.tg-native-chart-svg,
.tgads-app svg.tg-native-chart-svg,
.tg-native-chart-svg {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: 270px !important;
  display: block !important;
  overflow: visible !important;
  cursor: crosshair;
  direction: ltr !important;
  box-sizing: border-box !important;
}
.tg-subchart-wrap {
  position: relative;
  width: 100% !important;
  height: 42px;
  margin-top: 14px;
  border-radius: 6px;
  overflow: hidden;
  background: #0d151e;
  border: 1px solid rgba(255,255,255,0.12);
  touch-action: none;
  direction: ltr !important;
  box-sizing: border-box !important;
}
.tgads-app .tg-subchart-wrap svg.tg-subchart-svg,
.tgads-app svg.tg-subchart-svg,
.tg-subchart-svg {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  display: block !important;
  direction: ltr !important;
  box-sizing: border-box !important;
}
.tgads-app svg#tgBudgetSvg,
#tgBudgetSvg {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: 200px !important;
  display: block !important;
  direction: ltr !important;
  box-sizing: border-box !important;
}
.tg-chart-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 12px;
  direction: rtl;
}
[dir="ltr"] .tg-chart-bottom-bar {
  direction: ltr;
}
.tg-series-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tg-series-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s ease;
  color: #fff;
  background: #333;
}
.tg-series-pill.views { background: #0086d3; }
.tg-series-pill.clicks { background: #65b9ac; }
.tg-series-pill.joined { background: #73c03a; }
.tg-series-pill.budget { background: #e67e22; }
.tg-series-pill.is-off {
  background: transparent !important;
  color: rgba(255,255,255,0.4) !important;
  border-color: rgba(255,255,255,0.2) !important;
}
.tg-series-pill:hover {
  filter: brightness(1.1);
}
.tg-csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #0086d3;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .15s;
}
.tg-csv-btn:hover {
  background: rgba(0, 134, 211, 0.12);
}
.tg-chart-tooltip {
  position: absolute;
  background: rgba(27, 39, 52, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  min-width: 130px;
  z-index: 10;
  transition: opacity .1s ease, transform .05s ease;
  direction: ltr;
}
.tg-tooltip-time {
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  font-size: 13px;
}
.tg-tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 3px;
}
.tg-tooltip-row.views b { color: #0086d3; }
.tg-tooltip-row.clicks b { color: #65b9ac; }
.tg-tooltip-row.joined b { color: #73c03a; }
.tg-tooltip-row.spent b { color: #e67e22; }
.tg-tooltip-row span { color: rgba(255,255,255,0.6); }
.stats-table-wrap {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 14px;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.stats-table th {
  position: sticky;
  top: 0;
  background: var(--surf2);
  padding: 8px 12px;
  text-align: inherit;
  border-bottom: 1px solid var(--line);
  color: var(--mut);
  font-weight: 700;
  z-index: 2;
}
.stats-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.stats-table tr:last-child td {
  border-bottom: none;
}
.stats-table tr:hover td {
  background: color-mix(in srgb, var(--acc) 4%, transparent);
}

/* ---------- Card Selection & Checkbox ---------- */
.ad-card-chk {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-inline-end: 8px;
  user-select: none;
  flex-shrink: 0;
}

.ad-card-chk input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ad-chk-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--mut, rgba(255, 255, 255, 0.3));
  background: var(--bg-alt, rgba(0, 0, 0, 0.2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}

.ad-card-chk:hover .ad-chk-box {
  border-color: var(--pri, #2ea6ff);
}

.ad-card-chk input:checked + .ad-chk-box {
  background: var(--pri, #2ea6ff);
  border-color: var(--pri, #2ea6ff);
}

.ad-card-chk input:checked + .ad-chk-box::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.card.ad.selected {
  border-color: var(--pri, #2ea6ff) !important;
  box-shadow: 0 0 0 1px var(--pri, #2ea6ff), 0 6px 20px rgba(46, 166, 255, 0.18) !important;
}

/* ---------- Floating Bulk Action Bar ---------- */
.bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 48px);
  max-width: 840px;
  background: rgba(18, 25, 38, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(46, 166, 255, 0.4);
  border-radius: 16px;
  padding: 10px 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: bulkSlideUp .22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bulkSlideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.bulk-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bulk-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bulk-count {
  font-size: 13.5px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-count strong {
  background: var(--pri, #2ea6ff);
  color: #fff;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
}

.bulk-clear-btn {
  background: none;
  border: none;
  color: var(--mut);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.bulk-clear-btn:hover {
  color: var(--ink);
}

.bulk-actions-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}

.bulk-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .bulk-bar {
    bottom: 12px;
    width: calc(100% - 20px);
    padding: 10px 12px;
  }
  .bulk-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .bulk-actions-btns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .bulk-actions-btns .btn {
    justify-content: center;
    padding: 8px 6px;
    font-size: 11px;
  }
}

/* ---------- Dashboard Page Styles ---------- */
.dash-section {
  margin-top: 24px;
}

.dash-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.dash-status-tile {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  transition: all .18s ease;
  cursor: pointer;
}

.dash-status-tile:hover {
  transform: translateY(-2px);
  border-color: var(--pri, #2ea6ff);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.dash-status-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.dash-status-tile.ok .dash-status-num { color: #38c172; }
.dash-status-tile.review .dash-status-num { color: #2ea6ff; }
.dash-status-tile.paused .dash-status-num { color: #e5a93c; }
.dash-status-tile.warn .dash-status-num { color: #f6993f; }
.dash-status-tile.draft .dash-status-num { color: #94a3b8; }
.dash-status-tile.bad .dash-status-num { color: #f25555; }

.dash-status-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mut);
}

.dash-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 18px;
}

@media (max-width: 900px) {
  .dash-split-grid {
    grid-template-columns: 1fr;
  }
}

.dash-card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--sh);
}

.dash-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.dash-card-h h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.dash-card-h h4 svg {
  width: 16px;
  height: 16px;
  color: var(--pri);
}

/* ========================================================
   Telegram Ads Placement & Multi-Mode Live Previews
   ======================================================== */
.tg-pv-tabs-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.tg-pv-tabs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tg-pv-tabs-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--mut);
  margin-inline-end: 4px;
}
.tg-pv-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surf2);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.tg-pv-tab-btn:hover {
  border-color: var(--acc);
  color: var(--pri);
}
.tg-pv-tab-btn.active {
  background: #2481cc;
  color: #fff !important;
  border-color: #2481cc;
  box-shadow: 0 2px 8px rgba(36, 129, 204, 0.35);
}
.tg-pv-subtabs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 10px;
  background: var(--surf2);
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin-top: 2px;
}
.tg-pv-subtabs-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mut);
  margin-inline-end: 4px;
}
.tg-pv-subtab-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.tg-pv-subtab-btn:hover {
  border-color: var(--acc);
  color: var(--pri);
}
.tg-pv-subtab-btn.active {
  background: #2481cc;
  color: #fff !important;
  border-color: #2481cc;
  box-shadow: 0 1px 6px rgba(36, 129, 204, 0.35);
}

/* 1. Channel Mode (Message in Channel) */
.tg-pv-doodle-bg {
  background-color: #9ab98d;
  background-image: radial-gradient(#8fae82 15%, transparent 16%), radial-gradient(#8fae82 15%, transparent 16%);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
  border-radius: 14px;
  padding: 16px 12px;
  box-sizing: border-box;
}
.tg-pv-channel-card {
  background: #ffffff;
  color: #222222;
  border-radius: 12px;
  padding: 14px 16px 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  max-width: 420px;
  margin: 0 auto;
  direction: rtl;
  text-align: right;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}
.tg-pv-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.tg-pv-head-start {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.tg-pv-ad-badge {
  background: #2481cc;
  color: #fff !important;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 4px;
  line-height: 1.3;
  display: inline-block;
  vertical-align: middle;
}
.tg-pv-whats-this {
  font-size: 11px;
  color: #707579;
  text-decoration: none;
  cursor: default;
}
.tg-pv-channel-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-pv-head-end {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #707579;
  font-size: 13.5px;
  cursor: default;
  flex-shrink: 0;
}
.tg-pv-channel-body {
  font-size: 13px;
  line-height: 1.55;
  color: #222;
  word-break: break-word;
  margin: 6px 0 10px;
}
.tg-pv-channel-btn {
  display: block;
  text-align: center;
  color: #0088cc !important;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none !important;
  padding-top: 9px;
  border-top: 1px solid #eef2f5;
  cursor: pointer;
  transition: opacity .15s;
}
.tg-pv-channel-btn:hover {
  opacity: 0.85;
}

/* 2. Search Mode (Global Search Result) */
.tg-pv-search-wrap {
  background: #0e1620;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 14px;
  color: #fff;
  direction: rtl;
  text-align: right;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}
.tg-pv-search-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  color: #707579;
  font-size: 13px;
  margin-bottom: 14px;
}
.tg-pv-search-sec-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #707579;
  margin-bottom: 10px;
  padding-inline-start: 4px;
}
.tg-pv-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 8px;
}
.tg-pv-search-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #b71c1c;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.1;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
}
.tg-pv-search-info {
  flex: 1;
  min-width: 0;
}
.tg-pv-search-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-pv-search-sub {
  font-size: 11.5px;
  color: #707579;
  margin-top: 2px;
}
.tg-pv-search-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.tg-pv-skeleton-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  opacity: 0.35;
}
.tg-pv-skeleton-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #2a3746;
  flex-shrink: 0;
}
.tg-pv-skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tg-pv-skel-line {
  height: 10px;
  border-radius: 4px;
  background: #2a3746;
}

/* 3. Video Mode (Banner in Video) */
.tg-pv-video-wrap {
  position: relative;
  background: linear-gradient(180deg, #1f2c39 0%, #0d1620 100%);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  aspect-ratio: 16/10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px 10px;
  box-sizing: border-box;
  direction: rtl;
  text-align: right;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tg-pv-video-overlay-card {
  background: rgba(23, 33, 43, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.tg-pv-video-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  margin-top: 6px;
  word-break: break-word;
}
.tg-pv-video-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  width: 100%;
  overflow: hidden;
}
.tg-pv-video-progress {
  height: 100%;
  width: 72%;
  background: #ffffff;
  border-radius: 2px;
}

/* 4. Bot Mode (Banner in Bot) */
.tg-pv-bot-wrap {
  background-color: #9ab98d;
  background-image: radial-gradient(#8fae82 15%, transparent 16%), radial-gradient(#8fae82 15%, transparent 16%);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
  border-radius: 14px;
  padding: 12px;
  box-sizing: border-box;
  direction: rtl;
  text-align: right;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tg-pv-bot-card {
  background: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  margin-bottom: 14px;
}
.tg-pv-bot-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  margin-top: 6px;
  word-break: break-word;
}
.tg-pv-bot-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 6px;
}
.tg-pv-bot-bubble {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
  max-width: 78%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tg-pv-bot-bubble.user {
  align-self: flex-end;
  background: rgba(238, 255, 222, 0.95);
  border-radius: 12px 12px 4px 12px;
}
.tg-pv-bot-bubble-line {
  height: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.18);
}

.tg-pv-channel-body.is-empty-hint,
.tg-pv-video-text.is-empty-hint,
.tg-pv-bot-text.is-empty-hint {
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}
.tg-pv-channel-card .tg-pv-channel-body.is-empty-hint {
  color: #707579;
  font-style: italic;
}
.tg-pv-channel-title.is-empty-hint,
.tg-pv-search-title.is-empty-hint {
  opacity: 0.65;
  font-style: italic;
}
.tg-pv-channel-btn.disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* ---------- Admin TON Deficit Warning Banner ---------- */
.admin-deficit-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.05));
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-right: 4px solid #ef4444;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.08);
  animation: pulseDeficit 3s infinite ease-in-out;
}
@keyframes pulseDeficit {
  0%, 100% { border-color: rgba(239, 68, 68, 0.4); }
  50% { border-color: rgba(239, 68, 68, 0.85); }
}
.admin-deficit-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.admin-deficit-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink);
}
.admin-deficit-title {
  font-size: 15px;
  font-weight: 800;
  color: #dc2626;
}
.admin-deficit-desc {
  font-size: 13px;
  color: var(--mut);
  line-height: 1.6;
}
.admin-deficit-amount {
  font-size: 14px;
  font-weight: 700;
  color: #b91c1c;
  margin: 4px 0;
}
.deficit-badge {
  background: #dc2626;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 800;
}
.admin-deficit-solution {
  font-size: 12px;
  color: var(--mut);
  opacity: 0.9;
}
.admin-deficit-mini-notice {
  border-right: 4px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
  color: #dc2626 !important;
}

/* Telegram Mini App Native Enhancements */
body.is-telegram-miniapp {
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.is-telegram-miniapp .tgads-app {
  min-height: 100vh;
}
@media (max-width: 640px) {
  body.is-telegram-miniapp .shell {
    padding-top: max(env(safe-area-inset-top, 0px), 8px);
  }
}


/* ---------------- ویجت شناور ارتباطات و شبکه‌های اجتماعی (Floating Contact Widget) ---------------- */
.tgads-floating-contact {
  position: fixed;
  bottom: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: inherit;
}
.tgads-floating-contact.pos-left {
  left: 24px;
  right: auto;
}
.tgads-floating-contact.pos-right,
[dir="rtl"] .tgads-floating-contact {
  right: 24px;
  left: auto;
}
[dir="ltr"] .tgads-floating-contact.pos-left {
  left: 24px;
  right: auto;
}
.tgads-fc-toggle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b8ad8, #0077b5);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(27, 138, 216, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}
.tgads-fc-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 25px rgba(27, 138, 216, 0.55);
}
.tgads-fc-toggle .fc-toggle-icon-close {
  display: none;
  font-size: 20px;
  font-weight: bold;
}
.tgads-floating-contact.active .tgads-fc-toggle {
  background: #cf3a3a;
  box-shadow: 0 6px 20px rgba(207, 58, 58, 0.45);
  transform: rotate(90deg);
}
.tgads-floating-contact.active .tgads-fc-toggle .fc-toggle-icon-default {
  display: none;
}
.tgads-floating-contact.active .tgads-fc-toggle .fc-toggle-icon-close {
  display: block;
}
.tgads-fc-menu {
  position: absolute;
  bottom: 66px;
  background: var(--surf, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
  max-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.95);
  transition: all 0.22s ease-out;
  pointer-events: none;
}
[data-theme="dark"] .tgads-fc-menu,
.tgads-app[data-theme="dark"] .tgads-fc-menu {
  background: #17212b;
  border-color: #263646;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.tgads-floating-contact.pos-left .tgads-fc-menu {
  left: 0;
  right: auto;
  transform-origin: bottom left;
}
.tgads-floating-contact.pos-right .tgads-fc-menu,
[dir="rtl"] .tgads-floating-contact .tgads-fc-menu {
  right: 0;
  left: auto;
  transform-origin: bottom right;
}
[dir="ltr"] .tgads-floating-contact.pos-left .tgads-fc-menu {
  left: 0;
  right: auto;
  transform-origin: bottom left;
}
.tgads-floating-contact.active .tgads-fc-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.tgads-fc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none !important;
  color: var(--ink, #1e293b);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s, transform 0.15s;
}
[data-theme="dark"] .tgads-fc-item,
.tgads-app[data-theme="dark"] .tgads-fc-item {
  color: #e6edf4;
}
.tgads-fc-item:hover,
.tgads-fc-item:focus,
.tgads-fc-item:active {
  background: var(--surf2, #f1f5f9);
  text-decoration: none !important;
  transform: translateX(-3px);
}
[dir="rtl"] .tgads-fc-item:hover,
[dir="rtl"] .tgads-fc-item:focus {
  transform: translateX(3px);
}
[data-theme="dark"] .tgads-fc-item:hover,
.tgads-app[data-theme="dark"] .tgads-fc-item:hover {
  background: #1d2a37;
  text-decoration: none !important;
}
.tgads-fc-item .fc-icon {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.tgads-fc-item.fc-bot { color: #0088cc; }
.tgads-fc-item.fc-channel { color: #229ed9; }
.tgads-fc-item.fc-instagram { color: #e1306c; }
.tgads-fc-item.fc-whatsapp { color: #25d366; }
.tgads-fc-item.fc-custom { color: #0284c7; }
.tgads-fc-item.fc-support { color: #8b5cf6; }

/* ---------------- فرم پشتیبانی مهمان و مدال کپچا ---------------- */
.tgads-captcha-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tgads-captcha-q {
  background: var(--card-sub, #f1f5f9);
  color: var(--txt, #1e293b);
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 15px;
  border: 1px solid var(--line, #e2e8f0);
  user-select: none;
  min-width: 80px;
  text-align: center;
  direction: ltr;
}
.tgads-guest-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(10, 18, 28, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.tgads-guest-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 18px;
  max-width: 520px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  animation: tgads-fade-in 0.2s ease-out;
  direction: rtl;
  max-height: 90vh;
  overflow-y: auto;
}
.tgads-guest-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--txt, #0f172a);
}
.tgads-guest-card p {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--mut, #64748b);
  line-height: 1.6;
}


/* ==========================================================================
   Admin Approval & Strict Telegram Ads Content Rules Styles
   ========================================================================== */

.chip-s.pending_admin {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.chip-s.rejected_admin {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.pill.has-pending {
  position: relative;
  border-color: #f59e0b !important;
  color: #d97706 !important;
  font-weight: 700;
}
.pill.has-pending::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 6px #f59e0b;
}

.card.ad.pending-admin {
  border-right: 4px solid #f59e0b;
}
.card.ad.rejected-admin {
  border-right: 4px solid #ef4444;
}

/* Admin Approval Banner inside Editor */
.admin-approval-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  flex-wrap: wrap;
}
.admin-approval-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 260px;
}
.admin-approval-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.admin-approval-info b {
  display: block;
  font-size: 15px;
  color: #b45309;
  margin-bottom: 4px;
}
.admin-approval-info p {
  margin: 0;
  font-size: 13px;
  color: var(--mut, #64748b);
  line-height: 1.5;
}
.admin-approval-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Live Rules Error Box */
.ad-rules-checklist {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  transition: all 0.2s ease;
  animation: tgads-fade-in 0.2s ease-out;
}
[data-theme="dark"] .ad-rules-checklist,
.tgads-app[data-theme="dark"] .ad-rules-checklist {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.rule-err-title {
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #b91c1c;
}
[data-theme="dark"] .rule-err-title,
.tgads-app[data-theme="dark"] .rule-err-title {
  color: #f87171;
}
.rule-err-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #dc2626;
  font-weight: 500;
}
[data-theme="dark"] .rule-err-item,
.tgads-app[data-theme="dark"] .rule-err-item {
  color: #fca5a5;
}
.rule-err-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}
textarea.in.in-err,
input.in.in-err {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

/* Rules bar & Agreement */
.ad-rules-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.rules-modal-btn {
  background: none;
  border: none;
  color: var(--acc, #1b8ad8);
  cursor: pointer;
  font-size: 12.5px;
  padding: 4px 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: opacity 0.2s;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rules-modal-btn:hover {
  opacity: 0.8;
}

.ad-rules-agreement-wrap {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--surf2, #f4f7fa);
  border: 1px dashed var(--line, #cbd5e1);
  border-radius: 10px;
}
[data-theme="dark"] .ad-rules-agreement-wrap,
.tgads-app[data-theme="dark"] .ad-rules-agreement-wrap {
  background: var(--surf2, #1d2a37);
  border-color: var(--line, #263646);
}
.ad-rules-agreement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink, #0e1a2b);
}
.ad-rules-agreement input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--acc, #1b8ad8);
  cursor: pointer;
  flex-shrink: 0;
}

/* Rules guidance button */
.rules-guidance-bar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.rules-guidance-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: rgba(36, 129, 204, 0.08);
  color: var(--acc, #2481cc);
  border: 1px solid rgba(36, 129, 204, 0.28);
  transition: all 0.2s ease;
  text-decoration: none;
  outline: none;
}
.rules-guidance-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  flex-shrink: 0;
}
.rules-guidance-btn:hover {
  background: rgba(36, 129, 204, 0.16);
  border-color: rgba(36, 129, 204, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(36, 129, 204, 0.15);
}
[data-theme="dark"] .rules-guidance-btn,
.tgads-app[data-theme="dark"] .rules-guidance-btn {
  background: rgba(46, 166, 255, 0.12);
  color: #50b5ff;
  border-color: rgba(46, 166, 255, 0.35);
}
[data-theme="dark"] .rules-guidance-btn:hover,
.tgads-app[data-theme="dark"] .rules-guidance-btn:hover {
  background: rgba(46, 166, 255, 0.2);
  border-color: rgba(46, 166, 255, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Media upload specs badges */
.drop-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--mut, #64748b);
  line-height: 1.5;
}
.spec-tag {
  display: inline-block;
  padding: 3px 9px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}
[data-theme="dark"] .spec-tag {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

/* Rules Dialog Modal (Light & Dark Theme) */
.tgads-rules-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(10, 18, 28, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: inherit;
}
.tgads-rules-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  max-width: 680px;
  width: 100%;
  padding: 24px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: tgads-fade-in 0.2s ease-out;
  direction: inherit;
  max-height: 90vh;
  overflow-y: auto;
  color: #0f172a;
}
.tgads-rules-modal[dir="rtl"] .tgads-rules-card {
  direction: rtl;
  text-align: right;
}
.tgads-rules-modal[dir="ltr"] .tgads-rules-card {
  direction: ltr;
  text-align: left;
}
[data-theme="dark"] .tgads-rules-card,
.tgads-rules-modal[data-theme="dark"] .tgads-rules-card,
.tgads-app[data-theme="dark"] .tgads-rules-card {
  background: #17212b;
  border-color: #263646;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  color: #e6edf4;
}
.tgads-rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
[data-theme="dark"] .tgads-rules-head,
.tgads-rules-modal[data-theme="dark"] .tgads-rules-head,
.tgads-app[data-theme="dark"] .tgads-rules-head {
  border-bottom-color: #263646;
}
.tgads-rules-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
[data-theme="dark"] .tgads-rules-head h3,
.tgads-rules-modal[data-theme="dark"] .tgads-rules-head h3,
.tgads-app[data-theme="dark"] .tgads-rules-head h3 {
  color: #e6edf4;
}
.tgads-rules-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s;
}
.tgads-rules-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}
[data-theme="dark"] .tgads-rules-close,
.tgads-rules-modal[data-theme="dark"] .tgads-rules-close,
.tgads-app[data-theme="dark"] .tgads-rules-close {
  color: #8fa3b8;
}
[data-theme="dark"] .tgads-rules-close:hover,
.tgads-rules-modal[data-theme="dark"] .tgads-rules-close:hover,
.tgads-app[data-theme="dark"] .tgads-rules-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.rules-sec {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
[data-theme="dark"] .rules-sec,
.tgads-rules-modal[data-theme="dark"] .rules-sec,
.tgads-app[data-theme="dark"] .rules-sec {
  background: #1d2a37;
  border-color: #263646;
}
.rules-sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 8px;
  color: #1e293b;
}
.rules-sec-title.warn {
  color: #b45309;
}
[data-theme="dark"] .rules-sec-title.warn,
.tgads-rules-modal[data-theme="dark"] .rules-sec-title.warn,
.tgads-app[data-theme="dark"] .rules-sec-title.warn {
  color: #fbbf24;
}
.rules-sec-title.err {
  color: #b91c1c;
}
[data-theme="dark"] .rules-sec-title.err,
.tgads-rules-modal[data-theme="dark"] .rules-sec-title.err,
.tgads-app[data-theme="dark"] .rules-sec-title.err {
  color: #f87171;
}
.rules-sec-title.info {
  color: #1d4ed8;
}
[data-theme="dark"] .rules-sec-title.info,
.tgads-rules-modal[data-theme="dark"] .rules-sec-title.info,
.tgads-app[data-theme="dark"] .rules-sec-title.info {
  color: #60a5fa;
}
.rules-list {
  margin: 0;
  padding: 0;
  padding-inline-start: 22px;
  font-size: 12.8px;
  color: #475569;
  line-height: 1.75;
}
[data-theme="dark"] .rules-list,
.tgads-rules-modal[data-theme="dark"] .rules-list,
.tgads-app[data-theme="dark"] .rules-list {
  color: #94a3b8;
}
.rules-list li {
  margin-bottom: 5px;
}
.rules-list li strong {
  color: #0f172a;
}
[data-theme="dark"] .rules-list li strong,
.tgads-rules-modal[data-theme="dark"] .rules-list li strong,
.tgads-app[data-theme="dark"] .rules-list li strong {
  color: #e2e8f0;
}
.tgads-rules-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
  color: #334155;
}
[data-theme="dark"] .tgads-rules-foot,
.tgads-rules-modal[data-theme="dark"] .tgads-rules-foot,
.tgads-app[data-theme="dark"] .tgads-rules-foot {
  border-top-color: #263646;
  color: #cbd5e1;
}
.card.ad.rejected-admin {
  border-color: rgba(207, 58, 58, 0.45);
  background: var(--surf, #ffffff);
}
[data-theme="dark"] .card.ad.rejected-admin,
.tgads-app[data-theme="dark"] .card.ad.rejected-admin {
  border-color: rgba(239, 106, 106, 0.4);
  background: var(--surf, #17212b);
}

/* ---------- Admin Users Table & Zebra Striping ---------- */
.users-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surf, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: inherit;
}
.users-table th {
  background: var(--surf2, #f1f5f9);
  padding: 13px 14px;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.users-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}
/* Zebra striping: alternate light and contrast rows */
.users-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.032);
}
.users-table tbody tr:nth-child(odd) {
  background: transparent;
}
.users-table tbody tr:hover td {
  background: color-mix(in srgb, var(--acc, #0088cc) 8%, transparent);
}
[data-theme="dark"] .users-table-wrap,
.tgads-app[data-theme="dark"] .users-table-wrap {
  background: #141e28;
  border-color: #243241;
}
[data-theme="dark"] .users-table th,
.tgads-app[data-theme="dark"] .users-table th {
  background: #192533;
  color: #e6edf4;
  border-bottom-color: #263646;
}
[data-theme="dark"] .users-table td,
.tgads-app[data-theme="dark"] .users-table td {
  border-bottom-color: #202d3a;
  color: #d1d9e2;
}
[data-theme="dark"] .users-table tbody tr:nth-child(even),
.tgads-app[data-theme="dark"] .users-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.038);
}
[data-theme="dark"] .users-table tbody tr:nth-child(odd),
.tgads-app[data-theme="dark"] .users-table tbody tr:nth-child(odd) {
  background: transparent;
}
[data-theme="dark"] .users-table tbody tr:hover td,
.tgads-app[data-theme="dark"] .users-table tbody tr:hover td {
  background: rgba(0, 136, 204, 0.16);
}

/* ---------- Clickable Owner Chip ---------- */
.chip-owner.clickable {
  cursor: pointer;
  border: 1px solid rgba(0, 136, 204, 0.28);
  background: color-mix(in srgb, var(--acc, #0088cc) 12%, transparent);
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 99px;
  color: var(--ink);
  outline: none;
}
.chip-owner.clickable:hover {
  background: var(--acc, #0088cc);
  color: #ffffff !important;
  border-color: var(--acc, #0088cc);
  box-shadow: 0 2px 8px rgba(0, 136, 204, 0.35);
  transform: translateY(-1px);
}
[data-theme="dark"] .chip-owner.clickable,
.tgads-app[data-theme="dark"] .chip-owner.clickable {
  background: rgba(0, 136, 204, 0.18);
  border-color: rgba(0, 136, 204, 0.4);
  color: #60a5fa;
}
[data-theme="dark"] .chip-owner.clickable:hover,
.tgads-app[data-theme="dark"] .chip-owner.clickable:hover {
  background: #0088cc;
  color: #ffffff !important;
}

/* ---------- Admin Users Toolbar ---------- */
.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.users-filter-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.users-filter-pills .pill {
  padding: 6px 13px;
  font-size: 12.5px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}
.users-filter-pills .pill.active {
  background: var(--pri, #0088cc);
  color: #ffffff;
  border-color: var(--pri, #0088cc);
  font-weight: 700;
}
.users-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Admin User Detail Modal ---------- */
.tgads-user-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(10, 18, 28, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.tgads-user-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  max-width: 860px;
  width: 100%;
  padding: 24px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: tgads-fade-in 0.2s ease-out;
  direction: inherit;
  max-height: 90vh;
  overflow-y: auto;
  color: #0f172a;
}
.tgads-user-modal[dir="rtl"] .tgads-user-card {
  direction: rtl;
  text-align: right;
}
.tgads-user-modal[dir="ltr"] .tgads-user-card {
  direction: ltr;
  text-align: left;
}
[data-theme="dark"] .tgads-user-card,
.tgads-user-modal[data-theme="dark"] .tgads-user-card,
.tgads-app[data-theme="dark"] .tgads-user-card {
  background: #17212b;
  border-color: #263646;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  color: #e6edf4;
}
.user-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.user-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.user-modal-stat {
  background: var(--surf2, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
[data-theme="dark"] .user-modal-stat,
.tgads-app[data-theme="dark"] .user-modal-stat {
  background: #1d2a37;
  border-color: #263646;
}
.user-modal-stat-label {
  font-size: 11.5px;
  color: var(--mut);
}
.user-modal-stat-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.user-modal-section-title {
  font-size: 14.5px;
  font-weight: 700;
  margin: 18px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Promote Peer Live Card & Channel Photo Option ---------- */
.promote-peer-card {
  margin-top: 10px;
}
.promote-peer-card-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surf2, #18222d);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  transition: all 0.2s ease;
}
.promote-peer-card-wrap.ok {
  border-color: rgba(76, 175, 80, 0.35);
  background: color-mix(in srgb, #4caf50 6%, var(--surf2, #18222d));
}
.promote-peer-card-wrap.bad {
  border-color: rgba(229, 57, 53, 0.35);
  background: color-mix(in srgb, #e53935 8%, var(--surf2, #18222d));
}
.promote-peer-card-wrap.loading {
  font-size: 13px;
  color: var(--mut);
  display: flex;
  align-items: center;
  gap: 10px;
}
.promote-peer-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--acc, #2481cc);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}
.promote-peer-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--acc-soft, rgba(36, 129, 204, 0.15));
  display: inline-grid;
  place-items: center;
  flex: none;
  font-size: 17px;
  font-weight: 800;
  color: var(--acc, #2481cc);
  border: 1.5px solid var(--line, rgba(255, 255, 255, 0.12));
}
.promote-peer-av-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.promote-peer-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.promote-peer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.promote-peer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.promote-peer-type {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--surf, #131b24);
  color: var(--mut);
  border: 1px solid var(--line);
}
.promote-peer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--mut);
}
.promote-peer-un {
  font-family: monospace;
  direction: ltr;
  color: var(--acc);
}
.promote-peer-subs {
  color: var(--ink);
  font-weight: 600;
}
.promote-peer-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.promote-peer-badge.ok {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.promote-peer-badge.bad {
  background: rgba(229, 57, 53, 0.15);
  color: #e53935;
  border: 1px solid rgba(229, 57, 53, 0.3);
}

/* Channel photo CPM surcharge box */
.channel-photo-option-box {
  margin-top: 10px;
  background: var(--surf, #17212b);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}
.channel-photo-toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.channel-photo-toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--acc, #2481cc);
  margin-top: 2px;
  cursor: pointer;
}
.channel-photo-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.channel-photo-toggle-text b {
  font-size: 13.5px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cpm-markup-badge {
  font-size: 11px;
  background: #f59e0b;
  color: #000;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.channel-photo-toggle-text small {
  font-size: 12px;
  color: var(--mut);
  line-height: 1.45;
}

/* Telegram review lock */
.tg-target-locked {
  pointer-events: none;
  opacity: 0.65;
  user-select: none;
  filter: grayscale(0.2);
}
.tg-review-lock-notice {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: var(--ink) !important;
  border-radius: 10px;
  padding: 12px 14px;
}
.tg-review-lock-notice b {
  color: #f59e0b;
}

/* Live preview channel avatar */
.tg-pv-channel-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ---------- Locked Targeting Fields in Review / Active Mode ---------- */
.tg-field-lock-wrap {
  position: relative;
  cursor: pointer;
}
.tg-field-lock-inner {
  pointer-events: none;
}
.tg-field-lock-inner .chips,
.tg-field-lock-inner .pick-wrap,
.tg-field-lock-inner .picker-box,
.tg-field-lock-inner .in,
.tg-field-lock-inner .device-grid {
  padding-inline-end: 38px !important;
  cursor: pointer !important;
}
.tg-field-lock-ico {
  position: absolute;
  inset-inline-end: 12px;
  top: 14px;
  color: var(--mut, #8892a0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}
.tg-field-lock-wrap:hover .tg-field-lock-ico {
  color: #f59e0b;
}

/* ---------- Promote URL Input with Trailing Avatar ---------- */
.url-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  direction: ltr !important;
}
.url-input-wrap .in {
  width: 100%;
  direction: ltr !important;
  text-align: left !important;
  padding-right: 44px !important;
  padding-left: 12px !important;
}
.url-channel-avatar-box {
  position: absolute;
  right: 10px !important;
  left: auto !important;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}
.url-channel-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

[dir="rtl"] .url-input-wrap,
.tgads-app[dir="rtl"] .url-input-wrap {
  direction: ltr !important;
}
[dir="rtl"] .url-input-wrap .in,
.tgads-app[dir="rtl"] .url-input-wrap .in {
  direction: ltr !important;
  text-align: left !important;
  padding-right: 46px !important;
  padding-left: 14px !important;
}
[dir="rtl"] .url-channel-avatar-box,
.tgads-app[dir="rtl"] .url-channel-avatar-box {
  right: 10px !important;
  left: auto !important;
}

/* ---------- Prominent Channel Photo Toggle Switch (iOS / Telegram Style) ---------- */
.channel-photo-sw-row {
  margin-top: 10px;
  background: var(--surf, #1e293b);
  border: 1px solid var(--line, #334155);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s, background-color 0.2s;
}
.channel-photo-sw-row.active {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.08);
}
.channel-photo-sw-row .sw-info {
  flex: 1 1 auto;
  min-width: 0;
}
.channel-photo-sw-row .sw-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--txt, #f1f5f9);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.channel-photo-sw-row .sw-desc {
  font-size: 12px;
  color: var(--mut, #8892a0);
  margin-top: 4px;
  line-height: 1.5;
}

/* ---------- Mobile Drawer Social Submenu Accordion ---------- */
.drawer-accordion {
  margin-top: 8px;
  border-top: 1px solid var(--line, #334155);
  padding-top: 6px;
}
.drawer-accordion-header {
  width: 100%;
  cursor: pointer;
  background: none;
  border: none;
  text-align: inherit;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--txt, #f1f5f9);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s;
}
.drawer-accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}
.drawer-accordion-caret {
  margin-inline-start: auto;
  transition: transform 0.22s ease;
  font-size: 14px;
  color: var(--mut, #8892a0);
}
.drawer-accordion.open .drawer-accordion-caret {
  transform: rotate(180deg);
}
.drawer-accordion-body {
  display: none;
  padding-inline-start: 14px;
  margin-top: 4px;
  flex-direction: column;
  gap: 4px;
}
.drawer-accordion.open .drawer-accordion-body {
  display: flex;
}
.promote-peer-subtle {
  margin-top: 6px;
}

/* ---------- CPM Input with Fiat Equivalent & +30% Badge ---------- */
.cpm-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cpm-input-box {
  flex: 1;
}
.cpm-meta-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cpm-approx-equiv {
  font-size: 13px;
  color: var(--mut, #8892a0);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  direction: ltr;
}
.cpm-markup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.38);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.cpm-markup-badge:hover {
  background: rgba(245, 158, 11, 0.28);
  transform: scale(1.04);
}

/* ---------- Preview Card Layout with Channel Photo ---------- */
.tg-pv-card-body-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
}
.tg-pv-card-text-col {
  flex: 1;
  min-width: 0;
}
.tg-pv-card-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.tg-pv-channel-thumb-box {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
  margin-inline-start: 4px;
}
.tg-pv-channel-photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tg-pv-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #707579;
  font-size: 13px;
  cursor: default;
  flex-shrink: 0;
  margin-inline-start: 2px;
}
.tg-pv-card-footer {
  border-top: 1px solid #f0f2f5;
  margin-top: 6px;
  padding-top: 4px;
}
body.dark .tg-pv-channel-card {
  background: #17212b;
  color: #ffffff;
}
body.dark .tg-pv-channel-card .tg-pv-channel-title {
  color: #ffffff;
}
body.dark .tg-pv-channel-card .tg-pv-channel-body {
  color: rgba(255, 255, 255, 0.92);
}
body.dark .tg-pv-card-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}


/* ---------- Delete Choice Modal ---------- */
.tgads-choice-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  padding: 16px;
  animation: tgadsFadeIn .15s ease;
}
.tgads-choice-modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card, #212d3b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tgads-choice-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.tgads-choice-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink, #fff);
  margin: 0;
}
.tgads-choice-close {
  background: transparent;
  border: 0;
  color: var(--mut, #8e9ca8);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
}
.tgads-choice-close:hover {
  color: var(--ink, #fff);
  background: rgba(255, 255, 255, 0.08);
}
.tgads-choice-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tgads-choice-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--mut, #8e9ca8);
  margin-bottom: 4px;
}
.tgads-choice-card {
  width: 100%;
  text-align: right;
  background: var(--bg-item, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all .15s ease;
  font-family: inherit;
}
[dir="ltr"] .tgads-choice-card {
  text-align: left;
}
.tgads-choice-card:hover {
  transform: translateY(-1px);
}
.tgads-choice-card.pri {
  border-color: rgba(46, 166, 255, 0.4);
  background: rgba(46, 166, 255, 0.08);
}
.tgads-choice-card.pri:hover {
  background: rgba(46, 166, 255, 0.14);
  border-color: var(--pri, #2ea6ff);
}
.tgads-choice-card.danger {
  border-color: rgba(239, 68, 68, 0.25);
}
.tgads-choice-card.danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.6);
}
.tgads-choice-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.tgads-choice-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tgads-choice-text b {
  font-size: 14px;
  color: var(--ink, #fff);
}
.tgads-choice-card.pri .tgads-choice-text b {
  color: var(--pri, #2ea6ff);
}
.tgads-choice-card.danger .tgads-choice-text b {
  color: #f25555;
}
.tgads-choice-text small {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--mut, #8e9ca8);
}
.tgads-choice-foot {
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
}
/* مودال به body اضافه می‌شود (خارج از .tgads-app) و پس‌زمینه‌اش همیشه تیره است؛
   بنابراین رنگ دکمه انصراف نباید به متغیر --ink تم روشن وابسته باشد */
.tgads-choice-foot .btn.ghost {
  color: #e6edf4;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.tgads-choice-foot .btn.ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}
.ad-tool-btn.warn {
  color: #e5a93c;
}
.ad-tool-btn.warn:hover {
  border-color: #e5a93c;
  background: rgba(229, 169, 60, 0.12);
}