/* Ca sáng – trò chơi quản lý quán cà phê (TOEX English) */
:root {
  --kem: #FBF6EA; --the: #F6EDDB; --vien: #E2D8C0; --rung: #3A4A32; --olive: #5F6D45;
  --chu: #4A4A3E; --chu-phu: #625E51; --cam: #B25D2A; --cam-dam: #8F4519; --glacier: #86A3BB;
  --giay: #FFFCF4; --xanh-dam: #2F4A62; --do: #A8412A; --vang: #D9A63A;
  --font: "Be Vietnam Pro", system-ui, sans-serif; --serif: "Lora", Georgia, serif;
  --canh-h: clamp(220px, 33dvh, 320px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--kem); color: var(--chu); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
button { font-family: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible { outline: 3px solid var(--xanh-dam); outline-offset: 2px; }
[hidden] { display: none !important; }
kbd { font-family: var(--font); font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.14); margin-left: 6px; }
#app { height: 100dvh; position: relative; overflow: hidden; }
.man { height: 100dvh; width: 100%; }

/* ---------- nút ---------- */
.nut { min-height: 44px; padding: 10px 20px; border-radius: 8px; border: 2px solid var(--rung); background: var(--giay); color: var(--rung); font-weight: 700; font-size: 15px; transition: transform .12s, background .15s, box-shadow .15s; }
.nut:hover { background: #fff; }
.nut:active { transform: translateY(1px) scale(.98); }
.nut-chinh { background: var(--cam); border-color: var(--cam-dam); color: #fff; box-shadow: 0 3px 0 var(--cam-dam); }
.nut-chinh:hover { background: #BF6730; }
.nut-chinh:active { box-shadow: 0 1px 0 var(--cam-dam); transform: translateY(2px); }
.nut-chinh kbd, .nut-phu kbd { background: rgba(255,255,255,.25); }
.nut-lon { min-height: 54px; font-size: 18px; padding: 12px 32px; }
.nut-nho { min-height: 44px; padding: 6px 14px; font-size: 14px; }
.nut-phu { background: transparent; border-color: var(--vien); color: var(--rung); }
.nut-phu:hover { background: var(--the); }
.nut[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.nut-icon { width: 44px; height: 44px; border-radius: 8px; border: 1.5px solid rgba(251,246,234,.35); background: rgba(251,246,234,.08); color: var(--kem); display: grid; place-items: center; }
.nut-icon:hover { background: rgba(251,246,234,.2); }
.nut-icon .am-tat { display: none; } .nut-icon[aria-pressed="true"] .am-tat { display: block; } .nut-icon[aria-pressed="true"] .am-song { display: none; }

/* ---------- màn mở ---------- */
.man-mo { position: relative; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.mo-nen { position: absolute; inset: 0; background: linear-gradient(rgba(58,74,50,.35), rgba(58,74,50,.55)), url("assets/ca-sang/quan-ca-phe.webp") center / cover no-repeat; }
.mo-khung { position: relative; width: min(560px, 100%); background: var(--kem); border: 2px solid var(--vien); border-radius: 14px; padding: 26px 28px 22px; box-shadow: 0 18px 50px rgba(30,40,25,.35); animation: len .5s ease-out; margin: auto; }
.mo-nhan { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--olive); }
.mo-khung h1, .tong-khung h1 { font-family: var(--serif); font-size: clamp(40px, 8vw, 56px); line-height: 1.05; margin: 0 0 8px; color: var(--rung); }
.mo-gt { margin: 0 0 14px; font-size: 16px; }
.mo-buoc { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: b; display: grid; gap: 8px; }
.mo-buoc li { counter-increment: b; display: flex; gap: 10px; align-items: baseline; font-size: 15px; }
.mo-buoc li::before { content: counter(b); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--rung); color: var(--kem); font-weight: 700; font-size: 13px; display: grid; place-items: center; transform: translateY(2px); }
.mo-ngay { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip-ngay { min-width: 52px; min-height: 44px; padding: 6px 14px; border-radius: 8px; border: 2px solid var(--vien); background: var(--the); font-weight: 700; color: var(--rung); }
.chip-ngay[aria-pressed="true"] { background: var(--rung); border-color: var(--rung); color: var(--kem); }
.chip-ngay small { display: block; font-weight: 500; font-size: 12px; opacity: .9; }
.mo-nut { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mo-nut .nut-lon { flex: 1 1 200px; }
.mo-ky { margin: 14px 0 0; font-size: 13.5px; color: var(--chu-phu); }
.mo-phim { margin: 8px 0 0; font-size: 12.5px; color: var(--chu-phu); }

/* ---------- màn chơi ---------- */
.man-choi { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; background: var(--rung); color: var(--kem); padding: 4px 12px; padding-top: calc(4px + env(safe-area-inset-top)); min-height: 52px; }
.hud-trai { display: flex; gap: 10px; align-items: baseline; }
.hud-ngay { font-family: var(--serif); font-size: 19px; font-weight: 700; white-space: nowrap; }
.hud-khach { white-space: nowrap; }
.hud-khach { font-size: 14px; opacity: .9; }
.hud-giua { display: flex; align-items: center; gap: 12px; }
.hud-tien { font-family: var(--serif); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-chuoi { background: var(--cam); color: #fff; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; animation: nay .35s ease-out; }
.hud-phai { display: flex; gap: 8px; justify-content: flex-end; }
.than { display: grid; grid-template-rows: var(--canh-h) minmax(0, 1fr); min-height: 0; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

.canh { position: relative; overflow: hidden; background: #cbb89a url("assets/ca-sang/quan-ca-phe.webp") center 35% / cover no-repeat; display: flex; align-items: flex-end; justify-content: center; gap: 22px; padding: 14px 24px 16px; border-bottom: 3px solid var(--rung); }
.canh::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(251,246,234,0), rgba(58,74,50,.18)); pointer-events: none; }
.khach-hang { position: relative; z-index: 2; flex: none; width: 150px; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .5s; }
.khach-hang.ngoai { transform: translateX(-120%); opacity: 0; }
.khach-hang.ra-vui { transform: translateX(160%); opacity: 0; }
.khach-hang.ra-gian { transform: translateX(-160%) rotate(-3deg); opacity: 0; }
.chan-dung { width: 124px; height: 124px; border-radius: 50%; overflow: hidden; border: 4px solid var(--giay); box-shadow: 0 6px 16px rgba(30,40,25,.3); background: var(--glacier); }
.chan-dung svg { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; animation: tho 3.2s ease-in-out infinite; }
.khach-hang.sot .chan-dung { animation: rung .45s linear infinite; }
.ly { position: absolute; left: 0; top: 0; z-index: 3; width: 44px; height: 52px; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.3)); will-change: transform; }
.ly i { display: block; }
.ly-cup i { width: 38px; height: 46px; margin: 3px; background: linear-gradient(#FFFCF4 0 20%, var(--c) 20% 100%); clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); }
.ly-plate i { width: 46px; height: 22px; margin-top: 22px; border-radius: 50% 50% 6px 6px / 90% 90% 6px 6px; background: var(--c); border-bottom: 5px solid #FFFCF4; }
/* quầy giao: dải gỗ ở chân cảnh; ly trượt lên quầy */
.quay-giao { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; z-index: 2; background: linear-gradient(#A8784A, #7E5634); border-top: 3px solid #C79A6B; box-shadow: 0 -4px 10px rgba(40,25,10,.25); animation: quay-len .25s ease-out; transition: opacity .35s; }
.quay-giao.het { opacity: 0; }
.ly em { position: absolute; right: -10px; top: -4px; font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: var(--cam-dam); border-radius: 999px; padding: 0 6px; }
.ly-da i { background: linear-gradient(#FFFCF4 0 14%, rgba(255,255,255,.65) 14% 30%, var(--c) 30% 100%); }
/* hơi nóng: hai vệt mờ bốc lên rồi tan */
.hoi { position: absolute; left: 14px; top: -16px; width: 6px; height: 18px; border-radius: 6px; background: rgba(255,255,255,.85); filter: blur(2px); opacity: 0; animation: hoi 1.4s ease-out .45s infinite; }
.hoi.h2 { left: 24px; animation-delay: .8s; }
/* đồng xu tiền boa bay lên thanh tiền */
.xu { position: fixed; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FBE7A1, #D9A63A 60%, #A87A1C); border: 1.5px solid #8C6414; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.hud-tien.nay { animation: nay .35s ease-out; }
.chan-dung.vui { animation: nhun .5s ease-out; }
.chan-dung.lac { animation: lac .45s ease-out; }
.khach-ten { background: var(--giay); border: 2px solid var(--vien); border-radius: 999px; padding: 2px 14px; font-weight: 700; font-size: 14px; color: var(--rung); min-height: 28px; }
.kien-nhan { width: 138px; height: 12px; border-radius: 999px; background: rgba(255,252,244,.85); border: 2px solid var(--rung); overflow: hidden; }
.kien-nhan span { display: block; height: 100%; width: 100%; background: #6F9A4B; border-radius: 999px; transition: width .2s linear, background .3s; }
.kien-nhan.vua span { background: #D9A63A; } .kien-nhan.can span { background: var(--do); }
.kien-nhan.dung span { background: var(--glacier); }

.bong { position: relative; z-index: 2; flex: 1 1 auto; max-width: 660px; align-self: center; max-height: calc(var(--canh-h) - 24px); overflow-y: auto; background: var(--giay); border: 2px solid var(--vien); border-radius: 16px; padding: 14px 18px; box-shadow: 0 6px 18px rgba(30,40,25,.25); }
.bong::before { content: ""; position: absolute; left: -11px; bottom: 34px; width: 20px; height: 20px; background: var(--giay); border-left: 2px solid var(--vien); border-bottom: 2px solid var(--vien); transform: rotate(45deg); }
.bong-chu { margin: 0; font-size: clamp(17px, 1.7vw, 22px); line-height: 1.4; color: #34342B; min-height: 1.4em; font-weight: 500; }
.bong-chu mark { background: #F6D9B8; color: #6B300C; padding: 0 3px; border-radius: 3px; font-weight: 700; }
.bong-chu.an { color: var(--chu-phu); letter-spacing: .3em; }
.bong-chu .go::after { content: "|"; animation: nhap .7s steps(1) infinite; margin-left: 1px; opacity: .6; }
.bong-nut { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bong-sai { margin-top: 10px; background: #FBE6DC; border: 1.5px solid #E5B7A2; color: #7A2D10; border-radius: 8px; padding: 6px 10px; font-size: 13.5px; font-weight: 600; }
.canh-ghi { position: absolute; z-index: 2; top: 12px; right: 14px; max-width: 46%; background: #FFF4DD; border: 2px dashed #C9A15A; color: #5B3F10; border-radius: 6px; padding: 6px 10px; font-size: 13px; font-weight: 600; transform: rotate(1.2deg); box-shadow: 0 3px 8px rgba(0,0,0,.18); }
.canh-tien { position: absolute; inset: 0; z-index: 4; pointer-events: none; }

/* ---------- phần dưới ---------- */
.duoi { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); grid-template-rows: minmax(0, 1fr); gap: 12px; padding: 12px 16px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); min-height: 0; }
.goi-y { flex: none; display: flex; gap: 10px; align-items: center; background: var(--rung); color: var(--kem); padding: 8px 14px; font-size: 15px; font-weight: 600; animation: len .3s ease-out; }
.goi-y b { background: var(--cam); color: #fff; border-radius: 999px; font-size: 12px; padding: 2px 10px; flex: none; }
.ban { grid-column: 1; display: flex; flex-direction: column; min-height: 0; background: var(--the); border: 2px solid var(--vien); border-radius: 10px; overflow: hidden; }
.ban-tab { display: flex; gap: 6px; padding: 8px 8px 0; border-bottom: 2px solid var(--vien); }
.tab { min-height: 44px; padding: 8px 18px; border: 2px solid transparent; border-bottom: 0; background: transparent; border-radius: 8px 8px 0 0; font-weight: 700; font-size: 15px; color: var(--chu-phu); }
.tab[aria-selected="true"] { background: var(--kem); border-color: var(--vien); color: var(--rung); margin-bottom: -2px; padding-bottom: 10px; }
.ban-luoi { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; background: var(--kem); -webkit-overflow-scrolling: touch; }
.mon { position: relative; min-height: 64px; text-align: left; padding: 8px 12px; border-radius: 8px; border: 2px solid var(--vien); background: var(--giay); display: grid; grid-template-columns: 1fr auto; align-content: center; column-gap: 6px; transition: transform .12s, border-color .15s, box-shadow .15s; }
.mon:hover { border-color: var(--olive); transform: translateY(-1px); box-shadow: 0 3px 8px rgba(58,74,50,.15); }
.mon:active { transform: scale(.97); }
.mon b { font-size: 15px; color: var(--rung); line-height: 1.2; }
.mon small { grid-column: 1 / -1; font-size: 12px; color: var(--chu-phu); line-height: 1.25; }
.mon .gia { grid-column: 2; grid-row: 1; margin-top: 1px; font-size: 12px; font-weight: 700; color: var(--cam-dam); font-variant-numeric: tabular-nums; }
.mon .so { position: absolute; bottom: 5px; right: 7px; font-size: 11px; font-weight: 700; color: var(--chu-phu); background: var(--the); border-radius: 4px; padding: 0 5px; }
.mon .dem { position: absolute; top: -7px; left: -7px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--cam); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; animation: nay .3s ease-out; }
.mon.nhay, .nhay { outline: 3px solid var(--cam); outline-offset: 2px; animation: xung 1.1s ease-in-out infinite; }

.phieu { grid-column: 2; display: flex; flex-direction: column; min-height: 0; background: var(--giay); border: 2px solid var(--vien); border-radius: 10px; box-shadow: 0 2px 0 var(--vien); }
.phieu-dau { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px 6px; border-bottom: 2px dashed var(--vien); }
.phieu-dau h2 { margin: 0; font-family: var(--serif); font-size: 19px; color: var(--rung); }
.phieu-tong { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--rung); font-variant-numeric: tabular-nums; }
.phieu-dong { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch; }
.phieu-trong { margin: auto; text-align: center; color: var(--chu-phu); font-size: 14.5px; padding: 10px; }
.dong { border: 2px solid var(--vien); border-radius: 8px; background: var(--kem); transition: border-color .2s, background .2s; }
.dong.loi { border-color: var(--do); background: #FDF0EA; animation: lac .4s ease-out; }
.dong-dau { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; min-height: 44px; }
.dong-ten { flex: 1; min-width: 0; text-align: left; background: none; border: 0; font-weight: 700; font-size: 14.5px; color: var(--rung); padding: 6px 0; min-height: 44px; line-height: 1.25; }
.dong-ten small { display: block; font-weight: 500; font-size: 12px; color: var(--chu-phu); }
.dong-gia { font-size: 13px; font-weight: 700; color: var(--cam-dam); font-variant-numeric: tabular-nums; }
.dong-xoa { width: 44px; height: 44px; background: none; border: 0; color: var(--chu-phu); font-size: 22px; line-height: 1; }
.dong-xoa:hover { color: var(--do); }
.dong-sua { display: none; padding: 2px 10px 10px; gap: 8px; flex-direction: column; }
.dong.mo .dong-sua { display: flex; }
.hang { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hang > span { flex: none; width: 54px; font-size: 12px; font-weight: 700; color: var(--chu-phu); text-transform: uppercase; letter-spacing: .04em; }
.seg { display: flex; gap: 4px; flex: 1; }
.hai { flex-wrap: wrap; }
.hai .seg-co { flex: 3 1 170px; } .hai .seg-nhiet { flex: 2 1 110px; }
/* nút chọn: chưa chọn = nền giấy chữ đậm; đã chọn = nền rừng chữ trắng kèm dấu tích. Không chuyển màu nền dần để chữ không bị "mất" giữa chừng */
.seg button { flex: 1; min-height: 44px; border: 2px solid #CFC3A6; background: var(--giay); border-radius: 8px; font-weight: 700; font-size: 14px; color: #2E3A27; padding: 4px 6px; transition: transform .1s; }
.seg button[aria-pressed="true"] { background: var(--rung); border-color: #26321F; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.18); }
.seg-noi button[aria-pressed="true"] span::before { content: "✓ "; }
.seg-noi.sai { outline: 3px solid var(--do); outline-offset: 2px; border-radius: 10px; }
.seg button[disabled] { opacity: .4; cursor: default; }
.seg button:active { transform: scale(.96); }
.seg-noi button { display: flex; flex-direction: column; line-height: 1.15; align-items: center; justify-content: center; }
.seg-noi small { font-weight: 600; font-size: 12px; color: #4E4A3E; }
.seg-noi button[aria-pressed="true"] small { color: #E9EFDF; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.seg-sua button { font-size: 13px; padding: 4px 2px; }
.chip { min-height: 44px; border: 2px solid var(--vien); background: var(--giay); border-radius: 8px; padding: 2px 10px; text-align: left; font-weight: 700; font-size: 13px; color: var(--rung); line-height: 1.2; }
.chip small { display: block; font-weight: 500; font-size: 12px; color: var(--chu-phu); }
.chip { border-color: #CFC3A6; color: #2E3A27; }
.chip small { color: #57534A; }
.chip[aria-pressed="true"] { background: var(--rung); border-color: #26321F; color: #fff; }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.chip[aria-pressed="true"] small { color: #E9EFDF; }
.buoc { flex: none; display: flex; align-items: center; gap: 2px; }
.buoc button { width: 44px; height: 44px; border-radius: 8px; border: 2px solid #CFC3A6; background: var(--giay); font-size: 22px; font-weight: 700; color: var(--rung); line-height: 1; }
.buoc output { min-width: 26px; text-align: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.phieu-chan { display: grid; grid-template-columns: 1fr 1.05fr; gap: 8px; padding: 8px 10px 10px; border-top: 2px dashed var(--vien); }
.phieu-chan .seg-noi { grid-column: 1; }
.nut-giao { grid-column: 2; min-height: 52px; font-size: 16px; }

/* ---------- bước thu tiền / hỏi đáp ---------- */
.thu { position: absolute; inset: 0; z-index: 6; background: var(--kem); display: grid; place-items: center; padding: 14px; overflow-y: auto; }
.thu-trong { animation: len-thu .3s ease-out; }
@keyframes len-thu { from { transform: translateY(10px) scale(.985); } to { transform: none; } }
.thu-trong { width: min(640px, 100%); text-align: center; }
.thu-nhan { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--olive); }
.thu h2 { font-family: var(--serif); font-size: clamp(20px, 3vw, 26px); margin: 0 0 6px; color: var(--rung); }
.thu-hd { margin: 0 0 12px; font-size: 15px; color: var(--chu-phu); }
.thu-hd b { font-family: var(--serif); font-size: 24px; color: var(--rung); }
.thu-chon { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.thu-chon.mot { grid-template-columns: 1fr; }
.chon { min-height: 58px; padding: 10px 14px; text-align: left; border: 2px solid var(--vien); border-radius: 10px; background: var(--giay); font-size: 16px; font-weight: 600; color: #34342B; display: flex; gap: 10px; align-items: center; transition: transform .12s, border-color .15s, background .15s; }
.chon:hover { border-color: var(--olive); transform: translateY(-1px); }
.chon i { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--the); border: 1.5px solid var(--vien); display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 700; color: var(--chu-phu); }
.chon.dung { background: #E3EDD3; border-color: var(--olive); }
.chon.sai { background: #FBE6DC; border-color: var(--do); animation: lac .4s ease-out; }
.chon[disabled] { cursor: default; transform: none; }
.thu-ghi { margin: 12px 0 0; min-height: 22px; font-size: 14px; font-weight: 600; color: var(--chu); }

/* ---------- bay ---------- */
.pop { position: absolute; font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--cam-dam); background: var(--giay); border: 2px solid var(--vien); border-radius: 999px; padding: 1px 14px; box-shadow: 0 3px 8px rgba(0,0,0,.22); animation: bay 1.5s ease-out forwards; white-space: nowrap; }
.pop.tot { color: #2F6A22; border-color: #A9C79A; } .pop.xau { color: var(--do); border-color: #E5B7A2; }
.bay { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.manh { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: roi 1.4s ease-in forwards; }

/* ---------- tổng kết ---------- */
.man-tong { overflow-y: auto; background: var(--kem); display: grid; place-items: start center; padding: 18px 14px 28px; }
.tong-khung { width: min(760px, 100%); background: var(--giay); border: 2px solid var(--vien); border-radius: 14px; padding: 24px 26px; animation: len .5s ease-out; }
.sao { display: flex; gap: 8px; margin: 6px 0 4px; }
.sao svg { width: 54px; height: 54px; transform: scale(.4); opacity: 0; }
.sao svg.hien { animation: sao .6s cubic-bezier(.2,1.6,.4,1) forwards; }
.sao svg path { fill: #E7DFC8; stroke: #CFC4A4; stroke-width: 1.5; stroke-linejoin: round; }
.sao svg.day path { fill: var(--vang); stroke: #B58420; }
.tong-loi { margin: 0 0 12px; font-size: 16px; font-weight: 500; }
.so-lieu { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 0 0 18px; }
.so-lieu div { background: var(--the); border: 1.5px solid var(--vien); border-radius: 10px; padding: 8px 12px; }
.so-lieu dt { font-size: 12px; font-weight: 600; color: var(--chu-phu); }
.so-lieu dd { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--rung); font-variant-numeric: tabular-nums; }
.tieu-de-nho { font-family: var(--serif); font-size: 20px; color: var(--rung); margin: 4px 0 8px; }
.cum { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.cum li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 14px; background: var(--the); border: 1.5px solid var(--vien); border-radius: 10px; }
.cum li.sai { border-color: #D9A58E; background: #FBEFE8; }
.cum em { display: inline-block; margin-left: 4px; font-style: normal; font-size: 12px; font-weight: 700; color: #7A2D10; background: #F6D9C8; border-radius: 999px; padding: 0 8px; }
.cum b { font-size: 16.5px; color: var(--rung); }
.cum span { grid-column: 1; font-size: 14px; color: var(--chu); }
.cum button { grid-column: 2; grid-row: 1 / span 2; min-height: 44px; padding: 6px 12px; border-radius: 8px; border: 2px solid var(--vien); background: var(--giay); font-weight: 700; font-size: 13px; color: var(--rung); }
.tong-nut { display: flex; flex-wrap: wrap; gap: 10px; }
.tong-nut .nut-lon { flex: 1 1 100%; }

/* ---------- hộp thoại ---------- */
.hop { position: fixed; inset: 0; z-index: 40; background: rgba(40,50,34,.55); display: grid; place-items: center; padding: 14px; overflow-y: auto; }
.hop-khung { width: min(640px, 100%); max-height: 100%; overflow-y: auto; background: var(--kem); border: 2px solid var(--vien); border-radius: 14px; padding: 20px 22px; animation: len .25s ease-out; margin: auto; }
.hop-khung h2 { font-family: var(--serif); font-size: 24px; color: var(--rung); margin: 0 0 8px; }
.hop-nut { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.hop-nut .nut { flex: 1 1 140px; }
.sp { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 12px; margin-bottom: 8px; background: var(--the); border: 1.5px solid var(--vien); border-radius: 10px; }
.sp b { color: var(--rung); } .sp span { grid-column: 1; font-size: 13.5px; color: var(--chu-phu); }
.sp .nut { grid-column: 2; grid-row: 1 / span 2; min-height: 44px; padding: 6px 14px; font-size: 14px; }
.sp.co { background: #E7EEDA; }
.vi-tien { font-family: var(--serif); font-size: 20px; margin: 0 0 10px; color: var(--rung); }

/* ---------- chuyển động ---------- */
@keyframes tho { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes rung { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes len { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes nay { 0% { transform: scale(.5); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes nhun { 0% { transform: translateY(0); } 35% { transform: translateY(-14px) scale(1.05); } 70% { transform: translateY(0) scale(.97); } 100% { transform: none; } }
@keyframes lac { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes xung { 0%, 100% { box-shadow: 0 0 0 0 rgba(178,93,42,.5); } 50% { box-shadow: 0 0 0 7px rgba(178,93,42,0); } }
@keyframes nhap { 50% { opacity: 0; } }
@keyframes bay { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 15% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-54px) scale(1); } }
@keyframes sao { to { transform: scale(1); opacity: 1; } }
@keyframes quay-len { from { transform: translateY(100%); } to { transform: none; } }
@keyframes hoi { 0% { opacity: 0; transform: translateY(6px) scaleY(.6); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-16px) translateX(3px) scaleY(1.2); } }
@keyframes roi { 0% { transform: translateY(-20px) rotate(0); opacity: 1; } 100% { transform: translateY(100vh) rotate(540deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- màn hẹp / thấp ---------- */
@media (max-width: 860px) {
  :root { --canh-h: clamp(170px, 24dvh, 220px); }
  .duoi { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 6px 8px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .ban { grid-column: 1; grid-row: 1; }
  .phieu { grid-column: 1; grid-row: 2; }
  .canh { gap: 12px; padding: 10px 12px 12px; align-items: flex-end; }
  .khach-hang { width: 100px; }
  .chan-dung { width: 80px; height: 80px; border-width: 3px; }
  .kien-nhan { width: 96px; height: 10px; }
  .khach-ten { font-size: 13px; padding: 1px 10px; }
  .bong { padding: 10px 12px; max-width: none; }
  .bong::before { bottom: 22px; }
  .bong-chu { font-size: 15.5px; }
  .bong-sai { font-size: 12.5px; padding: 4px 8px; margin-top: 6px; }
  .bong-nut { margin-top: 6px; }
  .canh-ghi { top: 6px; right: 8px; max-width: 62%; font-size: 12px; padding: 4px 8px; }
  .bong .canh-ghi { position: static; transform: none; max-width: none; margin: 0 0 6px; box-shadow: none; font-size: 12px; padding: 3px 8px; }
  .hud-tien { font-size: 21px; }
  .hud { grid-template-columns: auto 1fr auto; gap: 6px; padding-left: 10px; padding-right: 10px; }
  .hud-trai { flex-direction: column; gap: 0; line-height: 1.15; }
  .hud-ngay { font-size: 16px; } .hud-khach { font-size: 12.5px; }
  .hud-giua { justify-content: center; }
  .tong-khung h1 { font-size: 32px; }
  /* thực đơn: 3 hàng cố định, cuộn ngang trong khung – không bao giờ lộ nửa hàng trên/dưới; cột kế bên ló ra để báo còn món */
  .duoi { grid-template-rows: auto minmax(0, 1fr); }
  .ban-tab { padding: 6px 6px 0; }
  .tab { min-height: 44px; padding: 6px 16px; font-size: 14.5px; }
  .ban-luoi { flex: none; display: grid; grid-auto-flow: column; grid-template-rows: repeat(3, 54px); grid-template-columns: none; grid-auto-columns: calc((100% - 12px) / 2.3); gap: 6px; padding: 8px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .duoi.nhieu .ban-luoi { grid-template-rows: repeat(2, 54px); grid-auto-columns: calc((100% - 12px) / 2.3); }
  .ban-luoi.it, .duoi.nhieu .ban-luoi.it { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: 54px; overflow-x: hidden; overflow-y: auto; max-height: 190px; }
  .mon { min-height: 0; height: 54px; padding: 5px 8px; scroll-snap-align: start; grid-template-columns: minmax(0, 1fr) auto; align-content: center; }
  .mon b { font-size: 13.5px; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .mon small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mon .gia { font-size: 12px; }
  .mon .dem { top: -6px; left: -6px; min-width: 20px; height: 20px; font-size: 12px; }
  .mon .so { display: none; }
  .phieu { max-height: none; min-height: 0; }
  .phieu-dau { padding: 5px 12px 3px; }
  .phieu-dau h2 { font-size: 16px; }
  .phieu-tong { font-size: 18px; }
  .phieu-dong { padding: 6px 8px; gap: 6px; }
  .dong-dau { padding: 0 2px 0 8px; gap: 4px; }
  .dong-ten { font-size: 14px; }
  .dong-gia { font-size: 12.5px; }
  .dong-xoa { width: 44px; flex: none; }
  .dong-sua { padding: 0 8px 8px; gap: 6px; }
  .hai .seg-co { flex: 3 1 150px; } .hai .seg-nhiet { flex: 2 1 96px; }
  .seg button { font-size: 13.5px; padding: 3px 4px; }
  /* điện thoại: thẻ tuỳ chọn chỉ ghi tiếng Anh (nghĩa Việt hiện ở dòng tóm tắt dưới tên món) để vừa một hàng */
  .chips { gap: 5px; }
  .chip { flex: 0 1 auto; min-width: 84px; padding: 2px 8px; font-size: 12.5px; text-align: center; }
  .chip small { display: none; }
  .phieu-chan { padding: 6px 8px 8px; gap: 6px; grid-template-columns: 1.15fr 1fr; }
  .nut-giao { min-height: 48px; }
  .thu-chon { grid-template-columns: 1fr; }
  .tong-khung { padding: 18px 16px; }
  .goi-y { padding: 6px 10px; font-size: 13.5px; }
  .mo-khung { padding: 20px 18px 16px; }
  kbd { display: none; }
}
@media (min-width: 861px) {
  
}
@media (max-height: 560px) and (min-width: 600px) {
  :root { --canh-h: 170px; }
  .chan-dung { width: 84px; height: 84px; }
  .khach-hang { width: 110px; }
}

/* ---------- bản sửa 20261118cs3 (giữ nguyên) ---------- */
.bong-ghi { margin: 6px 0 0; font-size: 12.5px; font-weight: 600; color: var(--chu-phu); }
.tong-luat { margin: -4px 0 14px; font-size: 13px; color: var(--chu-phu); line-height: 1.45; }

/* ---------- lượt làm đẹp 20261118cs4: phản hồi, pha chế, tổng kết, khách ---------- */
.the-part { margin: 0 0 12px; padding: 7px 12px; font-size: 13.5px; line-height: 1.4; color: var(--rung); background: #E9EFDB; border: 1.5px solid #C5D2A6; border-radius: 8px; }
.the-part b { font-weight: 700; margin-right: 4px; }
.tong-khung .the-part { margin: 0 0 14px; }
.mo-buoc li { animation: len .45s ease-out both; }
.mo-buoc li:nth-child(1) { animation-delay: .12s; } .mo-buoc li:nth-child(2) { animation-delay: .22s; } .mo-buoc li:nth-child(3) { animation-delay: .32s; }

/* khách vào / ra: ra nhanh dần, không kéo dài hơn 0,7 giây */
.khach-hang { transition: transform .7s cubic-bezier(.16,.84,.3,1), opacity .5s; }
.khach-hang.ra-vui, .khach-hang.ra-gian { transition: transform .62s cubic-bezier(.5,0,.85,.45), opacity .4s .12s; }
.khach-hang:not(.ngoai) .khach-ten, .khach-hang:not(.ngoai) .kien-nhan { animation: len .4s .25s ease-out both; }
.chan-dung svg { transition: none; }
/* thanh kiên nhẫn: màu đổi liên tục (JS đặt màu), căng nhẹ khi sắp cạn */
.kien-nhan span { transition: width .2s linear, background-color .25s linear; }
.kien-nhan.can { animation: kn-nhay .8s ease-in-out infinite; }
@keyframes kn-nhay { 50% { transform: scaleY(1.25); } }

/* phiếu: dòng mới trượt vào, ly đầy dần, đĩa hiện ra */
.dong .pc { flex: none; width: 31px; height: 33px; margin-right: 2px; overflow: visible; }
.dong.moi { animation: dong-vao .45s ease-out var(--ago, 0s) both; }
.dong.moi .pc-do { transform-box: fill-box; transform-origin: 50% 100%; animation: pc-day .5s cubic-bezier(.2,.8,.3,1) var(--ago, 0s) both; }
.dong .pc-hoi { opacity: 0; }
.dong.moi .pc-hoi { animation: pc-hoi .9s ease-out var(--ago, 0s) both; }
@keyframes dong-vao { 0% { opacity: .2; background: #F3E3B8; } 100% { opacity: 1; background: var(--kem); } }
@keyframes pc-day { 0% { transform: scaleY(0); } 70% { transform: scaleY(1.06); } 100% { transform: scaleY(1); } }
@keyframes pc-hoi { 0% { opacity: 0; transform: translateY(2px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-3px); } }
.dong.moi .pc:not(:has(rect)) .pc-do { animation: pc-nay .45s cubic-bezier(.2,1.5,.4,1) var(--ago, 0s) both; }
@keyframes pc-nay { 0% { transform: scale(.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* giao đúng: dấu "đã giao" đóng lên phiếu, hơi nóng bốc sớm hơn, chuỗi hiện to */
.phieu { position: relative; }
.phieu.xong::after { content: "Đã giao"; position: absolute; left: 50%; top: 42%; z-index: 3; pointer-events: none; padding: 4px 16px; font-family: var(--serif); font-weight: 700; font-size: 24px; color: #2F6A22; background: rgba(255,252,244,.92); border: 3px solid #4C8A3A; border-radius: 8px; transform: translate(-50%, -50%) rotate(-7deg); animation: dau-giao 1.3s ease-out both; }
@keyframes dau-giao { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(1.7); } 18% { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(.94); } 28% { transform: translate(-50%, -50%) rotate(-7deg) scale(1); } 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(1); } }
.hoi { animation-delay: .22s; } .hoi.h2 { animation-delay: .5s; }
.chuoi-to { position: absolute; right: 14px; top: 8px; z-index: 5; padding: 2px 16px 4px; border-radius: 999px; background: var(--cam); color: #fff; border: 3px solid var(--cam-dam); font-family: var(--serif); font-weight: 700; font-size: 20px; box-shadow: 0 4px 12px rgba(0,0,0,.28); transform-origin: 100% 0; animation: chuoi-to 1.1s cubic-bezier(.2,1.4,.4,1) both; }
.chuoi-to b { font-size: 34px; line-height: 1; vertical-align: -3px; }
@keyframes chuoi-to { 0% { opacity: 0; transform: scale(.3) rotate(-10deg); } 22% { opacity: 1; transform: scale(1.2) rotate(3deg); } 36% { transform: scale(1) rotate(0); } 78% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px) scale(1); } }
.hud-chuoi.nay-to { animation: nay-to .5s ease-out; }
@keyframes nay-to { 0% { transform: scale(.7); } 45% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* giao sai: phiếu rung, dòng sai nháy đỏ, cảnh nháy đỏ viền, dòng báo lỗi bật ra */
.phieu.rung-phieu { animation: lac .42s ease-out; }
.dong.loi { animation: lac .4s ease-out, nhay-do .6s ease-out; }
@keyframes nhay-do { 0%, 50% { background: #F6B7A3; border-color: #C23B20; } 25%, 75% { background: #FDF0EA; } 100% { background: #FDF0EA; border-color: var(--do); } }
.canh.sai-nhay::before { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; box-shadow: inset 0 0 0 4px rgba(194,59,32,.55), inset 0 0 40px rgba(194,59,32,.35); animation: vien-do .5s ease-out forwards; }
@keyframes vien-do { from { opacity: 1; } to { opacity: 0; } }
.bong-sai.moi { animation: len .3s ease-out; }

/* tổng kết: màn hiện mượt, mọi khối vào lần lượt, sao bật lần lượt, cụm từ hiện từng dòng */
.man-tong:not([hidden]) { animation: man-vao .4s ease-out; }
@keyframes man-vao { from { opacity: 0; } to { opacity: 1; } }
.tong-khung > * { animation: len .45s ease-out both; }
.tong-khung > .mo-nhan, .tong-khung > h1 { animation-delay: .02s; } .tong-khung > .sao { animation-delay: .08s; }
.tong-khung > .tong-loi { animation-delay: .5s; } .tong-khung > .tong-luat { animation-delay: .58s; } .tong-khung > .the-part { animation-delay: .66s; }
.tong-khung > .tieu-de-nho { animation-delay: .95s; } .tong-khung > .tong-nut { animation-delay: .35s; }
.tong-khung > .so-lieu, .tong-khung > .cum { animation: none; }
.so-lieu div { animation: len .4s ease-out both; animation-delay: calc(.4s + var(--i, 0) * 70ms); }
.cum li { animation: len .4s ease-out both; animation-delay: calc(1s + var(--i, 0) * 110ms); }
.sao svg.day.hien { filter: drop-shadow(0 0 5px rgba(217,166,58,.7)); }

@media (prefers-reduced-motion: reduce) {
  .tong-khung > *, .so-lieu div, .cum li, .man-tong, .mo-buoc li, .khach-hang .khach-ten, .khach-hang .kien-nhan, .dong.moi, .dong.moi *, .phieu.xong::after, .chuoi-to, .canh.sai-nhay::before { animation: none !important; }
  .phieu.xong::after { opacity: 1; }
  .kien-nhan.can { animation: none; }
  .pc-hoi { display: none; }
}
@media (max-width: 860px) {
  .dong .pc { width: 17px; height: 19px; margin: 0 -2px 0 0; }
  .dong-dau .dong-ten { font-size: 13.5px; }
  .dong-dau .buoc output { min-width: 20px; }
  .chuoi-to { right: 8px; top: 4px; font-size: 16px; } .chuoi-to b { font-size: 26px; }
  .phieu.xong::after { font-size: 19px; padding: 2px 12px; }
  .the-part { font-size: 12.5px; padding: 6px 10px; }
}

/* ---------- bản sửa 20261118cs5: thanh nút tổng kết dính đáy ---------- */
.man-tong { padding-bottom: 0; }
.tong-khung { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding-bottom: 0; }
.tong-nut { position: sticky; bottom: 0; z-index: 5; margin: 14px -26px 0; padding: 12px 26px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--giay); border-top: 2px solid var(--vien); }
.tong-nut .nut-phu { flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 10px; }
@media (max-width: 860px) { .tong-nut { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; } }
@media (max-height: 700px) { .tong-nut { gap: 8px; padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); } .tong-nut .nut-lon { min-height: 46px; font-size: 16px; } .tong-nut .nut-phu { min-height: 44px; font-size: 13px; } }

/* ---------- điện thoại xoay ngang 20261118dt1: khách bên trái, thực đơn giữa, phiếu bên phải ---------- */
@media (orientation: landscape) and (max-height: 480px) and (max-width: 900px) {
  :root { --canh-h: auto; }
  .than { grid-template-columns: minmax(200px, 30%) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .canh { flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 8px 8px 8px; border-bottom: 0; border-right: 3px solid var(--vien); overflow-y: auto; }
  .khach-hang { flex: none; width: auto; }
  .chan-dung { width: 56px; height: 56px; }
  .bong { flex: 0 0 auto; width: 100%; max-width: none; max-height: none; align-self: stretch; padding: 8px 10px; }
  .bong::before { display: none; }
  .bong-chu { font-size: 16px; }
  .duoi { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 6px; padding: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .ban { grid-column: 1; grid-row: 1; }
  .phieu { grid-column: 2; grid-row: 1; }
  .ban-luoi, .duoi.nhieu .ban-luoi, .ban-luoi.it { flex: 1; min-height: 0; grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: 54px; grid-auto-columns: auto; overflow-x: hidden; overflow-y: auto; }
  .dong-dau { flex-wrap: wrap; }
  .dong-ten { flex: 1 1 100px; }
}
@media (orientation: landscape) and (max-height: 480px) and (max-width: 900px) {
  .duoi { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .goi-y { padding: 4px 10px; font-size: 13px; gap: 8px; line-height: 1.25; }
  .goi-y b { font-size: 12px; padding: 1px 8px; }
  .phieu-dau { padding: 4px 12px 2px; }
  .phieu-dau h2 { font-size: 16px; } .phieu-tong { font-size: 18px; }
  .phieu-chan { padding: 6px 8px 8px; gap: 6px; grid-template-columns: 1.4fr 1fr; }
  .phieu-chan .seg-noi { grid-column: 1; } .nut-giao { min-height: 48px; font-size: 15px; }
  .seg-noi button { padding: 2px 4px; font-size: 13px; }
  .seg-noi button span { white-space: nowrap; }
}
@media (orientation: landscape) and (max-height: 480px) and (max-width: 900px) {
  .dong-gia, .dong-dau .pc { display: none; }
  .dong-dau { flex-wrap: nowrap; padding-left: 8px; }
  .dong-ten { flex: 1 1 0; min-width: 60px; }
  .mon, .mon .gia { grid-template-columns: minmax(0, 1fr); }
  .mon .gia { grid-column: 1; grid-row: 3; margin: 0; }
  .ban-luoi, .duoi.nhieu .ban-luoi, .ban-luoi.it { grid-auto-rows: 64px; }
  .mon { height: 64px; }
  .mon b { -webkit-line-clamp: 1; }
}
/* soát độc lập 20261118dt1: màn Thu tiền ngang – 4 đáp án vừa một màn (2×2), không phải cuộn mới thấy đáp án thứ tư */
@media (orientation: landscape) and (max-height: 480px) and (max-width: 900px) {
  .thu { padding: 8px 12px; align-content: center; }
  .thu h2 { font-size: 20px; margin-bottom: 2px; }
  .thu-hd { margin-bottom: 8px; } .thu-hd b { font-size: 21px; }
  .thu-chon { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .thu-chon.mot { grid-template-columns: 1fr; }
  .chon { min-height: 54px; padding: 6px 10px; font-size: 15px; line-height: 1.3; }
  .thu-ghi { margin-top: 6px; }
}

/* ---------- 20261118ux1 ---------- */
/* màn mở: câu mời + nút trước, cách chơi gập */
.mo-gt { margin: 0 0 12px; font-size: 17px; font-weight: 500; }
.mo-nut { margin-bottom: 4px; }
.mo-cach { margin-top: 12px; border-top: 2px solid var(--vien); padding-top: 8px; }
.mo-cach summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--rung); cursor: pointer; list-style: none; }
.mo-cach summary::-webkit-details-marker { display: none; }
.mo-cach summary::after { content: "▾"; margin-left: 8px; }
.mo-cach[open] summary::after { content: "▴"; }
.mo-nhan, .mo-ky, .mo-phim { color: #4E4A3E; }
.mo-phim { font-size: 13px; }
/* thanh kiên nhẫn: dưới lời thoại, có nhãn */
.kn-hang { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.kn-nhan { flex: none; font-size: 13px; font-weight: 700; color: #35432D; min-width: 64px; }
.kn-hang .kien-nhan { flex: 1 1 auto; width: auto; max-width: 320px; height: 10px; border-color: #35432D; background: #ECE3CC; }
.kien-nhan.can span { background: #C4521A; }
.bong-chu:empty ~ .kn-hang { visibility: hidden; }
.khach-hang .chan-dung { margin-bottom: 0; }
/* nút nghe lại là nút chính của khung thoại */
.nut-nghe { background: var(--rung); color: #fff; border-color: #26321F; }
.nut-nghe:hover { background: #46593C; }
.nut-nghe kbd { background: rgba(255,255,255,.22); }
/* dấu Đã giao: nhãn ở tiêu đề phiếu, không đè lên đơn */
.phieu.xong::after { content: none !important; animation: none !important; }
.phieu.xong .phieu-dau h2::after { content: "Đã giao"; margin-left: 10px; padding: 2px 10px; font-family: var(--font); font-size: 13px; font-weight: 700; color: #1F4A18; background: #DCEBCB; border: 1.5px solid #4C8A3A; border-radius: 6px; vertical-align: middle; }
.phieu-dau { align-items: center; }
.phieu-dau h2 { display: flex; align-items: center; }
/* phiếu đơn rộng hơn trên máy tính */
@media (min-width: 861px) { .duoi { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); } }
/* điện thoại: cỡ ly và nóng/đá hai hàng, nút cách nhau 8px */
@media (max-width: 860px) {
  .hai .seg-co, .hai .seg-nhiet { flex: 1 1 100%; }
  .hai { gap: 8px; }
  .seg { gap: 8px; }
  .seg button { min-height: 44px; }
  .chips { gap: 8px; }
  .chip { min-height: 44px; }
  .kn-hang .kien-nhan { max-width: none; }
}
/* k12: giao xong (hoặc khách đi) thì ẩn thanh kiên nhẫn, giữ chỗ để bố cục không nhảy */
.kn-hang.tat { visibility: hidden; }
/* k12: viền ô chọn đạt 3:1 trên nền kem, phím tắt ≥ 12px và đọc rõ trên nút cam */
.seg button, .chip, #seg-noi button, .mon, .nut-phu { border-color: #978C6D; }
kbd { font-size: 12px; }
.nut-chinh kbd { background: rgba(0,0,0,.2); color: #fff; }
.mon .so { font-size: 12px; }
.mo-cach { border-top-color: #978C6D; }

/* ---------- 20261118ux2: lỗi chỉ đúng chỗ sửa, phiếu luôn thấy, chữ to theo bề rộng ---------- */
.loi-noi { grid-column: 1 / -1; margin: 0; padding: 6px 10px; background: #FBE6DC; border: 2px solid #A8402B; border-left-width: 6px; border-radius: 8px; color: #6C2415; font-size: 15px; font-weight: 600; line-height: 1.3; }
.loi-noi b { color: #8A2A14; }
.seg-noi button { position: relative; }
.seg-noi.sai { outline: 3px solid #A8402B; outline-offset: 2px; }
.seg-noi.sai button[aria-pressed="true"] { border-color: #A8402B; background: #8A3322; }
.seg-noi.sai button[aria-pressed="true"]::after { content: "Sửa chỗ này"; position: absolute; top: -13px; right: -2px; padding: 1px 8px; background: #A8402B; color: #fff; border-radius: 5px; font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.dong { position: relative; }
.dong.loi::after { content: "Sửa chỗ này"; position: absolute; top: -11px; right: 10px; padding: 1px 8px; background: #A8402B; color: #fff; border-radius: 5px; font-size: 12px; font-weight: 700; line-height: 1.4; pointer-events: none; }
.dong.loi { border-color: #A8402B; border-width: 3px; }
@media (min-width: 861px) {
  .bong-chu { font-size: clamp(20px, 1.9vw, 27px); }
  .bong-sai { font-size: 15px; }
  .bong-nut .nut-nho { font-size: 15px; min-height: 44px; }
  .kn-nhan { font-size: 14px; }
  .khach-ten { font-size: 15px; }
  .mon { min-height: 72px; }
  .mon b { font-size: clamp(16px, 1.3vw, 19px); }
  .mon small { font-size: 13px; }
  .mon .gia { font-size: 15px; }
  .tab { font-size: 16px; }
  .goi-y { font-size: 16px; }
  .phieu-dau h2 { font-size: 22px; }
  .phieu-tong { font-size: 25px; }
  .dong-ten { font-size: clamp(16px, 1.3vw, 19px); }
  .dong-ten small { font-size: 13px; }
  .dong-gia { font-size: 16px; }
  .seg button { font-size: 16px; min-height: 46px; }
  .seg button small { font-size: 12.5px; }
  .chip { font-size: 15px; min-height: 46px; }
  .chip small { font-size: 12.5px; }
  .phieu-trong { font-size: 16px; }
  .nut-giao { font-size: 18px; min-height: 56px; }
  .seg-noi button span { font-size: 16px; }
}
/* điện thoại: hướng dẫn gọn một dải, thực đơn thu một hàng khi đã có món để phiếu đơn luôn thấy */
@media (max-width: 860px) {
  .goi-y b { display: none; }
  .goi-y { padding: 4px 10px; font-size: 13px; line-height: 1.25; }
  .duoi.co-don .ban-luoi, .duoi.co-don .ban-luoi.it { flex: none; display: grid; grid-auto-flow: column; grid-template-columns: none; grid-template-rows: 54px; grid-auto-rows: auto; grid-auto-columns: calc((100% - 12px) / 2.3); overflow-x: auto; overflow-y: hidden; max-height: none; }
  .duoi.co-don .tab { min-height: 40px; padding-top: 4px; padding-bottom: 4px; }
  .loi-noi { font-size: 14px; padding: 5px 8px; }
  .seg-noi.sai button[aria-pressed="true"]::after { top: -12px; }
}
@media (max-width: 860px) { .phieu-dong { padding-bottom: 14px; } }
/* k14: thực đơn một hàng – mép phải mờ dần báo còn món để vuốt, thẻ dừng gọn theo từng món */
@media (max-width: 860px) {
  .duoi.co-don .ban-luoi { scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); padding-right: 22px; scroll-padding-left: 2px; }
  .duoi.co-don .ban-luoi.het-phai { -webkit-mask-image: none; mask-image: none; }
  .duoi.co-don .ban-luoi > * { scroll-snap-align: start; }
}

/* ---------- 20261118ux3: dải 3 bước ở màn mở; thực đơn điện thoại chỉ hiện thẻ trọn vẹn; máy tính khung thực đơn co theo món ---------- */
.mo-3buoc { list-style: none; margin: 0 0 14px; padding: 0; display: flex; align-items: center; gap: 6px; }
.mo-3buoc li { display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border: 2px solid #978C6D; border-radius: 999px; background: var(--the); color: var(--rung); font-size: 15px; line-height: 1.2; }
.mo-3buoc li svg { flex: none; }
.mo-3buoc li b { font-weight: 700; }
.mo-3buoc li:not(:last-child) { position: relative; margin-right: 14px; }
.mo-3buoc li:not(:last-child)::after { content: "›"; position: absolute; right: -14px; top: 50%; transform: translateY(-52%); width: 14px; text-align: center; color: #4E4A3E; font-weight: 700; font-size: 18px; }
@media (max-width: 860px) {
  .duoi.co-don .ban-luoi, .duoi.co-don .ban-luoi.it { grid-auto-columns: calc((100% - 16px) / 2); column-gap: 16px; padding-right: 8px; scroll-snap-type: x mandatory; scroll-padding-left: 8px; -webkit-mask-image: none; mask-image: none; }
  .duoi.co-don .ban-tab { align-items: center; }
  .duoi.co-don .ban:has(> .ban-luoi:not(.het-phai)) .ban-tab::after { content: "Vuốt xem thêm ›"; margin-left: auto; padding: 0 6px 4px 0; font-size: 12.5px; font-weight: 600; color: #4E4A3E; white-space: nowrap; }
}
@media (min-width: 861px) {
  .ban { align-self: start; max-height: 100%; }
  .ban-luoi { flex: 0 1 auto; }
}
@media (max-width: 860px) and (orientation: landscape) and (max-height: 480px) {
  .duoi.co-don .ban:has(> .ban-luoi:not(.het-phai)) .ban-tab::after { content: "›"; font-size: 20px; padding: 0 8px 4px 0; }
}
