/* Nyetruk — design system app
   Mobile-first. Layout responsif memakai container query pada #app
   (bukan lebar jendela), supaya bingkai HP di desktop tetap akurat. */

/* ========== Dasar (mobile-native) ========== */
* { box-sizing: border-box; }
html {
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}
button, a, [role="button"], .chip, .tab, .key {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; text-align: inherit; }
input, select, textarea { font: inherit; font-size: var(--text-md); color: var(--text); }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.ph, .ph-fill, .ph-bold { font-size: var(--text-xl); line-height: var(--leading-none); }
.muted { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
input::placeholder { color: var(--text-3); opacity: 1; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }

.press { transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-quick) ease, box-shadow var(--dur-quick) ease; }
.press:active { transform: scale(.97); }

/* ========== Kerangka app ========== */
#app {
  container: app / inline-size;
  position: fixed; inset: 0;
  overflow: hidden;
  background: var(--bg);
}
.app { position: absolute; inset: 0; display: flex; }
.sidebar { display: none; }
.main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.screen { display: none; flex: 1; min-height: 0; flex-direction: column; position: relative; }
.screen.on { display: flex; animation: fadeUp var(--dur-enter) var(--ease-out); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.wrap { padding: 0 var(--space-4); }
.stack { display: grid; gap: var(--space-3); }

#app[data-tabbar="hide"] .tabbar,
#app[data-shell="none"] .tabbar,
#app[data-shell="none"] .sidebar { display: none !important; }

/* ---------- Tab bar mengambang (kaca) ---------- */
.tabbar {
  position: absolute; left: var(--space-3); right: var(--space-3);
  bottom: calc(var(--space-2-5) + var(--safe-b));
  height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-2);
  padding: var(--space-1-5);
  border-radius: var(--r-xl);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-line);
  z-index: var(--z-bar);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-0-5);
  border-radius: var(--radius-6);
  font-size: var(--text-xs); font-weight: var(--weight-label); color: var(--text-2);
  transition: background-color var(--dur-base) ease, color var(--dur-base) ease, transform var(--dur-press) var(--ease-out);
}
.tab:active { transform: scale(.97); }
.tab .ph, .tab .ph-fill { font-size: var(--text-2xl); }
.tab.on { background: var(--primary-soft); color: var(--primary-ink); font-weight: var(--weight-active); }
.tab-space { flex: none; height: calc(var(--tabbar-h) + var(--space-2-5) + var(--space-8) + var(--safe-b)); } /* = tinggi fade: isi terakhir tidak pudar saat mentok */
/* HP: isi layar memudar di belakang tab bar → tab bar tidak bertabrakan dengan konten */
@container app (max-width: 719px) {
#app:not([data-tabbar="hide"]):not([data-shell="none"]) .main .screen > .scroll {
  --fade: calc(var(--tabbar-h) + var(--space-2-5) + var(--safe-b) + var(--space-8));
  -webkit-mask-image: linear-gradient(to bottom, var(--mask-solid) calc(100% - var(--fade)), var(--mask-faint) calc(100% - var(--fade) * .4));
  mask-image: linear-gradient(to bottom, var(--mask-solid) calc(100% - var(--fade)), var(--mask-faint) calc(100% - var(--fade) * .4));
}
}

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; gap: var(--space-3);
  padding: calc(var(--space-4) + var(--safe-t)) var(--space-4) var(--space-3);
  min-height: 68px;
}
.large-title { padding: calc(var(--space-6) + var(--safe-t)) var(--space-4) var(--space-4); }
.large-title h1 { font-size: var(--text-5xl); line-height: var(--leading-tight); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tighter); }
.large-title p { font-size: var(--text-base); color: var(--text-3); margin-top: var(--space-1-5); }
.top h1.small { font-size: var(--text-xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-snug); }
.icon-btn {
  position: relative;
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--text);
}
.icon-btn.ghost { background: transparent; box-shadow: none; }
.icon-btn .dot {
  position: absolute; top: var(--space-1); right: var(--space-0-5);
  min-width: 18px; height: 18px; padding: 0 var(--space-1-25); border-radius: var(--radius-2-25);
  background: var(--danger); color: var(--bg); font-size: var(--text-xs); font-weight: var(--weight-heavy);
  display: grid; place-items: center; line-height: var(--leading-none);
  box-shadow: 0 0 0 2px var(--bg);
}

.store-switch { display: flex; align-items: center; gap: var(--space-2-5); min-width: 0; flex: 1; text-align: left; border-radius: var(--radius-3-5); padding: var(--space-0-5); }
.store-switch .logo { width: 40px; height: 40px; flex: none; }
.store-switch b { display: block; font-size: var(--text-md); font-weight: var(--weight-heavy); line-height: var(--leading-title); overflow-wrap: anywhere; } /* nama panjang turun baris, tidak terpotong */
.store-switch b .ph { vertical-align: -2px; }
.store-switch > .grow { min-width: 0; }
.store-switch small { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-1-5); font-size: var(--text-sm); color: var(--text-3); font-weight: var(--weight-label); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.status-dot.on { background: var(--success); }

/* ---------- Logo ---------- */
/* Pita N: petak tinta + simbol kertas; warna merek tetap di semua tema. Perforasi = warna petak. */
.logo { --logo-cut: var(--logo-ink); display: grid; place-items: center; border-radius: var(--radius-3); background: var(--logo-ink); color: var(--logo-paper); box-shadow: inset 0 0 0 1px var(--line); }
.logo svg { width: 72%; height: 72%; }
.wordmark-type { height: 24px; width: auto; flex: none; color: var(--text); }
.wordmark { display: flex; align-items: center; gap: var(--space-2-5); font-weight: var(--weight-heavy); font-size: var(--text-xl); letter-spacing: var(--tracking-tight); }
.wordmark .logo { width: 36px; height: 36px; border-radius: var(--radius-2-75); }

/* ---------- Input ---------- */
.search {
  display: flex; align-items: center; gap: var(--space-2-5);
  height: 48px; padding: 0 var(--space-1-5) 0 var(--space-3-5);
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  color: var(--text-3);
}
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; height: 100%; }
.search input::placeholder { color: var(--text-3); }
.search .icon-btn { width: 36px; height: 36px; box-shadow: none; background: var(--surface-2); }

.field { display: grid; gap: var(--space-1-5); }
.field > span { font-size: var(--text-sm); font-weight: var(--weight-label); color: var(--text-2); }
.input {
  height: 52px; display: flex; align-items: center; gap: var(--space-2);
  padding: 0 var(--space-3-5); border-radius: var(--r-sm);
  background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
.input input { width: 100%; flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 100%; }
.input .readonly-value { flex: 1; min-width: 0; font-size: var(--text-md); color: var(--text-2); }
.input .pre { color: var(--text-3); font-weight: var(--weight-label); }
.input:focus-within { box-shadow: 0 0 0 2px var(--primary); }
.hint { font-size: var(--text-sm); color: var(--text-3); }
.hint.good { color: var(--success); font-weight: var(--weight-bold); }

/* ---------- Chip & segmented ---------- */
.chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding: var(--space-3) var(--space-4); scroll-padding: var(--space-4); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 var(--space-3-5);
  display: inline-flex; align-items: center; gap: var(--space-1-5);
  border-radius: var(--r-full);
  background: var(--surface); box-shadow: var(--shadow-1);
  font-size: var(--text-base); font-weight: var(--weight-label); color: var(--text-2); white-space: nowrap;
}
.chip .count { font-size: var(--text-xs); font-weight: var(--weight-label); color: var(--text-3); }
.chip.on { background: var(--strong-bg); color: var(--strong-fg); box-shadow: none; font-weight: var(--weight-active); }
.chip.on .count { color: inherit; }

.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-2);
  padding: var(--space-1); border-radius: var(--radius-3-5); background: var(--surface-2);
}
.seg button {
  height: 40px; border-radius: var(--radius-2-5); min-width: 0; padding: 0 var(--space-2); text-align: center; line-height: var(--leading-snug);
  font-size: var(--text-base); font-weight: var(--weight-label); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1-5);
}
.seg button .ph { font-size: var(--text-lg); flex: none; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); font-weight: var(--weight-active); }

.opt-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.opt {
  min-height: 48px; padding: var(--space-2) var(--space-3-5);
  border-radius: var(--radius-3-5); background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  display: inline-flex; flex-direction: column; justify-content: center;
  font-size: var(--text-base); font-weight: var(--weight-bold);
}
.opt small { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-3); }
.opt.on { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.opt.on small { color: var(--primary-ink); }

/* switch */
.switch { width: 52px; height: 32px; border-radius: var(--radius-4); background: var(--surface-3); position: relative; flex: none; transition: background-color var(--dur-base) ease; }
.switch::after { content: ""; position: absolute; top: var(--space-0-75); left: var(--space-0-75); width: 26px; height: 26px; border-radius: 50%; background: var(--switch-thumb); box-shadow: var(--shadow-thumb); transition: transform var(--dur-enter) var(--ease-out); }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* ---------- Tombol ---------- */
.btn {
  height: 52px; padding: 0 var(--space-5);
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-size: var(--text-md); font-weight: var(--weight-heavy); white-space: nowrap;
}
.btn.sm { height: 40px; padding: 0 var(--space-3-5); font-size: var(--text-base); border-radius: var(--radius-3); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:active { background: var(--primary-press); }
.btn.ink { background: var(--strong-bg); color: var(--strong-fg); }
.btn.soft { background: var(--surface-2); color: var(--text); }
.btn.line { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }
.btn .sub { font-weight: var(--weight-medium); opacity: 1; }
.row-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); } /* turun baris kalau kolom sempit (mis. tablet 2 kolom) */
.row-actions > .btn { flex: 1 1 auto; }
.row-actions > .btn.fit { flex: none; }
.pill-btn {
  height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-2-5);
  display: inline-flex; align-items: center; gap: var(--space-1-5);
  background: var(--surface-2); font-size: var(--text-base); font-weight: var(--weight-bold); color: var(--text-2); white-space: nowrap;
}

/* ---------- Kartu & list ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.group { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.cell { display: flex; align-items: center; gap: var(--space-3-5); padding: var(--space-3-5) var(--space-4); min-height: 64px; text-align: left; width: 100%; }
.group > .cell + .cell { box-shadow: inset 0 1px 0 var(--line); }
.cell .ico { width: 36px; height: 36px; border-radius: var(--radius-2-5); display: grid; place-items: center; flex: none; }
.cell .t { font-weight: var(--weight-name); font-size: var(--text-md); }
.cell .d { font-size: var(--text-sm); color: var(--text-3); font-weight: var(--weight-regular); }
.cell .end { text-align: right; flex: none; }
.cell .chev { color: var(--text-3); font-size: var(--text-lg); }
.section-label { font-size: var(--text-sm); font-weight: var(--weight-label); color: var(--text-3); padding: var(--space-5) var(--space-5) var(--space-2-5); }
.thumb { width: 44px; height: 44px; border-radius: var(--radius-3); display: grid; place-items: center; flex: none; font-weight: var(--weight-heavy); }
.thumb .ph { font-size: var(--text-2xl); }

.tag { display: inline-flex; align-items: center; gap: var(--space-1); height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-2); font-size: var(--text-xs); font-weight: var(--weight-bold); white-space: nowrap; }
.tag.ok { background: var(--success-soft); color: var(--success); }
.tag.warn { background: var(--accent-soft); color: var(--accent); }
.tag.low { background: var(--danger-soft); color: var(--danger); }
.tag.info { background: var(--info-soft); color: var(--info); }
.tag.neutral { background: var(--surface-2); color: var(--text-2); }

.banner { display: flex; align-items: center; gap: var(--space-2-5); padding: var(--space-3) var(--space-3-5); border-radius: var(--r-md); font-size: var(--text-base); font-weight: var(--weight-bold); }
.banner.warn { background: var(--accent-soft); color: var(--accent); }
.banner.info { background: var(--info-soft); color: var(--info); }
.banner.ok { background: var(--success-soft); color: var(--success); }

/* pastel kategori */
/* warna kategori → token --catN-tb (latar) / --catN-tf (ikon/teks) di tokens.css */
.t1 { --tb: var(--cat1-tb); --tf: var(--cat1-tf); }
.t2 { --tb: var(--cat2-tb); --tf: var(--cat2-tf); }
.t3 { --tb: var(--cat3-tb); --tf: var(--cat3-tf); }
.t4 { --tb: var(--cat4-tb); --tf: var(--cat4-tf); }
.t5 { --tb: var(--cat5-tb); --tf: var(--cat5-tf); }
.t6 { --tb: var(--cat6-tb); --tf: var(--cat6-tf); }
.t1, .t2, .t3, .t4, .t5, .t6 { background: var(--tb); color: var(--tf); }

/* resep (modul M26): baris bahan dengan kolom takaran */
.recipe-row { align-items: center; }
.recipe-row .field { flex: none; width: var(--space-32); }

/* rekap harian di kasir (M25) */
.recap-card { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3-5); border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.recap-ico { flex: none; width: var(--space-10); height: var(--space-10); border-radius: var(--r-full); display: grid; place-items: center; background: var(--success-soft); color: var(--success); font-size: var(--text-lg); }
.recap-text { flex: 1; min-width: 0; font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text); text-wrap: pretty; }
.recap-wa { flex: none; min-height: 44px; display: inline-flex; align-items: center; gap: var(--space-1-5); padding: 0 var(--space-3-5); border-radius: var(--r-full); background: var(--surface-2); color: var(--text); font-size: var(--text-base); font-weight: var(--weight-label); text-decoration: none; }

/* ---------- Kasir ---------- */
.kasir { display: flex; flex: 1; min-height: 0; }
.kasir-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2-5);
  padding: var(--space-0-5) var(--space-4) var(--space-4);
}
.prod {
  position: relative;
  min-height: 132px;
  background: var(--surface) !important; color: var(--text) !important; box-shadow: var(--shadow-1);
  padding: var(--space-3);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: var(--space-0-5);
  overflow: hidden;
  text-align: left;
}
/* nama di tile sengaja lebih ringan dari nama di daftar: tile dipindai lewat harga (heavy) */
.prod .name { font-size: var(--text-base); font-weight: var(--weight-label); line-height: var(--leading-normal); padding-right: var(--space-7-5); }
.prod .price { font-size: var(--text-md); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-snug); }
.prod .price.long { font-size: var(--text-sm); overflow-wrap: anywhere; } /* harga ratusan juta–miliaran */
/* baris bawah tile: info stok/pilihan + ikon/foto di alur (tidak melayang → tidak menimpa nama/harga) */
.prod-foot { margin-top: auto; padding-top: var(--space-1-5); display: flex; align-items: flex-end; gap: var(--space-2); }
.prod .meta { min-width: 0; font-size: var(--text-xs); font-weight: var(--weight-label); color: var(--text-3); }
.prod .meta.low { color: var(--danger); font-weight: var(--weight-medium); } /* peringatan stok tetap menonjol */
.prod .ico { margin-left: auto; flex: none; font-size: var(--text-2xl); width: 40px; height: 40px; border-radius: var(--radius-3); display: grid; place-items: center; background: var(--tb); color: var(--tf); }
.prod .qty {
  position: absolute; top: var(--space-2); right: var(--space-2);
  min-width: 28px; height: 28px; padding: 0 var(--space-2); border-radius: var(--r-full);
  background: var(--strong-bg); color: var(--strong-fg);
  font-size: var(--text-base); font-weight: var(--weight-heavy); display: grid; place-items: center;
}
.prod.sel { box-shadow: inset 0 0 0 2px var(--primary); }
.prod .var { position: absolute; left: var(--space-3); bottom: var(--space-3); }

.cartbar {
  position: absolute; left: var(--space-3); right: var(--space-3);
  bottom: calc(86px + var(--safe-b));
  height: 60px; padding: 0 var(--space-2) 0 var(--space-4);
  display: flex; align-items: center; gap: var(--space-3);
  border-radius: var(--radius-5);
  background: var(--strong-bg); color: var(--strong-fg);
  box-shadow: var(--shadow-3);
  z-index: var(--z-sticky);
}
.cartbar .count { width: 32px; height: 32px; border-radius: var(--radius-2-5); background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: var(--weight-heavy); font-size: var(--text-base); flex: none; }
.cartbar .tot { flex: 1; text-align: left; line-height: var(--leading-snug); }
.cartbar .tot small { display: block; font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--strong-fg-2); }
.cartbar .tot b { font-size: var(--text-lg); font-weight: var(--weight-heavy); }
.cartbar .go { height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-3-5); background: var(--primary); color: var(--on-primary); font-weight: var(--weight-heavy); display: flex; align-items: center; gap: var(--space-1-5); }
.kasir .scroll { padding-bottom: var(--space-42); }

.cartpanel { display: none; }

/* baris pesanan */
.line:not(.btn) { display: flex; gap: var(--space-3); padding: var(--space-3) 0; align-items: center; } /* baris keranjang (bukan tombol bergaya "line") */
.line:not(.btn) + .line:not(.btn) { box-shadow: inset 0 1px 0 var(--line); }
.line .info { flex: 1; min-width: 0; }
.line .nm { font-weight: var(--weight-name); font-size: var(--text-md); }
.line .meta { font-size: var(--text-sm); color: var(--text-3); }
.line .pr { font-weight: var(--weight-heavy); font-size: var(--text-base); margin-top: var(--space-0-5); }
.stepper { display: flex; align-items: center; flex: none; background: var(--surface-2); border-radius: var(--radius-3); height: 40px; }
.stepper button { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-3); }
.stepper .ph { font-size: var(--text-md); }
.stepper span { min-width: 22px; text-align: center; font-weight: var(--weight-heavy); }
.sum { display: grid; gap: var(--space-1-5); padding: var(--space-3) 0 var(--space-1); }
.kv { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-base); color: var(--text-2); }
.kv.total { color: var(--text); font-weight: var(--weight-heavy); font-size: var(--text-xl); padding-top: var(--space-2); box-shadow: inset 0 1px 0 var(--line); margin-top: var(--space-1); }
/* pemisah sebelum total keranjang: garis perforasi struk */
.kv.total.perf { box-shadow: none; padding-top: var(--space-3); background: var(--perforation) top / 100% var(--perforation-h) no-repeat; }
.kv .good { color: var(--success); font-weight: var(--weight-bold); }

/* ---------- Overlay: sheet / dialog / layar penuh ---------- */
.overlay { position: absolute; inset: 0; z-index: var(--z-overlay); display: none; }
.overlay.on { display: block; }
.overlay .scrim { position: absolute; inset: 0; background: var(--scrim); animation: fade var(--dur-enter) ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 90%;
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-3);
  animation: sheetIn var(--dur-sheet) var(--ease-sheet);
}
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes dialogIn { from { opacity: 0; scale: .96; } }
.grab { width: 40px; height: 5px; border-radius: var(--radius-0-75); background: var(--surface-3); margin: var(--space-2) auto var(--space-0-5); flex: none; }
.sheet-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4) var(--space-2-5); }
.sheet-head h2 { font-size: var(--text-xl); font-weight: var(--weight-heavy); flex: 1; letter-spacing: var(--tracking-snug); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--space-4) var(--space-2); }
.sheet-foot { padding: var(--space-3) var(--space-4) calc(var(--space-3) + var(--safe-b)); box-shadow: inset 0 1px 0 var(--line); }

.fullscreen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); animation: pushIn var(--dur-move) var(--ease-out); }
@keyframes pushIn { from { opacity: 0; transform: translateX(24px); } }
.foot { padding: var(--space-3) var(--space-4) calc(var(--space-3) + var(--safe-b)); }

/* ---------- Bayar ---------- */
.amount-hero { text-align: center; padding: var(--space-1) var(--space-4) var(--space-3-5); }
.amount-hero .lbl { font-size: var(--text-base); font-weight: var(--weight-label); color: var(--text-3); }
.amount-hero .amt { font-size: var(--text-7xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tightest); line-height: var(--leading-tight); }
.methods { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding: 0 var(--space-4) var(--space-3); }
.methods::-webkit-scrollbar { display: none; }
.method {
  flex: none; min-width: 84px; height: 64px; padding: 0 var(--space-3);
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1);
  font-size: var(--text-sm); font-weight: var(--weight-label); color: var(--text-2);
}
.method .ph { font-size: var(--text-2xl); }
.method[aria-selected="true"] { background: var(--strong-bg); color: var(--strong-fg); box-shadow: none; font-weight: var(--weight-active); }
.received { margin: 0 var(--space-4); padding: var(--space-2-5) var(--space-4); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); display: flex; align-items: center; gap: var(--space-3); }
.received .v { font-size: var(--text-3xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tight); flex: 1; }
.received .lbl { font-size: var(--text-sm); font-weight: var(--weight-label); color: var(--text-3); }
.change-pill { display: inline-flex; flex-direction: column; align-items: flex-end; }
.change-pill small { font-size: var(--text-xs); font-weight: var(--weight-label); color: var(--text-3); }
.change-pill b { font-size: var(--text-lg); font-weight: var(--weight-heavy); color: var(--primary-ink); }
.quick { display: flex; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-1); overflow-x: auto; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: none; height: 40px; padding: 0 var(--space-3-5); border-radius: var(--radius-3); background: var(--primary-soft); color: var(--primary-ink); font-weight: var(--weight-heavy); font-size: var(--text-base); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); padding: var(--space-2-5) var(--space-4) 0; }
.key {
  height: 56px; border-radius: var(--radius-3-5);
  background: var(--surface); box-shadow: var(--shadow-1);
  font-size: var(--text-3xl); font-weight: var(--weight-bold);
  display: grid; place-items: center;
  transition: transform var(--dur-instant) var(--ease-out), background-color var(--dur-instant) ease;
}
.key:active { transform: scale(.97); background: var(--surface-2); }
.key.fn { background: transparent; box-shadow: none; }

.qr-card { margin: 0 auto; width: min(100%, 240px); padding: var(--space-4-5); border-radius: var(--r-xl); background: var(--paper-white); color: var(--paper-ink-strong); box-shadow: var(--shadow-2); text-align: center; }
.qr-card svg { width: 100%; height: auto; aspect-ratio: 1; display: block; overflow: hidden; }
.qr-card .m { font-weight: var(--weight-heavy); font-size: var(--text-base); margin-top: var(--space-2-5); }
.qr-card .s { font-size: var(--text-xs); color: var(--paper-ink-muted); }

/* sukses */
.success { text-align: center; padding: var(--space-3) var(--space-4) var(--space-1-5); }
.check {
  width: 72px; height: 72px; margin: 0 auto var(--space-3); border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center;
  animation: pop var(--dur-slow) var(--ease-out);
}
.check .ph-bold { font-size: var(--text-6xl); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.success h2 { font-size: var(--text-xl); font-weight: var(--weight-heavy); }
.success .big { font-size: var(--text-7xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tightest); line-height: var(--leading-tight); margin-top: var(--space-0-5); }
.success p { color: var(--text-3); font-size: var(--text-base); font-weight: var(--weight-medium); }
.receipt {
  margin: var(--space-3-5) var(--space-4) 0; padding: var(--space-4) var(--space-4) var(--space-5-5);
  background: var(--paper); color: var(--paper-ink);
  font-family: var(--mono); font-size: var(--text-xs); line-height: var(--leading-mono);
  border-radius: var(--radius-2) var(--radius-2) 0 0;
  box-shadow: var(--shadow-1);
  /* tepi bawah sobek (motif struk) */
  -webkit-mask: var(--tear-mask);
          mask: var(--tear-mask);
}
.receipt .c { text-align: center; }
.receipt .b { font-weight: var(--weight-bold); }
.receipt .r { display: flex; justify-content: space-between; gap: var(--space-2); }
.receipt hr { border: 0; border-top: 1px dashed var(--paper-rule); margin: var(--space-2) 0; }

/* scan */
.camera { position: absolute; inset: 0; background: var(--media-bg); box-shadow: inset 0 0 160px var(--media-vignette); color: var(--media-fg); display: flex; flex-direction: column; }
.camera .top { color: var(--media-fg); }
.camera .icon-btn { background: var(--media-glass); color: var(--media-fg); box-shadow: none; backdrop-filter: blur(12px); }
.viewfinder { position: relative; width: min(78%, 320px); aspect-ratio: 1.5; margin: 12vh auto 0; }
.viewfinder i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--media-fg); }
.viewfinder i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: var(--radius-3-5) 0 0 0; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 var(--radius-3-5) 0 0; }
.viewfinder i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 var(--radius-3-5); }
.viewfinder i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 var(--radius-3-5) 0; }
.viewfinder .laser { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: var(--scan-laser); box-shadow: 0 0 12px var(--scan-laser); animation: scanline var(--dur-scan) ease-in-out infinite alternate; }
@keyframes scanline { from { transform: translateY(-40px); } to { transform: translateY(40px); } }
.scan-hint { text-align: center; font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--media-fg-soft); margin-top: var(--space-4-5); }
.scan-toast { margin: auto var(--space-4) var(--space-3); padding: var(--space-3) var(--space-3-5); border-radius: var(--r-md); background: var(--media-card); color: var(--paper-ink-strong); display: flex; align-items: center; gap: var(--space-3); box-shadow: var(--shadow-3); }
.scan-toast b { font-size: var(--text-base); display: block; }
.scan-toast small { font-size: var(--text-sm); color: var(--paper-ink-muted); }
.camera .foot .btn.soft { background: var(--media-glass); color: var(--media-fg); backdrop-filter: blur(12px); }

/* PIN */
.pin { display: flex; flex-direction: column; align-items: center; padding: calc(var(--space-6) + var(--safe-t)) var(--space-4) 0; flex: 1; }
.people { display: flex; gap: var(--space-3); justify-content: center; margin-top: var(--space-4-5); }
.person { display: flex; flex-direction: column; align-items: center; gap: var(--space-1-5); font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--text-2); width: 72px; }
.person .av { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: var(--weight-heavy); font-size: var(--text-lg); }
.person.on .av { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary); }
.person.on { color: var(--text); }
.dots { display: flex; gap: var(--space-3-5); margin: var(--space-6-5) 0 var(--space-2); }
.dots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-strong); }
.dots i.f { background: var(--text); box-shadow: none; }
.pin .keypad { width: 100%; max-width: 360px; padding: var(--space-4-5) 0 0; }
.pin .key { height: 64px; border-radius: 50%; width: 64px; justify-self: center; }

/* welcome / onboarding */
.hero-art { position: relative; height: 300px; margin: 0 var(--space-4); border-radius: var(--r-xl); overflow: hidden; background: linear-gradient(160deg, var(--primary-soft), var(--surface) 70%); }
.hero-art .r1, .hero-art .r2 { position: absolute; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.hero-art .r1 { left: var(--space-4-5); right: 70px; top: 34px; padding: var(--space-3-5); }
.hero-art .r2 { right: var(--space-4-5); width: 150px; bottom: var(--space-6-5); padding: var(--space-3-5); }
.hero-art .r3 { position: absolute; left: var(--space-4-5); bottom: var(--space-6-5); width: 160px; padding: var(--space-3); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-2); display: flex; gap: var(--space-2-5); align-items: center; }
.hero-art .r3 b { display: block; font-size: var(--text-sm); }
.hero-art .r3 small { font-size: var(--text-xs); color: var(--accent); font-weight: var(--weight-bold); }
.ob { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ob-body { padding: var(--space-5) var(--space-5) 0; }
.ob-body h1 { font-size: var(--text-5xl); line-height: var(--leading-tight); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tightest); }
.ob-body p.lead { color: var(--text-2); margin-top: var(--space-2-5); }
.progress { display: flex; gap: var(--space-1-5); padding: calc(var(--space-4) + var(--safe-t)) var(--space-5) 0; }
.progress i { flex: 1; height: 4px; border-radius: var(--radius-0-5); background: var(--surface-3); }
.progress i.on { background: var(--primary); }
.choice { display: flex; gap: var(--space-3-5); align-items: flex-start; text-align: left; padding: var(--space-4); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); width: 100%; }
.choice.on { box-shadow: inset 0 0 0 2px var(--primary), var(--shadow-1); }
.choice .ico { width: 44px; height: 44px; border-radius: var(--radius-3-5); display: grid; place-items: center; flex: none; }
.choice .ico .ph { font-size: var(--text-2xl); }
.choice .t { font-weight: var(--weight-heavy); font-size: var(--text-md); display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.choice .d { color: var(--text-2); font-size: var(--text-base); margin-top: var(--space-0-5); display: block; }
.radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-strong); flex: none; margin-top: var(--space-0-5); display: grid; place-items: center; }
.choice.on .radio { box-shadow: inset 0 0 0 2px var(--primary); }
.choice.on .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

/* laporan */
.bento { display: grid; gap: var(--space-3); padding: 0 var(--space-4); grid-template-columns: repeat(2, 1fr); }
.bento > * { min-width: 0; }
.span-2 { grid-column: span 2; }
.hero-num { padding: var(--space-4-5); border-radius: var(--r-lg); background: var(--ink); color: var(--bg); display: flex; flex-direction: column; align-items: flex-start; }
.hero-num .target { margin-top: auto; padding-top: var(--space-4-5); width: 100%; font-size: var(--text-sm); font-weight: var(--weight-bold); color: color-mix(in srgb, var(--bg) 75%, var(--ink)); }
.hero-num .target .meter { background: color-mix(in srgb, var(--bg) 18%, var(--ink)); }
.hero-num .lbl { font-size: var(--text-base); font-weight: var(--weight-label); color: color-mix(in srgb, var(--bg) 75%, var(--ink)); }
.hero-num .amt { max-width: 100%; overflow-wrap: anywhere; font-size: var(--text-5xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tightest); line-height: var(--leading-snug); margin-top: var(--space-0-5); }
.delta { display: inline-flex; align-items: center; gap: var(--space-1); margin-top: var(--space-2-5); padding: var(--space-1) var(--space-2); border-radius: var(--radius-2); font-size: var(--text-sm); font-weight: var(--weight-heavy); background: var(--success-soft); color: var(--success); }
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.kpi { padding: var(--space-4); }
.kpi .lbl { font-size: var(--text-sm); font-weight: var(--weight-label); color: var(--text-3); }
.kpi .v { font-size: var(--text-xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tight); margin-top: var(--space-0-5); }
.kpi .s { font-size: var(--text-xs); font-weight: var(--weight-label); color: var(--text-3); }
.chart { padding: var(--space-4); }
.chart .head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-3); }
.chart .head b { font-size: var(--text-md); }
.chart .head span { font-size: var(--text-sm); color: var(--text-3); font-weight: var(--weight-medium); }
.bars { display: flex; align-items: flex-end; gap: var(--space-2); height: 132px; }
.bars div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: var(--space-1-5); }
.bars i { display: block; width: 100%; max-width: 36px; border-radius: var(--radius-2) var(--radius-2) var(--radius-1) var(--radius-1); background: var(--surface-3); }
.bars .today i { background: var(--primary); }
.bars small { font-size: var(--text-xs); color: var(--text-3); font-weight: var(--weight-label); }
.meter { height: 8px; border-radius: var(--radius-1); background: var(--surface-2); overflow: hidden; margin-top: var(--space-1-5); }
.meter i { display: block; height: 100%; border-radius: var(--radius-1); background: var(--primary); }
.split-bar { display: flex; height: 12px; border-radius: var(--radius-1-5); overflow: hidden; gap: var(--space-0-75); margin: var(--space-1) 0 var(--space-3); }
.split-bar i { display: block; height: 100%; }
.legend { display: grid; gap: var(--space-2); }
.legend div { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); font-weight: var(--weight-medium); }
.legend em { width: 10px; height: 10px; border-radius: var(--radius-0-75); flex: none; }
.legend b { margin-left: auto; font-weight: var(--weight-heavy); }

/* pelanggan */
.profile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-1) var(--space-4) var(--space-4); }
.profile .av { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: var(--text-3xl); font-weight: var(--weight-heavy); }
.profile h2 { font-size: var(--text-3xl); font-weight: var(--weight-heavy); margin-top: var(--space-2-5); letter-spacing: var(--tracking-tight); }
.profile p { color: var(--text-3); font-size: var(--text-base); font-weight: var(--weight-medium); }
.debt { padding: var(--space-4); border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent); }
.debt .lbl { font-size: var(--text-base); font-weight: var(--weight-label); }
.debt .amt { font-size: var(--text-5xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tightest); }
.debt .s { font-size: var(--text-sm); font-weight: var(--weight-label); }
.timeline .cell .ico { border-radius: 50%; }

/* form produk */
.photo-pick { width: 112px; height: 112px; border-radius: var(--r-lg); display: grid; place-items: center; text-align: center; gap: var(--space-1); font-size: var(--text-sm); font-weight: var(--weight-bold); background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); color: var(--text-3); align-content: center; }
.photo-pick .ph { font-size: var(--text-4xl); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

/* shift */
.drawer-sum .cell { min-height: 48px; }
.drawer-sum .t { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-2); }
.drawer-sum .end { font-weight: var(--weight-heavy); }

/* printer */
.preview-wrap { padding: var(--space-4); border-radius: var(--r-lg); background: var(--surface-2); }
.preview-wrap .receipt { margin: 0 auto; }

/* lisensi */
.plans { display: grid; gap: var(--space-3); }
.plan { padding: var(--space-4); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); display: grid; gap: var(--space-1-5); align-content: start; min-width: 0; }
.plan > .u-flex { flex-wrap: wrap; }
.pro-examples .kv { flex-wrap: wrap; }
.pro-examples .kv > :last-child { margin-left: auto; text-align: right; }
.plan.cur { box-shadow: inset 0 0 0 2px var(--primary), var(--shadow-1); }
.plan h3 { font-size: var(--text-lg); font-weight: var(--weight-heavy); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.plan .price { font-size: var(--text-3xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tight); }
.plan .price small { font-size: var(--text-base); color: var(--text-3); font-weight: var(--weight-label); }
.plan ul { margin: var(--space-1) 0 0; padding: 0; list-style: none; display: grid; gap: var(--space-1-5); font-size: var(--text-base); color: var(--text-2); }
.plan li { display: flex; gap: var(--space-2); align-items: flex-start; }
.plan li .ph { color: var(--primary-ink); font-size: var(--text-lg); }
/* meteran bayar kalau laku */
.pro-meter { display: grid; gap: var(--space-2); }
.pro-meter-bar { height: 10px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.pro-meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.pro-meter.capped .pro-meter-fill { background: var(--success); }
.pro-meter-text { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text); }
.pro-examples { display: grid; gap: var(--space-2); margin-top: var(--space-2); padding: var(--space-3); border-radius: var(--r-md); background: var(--surface-2); }

/* tutorial */
.step { display: flex; gap: var(--space-3-5); padding: var(--space-4); }
.step + .step { box-shadow: inset 0 1px 0 var(--line); }
.step .n { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; font-weight: var(--weight-heavy); flex: none; font-size: var(--text-base); }
.step .n.done { background: var(--primary); color: var(--on-primary); }
.step b { display: block; font-size: var(--text-md); }
.step p { color: var(--text-2); font-size: var(--text-base); margin-top: var(--space-0-5); }
.illus { margin-top: var(--space-3); border-radius: var(--radius-3-5); background: var(--surface-2); height: 120px; display: grid; place-items: center; }
.illus .win { width: 72%; height: 78px; border-radius: var(--radius-2-5); background: var(--surface); box-shadow: var(--shadow-2); display: flex; flex-direction: column; overflow: hidden; }
.illus .win > i { height: 16px; background: var(--surface-3); display: block; }
.illus .win > div { flex: 1; display: flex; gap: var(--space-2); align-items: center; justify-content: center; font-size: var(--text-sm); font-weight: var(--weight-heavy); color: var(--primary-ink); }

/* desktop table */
.table { display: none; }

/* Tooltip: hover (mouse), fokus keyboard, tekan lama (sentuh) */
[data-tip] { position: relative; }
.tip {
  position: absolute; top: calc(100% + var(--space-1-5)); left: 50%;
  translate: -50% 0;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-2);
  background: var(--strong-bg); color: var(--strong-fg);
  font-size: var(--text-xs); font-weight: var(--weight-bold); white-space: nowrap;
  display: none; pointer-events: none; z-index: var(--z-tour);
}
@keyframes tipIn { from { opacity: 0; } }
[data-tip]:focus-visible .tip, [data-tip].long .tip { display: block; animation: tipIn var(--dur-fast) var(--ease-out); }

/* ========== Hover (hanya perangkat dengan mouse) ========== */
@media (hover: hover) and (pointer: fine) {
  [data-tip]:hover .tip { display: block; animation: tipIn var(--dur-fast) var(--ease-out) var(--dur-hint) backwards; }
  .chip:not(.on):hover, .icon-btn:hover, .pill-btn:hover, .btn.line:hover, .btn.soft:hover, .method:not([aria-selected="true"]):not([aria-pressed="true"]):hover { background: var(--surface-2); }
  .prod:hover { box-shadow: var(--shadow-2); }
  .prod.sel:hover { box-shadow: inset 0 0 0 2px var(--primary), var(--shadow-2); }
  .cell[role="button"]:hover, button.cell:hover { background: var(--surface-2); }
  .tab:not(.on):hover, .side-nav button:not(.on):hover { background: var(--surface-2); }
  .key:hover { background: var(--surface-2); }
  .btn.primary:hover { background: var(--primary-press); }
  .choice:hover, .opt:hover { box-shadow: var(--shadow-2); }
  .choice.on:hover { box-shadow: inset 0 0 0 2px var(--primary), var(--shadow-2); }
}

/* ========== Tablet & desktop (container) ========== */
@container app (min-width: 720px) {
  .tabbar, .cartbar, .tab-space { display: none !important; }
  .sidebar {
    display: flex; flex-direction: column; gap: var(--space-2);
    width: 92px; flex: none;
    padding: var(--space-4) var(--space-2-5);
    background: var(--bg-elev);
    box-shadow: inset -1px 0 0 var(--line);
  }
  .sidebar .wordmark { justify-content: center; padding: var(--space-1) 0 var(--space-3-5); }
  .sidebar .wordmark .wordmark-type { display: none; }
  .side-nav { display: grid; gap: var(--space-2); }
  .side-nav button {
    display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
    padding: var(--space-2-5) var(--space-1); border-radius: var(--radius-4);
    font-size: var(--text-xs); font-weight: var(--weight-label); color: var(--text-2);
  }
  .side-nav button .ph, .side-nav button .ph-fill { font-size: var(--text-2xl); }
  .side-nav button.on { background: var(--primary-soft); color: var(--primary-ink); font-weight: var(--weight-active); }
  .side-foot { margin-top: auto; display: grid; gap: var(--space-2); justify-items: center; }
  .side-foot .me { display: none; }
  .side-foot .only-rail { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-1-5) var(--space-1); border-radius: var(--radius-4); font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--text-2); }
  .side-foot .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: var(--weight-heavy); font-size: var(--text-base); }

  .kasir .scroll { padding-bottom: var(--space-4); }
  .cartpanel {
    display: flex; flex-direction: column;
    width: 360px; flex: none;
    background: var(--bg-elev);
    box-shadow: inset 1px 0 0 var(--line);
  }
  .cartpanel .sheet-head { padding-top: var(--space-4-5); }
  .cartpanel .sheet-body { flex: 1; }
  .ov-cart { display: none !important; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  /* sheet & layar penuh → dialog di tengah */
  .overlay .sheet, .overlay .fullscreen.dialog {
    left: 50%; top: 50%; right: auto; bottom: auto;
    width: min(520px, calc(100% - 48px));
    max-height: calc(100% - 48px);
    border-radius: var(--r-xl);
    translate: -50% -50%;
    animation: dialogIn var(--dur-move) var(--ease-out);
    box-shadow: var(--shadow-3);
  }
  .overlay .fullscreen.dialog { height: auto; background: var(--bg-elev); }
  .overlay .fullscreen.dialog .scroll { flex: 0 1 auto; }
  .overlay .sheet .grab { display: none; }

  .large-title { padding-top: var(--space-5-5); }
  .wrap, .chips, .large-title, .top { padding-left: var(--space-6); padding-right: var(--space-6); }
  .bento { padding: 0 var(--space-6); grid-template-columns: repeat(4, 1fr); }
  .bento .span-2 { grid-column: span 2; }
  .bento .span-4 { grid-column: span 4; }
  .bento .span-2-m { grid-column: span 2; }

  .center-col { width: 100%; max-width: var(--page); margin: 0 auto; }
  .split .wrap, .split .chips { padding-left: 0; padding-right: 0; }
  .split .section-label { padding-left: var(--space-1); }
  .overlay .methods { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .overlay .method { min-width: 0; padding: 0 var(--space-1); }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-5); padding: 0 var(--space-6); align-items: start; }
  .split > .wrap { padding: 0; }
  .detail-pane { display: block !important; position: sticky; top: 0; }
  .list-only { display: none; }
  .table { display: block; }
  .mobile-only { display: none !important; }
  .two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
  .screen > .top { width: 100%; max-width: var(--page); margin: 0 auto; }
  .screen.full > .top { max-width: none; }
  .wrap > .seg { max-width: 440px; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-5); padding: 0 var(--space-6); }
  .settings-grid .wrap { padding: 0; }
  .ob-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: center; max-width: 1040px; margin: 0 auto; padding: var(--space-8); flex: 1; }
  .ob-split .hero-art { height: 480px; margin: 0; }
  .ob-split .ob-body h1 { font-size: var(--text-7xl); }
  .ob-split .hero-art .r1 { right: 120px; top: var(--space-12); }
  .ob-split .hero-art .r3 { bottom: 120px; }
  .camera .viewfinder { margin-top: 8vh; }
}
@container app (min-width: 1100px) {
  .sidebar { width: 248px; padding: var(--space-5) var(--space-3-5); }
  .sidebar .wordmark { justify-content: flex-start; padding: var(--space-1) var(--space-2-5) var(--space-4-5); }
  .sidebar .wordmark .wordmark-type { display: block; }
  .side-nav button { flex-direction: row; gap: var(--space-3); padding: 0 var(--space-3-5); height: 48px; font-size: var(--text-base); }
  .side-foot { justify-items: stretch; }
  .side-foot .me { display: flex; align-items: center; gap: var(--space-2-5); padding: var(--space-2-5); border-radius: var(--radius-4); background: var(--surface); box-shadow: var(--shadow-1); }
  .side-foot .me b { display: block; font-size: var(--text-base); }
  .side-foot .me small { font-size: var(--text-xs); color: var(--text-3); font-weight: var(--weight-medium); }
  .side-foot .only-rail { display: none; }
  .cartpanel { width: 400px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
.detail-pane { display: none; }
.desk-only { display: none; }
@container app (min-width: 720px) { .desk-only { display: block; } }

/* tabel produk (desktop) */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.tbl th { text-align: left; font-size: var(--text-sm); font-weight: var(--weight-label); color: var(--text-3); padding: var(--space-3) var(--space-3-5); box-shadow: inset 0 -1px 0 var(--line); }
.tbl td { padding: var(--space-2-5) var(--space-3-5); box-shadow: inset 0 -1px 0 var(--line); vertical-align: middle; }
.tbl tr:last-child td { box-shadow: none; }
.tbl .pn { display: flex; align-items: center; gap: var(--space-3); font-weight: var(--weight-bold); }
.tbl .pn small { display: block; font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-3); font-variant-numeric: tabular-nums; }
.tbl .r { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .screen.on, .sheet, .check, .fullscreen, .overlay .scrim, .viewfinder .laser { animation: fade var(--dur-base) ease; }
  .press:active, .key:active, .tab:active { transform: none; }
  .viewfinder .laser { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .tabbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

[role="dialog"]:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== Tambahan layar v3 ===== */
.prod.manual { background: transparent !important; box-shadow: inset 0 0 0 2px var(--line-strong); color: var(--text-2) !important; }
.prod.manual .name { color: var(--text); }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.choice-tile { min-height: 76px; padding: var(--space-3); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-1-5); font-size: var(--text-base); font-weight: var(--weight-bold); text-align: left; }
.choice-tile .ph { font-size: var(--text-3xl); color: var(--text-2); }
.choice-tile.on { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.choice-tile.on .ph { color: var(--primary-ink); }
.cbox { width: 24px; height: 24px; border-radius: var(--radius-2); flex: none; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--line-strong); color: var(--on-primary); }
.cbox .ph-bold { font-size: var(--text-base); }
[aria-checked="true"] > .cbox { background: var(--primary); box-shadow: none; }
.tbl tr.bad td { background: color-mix(in srgb, var(--danger-soft) 55%, transparent); }
.code { display: flex; gap: var(--space-2); justify-content: center; margin: var(--space-1) 0; }
.code span { width: 46px; height: 58px; border-radius: var(--radius-3-5); background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); display: grid; place-items: center; font-size: var(--text-3xl); font-weight: var(--weight-heavy); }
.code span.cur { box-shadow: inset 0 0 0 2px var(--primary); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2-5); }
.help { min-height: 120px; padding: var(--space-3-5); border-radius: var(--r-lg); display: flex; flex-direction: column; gap: var(--space-1); text-align: left; background: var(--surface) !important; color: var(--text) !important; box-shadow: var(--shadow-1); }
.help .ph { font-size: var(--text-2xl); margin-bottom: auto; width: 40px; height: 40px; border-radius: var(--radius-3); display: grid; place-items: center; background: var(--tb); color: var(--tf); }
.help b { font-size: var(--text-base); font-weight: var(--weight-heavy); padding-top: var(--space-3); }
.help span { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-3); }
.coach-card { position: absolute; left: var(--space-4); right: var(--space-4); bottom: calc(var(--space-42) + var(--safe-b)); margin: 0 auto; max-width: 400px; padding: var(--space-4); border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-3); display: grid; gap: var(--space-2); justify-items: start; pointer-events: auto; animation: dialogIn var(--dur-move) var(--ease-out); }
.coach-card h2 { font-size: var(--text-lg); font-weight: var(--weight-heavy); }
.coach-card p { font-size: var(--text-base); color: var(--text-2); }
.coach-card .row-actions { width: 100%; padding-top: var(--space-1); }
.methods-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); padding: 0 var(--space-4) var(--space-3); }
.methods-grid .method { min-width: 0; height: 56px; }
@container app (min-width: 720px) {
  .coach-card { bottom: var(--space-8); }
  .help-grid { grid-template-columns: repeat(3, 1fr); }
  .type-grid { grid-template-columns: repeat(4, 1fr); }
  .overlay .methods-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@container app (min-width: 720px) and (max-width: 1099px) {
  .cartpanel { width: 300px; }
  .cartpanel .sheet-head h2 .muted { display: none; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: var(--space-2); }
  .prod { min-height: 120px; padding: var(--space-2-5); }
  .prod .ico { font-size: var(--text-5xl); }
  .pgrid .prod { --thumb: var(--thumb-tile-sm); }
}

/* ===== Komponen app (M1) ===== */
.drag-zone, .sheet .sheet-head { touch-action: none; }
.drag-zone { cursor: grab; padding-bottom: var(--space-0-5); }
.overlay.closing .scrim { opacity: 0; transition: opacity var(--dur-base) ease; }
.overlay.closing .sheet { transform: translateY(100%); transition: transform var(--dur-sheet-exit) var(--ease-sheet); }
.overlay.closing .fullscreen { opacity: 0; transition: opacity var(--dur-exit) ease; }
.sheet { transition: transform var(--dur-slow) var(--ease-sheet); }
.stepper .step-btn { width: 40px; height: 40px; border-radius: var(--radius-3); background: transparent; box-shadow: none; }
.stepper .step-btn:disabled { opacity: .35; }
.empty { display: grid; justify-items: center; text-align: center; gap: var(--space-1-5); padding: var(--space-12) var(--space-6); }
/* kosong-state: potongan struk (tepi bawah sobek) */
.empty .empty-ico { width: 64px; height: 68px; padding-bottom: var(--tear-size); border-radius: var(--radius-5) var(--radius-5) 0 0; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-3); margin-bottom: var(--space-2); -webkit-mask: var(--tear-mask); mask: var(--tear-mask); }
:root[data-theme="dark"] .empty .empty-ico { background: var(--surface-3); } /* di atas panel gelap gerigi tetap terlihat */
.empty .empty-ico .ph { font-size: var(--text-4xl); }
.empty b { font-size: var(--text-lg); font-weight: var(--weight-heavy); }
.empty p { color: var(--text-3); font-size: var(--text-base); max-width: 320px; margin-bottom: var(--space-2-5); }
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--space-3) + var(--safe-t)); z-index: var(--z-toast); display: grid; justify-items: center; gap: var(--space-2); pointer-events: none; padding: 0 var(--space-4); }
.toast { display: inline-flex; align-items: center; gap: var(--space-2); max-width: 420px; padding: var(--space-2-5) var(--space-4); border-radius: var(--r-full); background: var(--strong-bg); color: var(--strong-fg); font-size: var(--text-base); font-weight: var(--weight-bold); box-shadow: var(--shadow-3); transition: opacity var(--dur-exit) ease, transform var(--dur-exit) var(--ease-out); animation: toastIn var(--dur-enter) var(--ease-out); }
.toast .ph-fill { font-size: var(--text-lg); }
.toast.ok .ph-fill { color: var(--success); }
.toast.warn .ph-fill { color: var(--accent); }
.toast.error .ph-fill { color: var(--danger); }
.toast.leaving { opacity: 0; transform: translateY(-100%); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-100%); } }
:root[data-theme="dark"] .toast.ok .ph-fill { color: var(--on-ink-success); }
input[type="search"]::-webkit-search-cancel-button { display: none; }
.app .main > .screen { flex: 1; }
@media (prefers-reduced-motion: reduce) {
  .toast { animation: fade var(--dur-base) ease; }
  .toast.leaving { transform: none; }
  .overlay.closing .sheet { transform: none; opacity: 0; transition: opacity var(--dur-exit) ease; }
}
@container app (min-width: 720px) {
  .overlay.closing .sheet { transform: none !important; opacity: 0; scale: .96; transition: opacity var(--dur-exit) ease, scale var(--dur-exit) var(--ease-out); }
  .overlay.closing .fullscreen.dialog { scale: .96; transition: opacity var(--dur-exit) ease, scale var(--dur-exit) var(--ease-out); }
}

/* ===== Produk (M2) ===== */
.thumb.photo { object-fit: contain; display: block; background: var(--paper-white); outline: 1px solid var(--line); outline-offset: -1px; }
.photo-pick { flex: none; overflow: hidden; }
.photo-pick.has { padding: 0; box-shadow: var(--shadow-1); }
.tone-row { display: flex; gap: var(--space-2-5); flex-wrap: wrap; }
.tone-dot { width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
.tone-dot.on { box-shadow: 0 0 0 3px var(--bg-elev), 0 0 0 5px var(--primary); }
.icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-2); }
.icon-pick { height: 48px; border-radius: var(--radius-3-5); display: grid; place-items: center; }
.icon-pick .ph { font-size: var(--text-2xl); }
.icon-pick.on { box-shadow: inset 0 0 0 2px currentColor; }
.opt-edit { display: flex; gap: var(--space-2); align-items: center; }
.opt-edit .input { height: 48px; }
.opt-edit .input.price { width: 130px; flex: none; }
.cell.add-row .t { color: var(--primary-ink); }
.cell.add-row .ico { background: var(--primary-soft); color: var(--primary-ink); }
.picked { color: var(--primary-ink); }
.row-link { display: flex; align-items: center; gap: var(--space-3); font-weight: var(--weight-bold); text-align: left; border-radius: var(--radius-2-5); }
.tbl .row-link small { display: block; font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-3); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .row-link:hover { color: var(--primary-ink); } }
.two-col { display: grid; gap: var(--space-4); }

/* ===== Pemindai (M3) ===== */
.camera { overflow: hidden; }
.camera-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera > :not(video) { position: relative; z-index: var(--z-raised); }
.camera .top { background: linear-gradient(var(--media-shade), transparent); }
.camera .foot { margin-top: auto; background: linear-gradient(transparent, var(--media-shade)); }
.scan-hint { text-shadow: 0 1px 3px var(--media-text-shadow); }
.scan-toast { margin-top: auto; animation: toastIn var(--dur-move) var(--ease-out); }
.scan-toast + .foot { margin-top: 0; }
.scan-toast .ok-mark { color: var(--on-ink-success); }
.scan-problem { margin: 12vh var(--space-6) 0; padding: var(--space-5); border-radius: var(--r-lg); background: var(--media-glass-soft); color: var(--media-fg); display: grid; justify-items: center; gap: var(--space-2-5); text-align: center; font-size: var(--text-base); font-weight: var(--weight-medium); }
.manual-code { display: flex; gap: var(--space-2); }
.manual-code .input { background: var(--paper-white); color: var(--paper-ink-strong); }
.manual-code .input input { color: var(--paper-ink-strong); }
@container app (min-width: 720px) {
  .overlay .dialog.scanner { height: min(680px, calc(100% - 48px)); }
}
.input .icon-btn.in-field { width: 40px; height: 40px; margin-right: calc(var(--space-2) * -1); }
.stock-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
/* HP sempit (≤380 px): "Stok masuk" satu baris penuh, dua tombol lain berdampingan */
@container app (max-width: 380px) { .stock-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stock-actions > :first-child { grid-column: 1 / -1; } }
.stock-actions .btn { padding: 0 var(--space-2-5); font-size: var(--text-base); }
.stock-num { font-size: var(--text-lg); }
.banner-act { background: transparent; color: inherit; }

/* ===== Stok (M3) ===== */
.in-item { padding: var(--space-3); display: grid; gap: var(--space-2-5); }
.in-head { display: flex; align-items: center; gap: var(--space-2-5); }
.in-head b { font-size: var(--text-md); }
.count-in { width: 84px; height: 44px; flex: none; padding: 0 var(--space-2-5); }
.count-in input { text-align: center; font-weight: var(--weight-heavy); }
.picker .group { max-height: none; }

/* ===== Label barcode (M3) ===== */
.lbl-item { box-sizing: border-box; padding: 2mm 3mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--paper-white); color: var(--print-ink); font-family: var(--font); overflow: hidden; }
.lbl-name { font-size: 9pt; font-weight: var(--weight-bold); line-height: var(--leading-snug); max-height: 2.3em; overflow: hidden; }
.lbl-price { font-size: 11pt; font-weight: var(--weight-heavy); margin-top: .5mm; }
.lbl-bar { width: 100%; height: 9mm; margin-top: 1mm; }
.lbl-bar svg { width: 100%; height: 100%; display: block; }
.lbl-code { font-family: var(--mono); font-size: 7pt; letter-spacing: var(--tracking-wider); }
.lbl-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(58mm, 1fr)); justify-items: center; gap: var(--space-2-5); padding: var(--space-3); border-radius: var(--r-lg); background: var(--surface-2); }
.lbl-preview.roll58 { grid-template-columns: 1fr; }
.lbl-preview .lbl-item { width: 58mm; height: 30mm; border-radius: var(--radius-1-5); box-shadow: var(--shadow-1); }
#print-root .lbl-item { height: 100%; }
#print-root { display: none; }
@media print {
  #app, .toasts { display: none !important; }
  #print-root { display: block; }
  html, body { background: var(--paper-white) !important; }
}
.stock-num + .d { margin-left: var(--space-0-75); }
.lbl-err { font-size: 7pt; color: var(--print-danger); font-weight: var(--weight-bold); display: grid; place-items: center; height: 100%; }

/* ===== Kasir (M4) ===== */
.cartbar { padding: 0 var(--space-2); gap: var(--space-2); }
.cartbar-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3); height: 100%; padding-left: var(--space-2); color: inherit; text-align: left; border-radius: var(--radius-3-5); }
.cartbar .go { flex: none; }
.line-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3); text-align: left; border-radius: var(--radius-3); }
.line-main .info { display: flex; flex-direction: column; }
.line .info .nm { font-weight: var(--weight-name); font-size: var(--text-md); }
.cart-lines .line .meta { font-size: var(--text-sm); color: var(--text-3); }
.btn-sq { width: 52px; height: 52px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: none; flex: none; }
.btn-sq.line { background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.keypad .icon-btn.key { width: auto; height: 56px; border-radius: var(--radius-3-5); background: transparent; box-shadow: none; }
.keypad .icon-btn.key .ph { font-size: var(--text-3xl); }
.qty-row { display: flex; align-items: center; gap: var(--space-3); }
.qty-row .t { font-weight: var(--weight-label); }
/* foto produk = thumbnail di pojok (pengganti ikon): kartu tetap terang & teks selalu terbaca */
.prod-photo { margin-left: auto; flex: none; width: var(--thumb, var(--thumb-tile)); height: var(--thumb, var(--thumb-tile)); object-fit: contain; padding: var(--space-0-5); border-radius: var(--radius-3); background: var(--paper-white); outline: 1px solid var(--line); outline-offset: -1px; }
.store-card { width: 100%; padding: var(--space-4); display: flex; gap: var(--space-3-5); align-items: center; text-align: left; }
/* Struk di layar (M33): selalu muat satu baris kertas penuh (58 mm = 32 kolom, 80 mm = 48 kolom). Kertas jadi container;
   huruf mengecil mengikuti lebar kertas yang tersedia (lebar 1 huruf mono ≈ 0,62 em), maksimal ukuran teks biasa. */
/* width 100%: container tidak boleh mengukur lebar dari isinya (di wadah grid kertas bisa kolaps jadi 0) */
.receipt { --cols: 32; container-type: inline-size; white-space: pre; overflow-x: auto; width: 100%; max-width: 340px; margin-left: auto; margin-right: auto; }
.receipt-80 > div { font-size: var(--text-2xs); } /* cadangan untuk browser tanpa cqi */
.receipt-80 { --cols: 48; max-width: 440px; padding-left: var(--space-3); padding-right: var(--space-3); }
.preview-wrap:has(.receipt-80) { padding-left: var(--space-2); padding-right: var(--space-2); }
.receipt > div { font-size: min(var(--text-xs), calc(100cqi / var(--cols) / 0.62)); }
.print-receipt { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 9pt; line-height: var(--leading-relaxed); white-space: pre; color: var(--print-ink); padding: 2mm 0; }
.print-receipt .brand-mark { display: flex; justify-content: center; margin-top: 1mm; }
.print-receipt .brand-mark svg { display: block; margin: 0 auto; }
.print-receipt.p58 { width: 58mm; }
.print-receipt.p80 { width: 80mm; font-size: 9pt; }
.print-receipt .b { font-weight: var(--weight-bold); }
a.btn { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .cartbar-open:hover { background: var(--veil-on-ink); } }
.row-actions > .icon-btn, .row-actions > .btn-sq { flex: none; }
.btn-sq { min-width: 52px; }
.btn-sq .ph { font-size: var(--text-2xl); }

/* ===== Pembayaran lanjutan (M5) ===== */
.receipt-logo { display: block; max-width: 45%; max-height: 64px; margin: 0 auto var(--space-2); filter: grayscale(1) contrast(1.4); }
.print-receipt .receipt-logo { max-width: 40mm; max-height: 20mm; }
.qr-card img { width: 100%; height: auto; display: block; border-radius: var(--radius-2); image-rendering: pixelated; }
.bank-card { padding: var(--space-3-5) var(--space-4); display: flex; align-items: center; gap: var(--space-3); }
.qris-setup .qr-card { margin: 0 auto; } /* judul panel tetap rata kiri seperti panel lain */
.printer-card { padding: var(--space-3-5); display: flex; gap: var(--space-3); align-items: center; }
.logo-row { display: flex; gap: var(--space-3-5); align-items: center; }
.logo-prev { width: 72px; height: 72px; border-radius: var(--radius-4); object-fit: contain; background: var(--paper-white); box-shadow: var(--shadow-1); flex: none; }
.logo-prev.is-empty { display: grid; place-items: center; background: var(--surface); color: var(--text-3); }
.logo-prev.is-empty .ph { font-size: var(--text-4xl); }
.bill-list { display: grid; gap: var(--space-2); }
.bill-row { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1-5) var(--space-1-5) var(--space-1-5) 0; }
.bill-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-1) var(--space-2) var(--space-3); text-align: left; border-radius: var(--radius-3-5); }
.bill-main .ico { width: 36px; height: 36px; border-radius: var(--radius-2-5); display: grid; place-items: center; flex: none; }
.bill-main .t { font-weight: var(--weight-name); }
.bill-main .d { font-size: var(--text-sm); color: var(--text-3); }
.wrap .received { margin: 0; }
.method[aria-pressed="true"] { background: var(--strong-bg); color: var(--strong-fg); box-shadow: none; font-weight: var(--weight-active); }
.cart-meta { display: flex; gap: var(--space-2); flex-wrap: wrap; padding-bottom: var(--space-1-5); }

/* riwayat transaksi */
.cell.sel-row { background: var(--primary-soft); }
.chip-sep { flex: none; width: 1px; align-self: stretch; margin: var(--space-1-5) var(--space-0-5); background: var(--line); }
@container app (min-width: 720px) and (max-width: 1099px) { .split { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-4); } }

/* PIN: label, galat, layar kunci */
.pin-label { margin-top: var(--space-5); font-weight: var(--weight-heavy); font-size: var(--text-lg); text-align: center; }
.pin-error { min-height: 20px; font-size: var(--text-base); font-weight: var(--weight-bold); color: var(--danger); text-align: center; }
.people { flex-wrap: wrap; }
.person .nm { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen.lock .pin { justify-content: center; }
.overlay .pin { padding-top: 0; }
.overlay .pin .key { height: 56px; width: 56px; }

/* laporan: grafik tren & metode (warna kategori tervalidasi, terang/gelap) */
.trend { position: relative; touch-action: pan-y; padding-top: var(--space-5); } /* ruang label angka maksimum: batang tidak menimpanya */
.trend .bars { gap: var(--space-0-5); height: 140px; border-bottom: 1px solid var(--line-strong); }
.trend .bars div { gap: 0; }
.trend .bars i { max-width: 28px; border-radius: var(--radius-1) var(--radius-1) 0 0; background: var(--primary); min-height: 0; }
.trend .bars div.on i { background: var(--primary-ink); }
.trend .axis { display: flex; gap: var(--space-0-5); margin-top: var(--space-1-5); }
.trend .axis small { flex: 1; text-align: center; font-size: var(--text-xs); color: var(--text-3); font-weight: var(--weight-label); white-space: nowrap; overflow: visible; }
.trend .ymax { position: absolute; top: 0; left: 0; font-size: var(--text-xs); font-weight: var(--weight-label); color: var(--text-3); }
.trend .gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.trend .tipbox { position: absolute; top: 0; transform: translateX(-50%); padding: var(--space-1-5) var(--space-2-5); border-radius: var(--radius-2-5); background: var(--strong-bg); color: var(--strong-fg); font-size: var(--text-sm); font-weight: var(--weight-bold); white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-2); z-index: var(--z-above); }
.trend .tipbox small { display: block; font-size: var(--text-xs); font-weight: var(--weight-medium); opacity: .8; }
.delta.down { background: var(--accent-soft); color: var(--accent); }
.delta.flat { background: color-mix(in srgb, var(--bg) 18%, var(--ink)); color: var(--bg); }
.split-bar { gap: var(--space-0-5); }
.rank { display: grid; gap: var(--space-3); }
.rank .row { display: block; font-size: var(--text-base); font-weight: var(--weight-medium); }
.rank .row > div:first-child { display: flex; gap: var(--space-2); }
.rank .row b { margin-left: auto; font-weight: var(--weight-heavy); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.tbl th, .tbl td { padding: var(--space-2) var(--space-1); text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { font-size: var(--text-xs); color: var(--text-3); font-weight: var(--weight-label); }
.tbl .r { text-align: right; }

/* kode sambung server */
.code-input { font-size: var(--text-3xl) !important; letter-spacing: var(--tracking-pin); font-weight: var(--weight-heavy); text-align: center; }

/* langkah bernomor (pindah HP) */
.steps { display: grid; gap: var(--space-2-5); padding-left: var(--space-5-5); font-size: var(--text-base); color: var(--text-2); line-height: var(--leading-loose); }
.steps b { color: var(--text); }

/* wizard pertama kali */
.ob-col { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* tur layar kasir */
.tour { position: fixed; inset: 0; z-index: var(--z-tour); }
.tour-ring { position: fixed; top: 0; left: 0; border-radius: var(--radius-5); box-shadow: 0 0 0 4px var(--primary), 0 0 0 9999px var(--scrim-strong); transition: transform var(--dur-move) var(--ease-out); pointer-events: none; }
.tour-scrim { position: fixed; inset: 0; background: var(--scrim-strong); }
.tour-card { position: fixed; left: var(--space-4); right: var(--space-4); bottom: auto; }
@media (prefers-reduced-motion: reduce) {
  .tour-ring { transition: none; }
  .tour-card { animation: none; }
  .overlay .sheet, .overlay .fullscreen.dialog, .scan-toast { animation: fade var(--dur-base) ease; }
  .overlay.closing .sheet, .overlay.closing .fullscreen.dialog { scale: none; transform: none; }
}
/* angka sangat besar (miliaran) di kartu utama laporan */
.hero-num .amt.long { font-size: var(--text-3xl); }

/* pusat bantuan: tutorial bergambar */
.tut { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.tut-step { padding: var(--space-3-5); display: grid; gap: var(--space-3-5); }
.tut-art { border-radius: var(--r-md); background: var(--surface-2); padding: var(--space-4); display: grid; place-items: center; min-height: 168px; }
.tut-text { display: flex; gap: var(--space-3); align-items: flex-start; }
.tut-text b { font-size: var(--text-md); font-weight: var(--weight-heavy); display: block; }
.tut-text p { font-size: var(--text-base); color: var(--text-2); margin-top: var(--space-0-5); }
.tut-n { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: var(--weight-heavy); font-size: var(--text-base); flex: none; }
.art-phone { width: 172px; border-radius: var(--radius-5-5); background: var(--surface); box-shadow: var(--shadow-2), inset 0 0 0 2px var(--line-strong); padding: var(--space-2); display: grid; gap: var(--space-1-5); }
.art-desk { width: min(100%, 300px); border-radius: var(--radius-3); background: var(--surface); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line-strong); overflow: hidden; }
.art-bar { display: flex; align-items: center; gap: var(--space-1-5); padding: var(--space-1-5) var(--space-2-5); font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--text-3); background: var(--surface-2); border-radius: var(--radius-3-5); }
.art-desk .art-bar { border-radius: 0; }
.art-desk .art-bar > i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.art-desk .art-bar span { margin-left: var(--space-1-5); }
.art-url { flex: 1; }
.art-body { display: grid; gap: var(--space-2); padding: var(--space-2) var(--space-1-5) var(--space-2-5); }
.art-desk .art-body { padding: var(--space-3); }
.art-line { display: block; height: 8px; border-radius: var(--radius-1); background: var(--surface-3); }
.art-hi { display: flex; align-items: center; gap: var(--space-1-5); padding: var(--space-2) var(--space-2-5); border-radius: var(--radius-3); font-size: var(--text-xs); font-weight: var(--weight-heavy); color: var(--primary-ink); background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.art-hi .ph-bold { font-size: var(--text-md); }
.art-item, .art-file { display: flex; align-items: center; gap: var(--space-1-5); font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--text-2); }
.art-item .ph, .art-item .ph-fill, .art-file .ph { font-size: var(--text-md); }
.art-app { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-heavy); padding: var(--space-1-5) 0; }
.art-logo { display: inline-block; width: 28px; height: 28px; border-radius: var(--radius-2); background: var(--primary); }
.art-icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); padding: var(--space-1-5) 0; }
.art-icons span { aspect-ratio: 1; border-radius: var(--radius-2-5); background: var(--surface-3); display: grid; place-items: center; }
.art-icons span.on { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.art-cap { font-size: var(--text-xs); color: var(--text-2); font-weight: var(--weight-medium); text-align: center; }
.art-dock { display: flex; justify-content: space-around; align-items: center; padding-top: var(--space-4-5); }
.art-dock > span { width: 18px; height: 18px; border-radius: var(--radius-1); background: var(--surface-3); }
.art-row { display: flex; align-items: center; gap: var(--space-3-5); }
.art-printer { position: relative; width: 84px; height: 72px; border-radius: var(--radius-3-5); background: var(--surface); box-shadow: var(--shadow-2); display: grid; place-items: center; font-size: var(--text-6xl); color: var(--text-2); }
.art-led { position: absolute; right: var(--space-2-5); top: var(--space-2-5); width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.art-note { font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--text-2); max-width: 140px; }
.art-h { font-size: var(--text-base); font-weight: var(--weight-heavy); }
.art-code { font-size: var(--text-3xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-code); text-align: center; }
.art-code.sm { font-size: var(--text-lg); padding: var(--space-1-5); border-radius: var(--radius-2-5); background: var(--surface-2); }
.art-qr { width: 64px; height: 64px; margin: 0 auto; border-radius: var(--radius-1-5); background: repeating-conic-gradient(var(--text) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }
.art-term { display: block; font-family: var(--mono); font-size: var(--text-xs); line-height: var(--leading-mono); background: var(--terminal-bg); color: var(--terminal-fg); padding: var(--space-2-5); border-radius: var(--radius-2); }
.art-chips { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.art-chips span { font-size: var(--text-2xs); font-weight: var(--weight-heavy); padding: var(--space-1) var(--space-2); border-radius: var(--radius-2); background: var(--surface-2); color: var(--text-2); }
.art-chips span.on { background: var(--primary-soft); color: var(--primary-ink); box-shadow: inset 0 0 0 2px var(--primary); }
@container app (min-width: 720px) { .tut-step { grid-template-columns: 260px 1fr; align-items: center; } }

/* daftar panjang: muat bertahap */
.more { display: flex; justify-content: center; padding: var(--space-3) 0 var(--space-1); }

/* ========== Panel form berjudul (v2) ========== */
.panel { display: grid; gap: var(--space-3-5); }
.panel-h { display: flex; align-items: baseline; gap: var(--space-2); }
.panel-h b { font-size: var(--text-md); font-weight: var(--weight-heavy); }
.panel-h span { font-size: var(--text-sm); color: var(--text-3); font-weight: var(--weight-medium); }
.panel-h + * { margin-top: calc(var(--space-1) * -1); }
@container app (min-width: 720px) {
  .panel { padding: var(--space-5); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
  .panel .group { box-shadow: inset 0 0 0 1px var(--line); background: transparent; }
  .panel .field .input { background: var(--bg); }
  .form-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
}
.form-cols { display: grid; gap: var(--space-4); }
.form-cols > div { display: grid; gap: var(--space-4); align-content: start; }
.photo-row { display: flex; gap: var(--space-3-5); align-items: flex-end; }
.photo-row .field { flex: 1; min-width: 0; }

/* ========== Irama jarak (v2) ========== */
/* blok setelah kepala layar: jarak seragam 12px, chip tidak menempel ke cari/tab */
.large-title + .wrap, .top + .wrap { padding-top: var(--space-1); }
.wrap + .chips { padding-top: var(--space-3-5); }
.chips + .chips { padding-top: 0; }
.chips + .wrap, .chips + .scroll { margin-top: var(--space-0-5); }
.wrap > .seg + * { margin-top: var(--space-3); }
/* tombol berikon: ikon & teks sejajar optis */
.btn .ph, .btn .ph-bold, .btn .ph-fill { font-size: var(--text-xl); line-height: var(--leading-none); flex: none; }
.btn.sm .ph, .btn.sm .ph-bold, .btn.sm .ph-fill { font-size: var(--text-lg); }
.pill-btn .ph, .pill-btn .ph-bold { font-size: var(--text-md); line-height: var(--leading-none); }
/* kartu utama laporan di mode gelap: bukan kartu putih menyilaukan, tetap menonjol */
:root[data-theme="dark"] .hero-num { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
:root[data-theme="dark"] .hero-num .lbl, :root[data-theme="dark"] .hero-num .target { color: var(--text-3); }
:root[data-theme="dark"] .hero-num .target .meter { background: var(--surface-3); }
:root[data-theme="dark"] .delta.flat { background: var(--surface-3); color: var(--text); }

/* atribusi pembuat */
.credit { text-align: center; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-3); padding: var(--space-6) var(--space-4) var(--space-2); }
.credit a { color: var(--text-2); font-weight: var(--weight-heavy); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .credit a:hover { color: var(--primary-ink); text-decoration-color: currentColor; } }

/* ========== Komponen kecil (pengganti inline style, M14) ========== */
.icon-tile { width: 44px; height: 44px; border-radius: var(--radius-3-5); display: grid; place-items: center; font-size: var(--text-2xl); flex: none; }
.avatar-sm { width: var(--space-8); height: var(--space-8); border-radius: var(--radius-full); font-size: var(--text-sm); }
.amount-xl { font-size: var(--text-5xl); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-tight); }
.qr-card-sm { width: 200px; padding: var(--space-3); box-shadow: var(--shadow-1); }
.trend .gridline-top { top: var(--space-5); }
.trend .gridline-mid { top: calc(var(--space-5) + 70px); }
/* ilustrasi layar sambutan: tinggi batang contoh */
.hero-bars { height: 64px; margin-top: var(--space-2-5); }
.hero-bars > div:nth-child(1) i { height: 40%; }
.hero-bars > div:nth-child(2) i { height: 62%; }
.hero-bars > div:nth-child(3) i { height: 90%; }
.hero-bars > div:nth-child(4) i { height: 55%; }
.hero-bars > div:nth-child(5) i { height: 75%; }

.icon-btn.ink { background: var(--strong-bg); color: var(--strong-fg); }
.stepper.tall, .stepper.tall .step-btn { height: 52px; }

/* kalimat ringkasan promo (M30): dibaca pemilik sebelum menyimpan */
.promo-sentence { margin: 0; padding: var(--space-3-5) var(--space-4); border-radius: var(--r-md); background: var(--strong-bg); color: var(--strong-fg); font-size: var(--text-md); font-weight: var(--weight-medium); text-wrap: pretty; }

/* promo di keranjang (M30) */
.promo-row { align-items: center; }
.promo-row .grow { display: inline-flex; align-items: center; gap: var(--space-1-5); }
.free-line .pr { color: var(--success); font-weight: var(--weight-active); }
.free-qty { flex: none; min-width: var(--space-10); text-align: center; font-weight: var(--weight-label); color: var(--text-2); }

/* tarik untuk muat ulang (M31): isi ikut tertarik ke bawah, ikon muncul dari atas di celah yang terbuka.
   --ptr (px tarikan) & --ptr-turn (putaran ikon) diisi ui/pull-refresh.js; data-ptr hanya ada saat ditarik/memuat. */
.ptr { position: sticky; top: 0; height: 0; z-index: var(--z-sticky); display: flex; justify-content: center; pointer-events: none; }
.ptr-dot { width: var(--space-10); height: var(--space-10); border-radius: var(--r-full); display: grid; place-items: center; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); font-size: var(--text-lg);
  opacity: 0; transform: translateY(calc(var(--ptr, 0px) / 2 - var(--space-10) / 2)) rotate(var(--ptr-turn, 0deg)); }
.scroll[data-ptr] .ptr-dot { opacity: 1; }
.scroll[data-ptr] > :not(.ptr) { transform: translateY(var(--ptr, 0px)); }
.scroll[data-ptr="on"] > :not(.ptr), .scroll[data-ptr="on"] .ptr-dot { transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out); }
.scroll.ptr-ready .ptr-dot { color: var(--primary); }
.ptr-dot.spin i { animation: ptr-spin var(--dur-spin) linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .scroll[data-ptr="on"] > :not(.ptr), .scroll[data-ptr="on"] .ptr-dot { transition: none; } .ptr-dot.spin i { animation: none; } .ptr-dot.spin { opacity: .7; } }
