/* ADVSET: расширенные настройки (advset.js) */
html.adv-fs .bubble { font-size: var(--adv-fs, 14px); }
html.adv-fs .row strong { font-size: calc(var(--adv-fs, 14px) * 1); }
html.adv-fs .row .preview, html.adv-fs .row .sub { font-size: calc(var(--adv-fs, 14px) * .93); }
html.adv-fs #input { font-size: max(16px, var(--adv-fs, 14px)); }
html[data-chat-bg="none"] .thread { background: var(--bg); }
html[data-chat-bg="forest"] .thread { background: radial-gradient(120% 80% at 20% 0%, #13321f 0%, #0b1a12 55%, #070d0a 100%); }
html[data-chat-bg="ocean"] .thread { background: radial-gradient(120% 90% at 80% 0%, #0f2c44 0%, #0a1a2a 55%, #060d16 100%); }
html[data-chat-bg="sunset"] .thread { background: linear-gradient(180deg, #2b1630 0%, #3a1d22 45%, #120c10 100%); }
html[data-chat-bg="graphite"] .thread { background: linear-gradient(180deg, #1b1d1f 0%, #121314 100%); }
html[data-chat-bg="dots"] .thread { background: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.4px) 0 0 / 18px 18px, #0d1210; }
html.adv-accent .msg.me .bubble { background: color-mix(in srgb, var(--accent) 26%, #0f1512 74%); }

.photo-gate {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: min(260px, 64vw); height: 150px; border: 0; border-radius: 10px; cursor: pointer;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 10px, rgba(255,255,255,.02) 10px 20px), #1a2420;
  color: #dfe8e3; font: inherit;
}
.photo-gate .pg-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
  background: rgba(var(--accent-rgb), .18); color: var(--accent); }
.photo-gate small { color: #8a9690; }
video.file-video { display: block; max-width: min(300px, 70vw); max-height: 320px; border-radius: 10px; margin-bottom: 6px; background: #000; }
img.file-preview { margin-bottom: 6px; border-radius: 10px; }

.adv-ov { position: fixed; inset: 0; z-index: 2147482000; background: var(--bg, #0b0f0d); color: var(--text, #e9efec);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.2, .9, .3, 1);
  font: 14px/1.4 var(--font, system-ui); }
.adv-ov.open { transform: none; }
@media (min-width: 900px) { .adv-ov { left: auto; width: 460px; border-left: 1px solid var(--line); box-shadow: -20px 0 50px rgba(0,0,0,.4); } }
.adv-head { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 6px;
  border-bottom: 1px solid var(--line); background: var(--sidebar, #101614); }
.adv-head strong { font-size: 16px; flex: 1; }
.adv-head button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; }
.adv-head button:hover { background: var(--hover); }
.adv-body { flex: 1; overflow-y: auto; padding: 12px 12px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.adv-sec { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; border: 1px solid var(--line); border-radius: var(--radius, 14px);
  background: var(--panel); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.adv-sec:hover { background: var(--panel-2); }
.adv-sec .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: rgba(var(--accent-rgb), .14); flex: none; }
.adv-sec span { flex: 1; display: flex; flex-direction: column; }
.adv-sec small { color: var(--muted); font-size: 12.5px; }
.adv-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius, 14px); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.adv-card h4 { margin: 0 0 2px; font-size: 14.5px; }
.adv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.adv-row > span { display: flex; flex-direction: column; min-width: 0; }
.adv-row small, .adv-hint { color: var(--muted); font-size: 12.5px; }
.adv-seg { display: inline-flex; background: var(--input, #18201d); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex: none; }
.adv-seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 10px; border-radius: 8px; font: inherit; font-size: 12.5px; cursor: pointer; }
.adv-seg button.on { background: var(--accent); color: var(--on-accent, #05210f); font-weight: 600; }
.adv-card input[type=text], .adv-card input[type=tel], .adv-card input[type=password] {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--input); color: inherit; font: inherit; }
.adv-card input[type=range] { width: 100%; accent-color: var(--accent); }
.adv-btn { padding: 10px 14px; border-radius: 10px; border: 0; background: var(--accent); color: var(--on-accent, #05210f); font: inherit; font-weight: 600; cursor: pointer; }
.adv-btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); font-weight: 500; }
.adv-btn.danger { background: transparent; color: #ef4444; border: 1px solid rgba(239,68,68,.35); }
.adv-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.adv-swatches button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.adv-swatches button.on { border-color: #fff; transform: scale(1.08); }
.adv-bgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.adv-bgs button { height: 64px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; color: #dfe8e3; font-size: 11px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.adv-bgs button.on { border-color: var(--accent); }
.adv-preview { border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); }
.adv-preview .b { max-width: 75%; padding: 7px 11px; border-radius: 12px; background: rgba(28,36,33,.96); }
.adv-preview .b.me { align-self: flex-end; background: color-mix(in srgb, var(--accent) 26%, #0f1512 74%); }
.adv-err { color: #ef4444; font-size: 13px; margin: 0; }
.adv-ok { color: var(--accent); font-size: 13px; margin: 0; }
.adv-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0;
  background: #1c2522; color: #e9efec; padding: 10px 16px; border-radius: 12px; z-index: 2147483001; transition: all .25s; pointer-events: none; font-size: 13.5px; }
.adv-toast.show { transform: translate(-50%, 0); opacity: 1; }
.adv-phone { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }

.adv-lock { position: fixed; inset: 0; z-index: 2147483500; background: radial-gradient(120% 80% at 50% 0%, #13241b, #070b09 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: #e9efec; font: 15px/1.4 var(--font, system-ui); }
.adv-lock .dots { display: flex; gap: 14px; }
.adv-lock .dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); transition: all .15s; }
.adv-lock .dots i.f { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.adv-lock.bad .dots { animation: ptr-shake .4s; }
.adv-lock .pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; }
.adv-lock .pad button { width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(255,255,255,.07); color: inherit; font-size: 24px; cursor: pointer; }
.adv-lock .pad button:active { background: rgba(var(--accent-rgb), .35); }
.adv-2fa { position: fixed; inset: 0; z-index: 2147483600; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.adv-2fa form { width: min(360px, 100%); background: #151c19; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; color: #e9efec; font: 14px/1.4 var(--font, system-ui); }
.adv-2fa h3 { margin: 0; font-size: 17px; }
.adv-2fa input { padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: #18201d; color: inherit; font: inherit; }
.adv-2fa .acts { display: flex; gap: 8px; justify-content: flex-end; }
.adv-2fa button { padding: 10px 14px; border-radius: 10px; border: 0; cursor: pointer; font: inherit; }
.adv-2fa button.p { background: var(--accent, #22c55e); color: #05210f; font-weight: 600; }
.adv-2fa button.s { background: transparent; color: #a7b4ad; border: 1px solid rgba(255,255,255,.12); }
.adv-2fa .e { color: #ef4444; margin: 0; font-size: 13px; }
