/* WASH4U — calm slate + royal blue, touch-first for iPad POS.
   Layout: white side rail with the rhino logo; POS = machine catalog | bill panel
   (portrait/phone: slim header + bottom tab bar, bill becomes a bottom sheet). */
:root {
  --bg: #F1F5F9;
  --card: #FFFFFF;
  --ink: #0F172A;
  --nav: #1E293B;
  --nav-2: #334155;
  --nav-3: #475569;
  --muted: #64748B;
  --faint: #94A3B8;
  --line: #E2E8F0;
  --chip: #F8FAFC;
  --chip-line: #CBD5E1;
  --brand: #C4574A;
  --blue: #2563EB;
  --blue-dk: #1D4ED8;
  --blue-soft: #EFF6FF;
  --blue-line: #BFDBFE;
  --blue-mid: #DBEAFE;
  --ok: #15803D;
  --ok-soft: #F0FDF4;
  --ok-line: #BBF7D0;
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --warn-line: #FDE68A;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --font: 'Prompt', 'Sukhumvit Set', 'Thonburi', system-ui, -apple-system, sans-serif;
  --r: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 18px -10px rgba(15, 23, 42, 0.14);
  --shadow-up: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 28px -12px rgba(30, 41, 59, 0.28);
  --shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, 0.35);
  --ring: 0 0 0 4px rgba(37, 99, 235, 0.14);
  --gut: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
  --tabbar: 0px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.num, .money { font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue-line); outline-offset: 2px; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- app shell: white side rail (landscape) ---------- */
.app { height: 100%; display: grid; grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.topbar {
  background: #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: max(14px, env(safe-area-inset-top, 0px)) 10px 14px max(10px, env(safe-area-inset-left, 0px));
  border-right: 1px solid var(--line);
  position: relative;
  z-index: 30;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.logo-mark { display: block; width: 64px; height: 64px; flex: none; background: var(--brand); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; padding-bottom: 8px; border-bottom: 1px solid var(--line); width: 100%; }
.brand-text { text-align: center; }
.brand-name { font-weight: 700; font-size: 13px; letter-spacing: 0.08em; line-height: 1; color: var(--ink); display: none; }
.brand-sub { font-size: 11px; color: var(--muted); line-height: 1.2; }
.nav { display: flex; flex-direction: column; gap: 6px; width: 100%; flex: none; }
.nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 70px;
  width: 100%;
  padding: 8px 4px;
  border-radius: 18px;
  font-weight: 500;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
  transition: background 0.15s, color 0.15s;
  line-height: 1.15;
  text-align: center;
}
.nav button .ico { width: 24px; height: 24px; }
.nav button:active { background: var(--chip); }
.nav button[aria-current='page'] { background: var(--blue-soft); color: var(--blue-dk); font-weight: 600; }
.nav button[aria-current='page'] .ico { color: var(--blue); }
.nav button[aria-current='page']::before { content: ''; position: absolute; left: -10px; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue); }
.nav .count { position: absolute; top: 6px; right: 14px; background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; line-height: 18px; font-weight: 600; font-variant-numeric: tabular-nums; border: 2px solid #fff; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding-top: 10px; border-top: 1px solid var(--line); }
.duty { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.duty .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4ADE80; }
.duty-empty { font-size: 11px; color: var(--faint); text-align: center; line-height: 1.2; }
.clock { text-align: center; flex: none; }
.clock .t { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--nav); }
.clock .t .s { color: var(--faint); font-size: 12px; }
.clock .d { font-size: 10.5px; color: var(--muted); }
.mode-pill { font-size: 10.5px; padding: 3px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; flex: none; display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); }
.mode-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #F59E0B; }
.mode-pill.live::before { background: #22C55E; }
.mode-pill.off::before { background: #EF4444; }

.view { overflow: auto; min-height: 0; padding: 18px var(--gut-r) calc(24px + var(--tabbar)) var(--gut); -webkit-overflow-scrolling: touch; }
.view.pos-view { overflow: hidden; padding-bottom: 16px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.view-head h1 { font-size: 24px; font-weight: 600; color: var(--nav); letter-spacing: -0.01em; }
.view-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.duty-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.duty-chip { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 3px; font-size: 13px; white-space: nowrap; }
.duty-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }

/* ---------- generic ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid rgba(226, 232, 240, 0.9); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 2px 12px; flex-wrap: wrap; }
.section-title h2 { font-size: 16px; font-weight: 600; color: var(--nav); display: flex; align-items: center; gap: 10px; }
.section-title h2 .ico { color: var(--blue); }
.section-title .hint { color: var(--muted); font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0.04em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn {
  min-height: 52px;
  padding: 0 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--chip-line);
  background: var(--chip);
  color: var(--ink);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.8); }
.btn.primary:active { background: var(--blue-dk); }
.btn.dark { background: var(--nav); border-color: var(--nav); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.white { background: #fff; }
.btn.danger { color: var(--danger); border-color: #FECACA; background: var(--danger-soft); }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.lg { min-height: 60px; font-size: 17px; font-weight: 600; }
.btn.xl { min-height: 74px; font-size: 19px; font-weight: 600; }
.btn.block { width: 100%; }
.btn.stack { flex-direction: column; gap: 0; line-height: 1.2; min-height: 64px; padding: 6px 8px; text-align: center; }
.btn.stack small { font-size: 12px; font-weight: 400; opacity: 0.8; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; background: var(--chip); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.blue { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue-dk); }
.pill.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.pill.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.pill.solid { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill.dark { background: var(--nav); border-color: var(--nav); color: #fff; }
.input, select.input, textarea.input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--chip-line);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { min-height: 64px; resize: vertical; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.toggle { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 6px 0; min-height: 52px; font-weight: 500; white-space: nowrap; }
.toggle .track { width: 54px; height: 32px; border-radius: 999px; background: var(--chip-line); position: relative; transition: background 0.15s; flex: none; }
.toggle .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3); transition: transform 0.18s; }
.toggle[aria-pressed='true'] .track { background: var(--blue); }
.toggle[aria-pressed='true'] .track::after { transform: translateX(22px); }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: 18px; height: 100%; }
.catalog { overflow: auto; min-height: 0; padding: 2px 4px 28px 2px; }
.machine-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.machine {
  background: var(--card);
  border: 2px solid transparent;
  outline: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.2s, outline-color 0.15s;
}
.machine.selected { border-color: var(--blue); outline-color: transparent; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), var(--shadow-up); }
.machine.off { opacity: 0.5; filter: grayscale(0.6); }
.machine-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.machine-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.glyph { width: 52px; height: 52px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; transition: background 0.15s, color 0.15s; }
.glyph svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.machine.selected .glyph { background: var(--blue); color: #fff; }
.machine.dryer .glyph { background: #F1F5F9; color: var(--nav); }
.machine.dryer.selected .glyph { background: var(--blue); color: #fff; }
.machine-size { font-size: 26px; font-weight: 700; line-height: 1; color: var(--nav); letter-spacing: -0.01em; }
.machine-size small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.machine-kind { font-size: 13px; color: var(--muted); margin-top: 5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.price { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.price .now { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--nav); line-height: 1; }
.price .now small { font-size: 14px; font-weight: 600; margin-left: 1px; }
.price .was { font-size: 13px; color: var(--faint); text-decoration: line-through; margin-right: 6px; }
.promo-tag { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; }
.sel-badge { background: var(--blue); color: #fff; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; animation: pop 0.3s ease; }
.mods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mod {
  min-height: 74px;
  border-radius: 14px;
  border: 1px solid var(--chip-line);
  background: var(--chip);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  text-align: center;
  position: relative;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.mod:active { transform: scale(0.96); }
.mod .ic { font-size: 19px; line-height: 1; }
.mod .lb { font-size: 13px; font-weight: 500; }
.mod .pr { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mod.on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 16px -10px rgba(37, 99, 235, 0.9); }
.mod.on .pr { color: #fff; font-weight: 600; }
.machine-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-height: 40px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: -2px; }
.machine-foot .hint { font-size: 12px; color: var(--muted); }
.addon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.addon { padding: 14px; gap: 12px; }
.addon .name { font-weight: 500; font-size: 14px; line-height: 1.3; }
.addon .glyph { width: 40px; height: 40px; border-radius: 12px; }
.addon .glyph svg { width: 24px; height: 24px; }
.stepper { display: flex; align-items: center; gap: 6px; background: var(--chip); border-radius: 14px; padding: 4px; border: 1px solid var(--line); }
.stepper button { width: 52px; height: 52px; border-radius: 11px; border: 0; background: #fff; font-size: 24px; font-weight: 500; flex: none; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.stepper button[disabled] { opacity: 0.35; }
.stepper button.plus.on { background: var(--blue); color: #fff; }
.stepper .q { flex: 1; text-align: center; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* bill */
.bill { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.bill-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.bill-head h2 { font-size: 17px; font-weight: 600; color: var(--nav); }
.bill-head .sheet-close { display: none; }
.bill-scroll { overflow: auto; flex: 1; min-height: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 16px; }
.bill-scroll > * { flex: none; }
.bill-foot { border-top: 1px solid var(--line); padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, #fff, var(--chip)); }
.member-empty { display: grid; gap: 8px; padding: 14px; border-radius: var(--r-md); background: var(--chip); border: 1px dashed var(--chip-line); }
.member-empty .lead { display: flex; align-items: center; gap: 10px; }
.member-empty .lead .glyph { width: 40px; height: 40px; border-radius: 12px; }
.member-empty .lead .glyph svg { width: 22px; height: 22px; }

/* loyalty card (POS + LINE) */
.loyalty {
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(96, 165, 250, 0.35), transparent 55%),
    linear-gradient(150deg, #1E293B 0%, #0F172A 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 30px -18px rgba(15, 23, 42, 0.9);
}
.loyalty-wm { position: absolute; right: -26px; bottom: -30px; width: 170px; height: 170px; background: rgba(255, 255, 255, 0.07); pointer-events: none; }
.loyalty-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; position: relative; z-index: 1; }
.loyalty .who { font-weight: 600; font-size: 17px; line-height: 1.2; }
.loyalty .sub { font-size: 12px; color: #CBD5E1; font-variant-numeric: tabular-nums; margin-top: 2px; }
.loyalty .btn.sm { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.loyalty .meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #CBD5E1; position: relative; z-index: 1; }
.loyalty .meta b { color: #fff; font-size: 15px; }
.stamps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; max-width: 360px; width: 100%; position: relative; z-index: 1; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, 0.28); display: flex; align-items: center; justify-content: center; font-size: 13px; color: rgba(255, 255, 255, 0.45); flex-direction: column; line-height: 1.05; font-variant-numeric: tabular-nums; max-width: 100%; text-align: center; }
.stamp.filled { border: 0; background: #fff; color: var(--blue); font-size: 18px; font-weight: 700; }
.stamp.new { border: 0; background: var(--blue); color: #fff; font-size: 9px; font-weight: 600; box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.45); animation: pulse 1.6s ease-in-out infinite; }
.stamp.new b { font-size: 15px; }
.stamp.gift { font-size: 18px; border-style: solid; border-color: rgba(251, 191, 36, 0.6); }
@keyframes pop { 0% { transform: scale(0.7); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.45); } 50% { box-shadow: 0 0 0 7px rgba(96, 165, 250, 0.12); } }
.wallet { display: flex; flex-wrap: wrap; gap: 6px; }
.coupon-chip { border: 1px dashed var(--blue); background: var(--blue-soft); color: var(--blue-dk); border-radius: 12px; min-height: 48px; padding: 6px 12px; font-size: 13px; font-weight: 600; text-align: left; line-height: 1.2; }
.coupon-chip small { display: block; font-weight: 400; font-size: 11px; }
.coupon-chip.on { background: var(--blue); color: #fff; border-style: solid; }
.loyalty .coupon-chip { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(147, 197, 253, 0.7); position: relative; z-index: 1; }
.loyalty .coupon-chip.on { background: var(--blue); border-color: var(--blue); }
.loyalty .notice { position: relative; z-index: 1; }
.lines { display: flex; flex-direction: column; gap: 6px; }
.line { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; padding: 8px 0 8px 8px; border-radius: 12px; background: var(--chip); border: 1px solid var(--line); animation: slidein 0.2s ease; }
@keyframes slidein { from { opacity: 0; transform: translateY(-4px); } }
.line .no { width: 36px; height: 36px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; color: var(--blue); font-variant-numeric: tabular-nums; }
.line.dryer .no { color: var(--nav); }
.line.addon .no { color: var(--muted); font-size: 16px; }
.line .l1 { font-weight: 600; font-size: 14px; }
.line .l2 { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.line .x { width: 40px; height: 40px; border: 0; background: transparent; color: var(--faint); font-size: 22px; border-radius: 8px; }
.empty-cart { text-align: center; color: var(--muted); padding: 22px 12px; border: 1.5px dashed var(--chip-line); border-radius: var(--r-md); font-size: 14px; display: grid; justify-items: center; gap: 8px; }
.empty-logo { width: 72px; height: 72px; background: var(--chip-line); opacity: 0.7; }
.empty-cart svg { width: 44px; height: 44px; fill: none; stroke: var(--chip-line); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.totals { display: grid; gap: 4px; font-size: 14px; }
.totals .row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; gap: 8px; }
.totals .disc { color: var(--ok); }
.totals .net { font-size: 28px; font-weight: 700; color: var(--nav); align-items: baseline; letter-spacing: -0.01em; }
.totals .net span:first-child { font-size: 15px; font-weight: 500; letter-spacing: 0; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-opt { min-height: 52px; border-radius: 12px; border: 1px solid var(--chip-line); background: #fff; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.15s; }
.pay-opt.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row .input { text-transform: uppercase; }
.field-label { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; display: block; }
.pos-mbar, .sheet-scrim { display: none; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 22px; width: min(560px, 100%); max-height: calc(100% - 16px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; animation: rise 0.2s ease; }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 18px; font-weight: 600; }
.modal-body { padding: 18px; overflow: auto; flex: 1; min-height: 0; }
.modal-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
.close-x { width: 48px; height: 48px; border-radius: 12px; border: 0; background: var(--chip); font-size: 22px; flex: none; }

.phone-display { font-size: 34px; font-weight: 600; text-align: center; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; padding: 12px; border-radius: 16px; background: var(--chip); border: 1px solid var(--line); min-height: 72px; }
.phone-display .ph { color: var(--chip-line); }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.numpad button { min-height: 74px; border-radius: 16px; border: 1px solid var(--line); background: #fff; font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; box-shadow: 0 2px 0 var(--line); transition: background 0.12s ease-out; }
.numpad button:active { background: var(--blue-soft); transition: none; }
.modal-backdrop.still, .modal-backdrop.still .modal { animation: none; }
.phone-display { overflow: hidden; white-space: nowrap; }
.phone-display .pd { display: inline-block; width: 0.64em; text-align: center; }
.numpad .fn { font-size: 17px; background: var(--chip); }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.notice.info { background: var(--blue-soft); color: var(--blue-dk); border: 1px solid var(--blue-line); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }

.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: center; }
.qr-box svg { width: 220px; height: 220px; max-width: 100%; }
.qr-head { background: #0E3E6B; color: #fff; border-radius: 10px; padding: 6px; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.qr-placeholder { width: 220px; height: 220px; max-width: 100%; margin: 0 auto; border-radius: 12px; background: repeating-linear-gradient(45deg, var(--chip), var(--chip) 10px, #fff 10px, #fff 20px); border: 1px dashed var(--chip-line); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; padding: 16px; }
.cash-keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.big-amount { font-size: 40px; font-weight: 700; color: var(--nav); font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -0.01em; }

/* ---------- print preview & paper ---------- */
.print-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.print-bar .btn { flex: 1 1 200px; }
.paper-row { display: flex; gap: 20px; justify-content: center; align-items: flex-start; flex-wrap: wrap; background: #E2E8F0; padding: 20px; border-radius: 14px; }
.paper {
  width: 80mm;
  max-width: 100%;
  background: #fff;
  color: #000;
  padding: 4mm 4mm 6mm;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.15);
  font-variant-numeric: tabular-nums;
}
.paper .c { text-align: center; }
.paper .r { text-align: right; }
.paper .r-logo { width: 30mm; height: 30mm; display: block; margin: 0 auto 2px; }
.paper .tag-title { display: flex; align-items: center; justify-content: center; gap: 6px; }
.paper .t-logo { width: 7mm; height: 7mm; filter: invert(1); }
.paper .logo { font-size: 22px; font-weight: 700; letter-spacing: 0.08em; }
.paper .hr { border-top: 1px dashed #000; margin: 6px 0; }
.paper .hr2 { border-top: 2px solid #000; margin: 6px 0; }
.paper .kv { display: flex; justify-content: space-between; gap: 6px; }
.paper .kv span:last-child { text-align: right; }
.paper .big { font-size: 15px; font-weight: 700; }
.paper .q { font-size: 34px; font-weight: 700; line-height: 1; }
.paper .item { margin: 4px 0; }
.paper .item .sub { padding-left: 8px; font-size: 11px; }
/* receipt stamp card: pure black on white, no greys (thermal printers dither them) */
.paper .pcard { border: 2px solid #000; border-radius: 3mm; padding: 2mm 2.5mm 2.5mm; margin: 2mm 0; }
.paper .pcard-h { display: flex; justify-content: space-between; align-items: center; background: #000; color: #fff; font-weight: 700; font-size: 13px; margin: -2mm -2.5mm 2mm; padding: 1.2mm 2.5mm; border-radius: 1.5mm 1.5mm 0 0; }
.paper .pcard-who { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; margin-bottom: 1.5mm; }
.paper .pcard-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5mm 1mm; justify-items: center; }
.paper .psc { display: flex; flex-direction: column; align-items: center; min-height: 12mm; }
.paper .pdot { width: 10mm; height: 10mm; border-radius: 50%; border: 1px dashed #000; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; line-height: 1; }
.paper .pdot.f { background: #000; color: #fff; border: 1px solid #000; font-size: 15px; }
.paper .pdot.n { border: 1px solid #000; box-shadow: 0 0 0 0.6mm #fff, 0 0 0 1.1mm #000; background: #000; color: #fff; font-size: 15px; }
.paper .pdot.g { border: 2px solid #000; font-weight: 700; font-size: 11px; }
.paper .psc i { font-style: normal; font-size: 8.5px; font-weight: 700; margin-top: 1.4mm; line-height: 1; }
.paper .pcard-count { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 2mm; border-top: 1px dashed #000; margin-top: 1.5mm; padding-top: 1.5mm; }
.paper .pcard-count b { font-size: 22px; line-height: 1; }
.paper .pcard-count small { font-size: 13px; }
.paper .pcard-count span:last-child { text-align: right; font-size: 11px; font-weight: 600; }
.paper .pcard-foot { text-align: center; margin-top: 1.5mm; font-size: 12px; line-height: 1.4; }
.paper .pcard-foot .pnum { font-size: 16px; }
.paper, .paper * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.paper .tag-title { background: #000; color: #fff; text-align: center; font-weight: 700; padding: 4px; font-size: 14px; }
.paper .box { border: 1.5px solid #000; padding: 4px 6px; margin: 6px 0; }
.paper .box-title { font-weight: 700; border-bottom: 1px solid #000; margin-bottom: 4px; padding-bottom: 2px; }
.paper .setting { font-weight: 700; }
.paper .check { display: flex; gap: 6px; padding: 3px 0; border-bottom: 1px dotted #000; font-size: 13px; }
.paper .check:last-child { border-bottom: 0; }
.paper .paid { border: 2px solid #000; text-align: center; font-weight: 700; font-size: 15px; padding: 3px; margin: 6px 0; }
#print-root { display: none; }

@media print {
  @page { size: 80mm auto; margin: 0; }
  html, body { background: #fff !important; height: auto !important; overflow: visible !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  /* Unlock any modal so the tag is never cut in half on iPad Safari. */
  .modal-backdrop, .modal, .modal-body, .paper-row, #print-root {
    max-height: none !important; height: auto !important; overflow: visible !important; position: static !important;
  }
  .paper { box-shadow: none !important; width: 80mm !important; margin: 0 !important; page-break-after: always; break-after: page; page-break-inside: avoid; }
  .paper:last-child { page-break-after: auto; break-after: auto; }
}

/* ---------- queue board ---------- */
.q-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.q-tile { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--r-md); padding: 12px 14px; min-height: 74px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: border-color 0.15s, background 0.15s; }
.q-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--st, var(--chip-line)); }
.q-tile .k { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.q-tile .v { font-size: 26px; font-weight: 700; color: var(--nav); line-height: 1; font-variant-numeric: tabular-nums; }
.q-tile.on { border-color: var(--blue); background: var(--blue-soft); }
.q-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; justify-content: space-between; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg button { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 0; background: transparent; font-weight: 500; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.seg button.on { background: var(--nav); color: #fff; }
.seg .n { font-size: 12px; background: rgba(15, 23, 42, 0.06); border-radius: 999px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.seg button.on .n { background: rgba(255, 255, 255, 0.2); }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.q-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.q-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--st, var(--chip-line)); }
.st-active { --st: var(--nav); }
.st-received { --st: #94A3B8; }
.st-washing { --st: #60A5FA; }
.st-drying { --st: #2563EB; }
.st-ready { --st: #16A34A; }
.st-completed { --st: #CBD5E1; }
.q-card.st-completed { opacity: 0.78; }
.q-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.q-no { font-size: 32px; font-weight: 700; color: var(--nav); line-height: 1; letter-spacing: -0.02em; }
.q-cust { font-weight: 600; }
.q-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-items { display: flex; flex-wrap: wrap; gap: 6px; }
.q-item { background: var(--chip); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; }
.q-item b { font-weight: 600; }
.q-note { background: var(--warn-soft); border: 1px solid var(--warn-line); color: #78350F; border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; background: var(--chip); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.steps button { min-height: 52px; border-radius: 9px; border: 0; background: transparent; font-size: 12px; line-height: 1.15; padding: 4px 2px; font-weight: 500; color: var(--muted); position: relative; }
.steps button.done { color: var(--blue-dk); }
.steps button.done::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: 5px; height: 3px; border-radius: 2px; background: var(--blue-line); }
.steps button.cur { background: var(--blue); color: #fff; font-weight: 600; box-shadow: 0 6px 14px -8px rgba(37, 99, 235, 0.9); }
.q-actions { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state svg { width: 56px; height: 56px; fill: none; stroke: var(--chip-line); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- attendance ---------- */
.att { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cam { position: relative; background: #0B1220; border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; max-width: 100%; box-shadow: var(--shadow-up); }
.cam video, .cam img.still { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam img.still { transform: none; }
.cam .overlay { position: absolute; inset: 0; pointer-events: none; }
.cam .oval { position: absolute; left: 50%; top: 47%; width: 44%; height: 68%; transform: translate(-50%, -50%); border: 3px solid rgba(147, 197, 253, 0.9); border-radius: 50%; box-shadow: 0 0 0 9999px rgba(11, 18, 32, 0.5); }
.cam .corners { position: absolute; left: 50%; top: 47%; width: 54%; height: 78%; transform: translate(-50%, -50%); }
.cam .corners i { position: absolute; width: 26px; height: 26px; border-color: #93C5FD; border-style: solid; }
.cam .corners i:nth-child(1) { left: 0; top: 0; border-width: 3px 0 0 3px; border-radius: 8px 0 0 0; }
.cam .corners i:nth-child(2) { right: 0; top: 0; border-width: 3px 3px 0 0; border-radius: 0 8px 0 0; }
.cam .corners i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 8px; }
.cam .corners i:nth-child(4) { right: 0; bottom: 0; border-width: 0 3px 3px 0; border-radius: 0 0 8px 0; }
.cam .laser { position: absolute; left: 29%; right: 29%; height: 2px; background: #60A5FA; box-shadow: 0 0 14px 4px rgba(96, 165, 250, 0.75); top: 15%; animation: laser 2.4s ease-in-out infinite alternate; }
@keyframes laser { from { top: 15%; } to { top: 79%; } }
.cam .cam-clock { position: absolute; left: 16px; bottom: 14px; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.cam .cam-clock .t { font-size: 36px; font-weight: 600; line-height: 1; letter-spacing: 0.02em; }
.cam .cam-clock .d { font-size: 13px; opacity: 0.85; }
.cam .cam-status { position: absolute; right: 14px; top: 14px; }
.cam .fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #CBD5E1; text-align: center; padding: 24px; z-index: 1; }
.cam .fallback svg { width: 56px; height: 56px; fill: none; stroke: #64748B; stroke-width: 1.5; }
.cam .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam .flash.go { animation: flash 0.5s ease; }
@keyframes flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }
.cam .scanning { position: absolute; left: 50%; top: 86%; transform: translateX(-50%); background: rgba(37, 99, 235, 0.95); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.staff-btn { min-height: 74px; border-radius: 14px; border: 1px solid var(--chip-line); background: var(--chip); display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: left; transition: background 0.15s; position: relative; }
.staff-btn.on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 10px 20px -12px rgba(37, 99, 235, 0.9); }
.staff-btn.on .muted { color: var(--blue-mid); }
.staff-btn .live { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--nav); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; overflow: hidden; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.staff-btn.on .avatar { background: #fff; color: var(--blue); }
.att-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.thumb { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--chip); display: block; }

/* ---------- LINE LIFF mock ---------- */
.liff-wrap { display: grid; grid-template-columns: auto minmax(0, 460px); gap: 28px; align-items: start; justify-content: center; }
.phone { width: 390px; max-width: 100%; height: 780px; max-height: calc(100vh - 130px); min-height: 560px; border-radius: 52px; background: #0F172A; padding: 12px; box-shadow: var(--shadow-lg), inset 0 0 0 2px #334155; position: relative; }
.phone::before { content: ''; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 110px; height: 30px; border-radius: 20px; background: #0F172A; z-index: 2; }
.phone-screen { background: #F8FAFC; border-radius: 42px; height: 100%; overflow: hidden; display: flex; flex-direction: column; }
.liff-status { height: 44px; display: flex; justify-content: space-between; align-items: center; padding: 6px 30px 0; font-size: 13px; font-weight: 600; background: #fff; }
.liff-bar { background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.liff-bar .x { font-size: 18px; color: var(--muted); width: 24px; }
.liff-body { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.liff-card { background: #fff; border-radius: 16px; padding: 12px 14px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.liff-h { margin: 4px 2px 0; font-size: 15px; font-weight: 600; }
.track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.track .seg-bar { height: 6px; border-radius: 3px; background: var(--line); }
.track .seg-bar.on { background: var(--blue); }
.liff-coupon { display: flex; gap: 10px; align-items: center; border-radius: 14px; padding: 12px; background: #fff; border: 1px solid var(--line); position: relative; box-shadow: var(--shadow); }
.liff-coupon .tick { width: 44px; height: 44px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.liff-coupon .code { font-weight: 700; color: var(--blue-dk); letter-spacing: 0.03em; }
.liff-coupon.used { opacity: 0.55; box-shadow: none; }
.liff-coupon.used .tick { background: var(--chip); color: var(--faint); }
.liff-side { display: flex; flex-direction: column; gap: 14px; }
.liff-tabs { display: flex; border-top: 1px solid var(--line); background: #fff; padding-bottom: 10px; }
.liff-tabs button { flex: 1; border: 0; background: none; min-height: 56px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.liff-tabs button.on { color: var(--blue); font-weight: 600; }
.member-list { display: flex; flex-direction: column; gap: 6px; max-height: 440px; overflow: auto; }
.member-list button { min-height: 60px; border: 1px solid var(--line); border-radius: 14px; background: var(--chip); display: flex; justify-content: space-between; align-items: center; padding: 0 14px; text-align: left; gap: 10px; }
.member-list button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.member-list button.on .muted { color: var(--blue-mid); }
.mini-bar { width: 72px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; display: block; margin-top: 4px; }
.mini-bar i { display: block; height: 100%; background: var(--blue); }
.member-list button.on .mini-bar { background: rgba(255, 255, 255, 0.3); }
.member-list button.on .mini-bar i { background: #fff; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; padding: 10px; position: sticky; top: 0; }
.admin-nav button { min-height: 52px; border: 0; border-radius: 12px; background: transparent; text-align: left; padding: 0 14px; font-weight: 500; display: flex; gap: 10px; align-items: center; color: var(--nav-3); white-space: nowrap; }
.admin-nav button .ico { width: 20px; height: 20px; }
.admin-nav button.on { background: var(--blue-soft); color: var(--blue-dk); }
.admin-panel { padding: 20px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.admin-panel h2 { font-size: 18px; font-weight: 600; }
.admin-panel .tbl .input { min-height: 46px; font-size: 15px; padding: 6px 10px; }
.admin-panel .tbl td.w-num { width: 120px; }
.add-box { padding: 16px; background: var(--chip); border-radius: var(--r-md); border: 1px dashed var(--chip-line); }
.add-box h3 { font-size: 15px; margin-bottom: 10px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; border-radius: var(--r-md); background: var(--chip); border: 1px solid var(--line); }
.kpi.lead { background: var(--nav); color: #fff; border-color: var(--nav); }
.kpi .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--nav); }
.kpi.lead .v { color: #fff; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi.lead .k { color: var(--faint); }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell .bar { width: 120px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-cell .bar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(max(20px, env(safe-area-inset-bottom, 0px)) + var(--tabbar)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; align-items: center; pointer-events: none; width: min(560px, calc(100% - 32px)); }
.toast { background: var(--nav); color: #fff; border-radius: 14px; padding: 12px 18px; box-shadow: var(--shadow-lg); font-size: 15px; animation: rise 0.22s ease; text-align: center; display: flex; gap: 10px; align-items: center; }
.toast::before { content: 'i'; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.toast.ok::before { content: '✓'; background: #22C55E; }
.toast.err { background: #7F1D1D; }
.toast.has-act { pointer-events: auto; padding: 8px 8px 8px 18px; }
.toast-act { margin-left: auto; flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: #fff; color: var(--nav); font: inherit; font-weight: 600; cursor: pointer; }
.toast.err::before { content: '!'; background: var(--danger); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- หน้าร้าน: quick wins ---------- */
.to-admin { border: 1px solid var(--line); background: var(--chip); color: var(--muted); border-radius: 12px; min-height: 44px; width: 100%; font-size: 11.5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 500; }
.to-admin .ico { width: 18px; height: 18px; }
.to-admin:active { background: var(--blue-soft); color: var(--blue-dk); }
.search-box { position: relative; display: block; flex: 0 1 360px; min-width: 220px; }
.search-box .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 20px; height: 20px; pointer-events: none; }
.search-box .input { padding-left: 44px; background: #fff; }
.coupon-row .input[type='search'] { text-transform: none; }
.age { margin-top: 6px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.age.late { color: var(--warn); font-weight: 600; }
.q-card.late { border-color: var(--warn-line); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16), var(--shadow); }
.repeat-btn { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 58px; padding: 10px 14px; border-radius: 14px; border: 1px dashed rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.08); color: #fff; }
.repeat-btn .ico { color: #93C5FD; }
.repeat-btn b { display: block; font-size: 15px; font-weight: 600; }
.repeat-btn small { display: block; font-size: 12.5px; color: #CBD5E1; line-height: 1.35; }
.repeat-btn:active { background: rgba(255, 255, 255, 0.16); }

/* ---------- หลังบ้าน: dark sidebar, separate from the white POS rail ---------- */
.app.bo { grid-template-columns: 248px minmax(0, 1fr); }
.bo .topbar { background: var(--nav); color: #E2E8F0; border-right: 0; align-items: stretch; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: 14px; }
.bo .brand { flex-direction: row; align-items: center; gap: 12px; border-bottom-color: rgba(255, 255, 255, 0.1); padding: 4px 4px 14px; }
.logo-tile { width: 52px; height: 52px; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.logo-tile .logo-mark { width: 42px; height: 42px; }
.bo .brand-text { text-align: left; }
.bo .brand-name { display: block; color: #fff; font-size: 16px; }
.bo .brand-sub { color: var(--faint); font-size: 12px; margin-top: 3px; }
.bo .nav { gap: 2px; }
.bo .nav button { flex-direction: row; justify-content: flex-start; min-height: 52px; padding: 0 14px; gap: 12px; font-size: 15px; color: #CBD5E1; border-radius: 12px; text-align: left; }
.bo .nav button .ico { width: 21px; height: 21px; }
.bo .nav button:active { background: var(--nav-2); }
.bo .nav button[aria-current='page'] { background: rgba(255, 255, 255, 0.1); color: #fff; }
.bo .nav button[aria-current='page'] .ico { color: #93C5FD; }
.bo .nav button[aria-current='page']::before { left: -14px; top: 12px; bottom: 12px; background: #60A5FA; }
.bo .nav .count { position: static; margin-left: auto; border: 0; background: #F59E0B; color: var(--nav); }
.bo .rail-foot { border-top-color: rgba(255, 255, 255, 0.1); align-items: stretch; gap: 6px; }
.bo .mode-pill { align-self: flex-start; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); color: #CBD5E1; margin-bottom: 4px; }
.side-btn { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12); background: transparent; color: #E2E8F0; font-size: 14.5px; font-weight: 500; }
.side-btn .ico { width: 20px; height: 20px; color: var(--faint); }
.side-btn:active { background: var(--nav-2); }
.bo .view { padding-top: 22px; }
.bo-stack { display: grid; gap: 16px; }
.bo-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1400px) { .kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.admin-panel .tbl .num, .admin-panel .tbl .btn.sm { white-space: nowrap; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.lead .s { color: #CBD5E1; }
button.link { border: 0; background: none; padding: 0; color: var(--blue-dk); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-row input[type='date'] { min-width: 180px; }
/* 7-day sales: one series, so one hue; today is the dark end of the same ramp */
.chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; height: 210px; align-items: end; padding-top: 8px; }
.chart .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.chart .bar { width: 100%; max-width: 44px; background: var(--blue-line); border-radius: 4px 4px 0 0; transition: background 0.15s; }
.chart .col:hover .bar { background: #93C5FD; }
.chart .col.today .bar { background: var(--blue); }
.chart .val { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart .col.today .val { color: var(--ink); font-weight: 600; }
.chart .lbl { font-size: 12px; color: var(--muted); white-space: nowrap; border-top: 1px solid var(--line); width: 100%; text-align: center; padding-top: 6px; }
.st-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.st-row > div { background: var(--chip); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 2px; }
.st-row b { font-size: 24px; line-height: 1; color: var(--nav); }
.st-row span { font-size: 12px; color: var(--muted); }
.late-list { display: grid; gap: 6px; }
.late-list > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); border: 1px solid var(--warn-line); font-size: 14px; }
.late-list .age { margin: 0; }

/* PIN lock screen */
.app.locked { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.app.locked .topbar { display: none; }
.view.login-view { padding: 0; display: grid; }
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, #E0EAFF 0%, var(--bg) 60%); }
.login-card { width: min(400px, 100%); padding: 22px 22px 18px; display: grid; gap: 12px; text-align: center; }
.login-card h1 { font-size: 26px; font-weight: 700; color: var(--nav); }
.login-logo { width: 68px; height: 68px; margin: 0 auto; }
.login-card .numpad { margin-top: 0; }
.login-card .numpad { gap: 8px; }
.login-card .numpad button { min-height: 60px; }
.login-card .notice { text-align: left; }
.pin-dots { display: flex; justify-content: center; gap: 14px; min-height: 22px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--chip-line); transition: background 0.12s, border-color 0.12s; }
.pin-dots i.on { background: var(--blue); border-color: var(--blue); }
.pin-dots.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .pos { grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
  .q-tile .k { font-size: 12px; }
  .glyph { width: 44px; height: 44px; }
  .glyph svg { width: 28px; height: 28px; }
}
/* iPad portrait & phones: slim top header + bottom tab bar, bill becomes a bottom sheet */
@media (max-width: 960px) {
  :root { --tabbar: 74px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .topbar { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); padding: max(8px, env(safe-area-inset-top, 0px)) var(--gut-r) 8px var(--gut); gap: 12px; overflow: visible; }
  .brand { flex-direction: row; border-bottom: 0; padding: 0; width: auto; gap: 10px; }
  .logo-mark { width: 44px; height: 44px; }
  .brand-text { text-align: left; }
  .brand-name { display: block; font-size: 17px; }
  .rail-foot { flex-direction: row; margin: 0 0 0 auto; border-top: 0; padding: 0; width: auto; gap: 12px; }
  .clock { text-align: right; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; flex-direction: row;
    background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    justify-content: space-around; gap: 4px;
  }
  .nav button { flex: 1 1 0; min-height: 60px; border-radius: 14px; max-width: 160px; }
  .nav button[aria-current='page']::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .nav .count { right: calc(50% - 26px); }
  .view.pos-view { overflow: auto; padding-bottom: calc(110px + var(--tabbar)); }
  .pos { grid-template-columns: minmax(0, 1fr); height: auto; }
  .catalog { overflow: visible; padding: 0; }
  .bill {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    max-height: min(90%, 880px);
    border-radius: 24px 24px 0 0;
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 -20px 50px -20px rgba(15, 23, 42, 0.45);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    visibility: hidden;
  }
  .bill.open { transform: none; visibility: visible; }
  .bill-head { padding-top: 22px; position: relative; }
  .bill-head::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 44px; height: 5px; border-radius: 3px; background: var(--chip-line); }
  .bill-head .sheet-close { display: inline-flex; }
  .sheet-scrim.open { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 54; animation: fade 0.2s ease; }
  .pos-mbar {
    display: flex; position: fixed; z-index: 40;
    left: var(--gut); right: var(--gut-r); bottom: calc(12px + var(--tabbar) + env(safe-area-inset-bottom, 0px));
    align-items: center; justify-content: space-between; gap: 12px;
    background: var(--nav); color: #fff; border-radius: 20px; padding: 10px 10px 10px 18px;
    box-shadow: 0 18px 40px -16px rgba(15, 23, 42, 0.7);
  }
  .pos-mbar b { font-size: 24px; font-variant-numeric: tabular-nums; display: block; line-height: 1.1; }
  .pos-mbar .small { color: #CBD5E1; }
  .pos-mbar .btn { min-width: 170px; }
  .q-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .att, .admin { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { flex-direction: row; overflow-x: auto; position: static; scrollbar-width: none; }
  .admin-nav button { flex: none; }
  .liff-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .liff-side { width: 100%; max-width: 560px; }
  .member-list { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .member-list button { flex: none; min-width: 190px; }
}
/* stacked admin tables */
@media (max-width: 760px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody { display: block; }
  .tbl.stack tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .tbl.stack tr:last-child { border-bottom: 0; }
  .tbl.stack td { display: block; border: 0; padding: 0; width: auto !important; }
  .tbl.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
  .tbl.stack td.full { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --tabbar: 70px; }
  .brand-sub, .clock .d, .mode-pill, .duty { display: none; }
  .logo-mark { width: 40px; height: 40px; }
  .nav button { font-size: 11px; min-height: 56px; }
  .view { padding-top: 14px; }
  .view-head h1 { font-size: 20px; }
  .machine-grid, .addon-grid, .pay-grid { grid-template-columns: minmax(0, 1fr); }
  .machine-grid { gap: 12px; }
  .q-grid { grid-template-columns: minmax(0, 1fr); }
  .q-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-mbar .btn { min-width: 0; }
  .phone { width: 100%; height: 680px; border-radius: 44px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 94%; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .att-actions { grid-template-columns: 1fr; }
  .tbl.stack tr { grid-template-columns: minmax(0, 1fr); }
}
/* back office below landscape iPad: header on top, menu as a scrollable strip (8 items is too many for a tab bar) */
@media (max-width: 1100px) {
  .bo-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .app.bo { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app.bo .topbar { flex-wrap: wrap; row-gap: 10px; padding-bottom: 0; }
  .bo .brand { padding: 0; }
  .logo-tile { width: 44px; height: 44px; border-radius: 12px; }
  .logo-tile .logo-mark { width: 36px; height: 36px; }
  .bo .rail-foot { flex-direction: row; align-items: center; }
  .bo .mode-pill { margin: 0; align-self: center; }
  .side-btn { min-height: 44px; padding: 0 12px; }
  .bo .nav { position: static; order: 3; width: calc(100% + 28px); margin: 0 -14px; padding: 0 14px 10px; flex-direction: row; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; gap: 6px; }
  .bo .nav button { flex: none; width: auto; min-height: 44px; max-width: none; font-size: 14px; white-space: nowrap; }
  .bo .nav button[aria-current='page']::before { display: none; }
  .bo .view { padding-bottom: 32px; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .rail-foot .to-admin { flex-direction: row; width: auto; padding: 0 12px; gap: 6px; font-size: 13px; }
}
@media (max-width: 640px) {
  .bo .side-btn span { display: none; }
  .bo .brand-sub { display: block; }
  .search-box { flex: 1 1 100%; }
  .st-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart { gap: 6px; }
  .chart .val { font-size: 10px; }
  .rail-foot .to-admin span { display: none; }
}

/* ---------- coupons: ticket, editor, LINE claim ---------- */
.ticket { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: stretch; background: #fff; border: 1px solid var(--line); border-radius: 14px; position: relative; overflow: hidden; min-height: 84px; }
.ticket .t-val { background: var(--blue); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 6px; position: relative; }
.ticket .t-val::after { content: ''; position: absolute; right: -1px; top: 8px; bottom: 8px; border-right: 2px dashed rgba(255, 255, 255, 0.55); }
.ticket .t-val b { font-size: 20px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.ticket .t-val small { font-size: 11px; opacity: 0.85; margin-top: 4px; letter-spacing: 0.04em; word-break: break-all; }
.ticket .t-body { padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.ticket .t-title { font-weight: 600; font-size: 15px; color: var(--nav); line-height: 1.3; }
.ticket .t-detail { font-size: 12.5px; color: var(--nav-3); }
.ticket .t-terms, .ticket .t-src { font-size: 12px; color: var(--muted); line-height: 1.35; }
.ticket .t-act { display: flex; align-items: center; padding-right: 10px; }
.ticket.gift .t-val { background: #16A34A; }
.ticket.used, .ticket.off { opacity: 0.55; }
.ticket.used .t-val, .ticket.off .t-val { background: var(--faint); }
.coupon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.coupon-card { padding: 14px; display: grid; gap: 12px; align-content: start; }
.coupon-card.is-off { background: var(--chip); }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cc-stats > div { background: var(--chip); border-radius: 10px; padding: 8px 10px; display: grid; }
.cc-stats b { font-size: 18px; color: var(--nav); line-height: 1.1; }
.cc-stats span { font-size: 11.5px; color: var(--muted); }
.cc-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.flow > div { display: flex; gap: 10px; align-items: flex-start; background: var(--blue-soft); border: 1px solid var(--blue-mid); border-radius: 12px; padding: 12px; }
.flow b { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; font-size: 13px; }
.flow span { font-size: 12.5px; color: var(--nav-3); line-height: 1.4; }
.flow strong { display: block; font-size: 14px; color: var(--nav); font-weight: 600; margin-bottom: 2px; }
.loyalty-set { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.loyalty-set p { flex: 1; min-width: 240px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--chip-line); background: #fff; font-size: 14px; font-weight: 500; color: var(--nav-3); display: inline-flex; align-items: center; gap: 6px; }
.chip span { color: var(--faint); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.on span { color: #BFDBFE; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; background: var(--chip); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { flex: 1 1 auto; min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; font-weight: 500; color: var(--nav-3); padding: 0 12px; }
.seg button.on { background: #fff; color: var(--blue-dk); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); font-weight: 600; }
.trig-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.trig-grid.one { grid-template-columns: minmax(0, 1fr); }
.trig { text-align: left; border: 1px solid var(--chip-line); background: var(--chip); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; min-height: 58px; }
.trig b { font-size: 14px; font-weight: 600; color: var(--nav); }
.trig span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.trig.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.trig.on b { color: var(--blue-dk); }
.trig:disabled { opacity: 0.55; }
.trig.on:disabled { opacity: 1; }
.input.inline { display: inline-block; width: 70px; min-height: 36px; padding: 2px 8px; margin: 0 4px; }
.input.inline.wide { width: 170px; margin: 4px 0 0; }
.claim-toggle { margin-top: 12px; width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 1px solid var(--ok-line); background: var(--ok-soft); border-radius: 12px; padding: 12px; }
.claim-toggle[aria-pressed='false'] { border-color: var(--line); background: var(--chip); }
.claim-toggle .toggle { pointer-events: none; min-height: 0; padding: 0; }
.claim-toggle[aria-pressed='true'] .track { background: var(--blue); }
.claim-toggle[aria-pressed='true'] .track::after { transform: translateX(22px); }
.claim-toggle b { display: block; font-size: 14px; color: var(--nav); }
.claim-toggle small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chips button { width: 52px; height: 46px; border-radius: 12px; border: 1px solid var(--chip-line); background: #fff; font-weight: 500; }
.day-chips button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.modal-body.ce { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ce-form { display: grid; gap: 18px; min-width: 0; }
.ce-form section { display: grid; gap: 4px; }
.ce-form h4, .sub-h { font-size: 15px; font-weight: 600; color: var(--nav); margin: 0 0 8px; }
.form-grid.ce-g { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.ce-preview { position: sticky; top: 0; background: var(--bg); border-radius: 16px; padding: 14px; }
.line-hint { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; background: rgba(6, 199, 85, 0.12); border: 1px solid rgba(6, 199, 85, 0.35); border-radius: 12px; padding: 8px 10px; font-size: 13px; color: #E2E8F0; }
.line-hint > span:nth-child(2) { flex: 1; }
.line-dot { background: #06C755; color: #fff; font-size: 10px; font-weight: 700; border-radius: 6px; padding: 3px 5px; letter-spacing: 0.03em; }
.line-claim { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: center; background: var(--chip); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.line-claim ol { margin: 0; padding-left: 20px; font-size: 14px; display: grid; gap: 6px; }
.qr-mini svg, .qr-big svg { width: 100%; height: auto; display: block; background: #fff; border-radius: 8px; }
.qr-big { width: min(260px, 70vw); }
.line-btn { background: #06C755; border-color: #06C755; color: #fff; }
.liff-gate { display: grid; gap: 12px; text-align: center; padding: 40px 12px; }
.liff-gate h3 { font-size: 18px; }
.liff-banner { width: 100%; border: 0; border-radius: 14px; background: #DCFCE7; color: #166534; font-weight: 600; padding: 12px 14px; display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; }
.liff-body .ticket { flex: none; margin-bottom: 8px; grid-template-columns: 82px minmax(0, 1fr) auto; }
.liff-body .ticket .t-val small { font-size: 9.5px; letter-spacing: 0; }
.liff-body .ticket .t-val b { font-size: 16px; }
.liff-tabs .ic { position: relative; }
.liff-tabs .dot { position: absolute; top: -2px; right: -6px; width: 9px; height: 9px; border-radius: 50%; background: #EF4444; border: 2px solid #fff; }
.hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.hours > div { display: flex; align-items: center; gap: 10px; background: var(--chip); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.hours > div > span:nth-child(2) { flex: 1; min-width: 0; }
.hours small { display: block; color: var(--muted); font-size: 12px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.void-row td { color: var(--faint); }
.void-row td b { text-decoration: line-through; }
.pill.danger { background: var(--danger-soft); border-color: #FECACA; color: var(--danger); }
.btn.danger-text { color: var(--danger); }
@media (max-width: 960px) {
  .modal-body.ce { grid-template-columns: minmax(0, 1fr); }
  .ce-preview { position: static; order: -1; }
  .flow { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .coupon-grid { grid-template-columns: minmax(0, 1fr); }
  .trig-grid, .form-grid.ce-g { grid-template-columns: minmax(0, 1fr); }
  .line-claim { grid-template-columns: 100px minmax(0, 1fr); }
  .ticket { grid-template-columns: 84px minmax(0, 1fr); }
  .ticket .t-act { grid-column: 1 / -1; padding: 0 10px 10px; justify-content: flex-end; }
}
/* LINE (LIFF) page: never let sections shrink inside the scrolling body, size the stamp card for a phone */
.liff-body > * { flex: none; min-width: 0; }
.liff-body .loyalty { padding: 16px; gap: 14px; }
.liff-body .stamps { max-width: 300px; gap: 8px; margin: 0 auto; }
.liff-body .stamp { font-size: 12px; }
.liff-body .stamp.filled, .liff-body .stamp.gift { font-size: 16px; }
.liff-body .loyalty .meta { flex-wrap: wrap; gap: 2px 10px; }
.liff-body .loyalty .sub { overflow-wrap: anywhere; }
.liff-card > div { min-width: 0; overflow-wrap: anywhere; }
.liff-card > div:first-child { gap: 8px; }
.liff-banner { gap: 8px; text-align: left; }
.liff-banner span { flex: none; }
@media (max-width: 640px) {
  /* on a real phone the device frame is noise: the screen itself fills the width */
  .liff-wrap { gap: 16px; }
  .phone { width: 100%; height: min(720px, calc(100dvh - 150px)); min-height: 520px; max-height: none; padding: 0; border-radius: 22px; background: none; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); }
  .phone::before, .liff-status { display: none; }
  .phone-screen { border-radius: 22px; }
  .liff-body { padding: 12px; gap: 10px; }
  .liff-body .ticket { grid-template-columns: 72px minmax(0, 1fr); min-height: 0; }
  .liff-body .ticket .t-act { grid-column: 1 / -1; padding: 0 10px 10px; justify-content: flex-end; }
  .liff-body .ticket .t-body { padding: 10px; }
  .liff-body .ticket .t-title { font-size: 14px; }
  .liff-gate { padding: 28px 8px; }
  .liff-side .member-list button { min-width: 160px; }
}
@media (max-width: 360px) {
  .liff-body .loyalty { padding: 14px 12px; }
  .liff-body .stamps { gap: 6px; }
  .liff-body .loyalty .meta { font-size: 12px; }
  .liff-tabs button { min-height: 50px; }
}
/* ---------- face scan (clock-in + enrollment) ---------- */
.cam .oval { transition: border-color 0.2s; }
.cam .oval[data-step='turn'], .cam .oval[data-step='back'] { border-color: #FBBF24; }
.cam .oval[data-step='send'] { border-color: #34D399; }
.face-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.face-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.face-steps span { text-align: center; font-size: 13px; padding: 7px 4px; border-radius: 10px; background: var(--chip); color: var(--muted); transition: background 0.2s, color 0.2s; }
.face-steps span.on { background: var(--blue); color: #fff; font-weight: 600; }
.face-steps span.done { background: var(--blue-soft); color: var(--blue-dk); }
.face-guide { text-align: center; font-size: 20px; font-weight: 600; color: var(--nav); min-height: 30px; }
.face-guide.warn { color: #B45309; }
.face-guide.err { color: #B91C1C; }
.face-guide.ok { color: #15803D; }
.face-result { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: #fff; background: rgba(21, 128, 61, 0.96); z-index: 3; padding: 20px; }
.face-result.show { display: flex; }
.face-result.out { background: rgba(30, 64, 175, 0.96); }
.face-result.err { background: rgba(153, 27, 27, 0.96); }
.face-result .fr-icon { width: 76px; height: 76px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 700; }
.face-result b { font-size: 30px; line-height: 1.2; }
.face-result span { font-size: 20px; }
.face-result small { font-size: 15px; opacity: 0.9; }
.enroll-cam { max-width: 420px; width: 100%; margin: 0 auto; }
.enroll-progress { display: flex; justify-content: center; gap: 8px; }
.enroll-progress i { width: 34px; height: 8px; border-radius: 4px; background: var(--line); transition: background 0.2s; }
.enroll-progress i.on { background: #16A34A; }
.staff-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.staff-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: grid; gap: 10px; background: #fff; }
.staff-card.off { opacity: 0.6; }
.sc-id { display: flex; gap: 10px; align-items: center; }
.sc-names { flex: 1; min-width: 0; display: grid; gap: 4px; }
.sc-names .input { min-height: 38px; padding: 6px 10px; }
.sc-names .input.small { font-size: 13px; min-height: 32px; }
.sc-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 10px; }
.sc-face { display: grid; gap: 2px; }
.sc-face b { color: #B45309; font-size: 14px; }
.sc-face.ok b { color: #15803D; }
.sc-shift { display: flex; align-items: center; gap: 6px; }
.sc-shift .input { width: 132px; min-height: 38px; }
.day-chips.sm { gap: 4px; }
.day-chips.sm button { width: 34px; height: 34px; border-radius: 9px; font-size: 12px; }
.pill.err { background: #FEE2E2; border-color: #FCA5A5; color: #B91C1C; }
.input.grace { width: 64px; min-height: 32px; padding: 4px 8px; display: inline-block; }
.numpad .primary-fn { background: var(--blue); color: #fff; border-color: var(--blue); }
@media (max-width: 640px) {
  .face-guide { font-size: 17px; }
  .face-result b { font-size: 24px; }
}
.att-armed { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r-md); background: var(--blue-soft); color: var(--blue-dk); font-weight: 600; font-size: 17px; }
.staff-btn:disabled { opacity: 0.5; }
/* queue card: small, out-of-the-way delete (confirm in a modal) */
.q-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.q-del { border: 0; background: none; color: var(--faint, #94A3B8); font-size: 12px; padding: 6px 4px; min-height: 0; border-radius: 8px; }
.q-del:active { color: #B91C1C; background: #FEE2E2; }
.q-actions .btn.primary { min-height: 68px; font-size: 17px; }
.kv-card { background: var(--chip); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }

/* intake KPI and OT */
.kpi-tag { color: var(--muted); }
.kpi-tag.hit { color: #15803D; font-weight: 600; }
.kpi { display: grid; gap: 4px; min-width: 140px; flex: 1; }
.kpi i { display: block; height: 8px; border-radius: 99px; background: var(--line, #E5E7EB); overflow: hidden; }
.kpi i b { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.kpi.hit i b { background: #22C55E; }
.ot-list { display: grid; gap: 8px; }
.ot-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--chip); }
.ot-hours { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ot-hours .pay-opt { min-width: 56px; padding: 0 14px; }
.ot-step { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; }
.ot-step .btn { min-width: 44px; }
.kv-row { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); }
.kv-row b { color: var(--ink, #0F172A); }
.att-cell { display: inline-flex; gap: 8px; align-items: center; }
.att-person tr.absent td { background: #FEF2F2; }

/* device pairing */
.pair-code { font-size: 28px; letter-spacing: 0.3em; text-align: center; }
.pair-code-box { display: grid; gap: 4px; justify-items: center; padding: 14px; border-radius: 14px; background: var(--blue-soft); border: 1px solid var(--blue-line); }
.pair-code-box b { font-size: 36px; letter-spacing: 0.15em; color: var(--blue-dk); }
/* members table: keep the name readable on iPad widths */
.tbl td[data-label="ชื่อ"] .input { min-width: 140px; }

/* ---------- LINE LIFF: customer app (redesign) ---------- */
.lx { --lx-ink: #0F172A; --lx-sub: #64748B; --lx-bg: #F5F7FB; --lx-card: #fff; --lx-acc: #2563EB; --lx-line-green: #06C755; --lx-r: 20px;
  --lx-sh: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -14px rgba(15, 23, 42, 0.22); background: var(--lx-bg); color: var(--lx-ink); }
.lx-i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lx-muted { color: var(--lx-sub); }
.lx-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid rgba(15, 23, 42, 0.06); position: relative; z-index: 2; }
.lx-logo { width: 34px; height: 34px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06); }
.lx-bar-t { display: grid; line-height: 1.15; min-width: 0; flex: 1; }
.lx-bar-t b { font-size: 15px; font-weight: 600; }
.lx-bar-t small { font-size: 11.5px; color: var(--lx-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-oa { font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--lx-line-green); background: rgba(6, 199, 85, 0.1); padding: 4px 8px; border-radius: 99px; flex: none; }
.lx-body { flex: 1; overflow: auto; padding: 18px 16px 24px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.lx-body > * { flex: none; min-width: 0; }
.lx-anim > * { animation: lx-up 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.lx-anim > *:nth-child(2) { animation-delay: 0.04s; } .lx-anim > *:nth-child(3) { animation-delay: 0.08s; } .lx-anim > *:nth-child(4) { animation-delay: 0.12s; } .lx-anim > *:nth-child(n + 5) { animation-delay: 0.16s; }
@keyframes lx-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.lx-hello { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lx-hello span { font-size: 13px; }
.lx-hello h3, .lx-title h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.lx-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lx-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px; color: var(--lx-acc); background: linear-gradient(135deg, #EFF6FF, #DBEAFE); box-shadow: inset 0 0 0 1px #BFDBFE; flex: none; }

/* hero stamp card */
.lx-card-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 20px 18px 18px; color: #fff; display: grid; gap: 16px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(96, 165, 250, 0.45), transparent 55%), linear-gradient(145deg, #1E3A8A 0%, #1E293B 70%);
  box-shadow: 0 18px 40px -18px rgba(30, 58, 138, 0.65); }
.lx-wm { position: absolute; right: -34px; bottom: -40px; width: 180px; height: 180px; opacity: 0.08; pointer-events: none; filter: grayscale(1) brightness(3); }
.lx-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: relative; }
.lx-eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #BFDBFE; font-weight: 500; }
.lx-hero-n { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.lx-hero-n b { font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.lx-hero-n span { font-size: 14px; color: #CBD5E1; }
.lx-member { font-size: 12px; color: #CBD5E1; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.lx-stamps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; position: relative; }
.lx-stamp { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.5); font-size: 13px; }
.lx-stamp b { font-weight: 500; }
.lx-stamp .lx-i { width: 52%; height: 52%; }
.lx-stamp.on { border: 0; background: #fff; color: var(--lx-acc); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.45); }
.lx-stamp.on .lx-i { stroke-width: 2.6; }
.lx-stamp.gift { border-style: solid; border-color: rgba(251, 191, 36, 0.75); color: #FCD34D; background: rgba(251, 191, 36, 0.1); }
.lx-stamp.gift.on { background: linear-gradient(135deg, #FDE68A, #F59E0B); color: #78350F; }
.lx-anim .lx-stamp.on { animation: lx-pop 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both; animation-delay: calc(var(--i) * 0.035s + 0.15s); }
@keyframes lx-pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.lx-progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.lx-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #93C5FD, #fff); transition: width 0.6s ease; }
.lx-hero-foot { font-size: 13.5px; color: #E2E8F0; margin: -4px 0 0; }
.lx-hero-foot b { color: #fff; font-size: 15px; }

.lx-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-radius: 18px; padding: 12px 14px; cursor: pointer; font: inherit;
  background: linear-gradient(120deg, #FFF7ED, #FEF3C7); color: #7C2D12; box-shadow: inset 0 0 0 1px #FDE68A; }
.lx-banner span:nth-child(2) { flex: 1; display: grid; min-width: 0; }
.lx-banner b { font-size: 14.5px; font-weight: 600; }
.lx-banner small { font-size: 12px; color: #9A3412; opacity: 0.8; }
.lx-banner-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: #EA580C; flex: none; box-shadow: 0 4px 10px -6px rgba(234, 88, 12, 0.6); }
.lx-banner .chev { width: 18px; height: 18px; }

.lx-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lx-stats div { background: var(--lx-card); border-radius: 16px; padding: 12px 10px; display: grid; gap: 2px; box-shadow: var(--lx-sh); text-align: center; }
.lx-stats b { font-size: 20px; font-weight: 600; }
.lx-stats span { font-size: 11.5px; color: var(--lx-sub); line-height: 1.25; }
.lx-h { font-size: 13px; font-weight: 600; color: var(--lx-sub); letter-spacing: 0.02em; margin: 6px 2px -4px; }

/* laundry order + timeline */
.lx-order { background: var(--lx-card); border-radius: var(--lx-r); padding: 16px; display: grid; gap: 14px; box-shadow: var(--lx-sh); }
.lx-order.ready { box-shadow: var(--lx-sh), inset 0 0 0 1.5px #86EFAC; }
.lx-order-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lx-order-top > div { display: grid; }
.lx-q { font-size: 17px; font-weight: 600; }
.lx-state { font-size: 12.5px; font-weight: 600; color: var(--lx-acc); background: #EFF6FF; padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.lx-order.ready .lx-state { color: #15803D; background: #F0FDF4; }
.lx-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.lx-steps li { display: grid; justify-items: center; gap: 4px; position: relative; text-align: center; min-width: 0; }
.lx-steps li::before { content: ''; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: #E2E8F0; }
.lx-steps li:first-child::before { display: none; }
.lx-steps li.done::before, .lx-steps li.now::before { background: var(--lx-acc); }
.lx-steps .dot { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid #CBD5E1; display: grid; place-items: center; position: relative; z-index: 1; color: #fff; }
.lx-steps .dot .lx-i { width: 14px; height: 14px; stroke-width: 3; }
.lx-steps li.done .dot { background: var(--lx-acc); border-color: var(--lx-acc); }
.lx-steps li.now .dot { border-color: var(--lx-acc); box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.15); }
.lx-steps li.now .dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--lx-acc); }
.lx-order.ready .lx-steps li.now .dot { border-color: #16A34A; box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.16); }
.lx-order.ready .lx-steps li.now .dot::after { background: #16A34A; }
.lx-steps .lb { font-size: 11px; color: var(--lx-sub); line-height: 1.2; }
.lx-steps li.now .lb { color: var(--lx-ink); font-weight: 600; }
.lx-steps .tm { font-size: 10.5px; color: #94A3B8; font-variant-numeric: tabular-nums; min-height: 13px; }
@media (prefers-reduced-motion: no-preference) {
  .lx-steps li.now .dot { animation: lx-ping 2s ease-out infinite; }
}
@keyframes lx-ping { 0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35); } 100% { box-shadow: 0 0 0 9px rgba(37, 99, 235, 0); } }
.lx-items { margin: 0; font-size: 12.5px; color: var(--lx-sub); overflow-wrap: anywhere; }
.lx-ready { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: #166534; background: #F0FDF4; border-radius: 12px; padding: 10px 12px; }
.lx-ready .lx-i { width: 18px; height: 18px; stroke-width: 2.6; }

/* coupon wallet */
.lx-coupon { display: grid; grid-template-columns: 92px minmax(0, 1fr); background: var(--lx-card); border-radius: 18px; box-shadow: var(--lx-sh); overflow: hidden; position: relative; }
.lx-coupon::before, .lx-coupon::after { content: ''; position: absolute; left: 83px; width: 18px; height: 18px; border-radius: 50%; background: var(--lx-bg); }
.lx-coupon::before { top: -9px; } .lx-coupon::after { bottom: -9px; }
.lx-cv { display: grid; place-content: center; text-align: center; gap: 2px; padding: 14px 8px; color: #fff; background: linear-gradient(160deg, #3B82F6, #1D4ED8); border-right: 2px dashed rgba(255, 255, 255, 0.55); }
.lx-cv b { font-size: 18px; font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }
.lx-cv small { font-size: 10px; letter-spacing: 0.06em; opacity: 0.85; overflow-wrap: anywhere; }
.lx-coupon.offer .lx-cv { background: linear-gradient(160deg, #FB923C, #EA580C); }
.lx-coupon.pending .lx-cv { background: linear-gradient(160deg, #22C55E, #15803D); }
.lx-coupon.collect .lx-cv { background: linear-gradient(160deg, #A78BFA, #7C3AED); }
.lx-coupon.used { box-shadow: none; outline: 1px solid #E2E8F0; }
.lx-coupon.used .lx-cv { background: #CBD5E1; }
.lx-coupon.used .lx-cb { opacity: 0.6; }
.lx-cb { padding: 12px 14px 12px 16px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.lx-cb h5 { font-size: 15px; font-weight: 600; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.lx-cb p { margin: 0; font-size: 12px; color: var(--lx-sub); line-height: 1.4; overflow-wrap: anywhere; }
.lx-cb .lx-hint { color: #15803D; font-weight: 500; }
.lx-tag { justify-self: start; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #EFF6FF; color: #1D4ED8; }
.lx-tag.offer { background: #FFF7ED; color: #C2410C; } .lx-tag.pending { background: #F0FDF4; color: #15803D; } .lx-tag.collect { background: #F5F3FF; color: #6D28D9; } .lx-tag.used { background: #F1F5F9; color: #64748B; }
.lx-ca { display: flex; justify-content: flex-end; margin-top: 6px; }
.lx-btn { min-height: 40px; padding: 0 18px; border-radius: 99px; border: 1px solid #CBD5E1; background: #fff; color: var(--lx-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 0.12s ease, background 0.2s; }
.lx-btn.primary { background: var(--lx-acc); border-color: var(--lx-acc); color: #fff; box-shadow: 0 6px 14px -8px rgba(37, 99, 235, 0.9); }
.lx-btn:active { transform: scale(0.97); }
.lx-coupon.offer .lx-btn.primary { background: #EA580C; border-color: #EA580C; box-shadow: 0 6px 14px -8px rgba(234, 88, 12, 0.9); }

/* history */
.lx-list { background: var(--lx-card); border-radius: var(--lx-r); box-shadow: var(--lx-sh); overflow: hidden; }
.lx-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.lx-row + .lx-row { border-top: 1px solid #EEF2F7; }
.lx-row-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #F1F5F9; color: #475569; flex: none; }
.lx-row-b { flex: 1; display: grid; min-width: 0; }
.lx-row-b b { font-size: 14.5px; font-weight: 600; }
.lx-row-b small { font-size: 12px; color: var(--lx-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-row > .num { font-weight: 600; }

.lx-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 26px 16px; color: var(--lx-sub); font-size: 13.5px; background: var(--lx-card); border-radius: var(--lx-r); box-shadow: var(--lx-sh); }
.lx-empty .lx-i { width: 28px; height: 28px; color: #94A3B8; }

/* add-friend gate */
.lx-gate { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 18px 4px 8px; }
.lx-gate-logo { width: 96px; height: 96px; border-radius: 28px; background: #fff; display: grid; place-items: center; box-shadow: var(--lx-sh); }
.lx-gate-logo .logo-mark { width: 72px; height: 72px; }
.lx-gate h3 { font-size: 22px; font-weight: 600; margin-bottom: -10px; }
.lx-gate p { margin: 0; font-size: 13px; }
.lx-gift-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #C2410C; background: #FFF7ED; padding: 6px 12px; border-radius: 99px; }
.lx-gift-note .lx-i { width: 16px; height: 16px; }
.lx-benefits { list-style: none; margin: 4px 0; padding: 4px 14px; width: 100%; text-align: left; background: var(--lx-card); border-radius: var(--lx-r); box-shadow: var(--lx-sh); }
.lx-benefits li { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.lx-benefits li + li { border-top: 1px solid #EEF2F7; }
.lx-benefits .lx-i { width: 36px; height: 36px; padding: 8px; border-radius: 11px; background: #EFF6FF; color: var(--lx-acc); }
.lx-benefits span { display: grid; font-size: 12.5px; color: var(--lx-sub); }
.lx-benefits b { font-size: 14px; color: var(--lx-ink); font-weight: 600; }
.lx-line-btn { width: 100%; min-height: 52px; border: 0; border-radius: 16px; background: var(--lx-line-green); color: #fff; font: inherit; font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; box-shadow: 0 10px 22px -12px rgba(6, 199, 85, 0.9); }
.lx-line-btn .lx-i { fill: #fff; stroke: none; }

/* bottom tab bar */
.lx-tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid rgba(15, 23, 42, 0.06); padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
.lx-tabs button { border: 0; background: none; font: inherit; font-size: 11.5px; color: #94A3B8; display: grid; justify-items: center; gap: 2px; min-height: 52px; padding-top: 4px; cursor: pointer; }
.lx-tabs .ic { position: relative; width: 52px; height: 30px; border-radius: 99px; display: grid; place-items: center; transition: background 0.2s; }
.lx-tabs button.on { color: var(--lx-acc); font-weight: 600; }
.lx-tabs button.on .ic { background: #EFF6FF; }
.lx-tabs .badge { position: absolute; top: -3px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #EF4444; color: #fff; font-size: 10px; font-style: normal; font-weight: 600; display: grid; place-items: center; border: 2px solid #fff; }

@media (max-width: 640px) {
  .lx-body { padding: 16px 14px 22px; }
}
@media (max-width: 360px) {
  .lx-body { padding: 14px 12px 20px; gap: 12px; }
  .lx-card-hero { padding: 16px 14px; border-radius: 20px; }
  .lx-stamps { gap: 7px; }
  .lx-hero-n b { font-size: 34px; }
  .lx-coupon { grid-template-columns: 78px minmax(0, 1fr); }
  .lx-coupon::before, .lx-coupon::after { left: 69px; }
  .lx-cv b { font-size: 16px; }
  .lx-stats b { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .lx-anim > *, .lx-anim .lx-stamp.on { animation: none; }
  .lx-progress i, .lx-btn { transition: none; }
}
