/* Khung chat trên website (ADR-0044). Mọi lớp có tiền tố .asc- — không đụng CSS của theme. */
.asc, .asc * { box-sizing: border-box; }
.asc { --asc-accent: #8B5E34; --asc-ink: #1f2328; --asc-muted: #6b7280; --asc-line: #e6e3de; --asc-bg: #f6f5f2; position: fixed; right: 18px; bottom: 18px; z-index: 9990; font-family: inherit; font-size: 14px; line-height: 1.45; color: var(--asc-ink); }
.asc button, .asc input, .asc textarea { font: inherit; color: inherit; }
.asc-fab { position: relative; display: grid; place-items: center; width: 58px; height: 58px; border: 0; border-radius: 50%; background: var(--asc-accent); color: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, .22); cursor: pointer; transition: transform .2s; }
.asc-fab:hover { transform: translateY(-2px); }
.asc-fab svg { width: 28px; height: 28px; }
.asc-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.asc-badge[hidden] { display: none; }
.asc-teaser { position: absolute; right: 0; bottom: 72px; width: 260px; padding: 12px 34px 12px 14px; border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgba(0, 0, 0, .16); font-size: 13.5px; cursor: pointer; animation: asc-up .3s ease; }
.asc-teaser button { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--asc-bg); cursor: pointer; }
.asc-teaser[hidden] { display: none; }
.asc-panel { position: absolute; right: 0; bottom: 72px; display: flex; flex-direction: column; width: 370px; height: min(600px, calc(100vh - 110px)); overflow: hidden; border-radius: 18px; background: #fff; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); animation: asc-up .25s ease; }
.asc-panel[hidden] { display: none; }
@keyframes asc-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.asc-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px; background: var(--asc-accent); color: #fff; }
.asc-ava { flex: none; width: 46px; height: 46px; border: 2px solid rgba(255, 255, 255, .7); border-radius: 50%; background: #fff center / 78% auto no-repeat; }
.asc-who { flex: 1; min-width: 0; }
.asc-who b { display: block; font-size: 15.5px; letter-spacing: .01em; }
.asc-who small { display: block; opacity: .9; font-size: 12.5px; }
.asc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.asc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: 11.5px; }
.asc-dot { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; }
.asc-dot.on { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .3); }
.asc-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .2); color: #fff; font-size: 18px; cursor: pointer; }
.asc-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 10px 6px; border-bottom: 1px solid var(--asc-line); }
.asc-act { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 4px; border: 1px solid var(--asc-line); border-radius: 999px; background: #fff; color: var(--asc-ink); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; }
.asc-act.on { border-color: var(--asc-accent); background: var(--asc-accent); color: #fff; }
.asc-act svg { width: 14px; height: 14px; flex: none; }
.asc-note { margin: 0; padding: 4px 12px 0; color: var(--asc-muted); font-size: 11px; text-align: center; }
.asc-msgs { flex: 1; overflow-y: auto; padding: 12px; background: var(--asc-bg); display: flex; flex-direction: column; gap: 8px; }
.asc-m { max-width: 82%; padding: 9px 12px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.asc-m.agent, .asc-m.staff { align-self: flex-start; background: #fff; border: 1px solid var(--asc-line); border-bottom-left-radius: 5px; }
.asc-m.visitor { align-self: flex-end; background: var(--asc-accent); color: #fff; border-bottom-right-radius: 5px; }
.asc-m.system { align-self: center; max-width: 92%; padding: 6px 10px; background: transparent; color: var(--asc-muted); font-size: 12.5px; text-align: center; }
.asc-m.pending { opacity: .6; }
.asc-m small { display: block; margin-top: 2px; font-size: 10.5px; opacity: .65; }
.asc-m img { display: block; max-width: 220px; max-height: 240px; border-radius: 10px; }
.asc-card { align-self: stretch; padding: 12px; border: 1px solid var(--asc-line); border-radius: 14px; background: #fff; }
.asc-card p { margin: 0 0 8px; font-size: 13px; }
.asc-card form { display: grid; gap: 6px; }
.asc-card input { width: 100%; padding: 8px 10px; border: 1px solid var(--asc-line); border-radius: 10px; background: #fff; }
.asc-card button { padding: 8px 10px; border: 0; border-radius: 10px; background: var(--asc-accent); color: #fff; font-weight: 600; cursor: pointer; }
.asc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.asc-err { color: #c2412c; font-size: 12.5px; }
.asc-err:empty { display: none; }
.asc-form { display: flex; align-items: flex-end; gap: 6px; padding: 10px; border-top: 1px solid var(--asc-line); background: #fff; }
.asc-form textarea { flex: 1; max-height: 110px; min-height: 40px; padding: 9px 12px; border: 1px solid var(--asc-line); border-radius: 20px; background: var(--asc-bg); resize: none; outline: none; }
.asc-form textarea:focus { border-color: var(--asc-accent); }
.asc-ibtn { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--asc-muted); cursor: pointer; }
.asc-send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--asc-accent); color: #fff; cursor: pointer; }
.asc-ibtn svg, .asc-send svg { width: 20px; height: 20px; }
@media (max-width: 860px) {
  .asc { right: 12px; bottom: var(--asc-offset, 76px); }
  .asc-fab { width: 52px; height: 52px; }
  .asc-panel { position: fixed; inset: auto 0 0 0; width: 100%; height: 88vh; height: 88dvh; border-radius: 18px 18px 0 0; }
  .asc-teaser { bottom: 64px; }
  .asc.is-open .asc-fab { display: none; }
}
@media (prefers-reduced-motion: reduce) { .asc-panel, .asc-teaser { animation: none; } .asc-fab { transition: none; } }
