:root {
  --main: #0F5546; --main-ink: #fff; --main-dark: #0c463a; --main-tint: #d4e3df; --main-soft: #eef4f2;
  --hl: #F0B429; --hl-ink: #17231F;
  --wall: #E9EDE3; --bot: #fff; --me: #D4F2C4; --ink: #17231F; --muted: #5D6B66; --line: #D5DED6;
  --good: #1F8A55; --good-bg: #DDF1E5; --warn: #B45309; --warn-bg: #FCEBD6; --bad: #B42318; --bad-bg: #FDE2DF; --wait: #7A5300; --wait-bg: #FDF1D3;
  --r: 18px;
  font-family: "Nunito", "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #CFD8CB; color: var(--ink); font-size: 17px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--wall);
  background-image: radial-gradient(rgba(23,35,31,.06) 1px, transparent 1.2px); background-size: 18px 18px; box-shadow: 0 0 40px rgba(0,0,0,.12); }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: var(--main); color: var(--main-ink); display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
.logo { flex: none; border-radius: 50%; background: var(--hl); color: var(--hl-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.top .who { flex: 1; min-width: 0; }
.top .who b { display: block; font-size: 18px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who small { display: block; font-size: 13px; opacity: .85; }
.lang { display: flex; border: 2px solid currentColor; border-radius: 999px; overflow: hidden; flex: none; }
.lang button { border: 0; background: transparent; padding: 6px 10px; font-weight: 800; font-size: 14px; min-width: 44px; min-height: 36px; color: inherit; }
.lang button[aria-pressed=true] { background: var(--main-ink); color: var(--main); }

/* chat */
.chat { flex: 1; padding: 14px 12px 110px; display: flex; flex-direction: column; gap: 8px; }
.chip { align-self: center; background: rgba(255,255,255,.8); color: var(--muted); font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; box-shadow: 0 1px 1px rgba(0,0,0,.08); word-wrap: break-word; animation: pop .18s ease-out; }
.msg.bot { align-self: flex-start; background: var(--bot); border-top-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--main-tint); border-top-right-radius: 4px; font-weight: 700; }
.msg.me .chg { display: block; margin-top: 4px; border: 0; background: none; padding: 4px 0 0; color: var(--main); font-weight: 800; font-size: 14px; text-decoration: underline; text-align: right; width: 100%; min-height: 32px; }
.msg.wide { max-width: 100%; width: 100%; padding: 0; background: transparent; box-shadow: none; }
.msg b.big { font-size: 20px; }
.msg ul { margin: 6px 0; padding-left: 20px; }
.msg ul.r-items { margin: 6px 14px; padding: 0; }
.msg ul.past { padding: 0; }
.msg { scroll-margin-top: 76px; }
.msg .sub { color: var(--muted); font-size: 15px; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } }

/* answers */
.answers { margin-top: 4px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts.one { grid-template-columns: 1fr; }
.opts.three { grid-template-columns: repeat(3, 1fr); }
.opts.nums { grid-template-columns: repeat(4, 1fr); }
.opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 12px 8px; border-radius: var(--r);
  background: #fff; border: 2px solid #BFE0B0; text-align: center; font-weight: 800; font-size: 17px; line-height: 1.2; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.opt:active { transform: scale(.98); }
.opt:focus-visible, .btn:focus-visible, .lang button:focus-visible, .bar a:focus-visible, .bar button:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.opt small { display: block; font-weight: 600; font-size: 14px; color: var(--muted); }
.opt .price { font-weight: 800; color: var(--main); font-size: 15px; }
.opt .pic { width: 100%; height: 86px; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #FBF6EA; }
.opt .pic img { width: 100%; height: 100%; object-fit: cover; }
.opt .ic { color: var(--main); display: flex; }
.opt.wide { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; text-align: left; gap: 12px; }
.opt.wide .pic { width: 72px; height: 64px; flex: none; }
.opt.primary { background: var(--main); border-color: var(--main); color: var(--main-ink); }
.opt.primary small { color: inherit; opacity: .85; }
.opt.primary .ic { color: inherit; }
.opt[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.opt.num { font-size: 26px; min-height: 64px; }
.opt .left { font-size: 13px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--good-bg); color: var(--good); }
.opt .left.low { background: var(--warn-bg); color: var(--warn); }
.opt .left.out { background: var(--bad-bg); color: var(--bad); }
.opt .media { position: absolute; top: 6px; right: 6px; border: 0; background: rgba(23,35,31,.75); color: #fff; font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 999px; min-height: 28px; }
.eggart { display: inline-flex; align-items: flex-end; gap: 2px; }
.linkrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.textlink { border: 0; background: rgba(255,255,255,.7); color: var(--main); font-weight: 800; text-decoration: underline; padding: 8px 12px; border-radius: 999px; font-size: 15px; min-height: 40px; }

.form { background: #fff; border-radius: var(--r); padding: 14px; display: grid; gap: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.form label { font-weight: 800; font-size: 15px; }
.field { width: 100%; padding: 14px; font-size: 20px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.field:focus { outline: none; border-color: var(--main); }
.err { color: var(--bad); font-weight: 700; font-size: 15px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 12px 18px; border-radius: 16px; border: 2px solid var(--main); background: var(--main); color: var(--main-ink); font-weight: 800; font-size: 18px; text-decoration: none; }
.btn.ghost { background: #fff; color: var(--main); }
.btn.small { min-height: 44px; font-size: 15px; padding: 8px 12px; border-radius: 12px; }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

/* counters (wholesale) */
.counter { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #EEF1EE; }
.counter .nm { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.counter .ctl { display: flex; align-items: center; gap: 6px; }
.counter .ctl button { width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--main); background: #fff; color: var(--main); font-size: 26px; font-weight: 800; line-height: 1; }
.counter .ctl input { width: 64px; height: 48px; text-align: center; font-size: 22px; font-weight: 800; border: 2px solid var(--line); border-radius: 12px; }
.sumline { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; }

.past { list-style: none; margin: 0; padding: 0; }
.past li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #EEF1EE; }
.past li span { font-size: 15px; }

/* bottom bar */
.bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); }
.bar a, .bar button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 52px; padding: 0 4px; border-radius: 14px; border: 2px solid var(--main); background: #fff; color: var(--main); font-weight: 800; font-size: 15px; text-decoration: none; white-space: nowrap; }
.bar svg { flex: none; }
.bar .wa { background: #1F8A55; border-color: #1F8A55; color: #fff; }

/* sheet (gallery) */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(10,20,16,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: #fff; border-radius: 22px 22px 0 0; padding: 12px 14px max(16px, env(safe-area-inset-bottom)); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: #D5DED6; margin: 0 auto 10px; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; border-radius: 16px; }
.gallery > * { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #F3EEE2; display: flex; align-items: center; justify-content: center; }
.gallery img, .gallery video { width: 100%; height: 100%; object-fit: cover; }
.gallery .vid { flex-direction: column; gap: 8px; border: 0; color: #fff; background: #17231F; font-weight: 800; }
.gallery .vid .play { width: 72px; height: 72px; border-radius: 50%; background: var(--hl); color: var(--hl-ink); display: flex; align-items: center; justify-content: center; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 8px 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #CBD5CF; }
.dots i.on { background: var(--main); }
.sheet h2 { margin: 6px 0 2px; font-size: 22px; }
.sheet .meta { color: var(--muted); font-weight: 700; }
.sheet .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* full screen receipt */
.full { position: fixed; inset: 0; z-index: 30; background: #fff; overflow: auto; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); }
.full .inner { max-width: 480px; margin: 0 auto; display: grid; gap: 12px; }
.full .hint { text-align: center; color: var(--muted); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 40; background: #17231F; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; max-width: 90vw; text-align: center; }

/* first visit */
.welcome-lang { display: grid; gap: 14px; padding: 30px 8px; text-align: center; }
.welcome-lang .logo { margin: 0 auto; }
.welcome-lang h1 { margin: 6px 0 0; font-size: 26px; }
.welcome-lang .opt { min-height: 76px; font-size: 22px; }

@media (min-width: 600px) {
  body { padding: 18px 0; }
  .shell { border-radius: 22px; overflow: hidden; min-height: calc(100vh - 36px); }
  .bar { bottom: 18px; border-radius: 0 0 22px 22px; }
}
@media (max-width: 360px) {
  .opts.three { grid-template-columns: 1fr 1fr; }
  .opt .pic { height: 70px; }
}

@media print {
  body { background: #fff; padding: 0; }
  body * { visibility: hidden; }
  .print-me, .print-me * { visibility: visible; }
  .print-me { position: absolute; left: 0; top: 0; width: 100%; max-width: 420px; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .r-actions { display: none !important; }
}
