/* Giant4 IT — ИИ-чат вместо формы заявки (15.10.2026). Вид — как мессенджер, в палитре сайта. */
.tgc {
  --tg-bg: #171b1e; --tg-ai: #2a3035; --tg-me: #4d5c33; --tg-me-ink: #f4f7ec; --tg-bar: #1f2427;
  position: relative; display: grid; grid-template-rows: auto 1fr auto auto; height: 620px; max-height: 82vh; scroll-margin-top: calc(var(--bar-h, 64px) + 12px);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; color: var(--sc-ink);
  background: radial-gradient(120% 60% at 100% 0%, rgba(201, 242, 74, .07), rgba(201, 242, 74, 0) 60%), var(--tg-bg);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .6);
  font: 400 15px/1.42 var(--sc-font-text);
}
.tgc__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(32, 36, 39, .92); border-bottom: 1px solid var(--line); }
.tgc__ava { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--sc-accent); color: var(--sc-accent-ink); font: 800 15px/1 var(--sc-font-text); letter-spacing: .02em; }
.tgc__who { display: flex; flex-direction: column; min-width: 0; }
.tgc__who b { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgc__st { font-size: 13px; color: var(--sc-ink-soft); }
.tgc__st::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-end: 6px; border-radius: 50%; background: #5fd38a; vertical-align: .08em; }
.tgc__st.is-typing { color: var(--sc-accent); }
.tgc__st.is-typing::before { background: var(--sc-accent); animation: tgcBlink 1s ease-in-out infinite; }
.tgc__st.is-off::before { background: var(--warn); }

.tgc__feed { display: flex; flex-direction: column; gap: 6px; padding: 14px 12px 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3a4045 transparent; }
.tgc__m { position: relative; display: flex; flex-direction: column; max-width: 84%; align-self: flex-start; }
.tgc__m--me { align-self: flex-end; align-items: flex-end; }
.tgc__b { position: relative; padding: 7px 11px 6px; border-radius: 16px; border-end-start-radius: 6px; background: var(--tg-ai); word-wrap: break-word; overflow-wrap: anywhere; }
.tgc__m--me .tgc__b { background: var(--tg-me); color: var(--tg-me-ink); border-radius: 16px; border-end-end-radius: 6px; }
.tgc__txt a { color: var(--sc-accent); text-decoration: underline; text-underline-offset: 2px; }
.tgc__m--me .tgc__txt a { color: inherit; }
.tgc__meta { float: inline-end; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -2px 10px; font-size: 11.5px; line-height: 1; color: rgba(242, 244, 239, .5); white-space: nowrap; user-select: none; }
.tgc__m--me .tgc__meta { color: rgba(244, 247, 236, .62); }
.tgc__tick { display: inline-flex; width: 16px; height: 11px; }
.tgc__tick svg { width: 100%; height: 100%; }
.tgc__tick.is-read { color: var(--sc-accent); }
.tgc__tick.is-fail { color: var(--warn); width: 14px; height: 14px; }
.tgc__m.is-failed .tgc__b { cursor: pointer; opacity: .85; }

/* реакции */
.tgc__rx { align-self: flex-start; margin-top: 3px; padding: 2px 8px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .09); color: inherit; font: 15px/1.3 system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif; cursor: pointer; }
.tgc__m--me .tgc__rx { align-self: flex-end; }
.tgc__rx.is-their { cursor: default; background: rgba(201, 242, 74, .14); }
.tgc__rb { position: absolute; top: 50%; inset-inline-end: -34px; width: 28px; height: 28px; margin-top: -14px; padding: 4px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .07); color: var(--sc-ink-soft); cursor: pointer; opacity: 0; transition: opacity .15s; }
.tgc__rb svg { width: 100%; height: 100%; }
.tgc__m--ai:hover .tgc__rb, .tgc__rb:focus-visible { opacity: 1; }
@media (pointer: coarse) { .tgc__rb { display: none; } }
.tgc__pick { position: absolute; z-index: 5; bottom: calc(100% + 6px); inset-inline-start: 0; display: flex; flex-wrap: nowrap; gap: 2px; padding: 5px 6px; border-radius: 24px; background: #30363b; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); animation: tgcPop .14s ease-out; }
.tgc__pick.below { bottom: auto; top: calc(100% + 6px); }
.tgc__pick.right { inset-inline-start: auto; inset-inline-end: 0; }
.tgc__pick button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; font: 21px/1 system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif; cursor: pointer; transition: transform .12s; }
.tgc__pick button:hover, .tgc__pick button:focus-visible { transform: scale(1.22); }
.tgc__pick button.on { background: rgba(201, 242, 74, .2); }

/* быстрые ответы */
.tgc__quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.tgc__quick button { padding: 7px 12px; border: 1px solid rgba(201, 242, 74, .5); border-radius: 16px; background: rgba(201, 242, 74, .06); color: var(--sc-accent); font: 600 14px/1.25 var(--sc-font-text); cursor: pointer; text-align: start; }
.tgc__quick button:hover { background: rgba(201, 242, 74, .14); }

/* печатает */
.tgc__typing .tgc__b { padding: 11px 14px; }
.tgc__dots { display: inline-flex; gap: 4px; }
.tgc__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--sc-ink-soft); animation: tgcDot 1.2s infinite ease-in-out; }
.tgc__dots i:nth-child(2) { animation-delay: .15s; }
.tgc__dots i:nth-child(3) { animation-delay: .3s; }

/* голосовое */
.tgc__m--voice .tgc__b { min-width: 230px; }
.tgc__voice { display: flex; align-items: center; gap: 10px; }
.tgc__play { flex: none; width: 40px; height: 40px; padding: 9px; border: 0; border-radius: 50%; background: var(--sc-accent); color: var(--sc-accent-ink); cursor: pointer; }
.tgc__m--me .tgc__play { background: var(--tg-me-ink); color: var(--tg-me); }
.tgc__play svg { width: 100%; height: 100%; }
.tgc__vbox { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.tgc__wave { display: flex; align-items: center; gap: 2px; height: 24px; min-width: 0; overflow: hidden; }
.tgc__wave i { flex: 1 1 0; min-width: 2px; max-width: 3px; border-radius: 2px; background: rgba(242, 244, 239, .35); }
.tgc__wave i.on { background: var(--sc-accent); }
.tgc__m--me .tgc__wave i { background: rgba(244, 247, 236, .42); }
.tgc__m--me .tgc__wave i.on { background: var(--tg-me-ink); }
.tgc__dur { font: 600 11.5px/1 var(--sc-font-mono); opacity: .75; font-variant-numeric: tabular-nums; }
.tgc__trb { flex: none; padding: 4px 7px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .12); color: inherit; font: 700 12px/1 var(--sc-font-mono); cursor: pointer; }
.tgc__trb[aria-expanded="true"] { background: rgba(255, 255, 255, .24); }
.tgc__trx { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 14px; }
.tgc__trx i { opacity: .7; }

/* фото и файлы */
.tgc__m--image .tgc__b { padding: 3px; }
.tgc__m--image .tgc__meta { position: absolute; inset-inline-end: 9px; bottom: 8px; margin: 0; padding: 3px 6px; border-radius: 9px; background: rgba(0, 0, 0, .5); color: #fff; float: none; }
.tgc__img { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.tgc__img img { display: block; width: auto; height: auto; max-width: min(250px, 62vw); max-height: 300px; border-radius: 13px; object-fit: cover; }
.tgc__file { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 200px; }
.tgc__fic { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 10px; background: #e0775f; color: #fff; font: 800 11px/1 var(--sc-font-mono); }
.tgc__fic--docx, .tgc__fic--doc, .tgc__fic--odt, .tgc__fic--rtf, .tgc__fic--txt { background: #4f86e0; }
.tgc__fic--xlsx, .tgc__fic--xls, .tgc__fic--ods, .tgc__fic--csv { background: #3aa76d; }
.tgc__fn { display: flex; flex-direction: column; min-width: 0; }
.tgc__fn b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.tgc__fn small { opacity: .7; font-size: 12.5px; }
.tgc__lb { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: rgba(8, 10, 11, .9); cursor: zoom-out; }
.tgc__lb img { max-width: 94vw; max-height: 88vh; border-radius: 10px; }
.tgc__lb button { position: absolute; top: 14px; inset-inline-end: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }

/* вниз */
.tgc__down { position: absolute; inset-inline-end: 14px; bottom: 98px; z-index: 3; width: 42px; height: 42px; padding: 10px; border: 0; border-radius: 50%; background: #30363b; color: var(--sc-ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); cursor: pointer; }
.tgc__down svg { width: 100%; height: 100%; }
.tgc__down[data-n]:not([data-n="0"])::after { content: attr(data-n); position: absolute; top: -6px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--sc-accent); color: var(--sc-accent-ink); font: 700 12px/20px var(--sc-font-text); }
.tgc__hint { margin: 0 12px 6px; padding: 8px 12px; border-radius: 12px; background: #30363b; font-size: 13.5px; color: var(--sc-ink); }
.tgc__off { margin: auto; padding: 20px; text-align: center; color: var(--sc-ink-soft); }
.tgc__off a { color: var(--sc-accent); }

/* поле ввода */
.tgc__bar { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 10px; background: var(--tg-bar); border-top: 1px solid var(--line); }
.tgc__bar textarea {
  flex: 1; min-width: 0; height: 44px; min-height: 44px !important; max-height: 132px; margin: 0; padding: 11px 14px; resize: none; overflow-y: auto;
  border: 1px solid transparent; border-radius: 22px; background: #2a3035; color: var(--sc-ink); font: 400 15px/1.4 var(--sc-font-text);
}
.tgc__bar textarea::placeholder { color: #8a918a; }
.tgc__bar textarea:focus { outline: none; border-color: rgba(201, 242, 74, .45); }
.tgc__ib { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 50%; background: none; color: var(--sc-ink-soft); cursor: pointer; }
.tgc__ib svg { width: 100%; height: 100%; }
.tgc__ib:hover { color: var(--sc-ink); }
.tgc__ib:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.tgc__send, .tgc__mic, .tgc__rsend { background: var(--sc-accent); color: var(--sc-accent-ink); }
.tgc__send:hover, .tgc__mic:hover, .tgc__rsend:hover { color: var(--sc-accent-ink); filter: brightness(1.06); }
.tgc__mic { position: relative; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform .15s; }
.tgc__rsend { display: none; }
.tgc__rec { position: absolute; inset-block: 10px; inset-inline-start: 10px; inset-inline-end: 62px; display: flex; align-items: center; gap: 10px; padding-inline: 8px 14px; border-radius: 22px; background: #2a3035; overflow: hidden; }
.tgc__rec[hidden] { display: none; }
.tgc__rdot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #ff5a4f; animation: tgcBlink 1s ease-in-out infinite; }
.tgc__rt { flex: none; font: 600 15px/1 var(--sc-font-mono); font-variant-numeric: tabular-nums; }
.tgc__slide { flex: 1; text-align: end; color: var(--sc-ink-soft); font-size: 14px; white-space: nowrap; transition: opacity .1s; }
.tgc__del { display: none; width: 34px; height: 34px; padding: 7px; color: var(--warn); }
/* круг записи под пальцем (как в Telegram): ядро и ореол от громкости; висит над страницей, не обрезается окном чата */
.tgc-rc { position: fixed; z-index: 1500; width: 0; height: 0; pointer-events: none; }
.tgc-rc[hidden] { display: none; }
.tgc-rc__halo { position: absolute; left: -64px; top: -64px; width: 128px; height: 128px; border-radius: 50%; background: rgba(201, 242, 74, .24); transition: transform .07s linear; }
.tgc-rc.no-vu .tgc-rc__halo { animation: tgcBreath 1.3s ease-in-out infinite; }
.tgc-rc__core { position: absolute; left: -41px; top: -41px; display: grid; place-items: center; width: 82px; height: 82px; border-radius: 50%; background: #c9f24a; color: #151a05; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); animation: tgcPop .16s ease-out; }
.tgc-rc__core svg { width: 34px; height: 34px; }
@keyframes tgcBreath { 50% { transform: scale(1.22); } }
.tgc.is-locked .tgc__mic { display: none; }
.tgc.is-locked .tgc__rsend { display: grid; }
.tgc.is-locked .tgc__del { display: grid; }
.tgc.is-locked .tgc__slide { visibility: hidden; }
.tgc__lock { position: absolute; inset-inline-end: 14px; bottom: calc(158px + var(--up, 0px)); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 36px; padding: 8px 0 6px; border-radius: 18px; background: #30363b; color: var(--sc-ink-soft); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.tgc__lock[hidden] { display: none; }
.tgc__lock svg { width: 18px; height: 18px; }
.tgc__lock svg + svg { width: 14px; height: 14px; animation: tgcUp 1.2s ease-in-out infinite; }
.tgc__note { margin: 0; padding: 0 14px 10px; background: var(--tg-bar); font-size: 12px; line-height: 1.4; color: #8a918a; }
.tgc__note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@keyframes tgcBlink { 50% { opacity: .35; } }
@keyframes tgcDot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes tgcPop { from { transform: scale(.85); opacity: 0; } }
@keyframes tgcUp { 50% { transform: translateY(-3px); } }

@media (max-width: 860px) {
  .tgc { height: 76svh; min-height: 480px; max-height: 680px; border-radius: 18px; }
  .tgc__bar textarea { font-size: 16px; }   /* iOS не зумит поля от 16px */
  .tgc__m { max-width: 88%; }
  .tgc__down { bottom: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  .tgc__dots i, .tgc__rdot, .tgc__st.is-typing::before, .tgc__lock svg + svg, .tgc-rc.no-vu .tgc-rc__halo { animation: none; }
}
