* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #efece6;
  background-image: repeating-linear-gradient(0deg, rgba(27,24,19,.014) 0 2px, transparent 2px 5px);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  color: #1b1813;
  -webkit-font-smoothing: antialiased;
}
a { color: #d63c1c; }
a:hover { color: #9e2b14; }
button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
input { font-family: inherit; }
input::placeholder { color: #a89e8e; }
input:focus, select:focus { outline: none; border-color: #d63c1c; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes slideUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }

#app { min-height: 100vh; }

/* ---------- generic press feedback ---------- */
.btn-sink:active { transform: translateY(1px); }
.btn-scale:active { transform: scale(.96); }
.btn-dim:active { background: #f0ede6; }
.btn-dimdark:active { background: #e6e1d2; }
.bill-btn:active { transform: translateY(2px); }
.coin-btn:active { transform: scale(.88); }
.color-pick:active { transform: scale(.92); }
.plain-btn:active { filter: brightness(.94); }

/* ---------- wizard ---------- */
.wizard-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 64px;
}
.wiz-head { text-align: center; margin-bottom: 26px; animation: fadeUp .5s ease both; }
.wiz-logo {
  width: 52px; height: 52px; border-radius: 13px;
  background: #d63c1c; color: #faf8f2;
  display: flex; align-items: center; justify-content: center;
  font: 900 25px 'Zen Old Mincho', serif;
  margin: 0 auto 14px;
  box-shadow: 0 4px 12px rgba(214,60,28,.35), inset 0 0 0 2px rgba(250,248,242,.3);
}
.wiz-title { font: 900 26px 'Zen Old Mincho', serif; letter-spacing: .05em; }
.wiz-hint { font-size: 13px; color: #6e675c; margin-top: 5px; }
.dots { display: flex; gap: 8px; margin-bottom: 22px; }
.dot { width: 30px; height: 4px; border-radius: 2px; }
.wiz-card {
  width: 100%; max-width: 540px;
  background: #ffffff;
  border: 1.5px solid #1b1813;
  border-radius: 14px;
  box-shadow: 5px 5px 0 rgba(27,24,19,.12);
  padding: 26px 28px 28px;
  animation: fadeUp .5s .08s ease both;
}
.field-label {
  display: block; font-size: 12px; font-weight: 700; color: #6e675c;
  letter-spacing: .08em; margin: 4px 0 7px;
}
.field-label.top { margin-top: 20px; }
.field {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid rgba(27,24,19,.3); border-radius: 9px;
  font-size: 15px; background: #fff; color: #1b1813;
}
.field.small { padding: 11px 12px; font-size: 14px; border-radius: 8px; }
.float-hint { font-size: 11.5px; color: #a89e8e; margin-bottom: 9px; }
.float-box { border: 1.5px solid rgba(27,24,19,.25); border-radius: 10px; padding: 2px 14px; background: #fff; }
.fr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px dashed rgba(27,24,19,.15);
}
.fr-row:last-child { border-bottom: none; }
.bill-mini {
  width: 44px; height: 23px; border-radius: 3px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font: 900 10px 'Zen Old Mincho', serif;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), inset 0 0 0 3px rgba(255,255,255,.18);
}
.coin-mini {
  width: 23px; height: 23px; border-radius: 50%; flex: none; margin: 0 10.5px;
  display: flex; align-items: center; justify-content: center;
  font: 900 8.5px 'Zen Old Mincho', serif;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.7), inset 0 -1px 2px rgba(0,0,0,.22);
}
.fr-label { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.fr-spacer { flex: 1; }
.btn-step {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1.5px solid rgba(27,24,19,.35); background: #ffffff;
  cursor: pointer; font-size: 15px; color: #57503f;
}
.btn-step10 {
  height: 30px; border-radius: 8px;
  border: 1.5px solid rgba(27,24,19,.35); background: #ffffff;
  cursor: pointer; font-size: 12px; font-weight: 700; padding: 0 9px; color: #57503f;
}
.fr-n { width: 28px; text-align: center; font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; }
.fr-sub { width: 76px; text-align: right; font-size: 12.5px; color: #6e675c; font-variant-numeric: tabular-nums; }
.float-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 10px; padding: 0 2px;
}
.float-total span:first-child { font-size: 12px; font-weight: 700; color: #6e675c; letter-spacing: .08em; }
.float-total b { font: 900 22px 'Zen Old Mincho', serif; font-variant-numeric: tabular-nums; }

.btn-primary {
  width: 100%; margin-top: 26px; border: none; border-radius: 11px;
  padding: 15px; font-size: 15px; font-weight: 900; letter-spacing: .14em;
  cursor: pointer;
}
.btn-primary:disabled { cursor: default; }
.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.btn-row .btn-back {
  flex: 1; border: 1.5px solid rgba(27,24,19,.3); background: #fff;
  border-radius: 11px; padding: 14px; font-size: 14px; font-weight: 700;
  cursor: pointer; color: #6e675c;
}
.btn-row .btn-next {
  flex: 2; border: none; border-radius: 11px; padding: 14px;
  font-size: 15px; font-weight: 900; letter-spacing: .12em; cursor: pointer;
}
.btn-row .btn-next:disabled { cursor: default; }

.wiz-step-title { font: 700 16px 'Zen Old Mincho', serif; margin-bottom: 13px; }
.prod-form-row { display: flex; gap: 10px; }
.prod-form-row > div { min-width: 0; }
.prod-form-row .f-16 { flex: 1.6; }
.prod-form-row .f-10 { flex: 1; }
.prod-form-row .f-08 { flex: .8; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.chip {
  border: 1px solid rgba(27,24,19,.3); background: #f0ede6; color: #57503f;
  border-radius: 14px; padding: 5px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; font-variant-numeric: tabular-nums;
}
.add-row { display: flex; gap: 10px; margin-top: 13px; align-items: center; }
.img-pick {
  width: 44px; height: 44px; border-radius: 9px; overflow: hidden; flex: none;
  cursor: pointer; background: repeating-linear-gradient(45deg,#eeeae0 0 7px,#e3ddce 7px 14px);
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed rgba(27,24,19,.35); position: relative;
}
.img-pick img, .img-pick .bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-pick span { font: 700 9px ui-monospace, monospace; color: #9a9182; }
.add-btn {
  flex: 1; border: none; border-radius: 9px; padding: 13px;
  font-size: 14px; font-weight: 900; letter-spacing: .1em; cursor: pointer;
}
.add-btn:disabled { cursor: default; }
.prod-list { margin-top: 16px; border-top: 1.5px solid rgba(27,24,19,.18); max-height: 240px; overflow: auto; }
.prod-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed rgba(27,24,19,.2);
}
.prod-row .img-pick { width: 40px; height: 40px; border-radius: 8px; }
.prod-row .pr-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-row .pr-meta { font-size: 11.5px; color: #6e675c; }
.prod-row .pr-main { flex: 1; min-width: 0; }
.prod-row .pr-price { font: 700 15px 'Zen Old Mincho', serif; font-variant-numeric: tabular-nums; }
.remove-btn { border: none; background: none; color: #a89e8e; cursor: pointer; font-size: 17px; padding: 4px 6px; }
.sample-link { border: none; background: none; color: #d63c1c; font-size: 12.5px; font-weight: 700; cursor: pointer; margin-top: 10px; padding: 4px 0; text-decoration: underline; }
.save-back {
  width: 100%; margin-top: 18px; border: none; border-radius: 11px; padding: 15px;
  font-size: 15px; font-weight: 900; letter-spacing: .12em; cursor: pointer;
  background: #1b1813; color: #faf8f2;
}

/* ---------- app shell ---------- */
.app { display: flex; flex-direction: column; height: 100vh; }
.hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: #ffffff;
  border-bottom: 1.5px solid rgba(27,24,19,.22);
  z-index: 40; flex-wrap: wrap; flex: none;
}
.hdr-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.logo {
  width: 30px; height: 30px; border-radius: 8px; background: #d63c1c; color: #faf8f2;
  display: flex; align-items: center; justify-content: center;
  font: 900 15px 'Zen Old Mincho', serif; flex: none;
  box-shadow: inset 0 0 0 1.5px rgba(250,248,242,.3);
}
.hdr-title { min-width: 0; }
.proj-name { font: 700 13.5px 'Zen Old Mincho', serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.offline { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; color: #1e7a4e; }
.offline .dot { width: 6px; height: 6px; border-radius: 50%; background: #1e7a4e; display: inline-block; margin: 0; }
.tabs { display: flex; gap: 3px; background: #e8e4db; border-radius: 10px; padding: 3px; margin: 0 auto; }
.tab {
  border: none; cursor: pointer; padding: 7px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 700; background: rgba(0,0,0,0); color: #6e675c;
}
.tab.on { background: #ffffff; color: #1b1813; box-shadow: 0 1px 3px rgba(27,24,19,.2); }
.hdr-actions { display: flex; align-items: center; gap: 7px; }
.hdr-btn {
  border: 1.5px solid rgba(27,24,19,.3); background: #fff; border-radius: 8px;
  padding: 7px 12px; font-size: 12px; font-weight: 700; cursor: pointer; color: #57503f;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; flex: none;
  box-shadow: 0 2px 5px rgba(27,24,19,.25);
}
.app-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.screen-register .app-body { overflow: hidden; }
body.screen-history .app-body, body.screen-stats .app-body { overflow: auto; }

/* ---------- register ---------- */
.reg { flex: 1; min-height: 0; display: flex; flex-direction: column; height: 100%; }
.grid-wrap { flex: 1; min-width: 0; min-height: 0; display: flex; }
.grid {
  flex: 1; min-height: 0; overflow: auto; padding: 14px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: minmax(120px, 1fr); gap: 12px;
}
.prod-card {
  position: relative; display: flex; flex-direction: column; text-align: left;
  background: #ffffff; border: 1px solid rgba(27,24,19,.08); border-radius: 16px;
  padding: 0; cursor: pointer;
  box-shadow: 0 2px 3px rgba(27,24,19,.05), 0 10px 24px rgba(27,24,19,.07);
  overflow: hidden;
}
.prod-card:disabled { cursor: default; }
.tier { height: 6px; flex: none; }
.card-img { flex: 1; min-height: 0; background-size: cover; background-position: center; }
.card-ph { flex: 1; min-height: 0; background: #f0ede6; display: flex; align-items: center; justify-content: center; font: 900 44px 'Zen Old Mincho', serif; }
.card-info { flex: none; width: 100%; padding: 9px 13px 11px; }
.card-name { font-size: 13.5px; font-weight: 700; line-height: 1.32; max-height: 36px; overflow: hidden; }
.card-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 3px; }
.card-price { font: 900 24px 'Zen Old Mincho', serif; font-variant-numeric: tabular-nums; color: #1b1813; line-height: 1.1; }
.card-remain { font-size: 10.5px; font-weight: 700; color: #a89e8e; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty-badge {
  position: absolute; top: 12px; right: 10px; min-width: 30px; height: 30px; border-radius: 15px;
  background: #d63c1c; color: #faf8f2; font-size: 15px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; padding: 0 9px;
  box-shadow: 0 3px 8px rgba(214,60,28,.5); animation: popIn .18s ease;
}
.soldout {
  position: absolute; inset: 0; background: rgba(239,236,230,.82);
  display: flex; align-items: center; justify-content: center;
  font: 900 16px 'Zen Old Mincho', serif; color: #d63c1c; letter-spacing: .25em;
}

.pan {
  width: auto; flex: none; display: flex; flex-direction: column; min-height: 0;
  max-height: 64vh; overflow: auto; background: #171410;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -18px 44px rgba(27,24,19,.35);
  position: relative; z-index: 20;
}
.pan-head {
  padding: 13px 16px 6px; display: flex; align-items: center;
  justify-content: space-between; flex: none;
}
.pan-title { font-size: 11px; font-weight: 700; color: rgba(250,248,242,.5); letter-spacing: .14em; white-space: nowrap; }
.pan-count { color: rgba(250,248,242,.35); font-weight: 500; }
.clear-cart { border: none; background: none; color: #f0704a; font-size: 11px; font-weight: 700; cursor: pointer; padding: 2px 0; text-decoration: underline; }
.pan-items { flex: 1 1 auto; min-height: 64px; overflow: auto; padding: 2px 12px 10px; }
.cart-empty { text-align: center; color: rgba(250,248,242,.35); font-size: 12.5px; padding: 22px 0 24px; }
.cart-item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.06); border-radius: 12px; padding: 7px 9px; margin-bottom: 8px;
}
.ci-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; color: #faf8f2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-ctrl { display: flex; align-items: center; gap: 6px; }
.ci-btn {
  width: 34px; height: 34px; border-radius: 10px; border: none;
  background: rgba(255,255,255,.1); cursor: pointer; font-size: 17px; line-height: 1; color: #faf8f2;
}
.ci-btn:active { background: rgba(255,255,255,.22); }
.ci-qty { width: 24px; text-align: center; font-weight: 900; font-size: 15px; color: #faf8f2; font-variant-numeric: tabular-nums; }
.ci-sub { width: 76px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; color: #faf8f2; }
.pan-foot {
  flex: none; position: sticky; bottom: 0; z-index: 6; background: #171410;
  border-top: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 -16px 28px rgba(23,20,16,.55); padding: 13px 14px 14px;
}
.total-row { display: flex; align-items: baseline; justify-content: space-between; }
.total-row .t-label { font-size: 12px; font-weight: 700; letter-spacing: .3em; color: rgba(250,248,242,.55); }
.total-row .t-val { font: 900 40px 'Zen Old Mincho', serif; color: #f5b73e; font-variant-numeric: tabular-nums; line-height: 1.1; }
.recv-wrap { margin-top: 10px; }
.recv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.recv-row .r-label { font-size: 11px; font-weight: 700; color: rgba(250,248,242,.55); letter-spacing: .12em; }
.recv-row .r-val { font: 900 22px 'Zen Old Mincho', serif; color: #faf8f2; font-variant-numeric: tabular-nums; line-height: 1; }
.r-clear {
  border: 1.5px solid rgba(255,255,255,.28); background: transparent; border-radius: 7px;
  font-size: 11px; font-weight: 700; padding: 4px 10px; cursor: pointer; color: rgba(250,248,242,.7);
}
.r-clear:active { background: rgba(255,255,255,.12); }
.sug-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; align-items: center; }
.sug-label { font-size: 10.5px; font-weight: 700; color: rgba(250,248,242,.4); }
.sug-chip {
  border: none; border-radius: 17px; padding: 7px 14px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-variant-numeric: tabular-nums;
}
.sug-chip:active { transform: scale(.95); }
.denom-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.denom-chip {
  display: flex; align-items: center; gap: 5px; border: none;
  background: rgba(255,255,255,.09); border-radius: 15px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; color: #faf8f2; font-variant-numeric: tabular-nums;
}
.denom-chip:active { background: rgba(255,255,255,.18); }
.denom-chip .x { color: #f0704a; }
.bill-row { display: flex; gap: 8px; margin-top: 12px; }
.bill-btn { flex: 1; border: none; background: transparent; cursor: pointer; padding: 0; }
.bill-visual {
  position: relative; height: 50px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5), inset 0 0 0 5px rgba(255,255,255,.18), 0 2px 5px rgba(0,0,0,.4);
}
.bill-visual .corner { position: absolute; font-size: 8.5px; font-weight: 700; opacity: .75; font-variant-numeric: tabular-nums; }
.bill-visual .c-tl { left: 7px; top: 4px; }
.bill-visual .c-br { right: 7px; bottom: 4px; }
.bill-visual .wm { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.35); position: absolute; }
.bill-visual .txt { position: relative; font: 900 15px 'Zen Old Mincho', serif; }
.bill-visual .txt small { font-size: 10px; }
.coin-row { display: flex; gap: 9px; margin-top: 10px; align-items: center; }
.coin-btn { border: none; background: transparent; cursor: pointer; padding: 0; }
.coin-visual {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 900 11.5px 'Zen Old Mincho', serif;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.7), inset 0 -2px 3px rgba(0,0,0,.22), 0 2px 3px rgba(0,0,0,.35);
}
.pad-btn {
  margin-left: auto; border: 1.5px solid rgba(255,255,255,.28); background: transparent; color: #faf8f2;
  border-radius: 10px; padding: 9px 15px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.pad-btn:active { background: rgba(255,255,255,.12); }
.change-box { margin-top: 12px; border-radius: 14px; padding: 11px 16px 12px; transition: background .2s; }
.change-box .cb-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.change-box .cb-label { font-size: 11px; font-weight: 700; letter-spacing: .2em; opacity: .85; }
.change-box .cb-val { font: 900 34px 'Zen Old Mincho', serif; font-variant-numeric: tabular-nums; line-height: 1.1; }
.break-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.break-chip { background: rgba(255,255,255,.22); border-radius: 7px; padding: 4px 10px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-btn {
  width: 100%; margin-top: 12px; border: none; border-radius: 14px; padding: 17px;
  font-size: 17px; font-weight: 900; letter-spacing: .08em; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.pay-btn:disabled { cursor: default; }

@media (min-width: 980px) {
  .reg { flex-direction: row; }
  .pan { width: 400px; max-height: none; border-radius: 0; box-shadow: -18px 0 44px rgba(27,24,19,.22); }
}

/* ---------- history ---------- */
.hist-page { max-width: 760px; margin: 0 auto; padding: 18px 16px 60px; width: 100%; }
.filter-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chip {
  border: 1.5px solid rgba(27,24,19,.3); background: #fff; color: #57503f;
  border-radius: 16px; padding: 6px 14px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.filter-chip.on { border-color: #1b1813; background: #1b1813; color: #faf8f2; }
.filter-chip .fdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.hist-empty { text-align: center; color: #a89e8e; font-size: 14px; padding: 60px 0; }
.hist-row {
  background: #ffffff; border: 1.5px solid rgba(27,24,19,.25); border-radius: 12px;
  padding: 12px 15px; margin-bottom: 9px; box-shadow: 3px 3px 0 rgba(27,24,19,.07);
}
.hist-line { display: flex; align-items: center; gap: 10px; }
.h-avatar {
  width: 29px; height: 29px; border-radius: 50%; color: #fff;
  font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex: none;
}
.h-main { flex: 1; min-width: 0; }
.h-time-row { display: flex; align-items: center; gap: 8px; }
.h-time { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.void-badge { font-size: 10px; font-weight: 700; color: #d63c1c; border: 1px solid #d63c1c; border-radius: 5px; padding: 1px 6px; }
.h-items { font-size: 12px; color: #6e675c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.h-total { text-align: right; flex: none; }
.h-total .t { font: 700 16px 'Zen Old Mincho', serif; font-variant-numeric: tabular-nums; }
.h-total .f { font-size: 11px; color: #6e675c; font-variant-numeric: tabular-nums; }
.h-btn {
  border: 1.5px solid rgba(27,24,19,.3); background: #fff; border-radius: 8px;
  font-size: 11.5px; font-weight: 700; padding: 6px 11px; cursor: pointer; color: #6e675c; flex: none;
}
.h-btn:active { background: #f0ede6; }

/* ---------- stats ---------- */
.stats-page { max-width: 900px; margin: 0 auto; padding: 18px 16px 60px; width: 100%; }
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.stats-title { font: 900 17px 'Zen Old Mincho', serif; letter-spacing: .06em; }
.copy-btn {
  border: 1.5px solid #1b1813; background: #1b1813; color: #faf8f2;
  border-radius: 9px; padding: 8px 15px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.copy-btn:active { transform: translateY(1px); }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card { background: #ffffff; border: 1.5px solid rgba(27,24,19,.25); border-radius: 12px; padding: 13px 16px; box-shadow: 3px 3px 0 rgba(27,24,19,.07); }
.stat-card .s-label { font-size: 11px; font-weight: 700; color: #6e675c; letter-spacing: .08em; }
.stat-card .s-val { font: 900 24px 'Zen Old Mincho', serif; font-variant-numeric: tabular-nums; margin-top: 3px; }
.panel { background: #ffffff; border: 1.5px solid rgba(27,24,19,.25); border-radius: 12px; padding: 16px 18px; margin-top: 14px; box-shadow: 3px 3px 0 rgba(27,24,19,.07); }
.panel h3 { font: 700 14px 'Zen Old Mincho', serif; margin: 0; }
.bar-row { margin-top: 11px; }
.bar-meta { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; gap: 10px; }
.bar-meta .b-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-meta .b-val { color: #6e675c; font-variant-numeric: tabular-nums; flex: none; }
.bar-track { height: 10px; border-radius: 5px; background: #e8e4db; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #d63c1c, #e06a45); border-radius: 5px; }
.hour-chart { display: flex; align-items: flex-end; gap: 6px; height: 110px; margin-top: 14px; }
.hour-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.hour-col .n { font-size: 10px; color: #6e675c; font-weight: 700; }
.hour-col .bar { width: 100%; max-width: 34px; background: #1b1813; border-radius: 5px 5px 2px 2px; min-height: 2px; }
.hour-col .h { font-size: 10px; color: #a89e8e; }
.coin-chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.coin-chip { background: #f0ede6; border: 1px solid rgba(27,24,19,.2); border-radius: 9px; padding: 8px 12px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coin-chip .x { color: #d63c1c; }

/* ---------- overlays ---------- */
.overlay-back { position: fixed; inset: 0; background: rgba(18,15,11,.5); z-index: 80; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 420px; background: #ffffff;
  border: 1.5px solid #1b1813; border-bottom: none; border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.3); z-index: 81;
  padding: 18px 18px 24px; animation: slideUp .22s ease;
}
.sheet-title { font-size: 12px; font-weight: 700; color: #6e675c; letter-spacing: .12em; }
.sheet-amt { font: 900 36px 'Zen Old Mincho', serif; font-variant-numeric: tabular-nums; text-align: right; padding: 4px 4px 10px; border-bottom: 2px solid #1b1813; }
.pad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.pad-key { border: 1.5px solid rgba(27,24,19,.3); background: #fff; border-radius: 10px; padding: 14px 0; font-size: 19px; font-weight: 700; cursor: pointer; }
.pad-key:active { background: #f0ede6; }
.sheet-ok { width: 100%; margin-top: 12px; border: none; border-radius: 11px; padding: 14px; background: #1b1813; color: #faf8f2; font-size: 15px; font-weight: 900; letter-spacing: .12em; cursor: pointer; }
.sheet-ok:active { transform: translateY(1px); }
.share-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 440px); background: #ffffff; border: 1.5px solid #1b1813;
  border-radius: 16px; z-index: 81; padding: 24px; box-shadow: 6px 6px 0 rgba(27,24,19,.2);
  animation: popIn .18s ease;
}
.share-title { font: 700 17px 'Zen Old Mincho', serif; }
.share-hint { font-size: 12px; color: #6e675c; margin: 6px 0 13px; line-height: 1.7; }
.share-url-row { display: flex; gap: 8px; }
.share-url { flex: 1; padding: 12px 13px; background: #eeeae0; border-radius: 9px; font: 500 12.5px ui-monospace, monospace; color: #57503f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn2 { border: 1.5px solid #d63c1c; background: #fff; color: #d63c1c; border-radius: 8px; padding: 8px 15px; font-size: 12.5px; font-weight: 900; cursor: pointer; flex: none; }
.copy-btn2:active { background: #d63c1c; color: #fff; }
.members-label { font-size: 12px; font-weight: 700; color: #6e675c; letter-spacing: .08em; margin: 19px 0 8px; }
.member-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; }
.member-av { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.member-name { font-size: 13.5px; font-weight: 500; }
.member-tag { font-size: 11px; color: #a89e8e; }
.ov-screen {
  position: fixed; inset: 0; background: rgba(18,15,11,.96); z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; cursor: pointer; animation: popIn .2s ease;
}
.ov-label { font-size: 13px; font-weight: 700; color: rgba(250,248,242,.55); letter-spacing: .45em; }
.ov-amt { font: 900 min(19vw, 108px) 'Zen Old Mincho', serif; color: #faf8f2; font-variant-numeric: tabular-nums; line-height: 1.25; }
.ov-exact {
  width: 88px; height: 88px; border-radius: 50%; background: #d63c1c; color: #faf8f2;
  display: flex; align-items: center; justify-content: center;
  font: 900 42px 'Zen Old Mincho', serif; transform: rotate(-8deg);
  box-shadow: 0 0 0 4px rgba(214,60,28,.35), inset 0 0 0 3px rgba(250,248,242,.35);
  margin-top: 22px;
}
.ov-tokens { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.ov-token { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.ov-token .n { color: #faf8f2; font-size: 13.5px; font-weight: 900; font-variant-numeric: tabular-nums; }
.bill-token { width: 74px; height: 37px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font: 900 12.5px 'Zen Old Mincho', serif; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), inset 0 0 0 4px rgba(255,255,255,.18), 0 3px 6px rgba(0,0,0,.4); }
.coin-token { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 900 11px 'Zen Old Mincho', serif; box-shadow: inset 0 1px 2px rgba(255,255,255,.7), inset 0 -2px 3px rgba(0,0,0,.25), 0 3px 6px rgba(0,0,0,.4); }
.ov-done { margin-top: 44px; border: none; border-radius: 14px; background: #faf8f2; color: #1b1813; font-size: 16px; font-weight: 900; letter-spacing: .16em; padding: 16px 48px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.ov-done:active { transform: scale(.97); }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #1b1813; color: #faf8f2; border-radius: 20px; padding: 9px 20px;
  font-size: 13px; font-weight: 700; z-index: 95; animation: fadeUp .2s ease; white-space: nowrap;
}

@media (max-width: 640px) {
  .hdr { gap: 7px; }
  .tabs { order: 3; width: 100%; justify-content: center; margin: 2px 0 0; }
  .tab { flex: 1; }
  .proj-name { max-width: 120px; }
  .wizard-page { padding: 32px 14px 48px; }
  .wiz-card { padding: 22px 18px 24px; }
}
