/* AI chat (birja.altron.uz uslubida): markazda salomlashuv, pastda porlaydigan yozish maydoni */
main.chat { position: relative; max-width: none; margin: 0; padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat .scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 28px; scroll-behavior: smooth; }
.chat .wrap { max-width: 940px; margin: 0 auto; padding: 16px 0 8px; min-height: 100%; display: flex; flex-direction: column; }

.wallet-chip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); white-space: nowrap;
  border: 1px solid var(--line2); background: var(--w04); border-radius: 12px; padding: 6px 12px; font-size: 13px; }
.wallet-chip span { color: var(--muted); }
.wallet-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-chip:hover { border-color: rgba(124, 92, 255, .6); }

/* Salomlashuv */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px 0 30px; }
.hero[hidden] { display: none; }
.orb { width: min(400px, 74vw); height: auto; margin-bottom: 4px; overflow: visible; }
.orb .inf { fill: none; stroke-linecap: round; }
.orb .base { stroke: rgba(150, 125, 255, .22); stroke-width: 7; }
.orb .run { stroke: url(#og); stroke-width: 5; stroke-dasharray: 260 640; animation: flow 4.5s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -900; } }
.hero h1 { margin: 0; font-weight: 300; font-size: clamp(28px, 3.3vw, 48px); letter-spacing: -.6px; line-height: 1.25; }
.hero h1 b { font-weight: 600; }
.hero .sub { margin: 4px 0 30px; font-weight: 300; font-size: clamp(21px, 2.6vw, 36px); color: var(--muted); letter-spacing: -.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; max-width: 820px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line2); background: var(--chip-bg); color: var(--t1);
  border-radius: 14px; padding: 10px 17px 10px 13px; font-size: 14.5px; cursor: pointer; transition: .2s; white-space: nowrap; }
.chip svg { width: 17px; height: 17px; flex: none; }
.chip:hover { background: rgba(124, 92, 255, .18); border-color: rgba(124, 92, 255, .6); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(92, 72, 255, .25); }
.hero-note { margin-top: 26px; color: var(--dim); font-size: 13px; max-width: 600px; }

/* Xabarlar */
.msg { display: flex; gap: 11px; margin: 16px 0; min-width: 0; }
#msgs > .msg:last-child { animation: rise .25s ease both; }
.msg .av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.msg.u { flex-direction: row-reverse; }
.msg.u .av { background: var(--w09); }
.msg.a .av { background: var(--pop); border: 1px solid var(--line2); box-shadow: 0 0 16px rgba(124, 92, 255, .4); color: var(--acc-text); }
.bub { min-width: 0; max-width: min(780px, 88%); padding: 13px 18px; border-radius: 14px; overflow-wrap: anywhere; line-height: 1.6; }
.msg.u .bub { background: linear-gradient(135deg, rgba(124, 92, 255, .32), rgba(59, 107, 255, .26)); border: 1px solid rgba(124, 92, 255, .35);
  border-top-right-radius: 4px; white-space: pre-wrap; }
.msg.a .bub { background: var(--w035); border: 1px solid var(--line); border-top-left-radius: 4px; flex: 1; }
.bub p { margin: 0 0 9px; }
.bub p:last-child { margin: 0; }
.bub b { color: var(--strong); font-weight: 650; }
.bub ul { margin: 4px 0 9px; padding-left: 0; list-style: none; }
.bub li { position: relative; padding: 3px 0 3px 20px; }
.bub li::before { content: ""; position: absolute; left: 5px; top: .9em; width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg, var(--ac3), var(--ac2)); }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.tools span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 99px; padding: 2px 10px; }
.tools span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px var(--up); }
.tools span.err::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.act-card { margin-top: 12px; border: 1px solid rgba(124, 92, 255, .4); background: rgba(124, 92, 255, .08); border-radius: 12px;
  padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.act-card .sum { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--strong); display: block; }
.act-card small { color: var(--muted); display: block; }
.typing { display: flex; gap: 5px; align-items: center; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ac3); animation: b 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.typing small { color: var(--muted); margin-left: 8px; font-size: 12.5px; }
@keyframes b { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

/* Yozish maydoni */
.comp { padding: 8px 28px 18px; }
.comp .box { max-width: 940px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; background: var(--comp-bg);
  border: 1px solid var(--line2); border-radius: 18px; padding: 9px 9px 9px 10px; transition: .2s; }
.comp .in { display: flex; align-items: flex-end; gap: 8px; }
.comp .box:focus-within { border-color: rgba(124, 92, 255, .75); box-shadow: 0 0 0 4px rgba(124, 92, 255, .14), 0 0 34px rgba(92, 72, 255, .22); }
.comp textarea { flex: 1; background: none; border: 0; outline: 0; box-shadow: none; color: var(--ink); font: inherit; font-size: 17px;
  resize: none; max-height: 160px; padding: 6px 0; line-height: 1.5; border-radius: 0; }
.comp textarea:focus { box-shadow: none; }
.send { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--grad); cursor: pointer; display: grid; place-items: center;
  flex: none; transition: .2s; box-shadow: 0 4px 18px rgba(92, 72, 255, .5); }
.send:hover { transform: translateY(-1px); }
.send:disabled { opacity: .4; cursor: default; transform: none; }
.hint { text-align: center; color: var(--dim); font-size: 12px; margin-top: 9px; }

@media (max-width: 860px) {
  .chat .scroll { padding: 0 12px; }
  .hero { justify-content: flex-start; padding: 14px 0 8px; }
  .hero .sub { margin-bottom: 18px; }
  .chips { gap: 8px; }
  .chip { padding: 9px 12px 9px 10px; font-size: 13px; }
  .msg { gap: 8px; }
  .msg .av { width: 24px; height: 24px; font-size: 10px; }
  .msg.u .av { display: none; }
  .bub { max-width: 100%; font-size: 15px; }
  .msg.u .bub { max-width: 88%; }
  .comp { padding: 8px 12px 10px; }
  .hint { display: none; }
  .wallet-chip span { display: none; }
}

/* Yozish maydonidagi tugmalar: fayl biriktirish va ovozli suhbat */
.cbtn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: none; color: var(--icon); display: grid; place-items: center;
  cursor: pointer; flex: none; transition: .15s; }
.cbtn .ico { width: 21px; height: 21px; }
.cbtn:hover { background: var(--w07); color: var(--strong); }
#voice { color: var(--acc-text); }
#voice:hover { background: var(--brand-soft); }
.comp textarea { padding-left: 2px; }

/* Biriktirilgan fayllar (yuborishdan oldin) */
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 0 6px; }
.att { position: relative; display: flex; align-items: center; gap: 9px; max-width: 250px; padding: 6px 30px 6px 6px; border-radius: 12px;
  border: 1px solid var(--line2); background: var(--w04); animation: rise .2s both; }
.att img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.att-ico { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--acc-text); flex: none; }
.att-ico .ico { width: 20px; height: 20px; }
.att-n { min-width: 0; line-height: 1.25; }
.att-n b { display: block; font-size: .82rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-n small { color: var(--muted); font-size: .72rem; }
.att-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: none; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; }
.att-x .ico { width: 13px; height: 13px; }
.att-x:hover { background: var(--bad-soft); color: var(--bad); }

/* Xabar ichidagi fayllar */
.a-files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.a-files:last-child { margin-bottom: 0; }
.a-img img { display: block; max-width: 190px; max-height: 150px; border-radius: 10px; border: 1px solid var(--line2); }
.a-file { display: inline-flex; align-items: center; gap: 9px; padding: 7px 11px 7px 9px; border-radius: 10px; border: 1px solid var(--line2); background: var(--w05); }
.a-file .ico { width: 20px; height: 20px; color: var(--acc-text); flex: none; }
.a-file b { display: block; font-size: .84rem; font-weight: 500; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-file small { color: var(--muted); font-size: .72rem; }

/* Sudrab tashlash */
.dropzone { position: absolute; inset: 8px; z-index: 30; display: grid; place-items: center; text-align: center; border-radius: 16px;
  border: 2px dashed rgba(124, 92, 255, .75); background: color-mix(in srgb, var(--bg2) 88%, transparent); backdrop-filter: blur(3px); pointer-events: none; }
.dropzone[hidden] { display: none; }
.dropzone .ico { width: 34px; height: 34px; color: var(--acc-text); display: block; margin: 0 auto 8px; }
.dropzone b { display: block; font-size: 1.1rem; }
.dropzone small { color: var(--muted); }

/* Ovozli suhbat ekrani */
.voice { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 22px 20px 34px; background: radial-gradient(70vmax 60vmax at 50% 45%, color-mix(in srgb, var(--ac1) 14%, var(--bg2)), var(--bg2) 70%);
  animation: vin .3s both; }
@keyframes vin { from { opacity: 0; } }
.v-brand { font-weight: 600; font-size: 1.05rem; align-self: flex-start; display: flex; align-items: baseline; gap: 10px; }
.v-brand i { font-style: normal; background: linear-gradient(90deg, #c084fc, #3b6bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.v-brand small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.v-orb { width: min(80vmin, 560px); aspect-ratio: 1; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex: none; margin: auto 0 0; }
.v-orb canvas { width: 100%; height: 100%; display: block; }
.v-status { margin-top: 4px; font-size: 1.15rem; font-weight: 500; text-align: center; min-height: 1.6em; }
.v-text { min-height: 3.2em; max-width: min(640px, 92vw); margin-top: 6px; text-align: center; color: var(--muted); line-height: 1.5; font-size: .98rem; overflow-wrap: anywhere; }
.v-bar { display: flex; gap: 18px; margin: 14px 0 auto; }
.v-btn { width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--line2); background: var(--w07); color: var(--strong); display: grid; place-items: center; cursor: pointer; transition: .15s; }
.v-btn .ico { width: 24px; height: 24px; }
.v-btn:hover { background: var(--w09); transform: translateY(-1px); }
.v-btn.off { background: var(--bad-soft); color: var(--bad); border-color: rgba(248, 113, 113, .4); }
.v-btn.end { background: #ef4444; border-color: transparent; color: #fff; box-shadow: 0 6px 22px rgba(239, 68, 68, .45); }
.v-btn.end:hover { background: #dc2626; }
@media (max-height: 640px) { .v-orb { width: min(58vmin, 560px); } .v-btn { width: 52px; height: 52px; } }
.v-brand img { width: 30px; height: 30px; align-self: center; }
.v-brand { align-items: center; }
