/* AiSaleChat: the store's web chat, LINE-like, phone first. */
:root { --green: #1D9E75; --bg: #dde6ee; --ink: #1f2a37; --muted: #6b7684; --line: #e3e8ee; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; height: 100dvh; background: var(--bg); color: var(--ink);
       font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Myanmar", "Myanmar Text", sans-serif; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
       background: #fff; border-bottom: 1px solid var(--line); }
.logo { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; display: grid;
        place-items: center; font-weight: 700; flex: none; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); font-size: .75rem; }
.hbtn { position: relative; border: 0; background: #f1f4f7; border-radius: 10px; width: 40px; height: 40px;
        font-size: 1.15rem; cursor: pointer; }
.hbtn .n { position: absolute; top: -4px; right: -4px; min-width: 18px; padding: 0 4px; border-radius: 9px;
           background: #d93025; color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; }

#log { flex: 1; overflow-y: auto; padding: 12px 10px 4px; display: flex; flex-direction: column; gap: 8px;
       -webkit-overflow-scrolling: touch; }
.row { display: flex; flex-direction: column; max-width: 100%; }
.row.me { align-items: flex-end; }
.row.bot, .row.staff { align-items: flex-start; }
.who-label { font-size: .72rem; color: var(--muted); margin: 0 6px 2px; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 18px; white-space: pre-wrap; word-break: break-word;
          background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.row.me .bubble { background: var(--green); color: #fff; border-bottom-right-radius: 6px; }
.row.bot .bubble { border-bottom-left-radius: 6px; }
.row.staff .bubble { background: #fff8e1; border-bottom-left-radius: 6px; }
.row.me.pending .bubble { opacity: .6; }
.sys { align-self: center; font-size: .78rem; color: var(--muted); background: rgba(255,255,255,.6);
       padding: 3px 10px; border-radius: 10px; }

/* typing dots */
.typing .bubble { display: flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5b1; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* LINE Flex cards */
.carousel { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding: 2px 2px 6px; scroll-snap-type: x mandatory; }
.card { flex: none; width: min(260px, 78vw); background: #fff; border-radius: 14px; overflow: hidden;
        box-shadow: 0 1px 2px rgba(0,0,0,.08); scroll-snap-align: start; display: flex; flex-direction: column; }
.row > .card { width: min(320px, 88vw); }
.card img.hero { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eef1f4; display: block; cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .88); display: flex; align-items: center;
        justify-content: center; padding: 16px; cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.zoom-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%;
              background: rgba(255, 255, 255, .18); color: #fff; font-size: 1.2rem; cursor: pointer; }
.card .part { padding: 10px 12px; }
.card .part.header { padding-bottom: 0; }
.card .part.footer { padding-top: 0; }
.box { display: flex; flex-direction: column; min-width: 0; }
.box.h { flex-direction: row; align-items: baseline; }
.box.h > * { min-width: 0; }
.txt { white-space: pre-wrap; word-break: break-word; }
.txt.xs { font-size: .72rem; } .txt.sm { font-size: .85rem; } .txt.md { font-size: .95rem; }
.txt.lg { font-size: 1.1rem; } .txt.xl { font-size: 1.3rem; } .txt.b { font-weight: 700; } .txt.end { text-align: right; }
.card hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
.btn { border: 0; border-radius: 10px; padding: 9px 10px; font: inherit; font-weight: 600; cursor: pointer;
       background: #eef1f4; color: var(--ink); width: 100%; }
.btn.primary { background: var(--green); color: #fff; }
.box.h > .btn { flex: 1; }
.btn:disabled { opacity: .5; }

.banner { margin: 0 10px 6px; padding: 6px 10px; border-radius: 10px; background: #fff8e1; color: #6b4a00;
          font-size: .85rem; text-align: center; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 10px 6px; }
.chips:empty { display: none; }
.chip { flex: none; border: 1px solid var(--green); color: var(--green); background: #fff; border-radius: 999px;
        padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; }
.human { display: flex; justify-content: center; }
.human:empty { display: none; }

.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px;
            padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px;
                     font: inherit; max-height: 120px; outline: none; background: #f7f9fb; }
.composer textarea:focus { border-color: var(--green); background: #fff; }
.composer button { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--green);
                   color: #fff; font-size: 1.1rem; cursor: pointer; }
.composer button:disabled { background: #b8c2cc; }
.composer button.photo { background: #eef2f6; color: var(--ink); }
.composer button.photo:disabled { opacity: .5; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }

/* order progress during checkout */
.steps { display: flex; gap: 2px; margin: 0; padding: 6px 8px; list-style: none; background: #fff; border-bottom: 1px solid var(--line); }
.steps li { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .62rem;
            color: var(--muted); text-align: center; }
.steps li b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #e3e8ee; color: var(--muted); font-size: .72rem; }
.steps li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.steps li.done b { background: #b9e4d5; color: var(--green); }
.steps li.now b { background: var(--green); color: #fff; }
.steps li.now { color: var(--ink); font-weight: 600; }
.pic { display: block; max-width: 70%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.pic img { display: block; width: 100%; }
/* inside the website bubble (a frame): compact header; when the browser blocks the frame's cookie, one button */
body.embed .top { padding-top: 10px; }
.blocked { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px; text-align: center; color: #444; }
.openfull { display: inline-block; padding: 12px 20px; border-radius: 24px; background: #06c755; color: #fff;
  text-decoration: none; font-weight: 600; }
