:root {
  --bg: #05090e;
  --card: #0f151d;
  --card2: #121a24;
  --line: #1a2430;
  --cyan: #00d2ff;
  --cyan-soft: rgba(0, 210, 255, .12);
  --text: #f0f4f8;
  --muted: #8b97a8;
  --green: #2dff8a;
  --orange: #ff9f43;
  --red: #ef5350;
  --stop-bg: rgba(239, 83, 80, .18);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

body {
  padding: max(8px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(520px 220px at 50% -8%, rgba(0, 210, 255, .11), transparent 72%),
    radial-gradient(300px 120px at 80% 20%, rgba(0, 210, 255, .04), transparent 70%),
    var(--bg);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  min-height: calc(100vh - 20px);
}

.panel-page { max-width: 980px; }

.center-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hidden { display: none !important; }

/* ── Brand ── */
.brand {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-align: center;
  line-height: 1.1;
}

.brand span { color: #fff; }

.brand b {
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(0, 210, 255, .55);
}

.brand.glow {
  filter: drop-shadow(0 0 12px rgba(0, 210, 255, .15));
}

.sub {
  margin: 6px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ── Auth ── */
.auth-hero { padding: 22px 0 16px; }

.auth-card {
  background: linear-gradient(180deg, #101820 0%, #0b1118 100%);
  border: 1px solid rgba(0, 210, 255, .32);
  border-radius: 16px;
  padding: 16px 14px 14px;
  box-shadow: 0 0 28px rgba(0, 210, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .03);
}

.auth-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}

.auth-head-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 210, 255, .35);
  background: rgba(0, 210, 255, .08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}

.field-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #060a10;
  border: 1px solid rgba(0, 210, 255, .22);
  border-radius: 12px;
  padding: 0 12px;
}

.field-ico {
  color: var(--cyan);
  opacity: .85;
  flex: 0 0 auto;
  display: flex;
}

.field-wrap input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 13px 0;
}

.field-wrap input::placeholder { color: #6d7a8a; }

.btn-primary {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #021018;
  background: linear-gradient(90deg, #5defff 0%, var(--cyan) 100%);
  box-shadow: 0 0 20px rgba(0, 210, 255, .42);
  cursor: pointer;
}

.btn-primary.sm {
  width: auto;
  min-width: 88px;
  margin-top: 0;
  padding: 10px 14px;
}

.btn-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-arrow svg { flex: 0 0 auto; }

.btn-ghost, .filter-btn, .clear-btn, .chip-full, .top-tab, .send, .qbtn, .list-row, .btn-danger, .sub-btn {
  font-family: inherit;
  cursor: pointer;
}

.btn-ghost {
  flex: 1;
  border: 1px solid #243041;
  background: transparent;
  color: #d7dee8;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
}

.btn-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}

.tiny { font-size: 11px; }
.muted { color: var(--muted); }
.err { color: var(--red); }
.code-note { margin: 6px 2px 0; }

.auth-hint {
  min-height: 14px;
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.secure {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: #6d7a8a;
  font-size: 10px;
}

.secure svg { color: #6d7a8a; flex: 0 0 auto; }

/* ── Auth labels ── */
.auth-label {
  margin: 0 0 4px;
  color: #eef3f8;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}
.auth-label-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.auth-card-head span[data-i18n],
.auth-card-head span {
  text-transform: none;
  letter-spacing: .02em;
  font-size: 13px;
  font-weight: 600;
}

/* ── FAQ ── */
.faq { margin-top: 22px; padding-bottom: 8px; }

.faq-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.faq-head em {
  font-style: normal;
  color: #eef3f8;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.faq-item {
  background: #0a1017;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #eef3f8;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(0, 210, 255, .22);
  background: rgba(0, 210, 255, .06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}

.faq-item summary b {
  color: var(--cyan);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.faq-item[open] summary b { transform: rotate(45deg); display: inline-block; }

.faq-item p {
  margin: 0;
  padding: 0 14px 14px 52px;
  color: #9aa8b8;
  font-size: 12px;
  line-height: 1.55;
}

/* ── Panel topbar ── */
.panel-page { padding-bottom: 12px; }

.panel-topbar {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 6px;
  padding: 2px 0 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #1a222d;
}

.topbar-logo {
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 8px rgba(0, 210, 255, .45));
}

.topbar-profile {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-profile:active { color: var(--cyan); }

.panel-topbar .top-tabs {
  border-bottom: 0;
  margin-bottom: 0;
}

.top-tabs {
  display: grid;
  gap: 0;
  border-bottom: 1px solid #1a222d;
  margin-bottom: 10px;
}

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

.top-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 1px 11px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .04em;
  position: relative;
}

.top-tab.active { color: var(--cyan); }

.top-tab.active::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 210, 255, .85);
  border-radius: 2px;
}

body.tab-sub-active #news-top,
body.tab-sub-active #news-bottom { display: none; }

.tab-view { display: none; }
.tab-view.active { display: block; }

.news {
  background: rgba(0, 210, 255, .06);
  border: 1px solid rgba(0, 210, 255, .16);
  border-radius: 10px;
  padding: 7px 10px;
  color: #9fdfff;
  font-size: 11px;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news.bottom {
  margin-top: 10px;
  color: #b7c0cc;
  border-color: #1c2733;
  background: #0a0f14;
}

.sec-title {
  margin: 4px 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #c5ced8;
}

/* ── Quick grid ── */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.quick-grid.one { grid-template-columns: 1fr 1fr; }

.qbtn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  border: 1px solid #1c2836;
  background: var(--card);
  border-radius: 14px;
  padding: 12px 10px;
  color: var(--text);
  min-height: 72px;
}

.qbtn-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 210, 255, .14);
  border: 1px solid rgba(0, 210, 255, .28);
  color: var(--cyan);
  margin-top: 2px;
}

.qbtn-icon.play {
  background: rgba(0, 210, 255, .2);
  box-shadow: 0 0 12px rgba(0, 210, 255, .15);
}

.qbtn-icon.stop {
  background: var(--stop-bg);
  border-color: rgba(239, 83, 80, .35);
  color: #ff8a80;
}

.qbtn.stop .qbtn-body b { color: #ffcdd2; }

.qbtn-body {
  flex: 1;
  min-width: 0;
}

.qbtn-body b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.qbtn-body > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

/* ── List cards ── */
.list-card {
  background: var(--card);
  border: 1px solid #1a2430;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}

.list-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #141c26;
  background: transparent;
  color: inherit;
  padding: 12px 14px;
}

.list-row:last-child { border-bottom: 0; }

.row-ico {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}

.row-ico.warn { color: #ffb74d; }

.list-row > div { flex: 1; min-width: 0; }

.list-row b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.list-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row > em {
  color: #5d6b7c;
  font-style: normal;
  font-size: 18px;
  font-weight: 300;
}

.list-row.static { cursor: default; }
.list-row:active:not(.static) { background: rgba(0, 210, 255, .04); }

.list-row.danger b { color: #ff8aa0; }
.list-row.danger span { color: #a66; }
.list-row.danger .row-ico { color: #ff4d6d; }

/* ── Switch ── */
.switch { position: relative; width: 44px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #243041;
  transition: .15s;
}

.switch i::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: .15s;
}

.switch input:checked + i {
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 210, 255, .45);
}

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

/* ── Logs ── */
.log-bar { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }

.filter-btn, .clear-btn {
  border: 1px solid #223041;
  background: #0b1118;
  color: #c9d3df;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
}

.clear-btn { color: var(--cyan); border-color: rgba(0, 210, 255, .25); }

.logs { max-height: calc(100vh - 290px); min-height: 160px; overflow: auto; }

.log-item {
  display: grid;
  grid-template-columns: 52px 10px 1fr;
  gap: 8px;
  align-items: start;
  padding: 7px 0;
  border-bottom: 1px solid #121820;
}

.log-item time { color: #6d7a8a; font-size: 11px; }

.log-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  box-shadow: 0 0 8px currentColor;
}

.log-item .dot.ok { color: var(--green); background: var(--green); }
.log-item .dot.info { color: #3aa0ff; background: #3aa0ff; }
.log-item .dot.warn { color: var(--orange); background: var(--orange); }
.log-item .dot.error { color: var(--red); background: var(--red); }

.log-item .title { font-size: 12px; font-weight: 600; }
.log-item .detail { margin-top: 2px; font-size: 10px; color: #7f8b9a; }
.log-foot { margin-top: 6px; text-align: center; color: #556170; font-size: 10px; }

.console {
  margin-top: 10px;
  background: #0a1017;
  border: 1px solid rgba(0, 210, 255, .2);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 0 16px rgba(0, 210, 255, .05);
}

.console-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: .04em;
  margin-bottom: 8px;
}

.cmd-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #070b10;
  border: 1px solid #1c2733;
  border-radius: 12px;
  padding: 4px 8px 4px 10px;
}

.cmd-bar .prompt { color: var(--cyan); font-weight: 700; font-size: 14px; flex: 0 0 auto; }

.cmd-bar input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  padding: 10px 2px;
}

.send {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 210, 255, .12);
  color: var(--cyan);
  font-size: 15px;
}

.tpl-hint { margin: 10px 2px 0; }

.chip-full {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #141c26;
  background: transparent;
  color: #cfefff;
  padding: 11px 12px;
  font-size: 12px;
}

.chip-full:last-child { border-bottom: 0; }

/* ── Settings ── */
.set-sec {
  margin: 14px 4px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #6d7a8a;
}

.set-sec:first-child { margin-top: 4px; }

/* ── Sheet ── */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, .72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  animation: fadeIn .18s ease;
}

.sheet-card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid #223041;
  border-radius: 16px;
  padding: 14px;
  animation: slideUp .22s ease;
}

.sheet-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }

.sheet-card input[type=password],
.sheet-card input[type=text],
.sheet-card input[type=number],
.sheet-card textarea {
  width: 100%;
  border: 1px solid #223041;
  background: #070b10;
  color: #fff;
  border-radius: 10px;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 13px;
  margin-bottom: 4px;
  outline: none;
}

.sheet-card input:focus, .sheet-card textarea:focus {
  border-color: rgba(0, 210, 255, .45);
  box-shadow: 0 0 0 2px rgba(0, 210, 255, .1);
}

.field-label {
  display: block;
  margin: 8px 2px 5px;
  font-size: 11px;
  font-weight: 600;
  color: #8b97a8;
}

.choice-list { display: flex; flex-direction: column; gap: 8px; }

.choice-list button, .choice-btn {
  text-align: left;
  border: 1px solid #223041;
  background: #070b10;
  color: #eef3f8;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}

.choice-list button.active, .choice-btn.active {
  border-color: rgba(0, 210, 255, .5);
  color: var(--cyan);
  background: rgba(0, 210, 255, .06);
  box-shadow: 0 0 0 1px rgba(0, 210, 255, .12), 0 0 18px rgba(0, 210, 255, .08);
}

.key-box {
  word-break: break-all;
  background: #070b10;
  border: 1px solid rgba(0, 210, 255, .28);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  color: #9fdfff;
  margin: 10px 0 0;
}

.mini-list { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow: auto; }

.mini-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #141c26;
  font-size: 12px;
}

.mini-list button {
  border: 1px solid rgba(255, 77, 109, .35);
  background: transparent;
  color: #ff8aa0;
  border-radius: 8px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 11px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(18px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

body.appearance-minimal .quick-grid #q-pause,
body.appearance-minimal .quick-grid #q-restart { display: none; }
body.appearance-minimal .quick-grid { grid-template-columns: 1fr 1fr; }

/* ── Subscription ── */
.sub-head { margin: 6px 0 18px; }

.sub-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
}

.sub-desc {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  max-width: 720px;
}

.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .sub-grid { grid-template-columns: 1fr; }
  .panel-topbar .top-tab { font-size: 7px; }
}

.sub-card {
  background: linear-gradient(180deg, #0f151d 0%, #0a1017 100%);
  border: 1px solid #1c2836;
  border-radius: 16px;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
}

.sub-card-lifetime {
  border-color: rgba(0, 210, 255, .4);
  box-shadow: 0 0 0 1px rgba(0, 210, 255, .06), 0 0 24px rgba(0, 210, 255, .06);
}

.sub-card-lifetime.owned {
  border-color: rgba(45, 255, 138, .35);
}

.sub-card-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  margin-bottom: 12px;
}

.sub-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(0, 210, 255, .35);
  background: rgba(0, 210, 255, .08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}

.sub-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.sub-card-head h2, .sub-card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.sub-card-title { margin-bottom: 6px; }

.sub-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--cyan);
  background: rgba(0, 210, 255, .12);
  border: 1px solid rgba(0, 210, 255, .25);
  border-radius: 999px;
  padding: 3px 8px;
}

.sub-badge.active {
  color: var(--green);
  background: rgba(45, 255, 138, .1);
  border-color: rgba(45, 255, 138, .3);
}

.sub-card-text {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.sub-features {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  flex: 1;
}

.sub-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 500;
  color: #dce4ee;
  border-bottom: 1px solid #141c26;
}

.sub-features li:last-child { border-bottom: 0; }

.feat-ico {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(0, 210, 255, .28);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.sub-price-block { margin-bottom: 14px; }

.sub-price {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.sub-price-note, .sub-total-note {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.sub-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--muted);
}

.device-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #060a10;
  border: 1px solid #1c2733;
  border-radius: 12px;
  padding: 6px 8px;
  margin-bottom: 6px;
}

.step-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #243041;
  border-radius: 10px;
  background: #0d141d;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.step-btn:active:not(:disabled) {
  border-color: rgba(0, 210, 255, .4);
  color: var(--cyan);
}

.step-btn:disabled { opacity: .35; cursor: default; }

.step-val {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  min-width: 48px;
  text-align: center;
}

.sub-range-hint {
  margin: 0 0 10px;
  font-size: 10px;
  color: var(--muted);
}

.device-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--cyan) var(--pct, 16%), #1c2733 var(--pct, 16%), #1c2733 100%);
  outline: none;
  margin: 4px 0 6px;
}

.device-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 210, 255, .6);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #5d6b7c;
  margin-bottom: 14px;
}

.sub-total-box {
  background: #060a10;
  border: 1px solid #1c2733;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.sub-total {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}

.sub-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  transition: box-shadow .15s, transform .1s;
}

.sub-btn:active:not(:disabled) { transform: scale(.98); }

.sub-btn.outline {
  border: 1px solid rgba(0, 210, 255, .45);
  background: transparent;
  color: var(--cyan);
}

.sub-btn.solid {
  border: 0;
  background: linear-gradient(90deg, #5defff, var(--cyan));
  color: #021018;
  box-shadow: 0 0 16px rgba(0, 210, 255, .35);
}

.sub-btn:disabled { opacity: .45; cursor: default; }
.sub-btn.sm { width: auto; white-space: nowrap; padding: 10px 14px; font-size: 11px; }

.sub-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  background: #0a1017;
  border: 1px solid #1c2836;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .sub-banner { grid-template-columns: auto 1fr; }
  .sub-banner-thanks { grid-column: 1 / -1; }
}

.sub-banner-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 210, 255, .1);
  border: 1px solid rgba(0, 210, 255, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 210, 255, .12);
}

.sub-banner-body b {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.sub-banner-body p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.sub-banner-thanks {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  white-space: nowrap;
}

.sub-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #0a1017;
  border: 1px solid #1c2836;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}

.sub-extra b { display: block; font-size: 13px; margin-bottom: 4px; }
.sub-extra p { margin: 0; font-size: 11px; color: var(--muted); }

.sub-foot {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 10px;
  color: #5d6b7c;
  line-height: 1.4;
}

.sub-status {
  margin-top: 10px;
  font-size: 11px;
  color: var(--cyan);
  min-height: 16px;
}


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

/* Broadcast status banner */
.broadcast-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  border: 1px solid #1c2836;
  background: #0d141d;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.broadcast-status .bs-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #5d6b7c;
  box-shadow: 0 0 0 3px rgba(93, 107, 124, .2);
}
.broadcast-status .bs-text b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.broadcast-status .bs-text span {
  font-size: 11px;
  color: var(--muted);
}
.broadcast-status.stopped .bs-dot { background: #6d7a8a; }
.broadcast-status.stopped { border-color: #243041; }

.broadcast-status.running {
  border-color: rgba(45, 255, 138, .35);
  background: rgba(45, 255, 138, .06);
  box-shadow: 0 0 20px rgba(45, 255, 138, .08);
}
.broadcast-status.running .bs-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(45, 255, 138, .25), 0 0 12px rgba(45, 255, 138, .6);
  animation: pulse-dot 1.4s ease infinite;
}
.broadcast-status.running .bs-text b { color: #b8ffd4; }

.broadcast-status.paused {
  border-color: rgba(255, 159, 67, .35);
  background: rgba(255, 159, 67, .06);
}
.broadcast-status.paused .bs-dot {
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 159, 67, .25);
}
.broadcast-status.paused .bs-text b { color: #ffd4a8; }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: .85; }
}

.qbtn.is-active {
  border-color: rgba(0, 210, 255, .55);
  box-shadow: 0 0 0 1px rgba(0, 210, 255, .15), 0 0 18px rgba(0, 210, 255, .12);
}
.qbtn.stop.is-active {
  border-color: rgba(239, 83, 80, .5);
  box-shadow: 0 0 0 1px rgba(239, 83, 80, .15), 0 0 18px rgba(239, 83, 80, .12);
}
.qbtn:disabled { opacity: .4; pointer-events: none; }

/* Logs redesign */
.logs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.logs-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.logs-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}
.logs-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.pill-btn {
  border: 1px solid #223041;
  background: #0b1118;
  color: #c9d3df;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.pill-btn.muted { color: var(--muted); }
.logs-panel {
  min-height: 200px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding: 2px 0;
}
.log-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #1a2430;
  background: #0d141d;
}
.log-card .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex: 0 0 auto;
  box-shadow: 0 0 8px currentColor;
}
.log-card .dot.ok { color: var(--green); background: var(--green); }
.log-card .dot.info { color: #3aa0ff; background: #3aa0ff; }
.log-card .dot.warn { color: var(--orange); background: var(--orange); }
.log-card .dot.error { color: var(--red); background: var(--red); }
.log-card-body { flex: 1; min-width: 0; }
.log-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.log-card-top .title {
  font-size: 12px;
  font-weight: 600;
  color: #eef3f8;
}
.log-card-top time {
  font-size: 10px;
  color: #6d7a8a;
  flex-shrink: 0;
}
.log-card .detail {
  font-size: 10px;
  color: #7f8b9a;
  line-height: 1.35;
  word-break: break-word;
}
.logs-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 12px;
  border: 1px dashed #1c2836;
  border-radius: 14px;
  background: rgba(0, 0, 0, .15);
}
.logs-empty b {
  display: block;
  color: #9fadbe;
  font-size: 13px;
  margin-bottom: 4px;
}

.top-tabs.five { grid-template-columns: repeat(5, 1fr); }
body.tab-msg-active #news-top, body.tab-msg-active #news-bottom { display: none; }

/* Python console */
.py-console-wrap {
  background: #0a0e14;
  border: 1px solid #1a2430;
  border-radius: 14px;
  overflow: hidden;
  font-family: "Cascadia Code", "Consolas", "IBM Plex Mono", monospace;
  box-shadow: inset 0 0 30px rgba(0,0,0,.35);
}
.py-console-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #121820;
  border-bottom: 1px solid #1a2430;
}
.py-dots { display: flex; gap: 5px; }
.py-dots i { width: 9px; height: 9px; border-radius: 50%; background: #3a4555; display: block; }
.py-dots i:nth-child(1) { background: #ff5f57; }
.py-dots i:nth-child(2) { background: #febc2e; }
.py-dots i:nth-child(3) { background: #28c840; }
.py-title { flex: 1; font-size: 11px; color: #8b97a8; }
.py-clear { border: 0; background: transparent; color: #6d7a8a; font-size: 11px; cursor: pointer; font-family: inherit; }
.py-output {
  min-height: 220px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}
.py-line { margin-bottom: 4px; white-space: pre-wrap; word-break: break-word; }
.py-line.in { color: #79c0ff; }
.py-line.out { color: #c9d1d9; }
.py-line.err { color: #ff7b72; }
.py-line.ok { color: #7ee787; }
.py-line.dim { color: #6e7681; font-size: 11px; }
.py-input-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 12px 10px;
  border-top: 1px solid #1a2430;
  background: #0d1117;
}
.py-prompt { color: #7ee787; font-size: 12px; padding-top: 8px; flex: 0 0 auto; }
.py-input-wrap { flex: 1; position: relative; }
.py-input-row input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #e6edf3;
  font-family: inherit;
  font-size: 12px;
  padding: 8px 4px;
}
.cmd-suggest {
  position: absolute;
  left: 0; right: 0; bottom: 100%;
  margin-bottom: 4px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  max-height: 160px;
  overflow: auto;
  z-index: 5;
  box-shadow: 0 -8px 24px rgba(0,0,0,.4);
}
.cmd-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #c9d1d9;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  border-bottom: 1px solid #21262d;
}
.cmd-suggest button:last-child { border-bottom: 0; }
.cmd-suggest button.active, .cmd-suggest button:hover { background: #1f6feb33; color: #79c0ff; }
.cmd-suggest b { color: #7ee787; }
.cmd-suggest span { color: #8b949e; margin-left: 6px; }
.py-hint { padding: 0 12px 10px; font-size: 10px; color: #484f58; font-family: inherit; }

/* Messenger */
.msg-accounts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 8px;
}
.msg-acc {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #243041;
  background: #0d141d;
  color: #c9d3df;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.msg-acc.active { border-color: rgba(0,210,255,.5); color: var(--cyan); background: rgba(0,210,255,.08); }
.msg-acc-del {
  border: 0; background: transparent; color: #ff8aa0; font-size: 14px; cursor: pointer; padding: 0 2px; line-height: 1;
}
.msg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.msg-head b { font-size: 16px; }
.msg-dialogs { display: flex; flex-direction: column; gap: 2px; }
.msg-dialog {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 10px; border-radius: 12px; border: 0;
  background: transparent; color: inherit; text-align: left; cursor: pointer; width: 100%;
  font-family: inherit;
}
.msg-dialog:active { background: rgba(0,210,255,.06); }
.msg-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, #1a3a4a, #0d141d);
  border: 1px solid rgba(0,210,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan); font-weight: 700; font-size: 16px; flex: 0 0 auto;
}
.msg-d-body { flex: 1; min-width: 0; }
.msg-d-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.msg-d-top b { font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-d-top time { font-size: 10px; color: #6d7a8a; flex-shrink: 0; }
.msg-d-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-unread {
  min-width: 20px; height: 20px; border-radius: 999px; background: var(--cyan);
  color: #021018; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.msg-chat-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid #1a2430;
}
.msg-back {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid #243041;
  background: #0d141d; color: var(--cyan); font-size: 22px; cursor: pointer; line-height: 1;
}
.msg-messages {
  min-height: 300px; max-height: calc(100vh - 280px);
  overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 0;
}
.msg-bubble {
  max-width: 82%; padding: 9px 12px; border-radius: 14px;
  font-size: 13px; line-height: 1.35; word-break: break-word;
}
.msg-bubble.in { align-self: flex-start; background: #18222e; border: 1px solid #243041; color: #eef3f8; border-bottom-left-radius: 4px; }
.msg-bubble.out { align-self: flex-end; background: rgba(0,210,255,.15); border: 1px solid rgba(0,210,255,.28); color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble img { max-width: 100%; border-radius: 10px; margin-top: 4px; display: block; }
.msg-bubble time { display: block; font-size: 9px; color: #6d7a8a; margin-top: 4px; text-align: right; }
.msg-compose {
  display: flex; align-items: center; gap: 8px;
  padding-top: 10px; border-top: 1px solid #1a2430;
}
.msg-compose input {
  flex: 1; border: 1px solid #243041; background: #0a1017; color: #fff;
  border-radius: 999px; padding: 10px 14px; font-family: inherit; font-size: 13px; outline: none;
}
.msg-attach {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid #243041;
  display: flex; align-items: center; justify-content: center; color: var(--cyan); cursor: pointer;
}
.msg-send {
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: linear-gradient(90deg, #5defff, var(--cyan)); color: #021018; font-size: 16px; cursor: pointer;
}
.msg-empty { text-align: center; padding: 40px 16px; color: var(--muted); font-size: 12px; }

/* Telegram-like messenger v3 */
.tg-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #1a2430;
}
.tg-acc-btn {
  flex: 1; display: flex; align-items: center; gap: 10px;
  border: 1px solid #243041; background: #0d141d; border-radius: 14px;
  padding: 8px 12px; cursor: pointer; color: inherit; font-family: inherit; text-align: left;
}
.tg-acc-ava, .msg-chat-ava, .tg-acc-row-ava, .msg-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, #1a3a4a, #0d141d);
  border: 1px solid rgba(0,210,255,.2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--cyan); font-weight: 700; font-size: 15px;
  background-size: cover; background-position: center;
}
.msg-chat-ava { width: 38px; height: 38px; font-size: 14px; }
.tg-acc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tg-acc-info b { font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-acc-info small { font-size: 11px; color: var(--muted); }
.tg-acc-chev { color: var(--muted); flex-shrink: 0; }
.tg-merge-toggle {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted);
  border: 1px solid #243041; border-radius: 999px; padding: 8px 12px; cursor: pointer;
  background: #0d141d; user-select: none;
}
.tg-merge-toggle input { accent-color: var(--cyan); }
.tg-sheet {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  background: #0f151d; border: 1px solid #243041; border-radius: 16px;
  padding: 12px; box-shadow: 0 -12px 40px rgba(0,0,0,.55);
  max-height: 70vh; overflow: auto;
}
.tg-sheet-mini { position: absolute; left: 8px; right: 8px; bottom: 60px; z-index: 35; }
.tg-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tg-sheet-head b { font-size: 14px; }
.tg-sheet-x { border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.tg-acc-list { display: flex; flex-direction: column; gap: 4px; }
.tg-acc-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: transparent; color: inherit; padding: 10px 8px;
  border-radius: 12px; cursor: pointer; font-family: inherit; text-align: left;
}
.tg-acc-row.active { background: rgba(0,210,255,.1); }
.tg-acc-row-ava { width: 44px; height: 44px; }
.tg-acc-row-body { flex: 1; min-width: 0; }
.tg-acc-row-body b { display: block; font-size: 13px; color: #fff; }
.tg-acc-row-body small { font-size: 10px; color: var(--muted); }
.tg-acc-row-check { color: var(--cyan); font-size: 16px; }
.tg-acc-row-del {
  border: 0; background: transparent; color: #ff8aa0; font-size: 18px; cursor: pointer; padding: 4px;
}
.tg-add-acc {
  width: 100%; margin-top: 8px; border: 1px dashed rgba(0,210,255,.35);
  background: rgba(0,210,255,.06); color: var(--cyan); border-radius: 12px;
  padding: 12px; font-family: inherit; font-size: 13px; cursor: pointer;
}
.tg-add-auth { margin-bottom: 12px; border: 1px solid #243041; border-radius: 14px; padding: 12px; background: #0a1017; }
.tg-add-auth input { width: 100%; margin-bottom: 8px; }
.msg-chat-head { display: flex; align-items: center; gap: 8px; }
.msg-chat-meta { flex: 1; min-width: 0; }
.msg-chat-meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-chat-status { font-size: 11px; color: var(--cyan); display: block; }
.msg-chat-status.offline { color: var(--muted); }
.msg-chat-status.online { color: #7ee787; }
.msg-route-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid #243041;
  background: #0d141d; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1;
}
.msg-dialog { position: relative; }
.msg-avatar { width: 52px; height: 52px; font-size: 17px; }
.msg-d-preview { display: flex; align-items: center; gap: 4px; }
.msg-d-preview.unread { color: #fff; font-weight: 500; }
.msg-unread {
  min-width: 22px; height: 22px; border-radius: 999px; background: var(--cyan);
  color: #021018; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.msg-acc-badge {
  font-size: 9px; color: var(--cyan); border: 1px solid rgba(0,210,255,.25);
  border-radius: 6px; padding: 1px 5px; margin-left: 4px; vertical-align: middle;
}
.msg-bubble.out .msg-read { color: var(--cyan); margin-left: 4px; font-size: 10px; }
.msg-bubble time { display: inline; margin-top: 0; margin-left: 6px; }
.msg-bubble-foot { display: flex; align-items: center; justify-content: flex-end; gap: 2px; margin-top: 4px; }
.msg-accounts { display: none; }

.tg-profile-sheet { max-height: 85vh; }
.tg-profile-hero { text-align: center; padding: 12px 0 16px; }
.tg-profile-ava {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a3a4a, #0d141d);
  border: 2px solid rgba(0,210,255,.25); font-size: 28px; color: var(--cyan);
  background-size: cover; background-position: center; overflow: hidden;
}
.tg-profile-hero b { display: block; font-size: 17px; margin-bottom: 4px; }
.tg-profile-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.tg-profile-row span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; margin-bottom: 3px; }
.tg-profile-row b, .tg-profile-row p { font-size: 13px; color: #eef3f8; margin: 0; word-break: break-word; }
.tg-add-contact { width: 100%; margin-top: 4px; }
.tg-add-contact.hidden-btn { display: none; }
.msg-chat-head .msg-chat-meta { cursor: pointer; }
.msg-chat-head .msg-chat-ava { cursor: pointer; }
.msg-media { border-radius: 12px; max-width: 100%; cursor: pointer; display: block; margin-top: 4px; }
.msg-media-video { max-height: 280px; width: 100%; object-fit: cover; background: #000; }
.msg-media-thumb {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.25);
  border: 1px solid #243041; cursor: pointer; font-size: 12px; margin-top: 4px;
}
.msg-media-view {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.msg-media-view.hidden { display: none; }
.msg-media-close {
  position: absolute; top: 12px; right: 14px; z-index: 61;
  border: 0; background: transparent; color: #fff; font-size: 32px; cursor: pointer;
}
#msg-media-body img, #msg-media-body video { max-width: 100%; max-height: 90vh; border-radius: 8px; }

.msg-search-wrap {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  padding: 6px; border-radius: 14px; background: #121a24;
  border: 1px solid rgba(0,210,255,.35);
}
.msg-search-wrap input {
  flex: 1; border: 1px solid #243041; background: #0a1017; color: #fff;
  border-radius: 999px; padding: 10px 14px; font-family: inherit; font-size: 13px; outline: none;
}
.msg-search-btn {
  border: 1px solid rgba(0,210,255,.35); background: rgba(0,210,255,.1);
  color: var(--cyan); border-radius: 999px; padding: 0 14px; font-family: inherit;
  font-size: 12px; cursor: pointer; white-space: nowrap;
}
.msg-search-results {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #1a2430;
}
.msg-search-results.hidden { display: none; }
.msg-search-hit {
  display: flex; gap: 12px; align-items: center; width: 100%;
  padding: 10px; border: 0; border-radius: 12px; background: transparent;
  color: inherit; text-align: left; cursor: pointer; font-family: inherit;
}
.msg-search-hit:active { background: rgba(0,210,255,.06); }
.msg-search-hit .msg-d-preview { font-size: 11px; }
.tg-menu-actions { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.tg-menu-btn {
  width: 100%; text-align: left; border: 0; background: #121820; color: #eef3f8;
  border-radius: 12px; padding: 12px 14px; font-family: inherit; font-size: 13px; cursor: pointer;
}
.tg-menu-btn.danger { color: #ff8aa0; }
.tg-menu-btn:active { background: #1a2430; }
.msg-bubble-foot {
  display: inline-flex; align-items: center; justify-content: flex-end;
  gap: 3px; margin-top: 2px; float: right; clear: both;
}
.msg-bubble time { display: inline; margin: 0; font-size: 10px; color: #6d7a8a; }
.msg-read {
  font-size: 11px; line-height: 1; letter-spacing: -2px;
  margin-left: 1px; font-weight: 600;
}
.msg-read.unread { color: rgba(255,255,255,.75); }
.msg-read.read { color: #4fc3f7; }
.msg-bubble.out .msg-read { margin-left: 2px; }

.msg-search-ico { padding-left: 8px; font-size: 14px; }
.msg-search-wrap input {
  flex: 1; border: 0 !important; background: transparent !important;
  color: #fff; border-radius: 0; padding: 10px 6px; font-size: 14px; outline: none;
}
.msg-search-btn {
  border: 0 !important; background: linear-gradient(90deg, #5defff, var(--cyan)) !important;
  color: #021018 !important; border-radius: 10px !important; padding: 10px 14px !important;
  font-weight: 700; font-size: 12px; cursor: pointer;
}
.msg-ver { margin: 0 0 8px; opacity: .5; }
.msg-read {
  font-size: 13px !important; line-height: 1; letter-spacing: -3px;
  font-weight: 700 !important;
}
.msg-read.unread { color: #ffffff !important; opacity: 0.9; }
.msg-read.read { color: #40c4ff !important; }
.msg-bubble-foot { gap: 4px !important; margin-top: 3px !important; }
.tg-menu-actions { gap: 6px !important; }
.tg-menu-btn {
  font-size: 14px !important; padding: 14px 14px !important;
  border: 1px solid #243041 !important;
}

/* chat UX v12 12-1787423466 */
.msg-bubble {
  position: relative;
  max-width: 82%;
  padding: 8px 12px 6px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.msg-bubble-foot {
  display: flex !important;
  float: none !important;
  clear: both !important;
  align-items: center;
  justify-content: flex-end;
  gap: 6px !important;
  margin-top: 6px !important;
  padding-top: 2px;
  min-height: 14px;
}
.msg-bubble time {
  display: inline-block !important;
  margin: 0 !important;
  margin-left: 0 !important;
  font-size: 11px !important;
  color: #7a8796 !important;
  line-height: 1;
  flex-shrink: 0;
}
.msg-ticks {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  flex-shrink: 0;
}
.msg-ticks svg { display: block; }
.msg-ticks.is-sent { color: rgba(255,255,255,.72); }
.msg-ticks.is-read { color: #52bfff; }
.msg-ticks.dlg {
  margin-right: 4px;
  flex: 0 0 auto;
}
.msg-ticks.dlg.is-sent { color: #6d7a8a; }
.msg-ticks.dlg.is-read { color: #52bfff; }
.msg-ticks.bubble.is-sent { color: rgba(255,255,255,.78); }
.msg-ticks.bubble.is-read { color: #52bfff; }

.msg-dialog.has-unread {
  background: rgba(0,210,255,.05);
}
.msg-dialog.has-unread .msg-d-top b.is-unread {
  color: #fff;
  font-weight: 700;
}
.msg-d-preview {
  display: flex !important;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.msg-d-preview .msg-prev-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-d-preview.unread .msg-prev-text {
  color: #e8eef5;
  font-weight: 600;
}
.msg-unread {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #5defff, var(--cyan));
  color: #021018;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0,210,255,.25);
}

#msg-chat-view {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 160px);
}
#msg-chat-view.hidden { display: none !important; }
.msg-messages {
  flex: 1;
  min-height: 240px;
  max-height: none !important;
  padding-bottom: 8px;
}
.msg-compose {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 4px;
  margin-top: auto;
  background: linear-gradient(180deg, transparent, #07090d 18%);
  border-top: 1px solid #1a2430;
}
.msg-compose input,
.msg-compose textarea {
  flex: 1;
  border: 1px solid #2a3a4d !important;
  background: #0d141d !important;
  color: #fff !important;
  border-radius: 22px !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  min-height: 44px;
}
.msg-compose input:focus,
.msg-compose textarea:focus {
  border-color: rgba(0,210,255,.55) !important;
  outline: none;
}
.msg-send, .msg-attach {
  width: 44px !important;
  height: 44px !important;
  flex-shrink: 0;
}

.msg-media {
  max-width: 100%;
  max-height: 280px;
  border-radius: 12px;
  margin-top: 6px;
  display: block;
  cursor: zoom-in;
  background: #0a1017;
  object-fit: cover;
}
.msg-media-play {
  margin-top: 6px;
  width: 100%;
  text-align: left;
}
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-text b, .msg-text strong { font-weight: 700; }
.msg-text i, .msg-text em { font-style: italic; }
.msg-text code { font-family: ui-monospace, monospace; font-size: 0.92em; background: rgba(255,120,180,.16); padding: 3px 6px; border-radius: 6px; color: #ffd6ea; }
.msg-text pre.msg-pre { margin: 4px 0; padding: 8px; border-radius: 8px; background: rgba(0,0,0,.35); overflow-x: auto; font-size: 0.88em; }
.msg-text .msg-spoiler { background: rgba(255,255,255,.15); border-radius: 4px; color: transparent; }
.msg-text .msg-spoiler:hover { color: inherit; background: rgba(255,255,255,.06); }
.msg-text .msg-inline-quote {
  display: block;
  margin: 6px 0;
  padding: 10px 28px 10px 12px;
  border-radius: 10px;
  background: rgba(255, 105, 180, 0.18);
  border-left: 0;
  color: #ffd6ea;
  position: relative;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
.msg-text .msg-inline-quote::after {
  content: "”";
  position: absolute;
  top: 4px;
  right: 10px;
  color: rgba(255, 140, 200, 0.85);
  font-size: 1.15em;
  line-height: 1;
  pointer-events: none;
}
.msg-text a { color: var(--accent, #2aabee); text-decoration: none; }
.msg-text .msg-mention { color: var(--accent, #2aabee); }
.msg-text .msg-custom-emoji { font-size: 1.15em; }
.msg-reply-preview {
  display: flex; gap: 8px; align-items: stretch;
  margin-bottom: 6px; padding: 6px 8px; border-radius: 8px;
  background: rgba(0,0,0,.18); font-size: 0.82em; opacity: .92;
}
.msg-bubble.out .msg-reply-preview { background: rgba(0,0,0,.12); }
.msg-reply-line { width: 3px; border-radius: 2px; background: var(--accent, #2aabee); flex-shrink: 0; }
.msg-reply-body { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.msg-reply-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(10,16,23,.95);
}
.msg-reply-bar.hidden { display: none !important; }
.msg-reply-bar-body { flex: 1; min-width: 0; }
.msg-reply-bar-body small { display: block; color: var(--accent, #2aabee); font-size: 0.75em; }
.msg-reply-bar-body span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88em; opacity: .85; }
.msg-reply-cancel { border: 0; background: transparent; color: var(--muted, #8b98a5); font-size: 1.2em; padding: 4px 8px; cursor: pointer; }
.broadcast-fmt-bar {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap;
}
.text-sel-menu {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin-top: 10px; padding: 10px 8px;
  background: #0f1720; border: 1px solid #2a3a4d; border-radius: 14px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.45);
  position: sticky; bottom: 0; z-index: 30;
}
.text-sel-menu.hidden { display: none !important; }
.text-sel-menu button {
  border: 0; background: rgba(42,171,238,.18); color: #9ed8f5;
  padding: 10px 16px; border-radius: 12px; font-size: 0.9em; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.text-sel-menu button:active { background: rgba(42,171,238,.32); }
#sheet-body .broadcast-editor {
  width: 100%; min-height: 150px; max-height: 260px; overflow-y: auto;
  border: 1px solid #2a3a4d; background: #0d141d; color: #fff;
  border-radius: 12px; padding: 12px; font-size: 15px; line-height: 1.5;
  font-family: inherit; outline: none;
  -webkit-user-select: text; user-select: text;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  white-space: pre-wrap; word-break: break-word;
}
#sheet-body .broadcast-editor:empty::before {
  content: attr(data-placeholder);
  color: #6b7c8f; pointer-events: none;
}
#sheet-body .broadcast-editor b,
#sheet-body .broadcast-editor strong { font-weight: 700; color: #fff; }
#sheet-body .broadcast-editor i,
#sheet-body .broadcast-editor em { font-style: italic; }
#sheet-body .broadcast-editor blockquote {
  display: inline-block;
  vertical-align: baseline;
  max-width: 100%;
  margin: 4px 0;
  padding: 6px 24px 6px 10px;
  border-left: 3px solid rgba(255, 140, 200, 0.85);
  border-radius: 8px;
  background: rgba(255, 105, 180, 0.18);
  color: #ffd6ea;
  position: relative;
  font-family: inherit;
  font-size: 0.95em;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-user-select: text;
  user-select: text;
}
#sheet-body .broadcast-editor blockquote::after {
  content: "”";
  position: absolute;
  top: 4px;
  right: 10px;
  color: rgba(255, 140, 200, 0.85);
  font-size: 1.15em;
  line-height: 1;
  pointer-events: none;
}
#sheet-body .broadcast-editor code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255,120,180,.16);
  color: #ffd6ea;
  padding: 2px 6px;
  border-radius: 6px;
}
#sheet-body textarea#s-text,
#sheet-body textarea.broadcast-textarea {
  width: 100%; min-height: 140px; resize: vertical;
  border: 1px solid #2a3a4d; background: #0d141d; color: #fff;
  border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.45;
  font-family: inherit;
  -webkit-user-select: text;
  user-select: text;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.broadcast-text-hint { margin-top: 8px; margin-bottom: 4px; }
.broadcast-photo-row {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  margin-top: 12px;
}
.broadcast-photo-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 76px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.broadcast-photo-tile-icon {
  width: 58px; height: 58px; border-radius: 18px;
  background: linear-gradient(145deg, rgba(42,171,238,.28), rgba(93,239,255,.1));
  border: 1px solid rgba(93,239,255,.35);
  display: flex; align-items: center; justify-content: center;
  color: #9ee8ff;
  box-shadow: 0 6px 18px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .12s ease, box-shadow .12s ease;
}
.broadcast-photo-tile:active .broadcast-photo-tile-icon {
  transform: scale(.96);
  box-shadow: 0 3px 10px rgba(0,0,0,.22);
}
.broadcast-photo-tile-label {
  font-size: 11px; color: #9eb0c2; font-weight: 600; letter-spacing: .02em;
}
.broadcast-photo-rm {
  align-self: center;
  border: 0; background: rgba(255,90,90,.12); color: #ffb0b0;
  padding: 8px 12px; border-radius: 999px; font-size: 0.82em; cursor: pointer;
}
.broadcast-photo-rm.hidden { display: none !important; }
.broadcast-photo-preview {
  margin-top: 10px; border-radius: 12px; overflow: hidden;
  border: 1px solid #2a3a4d; background: #0d141d;
}
.broadcast-photo-preview.hidden { display: none !important; }
.broadcast-photo-preview img {
  display: block; width: 100%; max-height: 220px; object-fit: cover;
}
.msg-sticker { max-width: 160px; max-height: 160px; object-fit: contain; background: transparent !important; }
.msg-sticker-premium { box-shadow: 0 0 0 2px rgba(255,200,50,.35); border-radius: 8px; }
.msg-compose textarea {
  flex: 1; min-height: 38px; max-height: 120px; resize: none;
  border: 0; background: transparent; color: inherit; font: inherit;
  padding: 8px 0; outline: none;
}
#msg-media-view { cursor: zoom-out; }
#msg-media-body { max-width: 96vw; max-height: 90vh; }
#msg-media-body img, #msg-media-body video {
  max-width: 96vw; max-height: 88vh; border-radius: 10px;
  object-fit: contain; background: #000;
}

/* v14 header + lightbox */
body.msg-in-chat .tg-toolbar,
body.msg-in-chat .msg-search-wrap,
body.msg-in-chat .msg-ver,
body.msg-in-chat #msg-list-view {
  display: none !important;
}
#msg-chat-view {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px);
}
#msg-chat-view.hidden { display: none !important; }
.msg-chat-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 25 !important;
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 0 10px !important;
  margin-bottom: 8px !important;
  background: #07090d !important;
  border-bottom: 1px solid #1a2430;
  flex-shrink: 0;
}
.msg-back, .msg-route-btn {
  position: relative;
  z-index: 26;
  flex-shrink: 0;
}
.msg-media-view {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  background: rgba(0,0,0,.94) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 16px;
  margin: 0 !important;
}
.msg-media-view.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
.msg-media-close {
  position: fixed !important;
  top: max(12px, env(safe-area-inset-top));
  right: 14px;
  z-index: 10000 !important;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
  font-size: 28px !important;
  line-height: 1;
  cursor: pointer;
}
body.msg-media-open {
  overflow: hidden !important;
}
body.msg-media-open #msg-chat-view .msg-chat-head {
  /* keep in DOM; lightbox is above */
  visibility: visible;
}

/* v15 close + avatars + keyboard */
.msg-media-close {
  position: fixed !important;
  top: max(10px, env(safe-area-inset-top)) !important;
  right: 12px !important;
  z-index: 10001 !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: rgba(255,255,255,.2) !important;
  color: #fff !important;
  font-size: 30px !important;
  line-height: 48px !important;
  text-align: center !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: transparent;
}
.msg-media-view {
  pointer-events: auto !important;
}
.msg-media-view.hidden {
  display: none !important;
  pointer-events: none !important;
}
.msg-avatar, .tg-acc-ava, .msg-chat-ava, .tg-profile-ava, .tg-acc-row-ava {
  background-color: #1a2430;
  transition: background-image .15s ease;
}
.msg-avatar.has-ava, .tg-acc-ava.has-ava, .msg-chat-ava.has-ava {
  color: transparent;
}
#msg-chat-view .msg-compose {
  /* не прыгаем при клавиатуре — фиксируем низ чата */
  position: sticky;
  bottom: 0;
  transform: translateZ(0);
}
#msg-text {
  font-size: 16px !important; /* iOS: меньше авто-зума */
}
body.msg-media-open .msg-media-close {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* v16 polish */
.msg-media-view.hidden,
.msg-media-view.hidden .msg-media-close,
.msg-media-view.hidden .msg-media-topbar {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}
.msg-media-view:not(.hidden) {
  display: flex !important;
  flex-direction: column;
  z-index: 9999 !important;
}
.msg-media-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 10002;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 12px;
  pointer-events: none;
}
.msg-media-close {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  pointer-events: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.22) !important;
  color: #fff !important;
  font-size: 22px !important;
  border: 0 !important;
  cursor: pointer !important;
}
.msg-media-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}
.msg-media-loading {
  min-width: 160px;
  min-height: 160px;
  background: #121820 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%235a6a7a' stroke-width='1.5'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10' r='1.5'/%3E%3Cpath d='M21 16l-5-5-8 8'/%3E%3C/svg%3E") center/40px no-repeat !important;
}
.msg-media[src] {
  background: #0a1017 !important;
  min-height: 0;
}
.msg-avatar {
  font-size: 18px !important;
  font-weight: 700;
  color: var(--cyan);
}
#q-pause, #q-restart { display: none !important; }
.quick-grid {
  grid-template-columns: 1fr 1fr !important;
}

.msg-media-broken {
  min-height: 120px !important;
  opacity: 0.7;
}
#msg-send { -webkit-touch-callout: none; user-select: none; touch-action: manipulation; }
#msg-text:focus { outline: none; }

/* v17 chat viewport — низ чата + рабочая отправка */
body.msg-in-chat {
  overflow: hidden !important;
  height: 100% !important;
}
body.msg-in-chat #page-panel {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  min-height: 0 !important;
}
body.msg-in-chat #tab-msg {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: 100% !important;
  overflow: hidden !important;
  padding-bottom: 0 !important;
}
#msg-chat-view {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
#msg-chat-view.hidden {
  display: none !important;
}
.msg-chat-head {
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 30 !important;
  pointer-events: auto !important;
}
.msg-chat-head .msg-back,
.msg-chat-head .msg-route-btn,
.msg-chat-head .msg-chat-ava,
.msg-chat-head .msg-chat-meta {
  pointer-events: auto !important;
}
.msg-messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain;
  padding: 8px 2px 12px !important;
}
#msg-chat-view .msg-compose {
  flex-shrink: 0 !important;
  position: relative !important;
  position: relative !important;
  bottom: auto !important;
  z-index: 40 !important;
  margin-top: 0 !important;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  background: #07090d !important;
  border-top: 1px solid #1a2430 !important;
  pointer-events: auto !important;
}
#msg-send, #msg-text, .msg-attach {
  pointer-events: auto !important;
  touch-action: manipulation !important;
}
#msg-send {
  z-index: 41 !important;
  position: relative !important;
}

/* v17b: full-screen chat, tabs hidden, send always reachable */
body.msg-in-chat {
  padding: 0 !important;
  height: 100% !important;
  max-height: 100dvh !important;
}
html:has(body.msg-in-chat),
body.msg-in-chat {
  height: 100% !important;
  overflow: hidden !important;
}
body.msg-in-chat .panel-topbar,
body.msg-in-chat #news-top,
body.msg-in-chat #news-bottom {
  display: none !important;
}
body.msg-in-chat #page-panel {
  max-width: none !important;
  height: 100dvh !important;
  padding: 0 !important;
}
body.msg-in-chat #tab-msg {
  padding: 0 10px !important;
  height: 100% !important;
}
#msg-chat-view .msg-chat-head {
  padding: 8px 2px !important;
  background: #07090d !important;
  border-bottom: 1px solid #1a2430;
}

.msg-day-sep{display:flex;justify-content:center;align-items:center;margin:10px 0 6px;pointer-events:none}
.msg-day-sep span{font-size:12px;font-weight:600;color:#c9d4e0;background:rgba(24,34,46,.92);border:1px solid #243041;padding:4px 12px;border-radius:999px}
.pay-crypto-note{display:flex;align-items:center;gap:10px;margin:14px 0 8px;padding:12px 14px;border-radius:14px;background:linear-gradient(135deg,rgba(0,210,255,.08),rgba(36,58,90,.35));border:1px solid rgba(0,210,255,.22);color:#b8c7d8;font-size:12px;line-height:1.35}
.pay-crypto-badge{flex-shrink:0;font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#041018;background:linear-gradient(135deg,#7ee7ff,#00d2ff);padding:5px 8px;border-radius:8px}
.pay-overlay{position:fixed;inset:0;z-index:12000;background:rgba(0,0,0,.62);display:flex;align-items:center;justify-content:center;padding:20px}
.pay-overlay.hidden{display:none!important}
.pay-card{width:min(360px,100%);background:#0d141d;border:1px solid #243041;border-radius:18px;padding:22px 18px 16px;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.45)}
.pay-card-ico{font-size:28px;margin-bottom:8px}
.pay-card b{display:block;font-size:16px;color:#fff;margin-bottom:8px}
.pay-card p{margin:0 0 8px;color:#9aabbc;font-size:13px}
.pay-hint{font-size:11px!important;color:#6d7a8a!important;margin-bottom:14px!important}
.pay-card .sub-btn{width:100%;margin-top:8px;justify-content:center}

/* v19 polish */
.pay-crypto-note { display: none !important; }
[data-edit="mode"], #v-mode { display: none !important; }

.app-modal {
  position: fixed; inset: 0; z-index: 13000;
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
  background: rgba(3, 8, 14, .72);
  backdrop-filter: blur(8px);
}
.app-modal.hidden { display: none !important; }
.app-modal-card {
  width: min(340px, 100%);
  background: linear-gradient(180deg, #121a24 0%, #0b1017 100%);
  border: 1px solid #2a3a4d;
  border-radius: 20px;
  padding: 22px 18px 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(0,210,255,.06) inset;
  text-align: center;
  animation: appModalIn .22s ease-out;
}
@keyframes appModalIn {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.app-modal-ico {
  width: 48px; height: 48px; margin: 0 auto 12px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #041018;
  background: linear-gradient(135deg, #7ee7ff, #00d2ff);
}
.app-modal-ico.warn { background: linear-gradient(135deg, #ffb86c, #ff6b6b); }
.app-modal-ico.ok { background: linear-gradient(135deg, #7ee787, #3dd68c); }
.app-modal-title { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.app-modal-text { font-size: 13px; line-height: 1.45; color: #9aabbc; margin-bottom: 16px; white-space: pre-wrap; }
.app-modal-actions { display: flex; gap: 8px; }
.app-modal-btn {
  flex: 1; border: 0; border-radius: 12px; padding: 12px 10px;
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.app-modal-btn.primary { background: linear-gradient(135deg, #1ad0ef, #00a8cc); color: #041018; }
.app-modal-btn.ghost { background: #15202b; color: #c9d4e0; border: 1px solid #243041; }
.app-modal-btn.hidden, #app-modal-cancel.hidden { display: none !important; }

.tg-profile-overlay {
  position: fixed !important; inset: 0 !important; z-index: 80 !important;
  background: rgba(0,0,0,.55) !important;
  display: flex !important; align-items: flex-end !important; justify-content: center !important;
  padding: 0 !important; border: 0 !important; border-radius: 0 !important;
  max-height: none !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
}
.tg-profile-overlay.hidden { display: none !important; }
.tg-profile-panel {
  width: 100%; max-width: 520px;
  max-height: min(92dvh, 920px);
  background: #0f151d;
  border: 1px solid #243041;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: 0 -16px 50px rgba(0,0,0,.5);
}
.tg-profile-scroll {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  flex: 1; min-height: 0; padding-bottom: 8px;
}
.tg-profile-hero b {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  word-break: break-word;
  max-width: 100%;
  padding: 0 8px;
}
.tg-profile-row p { max-height: none; white-space: pre-wrap; }

.tg-menu-btn {
  display: flex !important; align-items: center; gap: 12px;
  width: 100%; text-align: left; padding: 12px 10px !important;
  border-radius: 12px; border: 0; background: transparent;
  color: #eef3f8; font-family: inherit; font-size: 14px; cursor: pointer;
}
.tg-menu-btn:active { background: rgba(255,255,255,.04); }
.tg-menu-btn.danger { color: #ff8aa0; }
.tg-menu-btn.is-unblock { color: #7ee787; }
.tg-menu-ico {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #18222e; border: 1px solid #243041;
  background-repeat: no-repeat; background-position: center; background-size: 18px;
}
.tg-menu-ico.contact {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d2ff' stroke-width='1.8'%3E%3Ccircle cx='9' cy='8' r='3.2'/%3E%3Cpath d='M4 18c0-2.8 2.2-5 5-5'/%3E%3Cpath d='M16 8v6M13 11h6'/%3E%3C/svg%3E");
}
.tg-menu-ico.block {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff8aa0' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M7 7l10 10'/%3E%3C/svg%3E");
}
.tg-menu-ico.profile {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d2ff' stroke-width='1.8'%3E%3Ccircle cx='12' cy='8' r='3.2'/%3E%3Cpath d='M5 19c0-3.5 3.1-6 7-6s7 2.5 7 6'/%3E%3C/svg%3E");
}
.tg-menu-btn.is-done .tg-menu-ico.contact {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237ee787' stroke-width='1.8'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}

.msg-refresh {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid #243041; background: #0d141d; color: var(--cyan);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.msg-refresh.is-spin svg { animation: spinRefresh .8s linear infinite; }
@keyframes spinRefresh { to { transform: rotate(360deg); } }
.msg-empty-error { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 12px; }
.msg-retry-btn {
  margin-top: 6px; border: 0; border-radius: 12px; padding: 10px 16px;
  background: linear-gradient(135deg, #1ad0ef, #00a8cc); color: #041018;
  font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
}
.msg-avatar, .tg-acc-ava, .msg-chat-ava, .tg-profile-ava, .tg-acc-row-ava {
  color: #e8f7ff !important;
  font-weight: 700;
  letter-spacing: .02em;
}


/* paywall */
.paywall-banner {
  margin: 8px 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 180, 60, .35);
  background: rgba(255, 160, 40, .1);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.paywall-banner.hidden { display: none !important; }
.paywall-banner b { color: #ffd89a; font-size: 13px; }
.paywall-banner span { color: #c9b89a; font-size: 12px; line-height: 1.4; }
.paywall-banner .btn-primary { margin-top: 4px; width: auto; align-self: flex-start; }
.ar-field { margin-bottom: 10px; }
.ar-field label { display: block; font-size: 12px; color: #9aa8b8; margin-bottom: 4px; }
.ar-field textarea, .ar-field input[type="number"] {
  width: 100%; box-sizing: border-box; border-radius: 10px; border: 1px solid #2a3a4d;
  background: #0d141d; color: #fff; padding: 10px 12px; font: inherit; min-height: 44px;
}
.ar-field textarea { min-height: 96px; resize: vertical; }
.ar-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #eef3f8; margin: 8px 0; }


/* autoresponder editor */
.ar-fmt-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ar-fmt {
  border: 1px solid #2a3a4d; background: #121a24; color: #d7dee8;
  border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.ar-fmt:active { background: rgba(42,171,238,.2); }
.ar-editor {
  min-height: 110px; max-height: 220px; overflow: auto;
  border: 1px solid #2a3a4d; background: #0d141d; color: #fff;
  border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.45;
  -webkit-user-select: text; user-select: text;
}
.ar-editor:empty::before {
  content: attr(data-placeholder); color: #6b7c8f; pointer-events: none;
}
.ar-editor blockquote {
  display: inline-block; max-width: 100%; margin: 4px 0; padding: 6px 10px;
  border-left: 3px solid rgba(255,140,200,.85); border-radius: 8px;
  background: rgba(255,105,180,.18); color: #ffd6ea;
}
.ar-editor code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255,120,180,.16); color: #ffd6ea; padding: 2px 6px; border-radius: 6px;
}
.ar-btn-row {
  display: grid; grid-template-columns: 1fr; gap: 6px;
  margin-bottom: 8px; padding: 10px; border-radius: 10px; background: #0a1017; border: 1px solid rgba(255,255,255,.06);
}
.ar-btn-row input, .ar-btn-row select {
  width: 100%; box-sizing: border-box; border-radius: 8px; border: 1px solid #2a3a4d;
  background: #0d141d; color: #fff; padding: 8px 10px; font: inherit; font-size: 13px;
}
.ar-btn-row .ar-btn-del { width: 100%; }


/* ar editor stable */
#sheet-body .ar-editor {
  min-height: 120px; max-height: 240px; overflow: auto;
  border: 1px solid #2a3a4d; background: #0d141d; color: #fff;
  border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.5;
  -webkit-user-select: text !important; user-select: text !important;
  caret-color: #5defff;
  outline: none;
  touch-action: manipulation;
}
#sheet-body .ar-editor:empty:before {
  content: attr(data-placeholder); color: #6b7c8f; pointer-events: none;
}
#sheet-body .ar-fmt-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px;
  padding-bottom: 4px;
}
#sheet-body .ar-fmt {
  -webkit-touch-callout: none; user-select: none;
  touch-action: manipulation;
}
#sheet-body #ar-sel-menu {
  position: relative; margin: 8px 0 0; z-index: 5;
}
#ar-editor-stable { }


/* floating format menu — no layout jump */
.text-sel-menu.fmt-float {
  position: fixed !important;
  z-index: 9999;
  margin: 0 !important;
  display: flex !important;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: center;
  padding: 8px 10px;
  background: rgba(15, 23, 32, 0.96);
  border: 1px solid #2a3a4d;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
  max-width: calc(100vw - 16px);
  pointer-events: auto;
}
.text-sel-menu.fmt-float.hidden { display: none !important; }
.text-sel-menu.fmt-float button {
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 0.85em;
}
.broadcast-fmt-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 10px 0 6px;
}
.ar-btns-preview { margin-bottom: 8px; }
.ar-btn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-btn-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 10px;
  background: #172230; border: 1px solid #2a3a4d;
  color: #e8f1fa; font-size: 13px; font-weight: 600;
}


/* —— stable sheets (keyboard-friendly) —— */
.sheet {
  align-items: flex-end !important;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom)) !important;
}
.sheet-card {
  width: min(440px, 100%) !important;
  max-height: min(72vh, 520px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 12px !important;
}
#sheet-title { flex: 0 0 auto; }
#sheet-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 2px;
}
.sheet-card > .btn-row {
  flex: 0 0 auto !important;
  margin-top: 8px !important;
  padding-top: 10px;
  border-top: 1px solid #223041;
  background: var(--card);
}

/* compact always-visible format bar — never giant float */
.text-sel-menu.fmt-bar-inline,
#ar-fmt-bar.fmt-bar-inline {
  position: static !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin: 0 0 8px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
}
.text-sel-menu.fmt-bar-inline button,
#ar-fmt-bar.fmt-bar-inline button {
  flex: 0 0 auto;
  padding: 7px 10px !important;
  font-size: 12px !important;
  border-radius: 9px;
  border: 0;
  background: rgba(42,171,238,.16);
  color: #9ed8f5;
  font-weight: 600;
}
.text-sel-menu.fmt-float { display: none !important; }

#sheet-body .ar-editor {
  min-height: 72px !important;
  max-height: 120px !important;
}
.ar-btn-row-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}
.ar-field-inline {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
  align-items: center;
}
.ar-field-inline input { margin: 0; }

.app-toast {
  position: fixed;
  left: 50%;
  top: max(16px, env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 10050;
  background: rgba(12, 22, 32, 0.94);
  border: 1px solid rgba(0, 210, 255, 0.35);
  color: #e8f7ff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  pointer-events: none;
}
.app-toast.hidden { display: none !important; }


/* ar-sel-menu under editor — only when text selected */
.ar-sel-menu {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  background: #0f1720;
  border: 1px solid #2a3a4d;
  border-radius: 12px;
}
.ar-sel-menu.hidden { display: none !important; }
.ar-sel-menu button {
  border: 0;
  background: rgba(42,171,238,.18);
  color: #9ed8f5;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.ar-sel-menu button:active { background: rgba(42,171,238,.32); }
#sheet-body .ar-editor {
  min-height: 100px !important;
  max-height: 180px !important;
}


/* AR styles — visible like Telegram */
.ar-style-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  padding: 8px;
  background: #0f1720;
  border: 1px solid #2a3a4d;
  border-radius: 12px;
}
.ar-style-bar[hidden] { display: flex !important; } /* always visible: WebView selection is unreliable */
.ar-style-label {
  width: 100%;
  font-size: 11px;
  color: #8b97a8;
  font-weight: 600;
  margin-bottom: 2px;
}
.ar-style-bar button {
  border: 0;
  background: rgba(42,171,238,.16);
  color: #d7eaf6;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.ar-style-bar button:active { background: rgba(42,171,238,.3); }
.ar-style-bar button b { font-weight: 800; color: #fff; }
.ar-style-bar button i { font-style: italic; color: #cfe8f7; }
.ar-style-bar button u { text-decoration: underline; }
.ar-style-bar button s { text-decoration: line-through; opacity: .85; }
.ar-style-bar button code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255,120,180,.16); color: #ffd6ea; padding: 1px 4px; border-radius: 4px;
}

#sheet-body .ar-editor,
.ar-editor {
  min-height: 110px !important;
  max-height: 200px !important;
  white-space: pre-wrap;
  word-break: break-word;
}
#sheet-body .ar-editor b,
#sheet-body .ar-editor strong,
.ar-editor b,
.ar-editor strong {
  font-weight: 800 !important;
  color: #ffffff !important;
}
#sheet-body .ar-editor i,
#sheet-body .ar-editor em,
.ar-editor i,
.ar-editor em {
  font-style: italic !important;
  color: #d7e6f3 !important;
}
#sheet-body .ar-editor u,
.ar-editor u {
  text-decoration: underline !important;
}
#sheet-body .ar-editor s,
.ar-editor s {
  text-decoration: line-through !important;
  opacity: 0.85;
}
#sheet-body .ar-editor blockquote,
.ar-editor blockquote {
  display: inline-block !important;
  max-width: 100%;
  margin: 4px 0 !important;
  padding: 6px 12px 6px 10px !important;
  border-left: 3px solid rgba(255,140,200,.9) !important;
  border-radius: 8px !important;
  background: rgba(255,105,180,.2) !important;
  color: #ffd6ea !important;
}
#sheet-body .ar-editor code,
.ar-editor code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  background: rgba(255,120,180,.18) !important;
  color: #ffd6ea !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
}


/* ar-editor selection fix */
#sheet-body .ar-editor,
.ar-editor {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default;
}
.ar-style-bar {
  display: flex !important;
}


/* selection-only format bar */
.text-sel-menu.fmt-bar-inline.hidden,
#ar-sel-menu.hidden {
  display: none !important;
}
.text-sel-menu.fmt-bar-inline:not(.hidden) {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  background: #0f1720;
  border: 1px solid #2a3a4d;
  border-radius: 12px;
  position: static !important;
  left: auto !important;
  top: auto !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
}
#sheet-body .ar-editor.broadcast-editor b,
#sheet-body .ar-editor.broadcast-editor strong { font-weight: 800 !important; color: #fff !important; }
#sheet-body .ar-editor.broadcast-editor i,
#sheet-body .ar-editor.broadcast-editor em { font-style: italic !important; }
#sheet-body .ar-editor.broadcast-editor blockquote {
  display: inline-block !important;
  margin: 4px 0 !important;
  padding: 6px 12px 6px 10px !important;
  border-left: 3px solid rgba(255,140,200,.9) !important;
  border-radius: 8px !important;
  background: rgba(255,105,180,.2) !important;
  color: #ffd6ea !important;
}
#sheet-body .ar-editor.broadcast-editor code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  background: rgba(255,120,180,.18) !important;
  color: #ffd6ea !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
}


/* TG-like URL buttons + edit submenu */
.tg-url-btns-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch;
  margin-top: 4px;
}
.tg-url-btn {
  position: relative;
  flex: 1 1 calc(50% - 8px);
  min-width: 120px;
  border: 0;
  border-radius: 12px;
  padding: 12px 28px 12px 12px;
  background: #1a222d;
  color: #ff6b8a;
  font-weight: 700;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.tg-url-btn--red { color: #ff5a7a; background: linear-gradient(180deg, #241820, #1a1218); }
.tg-url-btn--pink { color: #ff7eb3; background: linear-gradient(180deg, #241822, #1a1219); }
.tg-url-btn--green { color: #5dffa0; background: linear-gradient(180deg, #14241c, #101a14); }
.tg-url-btn--blue { color: #6ec8ff; background: linear-gradient(180deg, #142028, #10161c); }
.tg-url-btn--orange { color: #ffb060; background: linear-gradient(180deg, #241a14, #1a1410); }
.tg-url-btn-go {
  position: absolute; top: 8px; right: 10px;
  font-size: 12px; opacity: .85; color: inherit;
}
.tg-url-btn-add {
  flex: 0 0 44px;
  border-radius: 12px;
  border: 1px dashed #2a3a4d;
  background: transparent;
  color: #8b97a8;
  font-size: 20px;
  cursor: pointer;
}
.tg-url-edit {
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #0f1720;
  border: 1px solid #2a3a4d;
}
.tg-url-edit.hidden { display: none !important; }
.tg-url-edit-title { font-size: 12px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.tg-url-edit input, .tg-url-edit select {
  width: 100%; box-sizing: border-box;
  margin-bottom: 8px;
  border-radius: 10px; border: 1px solid #2a3a4d;
  background: #0d141d; color: #fff; padding: 10px 12px; font: inherit;
}
.tg-url-edit-actions { display: flex; gap: 8px; }
.tg-url-edit-actions .btn-primary { flex: 1; }

/* ensure AR uses same quote look as broadcast */
#sheet-body .ar-editor.broadcast-editor blockquote {
  display: inline-block;
  vertical-align: baseline;
  max-width: 100%;
  margin: 4px 0;
  padding: 6px 24px 6px 10px;
  border-left: 3px solid rgba(255, 140, 200, 0.85);
  border-radius: 8px;
  background: rgba(255, 105, 180, 0.18);
  color: #ffd6ea;
  position: relative;
}
#sheet-body .ar-editor.broadcast-editor blockquote::after {
  content: "”";
  position: absolute;
  top: 4px;
  right: 10px;
  color: rgba(255, 140, 200, 0.85);
  font-size: 1.15em;
  line-height: 1;
  pointer-events: none;
}


/* Telegram-like URL buttons (screenshot style) */
.tg-url-btns-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.tg-url-btn {
  position: relative;
  flex: 1 1 calc(50% - 6px);
  min-width: 140px;
  min-height: 44px;
  border: 0 !important;
  border-radius: 14px !important;
  padding: 12px 30px 12px 14px !important;
  background: #2a1a1f !important;
  box-shadow: inset 0 0 0 1px rgba(255,80,120,.18);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.tg-url-btn-text {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  background: linear-gradient(90deg, #ff4d6d, #ff8fab);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.tg-url-btn-go {
  position: absolute !important;
  top: 8px !important;
  right: 10px !important;
  font-size: 13px !important;
  color: rgba(255,200,210,.9) !important;
  opacity: 1 !important;
}
.tg-url-btn--red .tg-url-btn-text,
.tg-url-btn--pink .tg-url-btn-text {
  background: linear-gradient(90deg, #ff3b5c, #ff9a9e);
  -webkit-background-clip: text;
  background-clip: text;
}
.tg-url-btn--green {
  background: #15241c !important;
  box-shadow: inset 0 0 0 1px rgba(80,255,160,.18);
}
.tg-url-btn--green .tg-url-btn-text {
  background: linear-gradient(90deg, #3dff9a, #b6ffd4);
  -webkit-background-clip: text;
  background-clip: text;
}
.tg-url-btn--blue {
  background: #15202a !important;
  box-shadow: inset 0 0 0 1px rgba(80,180,255,.18);
}
.tg-url-btn--blue .tg-url-btn-text {
  background: linear-gradient(90deg, #4db7ff, #a6e1ff);
  -webkit-background-clip: text;
  background-clip: text;
}
.tg-url-btn--orange {
  background: #2a1c14 !important;
  box-shadow: inset 0 0 0 1px rgba(255,160,80,.18);
}
.tg-url-btn--orange .tg-url-btn-text {
  background: linear-gradient(90deg, #ff8a3d, #ffd0a8);
  -webkit-background-clip: text;
  background-clip: text;
}
.tg-url-btn-add {
  flex: 0 0 48px !important;
  min-height: 44px;
  border-radius: 14px !important;
  border: 1px dashed rgba(255,255,255,.2) !important;
  background: rgba(255,255,255,.03) !important;
  color: #9aa8b8 !important;
  font-size: 22px !important;
}
.broadcast-photo-preview {
  margin: 6px 0 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #2a3a4d;
  max-height: 160px;
}
.broadcast-photo-preview img {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
}
.broadcast-photo-rm {
  margin-left: 8px;
  white-space: nowrap;
}


/* Exact Telegram URL-button look (from screenshot) */
.tg-msg-preview {
  background: #182533;
  border-radius: 14px;
  padding: 10px;
  margin: 6px 0 10px;
  border: 1px solid rgba(255,255,255,.06);
}
.tg-msg-preview-label {
  font-size: 11px;
  color: #8b9aab;
  margin-bottom: 8px;
  font-weight: 600;
}
.tg-url-btns-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  width: 100%;
}
.tg-url-btn {
  position: relative !important;
  flex: 1 1 50% !important;
  min-width: 0 !important;
  min-height: 40px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  padding: 10px 28px 10px 12px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  backdrop-filter: none;
  text-align: center !important;
  cursor: pointer;
}
.tg-url-btn-text {
  display: block;
  width: 100%;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none !important;
  -webkit-text-fill-color: #ff6b9d !important;
  color: #ff6b9d !important;
}
.tg-url-btn-go {
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  transform: translateY(-50%);
  font-size: 12px !important;
  color: rgba(255,255,255,.75) !important;
  opacity: 1 !important;
  line-height: 1;
}
.tg-url-btn--red .tg-url-btn-text,
.tg-url-btn--pink .tg-url-btn-text { color: #ff6b9d !important; -webkit-text-fill-color: #ff6b9d !important; }
.tg-url-btn--green .tg-url-btn-text { color: #5dffa0 !important; -webkit-text-fill-color: #5dffa0 !important; }
.tg-url-btn--blue .tg-url-btn-text { color: #6ec8ff !important; -webkit-text-fill-color: #6ec8ff !important; }
.tg-url-btn--orange .tg-url-btn-text { color: #ffb060 !important; -webkit-text-fill-color: #ffb060 !important; }
.tg-url-btn-add {
  width: 100% !important;
  flex: none !important;
  min-height: 40px !important;
  margin-top: 4px !important;
  border-radius: 10px !important;
  border: 1px dashed rgba(255,255,255,.18) !important;
  background: transparent !important;
  color: #9aa8b8 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}


/* ===== Telegram compose preview ===== */
.tg-compose { width: 100%; }
.tg-bubble {
  background: #182533;
  border-radius: 16px 16px 16px 6px;
  padding: 10px 12px 8px;
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.tg-bubble-text.broadcast-editor,
.tg-bubble-text.ar-editor,
#sheet-body .tg-bubble-text {
  min-height: 88px !important;
  max-height: 200px !important;
  border: 0 !important;
  background: transparent !important;
  padding: 2px 2px 8px !important;
  border-radius: 0 !important;
  color: #fff !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}
.tg-bubble-btns { margin-top: 4px; }
.tg-bubble-btns .tg-url-btn-add { margin-top: 8px; }

/* Floating format bar — Telegram style */
.tg-fmt-float {
  position: fixed !important;
  z-index: 10060 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  max-width: calc(100vw - 16px);
  background: #2b3948 !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.45) !important;
}
.tg-fmt-float.hidden { display: none !important; }
.tg-fmt-float button {
  border: 0 !important;
  background: transparent !important;
  color: #e8eef5 !important;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 0 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.tg-fmt-float button:active { background: rgba(255,255,255,.1) !important; }
.tg-fmt-float button b { font-weight: 800; color: #fff; }
.tg-fmt-float button i { font-style: italic; }
.tg-fmt-float button u { text-decoration: underline; }
.tg-fmt-float button s { text-decoration: line-through; opacity: .9; }
.tg-fmt-float button code { font-size: 11px; color: #9ed8f5; }

/* Coral inline buttons like screenshot */
.tg-url-btns-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  width: 100%;
}
.tg-bubble .tg-url-btn,
.tg-url-btn {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  border-radius: 11px !important;
  border: 0 !important;
  padding: 11px 30px 11px 12px !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: none !important;
  text-align: center !important;
}
.tg-url-btn-text {
  background: none !important;
  color: #ff7a6e !important;
  -webkit-text-fill-color: #ff7a6e !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-align: center !important;
}
.tg-url-btn--coral .tg-url-btn-text,
.tg-url-btn--orange .tg-url-btn-text,
.tg-url-btn--red .tg-url-btn-text,
.tg-url-btn--pink .tg-url-btn-text {
  color: #ff7a6e !important;
  -webkit-text-fill-color: #ff7a6e !important;
}
.tg-url-btn-go {
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  transform: translateY(-50%);
  font-size: 13px !important;
  color: rgba(255,255,255,.8) !important;
}


/* ==== btnsfix 1789423595: Telegram-like compose preview ==== */
.tg-compose {
  background: transparent;
}
.tg-bubble {
  background: #182533 !important;
  border-radius: 14px 14px 14px 4px !important;
  padding: 10px 12px 10px !important;
  border: 0 !important;
  box-shadow: none !important;
}
.tg-bubble-text.broadcast-editor,
.tg-bubble-text.ar-editor,
#sheet-body .tg-bubble-text,
#sheet-body .tg-bubble-text.broadcast-editor {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
  min-height: 72px !important;
  max-height: 220px !important;
  border: 0 !important;
  background: transparent !important;
  padding: 2px 2px 10px !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}
.tg-bubble-text:empty:before,
.tg-bubble-text.broadcast-editor:empty::before,
.broadcast-editor:empty::before {
  content: attr(data-placeholder);
  color: #6b7c8f !important;
  -webkit-text-fill-color: #6b7c8f !important;
  pointer-events: none;
  font-style: normal !important;
}

/* Formatting looks like Telegram — NOT pink */
#sheet-body .broadcast-editor b,
#sheet-body .broadcast-editor strong,
.tg-bubble-text b,
.tg-bubble-text strong {
  font-weight: 700 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
#sheet-body .broadcast-editor i,
#sheet-body .broadcast-editor em,
.tg-bubble-text i,
.tg-bubble-text em {
  font-style: italic !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
#sheet-body .broadcast-editor u,
.tg-bubble-text u {
  text-decoration: underline !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
#sheet-body .broadcast-editor s,
.tg-bubble-text s {
  text-decoration: line-through !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}
#sheet-body .broadcast-editor blockquote,
.tg-bubble-text blockquote {
  display: block !important;
  margin: 4px 0 !important;
  padding: 2px 0 2px 10px !important;
  border-left: 3px solid #2AABEE !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  position: relative !important;
}
#sheet-body .broadcast-editor blockquote::after,
.tg-bubble-text blockquote::after {
  content: none !important;
}
#sheet-body .broadcast-editor code,
.tg-bubble-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  background: rgba(255,255,255,.08) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  padding: 1px 5px !important;
  border-radius: 5px !important;
}

/* Floating format bar — solid, text labels */
.tg-fmt-float {
  position: fixed !important;
  z-index: 10060 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center;
  justify-content: center;
  gap: 6px !important;
  padding: 8px 10px !important;
  margin: 0 !important;
  max-width: calc(100vw - 16px);
  background: #0f1720 !important;
  border: 1px solid #2a3a4d !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.55) !important;
}
.tg-fmt-float.hidden { display: none !important; }
.tg-fmt-float button {
  border: 0 !important;
  background: rgba(42,171,238,.18) !important;
  color: #9ed8f5 !important;
  -webkit-text-fill-color: #9ed8f5 !important;
  min-width: auto !important;
  height: auto !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 8px 11px !important;
  cursor: pointer;
  white-space: nowrap;
}
.tg-fmt-float button:active { background: rgba(42,171,238,.32) !important; }
.tg-fmt-float button b,
.tg-fmt-float button i,
.tg-fmt-float button u,
.tg-fmt-float button s,
.tg-fmt-float button code {
  all: unset;
  font: inherit;
  color: inherit;
}

/* Coral URL buttons like screenshot */
.tg-url-btns-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  width: 100%;
  margin-top: 2px;
}
.tg-bubble .tg-url-btn,
.tg-url-btn {
  position: relative !important;
  flex: 1 1 50% !important;
  min-width: 0 !important;
  min-height: 40px !important;
  border: 0 !important;
  border-radius: 12px !important;
  padding: 10px 28px 10px 10px !important;
  background: rgba(255,255,255,.07) !important;
  box-shadow: none !important;
  cursor: pointer;
  text-align: center !important;
}
.tg-url-btn-text {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none !important;
  color: #ff7a6e !important;
  -webkit-text-fill-color: #ff7a6e !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-align: center !important;
  letter-spacing: 0 !important;
}
.tg-url-btn-go {
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  transform: translateY(-50%);
  font-size: 13px !important;
  color: rgba(255,255,255,.85) !important;
  line-height: 1;
}
.tg-url-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.tg-url-btn-add,
.tg-url-btn-editall {
  width: 100% !important;
  min-height: 38px !important;
  border-radius: 10px !important;
  border: 1px dashed rgba(255,255,255,.18) !important;
  background: transparent !important;
  color: #9aa8b8 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer;
}
.tg-url-btn-editall {
  border-style: solid !important;
  border-color: rgba(42,171,238,.25) !important;
  color: #9ed8f5 !important;
}


/* ==== clickfix 1789423940 ==== */
.text-sel-menu.fmt-bar-inline,
#ar-sel-menu.text-sel-menu {
  position: static !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin: 8px 0 0 !important;
  padding: 8px !important;
  background: #0f1720 !important;
  border: 1px solid #2a3a4d !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 18px rgba(0,0,0,.35) !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  max-width: 100% !important;
}
.text-sel-menu.fmt-bar-inline.hidden,
#ar-sel-menu.text-sel-menu.hidden {
  display: none !important;
}
.text-sel-menu.fmt-bar-inline button,
#ar-sel-menu.text-sel-menu button {
  border: 0 !important;
  background: rgba(42,171,238,.18) !important;
  color: #9ed8f5 !important;
  -webkit-text-fill-color: #9ed8f5 !important;
  padding: 9px 12px !important;
  border-radius: 11px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer;
}
.text-sel-menu.fmt-bar-inline button:active {
  background: rgba(42,171,238,.32) !important;
}

/* Kill pink typing */
.tg-bubble-text,
.tg-bubble-text.broadcast-editor,
#sheet-body .tg-bubble-text {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff !important;
}
.tg-bubble-text:empty::before,
.broadcast-editor:empty::before {
  color: #6b7c8f !important;
  -webkit-text-fill-color: #6b7c8f !important;
}
.tg-bubble-text b, .tg-bubble-text strong,
.tg-bubble-text i, .tg-bubble-text em,
.tg-bubble-text u, .tg-bubble-text s {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.tg-bubble-text blockquote {
  border-left: 3px solid #2AABEE !important;
  background: transparent !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  padding: 2px 0 2px 10px !important;
  margin: 4px 0 !important;
  border-radius: 0 !important;
}
.tg-bubble-text blockquote::after { content: none !important; }
.tg-bubble-text code {
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* Bubble like screenshot */
.tg-bubble {
  background: #182533 !important;
  border-radius: 14px 14px 14px 4px !important;
  padding: 10px 12px 8px !important;
  border: 0 !important;
}

/* Coral URL buttons — real <a>, look like Telegram inline */
.tg-url-btns-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  width: 100%;
  margin-top: 6px;
}
a.tg-url-btn,
button.tg-url-btn,
.tg-bubble .tg-url-btn {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 50% !important;
  min-width: 0 !important;
  min-height: 40px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 10px 28px 10px 10px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.08) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent;
}
a.tg-url-btn:active,
button.tg-url-btn:active {
  background: rgba(255,255,255,.12) !important;
}
.tg-url-btn-text {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #ff7a6e !important;
  -webkit-text-fill-color: #ff7a6e !important;
  background: none !important;
  text-decoration: none !important;
}
.tg-url-btn-go {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%);
  font-size: 13px !important;
  color: rgba(255,255,255,.85) !important;
  pointer-events: none;
}
.tg-url-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.tg-url-btn-add, .tg-url-btn-editall {
  width: 100%;
  min-height: 36px;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,.2);
  background: transparent;
  color: #9aa8b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tg-url-btn-editall {
  border-style: solid;
  border-color: rgba(42,171,238,.28);
  color: #9ed8f5;
}


/* ==== mail compose UI 1789461103 ==== */
.sheet-card.sheet-mail-text {
  max-height: min(88vh, 720px) !important;
  padding: 14px 14px 12px !important;
  background: #0b1220 !important;
  border: 1px solid rgba(255,255,255,.06);
}
.sheet-card.sheet-mail-text #sheet-title {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}
.sheet-card.sheet-mail-text > .btn-row {
  border-top: 0 !important;
  padding-top: 10px !important;
}
.sheet-card.sheet-mail-text #sheet-cancel { display: none !important; }
.sheet-card.sheet-mail-text #sheet-ok {
  width: 100% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px !important;
  border-radius: 14px !important;
  border: 0 !important;
  background: #2f9bff !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 24px rgba(47,155,255,.28);
}
.sheet-ok-ico { font-size: 16px; line-height: 1; }
.mail-compose { display: flex; flex-direction: column; gap: 12px; }
.mail-card {
  background: #121a27;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px;
}
.mail-card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.mail-card-ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(47,155,255,.14); color: #6ec1ff; font-size: 14px; flex: 0 0 auto;
}
.mail-card-title { color: #fff; font-size: 14px; font-weight: 700; line-height: 1.2; }
.mail-card-sub { color: #8b9bb0; font-size: 12px; margin-top: 2px; line-height: 1.35; }
.mail-editor-wrap {
  position: relative;
  border: 1px solid rgba(47,155,255,.55);
  border-radius: 12px;
  background: #0d141f;
  min-height: 120px;
}
.mail-editor.broadcast-editor,
#sheet-body .mail-editor.broadcast-editor {
  min-height: 118px !important;
  max-height: 220px !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 12px !important;
  padding: 12px 12px 28px !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}
.mail-char-count {
  position: absolute; right: 10px; bottom: 8px;
  font-size: 11px; color: #7f8fa3; pointer-events: none;
}
.mail-char-count.over { color: #ff7a6e; }
.mail-btns-preview { margin-top: 10px; }
.mail-btn-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px;
}
.mail-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 10px; border-radius: 11px;
  border: 1px solid rgba(47,155,255,.55); background: transparent;
  color: #6ec1ff; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.mail-action-btn.is-active, .mail-action-btn:active { background: rgba(47,155,255,.12); }
.mail-btn-count { opacity: .85; font-weight: 600; }
.mail-info {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 12px 12px 14px; border-radius: 14px;
  background: rgba(47,155,255,.08);
  border: 1px solid rgba(47,155,255,.18);
  border-left: 3px solid #2f9bff;
  color: #b7c6d8; font-size: 12.5px; line-height: 1.4;
}
.mail-info b { color: #e8f3ff; font-weight: 700; }
.mail-info-ico {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(47,155,255,.2); color: #6ec1ff; font-size: 11px; font-weight: 800; margin-top: 1px;
}
.mail-photo-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 16px; border: 1px solid rgba(255,255,255,.08);
  background: #121a27; cursor: pointer;
}
.mail-photo-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(47,155,255,.12); color: #6ec1ff; flex: 0 0 auto;
}
.mail-photo-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mail-photo-title { color: #fff; font-size: 14px; font-weight: 700; }
.mail-photo-sub { color: #8b9bb0; font-size: 12px; }
.mail-photo-chev { color: #6b7c90; font-size: 22px; line-height: 1; font-weight: 300; }
.mail-photo-rm {
  width: 100%; min-height: 36px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12); background: transparent;
  color: #9aa8b8; font-size: 13px; font-weight: 600; cursor: pointer;
}
.mail-photo-rm.hidden { display: none !important; }
.sheet-card.sheet-mail-text .text-sel-menu.fmt-bar-inline {
  margin-top: 8px !important; background: #0f1720 !important;
}


/* ==== button colors 1789461377 ==== */
.mail-field-label {
  display: block;
  margin: 8px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #9aa8b8;
}
.mail-color-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.mail-color-swatch {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: #0d141f;
  color: #d7e3f0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}
.mail-color-swatch.is-on {
  border-color: #2f9bff;
  box-shadow: inset 0 0 0 1px rgba(47,155,255,.45);
}
.mail-color-swatch--coral { color: #ff7a6e; }
.mail-color-swatch--red { color: #ff5a7a; }
.mail-color-swatch--pink { color: #ff7eb3; }
.mail-color-swatch--orange { color: #ffb060; }
.mail-color-swatch--green { color: #5dffa0; }
.mail-color-swatch--blue { color: #6ec8ff; }
.tg-url-btn--coral .tg-url-btn-text { color: #ff7a6e !important; -webkit-text-fill-color: #ff7a6e !important; }
.tg-url-btn--red .tg-url-btn-text { color: #ff5a7a !important; -webkit-text-fill-color: #ff5a7a !important; }
.tg-url-btn--pink .tg-url-btn-text { color: #ff7eb3 !important; -webkit-text-fill-color: #ff7eb3 !important; }
.tg-url-btn--orange .tg-url-btn-text { color: #ffb060 !important; -webkit-text-fill-color: #ffb060 !important; }
.tg-url-btn--green .tg-url-btn-text { color: #5dffa0 !important; -webkit-text-fill-color: #5dffa0 !important; }
.tg-url-btn--blue .tg-url-btn-text { color: #6ec8ff !important; -webkit-text-fill-color: #6ec8ff !important; }
.tg-url-btn { padding-right: 12px !important; }
.tg-url-btn-go { display: none !important; }


/* ==== live button fills ==== */
.tg-url-btn--coral {
  background: #2a181c !important;
  box-shadow: inset 0 0 0 1px rgba(255,122,110,.28) !important;
}
.tg-url-btn--coral .tg-url-btn-text {
  background: none !important;
  color: #ff7a6e !important;
  -webkit-text-fill-color: #ff7a6e !important;
}
.tg-url-btn--red {
  background: #2a1418 !important;
  box-shadow: inset 0 0 0 1px rgba(255,90,122,.32) !important;
}
.tg-url-btn--red .tg-url-btn-text {
  background: none !important;
  color: #ff5a7a !important;
  -webkit-text-fill-color: #ff5a7a !important;
}
.tg-url-btn--pink {
  background: #2a1620 !important;
  box-shadow: inset 0 0 0 1px rgba(255,126,179,.32) !important;
}
.tg-url-btn--pink .tg-url-btn-text {
  background: none !important;
  color: #ff7eb3 !important;
  -webkit-text-fill-color: #ff7eb3 !important;
}
.tg-url-btn--orange {
  background: #2a1c12 !important;
  box-shadow: inset 0 0 0 1px rgba(255,176,96,.32) !important;
}
.tg-url-btn--orange .tg-url-btn-text {
  background: none !important;
  color: #ffb060 !important;
  -webkit-text-fill-color: #ffb060 !important;
}
.tg-url-btn--green {
  background: #12241a !important;
  box-shadow: inset 0 0 0 1px rgba(93,255,160,.28) !important;
}
.tg-url-btn--green .tg-url-btn-text {
  background: none !important;
  color: #5dffa0 !important;
  -webkit-text-fill-color: #5dffa0 !important;
}
.tg-url-btn--blue {
  background: #12202a !important;
  box-shadow: inset 0 0 0 1px rgba(110,200,255,.28) !important;
}
.tg-url-btn--blue .tg-url-btn-text {
  background: none !important;
  color: #6ec8ff !important;
  -webkit-text-fill-color: #6ec8ff !important;
}


/* ==== fmt visual fix ==== */
.mail-editor.broadcast-editor,
#sheet-body .mail-editor.broadcast-editor,
#sheet-body .broadcast-editor,
.tg-bubble-text.broadcast-editor {
  font-weight: 400 !important;
  -webkit-text-fill-color: #e8eef5 !important;
  color: #e8eef5 !important;
}
#sheet-body .broadcast-editor b,
#sheet-body .broadcast-editor strong,
.tg-bubble-text b,
.tg-bubble-text strong,
.mail-editor b,
.mail-editor strong {
  font-weight: 700 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
#sheet-body .broadcast-editor i,
#sheet-body .broadcast-editor em,
.mail-editor i,
.mail-editor em {
  font-style: italic !important;
  font-weight: inherit !important;
}
#sheet-body .broadcast-editor u,
.mail-editor u {
  text-decoration: underline !important;
  font-weight: inherit !important;
}
#sheet-body .broadcast-editor s,
.mail-editor s {
  text-decoration: line-through !important;
  font-weight: inherit !important;
  opacity: .85 !important;
}

/* Quote stays on the same line (Telegram-like inline quote) */
#sheet-body .broadcast-editor blockquote,
#sheet-body .broadcast-editor blockquote.tg-quote,
#sheet-body .mail-editor blockquote,
.tg-bubble-text blockquote,
.broadcast-editor .tg-quote {
  display: inline !important;
  vertical-align: baseline !important;
  margin: 0 !important;
  padding: 0 0 0 8px !important;
  border-left: 3px solid #2AABEE !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #cfe9f8 !important;
  -webkit-text-fill-color: #cfe9f8 !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  position: static !important;
  max-width: none !important;
  white-space: pre-wrap !important;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
#sheet-body .broadcast-editor blockquote::after,
.tg-bubble-text blockquote::after,
.broadcast-editor .tg-quote::after {
  content: none !important;
  display: none !important;
}
#sheet-body .broadcast-editor code,
.mail-editor code {
  font-weight: 400 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  padding: 1px 5px !important;
  border-radius: 5px !important;
}


/* ==== premium stickers picker ==== */
.mail-stk-btn {
  width: 100%;
  margin-top: 8px;
  border-color: rgba(255, 180, 90, .45) !important;
  color: #ffc27a !important;
}
.tg-custom-emoji {
  display: inline-block;
  width: 1.35em;
  height: 1.35em;
  vertical-align: -0.25em;
  margin: 0 1px;
}
.tg-custom-emoji img {
  width: 1.35em;
  height: 1.35em;
  object-fit: contain;
  pointer-events: none;
  display: block;
}
.stk-picker { display: flex; flex-direction: column; gap: 10px; min-height: 280px; }
.stk-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stk-tab {
  min-height: 38px; border-radius: 11px;
  border: 1px solid rgba(255,255,255,.1); background: #121a27;
  color: #9aa8b8; font-size: 13px; font-weight: 700; cursor: pointer;
}
.stk-tab.is-on { border-color: rgba(47,155,255,.55); color: #fff; background: rgba(47,155,255,.14); }
.stk-hint { font-size: 12px; color: #8b9bb0; line-height: 1.35; }
.stk-hint.is-err { color: #ff8aa0; }
.stk-packs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.stk-pack {
  flex: 0 0 auto; max-width: 170px;
  min-height: 34px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12); background: #0d141f;
  color: #d7e3f0; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stk-pack.is-on { border-color: #2f9bff; color: #fff; box-shadow: inset 0 0 0 1px rgba(47,155,255,.35); }
.stk-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  max-height: 340px; overflow-y: auto; padding: 4px 2px 8px;
}
.stk-item {
  aspect-ratio: 1; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08); background: #121a27;
  padding: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.stk-item img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.stk-item.is-added { border-color: #2dff8a; }
.stk-empty { grid-column: 1 / -1; text-align: center; color: #7f8fa3; padding: 24px 8px; font-size: 13px; }
.stk-empty-err { color: #ff8aa0; }
@media (max-width: 380px) { .stk-grid { grid-template-columns: repeat(4, 1fr); } }


/* ==== emoji corner btn + popover ==== */
.mail-editor-wrap { position: relative !important; }
.mail-emoji-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: #152033;
  color: #ffd27a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mail-emoji-btn:active { background: rgba(47,155,255,.18); }
.mail-editor.broadcast-editor,
#sheet-body .mail-editor.broadcast-editor {
  padding-right: 48px !important;
  padding-top: 14px !important;
}
.stk-popover {
  position: absolute;
  top: 46px;
  right: 8px;
  left: 8px;
  z-index: 20;
  background: #0d141f;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  padding: 10px;
  max-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stk-popover-head {
  display: grid;
  grid-template-columns: 1fr 1fr 34px;
  gap: 6px;
  align-items: center;
}
.stk-pop-close {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1); background: #121a27;
  color: #9aa8b8; font-size: 20px; cursor: pointer; line-height: 1;
}
.stk-popover .stk-grid {
  max-height: 220px;
}
.mail-stk-btn { display: none !important; }


/* per-account settings rows */
.tg-acc-row-meta { display:block; font-size:11px; color:#8b98a8; margin-top:2px; }
.tg-acc-row-actions { display:flex; gap:6px; margin-left:auto; align-items:center; }
.tg-acc-row-cfg {
  border:0; background:rgba(88,166,255,.14); color:#9ecbff; border-radius:8px;
  padding:6px 10px; font-size:11px; font-weight:600; cursor:pointer; white-space:nowrap;
}
.tg-acc-row-cfg:active { opacity:.8; }
.manage-acc-hint { padding:8px 14px 0; font-size:12px; color:#8b98a8; }


/* ==== LOPH FIX spacing+fleeges buttons ==== */
.broadcast-editor,
#sheet-body .broadcast-editor,
.mail-editor.broadcast-editor,
#sheet-body .mail-editor.broadcast-editor,
.tg-bubble-text.broadcast-editor,
#sheet-body .tg-bubble-text {
  line-height: 1.7 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}
.broadcast-editor div,
.broadcast-editor p,
.mail-editor div,
.mail-editor p,
.tg-bubble-text div,
.tg-bubble-text p {
  margin: 0 !important;
  min-height: 1.7em;
  line-height: 1.7 !important;
}
.broadcast-editor br,
.mail-editor br,
.tg-bubble-text br {
  content: "";
  display: block;
  margin-bottom: 0.35em;
}

/* Fleeges-like solid danger URL buttons */
.tg-url-btns-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  width: 100% !important;
  margin-top: 10px !important;
}
.tg-url-btn,
.tg-bubble .tg-url-btn,
#sheet-body .tg-url-btn {
  flex: 1 1 calc(50% - 8px) !important;
  min-width: 132px !important;
  min-height: 46px !important;
  border: 0 !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  text-align: center !important;
  justify-content: center !important;
  align-items: center !important;
  display: inline-flex !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  box-shadow: none !important;
  text-decoration: none !important;
}
.tg-url-btn-go { display: none !important; }
.tg-url-btn--coral,
.tg-url-btn--red,
.tg-url-btn--pink,
.tg-url-btn--orange {
  background: #e53955 !important;
  background-image: linear-gradient(180deg, #ff5c72 0%, #e0314c 100%) !important;
}
.tg-url-btn--coral .tg-url-btn-text,
.tg-url-btn--red .tg-url-btn-text,
.tg-url-btn--pink .tg-url-btn-text,
.tg-url-btn--orange .tg-url-btn-text,
.tg-url-btn--coral,
.tg-url-btn--red,
.tg-url-btn--pink,
.tg-url-btn--orange {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.tg-url-btn--green {
  background: #1f9d55 !important;
  background-image: linear-gradient(180deg, #2ecc71 0%, #1b9e55 100%) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.tg-url-btn--green .tg-url-btn-text {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.tg-url-btn--blue {
  background: #2a6fdb !important;
  background-image: linear-gradient(180deg, #4c8dff 0%, #2a6fdb 100%) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.tg-url-btn--blue .tg-url-btn-text {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.tg-custom-emoji {
  width: 1.55em !important;
  height: 1.55em !important;
  vertical-align: -0.3em !important;
}
.tg-custom-emoji img {
  width: 1.55em !important;
  height: 1.55em !important;
}
