/* ===== aat-atm: پاپ‌آپ پیوست — سه‌بعدی (تیره/روشن) ===== */
.aat-atm-bd { position: fixed; inset: 0; z-index: 2147483000; background: rgba(6, 8, 18, .42); opacity: 0; animation: aatAtmBd .18s forwards; }
@keyframes aatAtmBd { to { opacity: 1; } }
.aat-atm {
  --at-s1: #262c45; --at-s2: #151929; --at-hi: rgba(255, 255, 255, .055); --at-lo: rgba(0, 0, 0, .55); --at-txt: #f2f3fb; --at-line: rgba(255, 255, 255, .08);
  position: fixed; z-index: 2147483001; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 10px; padding: 20px 14px 16px; border-radius: 26px;
  background: linear-gradient(150deg, var(--at-s1), var(--at-s2)); color: var(--at-txt); border: 1px solid var(--at-line);
  box-shadow: 18px 24px 52px -10px rgba(0, 0, 0, .7), -8px -8px 22px var(--at-hi), inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -3px 8px rgba(0, 0, 0, .28);
  opacity: 0; transform: translateY(24px) scale(.98); transition: opacity .16s ease, transform .2s cubic-bezier(.2, .8, .2, 1); font-family: inherit;
}
.aat-atm[data-theme="light"] {
  --at-s1: #f8f9fe; --at-s2: #dfe3f0; --at-hi: rgba(255, 255, 255, .95); --at-lo: rgba(112, 124, 168, .5); --at-txt: #151a33; --at-line: rgba(255, 255, 255, .85);
  box-shadow: 16px 22px 46px -12px rgba(62, 74, 120, .5), -8px -8px 20px rgba(255, 255, 255, .95), inset 0 1px 0 #fff, inset 0 -3px 8px rgba(112, 124, 168, .22);
}
.aat-atm.is-in { opacity: 1; transform: none; }
.aat-atm-grab { position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--at-lo); opacity: .6; }
.aat-atm.is-pop { right: auto; grid-template-columns: 1fr; gap: 9px; padding: 12px; border-radius: 22px; transform: translateY(8px) scale(.97); transform-origin: bottom left; }
.aat-atm.is-pop.is-in { transform: none; }
.aat-atm.is-pop .aat-atm-grab { display: none; }
.aat-atm .aat-atm-i {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border: 0; border-radius: 18px; color: inherit; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  background: linear-gradient(145deg, var(--at-s1), var(--at-s2));
  box-shadow: 5px 6px 12px var(--at-lo), -4px -4px 10px var(--at-hi), inset 0 1px 0 var(--at-hi);
  transition: transform .15s ease, box-shadow .15s ease; -webkit-tap-highlight-color: transparent;
}
.aat-atm .aat-atm-i:hover, .aat-atm .aat-atm-i:focus-visible { transform: translateY(-2px); box-shadow: 7px 10px 17px var(--at-lo), -5px -5px 12px var(--at-hi), inset 0 1px 0 var(--at-hi); outline: 0; }
.aat-atm .aat-atm-i:active { transform: translateY(1px); box-shadow: inset 4px 5px 10px var(--at-lo), inset -3px -3px 8px var(--at-hi); }
.aat-atm .aat-atm-i:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.aat-atm-ic {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: var(--c);
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 34%, var(--at-s1)), color-mix(in srgb, var(--c) 12%, var(--at-s2)));
  box-shadow: 3px 4px 9px var(--at-lo), -2px -2px 6px var(--at-hi), inset 0 1px 1px rgba(255, 255, 255, .3), inset 0 -2px 4px color-mix(in srgb, var(--c) 30%, transparent);
}
.aat-atm-ic svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.aat-atm-t { line-height: 1.3; }
.aat-atm.is-pop .aat-atm-i { flex-direction: row; gap: 13px; padding: 9px 12px; font-size: 14px; text-align: start; }
.aat-atm.is-pop .aat-atm-ic { width: 40px; height: 40px; border-radius: 13px; flex: 0 0 auto; }
.aat-atm.is-pop .aat-atm-ic svg { width: 21px; height: 21px; }
@media (prefers-reduced-motion: reduce) { .aat-atm, .aat-atm-bd, .aat-atm .aat-atm-i { transition: none; animation: none; opacity: 1; transform: none; } }

/* ===== دکمه‌ی کپیِ پیام‌ها (کاربر و ایجنت) ===== */
.aatmi-cp { all: unset; box-sizing: border-box; flex: 0 0 auto; align-self: flex-end; display: inline-grid; place-items: center; width: 28px; height: 28px; margin-bottom: 4px; border-radius: 10px; cursor: pointer; color: var(--tx, currentColor); opacity: .5; transition: opacity .15s, background .15s, transform .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.aatmi-m:hover .aatmi-cp, .aatmi-cp:focus-visible, .aatmi-cp.is-done { opacity: 1; }
.aatmi-cp:hover { background: rgba(255, 255, 255, .1); }
.aatmi-cp:active { transform: scale(.9); }
.aatmi-cp:focus-visible { outline: 2px solid #8b6dff; outline-offset: 1px; }
.aatmi-cp.is-done { color: #34d399; }
@media (hover: none) { .aatmi-cp { opacity: .75; } }

/* ===== پیوست در کادر پیام ===== */
.aatmi-in.aatmi-muse .aatmi-gb { gap: 6px; }
.aatmi-att { gap: 10px; justify-content: flex-start; }
.aatmi-att img { width: 40px; height: 40px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; }
.aatmi-att > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aatmi-att.is-err { color: #ff8b97; }
