.tg-browser { max-width: 520px; margin: 0 auto; }
.tg-url { flex: 1; min-width: 0; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tg-chat { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--tint); }
.tg-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel); border-radius: 12px; }
.tg-head b { display: block; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.tg-head small { font-size: 12px; color: var(--ink-faint); }
.tg-ava { flex: none; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #7fb1f5, var(--accent)); }

.tg-bubble { position: relative; width: min(100%, 340px); padding: 6px 6px 10px; background: var(--panel); border-radius: 14px; box-shadow: var(--sh-1); }
.tg-bubble p { margin: 8px 8px 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
.tg-time { position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: var(--ink-faint); }
.tg-media { position: relative; height: 170px; border-radius: 10px; overflow: hidden; }
.tg-media-photo { background: linear-gradient(180deg, #fbd6a5 0%, #f6b98a 38%, #8fb8e8 39%, #5b8fd6 100%); }
.tg-media-video { background: linear-gradient(160deg, #34507e 0%, #6b8fc4 55%, #c9d9f2 100%); }
.tg-play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(15,28,46,.45); }
.tg-play svg { width: 22px; height: 22px; fill: #fff; }
.tg-dur { position: absolute; left: 8px; top: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(15,28,46,.5); color: #fff; font-size: 11px; }

.tg-btn { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.52); color: #fff; }
.tg-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tg-btn.hot { background: var(--accent); box-shadow: 0 0 0 4px rgba(31,106,230,.28); }
.tg-btn.tg-inline { position: static; flex: none; width: 30px; height: 30px; background: var(--accent); }

.tg-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.tg-file b { display: block; font-size: 13px; font-weight: 600; }
.tg-file small { font-size: 12px; color: var(--ink-faint); }
.tg-file > div { flex: 1; min-width: 0; }
.tg-file-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--fail); color: #fff; font-size: 11px; font-weight: 700; }

.tg-panel { width: min(100%, 340px); margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-2); overflow: hidden; }
.tg-panel-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.tg-panel-head b { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.tg-mark { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tg-count { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.tg-pro { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--accent); border-radius: 5px; padding: 2px 6px; }
.tg-row { position: relative; display: grid; gap: 2px; padding: 10px 14px 13px; }
.tg-row + .tg-row { border-top: 1px solid var(--line); }
.tg-row b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-row small { font-size: 11px; color: var(--ink-soft); }
.tg-row.done small { color: var(--ok); }
.tg-track { position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.tg-track i { display: block; height: 100%; background: var(--accent); transform-origin: left; }

.tg-pick { display: grid; gap: 0; padding: 12px 14px 14px; }
.tg-pick-title { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.tg-pick-label { margin: 12px 0 6px; font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.tg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-chips span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 11.5px; color: var(--ink); }
.tg-chips span.on { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-deep); font-weight: 600; }
.tg-pick-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tg-pick-foot small { font-size: 11.5px; color: var(--ink-soft); }
.tg-go { padding: 8px 12px; border-radius: 7px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }

.tg-list { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 46ch; }
.tg-list li { position: relative; padding-left: 22px; color: var(--ink-soft); line-height: 1.55; }
.tg-list li::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tg-list .key { color: var(--ink); font-weight: 600; }
#pro .hero-cta { margin-top: 26px; }

@media (max-width: 620px) {
  .tg-media { height: 140px; }
  .tg-chat { padding: 12px; }
}

.tg-url .car { display: inline-block; width: 1px; height: 12px; margin-left: 1px; vertical-align: -2px; background: var(--accent); animation: gcar 1s steps(1) infinite; }
.tg-ext { margin-left: -2px; }
.tg-in { transition: opacity 360ms ease, transform 520ms cubic-bezier(0.16, 1, 0.3, 1); }
.playing .tg-in:not(.on) { opacity: 0; transform: translateY(10px); }

.tg-btn { overflow: hidden; transition: opacity 200ms ease, transform 320ms cubic-bezier(0.16, 1, 0.3, 1), width 320ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms ease, box-shadow 240ms ease; }
.tg-btn .i-check, .tg-btn .tg-pct { display: none; }
.tg-btn .tg-pct { font-size: 11px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.tg-btn.press { transform: scale(0.88); }
.tg-btn[data-s="busy"] { width: 52px; border-radius: 16px; background: var(--accent); box-shadow: none; }
.tg-btn[data-s="busy"] svg { display: none; }
.tg-btn[data-s="busy"] .tg-pct { display: block; }
.tg-btn[data-s="done"] { background: var(--ok); box-shadow: 0 0 0 4px rgba(18,153,106,.22); }
.tg-btn[data-s="done"] .i-down { display: none; }
.tg-btn[data-s="done"] .i-check { display: block; }
.playing .tg-media .tg-btn:not([data-s]) { opacity: 0; transform: scale(0.8); }
.playing .tg-media.hover .tg-btn:not([data-s]) { opacity: 1; transform: none; }
.tg-media::after { content: ""; position: absolute; inset: 0; background: rgba(15,28,46,.08); opacity: 0; transition: opacity 200ms ease; pointer-events: none; }
.tg-media.hover::after { opacity: 1; }
.tg-media .tg-btn { z-index: 1; }

.gframe > .tg-desk { align-self: stretch; }
.tg-desk { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; min-height: 340px; padding: 16px; border-radius: 14px; background: var(--tint); overflow: hidden; }
.tg-desk > .tg-panel { position: relative; width: min(100%, 340px); margin: 0; }
.tg-ghost { position: absolute; left: 16px; top: 16px; width: min(62%, 300px); display: grid; gap: 10px; opacity: 0.5; filter: saturate(0.7); pointer-events: none; }
.tg-ghost .tg-bubble { width: 100%; box-shadow: none; }
.tg-ghost .tg-media { height: 130px; }
.tg-slot { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 420ms cubic-bezier(0.16, 1, 0.3, 1), opacity 260ms ease; }
.tg-slot > div { min-height: 0; overflow: hidden; }
.tg-slot:not(.on) { grid-template-rows: 0fr; opacity: 0; }
.tg-slot + .tg-slot .tg-row { border-top: 1px solid var(--line); }
.tg-row small { transition: color 200ms ease; }
.tg-track i { transition: transform 160ms linear; }
.tg-row.done .tg-track { opacity: 0; transition: opacity 240ms ease; }
.tg-row:not(.done) .tg-track i:not([style]) { transform: scaleX(0); }
.tg-count { transition: color 200ms ease; }
.tg-count.tick { color: var(--accent-deep); }

.tg-chips span { transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 160ms ease; }
.tg-chips span.press, .tg-go.press { transform: scale(0.95); }
.tg-go { transition: background-color 200ms ease, box-shadow 300ms ease, transform 160ms ease; }
.tg-go.ready { box-shadow: 0 0 0 4px var(--accent-line); }
.tg-status { min-height: 1.4em; }
.tg-dots::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: tgdots 900ms steps(4) infinite; }
@keyframes tgdots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.gstage .gctl[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tg-in, .tg-btn, .tg-slot, .tg-track i, .tg-chips span, .tg-go, .tg-media::after { transition: none; }
  .tg-url .car, .tg-dots::after { animation: none; }
}
