:root {
  --bg: #120f16;
  --bg-2: #1a1621;
  --panel: #211c2a;
  --panel-2: #2a2435;
  --line: #352d42;
  --text: #f3eef7;
  --muted: #a397b3;
  --accent: #ff5c8a;
  --accent-2: #ffb347;
  --accent-soft: rgba(255, 92, 138, 0.14);
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 16px;
  --z-sidebar: 40; --z-modal: 60; --z-toast: 70;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(255, 92, 138, 0.12), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(255, 179, 71, 0.10), transparent 60%),
              var(--bg);
  color: var(--text);
  line-height: 1.5;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }

.app { display: grid; grid-template-columns: 280px 1fr; height: 100vh; height: 100dvh; }

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 16px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: block; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.brand-name span { color: var(--accent); }
.brand-tag { font-size: 12px; color: var(--muted); }

.btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 12px;
  padding: 10px 14px; font-weight: 600; transition: border-color .15s, background-color .15s, color .15s; min-height: 40px;
}
.btn:hover { border-color: var(--accent); }
.btn-new { width: 100%; background: linear-gradient(135deg, var(--accent), #ff7fa9); border: none; color: #1a0b12; }
.btn-new:hover { filter: brightness(1.05); }

.side-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-bottom: 8px; }
.sessions { list-style: none; margin: 0; padding: 0; overflow: auto; }
.sessions li { margin: 0; padding: 0; }
.sessions .sess {
  display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px;
  padding: 9px 10px; min-height: 40px; color: var(--muted); font: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sessions .sess small { display: block; font-size: 11px; opacity: .8; margin-top: 2px; }
.sessions .sess:hover { background: var(--panel); color: var(--text); }
.sessions .sess.active { background: var(--accent-soft); color: var(--text); }
.sessions .empty { padding: 9px 10px; font-size: 12.5px; color: var(--muted); }
.side-footer { font-size: 12px; color: var(--muted); display: grid; gap: 6px; }
.status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-right: 6px; }
.status.ok .dot { background: var(--ok); }
.status.bad .dot { background: var(--bad); }

/* ---------- main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; height: 100dvh; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 22px;
  border-bottom: 1px solid var(--line); background: rgba(18, 15, 22, .6); backdrop-filter: blur(8px);
}
.topbar-title { color: var(--muted); font-size: 13.5px; }
.menu-btn { display: none; }
.icon-btn { background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 6px 8px; min-width: 44px; min-height: 44px; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); line-height: 1; touch-action: manipulation; }
.icon-btn svg { display: block; }
.icon-btn:hover { color: var(--text); }
.icon-btn:hover { background: var(--panel); border-color: var(--line); }

.chat { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 24px 22px 12px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }

.welcome { margin: auto; max-width: 620px; text-align: center; padding: 30px 10px; }
.welcome h1 { font-family: var(--display); font-size: 34px; margin: 0 0 12px; letter-spacing: -.5px; }
.welcome p { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.example {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  text-align: left; font-size: 13.5px; color: var(--text); transition: .15s;
}
.example:hover { border-color: var(--accent); background: var(--accent-soft); }

/* messages */
.msg { display: flex; gap: 12px; max-width: 900px; width: 100%; }
.msg-user { align-self: flex-end; justify-content: flex-end; }
.msg-user .bubble {
  background: linear-gradient(135deg, #2b2036, #33253f); border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 4px var(--radius); padding: 12px 14px; max-width: 70%;
  white-space: pre-wrap; word-break: break-word; font-size: 14.5px;
}
.user-img { max-width: 260px; max-height: 320px; min-height: 80px; border-radius: 10px; display: block; margin-bottom: 8px; background: var(--panel-2); }
.msg-bot { align-self: flex-start; }
.avatar { width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; flex-shrink: 0; font-size: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px var(--radius) var(--radius) var(--radius);
  padding: 16px 18px; flex: 1; min-width: 0; display: grid; gap: 14px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.badge.tone-interested, .badge.tone-flirty { color: var(--ok); border-color: rgba(74,222,128,.35); }
.badge.tone-cold, .badge.tone-annoyed { color: var(--bad); border-color: rgba(248,113,113,.35); }
.badge.tone-testing, .badge.tone-neutral { color: var(--warn); border-color: rgba(251,191,36,.35); }
.interest { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.interest .bar { width: 110px; height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.interest .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: left; transition: transform .6s ease; }
.interest b { color: var(--text); }

.recognized details { font-size: 13px; color: var(--muted); }
.recognized summary { cursor: pointer; }
.recognized ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.recognized li { padding: 6px 10px; border-radius: 10px; background: var(--panel-2); max-width: 85%; }
.recognized li.user { margin-left: auto; background: #3a2a44; color: var(--text); }
.recognized li b { font-size: 12px; color: var(--muted); margin-right: 6px; }
.signals { font-size: 13px; color: var(--muted); }
.signals span { display: inline-block; background: var(--panel-2); border-radius: 8px; padding: 2px 8px; margin: 2px 4px 2px 0; }

.variants { display: grid; gap: 10px; }
.variant { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg-2); position: relative; }
.variant-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.v-emoji { font-size: 16px; }
.v-label { font-weight: 700; font-size: 13px; letter-spacing: .3px; }
.copy { margin-left: auto; font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; min-height: 34px; min-width: 9.5em; color: var(--muted); touch-action: manipulation; }
.copy:hover { color: var(--text); border-color: var(--accent); }
.copy.done { color: var(--ok); border-color: rgba(74,222,128,.4); }
.v-text { margin: 0 0 6px; font-size: 15px; line-height: 1.55; }
.v-why { font-size: 12px; color: var(--muted); }
.v-source { color: var(--muted); }
.v-source::before { content: "· "; }

.explain { font-size: 14px; color: #dcd3e6; }
.avoid { font-size: 13.5px; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25); border-radius: 10px; padding: 8px 12px; }
.avoid span { font-weight: 700; color: var(--warn); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.meta { font-size: 11.5px; color: var(--muted); }
.fb { display: flex; gap: 4px; }
.fb-btn { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; min-width: 40px; min-height: 36px; touch-action: manipulation; }
.fb-btn:hover, .fb-btn.sel { border-color: var(--line); background: var(--panel-2); }

.msg-bot.error .card { border-color: rgba(248,113,113,.4); }
.msg-bot.error .explain { color: var(--bad); }

.typing { display: inline-flex; gap: 5px; align-items: center; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .5; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0);} 40% { opacity: 1; transform: translateY(-3px);} }

/* ---------- composer ---------- */
.composer { border-top: 1px solid var(--line); padding: 10px 22px 14px; background: rgba(18,15,22,.7); backdrop-filter: blur(8px); }
.style-hints { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.hint-label { font-size: 12px; color: var(--muted); margin-right: 4px; }
.chip { font-size: 12px; padding: 6px 12px; min-height: 32px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); touch-action: manipulation; }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.attach-preview { position: relative; display: inline-block; margin-bottom: 8px; }
.attach-preview img { max-height: 120px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.attach-preview .icon-btn { position: absolute; top: -10px; right: -10px; background: var(--panel-2); border-color: var(--line); font-size: 13px; padding: 0; width: 32px; height: 32px; min-width: 32px; min-height: 32px; border-radius: 50%; }
.attach-preview .icon-btn::before { content: ""; position: absolute; inset: -6px; }
.input-row {
  display: flex; align-items: flex-end; gap: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 24px; padding: 6px 6px 6px 12px; transition: border-color .15s, box-shadow .15s;
}
.input-row:focus-within, .input-row.drag { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* обводка фокуса - на контейнере, а не квадратом на textarea/кнопках внутри */
.input-row textarea:focus-visible, .input-row .icon-btn:focus-visible, .input-row .btn-send:focus-visible { outline: none; }
.attach-btn { font-size: 18px; }
textarea {
  flex: 1; resize: none; border: none; outline: none; background: transparent; color: var(--text);
  font: inherit; font-size: 15px; max-height: 220px; line-height: 1.45; padding: 6px 4px;
}
textarea::placeholder { color: var(--muted); }
.input-row textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-send { background: var(--accent); color: #1a0b12; border: none; width: 40px; height: 40px; border-radius: 50%; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-send:disabled { opacity: .5; cursor: not-allowed; }
.composer-note { font-size: 11px; color: var(--muted); margin-top: 6px; }

.toast { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; z-index: var(--z-toast); box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: min(92vw, 420px); text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: var(--z-sidebar); transform: translateX(-100%); transition: transform .2s; }
  input, textarea, select { font-size: 16px; }  /* iOS не зумит поля >=16px */
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.6); }
  .menu-btn { display: inline-block; }
  .topbar-title { font-size: 12.5px; }
  .examples { grid-template-columns: 1fr; }
  .msg-user .bubble { max-width: 90%; }
  .chat, .composer { padding-left: 12px; padding-right: 12px; }
  .welcome h1 { font-size: 26px; }
}

/* ---------- voice ---------- */
.mic-btn { font-size: 18px; }
.mic-btn.rec { background: rgba(248,113,113,.18); border-color: var(--bad); color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(248,113,113,.5);} 50% { box-shadow: 0 0 0 8px rgba(248,113,113,0);} }
.audio-chip { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.audio-chip audio { height: 32px; max-width: 260px; }
.voice-box { background: rgba(255,179,71,.07); border: 1px solid rgba(255,179,71,.25); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.voice-line b { color: var(--accent-2); }
.voice-tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.voice-tags span:empty { display: none; }
.voice-tags span { font-size: 12px; background: var(--panel-2); border-radius: 8px; padding: 2px 8px; color: var(--muted); }
.user-audio { display: block; max-width: 280px; height: 32px; margin-bottom: 6px; }

/* ---------- Telegram Mini App / компактный мобильный режим ---------- */
html.tg .app { grid-template-columns: 1fr; }
html.tg .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: var(--z-sidebar); transform: translateX(-100%); transition: transform .2s; }
html.tg .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.6); }
html.tg .menu-btn { display: inline-flex; }
html.tg .app, html.tg .main { height: 100vh; height: 100dvh; height: var(--tg-viewport-stable-height, 100dvh); }
html.tg body { font-size: 15px; }
html.tg .topbar { padding: 8px 10px; }
html.tg .topbar-title { font-size: 12px; line-height: 1.3; }
html.tg .chat { padding: 10px 8px 6px; gap: 12px; }
html.tg .welcome { padding: 14px 4px; }
html.tg .welcome h1 { font-size: 24px; }
html.tg .welcome p { font-size: 13.5px; margin-bottom: 14px; }
html.tg .examples { grid-template-columns: 1fr; gap: 6px; }
html.tg .example { padding: 9px 12px; font-size: 13px; }
html.tg .msg { gap: 6px; }
html.tg .avatar { display: none; }
html.tg .card { padding: 10px 11px; gap: 9px; border-radius: 12px; }
html.tg .msg-user .bubble { max-width: 88%; padding: 8px 11px; font-size: 14px; }
html.tg .variant { padding: 9px 10px; }
html.tg .v-text { font-size: 14.5px; line-height: 1.5; }
html.tg .v-why, html.tg .meta { font-size: 12px; }
html.tg .copy { font-size: 12.5px; padding: 5px 10px; min-height: 32px; }
html.tg .explain { font-size: 14px; }
html.tg .avoid { font-size: 12.5px; padding: 6px 10px; }
html.tg .signals span, html.tg .badge { font-size: 11px; }
html.tg .interest .bar { width: 70px; }
html.tg .composer { padding: 6px 8px 8px; }
html.tg .style-hints { margin-bottom: 6px; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
html.tg .style-hints::-webkit-scrollbar { display: none; }
html.tg .chip { font-size: 12px; padding: 5px 11px; min-height: 30px; white-space: nowrap; }
html.tg .input-row { padding: 4px 4px 4px 10px; border-radius: 22px; gap: 2px; align-items: center; }
html.tg .icon-btn { padding: 6px; min-width: 40px; min-height: 40px; }
html.tg .input-row textarea { font-size: 16px; max-height: 96px; padding: 6px 4px; line-height: 1.3; height: 34px; min-height: 34px; overflow: hidden; }
html.tg .input-row textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.tg .btn-send { width: 40px; height: 40px; border-radius: 10px; }
html.tg .composer-note { display: none; }

/* ---------- подписка ---------- */
.btn-plans { width: 100%; margin-bottom: 4px; background: linear-gradient(135deg, rgba(255,92,138,.18), rgba(255,179,71,.18)); border-color: rgba(255,92,138,.4); font-size: 13px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: var(--z-modal); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal { align-items: center; } }
.modal-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px 18px 0 0; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
@media (min-width: 640px) { .modal-card { border-radius: 18px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; } .modal-head h2 { margin: 0; font-family: var(--display); font-size: 18px; }
.sub-current { font-size: 13px; color: var(--muted); }
.sub-current b { color: var(--text); }
.plans { display: grid; gap: 8px; }
.plan { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left; color: var(--text); }
.plan:hover, .plan.active { border-color: var(--accent); background: var(--accent-soft); }
.plan .p-name { font-weight: 700; font-size: 14px; } .plan .p-desc { font-size: 12px; color: var(--muted); }
.plan .p-price { font-weight: 800; white-space: nowrap; } .plan .p-price small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.providers-title { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.providers-btns { display: grid; gap: 6px; }
.providers-btns .btn { text-align: left; }
.promo-row { display: flex; gap: 6px; } .promo-row input { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--text); font: inherit; }
.pay-status { font-size: 13px; min-height: 16px; }
.pay-status a { color: var(--accent); }

.tiers-line { font-size: 13px; color: var(--muted, #8a8f98); margin: 6px 0 14px; }
.tiers-line a { color: inherit; text-decoration: underline; }
.tiers-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
.icon-btn.locked { opacity: .7; position: relative; }
.icon-btn.locked::after { content: "🔒"; position: absolute; right: -2px; bottom: -2px; font-size: 10px; }
.period-switch { display: flex; gap: 6px; margin-bottom: 4px; }
.period-switch .chip.active { border-color: var(--accent); background: var(--accent-soft); }
.welcome-logo { width: 72px; height: 72px; margin-bottom: 8px; }
html.tg .welcome-logo { width: 56px; height: 56px; }

/* ---------- мой стиль ---------- */
.btn-profile { width: 100%; margin-top: 6px; justify-content: center; }
.btn-profile .prof-sum { font-size: 11px; color: var(--muted); margin-left: 4px; }
.prof-intro { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.prof-toggle { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 10px; }
.prof-q { margin-bottom: 10px; } .prof-q .q { font-size: 13px; margin-bottom: 5px; } .prof-q .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.prof-field { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.prof-field textarea { font-size: 15px; color: var(--text); }
.prof-field textarea { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--text); font: inherit; resize: vertical; }
.prof-auto { font-size: 12px; color: var(--muted); margin-bottom: 10px; } .prof-auto div { margin-top: 6px; display: grid; gap: 3px; } .prof-auto span.s { background: var(--panel); border-radius: 8px; padding: 4px 8px; }
.prof-actions { display: flex; gap: 8px; align-items: center; } .prof-actions .spacer { flex: 1; }
.btn-primary { background: var(--accent); color: #1a0b12; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.05); }

/* ---------- экраны Mini App ---------- */
.tabbar { display: none; }
.screen { display: none; }
html.tg .screen { flex: 1; overflow-y: auto; padding: 12px 12px 16px; }
html.tg body.scr-style #screenStyle, html.tg body.scr-more #screenMore { display: block; }
html.tg body.scr-style .chat, html.tg body.scr-more .chat, html.tg body.scr-style .composer, html.tg body.scr-more .composer { display: none; }
html.tg body.scr-style .topbar, html.tg body.scr-more .topbar { display: none; }
html.tg .tabbar { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: var(--bg-2); padding: 4px 6px calc(6px + env(safe-area-inset-bottom)); }
html.tg .tab { background: none; border: 0; color: var(--muted); font: inherit; font-size: 11.5px; display: grid; justify-items: center; gap: 1px; padding: 6px 0; min-height: 44px; border-radius: 10px; cursor: pointer; touch-action: manipulation; }
html.tg .tab i { font-style: normal; font-size: 18px; } html.tg .tab.active { color: var(--accent); }
html.tg .menu-btn { display: none; }
html.tg .topbar-title { font-size: 12px; text-align: center; width: 100%; }
html.tg .tiers-line { display: none; }
html.tg .welcome { padding: 8px 4px 4px; } html.tg .welcome-logo { width: 48px; height: 48px; margin-bottom: 4px; }
html.tg .welcome h1 { font-size: 22px; margin-bottom: 6px; } html.tg .welcome p { font-size: 13px; margin-bottom: 10px; }
html.tg .style-hints { display: none; }
html.tg .composer { padding: 6px 8px 6px; }
.screen-title { font-family: var(--display); font-size: 20px; margin: 4px 0 12px; }
.screen-block { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.screen-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 8px; }
.screen-note { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.tone-row { display: flex; flex-wrap: wrap; gap: 6px; }
.more-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); } .more-row:last-of-type { border-bottom: 0; }
.btn-wide { width: 100%; justify-content: center; margin-top: 8px; }
.how { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.5; }
.more-toggle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 0; }
#styleHost .prof-intro { margin-top: 0; }
#styleHost #profileForm .modal-head { display: none; }

.tg-only { display: none !important; } .tb-short { display: none; }
html.tg .tg-only { display: inline-flex !important; }
html.tg .tb-long { display: none; } html.tg .tb-short { display: inline; color: var(--text); font-weight: 600; font-size: 14px; }
html.tg .topbar { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
html.tg .topbar-title { flex: 1; text-align: center; }
#histSessions { margin-top: 10px; } #histSessions .sess { padding: 10px 12px; font-size: 14px; min-height: 44px; }

/* ---------- аудит UX: фокус, состояния, motion ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, .chip, .tab, .plan, .example { touch-action: manipulation; }
.btn:disabled, .chip:disabled { opacity: .55; cursor: not-allowed; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; top: 50%; left: 50%; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.msg-user.sending .bubble { opacity: .6; }
.msg-user.failed .bubble { border-color: rgba(248,113,113,.5); }
.msg-bot.error .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.msg-bot.error .actions .btn { font-size: 13px; padding: 8px 12px; min-height: 36px; }
.plan .p-badge { display: inline-block; font-size: 10.5px; font-weight: 700; color: #1a0b12; background: var(--accent-2); border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
.plan .p-price small.per { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.pay-note { font-size: 12px; color: var(--muted); }
html.tg .toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
html.tg .screen { overscroll-behavior: contain; }
body.modal-open { overflow: hidden; }
.msg-user .bubble .att-note { font-size: 12.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .chat { scroll-behavior: auto; }
}

.seg-lang { display: inline-flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg-lang button { background: transparent; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; cursor: pointer; }
.seg-lang button.active { background: var(--accent-soft); color: var(--text); }
.lang-row { margin-top: 8px; display: flex; justify-content: center; }
