/* Velisity Chat — слой сайта: обложка, чат, баланс. Только токены из tokens.css. */

/* ---------- обложка: hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.hero-t { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; min-width: 0; }
.hero-t .lead { max-width: 560px; }
.hero-act { display: flex; flex-wrap: wrap; gap: 12px; }
.ic-arrow { width: 18px; height: 18px; }

/* живое окно */
.hero-win { min-width: 0; border: 1px solid var(--bd); border-radius: var(--r); background: var(--glass), var(--s1); box-shadow: var(--shadow); overflow: hidden; }
.hw-top { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.hw-model { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--lav); border: 1px solid var(--bd2); border-radius: 4px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
.hw-body { display: flex; flex-direction: column; gap: 18px; min-height: 250px; padding: 22px 18px; }
.hw-msg { max-width: 92%; }
.hw-user { align-self: flex-end; background: var(--s3); border: 1px solid var(--bd); border-radius: 12px 12px 4px 12px; padding: 12px 16px; font-size: 14px; line-height: 1.55; }
.hw-ai { align-self: flex-start; display: flex; flex-direction: column; gap: 8px; }
.hw-who { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--text4); }
.hw-ai p { color: var(--text2); font-size: 14px; line-height: 1.65; }
.hw-cursor { display: inline-block; width: 8px; height: 15px; margin-left: 4px; vertical-align: -2px; background: var(--lav); animation: hwBlink 1s steps(2) infinite; }
@keyframes hwBlink { 50% { opacity: 0; } }
.hw-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.hw-cost { font-family: var(--mono); font-size: 13px; color: var(--lime); }

/* лестница цифр */
.nums { display: flex; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.num-i { flex: 1; min-width: 0; padding: 28px 24px; display: flex; flex-direction: column; gap: 8px; }
.num-i + .num-i { border-left: 1px solid var(--line); }
.num-i b { font-family: var(--mono); font-size: 24px; font-weight: 400; white-space: nowrap; }

/* секции обложки */
.sec { padding-top: 88px; padding-bottom: 88px; }
.sec-h { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 48px; text-align: center; }
.sec-note { margin-top: 16px; text-align: center; }
.tags-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* нумерованные шаги */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.step { display: flex; flex-direction: column; gap: 12px; padding: 24px 4px 0; border-top: 1px solid var(--line); min-width: 0; }
.step-n { font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: .14em; color: var(--lav); }
.step h3 { font-size: 21px; font-weight: 500; }
.step p { color: var(--text2); font-size: 14px; line-height: 1.65; }

/* финальный CTA: лавандовый ореол, не заливка */
.cta-s { padding: 24px 0 96px; }
.cta-box { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center;
  padding: 56px 48px; border: 1px solid var(--bd); border-radius: var(--r); background: var(--glass), var(--s1); }
.cta-box::before { content: ""; position: absolute; right: -80px; top: -60px; width: 420px; height: 200px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(183, 190, 220, .12), transparent); }
.cta-box > * { position: relative; }

/* ---------- авторизация ---------- */
.auth-box { border: 1px solid var(--bd); border-radius: var(--r); background: var(--glass), var(--s1); }

/* ---------- каркас чата ---------- */
.side-new { display: flex; }
.dlg-nav { flex: 1; min-height: 0; overflow-y: auto; }
.side-foot { margin-top: auto; }
.side-skl { height: 42px; border-radius: 6px; margin-bottom: 4px; }

.ubar-mid { margin-right: auto; width: 100%; max-width: 380px; min-width: 0; }
.ubar-mid .vs-btn { height: 36px; font-size: 13px; padding: 0 10px 0 12px; }

.dlg-item { position: relative; display: flex; align-items: center; min-height: 42px; border-radius: 6px; background: var(--s1); margin-bottom: 4px; }
.dlg-item > a { flex: 1; min-width: 0; height: 42px; display: flex; align-items: center; padding: 0 12px; font-size: 13px; color: var(--text2); }
.dlg-item .dlg-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-item:hover > a { color: var(--text); }
.dlg-item.on { background: var(--s4); }
.dlg-item.on > a { color: var(--text); }
.dlg-item.on::before { content: ""; position: absolute; left: 0; top: 12px; width: 2px; height: 18px; background: var(--lav); }
.dlg-act { display: flex; gap: 2px; padding-right: 6px; opacity: 0; transition: opacity .15s; }
.dlg-item:hover .dlg-act, .dlg-item:focus-within .dlg-act { opacity: 1; }
.dlg-act button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; color: var(--text3); cursor: pointer; border-radius: 5px; }
.dlg-act button:hover { color: var(--text); background: var(--s3); }
.dlg-act button svg { width: 15px; height: 15px; }
@media (hover: none) {
  .dlg-act { opacity: 1; }
  .dlg-act button { width: 44px; height: 44px; }
}
.dlg-empty { padding: 10px 12px; font-size: 12px; color: var(--text3); }

.chat { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; height: calc(100vh - 58px); }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 32px; }
.chat-empty { margin: auto; max-width: 520px; padding: 40px 0; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.chat-empty-ic { width: 34px; height: 34px; color: var(--lav); }
.chat-hints { width: 100%; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.hint { min-height: 44px; padding: 11px 16px; text-align: left; border: 1px solid var(--bd); border-radius: var(--r-s); background: var(--s1);
  color: var(--text2); font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s; }
.hint:hover { border-color: var(--bd2); color: var(--text); }

/* сообщения: реестр с волосяными линиями, роли капсом моно */
.msg { display: flex; flex-direction: column; gap: 10px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.msg:first-child { border-top: 1px solid var(--line); }
.msg-head { display: flex; align-items: center; gap: 10px; min-height: 20px; }
.msg-role { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--text4); }
.msg.user .msg-role { color: var(--lav); }
.msg-model { font-family: var(--mono); font-size: 11px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-meta { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--text3); white-space: nowrap; }
.msg-meta .cost { color: var(--lime); }
.msg-body { max-width: 860px; font-size: 15px; line-height: 1.7; }
.msg.user .msg-body { color: var(--text2); white-space: pre-wrap; word-break: break-word; }
.msg-body p { margin: 0 0 10px; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body h3 { margin: 8px 0 6px; font-size: 17px; font-weight: 500; }
.msg-body ul, .msg-body ol { margin: 0 0 10px; padding-left: 22px; color: var(--text2); }
.msg-body li { margin-bottom: 4px; }
.msg-body a { color: var(--lav); text-decoration: underline; }
.msg-body strong { font-weight: 600; }
.msg-body code { font-family: var(--mono); font-size: .88em; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--s2); }
.msg-body pre { margin: 0 0 10px; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
  font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.msg-body pre code { padding: 0; border: 0; background: none; font-size: 13px; }
.msg-body .cursor { display: inline-block; width: 8px; height: 15px; margin-left: 4px; vertical-align: -2px; background: var(--lav); animation: hwBlink 1s steps(2) infinite; }
.msg-err { color: var(--red); font-size: 13px; }

/* ход рассуждения */
.think { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--s1); }
.think summary { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; cursor: pointer; list-style: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--text3); }
.think summary::-webkit-details-marker { display: none; }
.think summary::before { content: "▸"; color: var(--lav); transition: transform .15s; }
.think[open] summary::before { transform: rotate(90deg); }
.think .think-body { padding: 0 14px 12px; font-family: var(--mono); font-size: 12px; line-height: 1.65; color: var(--text3); white-space: pre-wrap; word-break: break-word; }

/* композер */
.chat-in { padding: 12px 32px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--bg); }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 8px 8px 8px 16px; border: 1px solid var(--bd); border-radius: var(--r-m); background: var(--s1);
  transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: rgba(183, 190, 220, .5); box-shadow: var(--ring); }
.composer-ta { flex: 1; min-width: 0; max-height: 180px; padding: 11px 0; border: 0; background: none; resize: none; outline: none; font-size: 15px; line-height: 1.5; }
.btn-send { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--r-s); background: var(--btn); border: 1px solid var(--btn);
  color: #101010; cursor: pointer; transition: filter .15s, transform .1s; }
.btn-send:hover { filter: brightness(1.05); }
.btn-send:active { transform: translateY(1px); }
.btn-send[disabled] { opacity: .45; pointer-events: none; }
.btn-send .spin { width: 18px; height: 18px; border-width: 2px; }
.composer-hint { margin-top: 8px; display: flex; align-items: center; gap: 12px; }

/* ---------- баланс: способ оплаты и история ---------- */
.tx-status { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; padding: 2px 6px; border: 1px solid; border-radius: 4px; }
.tx-done { color: var(--green2); border-color: rgba(141, 185, 156, .4); }
.tx-pending { color: var(--yellow); border-color: rgba(216, 195, 124, .4); }
.tx-fail { color: var(--red); border-color: rgba(211, 151, 151, .4); }
.tx-link { color: var(--lav); text-decoration: underline; }

.pay-info { display: flex; flex-direction: column; gap: 10px; }
.pay-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--s1); }
.pay-row .k { flex: none; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--text4); text-transform: uppercase; }
.pay-row .v { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; text-align: right; word-break: break-all; user-select: all; }
.pay-row button { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--bd); border-radius: 6px;
  background: var(--s2); color: var(--text2); cursor: pointer; }
.pay-row button:hover { color: var(--text); border-color: var(--bd2); }
.pay-row button svg { width: 15px; height: 15px; }
.pay-note { margin-top: 12px; font-family: var(--mono); font-size: 11px; color: var(--text3); }

/* ---------- свои выпадающие списки (.vs) ---------- */
.vs { position: relative; display: block; width: 100%; min-width: 0; }
.vs-native { position: absolute !important; opacity: 0 !important; pointer-events: none !important; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0 !important; border: 0 !important; left: 0; bottom: 0; }
.vs-btn { width: 100%; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-radius: var(--r-s); border: 1px solid var(--bd); background: rgba(255, 255, 255, .025); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s, background .15s; }
.vs-btn:hover { border-color: var(--bd2); }
.vs-56 .vs-btn { height: 56px; }
.vs-sm .vs-btn { height: 38px; font-size: 13px; padding-left: 12px; }
.vs-mono .vs-btn { font-family: var(--mono); font-size: 13px; }
.vs-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-ch { width: 16px; height: 16px; flex: none; color: var(--text3); transition: transform .2s; }
.vs.open .vs-ch { transform: rotate(180deg); color: var(--lav); }
.vs.open .vs-btn, .vs-btn:focus-visible { border-color: rgba(183, 190, 220, .5); box-shadow: var(--ring); background: rgba(255, 255, 255, .035); }
.vs.dis .vs-btn { opacity: .5; cursor: not-allowed; }
.vs-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 80; min-width: max(100%, 220px); max-width: min(560px, calc(100vw - 32px)); background: var(--s2); border: 1px solid var(--bd2); border-radius: 14px; box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .4); padding: 6px; animation: vsIn .14s ease; outline: none; }
.vs-pop.up { top: auto; bottom: calc(100% + 6px); }
.vs-s { display: flex; align-items: center; gap: 8px; padding: 2px 10px 6px; margin: 0 -6px 6px; border-bottom: 1px solid var(--bd); }
.vs-s svg { width: 15px; height: 15px; color: var(--text3); flex: none; margin-left: 6px; }
.vs-s input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 13px; height: 34px; }
.vs-l { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.vs-o { position: relative; padding: 9px 34px 9px 12px; border-radius: 9px; font-size: 13px; line-height: 1.35; color: var(--text2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--sans); }
.vs-o.hl { background: rgba(255, 255, 255, .065); color: var(--text); }
.vs-o.sel { color: var(--text); }
.vs-o.sel::after { content: ""; position: absolute; right: 13px; top: 50%; width: 9px; height: 5px; border-left: 1.6px solid var(--lav); border-bottom: 1.6px solid var(--lav); transform: translateY(-70%) rotate(-45deg); }
.vs-o.dis { opacity: .4; cursor: default; }
.vs-g { padding: 10px 12px 5px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--text3); text-transform: uppercase; }
.vs-e { padding: 16px; text-align: center; font-size: 12px; color: var(--text3); }
@keyframes vsIn { from { opacity: 0; transform: translateY(-4px) scale(.99); } to { opacity: 1; transform: none; } }

/* ---------- адаптив ---------- */
@media (max-width: 1200px) {
  .hero { gap: 36px; }
  .steps { gap: 16px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 48px; }
  .hero-act .btn { flex: 1; min-width: 140px; }
  .sec { padding-top: 56px; padding-bottom: 56px; }
  .sec-h { margin-bottom: 32px; }
  .nums { flex-wrap: wrap; }
  .num-i { flex: 1 1 50%; padding: 20px 16px; }
  .num-i:nth-child(odd) { border-left: 0; }
  .num-i:nth-child(n+3) { border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .cta-s { padding-bottom: 64px; }
  .cta-box { padding: 40px 20px; }
  .chat-scroll { padding: 12px 16px; }
  .chat-in { padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .msg-meta { gap: 8px; }
  .hide-sm { display: none; }
  .ubar-mid { max-width: none; }
}
@media (max-width: 420px) {
  .hw-model { display: none; }
  .hero-act .btn { width: 100%; }
}
