/* 19:00 · 텔레그램(iOS) 대화 장면 — 모든 선택자는 .s-tg 아래.
   클래식 테마 느낌: 초록 보낸 말풍선, 흰 받은 말풍선, 무늬 배경. 곡선은 base.css·day.css 의 --glide·--spring 만. */
.s-tg {
  --tm-accent: #037ee5;
  --tm-out: #e1ffc7;
  --tm-out-meta: #4ea44a;
  --tm-in-meta: #98a1aa;
  --tm-grey: #858e99;
}

/* ── 배치: 휴대폰 + 기능 목록 ── */
.s-tg .tm-wrap { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 40px; align-items: center; }

/* ── 아이폰 ── */
.s-tg .tm-phone {
  position: relative; width: 264px; height: 548px; padding: 7px; border-radius: 46px; background: #141518;
  box-shadow: inset 0 0 0 1.5px #3b3d43, inset 0 0 0 2.5px #08090a, 0 30px 60px -20px rgba(0,0,0,.35), 0 3px 10px -2px rgba(0,0,0,.14);
}
.s-tg .tm-key { position: absolute; width: 3px; border-radius: 2px; background: #2b2d31; }
.s-tg .tm-key.k1 { left: -2.5px; top: 92px; height: 22px; }
.s-tg .tm-key.k2 { left: -2.5px; top: 128px; height: 38px; }
.s-tg .tm-key.k3 { left: -2.5px; top: 174px; height: 38px; }
.s-tg .tm-key.k4 { right: -2.5px; top: 146px; height: 60px; }
.s-tg .tm-screen {
  position: relative; height: 100%; border-radius: 39px; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; color: #000; line-height: 1.35; word-break: keep-all;
  background:
    radial-gradient(90% 55% at 8% 6%, #ddf0c6 0%, rgba(221,240,198,0) 70%),
    radial-gradient(95% 65% at 96% 92%, #a3d3dd 0%, rgba(163,211,221,0) 72%),
    linear-gradient(165deg, #cfe9c3 0%, #bfe2cf 46%, #acd7da 100%);
}
.s-tg .tm-wall { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; max-width: none; opacity: .15; pointer-events: none; }

/* 상태 줄 + 머리 띠(반투명) */
.s-tg .tm-top {
  position: absolute; z-index: 4; left: 0; right: 0; top: 0;
  background: rgba(247,247,247,.86); -webkit-backdrop-filter: blur(16px) saturate(1.8); backdrop-filter: blur(16px) saturate(1.8);
  box-shadow: 0 .5px 0 rgba(0,0,0,.18);
}
.s-tg .tm-sb { position: relative; height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 3px 18px 0 29px; }
.s-tg .tm-clock { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.s-tg .tm-island { position: absolute; left: 50%; top: 8px; width: 76px; height: 22px; margin-left: -38px; border-radius: 12px; background: #000; }
.s-tg .tm-sbi { display: flex; align-items: center; gap: 4px; }
.s-tg .tm-sbi svg { fill: #000; }

.s-tg .tm-nav { position: relative; height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px 0 7px; }
.s-tg .tm-back { display: flex; align-items: center; gap: 4px; font-size: 14px; line-height: 1; color: var(--tm-accent); }
.s-tg .tm-back svg { fill: none; stroke: var(--tm-accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.s-tg .tm-back em { display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--tm-accent); color: #fff; font-style: normal; font-size: 11px; font-weight: 600; }
.s-tg .tm-title { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; line-height: 1.2; white-space: nowrap; }
.s-tg .tm-title b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.s-tg .tm-sub { display: block; height: 14px; font-size: 11.5px; color: #8e959d; }
.s-tg .tm-sub .s-typing, .s-tg .tm-sub .s-file { display: none; color: var(--tm-accent); }
.s-tg .tm-nav[data-status="typing"] .s-idle, .s-tg .tm-nav[data-status="file"] .s-idle { display: none; }
.s-tg .tm-nav[data-status="typing"] .s-typing, .s-tg .tm-nav[data-status="file"] .s-file { display: inline; }
.s-tg .tm-sub i { display: inline-block; width: 3px; height: 3px; margin-left: 2px; border-radius: 50%; background: currentColor; vertical-align: 1px; animation: tm-dot 1.2s ease-in-out infinite; }
.s-tg .tm-sub i:first-child { margin-left: 3px; }
.s-tg .tm-sub i:nth-child(2) { animation-delay: .16s; }
.s-tg .tm-sub i:nth-child(3) { animation-delay: .32s; }
@keyframes tm-dot { 0%, 60%, 100% { transform: none; opacity: .35; } 30% { transform: translateY(-2px); opacity: 1; } }
.s-tg .tm-ava { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: #6a98f0; }
.s-tg .tm-ava img, .s-tg .tm-cav img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.34); }

/* ── 대화 ── */
.s-tg .tm-chat { position: relative; z-index: 1; flex: 1; min-height: 0; overflow: hidden; }
.s-tg .tm-feed { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 8px 8px; }

.s-tg .tm-date { display: flex; justify-content: center; margin: 10px 0 3px; }
.s-tg .tm-date span { padding: 1px 8px; border-radius: 10px; background: rgba(40,84,68,.4); color: #fff; font-size: 11.5px; font-weight: 600; line-height: 17px; }

.s-tg .tm-m { display: flex; margin-top: 7px; }
.s-tg .tm-m.cont { margin-top: 2px; }
.s-tg .tm-m.bot { padding-left: 6px; }
.s-tg .tm-m.me { justify-content: flex-end; padding-right: 6px; }
.s-tg .tm-m.new:not(.show) { display: none; }

.s-tg .tm-b {
  --bub: #fff; position: relative; max-width: 84%; padding: 5px 10px 5px 11px; border-radius: 16px; background: var(--bub);
  filter: drop-shadow(0 .6px .4px rgba(0,0,0,.15));
}
.s-tg .tm-m.me .tm-b { --bub: var(--tm-out); }
.s-tg .tm-m.bot.cont .tm-b { border-top-left-radius: 6px; }
.s-tg .tm-m.bot:not(.tail) .tm-b { border-bottom-left-radius: 6px; }
.s-tg .tm-m.me.cont .tm-b { border-top-right-radius: 6px; }
.s-tg .tm-m.me:not(.tail) .tm-b { border-bottom-right-radius: 6px; }
.s-tg .tm-m.bot.tail .tm-b { border-bottom-left-radius: 4px; }
.s-tg .tm-m.me.tail .tm-b { border-bottom-right-radius: 4px; }
/* 말풍선 꼬리: 묶음의 마지막 말풍선에만 */
.s-tg .tm-m.tail .tm-b::after {
  content: ""; position: absolute; z-index: -1; bottom: 0; left: -6px; width: 14px; height: 17px; background: var(--bub);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 17'%3E%3Cpath d='M6 0C6 8.6 4.4 13.6.6 16.6.2 16.9.4 17 1 17H14V0Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 17'%3E%3Cpath d='M6 0C6 8.6 4.4 13.6.6 16.6.2 16.9.4 17 1 17H14V0Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
.s-tg .tm-m.me.tail .tm-b::after { left: auto; right: -6px; transform: scaleX(-1); }

.s-tg .tm-b p { margin: 0; font-size: 13px; line-height: 18px; letter-spacing: -.005em; }
.s-tg .tm-sp { display: inline-block; width: 34px; height: 1px; }
.s-tg .tm-m.me .tm-sp { width: 50px; }
.s-tg .tm-meta { position: absolute; right: 9px; bottom: 5px; display: flex; align-items: center; gap: 2px; font-size: 11px; line-height: 13px; color: var(--tm-in-meta); font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-tg .tm-m.me .tm-meta { color: var(--tm-out-meta); right: 8px; }
.s-tg .tm-chk { width: 15px; height: 10px; fill: none; stroke: var(--tm-out-meta); stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.s-tg .tm-chk .c2 { opacity: 0; transition: opacity .2s; }
.s-tg .tm-m.read .tm-chk .c2 { opacity: 1; }
.s-tg .tm-cmd { color: #0a6fc6; }

/* 새 말풍선이 아래에서 올라올 때 살짝 커지며 나타남 */
.s-tg .tm-m.new.show .tm-b { animation: tm-pop .42s var(--glide) both; transform-origin: 0 100%; }
.s-tg .tm-m.me.new.show .tm-b { transform-origin: 100% 100%; }
@keyframes tm-pop { from { opacity: 0; transform: scale(.94); } }

/* 파일 말풍선 */
.s-tg .tm-doc { padding: 7px 10px 5px 8px; }
.s-tg .tm-dr { display: flex; align-items: center; gap: 9px; min-width: 0; }
.s-tg .tm-ic { flex: none; width: 40px; height: 40px; }
.s-tg .tm-ic svg { width: 40px; height: 40px; }
.s-tg .tm-ic .tm-fold { fill: rgba(255,255,255,.4); }
.s-tg .tm-ic .tm-gl { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.s-tg .tm-ic.xl .tm-pg { fill: #34a853; }
.s-tg .tm-ic.pp .tm-pg { fill: #ee7a30; }
.s-tg .tm-fn { display: grid; min-width: 0; line-height: 1.3; }
.s-tg .tm-fn b { font-size: 13px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-tg .tm-fn small { font-size: 11.5px; color: #8e959d; }
.s-tg .tm-doc p { margin-top: 5px; }
.s-tg .tm-file { width: 196px; padding: 7px 10px 7px 8px; }
.s-tg .tm-file .tm-meta { right: 9px; bottom: 7px; }

/* 음성 말풍선 */
.s-tg .tm-voice { display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; }
.s-tg .tm-play { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #5cb556; }
.s-tg .tm-play svg { width: 34px; height: 34px; fill: #fff; }
.s-tg .tm-vw { display: grid; gap: 3px; }
.s-tg .tm-bars { display: flex; align-items: flex-end; gap: 1.6px; height: 17px; }
.s-tg .tm-bars i { width: 2px; height: calc(var(--h) * 100%); min-height: 2px; border-radius: 1px; background: #7cc677; }
.s-tg .tm-vd { display: flex; align-items: center; gap: 4px; font-size: 11px; line-height: 13px; color: var(--tm-out-meta); font-variant-numeric: tabular-nums; }
.s-tg .tm-vd i { width: 4px; height: 4px; border-radius: 50%; background: var(--tm-out-meta); transition: opacity .3s; }
.s-tg .tm-m.read .tm-vd i { opacity: 0; }

/* 진행 막대 */
.s-tg .tm-prog { padding-bottom: 8px; }
.s-tg .tm-pb { display: block; height: 4px; margin: 7px 42px 1px 0; border-radius: 2px; background: rgba(3,126,229,.15); overflow: hidden; }
.s-tg .tm-pb i { display: block; height: 100%; border-radius: 2px; background: var(--tm-accent); transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--glide); }
.s-tg .tm-pb.go i { transform: scaleX(.6); }

/* 슬라이드 미리보기 묶음(앨범) */
.s-tg .tm-album { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; width: 196px; padding: 2px; }
.s-tg .tm-th { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 3px; background: #fff; outline: .5px solid rgba(0,0,0,.12); outline-offset: -.5px; }
.s-tg .tm-th:first-child { border-radius: 14px 3px 3px 14px; }
.s-tg .tm-th:nth-child(3) { border-radius: 3px 14px 14px 3px; }
.s-tg .tm-m.cont .tm-th:first-child { border-top-left-radius: 4px; }
.s-tg .tm-m:not(.tail) .tm-th:first-child { border-bottom-left-radius: 4px; }
.s-tg .tm-th svg { width: 100%; height: 100%; }
.s-tg .tm-album .tm-meta { right: 7px; bottom: 6px; padding: 1px 6px; border-radius: 8px; background: rgba(0,0,0,.42); color: #fff; }

/* 명령 제안 목록 ("/" 입력 시) */
.s-tg .tm-cmds {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.97); box-shadow: 0 -.5px 0 rgba(0,0,0,.16);
  transform: translateY(101%); transition: transform .32s var(--glide);
}
.s-tg .tm-cmds.show { transform: none; }
.s-tg .tm-cr { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; font-size: 13px; transition: background .15s; }
.s-tg .tm-cr + .tm-cr { box-shadow: inset 0 .5px 0 rgba(0,0,0,.1); }
.s-tg .tm-cr.hit { background: #e6e7eb; }
.s-tg .tm-cr b { font-weight: 600; }
.s-tg .tm-cr span:last-child { font-size: 12px; color: #8e959d; }
.s-tg .tm-cav { flex: none; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: #6a98f0; }

/* ── 입력 줄 ── */
.s-tg .tm-bar {
  position: relative; z-index: 3; flex: none; display: flex; align-items: flex-end; gap: 6px; padding: 7px 8px 24px;
  background: rgba(247,247,247,.94); box-shadow: 0 -.5px 0 rgba(0,0,0,.16);
}
.s-tg .tm-clip { flex: none; display: grid; place-items: center; width: 26px; height: 30px; transition: opacity .15s; }
.s-tg .tm-clip svg, .s-tg .tm-mic, .s-tg .tm-stk { fill: none; stroke: var(--tm-grey); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.s-tg .tm-clip svg { width: 22px; height: 22px; }
.s-tg .tm-field {
  position: relative; flex: 1; min-width: 0; min-height: 30px; padding: 6px 30px 6px 11px; border-radius: 16px; background: #fff;
  box-shadow: inset 0 0 0 .5px rgba(0,0,0,.22); font-size: 13px; line-height: 18px; transition: opacity .15s;
}
.s-tg .tm-ph { position: absolute; left: 11px; top: 6px; color: #a5abb2; pointer-events: none; }
.s-tg .tm-field .say:not(:empty) + .tm-ph { display: none; }
.s-tg .tm-field .caret { width: 1.5px; background: var(--tm-accent); }
.s-tg .tm-stk { position: absolute; right: 6px; bottom: 5px; width: 20px; height: 20px; stroke-width: 1.5; }
.s-tg .tm-act { position: relative; flex: none; width: 30px; height: 30px; transition: opacity .15s; }
.s-tg .tm-mic { position: absolute; left: 4px; top: 4px; width: 22px; height: 22px; transition: opacity .2s, transform .3s var(--spring); }
.s-tg .tm-send {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: var(--tm-accent);
  opacity: 0; transform: scale(.4); transition: opacity .18s, transform .34s var(--spring);
}
.s-tg .tm-send svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.s-tg .tm-bar:has(.say:not(:empty)) .tm-send { opacity: 1; transform: none; }
.s-tg .tm-bar:has(.say:not(:empty)) .tm-mic { opacity: 0; transform: scale(.5); }
.s-tg .tm-bar.press .tm-send { transform: scale(.84); }

/* 음성 녹음 중 */
.s-tg .tm-rec {
  position: absolute; left: 14px; right: 66px; top: 7px; height: 30px; display: flex; align-items: center; gap: 7px; font-size: 13px;
  opacity: 0; transform: translateX(14px); transition: opacity .2s, transform .35s var(--glide); pointer-events: none;
}
.s-tg .tm-rdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; animation: tm-blink 1s steps(1) infinite; }
@keyframes tm-blink { 50% { opacity: .25; } }
.s-tg .tm-rt { min-width: 50px; font-variant-numeric: tabular-nums; }
.s-tg .tm-slide { display: flex; align-items: center; gap: 4px; margin-left: 4px; font-size: 12px; color: #8e959d; white-space: nowrap; }
.s-tg .tm-slide svg { width: 7px; height: 11px; fill: none; stroke: #8e959d; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.s-tg .tm-recbtn {
  position: absolute; right: -3px; bottom: 12px; width: 54px; height: 54px; border-radius: 50%; background: var(--tm-accent);
  display: grid; place-items: center; opacity: 0; transform: scale(.3); transition: opacity .2s, transform .45s var(--spring); pointer-events: none;
}
.s-tg .tm-recbtn svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.s-tg .tm-bar.rec .tm-clip, .s-tg .tm-bar.rec .tm-field, .s-tg .tm-bar.rec .tm-act { opacity: 0; }
.s-tg .tm-bar.rec .tm-rec { opacity: 1; transform: none; }
.s-tg .tm-bar.rec .tm-recbtn { opacity: 1; transform: none; }
.s-tg .tm-home { position: absolute; left: 50%; bottom: 7px; width: 92px; height: 4px; margin-left: -46px; border-radius: 3px; background: #0b0b0b; }

/* ── 기능 목록 ── */
.s-tg .tm-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.s-tg .tm-feats li { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; transition: background .4s var(--glide), box-shadow .4s var(--glide); }
.s-tg .tm-fi { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--hair), 0 1px 2px rgba(17,17,16,.05); transition: background .35s, color .35s; }
.s-tg .tm-fi svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.s-tg .tm-ft { display: grid; gap: 1px; line-height: 1.45; }
.s-tg .tm-ft b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.s-tg .tm-ft span { font-size: 13px; color: var(--grey); }
.s-tg .tm-feats li.lit { background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 1px var(--hair); }
.s-tg .tm-feats li.lit .tm-fi { background: var(--cobalt); color: #fff; box-shadow: none; }

@media (max-width: 1180px) {
  .s-tg .tm-wrap { gap: 24px; }
  .s-tg .tm-feats li { gap: 12px; padding: 11px 12px; }
}

/* ── 휴대폰: 폰은 가운데, 기능은 작은 칩 ── */
@media (max-width: 860px) {
  .s-tg .tm-wrap { grid-template-columns: minmax(0, 1fr); gap: 18px; justify-items: center; }
  .s-tg .tm-phone { zoom: 1.1; }
  .s-tg .tm-feats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 360px; }
  .s-tg .tm-feats li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 5px; border-radius: 999px; background: rgba(255,255,255,.7); box-shadow: inset 0 0 0 1px var(--hair); }
  .s-tg .tm-fi { width: 26px; height: 26px; border-radius: 50%; box-shadow: none; background: var(--mist); }
  .s-tg .tm-fi svg { width: 15px; height: 15px; }
  .s-tg .tm-ft b { font-size: 13px; font-weight: 600; }
  .s-tg .tm-ft span { display: none; }
  .s-tg .tm-feats li.lit { background: #fff; }
}

/* 동작 줄이기: 마지막 화면 그대로, 깜박임·점 움직임 없음 */
@media (prefers-reduced-motion: reduce) {
  .s-tg .tm-sub i, .s-tg .tm-rdot { animation: none; }
  .s-tg .tm-m.new.show .tm-b { animation: none; }
}
