/* Self-hosted edition: features of the main edition that do not exist here are never shown.
   Loaded after each page's own styles; !important wins over scripts that un-hide these elements. */
[data-channel="bale"], [data-channel="rubika"], [data-chip="bale"], [data-chip="rubika"],
label:has(> .filter-platform-cb[value="bale"]), label:has(> .filter-platform-cb[value="rubika"]),
[data-channel="telegram"] [data-connect-zone], #tgPartPrivate, #tgGuideBtn, #tgWidgetContainer,
[data-go="charge"], [data-go="shopbot"], [data-go="balebot"], a[href^="/help/"], #bbPlatforms, #bbCopyBtn,
#tokenPop, #planBadge, #planBadgeDrawer, #planDialog, #planUpsell, #planLimitLine, #planFeatureGreen,
#storeCard, #storeCtaRail, #storeCtaDrawer, #storeMyRail, #storeMyDrawer, #storeConnectDialog,
#storeKbBtn, #storeKbHintEl, #storeAwaiting,
#ppTabBale, #ppTabRubika, #ppPanelBale, #ppPanelRubika, #chBalePanel, #chRubikaPanel, #baleDialog, #rubikaDialog,
#shopBotPop, #dangerAgencyRow, #agiDiscStore, #agiDiscWoo, #agiDiscStoreNote,
#waTabLite, #waTabPro, #waPanelLite, #waPanelPro, #whatsappDialog,
#changePassItem, #passwordDialog,
.credits, #wooDialog .field-hint:has([data-go="shopbot"]),
.group-head:has(> h2[data-i18n="developerTools"]), .group-head:has(> h2[data-i18n="developerTools"]) + .grid {
  display: none !important;
  --selfhost-off: 1; /* openDialog() refuses dialogs marked like this */
}

/* Nothing is charged in this edition (migration 0005): no cost or balance figures (tools/port/16_no_token_costs.py). */
.stat:has(> #estCost), .stat:has(> #estBal), .stat:has(> #anTokens),
#priceNote, #costNote, [data-popover-btn="csvPop"],
.card:has([data-i18n="recharge_history_title"]),
.table:has(#historyTableBody) thead th:nth-child(5), #historyTableBody > tr > td:nth-child(5) {
  display: none !important;
}
.stat-grid:has(> .stat > #estCost) { grid-template-columns: minmax(0, 1fr) !important; }
.stat-grid:has(> .stat > #anTokens) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

/* License banner (panel/selfhost_notice.js). */
.rpl-lic-bar {
  position: relative; z-index: 2147483000;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px 16px; font: 600 14px/1.6 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  text-align: center;
}
.rpl-lic-bar.is-info { background: #FFF4DB; color: #7A4B00; border-bottom: 1px solid #F3D28B; }
.rpl-lic-bar.is-alert { background: #FDE7E9; color: #9F1239; border-bottom: 1px solid #F5B5BE; }
.rpl-lic-close {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0,0,0,.06); color: inherit; font-size: 18px; line-height: 1;
}
@media (prefers-color-scheme: dark) {
  .rpl-lic-bar.is-info { background: #3A2A06; color: #FFD79A; border-color: #5C430E; }
  .rpl-lic-bar.is-alert { background: #3B0D16; color: #FFB3BF; border-color: #6B1A28; }
}

/* WhatsApp: connect with a permanent token (panel/whatsapp_connect.html, selfhost_wa_manual.js) */
.rpl-wa-manual { text-align: start; margin-top: 4px; }
.rpl-wa-or { display: flex; align-items: center; gap: 10px; margin: 24px 0 18px; color: #64748b; font-size: 13px; }
.rpl-wa-or::before, .rpl-wa-or::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
.rpl-wa-title { font-size: 17px; margin: 0 0 6px; }
.rpl-wa-hint { font-size: 12.5px; line-height: 1.7; color: #64748b; margin: 0 0 16px; overflow-wrap: anywhere; }
.rpl-wa-field { margin-bottom: 12px; }
.rpl-wa-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.rpl-wa-field input { width: 100%; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 12px; font-size: 15px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #fff; color: #0f172a; text-align: left; }
.rpl-wa-field input:focus { outline: 2px solid #25D366; outline-offset: 1px; border-color: #25D366; }
.rpl-wa-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6; margin: 4px 0 12px; overflow-wrap: anywhere; }
.rpl-wa-btn { background: #128C7E; box-shadow: 0 4px 10px rgba(18, 140, 126, .3); margin-top: 6px; }
.rpl-wa-btn:hover { background: #0f7a6e; }
.rpl-wa-pick { margin: 6px 0 12px; }
.rpl-wa-pick-title { font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.rpl-wa-pick-list { display: flex; flex-direction: column; gap: 8px; }
.rpl-wa-opt { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid #e2e8f0; border-radius: 12px; cursor: pointer; background: #fff; }
.rpl-wa-opt:has(input:checked) { border-color: #25D366; background: #f0fdf4; }
.rpl-wa-opt input { accent-color: #25D366; margin: 0; }
.rpl-wa-opt-txt { display: flex; flex-direction: column; gap: 2px; }
.rpl-wa-opt-num { font-weight: 700; font-size: 15px; unicode-bidi: isolate; }
.rpl-wa-opt-name { font-size: 12px; color: #64748b; }

/* Chats of the main account and its sub-accounts on one page (panel/chats.php, selfhost_allchats.js) */
.rp-acct-bar { display: flex; align-items: center; gap: 8px; padding: 8px var(--sp-5, 20px); border-bottom: 1px solid var(--border-soft, #e2e8f0); flex-shrink: 0; color: var(--text-muted, #64748b); }
.rp-acct-bar[hidden] { display: none; }
.rp-acct-bar > i { font-size: 17px; flex: none; }
.rp-acct-select { flex: 1; min-width: 0; height: 34px; padding: 0 12px; border: 1px solid var(--border-color, #cbd5e1); border-radius: var(--r-full, 999px); background: var(--search-bg, #f8fafc); color: var(--text-main, #0f172a); font: inherit; font-size: var(--fs-base, 13px); font-weight: 600; cursor: pointer; }
.rp-acct-select:focus-visible { outline: 2px solid var(--brand-400, #60a5fa); outline-offset: 1px; }
.chat-list-label.rp-acct-label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; color: var(--brand-600, #2563eb); border-color: var(--brand-200, #bfdbfe); background: var(--brand-50, #eff6ff); }
body.dark-mode .chat-list-label.rp-acct-label { color: #93c5fd; border-color: rgba(147,197,253,.3); background: rgba(59,130,246,.12); }
@media (max-width: 768px) { .rp-acct-bar { padding: 6px var(--sp-4, 16px); } }
