/* Layout: one column, phone-first; sticky header, fixed action bar + bottom nav. */
:root {
  --bg: #f2f5f1;
  --card: #ffffff;
  --ink: #15211b;
  --muted: #5b6a61;
  --line: #dbe3dd;
  --brand: #0d6b45;
  --brand-dark: #084a30;
  --brand-soft: #e2f1e9;
  --ok: #157f3c;
  --ok-bg: #dcf7e4;
  --warn: #a55306;
  --warn-bg: #fff1cc;
  --danger: #c3261f;
  --danger-bg: #fde7e5;
  --nav-h: 68px;
  --bar-h: 88px;
  --radius: 16px;
  font-size: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.boot { padding: 2rem; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
bdi { unicode-bidi: isolate; }

/* ---------- Structure ---------- */
.app { min-height: 100dvh; padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px)); }
.app.has-nav { padding-bottom: calc(var(--nav-h) + var(--bar-h) + env(safe-area-inset-bottom, 0px)); }
.app.no-bar { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.app.has-nav.no-bar { padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px)); }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  min-height: 60px;
  padding: 6px max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
  background: var(--brand); color: #fff;
}
.top h1 { flex: 1; margin: 0; font-size: 1.25rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .icon-btn { color: #fff; }
.top .icon-btn:active { background: rgba(255,255,255,.16); }

.page {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 640px; margin: 0 auto;
  padding-block: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; gap: 10px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(242,245,241,.96);
  border-top: 1px solid var(--line);
}
.bar > * { flex: 1; }
.bar > .btn.ghost { flex: 0 0 auto; }
.has-nav .bar { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: 12px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff; border-top: 1px solid var(--line);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: .9rem;
}
.nav a.on { color: var(--brand); }
.nav a.on svg { background: var(--brand-soft); border-radius: 999px; padding: 3px 16px; box-sizing: content-box; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 10px 18px;
  border: 2px solid transparent; border-radius: 14px;
  background: var(--brand); color: #fff;
  font-weight: 800; font-size: 1.05rem; text-align: center;
}
.btn:active { transform: translateY(1px); background: var(--brand-dark); }
.btn.big { min-height: 64px; font-size: 1.2rem; border-radius: 16px; }
.btn.secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn.secondary:active { background: var(--brand-soft); }
.btn.success { background: var(--ok); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; flex: none;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink);
}
.icon-btn.danger { color: var(--danger); }
.icon-btn:active { background: var(--brand-soft); }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.field small { color: var(--muted); font-weight: 600; }
.input, .field input {
  width: 100%; min-height: 58px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 14px; background: #fff;
  font-size: 1.1rem; font-weight: 600;
}
.field input:focus, .input:focus { border-color: var(--brand); outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-top: -4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 42px; padding: 4px 16px;
  border: 2px solid var(--line); border-radius: 999px; background: #fff;
  font-weight: 700;
}
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

.chips.wrap { flex-wrap: wrap; overflow: visible; margin-top: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip svg { color: var(--brand); }
.dot { display: inline-block; width: 16px; height: 16px; flex: none; border-radius: 999px; border: 1px solid rgba(0,0,0,.25); vertical-align: middle; }
.add-own { display: flex; gap: 8px; }
.add-own .input { min-height: 50px; font-size: 1rem; }
.add-own .btn { min-height: 50px; padding-inline: 16px; flex: none; }
.combos { display: flex; flex-direction: column; gap: 8px; }
.combo { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.combo-l { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .95rem; line-height: 1.3; }
.stepper.sm { gap: 5px; flex: none; }
.stepper.sm button { width: 42px; height: 44px; font-size: 1.4rem; border-radius: 12px; }
.stepper.sm input { width: 54px; min-height: 44px; font-size: 1.2rem; border-radius: 12px; }
.combo .icon-btn { width: 40px; height: 44px; }
.total-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; }
.vsum { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .92rem; }
.vsum .dot { width: 13px; height: 13px; }
.vrow { width: 100%; text-align: start; font: inherit; cursor: pointer; }
.vrow .code { margin: 0; }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 60px; height: 60px; flex: none;
  border: 2px solid var(--brand); border-radius: 14px; background: #fff; color: var(--brand);
  font-size: 1.8rem; font-weight: 800; line-height: 1;
}
.stepper button:active { background: var(--brand-soft); }
.stepper input {
  width: 110px; min-height: 60px; text-align: center;
  border: 2px solid var(--line); border-radius: 14px; background: #fff;
  font-size: 1.6rem; font-weight: 800;
}
.stepper input:focus { border-color: var(--brand); outline: none; }

.search { position: relative; display: block; }
.search svg { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-right: 48px; }

.error { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-weight: 700; }
.note { padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); color: #6b3a04; font-weight: 600; }
.okbox { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: var(--ok-bg); color: var(--ok); font-weight: 800; font-size: 1.15rem; }
.link { align-self: center; border: 0; background: none; padding: 10px; font-weight: 700; color: var(--brand); text-decoration: underline; }
.link.danger { color: var(--danger); }

/* ---------- Cards & lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none;
}
.item:active { background: #f7faf8; }
.item .qr { flex: none; border-radius: 6px; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.grow b { font-size: 1.1rem; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.badge { flex: none; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: .95rem; background: var(--brand-soft); color: var(--brand-dark); white-space: nowrap; }
.badge.low { background: var(--warn-bg); color: var(--warn); }
.badge.out { background: var(--danger-bg); color: var(--danger); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); font-weight: 600; }
.empty svg { color: var(--brand); margin-bottom: 6px; }
.empty b { display: block; color: var(--ink); font-size: 1.15rem; }
.sec { margin: 6px 0 0; font-size: 1.1rem; font-weight: 800; }
.summary { margin: 0; color: var(--muted); font-weight: 600; }

.detail { display: flex; gap: 14px; align-items: center; }
.detail h2 { margin: 0; font-size: 1.35rem; line-height: 1.3; }
.code { margin: 4px 0 0; font: 700 .95rem/1.2 ui-monospace, Consolas, monospace; color: var(--muted); text-align: right; }
.stock { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.stock strong { font-size: 1.4rem; color: var(--brand-dark); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Sale ---------- */
.scan-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 150px; border: 0; border-radius: 22px;
  background: var(--brand); color: #fff; font-size: 1.7rem; font-weight: 900;
  box-shadow: 0 6px 18px rgba(13,107,69,.28);
}
.scan-btn:active { background: var(--brand-dark); }
.manual-btn {
  display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 18px;
  border: 2px solid var(--brand); border-radius: 18px; background: #fff; color: var(--brand); text-align: start;
}
.manual-btn:active { background: var(--brand-soft); }
.manual-btn b { display: block; font-size: 1.2rem; font-weight: 900; }
.manual-btn small { display: block; color: var(--muted); font-weight: 600; font-size: .9rem; }
.note-soft { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.mlines { display: flex; flex-direction: column; gap: 10px; }
.mline { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.mtop { display: flex; align-items: center; gap: 8px; }
.mtop .input { flex: 1; min-width: 0; min-height: 52px; }
.mnum { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 900; font-size: .9rem; }
.mqty { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-inline-start: 38px; font-weight: 700; color: var(--muted); }
.add-line { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; border: 2px dashed var(--brand); border-radius: 14px; background: transparent; color: var(--brand); font-weight: 800; font-size: 1.05rem; }
.add-line:active { background: var(--brand-soft); }

.cam { position: relative; height: 42vh; min-height: 260px; max-height: 420px; border-radius: 22px; overflow: hidden; background: #0b1410; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .frame { position: absolute; top: 50%; left: 50%; width: min(62%, 240px); aspect-ratio: 1; transform: translate(-50%, -58%); border: 4px solid rgba(255,255,255,.85); border-radius: 22px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); }
.cam .frame.ok { border-color: #4ade80; }
.cam .frame.warn { border-color: #fbbf24; }
.cam .frame.error { border-color: #f87171; }
.cam-msg { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; padding: 14px 16px 84px; overflow-y: auto; text-align: center; color: #fff; font-weight: 700; font-size: .92rem; line-height: 1.45; background: rgba(8,20,14,.85); }
.cam-msg .btn { min-height: 48px; justify-self: center; }
.cam-msg ol { text-align: right; margin: 0; padding-right: 20px; font-weight: 600; }
.cam-ctl { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 10px; }
.cam-stop { flex: 1; min-height: 56px; border: 0; border-radius: 14px; background: #fff; color: var(--danger); font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 8px; }
.cam-btn { width: 56px; height: 56px; border: 0; border-radius: 14px; background: rgba(255,255,255,.92); color: var(--ink); display: grid; place-items: center; }
.cam-btn.on { background: #fde68a; }
.fb { position: absolute; top: 12px; left: 12px; right: 12px; padding: 12px 14px; border-radius: 14px; font-weight: 800; font-size: 1.1rem; color: #fff; text-align: center; }
.fb small { display: block; font-weight: 600; font-size: .9rem; opacity: .95; }
.fb.ok { background: var(--ok); }
.fb.warn { background: #b45309; }
.fb.error { background: var(--danger); }

.line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px; }
.line .grow { flex: 1 1 100%; }
.line .grow b { white-space: normal; }
.line .icon-btn { margin-inline-start: auto; }
.line.bad { border-color: var(--danger); background: var(--danger-bg); }
.line.flash { border-color: var(--ok); box-shadow: 0 0 0 3px #86efac; }
.warn-text { color: var(--danger); font-weight: 700; font-size: .95rem; }
.qty { display: flex; align-items: center; gap: 6px; flex: none; }
.qty button { width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-size: 1.4rem; font-weight: 800; line-height: 1; }
.qty span { min-width: 32px; text-align: center; font-size: 1.3rem; font-weight: 900; }

.amount { position: relative; }
.amount input { width: 100%; min-height: 84px; padding: 8px 90px 8px 16px; border: 3px solid var(--brand); border-radius: 18px; background: #fff; font-size: 2.4rem; font-weight: 900; text-align: center; }
.amount input:focus { outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
.amount span { position: absolute; top: 50%; right: 18px; transform: translateY(-50%); font-weight: 800; font-size: 1.2rem; color: var(--muted); }
.big-label { font-size: 1.25rem; font-weight: 900; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.sum-row:last-child { border-bottom: 0; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.seg button { min-height: 46px; border: 0; border-radius: 10px; background: transparent; font-weight: 800; color: var(--muted); }
.seg button.on { background: var(--brand); color: #fff; }

/* ---------- Sheets / dialogs ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(10,20,15,.45); }
.sheet {
  width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 14px;
  padding: 20px max(18px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  background: #fff; border-radius: 24px 24px 0 0;
}
.sheet h2 { margin: 0; font-size: 1.3rem; }
.sheet p { margin: 0; color: var(--muted); font-weight: 600; }
.sheet .row { display: flex; gap: 10px; }
.sheet .row > * { flex: 1; }

#toasts { position: fixed; top: calc(70px + env(safe-area-inset-top, 0px)); left: 16px; right: 16px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 520px; padding: 12px 18px; border-radius: 14px; color: #fff; font-weight: 800; background: #1f2a24; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }
.toast.warn { background: #b45309; }

/* ---------- Login / setup ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; padding: 24px 20px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 10px 30px rgba(13,107,69,.08); }
.auth-card h1 { margin: 0; text-align: center; font-size: 1.5rem; font-weight: 900; }
.auth-card > p { margin: -6px 0 4px; text-align: center; }
.auth-logo { align-self: center; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 22px; background: var(--brand); color: #fff; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.tabs button { min-height: 48px; border: 0; border-radius: 10px; background: transparent; font-weight: 800; color: var(--muted); }
.tabs button.on { background: var(--brand); color: #fff; }
.auth-card .hint { margin: -4px 0 0; text-align: center; font-weight: 600; }
.has-badge { position: relative; }
.badge-dot { position: absolute; top: 4px; left: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 900; line-height: 20px; text-align: center; }
.count { display: inline-block; min-width: 26px; padding: 0 8px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .85rem; text-align: center; vertical-align: middle; }
.accounts { display: flex; flex-direction: column; gap: 8px; }
.acc { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.acc.pending { border-color: var(--warn); background: var(--warn-bg); }
.acc .btn { min-height: 44px; padding: 6px 16px; }
.pw { display: flex; gap: 8px; }
.pw .input { flex: 1; min-width: 0; }
.pw-toggle { flex: none; min-width: 74px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-weight: 800; color: var(--muted); }

/* ---------- Settings ---------- */
.logo-box { display: flex; align-items: center; gap: 14px; }
.logo-prev { width: 84px; height: 84px; flex: none; display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 16px; background: #fafcfb; color: var(--muted); overflow: hidden; }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; min-height: 56px; }
.switch input { width: 26px; height: 26px; accent-color: var(--brand); }

/* ---------- Reports ---------- */
.kpis { display: flex; flex-direction: column; gap: 10px; }
.kpi { display: flex; align-items: center; gap: 12px; }
.kpi .grow b { font-size: 1.15rem; }
.kpi .grow small { color: var(--muted); font-weight: 600; font-size: .9rem; }
.kpi strong { flex: none; font-size: 1.55rem; font-weight: 900; line-height: 1.2; color: var(--brand-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi strong small { font-size: .6em; font-weight: 800; }
.rlist { padding-block: 6px; }
.rrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rrow:last-child { border-bottom: 0; }
.rrow b { flex: none; font-variant-numeric: tabular-nums; }
.rlink { color: inherit; text-decoration: none; }
.rlink span { color: var(--brand); font-weight: 700; text-decoration: underline; }
.day { padding: 0; overflow: hidden; }
.day-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px; border: 0; background: none; text-align: start; }
.day-head .grow span { font-size: .9rem; }
.day-amt { flex: none; font-weight: 900; font-size: 1.15rem; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.chev { flex: none; display: grid; color: var(--muted); }
.chev.up { transform: rotate(180deg); }
.day-body { display: flex; flex-direction: column; padding: 4px 14px 14px; border-top: 1px solid var(--line); background: #fafcfb; }
.day-body h3 { margin: 10px 0 2px; font-size: .95rem; color: var(--muted); }
.settings-link { display: flex; align-items: center; gap: 12px; padding: 16px; color: inherit; text-decoration: none; }
.settings-link .ico { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }

/* ---------- Labels (stickers) : A4, 3 x 8 = 24 stickers of 70 x 37 mm ---------- */
.a4 {
  width: 210mm; height: 297mm; padding-top: .5mm;
  display: grid; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm;
  background: #fff; color: #000; overflow: hidden;
  break-after: page; page-break-after: always;
}
.a4:last-child { break-after: auto; page-break-after: auto; }
.stk { display: flex; align-items: center; gap: 3mm; padding: 3.5mm 4mm; overflow: hidden; }
.stk svg { width: 29mm; height: 29mm; flex: none; }
.stk .t { flex: 1; min-width: 0; line-height: 1.25; }
.stk .n { font-size: 11pt; font-weight: 800; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stk .m { font-size: 9pt; font-weight: 600; }
.stk .c { margin-top: 1mm; font: 700 8.5pt/1.2 ui-monospace, Consolas, monospace; direction: ltr; text-align: right; }
.sheet-preview { overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.sheet-preview .stk { outline: 1px dashed #c9d3cc; outline-offset: -1px; }

/* ---------- Receipt ---------- */
.paper-wrap { display: flex; justify-content: center; overflow-x: auto; padding: 4px 0 8px; }
.paper-wrap .receipt { box-shadow: 0 4px 16px rgba(0,0,0,.10); border: 1px solid var(--line); }
.receipt { background: #fff; color: #000; font-family: "Cairo", Tahoma, Arial, sans-serif; line-height: 1.4; }
.receipt.p58 { width: 58mm; padding: 3mm 5mm 6mm; font-size: 9pt; }
.receipt.p80 { width: 80mm; padding: 4mm 5mm 8mm; font-size: 10.5pt; }
.receipt.pa4 { width: 150mm; padding: 10mm; font-size: 13pt; }
.receipt .logo { display: block; margin: 0 auto 2mm; max-width: 60%; max-height: 18mm; object-fit: contain; }
.receipt.pa4 .logo { max-height: 28mm; }
.receipt .store { text-align: center; font-weight: 900; font-size: 1.35em; line-height: 1.3; }
.receipt .info { text-align: center; font-size: .85em; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 2mm 0; }
.receipt .ttl { text-align: center; font-weight: 900; font-size: 1.15em; }
.receipt .row { display: flex; justify-content: space-between; gap: 2mm; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt th { font-weight: 800; text-align: start; border-bottom: 1px solid #000; padding-bottom: .5mm; }
.receipt td { padding: .8mm 0; vertical-align: top; }
.receipt th:last-child, .receipt td:last-child { text-align: end; width: 1%; white-space: nowrap; padding-inline-start: 3mm; font-weight: 800; }
.receipt td small { display: block; font-size: .85em; }
.receipt .total { margin-top: 2.5mm; padding: 1.5mm 2mm; border: 1.5px solid #000; text-align: center; }
.receipt .total b { display: block; font-size: 1.6em; font-weight: 900; line-height: 1.25; }
.receipt .thanks { margin-top: 3mm; text-align: center; font-weight: 700; }
@media (max-width: 640px) { .paper-wrap .receipt.pa4 { zoom: .55; } }

/* ---------- Print ---------- */
#print-root { position: fixed; top: 0; left: 0; width: 0; height: 0; overflow: hidden; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  html, body { background: #fff !important; }
  #print-root { position: static; width: auto; height: auto; overflow: visible; }
  #print-root .receipt { box-shadow: none; border: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
